2002-02-19 matthew green <mrg@eterna.com.au>
[official-gcc.git] / libjava / aclocal.m4
blob41d516fe01b6355214f9a2b3b233143f4a3b30b0
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 AC_DEFUN([AC_COMPILE_CHECK_SIZEOF],
14 [changequote(<<, >>)dnl
15 dnl The name to #define.
16 define(<<AC_TYPE_NAME>>, translit(sizeof_$1, [a-z *], [A-Z_P]))dnl
17 dnl The cache variable name.
18 define(<<AC_CV_NAME>>, translit(ac_cv_sizeof_$1, [ *], [_p]))dnl
19 changequote([, ])dnl
20 AC_MSG_CHECKING(size of $1)
21 AC_CACHE_VAL(AC_CV_NAME,
22 [for ac_size in 4 8 1 2 16 12 $2 ; do # List sizes in rough order of prevalence.
23   AC_TRY_COMPILE([#include "confdefs.h"
24 #include <sys/types.h>
26 ], [switch (0) case 0: case (sizeof ($1) == $ac_size):;], AC_CV_NAME=$ac_size)
27   if test x$AC_CV_NAME != x ; then break; fi
28 done
30 if test x$AC_CV_NAME = x ; then
31   AC_MSG_ERROR([cannot determine a size for $1])
33 AC_MSG_RESULT($AC_CV_NAME)
34 AC_DEFINE_UNQUOTED(AC_TYPE_NAME, $AC_CV_NAME, [The number of bytes in type $1])
35 undefine([AC_TYPE_NAME])dnl
36 undefine([AC_CV_NAME])dnl
39 AC_DEFUN(LIBGCJ_CONFIGURE,
41 dnl Default to --enable-multilib
42 AC_ARG_ENABLE(multilib,
43 [  --enable-multilib       build many library versions (default)],
44 [case "${enableval}" in
45   yes) multilib=yes ;;
46   no)  multilib=no ;;
47   *)   AC_MSG_ERROR(bad value ${enableval} for multilib option) ;;
48  esac], [multilib=yes])dnl
50 dnl We may get other options which we don't document:
51 dnl --with-target-subdir, --with-multisrctop, --with-multisubdir
53 # When building with srcdir == objdir, links to the source files will
54 # be created in directories within the target_subdir.  We have to
55 # adjust toplevel_srcdir accordingly, so that configure finds
56 # install-sh and other auxiliary files that live in the top-level
57 # source directory.
58 if test "${srcdir}" = "."; then
59   if test -z "${with_target_subdir}"; then
60     toprel=".."
61   else
62     if test "${with_target_subdir}" != "."; then
63       toprel="${with_multisrctop}../.."
64     else
65       toprel="${with_multisrctop}.."
66     fi
67   fi
68 else
69   toprel=".."
72 libgcj_basedir=$srcdir/$toprel/$1/libjava
73 AC_SUBST(libgcj_basedir)
75 AC_CONFIG_AUX_DIR(${srcdir}/$toprel)
76 if :; then :; else
77   # This overrides the previous occurrence for automake, but not for
78   # autoconf, which is exactly what we want.
79   AC_CONFIG_AUX_DIR(..)
82 # This works around an automake problem.
83 mkinstalldirs="`cd $ac_aux_dir && pwd`/mkinstalldirs"
84 AC_SUBST(mkinstalldirs)
86 AC_CANONICAL_SYSTEM
88 dnl This shouldn't be needed, as long as top-level dependencies are
89 dnl defined correctly and shared-library paths are set up so that
90 dnl execution tests succeed.  FIXME.
91 define([AC_PROG_CC_WORKS],[])
92 define([AC_PROG_CXX_WORKS],[])
94 AC_PROG_CC
95 AC_PROG_CXX
97 dnl version is pulled out to make it a bit easier to change using sed.
98 version=0.0.7
99 dnl Still use "libjava" here to placate dejagnu.
100 AM_INIT_AUTOMAKE(libjava, $version)
102 # AC_CHECK_TOOL does AC_REQUIRE (AC_CANONICAL_BUILD).  If we don't
103 # run it explicitly here, it will be run implicitly before
104 # LIBGCJ_CONFIGURE, which doesn't work because that means that it will
105 # be run before AC_CANONICAL_HOST.
106 AC_CANONICAL_BUILD
108 AC_CHECK_TOOL(AS, as)
109 AC_CHECK_TOOL(AR, ar)
110 AC_CHECK_TOOL(RANLIB, ranlib, :)
112 AC_PROG_INSTALL
114 AM_MAINTAINER_MODE
116 # We need AC_EXEEXT to keep automake happy in cygnus mode.  However,
117 # at least currently, we never actually build a program, so we never
118 # need to use $(EXEEXT).  Moreover, the test for EXEEXT normally
119 # fails, because we are probably configuring with a cross compiler
120 # which cant create executables.  So we include AC_EXEEXT to keep
121 # automake happy, but we don't execute it, since we don't care about
122 # the result.
123 if false; then
124   # autoconf 2.50 runs AC_EXEEXT by default, and the macro expands
125   # to nothing, so nothing would remain between `then' and `fi' if it
126   # were not for the `:' below.
127   :
128   AC_EXEEXT
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
136 libgcj_cflags=
137 libgcj_cxxflags=
138 libgcj_javaflags=
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)
148 ])dnl
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.
154 ifelse(yes,no,[
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],)
159 AC_SUBST(GCJ)
160 AC_SUBST(LIBTOOL)
163 #serial AM2
165 dnl From Bruno Haible.
167 AC_DEFUN([AM_ICONV],
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
178     done
179    ])
181   AC_CACHE_CHECK(for iconv, am_cv_func_iconv, [
182     am_cv_func_iconv="no, consider installing GNU libiconv"
183     am_cv_lib_iconv=no
184     AC_TRY_LINK([#include <stdlib.h>
185 #include <iconv.h>],
186       [iconv_t cd = iconv_open("","");
187        iconv(cd,NULL,NULL,NULL,NULL);
188        iconv_close(cd);],
189       am_cv_func_iconv=yes)
190     if test "$am_cv_func_iconv" != yes; then
191       am_save_LIBS="$LIBS"
192       LIBS="$LIBS $am_cv_libiconv_ldpath -liconv"
193       AC_TRY_LINK([#include <stdlib.h>
194 #include <iconv.h>],
195         [iconv_t cd = iconv_open("","");
196          iconv(cd,NULL,NULL,NULL,NULL);
197          iconv_close(cd);],
198         am_cv_lib_iconv=yes
199         am_cv_func_iconv=yes)
200       LIBS="$am_save_LIBS"
201     fi
202   ])
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, [
207       AC_TRY_COMPILE([
208 #include <stdlib.h>
209 #include <iconv.h>
210 extern
211 #ifdef __cplusplus
213 #endif
214 #if defined(__STDC__) || defined(__cplusplus)
215 size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);
216 #else
217 size_t iconv();
218 #endif
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.])
226   fi
227   LIBICONV=
228   if test "$am_cv_lib_iconv" = yes; then
229     LIBICONV="$am_cv_lib_iconv_ldpath -liconv"
230   fi
231   AC_SUBST(LIBICONV)
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.
246 # serial 2
248 AC_DEFUN([AM_LC_MESSAGES],
249   [if test $ac_cv_header_locale_h = yes; then
250     AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES,
251       [AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
252        am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)])
253     if test $am_cv_val_LC_MESSAGES = yes; then
254       AC_DEFINE(HAVE_LC_MESSAGES, 1,
255         [Define if your <locale.h> file defines LC_MESSAGES.])
256     fi
257   fi])
259 # Do all the work for Automake.  This macro actually does too much --
260 # some checks are only needed if your package does certain things.
261 # But this isn't really a big deal.
263 # serial 1
265 dnl Usage:
266 dnl AM_INIT_AUTOMAKE(package,version, [no-define])
268 AC_DEFUN([AM_INIT_AUTOMAKE],
269 [AC_REQUIRE([AC_PROG_INSTALL])
270 PACKAGE=[$1]
271 AC_SUBST(PACKAGE)
272 VERSION=[$2]
273 AC_SUBST(VERSION)
274 dnl test to see if srcdir already configured
275 if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
276   AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
278 ifelse([$3],,
279 AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
280 AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package]))
281 AC_REQUIRE([AM_SANITY_CHECK])
282 AC_REQUIRE([AC_ARG_PROGRAM])
283 dnl FIXME This is truly gross.
284 missing_dir=`cd $ac_aux_dir && pwd`
285 AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir)
286 AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
287 AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir)
288 AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
289 AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir)
290 AC_REQUIRE([AC_PROG_MAKE_SET])])
293 # Check to make sure that the build environment is sane.
296 AC_DEFUN([AM_SANITY_CHECK],
297 [AC_MSG_CHECKING([whether build environment is sane])
298 # Just in case
299 sleep 1
300 echo timestamp > conftestfile
301 # Do `set' in a subshell so we don't clobber the current shell's
302 # arguments.  Must try -L first in case configure is actually a
303 # symlink; some systems play weird games with the mod time of symlinks
304 # (eg FreeBSD returns the mod time of the symlink's containing
305 # directory).
306 if (
307    set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
308    if test "[$]*" = "X"; then
309       # -L didn't work.
310       set X `ls -t $srcdir/configure conftestfile`
311    fi
312    if test "[$]*" != "X $srcdir/configure conftestfile" \
313       && test "[$]*" != "X conftestfile $srcdir/configure"; then
315       # If neither matched, then we have a broken ls.  This can happen
316       # if, for instance, CONFIG_SHELL is bash and it inherits a
317       # broken ls alias from the environment.  This has actually
318       # happened.  Such a system could not be considered "sane".
319       AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
320 alias in your environment])
321    fi
323    test "[$]2" = conftestfile
324    )
325 then
326    # Ok.
327    :
328 else
329    AC_MSG_ERROR([newly created file is older than distributed files!
330 Check your system clock])
332 rm -f conftest*
333 AC_MSG_RESULT(yes)])
335 dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY)
336 dnl The program must properly implement --version.
337 AC_DEFUN([AM_MISSING_PROG],
338 [AC_MSG_CHECKING(for working $2)
339 # Run test in a subshell; some versions of sh will print an error if
340 # an executable is not found, even if stderr is redirected.
341 # Redirect stdin to placate older versions of autoconf.  Sigh.
342 if ($2 --version) < /dev/null > /dev/null 2>&1; then
343    $1=$2
344    AC_MSG_RESULT(found)
345 else
346    $1="$3/missing $2"
347    AC_MSG_RESULT(missing)
349 AC_SUBST($1)])
351 # Add --enable-maintainer-mode option to configure.
352 # From Jim Meyering
354 # serial 1
356 AC_DEFUN([AM_MAINTAINER_MODE],
357 [AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
358   dnl maintainer-mode is disabled by default
359   AC_ARG_ENABLE(maintainer-mode,
360 [  --enable-maintainer-mode enable make rules and dependencies not useful
361                           (and sometimes confusing) to the casual installer],
362       USE_MAINTAINER_MODE=$enableval,
363       USE_MAINTAINER_MODE=no)
364   AC_MSG_RESULT($USE_MAINTAINER_MODE)
365   AM_CONDITIONAL(MAINTAINER_MODE, test $USE_MAINTAINER_MODE = yes)
366   MAINT=$MAINTAINER_MODE_TRUE
367   AC_SUBST(MAINT)dnl
371 # Define a conditional.
373 AC_DEFUN([AM_CONDITIONAL],
374 [AC_SUBST($1_TRUE)
375 AC_SUBST($1_FALSE)
376 if $2; then
377   $1_TRUE=
378   $1_FALSE='#'
379 else
380   $1_TRUE='#'
381   $1_FALSE=
382 fi])
384 # Like AC_CONFIG_HEADER, but automatically create stamp file.
386 AC_DEFUN([AM_CONFIG_HEADER],
387 [AC_PREREQ([2.12])
388 AC_CONFIG_HEADER([$1])
389 dnl When config.status generates a header, we must update the stamp-h file.
390 dnl This file resides in the same directory as the config header
391 dnl that is generated.  We must strip everything past the first ":",
392 dnl and everything past the last "/".
393 AC_OUTPUT_COMMANDS(changequote(<<,>>)dnl
394 ifelse(patsubst(<<$1>>, <<[^ ]>>, <<>>), <<>>,
395 <<test -z "<<$>>CONFIG_HEADERS" || echo timestamp > patsubst(<<$1>>, <<^\([^:]*/\)?.*>>, <<\1>>)stamp-h<<>>dnl>>,
396 <<am_indx=1
397 for am_file in <<$1>>; do
398   case " <<$>>CONFIG_HEADERS " in
399   *" <<$>>am_file "*<<)>>
400     echo timestamp > `echo <<$>>am_file | sed -e 's%:.*%%' -e 's%[^/]*$%%'`stamp-h$am_indx
401     ;;
402   esac
403   am_indx=`expr "<<$>>am_indx" + 1`
404 done<<>>dnl>>)
405 changequote([,]))])