pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/mk/buildlink3 Add bits to make buildlink3 use the MIPS...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/420336aea5fe
branches:  trunk
changeset: 465892:420336aea5fe
user:      jlam <jlam%pkgsrc.org@localhost>
date:      Wed Jan 07 20:45:59 2004 +0000

description:
Add bits to make buildlink3 use the MIPSpro compiler if USE_MIPSPRO is
defined.

diffstat:

 mk/buildlink3/bsd.buildlink3.mk     |  43 +++++++++++++++++++++++++++++++++---
 mk/buildlink3/mipspro-cc-post-cache |  12 ++++++++++
 mk/buildlink3/mipspro-cc-post-logic |  36 ++++++++++++++++++++++++++++++
 3 files changed, 87 insertions(+), 4 deletions(-)

diffs (135 lines):

diff -r d1ef260f0738 -r 420336aea5fe mk/buildlink3/bsd.buildlink3.mk
--- a/mk/buildlink3/bsd.buildlink3.mk   Wed Jan 07 19:12:57 2004 +0000
+++ b/mk/buildlink3/bsd.buildlink3.mk   Wed Jan 07 20:45:59 2004 +0000
@@ -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 @@
 # 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 @@
 # 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_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 @@
        ${_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 -r d1ef260f0738 -r 420336aea5fe mk/buildlink3/mipspro-cc-post-cache
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/mk/buildlink3/mipspro-cc-post-cache       Wed Jan 07 20:45:59 2004 +0000
@@ -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 -r d1ef260f0738 -r 420336aea5fe mk/buildlink3/mipspro-cc-post-logic
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/mk/buildlink3/mipspro-cc-post-logic       Wed Jan 07 20:45:59 2004 +0000
@@ -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



Home | Main Index | Thread Index | Old Index