summaryrefslogtreecommitdiff
path: root/mk/buildlink3/marshall
blob: 6c6e2512fb5ee47729f8bdfdd5cc21c3b1f525e1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# $NetBSD: marshall,v 1.6 2003/11/25 14:44:39 jlam Exp $
#
# Handle cases where multiple consecutive arguments must be processed
# together, either by merging the arguments or "skipping" the extra
# arguments.
#
case $arg in
#
# Merge "-Wl,--rpath -Wl,/path/to/dir" into a single argument
# "-Wl,--rpath,/path/to/dir" so that we can look it up in the cache.
#
-Wl,-rpath|-Wl,-rpath-link|\
-Wl,--rpath|-Wl,--rpath-link)
	nextarg=`$echo "X$1" | $Xsed -e "s|^-Wl,||g"`
	arg="$arg,$nextarg"
	shift
	;;
#
# If we're linking a shared library by "cc -shared -o /srcdir/shlib",
# we need to protect the full path after "-o" from being transformed
# from "/srcdir/shlib" to "-L/srcdir -lshlib"
#
-o)
	skipargs=1
	;;
#
# Darwin's special GCC uses "-install_name /path/shlib" to indicate
# the final installed location for the named shared library, and we
# need to protect the full path from "/path/shlib" -> "-L/path -lshlib"
# transformation.
#
-install_name)
	skipargs=1
	;;
esac