[20387] | 1 | # -*- Autoconf -*- |
---|
| 2 | # Process this file with autoconf to produce a configure script. |
---|
| 3 | |
---|
| 4 | # $Id: configure.ac,v 1.1.1.1 2004-04-09 20:09:15 amb Exp $ |
---|
| 5 | |
---|
| 6 | # This file is part of ifplugd. |
---|
| 7 | # |
---|
| 8 | # ifplugd 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 | # ifplugd 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 ifplugd; 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.59) |
---|
| 23 | AC_INIT([ifplugd],[0.23],[mzvscyhtq (at) 0pointer (dot) de]) |
---|
| 24 | AC_CONFIG_SRCDIR([src/ifplugd.c]) |
---|
| 25 | AC_CONFIG_HEADERS([config.h]) |
---|
| 26 | AM_INIT_AUTOMAKE([foreign -Wall]) |
---|
| 27 | |
---|
| 28 | AC_SUBST(PACKAGE_URL, [http://0pointer.de/lennart/projects/ifplugd/]) |
---|
| 29 | |
---|
| 30 | if type -p stow > /dev/null && test -d /usr/local/stow ; then |
---|
| 31 | 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}" |
---|
| 33 | fi |
---|
| 34 | |
---|
| 35 | # Checks for programs. |
---|
| 36 | AC_PROG_CXX |
---|
| 37 | AC_PROG_CC |
---|
| 38 | AC_PROG_CPP |
---|
| 39 | AC_PROG_INSTALL |
---|
| 40 | AC_PROG_LN_S |
---|
| 41 | AC_PROG_MAKE_SET |
---|
| 42 | |
---|
| 43 | # If using GCC specifiy some additional parameters |
---|
| 44 | if test "x$GCC" = "xyes" ; then |
---|
| 45 | CFLAGS="$CFLAGS -pipe -Wall" |
---|
| 46 | fi |
---|
| 47 | |
---|
| 48 | # Checks for header files. |
---|
| 49 | AC_HEADER_STDC |
---|
| 50 | AC_HEADER_SYS_WAIT |
---|
| 51 | AC_CHECK_HEADERS([fcntl.h limits.h netinet/in.h stdlib.h string.h sys/ioctl.h sys/time.h syslog.h unistd.h]) |
---|
| 52 | |
---|
| 53 | # Checks for typedefs, structures, and compiler characteristics. |
---|
| 54 | AC_C_CONST |
---|
| 55 | AC_TYPE_PID_T |
---|
| 56 | AC_HEADER_TIME |
---|
| 57 | AC_C_VOLATILE |
---|
| 58 | |
---|
| 59 | # Checks for library functions. |
---|
| 60 | AC_FUNC_FORK |
---|
| 61 | AC_PROG_GCC_TRADITIONAL |
---|
| 62 | AC_FUNC_SELECT_ARGTYPES |
---|
| 63 | AC_FUNC_MALLOC |
---|
| 64 | AC_TYPE_SIGNAL |
---|
| 65 | AC_FUNC_VPRINTF |
---|
| 66 | AC_CHECK_FUNCS([alarm dup2 memset select setenv socket strchr strdup strerror strrchr strspn]) |
---|
| 67 | |
---|
| 68 | PKG_CHECK_MODULES(LIBDAEMON, [ libdaemon >= 0.5 ]) |
---|
| 69 | AC_SUBST(LIBDAEMON_CFLAGS) |
---|
| 70 | AC_SUBST(LIBDAEMON_LIBS) |
---|
| 71 | |
---|
| 72 | # Init script location |
---|
| 73 | AC_ARG_WITH(initdir, AS_HELP_STRING(--with-initdir=DIR,Install init script in DIR (system dependent default))) |
---|
| 74 | |
---|
| 75 | test "x$with_initdir" = xyes -o "x$with_initdir" = xno && with_initdir= |
---|
| 76 | |
---|
| 77 | if test "x$with_initdir" = x ; then |
---|
| 78 | if test -d /etc/init.d ; then |
---|
| 79 | SYSINITDIR=/etc/init.d |
---|
| 80 | else |
---|
| 81 | if test -d /etc/rc.d/init.d ; then |
---|
| 82 | SYSINITDIR=/etc/rc.d/init.d |
---|
| 83 | else |
---|
| 84 | AC_MSG_ERROR([missing --with-initdir=DIR]) |
---|
| 85 | fi |
---|
| 86 | fi |
---|
| 87 | else |
---|
| 88 | SYSINITDIR="$with_initdir" |
---|
| 89 | fi |
---|
| 90 | |
---|
| 91 | AC_MSG_NOTICE([*** Init sript will be installed in $SYSINITDIR ***]) |
---|
| 92 | AC_SUBST(SYSINITDIR) |
---|
| 93 | |
---|
| 94 | # LYNX documentation generation |
---|
| 95 | AC_ARG_ENABLE(lynx, |
---|
| 96 | AS_HELP_STRING(--disable-lynx,Turn off lynx usage for documentation generation), |
---|
| 97 | [case "${enableval}" in |
---|
| 98 | yes) lynx=yes ;; |
---|
| 99 | no) lynx=no ;; |
---|
| 100 | *) AC_MSG_ERROR(bad value ${enableval} for --disable-lynx) ;; |
---|
| 101 | esac],[lynx=yes]) |
---|
| 102 | |
---|
| 103 | if test x$lynx = xyes ; then |
---|
| 104 | AC_CHECK_PROG(have_lynx, lynx, yes, no) |
---|
| 105 | |
---|
| 106 | if test x$have_lynx = xno ; then |
---|
| 107 | AC_MSG_ERROR([*** Sorry, you have to install lynx or use --disable-lynx ***]) |
---|
| 108 | fi |
---|
| 109 | fi |
---|
| 110 | |
---|
| 111 | AM_CONDITIONAL([USE_LYNX], [test "x$lynx" = xyes]) |
---|
| 112 | |
---|
| 113 | # XMLTOMAN manpage generation |
---|
| 114 | AC_ARG_ENABLE(xmltoman, |
---|
| 115 | AS_HELP_STRING(--disable-xmltoman,Disable rebuilding of man pages with xmltoman), |
---|
| 116 | [case "${enableval}" in |
---|
| 117 | yes) xmltoman=yes ;; |
---|
| 118 | no) xmltoman=no ;; |
---|
| 119 | *) AC_MSG_ERROR([bad value ${enableval} for --disable-xmltoman]) ;; |
---|
| 120 | esac],[xmltoman=yes]) |
---|
| 121 | |
---|
| 122 | if test x$xmltoman = xyes ; then |
---|
| 123 | AC_CHECK_PROG(have_xmltoman, xmltoman, yes, no) |
---|
| 124 | |
---|
| 125 | if test x$have_xmltoman = xno ; then |
---|
| 126 | AC_MSG_WARN([*** Not rebuilding man pages as xmltoman is not found ***]) |
---|
| 127 | xmltoman=no |
---|
| 128 | fi |
---|
| 129 | fi |
---|
| 130 | |
---|
| 131 | AM_CONDITIONAL([USE_XMLTOMAN], [test "x$xmltoman" = xyes]) |
---|
| 132 | |
---|
| 133 | # subversion release number generation |
---|
| 134 | AC_ARG_ENABLE(subversion, |
---|
| 135 | AS_HELP_STRING(--disable-subversion,Disable rebuilding of svn-release.h), |
---|
| 136 | [case "${enableval}" in |
---|
| 137 | yes) subversion=yes ;; |
---|
| 138 | no) subversion=no ;; |
---|
| 139 | *) AC_MSG_ERROR([bad value ${enableval} for --disable-subversion]) ;; |
---|
| 140 | esac],[subversion=yes]) |
---|
| 141 | |
---|
| 142 | if test x$subversion = xyes ; then |
---|
| 143 | AC_CHECK_PROG(have_subversion, svn, yes, no) |
---|
| 144 | |
---|
| 145 | if test x$have_subversion = xno ; then |
---|
| 146 | AC_MSG_WARN([*** Not rebuilding svn-release.h as subversion is not found ***]) |
---|
| 147 | subversion=no |
---|
| 148 | fi |
---|
| 149 | fi |
---|
| 150 | |
---|
| 151 | AM_CONDITIONAL([USE_SUBVERSION], [test "x$subversion" = xyes]) |
---|
| 152 | |
---|
| 153 | AC_CONFIG_FILES([src/Makefile Makefile man/Makefile conf/Makefile doc/Makefile doc/README.html patches/Makefile ifplugd.spec]) |
---|
| 154 | AC_OUTPUT |
---|