summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortv <tv@pkgsrc.org>2004-12-09 17:15:01 +0000
committertv <tv@pkgsrc.org>2004-12-09 17:15:01 +0000
commitb54b3baeaeda66bf1ddf60cd51668ec232c8086a (patch)
tree2f167a24ec1461f66af3d5cb2ad2fe962354bec5
parent549401cafd9442d0d614c915cba5a47bb1271ae7 (diff)
downloadpkgsrc-b54b3baeaeda66bf1ddf60cd51668ec232c8086a.tar.gz
Merge from HEAD.
-rw-r--r--mk/bsd.options.mk20
-rw-r--r--mk/bsd.sites.mk4
-rw-r--r--mk/pthread.builtin.mk5
-rw-r--r--mk/wrapper/bsd.wrapper.mk10
-rw-r--r--mk/wrapper/cmd-sink-darwin-xlc59
-rw-r--r--mk/wrapper/logic36
-rw-r--r--mk/wrapper/transform-xlc-cc24
7 files changed, 133 insertions, 25 deletions
diff --git a/mk/bsd.options.mk b/mk/bsd.options.mk
index a165724362a..91220e123e1 100644
--- a/mk/bsd.options.mk
+++ b/mk/bsd.options.mk
@@ -1,4 +1,4 @@
-# $NetBSD: bsd.options.mk,v 1.9.4.2 2004/11/28 20:11:32 tv Exp $
+# $NetBSD: bsd.options.mk,v 1.9.4.3 2004/12/09 17:15:01 tv Exp $
#
# This Makefile fragment provides boilerplate code for standard naming
# conventions for handling per-package build options.
@@ -176,9 +176,21 @@ _PKG_OPTIONS_WORDWRAP_FILTER= \
END { if (length(line) > 0) print " "line } \
'
-# Store the result in the +BUILD_INFO file so we can query for the build
-# options using "pkg_info -Q PKG_OPTIONS <pkg>".
-BUILD_DEFS_FIXED+= PKG_OPTIONS
+.if !defined(_PKG_OPTIONS_AVAILABLE) && defined(PKG_SUPPORTED_OPTIONS) && !empty(PKG_SUPPORTED_OPTIONS)
+_PKG_OPTIONS_AVAILABLE!= ${ECHO} ${PKG_SUPPORTED_OPTIONS} | ${XARGS} -n 1 | ${SORT}
+.endif
+.if !defined(_PKG_OPTIONS_DEFAULT) && defined(PKG_DEFAULT_OPTIONS) && !empty(PKG_DEFAULT_OPTIONS)
+_PKG_OPTIONS_DEFAULT!= ${ECHO} ${PKG_DEFAULT_OPTIONS} | ${XARGS} -n 1 | ${SORT}
+.endif
+.if !defined(_PKG_OPTIONS_ENABLED) && defined(PKG_OPTIONS) && !empty(PKG_OPTIONS)
+_PKG_OPTIONS_ENABLED!= ${ECHO} ${PKG_OPTIONS} | ${XARGS} -n 1 | ${SORT}
+.endif
+
+.PHONY: show-options
+show-options:
+ @${ECHO} "available: ${_PKG_OPTIONS_AVAILABLE}"
+ @${ECHO} "default: ${_PKG_OPTIONS_DEFAULT}"
+ @${ECHO} "enabled: ${_PKG_OPTIONS_ENABLED}"
.if defined(PKG_SUPPORTED_OPTIONS)
.PHONY: supported-options-message
diff --git a/mk/bsd.sites.mk b/mk/bsd.sites.mk
index 18a42bc500c..6a6a96ddf78 100644
--- a/mk/bsd.sites.mk
+++ b/mk/bsd.sites.mk
@@ -1,4 +1,4 @@
-# $NetBSD: bsd.sites.mk,v 1.20.2.3 2004/12/03 19:15:00 tv Exp $
+# $NetBSD: bsd.sites.mk,v 1.20.2.4 2004/12/09 17:15:01 tv Exp $
#
# Default MASTER_SITES
@@ -127,7 +127,7 @@ MASTER_SITE_SOURCEFORGE+= \
http://umn.dl.sourceforge.net/sourceforge/ \
http://unc.dl.sourceforge.net/sourceforge/ \
http://voxel.dl.sourceforge.net/sourceforge/ \
- ftp://ftp3.sourceforge.net/pub/sourceforge/
+ ftp://ftp2.sourceforge.net/pub/sourceforge/
# ftp://ftp.tuwien.ac.at/linux/sourceforge/
# http://sf.gds.tuwien.ac.at/
diff --git a/mk/pthread.builtin.mk b/mk/pthread.builtin.mk
index b4b98d11f94..5b86375ff87 100644
--- a/mk/pthread.builtin.mk
+++ b/mk/pthread.builtin.mk
@@ -1,4 +1,4 @@
-# $NetBSD: pthread.builtin.mk,v 1.2.2.1 2004/11/28 20:11:32 tv Exp $
+# $NetBSD: pthread.builtin.mk,v 1.2.2.2 2004/12/09 17:15:01 tv Exp $
.for _lib_ in pthread c_r rt
. if !defined(_BLNK_LIB_FOUND.${_lib_})
@@ -53,6 +53,9 @@ BUILDLINK_CFLAGS.pthread+= -pthread
. else
BUILDLINK_CPPFLAGS.pthread+= -D_REENTRANT
. endif
+. if ${OPSYS} == "FreeBSD"
+BUILDLINK_CPPFLAGS.pthread+= -D_THREAD_SAFE
+. endif
# Handle systems which have pthreads functions in libc_r such as
# FreeBSD 5.x, or fall back to libc if we don't find libc_r.
diff --git a/mk/wrapper/bsd.wrapper.mk b/mk/wrapper/bsd.wrapper.mk
index ee8be54c938..0a25dcbec53 100644
--- a/mk/wrapper/bsd.wrapper.mk
+++ b/mk/wrapper/bsd.wrapper.mk
@@ -1,4 +1,4 @@
-# $NetBSD: bsd.wrapper.mk,v 1.12.2.4 2004/11/30 15:10:47 tv Exp $
+# $NetBSD: bsd.wrapper.mk,v 1.12.2.5 2004/12/09 17:15:01 tv Exp $
#
# Copyright (c) 2004 The NetBSD Foundation, Inc.
# All rights reserved.
@@ -252,6 +252,8 @@ _WRAP_TRANSFORM.CXX= ${_WRAP_TRANSFORM.CC}
.endif
.if !empty(PKGSRC_COMPILER:Mxlc)
+_WRAP_CMD_SINK.CC= ${WRAPPER_TMPDIR}/cmd-sink-darwin-xlc
+_WRAP_CMD_SINK.CXX= ${_WRAP_CMD_SINK.CC}
_WRAP_CACHE_BODY.CC= ${WRAPPER_TMPDIR}/cache-body-xlc-cc
_WRAP_TRANSFORM.CC= ${WRAPPER_TMPDIR}/transform-xlc-cc
_WRAP_CACHE_BODY.CXX= ${_WRAP_CACHE_BODY.CC}
@@ -415,6 +417,12 @@ ${WRAPPER_TMPDIR}/cmd-sink-aix-xlc: \
${_PKG_SILENT}${_PKG_DEBUG}${CAT} ${.ALLSRC} \
| ${_WRAP_SH_CRUNCH_FILTER} > ${.TARGET}
+${WRAPPER_TMPDIR}/cmd-sink-darwin-xlc: \
+ ${WRAPPER_SRCDIR}/cmd-sink-darwin-xlc
+ ${_PKG_SILENT}${_PKG_DEBUG}${MKDIR} ${.TARGET:H}
+ ${_PKG_SILENT}${_PKG_DEBUG}${CAT} ${.ALLSRC} \
+ | ${_WRAP_SH_CRUNCH_FILTER} > ${.TARGET}
+
${WRAPPER_TMPDIR}/cmd-sink-interix-gcc: \
${WRAPPER_SRCDIR}/cmd-sink-interix-gcc
${_PKG_SILENT}${_PKG_DEBUG}${MKDIR} ${.TARGET:H}
diff --git a/mk/wrapper/cmd-sink-darwin-xlc b/mk/wrapper/cmd-sink-darwin-xlc
new file mode 100644
index 00000000000..54bef45f3ca
--- /dev/null
+++ b/mk/wrapper/cmd-sink-darwin-xlc
@@ -0,0 +1,59 @@
+# $NetBSD: cmd-sink-darwin-xlc,v 1.1.2.2 2004/12/09 17:15:01 tv Exp $
+#
+# Copyright (c) 2004 The NetBSD Foundation, Inc.
+# All rights reserved.
+#
+# This code is derived from software contributed to The NetBSD Foundation
+# by Johnny C. Lam.
+#
+# 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. All advertising materials mentioning features or use of this software
+# must display the following acknowledgement:
+# This product includes software developed by the NetBSD
+# Foundation, Inc. and its contributors.
+# 4. 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.
+
+# Empty out the command buffer and build up the command line in $cmd.
+while ! queue_is_empty cmdbuf; do
+ pop_queue cmdbuf arg
+ $debug_log $wrapperlog " (cmd-sink-darwin-xlc) pop: $arg"
+ case $arg in
+ ##############################################################
+ # xlc doesn't support -install_name, -compatibility_version,
+ # -current_version, so explicitly pass them to the linker with
+ # the next argument.
+ ##############################################################
+ -install_name|-compatibility_version|-current_version)
+ pop_queue cmdbuf arg2
+ $debug_log $wrapperlog " (cmd-sink-darwin-xlc) pop: $arg2"
+ $debug_log $wrapperlog " (cmd-sink-darwin-xlc) pre: -Wl,$arg2"
+ prepend_queue cmdbuf "-Wl,$arg2"
+ $debug_log $wrapperlog " (cmd-sink-darwin-xlc) pre: -Wl,$arg"
+ prepend_queue cmdbuf "-Wl,$arg"
+ ;;
+ *)
+ . $buildcmd
+ ;;
+ esac
+done
diff --git a/mk/wrapper/logic b/mk/wrapper/logic
index 84a969dc3dc..e575b42aa23 100644
--- a/mk/wrapper/logic
+++ b/mk/wrapper/logic
@@ -1,4 +1,4 @@
-# $NetBSD: logic,v 1.6 2004/10/08 21:53:53 jlam Exp $
+# $NetBSD: logic,v 1.6.2.1 2004/12/09 17:15:01 tv Exp $
#
# Copyright (c) 2004 The NetBSD Foundation, Inc.
# All rights reserved.
@@ -207,6 +207,7 @@ while ! queue_is_empty argbuf; do
*)
# Apply transformations to $arg.
addtocache=no
+ split_arg=no
case $skip_transform in
yes)
$debug_log $wrapperlog " (logic) to: $arg [untransformed]"
@@ -231,12 +232,22 @@ while ! queue_is_empty argbuf; do
;;
esac
+ ##############################################
+ # Split all -l options along whitespace. This
+ # disallows library names with whitespace, but it
+ # allows us to handle transformations that look
+ # like, e.g. "-lreadline" -> "-ledit -ltermcap".
+ ##############################################
+ case $arg in
+ -l*) split_arg=yes ;;
+ esac
+
# Re-create the cache file if we're adding to it.
case $updatecache,$addtocache in
yes,yes)
shquote "$arg"; cachedarg="$shquoted"
$cat >> $cache_body << EOF
-$cachearg) arg=$cachedarg; cachehit=yes ;;
+$cachearg) arg=$cachedarg; split_arg=$split_arg; cachehit=yes ;;
EOF
$cat $cache_header \
$cache_body \
@@ -245,23 +256,24 @@ EOF
esac
;;
esac
- case $arg in
+
+ case $split_arg in
######################################################
- # Split -l options along whitespace. This disallows
- # library names with whitespace, but it allows us to
- # handle transformations that look like, e.g.
- # "-lreadline" -> "-ledit -ltermcap".
+ # Split some options along whitespace. This disallows
+ # options that contain whitespace, but it allows us to
+ # handle transformations that transform one arg into
+ # several.
######################################################
- -l*)
- for lib in $arg; do
- append_queue cmdbuf "$lib"
- $debug_log $wrapperlog " (logic) push: $lib"
+ yes)
+ for i in $arg; do
+ append_queue cmdbuf "$i"
+ $debug_log $wrapperlog " (logic) push: $i"
done
;;
######################################################
# Everything else goes into the command buffer unchanged.
######################################################
- *)
+ no)
append_queue cmdbuf "$arg"
$debug_log $wrapperlog " (logic) push: $arg"
;;
diff --git a/mk/wrapper/transform-xlc-cc b/mk/wrapper/transform-xlc-cc
index 6643a780c32..cef8eb33be2 100644
--- a/mk/wrapper/transform-xlc-cc
+++ b/mk/wrapper/transform-xlc-cc
@@ -1,4 +1,4 @@
-# $NetBSD: transform-xlc-cc,v 1.1 2004/10/06 09:49:53 grant Exp $
+# $NetBSD: transform-xlc-cc,v 1.1.2.1 2004/12/09 17:15:01 tv Exp $
#
# Copyright (c) 2004 The NetBSD Foundation, Inc.
# All rights reserved.
@@ -36,12 +36,12 @@
case $arg in
######################################################################
-# Leave -Wl,-R unchanged.
+# Leave -Wl, unchanged.
######################################################################
--Wl,-R*)
+-Wl,*)
;;
######################################################################
-# XL C doens't understand many -W* arguments, so just silently ignore
+# XL C doesn't understand many -W* arguments, so just silently ignore
# them all.
######################################################################
-W*)
@@ -49,10 +49,24 @@ case $arg in
msg_log $wrapperlog " (transform-xlc-cc) to: $arg"
addtocache=yes
;;
+# xlc uses -qmkshrobj to create shared objects, and we also need to
+# tell the linker to use a flat namespace and allow undefined symbols.
+-dynamiclib)
+ arg="-qmkshrobj -Wl,-flat_namespace -Wl,-undefined -Wl,suppress"
+ msg_log $wrapperlog " (transform-xlc-cc) to: $arg"
+ addtocache=yes
+ split_arg=yes
+ ;;
+# -qnocommon is the xlc argument to allocate uninitialized globals in
+# the data section.
+-fno-common)
+ arg=-qnocommon
+ addtocache=yes
+ ;;
######################################################################
# Ignore some flags that are unnecessary for XL C.
######################################################################
--pipe|-ansi|-fno-common|-fno-gnu-keywords|-fstrict-prototypes|-no-cpp-precomp|-pedantic)
+-pipe|-ansi|-fno-gnu-keywords|-fstrict-prototypes|-no-cpp-precomp|-pedantic)
arg=
msg_log $wrapperlog " (transform-xlc-cc) to: $arg"
addtocache=yes