X-Git-Url: https://sigrok.org/gitweb/?p=sigrok-util.git;a=blobdiff_plain;f=cross-compile%2Fandroid%2Fsigrok-cross-android;h=adeee91bcf9b764f62de9e6d86d1458403cc521c;hp=eeb0ebb839d0bb618fd351e362c80612a05deb5f;hb=7cf8cc4a916b0a13d4b478d27f343b38bf382664;hpb=0369c8a6b15b91e206f2db856919d2df42ff8939 diff --git a/cross-compile/android/sigrok-cross-android b/cross-compile/android/sigrok-cross-android index eeb0ebb..adeee91 100755 --- a/cross-compile/android/sigrok-cross-android +++ b/cross-compile/android/sigrok-cross-android @@ -26,7 +26,7 @@ set -e ANDROID_PATH=$HOME/android # The path where the Android NDK is located. -ANDROID_NDK=$ANDROID_PATH/android-ndk-r10d +ANDROID_NDK=$ANDROID_PATH/android-ndk-r10e # The path where the Android SDK is located. ANDROID_SDK=$ANDROID_PATH/android-sdk-linux @@ -62,26 +62,31 @@ PARALLEL="-j 2" # ----------------------------------------------------------------------------- VER_LIBICONV=1.14 -VER_GETTEXT=0.19.4 +VER_GETTEXT=0.19.7 VER_ZLIB=1.2.8 -VER_PCRE=8.36 +VER_PCRE=8.38 VER_LIBFFI=3.2.1 -VER_GLIB=2.43.3 -VER_GLIB_SHORT=2.43 -VER_LIBSIGCXX=2.4.0 -VER_LIBSIGCXX_SHORT=2.4 -VER_LIBZIP=0.11.2 +VER_GLIB=2.47.5 +VER_GLIB_SHORT=2.47 +VER_GLIBMM=2.47.4 +VER_GLIBMM_SHORT=2.47 +VER_LIBSIGCXX=2.6.2 +VER_LIBSIGCXX_SHORT=2.6 +VER_LIBZIP=1.1 VER_LIBFTDI1=1.2 VER_LIBUSB=1.0.19 VER_PYTHON=3.3.3 -VER_BOOST=1.57.0 -VER_QT=5.3.1 -VER_NDK=10d -VER_SDK=23.0.2 +VER_BOOST=1.58.0 +VER_QT=5.5.1 +VER_SIGROK_FIRMWARE_FX2LAFW=0.1.3 +VER_NDK=10e +VER_SDK=24.4.1 +VER_AND_BT=23.0.2 # Android build tools version +VER_AND_API=16 # Target Android API version -SF_MIRROR=switch.dl.sourceforge.net +SF_MIRROR=download.sourceforge.net -WGET="wget --quiet" +WGET="wget -c --quiet" GIT_CLONE="git clone --depth=1" case "$TOOLCHAIN_TRIPLET" in @@ -101,18 +106,24 @@ if [ "x$1" = "xprepare" ]; then # NDK $WGET http://dl.google.com/android/ndk/android-ndk-r$VER_NDK-linux-x86.bin chmod 700 android-ndk-r$VER_NDK-linux-x86.bin - ./android-ndk-r$VER_NDK-linux-x86.bin + ./android-ndk-r$VER_NDK-linux-x86.bin -y cd android-ndk-r$VER_NDK - ./build/tools/make-standalone-toolchain.sh --platform=android-16 \ + ./build/tools/make-standalone-toolchain.sh --platform=android-$VER_AND_API \ --toolchain=arm-linux-androideabi-4.9 \ --install-dir=$ANDROID_PATH/android-arm-toolchain + ./build/tools/make-standalone-toolchain.sh --platform=android-$VER_AND_API \ + --toolchain=x86-4.9 \ + --install-dir=$ANDROID_PATH/android-i686-toolchain + ./build/tools/make-standalone-toolchain.sh --platform=android-$VER_AND_API \ + --toolchain=mipsel-linux-android-4.9 \ + --install-dir=$ANDROID_PATH/android-mipsel-toolchain cd .. # SDK $WGET http://dl.google.com/android/android-sdk_r$VER_SDK-linux.tgz tar xfz android-sdk_r$VER_SDK-linux.tgz cd android-sdk-linux - ./tools/android update sdk --no-ui --filter platform-tools,build-tools-21.1.2,android-8,android-10,android-11,android-14,android-16 + echo y | ./tools/android update sdk --no-ui --all --filter platform-tools,build-tools-$VER_AND_BT,android-$VER_AND_API cd .. exit @@ -153,7 +164,7 @@ if test -d "$TOOLCHAIN"/sysroot; then SYSROOT= else STANDALONE_TOOLCHAIN= - NATIVE_API_LEVEL=16 + NATIVE_API_LEVEL=$VER_AND_API SYSROOT_DIR=${ANDROID_NDK}/platforms/android-${NATIVE_API_LEVEL}/arch-${TARGET_ARCH%eabi*} if [ ! -d "$SYSROOT_DIR" ]; then echo >&2 "Can't build with NDK toolchain; sysroot $SYSROOT_DIR is missing" @@ -212,6 +223,8 @@ autoreconf patch -p1 < ../../Python-$VER_PYTHON.patch ac_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 sed -i "s/^#zlib/zlib/g" Modules/Setup +sed -i "s/^#math/math/g" Modules/Setup +sed -i "s/^#time/time/g" Modules/Setup make PYTHON_FOR_BUILD='_PYTHON_HOST_PLATFORM=$(_PYTHON_HOST_PLATFORM) ./hostpython' install $V cd .. @@ -310,7 +323,7 @@ cd .. $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=no -DDOCUMENTATION=no -DEXAMPLES=no -DFTDI_EEPROM=no -DPYTHON_BINDINGS=no . +cmake $CM -DFTDIPP=no -DDOCUMENTATION=no -DEXAMPLES=no -DFTDI_EEPROM=no -DPYTHON_BINDINGS=no -DBUILD_TESTS=n . make $PARALLEL $V make install $V cd .. @@ -342,9 +355,9 @@ if [ x"$CPPFLAGS_STL" != x ]; then cd .. # glibmm (needed for libsigrok bindings) - $WGET http://ftp.gnome.org/pub/gnome/sources/glibmm/$VER_GLIB_SHORT/glibmm-$VER_GLIB.tar.xz - tar xfJ glibmm-$VER_GLIB.tar.xz - cd glibmm-$VER_GLIB + $WGET http://ftp.gnome.org/pub/gnome/sources/glibmm/$VER_GLIBMM_SHORT/glibmm-$VER_GLIBMM.tar.xz + tar xfJ glibmm-$VER_GLIBMM.tar.xz + cd glibmm-$VER_GLIBMM CPPFLAGS="$CPPFLAGS_STL" LDFLAGS="$LDFLAGS_STL -lgnustl_shared" ./configure --disable-documentation $C make $PARALLEL $V make install $V @@ -374,6 +387,24 @@ make $PARALLEL $V make install $V cd ../.. +# sigrok-firmware +$GIT_CLONE git://sigrok.org/sigrok-firmware +cd sigrok-firmware +./autogen.sh +mkdir build +cd build +../configure $C +make $PARALLEL $V +make install $V +cd ../.. + +# sigrok-firmware-fx2lafw +$WGET http://sigrok.org/download/binary/sigrok-firmware-fx2lafw/sigrok-firmware-fx2lafw-bin-$VER_SIGROK_FIRMWARE_FX2LAFW.tar.gz +tar xfz sigrok-firmware-fx2lafw-bin-$VER_SIGROK_FIRMWARE_FX2LAFW.tar.gz +cd sigrok-firmware-fx2lafw-bin-$VER_SIGROK_FIRMWARE_FX2LAFW +cp *.fw $PREFIX/share/sigrok-firmware/ +cd .. + # sigrok-cli $GIT_CLONE git://sigrok.org/sigrok-cli cd sigrok-cli @@ -392,13 +423,8 @@ if [ -z "$ANDROID_NDK" -o ! -d "$ANDROID_NDK" ]; then exit 0 fi -if [ -z "$ANDROID_SDK" -o \ - ! -d "$ANDROID_SDK"/platforms/android-8 -o \ - ! -d "$ANDROID_SDK"/platforms/android-10 -o \ - ! -d "$ANDROID_SDK"/platforms/android-11 -o \ - ! -d "$ANDROID_SDK"/platforms/android-14 -o \ - ! -d "$ANDROID_SDK"/platforms/android-16 ]; then - echo "Android SDK with platforms 8 10 11 14 16 not available, not building PulseView." +if [ -z "$ANDROID_SDK" -o ! -d "$ANDROID_SDK"/platforms/android-$VER_AND_API ]; then + echo "Android SDK with platform $VER_AND_API not available, not building PulseView." exit 0 fi @@ -423,7 +449,34 @@ $WGET http://download.qt-project.org/official_releases/qt/${VER_QT%.*}/${VER_QT} tar xfz qt-everywhere-opensource-src-${VER_QT}.tar.gz cd qt-everywhere-opensource-src-${VER_QT} patch -p1 < ../../android-qt.patch -CC= CXX= ./configure --prefix="$PREFIX" -developer-build -xplatform android-g++ -nomake tests -nomake examples -android-sdk "$ANDROID_SDK" -android-ndk "$ANDROID_NDK" -android-ndk-host "$NDK_HOST" -android-arch "$TARGET_ARCH" -android-toolchain-version "$NDK_TOOLCHAIN_VERSION" -skip qttranslations -skip qtwebkit -skip qtserialport -skip qtwebkit-examples -skip qtlocation -skip qtconnectivity -opensource -confirm-license -silent +CC= CXX= ./configure \ + --prefix="$PREFIX" \ + -developer-build \ + -xplatform android-g++ \ + -nomake tests \ + -nomake examples \ + -android-sdk "$ANDROID_SDK" \ + -android-ndk "$ANDROID_NDK" \ + -android-ndk-host "$NDK_HOST" \ + -android-arch "$TARGET_ARCH" \ + -android-toolchain-version "$NDK_TOOLCHAIN_VERSION" \ + -skip qtconnectivity \ + -skip qtdeclarative \ + -skip qtlocation \ + -skip qtmultimedia \ + -skip qtscript \ + -skip qtsensors \ + -skip qtserialport \ + -skip qttools \ + -skip qttranslations \ + -skip qtwebchannel \ + -skip qtwebkit \ + -skip qtwebkit-examples \ + -skip qtwebsockets \ + -skip qtxmlpatterns \ + -opensource -confirm-license -silent +export ANDROID_API_VERSION=android-$VER_AND_API +export ANDROID_BUILD_TOOLS_REVISION=$VER_AND_BT make module-qtbase module-qtandroidextras module-qtsvg module-qtimageformats $PARALLEL $V make install $V cd .. @@ -432,7 +485,7 @@ cd .. $GIT_CLONE git://sigrok.org/sigrok-androidutils cd sigrok-androidutils ./autogen.sh -./configure $C --with-android-sdk="${ANDROID_SDK}" +./configure $C --with-android-sdk="${ANDROID_SDK}" --with-android-platform=android-$VER_AND_API make $PARALLEL $V make install $V cd .. @@ -443,12 +496,11 @@ find $PREFIX -iname "*.so" -exec ${TOOLCHAIN_TRIPLET}-strip -S {} \; # PulseView $GIT_CLONE git://sigrok.org/pulseview cd pulseview +patch -p1 < ../../pv_cmake_pkgconfig_fix.patch cmake $CM -DENABLE_TESTS=y . make $PARALLEL $V -make install $V ${TOOLCHAIN_TRIPLET}-strip -S libs/$TARGET_ARCH/libpulseview.so cd android -"${ANDROID_SDK}/tools/android" update project -p . -t android-14 -n PulseView +"${ANDROID_SDK}/tools/android" update project -p . -t android-$VER_AND_API -n PulseView ant debug cd ../.. -