From e830175dc7e464f12326886bfdde4bd2638151e3 Mon Sep 17 00:00:00 2001 From: "Gary V. Vaughan" Date: Sun, 28 Oct 2001 00:00:00 +0000 Subject: [PATCH] * 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. --- ChangeLog | 6 ++++++ ltdl.m4 | 50 +++++++++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 55 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 1706081b..c96bacac 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2001-10-27 Gary V. Vaughan + + * 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 *libtool.m4 (AC_LIBTOOL_PROG_LD_SHLIBS): Remove a stray ' quote. diff --git a/ltdl.m4 b/ltdl.m4 index 06f9f160..d24745fb 100644 --- a/ltdl.m4 +++ b/ltdl.m4 @@ -20,7 +20,55 @@ ## 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 # -----------