[libvirt] [cim PATCH 3/3] autogen: Support running out-of-tree

Andrea Bolognani abologna at redhat.com
Thu Nov 16 17:12:56 UTC 2017


Instead of having to run autogen.sh inside the source directory
first, before moving to a build directory and run configure there,
it's now possible to run everything from the build directory.

Signed-off-by: Andrea Bolognani <abologna at redhat.com>
---
 autogen.sh | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/autogen.sh b/autogen.sh
index a04e4e6..ebe6fe2 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -8,6 +8,14 @@ die()
     exit 1
 }
 
+curdir=$(pwd)
+test "$curdir" || curdir=.
+
+srcdir=$(dirname "$0")
+test "$srcdir" || srcdir=.
+
+cd "$srcdir" || die "Failed to cd into $srcdir"
+
 echo "Running libtool ..."
 libtoolize --copy --force --automake || die
 
@@ -31,6 +39,8 @@ else
     echo "0" > .revision
 fi
 
+cd "$curdir" || die "Failed to cd into $curdir"
+
 if test "$#" -eq 0; then
     echo "Running configure without arguments ..."
     echo "(If you want to pass any, specify them on the $0 command line)"
-- 
2.14.3




More information about the libvir-list mailing list