Skip to content

Commit 2902b29

Browse files
committed
Android build script updates to use NDK 11 and clang 3.8
1 parent 26bf780 commit 2902b29

File tree

3 files changed

+71
-32
lines changed

3 files changed

+71
-32
lines changed

Build_android/boost-for-android-x86.patch

Lines changed: 32 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,22 @@
11
diff --git a/build-android.sh b/build-android.sh
2-
index 40453f7..7ffc050 100755
2+
index 40453f7..5902fe2 100755
33
--- a/build-android.sh
44
+++ b/build-android.sh
5-
@@ -258,9 +258,14 @@ case "$NDK_RN" in
5+
@@ -195,8 +195,12 @@ case "$HOST_OS" in
6+
PlatformOS=linux
7+
esac
8+
9+
+NDK_SOURCE_PROPERTIES=$AndroidNDKRoot"/source.properties"
10+
NDK_RELEASE_FILE=$AndroidNDKRoot"/RELEASE.TXT"
11+
-if [ -f "${NDK_RELEASE_FILE}" ]; then
12+
+if [ -f "${NDK_SOURCE_PROPERTIES}" ]; then
13+
+ version=$(grep -i '^Pkg.Revision =' $NDK_SOURCE_PROPERTIES | cut -f2- -d=)
14+
+ NDK_RN=$(echo $version | awk -F. '{print $1}')
15+
+elif [ -f "${NDK_RELEASE_FILE}" ]; then
16+
NDK_RN=`cat $NDK_RELEASE_FILE | sed 's/^r\(.*\)$/\1/g'`
17+
elif [ -n "${AndroidSourcesDetected}" ]; then
18+
if [ -f "${ANDROID_BUILD_TOP}/ndk/docs/CHANGES.html" ]; then
19+
@@ -258,10 +262,20 @@ case "$NDK_RN" in
620
TOOLSET=gcc-androidR8e
721
;;
822
"10 (64-bit)")
@@ -18,17 +32,23 @@ index 40453f7..7ffc050 100755
1832
+ CXXPATH=$AndroidNDKRoot/toolchains/${TOOLCHAIN}/prebuilt/${PlatformOS}-x86_64/bin/clang++
1933
+ TOOLSET=clang-androidR8e
2034
;;
35+
+ 11)
36+
+ TOOLCHAIN=llvm
37+
+ CXXPATH=$AndroidNDKRoot/toolchains/${TOOLCHAIN}/prebuilt/${PlatformOS}-x86_64/bin/clang++
38+
+ TOOLSET=clang-androidR8e
39+
+ ;;
2140
*)
2241
echo "Undefined or not supported Android NDK version!"
23-
@@ -391,6 +396,7 @@ echo "Building boost for android"
42+
exit 1
43+
@@ -391,6 +405,7 @@ echo "Building boost for android"
2444
export AndroidBinariesPath=`dirname $CXXPATH`
2545
export PATH=$AndroidBinariesPath:$PATH
2646
export AndroidNDKRoot
2747
+ export PlatformOS
2848
export NO_BZIP2=1
29-
49+
3050
cxxflags=""
31-
@@ -405,7 +411,7 @@ echo "Building boost for android"
51+
@@ -405,7 +420,7 @@ echo "Building boost for android"
3252
--layout=versioned \
3353
--prefix="./../$BUILD_DIR/" \
3454
$LIBRARIES \
@@ -38,11 +58,11 @@ index 40453f7..7ffc050 100755
3858
} | tee -a $PROGDIR/build.log
3959

