Initial revision
[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 ORIGDIR=`pwd`
8 cd $srcdir
9 PROJECT=NetworkManager
10 TEST_TYPE=-d
11 FILE=src
12
13 DIE=0
14
15 if $have_libtool ; then : ; else
16         echo
17         echo "You must have libtool 1.4 installed to compile $PROJECT."
18         echo "Install the appropriate package for your distribution,"
19         echo "or get the source tarball at http://ftp.gnu.org/gnu/libtool/"
20         DIE=1
21 fi
22
23 (autoconf --version) < /dev/null > /dev/null 2>&1 || {
24         echo
25         echo "You must have autoconf installed to compile $PROJECT."
26         echo "Install the appropriate package for your distribution,"
27         echo "or get the source tarball at http://ftp.gnu.org/gnu/autoconf/"
28         DIE=1
29 }
30
31 if automake-1.7 --version < /dev/null > /dev/null 2>&1 ; then
32     AUTOMAKE=automake-1.7
33     ACLOCAL=aclocal-1.7
34 else
35         echo
36         echo "You must have automake 1.7.x installed to compile $PROJECT."
37         echo "Install the appropriate package for your distribution,"
38         echo "or get the source tarball at http://ftp.gnu.org/gnu/automake/"
39         DIE=1
40 fi
41
42 if test "$DIE" -eq 1; then
43         exit 1
44 fi
45
46 test $TEST_TYPE $FILE || {
47         echo "You must run this script in the top-level $PROJECT directory"
48         exit 1
49 }
50
51 if test -z "$AUTOGEN_SUBDIR_MODE"; then
52         if test -z "$*"; then
53                 echo "I am going to run ./configure with no arguments - if you wish "
54                 echo "to pass any to it, please specify them on the $0 command line."
55         fi
56 fi
57
58 $ACLOCAL -I . $ACLOCALFLAGS || exit $?
59 $AUTOMAKE --add-missing || exit $?
60 autoconf || exit $?
61 cd $ORIGDIR || exit $?
62
63 if test -z "$AUTOGEN_SUBDIR_MODE"; then
64         $srcdir/configure --enable-maintainer-mode $AUTOGEN_CONFIGURE_ARGS "$@" || exit $?
65
66         echo 
67         echo "Now type 'make' to compile $PROJECT."
68 fi