On 2012-08-19 22:09, Peter Rosin wrote: > [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?
Oops, forgot a couple of backslashes, trying again. Sorry for the noise. Testsuite running, just in case... Cheers, Peter
>From 00ed0187c1c6cc3519188bc47d5ed0ff85f2d950 Mon Sep 17 00:00:00 2001 From: Peter Rosin <p...@lysator.liu.se> Date: Sun, 19 Aug 2012 22:14:13 +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 al...@fairlite.co.uk Alexei Sheplyakov v...@theor.jinr.ru Alon Bar-Lev alon.bar...@gmail.com + Andreas Schiffler aschiff...@ferzkopp.net Andreas Schwab sch...@suse.de Andrey Slepuhin p...@msu.ru Aneesh Kumar K.V kvane...@hotmail.com diff --git a/build-aux/ltmain.m4sh b/build-aux/ltmain.m4sh index 30f99f4..48e259b 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