]> sigrok.org Git - sigrok-util.git/blame - cross-compile/android/sigrok-cross-android
sigrok-cross-android: Don't re-download existing files.
[sigrok-util.git] / cross-compile / android / sigrok-cross-android
CommitLineData
0832e7d6
UH
1#!/bin/bash
2##
3## This file is part of the sigrok-util project.
4##
be9ce537
UH
5## Copyright (C) 2013-2015 Uwe Hermann <uwe@hermann-uwe.de>
6## Copyright (C) 2013-2015 Marcus Comstedt <marcus@mc.pp.se>
0832e7d6
UH
7##
8## This program is free software; you can redistribute it and/or modify
9## it under the terms of the GNU General Public License as published by
10## the Free Software Foundation; either version 2 of the License, or
11## (at your option) any later version.
12##
13## This program is distributed in the hope that it will be useful,
14## but WITHOUT ANY WARRANTY; without even the implied warranty of
15## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16## GNU General Public License for more details.
17##
18## You should have received a copy of the GNU General Public License
19## along with this program; if not, write to the Free Software
20## Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
21##
22
c28fee03
MC
23set -e
24
3bdccc55
UH
25# The path where the NDK, SDK, and toolchains are located.
26ANDROID_PATH=$HOME/android
27
e25d7d5a 28# The path where the Android NDK is located.
47708ed7 29ANDROID_NDK=$ANDROID_PATH/android-ndk-r10d
11b9792e 30
e25d7d5a 31# The path where the Android SDK is located.
3bdccc55 32ANDROID_SDK=$ANDROID_PATH/android-sdk-linux
11b9792e 33
0832e7d6 34# The path where your Android toolchain directory is located.
3bdccc55
UH
35TOOLCHAIN=$ANDROID_PATH/android-arm-toolchain
36# TOOLCHAIN=$ANDROID_PATH/android-mipsel-toolchain
37# TOOLCHAIN=$ANDROID_PATH/android-i686-toolchain
697cb97d
UH
38# TOOLCHAIN=$ANDROID_NDK/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86
39# TOOLCHAIN=$ANDROID_NDK/toolchains/x86-4.9/prebuilt/linux-x86
40# TOOLCHAIN=$ANDROID_NDK/toolchains/mipsel-linux-android-4.9/prebuilt/linux-x86
e2bb3ab1
UH
41
42# Select which Android toolchain to use.
43# Don't forget to also adapt TOOLCHAIN above if you change TOOLCHAIN_TRIPLET!
44TOOLCHAIN_TRIPLET=arm-linux-androideabi
45# TOOLCHAIN_TRIPLET=mipsel-linux-android
46# TOOLCHAIN_TRIPLET=i686-linux-android
0832e7d6
UH
47
48# The path where the cross-compiled packages will be installed.
49PREFIX=$HOME/sr_android
50
51# The path where to download files to and where to build packages.
07947dda 52BUILDDIR=./build
0832e7d6 53
9fc8b952
UH
54# Edit this to control verbose build output.
55# V="V=1 VERBOSE=1"
56
819eb05b
UH
57# Edit this to enable/disable/modify parallel compiles.
58PARALLEL="-j 2"
59
0832e7d6
UH
60# You usually don't need to change anything below this line.
61
62# -----------------------------------------------------------------------------
63
64VER_LIBICONV=1.14
5f721e39 65VER_GETTEXT=0.19.4
b118df5f 66VER_ZLIB=1.2.8
5f721e39
UH
67VER_PCRE=8.36
68VER_LIBFFI=3.2.1
69VER_GLIB=2.43.3
70VER_GLIB_SHORT=2.43
71VER_LIBSIGCXX=2.4.0
72VER_LIBSIGCXX_SHORT=2.4
d4069d6e 73VER_LIBZIP=0.11.2
5f721e39 74VER_LIBFTDI1=1.2
d4069d6e 75VER_LIBUSB=1.0.19
5451bfe2 76VER_PYTHON=3.3.3
0263ef05 77VER_BOOST=1.57.0
6e39ae14 78VER_QT=5.4.1
47708ed7 79VER_NDK=10d
3bdccc55 80VER_SDK=23.0.2
6bebfd4e
UH
81VER_AND_BT=22.0.1 # Android build tools version
82VER_AND_API=16 # Target Android API version
0832e7d6 83
10adf549 84SF_MIRROR=download.sourceforge.net
0832e7d6 85
dfae3608 86WGET="wget -c --quiet"
a51ca6bd 87GIT_CLONE="git clone --depth=1"
ec49447e 88
7966c37c
MC
89case "$TOOLCHAIN_TRIPLET" in
90 arm*) TARGET_ARCH=armeabi;;
91 mips*) TARGET_ARCH=mips;;
92 i686*) TARGET_ARCH=x86;;
e25d7d5a 93 *) echo >&2 "Unknown prefix for TOOLCHAIN_TRIPLET."; exit 1;;
7966c37c
MC
94esac
95
0832e7d6 96# -----------------------------------------------------------------------------
3bdccc55
UH
97
98# Get the Android NDK and SDK, install required packages and toolchains.
99if [ "x$1" = "xprepare" ]; then
100 mkdir -p $ANDROID_PATH
101 cd $ANDROID_PATH
102
103 # NDK
104 $WGET http://dl.google.com/android/ndk/android-ndk-r$VER_NDK-linux-x86.bin
105 chmod 700 android-ndk-r$VER_NDK-linux-x86.bin
106 ./android-ndk-r$VER_NDK-linux-x86.bin
107 cd android-ndk-r$VER_NDK
24bcc754 108 ./build/tools/make-standalone-toolchain.sh --platform=android-$VER_AND_API \
3bdccc55
UH
109 --toolchain=arm-linux-androideabi-4.9 \
110 --install-dir=$ANDROID_PATH/android-arm-toolchain
24bcc754 111 ./build/tools/make-standalone-toolchain.sh --platform=android-$VER_AND_API \
6bebfd4e
UH
112 --toolchain=x86-4.9 \
113 --install-dir=$ANDROID_PATH/android-i686-toolchain
24bcc754 114 ./build/tools/make-standalone-toolchain.sh --platform=android-$VER_AND_API \
6bebfd4e
UH
115 --toolchain=mipsel-linux-android-4.9 \
116 --install-dir=$ANDROID_PATH/android-mipsel-toolchain
3bdccc55
UH
117 cd ..
118
119 # SDK
120 $WGET http://dl.google.com/android/android-sdk_r$VER_SDK-linux.tgz
121 tar xfz android-sdk_r$VER_SDK-linux.tgz
122 cd android-sdk-linux
6e39ae14 123 ./tools/android update sdk --no-ui --filter platform-tools,build-tools-$VER_AND_BT,android-$VER_AND_API
3bdccc55
UH
124 cd ..
125
126 exit
127fi
128
129# -----------------------------------------------------------------------------
0832e7d6 130
2e353a08
ML
131# Remove build directory contents (if any) and create a new build dir.
132rm -rf $BUILDDIR
133mkdir $BUILDDIR
134cd $BUILDDIR
135
e25d7d5a
UH
136# -----------------------------------------------------------------------------
137
2e353a08 138# Build host Python before we start messing with the environment.
510f5ccb 139# Don't do parallel builds, this doesn't seem to work well.
ec49447e 140$WGET http://python.org/ftp/python/$VER_PYTHON/Python-$VER_PYTHON.tar.xz
25b2b9f5 141tar xfJ Python-$VER_PYTHON.tar.xz
5451bfe2 142cd Python-$VER_PYTHON
2e353a08 143./configure
9fc8b952 144make python $V
2e353a08 145mv python hostpython
2e353a08
ML
146cd ..
147
148# -----------------------------------------------------------------------------
149
150# We need to find tools in the toolchain.
151export PATH=$TOOLCHAIN/bin:$PATH
0832e7d6 152
02c87af2 153# Tell pkg-config to only look for our cross-built stuff.
226830e4
MC
154export PKG_CONFIG_LIBDIR="$PREFIX/lib/pkgconfig"
155export -n PKG_CONFIG_PATH
156
890c9708
MC
157# Check toolchain
158if test -d "$TOOLCHAIN"/sysroot; then
159 echo "Toolchain is standalone"
160 STANDALONE_TOOLCHAIN=$TOOLCHAIN
161 SYSROOT=
162else
163 STANDALONE_TOOLCHAIN=
6e39ae14 164 NATIVE_API_LEVEL=$VER_AND_API
890c9708
MC
165 SYSROOT_DIR=${ANDROID_NDK}/platforms/android-${NATIVE_API_LEVEL}/arch-${TARGET_ARCH%eabi*}
166 if [ ! -d "$SYSROOT_DIR" ]; then
167 echo >&2 "Can't build with NDK toolchain; sysroot $SYSROOT_DIR is missing"
168 exit 1
169 fi
170 SYSROOT="--sysroot $SYSROOT_DIR"
171 CC="$TOOLCHAIN_TRIPLET-gcc $SYSROOT"
172 CXX="$TOOLCHAIN_TRIPLET-g++ $SYSROOT"
173 export CC CXX
174fi
175NDK_TOOLCHAIN_VERSION=`${TOOLCHAIN_TRIPLET}-gcc --version | head -1 | sed -e 's/.* \([0-9]\+\.[0-9.]\+\)\( \|.*\)$/\1/'`
176
0832e7d6 177# Define some helper variables.
e2bb3ab1 178C="--host=$TOOLCHAIN_TRIPLET --prefix=$PREFIX"
890c9708
MC
179CM="-Wno-dev -DCMAKE_TOOLCHAIN_FILE=../android.toolchain.cmake -DANDROID_ABI=${TARGET_ARCH} -DCMAKE_INSTALL_PREFIX=${PREFIX}"
180if [ -n "$STANDALONE_TOOLCHAIN" ]; then
181 CM="$CM -DANDROID_STANDALONE_TOOLCHAIN=${STANDALONE_TOOLCHAIN}"
182 if [ -d "${ANDROID_NDK}/sources/cxx-stl" ]; then
183 CM="$CM -DANDROID_STL_PATH=${ANDROID_NDK}/sources/cxx-stl"
184 fi
185else
186 CM="$CM -DANDROID_NDK=${ANDROID_NDK}"
187 CM="$CM -DANDROID_NATIVE_API_LEVEL=${NATIVE_API_LEVEL}"
188 CM="$CM -DANDROID_TOOLCHAIN_NAME=${TOOLCHAIN_TRIPLET}-${NDK_TOOLCHAIN_VERSION}"
189fi
0832e7d6 190
2fddc139 191# Look for STL, needed to build bindings
2fddc139
MC
192STL_BASE="${ANDROID_NDK}/sources/cxx-stl/gnu-libstdc++/${NDK_TOOLCHAIN_VERSION}"
193if [ -d ${STL_BASE}/include ]; then
194 CPPFLAGS_STL="-I${STL_BASE}/include -I${STL_BASE}/libs/${TARGET_ARCH}/include"
195 LDFLAGS_STL="-L${STL_BASE}/libs/${TARGET_ARCH} -Wl,-rpath=${STL_BASE}/libs/${TARGET_ARCH}"
196 BINDINGS_CONFIG="--enable-bindings"
197else
198 echo "Warning: STL unavailable, libsigrok bindings will not be built."
199 CPPFLAGS_STL=
200 LDFLAGS_STL=
201 BINDINGS_CONFIG="--disable-bindings"
202fi
203
e25d7d5a
UH
204# -----------------------------------------------------------------------------
205
0832e7d6 206# Get the latest versions of config.guess/config.sub that know about Android.
a51ca6bd 207$GIT_CLONE git://git.savannah.gnu.org/config.git
0832e7d6 208
e25d7d5a
UH
209# Get a toolchain for cmake that knows about Android.
210$WGET https://android-cmake.googlecode.com/hg/toolchain/android.toolchain.cmake
7966c37c
MC
211patch < ../android.toolchain.cmake.patch android.toolchain.cmake
212
0832e7d6
UH
213# -----------------------------------------------------------------------------
214
f7b8aa73 215# Python (needed for libsigrokdecode)
510f5ccb 216# Don't do parallel Python builds, this doesn't seem to work well.
f7b8aa73 217cd Python-$VER_PYTHON
9fc8b952 218make distclean $V
f7b8aa73
UH
219autoreconf
220patch -p1 < ../../Python-$VER_PYTHON.patch
221ac_cv_file__dev_ptmx=no ac_cv_file__dev_ptc=no ac_cv_func_pipe2=no ac_cv_func_fdatasync=no ac_cv_func_killpg=no ac_cv_func_waitid=no ac_cv_func_sigaltstack=no ./configure $C --build=x86_64-linux-gnu --disable-ipv6
9a98e0d1 222sed -i "s/^#zlib/zlib/g" Modules/Setup
9fc8b952 223make PYTHON_FOR_BUILD='_PYTHON_HOST_PLATFORM=$(_PYTHON_HOST_PLATFORM) ./hostpython' install $V
f7b8aa73
UH
224cd ..
225
85b46172 226# libiconv (needed for glib)
ec49447e 227$WGET http://ftp.gnu.org/pub/gnu/libiconv/libiconv-$VER_LIBICONV.tar.gz
85b46172
MC
228tar xfz libiconv-$VER_LIBICONV.tar.gz
229cd libiconv-$VER_LIBICONV
230cp -f ../config/config.guess build-aux
231cp -f ../config/config.sub build-aux
232cp -f ../config/config.guess libcharset/build-aux
233cp -f ../config/config.sub libcharset/build-aux
234./configure $C --enable-shared
9fc8b952 235make lib/localcharset.h $V
85b46172 236cd libcharset
9fc8b952
UH
237make $PARALLEL $V
238make install $V
85b46172 239cd ../lib
9fc8b952
UH
240make $PARALLEL $V
241make install $V
85b46172
MC
242cd ..
243test -d $PREFIX/include || mkdir $PREFIX/include
244cp include/iconv.h.inst $PREFIX/include/iconv.h
245cd ..
0832e7d6 246
87ea3974 247# gettext (needed for glib)
ec49447e 248$WGET http://ftp.gnu.org/pub/gnu/gettext/gettext-$VER_GETTEXT.tar.gz
87ea3974
MC
249tar xfz gettext-$VER_GETTEXT.tar.gz
250cd gettext-$VER_GETTEXT
251./configure $C --enable-shared --disable-libasprintf
252cd gettext-runtime
9fc8b952
UH
253make $PARALLEL $V
254make install $V
87ea3974 255cd ../..
0832e7d6
UH
256
257# zlib (needed for glib and libzip)
ec49447e 258$WGET http://zlib.net/zlib-$VER_ZLIB.tar.gz
25b2b9f5 259tar xfz zlib-$VER_ZLIB.tar.gz
167cb16e
UH
260cd zlib-$VER_ZLIB
261# Note: zlib's configure doesn't understand --host, we need to pass $CC.
890c9708 262CC="$TOOLCHAIN_TRIPLET-gcc $SYSROOT" ./configure --prefix=$PREFIX
9fc8b952
UH
263make $PARALLEL $V
264make install $V
167cb16e 265cd ..
0832e7d6
UH
266
267# pcre (needed for glib)
ec49447e 268$WGET ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-$VER_PCRE.tar.gz
25b2b9f5 269tar xfz pcre-$VER_PCRE.tar.gz
85c9910a 270cd pcre-$VER_PCRE
091ed535 271./configure $C --disable-cpp
9fc8b952
UH
272make $PARALLEL $V
273make install $V
85c9910a 274cd ..
0832e7d6
UH
275
276# libffi (needed for glib)
ec49447e 277$WGET ftp://sourceware.org/pub/libffi/libffi-$VER_LIBFFI.tar.gz
0832e7d6
UH
278tar xfz libffi-$VER_LIBFFI.tar.gz
279cd libffi-$VER_LIBFFI
c28fee03 280./configure $C
9fc8b952
UH
281make $PARALLEL $V
282make install $V
0832e7d6
UH
283cd ..
284
e25d7d5a 285# glib (needed for libsigrok)
ec49447e 286$WGET http://ftp.gnome.org/pub/gnome/sources/glib/$VER_GLIB_SHORT/glib-$VER_GLIB.tar.xz
25b2b9f5 287tar xfJ glib-$VER_GLIB.tar.xz
f7b8aa73 288cd glib-$VER_GLIB
c38bb075 289NOCONFIGURE=yes ./autogen.sh
559be0ff 290# Note: Manual LDFLAGS/CPPFLAGS needed for libiconv, rest uses pkg-config.
e2bb3ab1 291LDFLAGS=-L$PREFIX/lib CPPFLAGS=-I$PREFIX/include glib_cv_stack_grows=no glib_cv_uscore=no ac_cv_func_posix_getpwuid_r=no ac_cv_func_posix_getgrgid_r=no ./configure --disable-compile-warnings $C
9fc8b952
UH
292make $PARALLEL $V
293make install $V
f0e760bb 294cd ..
0832e7d6 295
e25d7d5a 296# libzip (needed for libsigrok)
ec49447e 297$WGET http://www.nih.at/libzip/libzip-$VER_LIBZIP.tar.gz
0832e7d6
UH
298tar xfz libzip-$VER_LIBZIP.tar.gz
299cd libzip-$VER_LIBZIP
300cp -f ../config/config.guess .
301cp -f ../config/config.sub .
c28fee03 302./configure $C
9fc8b952
UH
303make $PARALLEL $V
304make install $V
0832e7d6
UH
305cd ..
306
e25d7d5a 307# libusb-1.0 (needed for libsigrok)
d4069d6e
UH
308$WGET http://$SF_MIRROR/project/libusb/libusb-1.0/libusb-$VER_LIBUSB/libusb-$VER_LIBUSB.tar.bz2
309tar xfj libusb-$VER_LIBUSB.tar.bz2
310cd libusb-$VER_LIBUSB
c09c85b3 311patch -p1 < ../../libusb-1.0.patch
6907ee7e 312./configure $C --disable-udev
9fc8b952
UH
313make $PARALLEL $V
314make install $V
13b2dfdc
MC
315cd ..
316
e25d7d5a 317# libftdi1 (needed for libsigrok)
7966c37c
MC
318$WGET http://www.intra2net.com/en/developer/libftdi/download/libftdi1-$VER_LIBFTDI1.tar.bz2
319tar xfj libftdi1-$VER_LIBFTDI1.tar.bz2
320cd libftdi1-$VER_LIBFTDI1
9773a798 321cmake $CM -DFTDIPP=no -DDOCUMENTATION=no -DEXAMPLES=no -DFTDI_EEPROM=no -DPYTHON_BINDINGS=no .
9fc8b952
UH
322make $PARALLEL $V
323make install $V
7966c37c
MC
324cd ..
325
900a8684 326# libserialport
a51ca6bd 327$GIT_CLONE git://sigrok.org/libserialport
900a8684
ML
328cd libserialport
329./autogen.sh
67b2de8a
UH
330mkdir build
331cd build
332../configure $C
9fc8b952
UH
333make $PARALLEL $V
334make install $V
67b2de8a 335cd ../..
900a8684 336
2fddc139
MC
337# Build dependencies for libsigrok bindings if needed
338
339if [ x"$CPPFLAGS_STL" != x ]; then
340
341 # libsigc++ (needed for glibmm)
342 $WGET http://ftp.gnome.org/pub/gnome/sources/libsigc++/$VER_LIBSIGCXX_SHORT/libsigc++-$VER_LIBSIGCXX.tar.xz
25b2b9f5 343 tar xfJ libsigc++-$VER_LIBSIGCXX.tar.xz
2fddc139
MC
344 cd libsigc++-$VER_LIBSIGCXX
345 cp -f ../config/config.guess build
346 cp -f ../config/config.sub build
9773a798 347 CPPFLAGS="$CPPFLAGS_STL" LDFLAGS="$LDFLAGS_STL -lgnustl_shared" ./configure --disable-documentation $C
9fc8b952
UH
348 make $PARALLEL $V
349 make install $V
2fddc139
MC
350 cd ..
351
352 # glibmm (needed for libsigrok bindings)
353 $WGET http://ftp.gnome.org/pub/gnome/sources/glibmm/$VER_GLIB_SHORT/glibmm-$VER_GLIB.tar.xz
25b2b9f5 354 tar xfJ glibmm-$VER_GLIB.tar.xz
2fddc139 355 cd glibmm-$VER_GLIB
9773a798 356 CPPFLAGS="$CPPFLAGS_STL" LDFLAGS="$LDFLAGS_STL -lgnustl_shared" ./configure --disable-documentation $C
9fc8b952
UH
357 make $PARALLEL $V
358 make install $V
2fddc139
MC
359 cd ..
360
361fi
362
c062d1dc 363# libsigrok
a51ca6bd 364$GIT_CLONE git://sigrok.org/libsigrok
c062d1dc
MC
365cd libsigrok
366./autogen.sh
67b2de8a
UH
367mkdir build
368cd build
369CPPFLAGS="$CPPFLAGS_STL" LDFLAGS="$LDFLAGS_STL" ../configure $C $BINDINGS_CONFIG --datadir=/sdcard
9fc8b952
UH
370make $PARALLEL $V
371make datadir='$(datarootdir)' install $V
67b2de8a 372cd ../..
02c87af2 373
2fbea156 374# libsigrokdecode
a51ca6bd 375$GIT_CLONE git://sigrok.org/libsigrokdecode
2fbea156
ML
376cd libsigrokdecode
377./autogen.sh
67b2de8a
UH
378mkdir build
379cd build
380../configure $C
9fc8b952
UH
381make $PARALLEL $V
382make install $V
67b2de8a 383cd ../..
2fbea156
ML
384
385# sigrok-cli
a51ca6bd 386$GIT_CLONE git://sigrok.org/sigrok-cli
2fbea156
ML
387cd sigrok-cli
388./autogen.sh
67b2de8a
UH
389mkdir build
390cd build
391../configure $C
9fc8b952
UH
392make $PARALLEL $V
393make install $V
67b2de8a 394cd ../..
819eb05b 395
e25d7d5a 396# Check if we have all requirements to build PulseView:
11b9792e
MC
397
398if [ -z "$ANDROID_NDK" -o ! -d "$ANDROID_NDK" ]; then
e25d7d5a 399 echo "Android NDK not available, not building PulseView."
11b9792e
MC
400 exit 0
401fi
402
6e39ae14
JS
403if [ -z "$ANDROID_SDK" -o ! -d "$ANDROID_SDK"/platforms/android-$VER_AND_API ]; then
404 echo "Android SDK with platform $VER_AND_API not available, not building PulseView."
11b9792e
MC
405 exit 0
406fi
407
e25d7d5a
UH
408if [ ! -e "${ANDROID_SDK}/tools/android" ]; then
409 echo "Essential Android build tools not available, not building PulseView."
11b9792e
MC
410 exit 0
411fi
412
11b9792e
MC
413NDK_HOST=`"$ANDROID_NDK/ndk-build" -p 2>/dev/null | awk '$1 == "HOST_TAG" { print $3 }'`
414
e25d7d5a 415# Boost (needed for PulseView)
11b9792e
MC
416$WGET http://$SF_MIRROR/project/boost/boost/$VER_BOOST/boost_${VER_BOOST//./_}.tar.bz2
417tar xfj boost_${VER_BOOST//./_}.tar.bz2
418cd boost_${VER_BOOST//./_}
0369c8a6 419CC= ./bootstrap.sh --with-toolset=gcc --with-libraries=filesystem,system,thread,test --without-icu
890c9708 420echo "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
0263ef05 421./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
11b9792e
MC
422cd ..
423
e25d7d5a 424# Qt (needed for PulseView)
7b888971
MC
425$WGET http://download.qt-project.org/official_releases/qt/${VER_QT%.*}/${VER_QT}/single/qt-everywhere-opensource-src-${VER_QT}.tar.gz
426tar xfz qt-everywhere-opensource-src-${VER_QT}.tar.gz
427cd qt-everywhere-opensource-src-${VER_QT}
11b9792e 428patch -p1 < ../../android-qt.patch
6e39ae14
JS
429CC= CXX= ./configure \
430 --prefix="$PREFIX" \
431 -developer-build \
432 -xplatform android-g++ \
433 -nomake tests \
434 -nomake examples \
435 -android-sdk "$ANDROID_SDK" \
436 -android-ndk "$ANDROID_NDK" \
437 -android-ndk-host "$NDK_HOST" \
438 -android-arch "$TARGET_ARCH" \
439 -android-toolchain-version "$NDK_TOOLCHAIN_VERSION" \
440 -skip qttranslations \
441 -skip qtwebkit \
442 -skip qtserialport \
443 -skip qtwebkit-examples \
444 -skip qtlocation \
445 -skip qtconnectivity \
446 -opensource -confirm-license -silent
447export ANDROID_API_VERSION=android-$VER_AND_API
448export ANDROID_BUILD_TOOLS_REVISION=$VER_AND_BT
9fc8b952
UH
449make module-qtbase module-qtandroidextras module-qtsvg module-qtimageformats $PARALLEL $V
450make install $V
11b9792e 451cd ..
5d1a9a53 452
7d3d2c0c 453# sigrok-androidutils
621e2e6e 454$GIT_CLONE git://sigrok.org/sigrok-androidutils
7d3d2c0c
MC
455cd sigrok-androidutils
456./autogen.sh
6e39ae14 457./configure $C --with-android-sdk="${ANDROID_SDK}" --with-android-platform=android-$VER_AND_API
9fc8b952
UH
458make $PARALLEL $V
459make install $V
7d3d2c0c
MC
460cd ..
461
f6a6d164
UH
462# Strip all shared libs to reduce size.
463find $PREFIX -iname "*.so" -exec ${TOOLCHAIN_TRIPLET}-strip -S {} \;
464
5d1a9a53 465# PulseView
621e2e6e 466$GIT_CLONE git://sigrok.org/pulseview
5d1a9a53 467cd pulseview
0369c8a6 468cmake $CM -DENABLE_TESTS=y .
9fc8b952
UH
469make $PARALLEL $V
470make install $V
f6a6d164 471${TOOLCHAIN_TRIPLET}-strip -S libs/$TARGET_ARCH/libpulseview.so
1238f785 472cd android
6e39ae14 473"${ANDROID_SDK}/tools/android" update project -p . -t android-$VER_AND_API -n PulseView
aef0361e
MC
474ant debug
475cd ../..