PERFORCE change 179302 for review
Andrius Morkunas
andrius at FreeBSD.org
Mon Jun 7 21:15:17 UTC 2010
http://p4web.freebsd.org/@@179302?ac=10
Change 179302 by andrius at klevas on 2010/06/07 21:14:52
Add support for PORTS_CC, USE_CC.
Initial PORTS_CC and some PORTS_CXX support, they replace CC and
CXX respectively. USE_CC is intended to be used instead of USE_GCC,
but the latter is still supported for backwards compatibility.
Affected files ...
.. //depot/projects/soc2010/clangports/ports/Mk/bsd.port.mk#2 edit
Differences ...
==== //depot/projects/soc2010/clangports/ports/Mk/bsd.port.mk#2 (text+ko) ====
@@ -1747,6 +1747,38 @@
CONFIGURE_ENV+= MAKE=${GMAKE}
.endif
+# Set the defaults
+PORTS_CC?= gcc
+# PORTS_CXX should only be set if PORTS_CC is neither gcc nor clang
+PORTS_CXX?= g++
+
+# handle USE_CC
+.if defined(USE_CC)
+# Check if port requires specific compiler
+.if ${USE_CC:Mgcc*} != "" && ${USE_CC:Mclang*} == ""
+PORTS_CC= gcc
+.elif ${USE_CC:Mclang*} != "" && ${USE_CC:Mgcc*} == ""
+PORTS_CC= clang
+.endif
+.endif
+
+.if (${PORTS_CC:M*gcc*} != "") || defined(USE_GCC)
+.if defined(USE_CC) && (${USE_CC:Mgcc*} != "")
+USE_GCC= ${USE_CC:Mgcc*:S/gcc//}
+.endif
+CC= gcc
+CXX= g++
+.elif (${PORTS_CC:Mclang*} != "")
+# TODO: handle something like USE_CLANG here when/if there's need for that
+BUILD_DEPENDS+= clang:${PORTSDIR}/devel/llvm-devel
+CC= clang
+CXX= clang++
+.else
+# PORTS_CC is set to something weird
+CC= ${PORTS_CC}
+CXX= ${PORTS_CXX}
+.endif
+
.if defined(USE_GCC) || defined(USE_FORTRAN)
.include "${PORTSDIR}/Mk/bsd.gcc.mk"
.endif
More information about the p4-projects
mailing list