summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2013-05-21 20:44:00 +0000
committerMike Frysinger <vapier@gentoo.org>2013-05-21 20:44:00 +0000
commit778eaa3510a66645057b90d118ccb507c10b49a2 (patch)
tree9ce83a7e6be5a5893e263793a934716078602fd5 /eclass/toolchain.eclass
parentRemove ncurses support (bug #336901). (diff)
downloadhistorical-778eaa3510a66645057b90d118ccb507c10b49a2.tar.gz
historical-778eaa3510a66645057b90d118ccb507c10b49a2.tar.bz2
historical-778eaa3510a66645057b90d118ccb507c10b49a2.zip
convert confgcc to an array to avoid overloading $@ and to clean things up a bit -- hopefully no real functional changes here
Diffstat (limited to 'eclass/toolchain.eclass')
-rw-r--r--eclass/toolchain.eclass216
1 files changed, 116 insertions, 100 deletions
diff --git a/eclass/toolchain.eclass b/eclass/toolchain.eclass
index a2d7113aa09e..1074d851f463 100644
--- a/eclass/toolchain.eclass
+++ b/eclass/toolchain.eclass
@@ -1,6 +1,6 @@
# Copyright 1999-2013 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/toolchain.eclass,v 1.590 2013/05/15 05:42:09 dirtyepic Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/toolchain.eclass,v 1.591 2013/05/21 20:44:00 vapier Exp $
#
# Maintainer: Toolchain Ninjas <toolchain@gentoo.org>
@@ -836,13 +836,13 @@ gcc-abi-map() {
gcc-multilib-configure() {
if ! is_multilib ; then
- confgcc+=" --disable-multilib"
+ confgcc+=( --disable-multilib )
# Fun times: if we are building for a target that has multiple
# possible ABI formats, and the user has told us to pick one
# that isn't the default, then not specifying it via the list
# below will break that on us.
else
- confgcc+=" --enable-multilib"
+ confgcc+=( --enable-multilib )
fi
# translate our notion of multilibs into gcc's
@@ -854,7 +854,7 @@ gcc-multilib-configure() {
if [[ -n ${list} ]] ; then
case ${CTARGET} in
x86_64*)
- tc_version_is_at_least 4.7 && confgcc+=" --with-multilib-list=${list:1}"
+ tc_version_is_at_least 4.7 && confgcc+=( --with-multilib-list=${list:1} )
;;
esac
fi
@@ -865,21 +865,21 @@ gcc-compiler-configure() {
if tc_version_is_at_least "4.0" ; then
if in_iuse mudflap ; then
- confgcc+=" $(use_enable mudflap libmudflap)"
+ confgcc+=( $(use_enable mudflap libmudflap) )
else
- confgcc+=" --disable-libmudflap"
+ confgcc+=( --disable-libmudflap )
fi
if use_if_iuse libssp ; then
- confgcc+=" --enable-libssp"
+ confgcc+=( --enable-libssp )
else
export gcc_cv_libc_provides_ssp=yes
- confgcc+=" --disable-libssp"
+ confgcc+=( --disable-libssp )
fi
# If we want hardened support with the newer piepatchset for >=gcc 4.4
if tc_version_is_at_least 4.4 && want_minispecs ; then
- confgcc+=" $(use_enable hardened esp)"
+ confgcc+=( $(use_enable hardened esp) )
fi
if tc_version_is_at_least "4.2" ; then
@@ -891,14 +891,14 @@ gcc-compiler-configure() {
if ! is_crosscompile || \
$(tc-getCPP ${CTARGET}) -E - <<<"#include <pthread.h>" >& /dev/null
then
- confgcc+=" $(use_enable openmp libgomp)"
+ confgcc+=( $(use_enable openmp libgomp) )
else
# Force disable as the configure script can be dumb #359855
- confgcc+=" --disable-libgomp"
+ confgcc+=( --disable-libgomp )
fi
else
# For gcc variants where we don't want openmp (e.g. kgcc)
- confgcc+=" --disable-libgomp"
+ confgcc+=( --disable-libgomp )
fi
fi
@@ -913,48 +913,48 @@ gcc-compiler-configure() {
#
# This should translate into "/share/gcc-data/${CTARGET}/${GCC_CONFIG_VER}/python"
if tc_version_is_at_least "4.4" ; then
- confgcc+=" --with-python-dir=${DATAPATH/$PREFIX/}/python"
+ confgcc+=( --with-python-dir=${DATAPATH/$PREFIX/}/python )
fi
fi
# Enable build warnings by default with cross-compilers when system
# paths are included (e.g. via -I flags).
- is_crosscompile && confgcc+=" --enable-poison-system-directories"
+ is_crosscompile && confgcc+=( --enable-poison-system-directories )
# For newer versions of gcc, use the default ("release"), because no
# one (even upstream apparently) tests with it disabled. #317217
if tc_version_is_at_least 4 || [[ -n ${GCC_CHECKS_LIST} ]] ; then
- confgcc+=" --enable-checking=${GCC_CHECKS_LIST:-release}"
+ confgcc+=( --enable-checking=${GCC_CHECKS_LIST:-release} )
else
- confgcc+=" --disable-checking"
+ confgcc+=( --disable-checking )
fi
# GTK+ is preferred over xlib in 3.4.x (xlib is unmaintained
# right now). Much thanks to <csm@gnu.org> for the heads up.
# Travis Tilley <lv@gentoo.org> (11 Jul 2004)
if ! is_gcj ; then
- confgcc+=" --disable-libgcj"
+ confgcc+=( --disable-libgcj )
elif use gtk ; then
- confgcc+=" --enable-java-awt=gtk"
+ confgcc+=( --enable-java-awt=gtk )
fi
# allow gcc to search for clock funcs in the main C lib.
# if it can't find them, then tough cookies -- we aren't
# going to link in -lrt to all C++ apps. #411681
if tc_version_is_at_least 4.4 && is_cxx ; then
- confgcc+=" --enable-libstdcxx-time"
+ confgcc+=( --enable-libstdcxx-time )
fi
# newer gcc versions like to bootstrap themselves with C++,
# so we need to manually disable it ourselves
if tc_version_is_at_least 4.7 && ! is_cxx ; then
- confgcc+=" --disable-build-with-cxx --disable-build-poststage1-with-cxx"
+ confgcc+=( --disable-build-with-cxx --disable-build-poststage1-with-cxx )
fi
# newer gcc's come with libquadmath, but only fortran uses
# it, so auto punt it when we don't care
if tc_version_is_at_least 4.6 && ! is_fortran ; then
- confgcc+=" --disable-libquadmath"
+ confgcc+=( --disable-libquadmath )
fi
local with_abi_map=()
@@ -974,7 +974,7 @@ gcc-compiler-configure() {
if (srcdir=${S}/gcc target=${CTARGET} with_arch=${arm_arch};
. "${srcdir}"/config.gcc) &>/dev/null
then
- confgcc+=" --with-arch=${arm_arch}"
+ confgcc+=( --with-arch=${arm_arch} )
fi
# Enable hardvfp
@@ -983,37 +983,37 @@ gcc-compiler-configure() {
tc_version_is_at_least "4.5"
then
# Follow the new arm hardfp distro standard by default
- confgcc+=" --with-float=hard"
+ confgcc+=( --with-float=hard )
case ${CTARGET} in
- armv6*) confgcc+=" --with-fpu=vfp" ;;
- armv7*) confgcc+=" --with-fpu=vfpv3-d16" ;;
+ armv6*) confgcc+=( --with-fpu=vfp ) ;;
+ armv7*) confgcc+=( --with-fpu=vfpv3-d16 ) ;;
esac
fi
;;
# Add --with-abi flags to set default ABI
mips)
- confgcc+=" --with-abi=$(gcc-abi-map ${TARGET_DEFAULT_ABI})"
+ confgcc+=( --with-abi=$(gcc-abi-map ${TARGET_DEFAULT_ABI}) )
;;
amd64)
# drop the older/ABI checks once this get's merged into some
# version of gcc upstream
if tc_version_is_at_least 4.7 && has x32 $(get_all_abis TARGET) ; then
- confgcc+=" --with-abi=$(gcc-abi-map ${TARGET_DEFAULT_ABI})"
+ confgcc+=( --with-abi=$(gcc-abi-map ${TARGET_DEFAULT_ABI}) )
fi
;;
# Default arch for x86 is normally i386, lets give it a bump
# since glibc will do so based on CTARGET anyways
x86)
- confgcc+=" --with-arch=${CTARGET%%-*}"
+ confgcc+=( --with-arch=${CTARGET%%-*} )
;;
# Enable sjlj exceptions for backward compatibility on hppa
hppa)
- [[ ${GCCMAJOR} == "3" ]] && confgcc+=" --enable-sjlj-exceptions"
+ [[ ${GCCMAJOR} == "3" ]] && confgcc+=( --enable-sjlj-exceptions )
;;
# Set up defaults based on current CFLAGS
ppc)
- is-flagq -mfloat-gprs=double && confgcc+=" --enable-e500-double"
- [[ ${CTARGET//_/-} == *-e500v2-* ]] && confgcc+=" --enable-e500-double"
+ is-flagq -mfloat-gprs=double && confgcc+=( --enable-e500-double )
+ [[ ${CTARGET//_/-} == *-e500v2-* ]] && confgcc+=( --enable-e500-double )
;;
esac
@@ -1025,7 +1025,7 @@ gcc-compiler-configure() {
if is_objc || is_objcxx ; then
GCC_LANG+=",objc"
if tc_version_is_at_least "4.0" ; then
- use objc-gc && confgcc+=" --enable-objc-gc"
+ use objc-gc && confgcc+=( --enable-objc-gc )
fi
is_objcxx && GCC_LANG+=",obj-c++"
fi
@@ -1042,94 +1042,94 @@ gcc-compiler-configure() {
# is_ada && GCC_LANG+=",ada"
einfo "configuring for GCC_LANG: ${GCC_LANG}"
- confgcc+=" --enable-languages=${GCC_LANG}"
+ confgcc+=( --enable-languages=${GCC_LANG} )
}
gcc_do_configure() {
- local confgcc
-
- # Set configuration based on path variables
- confgcc+=" \
- --prefix=${PREFIX} \
- --bindir=${BINPATH} \
- --includedir=${INCLUDEPATH} \
- --datadir=${DATAPATH} \
- --mandir=${DATAPATH}/man \
- --infodir=${DATAPATH}/info \
- --with-gxx-include-dir=${STDCXX_INCDIR}"
+ local confgcc=(
+ # Set configuration based on path variables
+ --prefix="${PREFIX}"
+ --bindir="${BINPATH}"
+ --includedir="${INCLUDEPATH}"
+ --datadir="${DATAPATH}"
+ --mandir="${DATAPATH}/man"
+ --infodir="${DATAPATH}/info"
+ --with-gxx-include-dir="${STDCXX_INCDIR}"
+ )
# On Darwin we need libdir to be set in order to get correct install names
# for things like libobjc-gnu, libgcj and libfortran. If we enable it on
# non-Darwin we screw up the behaviour this eclass relies on. We in
# particular need this over --libdir for bug #255315.
[[ ${CTARGET} == *-darwin* ]] && \
- confgcc+=" --enable-version-specific-runtime-libs"
+ confgcc+=( --enable-version-specific-runtime-libs )
# All our cross-compile logic goes here ! woo !
- confgcc+=" --host=${CHOST}"
+ confgcc+=( --host=${CHOST} )
if is_crosscompile || tc-is-cross-compiler ; then
# Straight from the GCC install doc:
# "GCC has code to correctly determine the correct value for target
# for nearly all native systems. Therefore, we highly recommend you
# not provide a configure target when configuring a native compiler."
- confgcc+=" --target=${CTARGET}"
+ confgcc+=( --target=${CTARGET} )
fi
- [[ -n ${CBUILD} ]] && confgcc+=" --build=${CBUILD}"
+ [[ -n ${CBUILD} ]] && confgcc+=( --build=${CBUILD} )
# ppc altivec support
- confgcc+=" $(use_enable altivec)"
+ confgcc+=( $(use_enable altivec) )
# gcc has fixed-point arithmetic support in 4.3 for mips targets that can
# significantly increase compile time by several hours. This will allow
# users to control this feature in the event they need the support.
- tc_version_is_at_least "4.3" && confgcc+=" $(use_enable fixed-point)"
+ tc_version_is_at_least "4.3" && confgcc+=( $(use_enable fixed-point) )
# graphite was added in 4.4 but we only support it in 4.6+ due to external
# library issues. 4.6/4.7 uses cloog-ppl which is a fork of CLooG with a
# PPL backend. 4.8+ uses upstream CLooG with the ISL backend. We install
# cloog-ppl into a non-standard location to prevent collisions.
if tc_version_is_at_least "4.8" ; then
- confgcc+=" $(use_with graphite cloog)"
- use graphite && confgcc+=" --disable-isl-version-check"
+ confgcc+=( $(use_with graphite cloog) )
+ use graphite && confgcc+=( --disable-isl-version-check )
elif tc_version_is_at_least "4.6" ; then
- confgcc+=" $(use_with graphite cloog)"
- confgcc+=" $(use_with graphite ppl)"
- use graphite && confgcc+=" --with-cloog-include=/usr/include/cloog-ppl"
- use graphite && confgcc+=" --disable-ppl-version-check"
+ confgcc+=( $(use_with graphite cloog) )
+ confgcc+=( $(use_with graphite ppl) )
+ use graphite && confgcc+=( --with-cloog-include=/usr/include/cloog-ppl )
+ use graphite && confgcc+=( --disable-ppl-version-check )
elif tc_version_is_at_least "4.4" ; then
- confgcc+=" --without-cloog"
- confgcc+=" --without-ppl"
+ confgcc+=( --without-cloog )
+ confgcc+=( --without-ppl )
fi
if tc_version_is_at_least "4.6" ; then
- confgcc+=" $(use_enable lto)"
+ confgcc+=( $(use_enable lto) )
elif tc_version_is_at_least "4.5" ; then
- confgcc+=" --disable-lto"
+ confgcc+=( --disable-lto )
fi
case $(tc-is-softfloat) in
- yes) confgcc+=" --with-float=soft" ;;
- softfp) confgcc+=" --with-float=softfp" ;;
+ yes) confgcc+=( --with-float=soft ) ;;
+ softfp) confgcc+=( --with-float=softfp ) ;;
*)
# If they've explicitly opt-ed in, do hardfloat,
# otherwise let the gcc default kick in.
[[ ${CTARGET//_/-} == *-hardfloat-* ]] \
- && confgcc+=" --with-float=hard"
+ && confgcc+=( --with-float=hard )
;;
esac
# Native Language Support
if use nls ; then
- confgcc+=" --enable-nls --without-included-gettext"
+ confgcc+=( --enable-nls --without-included-gettext )
else
- confgcc+=" --disable-nls"
+ confgcc+=( --disable-nls )
fi
# reasonably sane globals (hopefully)
- confgcc+=" \
- --with-system-zlib \
- --enable-obsolete \
- --disable-werror \
- --enable-secureplt"
+ confgcc+=(
+ --with-system-zlib
+ --enable-obsolete
+ --disable-werror
+ --enable-secureplt
+ )
gcc-compiler-configure || die
@@ -1149,7 +1149,7 @@ gcc_do_configure() {
$(tc-getCPP ${CTARGET}) -E -dD - 2>/dev/null | \
grep -q __HAVE_SHARED__
then #291870
- confgcc+=" --disable-shared"
+ confgcc+=( --disable-shared )
fi
needed_libc=uclibc
;;
@@ -1157,73 +1157,89 @@ gcc_do_configure() {
x86_64-*-mingw*|\
*-w64-mingw*) needed_libc=mingw64-runtime;;
mingw*|*-mingw*) needed_libc=mingw-runtime;;
- avr) confgcc+=" --enable-shared --disable-threads";;
+ avr) confgcc+=( --enable-shared --disable-threads );;
esac
if [[ -n ${needed_libc} ]] ; then
- local confgcc_no_libc="--disable-shared"
- tc_version_is_at_least 4.8 && confgcc_no_libc+=" --disable-libatomic"
+ local confgcc_no_libc=( --disable-shared )
+ tc_version_is_at_least 4.8 && confgcc_no_libc+=( --disable-libatomic )
if ! has_version ${CATEGORY}/${needed_libc} ; then
- confgcc+=" ${confgcc_no_libc} --disable-threads --without-headers"
+ confgcc+=(
+ "${confgcc_no_libc[@]}"
+ --disable-threads
+ --without-headers
+ )
elif built_with_use --hidden --missing false ${CATEGORY}/${needed_libc} crosscompile_opts_headers-only ; then
- confgcc+=" ${confgcc_no_libc} --with-sysroot=${PREFIX}/${CTARGET}"
+ confgcc+=(
+ "${confgcc_no_libc[@]}"
+ --with-sysroot=${PREFIX}/${CTARGET}
+ )
else
- confgcc+=" --with-sysroot=${PREFIX}/${CTARGET}"
+ confgcc+=( --with-sysroot=${PREFIX}/${CTARGET} )
fi
fi
- tc_version_is_at_least 4.2 && confgcc+=" --disable-bootstrap"
+ tc_version_is_at_least 4.2 && confgcc+=( --disable-bootstrap )
else
if tc-is-static-only ; then
- confgcc+=" --disable-shared"
+ confgcc+=( --disable-shared )
else
- confgcc+=" --enable-shared"
+ confgcc+=( --enable-shared )
fi
case ${CHOST} in
mingw*|*-mingw*|*-cygwin)
- confgcc+=" --enable-threads=win32" ;;
+ confgcc+=( --enable-threads=win32 ) ;;
*)
- confgcc+=" --enable-threads=posix" ;;
+ confgcc+=( --enable-threads=posix ) ;;
esac
fi
# __cxa_atexit is "essential for fully standards-compliant handling of
# destructors", but apparently requires glibc.
case ${CTARGET} in
*-uclibc*)
- confgcc+=" --disable-__cxa_atexit $(use_enable nptl tls)"
- [[ ${GCCMAJOR}.${GCCMINOR} == 3.3 ]] && confgcc+=" --enable-sjlj-exceptions"
+ confgcc+=(
+ --disable-__cxa_atexit
+ $(use_enable nptl tls)
+ )
+ [[ ${GCCMAJOR}.${GCCMINOR} == 3.3 ]] && confgcc+=( --enable-sjlj-exceptions )
if tc_version_is_at_least 3.4 && ! tc_version_is_at_least 4.3 ; then
- confgcc+=" --enable-clocale=uclibc"
+ confgcc+=( --enable-clocale=uclibc )
fi
;;
*-elf|*-eabi)
- confgcc+=" --with-newlib"
+ confgcc+=( --with-newlib )
;;
*-gnu*)
- confgcc+=" --enable-__cxa_atexit"
- confgcc+=" --enable-clocale=gnu"
+ confgcc+=(
+ --enable-__cxa_atexit
+ --enable-clocale=gnu
+ )
;;
*-freebsd*)
- confgcc+=" --enable-__cxa_atexit"
+ confgcc+=( --enable-__cxa_atexit )
;;
*-solaris*)
- confgcc+=" --enable-__cxa_atexit"
+ confgcc+=( --enable-__cxa_atexit )
;;
esac
- tc_version_is_at_least 3.4 || confgcc+=" --disable-libunwind-exceptions"
+ tc_version_is_at_least 3.4 || confgcc+=( --disable-libunwind-exceptions )
# if the target can do biarch (-m32/-m64), enable it. overhead should
# be small, and should simplify building of 64bit kernels in a 32bit
# userland by not needing sys-devel/kgcc64. #349405
case $(tc-arch) in
- ppc|ppc64) tc_version_is_at_least 3.4 && confgcc+=" --enable-targets=all" ;;
- sparc) tc_version_is_at_least 4.4 && confgcc+=" --enable-targets=all" ;;
- amd64|x86) tc_version_is_at_least 4.3 && confgcc+=" --enable-targets=all" ;;
+ ppc|ppc64) tc_version_is_at_least 3.4 && confgcc+=( --enable-targets=all ) ;;
+ sparc) tc_version_is_at_least 4.4 && confgcc+=( --enable-targets=all ) ;;
+ amd64|x86) tc_version_is_at_least 4.3 && confgcc+=( --enable-targets=all ) ;;
esac
- tc_version_is_at_least 4.3 && set -- "$@" \
- --with-bugurl=http://bugs.gentoo.org/ \
+ tc_version_is_at_least 4.3 && confgcc+=(
+ --with-bugurl=http://bugs.gentoo.org/
--with-pkgversion="${BRANDING_GCC_PKGVERSION}"
- set -- ${confgcc} "$@" ${EXTRA_ECONF}
+ )
+ confgcc+=(
+ "$@"
+ ${EXTRA_ECONF}
+ )
# Disable gcc info regeneration -- it ships with generated info pages
# already. Our custom version/urls/etc... trigger it. #464008
@@ -1243,7 +1259,7 @@ gcc_do_configure() {
einfo "DATAPATH: ${DATAPATH}"
einfo "STDCXX_INCDIR: ${STDCXX_INCDIR}"
echo
- einfo "Configuring GCC with: ${@//--/\n\t--}"
+ einfo "Configuring GCC with: ${confgcc[@]//--/\n\t--}"
echo
# Build in a separate build tree
@@ -1252,8 +1268,8 @@ gcc_do_configure() {
# and now to do the actual configuration
addwrite /dev/zero
- echo "${S}"/configure "$@"
- "${S}"/configure "$@" || die "failed to run configure"
+ echo "${S}"/configure "${confgcc[@]}"
+ "${S}"/configure "${confgcc[@]}" || die "failed to run configure"
# return to whatever directory we were in before
popd > /dev/null