2012-02-28 13:41:08 +00:00
|
|
|
# Template build file for 'chroot-gcc'
|
2013-02-19 11:38:16 +00:00
|
|
|
#
|
2012-03-30 11:10:20 +00:00
|
|
|
_majorver=4.7
|
2013-02-19 11:38:16 +00:00
|
|
|
_gmp_ver=5.0.5
|
2013-04-16 16:29:27 +00:00
|
|
|
_mpfr_ver=3.1.2
|
2012-02-28 13:41:08 +00:00
|
|
|
_mpc_ver=0.8.2
|
2013-02-19 11:38:16 +00:00
|
|
|
|
|
|
|
pkgname=chroot-gcc
|
2013-04-16 16:29:27 +00:00
|
|
|
version=${_majorver}.3
|
2014-01-18 07:21:06 +00:00
|
|
|
revision=6
|
2012-02-28 13:41:08 +00:00
|
|
|
wrksrc="gcc-${version}"
|
2012-06-04 08:28:30 +00:00
|
|
|
homepage="http://gcc.gnu.org"
|
|
|
|
short_desc="The GNU C Compiler suite -- for xbps-src use"
|
|
|
|
maintainer="Juan RP <xtraeme@gmail.com>"
|
|
|
|
license="GPL-3"
|
2012-02-28 13:41:08 +00:00
|
|
|
distfiles="
|
2013-02-19 11:38:16 +00:00
|
|
|
http://ftp.gnu.org/pub/gnu/gcc/gcc-${version}/gcc-${version}.tar.bz2
|
|
|
|
http://ftp.gnu.org/pub/gnu/gmp/gmp-${_gmp_ver}.tar.bz2
|
|
|
|
http://www.mpfr.org/mpfr-current/mpfr-${_mpfr_ver}.tar.bz2
|
|
|
|
http://www.multiprecision.org/mpc/download/mpc-${_mpc_ver}.tar.gz"
|
2012-02-28 13:41:08 +00:00
|
|
|
checksum="
|
2013-04-16 16:29:27 +00:00
|
|
|
2f7c37eb4fc14422ff2358a9ef59c974a75ab41204ef0e49fc34ab1d8981a9c3
|
2013-02-19 11:38:16 +00:00
|
|
|
1f588aaccc41bb9aed946f9fe38521c26d8b290d003c5df807f65690f2aadec9
|
2013-04-16 16:29:27 +00:00
|
|
|
79c73f60af010a30a5c27a955a1d2d01ba095b72537dab0ecaad57f5a7bb1b6b
|
2013-02-19 11:38:16 +00:00
|
|
|
ae79f8d41d8a86456b68607e9ca398d00f8b7342d1d83bcf4428178ac45380c7"
|
2012-02-28 13:41:08 +00:00
|
|
|
|
2013-02-19 11:38:16 +00:00
|
|
|
create_wrksrc=yes
|
|
|
|
bootstrap=yes
|
2014-01-01 15:10:11 +00:00
|
|
|
provides="
|
|
|
|
libgcc-${version}
|
|
|
|
libstdc++-${version}
|
|
|
|
libstdc++-devel-${version}
|
|
|
|
gcc-${version}
|
|
|
|
gcc-c++-${version}"
|
|
|
|
conflicts="
|
|
|
|
libgcc>=0
|
|
|
|
libstdc++>=0
|
|
|
|
libstdc++-devel>=0
|
|
|
|
gcc>=0
|
|
|
|
gcc-c++>=0"
|
|
|
|
noverifyrdeps=yes
|
2013-02-19 11:38:16 +00:00
|
|
|
|
2013-10-23 08:35:03 +00:00
|
|
|
if [ "$CHROOT_READY" ]; then
|
2013-04-16 16:34:38 +00:00
|
|
|
hostmakedepends+=" perl flex"
|
2012-06-04 08:28:30 +00:00
|
|
|
fi
|
|
|
|
|
2012-02-28 13:41:08 +00:00
|
|
|
pre_configure() {
|
2013-02-19 11:38:16 +00:00
|
|
|
cd gcc-${version}
|
2013-04-16 16:30:57 +00:00
|
|
|
for f in ${FILESDIR}/*; do
|
2013-02-19 11:38:16 +00:00
|
|
|
patch -Np0 -i ${f}
|
|
|
|
done
|
2012-02-28 13:41:08 +00:00
|
|
|
# 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
|
2013-02-19 11:38:16 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
_gmp_build() {
|
|
|
|
cd ${wrksrc}
|
|
|
|
[ ! -d gmp-build ] && mkdir gmp-build
|
|
|
|
cd gmp-build
|
|
|
|
[ -f .gmp_build_done ] && return
|
2014-01-07 21:19:26 +00:00
|
|
|
cp -f ${XBPS_CROSSPFDIR}/config.sub ../gmp-${_gmp_ver}/configfsf.sub
|
2013-02-19 11:38:16 +00:00
|
|
|
|
2013-04-17 12:51:25 +00:00
|
|
|
if [ "$XBPS_TARGET_MACHINE" = "i686" ]; then
|
|
|
|
export ABI=32
|
|
|
|
fi
|
|
|
|
../gmp-${_gmp_ver}/configure --prefix=${wrksrc}/buildtmp \
|
|
|
|
--disable-shared --enable-static "$@"
|
2013-02-19 11:38:16 +00:00
|
|
|
|
|
|
|
make ${makejobs}
|
|
|
|
make install
|
|
|
|
|
|
|
|
rm -f ${wrksrc}/buildtmp/lib/*.la
|
|
|
|
|
|
|
|
touch .gmp_build_done
|
|
|
|
}
|
|
|
|
|
|
|
|
_mpfr_build() {
|
|
|
|
cd ${wrksrc}
|
|
|
|
[ ! -d mpfr-build ] && mkdir mpfr-build
|
|
|
|
cd mpfr-build
|
|
|
|
[ -f .mpfr_build_done ] && return
|
2014-01-07 21:19:26 +00:00
|
|
|
cp -f ${XBPS_CROSSPFDIR}/config.sub ../mpfr-${_mpfr_ver}/
|
2013-02-19 11:38:16 +00:00
|
|
|
|
2013-04-17 12:51:25 +00:00
|
|
|
../mpfr-${_mpfr_ver}/configure --prefix=${wrksrc}/buildtmp \
|
2013-02-19 11:38:16 +00:00
|
|
|
--with-gmp=${wrksrc}/buildtmp \
|
2013-04-17 12:51:25 +00:00
|
|
|
--disable-shared --enable-static "$@"
|
2013-02-19 11:38:16 +00:00
|
|
|
|
|
|
|
make ${makejobs}
|
|
|
|
make install
|
|
|
|
|
|
|
|
rm -f ${wrksrc}/buildtmp/lib/*.la
|
2012-02-28 13:41:08 +00:00
|
|
|
|
2013-02-19 11:38:16 +00:00
|
|
|
touch .mpfr_build_done
|
|
|
|
}
|
|
|
|
|
|
|
|
_mpc_build() {
|
|
|
|
cd ${wrksrc}
|
|
|
|
[ ! -d mpc-build ] && mkdir mpc-build
|
|
|
|
cd mpc-build
|
|
|
|
[ -f .mpc_build_done ] && return
|
2014-01-07 21:19:26 +00:00
|
|
|
cp -f ${XBPS_CROSSPFDIR}/config.sub ../mpc-${_mpc_ver}/
|
2013-02-19 11:38:16 +00:00
|
|
|
|
2013-04-17 12:51:25 +00:00
|
|
|
../mpc-${_mpc_ver}/configure --prefix=${wrksrc}/buildtmp \
|
2013-02-19 11:38:16 +00:00
|
|
|
--with-gmp=${wrksrc}/buildtmp \
|
|
|
|
--with-mpfr=${wrksrc}/buildtmp \
|
2013-04-17 12:51:25 +00:00
|
|
|
--disable-shared --enable-static "$@"
|
2013-02-19 11:38:16 +00:00
|
|
|
|
|
|
|
make ${makejobs}
|
|
|
|
make install
|
|
|
|
|
|
|
|
rm -f ${wrksrc}/buildtmp/lib/*.la
|
|
|
|
|
|
|
|
touch .mpfr_build_done
|
2012-02-28 13:41:08 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
do_configure() {
|
2013-02-19 11:38:16 +00:00
|
|
|
local _floatabi _args
|
|
|
|
|
2014-01-18 07:21:06 +00:00
|
|
|
case "$XBPS_TARGET_MACHINE" in
|
|
|
|
armv6*) _args+=" --with-arch=armv6 --with-fpu=vfp --with-float=hard";;
|
|
|
|
armv7*) _args+=" --with-arch=armv7-a --with-fpu=vfpv3 --with-float=hard";;
|
|
|
|
esac
|
2013-02-19 11:38:16 +00:00
|
|
|
|
2013-04-16 16:29:27 +00:00
|
|
|
if [ "$CROSS_BUILD" ]; then
|
2014-01-18 07:21:06 +00:00
|
|
|
_args+=" --host=$XBPS_CROSS_TRIPLET"
|
2013-02-19 11:38:16 +00:00
|
|
|
export CC="$XBPS_CROSS_TRIPLET-gcc"
|
|
|
|
export GCC="$CC"
|
|
|
|
export CC_FOR_TARGET="$CC"
|
|
|
|
export GCC_FOR_TARGET="$CC"
|
|
|
|
export CXX="$XBPS_CROSS_TRIPLET-g++"
|
|
|
|
export CXX_FOR_TARGET="$CXX"
|
|
|
|
export CFLAGS="-Os"
|
|
|
|
export CXXFLAGS="$CFLAGS"
|
|
|
|
fi
|
|
|
|
|
2013-04-17 12:51:25 +00:00
|
|
|
_gmp_build ${_args}
|
|
|
|
_mpfr_build ${_args}
|
|
|
|
_mpc_build ${_args}
|
2013-02-19 11:38:16 +00:00
|
|
|
|
|
|
|
cd ${wrksrc}
|
|
|
|
[ ! -d gcc-build ] && mkdir gcc-build
|
|
|
|
cd gcc-build
|
|
|
|
|
|
|
|
CONFIG_SHELL=/bin/bash \
|
2014-01-18 07:21:06 +00:00
|
|
|
../gcc-${version}/configure --disable-bootstrap \
|
|
|
|
--prefix=/usr --bindir=/usr/bin \
|
2013-04-17 06:26:16 +00:00
|
|
|
--mandir=/usr/share/man --infodir=/usr/share/info \
|
2013-02-19 11:38:16 +00:00
|
|
|
--libdir=/usr/lib --libexecdir=/usr/lib \
|
|
|
|
--enable-clocale=gnu --enable-shared \
|
2012-02-28 13:41:08 +00:00
|
|
|
--enable-threads=posix --enable-__cxa_atexit \
|
2013-09-23 12:17:15 +00:00
|
|
|
--disable-gold --enable-lto --enable-linker-build-id \
|
2013-02-19 11:38:16 +00:00
|
|
|
--with-gmp=${wrksrc}/buildtmp \
|
|
|
|
--with-mpfr=${wrksrc}/buildtmp \
|
|
|
|
--with-mpc=${wrksrc}/buildtmp \
|
2012-02-28 13:41:08 +00:00
|
|
|
--enable-gnu-unique-object --enable-checking=release \
|
2013-09-23 12:17:15 +00:00
|
|
|
--enable-languages=c,c++,lto --disable-nls --disable-multilib \
|
2012-02-28 13:41:08 +00:00
|
|
|
--without-cloog --without-ppl --disable-libstdcxx-pch \
|
|
|
|
--disable-libquadmath --disable-libquadmath-support \
|
2013-02-19 11:38:16 +00:00
|
|
|
--disable-libgomp --disable-libssp --disable-libitm \
|
2014-01-07 21:19:26 +00:00
|
|
|
--disable-libmudflap ${_args}
|
2012-02-28 13:41:08 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
do_build() {
|
2013-02-19 11:38:16 +00:00
|
|
|
cd gcc-build
|
2012-02-28 13:41:08 +00:00
|
|
|
make ${makejobs}
|
|
|
|
}
|
|
|
|
|
|
|
|
do_install() {
|
2014-01-18 07:21:06 +00:00
|
|
|
local _triplet
|
|
|
|
|
|
|
|
case "$XBPS_TARGET_MACHINE" in
|
|
|
|
x86_64) _triplet="x86_64-unknown-linux-gnu";;
|
|
|
|
x86_64-musl) _triplet="x86_64-unknown-linux-musl";;
|
|
|
|
i686) _triplet="i686-pc-linux-gnu";;
|
|
|
|
i686-musl) _triplet="i686-pc-linux-musl";;
|
|
|
|
armv[678]l) _triplet="arm-unknown-linux-gnueabihf";;
|
|
|
|
armv[678]l-musl) _triplet="arm-unknown-linux-musleabi";;
|
|
|
|
*) _triplet="$XBPS_CROSS_TRIPLET";;
|
|
|
|
esac
|
2013-02-19 11:38:16 +00:00
|
|
|
|
|
|
|
cd gcc-build
|
2012-02-28 13:41:08 +00:00
|
|
|
make DESTDIR=${DESTDIR} install
|
|
|
|
|
|
|
|
# Make version a symlink of major version to make all versions
|
|
|
|
# from the same series work automagically.
|
|
|
|
mv ${DESTDIR}/usr/lib/gcc/${_triplet}/${version} \
|
|
|
|
${DESTDIR}/usr/lib/gcc/${_triplet}/${_majorver}
|
2014-01-18 07:21:06 +00:00
|
|
|
ln -sfr ${DESTDIR}/usr/lib/gcc/${_triplet}/${_majorver} \
|
|
|
|
${DESTDIR}/usr/lib/gcc/${_triplet}/${version}
|
2012-02-28 13:41:08 +00:00
|
|
|
|
|
|
|
# Ditto for c++ headers.
|
|
|
|
mv ${DESTDIR}/usr/include/c++/${version} \
|
|
|
|
${DESTDIR}/usr/include/c++/${_majorver}
|
2014-01-18 07:21:06 +00:00
|
|
|
ln -sfr ${DESTDIR}/usr/include/c++/${_majorver} \
|
|
|
|
${DESTDIR}/usr/include/c++/${version}
|
2012-02-28 13:41:08 +00:00
|
|
|
|
|
|
|
# cc symlink.
|
2014-01-18 07:21:06 +00:00
|
|
|
ln -sfr ${DESTDIR}/usr/bin/gcc ${DESTDIR}/usr/bin/cc
|
2012-07-09 16:11:56 +00:00
|
|
|
# rpcgen wants /lib/cpp, make a symlink
|
2014-01-18 07:21:06 +00:00
|
|
|
ln -sfr ${DESTDIR}/usr/bin/cpp ${DESTDIR}/usr/bin/cpp
|
2012-02-28 13:41:08 +00:00
|
|
|
|
|
|
|
# Remove unused stuff.
|
|
|
|
rm -f ${DESTDIR}/usr/lib/libffi*
|
|
|
|
rm -f ${DESTDIR}/usr/lib/libmudflap*
|
|
|
|
rm -rf ${DESTDIR}/usr/share
|
|
|
|
|
|
|
|
# Remove all python scripts in libdir.
|
|
|
|
rm -f ${DESTDIR}/usr/lib/*.py
|
|
|
|
}
|