Blame configure.ac

Packit Service d1fe03
Packit Service d1fe03
AC_INIT([iptables], [1.8.4])
Packit Service d1fe03
Packit Service d1fe03
# See libtool.info "Libtool's versioning system"
Packit Service d1fe03
libxtables_vcurrent=14
Packit Service d1fe03
libxtables_vage=2
Packit Service d1fe03
Packit Service d1fe03
AC_CONFIG_AUX_DIR([build-aux])
Packit Service d1fe03
AC_CONFIG_HEADERS([config.h])
Packit Service d1fe03
AC_CONFIG_MACRO_DIR([m4])
Packit Service d1fe03
AC_PROG_INSTALL
Packit Service d1fe03
AM_INIT_AUTOMAKE([-Wall])
Packit Service d1fe03
AC_PROG_CC
Packit Service d1fe03
AM_PROG_CC_C_O
Packit Service d1fe03
AC_DISABLE_STATIC
Packit Service d1fe03
m4_ifdef([AM_PROG_AR], [AM_PROG_AR])
Packit Service d1fe03
AM_PROG_LIBTOOL
Packit Service d1fe03
Packit Service d1fe03
AC_ARG_WITH([kernel],
Packit Service d1fe03
	AS_HELP_STRING([--with-kernel=PATH],
Packit Service d1fe03
	[Path to kernel source/build directory]),
Packit Service d1fe03
	[kbuilddir="$withval"; ksourcedir="$withval";])
Packit Service d1fe03
AC_ARG_WITH([kbuild],
Packit Service d1fe03
	AS_HELP_STRING([--with-kbuild=PATH],
Packit Service d1fe03
	[Path to kernel build directory [[/lib/modules/CURRENT/build]]]),
Packit Service d1fe03
	[kbuilddir="$withval"])
Packit Service d1fe03
AC_ARG_WITH([ksource],
Packit Service d1fe03
	AS_HELP_STRING([--with-ksource=PATH],
Packit Service d1fe03
	[Path to kernel source directory [[/lib/modules/CURRENT/source]]]),
Packit Service d1fe03
	[ksourcedir="$withval"])
Packit Service d1fe03
AC_ARG_WITH([xtlibdir],
Packit Service d1fe03
	AS_HELP_STRING([--with-xtlibdir=PATH],
Packit Service d1fe03
	[Path where to install Xtables extensions [[LIBEXECDIR/xtables]]]),
Packit Service d1fe03
	[xtlibdir="$withval"],
Packit Service d1fe03
	[xtlibdir="${libdir}/xtables"])
Packit Service d1fe03
AC_ARG_ENABLE([ipv4],
Packit Service d1fe03
	AS_HELP_STRING([--disable-ipv4], [Do not build iptables]),
Packit Service d1fe03
	[enable_ipv4="$enableval"], [enable_ipv4="yes"])
Packit Service d1fe03
AC_ARG_ENABLE([ipv6],
Packit Service d1fe03
	AS_HELP_STRING([--disable-ipv6], [Do not build ip6tables]),
Packit Service d1fe03
	[enable_ipv6="$enableval"], [enable_ipv6="yes"])
Packit Service d1fe03
AC_ARG_ENABLE([largefile],
Packit Service d1fe03
	AS_HELP_STRING([--disable-largefile], [Do not build largefile support]),
Packit Service d1fe03
	[enable_largefile="$enableval"],
Packit Service d1fe03
	[enable_largefile="yes"])
Packit Service d1fe03
AS_IF([test "$enable_largefile" = "yes"], [largefile_cppflags='-D_LARGEFILE_SOURCE=1 -D_LARGE_FILES -D_FILE_OFFSET_BITS=64'])
Packit Service d1fe03
Packit Service d1fe03
AC_ARG_ENABLE([devel],
Packit Service d1fe03
	AS_HELP_STRING([--enable-devel],
Packit Service d1fe03
	[Install Xtables development headers]),
Packit Service d1fe03
	[enable_devel="$enableval"], [enable_devel="yes"])
Packit Service d1fe03
AC_ARG_ENABLE([libipq],
Packit Service d1fe03
	AS_HELP_STRING([--enable-libipq], [Build and install libipq]),
Packit Service d1fe03
	[enable_libipq="$enableval"], [enable_libipq="no"])
