[gnome-news] Support non-srcdir builds in autogen.sh



commit 8a750e458205d81399a92fc5cd59c2b2b85ca8ff
Author: Emmanuele Bassi <ebassi gnome org>
Date:   Fri Jun 17 20:10:34 2016 +0100

    Support non-srcdir builds in autogen.sh
    
    We need to call the various tools that modify the build system from
    within the source dir, and then call `configure` from within the build
    dir.

 autogen.sh |   12 ++++++++++--
 1 files changed, 10 insertions(+), 2 deletions(-)
---
diff --git a/autogen.sh b/autogen.sh
index c09a22b..98ae689 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -1,7 +1,11 @@
 #!/bin/sh
 # Run this to generate all the initial makefiles, etc.
-srcdir=`dirname $0`
-test -z "$srcdir" && srcdir=.
+test -n "$srcdir" || srcdir=`dirname "$0"`
+test -n "$srcdir" || srcdir=.
+
+olddir=`pwd`
+
+cd "$srcdir"
 
 (test -f $srcdir/configure.ac) || {
         echo "**Error**: Directory "\`$srcdir\'" does not look like the top-level project directory"
@@ -21,12 +25,16 @@ touch ChangeLog
 touch INSTALL
 
 set -x
+
 aclocal --install || exit 1
 glib-gettextize --force --copy || exit 1
 intltoolize --force --copy --automake || exit 1
 autoreconf --verbose --force --install -Wno-portability || exit 1
+
 { set +x; } 2>/dev/null
 
+cd "$olddir"
+
 if [ "$NOCONFIGURE" = "" ]; then
         set -x
         $srcdir/configure "$@" || exit 1


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]