1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136
|
dnl Process this file with autoconf to produce a configure script.
dnl $Id: configure.in 68 2007-01-23 11:12:33Z steve $
AC_PREREQ(2.59)
AC_INIT(dnshistory, 1.3, spm@stedee.id.au)
AC_CONFIG_SRCDIR([src/dnshistory.c])
AC_CONFIG_AUX_DIR([config])
AC_CONFIG_HEADER(src/config.h:src/config-h.in)
AM_INIT_AUTOMAKE
AC_REVISION($Revision: 1.1 $)
OLD_CFLAGS=${CFLAGS}
AC_PROG_CC
dnl ********************
dnl Set CFLAGS to use
dnl Use extra optimisations if using gcc
if test "$OLD_CFLAGS" = ""; then
if test "$GCC" = "yes"; then
CFLAGS="-Wall -Winline -O3 -fexpensive-optimizations"
else
CFLAGS="-Wall -O3"
fi
fi
dnl ********************
dnl Config Arg: --enable-debug
dnl Enable the debug flag for compiling
dnl ********************
AC_ARG_ENABLE([debug],
AC_HELP_STRING([--enable-debug],
[Turn on compiler debugging information (default=no)]),
[if eval "test x$enable_debug = xyes"; then
CFLAGS="${OLD_CFLAGS} -Wall -g"
fi])
dnl ********************
dnl Config Arg: --enable-developer
dnl Enable maximum warnings. Base taken from Samba.
dnl ********************
AC_ARG_ENABLE([developer],
AC_HELP_STRING([--enable-developer],
[Turn on developer warnings and debugging (default=no)]),
[if eval "test x$enable_developer = xyes"; then
CFLAGS="${OLD_CFLAGS} -g -pg -Wall -W -Wshadow -Wstrict-prototypes -Wcast-qual -Wcast-align -Wwrite-strings -DDEVELOPER"
fi])
dnl ********************
dnl Config Arg: --with-db
dnl Locate the Berkeley DB
dnl ********************
AC_ARG_WITH([berkeley-db],
AC_HELP_STRING([--with-berkeley-db=DIR],
[Alternate location for the Berkeley DB]),
[CFLAGS="-I${withval}/include ${CFLAGS}" LDFLAGS="-L${withval}/lib ${LDFLAGS}"])
dnl ********************
dnl Config Arg: --enable-database-name
dnl Set the database name to use
dnl Default is "dnshistory.db"
dnl ********************
AC_ARG_ENABLE([database-name],
AC_HELP_STRING([--enable-database-name=FILE],
[Set the database name to use (default is dnshistory.db)]),
[ac_cv_dbname="$enableval"], [ac_cv_dbname="dnshistory.db"])
AC_CACHE_CHECK([database name change],
[ac_cv_dbname], [ac_cv_dbname=dnshistory.db])
AC_SUBST(ac_cv_dbname)
dnl ********************
dnl Config Arg: --enable-database-dir
dnl Set the database directory to use
dnl Default is "$localstatedir/lib/dnshistory"
dnl ********************
AC_ARG_ENABLE([database-dir],
AC_HELP_STRING([--enable-database-dir=DIR],
[Set the database directory to use (default is $localstatedir/lib/dnshistory)]),
[ac_cv_dbdir="$enableval"], [ac_cv_dbdir="$localstatedir/lib/dnshistory"])
AC_CACHE_CHECK([database directory change],
[ac_cv_dbdir], [ac_cv_dbdir=$localstatedir/lib/dnshistory])
AC_SUBST(ac_cv_dbdir)
dnl ********************
dnl LIBRARY CHECKING
dnl ********************
AC_PROG_RANLIB
AC_CHECK_LIB([pcre], [main],[], [echo "Missing Perl Regular Expressions Library" ; exit])
AC_CHECK_LIB([db], [main],[], [echo "Missing Berkeley DB Library" ; exit])
AC_CHECK_LIB([m], [main],[], [echo "Missing Math Library" ; exit])
AC_CHECK_LIB([z], [main],[], [echo "Missing Zlib Compression Library" ; exit])
AC_CHECK_LIB([pthread], [main],[], [echo "Missing pthread Library" ; exit])
dnl Checks for library functions.
dnl - messes up Solaris - AC_FUNC_MALLOC
AC_FUNC_MKTIME
AC_CHECK_FUNCS([floor memset memcpy])
dnl ********************
dnl HEADER CHECKING
dnl ********************
dnl Checks for header files.
AC_HEADER_STDC
AC_HEADER_STDBOOL
AC_HEADER_TIME
AC_CHECK_HEADERS([db.h], [], [echo "Missing db.h" ; exit])
AC_CHECK_HEADERS([pcre.h], [],
[ AC_CHECK_HEADERS([pcre/pcre.h], [], [ echo "Missing pcre.h" ; exit ] ])
)
AC_CHECK_HEADERS([getopt.h], [], [echo "Missing getopt.h" ; exit])
AC_CHECK_HEADERS([zlib.h], [], [echo "Missing zlib.h" ; exit])
AC_CHECK_HEADERS([math.h], [], [echo "Missing math.h" ; exit])
AC_CHECK_HEADERS([unistd.h], [], [echo "Missing unistd.h" ; exit])
AC_CHECK_HEADERS([sys/socket.h], [], [echo "Missing sys/socket.h" ; exit])
AC_CHECK_HEADERS([netinet/in.h], [], [echo "Missing netinet/in.h" ; exit])
AC_CHECK_HEADERS([arpa/inet.h], [], [echo "Missing arpa/inet.h" ; exit])
AC_CHECK_HEADERS([netdb.h], [], [echo "Missing netdb.h" ; exit])
AC_CHECK_HEADERS([pthread.h], [], [echo "Missing pthread.h" ; exit])
dnl ********************
dnl Checks for typedefs, structures, and compiler characteristics.
dnl ********************
AC_C_CONST
AC_C_INLINE
AC_STRUCT_TM
AC_TYPE_SIZE_T
dnl ********************
AC_OUTPUT(Makefile src/Makefile doc/Makefile)
|