2 # Process this file with autoconf to produce a configure script.
4 # This file is part of libdaemon.
6 # Copyright 2003-2008 Lennart Poettering
8 # libdaemon is free software; you can redistribute it and/or modify it
9 # under the terms of the GNU Lesser General Public License as
10 # published by the Free Software Foundation, either version 2.1 of the
11 # License, or (at your option) any later version.
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 # Lesser General Public License for more details.
18 # You should have received a copy of the GNU Lesser General Public
19 # License along with libdaemon. If not, see
20 # <http://www.gnu.org/licenses/>.
24 AC_INIT([libdaemon],[0.14],[mzqnrzba (at) 0pointer (dot) de])
25 AC_CONFIG_SRCDIR([libdaemon/dfork.c])
26 AC_CONFIG_HEADERS([config.h])
27 AC_CONFIG_MACRO_DIR([m4])
29 AM_INIT_AUTOMAKE([foreign 1.10 -Wall])
31 AC_SUBST(PACKAGE_URL, [http://0pointer.de/lennart/projects/libdaemon/])
33 AC_SUBST(LIBDAEMON_VERSION_INFO, [5:0:5])
35 if type -p stow > /dev/null && test -d /usr/local/stow ; then
36 AC_MSG_NOTICE([*** Found /usr/local/stow: default install prefix set to /usr/local/stow/${PACKAGE_NAME}-${PACKAGE_VERSION} ***])
37 ac_default_prefix="/usr/local/stow/${PACKAGE_NAME}-${PACKAGE_VERSION}"
40 m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
42 # Checks for programs.
44 AC_PROG_CC_C99 dnl This enable gnu99 if present
47 AC_USE_SYSTEM_EXTENSIONS
54 CC_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])
56 # Checks for header files.
59 AC_CHECK_HEADERS([fcntl.h limits.h stdlib.h string.h syslog.h unistd.h sys/ioctl.h sys/time.h])
62 # Checks for typedefs, structures, and compiler characteristics.
68 # Checks for library functions.
70 AC_FUNC_SELECT_ARGTYPES
72 AC_CHECK_FUNCS([select strerror dup2 memset strrchr asprintf])
84 AC_ARG_ENABLE(examples,
85 AS_HELP_STRING([--disable-examples], [Don't build examples during make]),,
86 enable_examples="yes")
87 AM_CONDITIONAL(EXAMPLES, [test "$enable_examples" = "yes"])
89 AC_CONFIG_FILES([libdaemon/Makefile Makefile doc/Makefile doc/README.html doc/doxygen.conf examples/Makefile pkgconfig/libdaemon.pc pkgconfig/libdaemon-uninstalled.pc])