-dnl Is the gmp header file new enough? (i.e. >= 3.0)
- AC_CACHE_CHECK([for recent enough gmp.h], cl_cv_new_gmp_h, [
- AC_TRY_CPP([#include <gmp.h>
-#if !defined(__GNU_MP_VERSION) || (__GNU_MP_VERSION < 3)
- #error "ancient gmp.h"
-#endif],
-cl_cv_new_gmp_h="yes", cl_cv_new_gmp_h="no")
-])
-if test "$cl_cv_new_gmp_h" = no; then with_gmp="no"; fi
-if test "$with_gmp" = yes; then
-dnl Does the library match the header file have 3.0 features?
- AC_CACHE_CHECK([for working libgmp], cl_cv_new_libgmp, [
- SAVELIBS=$LIBS
- LIBS="$LIBS -lgmp"
- AC_TRY_LINK([#include <gmp.h>],[mpn_divexact_by3(0,0,0)],
-cl_cv_new_libgmp="yes", cl_cv_new_libgmp="no"; LIBS=$SAVELIBS)
-])
-if test "$cl_cv_new_libgmp" = no; then with_gmp="no"; fi
-fi
+ CL_GMP_H_VERSION
+ if test "$cl_cv_new_gmp_h" = no; then with_gmp="no"; fi
+ if test "$with_gmp" = yes; then
+ CL_GMP_CHECK
+ if test "$cl_cv_new_libgmp" = no; then with_gmp="no"; fi
+ fi