]> 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>
Sat, 27 Oct 2001 23:52:57 +0000 (23:52 +0000)
committerGary V. Vaughan <gary@gnu.org>
Sat, 27 Oct 2001 23:52:57 +0000 (23:52 +0000)
option to configure, but to find an appropriate ltdl library and
append the right options to link it.

ChangeLog
ltdl.m4

index 0dca01096585207d7229c9728f1f12d61043836e..f4787a609f6d6e1e28ee04c2ad20ba9ac9aa6b55 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-04  Albert Chin-A-Young  <china@thewrittenword.com>
 
        * libltdl/ltdl.c: Match function return type with prototype
diff --git a/ltdl.m4 b/ltdl.m4
index 229bede154a00b88e9fae8c75d645b984ec1d74b..3994c3389204421315169008ffce5807c97bf039 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 2 AC_LIB_LTDL
+# serial 5 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
 # -----------