]> www.ginac.de Git - ginac.git/blob - acinclude.m4
* Now this four-package split-up is gonna get in. Promised.
[ginac.git] / acinclude.m4
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
4 dnl future trouble.
5 dnl ===========================================================================
6
7 dnl Usage: GINAC_TERMCAP
8 dnl libreadline is based on the termcap functions.
9 dnl Some systems have tgetent(), tgetnum(), tgetstr(), tgetflag(), tputs(),
10 dnl tgoto() in libc, some have it in libtermcap, some have it in libncurses.
11 dnl When both libtermcap and libncurses exist, we prefer the latter, because
12 dnl libtermcap is being phased out.
13 AC_DEFUN(GINAC_TERMCAP,
14 [LIBTERMCAP=
15 AC_CHECK_FUNCS(tgetent)
16 if test "x$ac_cv_func_tgetent" = "xyes"; then
17     :
18 else
19     AC_CHECK_LIB(ncurses, tgetent, LIBTERMCAP="-lncurses")
20     if test -z "$LIBTERMCAP"; then
21         AC_CHECK_LIB(termcap, tgetent, LIBTERMCAP="-ltermcap")
22     fi
23 fi
24 AC_SUBST(LIBTERMCAP)
25 ])
26
27 dnl Usage: GINAC_ERROR(message)
28 dnl This macro displays the warning "message" and sets the flag ginac_error
29 dnl to yes.
30 AC_DEFUN(GINAC_ERROR,[
31 ginac_error_txt="$ginac_error_txt
32 ** $1
33 "
34 ginac_error=yes])
35
36 dnl Usage: GINAC_WARNING(message)
37 dnl This macro displays the warning "message" and sets the flag ginac_warning
38 dnl to yes.
39 AC_DEFUN(GINAC_WARNING,[
40 ginac_warning_txt="$ginac_warning_txt
41 == $1
42 "
43 ginac_warning=yes])
44
45 dnl Usage: GINAC_CHECK_ERRORS
46 dnl (preferably to be put at end of configure.in)
47 dnl This macro displays a warning message if GINAC_ERROR or GINAC_WARNING 
48 dnl has occured previously.
49 AC_DEFUN(GINAC_CHECK_ERRORS,[
50 if test "x${ginac_error}" = "xyes"; then
51     echo "**** The following problems have been detected by configure."
52     echo "**** Please check the messages below before running \"make\"."
53     echo "**** (see the section 'Common Problems' in the INSTALL file)"
54     echo "$ginac_error_txt"
55     if test "x${ginac_warning_txt}" != "x"; then
56         echo "${ginac_warning_txt}"
57     fi
58     echo "deleting cache ${cache_file}"
59     rm -f $cache_file
60     else 
61         if test x$ginac_warning = xyes; then
62             echo "=== The following minor problems have been detected by configure."
63             echo "=== Please check the messages below before running \"make\"."
64             echo "=== (see the section 'Common Problems' in the INSTALL file)"
65             echo "$ginac_warning_txt"
66         fi
67     echo "Configuration of GiNaC $VERSION done. Now type \"make\"."
68 fi])