public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* libtool quoting error
@ 2012-08-19 18:25 Andreas Schiffler
  2012-08-19 18:50 ` Earnie Boyd
  2012-08-19 20:56 ` Peter Rosin
  0 siblings, 2 replies; 3+ messages in thread
From: Andreas Schiffler @ 2012-08-19 18:25 UTC (permalink / raw)
  To: cygwin

The libtool distributed with cygwin has a bug that prevents use in paths 
containing spaces.
This was encountered when trying to build SDL2 on Windows (see 
http://bugzilla.libsdl.org/show_bug.cgi?id=1575 for details or repro).

# Which release of libtool.m4 was used?
macro_version=2.2.6
macro_revision=1.3012

The fix is simple: add additional quoting.

$ diff libtool libtool-fixed
2797c2797
<       exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs'
---
 >       exec_cmd='$SHELL "$progpath" $preserve_args 
--finish$current_libdirs'
8321c8321
<       if test "X$ECHO" = "X$SHELL $progpath --fallback-echo"; then
---
 >       if test "X$ECHO" = "X$SHELL \"$progpath\" --fallback-echo"; then
8323,8324c8323,8324
<       [\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $progpath --fallback-echo";;
<       *) qecho="$SHELL `pwd`/$progpath --fallback-echo";;
---
 >       [\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL \"$progpath\" 
--fallback-echo";;
 >       *) qecho="$SHELL `pwd`/\"$progpath\" --fallback-echo";;
8559c8559
<       relink_command="(cd `pwd`; $SHELL $progpath $preserve_args 
--mode=relink $libtool_args @inst_prefix_dir@)"
---
 >       relink_command="(cd `pwd`; $SHELL \"$progpath\" $preserve_args 
--mode=relink $libtool_args @inst_prefix_dir@)"

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: libtool quoting error
  2012-08-19 18:25 libtool quoting error Andreas Schiffler
@ 2012-08-19 18:50 ` Earnie Boyd
  2012-08-19 20:56 ` Peter Rosin
  1 sibling, 0 replies; 3+ messages in thread
From: Earnie Boyd @ 2012-08-19 18:50 UTC (permalink / raw)
  To: cygwin

On Sun, Aug 19, 2012 at 1:03 PM, Andreas Schiffler
<aschiffler@ferzkopp.net> wrote:
> The libtool distributed with cygwin has a bug that prevents use in paths
> containing spaces.

You probably want to report this to bug-libtool @ gnu.org.

-- 
Earnie
-- https://sites.google.com/site/earnieboyd

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: libtool quoting error
  2012-08-19 18:25 libtool quoting error Andreas Schiffler
  2012-08-19 18:50 ` Earnie Boyd
@ 2012-08-19 20:56 ` Peter Rosin
  1 sibling, 0 replies; 3+ messages in thread
From: Peter Rosin @ 2012-08-19 20:56 UTC (permalink / raw)
  To: Libtool Patches List; +Cc: cygwin, aschiffler

[-- Attachment #1: Type: text/plain, Size: 1790 bytes --]

[Cygwinners: Taking this to the Libtool lists]
[Libtoolers: Following up on a post on the cygwin mailing list]

On 2012-08-19 19:03, Andreas Schiffler wrote:
> The libtool distributed with cygwin has a bug that prevents use in paths containing spaces.
> This was encountered when trying to build SDL2 on Windows (see http://bugzilla.libsdl.org/show_bug.cgi?id=1575 for details or repro).
> 
> # Which release of libtool.m4 was used?
> macro_version=2.2.6
> macro_revision=1.3012
> 
> The fix is simple: add additional quoting.
> 
> $ diff libtool libtool-fixed
> 2797c2797
> <       exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs'
> ---
>>       exec_cmd='$SHELL "$progpath" $preserve_args --finish$current_libdirs'
> 8321c8321
> <       if test "X$ECHO" = "X$SHELL $progpath --fallback-echo"; then
> ---
>>       if test "X$ECHO" = "X$SHELL \"$progpath\" --fallback-echo"; then
> 8323,8324c8323,8324
> <       [\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $progpath --fallback-echo";;
> <       *) qecho="$SHELL `pwd`/$progpath --fallback-echo";;
> ---
>>       [\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL \"$progpath\" --fallback-echo";;
>>       *) qecho="$SHELL `pwd`/\"$progpath\" --fallback-echo";;
> 8559c8559
> <       relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)"
> ---
>>       relink_command="(cd `pwd`; $SHELL \"$progpath\" $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)"

The code changed in the two middle hunks went out after 2.2.6 and
are thus gone in 2.2.8 and later, so that no longer applies.

I also took the liberty of changing ltmain.m4sh instead of the
generated libtool script.

So, this is a better attempt for a patch, with Andreas added to
THANKS.

Ok to push?

Cheers,
Peter


[-- Attachment #2: 0001-libtool-quote-progpath-properly.patch --]
[-- Type: text/x-patch, Size: 1831 bytes --]

From c50b8d27d5832ca1c962bf3dec46c1b85eff5bad Mon Sep 17 00:00:00 2001
From: Peter Rosin <peda@lysator.liu.se>
Date: Sun, 19 Aug 2012 22:06:06 +0200
Subject: [PATCH] libtool: quote progpath properly

Attempt to handle spaces in paths better.

* build-aux/ltmain.m4sh (func_mode_install, func_mode_link): Quote
$progpath.
* THANKS: Update.
---
 THANKS                |    1 +
 build-aux/ltmain.m4sh |    4 ++--
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/THANKS b/THANKS
index 84cb6c9..24f1c91 100644
--- a/THANKS
+++ b/THANKS
@@ -70,6 +70,7 @@
   Alan Hourihane		alanh@fairlite.co.uk
   Alexei Sheplyakov		varg@theor.jinr.ru
   Alon Bar-Lev			alon.barlev@gmail.com
+  Andreas Schiffler		aschiffler@ferzkopp.net
   Andreas Schwab		schwab@suse.de
   Andrey Slepuhin		pooh@msu.ru
   Aneesh Kumar K.V		kvaneesh@hotmail.com
diff --git a/build-aux/ltmain.m4sh b/build-aux/ltmain.m4sh
index 30f99f4..968b727 100644
--- a/build-aux/ltmain.m4sh
+++ b/build-aux/ltmain.m4sh
@@ -2449,7 +2449,7 @@ func_mode_install ()
     if test -n "$current_libdirs"; then
       # Maybe just do a dry run.
       $opt_dry_run && current_libdirs=" -n$current_libdirs"
-      exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs'
+      exec_cmd='$SHELL "$progpath" $preserve_args --finish$current_libdirs'
     else
       exit $EXIT_SUCCESS
     fi
@@ -8506,7 +8506,7 @@ EOF
 	fi
       done
       # Quote the link command for shipping.
-      relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)"
+      relink_command="(cd `pwd`; $SHELL "$progpath" $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)"
       relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"`
       if test yes = "$hardcode_automatic"; then
 	relink_command=
-- 
1.7.9



[-- Attachment #3: Type: text/plain, Size: 218 bytes --]

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-08-19 20:09 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-08-19 18:25 libtool quoting error Andreas Schiffler
2012-08-19 18:50 ` Earnie Boyd
2012-08-19 20:56 ` Peter Rosin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).