* config/ltmain.m4sh, tests/defs.m4sh: Typos. * tests/Makefile.am, tests/testsuite.at, tests/reload.at: New test to check for piecewise linking with subdir-objects. If using GNU ld, also try without link script. Index: config/ltmain.m4sh =================================================================== RCS file: /cvsroot/libtool/libtool/config/ltmain.m4sh,v retrieving revision 1.49 diff -u -r1.49 ltmain.m4sh --- config/ltmain.m4sh 1 Feb 2005 07:34:34 -0000 1.49 +++ config/ltmain.m4sh 2 Feb 2005 21:10:44 -0000 @@ -5160,7 +5160,7 @@ eval concat_cmds=\"\$concat_cmds~$export_symbols_cmds\" fi - # Set up a command to remove the reloadale object files + # Set up a command to remove the reloadable object files # after they are used. i=0 while test "$i" -lt "$k" Index: tests/defs.m4sh =================================================================== RCS file: /cvsroot/libtool/libtool/tests/defs.m4sh,v retrieving revision 1.7 diff -u -r1.7 defs.m4sh --- tests/defs.m4sh 24 Jan 2005 07:45:35 -0000 1.7 +++ tests/defs.m4sh 2 Feb 2005 21:10:45 -0000 @@ -122,7 +122,7 @@ # Extract host from the libtool configuration func_get_config "host" "$LIBTOOL --config" ": fatal" -# Extract host from the libtool configuration +# Extract build from the libtool configuration func_get_config "build" "$LIBTOOL --config" ": fatal" # func_mkprefixdir Index: tests/Makefile.am =================================================================== RCS file: /cvsroot/libtool/libtool/tests/Makefile.am,v retrieving revision 1.51 diff -u -r1.51 Makefile.am --- tests/Makefile.am 1 Feb 2005 15:09:46 -0000 1.51 +++ tests/Makefile.am 2 Feb 2005 21:10:44 -0000 @@ -25,6 +25,7 @@ TESTSUITE_AT = testsuite.at \ am-subdir.at \ functests.at \ + reload.at \ inherited_flags.at EXTRA_DIST = $(TESTSUITE) $(TESTSUITE_AT) package.m4 Index: tests/testsuite.at =================================================================== RCS file: /cvsroot/libtool/libtool/tests/testsuite.at,v retrieving revision 1.5 diff -u -r1.5 testsuite.at --- tests/testsuite.at 10 Jan 2005 15:44:13 -0000 1.5 +++ tests/testsuite.at 2 Feb 2005 21:10:45 -0000 @@ -66,3 +66,5 @@ m4_include([functests.at]) # Test that inherited_linker_flags in the .la actually gets used. m4_include([inherited_flags.at]) +# Test that piecewise linking works +m4_include([reload.at]) --- /dev/null 2005-01-02 13:09:49.000000000 +0100 +++ tests/reload.at 2005-02-02 22:08:39.000000000 +0100 @@ -0,0 +1,56 @@ +# Hand crafted tests for GNU Libtool. -*- Autotest -*- +# Copyright 2004 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. + + +AT_BANNER([Libtool reload tests.]) + +AT_SETUP([piecewise linking]) + +: ${LIBTOOL=$abs_top_builddir/libtool} +eval `$LIBTOOL --config | grep ^CC` +eval `$LIBTOOL --config | grep ^with_gnu_ld` + +sed 's/^max_cmd_len=.*/max_cmd_len=10/' < $LIBTOOL > libtool +chmod u+x libtool +LIBTOOL=./libtool + +mkdir sub sub2 sub3 2>/dev/null +objs= +for i in 1 2 3 4 sub/5 +do + objs="$objs $i.lo" + j=`echo X$i | sed 's,^X,,;s,.*/,,'` + echo "int x$j = 42;" > $i.c + AT_CHECK([$SHELL $LIBTOOL --mode=compile $CC -c -o $i.lo $i.c], [0], [ignore], [ignore]) +done + +AT_CHECK([$LIBTOOL --mode=link $CC -o sub2/libfoo.la $objs],[0],[ignore],[ignore]) +AT_CHECK([$LIBTOOL --mode=link $CC -o sub3/libfoo.la $objs -rpath /nonexistent],[0],[ignore],[ignore]) + +# check also the non-GNU-ld way in case this is GNU ld +case $with_gnu_ld in + yes) + sed 's/^with_gnu_ld=.*/with_gnu_ld="no"/' < $LIBTOOL > libtool-new + rm -f libtool + mv libtool-new libtool + chmod u+x libtool + AT_CHECK([$LIBTOOL --mode=link $CC -o sub3/libfoo.la $objs -rpath /nonexistent],[0],[ignore],[ignore]) + ;; +esac + +AT_CLEANUP