[gnome-flashback/wip/segeiger/build-fixes: 1/2] autogen.sh: fix srddir!=builddir builds



commit f97500b4260e5dc38f3ed50d2e9badc15fdc8fc5
Author: Sebastian Geiger <sbastig gmx net>
Date:   Sun Feb 26 07:33:52 2017 +0100

    autogen.sh: fix srddir!=builddir builds

 autogen.sh |   18 +++++++++++-------
 1 files changed, 11 insertions(+), 7 deletions(-)
---
diff --git a/autogen.sh b/autogen.sh
index 888910b..cf3cc4a 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -2,16 +2,20 @@
 #
 # 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=.
 
-if [ ! -f $srcdir/configure.ac ]; then
-  echo "**Error**: Directory "\'$srcdir\'" does not look like the top-level" \
+builddir=$(pwd)
+
+cd $srcdir
+
+if [ ! -f configure.ac ]; then
+  echo "**Error**: Directory '$srcdir' does not look like the top-level" \
        "project directory."
   exit 1
 fi
 
-if [ ! -f $srcdir/gnome-flashback/libsound-applet/gvc/Makefile.am ]; then
+if [ ! -f gnome-flashback/libsound-applet/gvc/Makefile.am ]; then
        set -x
        git submodule init
        { set +x; } 2>/dev/null
@@ -21,7 +25,7 @@ set -x
 git submodule update
 { set +x; } 2>/dev/null
 
-PKG_NAME=$(autoconf --trace 'AC_INIT:$1' "$srcdir/configure.ac")
+PKG_NAME=$(autoconf --trace 'AC_INIT:$1' configure.ac)
 
 if [ "$#" = 0 ] && [ -z "$NOCONFIGURE" ]; then
   echo "**Warning**: I am going to run 'configure' with no arguments." >&2
@@ -30,10 +34,10 @@ if [ "$#" = 0 ] && [ -z "$NOCONFIGURE" ]; then
 fi
 
 set -x
-aclocal --install || exit 1
 autoreconf --verbose --force --install -Wno-portability || exit 1
 { set +x; } 2>/dev/null
 
+cd "$builddir"
 if [ -z "$NOCONFIGURE" ]; then
   set -x
   $srcdir/configure "$@" || exit 1


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