1 dnl ===========================================================================
2 dnl Additional macros used to configure GiNaC. We don't start our own
3 dnl additions' names with AC_ but with GINAC_ in order to steer clear of
5 dnl ===========================================================================
7 dnl Generally, it is a bad idea to put specialized header files for a library
8 dnl into a generic directory like /usr/local/include/. Instead, one should put
9 dnl them into a subdirectory. GiNaC does it, NTL does it. Unfortunately, CLN
10 dnl doesn't do so but some people choose to do it by hand. In these cases we
11 dnl need to #include <cln/cln.h>, otherwise #include <cln.h>. This macro
12 dnl tries to be clever and find out the correct way by defining the variable
13 dnl HAVE_CLN_CLN_H in config.h:
14 AC_DEFUN(GINAC_CHECK_CLN_H,
16 AC_CHECK_HEADERS(cln/cln.h, ,
17 AC_CHECK_HEADERS(cln.h, ,
18 AC_MSG_ERROR([cannot find header for Bruno Haible's CLN]);
23 dnl This macro is needed because the generic AC_CHECK_LIB doesn't work because
24 dnl C++ is more strongly typed than C. Therefore we need to work with the
25 dnl more fundamental AC_TRY_LINK instead.
26 AC_DEFUN(GINAC_CHECK_LIBCLN,
28 AC_MSG_CHECKING([for doublefactorial in -lcln])
30 AC_CACHE_VAL(ginac_cv_lib_cln_link,
32 case "${ac_cv_header_cln_cln_h}" in
34 AC_TRY_LINK([#include <cln/cln.h>],
35 [doublefactorial(2);],
36 ginac_cv_lib_cln_link="-lcln",
37 ginac_cv_lib_cln_link="fail")
40 AC_TRY_LINK([#include <cln.h>],
41 [doublefactorial(2);],
42 ginac_cv_lib_cln_link="-lcln",
43 ginac_cv_lib_cln_link="fail")
47 case "${ginac_cv_lib_cln_link}" in
50 LIBS="${ginac_cv_lib_cln_link} ${saved_LIBS}"
57 AC_MSG_ERROR([You either need to set \$LDFLAGS or update CLN])
59 dnl should never ever get here:
62 AC_MSG_WARN([you found a bug in the configure script!])