AM_INIT_AUTOMAKE(logtool,1.2.7) AM_PROG_CC_STDC dnl Process this file with autoconf to produce a configure script. AC_INIT(src/logtool.c) dnl Checks for programs. AC_PROG_CC AC_PREFIX_DEFAULT(/usr) dnl We want the sysconfdir to be damn near standard AC_SUBST(sysconfdir) if test "`echo "$sysconfdir" | grep "prefix"`" ; then sysconfdir=`echo $sysconfdir/logtool | sed s/'${prefix}'/""/g` else sysconfdir=$sysconfdir fi AC_SUBST(version) version=1.2.7 AC_PROG_INSTALL AC_SUBST(installprog) installprog="$INSTALL" AC_PROG_LN_S AC_PROG_MAKE_SET AC_HEADER_STDC AC_CHECK_FUNCS(inet_addr, [], [ AC_CHECK_LIB(nsl, inet_addr, [ LIBS="-lnsl $LIBS" ], [ AC_CHECK_LIB(m, inet_addr, [ LIBS="-lm $LIBS" ], [ AC_MSG_WARN([Warning: unable to find inet_addr - resolver disabled]) AC_DEFINE(NO_RESOLVER) NO_RESOLVER="yes" ]) ]) ]) AC_CHECK_FUNCS(gethostbyaddr, [], [ AC_CHECK_LIB(nsl, gethostbyaddr, [ tvar="`echo $LIBS | grep lnsl`" if test "$tavr" != "" ; then LIBS="-lnsl $LIBS" fi ], [ AC_CHECK_LIB(m, gethostbyaddr, [ tvar="`echo $LIBS | grep lm`" if test "$tavr" != "" ; then LIBS="-lm $LIBS" fi ], [ AC_MSG_WARN([Warning: unable to find gethostbyaddr - resolver disabled]) AC_DEFINE(NO_RESOLVER) NO_RESOLVER="yes" ]) ]) ] []) dnl Checks for header files. AC_CHECK_HEADERS(unistd.h sysexits.h regex.h time.h, [ ], [ AC_MSG_ERROR([Fatal Error: required header file missing.]) ]) dnl this isn't a fatal error, as we can use our own copy (we hope :) AC_CHECK_HEADERS(getopt.h) dnl Checks for typedefs, structures, and compiler characteristics. AC_C_CONST AC_TYPE_SIZE_T dnl Checks for library functions. AC_CHECK_FUNCS(strncasecmp, [], [ AC_MSG_ERROR([Fatal Error: strncasecmp not available]) ]) AC_CHECK_FUNCS(setenv, [ AC_DEFINE(HAVE_SETENV) ], []) AC_CHECK_FUNCS(regcomp regexec regfree, [], [ AC_MSG_ERROR([Fatal Error: regex library functions nonstandard/incomplete]) ]) AC_CONFIG_HEADER(config.h) AC_OUTPUT(logtool.spec src/config.h src/Makefile Makefile conf/logtool.conf doc/logtool.1 doc/logtool.txt) echo " Build was configured as follows: Prefix: $prefix Configuration files wil be placed in: $sysconfdir Binaries will be placed in: $prefix/bin Using this install program: $installprog We will use the following compiler: $CC With the following CFLAGS: $CFLAGS With the following DEFS: $DEFS With the following LIBS: $LIBS"