summaryrefslogtreecommitdiff
path: root/mk/compiler
diff options
context:
space:
mode:
authormarino <marino@pkgsrc.org>2012-12-12 20:49:01 +0000
committermarino <marino@pkgsrc.org>2012-12-12 20:49:01 +0000
commit5bc0974395b1622e34a1eafc62ad0f558293c9aa (patch)
tree7a12ae351e0f635f96b34682e5816bd1d37b9485 /mk/compiler
parentc6ed377de9e3c36ce91b954e68979501c85447d4 (diff)
downloadpkgsrc-5bc0974395b1622e34a1eafc62ad0f558293c9aa.tar.gz
compiler.mk, gcc.mk: Implement DRAGONFLY_CCVER
DragonFly has two compilers in base, GCC 4.4.7 and GCC 4.7.2. The way one switches between them for userland programs is to set CCVER in the environment. However, to set this via make.conf is tricky. I've been using the low level "ALL_ENV+= CCVER=gcc47", but this trick fails to properly identify the compiler which results in _GCC_VERSION being incorrectly defined. Additionally, there are some prominent packages that do not build on gcc 4.7 and the fix is either not fully understood or would require a large amount of work to implement. In these cases, it is desireable to specify the package be built on gcc 4.4 regardless of CCVER setting. To address these issues, a new directive is added: DRAGONFLY_CCVER. It is only effective if OPSYS equals "DragonFly", and it will properly set CCVER and properly define _GCC_VERSION. It will also allow a per package specification of a particular compiler in the pkg makefile.
Diffstat (limited to 'mk/compiler')
-rw-r--r--mk/compiler/gcc.mk4
1 files changed, 3 insertions, 1 deletions
diff --git a/mk/compiler/gcc.mk b/mk/compiler/gcc.mk
index 70734b2676c..f84da78682a 100644
--- a/mk/compiler/gcc.mk
+++ b/mk/compiler/gcc.mk
@@ -1,4 +1,4 @@
-# $NetBSD: gcc.mk,v 1.129 2012/09/17 04:43:56 obache Exp $
+# $NetBSD: gcc.mk,v 1.130 2012/12/12 20:49:01 marino Exp $
#
# This is the compiler definition for the GNU Compiler Collection.
#
@@ -165,6 +165,8 @@ _GCC_VERSION_STRING!= \
( env LC_ALL=C ${_CC} -v 2>&1 | ${GREP} 'gcc version') 2>/dev/null || ${ECHO} 0
. if !empty(_GCC_VERSION_STRING:Megcs*)
_GCC_VERSION= 2.8.1 # egcs is considered to be gcc-2.8.1.
+. elif !empty(DRAGONFLY_CCVER) && ${OPSYS} == "DragonFly"
+_GCC_VERSION!= env CCVER=${DRAGONFLY_CCVER} ${_CC} -dumpversion
. elif !empty(_GCC_VERSION_STRING:Mgcc*)
_GCC_VERSION!= ${_CC} -dumpversion
. else