summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Stapelberg <michael@stapelberg.de>2012-10-10 09:09:38 +0200
committerMichael Stapelberg <michael@stapelberg.de>2012-11-29 10:24:52 +0100
commite527fdc914d4b4fa816ea9e563c6abf6505b39d3 (patch)
tree84596df569fdd51c351bdfe1719eb3bcc90526f8
parent12fc61fbbdf1ca2df25281a7d8e00f2dab75d1c2 (diff)
downloadutil-keysyms-e527fdc914d4b4fa816ea9e563c6abf6505b39d3.tar.gz
autogen.sh: verify that git submodules are initialized
-rwxr-xr-xautogen.sh15
1 files changed, 15 insertions, 0 deletions
diff --git a/autogen.sh b/autogen.sh
index 904cd67..afe5299 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -6,6 +6,21 @@ test -z "$srcdir" && srcdir=.
ORIGDIR=`pwd`
cd $srcdir
+# If this is a git checkout, verify that the submodules are initialized,
+# otherwise autotools will just fail with an unhelpful error message.
+if [ -d ".git" ] && [ -r ".gitmodules" ]
+then
+ # If git is not in PATH, this will not return 0, thus not keeping us
+ # from building. Since the message is worthless when git is not
+ # installed, this is what we want.
+ if git submodule status 2>/dev/null | grep -q '^-'
+ then
+ echo "You have uninitialized git submodules." >&2
+ echo "Please run: git submodule update --init" >&2
+ exit 1
+ fi
+fi
+
autoreconf -v --install || exit 1
cd $ORIGDIR || exit $?