Skip to content

Commit d5afb5c

Browse files
deniztDeniz Türkoglu
authored and
Deniz Türkoglu
committed
Fix android build script for linux
The build no longer uses libiconv but there were traces left. Also boost patch had a typo for x86. With these changes, the build script should work as expected.
1 parent 3070ca2 commit d5afb5c

File tree

3 files changed

+10
-71
lines changed

3 files changed

+10
-71
lines changed

Build_android/boost-for-android-x86.patch

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -13,29 +13,17 @@ index 40453f7..7ffc050 100755
1313
+ CXXPATH=$AndroidNDKRoot/toolchains/${TOOLCHAIN}/prebuilt/${PlatformOS}-x86_64/bin/clang++
1414
+ TOOLSET=clang-androidR8e
1515
+ ;;
16-
+ "10e-rc4 (64-bit)")
16+
+ "10e-rc4 (64-bit)"|"10e (64-bit)")
1717
+ TOOLCHAIN=llvm-3.6
1818
+ CXXPATH=$AndroidNDKRoot/toolchains/${TOOLCHAIN}/prebuilt/${PlatformOS}-x86_64/bin/clang++
1919
+ TOOLSET=clang-androidR8e
2020
;;
2121
*)
2222
echo "Undefined or not supported Android NDK version!"
23-
@@ -392,6 +397,7 @@ echo "Building boost for android"
24-
export PATH=$AndroidBinariesPath:$PATH
25-
export AndroidNDKRoot
26-
export NO_BZIP2=1
27-
+ export ICONV_PATH="`pwd`/../../libiconv/x86"
28-
29-
cxxflags=""
30-
for flag in $CXXFLAGS; do cxxflags="$cxxflags cxxflags=$flag"; done
31-
@@ -404,8 +410,12 @@ echo "Building boost for android"
23+
@@ -404,8 +409,8 @@ echo "Building boost for android"
3224
threading=multi \
3325
--layout=versioned \
3426
--prefix="./../$BUILD_DIR/" \
35-
+ boost.locale.posix=off \
36-
+ boost.locale.std=on \
37-
+ boost.locale.iconv=on \
38-
+ boost.locale.icu=off \
3927
$LIBRARIES \
4028
- install 2>&1 \
4129
+ release debug install 2>&1 \
@@ -98,7 +86,7 @@ index 666d4c8..762753e 100644
9886
+<linkflags>--sysroot=$(AndroidNDKRoot)/platforms/android-9/arch-x86
9987
# @Moss - Above are the 'oficial' android flags
10088
-<architecture>arm
101-
+#<architecture>i686
89+
+<architecture>i686
10290
<compileflags>-fvisibility=hidden
10391
<compileflags>-fvisibility-inlines-hidden
10492
<compileflags>-fdata-sections

Build_android/boost-for-android.patch

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -13,29 +13,17 @@ index 40453f7..ad78ddf 100755
1313
+ CXXPATH=$AndroidNDKRoot/toolchains/${TOOLCHAIN}/prebuilt/${PlatformOS}-x86_64/bin/clang++
1414
+ TOOLSET=clang-androidR8e
1515
+ ;;
16-
+ "10e-rc4 (64-bit)")
16+
+ "10e-rc4 (64-bit)"|"10e (64-bit)")
1717
+ TOOLCHAIN=llvm-3.6
1818
+ CXXPATH=$AndroidNDKRoot/toolchains/${TOOLCHAIN}/prebuilt/${PlatformOS}-x86_64/bin/clang++
1919
+ TOOLSET=clang-androidR8e
2020
;;
2121
*)
2222
echo "Undefined or not supported Android NDK version!"
23-
@@ -392,6 +397,7 @@ echo "Building boost for android"
24-
export PATH=$AndroidBinariesPath:$PATH
25-
export AndroidNDKRoot
26-
export NO_BZIP2=1
27-
+ export ICONV_PATH="`pwd`/../../libiconv/armeabi-v7a"
28-
29-
cxxflags=""
30-
for flag in $CXXFLAGS; do cxxflags="$cxxflags cxxflags=$flag"; done
31-
@@ -404,8 +410,12 @@ echo "Building boost for android"
23+
@@ -404,8 +409,8 @@ echo "Building boost for android"
3224
threading=multi \
3325
--layout=versioned \
3426
--prefix="./../$BUILD_DIR/" \
35-
+ boost.locale.posix=off \
36-
+ boost.locale.std=on \
37-
+ boost.locale.iconv=on \
38-
+ boost.locale.icu=off \
3927
$LIBRARIES \
4028
- install 2>&1 \
4129
+ release debug install 2>&1 \

