From 72abadcd76e5f0ddc580384ff0a63b0350441597 Mon Sep 17 00:00:00 2001 From: Alexandre Oliva Date: Thu, 21 Jan 1999 03:50:07 +0000 Subject: [PATCH] * tests/demo-shared.test, tests/demo-static.test: new tests * tests/mdemo-shared.test, tests/mdemo-static.test: ditto * tests/Makefile.am: ditto * doc/libtool.texi: document them * demo/Makefile.am, mdemo/Makefile.am (@STATIC@): do not use -static unconditionally, it can't work with --disable-static * demo/configure.in, mdemo/configure.in: check whether libtool was configured to build static libraries and, if not, set STATIC to an empty string --- ChangeLog | 12 ++++++++++++ demo/Makefile.am | 2 +- demo/configure.in | 7 +++++++ doc/libtool.texi | 31 ++++++++++++++++++++++++------- mdemo/Makefile.am | 2 +- mdemo/configure.in | 7 +++++++ tests/Makefile.am | 12 ++++++++++-- tests/demo-shared.test | 30 ++++++++++++++++++++++++++++++ tests/demo-static.test | 30 ++++++++++++++++++++++++++++++ tests/mdemo-shared.test | 30 ++++++++++++++++++++++++++++++ tests/mdemo-static.test | 30 ++++++++++++++++++++++++++++++ 11 files changed, 182 insertions(+), 11 deletions(-) create mode 100755 tests/demo-shared.test create mode 100755 tests/demo-static.test create mode 100755 tests/mdemo-shared.test create mode 100755 tests/mdemo-static.test diff --git a/ChangeLog b/ChangeLog index a7f4b956..03360e8a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,15 @@ +1999-01-21 Alexandre Oliva + + * tests/demo-shared.test, tests/demo-static.test: new tests + * tests/mdemo-shared.test, tests/mdemo-static.test: ditto + * tests/Makefile.am: ditto + * doc/libtool.texi: document them + * demo/Makefile.am, mdemo/Makefile.am (@STATIC@): do not use + -static unconditionally, it can't work with --disable-static + * demo/configure.in, mdemo/configure.in: check whether libtool was + configured to build static libraries and, if not, set STATIC to an + empty string + 1999-01-20 Alexandre Oliva * ltmain.in (module, droppeddeps): if libtool could not satisfy diff --git a/demo/Makefile.am b/demo/Makefile.am index 9034bc46..7cf94b32 100644 --- a/demo/Makefile.am +++ b/demo/Makefile.am @@ -29,7 +29,7 @@ hell_LDADD = libhello.la # Create an easier-to-debug version of hell. hell_debug_SOURCES = main.c hell_debug_LDADD = libhello.la -hell_debug_LDFLAGS = -static +hell_debug_LDFLAGS = @STATIC@ if BINARY_HELLDL diff --git a/demo/configure.in b/demo/configure.in index f151af91..e0fac772 100644 --- a/demo/configure.in +++ b/demo/configure.in @@ -7,6 +7,13 @@ AC_C_CONST AC_EXEEXT AM_PROG_LIBTOOL +if ${CONFIG_SHELL} ./libtool --features | grep "enable static" >/dev/null; then + STATIC=-static +else + STATIC= +fi +AC_SUBST(STATIC) + AM_CONDITIONAL(BINARY_HELLDL, [dnl grep '^global_symbol_pipe=..*$' ./libtool >/dev/null]) diff --git a/doc/libtool.texi b/doc/libtool.texi index 7ecde30f..0baf3b57 100644 --- a/doc/libtool.texi +++ b/doc/libtool.texi @@ -2830,28 +2830,43 @@ line as an assignment in the libtool script. @itemx demo-inst.test @itemx demo-make.test @itemx demo-unst.test +@itemx demo-static.test +@itemx demo-shared.test @pindex demo-conf.test @pindex demo-exec.test @pindex demo-inst.test @pindex demo-make.test @pindex demo-unst.test +@pindex demo-static.test +@pindex demo-shared.test These programs check to see that the @file{demo} subdirectory of the libtool distribution can be configured, built, installed, and uninstalled correctly. The @file{demo} subdirectory contains a demonstration of a trivial -package that uses libtool. +package that uses libtool. The tests @file{cdemo-make.test}, +@file{cdemo-exec.test}, @file{cdemo-inst.test} and +@file{cdemo-unst.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, +@file{cdemo-static.test} builds only static libraries +(@samp{--disable-shared}), and @file{cdemo-shared.test} builds only +shared libraries (@samp{--disable-static}). @item mdemo-conf.test @itemx mdemo-exec.test @itemx mdemo-inst.test @itemx mdemo-make.test @itemx mdemo-unst.test +@itemx mdemo-static.test +@itemx mdemo-shared.test @pindex mdemo-conf.test @pindex mdemo-exec.test @pindex mdemo-inst.test @pindex mdemo-make.test @pindex mdemo-unst.test +@pindex mdemo-static.test +@pindex mdemo-shared.test These programs check to see that the @file{mdemo} subdirectory of the libtool distribution can be configured, built, installed, and uninstalled correctly. @@ -2862,12 +2877,13 @@ load modules. The library @file{libltdl} provides an experimental dlopen wrapper for various platforms (Linux, Solaris, HP/UX, Win32 etc.) including support for dlpreopened modules (@pxref{Dlpreopening}). -NOTE: The tests @file{mdemo-exec.test} and @file{mdemo-inst.test} are -known to fail on platforms that do not fully support inter-library -dependencies. We'd appreciate your help in porting the recently -introduced inter-library dependencies code to various platforms, even -some very common platforms haven't been updated yet (@pxref{Porting -inter-library dependencies}). +The tests @file{mdemo-make.test}, @file{mdemo-exec.test}, +@file{mdemo-inst.test} and @file{mdemo-unst.test} are executed +three times, under three different libtool configurations: +@file{mdemo-conf.test} configures @file{mdemo/libtool} to build both +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 @@ -2878,6 +2894,7 @@ inter-library dependencies}). @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. diff --git a/mdemo/Makefile.am b/mdemo/Makefile.am index 31600e7a..b56c2eca 100644 --- a/mdemo/Makefile.am +++ b/mdemo/Makefile.am @@ -32,6 +32,6 @@ mdemo_DEPENDENCIES = ../libltdl/libltdlc.la foo1.la libfoo2.la # Create an easier-to-debug version of mdemo. mdemo_debug_SOURCES = $(mdemo_SOURCES) -mdemo_debug_LDFLAGS = -static $(mdemo_LDFLAGS) +mdemo_debug_LDFLAGS = @STATIC@ $(mdemo_LDFLAGS) mdemo_debug_LDADD = $(mdemo_LDADD) mdemo_debug_DEPENDENCIES = $(mdemo_DEPENDENCIES) diff --git a/mdemo/configure.in b/mdemo/configure.in index b070b908..c29c3590 100644 --- a/mdemo/configure.in +++ b/mdemo/configure.in @@ -7,6 +7,13 @@ AC_C_CONST AC_EXEEXT AM_PROG_LIBTOOL +if ${CONFIG_SHELL} ./libtool --features | grep "enable static" >/dev/null; then + STATIC=-static +else + STATIC= +fi +AC_SUBST(STATIC) + AC_CHECK_HEADERS(math.h) AC_CHECK_LIB(m, cos, LIBADD_M="-lm", LIBADD_M=) diff --git a/tests/Makefile.am b/tests/Makefile.am index 976f41e6..a6243801 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -2,12 +2,20 @@ AUTOMAKE_OPTIONS = gnits -TESTS = demo-conf.test demo-make.test demo-exec.test \ +TESTS = demo-static.test demo-make.test demo-exec.test \ + demo-inst.test demo-unst.test hardcode.test \ + mdemo-static.test mdemo-make.test mdemo-exec.test \ + mdemo-inst.test mdemo-unst.test \ + cdemo-static.test cdemo-make.test cdemo-exec.test \ + demo-conf.test demo-make.test demo-exec.test \ demo-inst.test demo-unst.test hardcode.test \ mdemo-conf.test mdemo-make.test mdemo-exec.test \ mdemo-inst.test mdemo-unst.test \ cdemo-conf.test cdemo-make.test cdemo-exec.test \ - cdemo-static.test cdemo-make.test cdemo-exec.test \ + demo-shared.test demo-make.test demo-exec.test \ + demo-inst.test demo-unst.test hardcode.test \ + mdemo-shared.test mdemo-make.test mdemo-exec.test \ + mdemo-inst.test mdemo-unst.test \ cdemo-shared.test cdemo-make.test cdemo-exec.test \ link.test link-2.test nomode.test \ quote.test sh.test suffix.test diff --git a/tests/demo-shared.test b/tests/demo-shared.test new file mode 100755 index 00000000..64ced1ff --- /dev/null +++ b/tests/demo-shared.test @@ -0,0 +1,30 @@ +#! /bin/sh +# demo-conf.test - try configuring the ../demo subdirectory + +# 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 + +# Maybe we have a VPATH build, in which case, create a new subdir. +test -d ../demo || mkdir ../demo + +# Change to our build directory. +cd ../demo || exit 1 + +# Possibly clean up the distribution. +if test -f Makefile; then + echo "= Running $make distclean in ../demo" + $make distclean +fi +rm -f config.cache + +# Configure the demonstration. +echo "= Configuring in ../demo (prefix=$prefix) with --disable-static" +CONFIG_SITE=/dev/null ${CONFIG_SHELL-/bin/sh} $srcdir/../demo/configure --srcdir=$srcdir/../demo --prefix=$prefix --disable-static || exit 1 + +exit 0 diff --git a/tests/demo-static.test b/tests/demo-static.test new file mode 100755 index 00000000..9508a9e3 --- /dev/null +++ b/tests/demo-static.test @@ -0,0 +1,30 @@ +#! /bin/sh +# demo-conf.test - try configuring the ../demo subdirectory + +# 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 + +# Maybe we have a VPATH build, in which case, create a new subdir. +test -d ../demo || mkdir ../demo + +# Change to our build directory. +cd ../demo || exit 1 + +# Possibly clean up the distribution. +if test -f Makefile; then + echo "= Running $make distclean in ../demo" + $make distclean +fi +rm -f config.cache + +# Configure the demonstration. +echo "= Configuring in ../demo (prefix=$prefix) with --disable-shared" +CONFIG_SITE=/dev/null ${CONFIG_SHELL-/bin/sh} $srcdir/../demo/configure --srcdir=$srcdir/../demo --prefix=$prefix --disable-shared || exit 1 + +exit 0 diff --git a/tests/mdemo-shared.test b/tests/mdemo-shared.test new file mode 100755 index 00000000..f1b3feea --- /dev/null +++ b/tests/mdemo-shared.test @@ -0,0 +1,30 @@ +#! /bin/sh +# mdemo-conf.test - try configuring the ../libltdl and ../mdemo subdirectories + +# 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 + +# Maybe we have a VPATH build, in which case, create a new subdir. +test -d ../mdemo || mkdir ../mdemo + +# Change to our build directory. +cd ../mdemo || exit 1 + +# Possibly clean up the distribution. +if test -f Makefile; then + echo "= Running $make distclean in ../mdemo" + $make distclean +fi +rm -f config.cache + +# Configure the demonstration. +echo "= Configuring in ../mdemo (prefix=$prefix) with --disable-static" +CONFIG_SITE=/dev/null ${CONFIG_SHELL-/bin/sh} $srcdir/../mdemo/configure --srcdir=$srcdir/../mdemo --prefix=$prefix --disable-static || exit 1 + +exit 0 diff --git a/tests/mdemo-static.test b/tests/mdemo-static.test new file mode 100755 index 00000000..b063fc5c --- /dev/null +++ b/tests/mdemo-static.test @@ -0,0 +1,30 @@ +#! /bin/sh +# mdemo-conf.test - try configuring the ../libltdl and ../mdemo subdirectories + +# 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 + +# Maybe we have a VPATH build, in which case, create a new subdir. +test -d ../mdemo || mkdir ../mdemo + +# Change to our build directory. +cd ../mdemo || exit 1 + +# Possibly clean up the distribution. +if test -f Makefile; then + echo "= Running $make distclean in ../mdemo" + $make distclean +fi +rm -f config.cache + +# Configure the demonstration. +echo "= Configuring in ../mdemo (prefix=$prefix) with --disable-shared" +CONFIG_SITE=/dev/null ${CONFIG_SHELL-/bin/sh} $srcdir/../mdemo/configure --srcdir=$srcdir/../mdemo --prefix=$prefix --disable-shared || exit 1 + +exit 0