# Copyright 1999-2011 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/toolchain.eclass,v 1.478 2011/11/09 17:25:43 vapier Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/toolchain.eclass,v 1.479 2011/11/14 17:40:06 vapier Exp $
#
# Maintainer: Toolchain Ninjas <toolchain@gentoo.org>
IUSE="build multislot nls nptl test vanilla"
if [[ ${PN} != "kgcc64" && ${PN} != gcc-* ]] ; then
- IUSE+=" altivec fortran nocxx"
+ IUSE+=" altivec cxx fortran nocxx"
[[ -n ${PIE_VER} ]] && IUSE+=" nopie"
[[ -n ${HTB_VER} ]] && IUSE+=" boundschecking"
[[ -n ${D_VER} ]] && IUSE+=" d"
# we dont want to use the installed compiler's specs to build gcc!
unset GCC_SPECS
- if use nocxx ; then
- use_if_iuse go && ewarn 'Go requires a C++ compiler, disabled due to USE="nocxx"'
- use_if_iuse objc++ && ewarn 'Obj-C++ requires a C++ compiler, disabled due to USE="nocxx"'
- use_if_iuse gcj && ewarn 'GCJ requires a C++ compiler, disabled due to USE="nocxx"'
+ if ! use cxx ; then
+ use_if_iuse go && ewarn 'Go requires a C++ compiler, disabled due to USE="-cxx"'
+ use_if_iuse objc++ && ewarn 'Obj-C++ requires a C++ compiler, disabled due to USE="-cxx"'
+ use_if_iuse gcj && ewarn 'GCJ requires a C++ compiler, disabled due to USE="-cxx"'
fi
want_libssp && libc_has_ssp && \
gcc_do_configure() {
local confgcc
+ # Sanity check for USE=nocxx -> USE=cxx migration
+ if (use cxx && use nocxx) || (use !cxx && use !nocxx) ; then
+ eerror "We are migrating USE=nocxx to USE=cxx, but your USE settings do not make"
+ eerror "sense. Please make sure these two flags line up logically in your setup."
+ die "USE='cxx nocxx' and USE='-cxx -nocxx' make no sense"
+ fi
+
# Set configuration based on path variables
confgcc+=" \
--prefix=${PREFIX} \
${GCC_MAKE_TARGET} \
|| die "emake failed with ${GCC_MAKE_TARGET}"
- if ! is_crosscompile && ! use nocxx && use doc ; then
+ if ! is_crosscompile && use cxx && use doc ; then
if type -p doxygen > /dev/null ; then
if tc_version_is_at_least 4.3 ; then
cd "${CTARGET}"/libstdc++-v3/doc
is_cxx() {
gcc-lang-supported 'c++' || return 1
- ! use nocxx
+ use cxx
}
is_d() {
is_gcj() {
gcc-lang-supported java || return 1
- ! use nocxx && use_if_iuse gcj
+ use cxx && use_if_iuse gcj
}
is_go() {
gcc-lang-supported go || return 1
- ! use nocxx && use_if_iuse go
+ use cxx && use_if_iuse go
}
is_libffi() {
is_objcxx() {
gcc-lang-supported 'obj-c++' || return 1
- ! use nocxx && use_if_iuse objc++
+ use cxx && use_if_iuse objc++
}
is_ada() {