-
Notifications
You must be signed in to change notification settings - Fork 29
/
Copy pathconfigure.ac
74 lines (60 loc) · 2.08 KB
/
configure.ac
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
AC_PREREQ([2.68])
AM_INIT_AUTOMAKE([-Wall foreign check-news silent-rules -Werror])
AC_CONFIG_SRCDIR([src/addrwatch.c])
AM_CONFIG_HEADER([src/config.h])
# Checks for programs.
AC_PROG_CC
AC_PROG_INSTALL
optional_modules=""
AC_SUBST([optional_modules])
# Checks for libraries.
AC_CHECK_LIB([pcap], [pcap_open_live], :)
AC_CHECK_LIB([rt], [shm_open])
PKG_CHECK_MODULES(LIBEVENT, [libevent >= 1.4], , [
AC_CHECK_LIB([event], [event_dispatch], , [
AC_MSG_ERROR([Please install libevent-1.4 or libevent-2.0])
])
])
PKG_CHECK_MODULES(LIBEVENT2, [libevent >= 2.0], [
AC_DEFINE([HAVE_LIBEVENT2], 1, [Define to 1 if you have libevent2])
], [ ])
AC_SEARCH_LIBS([argp_parse], [argp], , [
AC_MSG_ERROR([Your libc is missing argp_parse funcion. If you \
are not using GNU libc you can use argp-standalone package. Specify argp \
library search path in LDFLAGS variable with -L option. Example: ./configure \
LDFLAGS="-L/usr/local/lib"])
])
AC_CHECK_HEADERS([argp.h], , [
AC_MSG_ERROR([Unable to find argp.h header. If you are using \
argp-standalone package specify argp include search path in CPPFLAGS \
variable with -I option. Example: ./configure CPPFLAGS="-I/usr/local/include"])
])
AC_ARG_ENABLE([sqlite3],
AS_HELP_STRING([--enable-sqlite3], [Enable sqlite3 database output]),
AC_CHECK_LIB([sqlite3], [sqlite3_open], , [
AC_MSG_ERROR([Unable to find libsqlite3.])
])
)
AC_ARG_ENABLE([mysql],
AS_HELP_STRING([--enable-mysql], [Enable MySQL database output]),
AC_CHECK_LIB([mysqlclient], [mysql_real_connect], :, [
AC_MSG_ERROR([Unable to find libmysqlclient.])
])
optional_modules="${optional_modules} addrwatch_mysql"
)
# Checks for header files.
AC_CHECK_HEADERS([arpa/inet.h netinet/in.h stdint.h stdlib.h syslog.h unistd.h])
# Checks for typedefs, structures, and compiler characteristics.
AC_C_INLINE
AC_TYPE_PID_T
AC_TYPE_UINT32_T
AC_TYPE_UINT16_T
AC_TYPE_UINT8_T
# Checks for library functions.
AC_FUNC_FORK
AC_CHECK_FUNCS([bzero])
AC_CONFIG_FILES([Makefile
src/Makefile
doc/Makefile])
AC_OUTPUT