blob: 49cde9a04d0e33026ed19757b8de65b26bc64028 [file] [log] [blame]
lh9ed821d2023-04-07 01:36:19 -07001
2AC_INIT([iptables], [1.4.3.2])
3
4# See libtool.info "Libtool's versioning system"
5libxtables_vcurrent=2
6libxtables_vage=0
7
8AC_CONFIG_HEADERS([config.h])
9AC_CONFIG_MACRO_DIR([m4])
10AC_PROG_INSTALL
11AM_INIT_AUTOMAKE([-Wall])
12AC_PROG_CC
13AM_PROG_CC_C_O
14AC_DISABLE_STATIC
15AM_PROG_LIBTOOL
16
17AC_ARG_WITH([kernel],
18 AS_HELP_STRING([--with-kernel=PATH],
19 [Path to kernel source/build directory]),
20 [kbuilddir="$withval"; ksourcedir="$withval";])
21AC_ARG_WITH([kbuild],
22 AS_HELP_STRING([--with-kbuild=PATH],
23 [Path to kernel build directory [[/lib/modules/CURRENT/build]]]),
24 [kbuilddir="$withval"])
25AC_ARG_WITH([ksource],
26 AS_HELP_STRING([--with-ksource=PATH],
27 [Path to kernel source directory [[/lib/modules/CURRENT/source]]]),
28 [ksourcedir="$withval"])
29AC_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"])
34AC_ARG_ENABLE([ipv4],
35 AS_HELP_STRING([--disable-ipv4], [Do not build iptables]),
36 [enable_ipv4="$enableval"], [enable_ipv4="yes"])
37AC_ARG_ENABLE([ipv6],
38 AS_HELP_STRING([--disable-ipv6], [Do not build ip6tables]),
39 [enable_ipv6="$enableval"], [enable_ipv6="yes"])
40AC_ARG_ENABLE([devel],
41 AS_HELP_STRING([--enable-devel],
42 [Install Xtables development headers]),
43 [enable_devel="$enableval"], [enable_devel="yes"])
44AC_ARG_ENABLE([libipq],
45 AS_HELP_STRING([--enable-libipq], [Build and install libipq]))
46AC_ARG_WITH([pkgconfigdir], AS_HELP_STRING([--with-pkgconfigdir=PATH],
47 [Path to the pkgconfig directory [[LIBDIR/pkgconfig]]]),
48 [pkgconfigdir="$withval"], [pkgconfigdir='${libdir}/pkgconfig'])
49
50AC_CHECK_HEADER([linux/dccp.h])
51
52blacklist_modules="";
53if test "$ac_cv_header_linux_dccp_h" != "yes"; then
54 blacklist_modules="$blacklist_modules dccp";
55fi;
56AC_SUBST([blacklist_modules])
57
58AM_CONDITIONAL([ENABLE_STATIC], [test "$enable_static" = "yes"])
59AM_CONDITIONAL([ENABLE_SHARED], [test "$enable_shared" = "yes"])
60AM_CONDITIONAL([ENABLE_IPV4], [test "$enable_ipv4" = "yes"])
61AM_CONDITIONAL([ENABLE_IPV6], [test "$enable_ipv6" = "yes"])
62AM_CONDITIONAL([ENABLE_DEVEL], [test "$enable_devel" = "yes"])
63AM_CONDITIONAL([ENABLE_LIBIPQ], [test "$enable_libipq" = "yes"])
64
65regular_CFLAGS="-D_LARGEFILE_SOURCE=1 -D_LARGE_FILES -D_FILE_OFFSET_BITS=64 \
66 -D_REENTRANT -Wall -Waggregate-return -Wmissing-declarations \
67 -Wmissing-prototypes -Wredundant-decls -Wshadow -Wstrict-prototypes \
68 -Winline -pipe \
69 -DXTABLES_LIBDIR=\\\"\${xtlibdir}\\\" -DXTABLES_INTERNAL";
70kinclude_CFLAGS="";
71if [[ "$enable_static" = yes ]]; then
72 regular_CFLAGS="$regular_CFLAGS -DNO_SHARED_LIBS=1";
73fi
74if [[ -n "$kbuilddir" ]]; then
75 kinclude_CFLAGS="$kinclude_CFLAGS -I $kbuilddir/include";
76fi;
77if [[ -n "$ksourcedir" ]]; then
78 kinclude_CFLAGS="$kinclude_CFLAGS -I $ksourcedir/include";
79fi;
80
81AC_SUBST([regular_CFLAGS])
82AC_SUBST([kinclude_CFLAGS])
83AC_SUBST([kbuilddir])
84AC_SUBST([ksourcedir])
85AC_SUBST([xtlibdir])
86AC_SUBST([pkgconfigdir])
87AC_SUBST([libxtables_vcurrent])
88AC_SUBST([libxtables_vage])
89libxtables_vmajor=$(($libxtables_vcurrent - $libxtables_vage));
90AC_SUBST([libxtables_vmajor])
91
92AC_CONFIG_FILES([Makefile extensions/GNUmakefile include/Makefile
93 libipq/Makefile
94 include/xtables.h include/iptables/internal.h libiptc.pc xtables.pc])
95AC_OUTPUT