[libvirt] [PATCH 2/2] build: don't lose prior configure args on autogen.sh

Eric Blake eblake at redhat.com
Thu Mar 25 23:37:32 UTC 2010

My prior patch forced an autogen.sh run, and I was surprised that the
suggested './autogen.sh' lost the fact that I had previously used
'./autogen.sh -C' for speed.

* autogen.sh: Use config.status, if present and there were no arguments.

Signed-off-by: Eric Blake <eblake at redhat.com>

I noticed this on the previous patch, because I blindly followed
make's instructions to rerun ./autogen.sh, only to later realize
that I just nuked my nice ./configure --enable-compiler-warnings=error

Hmm, as long as make is smart enough to warn, and now that running
./autogen.sh with no arguments is reliable at maintaining an
existing setup, I could even submit a followup patch to have make
blindly run ./autogen.sh instead of dying with the error that the
user has to run it.  Any interest in such a followup?

 autogen.sh |   10 +++++++---
 1 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/autogen.sh b/autogen.sh
index b93cdba..a618d86 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -56,8 +56,8 @@ if test "x$1" = "x--system"; then
     EXTRA_ARGS="--prefix=/usr --sysconfdir=/etc --localstatedir=/var"
     echo "Running ./configure with $EXTRA_ARGS $@"
-    if test -z "$*"; then
-	echo "I am going to run ./configure with no arguments - if you wish "
+    if test -z "$*" && test ! -f "$THEDIR/config.status"; then
+        echo "I am going to run ./configure with no arguments - if you wish "
         echo "to pass any to it, please specify them on the $0 command line."
@@ -92,7 +92,11 @@ if test "x$OBJ_DIR" != x; then
     cd "$OBJ_DIR"

-$srcdir/configure $EXTRA_ARGS "$@" && {
+if test -z "$*" && test -f config.status; then
+    ./config.status --recheck
+    $srcdir/configure $EXTRA_ARGS "$@"
+fi && {
     echo "Now type 'make' to compile libvirt."

More information about the libvir-list mailing list