]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
meson: Check GNU sed's availability
authorAndrea Bolognani <abologna@redhat.com>
Wed, 24 Mar 2021 09:10:20 +0000 (10:10 +0100)
committerAndrea Bolognani <abologna@redhat.com>
Thu, 1 Apr 2021 12:14:28 +0000 (14:14 +0200)
As explained in the comment in build-aux/Makefile.in, the
version of sed included in the FreeBSD base system is not GNU
sed, which our syntax-check rules expect; as a result, many
checks will fail with

  gmake: gsed: No such file or directory
  /bin/sh: gsed: not found

Similarly to what we're already doing with GNU make and GNU
grep, look for GNU sed during the configuration step and fail
early if it's not available.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
build-aux/Makefile.in
build-aux/meson.build
build-aux/syntax-check.mk

index 415a8df30574567da3e62682241180b6fe41f373..9ccbec7b1beb8a12ef755d42cb78f672cde592d9 100644 (file)
@@ -6,6 +6,7 @@ FLAKE8 = @flake8_path@
 RUNUTF8 = @runutf8@
 PYTHON = @PYTHON3@
 GREP = @GREP@
+SED = @SED@
 
 # include syntax-check.mk file
 include $(top_srcdir)/build-aux/syntax-check.mk
index c56a3489461363ff321b8865e8cccd1b5b615f7b..fe88d6b736b10d8be72e9655d9bc09b71445ccfa 100644 (file)
@@ -12,8 +12,10 @@ syntax_check_conf.set('PYTHON3', python3_prog.path())
 
 if host_machine.system() == 'freebsd'
   make_prog = find_program('gmake')
+  sed_prog = find_program('gsed')
 else
   make_prog = find_program('make')
+  sed_prog = find_program('sed')
 endif
 
 if host_machine.system() == 'freebsd'
@@ -34,6 +36,7 @@ else
 endif
 
 syntax_check_conf.set('GREP', grep_prog.path())
+syntax_check_conf.set('SED', sed_prog.path())
 
 configure_file(
   input: 'Makefile.in',
index 51a498a8976851b9e2668c37fd3c0993e7ab4b2d..7f4a23c04860a2000cc2212c769fdb94c2e3789f 100644 (file)
@@ -27,15 +27,6 @@ ME := build-aux/syntax-check.mk
 # of the module description. But some packages import this file directly,
 # ignoring the module description.
 AWK ?= awk
-# FreeBSD (and probably some other OSes too) ships own version of sed(1), not
-# compatible with the GNU sed. GNU sed is available as gsed(1), so use this
-# instead
-UNAME := $(shell uname)
-ifeq ($(UNAME),FreeBSD)
-SED ?= gsed
-else
-SED ?= sed
-endif
 
 # Helper variables.
 _empty =