OSDN Git Service

2006-08-14 Mark Wielaard <mark@klomp.org>
[pf3gnuchains/gcc-fork.git] / libjava / classpath / 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=classpath
10 TEST_TYPE=-f
11 FILE=java/lang/Object.java
12
13 DIE=0
14
15 LIBTOOLIZE=libtoolize
16
17 have_libtool=false
18 if ${LIBTOOLIZE} --version < /dev/null > /dev/null 2>&1 ; then
19         libtool_version=`${LIBTOOLIZE} --version | sed 's/^.*[^0-9.]\([0-9]\{1,\}\.[0-9.]\{1,\}\).*/\1/'`
20         case $libtool_version in
21             1.5*)
22                 have_libtool=true
23                 ;;
24         esac
25 fi
26 if $have_libtool ; then : ; else
27         echo
28         echo "You must have libtool 1.5 installed to compile $PROJECT."
29         echo "Install the appropriate package for your distribution,"
30         echo "or get the source tarball at http://ftp.gnu.org/gnu/libtool/"
31         echo "For Darwin you need the latest stable (1.5.18) to support"
32         echo "Frameworks linking. Also, you have to point ACLOCAL_FLAGS"
33         echo "to this libtool/share/aclocal."
34         DIE=1
35 fi
36
37 have_autoconf=false
38 if autoconf --version < /dev/null > /dev/null 2>&1 ; then
39         autoconf_version=`autoconf --version | sed 's/^[^0-9]*\([0-9.][0-9.]*\).*/\1/'`
40         case $autoconf_version in
41             2.59*)
42                 have_autoconf=true
43                 ;;
44             2.60*)
45                 have_autoconf=true
46                 ;;
47         esac
48 fi
49 if $have_autoconf ; then : ; else
50         echo
51         echo "You must have autoconf 2.59 or 2.60 installed for $PROJECT."
52         echo "Install the appropriate package for your distribution,"
53         echo "or get the source tarball at http://ftp.gnu.org/gnu/autoconf/"
54         DIE=1
55 fi
56
57 have_automake=false
58 # We know each 1.9.x version works
59 if automake-1.9 --version < /dev/null > /dev/null 2>&1 ; then
60         AUTOMAKE=automake-1.9
61         ACLOCAL=aclocal-1.9
62         have_automake=true
63 elif automake --version < /dev/null > /dev/null 2>&1 ; then
64         AUTOMAKE=automake
65         ACLOCAL=aclocal
66         automake_version=`automake --version | sed 's/^[^0-9]*\([0-9.][0-9.]*\).*/\1/'`
67         case $automake_version in
68             1.9*)
69                 have_automake=true
70                 ;;
71         esac
72 fi
73 if $have_automake ; then : ; else
74         echo
75         echo "You must have automake 1.9 installed to compile $PROJECT."
76         echo "Install the appropriate package for your distribution,"
77         echo "or get the source tarball at http://ftp.gnu.org/gnu/automake/"
78         DIE=1
79 fi
80
81 if test "$DIE" -eq 1; then
82         exit 1
83 fi
84
85 test $TEST_TYPE $FILE || {
86         echo "You must run this script in the top-level $PROJECT directory"
87         exit 1
88 }
89
90 if test "x$AUTOGEN_SUBDIR_MODE" = "xyes"; then
91         if test -z "$*"; then
92                 echo "I am going to run ./configure with no arguments - if you wish "
93                 echo "to pass any to it, please specify them on the $0 command line."
94         fi
95 fi
96
97 if test -z "$ACLOCAL_FLAGS"; then
98
99         acdir=`$ACLOCAL --print-ac-dir`
100         m4list="glib-2.0.m4 glib-gettext.m4"
101
102         for file in $m4list
103         do
104                 if [ ! -f "$acdir/$file" ]; then
105                         echo "WARNING: aclocal's directory is $acdir, but..."
106                         echo "         no file $acdir/$file"
107                         echo "         You may see fatal macro warnings below."
108                         echo "         If these files are installed in /some/dir, set the ACLOCAL_FLAGS "
109                         echo "         environment variable to \"-I /some/dir\", or install"
110                         echo "         $acdir/$file."
111                         echo ""
112                 fi
113         done
114 fi
115
116 # Use the "-I m4 flag in order to include pkg.m4 and other .m4 files.
117 $ACLOCAL -I m4 $ACLOCAL_FLAGS || exit $?
118
119 ${LIBTOOLIZE} --force || exit $?
120
121 autoheader || exit $?
122
123 $AUTOMAKE --add-missing || exit $?
124 autoconf || exit $?
125 cd $ORIGDIR || exit $?
126
127 if test "x$AUTOGEN_SUBDIR_MODE" = "xyes"; then
128         $srcdir/configure --enable-maintainer-mode $AUTOGEN_CONFIGURE_ARGS "$@" || exit $?
129
130         echo 
131         echo "Now type 'make' to compile $PROJECT."
132 fi