From: Marcus Comstedt Date: Sat, 3 Dec 2016 14:11:12 +0000 (+0100) Subject: sigrok-cross-android: Patch Boost to remove dependencies on libc wchar stuff X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=af5dd4f1b90a769166337c25d47fa88cbab954be;p=sigrok-util.git sigrok-cross-android: Patch Boost to remove dependencies on libc wchar stuff This avoids issues like these: libboost_serialization.so: error: undefined reference to 'mbtowc' E/dalvikvm(28980): dlopen("/data/app-lib/org.sigrok.pulseview-1/ libboost_serialization.so") failed: dlopen failed: cannot locate symbol "mbtowc" referenced by "libboost_serialization.so" --- diff --git a/cross-compile/android/boost_wchar.patch b/cross-compile/android/boost_wchar.patch new file mode 100644 index 0000000..31c267a --- /dev/null +++ b/cross-compile/android/boost_wchar.patch @@ -0,0 +1,46 @@ +--- boost/config/platform/linux.hpp.orig 2016-12-03 12:31:10.512815722 +0100 ++++ boost/config/platform/linux.hpp 2016-12-03 12:31:58.180223676 +0100 +@@ -102,4 +102,7 @@ + # endif + #endif + ++#ifdef __ANDROID__ ++#define BOOST_NO_CWCHAR ++#endif + +--- boost/integer_traits.hpp.orig 2016-12-03 14:22:08.001314430 +0100 ++++ boost/integer_traits.hpp 2016-12-03 14:22:19.582412591 +0100 +@@ -23,7 +23,7 @@ + #include + // we need wchar.h for WCHAR_MAX/MIN but not all platforms provide it, + // and some may have but not ... +-#if !defined(BOOST_NO_INTRINSIC_WCHAR_T) && (!defined(BOOST_NO_CWCHAR) || defined(sun) || defined(__sun) || defined(__QNX__)) ++#if !defined(BOOST_NO_INTRINSIC_WCHAR_T) && (!defined(BOOST_NO_CWCHAR) || defined(sun) || defined(__sun) || defined(__QNX__) || defined(__ANDROID__)) + #include + #endif + +--- libs/serialization/build/Jamfile.v2.orig 2016-12-03 13:29:51.821334991 +0100 ++++ libs/serialization/build/Jamfile.v2 2016-12-03 13:30:21.457586514 +0100 +@@ -103,12 +103,13 @@ + shared:BOOST_SERIALIZATION_DYN_LINK=1 + ; + +-lib boost_wserialization +- : $(WSOURCES).cpp boost_serialization +- : +- msvc:/Gy +- #gcc:"-fvisibility=hidden" +- shared:BOOST_SERIALIZATION_DYN_LINK=1 +- ; +- +-boost-install boost_serialization boost_wserialization ; ++# lib boost_wserialization ++# : $(WSOURCES).cpp boost_serialization ++# : ++# msvc:/Gy ++# #gcc:"-fvisibility=hidden" ++# shared:BOOST_SERIALIZATION_DYN_LINK=1 ++# ; ++# ++# boost-install boost_serialization boost_wserialization ; ++boost-install boost_serialization ; diff --git a/cross-compile/android/sigrok-cross-android b/cross-compile/android/sigrok-cross-android index 6b219ef..ea67d6b 100755 --- a/cross-compile/android/sigrok-cross-android +++ b/cross-compile/android/sigrok-cross-android @@ -440,6 +440,7 @@ NDK_HOST=`"$ANDROID_NDK/ndk-build" -p 2>/dev/null | awk '$1 == "HOST_TAG" { prin $WGET http://$SF_MIRROR/project/boost/boost/$VER_BOOST/boost_${VER_BOOST//./_}.tar.bz2 tar xfj boost_${VER_BOOST//./_}.tar.bz2 cd boost_${VER_BOOST//./_} +patch -p0 < ../../boost_wchar.patch CC= ./bootstrap.sh --with-toolset=gcc --with-libraries=filesystem,system,thread,serialization,test --without-icu echo "using gcc : $NDK_TOOLCHAIN_VERSION : \"${TOOLCHAIN_TRIPLET}-g++\" : \"$SYSROOT -I$PREFIX/include $CPPFLAGS_STL\" \"$SYSROOT -L$PREFIX/lib $LDFLAGS_STL -lgnustl_shared\" ;" > user-config.jam ./b2 -q -d+2 --ignore-site-config --user-config=user-config.jam toolset=gcc variant=release link=shared threading=multi runtime-link=shared target-os=android --prefix=$PREFIX --layout=system install $PARALLEL