gcc: fix cross builds to not set default cross sysroot.

This commit is contained in:
Juan RP 2013-04-17 08:16:47 +02:00
parent 45d554ef09
commit 493121ef10
1 changed files with 14 additions and 10 deletions

View File

@ -2,9 +2,7 @@
pkgname=gcc
_majorver=4.7
version=${_majorver}.3
revision=1
hostmakedepends="perl flex"
makedepends="zlib-devel gmp-devel mpfr-devel mpc-devel ppl-devel>=1.0 cloog-devel"
revision=2
short_desc="The GNU C Compiler"
maintainer="Juan RP <xtraeme@gmail.com>"
homepage="http://gcc.gnu.org"
@ -12,6 +10,9 @@ license="GFDL-1.2, GPL-3, LGPL-2.1"
distfiles="http://ftp.gnu.org/pub/gnu/gcc/gcc-$version/gcc-$version.tar.bz2"
checksum=2f7c37eb4fc14422ff2358a9ef59c974a75ab41204ef0e49fc34ab1d8981a9c3
hostmakedepends="perl flex"
makedepends="zlib-devel gmp-devel mpfr-devel mpc-devel ppl-devel>=1.0 cloog-devel"
if [ "$XBPS_TARGET_MACHINE" = "x86_64" ]; then
# Required stuff for multilib packages.
_triplet="${XBPS_MACHINE}-unknown-linux-gnu"
@ -27,27 +28,30 @@ if [ "$CROSS_BUILD" ]; then
fi
do_configure() {
local _langs _args
# As specified in the LFS book, disable installing libiberty.
sed -i 's/install_to_$(INSTALL_DEST) //' libiberty/Makefile.in
# Do not run fixincludes
sed -i 's@\./fixinc\.sh@-c true@' gcc/Makefile.in
if [ "$CROSS_BUILD" ]; then
export CC="$XBPS_CROSS_TRIPLET-gcc --sysroot=$XBPS_CROSS_BASE"
export CC_FOR_TARGET="$CC"
export GCC="$CC"
export GCC_FOR_TARGET="$CC"
export CXX="$XBPS_CROSS_TRIPLET-g++ --sysroot=$XBPS_CROSS_BASE"
export CXX_FOR_TARGET="$CXX"
export CFLAGS="$XBPS_CROSS_CFLAGS"
export CXXFLAGS="$CFLAGS"
_args="--disable-multilib --with-float=hard"
_langs="c,c++,lto"
_args="--disable-multilib"
if [ "$XBPS_TARGET_MACHINE" = "armv6l" ]; then
_args+=" --with-float=hard"
fi
_args+=" --host=$XBPS_CROSS_TRIPLET"
else
_langs="c,c++,objc,obj-c++,fortran,go,lto"
fi
./configure ${CONFIGURE_SHARED_ARGS} --libexecdir=/usr/lib \
./configure --prefix=/usr --mandir=/usr/share/man \
--infodir=/usr/share/info --libexecdir=/usr/lib \
--enable-clocale=gnu --disable-bootstrap --libdir=/usr/lib \
--enable-threads=posix --enable-__cxa_atexit --enable-multilib \
--disable-rpath --with-system-zlib --enable-shared --enable-lto \