4060
diff --git a/configs/user-config-boost-1_55_0.jam b/configs/user-config-boost-1_55_0.jam
41-
index 666d4c8..4cd3441 100644
61+
index 666d4c8..93aba68 100644
4262
--- a/configs/user-config-boost-1_55_0.jam
4363
+++ b/configs/user-config-boost-1_55_0.jam
4464
@@ -39,93 +39,47 @@
45-
65+
4666
import os ;
4767
local AndroidNDKRoot = [ os.environ AndroidNDKRoot ] ;
4868
+local PlatformOS = [ os.environ PlatformOS ] ;
@@ -53,10 +73,10 @@ index 666d4c8..4cd3441 100644
5373
+using clang : androidR8e
5474
:
5575
-arm-linux-androideabi-g++
56-
+$(AndroidNDKRoot)/toolchains/llvm-3.6/prebuilt/$(PlatformOS)-x86_64/bin/clang++
76+
+$(AndroidNDKRoot)/toolchains/llvm/prebuilt/$(PlatformOS)-x86_64/bin/clang++
5777
:
5878
-<archiver>arm-linux-androideabi-ar
59-
+<compileflags>--gcc-toolchain="$(AndroidNDKRoot)/toolchains/x86-4.8/prebuilt/$(PlatformOS)-x86_64"
79+
+<compileflags>--gcc-toolchain="$(AndroidNDKRoot)/toolchains/x86-4.9/prebuilt/$(PlatformOS)-x86_64"
6080
<compileflags>-fexceptions
6181
<compileflags>-frtti
6282
<compileflags>-fpic
@@ -89,10 +109,10 @@ index 666d4c8..4cd3441 100644
89109
<compileflags>-g
90110
-<compileflags>-I$(AndroidNDKRoot)/sources/cxx-stl/gnu-libstdc++/4.6/include
91111
-<compileflags>-I$(AndroidNDKRoot)/sources/cxx-stl/gnu-libstdc++/4.6/libs/armeabi/include
92-
+<compileflags>-I$(AndroidNDKRoot)/sources/cxx-stl/gnu-libstdc++/4.8/include
93-
+<compileflags>-I$(AndroidNDKRoot)/sources/cxx-stl/gnu-libstdc++/4.8/libs/x86/include
112+
+<compileflags>-I$(AndroidNDKRoot)/sources/cxx-stl/gnu-libstdc++/4.9/include
113+
+<compileflags>-I$(AndroidNDKRoot)/sources/cxx-stl/gnu-libstdc++/4.9/libs/x86/include
94114
+<linkflags>--target=i686-none-linux-android
95-
+<linkflags>--gcc-toolchain="$(AndroidNDKRoot)/toolchains/x86-4.8/prebuilt/$(PlatformOS)-x86_64"
115+
+<linkflags>--gcc-toolchain="$(AndroidNDKRoot)/toolchains/x86-4.9/prebuilt/$(PlatformOS)-x86_64"
96116
+<linkflags>--sysroot=$(AndroidNDKRoot)/platforms/android-9/arch-x86
97117
# @Moss - Above are the 'oficial' android flags
98118
-<architecture>arm

Build_android/boost-for-android.patch

