@@ -31,7 +31,7 @@ ANDROID_STANDALONE_SYSROOT=$ANDROID_STANDALONE_TOOLCHAIN/sysroot
31
31
32
32
if [ ! -d android-standalone-toolchain ]; then
33
33
echo Creating Android standalone toolchain ...
34
- $ANDROID_NDK_PATH /build/tools/make_standalone_toolchain.py --api 22 --arch arm --stl libc++ --install-dir $ANDROID_STANDALONE_TOOLCHAIN --force -v
34
+ $ANDROID_NDK_PATH /build/tools/make_standalone_toolchain.py --api 21 --arch arm --stl libc++ --install-dir $ANDROID_STANDALONE_TOOLCHAIN --force -v
35
35
fi
36
36
37
37
export PATH=$ANDROID_STANDALONE_TOOLCHAIN /bin:$PATH
@@ -93,8 +93,12 @@ if [ ! -f libFoundation.so ]; then
93
93
# Search path for curl seems to be wrong in foundation
94
94
# cp -r .build/openssl-1.0.2l/ssl $ANDROID_STANDALONE_SYSROOT/usr/include
95
95
cp -r .build/curl/include/curl $ANDROID_STANDALONE_SYSROOT /usr/include
96
- ln -s $ANDROID_STANDALONE_SYSROOT /usr/include/curl $ANDROID_STANDALONE_SYSROOT /usr/include/curl/curl
97
- ln -s $ANDROID_STANDALONE_SYSROOT /usr/include/libxml2/libxml $ANDROID_STANDALONE_SYSROOT /usr/include/libxml
96
+ if [ ! -e $ANDROID_STANDALONE_SYSROOT /usr/include/curl/curl ]; then
97
+ ln -s $ANDROID_STANDALONE_SYSROOT /usr/include/curl $ANDROID_STANDALONE_SYSROOT /usr/include/curl/curl
98
+ fi
99
+ if [ ! -e $ANDROID_STANDALONE_SYSROOT /usr/include/libxml ]; then
100
+ ln -s $ANDROID_STANDALONE_SYSROOT /usr/include/libxml2/libxml $ANDROID_STANDALONE_SYSROOT /usr/include/libxml
101
+ fi
98
102
99
103
env \
100
104
SWIFTC=" $SWIFT_ANDROID_BUILD_PATH /swift-linux-x86_64/bin/swiftc" \
@@ -104,9 +108,9 @@ if [ ! -f libFoundation.so ]; then
104
108
BUILD_DIR=" $SWIFT_ANDROID_BUILD_PATH /foundation-linux-x86_64" \
105
109
DSTROOT=" /" \
106
110
PREFIX=" /usr" \
107
- CFLAGS=" -DDEPLOYMENT_TARGET_ANDROID -DDEPLOYMENT_ENABLE_LIBDISPATCH --sysroot=$ANDROID_NDK_PATH /platforms/android-22 /arch-arm -I$ANDROID_ICU_PATH /armeabi-v7a/include -I${SDKROOT} /lib/swift -I$ANDROID_NDK_PATH /sources/android/support/include -I$ANDROID_STANDALONE_SYSROOT /usr/include -I$SWIFT_PATH /swift-corelibs-foundation/closure" \
108
- SWIFTCFLAGS=" -DDEPLOYMENT_TARGET_ANDROID -DDEPLOYMENT_ENABLE_LIBDISPATCH -I$ANDROID_NDK_PATH /platforms/android-22 /arch-arm/usr/include" \
109
- LDFLAGS=" -fuse-ld=gold --sysroot=$ANDROID_NDK_PATH /platforms/android-22 /arch-arm -L$ANDROID_NDK_PATH /toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/lib/gcc/arm-linux-androideabi/4.9.x -L$ANDROID_ICU_PATH /armeabi-v7a -L$ANDROID_STANDALONE_SYSROOT /usr/lib -ldispatch " \
111
+ CFLAGS=" -DDEPLOYMENT_TARGET_ANDROID -DDEPLOYMENT_ENABLE_LIBDISPATCH --sysroot=$ANDROID_NDK_PATH /platforms/android-21 /arch-arm -I$ANDROID_ICU_PATH /armeabi-v7a/include -I${SDKROOT} /lib/swift -I$ANDROID_NDK_PATH /sources/android/support/include -I$ANDROID_STANDALONE_SYSROOT /usr/include -I$SWIFT_PATH /swift-corelibs-foundation/closure" \
112
+ SWIFTCFLAGS=" -DDEPLOYMENT_TARGET_ANDROID -DDEPLOYMENT_ENABLE_LIBDISPATCH -I$ANDROID_NDK_PATH /platforms/android-21 /arch-arm/usr/include" \
113
+ LDFLAGS=" -fuse-ld=gold --sysroot=$ANDROID_NDK_PATH /platforms/android-21 /arch-arm -L$ANDROID_NDK_PATH /toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/lib/gcc/arm-linux-androideabi/4.9.x -L$ANDROID_ICU_PATH /armeabi-v7a -L$ANDROID_STANDALONE_SYSROOT /usr/lib -ldispatch " \
110
114
./configure \
111
115
Release \
112
116
--target=armv7-none-linux-androideabi \
@@ -116,10 +120,10 @@ if [ ! -f libFoundation.so ]; then
116
120
-DLIBDISPATCH_BUILD_DIR=$SWIFT_PATH /swift-corelibs-libdispatch &&
117
121
118
122
cp -r /usr/include/uuid $ANDROID_STANDALONE_SYSROOT /usr/include
119
- sed -ie " s/-I.\/ -I\/usr\/include\/x86_64-linux-gnu -I\/usr\/include\/x86_64-linux-gnu -I\/usr\/include\/libxml2//" build.ninja
120
- sed -ie " s/-licui18n/-licui18nswift/g" build.ninja
121
- sed -ie " s/-licuuc/-licuucswift/g" build.ninja
122
- sed -ie " s/-licudata/-licudataswift/g" build.ninja
123
+ sed -i~ " s/-I.\/ -I\/usr\/include\/x86_64-linux-gnu -I\/usr\/include\/x86_64-linux-gnu -I\/usr\/include\/libxml2//" build.ninja
124
+ sed -i~ " s/-licui18n/-licui18nswift/g" build.ninja
125
+ sed -i~ " s/-licuuc/-licuucswift/g" build.ninja
126
+ sed -i~ " s/-licudata/-licudataswift/g" build.ninja
123
127
124
128
ninja || exit 1
125
129
0 commit comments