From: Alexandre Oliva Date: Tue, 9 Mar 1999 22:02:09 +0000 (+0000) Subject: * libtool.m4 (AC_LIBLTDL_INSTALLABLE, AC_LIBLTDL_CONVENIENCE): X-Git-Tag: release-1-2f~64 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=68799c00775ddb4f42fa6bc1f59c2d5edbaec43b;p=thirdparty%2Flibtool.git * libtool.m4 (AC_LIBLTDL_INSTALLABLE, AC_LIBLTDL_CONVENIENCE): new macros * NEWS: ditto * libltdl/configure.in: if none of the new macros or configure arguments are used, warn and build convenience library only * libltdl/Makefile.am: conditionally build convenience libltdl.la * mdemo/configure.in: use AC_LIBLTDL_CONVENIENCE * mdemo/Makefile.am: refer to @LIBLTDL@ --- diff --git a/ChangeLog b/ChangeLog index c457538f2..247938b2b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +1999-03-09 Alexandre Oliva + + * libtool.m4 (AC_LIBLTDL_INSTALLABLE, AC_LIBLTDL_CONVENIENCE): + new macros + * NEWS: ditto + * libltdl/configure.in: if none of the new macros or configure + arguments are used, warn and build convenience library only + * libltdl/Makefile.am: conditionally build convenience libltdl.la + * mdemo/configure.in: use AC_LIBLTDL_CONVENIENCE + * mdemo/Makefile.am: refer to @LIBLTDL@ + 1999-03-09 Gary V. Vaughan * NEWS: updated. diff --git a/NEWS b/NEWS index e625e20f0..23311b0d0 100644 --- a/NEWS +++ b/NEWS @@ -1,6 +1,8 @@ NEWS - list of user-visible changes between releases of GNU Libtool New in 1.2e: CVS version; 1.2f: 1999-?-?, Libtool team: +* New AC_LIBLTDL_CONVENIENCE and AC_LIBLTDL_INSTALLABLE macros, to select + convenience and/or installable versions of libltdl. * In order for libtool to attempt to link a shared library (dll) on win32 platforms, you must pass the -no-undefined flag to libtool in link mode. * The path to GNU ld now works on cygwin-b18 to cygwin-b20.2 at least. diff --git a/libltdl/Makefile.am b/libltdl/Makefile.am index d854f7eb2..0f3fc19e0 100644 --- a/libltdl/Makefile.am +++ b/libltdl/Makefile.am @@ -10,7 +10,9 @@ else noinst_HEADERS = ltdl.h endif +if CONVENIENCE_LTDL noinst_LTLIBRARIES = libltdl.la +endif libltdl_la_SOURCES = ltdl.c libltdl_la_LIBADD = $(LIBADD_DL) diff --git a/libltdl/configure.in b/libltdl/configure.in index 3785958af..93afeedf2 100644 --- a/libltdl/configure.in +++ b/libltdl/configure.in @@ -9,16 +9,25 @@ AM_MAINTAINER_MODE TOINST=toinst AC_SUBST(TOINST) +if test -z "$enable_ltdl_install$enable_ltdl_convenience"; then + AC_MSG_WARN([*** Neither AC_LIBLTDL_INSTALLABLE nor AC_LIBLTDL_CONVENIENCE wre used]) + AC_MSG_WARN([*** in configure.in; building convenience library for backward]) + AC_MSG_WARN([*** compatibility. This is deprecated, and will not work in the future]) + enable_ltdl_convenience=yes +fi + 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 +if test x"$enable_ltdl_install" != xno; then LIBLIBS=$TOINST/libltdl.la else LIBLIBS= fi AC_SUBST(LIBLIBS) +AM_CONDITIONAL(INSTALL_LTDL, test x"$enable_ltdl_install" != xno) +AM_CONDITIONAL(CONVENIENCE_LTDL, test x"$enable_ltdl_convenience" != xno) + AC_PROG_CC AC_C_CONST AC_C_INLINE diff --git a/libtool.m4 b/libtool.m4 index 04697c48d..02442355a 100644 --- a/libtool.m4 +++ b/libtool.m4 @@ -21,7 +21,7 @@ ## configuration script generated by Autoconf, you may include it under ## the same distribution terms that you use for the rest of that program. -# serial 32 AC_PROG_LIBTOOL +# serial 33 AC_PROG_LIBTOOL AC_DEFUN(AC_PROG_LIBTOOL, [AC_PREREQ(2.12.2)dnl AC_REQUIRE([AC_ENABLE_SHARED])dnl @@ -601,6 +601,38 @@ AC_CHECK_LIB(mw, _mwvalidcheckl) AC_CHECK_LIB(m, cos) ]) +# AC_LIBLTDL_CONVENIENCE[(dir)] - sets LIBLTDL to the link flags for +# the libltdl convenience library, adds --enable-ltdl-convenience to +# the configure arguments. Note that LIBLTDL is not AC_SUBSTed, nor +# is AC_CONFIG_SUBDIRS called. If DIR is not provided, it is assumed +# to be `${top_builddir}/libltdl'. Make sure you start DIR with +# '${top_builddir}/' (note the single quotes!) if your package is not +# flat, and, if you're not using automake, define top_builddir as +# appropriate in the Makefiles. +AC_DEFUN(AC_LIBLTDL_CONVENIENCE, [ + LIBLTDL=ifelse($#,1,$1,['${top_builddir}/libltdl'])/libltdl.la + ac_configure_args="$ac_configure_args --enable-ltdl-convenience" +]) + +# AC_LIBLTDL_INSTALLABLE[(dir)] - sets LIBLTDL to the link flags for +# the libltdl installable library, and adds --enable-ltdl-install to +# the configure arguments. Note that LIBLTDL is not AC_SUBSTed, nor +# is AC_CONFIG_SUBDIRS called. If DIR is not provided, it is assumed +# to be `${top_builddir}/libltdl'. Make sure you start DIR with +# '${top_builddir}/' (note the single quotes!) if your package is not +# flat, and, if you're not using automake, define top_builddir as +# appropriate in the Makefiles. +# In the future, this macro may have to be called after AC_PROG_LIBTOOL. +AC_DEFUN(AC_LIBLTDL_INSTALLABLE, [ + AC_CHECK_LIB(ltdl, main, LIBLTDL="-lltdl", [ + enable_ltdl_install=yes + ac_configure_args="$ac_configure_args --enable-ltdl-install" + ]) + if test x"$enable_ltdl_install" = x"yes"; then + LIBLTDL=ifelse($#,1,$1,['${top_builddir}/libltdl'])/toinst/libltdl.la + fi +]) + dnl old names AC_DEFUN(AM_PROG_LIBTOOL, [indir([AC_PROG_LIBTOOL])])dnl AC_DEFUN(AM_ENABLE_SHARED, [indir([AC_ENABLE_SHARED], $@)])dnl diff --git a/mdemo/Makefile.am b/mdemo/Makefile.am index e2b62f446..426cd88aa 100644 --- a/mdemo/Makefile.am +++ b/mdemo/Makefile.am @@ -18,9 +18,11 @@ noinst_HEADERS = foo.h bin_PROGRAMS = mdemo mdemo.static -../libltdl/libltdl.la: ../libtool ../libltdl/libtool \ +## use @LIBLTDL@ because some broken makes do not accept macros in targets +## we can only do this because our LIBLTDL does not contain ${top_builddir} +@LIBLTDL@: ../libtool ../libltdl/libtool \ $(srcdir)/../libltdl/ltdl.c $(srcdir)/../libltdl/ltdl.h - (cd ../libltdl; $(MAKE) libltdl.la) + (cd ../libltdl; $(MAKE) `echo $(LIBLTDL) | sed 's,.*\.\./libltdl/,,g'`) # Without the following line, the check may fail if libltdl/libtool is # removed after libltdl is configured ../libltdl/libtool: @@ -30,9 +32,9 @@ mdemo_SOURCES = main.c mdemo_LDFLAGS = -export-dynamic ## FIXME: remove this when libtool and libltdl ## handle dependencies of modules ## The quotes around -dlopen below fool automake into accepting it -mdemo_LDADD = ../libltdl/libltdl.la "-dlopen" self \ +mdemo_LDADD = @LIBLTDL@ "-dlopen" self \ "-dlopen" foo1.la "-dlopen" libfoo2.la -mdemo_DEPENDENCIES = ../libltdl/libltdl.la foo1.la libfoo2.la +mdemo_DEPENDENCIES = @LIBLTDL@ foo1.la libfoo2.la # Create a statically linked version of mdemo. mdemo_static_SOURCES = $(mdemo_SOURCES) diff --git a/mdemo/configure.in b/mdemo/configure.in index ebada43b6..28aba7b82 100644 --- a/mdemo/configure.in +++ b/mdemo/configure.in @@ -8,6 +8,13 @@ AC_EXEEXT AC_LIBTOOL_DLOPEN AM_PROG_LIBTOOL +dnl AC_LIBLTDL_CONVENIENCE(['${top_builddir}/../libltdl']) +dnl Since the package is flat, we need not use the line above, +dnl and not having macros in LIBLTDL allows us to build LIBLTDL +dnl on demand even with broken makes +AC_LIBLTDL_CONVENIENCE(../libltdl) +AC_SUBST(LIBLTDL) + if ${CONFIG_SHELL} ./libtool --features | grep "enable static" >/dev/null; then STATIC=-static else