blob: 884d8d050a444871b751fe33c67f0504ca223cbd [file] [log] [blame]
Lennart Poetteringe774e8e2003-07-31 14:18:41 +00001# -*- Autoconf -*-
2# Process this file with autoconf to produce a configure script.
3
4# $Id$
5
6# This file is part of libdaemon.
7#
8# libdaemon is free software; you can redistribute it and/or modify it
9# under the terms of the GNU General Public License as published by
10# the Free Software Foundation; either version 2 of the License, or
11# (at your option) any later version.
12#
13# libdaemon is distributed in the hope that it will be useful, but
14# WITHOUT ANY WARRANTY; without even the implied warranty of
15# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16# General Public License for more details.
17#
18# You should have received a copy of the GNU General Public License
19# along with libdaemon; if not, write to the Free Software Foundation,
20# Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
21
22AC_PREREQ(2.57)
23AC_INIT([libdaemon], [0.3], [mzqnrzba@itaparica.org])
24AC_CONFIG_SRCDIR([src/dfork.c])
25AC_CONFIG_HEADERS([config.h])
26AM_INIT_AUTOMAKE([foreign -Wall])
27AM_MAINTAINER_MODE
28
29# Checks for programs.
30AC_PROG_CC
31AC_PROG_CXX
32AC_PROG_LIBTOOL
33
34# If using GCC specifiy some additional parameters
35if test "x$GCC" = "xyes" ; then
36 CFLAGS="$CFLAGS -pipe -Wall"
37fi
38
39# Checks for libraries.
40
41# Checks for header files.
42AC_HEADER_STDC
43AC_CHECK_HEADERS([fcntl.h limits.h stdlib.h string.h syslog.h unistd.h])
44
45# Checks for typedefs, structures, and compiler characteristics.
46AC_C_CONST
47AC_TYPE_PID_T
48AC_HEADER_TIME
49AC_C_VOLATILE
50
51# Checks for library functions.
52AC_FUNC_FORK
53AC_FUNC_SELECT_ARGTYPES
54AC_FUNC_VPRINTF
55AC_CHECK_FUNCS([select strerror dup2 memset strrchr])
56AC_TYPE_MODE_T
57
58# DOXYGEN documentation generation
59AC_ARG_ENABLE(doxygen,
60 AC_HELP_STRING([--disable-doxygen], [Turn off doxygen usage for documentation generation]),
61[case "${enableval}" in
62 yes) doxygen=yes ;;
63 no) doxygen=no ;;
64 *) AC_MSG_ERROR(bad value ${enableval} for --disable-doxygen) ;;
65esac],[doxygen=yes])
66
67if test x$doxygen = xyes ; then
68 AC_CHECK_PROG(have_doxygen, doxygen, yes, no)
69
70 if test x$have_doxygen = xno ; then
71 AC_MSG_ERROR([*** Sorry, you have to install doxygen or use --disable-doxygen ***])
72 fi
73fi
74
75AM_CONDITIONAL([USE_DOXYGEN], [test "x$doxygen" = xyes])
76
77# LYNX documentation generation
78AC_ARG_ENABLE(lynx,
79 AC_HELP_STRING([--disable-lynx], [Turn off lynx usage for documentation generation]),
80[case "${enableval}" in
81 yes) lynx=yes ;;
82 no) lynx=no ;;
83 *) AC_MSG_ERROR(bad value ${enableval} for --disable-lynx) ;;
84esac],[lynx=yes])
85
86if test x$lynx = xyes ; then
87 AC_CHECK_PROG(have_lynx, lynx, yes, no)
88
89 if test x$have_lynx = xno ; then
90 AC_MSG_ERROR([*** Sorry, you have to install lynx or use --disable-lynx ***])
91 fi
92fi
93
94AM_CONDITIONAL([USE_LYNX], [test "x$lynx" = xyes])
95
96AC_CONFIG_FILES([src/Makefile Makefile doc/Makefile doc/README.html doc/doxygen.conf examples/Makefile libdaemon.spec])
97AC_OUTPUT