]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
autoconf macros for tidying module config
authorMatthew Newton <matthew-git@newtoncomputing.co.uk>
Fri, 30 Sep 2022 15:53:07 +0000 (16:53 +0100)
committerMatthew Newton <matthew-git@newtoncomputing.co.uk>
Sun, 2 Oct 2022 17:08:23 +0000 (18:08 +0100)
Add a nice report at the _end_ of configure, so there's no excuse
of missing a "silently unconfigured" module any more.

34 files changed:
.gitignore
configure.ac
m4/fr_init_module.m4
m4/fr_module_start_tests.m4 [new file with mode: 0644]
src/modules/rlm_cache/configure.ac
src/modules/rlm_cache/drivers/rlm_cache_memcached/configure.ac
src/modules/rlm_couchbase/configure.ac
src/modules/rlm_eap/configure.ac
src/modules/rlm_idn/configure.ac
src/modules/rlm_krb5/configure.ac
src/modules/rlm_lua/configure.ac
src/modules/rlm_mruby/configure.ac
src/modules/rlm_mschap/configure.ac
src/modules/rlm_opendirectory/configure.ac
src/modules/rlm_pam/configure.ac
src/modules/rlm_perl/configure.ac
src/modules/rlm_python/configure.ac
src/modules/rlm_radutmp/configure.ac
src/modules/rlm_securid/configure.ac
src/modules/rlm_sigtran/configure.ac
src/modules/rlm_sql/configure.ac
src/modules/rlm_sql/drivers/rlm_sql_cassandra/configure.ac
src/modules/rlm_sql/drivers/rlm_sql_db2/configure.ac
src/modules/rlm_sql/drivers/rlm_sql_firebird/configure.ac
src/modules/rlm_sql/drivers/rlm_sql_freetds/configure.ac
src/modules/rlm_sql/drivers/rlm_sql_mysql/configure.ac
src/modules/rlm_sql/drivers/rlm_sql_oracle/configure.ac
src/modules/rlm_sql/drivers/rlm_sql_postgresql/configure.ac
src/modules/rlm_sql/drivers/rlm_sql_sqlite/configure.ac
src/modules/rlm_sql/drivers/rlm_sql_unixodbc/configure.ac
src/modules/rlm_unbound/configure.ac
src/modules/rlm_unix/configure.ac
src/modules/rlm_winbind/configure.ac
src/modules/rlm_yubikey/configure.ac

index 1e4f9c5ab68998d6b7a8d04a6540cd5e4b7c78b5..840c08f5d9665efa71c896a1698f8579491d4845 100644 (file)
@@ -62,6 +62,7 @@ libtool
 autom4te.cache
 aclocal.m4
 config.guess
+config.info
 config.sub
 config.h
 src/bin/unit_test_attribute
index 820d88bb6c00994910e63bd645a3f2c0449fc2f6..74c99f85df116add4a8a6270a77254b926313cc2 100644 (file)
@@ -2629,3 +2629,4 @@ AC_CONFIG_FILES([\
   ./raddb/radiusd.conf
 ])
 AC_OUTPUT
