autogen.sh: tell user the correct make command

When autogen.sh finishes it helpfully prints

  "Now type 'make' to compile libvirt."

which is fine if on a host with GNU make, but on *BSD running
'make' will end in tears. We should tell users to run 'gmake'
on these platforms. If 'gmake' doesn't exist then we should
report an error too

  "GNU make is required to build libvirt"

Reviewed-by: Andrea Bolognani <abologna@redhat.com>
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
This commit is contained in:
Daniel P. Berrange 2017-07-04 15:59:51 +01:00
parent 8599aedd43
commit 291f68b5da

View File

@ -175,6 +175,19 @@ if test "$OBJ_DIR"; then
} }
fi fi
# Make sure we can find GNU make and tell the user
# the right command to run
MAKE=
for cmd in make gmake; do
if $cmd -v 2>&1 | grep -q "GNU Make"; then
MAKE=$cmd
break
fi
done
test "$MAKE" || {
die "GNU make is required to build libvirt"
}
if test -z "$*" && test -z "$extra_args" && test -f config.status; then if test -z "$*" && test -z "$extra_args" && test -f config.status; then
echo "Running config.status..." echo "Running config.status..."
./config.status --recheck || { ./config.status --recheck || {
@ -193,4 +206,4 @@ else
fi fi
echo echo
echo "Now type 'make' to compile libvirt." echo "Now type '$MAKE' to compile libvirt."