From: Thomas Tanner Date: Mon, 5 Apr 1999 12:34:03 +0000 (+0000) Subject: * doc/libtool.texi: reorder tests to reflect execution order, X-Git-Tag: release-1-3~72 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=507c2b12c69ea27b94048b0b876752df6be22781;p=thirdparty%2Flibtool.git * doc/libtool.texi: reorder tests to reflect execution order, documented dryrun.test * ltmain.in (lt_preloaded_symbols): dry-run mode bugfix * tests/dryrun.test: new test to check whether the dry-run mode works properly --- diff --git a/ChangeLog b/ChangeLog index e249da5a8..2f36a8b4e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,11 @@ 1999-04-05 Thomas Tanner + * doc/libtool.texi: reorder tests to reflect execution order, + documented dryrun.test + * ltmain.in (lt_preloaded_symbols): dry-run mode bugfix + * tests/dryrun.test: new test to check whether the dry-run + mode works properly + * demo/run.test: removed the unnecessary test * demo/Makefile.am: ditto diff --git a/doc/libtool.texi b/doc/libtool.texi index 1c959d956..3818760b5 100644 --- a/doc/libtool.texi +++ b/doc/libtool.texi @@ -3098,10 +3098,31 @@ test for: @table @file -@item assign.test -@pindex assign.test -Checks whether we don't put break or continue on the same -line as an assignment in the libtool script. +@item cdemo-conf.test +@itemx cdemo-exec.test +@itemx cdemo-make.test +@itemx cdemo-static.test +@itemx cdemo-shared.test +@pindex cdemo-conf.test +@pindex cdemo-exec.test +@pindex cdemo-make.test +@pindex cdemo-static.test +@pindex cdemo-shared.test +These programs check to see that the @file{cdemo} subdirectory of the +libtool distribution can be configured and built correctly. + +The @file{cdemo} subdirectory contains a demonstration of libtool +convenience libraries, a mechanism that allows build-time static +libraries to be created, in a way that their components can be later +linked into programs or other libraries, even shared ones. + +The tests @file{cdemo-make.test} and @file{cdemo-exec.test} are executed +three times, under three different libtool configurations: +@file{cdemo-conf.test} configures @file{cdemo/libtool} to build both +static and shared libraries (the default for platforms that support +both), @file{cdemo-static.test} builds only static libraries +(@samp{--disable-shared}), and @file{cdemo-shared.test} builds only +shared libraries (@samp{--disable-static}). @item demo-conf.test @itemx demo-exec.test @@ -3142,6 +3163,25 @@ libtool uses a @code{deplibs_check_method} to prevent such cases. This tests checks whether libtool's @code{deplibs_check_method} works properly. +@item hardcode.test +@pindex hardcode.test +On all systems with shared libraries, the location of the library can be +encoded in executables that are linked against it @pxref{Linking +executables}. This test checks the conditions under which your system +linker hardcodes the library location, and guarantees that they +correspond to libtool's own notion of how your linker behaves. + +@item build-relink.test +@pindex build-relink.test +Checks whether variable @var{shlibpath_overrides_runpath} is properly +set. If the test fails and @var{VERBOSE} is set, it will indicate what +the variable should have been set to. + +@item noinst-link.test +@pindex noinst-link.test +Checks whether libtool will not try to link with a previously installed +version of a library when it should be linking with a just-built one. + @item mdemo-conf.test @itemx mdemo-exec.test @itemx mdemo-inst.test @@ -3174,50 +3214,14 @@ static and shared libraries, @file{mdemo-static.test} builds only static libraries (@samp{--disable-shared}), and @file{mdemo-shared.test} builds only shared libraries (@samp{--disable-static}). -@item cdemo-conf.test -@itemx cdemo-exec.test -@itemx cdemo-make.test -@itemx cdemo-static.test -@itemx cdemo-shared.test -@pindex cdemo-conf.test -@pindex cdemo-exec.test -@pindex cdemo-make.test -@pindex cdemo-static.test -@pindex cdemo-shared.test -These programs check to see that the @file{cdemo} subdirectory of the -libtool distribution can be configured and built correctly. +@item dryrun.test +@pindex dryrun.test +This test checks whether libtool's @code{--dry-run} mode works properly. -The @file{cdemo} subdirectory contains a demonstration of libtool -convenience libraries, a mechanism that allows build-time static -libraries to be created, in a way that their components can be later -linked into programs or other libraries, even shared ones. - -The tests @file{cdemo-make.test} and @file{cdemo-exec.test} are executed -three times, under three different libtool configurations: -@file{cdemo-conf.test} configures @file{cdemo/libtool} to build both -static and shared libraries (the default for platforms that support -both), @file{cdemo-static.test} builds only static libraries -(@samp{--disable-shared}), and @file{cdemo-shared.test} builds only -shared libraries (@samp{--disable-static}). - -@item hardcode.test -@pindex hardcode.test -On all systems with shared libraries, the location of the library can be -encoded in executables that are linked against it @pxref{Linking -executables}. This test checks the conditions under which your system -linker hardcodes the library location, and guarantees that they -correspond to libtool's own notion of how your linker behaves. - -@item build-relink.test -@pindex build-relink.test -Checks whether variable @var{shlibpath_overrides_runpath} is properly -set. If the test fails and @var{VERBOSE} is set, it will indicate what -the variable should have been set to. - -@item noinst-link.test -@pindex noinst-link.test -Checks whether libtool will not try to link with a previously installed -version of a library when it should be linking with a just-built one. +@item assign.test +@pindex assign.test +Checks whether we don't put break or continue on the same +line as an assignment in the libtool script. @item link.test @pindex link.test diff --git a/ltmain.in b/ltmain.in index 79ba038d2..16c54f8bf 100644 --- a/ltmain.in +++ b/ltmain.in @@ -2366,7 +2366,8 @@ EOF # Parse the name list into a source file. $show "creating $objdir/$dlsyms" - $echo > "$objdir/$dlsyms" "\ + if test -z "$run"; then + $echo > "$objdir/$dlsyms" "\ /* $dlsyms - symbol resolution table for \`$outputname' dlsym emulation. */ /* Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP */ @@ -2379,11 +2380,12 @@ extern \"C\" { /* External symbol declarations for the compiler. */\ " + fi if test "$dlself" = yes; then $show "generating symbol list for \`$output'" - echo ': @PROGRAM@ ' > "$nlist" + test -z "$run" && $echo ': @PROGRAM@ ' > "$nlist" # Add our own program objects to the symbol list. progfiles=`$echo "X$objs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` diff --git a/tests/Makefile.am b/tests/Makefile.am index fe6838836..2ee58ab46 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -11,7 +11,7 @@ TESTS = cdemo-static.test cdemo-make.test cdemo-exec.test \ demo-conf.test demo-make.test demo-exec.test \ demo-inst.test demo-unst.test deplibs.test \ mdemo-conf.test mdemo-make.test mdemo-exec.test \ - mdemo-inst.test mdemo-unst.test \ + mdemo-inst.test mdemo-unst.test dryrun.test \ demo-nofast.test demo-make.test demo-exec.test \ demo-inst.test demo-unst.test \ cdemo-shared.test cdemo-make.test cdemo-exec.test \ diff --git a/tests/dryrun.test b/tests/dryrun.test new file mode 100755 index 000000000..6d71f72a0 --- /dev/null +++ b/tests/dryrun.test @@ -0,0 +1,84 @@ +#! /bin/sh +# dryrun.test - check whether the --dry-run mode works properly + +# Test script header. +need_prefix=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 + +if test -f ../mdemo/Makefile; then : +else + echo "You must run mdemo-conf.test before running $0" 1>&2 + exit 77 +fi + +# Change to our build directory. +cd ../mdemo || exit 1 + +echo "= Running $make clean in ../mdemo" +$make clean || exit 1 + +$make main.o || exit 1 +mkdir .libs +rm -f .before .after + +echo "= Making object files in ../mdemo" +ls -l . .libs > .before +$make LIBTOOL="libtool -n" foo1.lo foo2.lo || exit 1 +ls -l . .libs > .after +diff .before .after > /dev/null || exit 1 +# Now really make them +$make foo1.lo foo2.lo || exit 1 + +echo "= Making libraries in ../mdemo" +ls -l . .libs > .before +$make LIBTOOL="libtool -n" foo1.la libfoo2.la || exit 1 +ls -l . .libs > .after +diff .before .after > /dev/null || exit 1 +# Now really make them +$make foo1.la libfoo2.la || exit 1 + +echo "= Making programs in ../mdemo" +ls -l . .libs > .before +$make LIBTOOL="libtool -n" mdemo mdemo.static || exit 1 +ls -l . .libs > .after +diff .before .after > /dev/null || exit 1 +# Now really make them +$make mdemo mdemo.static || exit 1 + +echo "= Running $make install in ../mdemo" +# Libtool does not create these directories +mkdir $prefix/bin +mkdir $prefix/lib +ls -l . .libs > .before +ls -lR $prefix >> .before +$make LIBTOOL="libtool -n" install || exit 1 +ls -l . .libs > .after +ls -lR $prefix >> .after +diff .before .after > /dev/null || exit 1 +# Now really run it +$make install || exit 1 + +echo "= Running $make uninstall in ../mdemo" +ls -l . .libs > .before +ls -lR $prefix >> .before +# Libtool does not uninstall the programs, save them +cp $prefix/bin/mdemo mdemo.sav +cp $prefix/bin/mdemo.static mdemo.static.sav +$make LIBTOOL="libtool -n" uninstall || exit 1 +# Restore them +mv mdemo.sav $prefix/bin/mdemo +mv mdemo.static.sav $prefix/bin/mdemo.static +ls -l . .libs > .after +ls -lR $prefix >> .after +diff .before .after > /dev/null || exit 1 +# Now really run it +$make uninstall || exit 1 + +rm -f .before .after + +exit 0