Fix previous mis-applied patch.
[official-gcc.git] / libjava / classpath / autogen.sh
blobbabfa4e5d83872dc507c5b3a4ceb5196a5aadcf7
1 #!/bin/sh
2 # Run this to generate all the initial makefiles, etc.
4 srcdir=`dirname $0`
5 test -z "$srcdir" && srcdir=.
7 ORIGDIR=`pwd`
8 cd $srcdir
9 PROJECT=classpath
10 TEST_TYPE=-f
11 FILE=java/lang/Object.java
13 DIE=0
15 LIBTOOLIZE=libtoolize
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
24 esac
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
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
44 esac
46 if $have_autoconf ; then : ; else
47 echo
48 echo "You must have autoconf 2.59 installed to compile $PROJECT."
49 echo "Install the appropriate package for your distribution,"
50 echo "or get the source tarball at http://ftp.gnu.org/gnu/autoconf/"
51 DIE=1
54 have_automake=false
55 # We know each 1.9.x version works
56 if automake-1.9 --version < /dev/null > /dev/null 2>&1 ; then
57 AUTOMAKE=automake-1.9
58 ACLOCAL=aclocal-1.9
59 have_automake=true
60 elif automake --version < /dev/null > /dev/null 2>&1 ; then
61 AUTOMAKE=automake
62 ACLOCAL=aclocal
63 automake_version=`automake --version | sed 's/^[^0-9]*\([0-9.][0-9.]*\).*/\1/'`
64 case $automake_version in
65 1.9*)
66 have_automake=true
68 esac
70 if $have_automake ; then : ; else
71 echo
72 echo "You must have automake 1.9 installed to compile $PROJECT."
73 echo "Install the appropriate package for your distribution,"
74 echo "or get the source tarball at http://ftp.gnu.org/gnu/automake/"
75 DIE=1
78 if test "$DIE" -eq 1; then
79 exit 1
82 test $TEST_TYPE $FILE || {
83 echo "You must run this script in the top-level $PROJECT directory"
84 exit 1
87 if test "x$AUTOGEN_SUBDIR_MODE" = "xyes"; then
88 if test -z "$*"; then
89 echo "I am going to run ./configure with no arguments - if you wish "
90 echo "to pass any to it, please specify them on the $0 command line."
94 if test -z "$ACLOCAL_FLAGS"; then
96 acdir=`$ACLOCAL --print-ac-dir`
97 m4list="glib-2.0.m4 glib-gettext.m4"
99 for file in $m4list
101 if [ ! -f "$acdir/$file" ]; then
102 echo "WARNING: aclocal's directory is $acdir, but..."
103 echo " no file $acdir/$file"
104 echo " You may see fatal macro warnings below."
105 echo " If these files are installed in /some/dir, set the ACLOCAL_FLAGS "
106 echo " environment variable to \"-I /some/dir\", or install"
107 echo " $acdir/$file."
108 echo ""
110 done
113 # Use the "-I m4 flag in order to include pkg.m4 and other .m4 files.
114 $ACLOCAL -I m4 $ACLOCAL_FLAGS || exit $?
116 ${LIBTOOLIZE} --force || exit $?
118 autoheader || exit $?
120 $AUTOMAKE --add-missing || exit $?
121 autoconf || exit $?
122 cd $ORIGDIR || exit $?
124 if test "x$AUTOGEN_SUBDIR_MODE" = "xyes"; then
125 $srcdir/configure --enable-maintainer-mode $AUTOGEN_CONFIGURE_ARGS "$@" || exit $?
127 echo
128 echo "Now type 'make' to compile $PROJECT."