2
0
mirror of https://gitlab.isc.org/isc-projects/kea synced 2025-08-22 18:08:16 +00:00

[#3731] Uppercase program names with no _exe in meson.build

This commit is contained in:
Andrei Pavel 2025-02-24 12:01:19 +02:00
parent f79d96a65d
commit a0d00963c5
No known key found for this signature in database
GPG Key ID: D4E804481939CB21
13 changed files with 58 additions and 74 deletions

View File

@ -1,4 +1,4 @@
if not doxygen_exe.found() if not DOXYGEN.found()
subdir_done() subdir_done()
endif endif

View File

@ -1,4 +1,4 @@
if not python_exe.found() if not PYTHON.found()
subdir_done() subdir_done()
endif 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('srcdir', meson.current_source_dir())
make_conf_data.set('sphinxbuilddir', sphinxbuilddir) make_conf_data.set('sphinxbuilddir', sphinxbuilddir)
make_conf_data.set('abs_sphinxbuilddir', abs_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) make_conf_data.set('TOP_SOURCE_DIR', TOP_SOURCE_DIR)
if pdflatex_exe.found() if PDFLATEX.found()
make_conf_data.set('HAVE_PDFLATEX', 'yes') make_conf_data.set('HAVE_PDFLATEX', 'yes')
pdflatex = pdflatex_exe.full_path() pdflatex = PDFLATEX.full_path()
else else
make_conf_data.set('HAVE_PDFLATEX', 'no') make_conf_data.set('HAVE_PDFLATEX', 'no')
pdflatex = 'false' pdflatex = 'false'
endif endif
make_conf_data.set('PDFLATEX_AND_OPTS', pdflatex + ' -interaction nonstopmode') 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)) make_conf_data.set('sphinxopts', ' '.join(sphinxopts))
if plantuml_exe.found() if PLANTUML.found()
make_conf_data.set('HAVE_PLANTUML', 'yes') make_conf_data.set('HAVE_PLANTUML', 'yes')
plantuml = plantuml_exe.full_path() plantuml = PLANTUML.full_path()
else else
make_conf_data.set('HAVE_PLANTUML', 'no') make_conf_data.set('HAVE_PLANTUML', 'no')
plantuml = 'false' plantuml = 'false'
@ -98,7 +98,7 @@ endif
make_conf_data.set('PLANTUML', plantuml) make_conf_data.set('PLANTUML', plantuml)
make_conf_data.set('umls', ' '.join(umls)) make_conf_data.set('umls', ' '.join(umls))
make_conf_data.set('svgs', ' '.join(svgs)) make_conf_data.set('svgs', ' '.join(svgs))
if xmllint_exe.found() if XMLLINT.found()
make_conf_data.set('HAVE_XMLLINT', 'yes') make_conf_data.set('HAVE_XMLLINT', 'yes')
else else
make_conf_data.set('HAVE_XMLLINT', 'no') make_conf_data.set('HAVE_XMLLINT', 'no')
@ -106,7 +106,7 @@ endif
tumls = ['uml/tkey.uml', 'uml/update.uml'] tumls = ['uml/tkey.uml', 'uml/update.uml']
make_conf_data.set('tumls', ' '.join(tumls)) make_conf_data.set('tumls', ' '.join(tumls))
make_conf_data.set('txts', ' '.join(txts)) make_conf_data.set('txts', ' '.join(txts))
if pip_compile_exe.found() if PIP_COMPILE.found()
make_conf_data.set('HAVE_PIP_COMPILE', 'yes') make_conf_data.set('HAVE_PIP_COMPILE', 'yes')
else else
make_conf_data.set('HAVE_PIP_COMPILE', 'no') 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) make_conf_data.set('PREFIX', PREFIX)
docdir = f'@PREFIX@/@DATADIR@/kea' docdir = f'@PREFIX@/@DATADIR@/kea'
make_conf_data.set('docdir', docdir) 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') mandir = get_option('mandir')
mandir8 = f'@PREFIX@/@mandir@/man8/' mandir8 = f'@PREFIX@/@mandir@/man8/'
make_conf_data.set('mandir8', mandir8) make_conf_data.set('mandir8', mandir8)
if sphinx_exe.found() if SPHINX.found()
make_doc = configure_file( make_doc = configure_file(
input: 'make-doc.sh.in', input: 'make-doc.sh.in',
output: 'make-doc.sh', output: 'make-doc.sh',

View File

@ -1,11 +1,5 @@
# Require meson >= 0.64.0 for preserve_path arg in install_data. # Require meson >= 0.64.0 for preserve_path arg in install_data.
project( project('kea', 'cpp', version: '2.7.7-git', meson_version: '>=0.64.0')
'kea',
'cpp',
version: '2.7.7-git',
meson_version: '>=0.64.0',
default_options: ['default_library=shared'],
)
cpp = meson.get_compiler('cpp') cpp = meson.get_compiler('cpp')
project_version = meson.project_version() project_version = meson.project_version()
@ -155,33 +149,23 @@ message(f'Detected system "@SYSTEM@".')
#### Programs #### Programs
python_exe = find_program('python3', 'python', required: false) # External programs used only in this file.
flex_exe = find_program('flex', version: '>=2.6.4', required: false) cppcheck = find_program('cppcheck', required: false)
bison_exe = find_program('bison', version: '>=3.3.0', required: false) cppcheck_htmlreport = find_program('cppcheck-htmlreport', required: false)
awk_exe = find_program('gawk', 'awk', required: false) valgrind = find_program('valgrind', required: false)
doxygen_exe = find_program('doxygen', required: false)
sphinx_exe = find_program('sphinx-build', 'sphinx-build-3', required: false) AWK = find_program('gawk', 'awk', required: false)
pdflatex_exe = find_program('pdflatex', required: false) BISON = find_program('bison', version: '>=3.3.0', required: false)
plantuml_exe = find_program('plantuml', required: false) DOXYGEN = find_program('doxygen', required: false)
xmllint_exe = find_program('xmllint', required: false) FLEX = find_program('flex', version: '>=2.6.4', required: false)
pip_compile_exe = find_program('pip-compile', required: false) INSTALL = find_program('install', required: true)
install_exe = find_program('install', required: true) PDFLATEX = find_program('pdflatex', required: false)
valgrind_exe = find_program('valgrind', required: false) PIP_COMPILE = find_program('pip-compile', required: false)
cppcheck_exe = find_program('cppcheck', required: false) PLANTUML = find_program('plantuml', required: false)
cppcheck_htmlreport_exe = find_program('cppcheck-htmlreport', 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') CD_AND_RUN = find_program(f'@TOP_SOURCE_DIR@/cd-and-run.sh')
KEA_MSG_COMPILER = disabler() KEA_MSG_COMPILER = disabler()
@ -489,11 +473,11 @@ endif
report_conf_data.set('CXX_ARGS', ' '.join(compile_args)) report_conf_data.set('CXX_ARGS', ' '.join(compile_args))
report_conf_data.set('LD_ID', cpp.get_linker_id()) report_conf_data.set('LD_ID', cpp.get_linker_id())
report_conf_data.set('LD_ARGS', ' '.join(link_args)) 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('HAVE_PYTHON', 'yes')
report_conf_data.set('PYTHON_PATH', PYTHON) report_conf_data.set('PYTHON_PATH', PYTHON.full_path())
result = run_command( result = run_command(
python_exe, PYTHON,
'-c', '-c',
'import sysconfig; print(sysconfig.get_paths()[\'purelib\'])', 'import sysconfig; print(sysconfig.get_paths()[\'purelib\'])',
check: false, check: false,
@ -575,13 +559,13 @@ if result.returncode() == 0
else else
report_conf_data.set('LOG4CPLUS_VERSION', log4cplus.version()) report_conf_data.set('LOG4CPLUS_VERSION', log4cplus.version())
endif endif
if flex_exe.found() if FLEX.found()
report_conf_data.set('FLEX', FLEX) report_conf_data.set('FLEX', FLEX.full_path())
else else
report_conf_data.set('FLEX', 'unknown') report_conf_data.set('FLEX', 'unknown')
endif endif
if bison_exe.found() if BISON.found()
report_conf_data.set('BISON', BISON) report_conf_data.set('BISON', BISON.full_path())
else else
report_conf_data.set('BISON', 'unknown') report_conf_data.set('BISON', 'unknown')
endif endif
@ -658,11 +642,11 @@ run_target(
) )
# todo: remove redirections # todo: remove redirections
if cppcheck_exe.found() if cppcheck.found()
run_target( run_target(
'cppcheck', 'cppcheck',
command: [ command: [
cppcheck_exe, cppcheck,
'-I.', '-I.',
'-I./src/lib', '-I./src/lib',
'-I./src/bin', '-I./src/bin',
@ -682,11 +666,11 @@ if cppcheck_exe.found()
) )
endif endif
if cppcheck_htmlreport_exe.found() if cppcheck_htmlreport.found()
run_target( run_target(
'cppcheck-report', 'cppcheck-report',
command: [ command: [
cppcheck_htmlreport_exe, cppcheck_htmlreport,
'--file', '--file',
'./cppcheck-result.xml', './cppcheck-result.xml',
'--report-dir', '--report-dir',
@ -697,11 +681,11 @@ if cppcheck_htmlreport_exe.found()
) )
endif endif
if valgrind_exe.found() if valgrind.found()
add_test_setup( add_test_setup(
'valgrind', 'valgrind',
exe_wrapper: [ exe_wrapper: [
valgrind_exe, valgrind,
'--child-silent-after-fork=yes', '--child-silent-after-fork=yes',
'--fullpath-after=', '--fullpath-after=',
'--leak-check=full', '--leak-check=full',

View File

@ -39,7 +39,7 @@ if KEA_MSG_COMPILER.found()
TARGETS_GEN_MESSAGES += [target_gen_messages] TARGETS_GEN_MESSAGES += [target_gen_messages]
endif endif
if flex_exe.found() and bison_exe.found() if FLEX.found() and BISON.found()
target_parser = run_target( target_parser = run_target(
'src-bin-agent-parser', 'src-bin-agent-parser',
command: [ command: [

View File

@ -29,7 +29,7 @@ executable(
) )
subdir('tests') subdir('tests')
if flex_exe.found() and bison_exe.found() if FLEX.found() and BISON.found()
current_source_dir = meson.current_source_dir() current_source_dir = meson.current_source_dir()
target_parser = run_target( target_parser = run_target(
'src-bin-d2-parser', 'src-bin-d2-parser',

View File

@ -38,7 +38,7 @@ if KEA_MSG_COMPILER.found()
TARGETS_GEN_MESSAGES += [target_gen_messages] TARGETS_GEN_MESSAGES += [target_gen_messages]
endif endif
if flex_exe.found() and bison_exe.found() if FLEX.found() and BISON.found()
target_parser = run_target( target_parser = run_target(
'src-bin-dhcp4-parser', 'src-bin-dhcp4-parser',
command: [ command: [

View File

@ -39,7 +39,7 @@ if KEA_MSG_COMPILER.found()
TARGETS_GEN_MESSAGES += [target_gen_messages] TARGETS_GEN_MESSAGES += [target_gen_messages]
endif endif
if flex_exe.found() and bison_exe.found() if FLEX.found() and BISON.found()
target_parser = run_target( target_parser = run_target(
'src-bin-dhcp6-parser', 'src-bin-dhcp6-parser',
command: [ command: [

View File

@ -52,7 +52,7 @@ if KEA_MSG_COMPILER.found()
TARGETS_GEN_MESSAGES += [target_gen_messages] TARGETS_GEN_MESSAGES += [target_gen_messages]
endif endif
if flex_exe.found() and bison_exe.found() if FLEX.found() and BISON.found()
target_parser = run_target( target_parser = run_target(
'src-bin-netconf-parser', 'src-bin-netconf-parser',
command: [ command: [

View File

@ -1,14 +1,14 @@
if not python_exe.found() if not PYTHON.found()
subdir_done() subdir_done()
endif endif
kea_shell_conf_data = configuration_data() 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('PACKAGE_VERSION', project_version)
kea_shell_conf_data.set('EXTENDED_VERSION', project_version + ' (tarball)') kea_shell_conf_data.set('EXTENDED_VERSION', project_version + ' (tarball)')
r = run_command( r = run_command(
python_exe, PYTHON,
'-c', '-c',
'import sysconfig; print(sysconfig.get_paths()[\'purelib\'])', 'import sysconfig; print(sysconfig.get_paths()[\'purelib\'])',
check: true, check: true,

View File

@ -3,7 +3,7 @@ if not gtest.found()
endif endif
shell_tests_conf_data = configuration_data() 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_builddir', TOP_BUILD_DIR)
shell_tests_conf_data.set('abs_top_srcdir', TOP_SOURCE_DIR) shell_tests_conf_data.set('abs_top_srcdir', TOP_SOURCE_DIR)
shell_unittest = configure_file( shell_unittest = configure_file(

View File

@ -41,7 +41,7 @@ if KEA_MSG_COMPILER.found()
TARGETS_GEN_MESSAGES += [target_gen_messages] TARGETS_GEN_MESSAGES += [target_gen_messages]
endif endif
if flex_exe.found() and bison_exe.found() if FLEX.found() and BISON.found()
target_parser = run_target( target_parser = run_target(
'src-lib-eval-parser', 'src-lib-eval-parser',
command: [ command: [

View File

@ -1,10 +1,10 @@
if not python_exe.found() if not PYTHON.found()
subdir_done() subdir_done()
endif endif
configure_file(input: 'const2hdr.py', output: 'const2hdr.py', copy: true) configure_file(input: 'const2hdr.py', output: 'const2hdr.py', copy: true)
util_python_conf_data = configuration_data() util_python_conf_data = configuration_data()
util_python_conf_data.set('PYTHON', PYTHON) util_python_conf_data.set('PYTHON', PYTHON.full_path())
configure_file( configure_file(
input: 'gen_wiredata.py.in', input: 'gen_wiredata.py.in',
output: 'gen_wiredata.py', output: 'gen_wiredata.py',

View File

@ -5,13 +5,13 @@ tools_conf_data.set('localstatedir', '${prefix}/' + get_option('localstatedir'))
tools_conf_data.set('exec_prefix', '${prefix}') tools_conf_data.set('exec_prefix', '${prefix}')
tools_conf_data.set('libdir', '${exec_prefix}/' + get_option('libdir')) tools_conf_data.set('libdir', '${exec_prefix}/' + get_option('libdir'))
tools_conf_data.set('SEP', '+') tools_conf_data.set('SEP', '+')
if bison_exe.found() if BISON.found()
tools_conf_data.set('YACC', BISON) tools_conf_data.set('YACC', BISON.full_path())
else else
tools_conf_data.set('YACC', 'bison') tools_conf_data.set('YACC', 'bison')
endif endif
if awk_exe.found() if AWK.found()
tools_conf_data.set('AWK', AWK) tools_conf_data.set('AWK', AWK.full_path())
else else
tools_conf_data.set('AWK', 'awk') tools_conf_data.set('AWK', 'awk')
endif endif