@@ -63,6 +63,10 @@ AC_ARG_WITH([pkgconfigdir], AS_HELP_STRING([--with-pkgconfigdir=PATH],
AC_ARG_ENABLE([nftables],
AS_HELP_STRING([--disable-nftables], [Do not build nftables compat]),
[enable_nftables="$enableval"], [enable_nftables="yes"])
+AC_ARG_ENABLE([bashcompl],
+ AS_HELP_STRING([--enable-bashcompl],
+ [Install bash completion for iptables]),
+ [enable_bashcompl="$enableval"], [enable_bashcompl="no"])
libiptc_LDFLAGS2="";
AX_CHECK_LINKER_FLAGS([-Wl,--no-as-needed],
@@ -160,6 +164,11 @@ if test "x$enable_nftables" = "xyes"; then
fi
fi
+if test "x$enable_bashcompl" = "xyes"; then
+ PKG_CHECK_VAR(bashcompdir, [bash-completion], [completionsdir], , bashcompdir="${sysconfdir}/bash_completion.d")
+ AC_SUBST(bashcompdir)
+fi
+
AM_CONDITIONAL([HAVE_LIBMNL], [test "$mnl" = 1])
AM_CONDITIONAL([HAVE_LIBNFTNL], [test "$nftables" = 1])
@@ -242,6 +251,7 @@ Iptables Configuration:
Large file support: ${enable_largefile}
BPF utils support: ${enable_bpfc}
nfsynproxy util support: ${enable_nfsynproxy}
+ bash completion support: ${enable_bashcompl}
nftables support: ${enable_nftables}
Build parameters:
@@ -251,6 +261,9 @@ Build parameters:
Xtables extension directory: ${e_xtlibdir}
Pkg-config directory: ${e_pkgconfigdir}"
+if [[ -n "$bashcompdir" ]]; then
+ echo " Bash completion directory: ${bashcompdir}"
+fi;
if [[ -n "$ksourcedir" ]]; then
echo " Kernel source directory: ${ksourcedir}"
fi;
@@ -23,3 +23,6 @@ if ENABLE_SYNCONF
sbin_PROGRAMS += nfsynproxy
nfsynproxy_LDADD = -lpcap
endif
+
+bashcompdir = @bashcompdir@
+dist_bashcomp_DATA = iptables-bash_completion/iptables
Add the configure option --enable-bashcompl (default disabled). The PKG_CHECK_VAR requires pkg-config 0.28 or greater. Signed-off-by: Mart Frauenlob <mart.frauenlob@chello.at> --- configure.ac | 13 +++++++++++++ utils/Makefile.am | 3 +++ 2 files changed, 16 insertions(+), 0 deletions(-)