]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
update configure.ac and nice report for libraries, too
authorMatthew Newton <matthew-git@newtoncomputing.co.uk>
Sat, 1 Oct 2022 13:05:19 +0000 (14:05 +0100)
committerMatthew Newton <matthew-git@newtoncomputing.co.uk>
Sun, 2 Oct 2022 17:08:23 +0000 (18:08 +0100)
configure.ac
m4/fr_init_module.m4
m4/fr_module_start_tests.m4
src/lib/curl/configure.ac
src/lib/json/configure.ac
src/lib/kafka/configure.ac
src/lib/ldap/configure.ac
src/lib/redis/configure.ac

index 74c99f85df116add4a8a6270a77254b926313cc2..88519b769ec9d8aabe4e19b0f47f557d062be19f 100644 (file)
@@ -2629,4 +2629,6 @@ AC_CONFIG_FILES([\
   ./raddb/radiusd.conf
 ])
 AC_OUTPUT
+
+FR_LIBRARY_REPORT
 FR_MODULE_REPORT
index 41a4d280da51202a449900d2de49e579bc9f195a..91ac4ff818e9365390b74fc77a29b7385674b2d2 100644 (file)
@@ -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]))
index 7573a4d7ea85df8e9d6a41be3f8b15674f2f2317..b399b029211cca1a7ff05c450ad88f61473f3dca 100644 (file)
@@ -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
+])
index e771dd33f6edc25bab948c35e083778169c2546b..37e88af01317ad5afe292f35eb10cd6d31158ded 100644 (file)
@@ -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
-
index b05b18f0a340e725f26b00e0a1e9b10d335af911..498a84babd02d2754cca71743053cc6b6e2e494c 100644 (file)
@@ -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 <freeradius-devel/automask.h>])
-
index 8a7ba206e03426ffb86a3838d2ca502350399072..b47105c7714a4a57ed841becc6d95463bee7c5e1 100644 (file)
@@ -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
index 31293842cb26df9ed5adfb5b05ce6b2e2b908d08..6c248b4b221fcd2d9db96824b916a541352b379d 100644 (file)
@@ -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
index bdceff4b227179baf05826f4cf018c971cb9830c..14e43ed05a463ae4dcfbcbd6131ce86e88350ad0 100644 (file)
@@ -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