From e12ea0dd9cdb9d7782e6785c5737d136f6d29bd1 Mon Sep 17 00:00:00 2001 From: dgsga <181612+dgsga@users.noreply.github.com> Date: Tue, 12 Mar 2024 11:41:16 +0000 Subject: [PATCH] Compile spotlight sources with flex and bison --- etc/spotlight/meson.build | 20 ++++++++++++++------ meson.build | 2 +- 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/etc/spotlight/meson.build b/etc/spotlight/meson.build index 2bd9e9c23a..cc1032f78d 100644 --- a/etc/spotlight/meson.build +++ b/etc/spotlight/meson.build @@ -1,4 +1,16 @@ -srp_sources = ['sparql_map.c', 'sparql_parser.c', 'spotlight_rawquery_lexer.c'] +lgen = generator(flex, +output : '@BASENAME@.c', +arguments : ['-o', '@OUTPUT@', '@INPUT@']) + +lfile = lgen.process('spotlight_rawquery_lexer.l') + +ygen = generator(bison, +output : '@BASENAME@.c', +arguments : ['-d', '-o', '@OUTPUT@', '@INPUT@']) + +yfile = ygen.process('sparql_parser.y') + +srp_sources = ['sparql_map.c', yfile, lfile] executable( 'srp', @@ -15,11 +27,7 @@ executable( install: false, ) -spotlight_sources = [ - 'sparql_map.c', - 'sparql_parser.c', - 'spotlight_rawquery_lexer.c', -] +spotlight_sources = ['sparql_map.c', lfile, yfile] libspotlight = static_library( 'libspotlight', diff --git a/meson.build b/meson.build index 9be52cc446..2f8603f88a 100644 --- a/meson.build +++ b/meson.build @@ -140,7 +140,7 @@ add_global_link_arguments(netatalk_common_link_args, language: 'c') # Programs # ############ -bison = find_program('bison', required: true) +bison = find_program(prefix / 'opt/bison/bin/bison', 'bison', required: true) flex = find_program('flex', required: true) grep = find_program('grep', required: true) mysql_config = find_program('mysql_config', required: false)