1 dnl aclocal.m4 generated automatically by aclocal 1.4
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.
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.
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
19 AC_DEFUN(LIBGCJ_CONFIGURE,
21 dnl Default to --enable-multilib
22 AC_ARG_ENABLE(multilib,
23 [ --enable-multilib build many library versions (default)],
24 [case "${enableval}" in
27 *) AC_MSG_ERROR(bad value ${enableval} for multilib option) ;;
28 esac], [multilib=yes])dnl
30 dnl We may get other options which we dont document:
31 dnl --with-target-subdir, --with-multisrctop, --with-multisubdir
33 if test "[$]{srcdir}" = "."; then
34 if test "[$]{with_target_subdir}" != "."; then
35 libgcj_basedir="[$]{srcdir}/[$]{with_multisrctop}../$1"
37 libgcj_basedir="[$]{srcdir}/[$]{with_multisrctop}$1"
40 libgcj_basedir="[$]{srcdir}/$1"
42 AC_SUBST(libgcj_basedir)
46 dnl Still use "libjava" here to placate dejagnu.
47 AM_INIT_AUTOMAKE(libjava, 0.0.7)
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
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])
65 if test $ac_cv_prog_gcc = yes; then
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"
74 if test "$ac_test_CFLAGS" = set; then
75 CFLAGS="$ac_save_CFLAGS"
76 elif test $ac_cv_prog_cc_g = yes; then
83 test "${CFLAGS+set}" = set || CFLAGS="-g"
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])
97 if test $ac_cv_prog_gxx = yes; then
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"
106 if test "$ac_test_CXXFLAGS" = set; then
107 CXXFLAGS="$ac_save_CXXFLAGS"
108 elif test $ac_cv_prog_cxx_g = yes; then
115 test "${CXXFLAGS+set}" = set || CXXFLAGS="-g"
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.
127 AC_CHECK_TOOL(AS, as)
128 AC_CHECK_TOOL(AR, ar)
129 AC_CHECK_TOOL(RANLIB, ranlib, :)
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
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
155 . [$]{libgcj_basedir}/configure.host
157 case [$]{libgcj_basedir} in
158 /* | [A-Za-z]:[/\\]*) libgcj_flagbasedir=[$]{libgcj_basedir} ;;
159 *) libgcj_flagbasedir='[$](top_builddir)/'[$]{libgcj_basedir} ;;
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)
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.
177 dnl AM_INIT_AUTOMAKE(package,version, [no-define])
179 AC_DEFUN(AM_INIT_AUTOMAKE,
180 [AC_REQUIRE([AC_PROG_INSTALL])
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])
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])])
204 # Check to make sure that the build environment is sane.
207 AC_DEFUN(AM_SANITY_CHECK,
208 [AC_MSG_CHECKING([whether build environment is sane])
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
218 set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
219 if test "[$]*" = "X"; then
221 set X `ls -t $srcdir/configure conftestfile`
223 if test "[$]*" != "X $srcdir/configure conftestfile" \
224 && test "[$]*" != "X conftestfile $srcdir/configure"; then
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])
234 test "[$]2" = conftestfile
240 AC_MSG_ERROR([newly created file is older than distributed files!
241 Check your system clock])
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
258 AC_MSG_RESULT(missing)
262 # Add --enable-maintainer-mode option to configure.
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
282 # Define a conditional.
284 AC_DEFUN(AM_CONDITIONAL,
295 # Like AC_CONFIG_HEADER, but automatically create stamp file.
297 AC_DEFUN(AM_CONFIG_HEADER,
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>>,
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
314 am_indx=`expr "<<$>>am_indx" + 1`
319 # serial 25 AM_PROG_LIBTOOL
320 AC_DEFUN(AM_PROG_LIBTOOL,
321 [AC_REQUIRE([AM_ENABLE_SHARED])dnl
322 AC_REQUIRE([AM_ENABLE_STATIC])dnl
323 AC_REQUIRE([AC_CANONICAL_HOST])dnl
324 AC_REQUIRE([AC_CANONICAL_BUILD])dnl
325 AC_REQUIRE([AC_PROG_RANLIB])dnl
326 AC_REQUIRE([AC_PROG_CC])dnl
327 AC_REQUIRE([AM_PROG_LD])dnl
328 AC_REQUIRE([AM_PROG_NM])dnl
329 AC_REQUIRE([AC_PROG_LN_S])dnl
331 # Always use our own libtool.
332 LIBTOOL='$(SHELL) $(top_builddir)/libtool'
335 # Check for any special flags to pass to ltconfig.
337 test "$enable_shared" = no && libtool_flags="$libtool_flags --disable-shared"
338 test "$enable_static" = no && libtool_flags="$libtool_flags --disable-static"
339 test "$silent" = yes && libtool_flags="$libtool_flags --silent"
340 test "$ac_cv_prog_gcc" = yes && libtool_flags="$libtool_flags --with-gcc"
341 test "$ac_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld"
343 # Some flags need to be propagated to the compiler or linker for good
347 # Find out which ABI we are using.
348 echo '[#]line __oline__ "configure"' > conftest.$ac_ext
349 if AC_TRY_EVAL(ac_compile); then
350 case "`/usr/bin/file conftest.o`" in
366 # On SCO OpenServer 5, we need -belf to get full-featured binaries.
367 CFLAGS="$CFLAGS -belf"
371 AM_SYS_LIBTOOL_CYGWIN32
376 # Actually configure libtool. ac_aux_dir is where install-sh is found.
377 CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \
378 LD="$LD" NM="$NM" RANLIB="$RANLIB" LN_S="$LN_S" \
379 DLLTOOL="$DLLTOOL" AS="$AS" \
380 ${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig --no-reexec \
381 $libtool_flags --no-verify $ac_aux_dir/ltmain.sh $host \
382 || AC_MSG_ERROR([libtool configure failed])
384 # Redirect the config.log output again, so that the ltconfig log is not
385 # clobbered by the next message.
389 # AM_ENABLE_SHARED - implement the --enable-shared flag
390 # Usage: AM_ENABLE_SHARED[(DEFAULT)]
391 # Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
393 AC_DEFUN(AM_ENABLE_SHARED,
394 [define([AM_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl
395 AC_ARG_ENABLE(shared,
396 changequote(<<, >>)dnl
397 << --enable-shared[=PKGS] build shared libraries [default=>>AM_ENABLE_SHARED_DEFAULT],
399 [p=${PACKAGE-default}
401 yes) enable_shared=yes ;;
402 no) enable_shared=no ;;
405 # Look at the argument we got. We use all the common list separators.
406 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
407 for pkg in $enableval; do
408 if test "X$pkg" = "X$p"; then
415 enable_shared=AM_ENABLE_SHARED_DEFAULT)dnl
418 # AM_DISABLE_SHARED - set the default shared flag to --disable-shared
419 AC_DEFUN(AM_DISABLE_SHARED,
420 [AM_ENABLE_SHARED(no)])
422 # AM_DISABLE_STATIC - set the default static flag to --disable-static
423 AC_DEFUN(AM_DISABLE_STATIC,
424 [AM_ENABLE_STATIC(no)])
426 # AM_ENABLE_STATIC - implement the --enable-static flag
427 # Usage: AM_ENABLE_STATIC[(DEFAULT)]
428 # Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
430 AC_DEFUN(AM_ENABLE_STATIC,
431 [define([AM_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl
432 AC_ARG_ENABLE(static,
433 changequote(<<, >>)dnl
434 << --enable-static[=PKGS] build static libraries [default=>>AM_ENABLE_STATIC_DEFAULT],
436 [p=${PACKAGE-default}
438 yes) enable_static=yes ;;
439 no) enable_static=no ;;
442 # Look at the argument we got. We use all the common list separators.
443 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
444 for pkg in $enableval; do
445 if test "X$pkg" = "X$p"; then
452 enable_static=AM_ENABLE_STATIC_DEFAULT)dnl
456 # AM_PROG_LD - find the path to the GNU or non-GNU linker
459 [ --with-gnu-ld assume the C compiler uses GNU ld [default=no]],
460 test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
461 AC_REQUIRE([AC_PROG_CC])
463 if test "$ac_cv_prog_gcc" = yes; then
464 # Check if gcc -print-prog-name=ld gives a path.
465 AC_MSG_CHECKING([for ld used by GCC])
466 ac_prog=`($CC -print-prog-name=ld) 2>&5`
468 # Accept absolute paths.
472 test -z "$LD" && LD="$ac_prog"
475 # If it fails, then pretend we aren't using GCC.
479 # If it is relative, then search for the first ld in PATH.
483 elif test "$with_gnu_ld" = yes; then
484 AC_MSG_CHECKING([for GNU ld])
486 AC_MSG_CHECKING([for non-GNU ld])
488 AC_CACHE_VAL(ac_cv_path_LD,
489 [if test -z "$LD"; then
490 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
491 for ac_dir in $PATH; do
492 test -z "$ac_dir" && ac_dir=.
493 if test -f "$ac_dir/$ac_prog"; then
494 ac_cv_path_LD="$ac_dir/$ac_prog"
495 # Check to see if the program is GNU ld. I'd rather use --version,
496 # but apparently some GNU ld's only accept -v.
497 # Break only if it was the GNU/non-GNU ld that we prefer.
498 if "$ac_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
499 test "$with_gnu_ld" != no && break
501 test "$with_gnu_ld" != yes && break
507 ac_cv_path_LD="$LD" # Let the user override the test with a path.
510 if test -n "$LD"; then
515 test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
520 AC_DEFUN(AM_PROG_LD_GNU,
521 [AC_CACHE_CHECK([if the linker ($LD) is GNU ld], ac_cv_prog_gnu_ld,
522 [# I'd rather use --version here, but apparently some GNU ld's only accept -v.
523 if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
524 ac_cv_prog_gnu_ld=yes
530 # AM_PROG_NM - find the path to a BSD-compatible name lister
532 [AC_MSG_CHECKING([for BSD-compatible nm])
533 AC_CACHE_VAL(ac_cv_path_NM,
534 [if test -n "$NM"; then
535 # Let the user override the test.
538 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
539 for ac_dir in /usr/ucb /usr/ccs/bin $PATH /bin; do
540 test -z "$ac_dir" && ac_dir=.
541 if test -f $ac_dir/nm; then
542 # Check to see if the nm accepts a BSD-compat flag.
543 # Adding the `sed 1q' prevents false positives on HP-UX, which says:
544 # nm: unknown option "B" ignored
545 if ($ac_dir/nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
546 ac_cv_path_NM="$ac_dir/nm -B"
547 elif ($ac_dir/nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
548 ac_cv_path_NM="$ac_dir/nm -p"
550 ac_cv_path_NM="$ac_dir/nm"
556 test -z "$ac_cv_path_NM" && ac_cv_path_NM=nm
563 # AM_SYS_LIBTOOL_CYGWIN32 - find tools needed on cygwin32
564 AC_DEFUN(AM_SYS_LIBTOOL_CYGWIN32,
565 [AC_CHECK_TOOL(DLLTOOL, dlltool, false)
566 AC_CHECK_TOOL(AS, as, false)