]> git.ipfire.org Git - thirdparty/libtool.git/commitdiff
Allow special characters in source file names. Will break unless
authorPer Bothner <per@bothner.com>
Tue, 15 Mar 2005 14:51:57 +0000 (14:51 +0000)
committerRalf Wildenhues <Ralf.Wildenhues@gmx.de>
Tue, 15 Mar 2005 14:51:57 +0000 (14:51 +0000)
`-o target' is also given, which must not contain special characters.
En passant, fix source file quoting broken for cygwin/MSVC.

ChangeLog
NEWS
ltmain.in

index 99bdbdf032a6501ef555aaa5a8f67de8c83014a6..3aa5d418aa9287c6a6c72629e6ef532f04f46ca5 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+2005-03-15  Per Bothner <per@bothner.com>,
+           Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
+
+       Allow special characters in source file names.  Will break unless
+       `-o target' is also given, which must not contain special characters.
+       En passant, fix source file quoting broken for cygwin/MSVC.
+
+       * ltmain.in (compile mode): Use new variable qsrcfile
+       for quoted source file name for compile $command.  Fix missing
+       quotes for _c_o lockfile.
+       * NEWS: Update.
+
 2005-03-14  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
 
        * libtool.m4 (AC_LIBTOOL_PROG_LD_SHLIBS) [linux]: Remove MAIN_
diff --git a/NEWS b/NEWS
index a16ec5fd8e994ed6dbf42cd3ffe0a9571d930967..e16b3260767382ce3edfe6f82dac2210e15a5bd8 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1,6 +1,8 @@
 NEWS - list of user-visible changes between releases of GNU Libtool
 
 New in 1.5.15a: 2005-??-??; CVS version 1.5.15a, Libtool team:
+* Allow shell special characters like `$' in source file names, but not
+  in object names, to enhance GCJ support.
 * Bug Fixes.
 \f
 New in 1.5.14: 2005-02-12; CVS version 1.5.13a, Libtool team:
index 98a89916eee5618fde43554810103230e5febf58..b3f4f7d67c8a2a9cb49ac1c92158e0a664017d64 100644 (file)
--- a/ltmain.in
+++ b/ltmain.in
@@ -757,6 +757,15 @@ if test -z "$show_help"; then
       esac
     done
 
+    qlibobj=`$echo "X$libobj" | $Xsed -e "$sed_quote_subst"`
+    case $qlibobj in
+      *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "")
+       qlibobj="\"$qlibobj\"" ;;
+    esac
+    if test "X$libobj" != "X$qlibobj"; then
+       $echo "$modename: libobj name \`$libobj' may not contain shell special characters."
+       exit $EXIT_FAILURE
+    fi
     objname=`$echo "X$obj" | $Xsed -e 's%^.*/%%'`
     xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'`
     if test "X$xdir" = "X$obj"; then
@@ -829,12 +838,17 @@ compiler."
        $run $rm $removelist
        exit $EXIT_FAILURE
       fi
-      $echo $srcfile > "$lockfile"
+      $echo "$srcfile" > "$lockfile"
     fi
 
     if test -n "$fix_srcfile_path"; then
       eval srcfile=\"$fix_srcfile_path\"
     fi
+    qsrcfile=`$echo "X$srcfile" | $Xsed -e "$sed_quote_subst"`
+    case $qsrcfile in
+      *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "")
+      qsrcfile="\"$qsrcfile\"" ;;
+    esac
 
     $run $rm "$libobj" "${libobj}T"
 
@@ -856,10 +870,10 @@ EOF
       fbsd_hideous_sh_bug=$base_compile
 
       if test "$pic_mode" != no; then
-       command="$base_compile $srcfile $pic_flag"
+       command="$base_compile $qsrcfile $pic_flag"
       else
        # Don't build PIC code
-       command="$base_compile $srcfile"
+       command="$base_compile $qsrcfile"
       fi
 
       if test ! -d "${xdir}$objdir"; then
@@ -939,9 +953,9 @@ EOF
     if test "$build_old_libs" = yes; then
       if test "$pic_mode" != yes; then
        # Don't build PIC code
-       command="$base_compile $srcfile"
+       command="$base_compile $qsrcfile"
       else
-       command="$base_compile $srcfile $pic_flag"
+       command="$base_compile $qsrcfile $pic_flag"
       fi
       if test "$compiler_c_o" = yes; then
        command="$command -o $obj"