1 |
#!/bin/sh |
#!/bin/sh |
2 |
|
# Run this to generate all the initial makefiles, etc. |
3 |
|
|
4 |
set -e |
srcdir=`dirname $0` |
5 |
|
test -z "$srcdir" && srcdir=. |
6 |
|
|
7 |
LIBTOOLIZE=libtoolize |
ORIGDIR=`pwd` |
8 |
${LIBTOOLIZE} --version | head -n 1 |
cd $srcdir |
9 |
echo "libtoolize: minimum version required: 1.5" |
PROJECT=classpath |
10 |
|
TEST_TYPE=-f |
11 |
|
FILE=java/lang/Object.java |
12 |
|
|
13 |
|
DIE=0 |
14 |
|
|
15 |
|
have_libtool=false |
16 |
|
if libtoolize --version < /dev/null > /dev/null 2>&1 ; then |
17 |
|
libtool_version=`libtoolize --version | sed 's/^[^0-9]*\([0-9.][0-9.]*\).*/\1/'` |
18 |
|
case $libtool_version in |
19 |
|
1.5*) |
20 |
|
have_libtool=true |
21 |
|
;; |
22 |
|
esac |
23 |
|
fi |
24 |
|
if $have_libtool ; then : ; else |
25 |
|
echo |
26 |
|
echo "You must have libtool 1.5 installed to compile $PROJECT." |
27 |
|
echo "Install the appropriate package for your distribution," |
28 |
|
echo "or get the source tarball at http://ftp.gnu.org/gnu/libtool/" |
29 |
|
DIE=1 |
30 |
|
fi |
31 |
|
|
32 |
AUTOCONF=autoconf |
have_autoconf=false |
33 |
${AUTOCONF} --version | head -n 1 |
if autoconf --version < /dev/null > /dev/null 2>&1 ; then |
34 |
echo "autoconf: minimum version required: 2.59" |
autoconf_version=`autoconf --version | sed 's/^[^0-9]*\([0-9.][0-9.]*\).*/\1/'` |
35 |
|
case $autoconf_version in |
36 |
|
2.59*) |
37 |
|
have_autoconf=true |
38 |
|
;; |
39 |
|
esac |
40 |
|
fi |
41 |
|
if $have_autoconf ; then : ; else |
42 |
|
echo |
43 |
|
echo "You must have autoconf 2.59 installed to compile $PROJECT." |
44 |
|
echo "Install the appropriate package for your distribution," |
45 |
|
echo "or get the source tarball at http://ftp.gnu.org/gnu/autoconf/" |
46 |
|
DIE=1 |
47 |
|
fi |
48 |
|
|
49 |
# Autoheader is part of autoconf |
have_automake=false |
50 |
AUTOHEADER=autoheader |
# We know each 1.9.x version works |
51 |
${AUTOHEADER} --version | head -n 1 |
if automake-1.9 --version < /dev/null > /dev/null 2>&1 ; then |
52 |
echo "autoheader: minimum version required: 2.59" |
AUTOMAKE=automake-1.9 |
53 |
|
ACLOCAL=aclocal-1.9 |
54 |
|
have_automake=true |
55 |
|
elif automake --version < /dev/null > /dev/null 2>&1 ; then |
56 |
|
AUTOMAKE=automake |
57 |
|
ACLOCAL=aclocal |
58 |
|
automake_version=`automake --version | sed 's/^[^0-9]*\([0-9.][0-9.]*\).*/\1/'` |
59 |
|
case $automake_version in |
60 |
|
1.9*) |
61 |
|
have_automake=true |
62 |
|
;; |
63 |
|
esac |
64 |
|
fi |
65 |
|
if $have_automake ; then : ; else |
66 |
|
echo |
67 |
|
echo "You must have automake 1.9 installed to compile $PROJECT." |
68 |
|
echo "Install the appropriate package for your distribution," |
69 |
|
echo "or get the source tarball at http://ftp.gnu.org/gnu/automake/" |
70 |
|
DIE=1 |
71 |
|
fi |
72 |
|
|
73 |
AUTOMAKE=automake |
if test "$DIE" -eq 1; then |
74 |
if test -x /usr/bin/automake-1.9; then |
exit 1 |
|
AUTOMAKE=/usr/bin/automake-1.9 |
|
75 |
fi |
fi |
|
${AUTOMAKE} --version | head -n 1 |
|
|
echo "automake: minimum version required: 1.9.0" |
|
76 |
|
|
77 |
# Aclocal is part of automake |
test $TEST_TYPE $FILE || { |
78 |
ACLOCAL=aclocal |
echo "You must run this script in the top-level $PROJECT directory" |
79 |
if test -x /usr/bin/aclocal-1.9; then |
exit 1 |
80 |
ACLOCAL=/usr/bin/aclocal-1.9 |
} |
81 |
|
|
82 |
|
if test -z "$AUTOGEN_SUBDIR_MODE"; then |
83 |
|
if test -z "$*"; then |
84 |
|
echo "I am going to run ./configure with no arguments - if you wish " |
85 |
|
echo "to pass any to it, please specify them on the $0 command line." |
86 |
|
fi |
87 |
fi |
fi |
|
${ACLOCAL} --version | head -n 1 |
|
|
echo "aclocal: minimum version required: 1.9.0" |
|
88 |
|
|
89 |
echo "libtoolize ..." |
if test -z "$ACLOCAL_FLAGS"; then |
|
${LIBTOOLIZE} --force --copy |
|
90 |
|
|
91 |
echo "aclocal ..." |
acdir=`$ACLOCAL --print-ac-dir` |
92 |
${ACLOCAL} -I . |
m4list="glib-2.0.m4 glib-gettext.m4" |
93 |
|
|
94 |
echo "autoheader ..." |
for file in $m4list |
95 |
${AUTOHEADER} --force |
do |
96 |
|
if [ ! -f "$acdir/$file" ]; then |
97 |
|
echo "WARNING: aclocal's directory is $acdir, but..." |
98 |
|
echo " no file $acdir/$file" |
99 |
|
echo " You may see fatal macro warnings below." |
100 |
|
echo " If these files are installed in /some/dir, set the ACLOCAL_FLAGS " |
101 |
|
echo " environment variable to \"-I /some/dir\", or install" |
102 |
|
echo " $acdir/$file." |
103 |
|
echo "" |
104 |
|
fi |
105 |
|
done |
106 |
|
fi |
107 |
|
|
108 |
|
$ACLOCAL $ACLOCAL_FLAGS || exit $? |
109 |
|
|
110 |
|
libtoolize --force || exit $? |
111 |
|
|
112 |
echo "automake ..." |
autoheader || exit $? |
|
${AUTOMAKE} --add-missing --copy |
|
113 |
|
|
114 |
echo "autoconf ..." |
$AUTOMAKE --add-missing || exit $? |
115 |
${AUTOCONF} --force |
autoconf || exit $? |
116 |
|
cd $ORIGDIR || exit $? |
117 |
|
|
118 |
echo "Finished" |
if test "x$AUTOGEN_SUBDIR_MODE" = "xyes"; then |
119 |
|
$srcdir/configure --enable-maintainer-mode $AUTOGEN_CONFIGURE_ARGS "$@" || exit $? |
120 |
|
|
121 |
|
echo |
122 |
|
echo "Now type 'make' to compile $PROJECT." |
123 |
|
fi |