Re: FYI: ltmain.m4sh needs to handle spaces in paths
Hi Derek, * Derek Price wrote on Thu, Jul 07, 2005 at 07:11:40PM CEST: Ralf Wildenhues wrote: Oh, I wasn't going to yank it. That was supposed to be a joke. If you take it as an incentive to fix more cases, the better. :) Okay, the attached patch to 1.5 fixes loads of quoting issues on Windows and passes tests on GNU/Linux. Basically, I made the minimal set of changes I needed to to get a large project containing libraries and executables to compile on Windows, except that if I set up the elements of a variable to be quoted in one location, I quoted them everywhere for consistency. Wow. Thanks for working on this! I then backported the changes to get the tests to pass again on Linux. The backporting to UNIX entailed a few minor changes to libtool.m4, demo/Makefile.am, and a few tests. The test changes basically just expect the quotes to appear in output now. What I *didn't* do is move my libtool workspace to a name with a space and try to run the test suite on LINUX, so there are probably still a few changes that need to be made to handle spaces in directories on LINUX. I also didn't try targets with spaces or relative paths within a project with spaces. This should pretty much only handle spaces in `pwd`. OK. I would like to test this as much as possible, in order to prevent regressions, so test cases would be very much necessary. One big problem of this patch is that it breaks two ways of backward compatibility. First, a library installed with a libtool with this patch cannot be linked against by an older libtool. Second, the patched libtool also does not recognize older, already-installed .la files. For a stable series like branch-1-5, I really would not like to do this. OTOH, I believe it is an important goal for libtool to have this added functionality. So the way I'd believe would be best would be to put in branch-1-5 the functionality to _parse_ installed .la files that contain the quotes (but do not contain spaces in paths), but only enable in HEAD or maybe branch-2-0 the code that puts in the quotes. In any case HEAD should be able to link against older .la files which do not contain the quoting. That way, at least there would be a clean upgrade path 1.5.18 - 1.5.next - 2.x without a trap in 2.x. Also, we should probably ship an upgrade script which could rewrite installed .la files to the new notation. Furthermore, libltdl would need to be adapted as well (and tests written for that). Another solution^Whack would be to do the same thing as done previously with backwards-incompatible extensions: put the new style into a new variable (e.g., $quoted_dependency_libs). While somewhat more convenient, it is also ugly and leads to bloat in the .la files. Dunno what's the best here. :-/ A few small glitches with your patch are noted below for convenience. Regards, Ralf 2005-07-07 Derek R. Price [EMAIL PROTECTED] * libtool.m4: Quote paths in $hardcode_libdir_flag_spec. * ltmain.in: Quote paths potentially containing spaces. Use set and $@ to loop on variables potentially containing quoted elements. * demo/Makefile.am (hc-libflag): Use eval to process quoted arguments inside variables. * tests/link-order.test, tests/link.test: Expect quoted arguments. Index: libtool.m4 === RCS file: /cvsroot/libtool/libtool/Attic/libtool.m4,v retrieving revision 1.314.2.95 diff -u -p -r1.314.2.95 libtool.m4 --- libtool.m43 Jul 2005 18:15:58 - 1.314.2.95 +++ libtool.m47 Jul 2005 17:00:45 - @@ -2753,7 +2753,7 @@ if test $GXX = yes; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' -_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' +_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath \${wl}$libdir\' _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' # If archive_cmds runs LD, not CC, wlarc should be empty While ok for most cases, in general it is not ok to quote ${wl}. For example, on Solaris it might get expanded to `-Qoption ld '; quoting like this: ${wl}\$libdir\$ should be ok, though. *big snip* Index: ltmain.in === RCS file: /cvsroot/libtool/libtool/Attic/ltmain.in,v retrieving revision 1.334.2.76 diff -u -p -r1.334.2.76 ltmain.in --- ltmain.in 3 Jul 2005 16:57:34 - 1.334.2.76 +++ ltmain.in 7 Jul 2005 17:00:49 - @@ -251,12 +251,12 @@ func_extract_an_archive () f_ex_an_ar_dir=$1; shift f_ex_an_ar_oldlib=$1 -$show
FYI: BUG: libtool-1.9f and libtool-1.5.18: install: you must specify a destination
* Ralf Wildenhues wrote on Wed, Jul 06, 2005 at 07:05:01PM CEST: * Juergen Leising wrote on Wed, Jul 06, 2005 at 09:03:49AM CEST: The following error message appears due to a bug in func_mode_install (): /bin/sh ../../../libtool --mode=install cp -f 'libeic.la' '/usr/local/lib/bastard/libeic.la' libtool: install: you must specify a destination libtool: install: Try `libtool --help --mode=install' for more information. Proposed patch (against HEAD, similar for backport): I have installed this slightly simpler patch, which also allows backslash as directory separator, to all branches. I decided to ignore the slight chance of misparse that may ensue with a group named `cp': install -g cp ... Cheers, Ralf HEAD/branch-2-0: * config/ltmain.m4sh (func_mode_install): Do not assume `-f' needs an argument if the install program is `cp'. Cleanup install mode somewhat. Reported by Juergen Leising [EMAIL PROTECTED]. Index: config/ltmain.m4sh === RCS file: /cvsroot/libtool/libtool/config/ltmain.m4sh,v retrieving revision 1.72 diff -u -r1.72 ltmain.m4sh --- config/ltmain.m4sh 3 Jul 2005 16:55:50 - 1.72 +++ config/ltmain.m4sh 8 Jul 2005 13:41:32 - @@ -1685,15 +1685,15 @@ # install_prog (especially on Windows NT). if test $nonopt = $SHELL || test $nonopt = /bin/sh || # Allow the use of GNU shtool's install command. - $ECHO X$nonopt | $Xsed | $GREP shtool /dev/null; then + $ECHO X$nonopt | $GREP shtool /dev/null; then # Aesthetically quote it. func_quote_for_eval $nonopt install_prog=$func_quote_for_eval_result - arg=$1 + arg=$1 shift else install_prog= - arg=$nonopt + arg=$nonopt fi # The real first argument should be the name of the installation program. @@ -1713,28 +1713,33 @@ do if test -n $dest; then files=$files $dest - dest=$arg + dest=$arg continue fi case $arg in -d) isdir=yes ;; - -f) prev=-f ;; - -g) prev=-g ;; - -m) prev=-m ;; - -o) prev=-o ;; + -f) + case $install_prog in + *[[\\\ /]]cp\ *) ;; + *) prev=$arg ;; + esac + ;; + -g | -m | -o) + prev=$arg + ;; -s) stripme= -s continue ;; - -*) ;; - + -*) + ;; *) # If the previous option needed an argument, then skip it. if test -n $prev; then prev= else - dest=$arg + dest=$arg continue fi ;; branch-1-5: * ltmain.in (install mode): Do not assume `-f' needs an argument if the install program is `cp'. Cleanup install mode somewhat. Reported by Juergen Leising [EMAIL PROTECTED]. Index: ltmain.in === RCS file: /cvsroot/libtool/libtool/Attic/ltmain.in,v retrieving revision 1.334.2.76 diff -u -r1.334.2.76 ltmain.in --- ltmain.in 3 Jul 2005 16:57:34 - 1.334.2.76 +++ ltmain.in 8 Jul 2005 13:42:26 - @@ -5361,7 +5361,7 @@ # install_prog (especially on Windows NT). if test $nonopt = $SHELL || test $nonopt = /bin/sh || # Allow the use of GNU shtool's install command. - $echo X$nonopt | $Xsed | grep shtool /dev/null; then + $echo X$nonopt | grep shtool /dev/null; then # Aesthetically quote it. arg=`$echo X$nonopt | $Xsed -e $sed_quote_subst` case $arg in @@ -5374,7 +5374,7 @@ shift else install_prog= - arg=$nonopt + arg=$nonopt fi # The real first argument should be the name of the installation program. @@ -5399,28 +5399,31 @@ do if test -n $dest; then files=$files $dest - dest=$arg + dest=$arg continue fi case $arg in -d) isdir=yes ;; - -f) prev=-f ;; - -g) prev=-g ;; - -m) prev=-m ;; - -o) prev=-o ;; + -f) + case $install_prog in + *[\\\ /]cp\ *) ;; + *) prev=$arg ;; + esac + ;; + -g | -m | -o) prev=$arg ;; -s) stripme= -s continue ;; - -*) ;; - + -*) + ;; *) # If the previous option needed an argument, then skip it. if test -n $prev; then prev= else - dest=$arg + dest=$arg continue fi ;; ___ Bug-libtool mailing list Bug-libtool@gnu.org http://lists.gnu.org/mailman/listinfo/bug-libtool
Re: libtool 1.5.14 on mingw: DLLs must be installed executable
Hi Bruno, * Bruno Haible wrote on Fri, Jul 08, 2005 at 03:07:33PM CEST: Using libtool 1.5.14 to install libiconv built for mingw, any program linked against the such installed libiconv-2.dll crashes on startup with a dialog box: The application failed to initialize properly (0xc022) The reason, as explained in http://www.mail-archive.com/cygwin@cygwin.com/msg23724.html is that libtool installs the DLL without the execution bit. Here is a fix. Erm, the fix is fine, but what caused the breakage in the first place? Surely this hasn't been broken all the time? Cheers, Ralf 2005-07-08 Bruno Haible [EMAIL PROTECTED] * libtool.m4 (postinstall_cmds) [cygwin,mingw,pw32]: Make DLL executable after installing it. ___ Bug-libtool mailing list Bug-libtool@gnu.org http://lists.gnu.org/mailman/listinfo/bug-libtool
FYI: tests/sh.test uses $SED without setting it
* Derek Price wrote on Fri, Jul 08, 2005 at 05:20:14PM CEST: Ralf Wildenhues wrote: * Derek Price wrote on Thu, Jul 07, 2005 at 07:06:37PM CEST: While working on some other stuff, I noticed that tests/sh.test is calling $SED without it being set, though this was only causing a *snip* You omitted the patch. I believe you are talking about branch-1-5 Libtool, right? How about setting SED and Xsed in tests/defs? That would be fine, though it looks like tests/sh.test is the only test using $SED on 1.5. I've attached my original patch anyho in case you want it - it just adds `: ${SED=sed}' to an early line of tests/sh.test to set a default without overriding any environment. Alright. I have applied this to branch-1-5. This issue is not present in the other branches. IMHO it does not matter which sed is chosen here. Thanks! Ralf 2005-07-08 Derek R. Price [EMAIL PROTECTED] * tests/defs (SED): Default variable contents to `sed'. Fixes false PASS of sh.test. Index: tests/defs === RCS file: /cvsroot/libtool/libtool/tests/Attic/defs,v retrieving revision 1.5.2.3 diff -u -r1.5.2.3 defs --- tests/defs 8 Apr 2005 13:00:50 - 1.5.2.3 +++ tests/defs 8 Jul 2005 15:26:53 - @@ -17,8 +17,9 @@ progname=`echo $0 | sed 's%^.*/%%'` libtool=../libtool -make=${MAKE-make} SHELL=${CONFIG_SHELL-/bin/sh} +: ${MAKE=make} +: ${SED=sed} if echo a | (grep -E '(a|b)') /dev/null 21; then EGREP='grep -E' ___ Bug-libtool mailing list Bug-libtool@gnu.org http://lists.gnu.org/mailman/listinfo/bug-libtool
Re: FYI: tests/sh.test uses $SED without setting it
* Ralf Wildenhues wrote on Fri, Jul 08, 2005 at 05:28:06PM CEST: --- tests/defs8 Apr 2005 13:00:50 - 1.5.2.3 +++ tests/defs8 Jul 2005 15:26:53 - @@ -17,8 +17,9 @@ progname=`echo $0 | sed 's%^.*/%%'` libtool=../libtool -make=${MAKE-make} SHELL=${CONFIG_SHELL-/bin/sh} +: ${MAKE=make} +: ${SED=sed} if echo a | (grep -E '(a|b)') /dev/null 21; then EGREP='grep -E' Argh. I'm very sorry. 2005-07-08 Ralf Wildenhues [EMAIL PROTECTED] * tests/defs (make): Undo bogus change I did, and also wrongly attributed to Derek R. Price. Index: tests/defs === RCS file: /cvsroot/libtool/libtool/tests/Attic/defs,v retrieving revision 1.5.2.4 diff -u -r1.5.2.4 defs --- tests/defs 8 Jul 2005 15:27:52 - 1.5.2.4 +++ tests/defs 8 Jul 2005 15:47:00 - @@ -17,8 +17,8 @@ progname=`echo $0 | sed 's%^.*/%%'` libtool=../libtool +make=${MAKE-make} SHELL=${CONFIG_SHELL-/bin/sh} -: ${MAKE=make} : ${SED=sed} if echo a | (grep -E '(a|b)') /dev/null 21; then ___ Bug-libtool mailing list Bug-libtool@gnu.org http://lists.gnu.org/mailman/listinfo/bug-libtool
FYI: libtool-1.5.18 -- installed files owned by non-root user
* Peter Breitenlohner wrote on Wed, Jul 06, 2005 at 09:34:24AM CEST: What about simply chown -R root $(DESTDIR)$(ltdldatadir) \ chgrp -R root $(DESTDIR)$(ltdldatadir) || : where failure of chown/chgrp is ignored? Who cares about some noise when `make install' is done by non-root or on non-posix systems, in particular when the cause of such noise can easily be deduced. FYI: I have applied this to all three branches. Thanks, Ralf HEAD/branch-2-0: 2005-07-08 Peter Breitenlohner [EMAIL PROTECTED] * Makefile.am (install-data-local): Have root own of installed files (but do not fail, for user installs). Index: Makefile.am === RCS file: /cvsroot/libtool/libtool/Makefile.am,v retrieving revision 1.153 diff -u -r1.153 Makefile.am --- Makefile.am 2 May 2005 09:20:24 - 1.153 +++ Makefile.am 8 Jul 2005 15:54:01 - @@ -254,6 +254,8 @@ done; \ ( cd $(srcdir)/m4 $(AMTAR) chf - $$aclocalfiles; ) \ | ( umask 0 cd $(DESTDIR)$(aclocaldir) $(AMTAR) xf -; ) + chown -R root $(DESTDIR)$(ltdldatadir) \ + chgrp -R root $(DESTDIR)$(ltdldatadir) || : install-data-hook: chmod +x $(DESTDIR)$(pkgdatadir)/config/config.guess branch-1-5: 2005-07-08 Peter Breitenlohner [EMAIL PROTECTED] * libltdl/Makefile.am (local-install-files): Have root own of installed files (but do not fail, for user installs). Index: libltdl/Makefile.am === RCS file: /cvsroot/libtool/libtool/libltdl/Makefile.am,v retrieving revision 1.42.2.6 diff -u -r1.42.2.6 Makefile.am --- libltdl/Makefile.am 2 May 2005 12:52:07 - 1.42.2.6 +++ libltdl/Makefile.am 8 Jul 2005 15:53:30 - @@ -47,3 +47,5 @@ $(mkinstalldirs) $(DESTDIR)$(ltdldatadir) ( cd $(srcdir) $(AMTAR) chf - $(ltdldatafiles); ) \ | ( umask 0 cd $(DESTDIR)$(ltdldatadir) $(AMTAR) xf -; ) + chown -R root $(DESTDIR)$(ltdldatadir) \ + chgrp -R root $(DESTDIR)$(ltdldatadir) || : ___ Bug-libtool mailing list Bug-libtool@gnu.org http://lists.gnu.org/mailman/listinfo/bug-libtool
Re: FYI: libtool-1.5.18 -- installed files owned by non-root user
Hallo Ralf, Sorry for the late review: On 8 Jul 2005, at 16:57, Ralf Wildenhues wrote: 2005-07-08 Peter Breitenlohner [EMAIL PROTECTED] * Makefile.am (install-data-local): Have root own of installed files (but do not fail, for user installs). Index: Makefile.am === RCS file: /cvsroot/libtool/libtool/Makefile.am,v retrieving revision 1.153 diff -u -r1.153 Makefile.am --- Makefile.am2 May 2005 09:20:24 -1.153 +++ Makefile.am8 Jul 2005 15:54:01 - @@ -254,6 +254,8 @@ done; \ ( cd $(srcdir)/m4 $(AMTAR) chf - $$aclocalfiles; ) \ | ( umask 0 cd $(DESTDIR)$(aclocaldir) $(AMTAR) xf -; ) +chown -R root $(DESTDIR)$(ltdldatadir) \ +chgrp -R root $(DESTDIR)$(ltdldatadir) || : What about: -chown -R root $(DESTDIR)$(ltdldatadir) 2/dev/null -chgrp -R root $(DESTDIR)$(ltdldatadir) 2/dev/null Cheers, Gary. -- Gary V. Vaughan ())_. gary@ {lilith.warpmail.net,gnu.org},[EMAIL PROTECTED] Research Scientist ( '/ http://www.tkd.kicks-ass.net GNU Hacker / )= http://www.gnu.org/software/{libtool,m4} Technical Author `(_~)_ http://sources.redhat.com/autobook PGP.sig Description: This is a digitally signed message part ___ Bug-libtool mailing list Bug-libtool@gnu.org http://lists.gnu.org/mailman/listinfo/bug-libtool