chroot-gcc: armv7 cross support; misc tweaks.

This commit is contained in:
Juan RP 2014-01-18 08:21:06 +01:00
parent be786e348c
commit 1c71e9ea77
1 changed files with 24 additions and 30 deletions

View File

@ -7,7 +7,7 @@ _mpc_ver=0.8.2
pkgname=chroot-gcc pkgname=chroot-gcc
version=${_majorver}.3 version=${_majorver}.3
revision=5 revision=6
wrksrc="gcc-${version}" wrksrc="gcc-${version}"
homepage="http://gcc.gnu.org" homepage="http://gcc.gnu.org"
short_desc="The GNU C Compiler suite -- for xbps-src use" short_desc="The GNU C Compiler suite -- for xbps-src use"
@ -118,17 +118,13 @@ _mpc_build() {
do_configure() { do_configure() {
local _floatabi _args local _floatabi _args
if [ "$CROSS_BUILD" ]; then case "$XBPS_TARGET_MACHINE" in
_args="--host=$XBPS_CROSS_TRIPLET" armv6*) _args+=" --with-arch=armv6 --with-fpu=vfp --with-float=hard";;
fi armv7*) _args+=" --with-arch=armv7-a --with-fpu=vfpv3 --with-float=hard";;
esac
if [ "$XBPS_TARGET_MACHINE" = "armv6l" ]; then
_args+=" --with-arch=armv6 --with-fpu=vfp --with-float=hard"
elif [ "$XBPS_TARGET_MACHINE" = "armv7l" ]; then
_args+=" --with-arch=armv7-a --with-fpu=vfpv3-d16 --with-float=hard"
fi
if [ "$CROSS_BUILD" ]; then if [ "$CROSS_BUILD" ]; then
_args+=" --host=$XBPS_CROSS_TRIPLET"
export CC="$XBPS_CROSS_TRIPLET-gcc" export CC="$XBPS_CROSS_TRIPLET-gcc"
export GCC="$CC" export GCC="$CC"
export CC_FOR_TARGET="$CC" export CC_FOR_TARGET="$CC"
@ -148,7 +144,8 @@ do_configure() {
cd gcc-build cd gcc-build
CONFIG_SHELL=/bin/bash \ CONFIG_SHELL=/bin/bash \
../gcc-${version}/configure --prefix=/usr \ ../gcc-${version}/configure --disable-bootstrap \
--prefix=/usr --bindir=/usr/bin \
--mandir=/usr/share/man --infodir=/usr/share/info \ --mandir=/usr/share/man --infodir=/usr/share/info \
--libdir=/usr/lib --libexecdir=/usr/lib \ --libdir=/usr/lib --libexecdir=/usr/lib \
--enable-clocale=gnu --enable-shared \ --enable-clocale=gnu --enable-shared \
@ -171,17 +168,17 @@ do_build() {
} }
do_install() { do_install() {
local _triplet= local _triplet
if [ "$XBPS_TARGET_MACHINE" = "x86_64" ]; then case "$XBPS_TARGET_MACHINE" in
_triplet="${XBPS_TARGET_MACHINE}-unknown-linux-gnu" x86_64) _triplet="x86_64-unknown-linux-gnu";;
elif [ "$XBPS_TARGET_MACHINE" = "i686" ]; then x86_64-musl) _triplet="x86_64-unknown-linux-musl";;
_triplet="${XBPS_TARGET_MACHINE}-pc-linux-gnu" i686) _triplet="i686-pc-linux-gnu";;
elif [ "$XBPS_TARGET_MACHINE" = "armv6l" ]; then i686-musl) _triplet="i686-pc-linux-musl";;
_triplet="arm-linux-gnueabihf" armv[678]l) _triplet="arm-unknown-linux-gnueabihf";;
else armv[678]l-musl) _triplet="arm-unknown-linux-musleabi";;
_triplet=${XBPS_CROSS_TRIPLET} *) _triplet="$XBPS_CROSS_TRIPLET";;
fi esac
cd gcc-build cd gcc-build
make DESTDIR=${DESTDIR} install make DESTDIR=${DESTDIR} install
@ -190,22 +187,19 @@ do_install() {
# from the same series work automagically. # from the same series work automagically.
mv ${DESTDIR}/usr/lib/gcc/${_triplet}/${version} \ mv ${DESTDIR}/usr/lib/gcc/${_triplet}/${version} \
${DESTDIR}/usr/lib/gcc/${_triplet}/${_majorver} ${DESTDIR}/usr/lib/gcc/${_triplet}/${_majorver}
cd ${DESTDIR}/usr/lib/gcc/${_triplet} && ln -sf ${_majorver} ${version} ln -sfr ${DESTDIR}/usr/lib/gcc/${_triplet}/${_majorver} \
${DESTDIR}/usr/lib/gcc/${_triplet}/${version}
# Ditto for c++ headers. # Ditto for c++ headers.
mv ${DESTDIR}/usr/include/c++/${version} \ mv ${DESTDIR}/usr/include/c++/${version} \
${DESTDIR}/usr/include/c++/${_majorver} ${DESTDIR}/usr/include/c++/${_majorver}
cd ${DESTDIR}/usr/include/c++ && ln -sf ${_majorver} ${version} ln -sfr ${DESTDIR}/usr/include/c++/${_majorver} \
${DESTDIR}/usr/include/c++/${version}
# cc symlink. # cc symlink.
cd ${DESTDIR}/usr/bin && ln -sf gcc cc ln -sfr ${DESTDIR}/usr/bin/gcc ${DESTDIR}/usr/bin/cc
# rpcgen wants /lib/cpp, make a symlink # rpcgen wants /lib/cpp, make a symlink
cd ${DESTDIR}/usr/lib && ln -sf ../bin/cpp . ln -sfr ${DESTDIR}/usr/bin/cpp ${DESTDIR}/usr/bin/cpp
if [ -d ${DESTDIR}/usr/lib64 ]; then
mv ${DESTDIR}/usr/lib64/* ${DESTDIR}/usr/lib
fi
rm -rf ${DESTDIR}/usr/lib64
# Remove unused stuff. # Remove unused stuff.
rm -f ${DESTDIR}/usr/lib/libffi* rm -f ${DESTDIR}/usr/lib/libffi*