bug-libtool
[Top][All Lists]
Advanced

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

Re: BUG: libtool-1.9f and libtool-1.5.18: "install: you must specify a d


From: Ralf Wildenhues
Subject: Re: BUG: libtool-1.9f and libtool-1.5.18: "install: you must specify a destination"
Date: Wed, 6 Jul 2005 19:05:01 +0200
User-agent: Mutt/1.4.1i

Hi Juergen,

* 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.

Acknowledged.

> As one can see, there has been given a destination, so it is not
> the fault of automake/autoconf/make, because it is pretty much
> legitimate to use both "cp -f" and "install -c".
> 
> The reason for this error is, that the -f of "cp" does NOT expect
> any further arguments, as opposed to bsd's "install". cp -f rather means
> "force" and enforces overwriting of any existing files. This is at least 
> true for both of the versions of "cp" under linux (fileutils-4.1) and under 
> freebsd-4.6 (and under irix, iirc). Therefore libtool's treatment of -f 
> in func_mode_install with "cp" MUST NOT be
> 
>       prev="-f"
> 
> However, at least bsd's "install" does know the option -f
> (opposedly to the install used under linux) and does require 
> further arguments. So a short distinction will be necessary. 
> My workaround for this is in libtool (around line 2442) rsp.
> ltmain.sh (line 2053) in func_mode_install ():
*snip*

Thanks for this report.  Unless anyone opposes, I will install this
slightly different fix, which also cleans up install mode a bit.
Failure might basically occur for a coreutils-like package, were that to
use libtool and also install a program named `cp'.

Regards,
Ralf

Proposed patch (against HEAD, similar for backport):

        * 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 <address@hidden>.

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 -0000       1.72
+++ config/ltmain.m4sh  6 Jul 2005 16:59:08 -0000
@@ -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.
@@ -1719,10 +1719,17 @@
 
       case $arg in
       -d) isdir=yes ;;
-      -f) prev="-f" ;;
-      -g) prev="-g" ;;
-      -m) prev="-m" ;;
-      -o) prev="-o" ;;
+      -f)
+       case " $install_prog " in
+       *" cp "* | *"/cp "*)
+         prev= ;;
+       *)
+         prev=$arg ;;
+       esac
+       ;;
+      -g | -m | -o)
+       prev=$arg
+       ;;
       -s)
        stripme=" -s"
        continue
@@ -1734,7 +1741,7 @@
        if test -n "$prev"; then
          prev=
        else
-         dest="$arg"
+         dest=$arg
          continue
        fi
        ;;




reply via email to

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