From caf7775aa546e44761b2e04c7c641523a2fe28f9 Mon Sep 17 00:00:00 2001 From: vlefevre Date: Tue, 3 Nov 2015 11:17:16 +0000 Subject: [configure.ac] C code starting with # (preprocessor directives) must not be indented. git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@9720 280ebfd0-de03-0410-8827-d642c229c3f4 --- configure.ac | 117 ++++++++++++++++++++++++++++++----------------------------- 1 file changed, 60 insertions(+), 57 deletions(-) (limited to 'configure.ac') diff --git a/configure.ac b/configure.ac index 7ca705741..0bf46dad9 100644 --- a/configure.ac +++ b/configure.ac @@ -1,5 +1,8 @@ dnl Process this file with autoconf to produce a configure script. +dnl WARNING! C code starting with # (preprocessor directives) must not +dnl be indented! + AC_COPYRIGHT([ Copyright 1999-2015 Free Software Foundation, Inc. Contributed by the AriC and Caramel projects, INRIA. @@ -529,17 +532,17 @@ dnl In particular fat builds are broken in GMP 4.3.2 and GMP 5.0.0 dnl (at least on 64-bit Core 2 under Linux), dnl see http://gmplib.org/list-archives/gmp-bugs/2011-August/002345.html. if test -z "$enable_mini_gmp" ; then - AC_MSG_CHECKING(for recent GMP) - AC_COMPILE_IFELSE([AC_LANG_SOURCE([[ - #include "gmp.h" - #if (__GNU_MP_VERSION*100+__GNU_MP_VERSION_MINOR*10 < 420) - # error "min GMP version is 4.2.0" - error - #endif - ]])],[AC_MSG_RESULT(yes)],[ - AC_MSG_RESULT(no) - AC_MSG_ERROR([GMP 4.2.0 or newer is required]) - ]) + AC_MSG_CHECKING(for recent GMP) + AC_COMPILE_IFELSE([AC_LANG_SOURCE([[ +#include "gmp.h" +#if (__GNU_MP_VERSION*100+__GNU_MP_VERSION_MINOR*10 < 420) +# error "min GMP version is 4.2.0" +error +#endif + ]])],[AC_MSG_RESULT(yes)],[ + AC_MSG_RESULT(no) + AC_MSG_ERROR([GMP 4.2.0 or newer is required]) +]) fi dnl Check if gmp.h is usable at link time; this may detect errors such as @@ -613,52 +616,52 @@ dnl WARNING! LD_RUN_PATH is not taken into account by the GNU gold ld, dnl e.g. from binutils-gold 2.22-5 under Debian; see dnl https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=660813 if test -z "$enable_mini_gmp" ; then - saved_LD_RUN_PATH="$LD_RUN_PATH" - LD_RUN_PATH="${LD_RUN_PATH:+$LD_RUN_PATH$PATH_SEPARATOR}$gmp_lib_path" - export LD_RUN_PATH - AC_RUN_IFELSE([AC_LANG_PROGRAM([[ - #include - #include - #include "gmp.h" - ]], [[ - char buffer[100]; - sprintf (buffer, "%d.%d.%d", __GNU_MP_VERSION, __GNU_MP_VERSION_MINOR, - __GNU_MP_VERSION_PATCHLEVEL); - printf ("(%s/%s) ", buffer, gmp_version); - fflush (stdout); - /* Also put information in config.log (stderr) */ - fprintf (stderr, "gmp.h: %s / libgmp: %s\n", buffer, gmp_version); - if (strcmp (buffer, gmp_version) == 0) - return 0; - if (__GNU_MP_VERSION_PATCHLEVEL != 0) - return 1; - sprintf (buffer, "%d.%d", __GNU_MP_VERSION, __GNU_MP_VERSION_MINOR); - return (strcmp (buffer, gmp_version) != 0) ? 1 : 0; - ]])], - [AC_MSG_RESULT(yes) - MPFR_CHECK_GMP - MPFR_CHECK_DBL2INT_BUG - MPFR_CHECK_PRINTF_SPEC], - [AC_MSG_RESULT(no) - AC_MSG_WARN([==========================================================]) - AC_MSG_WARN(['gmp.h' and 'libgmp' seem to have different versions or]) - AC_MSG_WARN([we cannot run a program linked with GMP (if you cannot]) - AC_MSG_WARN([see the version numbers above). A cause may be different]) - AC_MSG_WARN([GMP versions with different ABI's or the use of --with-gmp]) - AC_MSG_WARN([or --with-gmp-include with a system include directory]) - AC_MSG_WARN([(such as /usr/include or /usr/local/include).]) - AC_MSG_WARN([However since we can't use 'libtool' inside the configure,]) - AC_MSG_WARN([we can't be sure. See 'config.log' for details.]) - AC_MSG_WARN([CC="$CC"]) - AC_MSG_WARN([CFLAGS="$CFLAGS"]) - AC_MSG_WARN([CPPFLAGS="$CPPFLAGS"]) - AC_MSG_WARN([LDFLAGS="$LDFLAGS"]) - AC_MSG_WARN([LIBS="$LIBS"]) - AC_MSG_WARN([Temporary LD_RUN_PATH was "$LD_RUN_PATH".]) - AC_MSG_WARN([==========================================================]) - ],AC_MSG_RESULT([can not test]) - ) - LD_RUN_PATH="$saved_LD_RUN_PATH" + saved_LD_RUN_PATH="$LD_RUN_PATH" + LD_RUN_PATH="${LD_RUN_PATH:+$LD_RUN_PATH$PATH_SEPARATOR}$gmp_lib_path" + export LD_RUN_PATH + AC_RUN_IFELSE([AC_LANG_PROGRAM([[ +#include +#include +#include "gmp.h" + ]], [[ + char buffer[100]; + sprintf (buffer, "%d.%d.%d", __GNU_MP_VERSION, __GNU_MP_VERSION_MINOR, + __GNU_MP_VERSION_PATCHLEVEL); + printf ("(%s/%s) ", buffer, gmp_version); + fflush (stdout); + /* Also put information in config.log (stderr) */ + fprintf (stderr, "gmp.h: %s / libgmp: %s\n", buffer, gmp_version); + if (strcmp (buffer, gmp_version) == 0) + return 0; + if (__GNU_MP_VERSION_PATCHLEVEL != 0) + return 1; + sprintf (buffer, "%d.%d", __GNU_MP_VERSION, __GNU_MP_VERSION_MINOR); + return (strcmp (buffer, gmp_version) != 0) ? 1 : 0; + ]])], + [AC_MSG_RESULT(yes) + MPFR_CHECK_GMP + MPFR_CHECK_DBL2INT_BUG + MPFR_CHECK_PRINTF_SPEC], + [AC_MSG_RESULT(no) + AC_MSG_WARN([==========================================================]) + AC_MSG_WARN(['gmp.h' and 'libgmp' seem to have different versions or]) + AC_MSG_WARN([we cannot run a program linked with GMP (if you cannot]) + AC_MSG_WARN([see the version numbers above). A cause may be different]) + AC_MSG_WARN([GMP versions with different ABI's or the use of --with-gmp]) + AC_MSG_WARN([or --with-gmp-include with a system include directory]) + AC_MSG_WARN([(such as /usr/include or /usr/local/include).]) + AC_MSG_WARN([However since we can't use 'libtool' inside the configure,]) + AC_MSG_WARN([we can't be sure. See 'config.log' for details.]) + AC_MSG_WARN([CC="$CC"]) + AC_MSG_WARN([CFLAGS="$CFLAGS"]) + AC_MSG_WARN([CPPFLAGS="$CPPFLAGS"]) + AC_MSG_WARN([LDFLAGS="$LDFLAGS"]) + AC_MSG_WARN([LIBS="$LIBS"]) + AC_MSG_WARN([Temporary LD_RUN_PATH was "$LD_RUN_PATH".]) + AC_MSG_WARN([==========================================================]) + ],AC_MSG_RESULT([can not test]) + ) + LD_RUN_PATH="$saved_LD_RUN_PATH" fi dnl __gmpn_sbpi1_divappr_q is an internal GMP symbol; thus its behavior -- cgit v1.2.1