summaryrefslogtreecommitdiff
path: root/mk
diff options
context:
space:
mode:
authorgrant <grant>2005-07-23 04:45:30 +0000
committergrant <grant>2005-07-23 04:45:30 +0000
commita9d0120502447df57da26b0a93dc10c4e223f328 (patch)
treedabd20b6ac486de9ada86c8a2b7479ff311185f4 /mk
parentaf25daadf9aa864c91155ab4a17ba5b08c68c4ca (diff)
downloadpkgsrc-a9d0120502447df57da26b0a93dc10c4e223f328.tar.gz
ensure gcc options are always passed to imake when using gcc on
Solaris. fixes PR pkg/29608.
Diffstat (limited to 'mk')
-rw-r--r--mk/wrapper/bsd.wrapper.mk23
-rw-r--r--mk/wrapper/cmd-sink-solaris-imake46
-rw-r--r--mk/wrapper/transform-solaris-gcc42
3 files changed, 110 insertions, 1 deletions
diff --git a/mk/wrapper/bsd.wrapper.mk b/mk/wrapper/bsd.wrapper.mk
index 7c74e5506f5..04f1315af03 100644
--- a/mk/wrapper/bsd.wrapper.mk
+++ b/mk/wrapper/bsd.wrapper.mk
@@ -1,4 +1,4 @@
-# $NetBSD: bsd.wrapper.mk,v 1.34 2005/07/06 03:35:28 grant Exp $
+# $NetBSD: bsd.wrapper.mk,v 1.35 2005/07/23 04:45:30 grant Exp $
#
# Copyright (c) 2005 The NetBSD Foundation, Inc.
# All rights reserved.
@@ -314,6 +314,15 @@ _WRAP_CACHE_BODY.CXX= ${_WRAP_CACHE_BODY.CC}
_WRAP_TRANSFORM.CXX= ${_WRAP_TRANSFORM.CC}
.endif
+.if ${OPSYS} == "SunOS" && !empty(PKGSRC_COMPILER:Mgcc)
+_WRAP_CACHE_BODY.CC= ${WRAPPER_TMPDIR}/cache-body-solaris-gcc
+_WRAP_TRANSFORM.CC= ${WRAPPER_TMPDIR}/transform-solaris-gcc
+_WRAP_CACHE_BODY.CXX= ${_WRAP_CACHE_BODY.CC}
+_WRAP_TRANSFORM.CXX= ${_WRAP_TRANSFORM.CC}
+_WRAP_CMD_SINK.IMAKE= ${WRAPPER_TMPDIR}/cmd-sink-solaris-imake
+_WRAP_CACHE_BODY.IMAKE= ${WRAPPER_TMPDIR}/cache-body-solaris-imake
+.endif
+
# Filter to scrunch shell scripts by removing comments and empty lines.
_WRAP_SH_CRUNCH_FILTER= \
${GREP} -v "^\#[^!]" | ${GREP} -v "^[ ][ ]*\#" | \
@@ -434,6 +443,18 @@ ${_alias_}: ${_WRAP_COOKIE.${_wrappee_}}
do-wrapper: ${_target_}
.endfor
+${WRAPPER_TMPDIR}/transform-solaris-gcc: \
+ ${WRAPPER_SRCDIR}/transform-solaris-gcc
+ ${_PKG_SILENT}${_PKG_DEBUG}${MKDIR} ${.TARGET:H}
+ ${_PKG_SILENT}${_PKG_DEBUG}${CAT} ${.ALLSRC} \
+ | ${_WRAP_SH_CRUNCH_FILTER} > ${.TARGET}
+
+${WRAPPER_TMPDIR}/cmd-sink-solaris-imake: \
+ ${WRAPPER_SRCDIR}/cmd-sink-solaris-imake
+ ${_PKG_SILENT}${_PKG_DEBUG}${MKDIR} ${.TARGET:H}
+ ${_PKG_SILENT}${_PKG_DEBUG}${CAT} ${.ALLSRC} \
+ | ${_WRAP_SH_CRUNCH_FILTER} > ${.TARGET}
+
${WRAPPER_TMPDIR}/arg-pp-darwin-gcc: \
${WRAPPER_SRCDIR}/arg-pp-darwin-gcc
${_PKG_SILENT}${_PKG_DEBUG}${MKDIR} ${.TARGET:H}
diff --git a/mk/wrapper/cmd-sink-solaris-imake b/mk/wrapper/cmd-sink-solaris-imake
new file mode 100644
index 00000000000..98164a5e6ec
--- /dev/null
+++ b/mk/wrapper/cmd-sink-solaris-imake
@@ -0,0 +1,46 @@
+# $NetBSD: cmd-sink-solaris-imake,v 1.1 2005/07/23 04:45:30 grant Exp $
+#
+# Copyright (c) 2005 The NetBSD Foundation, Inc.
+# All rights reserved.
+#
+# This code is derived from software contributed to The NetBSD Foundation
+# by Grant Beattie.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+# 3. Neither the name of The NetBSD Foundation nor the names of its
+# contributors may be used to endorse or promote products derived
+# from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+# ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+# TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+
+# ensure gcc options are always passed to imake.
+arg=-DHasGcc2=YES
+$debug_log $wrapperlog " (cmd-sink-solaris-imake) pop: $arg"
+. $buildcmd
+
+arg=-DHasGcc2ForCplusplus=YES
+$debug_log $wrapperlog " (cmd-sink-solaris-imake) pop: $arg"
+. $buildcmd
+
+while ! queue_is_empty cmdbuf; do
+ pop_queue cmdbuf arg
+ $debug_log $wrapperlog " (cmd-sink-solaris-imake) pop: $arg"
+ . $buildcmd
+done
diff --git a/mk/wrapper/transform-solaris-gcc b/mk/wrapper/transform-solaris-gcc
new file mode 100644
index 00000000000..17be9969873
--- /dev/null
+++ b/mk/wrapper/transform-solaris-gcc
@@ -0,0 +1,42 @@
+# $NetBSD: transform-solaris-gcc,v 1.1 2005/07/23 04:45:30 grant Exp $
+#
+# Copyright (c) 2005 The NetBSD Foundation, Inc.
+# All rights reserved.
+#
+# This code is derived from software contributed to The NetBSD Foundation
+# by Grant Beattie.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+# 3. Neither the name of The NetBSD Foundation nor the names of its
+# contributors may be used to endorse or promote products derived
+# from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+# ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+# TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+
+case $arg in
+# the imake config templates on Solaris 8 pass -Kpic to build PIC, even
+# when -DHasGcc2=YES -DHasGcc2ForCplusplus=YES is passed, so transform
+# -Kpic to -fPIC.
+-Kpic|-KPIC)
+ arg=-fPIC
+ msg_log $wrapperlog " (transform-solaris-gcc) to: $arg"
+ addtocache=yes
+ ;;
+esac