diff options
author | jlam <jlam@pkgsrc.org> | 2004-01-07 20:45:59 +0000 |
---|---|---|
committer | jlam <jlam@pkgsrc.org> | 2004-01-07 20:45:59 +0000 |
commit | 17709ff9af8b44e22113b266709d0b931d772314 (patch) | |
tree | 54d0ce34222a1631930f507bc53ac6586c402ad1 /mk | |
parent | e85662a6f33c65df0d07d6e6979f69a49ee702cf (diff) | |
download | pkgsrc-17709ff9af8b44e22113b266709d0b931d772314.tar.gz |
Add bits to make buildlink3 use the MIPSpro compiler if USE_MIPSPRO is
defined.
Diffstat (limited to 'mk')
-rw-r--r-- | mk/buildlink3/bsd.buildlink3.mk | 43 | ||||
-rw-r--r-- | mk/buildlink3/mipspro-cc-post-cache | 12 | ||||
-rw-r--r-- | mk/buildlink3/mipspro-cc-post-logic | 36 |
3 files changed, 87 insertions, 4 deletions
diff --git a/mk/buildlink3/bsd.buildlink3.mk b/mk/buildlink3/bsd.buildlink3.mk index abc188072e3..d451d3f1070 100644 --- a/mk/buildlink3/bsd.buildlink3.mk +++ b/mk/buildlink3/bsd.buildlink3.mk @@ -1,4 +1,4 @@ -# $NetBSD: bsd.buildlink3.mk,v 1.41 2004/01/07 07:11:34 jlam Exp $ +# $NetBSD: bsd.buildlink3.mk,v 1.42 2004/01/07 20:45:59 jlam Exp $ # # An example package buildlink3.mk file: # @@ -935,6 +935,23 @@ _BLNK_WRAP_SANITIZE_PATH.SHLIBTOOL= # empty # We need to "unbuildlinkify" any libtool archives. _BLNK_WRAP_LT_UNTRANSFORM_SED= ${_UNBUILDLINK_SED} +.if defined(USE_MIPSPRO) +_BLNK_WRAP_PRIVATE_PRE_CACHE.CC= ${_BLNK_WRAP_PRE_CACHE} +_BLNK_WRAP_PRIVATE_CACHE_ADD.CC= ${BUILDLINK_DIR}/bin/.mipspro-cc-cache-add +_BLNK_WRAP_PRIVATE_CACHE.CC= ${BUILDLINK_DIR}/bin/.mipspro-cc-cache +_BLNK_WRAP_PRIVATE_POST_CACHE.CC= ${BUILDLINK_DIR}/bin/.mipspro-cc-post-cache +_BLNK_WRAP_POST_LOGIC.CC= ${BUILDLINK_DIR}/bin/.mipspro-cc-post-logic +# +# The MIPSpro C++ compiler wrapper shares cache information with the C +# compiler. +# +_BLNK_WRAP_PRIVATE_PRE_CACHE.CXX= ${_BLNK_WRAP_PRE_CACHE} +_BLNK_WRAP_PRIVATE_CACHE_ADD.CXX= ${BUILDLINK_DIR}/bin/.mipspro-cc-cache-add +_BLNK_WRAP_PRIVATE_CACHE.CXX= ${BUILDLINK_DIR}/bin/.mipspro-cc-cache +_BLNK_WRAP_PRIVATE_POST_CACHE.CXX= ${BUILDLINK_DIR}/bin/.mipspro-cc-post-cache +_BLNK_WRAP_POST_LOGIC.CXX= ${BUILDLINK_DIR}/bin/.mipspro-cc-post-logic +.endif # USE_MIPSPRO + .if defined(USE_SUNPRO) _BLNK_WRAP_PRIVATE_PRE_CACHE.CC= ${_BLNK_WRAP_PRE_CACHE} _BLNK_WRAP_PRIVATE_CACHE_ADD.CC= ${BUILDLINK_DIR}/bin/.sunpro-cc-cache-add @@ -1121,10 +1138,16 @@ MAKE_ENV+= ${BUILDLINK_ENV} # OS-specific overrides for buildlink3 wrappers # .if defined(USE_SUNPRO) -_BLNK_WRAPPEES.SunOS?= CC CXX +_BLNK_WRAPPEES.${_BLNK_OPSYS}?= CC CXX SUNWSPROBASE?= /opt/SUNWspro -CC.SunOS?= ${SUNWSPROBASE}/bin/cc -CXX.SunOS?= ${SUNWSPROBASE}/bin/CC +CC.${_BLNK_OPSYS}?= ${SUNWSPROBASE}/bin/cc +CXX.${_BLNK_OPSYS}?= ${SUNWSPROBASE}/bin/CC +.endif +.if defined(USE_MIPSPRO) +_BLNK_WRAPPEES.${_BLNK_OPSYS}?= CC CXX +MIPSPROBASE?= /usr +CC.${_BLNK_OPSYS}?= ${MIPSPROBASE}/bin/cc +CXX.${_BLNK_OPSYS}?= ${MIPSPROBASE}/bin/CC .endif .PHONY: buildlink-${_BLNK_OPSYS}-wrappers @@ -1226,6 +1249,12 @@ ${_BLNK_WRAP_POST_CACHE}: ${.CURDIR}/../../mk/buildlink3/post-cache | ${_BLNK_SH_CRUNCH_FILTER} > ${.TARGET} .endif +${BUILDLINK_DIR}/bin/.mipspro-cc-post-cache: \ + ${.CURDIR}/../../mk/buildlink3/mipspro-cc-post-cache + ${_PKG_SILENT}${_PKG_DEBUG}${MKDIR} ${.TARGET:H} + ${_PKG_SILENT}${_PKG_DEBUG}${CAT} ${.ALLSRC} \ + | ${_BLNK_SH_CRUNCH_FILTER} > ${.TARGET} + ${BUILDLINK_DIR}/bin/.sunpro-cc-post-cache: \ ${.CURDIR}/../../mk/buildlink3/sunpro-cc-post-cache ${_PKG_SILENT}${_PKG_DEBUG}${MKDIR} ${.TARGET:H} @@ -1297,6 +1326,12 @@ ${_BLNK_WRAP_LOGIC_TRANSFORM}: \ ${_PKG_SILENT}${_PKG_DEBUG}${MV} -f ${.TARGET}.tmp ${.TARGET} .endif +${BUILDLINK_DIR}/bin/.mipspro-cc-post-logic: \ + ${.CURDIR}/../../mk/buildlink3/mipspro-cc-post-logic + ${_PKG_SILENT}${_PKG_DEBUG}${MKDIR} ${.TARGET:H} + ${_PKG_SILENT}${_PKG_DEBUG}${CAT} ${.ALLSRC} \ + | ${_BLNK_SH_CRUNCH_FILTER} > ${.TARGET} + ${BUILDLINK_DIR}/bin/.sunpro-cc-post-logic: \ ${.CURDIR}/../../mk/buildlink3/sunpro-cc-post-logic ${_PKG_SILENT}${_PKG_DEBUG}${MKDIR} ${.TARGET:H} diff --git a/mk/buildlink3/mipspro-cc-post-cache b/mk/buildlink3/mipspro-cc-post-cache new file mode 100644 index 00000000000..36b058cf386 --- /dev/null +++ b/mk/buildlink3/mipspro-cc-post-cache @@ -0,0 +1,12 @@ +# $NetBSD: mipspro-cc-post-cache,v 1.1 2004/01/07 20:45:59 jlam Exp $ +# +# This file implements the default action of the "cc" private cache +# for the MIPSpro suite of compilers, and tells the wrapper to skip the +# common cache lookup for all GCC arguments that the MIPSpro compiler +# can't handle; they will instead by handled directly by +# mipspro-cc-post-logic. + +-[OW]*) + skipcache=yes + ;; +esac diff --git a/mk/buildlink3/mipspro-cc-post-logic b/mk/buildlink3/mipspro-cc-post-logic new file mode 100644 index 00000000000..6671c523089 --- /dev/null +++ b/mk/buildlink3/mipspro-cc-post-logic @@ -0,0 +1,36 @@ +# $NetBSD: mipspro-cc-post-logic,v 1.1 2004/01/07 20:45:59 jlam Exp $ +# +# Silently accept some GCC compiler arguments by silently converting +# them to the MIPSpro compiler equivalents. This makes the MIPSpro +# compiler wrappers work with more software that seems to assume GCC +# nowadays. + +case $arg in +-O[123]|-Ofast|-Ofast=*) + # MIPSpro can handle -O[123] and -Ofast[=platform], so just pass + # them on through. + ;; +-O*) + # Ignore all other -O* options. + arg= + addtoprivatecache=yes + ;; +-Wl,-R*) + # Directories for the runtime library search path are passed + # via "-Wl,-rpath,<dir>", not "-Wl,-R<dir>". + # + arg=`$echo "X$arg" | $Xsed -e "s|^-Wl,-R|-Wl,-rpath,|g"` + addtoprivatecache=yes + ;; +-W[ablfpR]*,*) + # The MIPSpro compiler accepts these -W* directives, so just + # accept them and pass them on through. + ;; +-W*) + # Ignore all of the other -W* directives, which are likely to + # be GCCisms. + # + arg= + addtoprivatecache=yes + ;; +esac |