Hi,

as I still encounter problems with libtool-1.5.26 and "make install
DESTDIR=...", from 'depdemo-inst.test' I've derived a new
'depdemo-instd.test', simply installing depdemo via DESTDIR.
Attached is a patch to add this test for libtool-1.5.26.

When adding this after depdemo-static, depdemo-conf, depdemo-nofast and
depdemo-shared, on platforms where I can test results are:

  build/host-triplet       static    conf    nofast    shared
---------------------------------------------------------------
  i686-pc-linux-gnu         PASS     PASS     FAIL      PASS
  i386-pc-solaris2.10       PASS     PASS     PASS      PASS
  sparc-sun-solaris2.9      PASS     PASS     PASS      PASS
  ia64-hp-hpux11.23         PASS     PASS     PASS      PASS
  powerpc-ibm-aix5.3.0.0    PASS     SKIP     FAIL     *FAIL*
  hppa2.0w-hp-hpux11.11     PASS     FAIL     SKIP      FAIL

Ok, failing on hppa2.0w-hp-hpux11.11 is less surprising currently.
More interesting is failing on linux with nofast...

But I'm focussing on 'conf' and 'shared' now, because they are the ones
being normally used AFAICT, so my current problem is 'shared' on
powerpc-ibm-aix5.3.0.0:

Here the problem is around line ltmain.in#2804, when one shared library
needs another in-package shared library:

2803         # Finalize command for both is simple: just hardcode it.
2804         if test "$hardcode_direct" = yes; then
2805           add="$libdir/$linklib"
2806         elif test "$hardcode_minus_L" = yes; then
               ...
2809         elif test "$hardcode_shlibpath_var" = yes; then
               ...
2815         elif test "$hardcode_automatic" = yes; then
               ...
2822         else
2823           # We cannot seem to hardcode it, guess we'll fake it.
               ...

It is impossible to "hardcode_direct" using "$libdir/$linklib", because
$linklib is not in $libdir yet but in $inst_prefix_dir$libdir.
But hardcoding $inst_prefix_dir$libdir/$linklib is bad either, as
$inst_prefix_dir is not there at runtime lateron.

Remember libtool is configured this way:
  hardcode_direct=yes
  hardcode_minus_L=no
  hardcode_shlibpath_var=unsupported

It simply works when using something like the second attached patch to
fall back to "guess we'll fake it" (like all my other platforms),
although hardcode_direct IMHO is generally a bad idea when some RUNPATH
can be encoded, even without using DESTDIR.

Thoughts?

Thanks!
/haubi/
diff -rNu libtool-1.5.26.vanilla/tests/Makefile.in libtool-1.5.26.instd-test/tests/Makefile.in
--- libtool-1.5.26.vanilla/tests/Makefile.in	2008-02-01 17:38:41.000000000 +0100
+++ libtool-1.5.26.instd-test/tests/Makefile.in	2008-03-14 10:49:53.244749000 +0100
@@ -184,6 +184,7 @@
 	demo-inst.test demo-unst.test \
 	depdemo-static.test depdemo-make.test \
 	depdemo-exec.test depdemo-inst.test depdemo-unst.test \
+	depdemo-instd.test depdemo-unst.test \
 	mdemo-static.test mdemo-make.test mdemo-exec.test \
 	mdemo-inst.test mdemo-unst.test \
 	cdemo-conf.test cdemo-make.test cdemo-exec.test \
@@ -191,6 +192,7 @@
 	demo-inst.test demo-unst.test deplibs.test \
 	depdemo-conf.test depdemo-make.test \
 	depdemo-exec.test depdemo-inst.test depdemo-unst.test \
+	depdemo-instd.test depdemo-unst.test \
 	mdemo-conf.test mdemo-make.test mdemo-exec.test \
 	mdemo-inst.test mdemo-unst.test dryrun.test \
 	demo-nofast.test demo-make.test demo-exec.test \
@@ -199,11 +201,13 @@
 	demo-nopic.test demo-make.test demo-exec.test \
 	depdemo-nofast.test depdemo-make.test \
 	depdemo-exec.test depdemo-inst.test depdemo-unst.test \
+	depdemo-instd.test depdemo-unst.test \
 	cdemo-shared.test cdemo-make.test cdemo-exec.test \
 	demo-shared.test demo-make.test demo-exec.test demo-inst.test \
 	hardcode.test build-relink.test noinst-link.test demo-unst.test \
 	depdemo-shared.test depdemo-make.test \