Packit Service d1fe03
AC_ARG_ENABLE([bpf-compiler],
Packit Service d1fe03
	AS_HELP_STRING([--enable-bpf-compiler], [Build bpf compiler]),
Packit Service d1fe03
	[enable_bpfc="$enableval"], [enable_bpfc="no"])
Packit Service d1fe03
AC_ARG_ENABLE([nfsynproxy],
Packit Service d1fe03
	AS_HELP_STRING([--enable-nfsynproxy], [Build SYNPROXY configuration tool]),
Packit Service d1fe03
	[enable_nfsynproxy="$enableval"], [enable_nfsynproxy="no"])
Packit Service d1fe03
AC_ARG_WITH([pkgconfigdir], AS_HELP_STRING([--with-pkgconfigdir=PATH],
Packit Service d1fe03
	[Path to the pkgconfig directory [[LIBDIR/pkgconfig]]]),
Packit Service d1fe03
	[pkgconfigdir="$withval"], [pkgconfigdir='${libdir}/pkgconfig'])
Packit Service d1fe03
AC_ARG_ENABLE([nftables],
Packit Service d1fe03
	AS_HELP_STRING([--disable-nftables], [Do not build nftables compat]),
Packit Service d1fe03
	[enable_nftables="$enableval"], [enable_nftables="yes"])
Packit Service d1fe03
AC_ARG_ENABLE([connlabel],
Packit Service d1fe03
	AS_HELP_STRING([--disable-connlabel],
Packit Service d1fe03
	[Do not build libnetfilter_conntrack]),
Packit Service d1fe03
	[enable_connlabel="$enableval"], [enable_connlabel="yes"])
Packit Service d1fe03
AC_ARG_WITH([xt-lock-name], AS_HELP_STRING([--with-xt-lock-name=PATH],
Packit Service d1fe03
	[Path to the xtables lock [[/run/xtables.lock]]]),
Packit Service d1fe03
	[xt_lock_name="$withval"],
Packit Service d1fe03
	[xt_lock_name="/run/xtables.lock"])
Packit Service d1fe03
Packit Service d1fe03
AC_MSG_CHECKING([whether $LD knows -Wl,--no-undefined])
Packit Service d1fe03
saved_LDFLAGS="$LDFLAGS";
Packit Service d1fe03
LDFLAGS="-Wl,--no-undefined";
Packit Service d1fe03
AC_LINK_IFELSE([AC_LANG_SOURCE([int main(void) {}])],
Packit Service d1fe03
	[noundef_LDFLAGS="$LDFLAGS"; AC_MSG_RESULT([yes])],
Packit Service d1fe03
	[AC_MSG_RESULT([no])]
Packit Service d1fe03
)
Packit Service d1fe03
LDFLAGS="$saved_LDFLAGS";
Packit Service d1fe03
Packit Service d1fe03
blacklist_modules=""
Packit Service d1fe03
blacklist_x_modules=""
Packit Service d1fe03
blacklist_b_modules=""
Packit Service d1fe03
blacklist_a_modules=""
Packit Service d1fe03
blacklist_4_modules=""
Packit Service d1fe03
blacklist_6_modules=""
Packit Service d1fe03
Packit Service d1fe03
AC_CHECK_HEADERS([linux/dccp.h linux/ip_vs.h linux/magic.h linux/proc_fs.h linux/bpf.h])
Packit Service d1fe03
if test "$ac_cv_header_linux_dccp_h" != "yes"; then
Packit Service d1fe03
	blacklist_modules="$blacklist_modules dccp";
Packit Service d1fe03
fi;
Packit Service d1fe03
if test "$ac_cv_header_linux_ip_vs_h" != "yes"; then
Packit Service d1fe03
	blacklist_modules="$blacklist_modules ipvs";
