Skip to content

Commit

Permalink
build: Allow autogen.sh to be run from another directory
Browse files Browse the repository at this point in the history
This allows the build pattern:
   git clone …
   mkdir /tmp/build
   cd /tmp/build
   /path/to/checkout/autogen.sh
   make
which is useful for builddir ≠ srcdir setups, such as buildbots.
  • Loading branch information
Philip Withnall committed May 11, 2016
1 parent 03b8d3a commit fd25a8e
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion autogen.sh
Expand Up @@ -42,6 +42,13 @@ run_versioned() {

set -ex

test -n "$srcdir" || srcdir=$(dirname "$0")
test -n "$srcdir" || srcdir=.

olddir=$(pwd)

cd $srcdir

if [ -f .git/hooks/pre-commit.sample -a ! -f .git/hooks/pre-commit ] ; then
cp -p .git/hooks/pre-commit.sample .git/hooks/pre-commit && \
chmod +x .git/hooks/pre-commit && \
Expand Down Expand Up @@ -70,8 +77,9 @@ else
run_versioned autoheader "$AC_VERSION"
run_versioned automake "$AM_VERSION" -a -c --foreign

cd "$olddir"
if test "x$NOCONFIGURE" = "x"; then
./configure "$@"
$srcdir/configure "$@"
make clean
fi
fi

0 comments on commit fd25a8e

Please sign in to comment.