## GNU General Public License for more details.
##
## You should have received a copy of the GNU General Public License
-## along with this program; if not, write to the Free Software
-## Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+## along with this program; if not, see <http://www.gnu.org/licenses/>.
##
set -e
ANDROID_SDK=$ANDROID_PATH/android-sdk-linux
# The path where your Android toolchain directory is located.
-TOOLCHAIN=$ANDROID_PATH/android-arm-toolchain
+# TOOLCHAIN=$ANDROID_PATH/android-arm-toolchain
# TOOLCHAIN=$ANDROID_PATH/android-mipsel-toolchain
# TOOLCHAIN=$ANDROID_PATH/android-i686-toolchain
-# TOOLCHAIN=$ANDROID_NDK/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86
+TOOLCHAIN=$ANDROID_NDK/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86
# TOOLCHAIN=$ANDROID_NDK/toolchains/x86-4.9/prebuilt/linux-x86
# TOOLCHAIN=$ANDROID_NDK/toolchains/mipsel-linux-android-4.9/prebuilt/linux-x86
VER_LIBICONV=1.14
VER_GETTEXT=0.19.7
-VER_ZLIB=1.2.8
+VER_ZLIB=1.2.11
VER_PCRE=8.38
VER_LIBFFI=3.2.1
VER_GLIB=2.48.1
./autogen.sh
mkdir build
cd build
-CPPFLAGS="$CPPFLAGS_STL" LDFLAGS="$LDFLAGS_STL" ../configure $C $BINDINGS_CONFIG --datadir=/sdcard
+CPPFLAGS="$CPPFLAGS_STL" LDFLAGS="$LDFLAGS_STL" JAVAC="javac -source 1.6 -target 1.6" ../configure $C $BINDINGS_CONFIG --datadir=/sdcard
make $PARALLEL $V
make datadir='$(datarootdir)' install $V
cd ../..
$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++\" : <cxxflags>\"$SYSROOT -I$PREFIX/include $CPPFLAGS_STL\" <linkflags>\"$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