configure: add --ninja option

On Windows it is not possible to invoke a Python script as $NINJA.
If ninja is present use it directly, while if it is not we can
keep using ninjatool.

Reported-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
Paolo Bonzini 2020-08-26 08:04:15 +02:00
parent 760e4327cd
commit 48328880fd

16
configure vendored
View file

@ -568,6 +568,7 @@ rng_none="no"
secret_keyring="" secret_keyring=""
libdaxctl="" libdaxctl=""
meson="" meson=""
ninja=""
skip_meson=no skip_meson=no
gettext="" gettext=""
@ -1052,6 +1053,8 @@ for opt do
;; ;;
--meson=*) meson="$optarg" --meson=*) meson="$optarg"
;; ;;
--ninja=*) ninja="$optarg"
;;
--smbd=*) smbd="$optarg" --smbd=*) smbd="$optarg"
;; ;;
--extra-cflags=*) --extra-cflags=*)
@ -1820,6 +1823,7 @@ Advanced options (experts only):
--python=PYTHON use specified python [$python] --python=PYTHON use specified python [$python]
--sphinx-build=SPHINX use specified sphinx-build [$sphinx_build] --sphinx-build=SPHINX use specified sphinx-build [$sphinx_build]
--meson=MESON use specified meson [$meson] --meson=MESON use specified meson [$meson]
--ninja=NINJA use specified ninja [$ninja]
--smbd=SMBD use specified smbd [$smbd] --smbd=SMBD use specified smbd [$smbd]
--with-git=GIT use specified git [$git] --with-git=GIT use specified git [$git]
--static enable static build [$static] --static enable static build [$static]
@ -2058,6 +2062,16 @@ case "$meson" in
*) meson=$(command -v meson) ;; *) meson=$(command -v meson) ;;
esac esac
# Probe for ninja (used for compdb)
if test -z "$ninja"; then
for c in ninja ninja-build samu; do
if has $c; then
ninja=$(command -v "$c")
break
fi
done
fi
# Check that the C compiler works. Doing this here before testing # Check that the C compiler works. Doing this here before testing
# the host CPU ensures that we had a valid CC to autodetect the # the host CPU ensures that we had a valid CC to autodetect the
@ -8197,7 +8211,7 @@ fi
mv $cross config-meson.cross mv $cross config-meson.cross
rm -rf meson-private meson-info meson-logs rm -rf meson-private meson-info meson-logs
NINJA=$PWD/ninjatool $meson setup \ NINJA=${ninja:-$PWD/ninjatool} $meson setup \
--prefix "${pre_prefix}$prefix" \ --prefix "${pre_prefix}$prefix" \
--libdir "${pre_prefix}$libdir" \ --libdir "${pre_prefix}$libdir" \
--libexecdir "${pre_prefix}$libexecdir" \ --libexecdir "${pre_prefix}$libexecdir" \