forked from steeve/libtorrent-go
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcross_build.txt
215 lines (142 loc) · 6.99 KB
/
cross_build.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
brew install boost-build
Cross Compiling libtorrent-go
Windows
=======
```
export CROSSHOST=i586-mingw32
export CROSSHOME=/usr/local/gcc-4.8.0-mingw32
export PATH=$CROSSHOME/bin:$PATH
export PKG_CONFIG_LIBDIR=$CROSSHOME/lib/pkgconfig
export CFLAGS="-I$CROSSHOME/include -D_WIN32_WINNT=0x0501"
export CPPFLAGS=$CFLAGS
```
Boost
*****
```
./bootstrap.sh
echo "using gcc : mingw32 : $CROSSHOST-g++ ;" >! tools/build/v2/user-config.jam
./b2 -j2 --with-date_time --with-system --prefix=$CROSSHOME toolset=gcc-mingw32 link=static variant=release threading=multi target-os=windows threadapi=win32 install
```
OpenSSL
*******
```
CROSS_COMPILE=$CROSSHOST- ./configure threads no-shared mingw --prefix=$CROSSHOME
make clean && make && make install
```
libtorrent
**********
```
sed -i 's/$PKG_CONFIG openssl --libs-only-l/$PKG_CONFIG openssl --static --libs-only-l/' ./configure
./configure --host=$CROSSHOST --prefix=$CROSSHOME --with-boost=$CROSSHOME --with-boost-libdir=$CROSSHOME/lib --enable-static --disable-shared
make -j2 && make install
```
Linux x86
=========
```
export CROSSHOST=i586-x86_64-pc-linux
export CROSSHOME=/usr/local/gcc-4.8.0-linux64
export PKG_CONFIG_LIBDIR=$CROSSHOME/lib/pkgconfig
unset CFLAGS
unset CPPFLAGS
```
OpenSSL
*******
```
CROSS_COMPILE=$CROSSHOST- ./configure threads no-shared linux-x86 --prefix=$CROSSHOME
make clean && make && make install
```
libtorrent
**********
```
sed -i 's/$PKG_CONFIG openssl --libs-only-l/$PKG_CONFIG openssl --static --libs-only-l/' ./configure
./configure --host=$CROSSHOST --prefix=$CROSSHOME
```
Linux x86_64
============
```
export CROSSHOST=i586-x86_64-pc-linux
export CROSSHOME=/usr/local/gcc-4.8.0-linux64
export PKG_CONFIG_LIBDIR=$CROSSHOME/lib/pkgconfig
unset CFLAGS
unset CPPFLAGS
```
OpenSSL
*******
```
CROSS_COMPILE=$CROSSHOST- ./configure threads no-shared linux-x86_64 --prefix=$CROSSHOME
make clean && make && make install
```
libtorrent
**********
```
sed -i 's/$PKG_CONFIG openssl --libs-only-l/$PKG_CONFIG openssl --static --libs-only-l/' ./configure
./configure --host=$CROSSHOST --prefix=$CROSSHOME
```
OpenSSL
CROSS_COMPILE=i586-mingw32- ./configure threads no-shared mingw --prefix=/usr/local/gcc-4.8.0-mingw32
make clean && make && make install
CROSS_COMPILE=x86_64-pc-linux- ./configure threads no-shared linux-x86_64 --prefix=/usr/local/gcc-4.8.0-linux64
make clean && make && make install
CROSS_COMPILE=arm-linux-androideabi- ./configure threads no-shared linux-armv4 --prefix=/usr/local/gcc-4.8.0-arm-linux-androideabi
make clean && make && make install
Grab toolchain from http://www.carlson-minot.com/available-arm-gnu-linux-g-lite-builds-for-mac-os-x
export CROSSHOST=arm-linux-gnueabihf
export CROSSHOME=/usr/local/gcc-linaro-arm-linux-gnueabihf-raspbian
CROSS_COMPILE=$CROSSHOST- ./configure threads shared linux-elf --prefix=$CROSSHOME no-asm
make clean && make && make install
export CROSSHOST=arm-linux-androideabi
export CROSSHOME=/usr/local/gcc-4.8.0-arm-linux-androideabi
CROSS_COMPILE=$CROSSHOST- ./configure threads no-shared linux-elf --prefix=$CROSSHOME no-asm
make clean && make && make install
Boost:
./bootstrap.sh
echo "using gcc : mingw32 : i586-mingw32-g++ ;" >> tools/build/v2/user-config.jam
echo "using gcc : linux64 : x86_64-pc-linux-g++ ;" >> tools/build/v2/user-config.jam
echo "using gcc : linuxarm : $CROSSHOST-g++ ;" > tools/build/v2/user-config.jam
echo "using gcc : android : $CROSSHOST-g++ ;" > tools/build/v2/user-config.jam
b2 --with-date_time --with-system --prefix=/usr/local/gcc-4.8.0-mingw32 toolset=gcc-mingw32 link=shared variant=release threading=multi target-os=windows threadapi=win32 install
b2 --with-date_time --with-system --prefix=/usr/local/gcc-4.8.0-linux64 toolset=gcc-linux64 link=shared variant=release threading=multi target-os=linux install
b2 --with-date_time --with-system --prefix=$CROSSHOME toolset=gcc-linuxarm link=shared variant=release threading=multi target-os=linux install
b2 --with-date_time --with-system --prefix=$CROSSHOME toolset=gcc-mingw32 link=static variant=release threading=multi target-os=windows install
b2 --with-date_time --with-system --prefix=$CROSSHOME toolset=gcc-android link=static variant=release threading=multi target-os=linux install
Libtorrent:
echo "using gcc : mingw32 : i586-mingw32-g++ ;" > user-config.jam
echo "using gcc : linux64 : x86_64-pc-linux-g++ ;" >> user-config.jam
echo "using gcc : linuxarm : arm-none-linux-gnueabi-g++ ;" >> user-config.jam
echo "using gcc : android : $CROSSHOST-g++ ;" > user-config.jam
remove /usr/local/include from Jamfile
export CROSSHOME=/usr/local/gcc-4.8.0-mingw32
b2 -j4 -q --without-python toolset=gcc-mingw32 cxxflags="-w -I/usr/local/gcc-4.8.0-mingw32/include" search=/usr/local/gcc-4.8.0-mingw32/lib variant=release link=shared boost-link=shared encryption=openssl logging=none dht-support=on geoip=static pool-allocators=on deprecated-functions=on i2p=on iconv=off target-os=windows
find bin -name "*.dll*" -exec cp {} $CROSSHOME/lib \;
export CROSSHOME=/usr/local/gcc-4.8.0-linux64
b2 -q --without-python --prefix=$CROSSHOME toolset=gcc-linux64 cxxflags="-w -I$CROSSHOME/include" search=$CROSSHOME/lib variant=release link=shared boost-link=shared encryption=openssl logging=none dht-support=on geoip=static pool-allocators=on deprecated-functions=on i2p=on iconv=off target-os=linux install
echo "using gcc : linuxarm : $CROSSHOST-g++ ;" > user-config.jam
b2 -j4 -q --without-python --prefix=$CROSSHOME toolset=gcc-linuxarm cxxflags="-w -I$CROSSHOME/include" search=$CROSSHOME/lib variant=release link=shared boost-link=shared encryption=openssl logging=none dht-support=on geoip=static pool-allocators=on deprecated-functions=on i2p=on iconv=off target-os=linux
echo "using gcc : android : $CROSSHOST-g++ ;" > ~/user-config.jam
b2 -j4 -q --without-python --prefix=$CROSSHOME toolset=gcc-android cxxflags="-w -I$CROSSHOME/include" search=$CROSSHOME/lib variant=release link=shared boost-link=static encryption=openssl logging=none dht-support=on geoip=static pool-allocators=on deprecated-functions=on i2p=on iconv=off target-os=android
CPPFLAGS="-I$CROSSHOME/include -D_WIN32_WINNT=0x0501" \
./configure \
--host=$CROSSHOST \
--prefix=$CROSSHOME \
--with-boost-libdir=$CROSSHOME/lib
CPPFLAGS="-I$CROSSHOME/include" \
./configure \
--disable-pool-allocators \
--host=$CROSSHOST \
--prefix=$CROSSHOME \
--with-boost-libdir=$CROSSHOME/lib
CPPFLAGS="-I$CROSSHOME/include -DTORRENT_DEBUG_BUFFERS=1 -ggdb -fstack-protector-all" \
./configure \
--enable-debug \
--disable-pool-allocators \
--disable-shared \
--host=$CROSSHOST \
--prefix=$CROSSHOME \
--with-boost-libdir=$CROSSHOME/lib
zlib:
mingw32
CROSSHOME=/usr/local/gcc-4.8.0-mingw32 BINARY_PATH=$CROSSHOME/bin INCLUDE_PATH=$CROSSHOME/include LIBRARY_PATH=$CROSSHOME/lib make -f win32/Makefile.gcc install CC=i586-mingw32-gcc AR=i586-mingw32-ar RC=i586-mingw32-windres
linux64
CHOST=x86_64-pc-linux ./configure --static --prefix=/usr/local/gcc-4.8.0-linux64
make && make install
CHOST=$CROSSHOST ./configure --static --prefix=$CROSSHOME