barvinok 0.41.8
[barvinok.git] / m4 / ax_check_ntl.m4
blobc22b13a06bd5c86b5330fb2b832bb4379c4c42ff
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_COMPILE_IFELSE([AC_LANG_PROGRAM([[
17                 #include <NTL/ZZ.h>
18                 using namespace NTL;
19         ]], [[]])], [],
20                 [AC_MSG_ERROR(Upgrade NTL or configure with NTL_STD_CXX=on)])
21         AC_LANG_POP
23         AC_CHECK_LIB(ntl, main,[],[bv_no_ntl=true])
24         if test "$bv_no_ntl" = "true"; then
25                 AC_MSG_ERROR(Need ntl)
26         fi
27         CPPFLAGS="$SAVE_CPPFLAGS"
28         LDFLAGS="$SAVE_LDFLAGS"