Lines changed: 34 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,22 @@
11
diff --git a/build-android.sh b/build-android.sh
2-
index 40453f7..ad78ddf 100755
2+
index 40453f7..5902fe2 100755
33
--- a/build-android.sh
44
+++ b/build-android.sh
5-
@@ -258,9 +258,14 @@ case "$NDK_RN" in
5+
@@ -195,8 +195,12 @@ case "$HOST_OS" in
6+
PlatformOS=linux
7+
esac
8+
9+
+NDK_SOURCE_PROPERTIES=$AndroidNDKRoot"/source.properties"
10+
NDK_RELEASE_FILE=$AndroidNDKRoot"/RELEASE.TXT"
11+
-if [ -f "${NDK_RELEASE_FILE}" ]; then
12+
+if [ -f "${NDK_SOURCE_PROPERTIES}" ]; then
13+
+ version=$(grep -i '^Pkg.Revision =' $NDK_SOURCE_PROPERTIES | cut -f2- -d=)
14+
+ NDK_RN=$(echo $version | awk -F. '{print $1}')
15+
+elif [ -f "${NDK_RELEASE_FILE}" ]; then
16+
NDK_RN=`cat $NDK_RELEASE_FILE | sed 's/^r\(.*\)$/\1/g'`
17+
elif [ -n "${AndroidSourcesDetected}" ]; then
18+
if [ -f "${ANDROID_BUILD_TOP}/ndk/docs/CHANGES.html" ]; then
19+
@@ -258,10 +262,20 @@ case "$NDK_RN" in
620
TOOLSET=gcc-androidR8e
721
;;
822
"10 (64-bit)")
@@ -18,18 +32,23 @@ index 40453f7..ad78ddf 100755
1832
+ CXXPATH=$AndroidNDKRoot/toolchains/${TOOLCHAIN}/prebuilt/${PlatformOS}-x86_64/bin/clang++
1933
+ TOOLSET=clang-androidR8e
2034
;;
35+
+ 11)
36+
+ TOOLCHAIN=llvm
37+
+ CXXPATH=$AndroidNDKRoot/toolchains/${TOOLCHAIN}/prebuilt/${PlatformOS}-x86_64/bin/clang++
38+
+ TOOLSET=clang-androidR8e
39+
+ ;;
2140
*)
2241
echo "Undefined or not supported Android NDK version!"
23-
@@ -391,6 +396,7 @@ echo "Building boost for android"
42+
exit 1
43+
@@ -391,6 +405,7 @@ echo "Building boost for android"
2444
export AndroidBinariesPath=`dirname $CXXPATH`
2545
export PATH=$AndroidBinariesPath:$PATH
2646
export AndroidNDKRoot
2747
+ export PlatformOS
2848
export NO_BZIP2=1
29-
49+
3050
cxxflags=""
31-
@@ -405,7 +411,7 @@ echo "Building boost for android"
32-
threading=multi \
51+
@@ -405,7 +420,7 @@ echo "Building boost for android"
3352
--layout=versioned \
3453
--prefix="./../$BUILD_DIR/" \
3554
$LIBRARIES \
@@ -39,25 +58,25 @@ index 40453f7..ad78ddf 100755
3958
} | tee -a $PROGDIR/build.log
4059

4160
diff --git a/configs/user-config-boost-1_55_0.jam b/configs/user-config-boost-1_55_0.jam
42-
index 666d4c8..df597f6 100644
61+
index 666d4c8..cdab118 100644
4362
--- a/configs/user-config-boost-1_55_0.jam
4463
+++ b/configs/user-config-boost-1_55_0.jam
4564
@@ -39,84 +39,44 @@
46-
65+
4766
import os ;
4867
local AndroidNDKRoot = [ os.environ AndroidNDKRoot ] ;
4968
+local PlatformOS = [ os.environ PlatformOS ] ;
50-
69+
5170
# --------------------------------------------------------------------
5271
-# Is same for 8b, 8c and 8d
5372
-using gcc : androidR8b
5473
+using clang : androidR8e
5574
:
5675
-arm-linux-androideabi-g++
57-
+$(AndroidNDKRoot)/toolchains/llvm-3.6/prebuilt/$(PlatformOS)-x86_64/bin/clang++
76+
+$(AndroidNDKRoot)/toolchains/llvm/prebuilt/$(PlatformOS)-x86_64/bin/clang++
5877
:
5978
-<archiver>arm-linux-androideabi-ar
60-
+<compileflags>--gcc-toolchain="$(AndroidNDKRoot)/toolchains/arm-linux-androideabi-4.8/prebuilt/$(PlatformOS)-x86_64"
79+
+<compileflags>--gcc-toolchain="$(AndroidNDKRoot)/toolchains/arm-linux-androideabi-4.9/prebuilt/$(PlatformOS)-x86_64"
6180
<compileflags>-fexceptions
6281
<compileflags>-frtti
6382
<compileflags>-fpic
@@ -134,15 +153,15 @@ index 666d4c8..df597f6 100644
134153
<compileflags>-g
135154
-<compileflags>-I$(AndroidNDKRoot)/sources/cxx-stl/gnu-libstdc++/4.6/include
136155
-<compileflags>-I$(AndroidNDKRoot)/sources/cxx-stl/gnu-libstdc++/4.6/libs/armeabi/include
137-
+<compileflags>-I$(AndroidNDKRoot)/sources/cxx-stl/gnu-libstdc++/4.8/include
138-
+<compileflags>-I$(AndroidNDKRoot)/sources/cxx-stl/gnu-libstdc++/4.8/libs/armeabi/include
156+
+<compileflags>-I$(AndroidNDKRoot)/sources/cxx-stl/gnu-libstdc++/4.9/include
157+
+<compileflags>-I$(AndroidNDKRoot)/sources/cxx-stl/gnu-libstdc++/4.9/libs/armeabi/include
139158
+<linkflags>--target=armv7-none-linux-androideabi
140-
+<linkflags>--gcc-toolchain="$(AndroidNDKRoot)/toolchains/arm-linux-androideabi-4.8/prebuilt/$(PlatformOS)-x86_64"
159+
+<linkflags>--gcc-toolchain="$(AndroidNDKRoot)/toolchains/arm-linux-androideabi-4.9/prebuilt/$(PlatformOS)-x86_64"
141160
+<linkflags>--sysroot=$(AndroidNDKRoot)/platforms/android-9/arch-arm
142161
# @Moss - Above are the 'oficial' android flags
143162
<architecture>arm
144163
<compileflags>-fvisibility=hidden
145-
@@ -125,9 +84,11 @@ arm-linux-androideabi-g++
164+
@@ -125,9 +85,11 @@ arm-linux-androideabi-g++
146165
<cxxflags>-D__arm__
147166
<cxxflags>-D_REENTRANT
148167
<cxxflags>-D_GLIBCXX__PTHREADS

