From: Matthew Newton Date: Fri, 30 Sep 2022 15:53:07 +0000 (+0100) Subject: autoconf macros for tidying module config X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7c1bcea73d29b3529dceaee5b4c3a84019ea23a8;p=thirdparty%2Ffreeradius-server.git autoconf macros for tidying module config Add a nice report at the _end_ of configure, so there's no excuse of missing a "silently unconfigured" module any more. --- diff --git a/.gitignore b/.gitignore index 1e4f9c5ab68..840c08f5d96 100644 --- a/.gitignore +++ b/.gitignore @@ -62,6 +62,7 @@ libtool autom4te.cache aclocal.m4 config.guess +config.info config.sub config.h src/bin/unit_test_attribute diff --git a/configure.ac b/configure.ac index 820d88bb6c0..74c99f85df1 100644 --- a/configure.ac +++ b/configure.ac @@ -2629,3 +2629,4 @@ AC_CONFIG_FILES([\ ./raddb/radiusd.conf ]) AC_OUTPUT +FR_MODULE_REPORT diff --git a/m4/fr_init_module.m4 b/m4/fr_init_module.m4 index 36c43c2221d..41a4d280da5 100644 --- a/m4/fr_init_module.m4 +++ b/m4/fr_init_module.m4 @@ -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 index 00000000000..7573a4d7ea8 --- /dev/null +++ b/m4/fr_module_start_tests.m4 @@ -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 +]) diff --git a/src/modules/rlm_cache/configure.ac b/src/modules/rlm_cache/configure.ac index 3202fd9305a..a4197f5ab9d 100644 --- a/src/modules/rlm_cache/configure.ac +++ b/src/modules/rlm_cache/configure.ac @@ -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 diff --git a/src/modules/rlm_cache/drivers/rlm_cache_memcached/configure.ac b/src/modules/rlm_cache/drivers/rlm_cache_memcached/configure.ac index fed1719edcb..d6b2dac806e 100644 --- a/src/modules/rlm_cache/drivers/rlm_cache_memcached/configure.ac +++ b/src/modules/rlm_cache/drivers/rlm_cache_memcached/configure.ac @@ -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 diff --git a/src/modules/rlm_couchbase/configure.ac b/src/modules/rlm_couchbase/configure.ac index d9f109c280d..6127be12247 100644 --- a/src/modules/rlm_couchbase/configure.ac +++ b/src/modules/rlm_couchbase/configure.ac @@ -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 diff --git a/src/modules/rlm_eap/configure.ac b/src/modules/rlm_eap/configure.ac index 0b6b653c9b4..130c563a071 100644 --- a/src/modules/rlm_eap/configure.ac +++ b/src/modules/rlm_eap/configure.ac @@ -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 diff --git a/src/modules/rlm_idn/configure.ac b/src/modules/rlm_idn/configure.ac index 71d5193dc20..a4069af6cf1 100644 --- a/src/modules/rlm_idn/configure.ac +++ b/src/modules/rlm_idn/configure.ac @@ -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 - diff --git a/src/modules/rlm_krb5/configure.ac b/src/modules/rlm_krb5/configure.ac index 8bbadb690a9..ed84f82fc60 100644 --- a/src/modules/rlm_krb5/configure.ac +++ b/src/modules/rlm_krb5/configure.ac @@ -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 diff --git a/src/modules/rlm_lua/configure.ac b/src/modules/rlm_lua/configure.ac index 32f5f567309..ee561b2c468 100644 --- a/src/modules/rlm_lua/configure.ac +++ b/src/modules/rlm_lua/configure.ac @@ -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! - diff --git a/src/modules/rlm_mruby/configure.ac b/src/modules/rlm_mruby/configure.ac index 4802266c64d..0d134723c0b 100644 --- a/src/modules/rlm_mruby/configure.ac +++ b/src/modules/rlm_mruby/configure.ac @@ -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 diff --git a/src/modules/rlm_mschap/configure.ac b/src/modules/rlm_mschap/configure.ac index 6b29418aef0..3551630cf0b 100644 --- a/src/modules/rlm_mschap/configure.ac +++ b/src/modules/rlm_mschap/configure.ac @@ -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 - diff --git a/src/modules/rlm_opendirectory/configure.ac b/src/modules/rlm_opendirectory/configure.ac index c37767afd1c..443af53cde5 100644 --- a/src/modules/rlm_opendirectory/configure.ac +++ b/src/modules/rlm_opendirectory/configure.ac @@ -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 ]) 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 diff --git a/src/modules/rlm_pam/configure.ac b/src/modules/rlm_pam/configure.ac index bb44022f791..6aa41af21d5 100644 --- a/src/modules/rlm_pam/configure.ac +++ b/src/modules/rlm_pam/configure.ac @@ -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 diff --git a/src/modules/rlm_perl/configure.ac b/src/modules/rlm_perl/configure.ac index cbf2b121e1e..36c51117581 100644 --- a/src/modules/rlm_perl/configure.ac +++ b/src/modules/rlm_perl/configure.ac @@ -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 ]) 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 diff --git a/src/modules/rlm_python/configure.ac b/src/modules/rlm_python/configure.ac index 18f2dff99ed..9e855e23fdc 100644 --- a/src/modules/rlm_python/configure.ac +++ b/src/modules/rlm_python/configure.ac @@ -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 diff --git a/src/modules/rlm_radutmp/configure.ac b/src/modules/rlm_radutmp/configure.ac index 2133e5eaffd..0966c0f8569 100644 --- a/src/modules/rlm_radutmp/configure.ac +++ b/src/modules/rlm_radutmp/configure.ac @@ -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 diff --git a/src/modules/rlm_securid/configure.ac b/src/modules/rlm_securid/configure.ac index d32f7646c64..e3aebd732eb 100644 --- a/src/modules/rlm_securid/configure.ac +++ b/src/modules/rlm_securid/configure.ac @@ -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) diff --git a/src/modules/rlm_sigtran/configure.ac b/src/modules/rlm_sigtran/configure.ac index 0b4d11c1835..5ca3f2de7c6 100644 --- a/src/modules/rlm_sigtran/configure.ac +++ b/src/modules/rlm_sigtran/configure.ac @@ -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=.]) 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 - diff --git a/src/modules/rlm_sql/configure.ac b/src/modules/rlm_sql/configure.ac index c696ae392e9..8f4078e0b8a 100644 --- a/src/modules/rlm_sql/configure.ac +++ b/src/modules/rlm_sql/configure.ac @@ -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 diff --git a/src/modules/rlm_sql/drivers/rlm_sql_cassandra/configure.ac b/src/modules/rlm_sql/drivers/rlm_sql_cassandra/configure.ac index f0cb397d668..7af997d7426 100644 --- a/src/modules/rlm_sql/drivers/rlm_sql_cassandra/configure.ac +++ b/src/modules/rlm_sql/drivers/rlm_sql_cassandra/configure.ac @@ -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 diff --git a/src/modules/rlm_sql/drivers/rlm_sql_db2/configure.ac b/src/modules/rlm_sql/drivers/rlm_sql_db2/configure.ac index 92a53c13773..dd36b19b089 100644 --- a/src/modules/rlm_sql/drivers/rlm_sql_db2/configure.ac +++ b/src/modules/rlm_sql/drivers/rlm_sql_db2/configure.ac @@ -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 diff --git a/src/modules/rlm_sql/drivers/rlm_sql_firebird/configure.ac b/src/modules/rlm_sql/drivers/rlm_sql_firebird/configure.ac index bebb8475b60..23ae99d73ea 100644 --- a/src/modules/rlm_sql/drivers/rlm_sql_firebird/configure.ac +++ b/src/modules/rlm_sql/drivers/rlm_sql_firebird/configure.ac @@ -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 diff --git a/src/modules/rlm_sql/drivers/rlm_sql_freetds/configure.ac b/src/modules/rlm_sql/drivers/rlm_sql_freetds/configure.ac index 38d5a6ac2f1..ab8f4e1a919 100644 --- a/src/modules/rlm_sql/drivers/rlm_sql_freetds/configure.ac +++ b/src/modules/rlm_sql/drivers/rlm_sql_freetds/configure.ac @@ -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 diff --git a/src/modules/rlm_sql/drivers/rlm_sql_mysql/configure.ac b/src/modules/rlm_sql/drivers/rlm_sql_mysql/configure.ac index d99b75ac7db..56a40d6c354 100644 --- a/src/modules/rlm_sql/drivers/rlm_sql_mysql/configure.ac +++ b/src/modules/rlm_sql/drivers/rlm_sql_mysql/configure.ac @@ -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 diff --git a/src/modules/rlm_sql/drivers/rlm_sql_oracle/configure.ac b/src/modules/rlm_sql/drivers/rlm_sql_oracle/configure.ac index 5fe9693c0ca..20d43ad72ab 100644 --- a/src/modules/rlm_sql/drivers/rlm_sql_oracle/configure.ac +++ b/src/modules/rlm_sql/drivers/rlm_sql_oracle/configure.ac @@ -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 diff --git a/src/modules/rlm_sql/drivers/rlm_sql_postgresql/configure.ac b/src/modules/rlm_sql/drivers/rlm_sql_postgresql/configure.ac index f6e3d563bba..0d795bf655c 100644 --- a/src/modules/rlm_sql/drivers/rlm_sql_postgresql/configure.ac +++ b/src/modules/rlm_sql/drivers/rlm_sql_postgresql/configure.ac @@ -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 diff --git a/src/modules/rlm_sql/drivers/rlm_sql_sqlite/configure.ac b/src/modules/rlm_sql/drivers/rlm_sql_sqlite/configure.ac index c7389482fb6..4d907698cd9 100644 --- a/src/modules/rlm_sql/drivers/rlm_sql_sqlite/configure.ac +++ b/src/modules/rlm_sql/drivers/rlm_sql_sqlite/configure.ac @@ -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 ]]) - 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 diff --git a/src/modules/rlm_sql/drivers/rlm_sql_unixodbc/configure.ac b/src/modules/rlm_sql/drivers/rlm_sql_unixodbc/configure.ac index 98de9754001..c7d6cda0ede 100644 --- a/src/modules/rlm_sql/drivers/rlm_sql_unixodbc/configure.ac +++ b/src/modules/rlm_sql/drivers/rlm_sql_unixodbc/configure.ac @@ -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 diff --git a/src/modules/rlm_unbound/configure.ac b/src/modules/rlm_unbound/configure.ac index 3bfa21065ac..f7888b7be7f 100644 --- a/src/modules/rlm_unbound/configure.ac +++ b/src/modules/rlm_unbound/configure.ac @@ -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 diff --git a/src/modules/rlm_unix/configure.ac b/src/modules/rlm_unix/configure.ac index 884e82319e6..04c0f2f4f19 100644 --- a/src/modules/rlm_unix/configure.ac +++ b/src/modules/rlm_unix/configure.ac @@ -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 diff --git a/src/modules/rlm_winbind/configure.ac b/src/modules/rlm_winbind/configure.ac index acbcd421583..519f0bc5818 100644 --- a/src/modules/rlm_winbind/configure.ac +++ b/src/modules/rlm_winbind/configure.ac @@ -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 diff --git a/src/modules/rlm_yubikey/configure.ac b/src/modules/rlm_yubikey/configure.ac index fac92f8bade..20ed4d59d80 100644 --- a/src/modules/rlm_yubikey/configure.ac +++ b/src/modules/rlm_yubikey/configure.ac @@ -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