Skip to content

Commit

Permalink
Locale support using libiconv and libicu, cosmetic improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
pelya committed Oct 13, 2014
1 parent 1c95d34 commit eb614df
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 6 deletions.
27 changes: 21 additions & 6 deletions build-android.sh
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ do_download ()
CLEAN=yes
}

#LIBRARIES=--with-libraries=date_time,filesystem,program_options,regex,signals,system,thread,iostreams
#LIBRARIES=--with-libraries=date_time,filesystem,program_options,regex,signals,system,thread,iostreams,locale
LIBRARIES=
register_option "--with-libraries=<list>" do_with_libraries "Comma separated list of libraries to build."
do_with_libraries () {
Expand Down Expand Up @@ -257,11 +257,11 @@ case "$NDK_RN" in
CXXPATH=$AndroidNDKRoot/toolchains/${TOOLCHAIN}/prebuilt/${PlatformOS}-x86_64/bin/arm-linux-androideabi-g++
TOOLSET=gcc-androidR8e
;;
"10 (64-bit)")
"10 (64-bit)"|"10b (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
;;
CXXPATH=$AndroidNDKRoot/toolchains/${TOOLCHAIN}/prebuilt/${PlatformOS}-x86_64/bin/arm-linux-androideabi-g++
TOOLSET=gcc-androidR8e
;;
*)
echo "Undefined or not supported Android NDK version!"
exit 1
Expand Down Expand Up @@ -301,7 +301,7 @@ fi
if [ ! -d $PROGDIR/$BOOST_DIR ]
then
echo "Unpacking boost"
if [ $OPTION_PROGRESS = "yes" ] ; then
if [ "$OPTION_PROGRESS" = "yes" ] ; then
pv $PROGDIR/$BOOST_TAR | tar xjf - -C $PROGDIR
else
tar xjf $PROGDIR/$BOOST_TAR
Expand Down Expand Up @@ -384,6 +384,19 @@ echo "# ---------------"
# Build boost for android
echo "Building boost for android"
(

if echo $LIBRARIES | grep locale; then
if [ -e libiconv-libicu-android ]; then
echo "ICONV and ICU already compiled"
else
echo "boost_locale selected - compiling ICONV and ICU"
git clone https://github.com/pelya/libiconv-libicu-android.git
cd libiconv-libicu-android
./build.sh || exit 1
cd ..
fi
fi

cd $BOOST_DIR

echo "Adding pathname: `dirname $CXXPATH`"
Expand All @@ -403,6 +416,8 @@ echo "Building boost for android"
link=static \
threading=multi \
--layout=versioned \
-sICONV_PATH=`pwd`/../libiconv-libicu-android/armeabi \
-sICU_PATH=`pwd`/../libiconv-libicu-android/armeabi \
--prefix="./../$BUILD_DIR/" \
$LIBRARIES \
install 2>&1 \
Expand Down
3 changes: 3 additions & 0 deletions configs/user-config-boost-1_53_0.jam
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,9 @@ $(AndroidBinariesPath)/arm-linux-androideabi-g++
<compileflags>-fomit-frame-pointer
<compileflags>-fno-strict-aliasing
<compileflags>-finline-limit=64
<compileflags>-I$(AndroidNDKRoot)/sources/android/support/include
<compileflags>-DTHOUSEP=MON_THOUSANDS_SEP
<compileflags>-DRADIXCHAR=MON_DECIMAL_POINT
<compileflags>-I$(AndroidNDKRoot)/platforms/android-9/arch-arm/usr/include
<compileflags>-Wa,--noexecstack
<compileflags>-DANDROID
Expand Down
11 changes: 11 additions & 0 deletions patches/boost-1_53_0/boost-1_53_0.patch
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
--- boost_1_53_0-boot/libs/locale/build/Jamfile.v2 2013-11-25 01:16:41.401893635 +0200
+++ boost_1_53_0/libs/locale/build/Jamfile.v2 2013-11-25 01:16:55.810101872 +0200
@@ -185,7 +185,7 @@
obj has_icu_obj : ../build/has_icu_test.cpp : $(ICU_OPTS) ;
obj has_icu64_obj : ../build/has_icu_test.cpp : $(ICU64_OPTS) ;

-exe has_icu : has_icu_obj : $(ICU_OPTS) ;
+lib has_icu : ../build/option.cpp : <link>static ;
exe has_icu64 : has_icu64_obj : $(ICU64_OPTS) ;

explicit has_icu has_icu64 ;
diff -ruN boost_1_54_0/libs/filesystem/src/path.cpp boost_1_54_0_patched/libs/filesystem/src/path.cpp
--- boost_1_54_0/libs/filesystem/src/path.cpp 2012-04-16 15:36:28.000000000 +0200
+++ boost_1_54_0_patched/libs/filesystem/src/path.cpp 2013-10-28 02:55:32.773380890 +0100
Expand Down

0 comments on commit eb614df

Please sign in to comment.