Build_android/configure.sh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ then
193193
cmake "$DIR/../Release/" \
194194
-DCMAKE_TOOLCHAIN_FILE=../android-cmake/android.toolchain.cmake \
195195
-DANDROID_ABI=armeabi-v7a \
196-
-DANDROID_TOOLCHAIN_NAME=arm-linux-androideabi-clang3.6 \
196+
-DANDROID_TOOLCHAIN_NAME=arm-linux-androideabi-clang3.8 \
197197
-DANDROID_STL=none \
198198
-DANDROID_STL_FORCE_FEATURES=ON \
199199
-DANDROID_NATIVE_API_LEVEL=android-9 \
@@ -209,7 +209,7 @@ then
209209
cmake "$DIR/../Release/" \
210210
-DCMAKE_TOOLCHAIN_FILE=../android-cmake/android.toolchain.cmake \
211211
-DANDROID_ABI=armeabi-v7a \
212-
-DANDROID_TOOLCHAIN_NAME=arm-linux-androideabi-clang3.6 \
212+
-DANDROID_TOOLCHAIN_NAME=arm-linux-androideabi-clang3.8 \
213213
-DANDROID_STL=none \
214214
-DANDROID_STL_FORCE_FEATURES=ON \
215215
-DANDROID_NDK="${ANDROID_NDK}" \
@@ -225,7 +225,7 @@ then
225225
cmake "$DIR/../Release/" \
226226
-DCMAKE_TOOLCHAIN_FILE=../android-cmake/android.toolchain.cmake \
227227
-DANDROID_ABI=x86 \
228-
-DANDROID_TOOLCHAIN_NAME=x86-clang3.6 \
228+
-DANDROID_TOOLCHAIN_NAME=x86-clang3.8 \
229229
-DANDROID_STL=none \
230230
-DANDROID_STL_FORCE_FEATURES=ON \
231231
-DANDROID_NATIVE_API_LEVEL=android-9 \
@@ -241,7 +241,7 @@ then
241241
cmake "$DIR/../Release/" \
242242
-DCMAKE_TOOLCHAIN_FILE=../android-cmake/android.toolchain.cmake \
243243
-DANDROID_ABI=x86 \
244-
-DANDROID_TOOLCHAIN_NAME=x86-clang3.6 \
244+
-DANDROID_TOOLCHAIN_NAME=x86-clang3.8 \
245245
-DANDROID_STL=none \
246246
-DANDROID_STL_FORCE_FEATURES=ON \
247247
-DANDROID_NDK="${ANDROID_NDK}" \
@@ -251,4 +251,4 @@ then
251251
make -j 1
252252
)
253253
)
254-
fi
254+
fi

0 commit comments

Comments
 (0)