1 dnl Disable config.cache
2 define([AC_CACHE_LOAD], )
3 define([AC_CACHE_SAVE], )
7 AM_INIT_AUTOMAKE(fprobe-ulog,1.1)
8 AM_CONFIG_HEADER(config.h)
13 dnl AC_CHECK_TOOL(RANLIB, ranlib, :)
15 AC_CHECK_LIB(pthread, pthread_create, , [AC_ERROR(POSIX threads not found)])
17 dnl ************************************************
20 AC_CHECK_HEADER(inttypes.h, AC_DEFINE_UNQUOTED(HAVE_INTTYPES_H, , Have inttypes.h),
21 [AC_CHECK_SIZEOF(int, 8)
22 AC_CHECK_SIZEOF(long, 8)
23 AC_CHECK_SIZEOF(long long, 8)]
26 dnl ************************************************
29 AC_DEFINE_UNQUOTED(OS_LINUX, , OS type)
30 CFLAGS="$CFLAGS -D_BSD_SOURCE"
32 dnl ************************************************
33 dnl Memory bulk indexing mode
35 AC_MSG_CHECKING(which memory bulk indexing mode to use)
37 [ --with-membulk=MODE indexing mode: index8|index16|ptr [default=ptr]],
38 mem="$withval", mem="ptr")
51 AC_ERROR(Invalid argument: "$mem")
56 AC_DEFINE_UNQUOTED(MEM_BITS, $mem_bits, Memory bulk indexing mode)
58 dnl ************************************************
61 AC_MSG_CHECKING(which hash type and size to use)
63 [ --with-hash=TYPE hash type: crc16|xor16|xor8 [default=crc16]],
64 hash="$withval", hash="crc16")
66 hash_type=`echo "$hash"|cut -b -3`
67 hash_bits=`echo "$hash"|cut -b 4-`
69 if test "$hash_type" = "xor"; then
70 AC_DEFINE_UNQUOTED(HASH_TYPE_XOR, , Hash type)
71 if test "$hash_bits" != "8" -a "$hash_bits" != "16"; then
72 AC_ERROR(Invalid argument: "$withval")
75 if test "$hash" != "crc16"; then
76 AC_ERROR(Invalid argument: "$hash")
78 AC_DEFINE_UNQUOTED(HASH_TYPE_CRC, , Hash type)
81 AC_DEFINE_UNQUOTED(HASH_BITS, $hash_bits , Hash size)
82 AC_MSG_RESULT("$hash")
84 dnl ************************************************
87 AC_MSG_CHECKING(whether to enable uptime trick)
88 AC_ARG_ENABLE(uptime_trick,
89 [ --enable-uptime_trick enable uptime trick [default=yes]],
90 uptime_trick="$enableval", uptime_trick="yes")
91 case "$uptime_trick" in
94 AC_DEFINE_UNQUOTED(UPTIME_TRICK, , Uptime trick)
101 dnl ************************************************
104 AC_MSG_CHECKING(whether to enable icmp trick)
105 AC_ARG_ENABLE(icmp_trick,
106 [ --enable-icmp_trick enable icmp trick: yes|cisco|no [default=yes]],
107 icmp_trick="$enableval", icmp_trick="yes")
108 case "$icmp_trick" in
111 AC_DEFINE_UNQUOTED(ICMP_TRICK, , ICMP trick)
114 AC_MSG_RESULT(yes: cisco)
115 AC_DEFINE_UNQUOTED(UPTIME_TRICK_CISCO, , Uptime trick)
122 dnl ************************************************
125 AC_MSG_CHECKING(whether to enable debugging)
127 [ --enable-debug enable debugging [default=no]],
128 debug="$enableval", debug="no")
139 AC_MSG_RESULT(custom: $debug)
141 debug=`echo $debug|tr , " "`
143 debug_val="$debug_val | DEBUG_$i"
147 AC_DEFINE_UNQUOTED(DEBUG, ($debug_val) , Debugging output)
149 dnl ************************************************
152 AC_MSG_CHECKING(whether to enable runtime messages)
153 AC_ARG_ENABLE(messages,
154 [ --enable-messages enable runtime messages [default=no]],
155 messages="$enableval", messages="no")
159 AC_DEFINE_UNQUOTED(MESSAGES, , Runtime messages)
166 dnl ************************************************
167 dnl Pidfiles location
169 AC_MSG_CHECKING(directory to store pidfiles)
171 [ --with-piddir=DIR pidfiles location [default=/var/run]],
172 piddir="$withval", piddir="/var/run")
173 AC_DEFINE_UNQUOTED(PID_DIR, "$piddir", Pidfiles location)
174 AC_MSG_RESULT("$piddir")
176 dnl ************************************************
178 CFLAGS="$CFLAGS -D_REENTRANT"
179 CFLAGS="$CFLAGS -DWALL -W -Wall"
183 DATE=`date +%Y-%m-%d`
186 AC_OUTPUT(Makefile src/Makefile src/libipulog/Makefile)