Combine generator subdirectories into one.
[wrappi.git] / configure.ac
1 # wrappi
2 # Copyright (C) 2011 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([wrappi],0.0.1)
19 AM_INIT_AUTOMAKE([foreign])
20
21 AC_CONFIG_MACRO_DIR([m4])
22
23 dnl Allow all GNU/Linux functions.
24 dnl autoconf complains unless this is very early in the file.
25 AC_USE_SYSTEM_EXTENSIONS
26
27 AC_PROG_LIBTOOL
28
29 AC_PROG_SED
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 Check for gperf.
64 AC_CHECK_PROG([GPERF],[gperf],[gperf],[no])
65 test "x$GPERF" = "xno" &&
66      AC_MSG_ERROR([gperf must be installed])
67
68 dnl Check for OCaml compiler.
69 AC_PROG_OCAML
70 if test "$OCAMLC" = "no"; then
71     AC_MSG_ERROR([You must install the OCaml compiler])
72 fi
73
74 dnl Camlp4 is required.
75 AC_PROG_CAMLP4
76 if test "$CAMLP4" = "no"; then
77     AC_MSG_ERROR([You must install camlp4 (the OCaml macro preprocessor)])
78 fi
79
80 dnl OCaml findlib ("ocamlfind") is required.
81 AC_PROG_FINDLIB
82 if test "$OCAMLFIND" = "no"; then
83     AC_MSG_ERROR([You must install OCaml findlib (the ocamlfind command)])
84 fi
85
86 dnl Library versioning.
87 LIB_MINOR=`cat $srcdir/lib/LIB_MINOR`
88 AC_SUBST(LIB_MINOR)
89
90 AC_CONFIG_HEADERS([config.h])
91 AC_CONFIG_FILES([Makefile
92                  APIs/Makefile
93                  daemon/Makefile
94                  examples/Makefile
95                  generator/Makefile
96                  generator/config.ml
97                  lib/Makefile])
98 AC_OUTPUT