diff --git a/ChangeLog b/ChangeLog index d8f52290..fec13b3e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,25 @@ 1999-01-10 Alexandre Oliva + * configure.in (AC_CONFIG_SUBDIRS): add libltdl, demo, mdemo and + depdemo commented out, so that `dist' works before `check' + (BUILD_LTDL): will contain libltdl if --enable-ltdl-install + * Makefile.am (DIST_SUBDIRS): expand SUBDIRS and add depdemo, + commented out + (SUBDIRS): add $(BUILT_LTDL) + * libltdl/Makefile.am (EXTRA_LTLIBRARIES): add libtest.la, the + same as libltdl but always a convenience library. Not built by + default. Both libraries now depend on the libtool script, that + depends on ../libtool and is rebuilt when needed + * mdemo/Makefile.am (mdemo, mdemo.debug): depend on and link with + ../libltdl/libtest.la, that is rebuilt if needed + (mdemo_LDADD): removed $(LIBADD_M), to avoid silent failures + (foo1.la): renamed from libfoo1.la; test removing the lib prefix + * mdemo/foo1.c: renamed libfoo1_LTX symbols to foo1_LTX + * mdemo/main.c: don't include string.h nor math.h, nor refer to + sin nor cos + * tests/mdemo-exec.test: renamed libfoo1.la to foo1.la + * tests/mdemo-inst.test: ditto + * libltdl/ltdl.c (FILENAME_MAX): use it instead of MAX_FILENAME, and don't redefine it if already defined; default to 1024, as on most systems diff --git a/Makefile.am b/Makefile.am index 4f2bc749..77383d78 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,8 +1,8 @@ ## Process Makefile.am with automake to create Makefile.in. -*-Makefile-*- ## Gordon Matzigkeit , 1996 AUTOMAKE_OPTIONS = gnits -SUBDIRS = . doc tests -DIST_SUBDIRS = $(SUBDIRS) demo libltdl mdemo +SUBDIRS = . doc tests $(BUILD_LTDL) +DIST_SUBDIRS = . doc tests libltdl demo mdemo # depdemo # We need to export these variables when we run ltconfig. CFLAGS = @CFLAGS@ diff --git a/configure.in b/configure.in index a7304de6..6dec2f10 100644 --- a/configure.in +++ b/configure.in @@ -8,6 +8,16 @@ AC_SUBST(pkgdatadir) aclocaldir='${datadir}/aclocal' AC_SUBST(aclocaldir) +AC_ARG_ENABLE(ltdl-install, + [--enable-ltdl-install install libltdl]) +AM_CONDITIONAL(INSTALL_LTDL, test x$enable_ltdl_install = xyes) +if test x$enable_ltdl_install = xyes; then + BUILD_LTDL=libltdl +else + BUILD_LTDL= +fi +AC_SUBST(BUILD_LTDL) + dnl Use the specified CC, RANLIB, and LD while running ltconfig. AC_PROG_CC AC_PROG_RANLIB @@ -18,6 +28,8 @@ 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_OUTPUT([Makefile doc/Makefile tests/Makefile]) # Local Variables: diff --git a/libltdl/Makefile.am b/libltdl/Makefile.am index f93cd96a..bd39633c 100644 --- a/libltdl/Makefile.am +++ b/libltdl/Makefile.am @@ -12,10 +12,20 @@ LTDL_FLAGS = noinst_HEADERS = ltdl.h endif -EXTRA_LTLIBRARIES = libltdl.la +EXTRA_LTLIBRARIES = libltdl.la libtest.la lib_LTLIBRARIES = @LIBLIBS@ noinst_LTLIBRARIES = @NOINSTLIBS@ libltdl_la_SOURCES = ltdl.c -libltdl_la_LDFLAGS = $(LTDL_FLAGS) $(LIBADD_DL) +libltdl_la_LDFLAGS = $(LTDL_FLAGS) +libltdl_la_LIBADD = $(LIBADD_DL) +libltdl_la_DEPENDENCIES = libtool + +libtest_la_SOURCES = $(libltdl_la_SOURCES) +libtest_la_LDFLAGS = +libtest_la_LIBADD = $(libltdl_la_LIBADD) +libltdl_la_DEPENDENCIES = libtool + +libtool: ../libtool + ./config.status --recheck diff --git a/libltdl/configure.in b/libltdl/configure.in index a60e8e43..4b3cccf2 100644 --- a/libltdl/configure.in +++ b/libltdl/configure.in @@ -4,7 +4,7 @@ AC_INIT(ltdl.c) AM_INIT_AUTOMAKE(libltdl,0.1) AC_ARG_ENABLE(ltdl-install, - [--enable-ltdl-install install libltdl (breaks check before install)]) + [--enable-ltdl-install install libltdl]) AM_CONDITIONAL(INSTALL_LTDL, test x$enable_ltdl_install = xyes) if test x$enable_ltdl_install = xyes; then LIBLIBS=libltdl.la diff --git a/mdemo/Makefile.am b/mdemo/Makefile.am index 98635f75..224c09a5 100644 --- a/mdemo/Makefile.am +++ b/mdemo/Makefile.am @@ -6,20 +6,10 @@ INCLUDES = -I$(srcdir)/../libltdl EXTRA_DIST = acinclude.m4 -# A little hack to build libltdl in a subdirectory -libltdl/libltdl.la: - -mkdir $(top_builddir)/libltdl - (here=`pwd` && cd $(top_builddir)/libltdl && \ - $$here/../libltdl/configure --srcdir=$$here/../libltdl && \ - $(MAKE) all) - -distclean-local: - -rm -rf $(top_builddir)/libltdl +lib_LTLIBRARIES = foo1.la libfoo2.la -lib_LTLIBRARIES = libfoo1.la libfoo2.la - -libfoo1_la_SOURCES = foo1.c -libfoo1_la_LDFLAGS = $(LIBADD_M) -module -avoid-versioning +foo1_la_SOURCES = foo1.c +foo1_la_LDFLAGS = $(LIBADD_M) -module -avoid-versioning libfoo2_la_SOURCES = foo2.c libfoo2_la_LDFLAGS = $(LIBADD_M) -module @@ -28,15 +18,19 @@ noinst_HEADERS = foo.h bin_PROGRAMS = mdemo mdemo.debug +../libltdl/libtest.la: ../libltdl/libtool \ + $(srcdir)/../libltdl/ltdl.c $(srcdir)/../libltdl/ltdl.h + (cd ../libltdl; $(MAKE) libtest.la) + # Create a version of mdemo that does dlopen. mdemo_SOURCES = main.c -mdemo_LDADD = libltdl/libltdl.la \ - $(LIBADD_M) # We won't need this when libltdl takes care of dependencies -mdemo_LDFLAGS = -dlopen libfoo1.la -dlopen libfoo2.la -mdemo_DEPENDENCIES = libltdl/libltdl.la libfoo1.la libfoo2.la +mdemo_LDADD = ../libltdl/libtest.la +mdemo_LDFLAGS = -export-dynamic -dlopen foo1.la -dlopen libfoo2.la +mdemo_DEPENDENCIES = ../libltdl/libtest.la foo1.la libfoo2.la # Create an easier-to-debug version of mdemo. mdemo_debug_SOURCES = main.c -mdemo_debug_LDADD = libltdl/libltdl.la -mdemo_debug_LDFLAGS = -static -dlopen libfoo1.la -dlopen libfoo2.la -mdemo_debug_DEPENDENCIES = libltdl/libltdl.la libfoo1.la libfoo2.la +mdemo_debug_LDADD = ../libltdl/libtest.la +mdemo_debug_LDFLAGS = -static -export-dynamic \ + -dlopen foo1.la -dlopen libfoo2.la +mdemo_debug_DEPENDENCIES = ../libltdl/libtest.la foo1.la libfoo2.la diff --git a/mdemo/foo1.c b/mdemo/foo1.c index d98c554b..d84233ca 100644 --- a/mdemo/foo1.c +++ b/mdemo/foo1.c @@ -25,9 +25,9 @@ USA. */ #include #endif -#define nothing libfoo1_LTX_nothing -#define foo1 libfoo1_LTX_foo1 -#define hello libfoo1_LTX_hello +#define nothing foo1_LTX_nothing +#define foo1 foo1_LTX_foo1 +#define hello foo1_LTX_hello /* Give a global variable definition. */ int nothing; diff --git a/mdemo/main.c b/mdemo/main.c index cfc0d143..5efc0df7 100644 --- a/mdemo/main.c +++ b/mdemo/main.c @@ -22,18 +22,6 @@ USA. */ #include "ltdl.h" #include -#ifdef HAVE_STRING_H -#include -#endif - -#ifdef HAVE_MATH_H -#include -#endif - -/* import sin and cos (used by the modules) */ -extern double sin (double x); -extern double cos (double x); - int test_dl (char *filename) { diff --git a/tests/mdemo-exec.test b/tests/mdemo-exec.test index 1d6faca0..d8651f03 100755 --- a/tests/mdemo-exec.test +++ b/tests/mdemo-exec.test @@ -20,13 +20,13 @@ fi echo "Executing uninstalled programs in ../mdemo" status=0 -if ../mdemo/mdemo.debug ../mdemo/libfoo1.la ../mdemo/libfoo2.la; then : +if ../mdemo/mdemo.debug ../mdemo/foo1.la ../mdemo/libfoo2.la; then : else echo "$0: cannot execute ../mdemo/mdemo.debug" 1>&2 status=1 fi -if ../mdemo/mdemo ../mdemo/libfoo1.la ../mdemo/libfoo2.la; then : +if ../mdemo/mdemo ../mdemo/foo1.la ../mdemo/libfoo2.la; then : else echo "$0: cannot execute ../mdemo/mdemo" 1>&2 status=1 diff --git a/tests/mdemo-inst.test b/tests/mdemo-inst.test index 60628acc..c4fd7fab 100755 --- a/tests/mdemo-inst.test +++ b/tests/mdemo-inst.test @@ -26,13 +26,13 @@ $make install || exit 1 echo "= Executing installed programs" status=0 -if $prefix/bin/mdemo.debug $prefix/lib/libfoo1.la $prefix/lib/libfoo2.la; then : +if $prefix/bin/mdemo.debug $prefix/lib/foo1.la $prefix/lib/libfoo2.la; then : else echo "$0: cannot execute $prefix/bin/mdemo.debug" 1>&2 status=1 fi -if $prefix/bin/mdemo $prefix/lib/libfoo1.la $prefix/lib/libfoo2.la; then : +if $prefix/bin/mdemo $prefix/lib/foo1.la $prefix/lib/libfoo2.la; then : else echo "$0: cannot execute $prefix/bin/mdemo" 1>&2