blob: 0a73646d0a44f74531cb2c10d639b1dcbb5d6140 [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
Lennart Poettering74229092004-01-11 00:43:42 +000022AC_PREREQ(2.59)
Lennart Poetteringfff36c82004-02-08 20:17:39 +000023AC_INIT([libdaemon],[0.5],[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
Lennart Poetteringce36dd02003-10-20 21:53:46 +000028AC_SUBST(PACKAGE_URL, [http://0pointer.de/lennart/projects/libdaemon/])
29
Lennart Poetteringce36dd02003-10-20 21:53:46 +000030if type -p stow > /dev/null && test -d /usr/local/stow ; then
Lennart Poetteringf4aa9a82003-12-11 18:56:42 +000031 AC_MSG_NOTICE([*** Found /usr/local/stow: default install prefix set to /usr/local/stow/${PACKAGE_NAME}-${PACKAGE_VERSION} ***])
32 ac_default_prefix="/usr/local/stow/${PACKAGE_NAME}-${PACKAGE_VERSION}"
Lennart Poetteringce36dd02003-10-20 21:53:46 +000033fi
Lennart Poetteringe774e8e2003-07-31 14:18:41 +000034
Lennart Poettering8f34edf2004-01-10 18:45:49 +000035# Checks for programs.
36AC_PROG_CC
37AC_PROG_CXX
38AC_PROG_MAKE_SET
Lennart Poettering74229092004-01-11 00:43:42 +000039AC_PROG_LIBTOOL()
Lennart Poettering8f34edf2004-01-10 18:45:49 +000040
41# If using GCC specifiy some additional parameters
42if test "x$GCC" = "xyes" ; then
43 CFLAGS="$CFLAGS -pipe -Wall"
44fi
45
Lennart Poetteringe774e8e2003-07-31 14:18:41 +000046# Checks for header files.
47AC_HEADER_STDC
48AC_CHECK_HEADERS([fcntl.h limits.h stdlib.h string.h syslog.h unistd.h])
Lennart Poettering8f34edf2004-01-10 18:45:49 +000049AC_HEADER_SYS_WAIT
Lennart Poetteringe774e8e2003-07-31 14:18:41 +000050
51# Checks for typedefs, structures, and compiler characteristics.
52AC_C_CONST
53AC_TYPE_PID_T
54AC_HEADER_TIME
55AC_C_VOLATILE
56
57# Checks for library functions.
58AC_FUNC_FORK
59AC_FUNC_SELECT_ARGTYPES
60AC_FUNC_VPRINTF
61AC_CHECK_FUNCS([select strerror dup2 memset strrchr])
62AC_TYPE_MODE_T
63
64# DOXYGEN documentation generation
65AC_ARG_ENABLE(doxygen,
Lennart Poettering22aea4c2004-01-10 20:26:36 +000066 AS_HELP_STRING(--disable-doxygen,Turn off doxygen usage for documentation generation),
Lennart Poetteringe774e8e2003-07-31 14:18:41 +000067[case "${enableval}" in
68 yes) doxygen=yes ;;
69 no) doxygen=no ;;
70 *) AC_MSG_ERROR(bad value ${enableval} for --disable-doxygen) ;;
71esac],[doxygen=yes])
72
73if test x$doxygen = xyes ; then
74 AC_CHECK_PROG(have_doxygen, doxygen, yes, no)
75
76 if test x$have_doxygen = xno ; then
77 AC_MSG_ERROR([*** Sorry, you have to install doxygen or use --disable-doxygen ***])
78 fi
79fi
80
81AM_CONDITIONAL([USE_DOXYGEN], [test "x$doxygen" = xyes])
82
83# LYNX documentation generation
84AC_ARG_ENABLE(lynx,
Lennart Poettering22aea4c2004-01-10 20:26:36 +000085 AS_HELP_STRING(--disable-lynx,Turn off lynx usage for documentation generation),
Lennart Poetteringe774e8e2003-07-31 14:18:41 +000086[case "${enableval}" in
87 yes) lynx=yes ;;
88 no) lynx=no ;;
89 *) AC_MSG_ERROR(bad value ${enableval} for --disable-lynx) ;;
90esac],[lynx=yes])
91
92if test x$lynx = xyes ; then
93 AC_CHECK_PROG(have_lynx, lynx, yes, no)
94
95 if test x$have_lynx = xno ; then
96 AC_MSG_ERROR([*** Sorry, you have to install lynx or use --disable-lynx ***])
97 fi
98fi
99
100AM_CONDITIONAL([USE_LYNX], [test "x$lynx" = xyes])
101
Lennart Poetteringf4aa9a82003-12-11 18:56:42 +0000102AC_CONFIG_FILES([src/Makefile Makefile doc/Makefile doc/README.html doc/doxygen.conf examples/Makefile libdaemon.spec libdaemon.pc])
Lennart Poetteringe774e8e2003-07-31 14:18:41 +0000103AC_OUTPUT