summaryrefslogtreecommitdiff
path: root/build-aux/meson.build
diff options
context:
space:
mode:
authorRoman Bogorodskiy <bogorodskiy@gmail.com>2021-03-02 18:31:36 +0400
committerRoman Bogorodskiy <bogorodskiy@gmail.com>2021-03-04 19:17:15 +0400
commit7dd7ddac500cd3f453cd19606904ae406f5ffe03 (patch)
treed47db0050148533febcb0087f83cfa15e5079678 /build-aux/meson.build
parente7bd2f6a732ecf57819d1f9a84fbe78489d7a98e (diff)
downloadlibvirt-7dd7ddac500cd3f453cd19606904ae406f5ffe03.tar.gz
build-aux: require GNU grep on FreeBSD
FreeBSD 13.x and newer ship BSD grep which apparently has some performance issues causing certain syntax check tests to run longer than the default 30 seconds timeout used by meson. However, GNU grep is still available through the textproc/gnugrep port, so require it on FreeBSD if /usr/bin/grep is a BSD grep to make checks pass in a reasonable time. Signed-off-by: Roman Bogorodskiy <bogorodskiy@gmail.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
Diffstat (limited to 'build-aux/meson.build')
-rw-r--r--build-aux/meson.build24
1 files changed, 19 insertions, 5 deletions
diff --git a/build-aux/meson.build b/build-aux/meson.build
index c506feefd2..c44ed6821c 100644
--- a/build-aux/meson.build
+++ b/build-aux/meson.build
@@ -10,18 +10,32 @@ syntax_check_conf.set('flake8_path', flake8_path)
syntax_check_conf.set('runutf8', ' '.join(runutf8))
syntax_check_conf.set('PYTHON3', python3_prog.path())
-configure_file(
- input: 'Makefile.in',
- output: '@BASENAME@',
- configuration: syntax_check_conf,
-)
+
+grep_prog = find_program('grep')
if host_machine.system() == 'freebsd'
make_prog = find_program('gmake')
+
+ grep_cmd = run_command(grep_prog, '--version')
+ if grep_cmd.stdout().startswith('grep (BSD grep')
+ grep_prog = find_program('/usr/local/bin/grep')
+ grep_cmd = run_command(grep_prog, '--version')
+ if grep_cmd.stdout().startswith('grep (BSD grep')
+ error('GNU grep not found')
+ endif
+ endif
else
make_prog = find_program('make')
endif
+syntax_check_conf.set('GREP', grep_prog.path())
+
+configure_file(
+ input: 'Makefile.in',
+ output: '@BASENAME@',
+ configuration: syntax_check_conf,
+)
+
rc = run_command(
'sed', '-n',
's/^\\(sc_[a-zA-Z0-9_-]*\\):.*/\\1/p',