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 26 AC_PREREQ(2.63) 27 28 AC_INIT([libdaemon],[0.14],[mzqnrzba (at) 0pointer (dot) de]) 29 AC_CONFIG_SRCDIR([libdaemon/dfork.c]) 30 AC_CONFIG_HEADERS([config.h]) 31 AC_CONFIG_MACRO_DIR([m4]) 32 33 AM_INIT_AUTOMAKE([foreign 1.10 -Wall]) 34 35 AC_SUBST(PACKAGE_URL, [http://0pointer.de/lennart/projects/libdaemon/]) 36 37 AC_SUBST(LIBDAEMON_VERSION_INFO, [5:0:5]) 38 39 if 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}" 42 fi 43 44 m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) 45 46 # Checks for programs. 47 AC_PROG_CC 48 AC_PROG_CC_C99 dnl This enable gnu99 if present 49 AM_PROG_CC_C_O 50 51 AC_USE_SYSTEM_EXTENSIONS 52 53 AC_PROG_INSTALL 54 AC_PROG_LN_S 55 AC_PROG_MAKE_SET 56 AC_PROG_LIBTOOL 57 58 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]) 59 60 # Checks for header files. 61 AC_HEADER_ASSERT 62 AC_HEADER_STDC 63 AC_CHECK_HEADERS([fcntl.h limits.h stdlib.h string.h syslog.h unistd.h sys/ioctl.h sys/time.h]) 64 AC_HEADER_SYS_WAIT 65 66 # Checks for typedefs, structures, and compiler characteristics. 67 AC_C_CONST 68 AC_TYPE_PID_T 69 AC_HEADER_TIME 70 AC_C_VOLATILE 71 72 # Checks for library functions. 73 AC_FUNC_FORK 74 AC_FUNC_SELECT_ARGTYPES 75 AC_FUNC_VPRINTF 76 AC_CHECK_FUNCS([select strerror dup2 memset strrchr asprintf]) 77 AC_TYPE_MODE_T 78 AC_FUNC_SETPGRP 79 AC_TYPE_SIGNAL 80 AC_TYPE_SIZE_T 81 82 AC_SYS_LARGEFILE 83 84 CC_NOUNDEFINED 85 86 ZP_LYNX_DOC 87 88 AC_ARG_ENABLE(examples, 89 AS_HELP_STRING([--disable-examples], [Don't build examples during make]),, 90 enable_examples="yes") 91 AM_CONDITIONAL(EXAMPLES, [test "$enable_examples" = "yes"]) 92 93 AC_CONFIG_FILES([libdaemon/Makefile Makefile doc/Makefile doc/README.html doc/doxygen.conf examples/Makefile pkgconfig/libdaemon.pc pkgconfig/libdaemon-uninstalled.pc]) 94 AC_OUTPUT 95