a3923bbc2cffc1d86feb3959864d727ab759853b
[platform/upstream/dbus.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
10 PROJECT=dbus
11 TEST_TYPE=-f
12 FILE=dbus-1.0.pc.in
13
14 DIE=0
15
16 (autoconf --version) < /dev/null > /dev/null 2>&1 || {
17         echo
18         echo "You must have autoconf installed to compile $PROJECT."
19         echo "Download the appropriate package for your distribution,"
20         echo "or get the source tarball at ftp://ftp.gnu.org/pub/gnu/"
21         DIE=1
22 }
23
24 AUTOMAKE=automake-1.6
25 ACLOCAL=aclocal-1.6
26
27 ($AUTOMAKE --version) < /dev/null > /dev/null 2>&1 || {
28         AUTOMAKE=automake
29         ACLOCAL=aclocal
30 }
31
32 ($AUTOMAKE --version) < /dev/null > /dev/null 2>&1 || {
33         echo
34         echo "You must have automake installed to compile $PROJECT."
35         echo "Get ftp://ftp.cygnus.com/pub/home/tromey/automake-1.2d.tar.gz"
36         echo "(or a newer version if it is available)"
37         DIE=1
38 }
39
40 if test "$DIE" -eq 1; then
41         exit 1
42 fi
43
44 test $TEST_TYPE $FILE || {
45         echo "You must run this script in the top-level $PROJECT directory"
46         exit 1
47 }
48
49 if test -z "$*"; then
50         echo "I am going to run ./configure with no arguments - if you wish "
51         echo "to pass any to it, please specify them on the $0 command line."
52 fi
53
54 libtoolize --copy --force
55
56 echo $ACLOCAL $ACLOCAL_FLAGS
57 $ACLOCAL $ACLOCAL_FLAGS
58
59 ## optionally feature autoheader
60 (autoheader --version)  < /dev/null > /dev/null 2>&1 && autoheader
61
62 $AUTOMAKE -a $am_opt
63 autoconf || echo "autoconf failed - version 2.5x is probably required"
64
65 cd $ORIGDIR
66
67 run_configure=true
68 for arg in $*; do
69     case $arg in 
70         --no-configure)
71             run_configure=false
72             ;;
73         *)
74             ;;
75     esac
76 done
77
78 if $run_configure; then
79     $srcdir/configure --enable-maintainer-mode "$@"
80     echo 
81     echo "Now type 'make' to compile $PROJECT."
82 else
83     echo
84     echo "Now run 'configure' and 'make' to compile $PROJECT."
85 fi
86