]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
show optional module build features in configure report
authorMatthew Newton <matthew-git@newtoncomputing.co.uk>
Sat, 1 Oct 2022 16:28:14 +0000 (17:28 +0100)
committerMatthew Newton <matthew-git@newtoncomputing.co.uk>
Sun, 2 Oct 2022 17:08:23 +0000 (18:08 +0100)
.gitignore
m4/fr_module_start_tests.m4
src/modules/rlm_mschap/configure.ac
src/modules/rlm_yubikey/configure.ac

index 840c08f5d9665efa71c896a1698f8579491d4845..24a6e0bf893c18cbe4b2c17201d2a36cbc3656e8 100644 (file)
@@ -62,7 +62,7 @@ libtool
 autom4te.cache
 aclocal.m4
 config.guess
-config.info
+config.report
 config.sub
 config.h
 src/bin/unit_test_attribute
index 3878fe5719cf84b4cf03f29be05f1bcd38e559c7..e4117c42ec442497e3ff54ddccf6b4e95ff2bb9d 100644 (file)
@@ -1,4 +1,11 @@
-AC_DEFUN([FR_STATUS_FILE], [config.info])
+dnl Where module/library report is stored
+AC_DEFUN([FR_REPORT_FILE], [config.report])
+
+dnl Where feature list is built up
+AC_DEFUN([FR_REPORT_TMP], [config.report.tmp])
+
+dnl Space prefix for non-first lines of feature list
+AC_DEFUN([FR_REPORT_PREFIX], [                                 ])
 
 dnl
 dnl Store status about module configure state.
