summaryrefslogtreecommitdiff
path: root/mk
diff options
context:
space:
mode:
authorjlam <jlam>2004-02-18 11:18:42 +0000
committerjlam <jlam>2004-02-18 11:18:42 +0000
commit8b83c9b073a82e76827aa2d9fe59cb3cf2116a05 (patch)
treecc7da8e9457392b0958c99992cb5559b55f862ec /mk
parent6748021a6b51fa425ec91994a6ba82f2b22358bd (diff)
downloadpkgsrc-8b83c9b073a82e76827aa2d9fe59cb3cf2116a05.tar.gz
Initial support for the MIPSpro ucode compilers found on IRIX 5.3. The
ucode compilers only support building the "o32" ABI.
Diffstat (limited to 'mk')
-rw-r--r--mk/buildlink3/mipspro-ucode-cc-post-cache12
-rw-r--r--mk/buildlink3/mipspro-ucode-cc-post-logic41
-rw-r--r--mk/compiler/bsd.compiler.mk5
-rw-r--r--mk/compiler/mipspro-ucode.mk18
4 files changed, 74 insertions, 2 deletions
diff --git a/mk/buildlink3/mipspro-ucode-cc-post-cache b/mk/buildlink3/mipspro-ucode-cc-post-cache
new file mode 100644
index 00000000000..10d7931918f
--- /dev/null
+++ b/mk/buildlink3/mipspro-ucode-cc-post-cache
@@ -0,0 +1,12 @@
+# $NetBSD: mipspro-ucode-cc-post-cache,v 1.1 2004/02/18 11:18:42 jlam Exp $
+#
+# This file implements the default action of the "cc" private cache
+# for the MIPSpro ucode 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]*|-f[pP][iI][cC])
+ skipcache=yes
+ ;;
+esac
diff --git a/mk/buildlink3/mipspro-ucode-cc-post-logic b/mk/buildlink3/mipspro-ucode-cc-post-logic
new file mode 100644
index 00000000000..9b4377c1353
--- /dev/null
+++ b/mk/buildlink3/mipspro-ucode-cc-post-logic
@@ -0,0 +1,41 @@
+# $NetBSD: mipspro-ucode-cc-post-logic,v 1.1 2004/02/18 11:18:42 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[0123])
+ # MIPSpro can handle -O[0123] 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
+ ;;
+-Wl,*)
+ # 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
+ ;;
+-f[Pp][Ii][Cc])
+ # The MIPSpro compiler uses -KPIC to create position independent code.
+ #
+ arg=-KPIC
+ addtoprivatecache=yes
+ ;;
+esac
diff --git a/mk/compiler/bsd.compiler.mk b/mk/compiler/bsd.compiler.mk
index 9ef9bc3c6a1..3e299d94a93 100644
--- a/mk/compiler/bsd.compiler.mk
+++ b/mk/compiler/bsd.compiler.mk
@@ -1,4 +1,4 @@
-# $NetBSD: bsd.compiler.mk,v 1.9 2004/02/05 21:26:16 jlam Exp $
+# $NetBSD: bsd.compiler.mk,v 1.10 2004/02/18 11:18:43 jlam Exp $
#
# This Makefile fragment implements handling for supported C/C++/Fortran
# compilers.
@@ -14,7 +14,8 @@
# distcc distributed C/C++ (chainable)
# ccache compiler cache (chainable)
# gcc GNU
-# mipspro Silicon Graphics, Inc. MIPSpro
+# mipspro Silicon Graphics, Inc. MIPSpro (n32/n64)
+# mipspro-ucode Silicon Graphics, Inc. MIPSpro (o32)
# sunpro Sun Microsystems, Inc. WorkShip/Forte/Sun
# ONE Studio
#
diff --git a/mk/compiler/mipspro-ucode.mk b/mk/compiler/mipspro-ucode.mk
new file mode 100644
index 00000000000..ed34c87bef8
--- /dev/null
+++ b/mk/compiler/mipspro-ucode.mk
@@ -0,0 +1,18 @@
+# $NetBSD: mipspro-ucode.mk,v 1.1 2004/02/18 11:18:43 jlam Exp $
+
+.if !defined(COMPILER_MIPSPRO_UCODE_MK)
+COMPILER_MIPSPRO_UCODE_MK= one
+
+CC_VERSION= MIPSpro Compilers: Version 4.x (ucode)
+. include "../../mk/compilers/mipspro.mk"
+.endif # COMPILER_MIPSPRO_UCODE_MK
+
+# The following section is included only if we're not being included by
+# bsd.prefs.mk.
+#
+.if empty(BSD_PREFS_MK)
+. if empty(COMPILER_MIPSPRO_UCODE_MK:Mtwo)
+COMPILER_MIPSPRO_UCODE_MK+= two
+. include "../../mk/compilers/mipspro.mk"
+. endif # COMPILER_MIPSPRO_UCODE_MK
+.endif # BSD_PREFS_MK