]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
meson: Look for GNU tools on macOS too
authorAndrea Bolognani <abologna@redhat.com>
Wed, 24 Mar 2021 10:33:15 +0000 (11:33 +0100)
committerAndrea Bolognani <abologna@redhat.com>
Thu, 1 Apr 2021 13:34:54 +0000 (15:34 +0200)
macOS is similar to FreeBSD in that it ships non-GNU versions
of several utilities that we need in the base system.

macOS actually includes GNU make already, but unfortunately due
to licensing reasons the tool is permanently stuck in 2006, so
even in that case users are better off installing a recent
version from Homebrew along with the dozens of other libvirt
dependencies that already need to be obtained that way.

Note that, unlike FreeBSD ports, Homebrew is fully consistent
in adding the 'g' prefix to the name of the GNU tools, so we
can detect GNU grep without additional hacks.

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

index fe88d6b736b10d8be72e9655d9bc09b71445ccfa..109598239723cc086151677b19f06ad9e02504b6 100644 (file)
@@ -10,7 +10,7 @@ syntax_check_conf.set('flake8_path', flake8_path)
 syntax_check_conf.set('runutf8', ' '.join(runutf8))
 syntax_check_conf.set('PYTHON3', python3_prog.path())
 
-if host_machine.system() == 'freebsd'
+if host_machine.system() == 'freebsd' or host_machine.system() == 'darwin'
   make_prog = find_program('gmake')
   sed_prog = find_program('gsed')
 else
@@ -31,6 +31,8 @@ if host_machine.system() == 'freebsd'
       error('GNU grep not found')
     endif
   endif
+elif host_machine.system() == 'darwin'
+  grep_prog = find_program('ggrep')
 else
   grep_prog = find_program('grep')
 endif