summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac35
1 files changed, 32 insertions, 3 deletions
diff --git a/configure.ac b/configure.ac
index 5035d7e..7b220ac 100644
--- a/configure.ac
+++ b/configure.ac
@@ -56,7 +56,7 @@ AC_TYPE_SIGNAL
AC_FUNC_STRFTIME
AC_FUNC_VPRINTF
AC_FUNC_STAT
-AC_CHECK_FUNCS([__argz_count __argz_next __argz_stringify getcwd gethostbyname memmove mempcpy memset munmap nl_langinfo regcomp setlocale socket stpcpy strcasecmp strchr strcspn strdup strerror strrchr strstr strtoul pipe sleep fcntl vsnprintf gettimeofday])
+AC_CHECK_FUNCS([__argz_count __argz_next __argz_stringify getcwd gethostbyname memmove mempcpy memset munmap nl_langinfo regcomp setlocale socket stpcpy strcasecmp strchr strcspn strdup strerror strrchr strstr strtoul pipe sleep fcntl vsnprintf gettimeofday asprintf vasprintf])
AC_SEARCH_LIBS(socket, socket)
AC_SEARCH_LIBS(gethostbyname, nsl)
@@ -80,8 +80,6 @@ else
AC_MSG_ERROR([no zlib found in the system.])
fi
-AC_DEFINE([HOOK_STDS], 1, [Hook the standard input/outputs])
-
if test x$ac_cv_wd_gzwrite != xyes ; then
AC_MSG_WARN([You have a broken zconf.h.]
[You should patch this using]
@@ -89,6 +87,37 @@ if test x$ac_cv_wd_gzwrite != xyes ; then
[Enabling workaround.])
fi
+GMP_LIBS="-lm"
+if test "$with_gmp" != "no"; then
+ AC_ARG_WITH(gmp-prefix, [ --with-gmp-prefix=DIR path to GMP],
+ [if test "$withval" != "no"; then
+ CPPFLAGS="${CPPFLAGS} -I$withval/include"
+ LDFLAGS="${LDFLAGS} -L$withval/lib"
+ fi],
+ dnl debian brain-damage
+ [if test -d /usr/include/gmp2; then
+ CPPFLAGS="${CPPFLAGS} -I/usr/include/gmp2"
+ fi])
+
+ found_gmp=no
+ AC_CHECK_HEADER(gmp.h,
+ [AC_CHECK_LIB(gmp, mpz_init,
+ [GMP_LIBS="-lgmp -lm"; found_gmp=yes],
+ [AC_CHECK_LIB(gmp, __gmpz_init,
+ [GMP_LIBS="-lgmp -lm"; found_gmp=yes])])])
+
+ if test "$found_gmp" = "yes"; then
+ AC_DEFINE([HAVE_GMP], 1, [Have the GMP library])
+ LIBS="$LIBS $GMP_LIBS"
+ AC_CHECK_FUNC(__gmp_randinit, AC_DEFINE([HAVE_GMP_RANDINIT], 1, [Have the RandInit function]))
+ elif test "$with_gmp" != "no"; then
+ AC_MSG_ERROR([Can't find GMP (--without-gmp for cut-down non-GMP build)])
+ fi
+fi
+AC_SUBST(GMP_LIBS)
+
+AC_DEFINE([HOOK_STDS], 1, [Hook the standard input/outputs])
+
AC_CHECK_FUNCS(gethostbyname)
AC_CHECK_FUNCS(regcomp)
AC_CHECK_FUNCS(socket)