1#!/bin/sh
2# Run this to generate all the initial makefiles, etc.
3
4srcdir=`dirname $0`
5test -z "$srcdir" && srcdir=.
6
7ORIGDIR=`pwd`
8cd $srcdir
9
10PROJECT=dbus
11TEST_TYPE=-f
12FILE=dbus-1.pc.in
13
14DIE=0
15
16if [ -f .git/hooks/pre-commit.sample -a ! -f .git/hooks/pre-commit ] ; then
17    echo "Activating pre-commit hook."
18    cp -av .git/hooks/pre-commit.sample .git/hooks/pre-commit
19    chmod -c +x  .git/hooks/pre-commit
20fi
21
22(autoconf --version) < /dev/null > /dev/null 2>&1 || {
23	echo
24	echo "You must have autoconf installed to compile $PROJECT."
25	echo "Download the appropriate package for your distribution,"
26	echo "or get the source tarball at ftp://ftp.gnu.org/pub/gnu/"
27	DIE=1
28}
29
30# If the user hasn't explicitly chosen an Automake version, use 1.11. This is
31# the earliest version that gives us silent rules.
32if test -z "$AUTOMAKE"; then
33    AUTOMAKE=automake-1.11
34    ACLOCAL=aclocal-1.11
35fi
36
37($AUTOMAKE --version) < /dev/null > /dev/null 2>&1 || {
38        AUTOMAKE=automake
39        ACLOCAL=aclocal
40}
41
42($AUTOMAKE --version) < /dev/null > /dev/null 2>&1 || {
43	echo
44	echo "You must have automake installed to compile $PROJECT."
45	echo "Get ftp://ftp.cygnus.com/pub/home/tromey/automake-1.2d.tar.gz"
46	echo "(or a newer version if it is available)"
47	DIE=1
48}
49
50LIBTOOLIZE=`which libtoolize`
51if ! test -f $LIBTOOLIZE; then
52	LIBTOOLIZE=`which glibtoolize`
53fi
54
55($LIBTOOLIZE --version) < /dev/null > /dev/null 2>&1 || {
56	echo
57	echo "You must have libtoolize installed to compile $PROJECT."
58	echo "Install the libtool package from ftp.gnu.org or a mirror."
59	DIE=1
60}
61
62if test "$DIE" -eq 1; then
63	exit 1
64fi
65
66test $TEST_TYPE $FILE || {
67	echo "You must run this script in the top-level $PROJECT directory"
68	exit 1
69}
70
71if test -z "$*"; then
72	echo "I am going to run ./configure with no arguments - if you wish "
73        echo "to pass any to it, please specify them on the $0 command line."
74fi
75
76$LIBTOOLIZE --copy --force
77
78$ACLOCAL -I m4 $ACLOCAL_FLAGS
79
80## optionally feature autoheader
81(autoheader --version)  < /dev/null > /dev/null 2>&1 && autoheader
82
83$AUTOMAKE -a $am_opt
84autoconf || echo "autoconf failed - version 2.5x is probably required"
85
86cd $ORIGDIR
87
88if test x"$NOCONFIGURE" = x; then
89  run_configure=true
90  for arg in $*; do
91    case $arg in
92        --no-configure)
93            run_configure=false
94            ;;
95        *)
96            ;;
97    esac
98  done
99else
100  run_configure=false
101fi
102
103if $run_configure; then
104    $srcdir/configure --enable-developer --config-cache "$@"
105    echo
106    echo "Now type 'make' to compile $PROJECT."
107else
108    echo
109    echo "Now run 'configure' and 'make' to compile $PROJECT."
110fi
111
112