summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormarino <marino>2012-12-12 20:49:01 +0000
committermarino <marino>2012-12-12 20:49:01 +0000
commit8eb1cd30701793ad4ef5a4af81da0ec9e27a94d4 (patch)
tree7a12ae351e0f635f96b34682e5816bd1d37b9485
parent3e5b907724fe2748ef789945a70bda96867196cc (diff)
downloadpkgsrc-8eb1cd30701793ad4ef5a4af81da0ec9e27a94d4.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.
-rw-r--r--mk/compiler.mk6
-rw-r--r--mk/compiler/gcc.mk4
2 files changed, 8 insertions, 2 deletions
diff --git a/mk/compiler.mk b/mk/compiler.mk
index d13cd74985a..65683280b29 100644
--- a/mk/compiler.mk
+++ b/mk/compiler.mk
@@ -1,4 +1,4 @@
-# $NetBSD: compiler.mk,v 1.79 2012/08/09 12:32:41 jperkin Exp $
+# $NetBSD: compiler.mk,v 1.80 2012/12/12 20:49:01 marino Exp $
#
# This Makefile fragment implements handling for supported C/C++/Fortran
# compilers.
@@ -205,4 +205,8 @@ PKG_ADA:= ${_FAIL_WRAPPER.ADA}
override-tools: ${_FAIL_WRAPPER.ADA}
.endif
+.if !empty(DRAGONFLY_CCVER) && ${OPSYS} == "DragonFly"
+ALL_ENV+= CCVER=${DRAGONFLY_CCVER}
+.endif
+
.endif # BSD_COMPILER_MK
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