From 2da431d3685c65d4355d387e213a3cd39d5b59f3 Mon Sep 17 00:00:00 2001 From: Neutron Soutmun Date: Thu, 10 May 2012 08:05:53 +0200 Subject: Add dynamic module support to ipset userspace tool The patch adds supporting dynamic modules for the set types to ipset userspace tool. The dynamic module support can be enabled by the --enable-settype-modules of "configure". The list of set types to be compiled as dynamic modules can be specified in the --with-settype-modules-list option. Example --enable-settype-modules \ --with-settype-modules-list="ipset_hash_ip ipset_hash_ipport" The keyword "all" can be used to compile all set types as dynamic modules. --- configure.ac | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) (limited to 'configure.ac') diff --git a/configure.ac b/configure.ac index 00f1115..7e7cf75 100644 --- a/configure.ac +++ b/configure.ac @@ -6,6 +6,11 @@ AC_CONFIG_MACRO_DIR([m4]) AC_CONFIG_HEADER([config.h]) AM_INIT_AUTOMAKE([foreign subdir-objects tar-pax]) +AC_ENABLE_STATIC +LT_INIT([dlopen]) +LT_CONFIG_LTDL_DIR([libltdl]) +LTDL_INIT([nonrecursive]) + dnl Shortcut: Linux supported alone case "$host" in *-*-linux*) ;; @@ -100,6 +105,43 @@ AC_ARG_ENABLE([debug], AM_CONDITIONAL([ENABLE_DEBUG], [test "x$enable_debug" = xyes]) +dnl Enable type modules +AC_ARG_ENABLE([settype_modules], + AS_HELP_STRING([--enable-settype-modules], + [Enable set type modules support]), + [enable_settype_modules="$enableval"], + [enable_settype_modules="no"]) + +AC_ARG_WITH([settype_modules_list], + AS_HELP_STRING([--with-settype-modules-list="mod1 mod2 ..."], + [List of dynamic loading modules, ignored if settype-modules is disabled. It could be "all" to build all available settypes as modules]), + [SETTYPE_MODLIST_RAW="$withval";]) + +SETTYPE_MODLIST= +if test "x$enable_settype_modules" = "xyes"; then + for mod in $SETTYPE_MODLIST_RAW; do + if echo $mod | grep "all"; then + m="${mod}" + else + if echo $mod | grep "ipset_"; then + m="${mod}.c" + else + m="ipset_${mod}.c" + fi + fi + + SETTYPE_MODLIST="${SETTYPE_MODLIST} $m" + done + + AC_MSG_RESULT([checking for configuration with dynamic loading modules... $SETTYPE_MODLIST_RAW]) +fi +AC_SUBST(SETTYPE_MODLIST) + +AM_CONDITIONAL([ENABLE_SETTYPE_MODULES], [test "x$enable_settype_modules" = xyes]) + +AM_CONDITIONAL([ENABLE_STATIC], [test "x$enable_static" = xyes]) +AM_CONDITIONAL([ENABLE_SHARED], [test "x$enable_shared" = xyes]) + dnl Checks for programs : ${CFLAGS=""} -- cgit v1.2.3