]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[#3731] Some improvements
authorFrancis Dupont <fdupont@isc.org>
Wed, 12 Mar 2025 23:03:28 +0000 (00:03 +0100)
committerFrancis Dupont <fdupont@isc.org>
Thu, 13 Mar 2025 17:03:38 +0000 (18:03 +0100)
config-report.sh.in
meson.build
meson.options
src/bin/shell/meson.build
subprojects/krb5/meson.build
subprojects/netconf/meson.build

index a840d6c9aaf249b48cecb95f54e5aedca3a4a927..28683f35360aa19634e4ed3d3b1f93bbb402f98d 100755 (executable)
@@ -34,20 +34,14 @@ C++ Compiler:
   LD_ID:           @LD_ID@
   LD_ARGS:         @LD_ARGS@
 '
-
-if test '@HAVE_PYTHON@' != 'no'; then
 add_to_report '
 Python:
   PYTHON:          @PYTHON_PATH@
+  PYTHON_VERSION:  @PYTHON_VERSION@
   PKGPYTHONDIR:    @PKGPYTHONDIR@
-'
-fi
 
-add_to_report '
 Boost:
   BOOST_VERSION:   @BOOST_VERSION@
-  BOOST_INCLUDE:   @BOOST_INCLUDE@
-  BOOST_LIBDIR:    @BOOST_LIBDIR@
 
 @CRYPTO_NAME@:
   CRYPTO_VERSION:  @CRYPTO_VERSION@
@@ -92,10 +86,18 @@ PostgreSQL:
 '
 fi
 
+if test '@HAVE_NETCONF@' != 'no'; then
+add_to_report '
+Netconf:
+  LIBYANG_PREFIX:  @LIBYANG_PREFIX@
+  SYSREPO_PREFIX:  @SYSREPO_PREFIX@
+'
+else
 add_to_report '
-NETCONF:
-  @HAVE_NETCONF@
+Netconf:
+  no
 '
+fi
 
 if test '@HAVE_GTEST@' != 'no'; then
 add_to_report '
@@ -110,3 +112,26 @@ Google Test:
   no
 '
 fi
+
+if test '@HAVE_KRB5@' != 'no'; then
+add_to_report '
+Kerberos5 GSS-API support:
+  KRB5_GSSAPI_VERSION:  @KRB5_GSSAPI_VERSION@
+  KRB5_GSSAPI_CFLAGS:   @KRB5_GSSAPI_CFLAGS@
+  KRB5_GSSAPI_LIBS:     @KRB5_GSSAPI_LIBS@
+  KRB5_GSSAPI_VENDOR:   @KRB5_GSSAPI_VENDOR@
+'
+else
+add_to_report '
+Kerberos5 GSS-API support:
+  no
+'
+fi
+
+add_to_report '
+Developer:
+  Tests:            @TESTS_ENABLED@
+  Valgrind:         @VALGRIND@
+  Fuzzing:          @FUZZ_ENABLED@
+  AFL:              @HAVE_AFL@
+'
index eb1116a1ffb59bf2a260d0a39e823b529a48dfc5..766eddbf9455120012276724ff07c7b170accff1 100644 (file)
@@ -35,7 +35,6 @@ netconf_opt = get_option('netconf')
 postgresql_opt = get_option('postgresql')
 
 FUZZ_OPT = get_option('fuzz')
-SHELL_OPT = get_option('shell')
 TESTS_OPT = get_option('tests')
 
 #### Configuration Data
@@ -117,7 +116,7 @@ INSTALL = find_program('install', required: true)
 PDFLATEX = find_program('pdflatex', required: false)
 PIP_COMPILE = find_program('pip-compile', required: false)
 PLANTUML = find_program('plantuml', required: false)
-PYTHON = find_program('python3', 'python', required: false)
+PYTHON = find_program('python3', 'python', required: true)
 SPHINX = find_program('sphinx-build', 'sphinx-build-3', required: false)
 XMLLINT = find_program('xmllint', required: false)
 
@@ -211,11 +210,6 @@ GTEST_DEP = dependency(
     required: TESTS_OPT.enabled() or FUZZ_OPT.enabled(),
 )
 
-# Kea shell
-if SHELL_OPT.enabled() and not PYTHON.found()
-    error('kea-shell requires python. Python not found.')
-endif
-
 # Crypto
 if crypto_opt == 'botan'
     if botan.found()
@@ -337,9 +331,13 @@ result = cpp.run(
 )
 FUZZING_WITH_CLUSTERFUZZLITE = result.returncode() == 0
 
+have_afl = false
 if FUZZ_OPT.enabled()
     result = cpp.run(fs.read('compiler-checks/have-afl.cc'), name: 'HAVE_AFL')
-    conf_data.set('HAVE_AFL', result.returncode() == 0)
+    if result.returncode() == 0
+        have_afl = true
+    endif
+    conf_data.set('HAVE_AFL', have_afl)
 endif
 
 if GTEST_DEP.found()
@@ -474,22 +472,18 @@ endif
 report_conf_data.set('CXX_ARGS', ' '.join(compile_args))
 report_conf_data.set('LD_ID', cpp.get_linker_id())
 report_conf_data.set('LD_ARGS', ' '.join(link_args))
-if PYTHON.found()
-    report_conf_data.set('HAVE_PYTHON', 'yes')
-    report_conf_data.set('PYTHON_PATH', PYTHON.full_path())
-    result = run_command(
-        PYTHON,
-        '-c',
-        'import sysconfig; print(sysconfig.get_paths()[\'purelib\'])',
-        check: false,
-    )
-    if result.returncode() == 0
-        report_conf_data.set('PKGPYTHONDIR', result.stdout().strip() + '/kea')
-    else
-        report_conf_data.set('PKGPYTHONDIR', 'unknown')
-    endif
+report_conf_data.set('PYTHON_PATH', PYTHON.full_path())
+report_conf_data.set('PYTHON_VERSION', PYTHON.version())
+result = run_command(
+    PYTHON,
+    '-c',
+    'import sysconfig; print(sysconfig.get_paths()[\'purelib\'])',
+    check: false,
+)
+if result.returncode() == 0
+    report_conf_data.set('PKGPYTHONDIR', result.stdout().strip() + '/kea')
 else
-    report_conf_data.set('HAVE_PYTHON', 'no')
+    report_conf_data.set('PKGPYTHONDIR', 'unknown')
 endif
 result = cpp.run(
     fs.read('compiler-checks/get-boost-version.cc'),
@@ -501,14 +495,6 @@ if result.returncode() == 0
 else
     report_conf_data.set('BOOST_VERSION', 'unknown')
 endif
-report_conf_data.set(
-    'BOOST_INCLUDE',
-    boost_dep.get_variable('includedir', default_value: 'unknown'),
-)
-report_conf_data.set(
-    'BOOST_LIBDIR',
-    boost_dep.get_variable('libdir', default_value: 'unknown'),
-)
 report_conf_data.set(
     'CRYPTO_INCLUDE',
     CRYPTO_DEP.get_variable('includedir', default_value: 'unknown'),
@@ -611,8 +597,18 @@ else
 endif
 if NETCONF_DEP.found()
     report_conf_data.set('HAVE_NETCONF', 'yes')
+    report_conf_data.set(
+        'LIBYANG_PREFIX',
+        NETCONF_DEP.get_variable('libyang_prefix', default_value: 'unknown'),
+    )
+    report_conf_data.set(
+        'SYSREPO_PREFIX',
+        NETCONF_DEP.get_variable('sysrepo_prefix', default_value: 'unknown'),
+    )
 else
     report_conf_data.set('HAVE_NETCONF', 'no')
+    report_conf_data.set('LIBYANG_PREFIX', 'unknown')
+    report_conf_data.set('SYSREPO_PREFIX', 'unknown')
 endif
 if FUZZ_OPT.enabled() or TESTS_OPT.enabled()
     report_conf_data.set('HAVE_GTEST', 'yes')
@@ -631,6 +627,48 @@ else
     report_conf_data.set('GTEST_INCLUDE', 'unknown')
     report_conf_data.set('GTEST_LIBDIR', 'unknown')
 endif
+if KRB5_DEP.found()
+    report_conf_data.set('HAVE_KRB5', 'yes')
+    report_conf_data.set('KRB5_GSSAPI_VERSION', KRB5_DEP.version())
+    report_conf_data.set(
+        'KRB5_GSSAPI_CFLAGS',
+        KRB5_DEP.get_variable('cflags', default_value: 'unknown'),
+    )
+    report_conf_data.set(
+        'KRB5_GSSAPI_LIBS',
+        KRB5_DEP.get_variable('libs', default_value: 'unknown'),
+    )
+    report_conf_data.set(
+        'KRB5_GSSAPI_VENDOR',
+        KRB5_DEP.get_variable('vendor', default_value: 'unknown'),
+    )
+else
+    report_conf_data.set('HAVE_KRB5', 'no')
+    report_conf_data.set('KRB5_GSSAPI_VERSION', 'unknown')
+    report_conf_data.set('KRB5_GSSAPI_CFLAGS', 'unknown')
+    report_conf_data.set('KRB5_GSSAPI_LIBS', 'unknown')
+    report_conf_data.set('KRB5_GSSAPI_VENDOR', 'unknown')
+endif
+if TESTS_OPT.enabled()
+    report_conf_data.set('TESTS_ENABLED', 'enabled')
+else
+    report_conf_data.set('TESTS_ENABLED', 'disabled')
+endif
+if valgrind.found()
+    report_conf_data.set('VALGRIND', valgrind.full_path())
+else
+    report_conf_data.set('VALGRIND', 'no')
+endif
+if FUZZ_OPT.enabled()
+    report_conf_data.set('FUZZ_ENABLED', 'enabled')
+else
+    report_conf_data.set('FUZZ_ENABLED', 'disabled')
+endif
+if have_afl
+    report_conf_data.set('HAVE_AFL', 'yes')
+else
+    report_conf_data.set('HAVE_AFL', 'no')
+endif
 
 #### Custom Targets
 
index 75b9475d57029713e4a5ef807d9987df3e26c454..0d8047b320febfcf9eeb3f542ba29c7f3ad7f660 100644 (file)
@@ -19,7 +19,16 @@ option(
     description: 'Support for PostgreSQL backends.',
 )
 
-# Options for enabling various parts of code.
-option('fuzz', type: 'feature', description: 'Support for fuzz testing.')
-option('shell', type: 'feature', description: 'Builds kea-shell.')
-option('tests', type: 'feature', description: 'Support for tests.')
+# Options for enabling testing code (not real features).
+option(
+    'fuzz',
+    type: 'feature',
+    value: 'disabled',
+    description: 'Support for fuzz testing.',
+)
+option(
+    'tests',
+    type: 'feature',
+    value: 'disabled',
+    description: 'Support for tests.',
+)
index 9f7e5044c846da5ebd2c7b321ed6acb980613ae3..31f2ed44c5aaa1cf32a3abeb86ae9f944a7c2d54 100644 (file)
@@ -1,7 +1,3 @@
-if not SHELL_OPT.enabled()
-    subdir_done()
-endif
-
 kea_shell_conf_data = configuration_data()
 kea_shell_conf_data.set('PYTHON', PYTHON.full_path())
 kea_shell_conf_data.set('PACKAGE_VERSION', PROJECT_VERSION)
index f59242a637115939ebe3da569dd9c757f1dfdf26..9f7c9ef2f859b0595e33fda095d1344e0bfea51a 100644 (file)
@@ -23,7 +23,11 @@ if krb5_config.found()
             compile_args: cflags.stdout().split(),
             link_args: libs.stdout().split(),
             version: krb5_version,
-            variables: {'vendor': vendor},
+            variables: {
+                'cflags': cflags.stdout().strip(),
+                'libs': libs.stdout().strip(),
+                'vendor': vendor,
+            },
         )
     endif
 endif
index 12c3e03e691b65df934fe29695ec16289566287c..5df322917806785fb933db195f5f3104623513e0 100644 (file)
@@ -54,6 +54,19 @@ foreach dep : ['yang', 'yang-cpp', 'sysrepo', 'sysrepo-cpp']
 endforeach
 
 if all_deps_found
+    variables = {}
+    if netconf_deps['yang'].found()
+        libyang_prefix = netconf_deps['yang'].get_variable('prefix')
+    else
+        libyang_prefix = 'unknown'
+    endif
+    variables += {'libyang_prefix': libyang_prefix}
+    if netconf_deps['sysrepo'].found()
+        sysrepo_prefix = netconf_deps['sysrepo'].get_variable('prefix')
+    else
+        sysrepo_prefix = 'unknown'
+    endif
+    variables += {'sysrepo_prefix': sysrepo_prefix}
     netconf = declare_dependency(
         dependencies: [
             netconf_deps['yang'],
@@ -61,12 +74,10 @@ if all_deps_found
             netconf_deps['sysrepo'],
             netconf_deps['sysrepo-cpp'],
         ],
-        variables: {
-            'libyang_prefix': netconf_deps['yang'].found() ? netconf_deps['yang'].get_variable('prefix') : 'unknown',
-            'sysrepo_prefix': netconf_deps['sysrepo'].found() ? netconf_deps['sysrepo'].get_variable('prefix') : 'unknown',
-        },
+        variables: variables,
     )
 else
-    netconf = disabler()
+    # Can't use a disabler here?
+    netconf = declare_dependency('', required: false)
 endif