diff options
author | Gwenole Beauchesne <gwenole.beauchesne@intel.com> | 2012-09-28 09:53:20 +0200 |
---|---|---|
committer | Gwenole Beauchesne <gwenole.beauchesne@intel.com> | 2012-09-28 09:55:47 +0200 |
commit | babe42305fba10f1df8f3abef2d7ec0fe88406b5 (patch) | |
tree | 14c26568d5e23abe2273aa9c2a7d0d51ba0ee3e6 | |
parent | 48fd9efc08d4da9e0fcaef19eb50f63669f3df9d (diff) |
autogen: modernize configure script generator.
Make it possible to run autogen.sh from a different location from the
original source directory. Make execution of the `configure' script
optional. i.e. don't run it by default if NO_CONFIGURE variable is set.
Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
-rwxr-xr-x | autogen.sh | 32 |
1 files changed, 29 insertions, 3 deletions
@@ -1,3 +1,4 @@ +#!/bin/sh # Copyright (c) 2007 Intel Corporation. All Rights Reserved. # # Permission is hereby granted, free of charge, to any person obtaining a @@ -20,6 +21,31 @@ # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -#! /bin/sh -autoreconf -v --install -./configure "$@" +PROJECT="libva" + +test -n "$srcdir" || srcdir="`dirname \"$0\"`" +test -n "$srcdir" || srcdir=. + +if ! test -f "$srcdir/configure.ac"; then + echo "Failed to find the top-level $PROJECT directory" + exit 1 +fi + +olddir="`pwd`" +cd "$srcdir" + +mkdir -p m4 + +AUTORECONF=`which autoreconf` +if test -z $AUTORECONF; then + echo "*** No autoreconf found ***" + exit 1 +else + autoreconf -v --install || exit $? +fi + +cd "$olddir" + +if test -z "$NO_CONFIGURE"; then + $srcdir/configure "$@" && echo "Now type 'make' to compile $PROJECT." +fi |