patch by: David Nečas <yeti@physics.muni.cz>
[gtk-doc.git] / autogen.sh
blob91687d7eacc3d64a9f52692299c57eb5f3a027ac
1 #!/bin/sh
2 # Run this to generate all the initial makefiles, etc.
4 PROJECT=gtk-doc
5 TEST_TYPE=-f
6 FILE=gtk-doc.dsl.in
8 # a silly hack that generates autoregen.sh but it's handy
9 echo "#!/bin/sh" > autoregen.sh
10 echo "./autogen.sh $@ \$@" >> autoregen.sh
11 chmod +x autoregen.sh
13 DIE=0
15 srcdir=`dirname $0`
16 test -z "$srcdir" && srcdir=.
18 THEDIR="`pwd`"
20 cd "$srcdir"
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/gnu/autoconf/"
27 DIE=1
30 if automake-1.10 --version < /dev/null > /dev/null 2>&1; then
31 AUTOMAKE=automake-1.10
32 ACLOCAL=aclocal-1.10
33 elif automake-1.9 --version < /dev/null > /dev/null 2>&1; then
34 AUTOMAKE=automake-1.9
35 ACLOCAL=aclocal-1.9
36 elif automake-1.8 --version < /dev/null > /dev/null 2>&1; then
37 AUTOMAKE=automake-1.8
38 ACLOCAL=aclocal-1.8
39 elif automake-1.7 --version < /dev/null > /dev/null 2>&1; then
40 AUTOMAKE=automake-1.7
41 ACLOCAL=aclocal-1.7
42 elif automake-1.6 --version < /dev/null > /dev/null 2>&1; then
43 AUTOMAKE=automake-1.6
44 ACLOCAL=aclocal-1.6
45 else
46 echo
47 echo "You must have automake installed to compile $PROJECT."
48 echo "Download the appropriate package for your distribution,"
49 echo "or get the source tarball at ftp://ftp.gnu.org/gnu/automake/"
50 DIE=1
53 if test "$DIE" -eq 1; then
54 exit 1
57 test $TEST_TYPE $FILE || {
58 echo "You must run this script in the top-level $PROJECT directory"
59 exit 1
62 if test "$#" = 0; then
63 echo "I am going to run ./configure with no arguments - if you wish "
64 echo "to pass any to it, please specify them on the $0 command line."
67 $ACLOCAL $ACLOCAL_FLAGS || exit $?
69 autoconf || exit $?
70 # optionally feature autoheader
71 #(autoheader --version) < /dev/null > /dev/null 2>&1 && autoheader
73 libtoolize --copy --force
75 $AUTOMAKE --add-missing $am_opt || exit $?
77 cd "$THEDIR"
79 $srcdir/configure --enable-maintainer-mode "$@" || exit $?
81 echo
82 echo "Now type 'make install' to install $PROJECT."