X-Git-Url: http://sigrok.org/gitweb/?a=blobdiff_plain;f=cross-compile%2Fandroid%2Fsigrok-cross-android;h=356e8083a36ea5c3d1e9ecf6f743f0964f7e1213;hb=HEAD;hp=d024c7f6751b4eb3d26aeb6f918dd730e09c10e1;hpb=a4c5908972c114c7c9608e599fe2ea05ec5db501;p=sigrok-util.git
diff --git a/cross-compile/android/sigrok-cross-android b/cross-compile/android/sigrok-cross-android
index d024c7f..356e808 100755
--- a/cross-compile/android/sigrok-cross-android
+++ b/cross-compile/android/sigrok-cross-android
@@ -16,8 +16,7 @@
## 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 .
##
set -e
@@ -32,17 +31,12 @@ ANDROID_NDK=$ANDROID_PATH/android-ndk-r10e
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-mipsel-toolchain
-# TOOLCHAIN=$ANDROID_PATH/android-i686-toolchain
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
# Select which Android toolchain to use.
# Don't forget to also adapt TOOLCHAIN above if you change TOOLCHAIN_TRIPLET!
TOOLCHAIN_TRIPLET=arm-linux-androideabi
-# TOOLCHAIN_TRIPLET=mipsel-linux-android
# TOOLCHAIN_TRIPLET=i686-linux-android
# The path where the cross-compiled packages will be installed.
@@ -63,7 +57,7 @@ PARALLEL="-j 2"
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
@@ -79,7 +73,7 @@ VER_PYTHON=3.3.3
VER_BOOST=1.58.0
VER_QT=5.6.0
VER_QT_SHORT=5.6
-VER_SIGROK_FIRMWARE_FX2LAFW=0.1.3
+VER_SIGROK_FIRMWARE_FX2LAFW=0.1.6
VER_NDK=10e
VER_SDK=24.4.1
VER_AND_BT=23.0.2 # Android build tools version
@@ -90,9 +84,10 @@ SF_MIRROR=download.sourceforge.net
WGET="wget -c --quiet"
GIT_CLONE="git clone --depth=1"
+REPO_BASE="git://sigrok.org"
+
case "$TOOLCHAIN_TRIPLET" in
arm*) TARGET_ARCH=armeabi;;
- mips*) TARGET_ARCH=mips;;
i686*) TARGET_ARCH=x86;;
*) echo >&2 "Unknown prefix for TOOLCHAIN_TRIPLET."; exit 1;;
esac
@@ -115,9 +110,6 @@ if [ "x$1" = "xprepare" ]; then
./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
@@ -190,6 +182,7 @@ else
CM="$CM -DANDROID_NDK=${ANDROID_NDK}"
CM="$CM -DANDROID_NATIVE_API_LEVEL=${NATIVE_API_LEVEL}"
CM="$CM -DANDROID_TOOLCHAIN_NAME=${TOOLCHAIN_TRIPLET}-${NDK_TOOLCHAIN_VERSION}"
+ CM="$CM -DCMAKE_MAKE_PROGRAM=${ANDROID_NDK}/prebuilt/linux-x86/bin/make"
fi
# Look for STL, needed to build bindings
@@ -226,6 +219,7 @@ ac_cv_file__dev_ptmx=no ac_cv_file__dev_ptc=no ac_cv_func_pipe2=no ac_cv_func_fd
sed -i "s/^#zlib/zlib/g" Modules/Setup
sed -i "s/^#math/math/g" Modules/Setup
sed -i "s/^#time/time/g" Modules/Setup
+sed -i "s/^#_struct/_struct/g" Modules/Setup
make PYTHON_FOR_BUILD='_PYTHON_HOST_PLATFORM=$(_PYTHON_HOST_PLATFORM) ./hostpython' install $V
cd ..
@@ -271,7 +265,7 @@ make install $V
cd ..
# pcre (needed for glib)
-$WGET ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-$VER_PCRE.tar.gz
+$WGET https://ftp.pcre.org/pub/pcre/pcre-$VER_PCRE.tar.gz
tar xfz pcre-$VER_PCRE.tar.gz
cd pcre-$VER_PCRE
./configure $C --disable-cpp --enable-utf --enable-unicode-properties
@@ -330,7 +324,7 @@ make install $V
cd ..
# libserialport
-$GIT_CLONE git://sigrok.org/libserialport
+$GIT_CLONE $REPO_BASE/libserialport
cd libserialport
./autogen.sh
mkdir build
@@ -367,7 +361,7 @@ if [ x"$CPPFLAGS_STL" != x ]; then
fi
# libsigrok
-$GIT_CLONE git://sigrok.org/libsigrok
+$GIT_CLONE $REPO_BASE/libsigrok
cd libsigrok
./autogen.sh
mkdir build
@@ -378,7 +372,7 @@ make datadir='$(datarootdir)' install $V
cd ../..
# libsigrokdecode
-$GIT_CLONE git://sigrok.org/libsigrokdecode
+$GIT_CLONE $REPO_BASE/libsigrokdecode
cd libsigrokdecode
./autogen.sh
mkdir build
@@ -389,7 +383,7 @@ make install $V
cd ../..
# sigrok-firmware
-$GIT_CLONE git://sigrok.org/sigrok-firmware
+$GIT_CLONE $REPO_BASE/sigrok-firmware
cd sigrok-firmware
./autogen.sh
mkdir build
@@ -407,7 +401,7 @@ cp *.fw $PREFIX/share/sigrok-firmware/
cd ..
# sigrok-cli
-$GIT_CLONE git://sigrok.org/sigrok-cli
+$GIT_CLONE $REPO_BASE/sigrok-cli
cd sigrok-cli
./autogen.sh
mkdir build
@@ -441,13 +435,13 @@ $WGET http://$SF_MIRROR/project/boost/boost/$VER_BOOST/boost_${VER_BOOST//./_}.t
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
+CC= ./bootstrap.sh --with-toolset=gcc --with-libraries=filesystem,system,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
cd ..
# Qt (needed for PulseView)
-$WGET http://download.qt.io/official_releases/qt/${VER_QT_SHORT}/${VER_QT}/single/qt-everywhere-opensource-src-${VER_QT}.tar.xz
+$WGET https://download.qt.io/new_archive/qt/${VER_QT_SHORT}/${VER_QT}/single/qt-everywhere-opensource-src-${VER_QT}.tar.xz
tar xfi qt-everywhere-opensource-src-${VER_QT}.tar.xz
cd qt-everywhere-opensource-src-${VER_QT}
patch -p1 < ../../android-qt.patch
@@ -463,26 +457,23 @@ CC= CXX= ./configure \
-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 qtwebsockets \
-skip qtxmlpatterns \
- -opensource -confirm-license -silent
+ -opensource -confirm-license -silent -no-warnings-are-errors
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 module-qtbase module-qtandroidextras module-qtsvg module-qtimageformats module-qttranslations $PARALLEL $V
make install $V
cd ..
# sigrok-androidutils
-$GIT_CLONE git://sigrok.org/sigrok-androidutils
+$GIT_CLONE $REPO_BASE/sigrok-androidutils
cd sigrok-androidutils
./autogen.sh
./configure $C --with-android-sdk="${ANDROID_SDK}" --with-android-platform=android-$VER_AND_API
@@ -494,9 +485,10 @@ cd ..
find $PREFIX -iname "*.so" -exec ${TOOLCHAIN_TRIPLET}-strip -S {} \;
# PulseView
-$GIT_CLONE git://sigrok.org/pulseview
+$GIT_CLONE $REPO_BASE/pulseview
cd pulseview
patch -p1 < ../../pv_cmake_pkgconfig_fix.patch
+sed -i -e "s,\t\tandroid:versionName=.*$,\t\tandroid:versionName=\"`date -Iseconds`\"," android/AndroidManifest.xml
cmake $CM -DENABLE_TESTS=y .
make $PARALLEL $V
${TOOLCHAIN_TRIPLET}-strip -S libs/$TARGET_ARCH/libpulseview.so