X-Git-Url: https://git.distorted.org.uk/~mdw/termux-packages/blobdiff_plain/556b6db05af6c5df9d8449266d8b110ce5b19379..d6d4e8feb047396c3a773e0e890b31e3698fc55a:/packages/gcc/build.sh diff --git a/packages/gcc/build.sh b/packages/gcc/build.sh index 6bf8a2a6..996436e1 100755 --- a/packages/gcc/build.sh +++ b/packages/gcc/build.sh @@ -2,6 +2,7 @@ TERMUX_PKG_HOMEPAGE=http://gcc.gnu.org/ TERMUX_PKG_DESCRIPTION="GNU C compiler" TERMUX_PKG_DEPENDS="binutils, libgmp, libmpfr, libmpc, ndk-sysroot" TERMUX_PKG_VERSION=4.9.3 +TERMUX_PKG_BUILD_REVISION=5 TERMUX_PKG_SRCURL=ftp://ftp.fu-berlin.de/unix/languages/gcc/releases/gcc-${TERMUX_PKG_VERSION}/gcc-${TERMUX_PKG_VERSION}.tar.bz2 TERMUX_PKG_EXTRA_CONFIGURE_ARGS="--enable-languages=c,c++ --with-system-zlib --disable-multilib --disable-lto" TERMUX_PKG_EXTRA_CONFIGURE_ARGS+=" --with-gmp=$TERMUX_PREFIX --with-mpfr=$TERMUX_PREFIX --with-mpc=$TERMUX_PREFIX" @@ -14,7 +15,7 @@ elif [ "$TERMUX_ARCH" = "i686" ]; then TERMUX_PKG_EXTRA_CONFIGURE_ARGS+=" --with-arch=i686 --with-tune=atom --with-fpmath=sse" fi TERMUX_PKG_KEEP_STATIC_LIBRARIES="true" -TERMUX_PKG_RM_AFTER_INSTALL="bin/gcc-ar bin/gcc-ranlib bin/c++ bin/gcc-nm bin/*-linux-* lib/gcc/*-linux-*/${TERMUX_PKG_VERSION}/plugin lib/gcc/*-linux-*/${TERMUX_PKG_VERSION}/include-fixed lib/gcc/*-linux-*/$TERMUX_PKG_VERSION/install-tools libexec/gcc/*-linux-*/${TERMUX_PKG_VERSION}/plugin libexec/gcc/*-linux-*/${TERMUX_PKG_VERSION}/install-tools share/man/man7" +TERMUX_PKG_RM_AFTER_INSTALL="bin/gcc-ar bin/gcc-ranlib bin/c++ bin/gcc-nm lib/gcc/*-linux-*/${TERMUX_PKG_VERSION}/plugin lib/gcc/*-linux-*/${TERMUX_PKG_VERSION}/include-fixed lib/gcc/*-linux-*/$TERMUX_PKG_VERSION/install-tools libexec/gcc/*-linux-*/${TERMUX_PKG_VERSION}/plugin libexec/gcc/*-linux-*/${TERMUX_PKG_VERSION}/install-tools share/man/man7" export AR_FOR_TARGET="$AR" export AS_FOR_TARGET="$AS" @@ -53,12 +54,26 @@ termux_step_make_install () { } termux_step_post_make_install () { - if [ $TERMUX_ARCH = "arm" ]; then + if [ $TERMUX_ARCH = "arm" ]; then # Note that moving to $TERMUX_PREFIX/lib/gcc/arm-linux-androideabi/${TERMUX_PKG_VERSION}/ # allows compilation but fails to link at runtime mv $TERMUX_PREFIX/lib/armv7-a/hard/libgcc_s* $TERMUX_PREFIX/lib/ fi # Android 5.0 only supports PIE binaries, so build that by default with a specs file: - cp $TERMUX_SCRIPTDIR/termux.spec $TERMUX_PREFIX/lib/gcc/$TERMUX_HOST_PLATFORM/$TERMUX_PKG_VERSION/specs + local GCC_SPECS=$TERMUX_PREFIX/lib/gcc/$TERMUX_HOST_PLATFORM/$TERMUX_PKG_VERSION/specs + cp $TERMUX_SCRIPTDIR/termux.spec $GCC_SPECS + + if [ $TERMUX_ARCH = "i686" ]; then + # See https://github.com/termux/termux-packages/issues/3 + # and https://github.com/termux/termux-packages/issues/14 + cat >> $GCC_SPECS <