]> git.ipfire.org Git - thirdparty/libtool.git/commitdiff
* ltdl.m4 (AC_WITH_LTDL): New macro to add `--with-included-ltdl'
authorGary V. Vaughan <gary@gnu.org>
Sun, 28 Oct 2001 00:00:00 +0000 (00:00 +0000)
committerGary V. Vaughan <gary@gnu.org>
Sun, 28 Oct 2001 00:00:00 +0000 (00:00 +0000)
option to configure, but to find an appropriate ltdl library and
append the right options to link it.

ChangeLog
ltdl.m4

index 1706081bbfbb300eb97fd0556db7ae736caa2062..c96bacac7d45a74d1fe9a9a8e882e2443d208aeb 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2001-10-27  Gary V. Vaughan  <gary@gnu.org>
+
+       * ltdl.m4 (AC_WITH_LTDL): New macro to add `--with-included-ltdl'
+       option to configure, but to find an appropriate ltdl library and
+       append the right options to link it.
+
 2001-10-24 Kevin Ryde  <user42@zip.com.au>
 
        *libtool.m4 (AC_LIBTOOL_PROG_LD_SHLIBS): Remove a stray ' quote.
diff --git a/ltdl.m4 b/ltdl.m4
index 06f9f16024c409e25521dc2e7373cd4a7b308231..d24745fbddef9ed284bfbae6aac702d5e6c7f0c8 100644 (file)
--- a/ltdl.m4
+++ b/ltdl.m4
 ## configuration script generated by Autoconf, you may include it under
 ## the same distribution terms that you use for the rest of that program.
 
-# serial 4 AC_LIB_LTDL
+# serial 6 AC_LIB_LTDL
+
+# AC_WITH_LTDL
+# ------------
+# Clients of libltdl can use this macro to allow the installer to
+# choose between a shipped copy of the ltdl sources or a preinstalled
+# version of the library.
+AC_DEFUN([AC_WITH_LTDL],
+[AC_REQUIRE([AC_LIB_LTDL])
+AC_SUBST([LIBLTDL])
+AC_SUBST([INCLTDL])
+
+# Unless the user asks us to check, assume no installed ltdl exists.
+use_installed_libltdl=no
+
+AC_ARG_WITH([included_ltdl],
+    [  --with-included-ltdl    use the GNU ltdl sources included here])
+
+if test "x$with_included_ltdl" != xyes; then
+  # We are not being forced to use the included libltdl sources, so
+  # decide whether there is a useful installed version we can use.
+  AC_CHECK_HEADER([ltdl.h],
+      [AC_CHECK_LIB([ltdl], [lt_dlcaller_register],
+          [with_included_ltdl=no],
+          [with_included_ltdl=yes])
+  ])
+fi
+
+if test "x$enable_ltdl_install" != xyes; then
+  # If the user did not specify an installable libltdl, then default
+  # to a convenience lib.
+  AC_LIBLTDL_CONVENIENCE
+fi
+
+if test "x$with_included_ltdl" = xno; then
+  # If the included ltdl is not to be used. then Use the
+  # preinstalled libltdl we found.
+  AC_DEFINE([HAVE_LTDL], 1,
+    [Define this if a modern libltdl is already installed])
+  LIBLTDL=-lltdl
+fi
+
+# Report our decision...
+AC_MSG_CHECKING([whether to use included libltdl])
+AC_MSG_RESULT([$with_included_ltdl])
+
+AC_CONFIG_SUBDIRS([libltdl])
+])# AC_WITH_LTDL
+
 
 # AC_LIB_LTDL
 # -----------