bug-libtool
[Top][All Lists]
Advanced

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

libtool-1.4 in install mode needs write access to .libs directory


From: Bruno Haible
Subject: libtool-1.4 in install mode needs write access to .libs directory
Date: Mon, 5 Nov 2001 11:38:26 +0100 (CET)

Hi,

Any package using GNU libtool 1.4 for two libraries, with a dependency from
one to the other, will violate the GNU standards for the "make install"
target. These standards say

`install'
     ...
     If possible, write the `install' target rule so that it does not
     modify anything in the directory where the program was built,
     provided `make all' has just been done.  This is convenient for
     building the program under one user name and installing it under
     another.

But during the second "libtool --mode=install" command, libtool fails
because it cannot create a file in .libs.

To reproduce, unpack and build
ftp://alpha.gnu.org/gnu/gettext/gettext-0.11-pre1.tar.gz on Linux.
I built it using "./configure --prefix=/packages/gnu; make". Then

$ su bin
> make install
...
/bin/sh ../libtool --mode=install /packages/gnu/bin/install -c  
libgettextlib.la /packages/gnu/lib/libgettextlib.la
/packages/gnu/bin/install -c .libs/libgettextlib-0.11-pre1.so 
/packages/gnu/lib/libgettextlib-0.11-pre1.so
(cd /packages/gnu/lib && rm -f libgettextlib.so && ln -s 
libgettextlib-0.11-pre1.so libgettextlib.so)
/packages/gnu/bin/install -c .libs/libgettextlib.lai 
/packages/gnu/lib/libgettextlib.la
/packages/gnu/bin/install -c .libs/libgettextlib.a 
/packages/gnu/lib/libgettextlib.a
ranlib /packages/gnu/lib/libgettextlib.a
chmod 644 /packages/gnu/lib/libgettextlib.a
PATH="$PATH:/sbin" ldconfig -n /packages/gnu/lib
...
/bin/sh ../libtool --mode=install /packages/gnu/bin/install -c  
libgettextsrc.la /packages/gnu/lib/libgettextsrc.la
libtool: install: warning: relinking `libgettextsrc.la'
cd /packages/gettext/gettext-cvs/gettext-5/src; /bin/sh ../libtool 
--mode=relink gcc -g -O2 -o libgettextsrc.la -rpath /packages/gnu/lib -release 
0.11-pre1 ../lib/libgettextlib.la -no-undefined message.lo po.lo po-lex.lo 
po-gram-gen.lo po-hash-gen.lo po-charset.lo open-po.lo dir-list.lo str-list.lo 
read-po.lo write-po.lo msgl-ascii.lo msgl-iconv.lo msgl-equal.lo msgl-cat.lo 
msgl-english.lo file-list.lo msgl-charset.lo po-time.lo format.lo format-c.lo 
format-java.lo format-lisp.lo format-python.lo format-pascal.lo format-ycp.lo
mv: cannot create regular file `libgettextsrc-0.11-pre1.soU': Permission denied
libtool: install: error: relink `libgettextsrc.la' with the above command 
before installing it
PATH="$PATH:/sbin" ldconfig -n /packages/gnu/lib

As you can see, the first library was installed correctly, but the second
one, which has a dependency, needs relinking, and this relinking needs write
access to .libs. The second library ends up not being installed.

Could you make this work
a) by letting "libtool --mode=install" directly create the library in the
   destination directory, or
b) by using a temporary subdirectory in ${TMPDIR-/tmp}, or
c) through "chmod a+w .libs" after "mkdir .libs"?

I'm using the appended patch as a quick fix, although I know about the
security problems.

Bruno

*** ltmain.sh.orig      Wed Apr 25 01:35:10 2001
--- ltmain.sh   Sat Nov  3 19:30:26 2001
***************
*** 538,543 ****
--- 538,545 ----
          if test $status -ne 0 && test ! -d $dir; then
            exit $status
          fi
+         $show "chmod 777 $dir"
+         $run chmod 777 $dir
        fi
        fi
        if test "$compiler_o_lo" = yes; then
***************
*** 1287,1292 ****
--- 1289,1296 ----
        if test $status -ne 0 && test ! -d $output_objdir; then
        exit $status
        fi
+       $show "chmod 777 $output_objdir"
+       $run chmod 777 $output_objdir
      fi
  
      # Determine the type of output



reply via email to

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