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>
#!/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