Packit Service d1fe03
fi;
Packit Service d1fe03
Packit Service d1fe03
AC_CHECK_SIZEOF([struct ip6_hdr], [], [#include <netinet/ip6.h>])
Packit Service d1fe03
Packit Service d1fe03
AM_CONDITIONAL([ENABLE_STATIC], [test "$enable_static" = "yes"])
Packit Service d1fe03
AM_CONDITIONAL([ENABLE_SHARED], [test "$enable_shared" = "yes"])
Packit Service d1fe03
AM_CONDITIONAL([ENABLE_IPV4], [test "$enable_ipv4" = "yes"])
Packit Service d1fe03
AM_CONDITIONAL([ENABLE_IPV6], [test "$enable_ipv6" = "yes"])
Packit Service d1fe03
AM_CONDITIONAL([ENABLE_LARGEFILE], [test "$enable_largefile" = "yes"])
Packit Service d1fe03
AM_CONDITIONAL([ENABLE_DEVEL], [test "$enable_devel" = "yes"])
Packit Service d1fe03
AM_CONDITIONAL([ENABLE_LIBIPQ], [test "$enable_libipq" = "yes"])
Packit Service d1fe03
AM_CONDITIONAL([ENABLE_BPFC], [test "$enable_bpfc" = "yes"])
Packit Service d1fe03
AM_CONDITIONAL([ENABLE_SYNCONF], [test "$enable_nfsynproxy" = "yes"])
Packit Service d1fe03
AM_CONDITIONAL([ENABLE_NFTABLES], [test "$enable_nftables" = "yes"])
Packit Service d1fe03
AM_CONDITIONAL([ENABLE_CONNLABEL], [test "$enable_connlabel" = "yes"])
Packit Service d1fe03
Packit Service d1fe03
if test "x$enable_bpfc" = "xyes" || test "x$enable_nfsynproxy" = "xyes"; then
Packit Service d1fe03
	AC_CHECK_LIB(pcap, pcap_compile,, AC_MSG_ERROR(missing libpcap library required by bpf compiler or nfsynproxy tool))
Packit Service d1fe03
fi
Packit Service d1fe03
Packit Service d1fe03
PKG_CHECK_MODULES([libnfnetlink], [libnfnetlink >= 1.0],
Packit Service d1fe03
	[nfnetlink=1], [nfnetlink=0])
Packit Service d1fe03
AM_CONDITIONAL([HAVE_LIBNFNETLINK], [test "$nfnetlink" = 1])
Packit Service d1fe03
Packit Service d1fe03
if test "x$enable_nftables" = "xyes"; then
Packit Service d1fe03
	PKG_CHECK_MODULES([libmnl], [libmnl >= 1.0], [mnl=1], [mnl=0])
Packit Service d1fe03
Packit Service d1fe03
	if test "$mnl" = 0;
Packit Service d1fe03
	then
Packit Service d1fe03
		echo "*** Error: No suitable libmnl found. ***"
Packit Service d1fe03
		echo "    Please install the 'libmnl' package"
Packit Service d1fe03
		echo "    Or consider --disable-nftables to skip"
Packit Service d1fe03
		echo "    iptables-compat over nftables support."
Packit Service d1fe03
		exit 1
Packit Service d1fe03
	fi
Packit Service d1fe03
Packit Service d1fe03
	PKG_CHECK_MODULES([libnftnl], [libnftnl >= 1.1.3], [nftables=1], [nftables=0])
Packit Service d1fe03
Packit Service d1fe03
	if test "$nftables" = 0;
Packit Service d1fe03
	then
Packit Service d1fe03
		echo "*** Error: no suitable libnftnl found. ***"
Packit Service d1fe03
		echo "    Please install the 'libnftnl' package"
Packit Service d1fe03
		echo "    Or consider --disable-nftables to skip"
Packit Service d1fe03
		echo "    iptables-compat over nftables support."
Packit Service d1fe03
		exit 1
Packit Service d1fe03
	fi
Packit Service d1fe03
fi
Packit Service d1fe03
Packit Service d1fe03
AM_CONDITIONAL([HAVE_LIBMNL], [test "$mnl" = 1])
Packit Service d1fe03
AM_CONDITIONAL([HAVE_LIBNFTNL], [test "$nftables" = 1])
Packit Service d1fe03
Packit Service d1fe03
if test "$nftables" != 1; then
Packit Service d1fe03
	blacklist_b_modules="$blacklist_b_modules limit mark nflog mangle"
Packit Service d1fe03
	blacklist_a_modules="$blacklist_a_modules mangle"
Packit Service d1fe03
fi
Packit Service d1fe03
Packit Service d1fe03
if test "x$enable_connlabel" = "xyes"; then
Packit Service d1fe03
	PKG_CHECK_MODULES([libnetfilter_conntrack],
Packit Service d1fe03
		[libnetfilter_conntrack >= 1.0.6],
Packit Service d1fe03
		[nfconntrack=1], [nfconntrack=0])
Packit Service d1fe03
Packit Service d1fe03
	if test "$nfconntrack" -ne 1; then
Packit Service d1fe03
		blacklist_modules="$blacklist_modules connlabel";
Packit Service d1fe03
		echo "WARNING: libnetfilter_conntrack not found, connlabel match will not be built";
Packit Service d1fe03
		enable_connlabel="no";
Packit Service d1fe03
	fi;
Packit Service d1fe03
else
Packit Service d1fe03
	blacklist_modules="$blacklist_modules connlabel";
Packit Service d1fe03
fi;
Packit Service d1fe03
Packit Service d1fe03
AM_CONDITIONAL([HAVE_LIBNETFILTER_CONNTRACK], [test "$nfconntrack" = 1])
Packit Service d1fe03
Packit Service d1fe03
AC_SUBST([blacklist_modules])
Packit Service d1fe03
AC_SUBST([blacklist_x_modules])
Packit Service d1fe03
AC_SUBST([blacklist_b_modules])
Packit Service d1fe03
AC_SUBST([blacklist_a_modules])
Packit Service d1fe03
AC_SUBST([blacklist_4_modules])
Packit Service d1fe03
AC_SUBST([blacklist_6_modules])
Packit Service d1fe03
Packit Service d1fe03
regular_CFLAGS="-Wall -Waggregate-return -Wmissing-declarations \
Packit Service d1fe03
	-Wmissing-prototypes -Wredundant-decls -Wshadow -Wstrict-prototypes \
Packit Service d1fe03
	-Wlogical-op \
Packit Service d1fe03
	-Winline -pipe";
Packit Service d1fe03
regular_CPPFLAGS="${largefile_cppflags} -D_REENTRANT \
Packit Service d1fe03
	-DXTABLES_LIBDIR=\\\"\${xtlibdir}\\\" -DXTABLES_INTERNAL";
Packit Service d1fe03
kinclude_CPPFLAGS="";
Packit Service d1fe03
if [[ -n "$kbuilddir" ]]; then
Packit Service d1fe03
	kinclude_CPPFLAGS="$kinclude_CPPFLAGS -I$kbuilddir/include/uapi -I$kbuilddir/include";
Packit Service d1fe03
fi;
Packit Service d1fe03
if [[ -n "$ksourcedir" ]]; then
Packit Service d1fe03
	kinclude_CPPFLAGS="$kinclude_CPPFLAGS -I$ksourcedir/include/uapi -I$ksourcedir/include";
Packit Service d1fe03
fi;
Packit Service d1fe03
pkgdatadir='${datadir}/xtables';
Packit Service d1fe03
Packit Service d1fe03
define([EXPAND_VARIABLE],
Packit Service d1fe03
[$2=[$]$1
Packit Service d1fe03
if test $prefix = 'NONE'; then
Packit Service d1fe03
	prefix="/usr/local"
Packit Service d1fe03
fi
Packit Service d1fe03
while true; do
Packit Service d1fe03
  case "[$]$2" in
Packit Service d1fe03
    *\[$]* ) eval "$2=[$]$2" ;;
Packit Service d1fe03
    *) break ;;
Packit Service d1fe03
  esac
Packit Service d1fe03
done
Packit Service d1fe03
eval "$2=[$]$2"
Packit Service d1fe03
])dnl EXPAND_VARIABLE
Packit Service d1fe03
Packit Service d1fe03
AC_SUBST([regular_CFLAGS])
Packit Service d1fe03
AC_SUBST([regular_CPPFLAGS])
Packit Service d1fe03
AC_SUBST([noundef_LDFLAGS])
Packit Service d1fe03
AC_SUBST([kinclude_CPPFLAGS])
Packit Service d1fe03
AC_SUBST([kbuilddir])
Packit Service d1fe03
AC_SUBST([ksourcedir])
Packit Service d1fe03
AC_SUBST([xtlibdir])
Packit Service d1fe03
AC_SUBST([pkgconfigdir])
Packit Service d1fe03
AC_SUBST([pkgdatadir])
Packit Service d1fe03
AC_SUBST([libxtables_vcurrent])
Packit Service d1fe03
AC_SUBST([libxtables_vage])
Packit Service d1fe03
libxtables_vmajor=$(($libxtables_vcurrent - $libxtables_vage));
Packit Service d1fe03
AC_SUBST([libxtables_vmajor])
Packit Service d1fe03
Packit Service d1fe03
AC_DEFINE_UNQUOTED([XT_LOCK_NAME], "${xt_lock_name}",
Packit Service d1fe03
	[Location of the iptables lock file])
