summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndy Wingo <wingo@pobox.com>2009-08-04 21:16:32 +0200
committerAndy Wingo <wingo@pobox.com>2009-08-04 21:16:32 +0200
commitf4863880f5ef539cb545999c19b6b5c0eec9382d (patch)
tree974ac34e4cb7f0eb05ee0e609340e245441e273e
parent45cc8a38777c9f971b6aae4895311fcc9e15ce3e (diff)
downloadguile-f4863880f5ef539cb545999c19b6b5c0eec9382d.tar.gz
perform gmp/unistring compile checks with AC_LIB_HAVE_LINKFLAGS
* configure.ac: Rework gmp and unistring checks to use AC_LIB_HAVE_LINKFLAGS, so that the compilation checks run with the right -L/-l flags. * libguile/Makefile.am (libguile_la_LIBADD): Adapt to need to add $(LIBGMP) and $(LIBUNISTRING) here. Hopefully this solves http://article.gmane.org/gmane.lisp.guile.bugs/4288.
-rw-r--r--configure.ac23
-rw-r--r--libguile/Makefile.am2
2 files changed, 11 insertions, 14 deletions
diff --git a/configure.ac b/configure.ac
index 53049eb79..dae82954a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -827,22 +827,19 @@ fi
dnl GMP tests
-AC_LIB_LINKFLAGS(gmp)
-AC_CHECK_LIB([gmp], [__gmpz_init], ,
- [AC_MSG_ERROR([GNU MP not found, see README])])
-
-# mpz_import is a macro so we need to include <gmp.h>
-AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <gmp.h>]],
- [[mpz_import (0, 0, 0, 0, 0, 0, 0); ]])],
+AC_LIB_HAVE_LINKFLAGS(gmp,
[],
- [AC_MSG_ERROR([At least GNU MP 4.1 is required, see README])])
+ [#include <gmp.h>],
+ [mpz_import (0, 0, 0, 0, 0, 0, 0);],
+ AC_MSG_ERROR([GNU MP 4.1 or greater not found, see README]))
dnl GNU libunistring tests.
-if test "x$LTLIBUNISTRING" != "x"; then
- LIBS="$LTLIBUNISTRING $LIBS"
-else
- AC_MSG_ERROR([GNU libunistring is required, please install it.])
-fi
+AC_LIB_HAVE_LINKFLAGS(unistring,
+ [],
+ [#include <unistr.h>],
+ [u8_check ("foo", 3)]
+ AC_MSG_ERROR([GNU libunistring not found, see README]))
+
dnl i18n tests
#AC_CHECK_HEADERS([libintl.h])
diff --git a/libguile/Makefile.am b/libguile/Makefile.am
index 8c9c598bf..dfaa65a8f 100644
--- a/libguile/Makefile.am
+++ b/libguile/Makefile.am
@@ -220,7 +220,7 @@ noinst_HEADERS = convert.i.c \
noinst_HEADERS += vm-engine.c vm-i-system.c vm-i-scheme.c vm-i-loader.c
libguile_la_DEPENDENCIES = @LIBLOBJS@
-libguile_la_LIBADD = @LIBLOBJS@ $(gnulib_library)
+libguile_la_LIBADD = @LIBLOBJS@ $(gnulib_library) $(LTLIBGMP) $(LTLIBUNISTRING)
libguile_la_LDFLAGS = @LTLIBINTL@ -version-info @LIBGUILE_INTERFACE_CURRENT@:@LIBGUILE_INTERFACE_REVISION@:@LIBGUILE_INTERFACE_AGE@ -export-dynamic -no-undefined
# These are headers visible as <guile/mumble.h>