forked from microsoft/cpprestsdk
-
Notifications
You must be signed in to change notification settings - Fork 0
/
boost-for-android-x86.patch
173 lines (165 loc) · 6.02 KB
/
boost-for-android-x86.patch
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
diff --git a/build-android.sh b/build-android.sh
index 40453f7..5902fe2 100755
--- a/build-android.sh
+++ b/build-android.sh
@@ -195,8 +195,12 @@ case "$HOST_OS" in
PlatformOS=linux
esac
+NDK_SOURCE_PROPERTIES=$AndroidNDKRoot"/source.properties"
NDK_RELEASE_FILE=$AndroidNDKRoot"/RELEASE.TXT"
-if [ -f "${NDK_RELEASE_FILE}" ]; then
+if [ -f "${NDK_SOURCE_PROPERTIES}" ]; then
+ version=$(grep -i '^Pkg.Revision =' $NDK_SOURCE_PROPERTIES | cut -f2- -d=)
+ NDK_RN=$(echo $version | awk -F. '{print $1}')
+elif [ -f "${NDK_RELEASE_FILE}" ]; then
NDK_RN=`cat $NDK_RELEASE_FILE | sed 's/^r\(.*\)$/\1/g'`
elif [ -n "${AndroidSourcesDetected}" ]; then
if [ -f "${ANDROID_BUILD_TOP}/ndk/docs/CHANGES.html" ]; then
@@ -258,10 +262,20 @@ case "$NDK_RN" in
TOOLSET=gcc-androidR8e
;;
"10 (64-bit)")
- TOOLCHAIN=${TOOLCHAIN:-arm-linux-androideabi-4.6}
- CXXPATH=$AndroidNDKRoot/toolchains/${TOOLCHAIN}/prebuilt/${PlatformOS}-x86_64/bin/arm-linux-androideabi-g++
- TOOLSET=gcc-androidR8e
+ TOOLCHAIN=llvm-3.4
+ CXXPATH=$AndroidNDKRoot/toolchains/${TOOLCHAIN}/prebuilt/${PlatformOS}-x86_64/bin/clang++
+ TOOLSET=clang-androidR8e
+ ;;
+ "10e-rc4 (64-bit)"|"10e (64-bit)")
+ TOOLCHAIN=llvm-3.6
+ CXXPATH=$AndroidNDKRoot/toolchains/${TOOLCHAIN}/prebuilt/${PlatformOS}-x86_64/bin/clang++
+ TOOLSET=clang-androidR8e
;;
+ 11)
+ TOOLCHAIN=llvm
+ CXXPATH=$AndroidNDKRoot/toolchains/${TOOLCHAIN}/prebuilt/${PlatformOS}-x86_64/bin/clang++
+ TOOLSET=clang-androidR8e
+ ;;
*)
echo "Undefined or not supported Android NDK version!"
exit 1
@@ -391,6 +405,7 @@ echo "Building boost for android"
export AndroidBinariesPath=`dirname $CXXPATH`
export PATH=$AndroidBinariesPath:$PATH
export AndroidNDKRoot
+ export PlatformOS
export NO_BZIP2=1
cxxflags=""
@@ -405,7 +420,7 @@ echo "Building boost for android"
--layout=versioned \
--prefix="./../$BUILD_DIR/" \
$LIBRARIES \
- install 2>&1 \
+ release debug install 2>&1 \
|| { dump "ERROR: Failed to build boost for android!" ; exit 1 ; }
} | tee -a $PROGDIR/build.log
diff --git a/configs/user-config-boost-1_55_0.jam b/configs/user-config-boost-1_55_0.jam
index 666d4c8..93aba68 100644
--- a/configs/user-config-boost-1_55_0.jam
+++ b/configs/user-config-boost-1_55_0.jam
@@ -39,93 +39,47 @@
import os ;
local AndroidNDKRoot = [ os.environ AndroidNDKRoot ] ;
+local PlatformOS = [ os.environ PlatformOS ] ;
# --------------------------------------------------------------------
-# Is same for 8b, 8c and 8d
-using gcc : androidR8b
+using clang : androidR8e
:
-arm-linux-androideabi-g++
+$(AndroidNDKRoot)/toolchains/llvm/prebuilt/$(PlatformOS)-x86_64/bin/clang++
:
-<archiver>arm-linux-androideabi-ar
+<compileflags>--gcc-toolchain="$(AndroidNDKRoot)/toolchains/x86-4.9/prebuilt/$(PlatformOS)-x86_64"
<compileflags>-fexceptions
<compileflags>-frtti
<compileflags>-fpic
<compileflags>-ffunction-sections
<compileflags>-funwind-tables
-<compileflags>-D__ARM_ARCH_5__
-<compileflags>-D__ARM_ARCH_5T__
-<compileflags>-D__ARM_ARCH_5E__
-<compileflags>-D__ARM_ARCH_5TE__
-<compileflags>-Wno-psabi
-<compileflags>-march=armv5te
-<compileflags>-mtune=xscale
-<compileflags>-msoft-float
-<compileflags>-mthumb
+<compileflags>-fstack-protector
+<compileflags>-no-canonical-prefixes
+<compileflags>--target=i686-none-linux-android
+<compileflags>--sysroot="$(AndroidNDKRoot)/platforms/android-9/arch-x86"
<compileflags>-Os
<compileflags>-fomit-frame-pointer
-<compileflags>-fno-strict-aliasing
-<compileflags>-finline-limit=64
-<compileflags>-I$(AndroidNDKRoot)/platforms/android-9/arch-arm/usr/include
+<compileflags>-fstrict-aliasing
<compileflags>-Wa,--noexecstack
<compileflags>-DANDROID
<compileflags>-D__ANDROID__
<compileflags>-DNDEBUG
<compileflags>-O2
<compileflags>-g
-<compileflags>-I$(AndroidNDKRoot)/sources/cxx-stl/gnu-libstdc++/4.6/include
-<compileflags>-I$(AndroidNDKRoot)/sources/cxx-stl/gnu-libstdc++/4.6/libs/armeabi/include
+<compileflags>-I$(AndroidNDKRoot)/sources/cxx-stl/gnu-libstdc++/4.9/include
+<compileflags>-I$(AndroidNDKRoot)/sources/cxx-stl/gnu-libstdc++/4.9/libs/x86/include
+<linkflags>--target=i686-none-linux-android
+<linkflags>--gcc-toolchain="$(AndroidNDKRoot)/toolchains/x86-4.9/prebuilt/$(PlatformOS)-x86_64"
+<linkflags>--sysroot=$(AndroidNDKRoot)/platforms/android-9/arch-x86
# @Moss - Above are the 'oficial' android flags
-<architecture>arm
+<architecture>i686
<compileflags>-fvisibility=hidden
<compileflags>-fvisibility-inlines-hidden
<compileflags>-fdata-sections
-<cxxflags>-D__arm__
<cxxflags>-D_REENTRANT
<cxxflags>-D_GLIBCXX__PTHREADS
+<cxxflags>-std=c++11
;
-# --------------------------------------------------------------------
-using gcc : androidR8e
-:
-arm-linux-androideabi-g++
-:
-<archiver>arm-linux-androideabi-ar
-<compileflags>-fexceptions
-<compileflags>-frtti
-<compileflags>-fpic
-<compileflags>-ffunction-sections
-<compileflags>-funwind-tables
-<compileflags>-D__ARM_ARCH_5__
-<compileflags>-D__ARM_ARCH_5T__
-<compileflags>-D__ARM_ARCH_5E__
-<compileflags>-D__ARM_ARCH_5TE__
-<compileflags>-Wno-psabi
-<compileflags>-march=armv5te
-<compileflags>-mtune=xscale
-<compileflags>-msoft-float
-<compileflags>-mthumb
-<compileflags>-Os
-<compileflags>-fomit-frame-pointer
-<compileflags>-fno-strict-aliasing
-<compileflags>-finline-limit=64
-<compileflags>-I$(AndroidNDKRoot)/platforms/android-9/arch-arm/usr/include
-<compileflags>-Wa,--noexecstack
-<compileflags>-DANDROID
-<compileflags>-D__ANDROID__
-<compileflags>-DNDEBUG
-<compileflags>-O2
-<compileflags>-g
-<compileflags>-I$(AndroidNDKRoot)/sources/cxx-stl/gnu-libstdc++/4.6/include
-<compileflags>-I$(AndroidNDKRoot)/sources/cxx-stl/gnu-libstdc++/4.6/libs/armeabi/include
-# @Moss - Above are the 'oficial' android flags
-<architecture>arm
-<compileflags>-fvisibility=hidden
-<compileflags>-fvisibility-inlines-hidden
-<compileflags>-fdata-sections
-<cxxflags>-D__arm__
-<cxxflags>-D_REENTRANT
-<cxxflags>-D_GLIBCXX__PTHREADS
-;
# ------------------