1 dnl aclocal.m4 generated automatically by aclocal 1.4-p5
3 dnl Copyright (C) 1994, 1995-8, 1999, 2001 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 sinclude(../config/accross.m4)
15 AC_DEFUN(LIBGCJ_CONFIGURE,
17 dnl Default to --enable-multilib
18 AC_ARG_ENABLE(multilib,
19 [ --enable-multilib build many library versions (default)],
20 [case "${enableval}" in
23 *) AC_MSG_ERROR(bad value ${enableval} for multilib option) ;;
24 esac], [multilib=yes])dnl
26 dnl We may get other options which we don't document:
27 dnl --with-target-subdir, --with-multisrctop, --with-multisubdir
29 # When building with srcdir == objdir, links to the source files will
30 # be created in directories within the target_subdir. We have to
31 # adjust toplevel_srcdir accordingly, so that configure finds
32 # install-sh and other auxiliary files that live in the top-level
34 if test "${srcdir}" = "."; then
35 if test -z "${with_target_subdir}"; then
38 if test "${with_target_subdir}" != "."; then
39 toprel="${with_multisrctop}../.."
41 toprel="${with_multisrctop}.."
48 libgcj_basedir=$srcdir/$toprel/$1/libjava
49 AC_SUBST(libgcj_basedir)
51 AC_CONFIG_AUX_DIR(${srcdir}/$toprel)
53 # This overrides the previous occurrence for automake, but not for
54 # autoconf, which is exactly what we want.
58 # This works around an automake problem.
59 mkinstalldirs="`cd $ac_aux_dir && ${PWDCMD-pwd}`/mkinstalldirs"
60 AC_SUBST(mkinstalldirs)
64 dnl This shouldn't be needed, as long as top-level dependencies are
65 dnl defined correctly and shared-library paths are set up so that
66 dnl execution tests succeed. FIXME.
67 define([AC_PROG_CC_WORKS],[])
68 define([AC_PROG_CXX_WORKS],[])
72 # We use the libstdc++-v3 version of LIB_AC_PROG_CXX, but use
73 # glibjava_CXX instead of glibcpp_CXX. That's because we're passed a
74 # different definition of CXX than other directories, since we don't
75 # depend on libstdc++-v3 having already been built.
76 AC_DEFUN(LIB_AC_PROG_CXX,
77 [AC_BEFORE([$0], [AC_PROG_CXXCPP])dnl
78 dnl Fool anybody using AC_PROG_CXX.
79 AC_PROVIDE([AC_PROG_CXX])
80 # Use glibjava_CXX so that we do not cause CXX to be cached with the
81 # flags that come in CXX while configuring libjava. They're different
82 # from those used for all other target libraries. If CXX is set in
83 # the environment, respect that here.
85 AC_CHECK_PROGS(glibjava_CXX, $CCC c++ g++ gcc CC cxx cc++, gcc)
88 test -z "$glibjava_CXX" && AC_MSG_ERROR([no acceptable c++ found in \$PATH])
92 if test $ac_cv_prog_gxx = yes; then
94 dnl Check whether -g works, even if CXXFLAGS is set, in case the package
95 dnl plays around with CXXFLAGS (such as to build both debugging and
96 dnl normal versions of a library), tasteless as that idea is.
97 ac_test_CXXFLAGS="${CXXFLAGS+set}"
98 ac_save_CXXFLAGS="$CXXFLAGS"
101 if test "$ac_test_CXXFLAGS" = set; then
102 CXXFLAGS="$ac_save_CXXFLAGS"
103 elif test $ac_cv_prog_cxx_g = yes; then
110 test "${CXXFLAGS+set}" = set || CXXFLAGS="-g"
116 dnl version is pulled out to make it a bit easier to change using sed.
118 dnl Still use "libjava" here to placate dejagnu.
119 AM_INIT_AUTOMAKE(libjava, $version)
121 # AC_CHECK_TOOL does AC_REQUIRE (AC_CANONICAL_BUILD). If we don't
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, :)
137 # configure.host sets the following important variables
138 # libgcj_cflags - host specific C compiler flags
139 # libgcj_cxxflags - host specific C++ compiler flags
140 # libgcj_javaflags - host specific Java compiler flags
146 . [$]{srcdir}/configure.host
148 LIBGCJ_CFLAGS="[$]{libgcj_cflags}"
149 LIBGCJ_CXXFLAGS="[$]{libgcj_cxxflags}"
150 LIBGCJ_JAVAFLAGS="[$]{libgcj_javaflags}"
151 AC_SUBST(LIBGCJ_CFLAGS)
152 AC_SUBST(LIBGCJ_CXXFLAGS)
153 AC_SUBST(LIBGCJ_JAVAFLAGS)
156 sinclude(../libtool.m4)
157 dnl The lines below arrange for aclocal not to bring libtool.m4
158 dnl AM_PROG_LIBTOOL into aclocal.m4, while still arranging for automake
159 dnl to add a definition of LIBTOOL to Makefile.in.
161 AC_DEFUN([AM_PROG_LIBTOOL],)
162 AC_DEFUN([AC_LIBTOOL_DLOPEN],)
163 AC_DEFUN([AC_LIBLTDL_CONVENIENCE],)
164 AC_DEFUN([LT_AC_PROG_GCJ],)
171 dnl From Bruno Haible.
175 dnl Some systems have iconv in libc, some have it in libiconv (OSF/1 and
176 dnl those with the standalone portable GNU libiconv installed).
178 am_cv_lib_iconv_ldpath=
179 AC_ARG_WITH([libiconv-prefix],
180 [ --with-libiconv-prefix=DIR search for libiconv in DIR/include and DIR/lib], [
181 for dir in `echo "$withval" | tr : ' '`; do
182 if test -d $dir/include; then CPPFLAGS="$CPPFLAGS -I$dir/include"; fi
183 if test -d $dir/lib; then am_cv_lib_iconv_ldpath="-L$dir/lib"; fi
187 AC_CACHE_CHECK(for iconv, am_cv_func_iconv, [
188 am_cv_func_iconv="no, consider installing GNU libiconv"
190 AC_TRY_LINK([#include <stdlib.h>
192 [iconv_t cd = iconv_open("","");
193 iconv(cd,NULL,NULL,NULL,NULL);
195 am_cv_func_iconv=yes)
196 if test "$am_cv_func_iconv" != yes; then
198 LIBS="$LIBS $am_cv_libiconv_ldpath -liconv"
199 AC_TRY_LINK([#include <stdlib.h>
201 [iconv_t cd = iconv_open("","");
202 iconv(cd,NULL,NULL,NULL,NULL);
205 am_cv_func_iconv=yes)
209 if test "$am_cv_func_iconv" = yes; then
210 AC_DEFINE(HAVE_ICONV, 1, [Define if you have the iconv() function.])
211 AC_MSG_CHECKING([for iconv declaration])
212 AC_CACHE_VAL(am_cv_proto_iconv, [
220 #if defined(__STDC__) || defined(__cplusplus)
221 size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);
225 ], [], am_cv_proto_iconv_arg1="", am_cv_proto_iconv_arg1="const")
226 am_cv_proto_iconv="extern size_t iconv (iconv_t cd, $am_cv_proto_iconv_arg1 char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);"])
227 am_cv_proto_iconv=`echo "[$]am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'`
228 AC_MSG_RESULT([$]{ac_t:-
229 }[$]am_cv_proto_iconv)
230 AC_DEFINE_UNQUOTED(ICONV_CONST, $am_cv_proto_iconv_arg1,
231 [Define as const if the declaration of iconv() needs const.])
234 if test "$am_cv_lib_iconv" = yes; then
235 LIBICONV="$am_cv_lib_iconv_ldpath -liconv"
240 # Check whether LC_MESSAGES is available in <locale.h>.
241 # Ulrich Drepper <drepper@cygnus.com>, 1995.
243 # This file can be copied and used freely without restrictions. It can
244 # be used in projects which are not available under the GNU General Public
245 # License or the GNU Library General Public License but which still want
246 # to provide support for the GNU gettext functionality.
247 # Please note that the actual code of the GNU gettext library is covered
248 # by the GNU Library General Public License, and the rest of the GNU
249 # gettext package package is covered by the GNU General Public License.
250 # They are *not* in the public domain.
254 AC_DEFUN([AM_LC_MESSAGES],
255 [if test $ac_cv_header_locale_h = yes; then
256 AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES,
257 [AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
258 am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)])
259 if test $am_cv_val_LC_MESSAGES = yes; then
260 AC_DEFINE(HAVE_LC_MESSAGES, 1,
261 [Define if your <locale.h> file defines LC_MESSAGES.])
265 # Do all the work for Automake. This macro actually does too much --
266 # some checks are only needed if your package does certain things.
267 # But this isn't really a big deal.
272 dnl AM_INIT_AUTOMAKE(package,version, [no-define])
274 AC_DEFUN([AM_INIT_AUTOMAKE],
275 [AC_REQUIRE([AC_PROG_INSTALL])
280 dnl test to see if srcdir already configured
281 if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
282 AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
285 AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
286 AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package]))
287 AC_REQUIRE([AM_SANITY_CHECK])
288 AC_REQUIRE([AC_ARG_PROGRAM])
289 dnl FIXME This is truly gross.
290 missing_dir=`cd $ac_aux_dir && pwd`
291 AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir)
292 AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
293 AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir)
294 AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
295 AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir)
296 AC_REQUIRE([AC_PROG_MAKE_SET])])
299 # Check to make sure that the build environment is sane.
302 AC_DEFUN([AM_SANITY_CHECK],
303 [AC_MSG_CHECKING([whether build environment is sane])
306 echo timestamp > conftestfile
307 # Do `set' in a subshell so we don't clobber the current shell's
308 # arguments. Must try -L first in case configure is actually a
309 # symlink; some systems play weird games with the mod time of symlinks
310 # (eg FreeBSD returns the mod time of the symlink's containing
313 set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
314 if test "[$]*" = "X"; then
316 set X `ls -t $srcdir/configure conftestfile`
318 if test "[$]*" != "X $srcdir/configure conftestfile" \
319 && test "[$]*" != "X conftestfile $srcdir/configure"; then
321 # If neither matched, then we have a broken ls. This can happen
322 # if, for instance, CONFIG_SHELL is bash and it inherits a
323 # broken ls alias from the environment. This has actually
324 # happened. Such a system could not be considered "sane".
325 AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken
326 alias in your environment])
329 test "[$]2" = conftestfile
335 AC_MSG_ERROR([newly created file is older than distributed files!
336 Check your system clock])
341 dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY)
342 dnl The program must properly implement --version.
343 AC_DEFUN([AM_MISSING_PROG],
344 [AC_MSG_CHECKING(for working $2)
345 # Run test in a subshell; some versions of sh will print an error if
346 # an executable is not found, even if stderr is redirected.
347 # Redirect stdin to placate older versions of autoconf. Sigh.
348 if ($2 --version) < /dev/null > /dev/null 2>&1; then
353 AC_MSG_RESULT(missing)
357 # Add --enable-maintainer-mode option to configure.
362 AC_DEFUN([AM_MAINTAINER_MODE],
363 [AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
364 dnl maintainer-mode is disabled by default
365 AC_ARG_ENABLE(maintainer-mode,
366 [ --enable-maintainer-mode enable make rules and dependencies not useful
367 (and sometimes confusing) to the casual installer],
368 USE_MAINTAINER_MODE=$enableval,
369 USE_MAINTAINER_MODE=no)
370 AC_MSG_RESULT($USE_MAINTAINER_MODE)
371 AM_CONDITIONAL(MAINTAINER_MODE, test $USE_MAINTAINER_MODE = yes)
372 MAINT=$MAINTAINER_MODE_TRUE
377 # Define a conditional.
379 AC_DEFUN([AM_CONDITIONAL],
390 # Like AC_CONFIG_HEADER, but automatically create stamp file.
392 AC_DEFUN([AM_CONFIG_HEADER],
394 AC_CONFIG_HEADER([$1])
395 dnl When config.status generates a header, we must update the stamp-h file.
396 dnl This file resides in the same directory as the config header
397 dnl that is generated. We must strip everything past the first ":",
398 dnl and everything past the last "/".
399 AC_OUTPUT_COMMANDS(changequote(<<,>>)dnl
400 ifelse(patsubst(<<$1>>, <<[^ ]>>, <<>>), <<>>,
401 <<test -z "<<$>>CONFIG_HEADERS" || echo timestamp > patsubst(<<$1>>, <<^\([^:]*/\)?.*>>, <<\1>>)stamp-h<<>>dnl>>,
403 for am_file in <<$1>>; do
404 case " <<$>>CONFIG_HEADERS " in
405 *" <<$>>am_file "*<<)>>
406 echo timestamp > `echo <<$>>am_file | sed -e 's%:.*%%' -e 's%[^/]*$%%'`stamp-h$am_indx
409 am_indx=`expr "<<$>>am_indx" + 1`