]> git.ipfire.org Git - thirdparty/libtool.git/commitdiff
* ltmain.in (-Wc, -Xcompiler): Implemented in compile mode.
authorAlexandre Oliva <oliva@lsd.ic.unicamp.br>
Sat, 18 Dec 1999 08:22:50 +0000 (08:22 +0000)
committerAlexandre Oliva <aoliva@redhat.com>
Sat, 18 Dec 1999 08:22:50 +0000 (08:22 +0000)
ChangeLog
ltmain.in

index 4d9f898e5f868d10a09da09cbe8e921b049071f5..bc796cfe77edc44c5b11bbd9579261e4d278bbbe 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,8 +1,11 @@
 1999-12-18  Alexandre Oliva  <oliva@lsd.ic.unicamp.br>
 
+       * ltmain.in (-Wc, -Xcompiler): Implemented in compile mode.
+       
        * 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'.
index fcb8b70202da33dcb957f6802f1d9e943197236c..f18d74129d478d66659328da0bb1cd8d83540367 100644 (file)
--- a/ltmain.in
+++ b/ltmain.in
@@ -267,6 +267,7 @@ if test -z "$show_help"; then
     modename="$modename: compile"
     # Get the compilation command and the source file.
     base_compile=
+    prev=
     lastarg=
     srcfile="$nonopt"
     suppress_output=
@@ -274,6 +275,32 @@ if test -z "$show_help"; then
     user_target=no
     for arg
     do
+      case "$prev" in
+      "") ;;
+      xcompiler)
+       # Aesthetically quote the previous argument.
+       prev=
+       lastarg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
+
+       case "$arg" in
+       # Double-quote args containing other shell metacharacters.
+       # Many Bourne shells cannot handle close brackets correctly
+       # in scan sets, so we specify it separately.
+       *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \   ]*|*]*|"")
+          arg="\"$arg\""
+         ;;
+       esac
+
+        # Add the previous argument to base_compile.
+        if test -z "$base_compile"; then
+         base_compile="$lastarg"
+        else
+         base_compile="$base_compile $lastarg"
+        fi
+       continue
+       ;;
+      esac
+
       # Accept any command-line options.
       case "$arg" in
       -o)
@@ -288,6 +315,40 @@ if test -z "$show_help"; then
        build_old_libs=yes
        continue
        ;;
+
+      -Xcompiler)
+        prev=xcompiler
+        continue
+       ;;
+
+      -Wc,*)
+        args=`$echo "X$arg" | $Xsed -e "s/^-Wc,//"`
+        lastarg=
+       IFS="${IFS=     }"; save_ifs="$IFS"; IFS=','
+       for arg in $args; do
+         IFS="$save_ifs"
+
+         # Double-quote args containing other shell metacharacters.
+         # Many Bourne shells cannot handle close brackets correctly
+         # in scan sets, so we specify it separately.
+         case "$arg" in
+           *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \       ]*|*]*|"")
+           arg="\"$arg\""
+           ;;
+         esac
+         lastarg="$lastarg $arg"
+       done
+       IFS="$save_ifs"
+       lastarg=`$echo "X$lastarg" | $Xsed -e "s/^ //"`
+
+        # Add the arguments to base_compile.
+       if test -z "$base_compile"; then
+         base_compile="$lastarg"
+       else
+         base_compile="$base_compile $lastarg"
+       fi
+       continue
+       ;;
       esac
 
       case "$user_target" in
@@ -316,11 +377,11 @@ if test -z "$show_help"; then
       lastarg=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"`
 
       # Double-quote args containing other shell metacharacters.
-      # Many Bourne shells cannot handle close brackets correctly in scan
-      # sets, so we specify it separately.
+      # Many Bourne shells cannot handle close brackets correctly
+      # in scan sets, so we specify it separately.
       case "$lastarg" in
-      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \    ]*|*]*)
-       lastarg="\"$lastarg\""
+      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \    ]*|*]*|"")
+        lastarg="\"$largarg\""
        ;;
       esac