pkgsrc/mk/buildlink3/marshall

47 lines
1.2 KiB
Text
Raw Normal View History

# $NetBSD: marshall,v 1.8 2004/02/09 04:35:12 jlam Exp $
2003-10-04 12:20:09 +02:00
#
# 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,R -Wl,/path/to/dir" into a single argument
# "-Wl,R/path/to/dir" and merge "-Wl,--rpath -Wl,/path/to/dir" into
# "-Wl,--rpath,/path/to/dir" so that we can look them up in the cache.
#
-Wl,-R)
nextarg=`$echo "X$1" | $Xsed -e "s|^-Wl,||g"`
arg="$arg$nextarg"
shift
;;
-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:
#
# -dylib_file /path/shlib:/path2/shlib
# -dylib_install_name /path/shlib
# -install_name /path/shlib
#
# to pass the installed locations for the shared libraries to the linker,
# and we need to protect the full path from "/path/shlib" -> "-L/path -lshlib"
# transformation.
#
-dylib_file|-dylib_install_name|-install_name)
2003-10-09 10:19:47 +02:00
skipargs=1
;;
esac