Created
January 9, 2015 17:35
gnutls build system is horrid...
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SRC_nettle="http://www.lysator.liu.se/~nisse/archive/nettle-2.7.1.tar.gz" | |
SRC_libtasn1="http://distfiles.gentoo.org/distfiles/libtasn1-4.2.tar.gz" | |
SRC_gmp="http://distfiles.gentoo.org/distfiles/gmp-6.0.0a.tar.xz" | |
SRC_gnutls="http://distfiles.gentoo.org/distfiles/gnutls-3.3.11.tar.xz" | |
#AUTOTOOL_SRC="gmp nettle libtasn1 gnutls" | |
AUTOTOOL_SRC="gmp nettle libtasn1 gnutls" | |
ROOTDIR="$PWD"; | |
DESTDIR="$PWD/dist" | |
SRCDIR="$PWD/src" | |
BUILDDIR="$PWD/build" | |
CFLAGS="-march=armv7-a -mfloat-abi=softfp -I$DESTDIR/usr/include" | |
LDFLAGS="-Wl,--fix-cortex-a8 -L$DESTDIR/usr/lib" | |
SYSROOT="${NDK}/platforms/android-3/arch-arm/" | |
CC=arm-linux-androideabi-gcc-4.8 | |
CHOST=arm-linux-androideabi | |
fetch() { | |
mkdir -p "$SRCDIR" | |
for a in $AUTOTOOL_SRC; do | |
eval url=\$SRC_$a | |
echo $a | |
wget -P "$SRCDIR" $url | |
done | |
touch .fetch | |
} | |
build() { | |
pushd $1 | |
export PKG_CONFIG_PATH=../../dist/usr/lib/pkg-config/ | |
autoreconfig -if | |
./configure --enable-static --disable-shared --prefix=/usr --host=$CHOST CFLAGS="$CFLAGS --sysroot=$SYSROOT" LDFLAGS="$LDFLAGS --sysroot=$SYSROOT" CXXFLAGS="$CFLAGS --sysroot=$SYSROOT" --disable-cxx --disable-tests | |
make -j 18 | |
make DESTDIR=${DESTDIR} install | |
popd | |
} | |
prepare_nettle() { | |
pushd $1 | |
sed -i -e "s:testsuite examples::" Makefile.in | |
popd | |
} | |
prepare_gnutls() { | |
pushd $1 | |
sed -i -e "s:SUBDIRS += po src::g" Makefile.am | |
popd | |
} | |
builds() { | |
mkdir -p "$BUILDDIR" | |
pushd "$BUILDDIR" | |
for a in $AUTOTOOL_SRC; do | |
eval url=\$SRC_$a | |
tarball=`basename $url` | |
tar -xvf "$SRCDIR/$tarball" | |
dirname=$a*/ | |
echo $dirname | |
prepare_$a $dirname | |
build $dirname | |
done | |
popd | |
} | |
[[ -e .fetch ]] || fetch | |
[[ -e .build ]] || builds |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment