1# -*- Autoconf -*-
2# Process this file with autoconf to produce a configure script.
3
4# This file is part of libdaemon.
5#
6# Copyright 2003-2008 Lennart Poettering
7#
8# Permission is hereby granted, free of charge, to any person obtaining a copy
9# of this software and associated documentation files (the "Software"), to deal
10# in the Software without restriction, including without limitation the rights
11# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12# copies of the Software, and to permit persons to whom the Software is
13# furnished to do so, subject to the following conditions:
14#
15# The above copyright notice and this permission notice shall be included in
16# all copies or substantial portions of the Software.
17#
18# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
24# SOFTWARE.
25
26AC_PREREQ(2.63)
27
28AC_INIT([libdaemon],[0.14],[mzqnrzba (at) 0pointer (dot) de])
29AC_CONFIG_SRCDIR([libdaemon/dfork.c])
30AC_CONFIG_HEADERS([config.h])
31AC_CONFIG_MACRO_DIR([m4])
32
33AM_INIT_AUTOMAKE([foreign 1.10 -Wall])
34
35AC_SUBST(PACKAGE_URL, [http://0pointer.de/lennart/projects/libdaemon/])
36
37AC_SUBST(LIBDAEMON_VERSION_INFO, [5:0:5])
38
39if type -p stow > /dev/null && test -d /usr/local/stow ; then
40   AC_MSG_NOTICE([*** Found /usr/local/stow: default install prefix set to /usr/local/stow/${PACKAGE_NAME}-${PACKAGE_VERSION} ***])
41   ac_default_prefix="/usr/local/stow/${PACKAGE_NAME}-${PACKAGE_VERSION}"
42fi
43
44m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
45
46# Checks for programs.
47AC_PROG_CC
48AC_PROG_CC_C99 dnl This enable gnu99 if present
49AM_PROG_CC_C_O
50
51AC_USE_SYSTEM_EXTENSIONS
52
53AC_PROG_INSTALL
54AC_PROG_LN_S
55AC_PROG_MAKE_SET
56AC_PROG_LIBTOOL
57
58CC_CHECK_CFLAGS_APPEND([-pipe -Wall -W -Wextra -pedantic -Wformat -Wold-style-definition -Wdeclaration-after-statement -Wfloat-equal -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wredundant-decls -Wmissing-noreturn -Wshadow -Wendif-labels -Wpointer-arith -Wbad-function-cast -Wcast-qual -Wcast-align -Wwrite-strings -Winline -Wno-unused-parameter -Wstrict-aliasing])
59
60# Checks for header files.
61AC_HEADER_ASSERT
62AC_HEADER_STDC
63AC_CHECK_HEADERS([fcntl.h limits.h stdlib.h string.h syslog.h unistd.h sys/ioctl.h sys/time.h])
64AC_HEADER_SYS_WAIT
65
66# Checks for typedefs, structures, and compiler characteristics.
67AC_C_CONST
68AC_TYPE_PID_T
69AC_HEADER_TIME
70AC_C_VOLATILE
71
72# Checks for library functions.
73AC_FUNC_FORK
74AC_FUNC_SELECT_ARGTYPES
75AC_FUNC_VPRINTF
76AC_CHECK_FUNCS([select strerror dup2 memset strrchr asprintf])
77AC_TYPE_MODE_T
78AC_FUNC_SETPGRP
79AC_TYPE_SIGNAL
80AC_TYPE_SIZE_T
81
82AC_SYS_LARGEFILE
83
84CC_NOUNDEFINED
85
86ZP_LYNX_DOC
87
88AC_ARG_ENABLE(examples,
89       AS_HELP_STRING([--disable-examples], [Don't build examples during make]),,
90       enable_examples="yes")
91AM_CONDITIONAL(EXAMPLES, [test "$enable_examples" = "yes"])
92
93AC_CONFIG_FILES([libdaemon/Makefile Makefile doc/Makefile doc/README.html doc/doxygen.conf examples/Makefile pkgconfig/libdaemon.pc pkgconfig/libdaemon-uninstalled.pc])
94AC_OUTPUT
95