bug-libtool
[Top][All Lists]
Advanced

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

ltmain.m4sh needs to handle spaces in paths


From: Derek Price
Subject: ltmain.m4sh needs to handle spaces in paths
Date: Thu, 30 Jun 2005 12:29:24 -0400
User-agent: Mozilla Thunderbird 1.0.2 (Windows/20050317)

There is a bug which causes libtool to exit during compilation with an
error like, "Can't find library `'" when there are spaces in PWD.  I
worked around this by creating a symlink from the Cygwin /home/user to
my Windows home directory which I usually also use as my Cygwin home and
cd'ing there before building.  This sort of setup probably isn't
uncommon under MinGW and Cygwin, or is getting less so as I notice these
sorts of errors mostly having been fixed in other common tools.

Anyhow, I later created a new bash shell and accidentally used the path
with spaces again.  Attempting to execute the generated wrapper for my
program brought up a second error when the PWD has spaces (the wrapper
script can't find program since it splits PWD on spaces in the call to
exec).  The attached patch should fix this second problem.  I have not
dug deeply into the first.

Not that this patch is very big, but my libtool paperwork has been
complete for some time.  I filled it out several years back when I was
filling out my Autoconf paperwork, despite this being my first libtool
submission.

2005-06-30  Derek R. Price  <address@hidden>

    * config/ltmain.m4sh: Handle spaces in paths to executed programs.
    Quote path in error message.


Regards,

Derek
Index: config/ltmain.m4sh
===================================================================
RCS file: /cvsroot/libtool/libtool/config/ltmain.m4sh,v
retrieving revision 1.69
diff -u -p -r1.69 ltmain.m4sh
--- config/ltmain.m4sh  21 Jun 2005 14:18:24 -0000      1.69
+++ config/ltmain.m4sh  30 Jun 2005 16:13:15 -0000
@@ -6221,13 +6221,13 @@ else
        # Backslashes separate directories on plain windows
        *-*-mingw | *-*-os2*)
          $ECHO >> $output "\
-      exec \$progdir\\\\\$program \${1+\"address@hidden"}
+      exec \"\$progdir\\\\\$program\" \${1+\"address@hidden"}
 "
          ;;
 
        *)
          $ECHO >> $output "\
-      exec \$progdir/\$program \${1+\"address@hidden"}
+      exec \"\$progdir/\$program\" \${1+\"address@hidden"}
 "
          ;;
        esac
@@ -6237,7 +6237,7 @@ else
     fi
   else
     # The program doesn't exist.
-    \$ECHO \"\$0: error: \$progdir/\$program does not exist\" 1>&2
+    \$ECHO \"\$0: error: \\\`\$progdir/\$program' does not exist\" 1>&2
     \$ECHO \"This script is just a wrapper for \$program.\" 1>&2
     $ECHO \"See the $PACKAGE documentation for more information.\" 1>&2
     exit 1

reply via email to

[Prev in Thread] Current Thread [Next in Thread]