X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=cross-compile%2Fandroid%2Fsigrok-cross-android;h=96224755e0b147b75c13aed2fca73ef8985ebeca;hb=226830e4d852609d0a219acadef34efd9f070de1;hp=ffec214b7991c55edbecf69cf15b01882a140371;hpb=c28fee03ac2572f7c86e88d3e21ecb3bc5c97673;p=sigrok-util.git diff --git a/cross-compile/android/sigrok-cross-android b/cross-compile/android/sigrok-cross-android index ffec214..9622475 100755 --- a/cross-compile/android/sigrok-cross-android +++ b/cross-compile/android/sigrok-cross-android @@ -36,7 +36,7 @@ BUILDDIR=./sr_android_build VER_LIBICONV=1.14 VER_GETTEXT=0.18.2 -VER_ZLIB=1.2.7 +VER_ZLIB=1.2.8 VER_PCRE=8.32 VER_LIBFFI=3.0.11 VER_GLIB=2.34.3 @@ -51,9 +51,12 @@ SF_MIRROR=switch.dl.sourceforge.net # We need to find tools in the toolchain and in the install directory. export PATH=$PREFIX/bin:$TOOLCHAIN/bin:$PATH +# Tell pkg-config to only look for our cross-built stuff +export PKG_CONFIG_LIBDIR="$PREFIX/lib/pkgconfig" +export -n PKG_CONFIG_PATH + # Define some helper variables. C="--host=arm-linux-androideabi --prefix=$PREFIX" -P="$PREFIX/lib/pkgconfig" # Remove build directory contents (if any) and create a new build dir. rm -rf $BUILDDIR @@ -65,29 +68,36 @@ git clone git://git.savannah.gnu.org/config.git # ----------------------------------------------------------------------------- -## # TODO: Doesn't build yet. -## # libiconv (needed for glib) -## wget http://ftp.gnu.org/pub/gnu/libiconv/libiconv-$VER_LIBICONV.tar.gz -## tar xfz libiconv-$VER_LIBICONV.tar.gz -## cd libiconv-$VER_LIBICONV -## cp -f ../config/config.guess build-aux -## cp -f ../config/config.sub build-aux -## cp -f ../config/config.guess libcharset/build-aux -## cp -f ../config/config.sub libcharset/build-aux -## ./configure $C -## make -## make install -## cd .. - -## # TODO: Needs libiconv -## # gettext (needed for glib) -## wget http://ftp.gnu.org/pub/gnu/gettext/gettext-$VER_GETTEXT.tar.gz -## tar xfz gettext-$VER_GETTEXT.tar.gz -## cd gettext-$VER_GETTEXT -## ./configure $C -## make -## make install -## cd .. +# libiconv (needed for glib) +wget http://ftp.gnu.org/pub/gnu/libiconv/libiconv-$VER_LIBICONV.tar.gz +tar xfz libiconv-$VER_LIBICONV.tar.gz +cd libiconv-$VER_LIBICONV +cp -f ../config/config.guess build-aux +cp -f ../config/config.sub build-aux +cp -f ../config/config.guess libcharset/build-aux +cp -f ../config/config.sub libcharset/build-aux +./configure $C --enable-shared +make lib/localcharset.h +cd libcharset +make +make install +cd ../lib +make +make install +cd .. +test -d $PREFIX/include || mkdir $PREFIX/include +cp include/iconv.h.inst $PREFIX/include/iconv.h +cd .. + +# gettext (needed for glib) +wget http://ftp.gnu.org/pub/gnu/gettext/gettext-$VER_GETTEXT.tar.gz +tar xfz gettext-$VER_GETTEXT.tar.gz +cd gettext-$VER_GETTEXT +./configure $C --enable-shared --disable-libasprintf +cd gettext-runtime +make +make install +cd ../.. # zlib (needed for glib and libzip) wget http://zlib.net/zlib-$VER_ZLIB.tar.gz @@ -103,7 +113,7 @@ cd .. wget ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-$VER_PCRE.tar.gz tar xfvz pcre-$VER_PCRE.tar.gz cd pcre-$VER_PCRE -./configure $C +./configure $C --disable-cpp make make install cd .. @@ -117,15 +127,16 @@ make make install cd .. -## # TODO: Not all build-dependencies build, yet. -## # glib -## wget ftp://ftp.gnome.org/pub/gnome/sources/glib/2.34/glib-$VER_GLIB.tar.xz -## tar xfJ glib-$VER_GLIB.tar.xz -## cd glib-$VER_GLIB -## ./configure $C -## make -## make install -## cd .. +# glib +wget https://github.com/djdeath/glib/archive/android.zip +unzip -q android.zip +cd glib-android +./autogen.sh +# Note: Manual LDFLAGS/CPPFLAGS needed for libiconv, rest uses pkg-config. +LDFLAGS=-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 $C --disable-modular-tests +make +make install +cd .. # libzip wget http://www.nih.at/libzip/libzip-$VER_LIBZIP.tar.gz @@ -145,8 +156,9 @@ cd libusb-$VER_LIBUSB cp -f ../config/config.guess . cp -f ../config/config.sub . ./configure $C -make -make install +# explicitly exclude libusbpp.la from lib_LTLIBRARIES, and skip subdirs +make lib_LTLIBRARIES=libusb.la SUBDIRS=. +make lib_LTLIBRARIES=libusb.la SUBDIRS=. install cd .. # libftdi @@ -160,3 +172,11 @@ make make install cd .. +# libsigrok +git clone git://sigrok.org/libsigrok +cd libsigrok +./autogen.sh +LDFLAGS=-L$PREFIX/lib CPPFLAGS="-I$PREFIX/include -I$PREFIX/lib/libzip/include" ./configure $C --disable-alsa --disable-link-mso19 --disable-kecheng-kc-330b +make +make install +cd ..