From a0d00963c59b494a0993b0df3baf9950af68e93a Mon Sep 17 00:00:00 2001 From: Andrei Pavel Date: Mon, 24 Feb 2025 12:01:19 +0200 Subject: [PATCH] [#3731] Uppercase program names with no _exe in meson.build --- doc/devel/meson.build | 2 +- doc/sphinx/meson.build | 22 +++++----- meson.build | 76 +++++++++++++-------------------- src/bin/agent/meson.build | 2 +- src/bin/d2/meson.build | 2 +- src/bin/dhcp4/meson.build | 2 +- src/bin/dhcp6/meson.build | 2 +- src/bin/netconf/meson.build | 2 +- src/bin/shell/meson.build | 6 +-- src/bin/shell/tests/meson.build | 2 +- src/lib/eval/meson.build | 2 +- src/lib/util/python/meson.build | 4 +- tools/meson.build | 8 ++-- 13 files changed, 58 insertions(+), 74 deletions(-) diff --git a/doc/devel/meson.build b/doc/devel/meson.build index ebb4970445..53b52ebbfa 100644 --- a/doc/devel/meson.build +++ b/doc/devel/meson.build @@ -1,4 +1,4 @@ -if not doxygen_exe.found() +if not DOXYGEN.found() subdir_done() endif diff --git a/doc/sphinx/meson.build b/doc/sphinx/meson.build index 99ac18e6b1..71d6e2d3be 100644 --- a/doc/sphinx/meson.build +++ b/doc/sphinx/meson.build @@ -1,4 +1,4 @@ -if not python_exe.found() +if not PYTHON.found() subdir_done() endif @@ -76,21 +76,21 @@ make_conf_data.set('builddir', meson.current_build_dir()) make_conf_data.set('srcdir', meson.current_source_dir()) make_conf_data.set('sphinxbuilddir', sphinxbuilddir) make_conf_data.set('abs_sphinxbuilddir', abs_sphinxbuilddir) -make_conf_data.set('PYTHON', python_exe.full_path()) +make_conf_data.set('PYTHON', PYTHON.full_path()) make_conf_data.set('TOP_SOURCE_DIR', TOP_SOURCE_DIR) -if pdflatex_exe.found() +if PDFLATEX.found() make_conf_data.set('HAVE_PDFLATEX', 'yes') - pdflatex = pdflatex_exe.full_path() + pdflatex = PDFLATEX.full_path() else make_conf_data.set('HAVE_PDFLATEX', 'no') pdflatex = 'false' endif make_conf_data.set('PDFLATEX_AND_OPTS', pdflatex + ' -interaction nonstopmode') -make_conf_data.set('SPHINXBUILD', sphinx_exe.full_path()) +make_conf_data.set('SPHINXBUILD', SPHINX.full_path()) make_conf_data.set('sphinxopts', ' '.join(sphinxopts)) -if plantuml_exe.found() +if PLANTUML.found() make_conf_data.set('HAVE_PLANTUML', 'yes') - plantuml = plantuml_exe.full_path() + plantuml = PLANTUML.full_path() else make_conf_data.set('HAVE_PLANTUML', 'no') plantuml = 'false' @@ -98,7 +98,7 @@ endif make_conf_data.set('PLANTUML', plantuml) make_conf_data.set('umls', ' '.join(umls)) make_conf_data.set('svgs', ' '.join(svgs)) -if xmllint_exe.found() +if XMLLINT.found() make_conf_data.set('HAVE_XMLLINT', 'yes') else make_conf_data.set('HAVE_XMLLINT', 'no') @@ -106,7 +106,7 @@ endif tumls = ['uml/tkey.uml', 'uml/update.uml'] make_conf_data.set('tumls', ' '.join(tumls)) make_conf_data.set('txts', ' '.join(txts)) -if pip_compile_exe.found() +if PIP_COMPILE.found() make_conf_data.set('HAVE_PIP_COMPILE', 'yes') else make_conf_data.set('HAVE_PIP_COMPILE', 'no') @@ -115,12 +115,12 @@ make_conf_data.set('man8s', ' '.join(man8s)) make_conf_data.set('PREFIX', PREFIX) docdir = f'@PREFIX@/@DATADIR@/kea' make_conf_data.set('docdir', docdir) -make_conf_data.set('INSTALL', install_exe.full_path()) +make_conf_data.set('INSTALL', INSTALL.full_path()) mandir = get_option('mandir') mandir8 = f'@PREFIX@/@mandir@/man8/' make_conf_data.set('mandir8', mandir8) -if sphinx_exe.found() +if SPHINX.found() make_doc = configure_file( input: 'make-doc.sh.in', output: 'make-doc.sh', diff --git a/meson.build b/meson.build index a032a66894..aeb92d752e 100644 --- a/meson.build +++ b/meson.build @@ -1,11 +1,5 @@ # Require meson >= 0.64.0 for preserve_path arg in install_data. -project( - 'kea', - 'cpp', - version: '2.7.7-git', - meson_version: '>=0.64.0', - default_options: ['default_library=shared'], -) +project('kea', 'cpp', version: '2.7.7-git', meson_version: '>=0.64.0') cpp = meson.get_compiler('cpp') project_version = meson.project_version() @@ -155,33 +149,23 @@ message(f'Detected system "@SYSTEM@".') #### Programs -python_exe = find_program('python3', 'python', required: false) -flex_exe = find_program('flex', version: '>=2.6.4', required: false) -bison_exe = find_program('bison', version: '>=3.3.0', required: false) -awk_exe = find_program('gawk', 'awk', required: false) -doxygen_exe = find_program('doxygen', required: false) -sphinx_exe = find_program('sphinx-build', 'sphinx-build-3', required: false) -pdflatex_exe = find_program('pdflatex', required: false) -plantuml_exe = find_program('plantuml', required: false) -xmllint_exe = find_program('xmllint', required: false) -pip_compile_exe = find_program('pip-compile', required: false) -install_exe = find_program('install', required: true) -valgrind_exe = find_program('valgrind', required: false) -cppcheck_exe = find_program('cppcheck', required: false) -cppcheck_htmlreport_exe = find_program('cppcheck-htmlreport', required: false) +# External programs used only in this file. +cppcheck = find_program('cppcheck', required: false) +cppcheck_htmlreport = find_program('cppcheck-htmlreport', required: false) +valgrind = find_program('valgrind', required: false) + +AWK = find_program('gawk', 'awk', required: false) +BISON = find_program('bison', version: '>=3.3.0', required: false) +DOXYGEN = find_program('doxygen', required: false) +FLEX = find_program('flex', version: '>=2.6.4', required: false) +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) +SPHINX = find_program('sphinx-build', 'sphinx-build-3', required: false) +XMLLINT = find_program('xmllint', required: false) -if python_exe.found() - PYTHON = python_exe.full_path() -endif -if flex_exe.found() - FLEX = flex_exe.full_path() -endif -if bison_exe.found() - BISON = bison_exe.full_path() -endif -if awk_exe.found() - AWK = awk_exe.full_path() -endif CD_AND_RUN = find_program(f'@TOP_SOURCE_DIR@/cd-and-run.sh') KEA_MSG_COMPILER = disabler() @@ -489,11 +473,11 @@ 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_exe.found() +if PYTHON.found() report_conf_data.set('HAVE_PYTHON', 'yes') - report_conf_data.set('PYTHON_PATH', PYTHON) + report_conf_data.set('PYTHON_PATH', PYTHON.full_path()) result = run_command( - python_exe, + PYTHON, '-c', 'import sysconfig; print(sysconfig.get_paths()[\'purelib\'])', check: false, @@ -575,13 +559,13 @@ if result.returncode() == 0 else report_conf_data.set('LOG4CPLUS_VERSION', log4cplus.version()) endif -if flex_exe.found() - report_conf_data.set('FLEX', FLEX) +if FLEX.found() + report_conf_data.set('FLEX', FLEX.full_path()) else report_conf_data.set('FLEX', 'unknown') endif -if bison_exe.found() - report_conf_data.set('BISON', BISON) +if BISON.found() + report_conf_data.set('BISON', BISON.full_path()) else report_conf_data.set('BISON', 'unknown') endif @@ -658,11 +642,11 @@ run_target( ) # todo: remove redirections -if cppcheck_exe.found() +if cppcheck.found() run_target( 'cppcheck', command: [ - cppcheck_exe, + cppcheck, '-I.', '-I./src/lib', '-I./src/bin', @@ -682,11 +666,11 @@ if cppcheck_exe.found() ) endif -if cppcheck_htmlreport_exe.found() +if cppcheck_htmlreport.found() run_target( 'cppcheck-report', command: [ - cppcheck_htmlreport_exe, + cppcheck_htmlreport, '--file', './cppcheck-result.xml', '--report-dir', @@ -697,11 +681,11 @@ if cppcheck_htmlreport_exe.found() ) endif -if valgrind_exe.found() +if valgrind.found() add_test_setup( 'valgrind', exe_wrapper: [ - valgrind_exe, + valgrind, '--child-silent-after-fork=yes', '--fullpath-after=', '--leak-check=full', diff --git a/src/bin/agent/meson.build b/src/bin/agent/meson.build index 0e6d876061..823fb9e269 100644 --- a/src/bin/agent/meson.build +++ b/src/bin/agent/meson.build @@ -39,7 +39,7 @@ if KEA_MSG_COMPILER.found() TARGETS_GEN_MESSAGES += [target_gen_messages] endif -if flex_exe.found() and bison_exe.found() +if FLEX.found() and BISON.found() target_parser = run_target( 'src-bin-agent-parser', command: [ diff --git a/src/bin/d2/meson.build b/src/bin/d2/meson.build index a641a597a7..5f8065f239 100644 --- a/src/bin/d2/meson.build +++ b/src/bin/d2/meson.build @@ -29,7 +29,7 @@ executable( ) subdir('tests') -if flex_exe.found() and bison_exe.found() +if FLEX.found() and BISON.found() current_source_dir = meson.current_source_dir() target_parser = run_target( 'src-bin-d2-parser', diff --git a/src/bin/dhcp4/meson.build b/src/bin/dhcp4/meson.build index 5cf5275175..44eb9574d5 100644 --- a/src/bin/dhcp4/meson.build +++ b/src/bin/dhcp4/meson.build @@ -38,7 +38,7 @@ if KEA_MSG_COMPILER.found() TARGETS_GEN_MESSAGES += [target_gen_messages] endif -if flex_exe.found() and bison_exe.found() +if FLEX.found() and BISON.found() target_parser = run_target( 'src-bin-dhcp4-parser', command: [ diff --git a/src/bin/dhcp6/meson.build b/src/bin/dhcp6/meson.build index 08fbbf0a25..e9aafe0952 100644 --- a/src/bin/dhcp6/meson.build +++ b/src/bin/dhcp6/meson.build @@ -39,7 +39,7 @@ if KEA_MSG_COMPILER.found() TARGETS_GEN_MESSAGES += [target_gen_messages] endif -if flex_exe.found() and bison_exe.found() +if FLEX.found() and BISON.found() target_parser = run_target( 'src-bin-dhcp6-parser', command: [ diff --git a/src/bin/netconf/meson.build b/src/bin/netconf/meson.build index f90834a890..a9b4a2b654 100644 --- a/src/bin/netconf/meson.build +++ b/src/bin/netconf/meson.build @@ -52,7 +52,7 @@ if KEA_MSG_COMPILER.found() TARGETS_GEN_MESSAGES += [target_gen_messages] endif -if flex_exe.found() and bison_exe.found() +if FLEX.found() and BISON.found() target_parser = run_target( 'src-bin-netconf-parser', command: [ diff --git a/src/bin/shell/meson.build b/src/bin/shell/meson.build index f86e4e9211..26f0047de2 100644 --- a/src/bin/shell/meson.build +++ b/src/bin/shell/meson.build @@ -1,14 +1,14 @@ -if not python_exe.found() +if not PYTHON.found() subdir_done() endif kea_shell_conf_data = configuration_data() -kea_shell_conf_data.set('PYTHON', PYTHON) +kea_shell_conf_data.set('PYTHON', PYTHON.full_path()) kea_shell_conf_data.set('PACKAGE_VERSION', project_version) kea_shell_conf_data.set('EXTENDED_VERSION', project_version + ' (tarball)') r = run_command( - python_exe, + PYTHON, '-c', 'import sysconfig; print(sysconfig.get_paths()[\'purelib\'])', check: true, diff --git a/src/bin/shell/tests/meson.build b/src/bin/shell/tests/meson.build index 334b9cb372..e01b58a436 100644 --- a/src/bin/shell/tests/meson.build +++ b/src/bin/shell/tests/meson.build @@ -3,7 +3,7 @@ if not gtest.found() endif shell_tests_conf_data = configuration_data() -shell_tests_conf_data.set('PYTHON', PYTHON) +shell_tests_conf_data.set('PYTHON', PYTHON.full_path()) shell_tests_conf_data.set('abs_top_builddir', TOP_BUILD_DIR) shell_tests_conf_data.set('abs_top_srcdir', TOP_SOURCE_DIR) shell_unittest = configure_file( diff --git a/src/lib/eval/meson.build b/src/lib/eval/meson.build index ac71603a3e..e93a67a7c8 100644 --- a/src/lib/eval/meson.build +++ b/src/lib/eval/meson.build @@ -41,7 +41,7 @@ if KEA_MSG_COMPILER.found() TARGETS_GEN_MESSAGES += [target_gen_messages] endif -if flex_exe.found() and bison_exe.found() +if FLEX.found() and BISON.found() target_parser = run_target( 'src-lib-eval-parser', command: [ diff --git a/src/lib/util/python/meson.build b/src/lib/util/python/meson.build index 3f5996b865..36b4f6d3ec 100644 --- a/src/lib/util/python/meson.build +++ b/src/lib/util/python/meson.build @@ -1,10 +1,10 @@ -if not python_exe.found() +if not PYTHON.found() subdir_done() endif configure_file(input: 'const2hdr.py', output: 'const2hdr.py', copy: true) util_python_conf_data = configuration_data() -util_python_conf_data.set('PYTHON', PYTHON) +util_python_conf_data.set('PYTHON', PYTHON.full_path()) configure_file( input: 'gen_wiredata.py.in', output: 'gen_wiredata.py', diff --git a/tools/meson.build b/tools/meson.build index ca59455090..1aeb8c2c7c 100644 --- a/tools/meson.build +++ b/tools/meson.build @@ -5,13 +5,13 @@ tools_conf_data.set('localstatedir', '${prefix}/' + get_option('localstatedir')) tools_conf_data.set('exec_prefix', '${prefix}') tools_conf_data.set('libdir', '${exec_prefix}/' + get_option('libdir')) tools_conf_data.set('SEP', '+') -if bison_exe.found() - tools_conf_data.set('YACC', BISON) +if BISON.found() + tools_conf_data.set('YACC', BISON.full_path()) else tools_conf_data.set('YACC', 'bison') endif -if awk_exe.found() - tools_conf_data.set('AWK', AWK) +if AWK.found() + tools_conf_data.set('AWK', AWK.full_path()) else tools_conf_data.set('AWK', 'awk') endif