bug-libtool
[Top][All Lists]
Advanced

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

Re: libtool 1.4.2 (gettext 0.11): Relinking fails when DESTDIR set


From: Bruno Haible
Subject: Re: libtool 1.4.2 (gettext 0.11): Relinking fails when DESTDIR set
Date: Tue, 5 Feb 2002 20:05:15 +0100 (CET)

Maciej W. Rozycki writes:

>  It seems that libtool cannot handle the standard DESTDIR way of handling
> chrooted installations.  The following happens with gettext 0.11:
> 
> $ CC=i386-linux-gcc CFLAGS='-pipe -O2 -fomit-frame-pointer -mcpu=i486'
> ./configure --prefix=/usr --cache-file=config.cache --build=i386-linux
> --host=i386-linux
> $ make
> $ make DESTDIR=/var/tmp/gettext-0.11-root install-strip
> 
> The last command fails as follows (I've separated output lines for
> readability):

Thanks for the report. I assume DESTDIR would be hard to support in
some operating systems (like AIX or HP-UX) which hardcode the library
paths in the executable (and possibly the libraries). But at least on
Linux, the following patch works.


2002-02-02  Bruno Haible  <address@hidden>

        * ltmain.sh: Add DESTDIR support on ELF systems.

diff -r -c3 --exclude='*.po*' --exclude='*.info*' --exclude='*.html' 
--exclude=Makefile.in --exclude=aclocal.m4 --exclude=configure 
gettext-8/ltmain.sh gettext-9/ltmain.sh
*** gettext-8/ltmain.sh 2001-11-05 11:39:00.000000000 +0100
--- gettext-9/ltmain.sh 2002-02-02 01:04:28.000000000 +0100
***************
*** 1865,1871 ****
              add="-l$name"
            else
              # We cannot seem to hardcode it, guess we'll fake it.
!             add_dir="-L$libdir"
              add="-l$name"
            fi
  
--- 1865,1875 ----
              add="-l$name"
            else
              # We cannot seem to hardcode it, guess we'll fake it.
!             if test "X$installed" = Xyes; then
!               add_dir="-L$libdir"
!             else
!               add_dir="-L$DESTDIR$libdir"
!             fi
              add="-l$name"
            fi
  
***************
*** 4110,4121 ****
--- 4114,4134 ----
        esac
  
        # Add the libdir to current_libdirs if it is the destination.
+       DESTDIR=
        if test "X$destdir" = "X$libdir"; then
          case "$current_libdirs " in
          *" $libdir "*) ;;
          *) current_libdirs="$current_libdirs $libdir" ;;
          esac
        else
+         case "$destdir" in
+           *"$libdir")
+             DESTDIR=`$echo "$destdir" | sed -e 's!'"$libdir"'$!!'`
+             if test "X$destdir" != "X$DESTDIR$libdir"; then
+               DESTDIR=
+             fi
+             ;;
+         esac
          # Note the libdir as a future libdir.
          case "$future_libdirs " in
          *" $libdir "*) ;;
***************
*** 4129,4134 ****
--- 4142,4148 ----
  
        if test -n "$relink_command"; then
          $echo "$modename: warning: relinking \`$file'" 1>&2
+         export DESTDIR
          $show "$relink_command"
          if $run eval "$relink_command"; then :
          else
***************
*** 4136,4141 ****
--- 4150,4156 ----
            continue
          fi
        fi
+       unset DESTDIR
  
        # See the names of the shared library.
        set dummy $library_names



reply via email to

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