* 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
This commit is contained in:
Alexandre Oliva 1999-01-10 19:16:30 +00:00 committed by Alexandre Oliva
parent 48fcf6a997
commit fbd5377930
10 changed files with 68 additions and 44 deletions

View File

@ -1,5 +1,25 @@
1999-01-10 Alexandre Oliva <oliva@dcc.unicamp.br>
* 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

View File

@ -1,8 +1,8 @@
## Process Makefile.am with automake to create Makefile.in. -*-Makefile-*-
## Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 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@

View File

@ -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:

View File

@ -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

View File

@ -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

View File

@ -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)
lib_LTLIBRARIES = foo1.la libfoo2.la
distclean-local:
-rm -rf $(top_builddir)/libltdl
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

View File

@ -25,9 +25,9 @@ USA. */
#include <math.h>
#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;

View File

@ -22,18 +22,6 @@ USA. */
#include "ltdl.h"
#include <stdio.h>
#ifdef HAVE_STRING_H
#include <string.h>
#endif
#ifdef HAVE_MATH_H
#include <math.h>
#endif
/* import sin and cos (used by the modules) */
extern double sin (double x);
extern double cos (double x);
int
test_dl (char *filename)
{

View File

@ -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

View File

@ -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