]> git.ipfire.org Git - thirdparty/iptables.git/commitdiff
configure: display summary
authorEric Leblond <eric@regit.org>
Wed, 5 Jun 2013 02:16:25 +0000 (04:16 +0200)
committerPablo Neira Ayuso <pablo@netfilter.org>
Wed, 5 Jun 2013 02:20:38 +0000 (04:20 +0200)
This patch adds a message at the end of configure which displays
the different compilation options and system settings.

An example output is the following:

Iptables Configuration:
  IPv4 support: yes
  IPv6 support: yes
  Devel support: yes
  IPQ support: no
  Large file support: yes
  BPF utils support: no

Build parameters:
  Put plugins into executable (static): no
  Support plugins via dlopen (shared): yes
  Installation prefix (--prefix): /usr/local
  Xtables extension directory: /usr/local/lib/xtables
  Pkg-config directory: /usr/local/lib/pkgconfig
  Kernel build directory: /lib/modules/custom
  Host: x86_64-unknown-linux-gnu
  GCC binary: gcc

Signed-off-by: Eric Leblond <eric@regit.org>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
configure.ac

index 3e5e8268b52e7e95857668ba6daf5fb57eee4172..d209494507352564dd041673a20c940b370287a8 100644 (file)
@@ -49,10 +49,11 @@ AC_ARG_ENABLE([devel],
        [Install Xtables development headers]),
        [enable_devel="$enableval"], [enable_devel="yes"])
 AC_ARG_ENABLE([libipq],
-       AS_HELP_STRING([--enable-libipq], [Build and install libipq]))
+       AS_HELP_STRING([--enable-libipq], [Build and install libipq]),
+       [enable_libipq="$enableval"], [enable_libipq="no"])
 AC_ARG_ENABLE([bpf-compiler],
        AS_HELP_STRING([--enable-bpf-compiler], [Build bpf compiler]),
-       [enable_bpfc="yes"])
+       [enable_bpfc="yes"], [enable_bpfc="no"])
 AC_ARG_WITH([pkgconfigdir], AS_HELP_STRING([--with-pkgconfigdir=PATH],
        [Path to the pkgconfig directory [[LIBDIR/pkgconfig]]]),
        [pkgconfigdir="$withval"], [pkgconfigdir='${libdir}/pkgconfig'])
@@ -111,6 +112,20 @@ if [[ -n "$ksourcedir" ]]; then
 fi;
 pkgdatadir='${datadir}/xtables';
 
+define([EXPAND_VARIABLE],
+[$2=[$]$1
+if test $prefix = 'NONE'; then
+       prefix="/usr/local"
+fi
+while true; do
+  case "[$]$2" in
+    *\[$]* ) eval "$2=[$]$2" ;;
+    *) break ;;
+  esac
+done
+eval "$2=[$]$2"
+])dnl EXPAND_VARIABLE
+
 AC_SUBST([regular_CFLAGS])
 AC_SUBST([regular_CPPFLAGS])
 AC_SUBST([noundef_LDFLAGS])
@@ -135,3 +150,33 @@ AC_CONFIG_FILES([Makefile extensions/GNUmakefile include/Makefile
        libxtables/Makefile utils/Makefile
        include/xtables-version.h include/iptables/internal.h])
 AC_OUTPUT
+
+
+EXPAND_VARIABLE(xtlibdir, e_xtlibdir)
+EXPAND_VARIABLE(pkgconfigdir, e_pkgconfigdir)
+
+echo "
+Iptables Configuration:
+  IPv4 support:                                ${enable_ipv4}
+  IPv6 support:                                ${enable_ipv6}
+  Devel support:                       ${enable_devel}
+  IPQ support:                         ${enable_libipq}
+  Large file support:                  ${enable_largefile}
+  BPF utils support:                   ${enable_bpfc}
+
+Build parameters:
+  Put plugins into executable (static):        ${enable_static}
+  Support plugins via dlopen (shared): ${enable_shared}
+  Installation prefix (--prefix):      ${prefix}
+  Xtables extension directory:         ${e_xtlibdir}
+  Pkg-config directory:                        ${e_pkgconfigdir}"
+
+if [[ -n "$ksourcedir" ]]; then
+       echo "  Kernel source directory:                ${ksourcedir}"
+fi;
+if [[ -n "$kbuilddir" ]]; then
+       echo "  Kernel build directory:         ${kbuilddir}"
+fi;
+
+echo "  Host:                                  ${host}
+  GCC binary:                          ${CC}"