From 291f68b5da78a303c58ca45b5d8be61e8047d328 Mon Sep 17 00:00:00 2001 From: "Daniel P. Berrange" Date: Tue, 4 Jul 2017 15:59:51 +0100 Subject: [PATCH] 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 Signed-off-by: Daniel P. Berrange --- autogen.sh | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/autogen.sh b/autogen.sh index d5d836aa71..1183b13083 100755 --- a/autogen.sh +++ b/autogen.sh @@ -175,6 +175,19 @@ if test "$OBJ_DIR"; then } 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 echo "Running config.status..." ./config.status --recheck || { @@ -193,4 +206,4 @@ else fi echo -echo "Now type 'make' to compile libvirt." +echo "Now type '$MAKE' to compile libvirt."