summaryrefslogtreecommitdiffstats
path: root/configure.ac
blob: cfffa99842fb7146c3fafadbd4b8ec8e936f2304 (plain)
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
dnl Boilerplate
AC_INIT([ipset], [5.0], [kadlec@blackhole.kfki.hu])
AC_CANONICAL_SYSTEM
AC_CONFIG_HEADER([config.h])
AM_INIT_AUTOMAKE([-Wall -Werror foreign])

dnl Shortcut: Linux supported alone
case $target in
*-*-linux*) ;;
*) AC_MSG_ERROR([Linux systems supported exclusively!]);;
esac

dnl Additional arguments
dnl Kernel build directory or source tree
AC_ARG_WITH([kernel],
	    AS_HELP_STRING([--with-kernel=PATH],
	    		   [Path to kernel source/build directory]),
	    [KBUILDDOR="$withval";])
AM_CONDITIONAL(WITH_KBUILDDIR, test "$KBUILDDIR" != "")
AC_SUBST(KBUILDDIR)

dnl Maximal number of sets supported by the kernel, default 256
AC_ARG_WITH([maxsets],
	    AS_HELP_STRING([--with-maxsets=256],
	    		   [Maximal numer of sets supported by the kernel]),
	    [MAXSETS="$withval";])
AM_CONDITIONAL(WITH_MAXSETS, test "$MAXSETS" != "")
AC_SUBST(MAXSETS)

dnl Verbose compiling
AC_ARG_ENABLE([verbose],
	      AS_HELP_STRING([--enable-verbose],
	                     [Enable verbose mode at compiling/linking.]),
	      [case "${enableval}" in
	       yes)	enable_verbose=yes ;;
	       no)	enable_verbose=no ;;
	       *) AC_MSG_ERROR([bad value ${enableval} for --enable-verbose]) ;;
	       esac], [enable_verbose=no])
	      
AM_CONDITIONAL([ENABLE_VERBOSE], [test "x$enable_verbose" = xyes])

dnl Disable extra warn flags
AC_ARG_ENABLE([extra-flags],
	      AS_HELP_STRING([--disable-extra-flags],
	      		     [Disable extra compiler warning flags.]),
	      [case "${enableval}" in
	       yes)	extra_flags=yes ;;
	       no)	extra_flags=no ;;
	       *) AC_MSG_ERROR([bad value ${enableval} for --disable-extra-flags]) ;;
	       esac], [extra_flags=yes])
	      
AM_CONDITIONAL([DISABLE_EXTRA_FLAGS], [test "x$extra_flags" = xno])

dnl Checks for programs
AC_PROG_CC
AC_PROG_LIBTOOL
AC_PROG_INSTALL
AC_PROG_LN_S

dnl Checks for libraries
AC_CHECK_LIB([mnl], [mnl_socket_open])
if test x"${ac_cv_lib_mnl_mnl_socket_open}" = xno; then
  AC_MSG_ERROR(libmnl not found)
fi

dnl Checks for header files

dnl Checks for typedefs, structures, and compiler characteristics.
AC_CHECK_TYPES([union nf_inet_addr],,,[#include <linux/types.h>
#include <netinet/in.h>
#include <linux/netfilter.h>])
dnl Checks for library functions.

dnl Generate output
AC_CONFIG_FILES([Makefile lib/Makefile src/Makefile])
AC_OUTPUT