pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/mk/buildlink3 Reorder arguments so that all of the -l ...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/cf610bfabac6
branches:  trunk
changeset: 467319:cf610bfabac6
user:      jlam <jlam%pkgsrc.org@localhost>
date:      Thu Jan 29 06:06:41 2004 +0000

description:
Reorder arguments so that all of the -l options come after the -L options
which come after everything else.  This ensure that all libraries come
after all -L/dir options so that the Sun linker won't act stupidly.

diffstat:

 mk/buildlink3/buildcmd   |  24 +++++++++++++++++-------
 mk/buildlink3/libtool.sh |   5 ++++-
 mk/buildlink3/wrapper.sh |   5 ++++-
 3 files changed, 25 insertions(+), 9 deletions(-)

diffs (101 lines):

diff -r 80c7ce072f2f -r cf610bfabac6 mk/buildlink3/buildcmd
--- a/mk/buildlink3/buildcmd    Thu Jan 29 06:03:15 2004 +0000
+++ b/mk/buildlink3/buildcmd    Thu Jan 29 06:06:41 2004 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: buildcmd,v 1.2 2003/10/04 10:20:09 jlam Exp $
+# $NetBSD: buildcmd,v 1.3 2004/01/29 06:06:41 jlam Exp $
 #
 # Append $arg to $cmd to build up the command line to be executed, but
 # directly add the next few arguments to $cmd if $skipargs > 0.
@@ -23,9 +23,19 @@
                # These options are only ever useful the first time
                # they're given.  All other instances are redundant.
                #
-               case "$cmd" in
-               *" "$arg|*" "$arg" "*)  ;;
-               *)      cmd="$cmd $arg" ;;
+               case $arg in
+               -L*)
+                       case "$ldflags" in
+                       *" "$arg|*" "$arg" "*)     ;;
+                       *) ldflags="$ldflags $arg" ;;
+                       esac
+                       ;;
+               *)
+                       case "$cmd" in
+                       *" "$arg|*" "$arg" "*) ;;
+                       *) cmd="$cmd $arg"     ;;
+                       esac
+                       ;;
                esac
                ;;
        -l*)
@@ -33,9 +43,9 @@
                # Extra libraries are suppressed only if they're
                # repeated, e.g. "-lm -lm -lm -lm" -> "-lm".
                #
-               case "$cmd" in
-               *" "$arg)       ;;
-               *)      cmd="$cmd $arg" ;;
+               case "$libs" in
+               *" "$arg)            ;;
+               *) libs="$libs $arg" ;;
                esac
                ;;
        *)
diff -r 80c7ce072f2f -r cf610bfabac6 mk/buildlink3/libtool.sh
--- a/mk/buildlink3/libtool.sh  Thu Jan 29 06:03:15 2004 +0000
+++ b/mk/buildlink3/libtool.sh  Thu Jan 29 06:06:41 2004 +0000
@@ -1,6 +1,6 @@
 #!@BUILDLINK_SHELL@
 #
-# $NetBSD: libtool.sh,v 1.11 2004/01/21 13:52:56 jlam Exp $
+# $NetBSD: libtool.sh,v 1.12 2004/01/29 06:06:41 jlam Exp $
 
 Xsed='@SED@ -e 1s/^X//'
 sed_quote_subst='s/\([\\`\\"$\\\\]\)/\\\1/g'
@@ -94,6 +94,8 @@
 done
 
 cmd="@WRAPPEE@"
+ldflags=
+libs=
 case $mode in
 install)
        #
@@ -161,6 +163,7 @@
        done
        ;;
 esac
+cmd="$cmd $ldflags $libs"
 
 @_BLNK_WRAP_ENV@
 @_BLNK_WRAP_SANITIZE_PATH@
diff -r 80c7ce072f2f -r cf610bfabac6 mk/buildlink3/wrapper.sh
--- a/mk/buildlink3/wrapper.sh  Thu Jan 29 06:03:15 2004 +0000
+++ b/mk/buildlink3/wrapper.sh  Thu Jan 29 06:06:41 2004 +0000
@@ -1,6 +1,6 @@
 #!@BUILDLINK_SHELL@
 #
-# $NetBSD: wrapper.sh,v 1.7 2004/01/21 13:52:56 jlam Exp $
+# $NetBSD: wrapper.sh,v 1.8 2004/01/29 06:06:41 jlam Exp $
 
 Xsed='@SED@ -e 1s/^X//'
 sed_quote_subst='s/\([\\`\\"$\\\\]\)/\\\1/g'
@@ -41,6 +41,8 @@
 $echo [*] $original_cmd >> $wrapperlog
 
 cmd="@WRAPPEE@"
+ldflags=
+libs=
 set -- "$@" @_BLNK_WRAP_EXTRA_FLAGS@
 while $test $# -gt 0 -o -n "${buf1}${buf2}${buf3}${buf4}${buf5}"; do
        cachehit=no
@@ -72,6 +74,7 @@
        #
        . $buildcmd
 done
+cmd="$cmd $ldflags $libs"
 
 @_BLNK_WRAP_ENV@
 @_BLNK_WRAP_SANITIZE_PATH@



Home | Main Index | Thread Index | Old Index