autogen.sh: only set up submodules if we have a .git directory
[NetworkManager.git] / autogen.sh
1 #!/bin/sh
2 # Run this to generate all the initial makefiles, etc.
3
4 srcdir=`dirname $0`
5 test -z "$srcdir" && srcdir=.
6
7 olddir=`pwd`
8
9 REQUIRED_AUTOMAKE_VERSION=1.9
10 PKG_NAME=NetworkManager
11
12 (test -f $srcdir/configure.ac \
13   && test -f $srcdir/src/main.c) || {
14     echo -n "**Error**: Directory "\`$srcdir\'" does not look like the"
15     echo " top-level $PKG_NAME directory"
16     exit 1
17 }
18
19 cd $srcdir
20
21 # Fetch submodules if needed
22 if test -d $srcdir/.git; then
23     echo "+ Setting up submodules"
24     git submodule init
25     git submodule update
26 fi
27
28 gtkdocize || exit 1
29 autopoint --force
30 AUTOPOINT='intltoolize --automake --copy' autoreconf --force --install --verbose
31
32 cd $olddir
33 if test -z "$NOCONFIGURE"; then
34         $srcdir/configure --enable-maintainer-mode "$@"
35 fi