Initial build environment.
[whenjobs.git] / configure.ac
1 # whenjobs
2 # Copyright (C) 2012 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([whenjobs],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 dnl Check for basic C environment.
30 AC_PROG_CC_STDC
31 AC_PROG_INSTALL
32 AC_PROG_CPP
33
34 AC_C_PROTOTYPES
35 test "x$U" != "x" && AC_MSG_ERROR([Compiler not ANSI compliant])
36
37 AM_PROG_CC_C_O
38
39 AC_ARG_ENABLE([gcc-warnings],
40     [AS_HELP_STRING([--enable-gcc-warnings],
41                     [turn on lots of GCC warnings (for developers)])],
42     [case $enableval in
43        yes|no) ;;
44        *)      AC_MSG_ERROR([bad value $enableval for gcc-warnings option]) ;;
45      esac
46      gcc_warnings=$enableval],
47     [gcc_warnings=no]
48 )
49
50 if test "$gcc_warnings" = yes; then
51     # XXX With gnulib we can improve this in future.
52     WARN_CFLAGS="-Wall"
53     AC_SUBST([WARN_CFLAGS])
54     WERROR_CFLAGS="-Werror"
55     AC_SUBST([WERROR_CFLAGS])
56 fi
57
58 dnl Check support for 64 bit file offsets.
59 AC_SYS_LARGEFILE
60
61 dnl lex and yacc, or hopefully GNU equivalents.
62 AC_PROG_LEX
63 AC_PROG_YACC
64
65 AC_CONFIG_HEADERS([config.h])
66 AC_CONFIG_FILES([Makefile
67                  daemon/Makefile
68                  tools/Makefile])
69 AC_OUTPUT