Skip to content

Commit fee7bd3

Browse files
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 fee7bd3

File tree

3 files changed

+8
-51
lines changed

3 files changed

+8
-51
lines changed

Build_android/boost-for-android-x86.patch

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,21 +20,19 @@ index 40453f7..7ffc050 100755
2020
;;
2121
*)
2222
echo "Undefined or not supported Android NDK version!"
23-
@@ -392,6 +397,7 @@ echo "Building boost for android"
23+
@@ -392,6 +397,6 @@ echo "Building boost for android"
2424
export PATH=$AndroidBinariesPath:$PATH
2525
export AndroidNDKRoot
2626
export NO_BZIP2=1
27-
+ export ICONV_PATH="`pwd`/../../libiconv/x86"
2827

2928
cxxflags=""
3029
for flag in $CXXFLAGS; do cxxflags="$cxxflags cxxflags=$flag"; done
31-
@@ -404,8 +410,12 @@ echo "Building boost for android"
30+
@@ -404,8 +409,11 @@ echo "Building boost for android"
3231
threading=multi \
3332
--layout=versioned \
3433
--prefix="./../$BUILD_DIR/" \
3534
+ boost.locale.posix=off \
3635
+ boost.locale.std=on \
37-
+ boost.locale.iconv=on \
3836
+ boost.locale.icu=off \
3937
$LIBRARIES \
4038
- install 2>&1 \
@@ -98,7 +96,7 @@ index 666d4c8..762753e 100644
9896
+<linkflags>--sysroot=$(AndroidNDKRoot)/platforms/android-9/arch-x86
9997
# @Moss - Above are the 'oficial' android flags
10098
-<architecture>arm
101-
+#<architecture>i686
99+
+<architecture>i686
102100
<compileflags>-fvisibility=hidden
103101
<compileflags>-fvisibility-inlines-hidden
104102
<compileflags>-fdata-sections

Build_android/boost-for-android.patch

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,21 +20,19 @@ index 40453f7..ad78ddf 100755
2020
;;
2121
*)
2222
echo "Undefined or not supported Android NDK version!"
23-
@@ -392,6 +397,7 @@ echo "Building boost for android"
23+
@@ -392,6 +397,6 @@ echo "Building boost for android"
2424
export PATH=$AndroidBinariesPath:$PATH
2525
export AndroidNDKRoot
2626
export NO_BZIP2=1
27-
+ export ICONV_PATH="`pwd`/../../libiconv/armeabi-v7a"
2827

2928
cxxflags=""
3029
for flag in $CXXFLAGS; do cxxflags="$cxxflags cxxflags=$flag"; done
31-
@@ -404,8 +410,12 @@ echo "Building boost for android"
30+
@@ -404,8 +409,11 @@ echo "Building boost for android"
3231
threading=multi \
3332
--layout=versioned \
3433
--prefix="./../$BUILD_DIR/" \
3534
+ boost.locale.posix=off \
3635
+ boost.locale.std=on \
37-
+ boost.locale.iconv=on \
3836
+ boost.locale.icu=off \
3937
$LIBRARIES \
4038
- install 2>&1 \

Build_android/configure.sh

Lines changed: 3 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,7 @@ 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+
PATH="$PATH:$NDK_DIR" ./build-android.sh --boost=1.55.0 --with-libraries=atomic,locale,random,date_time,filesystem,system,thread,chrono "${NDK_DIR}" || exit 1
191152
)
192153

193154
(
@@ -204,7 +165,7 @@ then
204165
ln -s ../Boost-for-Android/boost_1_55_0.tar.bz2 .
205166
touch cpprestsdk.patched.stamp
206167
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
168+
PATH="$PATH:$NDK_DIR" ./build-android.sh --boost=1.55.0 --with-libraries=atomic,locale,random,date_time,filesystem,system,thread,chrono "${NDK_DIR}" || exit 1
208169
)
209170
)
210171
fi

0 commit comments

Comments
 (0)