4
4
5
5
export BUILDDIR=` pwd`
6
6
7
- NCPU=4
7
+ NCPU=8
8
8
uname -s | grep -i " linux" && NCPU=` cat /proc/cpuinfo | grep -c -i processor`
9
9
10
10
NDK=` which ndk-build`
@@ -17,7 +17,7 @@ for ARCH in armeabi armeabi-v7a arm64-v8a x86 x86_64; do
17
17
18
18
cd $BUILDDIR
19
19
20
- GCCPREFIX=" ` env CLANG= ./setCrossEnvironment-$ARCH .sh sh -c ' basename $CC | sed s/-gcc //' ` "
20
+ GCCPREFIX=" ` ./setCrossEnvironment-$ARCH .sh sh -c ' basename $STRIP | sed s/-strip //' ` "
21
21
echo " ARCH $ARCH GCCPREFIX $GCCPREFIX "
22
22
23
23
mkdir -p $ARCH
@@ -53,7 +53,9 @@ cd $BUILDDIR/$ARCH
53
53
cp -f $BUILDDIR /config.sub libcharset/build-aux/
54
54
cp -f $BUILDDIR /config.guess libcharset/build-aux/
55
55
56
- env CFLAGS=" -I$NDK /sources/android/support/include" \
56
+ sed -i ' s/MB_CUR_MAX/1/g' lib/loop_wchar.h
57
+
58
+ env CFLAGS=" -I$NDK /sources/android/support/include -D_IO_getc=getc" \
57
59
LDFLAGS=" -L$BUILDDIR /$ARCH -landroid_support" \
58
60
$BUILDDIR /setCrossEnvironment-$ARCH .sh \
59
61
./configure \
@@ -114,19 +116,29 @@ cd $BUILDDIR/$ARCH
114
116
cp -f $BUILDDIR /config.sub .
115
117
cp -f $BUILDDIR /config.guess .
116
118
119
+ sed -i ' s/ld_shlibs=no/ld_shlibs=yes/g' ./configure
120
+
117
121
env CFLAGS=" -I$NDK /sources/android/support/include -frtti -fexceptions -I$BUILDDIR /$ARCH /include" \
118
122
LDFLAGS=" -frtti -fexceptions -L$BUILDDIR /$ARCH /lib" \
119
- LIBS=" -L$BUILDDIR /$ARCH -landroid_support -lgnustl_static -lstdc++ -latomic " \
123
+ LIBS=" -L$BUILDDIR /$ARCH -landroid_support" \
120
124
$BUILDDIR /setCrossEnvironment-$ARCH .sh \
121
125
./configure \
122
126
--host=$GCCPREFIX \
123
127
--prefix=` pwd` /../ \
124
- --enable-static --disable -shared \
128
+ --enable-static --enable -shared \
125
129
--with-glib=no --with-gobject=no \
126
130
--with-cairo=no --with-fontconfig=no \
127
131
--with-icu=no --with-freetype=no \
128
132
|| exit 1
129
133
134
+ env PATH=` pwd` :$PATH \
135
+ $BUILDDIR /setCrossEnvironment-$ARCH .sh \
136
+ make -j$NCPU V=1 || echo " Crappy libtool cannot link anything"
137
+
138
+ env PATH=` pwd` :$PATH \
139
+ $BUILDDIR /setCrossEnvironment-$ARCH .sh \
140
+ sh -c ' $LD $CFLAGS $LDFLAGS -shared src/.libs/*.o src/hb-ucdn/.libs/*.o -o src/.libs/libharfbuzz.so' || exit 1
141
+
130
142
env PATH=` pwd` :$PATH \
131
143
$BUILDDIR /setCrossEnvironment-$ARCH .sh \
132
144
make -j$NCPU V=1 || exit 1
@@ -135,6 +147,10 @@ cd $BUILDDIR/$ARCH
135
147
$BUILDDIR /setCrossEnvironment-$ARCH .sh \
136
148
make V=1 install || exit 1
137
149
150
+ env PATH=` pwd` :$PATH \
151
+ $BUILDDIR /setCrossEnvironment-$ARCH .sh \
152
+ sh -c ' $AR rcs ../lib/libharfbuzz.a src/.libs/*.o src/hb-ucdn/.libs/*.o' || exit 1
153
+
138
154
cd ..
139
155
cp -f lib/libharfbuzz.a ./
140
156
}
@@ -165,9 +181,9 @@ cd $BUILDDIR/$ARCH
165
181
sed -i " s@LD_SONAME *=.*@LD_SONAME =@g" config/mh-linux
166
182
sed -i " s%ln -s *%cp -f \$ (dir \$ @)/%g" config/mh-linux
167
183
168
- env CFLAGS=" -I$NDK /sources/android/support/include -frtti -fexceptions -include $BUILDDIR /ndk-r15-64-bit-fix.h " \
184
+ env CFLAGS=" -I$NDK /sources/android/support/include -frtti -fexceptions" \
169
185
LDFLAGS=" -frtti -fexceptions -L$BUILDDIR /$ARCH /lib" \
170
- LIBS=" -L$BUILDDIR /$ARCH -landroid_support -lgnustl_static -lstdc++ -latomic " \
186
+ LIBS=" -L$BUILDDIR /$ARCH -landroid_support ` $BUILDDIR /setCrossEnvironment- $ARCH .sh sh -c ' echo $LDFLAGS ' ` " \
171
187
$BUILDDIR /setCrossEnvironment-$ARCH .sh \
172
188
./configure \
173
189
--host=$GCCPREFIX \
@@ -214,10 +230,12 @@ cd $BUILDDIR/$ARCH
214
230
cp -f $BUILDDIR /config.sub .
215
231
cp -f $BUILDDIR /config.guess .
216
232
233
+ sed -i ' s/ld_shlibs=no/ld_shlibs=yes/g' ./configure
234
+
217
235
env CFLAGS=" -I$NDK /sources/android/support/include -frtti -fexceptions" \
218
236
CXXFLAGS=" -std=c++11" \
219
237
LDFLAGS=" -frtti -fexceptions" \
220
- LIBS=" -L$BUILDDIR /$ARCH -landroid_support -lgnustl_static -lstdc++ -latomic " \
238
+ LIBS=" -L$BUILDDIR /$ARCH -landroid_support" \
221
239
HARFBUZZ_CFLAGS=" -I$BUILDDIR /$ARCH /include/harfbuzz" \
222
240
HARFBUZZ_LIBS=" -L$BUILDDIR /$ARCH /lib -lharfbuzz" \
223
241
ICU_CFLAGS=" -I$BUILDDIR /$ARCH /include" \
@@ -226,9 +244,66 @@ cd $BUILDDIR/$ARCH
226
244
./configure \
227
245
--host=$GCCPREFIX \
228
246
--prefix=` pwd` /../ \
229
- --enable-static --disable -shared \
247
+ --enable-static --enable -shared \
230
248
|| exit 1
231
249
250
+ env PATH=` pwd` :$PATH \
251
+ $BUILDDIR /setCrossEnvironment-$ARCH .sh \
252
+ make V=1 || \
253
+ env PATH=` pwd` :$PATH \
254
+ $BUILDDIR /setCrossEnvironment-$ARCH .sh \
255
+ sh -c ' $LD $CFLAGS -shared src/.libs/*.o -o src/.libs/libicu-le-hb.so.0.0.0 -L../lib -lharfbuzz -licuuc $LDFLAGS' || exit 1
256
+
257
+ env PATH=` pwd` :$PATH \
258
+ $BUILDDIR /setCrossEnvironment-$ARCH .sh \
259
+ sh -c ' $AR rcs ../lib/libicu-le-hb.a src/.libs/*.o' || exit 1
260
+
261
+ cat > src/libicu-le-hb.la << EOF
262
+ # libicu-le-hb.so - a libtool library file
263
+ # Generated by libtool (GNU libtool) 2.4.2 Debian-2.4.2-1.7ubuntu1
264
+ #
265
+ # Please DO NOT delete this file!
266
+ # It is necessary for linking the library.
267
+
268
+ # The name that we can dlopen(3).
269
+ dlname='libicu-le-hb.so.0'
270
+
271
+ # Names of this library.
272
+ library_names='libicu-le-hb.so.0.0.0 libicu-le-hb.so.0 libicu-le-hb.so'
273
+
274
+ # The name of the static archive.
275
+ old_library=''
276
+
277
+ # Linker flags that can not go in dependency_libs.
278
+ inherited_linker_flags=''
279
+
280
+ # Libraries that this one depends upon.
281
+ dependency_libs=''
282
+
283
+ # Names of additional weak libraries provided by this library
284
+ weak_library_names=''
285
+
286
+ # Version information for libharfbuzz.
287
+ current=0
288
+ age=0
289
+ revision=0
290
+
291
+ # Is this an already installed library?
292
+ installed=no
293
+
294
+ # Should we warn about portability when linking against -modules?
295
+ shouldnotlink=no
296
+
297
+ # Files to dlopen/dlpreopen
298
+ dlopen=''
299
+ dlpreopen=''
300
+
301
+ # Directory that this library needs to be installed in:
302
+ libdir='/usr/lib'
303
+ EOF
304
+
305
+ cp -f src/libicu-le-hb.la src/.libs/libicu-le-hb.lai
306
+
232
307
env PATH=` pwd` :$PATH \
233
308
$BUILDDIR /setCrossEnvironment-$ARCH .sh \
234
309
make V=1 || exit 1
@@ -249,9 +324,9 @@ cd $BUILDDIR/$ARCH
249
324
250
325
cd icu/source
251
326
252
- env CFLAGS=" -I$NDK /sources/android/support/include -frtti -fexceptions -include $BUILDDIR /ndk-r15-64-bit-fix.h " \
327
+ env CFLAGS=" -I$NDK /sources/android/support/include -frtti -fexceptions" \
253
328
LDFLAGS=" -frtti -fexceptions -L$BUILDDIR /$ARCH /lib" \
254
- LIBS=" -L$BUILDDIR /$ARCH -landroid_support -lgnustl_static -lstdc++ -latomic " \
329
+ LIBS=" -L$BUILDDIR /$ARCH -landroid_support ` $BUILDDIR /setCrossEnvironment- $ARCH .sh sh -c ' echo $LDFLAGS ' ` " \
255
330
ICULEHB_CFLAGS=" -I$BUILDDIR /$ARCH /include/icu-le-hb" \
256
331
ICULEHB_LIBS=" -licu-le-hb" \
257
332
$BUILDDIR /setCrossEnvironment-$ARCH .sh \
0 commit comments