From: Matthew Newton Date: Sat, 1 Oct 2022 13:05:19 +0000 (+0100) Subject: update configure.ac and nice report for libraries, too X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c30413d3bc20f0c7bebb48e8f2521b71ea9aad75;p=thirdparty%2Ffreeradius-server.git update configure.ac and nice report for libraries, too --- diff --git a/configure.ac b/configure.ac index 74c99f85df1..88519b769ec 100644 --- a/configure.ac +++ b/configure.ac @@ -2629,4 +2629,6 @@ AC_CONFIG_FILES([\ ./raddb/radiusd.conf ]) AC_OUTPUT + +FR_LIBRARY_REPORT FR_MODULE_REPORT diff --git a/m4/fr_init_module.m4 b/m4/fr_init_module.m4 index 41a4d280da5..91ac4ff818e 100644 --- a/m4/fr_init_module.m4 +++ b/m4/fr_init_module.m4 @@ -12,3 +12,5 @@ AC_DEFUN([FR_INIT_MODULE], AC_ARG_WITH([$1], [AS_HELP_STRING([--without-$1],[build without ]ifelse([$2],[],[$1],[$2]))]) ]) + +AC_DEFUN([FR_INIT_LIBRARY], m4_defn([FR_INIT_MODULE])) diff --git a/m4/fr_module_start_tests.m4 b/m4/fr_module_start_tests.m4 index 7573a4d7ea8..b399b029211 100644 --- a/m4/fr_module_start_tests.m4 +++ b/m4/fr_module_start_tests.m4 @@ -42,9 +42,11 @@ echo Running tests for modname echo ]) -if test x"$with_[]modname" != xno; then +if test x"$with_[]modname_useropt" != xno; then ]) +AC_DEFUN([FR_LIBRARY_START_TESTS], m4_defn([FR_MODULE_START_TESTS])) + dnl dnl FR_MODULE_END_TESTS @@ -93,6 +95,8 @@ echo "$fr_status" > FR_STATUS_FILE AC_SUBST(targetname) ]) +AC_DEFUN([FR_LIBRARY_END_TESTS], m4_defn([FR_MODULE_END_TESTS])) + dnl dnl FR_MODULE_TEST_FAIL_DO @@ -109,6 +113,9 @@ if test x"$fail" != x""; then : fi ]) +AC_DEFUN([FR_LIBRARY_TEST_FAIL_DO], m4_defn([FR_MODULE_TEST_FAIL_DO])) + + dnl dnl FR_MODULE_TEST_PASS_DO dnl @@ -124,6 +131,9 @@ if test x"$fail" = x""; then : fi ]) +AC_DEFUN([FR_LIBRARY_TEST_PASS_DO], m4_defn([FR_MODULE_TEST_PASS_DO])) + + dnl dnl FR_MODULE_REPORT @@ -154,3 +164,34 @@ for module in $module_list; do echo "$module_print $module_status" done ]) + + +dnl +dnl FR_LIBRARY_REPORT +dnl +dnl Usage: +dnl FR_LIBRARY_REPORT +dnl +dnl Outputs a summary list of all libraries and any configure errors. +dnl +AC_DEFUN([FR_LIBRARY_REPORT], [ +library_list=$(find src/lib/ -mindepth 1 -maxdepth 1 -type d -print | sort) + +echo +echo Library configure status report +echo ------------------------------- + +for library in $library_list; do + library_name="$(basename $library)" + library_print="$(echo "$library_name ........................" | cut -c 1-25)" + 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) + fi + fi + + echo "$library_print $library_status" +done +]) diff --git a/src/lib/curl/configure.ac b/src/lib/curl/configure.ac index e771dd33f6e..37e88af0131 100644 --- a/src/lib/curl/configure.ac +++ b/src/lib/curl/configure.ac @@ -2,12 +2,11 @@ AC_PREREQ([2.69]) AC_INIT AC_CONFIG_SRCDIR([base.c]) AC_REVISION($Revision$) -FR_INIT_MODULE([libfreeradius-curl], [libcurl support]) -AC_DEFUN([modname_useropt],[m4_bpatsubst([]modname,[[-+.]],[_])]) +FR_INIT_LIBRARY([libfreeradius-curl], [libcurl support]) AC_CONFIG_HEADERS([config.h]) -if test x$with_[]modname_useropt != xno; then +FR_LIBRARY_START_TESTS AC_PROG_CC AC_PROG_CPP @@ -41,34 +40,16 @@ if test x$with_[]modname_useropt != xno; then fi fi - targetname=modname version="$libcurl_cv_lib_curl_version" -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_LIBRARY_END_TESTS mod_ldflags="$LIBCURL" mod_cflags="$LIBCURL_CPPFLAGS" AC_SUBST(mod_cflags) AC_SUBST(mod_ldflags) - AC_SUBST(version) -AC_SUBST(targetname) AC_CONFIG_FILES([all.mk]) AC_OUTPUT - diff --git a/src/lib/json/configure.ac b/src/lib/json/configure.ac index b05b18f0a34..498a84babd0 100644 --- a/src/lib/json/configure.ac +++ b/src/lib/json/configure.ac @@ -2,11 +2,9 @@ AC_PREREQ([2.69]) AC_INIT AC_CONFIG_SRCDIR([json.c]) AC_REVISION($Revision$) -FR_INIT_MODULE([libfreeradius-json], [JSON support from json-c]) -AC_DEFUN([modname_useropt],[m4_bpatsubst([]modname,[[-+.]],[_])]) -AC_CONFIG_HEADERS([config.h]) +FR_INIT_LIBRARY([libfreeradius-json], [JSON support from json-c]) -if test x$with_[]modname_useropt != xno; then +FR_LIBRARY_START_TESTS AC_PROG_CC AC_PROG_CPP @@ -121,24 +119,11 @@ if test x$with_[]modname_useropt != xno; then fail="$fail json-c >= 0.13" fi - targetname=modname -else - targetname= - echo \*\*\* module modname is disabled. -fi +FR_LIBRARY_END_TESTS -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 -else - AC_DEFINE([HAVE_JSON],[1],[Build with JSON support from json-c]) -fi +FR_MODULE_TEST_PASS_DO([ + AC_DEFINE([HAVE_JSON],[1],[Build with JSON support from json-c]) +]) mod_ldflags="$SMART_LIBS" mod_cflags="$SMART_CPPFLAGS" @@ -146,8 +131,8 @@ mod_cflags="$SMART_CPPFLAGS" AC_SUBST(mod_cflags) AC_SUBST(mod_ldflags) -AC_SUBST(targetname) +AC_CONFIG_HEADERS([config.h]) AC_CONFIG_FILES([all.mk]) + AC_OUTPUT AH_BOTTOM([#include ]) - diff --git a/src/lib/kafka/configure.ac b/src/lib/kafka/configure.ac index 8a7ba206e03..b47105c7714 100644 --- a/src/lib/kafka/configure.ac +++ b/src/lib/kafka/configure.ac @@ -2,13 +2,13 @@ AC_PREREQ([2.69]) AC_INIT AC_CONFIG_SRCDIR([base.c]) AC_REVISION($Revision$) -FR_INIT_MODULE([libfreeradius-kafka], [rdkafka support]) +FR_INIT_LIBRARY([libfreeradius-kafka], [rdkafka support]) -fail= SMART_LIBS= SMART_CLFAGS= -if test x$with_[]modname_useropt != xno; then +FR_LIBRARY_START_TESTS + dnl ############################################################ dnl # Check for command line options dnl ############################################################ @@ -90,27 +90,13 @@ if test x$with_[]modname_useropt != xno; then fail="$fail libhirdkafka" 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_LIBRARY_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/lib/ldap/configure.ac b/src/lib/ldap/configure.ac index 31293842cb2..6c248b4b221 100644 --- a/src/lib/ldap/configure.ac +++ b/src/lib/ldap/configure.ac @@ -2,15 +2,13 @@ AC_PREREQ([2.69]) AC_INIT AC_CONFIG_SRCDIR([base.c]) AC_REVISION($Revision$) -FR_INIT_MODULE([libfreeradius-ldap], [LDAP support]) -AC_DEFUN([modname_useropt],[m4_bpatsubst([]modname,[[-+.]],[_])]) +FR_INIT_LIBRARY([libfreeradius-ldap], [LDAP support]) -fail= SMART_LIBS= SMART_CLFAGS= SASL= -if test x$with_[]modname_useropt != xno; then +FR_LIBRARY_START_TESTS dnl ############################################################ dnl # Check for compiler @@ -124,27 +122,7 @@ if test x$with_[]modname_useropt != 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.]) - 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_LIBRARY_END_TESTS AC_DEFINE(WITH_EDIR, 1, [Build the server with support for Novell eDir Universal Password]) @@ -154,11 +132,7 @@ mod_cflags="$SMART_CPPFLAGS" AC_SUBST(mod_ldflags) AC_SUBST(mod_cflags) AC_SUBST(SASL) -AC_SUBST(targetname) -AC_CONFIG_HEADERS([config.h]) -dnl # This is needed so that all.mk is not created unless configure is run -dnl # so that it doesn't attempt to include libfreeradius-redis.mk which -dnl # is also dependent on configure being run. +AC_CONFIG_HEADERS([config.h]) AC_CONFIG_FILES([all.mk]) AC_OUTPUT diff --git a/src/lib/redis/configure.ac b/src/lib/redis/configure.ac index bdceff4b227..14e43ed05a4 100644 --- a/src/lib/redis/configure.ac +++ b/src/lib/redis/configure.ac @@ -2,14 +2,13 @@ AC_PREREQ([2.69]) AC_INIT AC_CONFIG_SRCDIR([redis.c]) AC_REVISION($Revision$) -FR_INIT_MODULE([libfreeradius-redis], [redis support]) -AC_DEFUN([modname_useropt],[m4_bpatsubst([]modname,[[-+.]],[_])]) +FR_INIT_LIBRARY([libfreeradius-redis], [redis support]) -fail= SMART_LIBS= SMART_CLFAGS= -if test x$with_[]modname_useropt != xno; then +FR_LIBRARY_START_TESTS + dnl ############################################################ dnl # Check for command line options dnl ############################################################ @@ -91,27 +90,13 @@ if test x$with_[]modname_useropt != xno; then fail="$fail libhiredis" 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_LIBRARY_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