>From 8976eaf3417193053a57e815ded557a0877a61ee Mon Sep 17 00:00:00 2001 From: Andy Wingo Date: Tue, 4 Aug 2009 21:16:32 +0200 Subject: [PATCH] perform gmp compile check with AC_LIB_HAVE_LINKFLAGS * configure.ac: Rework gmp check 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) here. (Copied from commit f486388 and tweaked for branch_release-1-8) --- configure.in | 11 ++++------- libguile/Makefile.am | 2 +- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/configure.in b/configure.in index 217ac83..206d76e 100644 --- a/configure.in +++ b/configure.in @@ -864,14 +864,11 @@ fi dnl GMP tests -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 i18n tests #AC_CHECK_HEADERS([libintl.h]) diff --git a/libguile/Makefile.am b/libguile/Makefile.am index 1299cf2..c836f07 100644 --- a/libguile/Makefile.am +++ b/libguile/Makefile.am @@ -180,7 +180,7 @@ noinst_HEADERS = convert.i.c \ private-gc.h libguile_la_DEPENDENCIES = @LIBLOBJS@ -libguile_la_LIBADD = @LIBLOBJS@ +libguile_la_LIBADD = @LIBLOBJS@ $(LTLIBGMP) libguile_la_LDFLAGS = @LTLIBINTL@ -version-info @LIBGUILE_INTERFACE_CURRENT@:@LIBGUILE_INTERFACE_REVISION@:@LIBGUILE_INTERFACE_AGE@ -export-dynamic -no-undefined # These are headers visible as -- 1.5.6.5