]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
Meson: Create flex and bison generators
authorFred Morcos <fred.morcos@open-xchange.com>
Thu, 3 Aug 2023 17:07:23 +0000 (19:07 +0200)
committerFred Morcos <fred.morcos@open-xchange.com>
Wed, 20 Mar 2024 12:28:31 +0000 (13:28 +0100)
meson.build
meson/bison/meson.build [moved from meson/prog-bison/meson.build with 63% similarity]
meson/flex/meson.build [moved from meson/prog-flex/meson.build with 68% similarity]

index 034720b024e956d62f45297aacf651c2fdedd8d2..ca41d4c728b12ca2cdbe257774fa3a3fa4011725 100644 (file)
@@ -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, ...)
similarity index 63%
rename from meson/prog-bison/meson.build
rename to meson/bison/meson.build
index e9c7186552cf21ef6c95a9b2016ecab844b40238..6801c91c8935192e16904e9ea336c1987317250b 100644 (file)
@@ -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@'],
+)
similarity index 68%
rename from meson/prog-flex/meson.build
rename to meson/flex/meson.build
index 562c21ef53122170f0b9cbb04abe4bfb63351036..3ab0ad3bf5a61fdc1367c4ae3573479b285fd9b3 100644 (file)
@@ -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@'],
+)