-	depdemo-exec.test depdemo-inst.test build-relink2.test \
+	depdemo-exec.test depdemo-instd.test depdemo-unst.test \
+	depdemo-inst.test build-relink2.test \
 	depdemo-unst.test \
 	mdemo-shared.test mdemo-make.test mdemo-exec.test \
 	mdemo-inst.test mdemo-unst.test \
diff -rNu libtool-1.5.26.vanilla/tests/defs libtool-1.5.26.instd-test/tests/defs
--- libtool-1.5.26.vanilla/tests/defs	2005-07-08 17:50:35.000000000 +0200
+++ libtool-1.5.26.instd-test/tests/defs	2008-03-14 10:49:53.254752000 +0100
@@ -42,6 +42,16 @@
   prefix=NONE
 fi
 
+image="./_image"
+if test "$need_image" = yes; then
+  # An absolute path to an image directory.
+  test -d $image || mkdir $image
+  image=`cd $image && pwd`
+else
+  test -d $image && rm -rf $image
+  image=
+fi
+
 # Extract CC from the libtool configuration
 eval `$libtool --config | grep '^CC='`
 
diff -rNu libtool-1.5.26.vanilla/tests/depdemo-instd.test libtool-1.5.26.instd-test/tests/depdemo-instd.test
--- libtool-1.5.26.vanilla/tests/depdemo-instd.test	1970-01-01 01:00:00.000000000 +0100
+++ libtool-1.5.26.instd-test/tests/depdemo-instd.test	2008-03-14 10:49:53.264743000 +0100
@@ -0,0 +1,68 @@
+#! /bin/sh
+# depdemo-instd.test - try installing from the ../depdemo subdirectory via DESTDIR
+
+# Test script header.
+need_prefix=yes
+need_image=yes
+if test -z "$srcdir"; then
+  srcdir=`echo "$0" | sed 's%/[^/]*$%%'`
+  test "$srcdir" = "$0" && srcdir=.
+  test "${VERBOSE+set}" != "set" && VERBOSE=yes
+fi
+. $srcdir/defs || exit 1
+
+# Check that things are built.
+if test -f ../depdemo/depdemo$EXEEXT; then :
+else
+  echo "You must run depdemo-make.test before $0" 1>&2
+  exit 77
+fi
+
+# Change to our build directory.
+cd ../depdemo || exit 1
+
+echo "= Running $make install 'DESTDIR=$image' in ../depdemo"
+$make install DESTDIR="${image}" || exit 1
+
+echo "= Moving out of DESTDIR"
+
+rm -f fail
+{ ( cd "${image}/${prefix}"; tar cf - . ) || touch fail ; } |
+{ ( cd "${prefix}" ; tar xfv - ) || touch fail ; }
+if [ -f fail ]; then
+	echo "$0: failed to merge from ${image}/${prefix} to ${prefix}" 1>&2
+	rm -f fail
+	exit 1
+fi
+rm -rf "${image}/${prefix}"
+leftovers=`find "${image}" ! -type d ! -name '.*' -print`
+if test -n "$leftovers"; then
+  echo "= Leftover after merging from ${image}/${prefix}:"
+  ls -l $leftovers
+  ls -l $leftovers > ~/devel/savannah/arse
+  exit 1
+fi
+rm -rf "${image}"
+
+echo "= Executing installed programs"
+
+status=0
+if $prefix/bin/depdemo_static; then :
+else
+  echo "$0: cannot execute $prefix/bin/depdemo_static" 1>&2
+  status=1
+fi
+
+if $prefix/bin/depdemo; then :
+else
+  echo "$0: cannot execute $prefix/bin/depdemo" 1>&2
+
+  # Simple check to see if they are superuser.
+  if test -w /; then :
+  else
+    echo "You may need to run $0 as the superuser."
+  fi
+  status=1
+fi
+
+exit $status
--- ltmain.in.orig	2008-02-01 17:12:00.000000000 +0100
+++ ltmain.in	2008-03-14 17:39:55.668379000 +0100
@@ -2801,7 +2801,10 @@
 	    add_dir=
 	    add=
 	    # Finalize command for both is simple: just hardcode it.
-	    if test "$hardcode_direct" = yes; then
+	    if test "$hardcode_direct" = yes &&
+	       { test -z "$inst_prefix_dir" ||
+		 test ! -f "$inst_prefix_dir$libdir/$linklib" 
+	       }; then
 	      add="$libdir/$linklib"
 	    elif test "$hardcode_minus_L" = yes; then
 	      add_dir="-L$libdir"
_______________________________________________
Bug-libtool mailing list
Bug-libtool@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-libtool

Reply via email to