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 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(AS, as)
122 AC_CHECK_TOOL(AR, ar)
123 AC_CHECK_TOOL(RANLIB, ranlib, :)
131 # configure.host sets the following important variables
132 # libgcj_cflags - host specific C compiler flags
133 # libgcj_cxxflags - host specific C++ compiler flags
134 # libgcj_javaflags - host specific Java compiler flags
140 . [$]{srcdir}/configure.host
142 LIBGCJ_CFLAGS="[$]{libgcj_cflags}"
143 LIBGCJ_CXXFLAGS="[$]{libgcj_cxxflags}"
144 LIBGCJ_JAVAFLAGS="[$]{libgcj_javaflags}"
145 AC_SUBST(LIBGCJ_CFLAGS)
146 AC_SUBST(LIBGCJ_CXXFLAGS)
147 AC_SUBST(LIBGCJ_JAVAFLAGS)
150 sinclude(../libtool.m4)
151 dnl The lines below arrange for aclocal not to bring libtool.m4
152 dnl AM_PROG_LIBTOOL into aclocal.m4, while still arranging for automake
153 dnl to add a definition of LIBTOOL to Makefile.in.
155 AC_DEFUN([AM_PROG_LIBTOOL],)
156 AC_DEFUN([AC_LIBTOOL_DLOPEN],)
157 AC_DEFUN([AC_LIBLTDL_CONVENIENCE],)
158 AC_DEFUN([LT_AC_PROG_GCJ],)
165 dnl From Bruno Haible.
169 dnl Some systems have iconv in libc, some have it in libiconv (OSF/1 and
170 dnl those with the standalone portable GNU libiconv installed).
172 am_cv_lib_iconv_ldpath=
173 AC_ARG_WITH([libiconv-prefix],
174 [ --with-libiconv-prefix=DIR search for libiconv in DIR/include and DIR/lib], [
175 for dir in `echo "$withval" | tr : ' '`; do
176 if test -d $dir/include; then CPPFLAGS="$CPPFLAGS -I$dir/include"; fi
177 if test -d $dir/lib; then am_cv_lib_iconv_ldpath="-L$dir/lib"; fi
181 AC_CACHE_CHECK(for iconv, am_cv_func_iconv, [
182 am_cv_func_iconv="no, consider installing GNU libiconv"
184 AC_TRY_LINK([#include <stdlib.h>
186 [iconv_t cd = iconv_open("","");
187 iconv(cd,NULL,NULL,NULL,NULL);
189 am_cv_func_iconv=yes)
190 if test "$am_cv_func_iconv" != yes; then
192 LIBS="$LIBS $am_cv_libiconv_ldpath -liconv"
193 AC_TRY_LINK([#include <stdlib.h>
195 [iconv_t cd = iconv_open("","");
196 iconv(cd,NULL,NULL,NULL,NULL);
199 am_cv_func_iconv=yes)
203 if test "$am_cv_func_iconv" = yes; then
204 AC_DEFINE(HAVE_ICONV, 1, [Define if you have the iconv() function.])
205 AC_MSG_CHECKING([for iconv declaration])
206 AC_CACHE_VAL(am_cv_proto_iconv, [
214 #if defined(__STDC__) || defined(__cplusplus)
215 size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);
219 ], [], am_cv_proto_iconv_arg1="", am_cv_proto_iconv_arg1="const")
220 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);"])
221 am_cv_proto_iconv=`echo "[$]am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'`
222 AC_MSG_RESULT([$]{ac_t:-
223 }[$]am_cv_proto_iconv)
224 AC_DEFINE_UNQUOTED(ICONV_CONST, $am_cv_proto_iconv_arg1,
225 [Define as const if the declaration of iconv() needs const.])
228 if test "$am_cv_lib_iconv" = yes; then
229 LIBICONV="$am_cv_lib_iconv_ldpath -liconv"
234 # Check whether LC_MESSAGES is available in <locale.h>.
235 # Ulrich Drepper <drepper@cygnus.com>, 1995.
237 # This file can be copied and used freely without restrictions. It can
238 # be used in projects which are not available under the GNU General Public
239 # License or the GNU Library General Public License but which still want
240 # to provide support for the GNU gettext functionality.
241 # Please note that the actual code of the GNU gettext library is covered
242 # by the GNU Library General Public License, and the rest of the GNU
243 # gettext package package is covered by the GNU General Public License.
244 # They are *not* in the public domain.
248 AC_DEFUN([AM_LC_MESSAGES],
249 [AC_CHECK_HEADERS(locale.h)
250 if test $ac_cv_header_locale_h = yes; then
251 AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES,
252 [AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
253 am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)])
254 if test $am_cv_val_LC_MESSAGES = yes; then
255 AC_DEFINE(HAVE_LC_MESSAGES, 1,
256 [Define if your <locale.h> file defines LC_MESSAGES.])
260 AC_DEFUN([CHECK_FOR_BROKEN_MINGW_LD],
262 AC_MSG_CHECKING(whether 'ld' is at least 2.13)
263 LD_PROG=`$CC --print-prog-name=ld`
264 LD_VERSION=`$LD_PROG --version`
265 LD_VERSION_MAJOR=`echo "$LD_VERSION" | head -1 | cut -d '.' -f 1 | cut -d ' ' -f 4`
266 LD_VERSION_MINOR=`echo "$LD_VERSION" | head -1 | cut -d '.' -f 2`
267 if expr "$LD_VERSION_MAJOR" \> 2 > /dev/null; then
270 if expr "$LD_VERSION_MAJOR" = 2 && expr "$LD_VERSION_MINOR" \>= 13 > /dev/null; then
274 if test "x$LD_OK" != x; then
275 AC_MSG_RESULT([yes; major=$LD_VERSION_MAJOR, minor=$LD_VERSION_MINOR])
277 AC_MSG_RESULT([no; major=$LD_VERSION_MAJOR, minor=$LD_VERSION_MINOR])
278 AC_MSG_WARN([ld <2.13 detected; enabling JV_LINKER_CANNOT_8BYTE_ALIGN_STATICS hack...])
279 AC_DEFINE(JV_LINKER_CANNOT_8BYTE_ALIGN_STATICS, 1,
280 [Indicate that linker is not able to 8-byte align static data])
282 ])# CHECK_FOR_BROKEN_MINGW_LD
284 dnl PKG_CHECK_MODULES(GSTUFF, gtk+-2.0 >= 1.3 glib = 1.3.4, action-if, action-not)
285 dnl defines GSTUFF_LIBS, GSTUFF_CFLAGS, see pkg-config man page
286 dnl also defines GSTUFF_PKG_ERRORS on error
287 AC_DEFUN(PKG_CHECK_MODULES, [
290 if test -z "$PKG_CONFIG"; then
291 AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
294 if test "$PKG_CONFIG" = "no" ; then
295 echo "*** The pkg-config script could not be found. Make sure it is"
296 echo "*** in your path, or set the PKG_CONFIG environment variable"
297 echo "*** to the full path to pkg-config."
298 echo "*** Or see http://www.freedesktop.org/software/pkgconfig to get pkg-config."
300 PKG_CONFIG_MIN_VERSION=0.9.0
301 if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then
302 AC_MSG_CHECKING(for $2)
304 if $PKG_CONFIG --exists "$2" ; then
308 AC_MSG_CHECKING($1_CFLAGS)
309 $1_CFLAGS=`$PKG_CONFIG --cflags "$2"`
310 AC_MSG_RESULT($$1_CFLAGS)
312 AC_MSG_CHECKING($1_LIBS)
313 $1_LIBS=`$PKG_CONFIG --libs "$2"`
314 AC_MSG_RESULT($$1_LIBS)
318 ## If we have a custom action on failure, don't print errors, but
319 ## do set a variable so people can do so.
320 $1_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$2"`
321 ifelse([$4], ,echo $$1_PKG_ERRORS,)
327 echo "*** Your version of pkg-config is too old. You need version $PKG_CONFIG_MIN_VERSION or newer."
328 echo "*** See http://www.freedesktop.org/software/pkgconfig"
332 if test $succeeded = yes; then
333 ifelse([$3], , :, [$3])
335 ifelse([$4], , AC_MSG_ERROR([Library requirements ($2) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them.]), [$4])
341 # Do all the work for Automake. This macro actually does too much --
342 # some checks are only needed if your package does certain things.
343 # But this isn't really a big deal.
348 dnl AM_INIT_AUTOMAKE(package,version, [no-define])
350 AC_DEFUN(AM_INIT_AUTOMAKE,
351 [AC_REQUIRE([AC_PROG_INSTALL])
356 dnl test to see if srcdir already configured
357 if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
358 AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
361 AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
362 AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package]))
363 AC_REQUIRE([AM_SANITY_CHECK])
364 AC_REQUIRE([AC_ARG_PROGRAM])
365 dnl FIXME This is truly gross.
366 missing_dir=`cd $ac_aux_dir && pwd`
367 AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir)
368 AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
369 AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir)
370 AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
371 AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir)
372 AC_REQUIRE([AC_PROG_MAKE_SET])])
375 # Check to make sure that the build environment is sane.
378 AC_DEFUN(AM_SANITY_CHECK,
379 [AC_MSG_CHECKING([whether build environment is sane])
382 echo timestamp > conftestfile
383 # Do `set' in a subshell so we don't clobber the current shell's
384 # arguments. Must try -L first in case configure is actually a
385 # symlink; some systems play weird games with the mod time of symlinks
386 # (eg FreeBSD returns the mod time of the symlink's containing
389 set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
390 if test "[$]*" = "X"; then
392 set X `ls -t $srcdir/configure conftestfile`
394 if test "[$]*" != "X $srcdir/configure conftestfile" \
395 && test "[$]*" != "X conftestfile $srcdir/configure"; then
397 # If neither matched, then we have a broken ls. This can happen
398 # if, for instance, CONFIG_SHELL is bash and it inherits a
399 # broken ls alias from the environment. This has actually
400 # happened. Such a system could not be considered "sane".
401 AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken
402 alias in your environment])
405 test "[$]2" = conftestfile
411 AC_MSG_ERROR([newly created file is older than distributed files!
412 Check your system clock])
417 dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY)
418 dnl The program must properly implement --version.
419 AC_DEFUN(AM_MISSING_PROG,
420 [AC_MSG_CHECKING(for working $2)
421 # Run test in a subshell; some versions of sh will print an error if
422 # an executable is not found, even if stderr is redirected.
423 # Redirect stdin to placate older versions of autoconf. Sigh.
424 if ($2 --version) < /dev/null > /dev/null 2>&1; then
429 AC_MSG_RESULT(missing)
433 # Add --enable-maintainer-mode option to configure.
438 AC_DEFUN(AM_MAINTAINER_MODE,
439 [AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
440 dnl maintainer-mode is disabled by default
441 AC_ARG_ENABLE(maintainer-mode,
442 [ --enable-maintainer-mode enable make rules and dependencies not useful
443 (and sometimes confusing) to the casual installer],
444 USE_MAINTAINER_MODE=$enableval,
445 USE_MAINTAINER_MODE=no)
446 AC_MSG_RESULT($USE_MAINTAINER_MODE)
447 AM_CONDITIONAL(MAINTAINER_MODE, test $USE_MAINTAINER_MODE = yes)
448 MAINT=$MAINTAINER_MODE_TRUE
453 # Define a conditional.
455 AC_DEFUN(AM_CONDITIONAL,
466 # Like AC_CONFIG_HEADER, but automatically create stamp file.
468 AC_DEFUN(AM_CONFIG_HEADER,
470 AC_CONFIG_HEADER([$1])
471 dnl When config.status generates a header, we must update the stamp-h file.
472 dnl This file resides in the same directory as the config header
473 dnl that is generated. We must strip everything past the first ":",
474 dnl and everything past the last "/".
475 AC_OUTPUT_COMMANDS(changequote(<<,>>)dnl
476 ifelse(patsubst(<<$1>>, <<[^ ]>>, <<>>), <<>>,
477 <<test -z "<<$>>CONFIG_HEADERS" || echo timestamp > patsubst(<<$1>>, <<^\([^:]*/\)?.*>>, <<\1>>)stamp-h<<>>dnl>>,
479 for am_file in <<$1>>; do
480 case " <<$>>CONFIG_HEADERS " in
481 *" <<$>>am_file "*<<)>>
482 echo timestamp > `echo <<$>>am_file | sed -e 's%:.*%%' -e 's%[^/]*$%%'`stamp-h$am_indx
485 am_indx=`expr "<<$>>am_indx" + 1`