]> matita.cs.unibo.it Git - helm.git/blob - helm/helmpot/configure.in
New module helm-mathql.
[helm.git] / helm / helmpot / configure.in
1 dnl Process this file with autoconf to produce a configure script.
2 AC_INIT(main.c)
3
4 HELMPOT_MAJOR_VERSION=0
5 HELMPOT_MINOR_VERSION=1
6 HELMPOT_MICRO_VERSION=0
7 HELMPOT_VERSION=$HELMPOT_MAJOR_VERSION.$HELMPOT_MINOR_VERSION.$HELMPOT_MICRO_VERSION
8 VERSION=$HELMPOT_VERSION
9
10 AC_SUBST(HELMPOT_VERSION)
11
12 AC_ARG_ENABLE(
13         checks,
14         [  --enable-checks[=ARG]   include debugging checks [default=yes]],
15         [
16                 if test $enableval = yes; then
17                         AC_DEFINE(ENABLE_CHECKS)
18                 fi
19         ],
20         AC_DEFINE(ENABLE_CHECKS)
21 )
22
23 dnl Automake configuration
24 AM_CONFIG_HEADER(config.h)
25 AM_INIT_AUTOMAKE(helmpot, $HELMPOT_VERSION)
26
27 dnl Checks for programs.
28 AC_LANG_C
29 AC_PROG_CC
30 AC_ISC_POSIX
31 AC_CHECK_PROG(HAVE_COLORGCC, colorgcc, yes, no)
32
33 dnl Checks for header files.
34 AC_HEADER_STDC
35 AC_CHECK_HEADERS(unistd.h)
36 AC_FUNC_VFORK
37
38 dnl Checks for typedefs, structures, and compiler characteristics.
39 AC_C_CONST
40
41 dnl Check for iconv with const pointer as second argument
42 AC_LANG_C
43
44 dnl Checks for libraries
45 AM_PATH_GTK(1.2.0, gtklib="yes", gtklib="no")
46
47 if test $gtklib = "no"; then
48         AC_MSG_ERROR(GTK is needed in order to use helmpot)
49 fi
50
51 AC_CHECK_PROG(HAVE_GTKMATHVIEW_CONFIG, gtkmathview-config, yes, no)
52 if test $HAVE_GTKMATHVIEW_CONFIG = "no"; then
53         AC_MSG_ERROR(gtkmathview is required)
54 fi
55
56 GTKMATHVIEW_MIN_VERSION=0.3.0
57 AC_MSG_CHECKING(for gtkmathview >= $GTKMATHVIEW_MIN_VERSION)
58 vers=`gtkmathview-config --version | awk -F. '{ printf "%d", ($1 * 1000 + $2) * 1000 + $3;}'`
59 minvers=`echo $GTKMATHVIEW_MIN_VERSION | awk -F. '{ printf "%d", ($1 * 1000 + $2) * 1000 + $3;}'`
60 if test "$vers" -lt "$minvers"; then
61         AC_MSG_RESULT(not found)
62         AC_MSG_ERROR(gtkmathview >= $GTKMATHVIEW_MIN_VERSION is required)
63 else
64         AC_MSG_RESULT(found)
65 fi
66
67 CFLAGS="$CFLAGS `gtkmathview-config --cflags`"
68 CXXFLAGS="$CXXFLAGS `gtkmathview-config --cflags`"
69 LIBS="$LIBS `gtkmathview-config --libs`"
70
71 if test $HAVE_COLORGCC = "yes"; then
72         CC=colorgcc
73         CXX=colorgcc
74 fi
75
76 CFLAGS="$CFLAGS -W -Wall"
77 CXXFLAGS="$CXXFLAGS -W -Wall"
78
79 AC_OUTPUT([
80 Makefile
81 helmpot.spec
82 ])