chiark / gitweb /
oss-fuzz: Fallback to `ninja-build` when available (#8641)
authorFilipe Brandenburger <filbranden@google.com>
Wed, 4 Apr 2018 07:32:59 +0000 (00:32 -0700)
committerSven Eden <yamakuzure@gmx.net>
Fri, 24 Aug 2018 14:47:08 +0000 (16:47 +0200)
The ninja binary is deployed as `ninja-build` in older distros such as
RHEL 7/CentOS 7.  Detect that and use `ninja-build` instead of `ninja`
when it's available.

tools/meson-build.sh

index 302749d8ed71ceec641a0de0824eee9118fb15e7..304a7556763646b63488ac3eef9072702e75517e 100755 (executable)
@@ -7,4 +7,12 @@ target="$3"
 options="$4"
 
 [ -d "$dst" ] || meson "$src" "$dst" $options
-ninja -C "$dst" "$target"
+
+# Locate ninja binary, on CentOS 7 it is called ninja-build, so
+# use that name if available.
+ninja=ninja
+if which ninja-build >/dev/null 2>&1 ; then
+    ninja=ninja-build
+fi
+
+"$ninja" -C "$dst" "$target"