Build_android/configure.sh

Lines changed: 5 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -34,17 +34,15 @@ set -e
3434
# Parse args
3535
# -----------------
3636

37-
DO_LIBICONV=1
3837
DO_BOOST=1
3938
DO_OPENSSL=1
4039
DO_CPPRESTSDK=1
4140

4241
function usage {
43-
echo "Usage: $0 [--skip-boost] [--skip-openssl] [--skip-libiconv] [--skip-cpprestsdk] [-h] [--ndk <android-ndk>]"
42+
echo "Usage: $0 [--skip-boost] [--skip-openssl] [--skip-cpprestsdk] [-h] [--ndk <android-ndk>]"
4443
echo ""
4544
echo " --skip-boost Skip fetching and compiling boost"
4645
echo " --skip-openssl Skip fetching and compiling openssl"
47-
echo " --skip-libiconv Skip fetching and compiling libiconv"
4846
echo " --skip-cpprestsdk Skip compiling cpprestsdk"
4947
echo " -h,--help,-? Display this information"
5048
echo " --ndk <android-ndk> If specified, overrides the ANDROID_NDK environment variable"
@@ -59,9 +57,6 @@ do
5957
"--skip-openssl")
6058
DO_OPENSSL=0
6159
;;
62-
"--skip-libiconv")
63-
DO_LIBICONV=0
64-
;;
6560
"--skip-cpprestsdk")
6661
DO_CPPRESTSDK=0
6762
;;
@@ -131,40 +126,6 @@ then
131126
)
132127
fi
133128

134-
# --------
135-
# libiconv
136-
# --------
137-
138-
# This steps are based on the blog post
139-
# http://danilogiulianelli.blogspot.com/2012/12/how-to-cross-compile-libiconv-for.html
140-
if [ "${DO_LIBICONV}" == "1" ]
141-
then
142-
(
143-
if [ ! -e "libiconv-1.13.1.tar.gz" ]
144-
then
145-
wget http://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.13.1.tar.gz
146-
fi
147-
rm -rf libiconv
148-
mkdir libiconv
149-
cd libiconv
150-
tar xzf ../libiconv-1.13.1.tar.gz
151-
patch -b -p0 < "$DIR/libiconv/libiconv.patch"
152-
cd libiconv-1.13.1
153-
./configure
154-
cp -r "$DIR/libiconv/jni" ..
155-
cd ../jni
156-
"${NDK_DIR}/ndk-build" || exit 1
157-
cd ..
158-
mkdir -p armeabi-v7a/include
159-
mkdir -p armeabi-v7a/lib
160-
mkdir -p x86/include
161-
mkdir -p x86/lib
162-
cp libiconv-1.13.1/include/iconv.h armeabi-v7a/include/
163-
cp libiconv-1.13.1/include/iconv.h x86/include/
164-
cp obj/local/x86/libiconv.a x86/lib/
165-
cp obj/local/armeabi-v7a/libiconv.a armeabi-v7a/lib/
166-
)
167-
fi
168129

169130
# -----
170131
# Boost
@@ -187,7 +148,8 @@ then
187148
git apply "$DIR/boost-for-android.patch"
188149
touch cpprestsdk.patched.stamp
189150
fi
190-
PATH="$PATH:$NDK_DIR" ./build-android.sh --boost=1.55.0 --with-libraries=locale,random,date_time,filesystem,system,thread,chrono "${NDK_DIR}" || exit 1
151+
152+
PATH="$PATH:$NDK_DIR" ./build-android.sh --boost=1.55.0 --with-libraries=random,date_time,filesystem,system,thread,chrono "${NDK_DIR}" || exit 1
191153
)
192154

193155
(
@@ -204,7 +166,8 @@ then
204166
ln -s ../Boost-for-Android/boost_1_55_0.tar.bz2 .
205167
touch cpprestsdk.patched.stamp
206168
fi
207-
PATH="$PATH:$NDK_DIR" ./build-android.sh --boost=1.55.0 --with-libraries=locale,random,date_time,filesystem,system,thread,chrono "${NDK_DIR}" || exit 1
169+
170+
PATH="$PATH:$NDK_DIR" ./build-android.sh --boost=1.55.0 --with-libraries=atomic,random,date_time,filesystem,system,thread,chrono "${NDK_DIR}" || exit 1
208171
)
209172
)
210173
fi

0 commit comments

Comments
 (0)