From: Alexandre Oliva Date: Wed, 13 Jan 1999 08:28:35 +0000 (+0000) Subject: * configure.in (AC_CONFIG_SUBDIRS): added cdemo X-Git-Tag: automake_1-4~47 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f956b65fc4899fbd2b8bedaefa550a9fad0c9964;p=thirdparty%2Flibtool.git * configure.in (AC_CONFIG_SUBDIRS): added cdemo * Makefile.am (DIST_SUBDIRS): ditto (ACINCLUDE_M4_LIST): ditto * tests/Makefile.am (TESTS): added cdemo-shared.test * tests/cdemo-static.test: disable shared libraries here * tests/cdemo-shared.test: disable static libraries here * doc/libtool.texi (Test descriptions): added cdemo tests * THANKS: added Edouard G. Parmelan 1999-01-13 Edouard G. Parmelan * ltmain.in: fix convenience libraries when static libraries are disables. * cdemo/README, cdemo/Makefile.am, cdemo/configure.in, cdemo/foo.h, cdemo/foo1.c, cdemo/main.c, cdemo/.cvsignore, test/cdemo-conf.test, test/cdemo-make.test, test/cdemo-exec.test, test/cdemo-static.test: new tests for convenience libraries. * autogen, Makefile.am, test/Makefile.am: ditto. * ltconfig.in, doc/PLATFORMS: Added support for NCR MP-RAS (i586-ncr-sysv4.3*) with native compiler. * README, doc/libtool.texi: Added note for NCR MP-RAS compiler. --- diff --git a/ChangeLog b/ChangeLog index 0ee53c473..92a886c0f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,28 @@ +1999-01-13 Alexandre Oliva + + * configure.in (AC_CONFIG_SUBDIRS): added cdemo + * Makefile.am (DIST_SUBDIRS): ditto + (ACINCLUDE_M4_LIST): ditto + * tests/Makefile.am (TESTS): added cdemo-shared.test + * tests/cdemo-static.test: disable shared libraries here + * tests/cdemo-shared.test: disable static libraries here + * doc/libtool.texi (Test descriptions): added cdemo tests + * THANKS: added Edouard G. Parmelan + +1999-01-13 Edouard G. Parmelan + + * ltmain.in: fix convenience libraries when static libraries + are disables. + * cdemo/README, cdemo/Makefile.am, cdemo/configure.in, cdemo/foo.h, + cdemo/foo1.c, cdemo/main.c, cdemo/.cvsignore, test/cdemo-conf.test, + test/cdemo-make.test, test/cdemo-exec.test, test/cdemo-static.test: + new tests for convenience libraries. + * autogen, Makefile.am, test/Makefile.am: ditto. + + * ltconfig.in, doc/PLATFORMS: Added support for NCR MP-RAS + (i586-ncr-sysv4.3*) with native compiler. + * README, doc/libtool.texi: Added note for NCR MP-RAS compiler. + 1999-01-12 Thomas Tanner * ltmain.in: before using LN_S remove the symlink diff --git a/Makefile.am b/Makefile.am index 77383d780..ddb2549e0 100644 --- a/Makefile.am +++ b/Makefile.am @@ -2,7 +2,7 @@ ## Gordon Matzigkeit , 1996 AUTOMAKE_OPTIONS = gnits SUBDIRS = . doc tests $(BUILD_LTDL) -DIST_SUBDIRS = . doc tests libltdl demo mdemo # depdemo +DIST_SUBDIRS = . doc tests libltdl demo mdemo cdemo # depdemo # We need to export these variables when we run ltconfig. CFLAGS = @CFLAGS@ @@ -61,9 +61,11 @@ $(srcdir)/ltmain.sh: $(srcdir)/ltmain.in $(top_srcdir)/configure.in # We use our own libtool.m4 for these. ACINCLUDE_M4_LIST = \ $(srcdir)/acinclude.m4 \ - $(srcdir)/demo/acinclude.m4 \ $(srcdir)/libltdl/acinclude.m4 \ - $(srcdir)/mdemo/acinclude.m4 + $(srcdir)/demo/acinclude.m4 \ + $(srcdir)/mdemo/acinclude.m4 \ + $(srcdir)/cdemo/acinclude.m4 # \ # +# $(srcdir)/depdemo/acinclude.m4 # All our rules should depend on these demo files. all check: $(ACINCLUDE_M4_LIST) $(LIBTOOL_DEPS) diff --git a/README b/README index e72af818b..02754c1f1 100644 --- a/README +++ b/README @@ -19,6 +19,7 @@ Shared library support has been implemented for these platforms: GNU/Linux ELF (*-*-linux-gnu*, except aout, coff, and oldld) HP-UX 9.x, 10.x, 11.x (*-*-hpux9*, *-*-hpux10*, *-*-hpux11*) [see note] IRIX 5.x, 6.x (*-*-irix5*, *-*-irix6*) + NCR MP-RAS 3.x (*-ncr-sysv4.3*) [see note] NetBSD 1.x (*-*-netbsd*) OpenBSD 2.x (*-*-openbsd*) OS/2 using EMX (*-*-os2*) @@ -35,6 +36,10 @@ libtool's requirements, so users may report unusual problems. There is no workaround except to install a working sed (such as GNU sed) on these systems. +NOTE: The vendor-distributed NCR MP-RAS cc programs emits copyright +on standard error that confuse tests on size of conftest.err. The +workaround is to specify CC when run configure with CC='cc -Hnocopyr'. + NOTE: Any earlier DG/UX system with ELF executables, such as R3.10 or R4.10, is also likely to work, but hasn't been explicitly tested. diff --git a/THANKS b/THANKS index 7055b7926..5754aac3c 100644 --- a/THANKS +++ b/THANKS @@ -13,6 +13,7 @@ Bruno Haible Carl D. Roth Charles S. Kerr Chris P. Ross +Edouard G. Parmelan Eric Estievenart Erez Zadok H.J. Lu diff --git a/autogen b/autogen index 5f1185c9a..15a882cb5 100644 --- a/autogen +++ b/autogen @@ -10,7 +10,7 @@ aclocal automake --gnits --add-missing autoconf -for sub in demo depdemo libltdl mdemo; do +for sub in demo depdemo libltdl mdemo cdemo; do cd $sub rm -f acinclude.m4 ln -s ../libtool.m4 acinclude.m4 diff --git a/cdemo/.cvsignore b/cdemo/.cvsignore new file mode 100644 index 000000000..88dae73ed --- /dev/null +++ b/cdemo/.cvsignore @@ -0,0 +1,13 @@ +.deps +.libs +Makefile +Makefile.in +aclocal.m4 +acinclude.m4 +configure +config.* +conftest* +libtool +*.lo +*.la +cdemo diff --git a/cdemo/Makefile.am b/cdemo/Makefile.am new file mode 100644 index 000000000..31774d14c --- /dev/null +++ b/cdemo/Makefile.am @@ -0,0 +1,18 @@ +# A brief demonstration of Libtool modules. -*-Makefile-*- +# +AUTOMAKE_OPTIONS = no-dependencies foreign + +INCLUDES = -I$(srcdir)/../libltdl + +EXTRA_DIST = acinclude.m4 + +noinst_LTLIBRARIES = libfoo1.la + +libfoo1_la_SOURCES = foo1.c + +noinst_HEADERS = foo.h + +bin_PROGRAMS = cdemo + +cdemo_SOURCES = main.c +cdemo_LDADD = libfoo1.la $(LIBADD_M) diff --git a/cdemo/README b/cdemo/README new file mode 100644 index 000000000..00a160929 --- /dev/null +++ b/cdemo/README @@ -0,0 +1,4 @@ +This is mdemo, an example package that uses GNU libtool with an +Automake-generated environment to build two simple libraries and programs. + +It demonstrates how to build convenience libraries diff --git a/cdemo/configure.in b/cdemo/configure.in new file mode 100644 index 000000000..df5a50563 --- /dev/null +++ b/cdemo/configure.in @@ -0,0 +1,15 @@ +dnl Initialize the cdemo package. +AC_INIT(main.c) +AM_INIT_AUTOMAKE(cdemo,0.1) + +AC_PROG_CC +AC_EXEEXT +AM_PROG_LIBTOOL + +AC_CHECK_HEADERS(string.h math.h) + +AC_CHECK_LIB(m, cos, LIBADD_M="-lm", LIBADD_M=) +AC_SUBST(LIBADD_M) + +dnl Output the makefile +AC_OUTPUT(Makefile) diff --git a/cdemo/foo.h b/cdemo/foo.h new file mode 100644 index 000000000..62590b7fc --- /dev/null +++ b/cdemo/foo.h @@ -0,0 +1,29 @@ +/* foo.h -- interface to the libfoo* libraries + Copyright (C) 1998-1999 Free Software Foundation, Inc. + Originally by Thomas Tanner + This file is part of GNU Libtool. + +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 of the License, 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. */ + +/* Only include this header file once. */ +#ifndef _FOO_H_ +#define _FOO_H_ 1 + +/* Silly constants that the functions return. */ +#define HELLO_RET 0xe110 +#define FOO_RET 0xf00 + +#endif /* !_FOO_H_ */ diff --git a/cdemo/foo1.c b/cdemo/foo1.c new file mode 100644 index 000000000..6a0275459 --- /dev/null +++ b/cdemo/foo1.c @@ -0,0 +1,42 @@ +/* foo1.c -- trivial test library + Copyright (C) 1998-1999 Free Software Foundation, Inc. + Originally by Thomas Tanner + This file is part of GNU Libtool. + +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 of the License, 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. */ + +#include "foo.h" +#include + +#ifdef HAVE_MATH_H +#include +#endif + +/* exported functions */ + +int +foo1() +{ + printf ("cos (0.0) = %g\n", (double) cos ((double) 0.0)); + return FOO_RET; +} + +int +hello() +{ + printf ("** This is foolib 1 **\n"); + return HELLO_RET; +} diff --git a/cdemo/main.c b/cdemo/main.c new file mode 100644 index 000000000..67e2c111b --- /dev/null +++ b/cdemo/main.c @@ -0,0 +1,41 @@ +/* main.c -- cdemo test program + Copyright (C) 1998-1999 Free Software Foundation, Inc. + Originally by Thomas Tanner + This file is part of GNU Libtool. + +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 of the License, 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. */ + +#include "foo.h" +#include + + +int +main (int argc, char **argv) +{ + int value; + + printf ("Welcome GNU libtool cdemo!\n"); + + value = hello(); + printf ("hello returned: %i\n", value); + if (value == HELLO_RET) + printf("hello is ok!\n"); + + if (foo1 () == FOO_RET) + printf("foo1 is ok!\n"); + + return 0; +} diff --git a/configure.in b/configure.in index 705655044..9f8349194 100644 --- a/configure.in +++ b/configure.in @@ -28,8 +28,7 @@ AC_PROG_LN_S dnl For the `lineno' script (which puts line numbers into `ltconfig'). AC_PROG_AWK -AC_CONFIG_SUBDIRS(libltdl demo mdemo dnl #depdemo -) +AC_CONFIG_SUBDIRS(libltdl demo mdemo cdemo) dnl #depdemo AC_OUTPUT([Makefile doc/Makefile tests/Makefile]) # Local Variables: diff --git a/doc/PLATFORMS b/doc/PLATFORMS index c2744edcd..753cd49f6 100644 --- a/doc/PLATFORMS +++ b/doc/PLATFORMS @@ -36,6 +36,7 @@ i386-unknown-netbsd1.3I egcs 1.2e ok i386-unknown-netbsd1.3.3 gcc 1.2e ok gcc/g++ 2.7.2.2, gas 1.92.3 i386-unknown-openbsd2.4 gcc 1.2e ok i486-ncr-sysv4.3.03 gcc 1.2e ok +i586-ncr-sysv4.3.03 cc 1.2e ok cc -Hnocopyr i586-pc-gnu0.3 gcc 1.2b ok i586-dg-dguxR4.20MU01 gcc 1.2 ok i486-pc-linux-gnulibc1 gcc 1.2e ok diff --git a/doc/libtool.texi b/doc/libtool.texi index e4b9fb31c..ce26f12c1 100644 --- a/doc/libtool.texi +++ b/doc/libtool.texi @@ -2610,8 +2610,39 @@ 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. +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}). + +@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 +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, @file{cdemo-static.test} builds only static +libraries (@samp{--disable-shared}), and @file{cdemo-shared.test} builds +only shared libraries (@samp{--disable-static}). + +NOTE: The tests after @file{cdemo-static.test} are known to fail on all +platforms. A fix is underway. @item hardcode.test @pindex hardcode.test @@ -2877,6 +2908,11 @@ broken, and cannot handle libtool's requirements, so users may report unusual problems. There is no workaround except to install a working @code{sed} (such as GNU @code{sed}) on these systems. +Note: The vendor-distributed NCR MP-RAS @code{cc} programs emits +copyright on standard error that confuse tests on size of +@file{conftest.err}. The workaround is to specify @code{CC} +when run @code{configure} with @kbd{CC='cc -Hnocopyr'}. + @node Platform quirks @section Platform quirks diff --git a/ltconfig.in b/ltconfig.in index 12e99cf47..22f1ae71e 100755 --- a/ltconfig.in +++ b/ltconfig.in @@ -1294,6 +1294,14 @@ else hardcode_shlibpath_var=no ;; + sysv4.3*) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs' + hardcode_direct=no + hardcode_minus_L=no + hardcode_shlibpath_var=no + export_dynamic_flag_spec='-Bexport' + ;; + uts4*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs' hardcode_libdir_flag_spec='-L$libdir' diff --git a/ltmain.in b/ltmain.in index a239b4f92..23581d196 100644 --- a/ltmain.in +++ b/ltmain.in @@ -1292,6 +1292,7 @@ compiler." libext=al oldlibs="$output_objdir/$libname.$libext $oldlibs" build_libtool_libs=convenience + build_old_libs=yes dependency_libs="$deplibs" if test -n "$vinfo"; then diff --git a/tests/Makefile.am b/tests/Makefile.am index a3fd4bedd..976f41e60 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -6,6 +6,9 @@ TESTS = 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 \ + 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/cdemo-conf.test b/tests/cdemo-conf.test new file mode 100755 index 000000000..d8c6ee4ea --- /dev/null +++ b/tests/cdemo-conf.test @@ -0,0 +1,30 @@ +#! /bin/sh +# cdemo-conf.test - try configuring the ../cdemo 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 ../cdemo || mkdir ../cdemo + +# Change to our build directory. +cd ../cdemo || 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 ../cdemo (prefix=$prefix)" +CONFIG_SITE=/dev/null ${CONFIG_SHELL-/bin/sh} $srcdir/../cdemo/configure --srcdir=$srcdir/../cdemo --prefix=$prefix || exit 1 + +exit 0 diff --git a/tests/cdemo-exec.test b/tests/cdemo-exec.test new file mode 100755 index 000000000..e83cb2411 --- /dev/null +++ b/tests/cdemo-exec.test @@ -0,0 +1,28 @@ +#! /bin/sh +# cdemo-exec.test - check that programs in the ../cdemo subdirectory are viable + +# 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 + +if test -f ../cdemo/cdemo; then : +else + echo "You must run cdemo-make.test before running $0" 1>&2 + exit 1 +fi + +# Check to see if the programs really run. +echo "Executing uninstalled programs in ../cdemo" + +if ../cdemo/cdemo; then : +else + echo "$0: cannot execute ../cdemo/cdemo" 1>&2 + status=1 +fi + +exit $status diff --git a/tests/cdemo-make.test b/tests/cdemo-make.test new file mode 100755 index 000000000..25416b0e4 --- /dev/null +++ b/tests/cdemo-make.test @@ -0,0 +1,25 @@ +#! /bin/sh +# cdemo-make.test - try building in the ../cdemo subdirectory + +# 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 + +if test -f ../cdemo/Makefile; then : +else + echo "You must run cdemo-conf.test before running $0" 1>&2 + exit 1 +fi + +# Change to our build directory. +cd ../cdemo || exit 1 + +# Do the actual build. +echo "Making in ../cdemo" +$make || exit 1 +exit 0 diff --git a/tests/cdemo-shared.test b/tests/cdemo-shared.test new file mode 100755 index 000000000..4d6c15703 --- /dev/null +++ b/tests/cdemo-shared.test @@ -0,0 +1,30 @@ +#! /bin/sh +# cdemo-conf.test - try configuring the ../cdemo 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 ../cdemo || mkdir ../cdemo + +# Change to our build directory. +cd ../cdemo || 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 ../cdemo (prefix=$prefix) with --disable-static" +CONFIG_SITE=/dev/null ${CONFIG_SHELL-/bin/sh} $srcdir/../cdemo/configure --srcdir=$srcdir/../cdemo --prefix=$prefix --disable-static || exit 1 + +exit 0 diff --git a/tests/cdemo-static.test b/tests/cdemo-static.test new file mode 100755 index 000000000..7e253f513 --- /dev/null +++ b/tests/cdemo-static.test @@ -0,0 +1,30 @@ +#! /bin/sh +# cdemo-conf.test - try configuring the ../cdemo 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 ../cdemo || mkdir ../cdemo + +# Change to our build directory. +cd ../cdemo || 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 ../cdemo (prefix=$prefix) with --disable-static" +CONFIG_SITE=/dev/null ${CONFIG_SHELL-/bin/sh} $srcdir/../cdemo/configure --srcdir=$srcdir/../cdemo --prefix=$prefix --disable-shared || exit 1 + +exit 0