OSDN Git Service

* Make-lang.in (JAVA_SRCS): Added check-init.c.
[pf3gnuchains/gcc-fork.git] / libjava / aclocal.m4
1 dnl aclocal.m4 generated automatically by aclocal 1.4
2
3 dnl Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
4 dnl This file is free software; the Free Software Foundation
5 dnl gives unlimited permission to copy and/or distribute it,
6 dnl with or without modifications, as long as this notice is preserved.
7
8 dnl This program is distributed in the hope that it will be useful,
9 dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without
10 dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A
11 dnl PARTICULAR PURPOSE.
12
13 # FIXME: We temporarily define our own version of AC_PROG_CC.  This is
14 # copied from autoconf 2.12, but does not call AC_PROG_CC_WORKS.  We
15 # are probably using a cross compiler, which will not be able to fully
16 # link an executable.  This should really be fixed in autoconf
17 # itself.
18
19 AC_DEFUN(LIBGCJ_CONFIGURE,
20 [
21 dnl Default to --enable-multilib
22 AC_ARG_ENABLE(multilib,
23 [  --enable-multilib         build many library versions (default)],
24 [case "${enableval}" in
25   yes) multilib=yes ;;
26   no)  multilib=no ;;
27   *)   AC_MSG_ERROR(bad value ${enableval} for multilib option) ;;
28  esac], [multilib=yes])dnl
29
30 dnl We may get other options which we dont document:
31 dnl --with-target-subdir, --with-multisrctop, --with-multisubdir
32
33 if test "[$]{srcdir}" = "."; then
34   if test "[$]{with_target_subdir}" != "."; then
35     libgcj_basedir="[$]{srcdir}/[$]{with_multisrctop}../$1"
36   else
37     libgcj_basedir="[$]{srcdir}/[$]{with_multisrctop}$1"
38   fi
39 else
40   libgcj_basedir="[$]{srcdir}/$1"
41 fi
42 AC_SUBST(libgcj_basedir)
43
44 AC_CANONICAL_HOST
45
46 dnl Still use "libjava" here to placate dejagnu.
47 AM_INIT_AUTOMAKE(libjava, 0.0.7)
48
49 # FIXME: We temporarily define our own version of AC_PROG_CC.  This is
50 # copied from autoconf 2.12, but does not call AC_PROG_CC_WORKS.  We
51 # are probably using a cross compiler, which will not be able to fully
52 # link an executable.  This should really be fixed in autoconf
53 # itself.
54
55 AC_DEFUN(LIB_AC_PROG_CC,
56 [AC_BEFORE([$0], [AC_PROG_CPP])dnl
57 AC_CHECK_PROG(CC, gcc, gcc)
58 if test -z "$CC"; then
59   AC_CHECK_PROG(CC, cc, cc, , , /usr/ucb/cc)
60   test -z "$CC" && AC_MSG_ERROR([no acceptable cc found in \$PATH])
61 fi
62
63 AC_PROG_CC_GNU
64
65 if test $ac_cv_prog_gcc = yes; then
66   GCC=yes
67 dnl Check whether -g works, even if CFLAGS is set, in case the package
68 dnl plays around with CFLAGS (such as to build both debugging and
69 dnl normal versions of a library), tasteless as that idea is.
70   ac_test_CFLAGS="${CFLAGS+set}"
71   ac_save_CFLAGS="$CFLAGS"
72   CFLAGS=
73   AC_PROG_CC_G
74   if test "$ac_test_CFLAGS" = set; then
75     CFLAGS="$ac_save_CFLAGS"
76   elif test $ac_cv_prog_cc_g = yes; then
77     CFLAGS="-g -O2"
78   else
79     CFLAGS="-O2"
80   fi
81 else
82   GCC=
83   test "${CFLAGS+set}" = set || CFLAGS="-g"
84 fi
85 ])
86
87 LIB_AC_PROG_CC
88
89 # Likewise for AC_PROG_CXX.
90 AC_DEFUN(LIB_AC_PROG_CXX,
91 [AC_BEFORE([$0], [AC_PROG_CXXCPP])dnl
92 AC_CHECK_PROGS(CXX, $CCC c++ g++ gcc CC cxx cc++, gcc)
93 test -z "$CXX" && AC_MSG_ERROR([no acceptable c++ found in \$PATH])
94
95 AC_PROG_CXX_GNU
96
97 if test $ac_cv_prog_gxx = yes; then
98   GXX=yes
99 dnl Check whether -g works, even if CXXFLAGS is set, in case the package
100 dnl plays around with CXXFLAGS (such as to build both debugging and
101 dnl normal versions of a library), tasteless as that idea is.
102   ac_test_CXXFLAGS="${CXXFLAGS+set}"
103   ac_save_CXXFLAGS="$CXXFLAGS"
104   CXXFLAGS=
105   AC_PROG_CXX_G
106   if test "$ac_test_CXXFLAGS" = set; then
107     CXXFLAGS="$ac_save_CXXFLAGS"
108   elif test $ac_cv_prog_cxx_g = yes; then
109     CXXFLAGS="-g -O2"
110   else
111     CXXFLAGS="-O2"
112   fi
113 else
114   GXX=
115   test "${CXXFLAGS+set}" = set || CXXFLAGS="-g"
116 fi
117 ])
118
119 LIB_AC_PROG_CXX
120
121 # AC_CHECK_TOOL does AC_REQUIRE (AC_CANONICAL_BUILD).  If we dont
122 # run it explicitly here, it will be run implicitly before
123 # LIBGCJ_CONFIGURE, which doesn't work because that means that it will
124 # be run before AC_CANONICAL_HOST.
125 AC_CANONICAL_BUILD
126
127 AC_CHECK_TOOL(AS, as)
128 AC_CHECK_TOOL(AR, ar)
129 AC_CHECK_TOOL(RANLIB, ranlib, :)
130
131 AC_PROG_INSTALL
132
133 AM_MAINTAINER_MODE
134
135 # We need AC_EXEEXT to keep automake happy in cygnus mode.  However,
136 # at least currently, we never actually build a program, so we never
137 # need to use $(EXEEXT).  Moreover, the test for EXEEXT normally
138 # fails, because we are probably configuring with a cross compiler
139 # which cant create executables.  So we include AC_EXEEXT to keep
140 # automake happy, but we dont execute it, since we dont care about
141 # the result.
142 if false; then
143   AC_EXEEXT
144 fi
145
146 # configure.host sets the following important variables
147 #       libgcj_cflags    - host specific C compiler flags
148 #       libgcj_cxxflags  - host specific C++ compiler flags
149 #       libgcj_javaflags - host specific Java compiler flags
150
151 libgcj_cflags=
152 libgcj_cxxflags=
153 libgcj_javaflags=
154
155 . [$]{libgcj_basedir}/configure.host
156
157 case [$]{libgcj_basedir} in
158 /* | [A-Za-z]:[/\\]*) libgcj_flagbasedir=[$]{libgcj_basedir} ;;
159 *) libgcj_flagbasedir='[$](top_builddir)/'[$]{libgcj_basedir} ;;
160 esac
161
162 LIBGCJ_CFLAGS="[$]{libgcj_cflags}"
163 LIBGCJ_CXXFLAGS="[$]{libgcj_cxxflags}"
164 LIBGCJ_JAVAFLAGS="[$]{libgcj_javaflags}"
165 AC_SUBST(LIBGCJ_CFLAGS)
166 AC_SUBST(LIBGCJ_CXXFLAGS)
167 AC_SUBST(LIBGCJ_JAVAFLAGS)
168 ])dnl
169
170 # Do all the work for Automake.  This macro actually does too much --
171 # some checks are only needed if your package does certain things.
172 # But this isn't really a big deal.
173
174 # serial 1
175
176 dnl Usage:
177 dnl AM_INIT_AUTOMAKE(package,version, [no-define])
178
179 AC_DEFUN(AM_INIT_AUTOMAKE,
180 [AC_REQUIRE([AC_PROG_INSTALL])
181 PACKAGE=[$1]
182 AC_SUBST(PACKAGE)
183 VERSION=[$2]
184 AC_SUBST(VERSION)
185 dnl test to see if srcdir already configured
186 if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
187   AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
188 fi
189 ifelse([$3],,
190 AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
191 AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package]))
192 AC_REQUIRE([AM_SANITY_CHECK])
193 AC_REQUIRE([AC_ARG_PROGRAM])
194 dnl FIXME This is truly gross.
195 missing_dir=`cd $ac_aux_dir && pwd`
196 AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir)
197 AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
198 AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir)
199 AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
200 AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir)
201 AC_REQUIRE([AC_PROG_MAKE_SET])])
202
203 #
204 # Check to make sure that the build environment is sane.
205 #
206
207 AC_DEFUN(AM_SANITY_CHECK,
208 [AC_MSG_CHECKING([whether build environment is sane])
209 # Just in case
210 sleep 1
211 echo timestamp > conftestfile
212 # Do `set' in a subshell so we don't clobber the current shell's
213 # arguments.  Must try -L first in case configure is actually a
214 # symlink; some systems play weird games with the mod time of symlinks
215 # (eg FreeBSD returns the mod time of the symlink's containing
216 # directory).
217 if (
218    set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
219    if test "[$]*" = "X"; then
220       # -L didn't work.
221       set X `ls -t $srcdir/configure conftestfile`
222    fi
223    if test "[$]*" != "X $srcdir/configure conftestfile" \
224       && test "[$]*" != "X conftestfile $srcdir/configure"; then
225
226       # If neither matched, then we have a broken ls.  This can happen
227       # if, for instance, CONFIG_SHELL is bash and it inherits a
228       # broken ls alias from the environment.  This has actually
229       # happened.  Such a system could not be considered "sane".
230       AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
231 alias in your environment])
232    fi
233
234    test "[$]2" = conftestfile
235    )
236 then
237    # Ok.
238    :
239 else
240    AC_MSG_ERROR([newly created file is older than distributed files!
241 Check your system clock])
242 fi
243 rm -f conftest*
244 AC_MSG_RESULT(yes)])
245
246 dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY)
247 dnl The program must properly implement --version.
248 AC_DEFUN(AM_MISSING_PROG,
249 [AC_MSG_CHECKING(for working $2)
250 # Run test in a subshell; some versions of sh will print an error if
251 # an executable is not found, even if stderr is redirected.
252 # Redirect stdin to placate older versions of autoconf.  Sigh.
253 if ($2 --version) < /dev/null > /dev/null 2>&1; then
254    $1=$2
255    AC_MSG_RESULT(found)
256 else
257    $1="$3/missing $2"
258    AC_MSG_RESULT(missing)
259 fi
260 AC_SUBST($1)])
261
262 # Add --enable-maintainer-mode option to configure.
263 # From Jim Meyering
264
265 # serial 1
266
267 AC_DEFUN(AM_MAINTAINER_MODE,
268 [AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
269   dnl maintainer-mode is disabled by default
270   AC_ARG_ENABLE(maintainer-mode,
271 [  --enable-maintainer-mode enable make rules and dependencies not useful
272                           (and sometimes confusing) to the casual installer],
273       USE_MAINTAINER_MODE=$enableval,
274       USE_MAINTAINER_MODE=no)
275   AC_MSG_RESULT($USE_MAINTAINER_MODE)
276   AM_CONDITIONAL(MAINTAINER_MODE, test $USE_MAINTAINER_MODE = yes)
277   MAINT=$MAINTAINER_MODE_TRUE
278   AC_SUBST(MAINT)dnl
279 ]
280 )
281
282 # Define a conditional.
283
284 AC_DEFUN(AM_CONDITIONAL,
285 [AC_SUBST($1_TRUE)
286 AC_SUBST($1_FALSE)
287 if $2; then
288   $1_TRUE=
289   $1_FALSE='#'
290 else
291   $1_TRUE='#'
292   $1_FALSE=
293 fi])
294
295 # Like AC_CONFIG_HEADER, but automatically create stamp file.
296
297 AC_DEFUN(AM_CONFIG_HEADER,
298 [AC_PREREQ([2.12])
299 AC_CONFIG_HEADER([$1])
300 dnl When config.status generates a header, we must update the stamp-h file.
301 dnl This file resides in the same directory as the config header
302 dnl that is generated.  We must strip everything past the first ":",
303 dnl and everything past the last "/".
304 AC_OUTPUT_COMMANDS(changequote(<<,>>)dnl
305 ifelse(patsubst(<<$1>>, <<[^ ]>>, <<>>), <<>>,
306 <<test -z "<<$>>CONFIG_HEADERS" || echo timestamp > patsubst(<<$1>>, <<^\([^:]*/\)?.*>>, <<\1>>)stamp-h<<>>dnl>>,
307 <<am_indx=1
308 for am_file in <<$1>>; do
309   case " <<$>>CONFIG_HEADERS " in
310   *" <<$>>am_file "*<<)>>
311     echo timestamp > `echo <<$>>am_file | sed -e 's%:.*%%' -e 's%[^/]*$%%'`stamp-h$am_indx
312     ;;
313   esac
314   am_indx=`expr "<<$>>am_indx" + 1`
315 done<<>>dnl>>)
316 changequote([,]))])
317