From f4863880f5ef539cb545999c19b6b5c0eec9382d Mon Sep 17 00:00:00 2001 From: Andy Wingo Date: Tue, 4 Aug 2009 21:16:32 +0200 Subject: [PATCH] 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. --- configure.ac | 23 ++++++++++------------- libguile/Makefile.am | 2 +- 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 -AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include ]], - [[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 ], + [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 ], + [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