Subject: Re: How Buildlink3 handles -Xlinker
To: None <tech-pkg@netbsd.org>
From: Masao Uebayashi <uebayasi@pultek.co.jp>
List: tech-pkg
Date: 03/13/2004 13:16:49
Hi.

I found converting all "-Xlinker xxx" into "-Wl,xxx" with stripping
"-Wl," in "xxx" in marshalling phase works.

I admit this process is more than what marshall phase should does, and
messing up things a bit, but I can't find any other better place to
process two sequencial arguments in Buildlink3.

Masao

Index: marshall
===================================================================
RCS file: /cvsroot/pkgsrc/mk/buildlink3/marshall,v
retrieving revision 1.9
diff -u -r1.9 marshall
--- marshall	13 Feb 2004 16:49:53 -0000	1.9
+++ marshall	13 Mar 2004 04:11:51 -0000
@@ -30,6 +30,15 @@
 	shift
 	;;
 #
+# Merge and convert "-Xlinker xxx" into "-Wl,xxx".  This is more than
+# marshalling, but just to be consistent.
+#
+-Xlinker)
+	nextarg=`$echo "X$1" | $Xsed -e "s|^-Wl,||g"`
+	arg="-Wl,$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"