Packit Service d1fe03
Packit Service d1fe03
AC_CONFIG_FILES([Makefile extensions/GNUmakefile include/Makefile
Packit Service d1fe03
	iptables/Makefile iptables/xtables.pc
Packit Service d1fe03
	iptables/iptables.8 iptables/iptables-extensions.8.tmpl
Packit Service d1fe03
	iptables/iptables-save.8 iptables/iptables-restore.8
Packit Service d1fe03
	iptables/iptables-apply.8 iptables/iptables-xml.1
Packit Service d1fe03
	libipq/Makefile libipq/libipq.pc
Packit Service d1fe03
	libiptc/Makefile libiptc/libiptc.pc
Packit Service d1fe03
	libiptc/libip4tc.pc libiptc/libip6tc.pc
Packit Service d1fe03
	libxtables/Makefile utils/Makefile
Packit Service d1fe03
	include/xtables-version.h
Packit Service d1fe03
	iptables/xtables-monitor.8
Packit Service d1fe03
	utils/nfnl_osf.8
Packit Service d1fe03
	utils/nfbpf_compile.8])
Packit Service d1fe03
AC_OUTPUT
Packit Service d1fe03
Packit Service d1fe03
Packit Service d1fe03
EXPAND_VARIABLE(xtlibdir, e_xtlibdir)
Packit Service d1fe03
EXPAND_VARIABLE(pkgconfigdir, e_pkgconfigdir)
Packit Service d1fe03
Packit Service d1fe03
echo "
Packit Service d1fe03
Iptables Configuration:
Packit Service d1fe03
  IPv4 support:				${enable_ipv4}
