diff --git a/ChangeLog b/ChangeLog index 04de1c1e..72aeaac5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2001-03-31 Gary V. Vaughan + + * ltmain.in: Remove the code for stripping duplicate deplibs + from libtool link lines -- duplicates are somtimes necessary + to satisfy inter-library dependencies, and never cause link to + fail even if they are spurious. + * tests/depdemo-dups.test: New file. Make sure this bug doesn't + creep back in again! + * tests/Makefile.am (TESTS): Use the new test above. + 2001-03-29 Edward M. Lee * libtoolize.in: Check configure.ac and prefer configure.ac to diff --git a/ltmain.in b/ltmain.in index 1fe64040..2ef4ef52 100644 --- a/ltmain.in +++ b/ltmain.in @@ -2060,25 +2060,11 @@ compiler." vars="compile_deplibs finalize_deplibs" fi for var in $vars dependency_libs; do - # Make sure that $var contains only unique libraries - # and add them in reverse order + # Add libraries to $var in reverse order eval tmp_libs=\"\$$var\" new_libs= for deplib in $tmp_libs; do - case $deplib in - -L*) new_libs="$deplib $new_libs" ;; - *) - case " $specialdeplibs " in - *" $deplib "*) new_libs="$deplib $new_libs" ;; - *) - case " $new_libs " in - *" $deplib "*) ;; - *) new_libs="$deplib $new_libs" ;; - esac - ;; - esac - ;; - esac + new_libs="$deplib $new_libs" done tmp_libs= for deplib in $new_libs; do diff --git a/tests/Makefile.am b/tests/Makefile.am index c7ec7846..4eb4cb8c 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -5,28 +5,29 @@ AUTOMAKE_OPTIONS = gnits TESTS = cdemo-static.test cdemo-make.test cdemo-exec.test \ demo-static.test demo-make.test demo-exec.test \ demo-inst.test demo-unst.test \ - depdemo-static.test depdemo-make.test depdemo-exec.test \ - depdemo-inst.test depdemo-unst.test \ + depdemo-static.test depdemo-make.test depdemo-dups.test \ + depdemo-exec.test depdemo-inst.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 \ demo-conf.test demo-make.test demo-exec.test \ demo-inst.test demo-unst.test deplibs.test \ - depdemo-conf.test depdemo-make.test depdemo-exec.test \ - depdemo-inst.test depdemo-unst.test \ + depdemo-conf.test depdemo-make.test depdemo-dups.test \ + depdemo-exec.test depdemo-inst.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 \ demo-inst.test demo-unst.test \ demo-pic.test demo-make.test demo-exec.test \ 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-nofast.test depdemo-make.test depdemo-dups.test \ + depdemo-exec.test depdemo-inst.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-unst.test \ + depdemo-shared.test depdemo-make.test depdemo-dups.test \ + depdemo-exec.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 \ assign.test link.test link-2.test nomode.test \ diff --git a/tests/depdemo-dups.test b/tests/depdemo-dups.test new file mode 100755 index 00000000..ed527a21 --- /dev/null +++ b/tests/depdemo-dups.test @@ -0,0 +1,39 @@ +#! /bin/sh +# depdemo-dups.test - check that duplicate deplibs are not removed + +# Test script header. +need_prefix=no +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 + +status=: + +# Check that things are built +if test -f ../depdemo/l2/libl2.la; 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 + +# Try to link with a library, and explicitly name its deplibs +pwd=`pwd` +result=`$libtool -n --mode=link gcc -o something $pwd/l2/libl2.la $pwd/l1/libl1.la` || status=false + +$status || exit 1 + +echo "$result" +case "$result" in +*/libl1.*/libl1.*) ;; +*) + echo "$0: duplicate deplibs should not be removed." + exit 1 + ;; +esac +exit 0