check cxx is in IUSE before trying to use it #391149 by Raúl Porcel
authorMike Frysinger <vapier@gentoo.org>
Sun, 20 Nov 2011 20:12:47 +0000 (20:12 +0000)
committerMike Frysinger <vapier@gentoo.org>
Sun, 20 Nov 2011 20:12:47 +0000 (20:12 +0000)
eclass/toolchain.eclass

index 9257375f25fb909f68f2282bf0d19cc43544629d..0a6ea47bbc4d5e332374c416cc32ca150f89b0e4 100644 (file)
@@ -1,6 +1,6 @@
 # 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.479 2011/11/14 17:40:06 vapier Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/toolchain.eclass,v 1.480 2011/11/20 20:12:47 vapier Exp $
 #
 # Maintainer: Toolchain Ninjas <toolchain@gentoo.org>
 
@@ -776,7 +776,7 @@ toolchain_pkg_setup() {
        # we dont want to use the installed compiler's specs to build gcc!
        unset GCC_SPECS
 
-       if ! use cxx ; then
+       if ! is_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"'
@@ -1251,10 +1251,12 @@ 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"
+       if in_iuse cxx && in_iuse nocxx ; then
+               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
        fi
 
        # Set configuration based on path variables