Initial commit.
[todo.git] / configure.ac
1 # todo
2 # Copyright (C) 2016 Red Hat Inc.
3 #
4 # This program is free software; you can redistribute it and/or modify
5 # it under the terms of the GNU General Public License as published by
6 # the Free Software Foundation; either version 2 of the License, or
7 # (at your option) any later version.
8 #
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12 # GNU General Public License for more details.
13 #
14 # You should have received a copy of the GNU General Public License
15 # along with this program; if not, write to the Free Software
16 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
17
18 AC_INIT([todo],[0.1])
19 AM_INIT_AUTOMAKE([foreign])
20
21 AC_SUBST([RPM_RELEASE],[1])
22
23 AC_CONFIG_MACRO_DIR([m4])
24
25 dnl Allow all GNU/Linux functions.
26 dnl autoconf complains unless this is very early in the file.
27 AC_USE_SYSTEM_EXTENSIONS
28
29 AC_PROG_LIBTOOL
30
31 dnl Check for basic C environment.
32 AC_PROG_CC_STDC
33 AC_PROG_INSTALL
34 AC_PROG_CPP
35
36 AC_C_PROTOTYPES
37 test "x$U" != "x" && AC_MSG_ERROR([Compiler not ANSI compliant])
38
39 AM_PROG_CC_C_O
40
41 AC_ARG_ENABLE([gcc-warnings],
42     [AS_HELP_STRING([--enable-gcc-warnings],
43                     [turn on lots of GCC warnings (for developers)])],
44     [case $enableval in
45        yes|no) ;;
46        *)      AC_MSG_ERROR([bad value $enableval for gcc-warnings option]) ;;
47      esac
48      gcc_warnings=$enableval],
49     [gcc_warnings=no]
50 )
51
52 if test "$gcc_warnings" = yes; then
53     # XXX With gnulib we can improve this in future.
54     WARN_CFLAGS="-Wall"
55     AC_SUBST([WARN_CFLAGS])
56     WERROR_CFLAGS="-Werror"
57     AC_SUBST([WERROR_CFLAGS])
58 fi
59
60 dnl Check support for 64 bit file offsets.
61 AC_SYS_LARGEFILE
62
63 dnl OCaml compiler.
64 AC_PROG_OCAML
65 if test "$OCAMLC" = "no"; then
66     AC_MSG_ERROR([You must install the OCaml compiler])
67 fi
68
69 AM_CONDITIONAL([HAVE_OCAMLOPT], [test "x$OCAMLOPT" != "xno"])
70
71 dnl OCaml findlib ("ocamlfind") is required.
72 AC_PROG_FINDLIB
73 if test "x$OCAMLFIND" = "xno"; then
74     AC_MSG_ERROR([You must install OCaml findlib (the ocamlfind command)])
75 fi
76
77 dnl Check for OCaml package Calendar (required).
78 AC_CHECK_OCAML_PKG(calendar)
79 if test "x$OCAML_PKG_calendar" = "xno"; then
80     AC_MSG_ERROR([You must install the 'ocaml-calendar' library])
81 fi
82
83 dnl Check for OCaml package PG'OCaml (required).
84 AC_CHECK_OCAML_PKG(pgocaml)
85 if test "x$OCAML_PKG_pgocaml" = "xno"; then
86     AC_MSG_ERROR([You must install the 'ocaml-pgocaml' library])
87 fi
88
89 dnl Check for POD (for manual pages).
90 AC_CHECK_PROG(POD2MAN,pod2man,pod2man,no)
91 AM_CONDITIONAL([HAVE_POD2MAN],
92                [test "x$POD2MAN" != "xno"])
93
94 AC_CONFIG_HEADERS([config.h])
95 AC_CONFIG_FILES([todo_config.ml
96                  todo.spec
97                  Makefile
98                  META])
99 AC_OUTPUT