From: Fred Morcos Date: Thu, 3 Aug 2023 17:07:23 +0000 (+0200) Subject: Meson: Create flex and bison generators X-Git-Tag: rec-5.1.0-alpha1~80^2~308 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5dedf440309bd21a72dc070845a73dc508c0dc18;p=thirdparty%2Fpdns.git Meson: Create flex and bison generators --- diff --git a/meson.build b/meson.build index 034720b024..ca41d4c728 100644 --- a/meson.build +++ b/meson.build @@ -26,8 +26,8 @@ subdir('meson/compiler-setup') # Common compiler setup (cxx is the C++ subdir('meson/summary') # Print a system/project summary subdir('meson/timet-size') # Check the size of time_t subdir('meson/timet-sign') # Check the sign of time_t -subdir('meson/prog-flex') # Find flex -subdir('meson/prog-bison') # Find bison +subdir('meson/flex') # Find flex and create generator +subdir('meson/bison') # Find bison and create generator subdir('meson/platform') # Platform detection subdir('meson/atomics') # Check atomics support subdir('meson/pthread-headers') # Check pthread headers @@ -194,7 +194,3 @@ config_h = configure_file(configuration: conf, output: 'config.h') # TODO: Add source files auth = executable('pdns', config_h, dependencies: deps, export_dynamic: true) - -# TODO Generate bindlexer.c and bindparser.cc. -# bindlexer_c = generator(flex, ...) -# bindparser_cc = generator(bison, ...) diff --git a/meson/prog-bison/meson.build b/meson/bison/meson.build similarity index 63% rename from meson/prog-bison/meson.build rename to meson/bison/meson.build index e9c7186552..6801c91c89 100644 --- a/meson/prog-bison/meson.build +++ b/meson/bison/meson.build @@ -5,3 +5,9 @@ bison = find_program('bison', required: true) summary('bison', bison.found(), bool_yn: true, section: 'Programs') # summary('Bison', bison.full_path(), section: 'System') # TODO Meson 0.55 # summary('Bison Version', bison.version(), section: 'System') # TODO Meson 0.62 + +bison_generator = generator( + bison, + output: '@BASENAME@.cc', + arguments: ['--verbose', '--debug', '--header=@BUILD_DIR@' / '@BASENAME@.h', '--output=@OUTPUT@', '@INPUT@'], +) diff --git a/meson/prog-flex/meson.build b/meson/flex/meson.build similarity index 68% rename from meson/prog-flex/meson.build rename to meson/flex/meson.build index 562c21ef53..3ab0ad3bf5 100644 --- a/meson/prog-flex/meson.build +++ b/meson/flex/meson.build @@ -5,3 +5,9 @@ flex = find_program('flex', required: true) summary('flex', flex.found(), bool_yn: true, section: 'Programs') # summary('Flex', flex.full_path(), section: 'System') # TODO Meson 0.55 # summary('Flex Version', flex.version(), section: 'System') # TODO Meson 0.62 + +flex_generator = generator( + flex, + output: '@BASENAME@.c', + arguments: ['--case-insensitive', '--outfile=@OUTPUT@', '@INPUT@'], +)