Merge commit 'local_master/1.3.5.1@6970' into trunk@12172
[iptables.git] / trunk / configure.ac
1 define([_XTABLES_VERSION_MAJOR], 1)
2 define([_XTABLES_VERSION_MINOR], 4)
3 define([_XTABLES_VERSION_PATCH], 1)
4 define([_XTABLES_VERSION_EXTRA], .1)
5
6 define([_XTABLES_VERSION],_XTABLES_VERSION_MAJOR._XTABLES_VERSION_MINOR._XTABLES_VERSION_PATCH[]_XTABLES_VERSION_EXTRA)
7
8 AC_INIT([iptables], _XTABLES_VERSION)
9 AC_CONFIG_HEADERS([config.h])
10 AC_PROG_INSTALL
11 AM_INIT_AUTOMAKE
12 AC_PROG_CC
13 AM_PROG_CC_C_O
14 AC_DISABLE_STATIC
15 AC_PROG_LIBTOOL
16
17 AC_ARG_WITH([kernel],
18         AS_HELP_STRING([--with-kernel=PATH],
19         [Path to kernel source/build directory]),
20         [kbuilddir="$withval"; ksourcedir="$withval";])
21 AC_ARG_WITH([kbuild],
22         AS_HELP_STRING([--with-kbuild=PATH],
23         [Path to kernel build directory [[/lib/modules/CURRENT/build]]]),
24         [kbuilddir="$withval"])
25 AC_ARG_WITH([ksource],
26         AS_HELP_STRING([--with-ksource=PATH],
27         [Path to kernel source directory [[/lib/modules/CURRENT/source]]]),
28         [ksourcedir="$withval"])
29 AC_ARG_WITH([xtlibdir],
30         AS_HELP_STRING([--with-xtlibdir=PATH],
31         [Path where to install Xtables extensions [[LIBEXECDIR/xtables]]]),
32         [xtlibdir="$withval"],
33         [xtlibdir="${libexecdir}/xtables"])
34 AC_ARG_ENABLE([devel],
35         AS_HELP_STRING([--enable-devel],
36         [Install Xtables development headers]),
37         [enable_devel="$enableval"], [enable_devel="yes"])
38 AC_ARG_ENABLE([libipq],
39         AS_HELP_STRING([--enable-libipq], [Build and install libipq]))
40
41 AC_CHECK_HEADER([netinet/ip6.h], [], [AC_MSG_ERROR(but we need that for IPv6)])
42 AC_CHECK_HEADER([linux/dccp.h])
43
44 blacklist_modules="";
45 if test "$ac_cv_header_linux_dccp_h" != "yes"; then
46         blacklist_modules="$blacklist_modules dccp";
47 fi;
48 AC_SUBST([blacklist_modules])
49
50 AM_CONDITIONAL([ENABLE_STATIC], [test "$enable_static" == "yes"])
51 AM_CONDITIONAL([ENABLE_SHARED], [test "$enable_shared" == "yes"])
52 AM_CONDITIONAL([ENABLE_DEVEL], [test "$enable_devel" == "yes"])
53 AM_CONDITIONAL([ENABLE_LIBIPQ], [test "$enable_libipq" == "yes"])
54
55 regular_CFLAGS="-D_LARGEFILE_SOURCE=1 -D_LARGE_FILES -D_FILE_OFFSET_BITS=64 \
56         -D_REENTRANT -Wall -Waggregate-return -Wmissing-declarations \
57         -Wmissing-prototypes -Wredundant-decls -Wshadow -Wstrict-prototypes \
58         -Winline -pipe \
59         -DXTABLES_LIBDIR=\\\"\${xtlibdir}\\\" -DXTABLES_INTERNAL";
60 kinclude_CFLAGS="";
61 if [[ -n "$kbuilddir" ]]; then
62         kinclude_CFLAGS="$kinclude_CFLAGS -I $kbuilddir/include";
63 fi;
64 if [[ -n "$ksourcedir" ]]; then
65         kinclude_CFLAGS="$kinclude_CFLAGS -I $ksourcedir/include";
66 fi;
67
68 AC_SUBST([regular_CFLAGS])
69 AC_SUBST([kinclude_CFLAGS])
70 AC_SUBST([kbuilddir])
71 AC_SUBST([ksourcedir])
72 AC_SUBST([xtlibdir])
73
74 XTABLES_VERSION_MAJOR=_XTABLES_VERSION_MAJOR
75 XTABLES_VERSION_MINOR=_XTABLES_VERSION_MINOR
76 XTABLES_VERSION_PATCH=_XTABLES_VERSION_PATCH
77 XTABLES_VERSION_EXTRA=_XTABLES_VERSION_EXTRA
78 AC_SUBST([XTABLES_VERSION_MAJOR])
79 AC_SUBST([XTABLES_VERSION_MINOR])
80 AC_SUBST([XTABLES_VERSION_PATCH])
81 AC_SUBST([XTABLES_VERSION_EXTRA])
82
83 AC_OUTPUT([Makefile extensions/GNUmakefile libipq/Makefile include/xtables.h])