]> git.ipfire.org Git - thirdparty/libtool.git/commitdiff
* libtool.m4 (AC_LIBLTDL_INSTALLABLE, AC_LIBLTDL_CONVENIENCE):
authorAlexandre Oliva <oliva@dcc.unicamp.br>
Tue, 9 Mar 1999 22:02:09 +0000 (22:02 +0000)
committerAlexandre Oliva <aoliva@redhat.com>
Tue, 9 Mar 1999 22:02:09 +0000 (22:02 +0000)
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@

ChangeLog
NEWS
libltdl/Makefile.am
libltdl/configure.in
libtool.m4
mdemo/Makefile.am
mdemo/configure.in

index c457538f24795d8f8cadefc4104c817276fa6126..247938b2b7174b56b0fffc5ec653174e4b7202bd 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+1999-03-09  Alexandre Oliva  <oliva@dcc.unicamp.br>
+
+       * 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 <gvaughan@oranda.demon.co.uk>
 
        * NEWS: updated.
diff --git a/NEWS b/NEWS
index e625e20f021d4bd4e5af9eee3dcc6a62cab4d623..23311b0d05c8a1c9589979614a2cd94224eaa40d 100644 (file)
--- 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.
index d854f7eb251d041230df961d6a0bc71cd89238bf..0f3fc19e0fa857118c41ba482e27739c7eabbee3 100644 (file)
@@ -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)
index 3785958af628b75f9fc9f1726a61b9da85a7b9f9..93afeedf2fe279baf0345d6ae23233a77c711cdf 100644 (file)
@@ -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
index 04697c48d057bd80073f8617c3642e4cfac041e6..02442355a36a132af5d00e564dee7fb6be225f7e 100644 (file)
@@ -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
index e2b62f446ac15782e8b5c8d8eb915018aa00ea93..426cd88aaad852fe9473690d1d569c693e649f08 100644 (file)
@@ -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)
index ebada43b61738db27ba98ce2d47fa305328745a1..28aba7b8283af9b7d2eff6e69651ca87e68123d3 100644 (file)
@@ -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