@@ -48,6 +55,9 @@ AC_DEFUN([FR_MODULE_START_TESTS],
 [
 fail=
 fr_status=
+fr_features=
+: > "FR_REPORT_FILE"
+: > "FR_REPORT_TMP"
 
 m4_divert_text([SHELL_FN], [
 echo
@@ -96,6 +106,7 @@ ifelse([$1], [nostrict], [], [
                AC_MSG_WARN([FAILURE: ]modname[ requires: $fail.]);
                fail="$(echo $fail)"
                FR_MODULE_STATUS([skipping], [requires $fail])
+               fr_features=
 ifelse([$1], [nostrict], [], [
        fi
 ])
@@ -103,7 +114,14 @@ else
        FR_MODULE_STATUS([OK])
 fi
 
-echo "$fr_status" > FR_STATUS_FILE
+if test x"$fr_features" = x""; then
+       $as_echo "$fr_status" > "FR_REPORT_FILE"
+else
+       $as_echo_n "$fr_status ... " > "FR_REPORT_FILE"
+       cat "FR_REPORT_TMP" >> "FR_REPORT_FILE"
+fi
+
+rm "FR_REPORT_TMP"
 
 AC_SUBST(targetname)
 ])
@@ -111,6 +129,28 @@ AC_SUBST(targetname)
 AC_DEFUN([FR_LIBRARY_END_TESTS], m4_defn([FR_MODULE_END_TESTS]))
 
 
+dnl
+dnl FR_MODULE_FEATURE
+dnl
+dnl Usage:
+dnl   FR_MODULE_FEATURE([name], [description])
+dnl
+dnl Declare that a module feature is or is not available (but the
+dnl module can still be built).
+dnl
+AC_DEFUN([FR_MODULE_FEATURE], [
+if echo "$fr_features" | grep -q "+$1+"; then :
+dnl feature already declared
+else :
+       fr_report_prefix=""
+       if test x"$fr_features" != x""; then
+               fr_report_prefix="FR_REPORT_PREFIX"
+       fi
+       $as_echo "$fr_report_prefix""$2" >> FR_REPORT_TMP
+       fr_features="$fr_features +$1+"
+fi
+])
+
 dnl
 dnl FR_MODULE_TEST_FAIL_DO
 dnl
@@ -169,12 +209,12 @@ for module in $module_list; do
   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)
+    if test -r $module/FR_REPORT_FILE; then
+      module_status=$(cat $module/FR_REPORT_FILE)
     fi
   fi
 
-  echo "$module_print $module_status"
+  $as_echo "$module_print $module_status"
 done
 ])
 
@@ -200,8 +240,8 @@ for library in $library_list; do
   library_status="OK"
 
   if test -r $library/configure.ac; then
-    if test -r $library/FR_STATUS_FILE; then
-      library_status=$(head -1 $library/FR_STATUS_FILE)
+    if test -r $library/FR_REPORT_FILE; then
+      library_status=$(cat $library/FR_REPORT_FILE)
     fi
   fi
 
index 63c5fcc425176d27f8df69e74f5854e72db607a8..f360360a39ca0284e6a9dd382422352c8d719e34 100644 (file)
@@ -72,6 +72,9 @@ if test "x$ac_cv_header_membership_h" = "xyes"; then
        AC_DEFINE([HAVE_MEMBERSHIP_H],[1],[Build with Apple Open Directory support])
        mschap_sources="$mschap_sources opendir.c"
        mod_ldflags="-F /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks -framework DirectoryService"
+       FR_MODULE_FEATURE([opendirectory], [with opendirectory support])
+else
+       FR_MODULE_FEATURE([opendirectory], [without opendirectory support])
 fi
 
 smart_try_dir="$winbind_include_dir /usr/include/samba-4.0"
@@ -80,6 +83,7 @@ FR_SMART_CHECK_INCLUDE(wbclient.h, [#include <stdint.h>
 if test "x$ac_cv_header_wbclient_h" != "xyes"; then
        AC_MSG_WARN([wbclient.h not found. Use --with-winbind-include-dir=<path>.])
        AC_MSG_WARN([silently building without support for direct authentication via winbind. requires: libwbclient])
+       FR_MODULE_FEATURE([wbclient], [without direct winbind support])
 fi
 
 FR_SMART_CHECK_INCLUDE(core/ntstatus.h, [#include <stdint.h>
@@ -87,6 +91,7 @@ FR_SMART_CHECK_INCLUDE(core/ntstatus.h, [#include <stdint.h>
 if test "x$ac_cv_header_core_ntstatus_h" != "xyes"; then
        AC_MSG_WARN([core/ntstatus.h not found. Use --with-winbind-include-dir=<path>.])
        AC_MSG_WARN([silently building without support for direct authentication via winbind. requires: libwbclient])
+       FR_MODULE_FEATURE([wbclient], [without direct winbind support])
 fi
 
 dnl ############################################################
@@ -101,9 +106,11 @@ if test "x$ac_cv_header_wbclient_h" = "xyes" && \
        if test "x$ac_cv_lib_wbclient_wbcCtxAuthenticateUserEx" != "xyes"; then
                AC_MSG_WARN([winbind libraries not found. Use --with-winbind-lib-dir=<path>.])
                AC_MSG_WARN([Samba must be version 4.2.1 or higher to use this feature.])
+               FR_MODULE_FEATURE([wbclient], [without direct winbind support])
        else
                mschap_sources="$mschap_sources auth_wbclient.c"
                AC_DEFINE([WITH_AUTH_WINBIND],[1],[Build with direct winbind auth support])
+               FR_MODULE_FEATURE([wbclient], [with direct winbind support])
        fi
 fi
 
index f2ff65f581256817d512366070e91f4a27f23682..253f2e503554b6120f9925240069f6aebaffa3ff 100644 (file)
@@ -142,6 +142,7 @@ if test "x$have_yubikey" = "xyes"; then
        AC_DEFINE([HAVE_YUBIKEY],[1],[Build with yubikey token decryption support support from yubikey])
 else
        AC_MSG_WARN([silently building without yubikey token decryption support. requires: yubikey])
+       FR_MODULE_FEATURE([yubikey], [without yubikey token decryption support])
 fi
 
 dnl ############################################################
@@ -176,6 +177,7 @@ if test "x$have_ykclient" = "xyes"; then
        AC_DEFINE([HAVE_YKCLIENT],[1],[Build with yubicloud support from ykclient])
 else
        AC_MSG_WARN([silently building without yubicloud support. requires: ykclient])
+       FR_MODULE_FEATURE([ykclient], [without yubicloud support])
 fi
 
 FR_MODULE_END_TESTS