diff options
author | pelissip <pelissip@280ebfd0-de03-0410-8827-d642c229c3f4> | 2004-09-16 11:12:09 +0000 |
---|---|---|
committer | pelissip <pelissip@280ebfd0-de03-0410-8827-d642c229c3f4> | 2004-09-16 11:12:09 +0000 |
commit | 98603da6d1dbf9978a79a5335b3b1a1f895df03b (patch) | |
tree | eb6a170168cf3011c6aed4acd12778907775e6e7 | |
parent | 13322bf0609c36f2e53ddbcb99738c7072701440 (diff) | |
download | mpfr-98603da6d1dbf9978a79a5335b3b1a1f895df03b.tar.gz |
Add a check if both gmp.h and libgmp.a have the same version.
git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@2971 280ebfd0-de03-0410-8827-d642c229c3f4
-rw-r--r-- | configure.in | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/configure.in b/configure.in index 59f82d266..15e49f1ef 100644 --- a/configure.in +++ b/configure.in @@ -93,8 +93,8 @@ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ AC_MSG_CHECKING(for recent GMP) AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include "gmp.h" -#if (__GNU_MP_VERSION < 4) -# error "min: GMP 4.0.0" +#if (__GNU_MP_VERSION*100+__GNU_MP_VERSION_MINOR*10+__GNU_MP_VERSION_PATCHLEVEL < 412) +# error "min GMP version is 4.1.2" #endif ]], [[]])],[AC_MSG_RESULT(yes)],[AC_MSG_RESULT(no) AC_MSG_ERROR([GMP 4.0.0 min required]) @@ -142,6 +142,26 @@ if test -f confdefs.h; then fi AC_MY_LIBS($with_gmp_lib, gmp) + +dnl Check for corresponding 'gmp.h' and libgmp.a +AC_MSG_CHECKING(if gmp.h version and libgmp version are the same) +AC_TRY_RUN([ +#include <stdio.h> +#include <string.h> +#include "gmp.h" +int main() +{ + char buffer[100]; + sprintf (buffer, "%d.%d.%d", __GNU_MP_VERSION, __GNU_MP_VERSION_MINOR, + __GNU_MP_VERSION_PATCHLEVEL); + return strcmp (buffer, gmp_version); +} +], AC_MSG_RESULT(yes), + [AC_MSG_RESULT(no) + AC_MSG_ERROR(['gmp.h' and 'libgmp' have different versions! you have to properly reinstall GMP.])], + AC_MSG_RESULT([can't test]) +) + AC_SUBST(INCLUDES) AC_SUBST(LDADD) AC_SUBST(LDFLAGS) |