PERFORCE change 179429 for review
Andrius Morkunas
andrius at FreeBSD.org
Thu Jun 10 18:33:26 UTC 2010
http://p4web.freebsd.org/@@179429?ac=10
Change 179429 by andrius at klevas on 2010/06/10 18:32:41
Add support for newer GCC versions.
PORTS_CC should now be able to handle newer GCC versions like gcc44.
Affected files ...
.. //depot/projects/soc2010/clangports/ports/Mk/bsd.port.mk#4 edit
Differences ...
==== //depot/projects/soc2010/clangports/ports/Mk/bsd.port.mk#4 (text+ko) ====
@@ -1752,23 +1752,38 @@
# PORTS_CXX should only be set if PORTS_CC is neither gcc nor clang
PORTS_CXX?= g++
-# handle USE_CC
+# Handle USE_CC
.if defined(USE_CC)
# Check if port requires specific compiler
-.if ${USE_CC:Mgcc*} != "" && ${USE_CC:Mclang*} == ""
+.if !empty(USE_CC:Mgcc*) && empty(USE_CC:Mclang*)
PORTS_CC= gcc
-.elif ${USE_CC:Mclang*} != "" && ${USE_CC:Mgcc*} == ""
+.elif !empty(USE_CC:Mclang*) && empty(USE_CC:Mgcc*)
PORTS_CC= clang
.endif
.endif
-.if (${PORTS_CC:M*gcc*} != "") || defined(USE_GCC)
-.if defined(USE_CC) && (${USE_CC:Mgcc*} != "")
+# Handle PORTS_CC
+# GCC
+.if !empty(PORTS_CC:M*gcc*) || defined(USE_GCC)
+# These are set early so that USE_GCC can override it later if neccessary.
+CC= ${PORTS_CC}
+CXX= ${PORTS_CC:S/cc/++/}
+
+# Translate USE_CC to USE_GCC if the former is defined.
+.if defined(USE_CC) && !empty(USE_CC:Mgcc*)
USE_GCC= ${USE_CC:Mgcc*:S/gcc//}
.endif
-CC= gcc
-CXX= g++
-.elif (${PORTS_CC:Mclang*} != "")
+
+# If USE_GCC is defined, doesn't require specific version and accepts version
+# from PORTS_CC, override USE_GCC with version from PORTS_CC.
+.if defined(USE_GCC) && !empty(USE_GCC:M*+) && !empty(PORTS_CC:Mgcc??)
+. if ${PORTS_CC:C/gcc([0-9])([0-9])/\1.\2/} > ${USE_GCC:S/+//}
+USE_GCC=${PORTS_CC:C/gcc([0-9])([0-9])/\1.\2/}
+. endif
+.endif
+
+# Clang
+.elif !empty(PORTS_CC:Mclang*)
# TODO: handle something like USE_CLANG here when/if there's need for that
CC= clang
CXX= clang++
More information about the p4-projects
mailing list