summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Schlemmer <azarah@gentoo.org>2002-09-09 21:14:07 +0000
committerMartin Schlemmer <azarah@gentoo.org>2002-09-09 21:14:07 +0000
commit2186b530e67c83e875142a356be110810b465e2b (patch)
tree272f28201a56038ce33ca1549687ae5390170c24 /eclass/gcc.eclass
parentfix possible build breaker (diff)
downloadgentoo-2-2186b530e67c83e875142a356be110810b465e2b.tar.gz
gentoo-2-2186b530e67c83e875142a356be110810b465e2b.tar.bz2
gentoo-2-2186b530e67c83e875142a356be110810b465e2b.zip
initial version of a gcc eclass that can be used to get version specific stuff
Diffstat (limited to 'eclass/gcc.eclass')
-rw-r--r--eclass/gcc.eclass79
1 files changed, 79 insertions, 0 deletions
diff --git a/eclass/gcc.eclass b/eclass/gcc.eclass
new file mode 100644
index 000000000000..c3c1c8aade4e
--- /dev/null
+++ b/eclass/gcc.eclass
@@ -0,0 +1,79 @@
+# 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 $
+# This eclass contains (or should) functions to get common info about gcc
+ECLASS=gcc
+INHERITED="$INHERITED $ECLASS"
+
+newdepend sys-devel/gcc
+
+DESCRIPTION="Based on the ${ECLASS} eclass"
+
+
+gcc-version() {
+
+ local CC="gcc"
+
+ 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
+
+ echo "$(${CC} -dumpversion | cut -f1,2 -d.)"
+}
+
+gcc-fullversion() {
+
+ local CC="gcc"
+
+ 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
+
+ echo "`${CC} -dumpversion`"
+}
+
+gcc-libpath() {
+
+ local CC="gcc"
+
+ 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
+
+ echo "/usr/lib/gcc-lib/$(${CC} -dumpmachine)/$(gcc-fullversion)"
+}
+