diff options
author | Martin Schlemmer <azarah@gentoo.org> | 2002-09-10 20:21:29 +0000 |
---|---|---|
committer | Martin Schlemmer <azarah@gentoo.org> | 2002-09-10 20:21:29 +0000 |
commit | 718d880fe2c30e59f231d64386e03d2db3c3cd34 (patch) | |
tree | 0829a390c758d1831198a400569174ee2b84bc0e | |
parent | Changed pkg_postinst stanza to replace install with dodir so directories (diff) | |
download | historical-718d880fe2c30e59f231d64386e03d2db3c3cd34.tar.gz historical-718d880fe2c30e59f231d64386e03d2db3c3cd34.tar.bz2 historical-718d880fe2c30e59f231d64386e03d2db3c3cd34.zip |
fixor and feature add
-rw-r--r-- | eclass/gcc.eclass | 77 |
1 files changed, 40 insertions, 37 deletions
diff --git a/eclass/gcc.eclass b/eclass/gcc.eclass index c3c1c8aade4e..ffc7a4e87cca 100644 --- a/eclass/gcc.eclass +++ b/eclass/gcc.eclass @@ -1,7 +1,7 @@ # Copyright 1999-2002 Gentoo Technologies, Inc. # Distributed under the terms of the GNU General Public License, v2 or later # Author: Martin Schlemmer <azarah@gentoo.org> -# $Header: /var/cvsroot/gentoo-x86/eclass/gcc.eclass,v 1.1 2002/09/09 21:14:07 azarah Exp $ +# $Header: /var/cvsroot/gentoo-x86/eclass/gcc.eclass,v 1.2 2002/09/10 20:21:29 azarah Exp $ # This eclass contains (or should) functions to get common info about gcc ECLASS=gcc INHERITED="$INHERITED $ECLASS" @@ -11,11 +11,15 @@ newdepend sys-devel/gcc DESCRIPTION="Based on the ${ECLASS} eclass" -gcc-version() { +# NOTE: To force gcc3 if multi ver install, do: export WANT_GCC_3="yes" +[ -z "${WANT_GCC_3}" ] && export WANT_GCC_3="no" + +gcc-getCC() { local CC="gcc" - - if [ "$(eval echo \$\(${CC} -dumpversion\) | cut -f1 -d.)" -ne 3 ] + + if [ "$(${CC} -dumpversion | cut -f1 -d.)" -ne 3 ] && \ + [ "${WANT_GCC_3}" = "yes" ] then # We use the dual/multiple install of gcc-3.x if the user # have 2.95.3 as base @@ -30,50 +34,49 @@ gcc-version() { CC="gcc-3.0" fi fi + + echo "${CC}" +} + +gcc-getCXX() { + + CC="$(gcc-getCC)" - echo "$(${CC} -dumpversion | cut -f1,2 -d.)" + if [ "$(${CC} -dumpversion | cut -f1 -d.)" -eq 3 ] + then + echo "${CC/gcc/g++}" + else + echo "${CC}" + fi } gcc-fullversion() { - local CC="gcc" + echo "$($(gcc-getCC) -dumpversion)" +} - if [ "$(eval echo \$\(${CC} -dumpversion\) | cut -f1 -d.)" -ne 3 ] - then - # We use the dual/multiple install of gcc-3.x if the user - # have 2.95.3 as base - if [ -x /usr/bin/gcc-3.2 ] - then - CC="gcc-3.2" - elif [ -x /usr/bin/gcc-3.1 ] - then - CC="gcc-3.1" - elif [ -x /usr/bin/gcc-3.0 ] - then - CC="gcc-3.0" - fi - fi +gcc-version() { - echo "`${CC} -dumpversion`" + echo "$(gcc-fullversion | cut -f1,2 -d.)" } -gcc-libpath() { +gcc-major-version() { - local CC="gcc" + echo "$(gcc-version | cut -f1 -d.)" +} - if [ "$(eval echo \$\(${CC} -dumpversion\) | cut -f1 -d.)" -ne 3 ] - then - # We use the dual/multiple install of gcc-3.x if the user - # have 2.95.3 as base - if [ -x /usr/bin/gcc-3.1 ] - then - CC="gcc-3.1" - elif [ -x /usr/bin/gcc-3.0 ] - then - CC="gcc-3.0" - fi - fi +gcc-minor-version() { + + echo "$(gcc-version | cut -f2 -d.)" +} + +gcc-micro-version() { + + echo "$(gcc-fullversion | cut -f3 -d.)" +} + +gcc-libpath() { - echo "/usr/lib/gcc-lib/$(${CC} -dumpmachine)/$(gcc-fullversion)" + echo "/usr/lib/gcc-lib/$($(gcc-getCC) -dumpmachine)/$(gcc-fullversion)" } |