build: use a more standard autogen.sh
authorThierry Reding <treding@nvidia.com>
Tue, 7 Mar 2017 13:52:47 +0000 (14:52 +0100)
committerBartosz Golaszewski <bartekgola@gmail.com>
Wed, 8 Mar 2017 13:51:36 +0000 (14:51 +0100)
This version of the autogen.sh script allows execution from a sub-
directory and will automatically run the configure script that it has
generated. This is useful for out-of-tree and cross builds.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Signed-off-by: Bartosz Golaszewski <bartekgola@gmail.com>
autogen.sh

index 7f824e965a6ef6684df5690b10608aff99e6059c..45a11fcbd95ac84428d065711dd255acd04a3dc7 100755 (executable)
@@ -1,3 +1,14 @@
 #!/bin/sh
 
-autoreconf --force --install --verbose
+srcdir=`dirname $0`
+test -z "$srcdir" && srcdir=.
+
+ORIGDIR=`pwd`
+cd "$srcdir"
+
+autoreconf --force --install --verbose || exit 1
+cd $ORIGDIR || exit $?
+
+if test -z "$NOCONFIGURE"; then
+       exec "$srcdir"/configure "$@"
+fi