Packit Service d1fe03
  IPv6 support:				${enable_ipv6}
Packit Service d1fe03
  Devel support:			${enable_devel}
Packit Service d1fe03
  IPQ support:				${enable_libipq}
Packit Service d1fe03
  Large file support:			${enable_largefile}
Packit Service d1fe03
  BPF utils support:			${enable_bpfc}
Packit Service d1fe03
  nfsynproxy util support:		${enable_nfsynproxy}
Packit Service d1fe03
  nftables support:			${enable_nftables}
Packit Service d1fe03
  connlabel support:			${enable_connlabel}
Packit Service d1fe03
Packit Service d1fe03
Build parameters:
Packit Service d1fe03
  Put plugins into executable (static):	${enable_static}
Packit Service d1fe03
  Support plugins via dlopen (shared):	${enable_shared}
Packit Service d1fe03
  Installation prefix (--prefix):	${prefix}
Packit Service d1fe03
  Xtables extension directory:		${e_xtlibdir}
Packit Service d1fe03
  Pkg-config directory:			${e_pkgconfigdir}
Packit Service d1fe03
  Xtables lock file:			${xt_lock_name}"
Packit Service d1fe03
Packit Service d1fe03
if [[ -n "$ksourcedir" ]]; then
Packit Service d1fe03
	echo "  Kernel source directory:		${ksourcedir}"
Packit Service d1fe03
fi;
Packit Service d1fe03
if [[ -n "$kbuilddir" ]]; then
Packit Service d1fe03
	echo "  Kernel build directory:		${kbuilddir}"
Packit Service d1fe03
fi;
Packit Service d1fe03
Packit Service d1fe03
echo "  Host:					${host}
Packit Service d1fe03
  GCC binary:				${CC}"
Packit Service d1fe03
Packit Service d1fe03
test x"$blacklist_modules" = "x" || echo "
Packit Service d1fe03
Iptables modules that will not be built: $blacklist_modules"