barvinok 0.41.5
[barvinok.git] / m4 / ax_check_ntl.m4
blobbec51698b7efa460f70a5125f5b94d3f1dc480a0
1 AC_DEFUN([AX_CHECK_NTL], [
2         bv_no_ntl=false
3         SAVE_CPPFLAGS="$CPPFLAGS"
4         SAVE_LDFLAGS="$LDFLAGS"
5         CPPFLAGS="$NTL_CPPFLAGS $CPPFLAGS"
6         LDFLAGS="$NTL_LDFLAGS $LDFLAGS"
7         AC_LANG_PUSH(C++)
8         AC_CHECK_HEADER([NTL/ZZ.h],[],[bv_no_ntl=true])
9         AC_EGREP_CPP(yes, [
10                 #include <NTL/ZZ.h>
11                 #ifdef NTL_GMP_LIP
12                 yes
13                 #endif
14                 ],:,AC_MSG_ERROR(ntl not compiled with gmp support))
16         AC_TRY_COMPILE([
17                 #include <NTL/ZZ.h>
18                 using namespace NTL;
19         ], [], [], [AC_MSG_ERROR(Upgrade NTL or configure with NTL_STD_CXX=on)])
20         AC_LANG_POP
22         AC_CHECK_LIB(ntl, main,[],[bv_no_ntl=true])
23         if test "$bv_no_ntl" = "true"; then
24                 AC_MSG_ERROR(Need ntl)
25         fi
26         CPPFLAGS="$SAVE_CPPFLAGS"
27         LDFLAGS="$SAVE_LDFLAGS"