]> git.ipfire.org Git - thirdparty/libtool.git/commitdiff
* ltmain.in (-Xcompiler, -Xlinker): Add to compile_command and
authorAlexandre Oliva <oliva@lsd.ic.unicamp.br>
Sat, 18 Dec 1999 07:50:04 +0000 (07:50 +0000)
committerAlexandre Oliva <aoliva@redhat.com>
Sat, 18 Dec 1999 07:50:04 +0000 (07:50 +0000)
finalize_command.
(-Wc, -Wl): Likewise.
* tests/quote.test: Adjust quoting style of -Wl.

ChangeLog
ltmain.in
tests/quote.test

index 53e13cd06822a5a036dae7735fbf39e93b5f1c06..4d9f898e5f868d10a09da09cbe8e921b049071f5 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
 1999-12-18  Alexandre Oliva  <oliva@lsd.ic.unicamp.br>
 
+       * ltmain.in (-Xcompiler, -Xlinker): Add to compile_command and
+       finalize_command.
+       (-Wc, -Wl): Likewise.
+       * tests/quote.test: Adjust quoting style of -Wl.
+       
        * ltmain.in: Oops, `echo' -> `$echo'.
 
        * ltmain.in (-Wl, -Wc): Make commas argument separators, just like
index 23451966198db62ac3437b1613bfbea810e907b0..fcb8b70202da33dcb957f6802f1d9e943197236c 100644 (file)
--- a/ltmain.in
+++ b/ltmain.in
@@ -729,7 +729,7 @@ compiler."
       arg="$1"
       shift
       case "$arg" in
-      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \    ]*|*]*)
+      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \    ]*|*]*|"")
        qarg=\"`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`\" ### testsuite: skip nested quoting test
        ;;
       *) qarg=$arg ;;
@@ -828,26 +828,18 @@ compiler."
          continue
          ;;
        xcompiler)
-         arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
-         case "$arg" in
-         *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
-           arg="\"$arg\""
-           ;;
-         esac
-         compiler_flags="$compiler_flags $arg"
+         compiler_flags="$compiler_flags $qarg"
          prev=
+         compile_command="$compile_command $qarg"
+         finalize_command="$finalize_command $qarg"
          continue
          ;;
        xlinker)
-         arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
-         case "$arg" in
-         *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
-           arg="\"$arg\""
-           ;;
-         esac
-         linker_flags="$linker_flags $arg"
-         compiler_flags="$compiler_flags $wl$arg"
+         linker_flags="$linker_flags $qarg"
+         compiler_flags="$compiler_flags $wl$qarg"
          prev=
+         compile_command="$compile_command $wl$qarg"
+         finalize_command="$finalize_command $wl$qarg"
          continue
          ;;
        *)
@@ -1045,36 +1037,40 @@ compiler."
        ;;
        
       -Wc,*)
-       arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wc,//'`
+       args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wc,//'`
+       arg=
        IFS="${IFS=     }"; save_ifs="$IFS"; IFS=','
-       for flag in $arg; do
+       for flag in $args; do
          IFS="$save_ifs"
          case "$flag" in
-           *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \       ]*|*]*)
+           *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \       ]*|*]*|"")
            flag="\"$flag\""
            ;;
          esac
+         arg="$arg $wl$flag"
          compiler_flags="$compiler_flags $flag"
        done
        IFS="$save_ifs"
-       continue
+       arg=`$echo "X$arg" | $Xsed -e "s/^ //"`
        ;;
 
       -Wl,*)
-       arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wl,//'`
+       args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wl,//'`
+       arg=
        IFS="${IFS=     }"; save_ifs="$IFS"; IFS=','
-       for flag in $arg; do
+       for flag in $args; do
          IFS="$save_ifs"
          case "$flag" in
-           *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \       ]*|*]*)
+           *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \       ]*|*]*|"")
            flag="\"$flag\""
            ;;
          esac
+         arg="$arg $wl$flag"
          compiler_flags="$compiler_flags $wl$flag"
          linker_flags="$linker_flags $flag"
        done
        IFS="$save_ifs"
-       continue
+       arg=`$echo "X$arg" | $Xsed -e "s/^ //"`
        ;;
 
       -Xcompiler)
@@ -1093,7 +1089,7 @@ compiler."
        # to be aesthetically quoted because they are evaled later.
        arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
        case "$arg" in
-       *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \   ]*|*]*)
+       *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \   ]*|*]*|"")
          arg="\"$arg\""
          ;;
        esac
@@ -1216,7 +1212,7 @@ compiler."
        # to be aesthetically quoted because they are evaled later.
        arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
        case "$arg" in
-       *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \   ]*|*]*)
+       *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \   ]*|*]*|"")
          arg="\"$arg\""
          ;;
        esac
index f671f82b75be0462c693bd1e07cd128251eb066b..f71ecda03c9756a2d35c0e1e8413e9968f6f8431 100755 (executable)
@@ -63,18 +63,21 @@ for mode in compile link install; do
   case "$mode" in
   compile)
     preargs="gcc -c"
+    preflag=
     flag="-DVAR="
     postargs="foo.c"
     ;;
 
   link)
     preargs="gcc -o hell -g -O"
-    flag="-Wl,-someflag="
+    preflag=-Wl,
+    flag="-someflag="
     postargs="foo.o"
     ;;
 
   install)
     preargs="install -c"
+    preflag=
     flag="--something="
     postargs="hell /usr/local/bin/hell"
     ;;
@@ -82,9 +85,9 @@ for mode in compile link install; do
 
   # Trivial.
   $echo "= trying: no quoting"
-  result=`$libtool -n --mode=$mode $preargs "${flag}test" $postargs` || status=1
+  result=`$libtool -n --mode=$mode $preargs ${preflag}"${flag}test" $postargs` || status=1
   case "$result" in
-  *"$preargs ${flag}test "*)
+  *"$preargs ${preflag}${flag}test "*)
     $echo "= passed: $result"
     ;;
   *)
@@ -96,9 +99,9 @@ for mode in compile link install; do
   # Metacharacters that should be backslashified.
   for mchar in \\ \" \` \$; do
     $echo "= trying: \\$mchar quoting"
-    result=`$libtool -n --mode=$mode $preargs "${flag}${mchar}test${mchar}" $postargs` || status=1
+    result=`$libtool -n --mode=$mode $preargs ${preflag}"${flag}${mchar}test${mchar}" $postargs` || status=1
     case "$result" in
-    *"$preargs ${flag}\\${mchar}test\\${mchar} "*)
+    *"$preargs ${preflag}${flag}\\${mchar}test\\${mchar} "*)
       $echo "= passed: $result"
       ;;
     *)
@@ -113,9 +116,9 @@ for mode in compile link install; do
       "'" " " "        "; do
 
     $echo "= trying: \"$mchar\" quoting"
-    result=`$libtool -n --mode=$mode $preargs "${flag}${mchar}test${mchar}" $postargs` || status=1
+    result=`$libtool -n --mode=$mode $preargs ${preflag}"${flag}${mchar}test${mchar}" $postargs` || status=1
     case "$result" in
-    *"$preargs \"${flag}${mchar}test${mchar}\" "*)
+    *"$preargs ${preflag}\"${flag}${mchar}test${mchar}\" "*)
       $echo "= passed: $result"
       ;;
     *)