]> xenbits.xensource.com Git - libvirt.git/commitdiff
build: avoid problems with autogen.sh runs from tarball
authorEric Blake <eblake@redhat.com>
Fri, 11 Feb 2011 17:35:54 +0000 (10:35 -0700)
committerEric Blake <eblake@redhat.com>
Sat, 12 Feb 2011 13:28:28 +0000 (06:28 -0700)
Introduced by commit fac97c65c distributing cfg.mk, which
previously could blindly assume it was in a git checkout.

* cfg.mk (_update_required): Also check for .git.
* autogen.sh: Don't run bootstrap from a tarball.
Reported by Daniel Veillard.

autogen.sh
cfg.mk

index ff13fd1486684f51d2540db982dc73f886a28f97..b64521e5edf5cab7cce33925f161feb2bd42096f 100755 (executable)
@@ -8,8 +8,8 @@ THEDIR=`pwd`
 cd "$srcdir"
 
 test -f src/libvirt.c || {
-       echo "You must run this script in the top-level libvirt directory"
-       exit 1
+    echo "You must run this script in the top-level libvirt directory"
+    exit 1
 }
 
 
@@ -52,16 +52,19 @@ bootstrap_hash()
 # Also, running 'make rpm' tends to litter the po/ directory, and some people
 # like to run 'git clean -x -f po' to fix it; but only ./bootstrap regenerates
 # the required file po/Makevars.
-curr_status=.git-module-status
-t=$(bootstrap_hash; git diff .gnulib)
-if test "$t" = "$(cat $curr_status 2>/dev/null)" \
-    && test -f "po/Makevars"; then
-    # good, it's up to date, all we need is autoreconf
-    autoreconf -if
-else
-    echo running bootstrap$no_git...
-    ./bootstrap$no_git --bootstrap-sync && bootstrap_hash > $curr_status \
-      || { echo "Failed to bootstrap, please investigate."; exit 1; }
+# Only run bootstrap from a git checkout, never from a tarball.
+if test -d .git; then
+    curr_status=.git-module-status
+    t=$(bootstrap_hash; git diff .gnulib)
+    if test "$t" = "$(cat $curr_status 2>/dev/null)" \
+        && test -f "po/Makevars"; then
+        # good, it's up to date, all we need is autoreconf
+        autoreconf -if
+    else
+        echo running bootstrap$no_git...
+        ./bootstrap$no_git --bootstrap-sync && bootstrap_hash > $curr_status \
+            || { echo "Failed to bootstrap, please investigate."; exit 1; }
+    fi
 fi
 
 cd "$THEDIR"
diff --git a/cfg.mk b/cfg.mk
index 120f452bc0bcca834f3dfbd7148a8a7488980e21..4bbeb966aa088c3eb03079a242047050a2e1f38b 100644 (file)
--- a/cfg.mk
+++ b/cfg.mk
@@ -507,6 +507,7 @@ ifeq (0,$(MAKELEVEL))
   _submodule_hash = sed 's/^[ +-]//;s/ .*//'
   _update_required := $(shell                                          \
       cd '$(srcdir)';                                                  \
+      test -d .git || { echo 0; exit; };                               \
       test -f po/Makevars || { echo 1; exit; };                                \
       actual=$$(git submodule status | $(_submodule_hash);             \
                git hash-object bootstrap.conf;                         \