Use `have-lib' when checking for libltdl.
authorLudovic Courtès <ludo@gnu.org>
Mon, 6 Sep 2010 20:49:24 +0000 (22:49 +0200)
committerLudovic Courtès <ludo@gnu.org>
Mon, 6 Sep 2010 20:49:24 +0000 (22:49 +0200)
Suggested by primus <rprimus@gmail.com>.

* configure.ac: Use `AC_LIB_HAVE_LINKFLAGS' when checking for libltdl.

* libguile/Makefile.am (libguile_@GUILE_EFFECTIVE_VERSION@_la_LIBADD):
  Add $(LTLIBLTDL).

* README: Update to make it clear that libgc and libffi don't have a
  `--with-XXX-prefix' option.

README
configure.ac
libguile/Makefile.am

diff --git a/README b/README
index bc9f5df..256e954 100644 (file)
--- a/README
+++ b/README
@@ -35,11 +35,13 @@ Guile depends on the following external libraries.
 - libunistring
 - libgc
 - libffi
-It will also use the libreadline library if it is available.  For each
-of these there is a corresponding --with-XXX-prefix option that you
-can use when invoking ./configure, if you have these libraries
-installed in a location other than the standard places (/usr and
-/usr/local).
+It will also use the libreadline library if it is available.
+
+There is a corresponding `--with-XXX-prefix' option for each of these
+libraries (except for libgc and libffi which use `pkg-config', see
+below) that you can use when invoking ./configure, if you have these
+libraries installed in a location other than the standard places (/usr
+and /usr/local).
 
 These options are provided by the Gnulib `havelib' module, and details
 of how they work are documented in `Searching for Libraries' in the
index 18691c2..c9fc489 100644 (file)
@@ -74,10 +74,13 @@ AM_PROG_CC_C_O
 
 AC_LIBTOOL_DLOPEN
 AC_PROG_LIBTOOL
-AC_CHECK_LIB([ltdl], [lt_dlinit], ,
-  [AC_MSG_ERROR([libltdl not found.  See README.])])
-AC_CHECK_HEADER([ltdl.h], [],
-  [AC_MSG_ERROR([<ltdl.h> not found.  See README.])])
+
+dnl Check for libltdl.
+AC_LIB_HAVE_LINKFLAGS([ltdl], [], [#include <ltdl.h>],
+  [lt_dlopenext ("foo");])
+if text "x$HAVE_LIBLTDL" != "xyes"; then
+  AC_MSG_ERROR([GNU libltdl (Libtool) not found, see README.])
+fi
 
 AC_CHECK_PROG(have_makeinfo, makeinfo, yes, no)
 AM_CONDITIONAL(HAVE_MAKEINFO, test "$have_makeinfo" = yes)
index d2f349b..b8c4e6b 100644 (file)
@@ -445,10 +445,10 @@ noinst_HEADERS = conv-integer.i.c conv-uinteger.i.c               \
 noinst_HEADERS += vm-engine.c vm-i-system.c vm-i-scheme.c vm-i-loader.c
 
 libguile_@GUILE_EFFECTIVE_VERSION@_la_DEPENDENCIES = @LIBLOBJS@
-libguile_@GUILE_EFFECTIVE_VERSION@_la_LIBADD =                         \
-  @LIBLOBJS@ $(gnulib_library) $(LTLIBGMP)     \
+libguile_@GUILE_EFFECTIVE_VERSION@_la_LIBADD =         \
+  @LIBLOBJS@ $(gnulib_library) $(LTLIBGMP) $(LTLIBLTDL)        \
   $(LTLIBUNISTRING) $(LTLIBICONV) $(LTLIBINTL)
-libguile_@GUILE_EFFECTIVE_VERSION@_la_LDFLAGS =                                                                                        \
+libguile_@GUILE_EFFECTIVE_VERSION@_la_LDFLAGS =                                                                \
   @LTLIBINTL@ $(LIBFFI_LIBS) $(INET_NTOP_LIB) $(INET_PTON_LIB)                                         \
   $(GETADDRINFO_LIB) $(HOSTENT_LIB) $(SERVENT_LIB)                                                     \
   -version-info @LIBGUILE_INTERFACE_CURRENT@:@LIBGUILE_INTERFACE_REVISION@:@LIBGUILE_INTERFACE_AGE@    \