summaryrefslogtreecommitdiff
path: root/mk/wrapper/arg-source
diff options
context:
space:
mode:
authorrillig <rillig>2007-02-23 00:31:29 +0000
committerrillig <rillig>2007-02-23 00:31:29 +0000
commitc06af81aa97c3d41507a873d72fe6366a2ffdd2a (patch)
tree2813e54ba2a93c0f60db6858608c13507f9d46ea /mk/wrapper/arg-source
parent4dba6c17298eb78919c677141f3c022c0035b9a4 (diff)
downloadpkgsrc-c06af81aa97c3d41507a873d72fe6366a2ffdd2a.tar.gz
The compiler option -Wl,foo,bar,baz is split into -Wl,foo -Wl,bar
-Wl,baz before processing the resulting options again. Fixes PR 32203.
Diffstat (limited to 'mk/wrapper/arg-source')
-rw-r--r--mk/wrapper/arg-source27
1 files changed, 26 insertions, 1 deletions
diff --git a/mk/wrapper/arg-source b/mk/wrapper/arg-source
index 57959ecaf19..bf4ce639fcb 100644
--- a/mk/wrapper/arg-source
+++ b/mk/wrapper/arg-source
@@ -1,4 +1,4 @@
-# $NetBSD: arg-source,v 1.11 2007/02/21 12:27:36 rillig Exp $
+# $NetBSD: arg-source,v 1.12 2007/02/23 00:31:29 rillig Exp $
#
# Copyright (c) 2004 The NetBSD Foundation, Inc.
# All rights reserved.
@@ -62,6 +62,31 @@ while $test $# -gt 0; do
$debug_log $wrapperlog " (arg-source) push: $arg$nextarg"
;;
##############################################################
+ # Split -Wl,option1,option2 into -Wl,option1 -Wl,option2 and
+ # process them again.
+ #
+ # XXX: The sunpro manual page says: A comma can be part of an
+ # argument by escaping it with an immediately preceding
+ # backslash. The manual pages for gcc and mipspro do not
+ # mention commas in those options at all.
+ ##############################################################
+ -Wl,*,*)
+ $debug_log $wrapperlog " (arg-source) before-split: $arg $*"
+ saved_IFS="$IFS"
+ new_args=""
+ IFS=","
+ for o in ${arg#-Wl,}; do
+ IFS="$saved_IFS"
+ shquote "$o"; o="$shquoted"
+ new_args="$new_args -Wl,$o"
+ done
+ IFS="$saved_IFS"
+ eval "set args $new_args \"\$@\""; shift
+ $debug_log $wrapperlog " (arg-source) after-split: $*"
+ continue
+ ;;
+
+ ##############################################################
# Split "-Wl,-R/dir1:/dir2" into "-Wl,-R/dir1 -Wl,-R/dir2".
# Same for -R and -Wl,-rpath and -Wl,-rpath-link.
##############################################################