Lennart Poettering | e774e8e | 2003-07-31 14:18:41 +0000 | [diff] [blame] | 1 | # -*- 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 | |
| 22 | AC_PREREQ(2.57) |
Lennart Poettering | ce36dd0 | 2003-10-20 21:53:46 +0000 | [diff] [blame^] | 23 | AC_INIT([libdaemon], [0.3], [mzqnrzba (at) 0pointer (dot) de]) |
Lennart Poettering | e774e8e | 2003-07-31 14:18:41 +0000 | [diff] [blame] | 24 | AC_CONFIG_SRCDIR([src/dfork.c]) |
| 25 | AC_CONFIG_HEADERS([config.h]) |
| 26 | AM_INIT_AUTOMAKE([foreign -Wall]) |
Lennart Poettering | e774e8e | 2003-07-31 14:18:41 +0000 | [diff] [blame] | 27 | |
| 28 | # Checks for programs. |
| 29 | AC_PROG_CC |
| 30 | AC_PROG_CXX |
| 31 | AC_PROG_LIBTOOL |
| 32 | |
Lennart Poettering | ce36dd0 | 2003-10-20 21:53:46 +0000 | [diff] [blame^] | 33 | AC_SUBST(PACKAGE_URL, [http://0pointer.de/lennart/projects/libdaemon/]) |
| 34 | |
Lennart Poettering | e774e8e | 2003-07-31 14:18:41 +0000 | [diff] [blame] | 35 | # If using GCC specifiy some additional parameters |
| 36 | if test "x$GCC" = "xyes" ; then |
| 37 | CFLAGS="$CFLAGS -pipe -Wall" |
| 38 | fi |
| 39 | |
Lennart Poettering | ce36dd0 | 2003-10-20 21:53:46 +0000 | [diff] [blame^] | 40 | if 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}]) |
| 43 | fi |
Lennart Poettering | e774e8e | 2003-07-31 14:18:41 +0000 | [diff] [blame] | 44 | |
| 45 | # Checks for header files. |
| 46 | AC_HEADER_STDC |
| 47 | AC_CHECK_HEADERS([fcntl.h limits.h stdlib.h string.h syslog.h unistd.h]) |
| 48 | |
| 49 | # Checks for typedefs, structures, and compiler characteristics. |
| 50 | AC_C_CONST |
| 51 | AC_TYPE_PID_T |
| 52 | AC_HEADER_TIME |
| 53 | AC_C_VOLATILE |
| 54 | |
| 55 | # Checks for library functions. |
| 56 | AC_FUNC_FORK |
| 57 | AC_FUNC_SELECT_ARGTYPES |
| 58 | AC_FUNC_VPRINTF |
| 59 | AC_CHECK_FUNCS([select strerror dup2 memset strrchr]) |
| 60 | AC_TYPE_MODE_T |
| 61 | |
| 62 | # DOXYGEN documentation generation |
| 63 | AC_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) ;; |
| 69 | esac],[doxygen=yes]) |
| 70 | |
| 71 | if 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 |
| 77 | fi |
| 78 | |
| 79 | AM_CONDITIONAL([USE_DOXYGEN], [test "x$doxygen" = xyes]) |
| 80 | |
| 81 | # LYNX documentation generation |
| 82 | AC_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) ;; |
| 88 | esac],[lynx=yes]) |
| 89 | |
| 90 | if 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 |
| 96 | fi |
| 97 | |
| 98 | AM_CONDITIONAL([USE_LYNX], [test "x$lynx" = xyes]) |
| 99 | |
| 100 | AC_CONFIG_FILES([src/Makefile Makefile doc/Makefile doc/README.html doc/doxygen.conf examples/Makefile libdaemon.spec]) |
| 101 | AC_OUTPUT |