From: Matthew Newton Date: Sat, 1 Oct 2022 16:28:14 +0000 (+0100) Subject: show optional module build features in configure report X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=03b0bc64a4d8a7b3bc6c11f036586c0f6d1fa171;p=thirdparty%2Ffreeradius-server.git show optional module build features in configure report --- diff --git a/.gitignore b/.gitignore index 840c08f5d96..24a6e0bf893 100644 --- a/.gitignore +++ b/.gitignore @@ -62,7 +62,7 @@ libtool autom4te.cache aclocal.m4 config.guess -config.info +config.report config.sub config.h src/bin/unit_test_attribute diff --git a/m4/fr_module_start_tests.m4 b/m4/fr_module_start_tests.m4 index 3878fe5719c..e4117c42ec4 100644 --- a/m4/fr_module_start_tests.m4 +++ b/m4/fr_module_start_tests.m4 @@ -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 diff --git a/src/modules/rlm_mschap/configure.ac b/src/modules/rlm_mschap/configure.ac index 63c5fcc4251..f360360a39c 100644 --- a/src/modules/rlm_mschap/configure.ac +++ b/src/modules/rlm_mschap/configure.ac @@ -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 if test "x$ac_cv_header_wbclient_h" != "xyes"; then AC_MSG_WARN([wbclient.h not found. Use --with-winbind-include-dir=.]) 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 @@ -87,6 +91,7 @@ FR_SMART_CHECK_INCLUDE(core/ntstatus.h, [#include if test "x$ac_cv_header_core_ntstatus_h" != "xyes"; then AC_MSG_WARN([core/ntstatus.h not found. Use --with-winbind-include-dir=.]) 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=.]) 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 diff --git a/src/modules/rlm_yubikey/configure.ac b/src/modules/rlm_yubikey/configure.ac index f2ff65f5812..253f2e50355 100644 --- a/src/modules/rlm_yubikey/configure.ac +++ b/src/modules/rlm_yubikey/configure.ac @@ -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