blob: 7deb5d817f765ec171e2abb05454f26c66896ac2 [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)
Lennart Poetteringce36dd02003-10-20 21:53:46 +000023AC_INIT([libdaemon], [0.3], [mzqnrzba (at) 0pointer (dot) de])
Lennart Poetteringe774e8e2003-07-31 14:18:41 +000024AC_CONFIG_SRCDIR([src/dfork.c])
25AC_CONFIG_HEADERS([config.h])
26AM_INIT_AUTOMAKE([foreign -Wall])
Lennart Poetteringe774e8e2003-07-31 14:18:41 +000027
28# Checks for programs.
29AC_PROG_CC
30AC_PROG_CXX
31AC_PROG_LIBTOOL
32
Lennart Poetteringce36dd02003-10-20 21:53:46 +000033AC_SUBST(PACKAGE_URL, [http://0pointer.de/lennart/projects/libdaemon/])
34
Lennart Poetteringe774e8e2003-07-31 14:18:41 +000035# If using GCC specifiy some additional parameters
36if test "x$GCC" = "xyes" ; then
37 CFLAGS="$CFLAGS -pipe -Wall"
38fi
39
Lennart Poetteringce36dd02003-10-20 21:53:46 +000040if type -p stow > /dev/null && test -d /usr/local/stow ; then
41 AC_MSG_NOTICE([*** Found /usr/local/stow: installing to /usr/local/stow/${PACKAGE_NAME}-${PACKAGE_VERSION} ***])
42 AC_PREFIX_DEFAULT([/usr/local/stow/${PACKAGE_NAME}-${PACKAGE_VERSION}])
43fi
Lennart Poetteringe774e8e2003-07-31 14:18:41 +000044
45# Checks for header files.
46AC_HEADER_STDC
47AC_CHECK_HEADERS([fcntl.h limits.h stdlib.h string.h syslog.h unistd.h])
48
49# Checks for typedefs, structures, and compiler characteristics.
50AC_C_CONST
51AC_TYPE_PID_T
52AC_HEADER_TIME
53AC_C_VOLATILE
54
55# Checks for library functions.
56AC_FUNC_FORK
57AC_FUNC_SELECT_ARGTYPES
58AC_FUNC_VPRINTF
59AC_CHECK_FUNCS([select strerror dup2 memset strrchr])
60AC_TYPE_MODE_T
61
62# DOXYGEN documentation generation
63AC_ARG_ENABLE(doxygen,
64 AC_HELP_STRING([--disable-doxygen], [Turn off doxygen usage for documentation generation]),
65[case "${enableval}" in
66 yes) doxygen=yes ;;
67 no) doxygen=no ;;
68 *) AC_MSG_ERROR(bad value ${enableval} for --disable-doxygen) ;;
69esac],[doxygen=yes])
70
71if test x$doxygen = xyes ; then
72 AC_CHECK_PROG(have_doxygen, doxygen, yes, no)
73
74 if test x$have_doxygen = xno ; then
75 AC_MSG_ERROR([*** Sorry, you have to install doxygen or use --disable-doxygen ***])
76 fi
77fi
78
79AM_CONDITIONAL([USE_DOXYGEN], [test "x$doxygen" = xyes])
80
81# LYNX documentation generation
82AC_ARG_ENABLE(lynx,
83 AC_HELP_STRING([--disable-lynx], [Turn off lynx usage for documentation generation]),
84[case "${enableval}" in
85 yes) lynx=yes ;;
86 no) lynx=no ;;
87 *) AC_MSG_ERROR(bad value ${enableval} for --disable-lynx) ;;
88esac],[lynx=yes])
89
90if test x$lynx = xyes ; then
91 AC_CHECK_PROG(have_lynx, lynx, yes, no)
92
93 if test x$have_lynx = xno ; then
94 AC_MSG_ERROR([*** Sorry, you have to install lynx or use --disable-lynx ***])
95 fi
96fi
97
98AM_CONDITIONAL([USE_LYNX], [test "x$lynx" = xyes])
99
100AC_CONFIG_FILES([src/Makefile Makefile doc/Makefile doc/README.html doc/doxygen.conf examples/Makefile libdaemon.spec])
101AC_OUTPUT