##
## This file is part of the sigrok-util project.
##
-## Copyright (C) 2013 Uwe Hermann <uwe@hermann-uwe.de>
+## Copyright (C) 2013-2014 Uwe Hermann <uwe@hermann-uwe.de>
##
## This program is free software; you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published by
set -e
# The path where the Android NDK is located.
-ANDROID_NDK=$HOME/android/android-ndk-r9d
+ANDROID_NDK=$HOME/android/android-ndk-r10c
# The path where the Android SDK is located.
ANDROID_SDK=$HOME/android/android-sdk-linux
# Build host Python before we start messing with the environment.
# Don't do parallel builds, this doesn't seem to work well.
$WGET http://python.org/ftp/python/$VER_PYTHON/Python-$VER_PYTHON.tar.xz
-tar xJf Python-$VER_PYTHON.tar.xz
+tar xfJ Python-$VER_PYTHON.tar.xz
cd Python-$VER_PYTHON
./configure
make python
# zlib (needed for glib and libzip)
$WGET http://zlib.net/zlib-$VER_ZLIB.tar.gz
-tar xfvz zlib-$VER_ZLIB.tar.gz
+tar xfz zlib-$VER_ZLIB.tar.gz
cd zlib-$VER_ZLIB
# Note: zlib's configure doesn't understand --host, we need to pass $CC.
CC=$TOOLCHAIN_TRIPLET-gcc ./configure --prefix=$PREFIX
# pcre (needed for glib)
$WGET ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-$VER_PCRE.tar.gz
-tar xfvz pcre-$VER_PCRE.tar.gz
+tar xfz pcre-$VER_PCRE.tar.gz
cd pcre-$VER_PCRE
./configure $C --disable-cpp
make $PARALLEL
# glib (needed for libsigrok)
$WGET http://ftp.gnome.org/pub/gnome/sources/glib/$VER_GLIB_SHORT/glib-$VER_GLIB.tar.xz
-tar xJf glib-$VER_GLIB.tar.xz
+tar xfJ glib-$VER_GLIB.tar.xz
cd glib-$VER_GLIB
./autogen.sh
# Note: Manual LDFLAGS/CPPFLAGS needed for libiconv, rest uses pkg-config.
$WGET http://www.intra2net.com/en/developer/libftdi/download/libftdi1-$VER_LIBFTDI1.tar.bz2
tar xfj libftdi1-$VER_LIBFTDI1.tar.bz2
cd libftdi1-$VER_LIBFTDI1
-cmake $CM -DFTDIPP=OFF .
+cmake $CM -DFTDIPP=no -DDOCUMENTATION=no -DEXAMPLES=no -DFTDI_EEPROM=no -DPYTHON_BINDINGS=no .
make $PARALLEL
make install
cd ..
# libsigc++ (needed for glibmm)
$WGET http://ftp.gnome.org/pub/gnome/sources/libsigc++/$VER_LIBSIGCXX_SHORT/libsigc++-$VER_LIBSIGCXX.tar.xz
- tar xJf libsigc++-$VER_LIBSIGCXX.tar.xz
+ tar xfJ libsigc++-$VER_LIBSIGCXX.tar.xz
cd libsigc++-$VER_LIBSIGCXX
cp -f ../config/config.guess build
cp -f ../config/config.sub build
- CPPFLAGS="$CPPFLAGS_STL" LDFLAGS="$LDFLAGS_STL -lgnustl_shared" ./configure $C
+ CPPFLAGS="$CPPFLAGS_STL" LDFLAGS="$LDFLAGS_STL -lgnustl_shared" ./configure --disable-documentation $C
make $PARALLEL
make install
cd ..
# glibmm (needed for libsigrok bindings)
$WGET http://ftp.gnome.org/pub/gnome/sources/glibmm/$VER_GLIB_SHORT/glibmm-$VER_GLIB.tar.xz
- tar xJf glibmm-$VER_GLIB.tar.xz
+ tar xfJ glibmm-$VER_GLIB.tar.xz
cd glibmm-$VER_GLIB
- CPPFLAGS="$CPPFLAGS_STL" LDFLAGS="$LDFLAGS_STL -lgnustl_shared" ./configure $C
+ CPPFLAGS="$CPPFLAGS_STL" LDFLAGS="$LDFLAGS_STL -lgnustl_shared" ./configure --disable-documentation $C
make $PARALLEL
make install
cd ..
make install
cd ..
+# Strip all shared libs to reduce size.
+find $PREFIX -iname "*.so" -exec ${TOOLCHAIN_TRIPLET}-strip -S {} \;
+
# PulseView
$GIT_CLONE git://sigrok.org/pulseview
cd pulseview
cmake $CM -DANDROID_STL_PATH=${ANDROID_NDK}/sources/cxx-stl .
make $PARALLEL VERBOSE=1
+make install
+${TOOLCHAIN_TRIPLET}-strip -S libs/$TARGET_ARCH/libpulseview.so
cd android
"${ANDROID_SDK}/tools/android" update project -p . -t android-14 -n PulseView
ant debug