+FR_MODULE_REPORT
index 36c43c2221dea3393e9608e08ce307eefa09e570..41a4d280da51202a449900d2de49e579bc9f195a 100644 (file)
@@ -7,6 +7,7 @@ dnl
 AC_DEFUN([FR_INIT_MODULE],
 [
   AC_DEFUN([modname],$1)
+  AC_DEFUN([modname_useropt],[m4_bpatsubst([]modname,[[-+.]],[_])])
 
   AC_ARG_WITH([$1],
     [AS_HELP_STRING([--without-$1],[build without ]ifelse([$2],[],[$1],[$2]))])
diff --git a/m4/fr_module_start_tests.m4 b/m4/fr_module_start_tests.m4
new file mode 100644 (file)
index 0000000..7573a4d
--- /dev/null
@@ -0,0 +1,156 @@
+AC_DEFUN([FR_STATUS_FILE], [config.info])
+
+dnl
+dnl Store status about module configure state.
+dnl
+dnl Usage:
+dnl   FR_MODULE_STATUS([status])
+dnl   FR_MODULE_STATUS([status], [reason])
+dnl
+dnl First argument is the status to report, likely "OK",
+dnl "skipping" or "disabled".
+dnl
+dnl Second optional argument is the reason for skipping this
+dnl module (likely dependencies not met).
+dnl
+AC_DEFUN([FR_MODULE_STATUS],[
+ifelse([$2], [], [
+fr_status="$1"
+], [
+fr_status="$1 ($2)"
+])])
+
+
+dnl
+dnl FR_MODULE_START_TESTS
+dnl
+dnl Usage:
+dnl   FR_MODULE_START_TESTS
+dnl
+dnl Set up ready to do module-specific tests. Clears variables and
+dnl adds code to output a header before the tests to make the
+dnl configure output easier to read.
+dnl
+AC_DEFUN([FR_MODULE_START_TESTS],
+[
+fail=
+fr_status=
+
+m4_divert_text([SHELL_FN], [
+echo
+echo Running tests for modname
+echo
+])
+
+if test x"$with_[]modname" != xno; then
+])
+
+
+dnl
+dnl FR_MODULE_END_TESTS
+dnl
+dnl Usage:
+dnl   FR_MODULE_END_TESTS
+dnl   FR_MODULE_END_TESTS([nostrict])
+dnl
+dnl If passed "nostrict", checks will be made for the
+dnl enable_strict_dependencies flag.
+dnl
+dnl Called at the end of module-specific tests. This outputs
+dnl information on whether the module is disabled or not, or why
+dnl configuration failed. It also stores the status for a summary
+dnl to be printed at the end of the main configure script.
+dnl
+AC_DEFUN([FR_MODULE_END_TESTS], [
+       targetname=modname
+else
+       targetname=
+       echo \*\*\* module modname is disabled.
+       FR_MODULE_STATUS([disabled])
+fi
+
+if test x"$fail" != x""; then
+       targetname=""
+
+ifelse([$1], [nostrict], [], [
+       if test x"${enable_strict_dependencies}" = x"yes"; then
+               AC_MSG_ERROR([set --without-]modname[ to disable it explicitly.])
+       else
+])
+               AC_MSG_WARN([silently not building ]modname[.])
+               AC_MSG_WARN([FAILURE: ]modname[ requires: $fail.]);
+               fail="$(echo $fail)"
+               FR_MODULE_STATUS([skipping], [requires $fail])
+ifelse([$1], [nostrict], [], [
+       fi
+])
+else
+       FR_MODULE_STATUS([OK])
+fi
+
+echo "$fr_status" > FR_STATUS_FILE
+
+AC_SUBST(targetname)
+])
+
+
+dnl
+dnl FR_MODULE_TEST_FAIL_DO
+dnl
+dnl Usage:
+dnl   FR_MODULE_TEST_FAIL_DO([commands])
+dnl
+dnl Run commands when the module tests fail and the module is not
+dnl going to be built.
+dnl
+AC_DEFUN([FR_MODULE_TEST_FAIL_DO], [
+if test x"$fail" != x""; then :
+       $1
+fi
+])
+
+dnl
+dnl FR_MODULE_TEST_PASS_DO
+dnl
+dnl Usage:
+dnl   FR_MODULE_TEST_PASS_DO([commands])
+dnl
+dnl Run commands when the module tests succeed and the module is
+dnl going to be built.
+dnl
+AC_DEFUN([FR_MODULE_TEST_PASS_DO], [
+if test x"$fail" = x""; then :
+       $1
+fi
+])
+
+
+dnl
+dnl FR_MODULE_REPORT
+dnl
+dnl Usage:
+dnl   FR_MODULE_REPORT
+dnl
+dnl Outputs a summary list of all modules and any configure errors.
+dnl
+AC_DEFUN([FR_MODULE_REPORT], [
+module_list=$(find src/modules/ -type d -name 'rlm_*' -print | sort)
+
+echo
+echo Module configure status report
+echo ------------------------------
+
+for module in $module_list; do
+  module_name="$(basename $module)"
+  module_print="$(echo "$module_name ........................" | cut -c 1-25)"
+  module_status="OK"
+
+  if test -r $module/configure.ac; then
+    if test -r $module/FR_STATUS_FILE; then
+      module_status=$(head -1 $module/FR_STATUS_FILE)
+    fi
+  fi
+
+  echo "$module_print $module_status"
+done
+])
index 3202fd9305a4102351bf59af93f637f57841b3a6..a4197f5ab9db9f315f77fc4197fa67881c1ebdc2 100644 (file)
@@ -4,11 +4,10 @@ AC_CONFIG_SRCDIR([rlm_cache.c])
 AC_REVISION($Revision$)
 FR_INIT_MODULE([rlm_cache])
 
-fail=
 SMART_LIBS=
 SMART_CLFAGS=
 
-if test x$with_[]modname != xno; then
+FR_MODULE_START_TESTS
 
        AC_PROG_CC
 
@@ -38,12 +37,7 @@ if test x$with_[]modname != xno; then
        dnl # Don't bother looking for errors in the child directories
        dnl #
 
-       targetname=modname
-else
-       targetname=
-       echo \*\*\* module modname is disabled.
-fi
+FR_MODULE_END_TESTS([nostrict])
 
-AC_SUBST(targetname)
 AC_CONFIG_FILES([all.mk])
 AC_OUTPUT
index fed1719edcb65cde732a4434b8e5495b4c555ff2..d6b2dac806ee9a9b2634422ccdd07abab2a9713c 100644 (file)
@@ -4,7 +4,7 @@ AC_CONFIG_SRCDIR([rlm_cache_memcached.c])
 AC_REVISION($Revision$)
 FR_INIT_MODULE([rlm_cache_memcached])
 
-if test x$with_[]modname != xno; then
+FR_MODULE_START_TESTS
 
        AC_PROG_CC
        AC_PROG_CPP
@@ -105,22 +105,7 @@ if test x$with_[]modname != xno; then
         ,, [fail="memached functions"])
        fi
 
-       targetname=modname
-else
-       targetname=
-       echo \*\*\* module modname is disabled.
-fi
-
-dnl  Don't change this section.
-if test x"$fail" != x""; then
-       if test x"${enable_strict_dependencies}" = x"yes"; then
-               AC_MSG_ERROR([set --without-]modname[ to disable it explicitly.])
-       else
-               AC_MSG_WARN([silently not building ]modname[.])
-               AC_MSG_WARN([FAILURE: ]modname[ requires: $fail.]);
-               targetname=""
-       fi
-fi
+FR_MODULE_END_TESTS
 
 mod_ldflags="$LIBCURL $SMART_LIBS"
 mod_cflags="$SMART_CPPFLAGS"
@@ -128,6 +113,5 @@ mod_cflags="$SMART_CPPFLAGS"
 AC_SUBST(mod_cflags)
 AC_SUBST(mod_ldflags)
 
-AC_SUBST(targetname)
 AC_CONFIG_FILES([all.mk])
 AC_OUTPUT
index d9f109c280de8717edd46ee7e3ad910fc92ab102..6127be12247b05b5c5d720cf2877fa5902635516 100644 (file)
@@ -3,9 +3,8 @@ AC_INIT
 AC_CONFIG_SRCDIR([rlm_couchbase.c])
 AC_REVISION($Revision$)
 FR_INIT_MODULE([rlm_couchbase])
-AC_CONFIG_HEADER(config.h)
 
-if test x$with_[]modname != xno; then
+FR_MODULE_START_TESTS
 
        AC_PROG_CC
        AC_PROG_CPP
@@ -93,26 +92,7 @@ if test x$with_[]modname != xno; then
                fail="$fail libcouchbase"
        fi
 
-       dnl ############################################################
-       dnl # Checks done - set targetname
-       dnl ############################################################
-
-       targetname=modname
-else
-       targetname=
-       echo \*\*\* module modname is disabled.
-fi
-
-dnl  Don't change this section.
-if test x"$fail" != x""; then
-       if test x"${enable_strict_dependencies}" = x"yes"; then
-               AC_MSG_ERROR([set --without-]modname[ to disable it explicitly.])
-       else
-               AC_MSG_WARN([silently not building ]modname[.])
-               AC_MSG_WARN([FAILURE: ]modname[ requires: $fail.]);
-               targetname=""
-       fi
-fi
+FR_MODULE_END_TESTS
 
 mod_ldflags="${SMART_LIBS}"
 mod_cflags="${SMART_CPPFLAGS}"
@@ -120,6 +100,6 @@ mod_cflags="${SMART_CPPFLAGS}"
 AC_SUBST(mod_cflags)
 AC_SUBST(mod_ldflags)
 
-AC_SUBST(targetname)
+AC_CONFIG_HEADER([config.h])
 AC_CONFIG_FILES([all.mk])
 AC_OUTPUT
index 0b6b653c9b4583ef61a9c16358f619652923da8b..130c563a071b2994a4d6c6b37a553dd83b127256 100644 (file)
@@ -4,15 +4,14 @@ AC_CONFIG_SRCDIR([rlm_eap.c])
 AC_REVISION($Revision$)
 FR_INIT_MODULE([rlm_eap])
 
-fail=
 SMART_LIBS=
 SMART_CLFAGS=
+eapsubdirs=
 
-if test x$with_[]modname != xno; then
+FR_MODULE_START_TESTS
 
        AC_PROG_CC
 
-       eapsubdirs=
        for foo in `find ./types -name configure -print`; do
          bar=`echo $foo | sed 's%/configure$%%g'`
          eapsubdirs="$eapsubdirs $bar"
@@ -32,28 +31,9 @@ if test x$with_[]modname != xno; then
        dnl # Don't bother looking for errors in the child directories
        dnl #
 
-       targetname=modname
-else
-       targetname=
-       echo \*\*\* module modname is disabled.
-fi
+FR_MODULE_END_TESTS
 
-if test x"$fail" != x""; then
-       if test x"${enable_strict_dependencies}" = x"yes"; then
-               AC_MSG_ERROR([set --without-]modname[ to disable it explicitly.])
-       else
-               AC_MSG_WARN([silently not building ]modname[.])
-               AC_MSG_WARN([FAILURE: ]modname[ requires: $fail.])
-               if test x"$headersuggestion" != x; then
-                       AC_MSG_WARN([$headersuggestion])
-               fi
-               if test x"$libsuggestion" != x; then
-                       AC_MSG_WARN([$libsuggestion])
-               fi
-               targetname=""
-           eapsubdirs=""
-       fi
-fi
+FR_MODULE_TEST_FAIL_DO([eapsubdirs=""])
 
 eaptypes=types
 if test x"$eapsubdirs" = x""; then
@@ -66,5 +46,4 @@ mod_cflags="$SMART_CPPFLAGS"
 AC_SUBST(eaptypes)
 AC_SUBST(mod_ldflags)
 AC_SUBST(mod_cflags)
-AC_SUBST(targetname)
 AC_OUTPUT
index 71d5193dc208c117e515bf218481e34a07afacfa..a4069af6cf1b4db4a7480287ec43b3e4bca58a74 100644 (file)
@@ -3,7 +3,7 @@ AC_CONFIG_SRCDIR([rlm_idn.c])
 AC_REVISION($Revision$)
 FR_INIT_MODULE([rlm_idn])
 
-if test x$with_[]modname != xno; then
+FR_MODULE_START_TESTS
 
        AC_PROG_CC
        AC_PROG_CPP
@@ -17,28 +17,14 @@ if test x$with_[]modname != xno; then
        if test "$ac_cv_header_idna_h" != "yes"; then
                fail="$fail idna.h"
        fi
-       targetname=modname
-else
-       targetname=
-       echo \*\*\* module modname is disabled.
-fi
-
-if test x"$fail" != x""; then
-       if test x"${enable_strict_dependencies}" = x"yes"; then
-               AC_MSG_ERROR([set --without-]modname[ to disable it explicitly.])
-       else
-               AC_MSG_WARN([silently not building ]modname[.])
-               AC_MSG_WARN([FAILURE: ]modname[ requires: $fail.]);
-               targetname=""
-       fi
-fi
+
+FR_MODULE_END_TESTS
 
 mod_ldflags="${SMART_LIBS}"
 mod_cflags="${SMART_CPPFLAGS}"
 
 AC_SUBST(mod_ldflags)
 AC_SUBST(mod_cflags)
-AC_SUBST(targetname)
+
 AC_CONFIG_FILES([all.mk])
 AC_OUTPUT
-
index 8bbadb690a9a871d90713c7729d28074b0dd38d2..ed84f82fc6094412ce28066165bcb0b2d8e8cdd8 100644 (file)
@@ -4,7 +4,7 @@ AC_CONFIG_SRCDIR([rlm_krb5.c])
 AC_REVISION($Revision$)
 FR_INIT_MODULE([rlm_krb5])
 
-if test x$with_[]modname != xno; then
+FR_MODULE_START_TESTS
 
        AC_PROG_CC
        AC_PROG_CPP
@@ -161,27 +161,14 @@ if test x$with_[]modname != xno; then
        else
                krb5mod_cflags="$krb5mod_cflags -DHEIMDAL_KRB5"
        fi
-       targetname=modname
-else
-       targetname=
-       echo \*\*\* module modname is disabled.
-fi
-
-if test x"$fail" != x""; then
-       if test x"${enable_strict_dependencies}" = x"yes"; then
-               AC_MSG_ERROR([set --without-]modname[ to disable it explicitly.])
-       else
-               AC_MSG_WARN([silently not building ]modname[.])
-               AC_MSG_WARN([FAILURE: ]modname[ requires: $fail.]);
-               targetname=""
-       fi
-fi
+
+FR_MODULE_END_TESTS(strict)
 
 mod_ldflags="$krb5mod_ldflags $krb5libcrypto $SMART_LIBS"
 mod_cflags="$krb5mod_cflags $krb5threadsafe $SMART_CPPFLAGS"
 
 AC_SUBST(mod_ldflags)
 AC_SUBST(mod_cflags)
-AC_SUBST(targetname)
+
 AC_CONFIG_FILES([all.mk])
 AC_OUTPUT
index 32f5f567309dd117bf3728cffb3aa3ae383b6a77..ee561b2c468304ee35accd7df838ce8f0bcf3f05 100644 (file)
@@ -4,7 +4,8 @@ AC_CONFIG_SRCDIR([rlm_lua.c])
 AC_REVISION($Revision$)
 FR_INIT_MODULE([rlm_lua], [lua support])
 
-if test x$with_[]modname != xno; then
+FR_MODULE_START_TESTS
+
        AC_PROG_CC
        AC_PROG_CPP
 
@@ -109,29 +110,11 @@ if test x$with_[]modname != xno; then
        fi
 
 
-       targetname=modname     # keep this!  Don't change!
-else
-       targetname=            # keep this!  Don't change!
-       echo \*\*\* module modname is disabled.  # keep this!  Don't change!
-fi
-
-dnl  Don't change this section.
-if test x"$fail" != x""; then
-       if test x"${enable_strict_dependencies}" = x"yes"; then
-               AC_MSG_ERROR([set --without-]modname[ to disable it explicitly.])
-       else
-               AC_MSG_WARN([silently not building ]modname[.])
-               AC_MSG_WARN([FAILURE: ]modname[ requires: $fail.]);
-               targetname=""
-       fi
-fi
+FR_MODULE_END_TESTS
 
 AC_SUBST(lua_cflags)
 AC_SUBST(lua_ldflags)
 
-
-AC_SUBST(targetname)  # keep this!  Don't change!
 AC_CONFIG_HEADER(config.h)
 AC_CONFIG_FILES([all.mk rlm_lua.mk libfreeradius-lua.mk])
 AC_OUTPUT  # keep this!  Don't change!
-
index 4802266c64d4cf47ec682354611c3ed6984a1a37..0d134723c0ba2c8d69f71fe6f0179fb76a9ef5c0 100644 (file)
@@ -3,7 +3,8 @@ AC_CONFIG_SRCDIR([rlm_mruby.c])
 AC_REVISION($Revision$)
 FR_INIT_MODULE([rlm_mruby])
 
-if test x$with_[]modname != xno; then
+FR_MODULE_START_TESTS
+
        AC_PROG_CC
        AC_PROG_CPP
 
@@ -102,27 +103,12 @@ if test x$with_[]modname != xno; then
                fail="$fail libm"
        fi
 
-       targetname=modname
-else
-       targetname=
-       echo \*\*\* module modname is disabled.
-fi
-
-if test x"$fail" != x""; then
-       if test x"${enable_strict_dependencies}" = x"yes"; then
-               AC_MSG_ERROR([set --without-]modname[ to disable it explicitly.])
-       else
-               AC_MSG_WARN([silently not building ]modname[.])
-               AC_MSG_WARN([FAILURE: ]modname[ requires: $fail.]);
-               targetname=""
-       fi
-fi
+FR_MODULE_END_TESTS
 
 mod_cflags="${SMART_CPPFLAGS}"
 
 AC_SUBST(mod_cflags)
 AC_SUBST(mod_ldflags)
 
-AC_SUBST(targetname)
 AC_CONFIG_FILES([all.mk])
 AC_OUTPUT
index 6b29418aef041cb29ce158e573f88faf30f20913..3551630cf0b8db7b352e8dc022b0e62a4625b354 100644 (file)
@@ -3,7 +3,7 @@ AC_CONFIG_SRCDIR([rlm_mschap.c])
 AC_REVISION($Revision$)
 FR_INIT_MODULE([rlm_mschap])
 
-if test x$with_[]modname != xno; then
+FR_MODULE_START_TESTS
 
     AC_PROG_CC
     AC_PROG_CPP
@@ -106,30 +106,15 @@ if test x$with_[]modname != xno; then
       fi
     fi
 
-    targetname=modname
-else
-    targetname=
-    echo \*\*\* module modname is disabled.
-fi
-
-if test x"$fail" != x""; then
-       if test x"${enable_strict_dependencies}" = x"yes"; then
-               AC_MSG_ERROR([set --without-]modname[ to disable it explicitly.])
-       else
-               AC_MSG_WARN([silently not building ]modname[.])
-               AC_MSG_WARN([FAILURE: ]modname[ requires: $fail.]);
-               targetname=""
-       fi
-fi
+FR_MODULE_END_TESTS
 
 mod_ldflags="$mod_ldflags $SMART_LIBS"
 mod_cflags="$SMART_CPPFLAGS"
+
 AC_SUBST(mschap_sources)
 AC_SUBST(mod_ldflags)
 AC_SUBST(mod_cflags)
-AC_SUBST(targetname)
 
-AC_CONFIG_HEADER(config.h)
+AC_CONFIG_HEADER([config.h])
 AC_CONFIG_FILES([rlm_mschap.mk])
 AC_OUTPUT
-
index c37767afd1c3bbfa90192c29d84f32118a1ea1f6..443af53cde526097fade607cdc6c9b0c3087c303 100644 (file)
@@ -3,7 +3,7 @@ AC_CONFIG_SRCDIR([rlm_opendirectory.c])
 AC_REVISION($Revision$)
 FR_INIT_MODULE([rlm_opendirectory])
 
-if test x$with_[]modname != xno; then
+FR_MODULE_START_TESTS
 
        AC_PROG_CC
        AC_PROG_CPP
@@ -21,25 +21,12 @@ if test x$with_[]modname != xno; then
                         [mod_cflags="${mod_cflags} -DHAVE_DECL_MBR_CHECK_MEMBERSHIP_REFRESH"],
                         [],[#include <membership.h>])
        fi
-       targetname=modname
-else
-       targetname=
-       echo \*\*\* module modname is disabled.
-fi
-
-if test x"$fail" != x""; then
-       if test x"${enable_strict_dependencies}" = x"yes"; then
-               AC_MSG_ERROR([set --without-]modname[ to disable it explicitly.])
-       else
-               AC_MSG_WARN([silently not building ]modname[.])
-               AC_MSG_WARN([FAILURE: ]modname[ requires: $fail.])
-               targetname=""
-       fi
-fi
+
+FR_MODULE_END_TESTS
 
 AC_SUBST(mod_ldflags)
 AC_SUBST(mod_cflags)
-AC_SUBST(targetname)
+
 AC_CONFIG_FILES([all.mk])
 AC_OUTPUT
 
index bb44022f79130360e463e10e40055f66ba398a89..6aa41af21d503426df4e34312dc82d9fae7fda2d 100644 (file)
@@ -3,9 +3,8 @@ AC_INIT
 AC_CONFIG_SRCDIR([rlm_pam.c])
 AC_REVISION($Revision$)
 FR_INIT_MODULE([rlm_pam])
-AC_DEFUN([modname_useropt],[m4_bpatsubst([]modname,[[-+.]],[_])])
 
-if test x$with_[]modname != xno; then
+FR_MODULE_START_TESTS
 
        AC_PROG_CC
        AC_PROG_CPP
@@ -30,25 +29,11 @@ dnl #
                        )
        mod_cflags="-I."
 
-       targetname=modname
-else
-       targetname=
-       echo \*\*\* module modname is disabled.
-fi
-
-if test x"$fail" != x""; then
-       if test x"${enable_strict_dependencies}" = x"yes"; then
-               AC_MSG_ERROR([set --without-]modname[ to disable it explicitly.])
-       else
-               AC_MSG_WARN([silently not building ]modname[.])
-               AC_MSG_WARN([FAILURE: ]modname[ requires: $fail.]);
-               targetname=""
-       fi
-fi
+FR_MODULE_END_TESTS
 
 AC_SUBST(mod_ldflags)
 AC_SUBST(mod_cflags)
-AC_SUBST(targetname)
+
 AC_CONFIG_HEADER(config.h)
 AC_CONFIG_FILES([all.mk])
 AC_OUTPUT
index cbf2b121e1eb2261fd0da730e122ac82ce3ace54..36c511175812c14900a9631306bd306fdecfa351 100644 (file)
@@ -4,7 +4,8 @@ AC_CONFIG_SRCDIR([rlm_perl.c])
 AC_REVISION($Revision$)
 FR_INIT_MODULE([rlm_perl])
 
-if test x$with_[]modname != xno; then
+FR_MODULE_START_TESTS
+
        AC_PROG_CC
        AC_PROG_CPP
 
@@ -66,13 +67,11 @@ if test x$with_[]modname != xno; then
                FR_SMART_CHECK_INCLUDE(EXTERN.h)
                if test "x$ac_cv_header_EXTERN_h" != "xyes"; then
                        fail="$fail EXTERN.h"
-                       targetname=
                fi
 
                FR_SMART_CHECK_INCLUDE(perl.h, [#include <EXTERN.h>])
                if test "x$ac_cv_header_perl_h" != "xyes"; then
                        fail="$fail EXTERN.h"
-                       targetname=
                fi
 
                dnl ############################################################
@@ -87,7 +86,6 @@ if test x$with_[]modname != xno; then
                AC_MSG_RESULT($LINKS)
                if test "x$LINKS" = "xno"; then
                        fail="$fail libperl.so"
-                       targetname=
                fi
 
                AC_MSG_CHECKING([we can link to Perl_hv_store()])
@@ -99,37 +97,17 @@ if test x$with_[]modname != xno; then
                AC_MSG_RESULT($LINKS)
                if test "x$LINKS" = "xno"; then
                        fail="$fail libperl.so"
-                       targetname=
                fi
 
                CFLAGS="$old_CFLAGS"
                LIBS="$old_LIBS"
-
-               targetname=modname
-       fi
-else
-               targetname=
-               echo \*\*\* module modname is disabled.
-fi
-
-dnl  Don't change this section.
-if test x"$fail" != x""; then
-       if test x"${enable_strict_dependencies}" = x"yes"; then
-               AC_MSG_ERROR([set --without-]modname[ to disable it explicitly.])
-       else
-               AC_MSG_WARN([silently not building ]modname[.])
-               AC_MSG_WARN([FAILURE: ]modname[ requires: $fail.]);
-
-               targetname=
        fi
-fi
 
+FR_MODULE_END_TESTS
 
 AC_SUBST(mod_cflags)
 AC_SUBST(mod_ldflags)
 
 AC_CONFIG_HEADER(config.h)
-
-AC_SUBST(targetname)
 AC_CONFIG_FILES([all.mk])
 AC_OUTPUT
index 18f2dff99ed840f5dd9779327e9d069680a9a481..9e855e23fdcdd17238e28c3dc2ff8490d281bc28 100644 (file)
@@ -4,7 +4,7 @@ AC_CONFIG_SRCDIR([rlm_python.c])
 AC_REVISION($Revision$)
 FR_INIT_MODULE([rlm_python])
 
-if test x$with_[]modname != xno; then
+FR_MODULE_START_TESTS
 
        AC_PROG_CC
        AC_PROG_CPP
@@ -120,31 +120,16 @@ if test x$with_[]modname != xno; then
                AC_MSG_RESULT($LINKS)
                if test "x$LINKS" = "xno"; then
                        fail="$fail working python libraries"
-                       targetname=
                fi
 
                CFLAGS=$old_CFLAGS
                LDFLAGS=$old_LDFLAGS
-
-               targetname="rlm_python"
-       fi
-else
-       targetname=
-       echo \*\*\* module modname is disabled.
-fi
-
-if test x"$fail" != x""; then
-       if test x"${enable_strict_dependencies}" = x"yes"; then
-               AC_MSG_ERROR([set --without-]modname[ to disable it explicitly.])
-       else
-               AC_MSG_WARN([silently not building ]modname[.])
-               AC_MSG_WARN([FAILURE: ]modname[ requires: $fail.]);
-               targetname=""
        fi
-fi
+
+FR_MODULE_END_TESTS
 
 AC_SUBST(mod_ldflags)
 AC_SUBST(mod_cflags)
-AC_SUBST(targetname)
+
 AC_CONFIG_FILES([all.mk])
 AC_OUTPUT
index 2133e5eaffdb77873ad0bcf7ac7a7cf0ba236889..0966c0f856924ff0e0e07cd3ed368d7e514de6bc 100644 (file)
@@ -4,19 +4,15 @@ AC_CONFIG_SRCDIR([rlm_radutmp.c])
 AC_REVISION($Revision$)
 FR_INIT_MODULE([rlm_radutmp])
 
-if test x$with_[]modname != xno; then
+FR_MODULE_START_TESTS
 
-       AC_CHECK_HEADERS(sys/mman.h)
+AC_CHECK_HEADERS(sys/mman.h)
 
-       targetname=modname
-else
-       targetname=
-       echo \*\*\* module modname is disabled.
-fi
+FR_MODULE_END_TESTS([nostrict])
 
 AC_SUBST(mod_ldflags)
 AC_SUBST(mod_cflags)
-AC_SUBST(targetname)
+
 AC_CONFIG_HEADER(config.h)
 AC_CONFIG_FILES([all.mk])
 AC_OUTPUT
index d32f7646c64aafa1447bb49ec92b9a56f261ed97..e3aebd732eba2231fbf9230e0aaea24a11414003 100644 (file)
@@ -3,11 +3,10 @@ AC_INIT(rlm_securid.c)
 AC_REVISION($Revision$)
 FR_INIT_MODULE([rlm_securid])
 
-fail=
 SMART_LIBS=
 SMART_CLFAGS=
 
-if test x$with_[]modname != xno; then
+FR_MODULE_START_TESTS
 
     dnl ############################################################
     dnl # Check for command line options
@@ -85,26 +84,12 @@ if test x$with_[]modname != xno; then
       fail="$fail libaceclnt"
     fi
 
-    targetname=modname
-else
-    targetname=
-    echo \*\*\* module modname is disabled.
-fi
-
-dnl Don't change this section.
-if test "x$fail" != x; then
-       if test "x${enable_strict_dependencies}" = xyes; then
-               AC_MSG_ERROR([set --without-]modname[ to disable it explicitly.])
-       else
-               AC_MSG_WARN([silently not building ]modname[.])
-               AC_MSG_WARN([FAILURE: ]modname[ requires:$fail.]);
-               targetname=
-       fi
-fi
+FR_MODULE_END_TESTS
 
 mod_ldflags="$SMART_LIBS"
 mod_cflags="$SMART_CPPFLAGS"
+
 AC_SUBST(mod_ldflags)
 AC_SUBST(mod_cflags)
-AC_SUBST(targetname)
+
 AC_OUTPUT(all.mk)
index 0b4d11c1835c2d11a0da237c57c5a1184a55ab27..5ca3f2de7c671557a78015472bf85d8432286f8c 100644 (file)
@@ -4,11 +4,11 @@ AC_CONFIG_SRCDIR([rlm_sigtran.c])
 AC_REVISION($Revision$)
 FR_INIT_MODULE([rlm_sigtran])
 
-fail=
 SMART_LIBS=
 SMART_CLFAGS=
 
-if test x$with_[]modname != xno; then
+FR_MODULE_START_TESTS
+
     dnl ############################################################
     dnl # Check for command line options
     dnl ############################################################
@@ -107,28 +107,14 @@ if test x$with_[]modname != xno; then
       AC_MSG_WARN([libmtp libraries not found. Use --with-sigtran-lib-dir=<path>.])
       fail="$fail libmtp"
     fi
-    targetname=modname
-else
-    targetname=
-    echo \*\*\* module modname is disabled.
-fi
-
-dnl Don't change this section.
-if test "x$fail" != x; then
-       if test "x${enable_strict_dependencies}" = xyes; then
-               AC_MSG_ERROR([set --without-]modname[ to disable it explicitly.])
-       else
-               AC_MSG_WARN([silently not building ]modname[.])
-               AC_MSG_WARN([FAILURE: ]modname[ requires:$fail.]);
-               targetname=
-       fi
-fi
+
+FR_MODULE_END_TESTS
 
 mod_ldflags="$SMART_LIBS $(pkg-config --libs-only-other libosmocore) $(pkg-config --libs-only-other libosmo-sccp) $(pkg-config --libs-only-other libosmo-xua) $(pkg-config --libs-only-other libosmo-mtp) $(net-snmp-config --agent-libs 2>&-) -lsctp"
 mod_cflags="$SMART_CPPFLAGS"
+
 AC_SUBST(mod_ldflags)
 AC_SUBST(mod_cflags)
-AC_SUBST(targetname)
+
 AC_CONFIG_FILES([all.mk])
 AC_OUTPUT
-
index c696ae392e9363833c2a6714d1d211f757c0f14d..8f4078e0b8ad48df379740cd7301d927d965081f 100644 (file)
@@ -4,11 +4,10 @@ AC_CONFIG_SRCDIR([rlm_sql.c])
 AC_REVISION($Revision$)
 FR_INIT_MODULE([rlm_sql])
 
-fail=
 SMART_LIBS=
 SMART_CLFAGS=
 
-if test x$with_[]modname != xno; then
+FR_MODULE_START_TESTS
 
        AC_PROG_CC
 
@@ -38,33 +37,13 @@ if test x$with_[]modname != xno; then
        dnl # Don't bother looking for errors in the child directories
        dnl #
 
-       targetname=modname
-else
-       targetname=
-       echo \*\*\* module modname is disabled.
-fi
-
-if test x"$fail" != x""; then
-       if test x"${enable_strict_dependencies}" = x"yes"; then
-               AC_MSG_ERROR([set --without-]modname[ to disable it explicitly.])
-       else
-               AC_MSG_WARN([silently not building ]modname[.])
-               AC_MSG_WARN([FAILURE: ]modname[ requires: $fail.])
-               if test x"$headersuggestion" != x; then
-                       AC_MSG_WARN([$headersuggestion])
-               fi
-               if test x"$libsuggestion" != x; then
-                       AC_MSG_WARN([$libsuggestion])
-               fi
-               targetname=""
-       fi
-fi
-
+FR_MODULE_END_TESTS
 
 mod_ldflags="$SMART_LIBS"
 mod_cflags="$SMART_CPPFLAGS"
+
 AC_SUBST(mod_ldflags)
 AC_SUBST(mod_cflags)
-AC_SUBST(targetname)
+
 AC_CONFIG_FILES([all.mk])
 AC_OUTPUT
index f0cb397d6687887f911b8d4fa6b23743ecd6838a..7af997d74269797aafd7e2abf7431df809989e88 100644 (file)
@@ -4,11 +4,10 @@ AC_CONFIG_SRCDIR([rlm_sql_cassandra.c])
 AC_REVISION($Revision$)
 FR_INIT_MODULE([rlm_sql_cassandra])
 
-fail=
 SMART_LIBS=
 SMART_CLFAGS=
 
-if test x$with_[]modname != xno; then
+FR_MODULE_START_TESTS
 
     dnl ############################################################
     dnl # Check for command line options
@@ -95,29 +94,17 @@ if test x$with_[]modname != xno; then
     fi
     CFLAGS="$SMART_CPPFLAGS"
 
-    targetname=modname
-else
-    targetname=
-    echo \*\*\* module modname is disabled.
-fi
-
-dnl Don't change this section.
-if test "x$fail" != x; then
-       if test "x${enable_strict_dependencies}" = xyes; then
-               AC_MSG_ERROR([set --without-]modname[ to disable it explicitly.])
-       else
-               AC_MSG_WARN([silently not building ]modname[.])
-               AC_MSG_WARN([FAILURE: ]modname[ requires:$fail.]);
-               AC_MSG_WARN([available from https://github.com/datastax/cpp-driver]);
-               targetname=
-       fi
-fi
+FR_MODULE_END_TESTS
+
+FR_MODULE_TEST_FAIL_DO([
+       AC_MSG_WARN([available from https://github.com/datastax/cpp-driver]);
+])
 
 mod_ldflags="$SMART_LIBS"
 mod_cflags="$SMART_CPPFLAGS"
+
 AC_SUBST(mod_ldflags)
 AC_SUBST(mod_cflags)
 
-AC_SUBST(targetname)
 AC_CONFIG_FILES([all.mk])
 AC_OUTPUT
index 92a53c1377348dbc566656c9bbbcee6fec6b1813..dd36b19b089dfbbc76efa7d4720ba8c0551f90be 100644 (file)
@@ -4,11 +4,10 @@ AC_CONFIG_SRCDIR([rlm_sql_db2.c])
 AC_REVISION($Revision$)
 FR_INIT_MODULE([rlm_sql_db2])
 
-fail=
 SMART_LIBS=
 SMART_CLFAGS=
 
-if test x$with_[]modname != xno; then
+FR_MODULE_START_TESTS
 
        dnl extra argument: --with-ibmdb2-include-dir
        ibmdb2_include_dir=
@@ -72,27 +71,13 @@ if test x$with_[]modname != xno; then
                fail="$fail sqlcli.h"
        fi
 
-       targetname=modname
-else
-       targetname=
-       echo \*\*\* module modname is disabled.
-fi
-
-dnl Don't change this section.
-if test "x$fail" != x; then
-       if test "x${enable_strict_dependencies}" = xyes; then
-               AC_MSG_ERROR([set --without-]modname[ to disable it explicitly.])
-       else
-               AC_MSG_WARN([silently not building ]modname[.])
-               AC_MSG_WARN([FAILURE: ]modname[ requires:$fail.]);
-               targetname=
-       fi
-fi
+FR_MODULE_END_TESTS
 
 sql_ibmdb2_ldflags="$SMART_LIBS"
 sql_ibmdb2_cflags="$SMART_CPPFLAGS"
+
 AC_SUBST(sql_ibmdb2_ldflags)
 AC_SUBST(sql_ibmdb2_cflags)
-AC_SUBST(targetname)
+
 AC_CONFIG_FILES([all.mk])
 AC_OUTPUT
index bebb8475b60247d56a8ef8c814622d3494e9814d..23ae99d73ea8e88cf4ef58e29a574e49a278417d 100644 (file)
@@ -4,11 +4,11 @@ AC_CONFIG_SRCDIR([rlm_sql_firebird.c])
 AC_REVISION($Revision$)
 FR_INIT_MODULE([rlm_sql_firebird])
 
-fail=
 SMART_LIBS=
 SMART_CLFAGS=
 
-if test x$with_[]modname != xno; then
+FR_MODULE_START_TESTS
+
        dnl extra argument: --with-firebird-include-dir
        firebird_include_dir=
        AC_ARG_WITH(firebird-include-dir,
@@ -71,27 +71,13 @@ if test x$with_[]modname != xno; then
                fail="$fail ibase.h"
        fi
 
-       targetname=modname
-else
-       targetname=
-       echo \*\*\* module modname is disabled.
-fi
-
-dnl Don't change this section.
-if test "x$fail" != x; then
-       if test "x${enable_strict_dependencies}" = xyes; then
-               AC_MSG_ERROR([set --without-]modname[ to disable it explicitly.])
-       else
-               AC_MSG_WARN([silently not building ]modname[.])
-               AC_MSG_WARN([FAILURE: ]modname[ requires:$fail.]);
-               targetname=
-       fi
-fi
+FR_MODULE_END_TESTS
 
 mod_ldflags="$SMART_LIBS"
 mod_cflags="$SMART_CPPFLAGS"
+
 AC_SUBST(mod_ldflags)
 AC_SUBST(mod_cflags)
-AC_SUBST(targetname)
+
 AC_CONFIG_FILES([all.mk])
 AC_OUTPUT
index 38d5a6ac2f14b9569b0c477fed0ab99141bd71bd..ab8f4e1a919e14afca10ff6c6c640d842d777e63 100644 (file)
@@ -4,11 +4,10 @@ AC_CONFIG_SRCDIR([rlm_sql_freetds.c])
 AC_REVISION($Revision$)
 FR_INIT_MODULE([rlm_sql_freetds])
 
-fail=
 SMART_LIBS=
 SMART_CLFAGS=
 
-if test x$with_[]modname != xno; then
+FR_MODULE_START_TESTS
 
     dnl ############################################################
     dnl # Check for command line options
@@ -86,27 +85,13 @@ if test x$with_[]modname != xno; then
       fail="$fail libct"
     fi
 
-    targetname=modname
-else
-    targetname=
-    echo \*\*\* module modname is disabled.
-fi
-
-dnl Don't change this section.
-if test "x$fail" != x; then
-       if test "x${enable_strict_dependencies}" = xyes; then
-               AC_MSG_ERROR([set --without-]modname[ to disable it explicitly.])
-       else
-               AC_MSG_WARN([silently not building ]modname[.])
-               AC_MSG_WARN([FAILURE: ]modname[ requires:$fail.]);
-               targetname=
-       fi
-fi
+FR_MODULE_END_TESTS
 
 mod_ldflags="$SMART_LIBS"
 mod_cflags="$SMART_CPPFLAGS"
+
 AC_SUBST(mod_ldflags)
 AC_SUBST(mod_cflags)
-AC_SUBST(targetname)
+
 AC_CONFIG_FILES([all.mk])
 AC_OUTPUT
index d99b75ac7dba550e06f8ef4ac84faef55284ba94..56a40d6c35475b6e67e310888f5d80e3d7e6a089 100644 (file)
@@ -3,13 +3,12 @@ AC_INIT
 AC_CONFIG_SRCDIR([rlm_sql_mysql.c])
 AC_REVISION($Revision$)
 FR_INIT_MODULE([rlm_sql_mysql])
-AC_CONFIG_HEADER(config.h)
 
-fail=
 SMART_LIBS=
 SMART_CLFAGS=
 
-if test x$with_[]modname != xno; then
+FR_MODULE_START_TESTS
+
        dnl ############################################################
        dnl # Check for command line options
        dnl ############################################################
@@ -201,27 +200,14 @@ if test x$with_[]modname != xno; then
                fi
     fi
 
-    targetname=modname
-else
-    targetname=
-    echo \*\*\* module modname is disabled.
-fi
-
-dnl Don't change this section.
-if test "x$fail" != x; then
-       if test "x${enable_strict_dependencies}" = xyes; then
-               AC_MSG_ERROR([set --without-]modname[ to disable it explicitly.])
-       else
-               AC_MSG_WARN([silently not building ]modname[.])
-               AC_MSG_WARN([FAILURE: ]modname[ requires:$fail.]);
-               targetname=
-       fi
-fi
+FR_MODULE_END_TESTS
 
 mod_ldflags="$SMART_LIBS"
 mod_cflags="$SMART_CPPFLAGS"
+
 AC_SUBST(mod_ldflags)
 AC_SUBST(mod_cflags)
-AC_SUBST(targetname)
+
+AC_CONFIG_HEADER(config.h)
 AC_CONFIG_FILES([all.mk])
 AC_OUTPUT
index 5fe9693c0ca461891da870e859b0ad1b6d378ca7..20d43ad72ab22289fd02fe9fbe9a1325fdb8f6a7 100644 (file)
@@ -4,11 +4,11 @@ AC_REVISION($Revision: 1.10 $)
 FR_INIT_MODULE([rlm_sql_oracle])
 
 oracle_supported_versions="19 18 12 11"
-fail=
+
 mod_ldflags=
 mod_cflags=
 
-if test x$with_[]modname != xno; then
+FR_MODULE_START_TESTS
 
     dnl ############################################################
     dnl # Check for command line options
@@ -143,26 +143,12 @@ if test x$with_[]modname != xno; then
        fail=["$fail libclntsh libnnz[9-12]"]
     fi
 
-    targetname=modname
-else
-    targetname=
-    echo \*\*\* module modname is disabled.
-fi
-
-dnl Don't change this section.
-if test "x$fail" != x; then
-       if test "x${enable_strict_dependencies}" = xyes; then
-               AC_MSG_ERROR([set --without-]modname[ to disable it explicitly.])
-       else
-               AC_MSG_WARN([silently not building ]modname[.])
-               AC_MSG_WARN([FAILURE: ]modname[ requires:$fail.]);
-               targetname=
-       fi
-fi
+FR_MODULE_END_TESTS
 
 mod_cflags="$SMART_CPPFLAGS"
+
 AC_SUBST(mod_ldflags)
 AC_SUBST(mod_cflags)
-AC_SUBST(targetname)
+
 AC_CONFIG_FILES([all.mk])
 AC_OUTPUT
index f6e3d563bbaa93f761d2c90ce25b4d6824a929b4..0d795bf655c203f8b010f87c7b94018005801dc3 100644 (file)
@@ -3,11 +3,10 @@ AC_CONFIG_SRCDIR([rlm_sql_postgresql.c])
 AC_REVISION($Revision$)
 FR_INIT_MODULE([rlm_sql_postgresql])
 
-fail=
 SMART_LIBS=
 SMART_CLFAGS=
 
-if test x$with_[]modname != xno; then
+FR_MODULE_START_TESTS
 
        AC_PROG_CC
 
@@ -101,33 +100,15 @@ if test x$with_[]modname != xno; then
                PQinitOpenSSL \
                PQinitSSL \
        )
-       targetname=modname
-else
-       targetname=
-       echo \*\*\* module modname is disabled.
-fi
 
-if test x"$fail" != x""; then
-       if test x"${enable_strict_dependencies}" = x"yes"; then
-               AC_MSG_ERROR([set --without-]modname[ to disable it explicitly.])
-       else
-               AC_MSG_WARN([silently not building ]modname[.])
-               AC_MSG_WARN([FAILURE: ]modname[ requires: $fail.])
-               if test x"$headersuggestion" != x; then
-                       AC_MSG_WARN([$headersuggestion])
-               fi
-               if test x"$libsuggestion" != x; then
-                       AC_MSG_WARN([$libsuggestion])
-               fi
-               targetname=""
-       fi
-fi
+FR_MODULE_END_TESTS
 
 mod_ldflags="$SMART_LIBS"
 mod_cflags="$SMART_CPPFLAGS"
+
 AC_SUBST(mod_ldflags)
 AC_SUBST(mod_cflags)
-AC_SUBST(targetname)
+
 AC_CONFIG_HEADER(config.h)
 AC_CONFIG_FILES([all.mk])
 AC_OUTPUT
index c7389482fb667880f8af9e10326d71e50fce5b76..4d907698cd9d023662cc11c5b3765f01b630374a 100644 (file)
@@ -4,11 +4,10 @@ AC_CONFIG_SRCDIR([rlm_sql_sqlite.c])
 AC_REVISION($Revision$)
 FR_INIT_MODULE([rlm_sql_sqlite])
 
-fail=
 SMART_LIBS=
 SMART_CLFAGS=
 
-if test x$with_[]modname != xno; then
+FR_MODULE_START_TESTS
 
     dnl ############################################################
     dnl # Check for command line options
@@ -105,30 +104,14 @@ if test x$with_[]modname != xno; then
     CFLAGS="$SMART_CPPFLAGS"
     AC_CHECK_TYPES([sqlite3_int64], [], [], [[#include <sqlite3.h>]])
 
-    targetname=modname
-else
-    targetname=
-    echo \*\*\* module modname is disabled.
-fi
-
-dnl Don't change this section.
-if test "x$fail" != x; then
-       if test "x${enable_strict_dependencies}" = xyes; then
-               AC_MSG_ERROR([set --without-]modname[ to disable it explicitly.])
-       else
-               AC_MSG_WARN([silently not building ]modname[.])
-               AC_MSG_WARN([FAILURE: ]modname[ requires:$fail.]);
-               targetname=
-       fi
-fi
+FR_MODULE_END_TESTS
 
 mod_ldflags="$SMART_LIBS"
 mod_cflags="$SMART_CPPFLAGS"
+
 AC_SUBST(mod_ldflags)
 AC_SUBST(mod_cflags)
 
 AC_CONFIG_HEADER(config.h)
-
-AC_SUBST(targetname)
 AC_CONFIG_FILES([all.mk])
 AC_OUTPUT
index 98de975400183edd905b643c385920d9309b6f60..c7d6cda0eded56194ead44f527a3f808cc72e10a 100644 (file)
@@ -4,11 +4,10 @@ AC_CONFIG_SRCDIR([rlm_sql_unixodbc.c])
 AC_REVISION($Revision$)
 FR_INIT_MODULE([rlm_sql_unixodbc])
 
-fail=
 SMART_LIBS=
 SMART_CLFAGS=
 
-if test x$with_[]modname != xno; then
+FR_MODULE_START_TESTS
 
        dnl extra argument: --with-unixodbc-include-dir
        unixodbc_include_dir=
@@ -72,27 +71,13 @@ if test x$with_[]modname != xno; then
                fail="$fail sql.h"
        fi
 
-       targetname=modname
-else
-       targetname=
-       echo \*\*\* module modname is disabled.
-fi
-
-dnl Don't change this section.
-if test "x$fail" != x; then
-       if test "x${enable_strict_dependencies}" = xyes; then
-               AC_MSG_ERROR([set --without-]modname[ to disable it explicitly.])
-       else
-               AC_MSG_WARN([silently not building ]modname[.])
-               AC_MSG_WARN([FAILURE: ]modname[ requires:$fail.]);
-               targetname=
-       fi
-fi
+FR_MODULE_END_TESTS
 
 mod_ldflags="$SMART_LIBS"
 mod_cflags="$SMART_CPPFLAGS"
+
 AC_SUBST(mod_ldflags)
 AC_SUBST(mod_cflags)
-AC_SUBST(targetname)
+
 AC_CONFIG_FILES([all.mk])
 AC_OUTPUT
index 3bfa21065acd4f97c8fbff558941b7fce372f59d..f7888b7be7f687ea49a09bf23ffa43f1e97368af 100644 (file)
@@ -4,7 +4,8 @@ AC_CONFIG_SRCDIR([rlm_unbound.c])
 AC_REVISION($Revision$)
 FR_INIT_MODULE([rlm_unbound])
 
-if test x$with_[]modname != xno; then
+FR_MODULE_START_TESTS
+
        dnl extra argument: --with-rlm-unbound-lib-dir
        rlm_unbound_lib_dir=
        AC_ARG_WITH(rlm-unbound-lib-dir,
@@ -55,21 +56,7 @@ if test x$with_[]modname != xno; then
                fail="$fail unbound-event.h"
        fi
 
-       targetname=modname
-else
-       targetname=
-       echo \*\*\* module modname is disabled.
-fi
-
-if test x"$fail" != x""; then
-       if test x"${enable_strict_dependencies}" = x"yes"; then
-               AC_MSG_ERROR([set --without-]modname[ to disable it explicitly.])
-       else
-               AC_MSG_WARN([silently not building ]modname[.])
-               AC_MSG_WARN([FAILURE: ]modname[ requires: $fail.]);
-               targetname=""
-       fi
-fi
+FR_MODULE_END_TESTS
 
 mod_ldflags="${SMART_LIBS}"
 mod_cflags="${SMART_CFLAGS}"
@@ -78,7 +65,5 @@ AC_SUBST(mod_cflags)
 AC_SUBST(mod_ldflags)
 
 AC_CONFIG_HEADER(config.h)
-
-AC_SUBST(targetname)
 AC_CONFIG_FILES([all.mk])
 AC_OUTPUT
index 884e82319e64a8dd6528fa50b008b2c46f9bd61c..04c0f2f4f19d218c5bff326a9edfeeab53db1590 100644 (file)
@@ -4,7 +4,7 @@ AC_CONFIG_SRCDIR([rlm_unix.c])
 AC_REVISION($Revision$)
 FR_INIT_MODULE([rlm_unix])
 
-if test x$with_[]modname != xno; then
+FR_MODULE_START_TESTS
 
        AC_PROG_CC
        AC_PROG_CPP
@@ -45,26 +45,11 @@ if test x$with_[]modname != xno; then
                ]
        )
 
-       targetname=modname
-
-else
-       targetname=
-       echo \*\*\* module modname is disabled.
-fi
-
-if test x"$fail" != x""; then
-       if test x"${enable_strict_dependencies}" = x"yes"; then
-               AC_MSG_ERROR([set --without-]modname[ to disable it explicitly.])
-       else
-               AC_MSG_WARN([silently not building ]modname[.])
-               AC_MSG_WARN([FAILURE: ]modname[ requires: $fail.]);
-               targetname=""
-       fi
-fi
+FR_MODULE_END_TESTS
 
 AC_SUBST(mod_ldflags)
 AC_SUBST(mod_cflags)
-AC_SUBST(targetname)
+
 AC_CONFIG_HEADER(config.h)
 AC_CONFIG_FILES([all.mk])
 AC_OUTPUT
index acbcd421583d3cfe0b0305d0d2bce8143c73a856..519f0bc581824db4b8a6b4b772aa243a9424395a 100644 (file)
@@ -3,7 +3,7 @@ AC_CONFIG_SRCDIR([rlm_winbind.c])
 AC_REVISION($Revision$)
 FR_INIT_MODULE([rlm_winbind])
 
-if test x$with_[]modname != xno; then
+FR_MODULE_START_TESTS
 
     AC_PROG_CC
     AC_PROG_CPP
@@ -98,28 +98,14 @@ if test x$with_[]modname != xno; then
       fi
     fi
 
-    targetname=modname
-else
-    targetname=
-    echo \*\*\* module modname is disabled.
-fi
-
-if test x"$fail" != x""; then
-       if test x"${enable_strict_dependencies}" = x"yes"; then
-               AC_MSG_ERROR([set --without-]modname[ to disable it explicitly.])
-       else
-               AC_MSG_WARN([silently not building ]modname[.])
-               AC_MSG_WARN([FAILURE: ]modname[ requires: $fail.]);
-               targetname=""
-       fi
-fi
+FR_MODULE_END_TESTS
 
 mod_ldflags="$mod_ldflags $SMART_LIBS"
 mod_cflags="$SMART_CPPFLAGS"
 
 AC_SUBST(mod_ldflags)
 AC_SUBST(mod_cflags)
-AC_SUBST(targetname)
+
 AC_CONFIG_HEADER(config.h)
 AC_CONFIG_FILES([all.mk])
 AC_OUTPUT
index fac92f8bade447c20f0509351589ab48cba96279..20ed4d59d803dac4c164fe44e1391d6cc01093a7 100644 (file)
@@ -4,7 +4,8 @@ AC_CONFIG_SRCDIR([rlm_yubikey.c])
 AC_REVISION($Revision$)
 FR_INIT_MODULE([rlm_yubikey])
 
-if test x$with_[]modname != xno; then
+FR_MODULE_START_TESTS
+
     dnl ############################################################
     dnl # Check for command line options
     dnl ############################################################
@@ -177,29 +178,14 @@ if test x$with_[]modname != xno; then
        AC_MSG_WARN([silently building without yubicloud support. requires: ykclient])
     fi
 
-    targetname=modname
-else
-    targetname=
-    echo \*\*\* module modname is disabled.
-fi
-
-dnl  Don't change this section.
-if test x"$fail" != x""; then
-    if test x"${enable_strict_dependencies}" = x"yes"; then
-       AC_MSG_ERROR([set --without-]modname[ to disable it explicitly.])
-    else
-       AC_MSG_WARN([silently not building ]modname[.])
-       AC_MSG_WARN([FAILURE: ]modname[ requires: $fail.]);
-       targetname=""
-    fi
-fi
+FR_MODULE_END_TESTS
 
 mod_ldflags="$SMART_LIBS"
 mod_cflags="$SMART_CPPFLAGS"
 
 AC_SUBST(mod_cflags)
 AC_SUBST(mod_ldflags)
-AC_SUBST(targetname)
+
 AC_CONFIG_HEADER(config.h)
 AC_CONFIG_FILES([all.mk])
 AC_OUTPUT