]> xenbits.xensource.com Git - libvirt.git/commitdiff
autogen.sh: tell user the correct make command
authorDaniel P. Berrange <berrange@redhat.com>
Tue, 4 Jul 2017 14:59:51 +0000 (15:59 +0100)
committerDaniel P. Berrange <berrange@redhat.com>
Mon, 18 Dec 2017 17:03:51 +0000 (17:03 +0000)
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>
autogen.sh

index d5d836aa717a8288d8221af80dfa57646562f998..1183b13083c2815c83768bb6a89ca60a50f5cba9 100755 (executable)
@@ -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."