1 AC_DEFUN([AC_COMPILE_CHECK_SIZEOF],
2 [changequote(<<, >>)dnl
3 dnl The name to #define.
4 define(<<AC_TYPE_NAME>>, translit(sizeof_$1, [a-z *], [A-Z_P]))dnl
5 dnl The cache variable name.
6 define(<<AC_CV_NAME>>, translit(ac_cv_sizeof_$1, [ *], [_p]))dnl
8 AC_MSG_CHECKING(size of $1)
9 AC_CACHE_VAL(AC_CV_NAME,
10 [for ac_size in 4 8 1 2 16 12 $2 ; do # List sizes in rough order of prevalence.
11 AC_TRY_COMPILE([#include "confdefs.h"
12 #include <sys/types.h>
14 ], [switch (0) case 0: case (sizeof ($1) == $ac_size):;], AC_CV_NAME=$ac_size)
15 if test x$AC_CV_NAME != x ; then break; fi
18 if test x$AC_CV_NAME = x ; then
19 AC_MSG_ERROR([cannot determine a size for $1])
21 AC_MSG_RESULT($AC_CV_NAME)
22 AC_DEFINE_UNQUOTED(AC_TYPE_NAME, $AC_CV_NAME, [The number of bytes in type $1])
23 undefine([AC_TYPE_NAME])dnl
24 undefine([AC_CV_NAME])dnl
27 AC_DEFUN(LIBGCJ_CONFIGURE,
29 dnl Default to --enable-multilib
30 AC_ARG_ENABLE(multilib,
31 [ --enable-multilib build many library versions (default)],
32 [case "${enableval}" in
35 *) AC_MSG_ERROR(bad value ${enableval} for multilib option) ;;
36 esac], [multilib=yes])dnl
38 dnl We may get other options which we don't document:
39 dnl --with-target-subdir, --with-multisrctop, --with-multisubdir
41 # When building with srcdir == objdir, links to the source files will
42 # be created in directories within the target_subdir. We have to
43 # adjust toplevel_srcdir accordingly, so that configure finds
44 # install-sh and other auxiliary files that live in the top-level
46 if test "${srcdir}" = "."; then
47 if test -z "${with_target_subdir}"; then
50 if test "${with_target_subdir}" != "."; then
51 toprel="${with_multisrctop}../.."
53 toprel="${with_multisrctop}.."
60 libgcj_basedir=$srcdir/$toprel/$1/libjava
61 AC_SUBST(libgcj_basedir)
63 AC_CONFIG_AUX_DIR(${srcdir}/$toprel)
65 # This overrides the previous occurrence for automake, but not for
66 # autoconf, which is exactly what we want.
70 # This works around an automake problem.
71 mkinstalldirs="`cd $ac_aux_dir && pwd`/mkinstalldirs"
72 AC_SUBST(mkinstalldirs)
76 dnl This shouldn't be needed, as long as top-level dependencies are
77 dnl defined correctly and shared-library paths are set up so that
78 dnl execution tests succeed. FIXME.
79 define([AC_PROG_CC_WORKS],[])
80 define([AC_PROG_CXX_WORKS],[])
85 dnl version is pulled out to make it a bit easier to change using sed.
87 dnl Still use "libjava" here to placate dejagnu.
88 AM_INIT_AUTOMAKE(libjava, $version)
90 # AC_CHECK_TOOL does AC_REQUIRE (AC_CANONICAL_BUILD). If we don't
91 # run it explicitly here, it will be run implicitly before
92 # LIBGCJ_CONFIGURE, which doesn't work because that means that it will
93 # be run before AC_CANONICAL_HOST.
98 AC_CHECK_TOOL(RANLIB, ranlib, :)
104 # We need AC_EXEEXT to keep automake happy in cygnus mode. However,
105 # at least currently, we never actually build a program, so we never
106 # need to use $(EXEEXT). Moreover, the test for EXEEXT normally
107 # fails, because we are probably configuring with a cross compiler
108 # which cant create executables. So we include AC_EXEEXT to keep
109 # automake happy, but we don't execute it, since we don't care about
112 # autoconf 2.50 runs AC_EXEEXT by default, and the macro expands
113 # to nothing, so nothing would remain between `then' and `fi' if it
114 # were not for the `:' below.
119 # configure.host sets the following important variables
120 # libgcj_cflags - host specific C compiler flags
121 # libgcj_cxxflags - host specific C++ compiler flags
122 # libgcj_javaflags - host specific Java compiler flags
128 . [$]{srcdir}/configure.host
130 LIBGCJ_CFLAGS="[$]{libgcj_cflags}"
131 LIBGCJ_CXXFLAGS="[$]{libgcj_cxxflags}"
132 LIBGCJ_JAVAFLAGS="[$]{libgcj_javaflags}"
133 AC_SUBST(LIBGCJ_CFLAGS)
134 AC_SUBST(LIBGCJ_CXXFLAGS)
135 AC_SUBST(LIBGCJ_JAVAFLAGS)
138 sinclude(../libtool.m4)
139 dnl The lines below arrange for aclocal not to bring libtool.m4
140 dnl AM_PROG_LIBTOOL into aclocal.m4, while still arranging for automake
141 dnl to add a definition of LIBTOOL to Makefile.in.
143 AC_DEFUN([AM_PROG_LIBTOOL],)
144 AC_DEFUN([AC_LIBTOOL_DLOPEN],)
145 AC_DEFUN([AC_LIBLTDL_CONVENIENCE],)
146 AC_DEFUN([LT_AC_PROG_GCJ],)
153 dnl From Bruno Haible.
157 dnl Some systems have iconv in libc, some have it in libiconv (OSF/1 and
158 dnl those with the standalone portable GNU libiconv installed).
160 am_cv_lib_iconv_ldpath=
161 AC_ARG_WITH([libiconv-prefix],
162 [ --with-libiconv-prefix=DIR search for libiconv in DIR/include and DIR/lib], [
163 for dir in `echo "$withval" | tr : ' '`; do
164 if test -d $dir/include; then CPPFLAGS="$CPPFLAGS -I$dir/include"; fi
165 if test -d $dir/lib; then am_cv_lib_iconv_ldpath="-L$dir/lib"; fi
169 AC_CACHE_CHECK(for iconv, am_cv_func_iconv, [
170 am_cv_func_iconv="no, consider installing GNU libiconv"
172 AC_TRY_LINK([#include <stdlib.h>
174 [iconv_t cd = iconv_open("","");
175 iconv(cd,NULL,NULL,NULL,NULL);
177 am_cv_func_iconv=yes)
178 if test "$am_cv_func_iconv" != yes; then
180 LIBS="$LIBS $am_cv_libiconv_ldpath -liconv"
181 AC_TRY_LINK([#include <stdlib.h>
183 [iconv_t cd = iconv_open("","");
184 iconv(cd,NULL,NULL,NULL,NULL);
187 am_cv_func_iconv=yes)
191 if test "$am_cv_func_iconv" = yes; then
192 AC_DEFINE(HAVE_ICONV, 1, [Define if you have the iconv() function.])
193 AC_MSG_CHECKING([for iconv declaration])
194 AC_CACHE_VAL(am_cv_proto_iconv, [
202 #if defined(__STDC__) || defined(__cplusplus)
203 size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);
207 ], [], am_cv_proto_iconv_arg1="", am_cv_proto_iconv_arg1="const")
208 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);"])
209 am_cv_proto_iconv=`echo "[$]am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'`
210 AC_MSG_RESULT([$]{ac_t:-
211 }[$]am_cv_proto_iconv)
212 AC_DEFINE_UNQUOTED(ICONV_CONST, $am_cv_proto_iconv_arg1,
213 [Define as const if the declaration of iconv() needs const.])
216 if test "$am_cv_lib_iconv" = yes; then
217 LIBICONV="$am_cv_lib_iconv_ldpath -liconv"
222 # Check whether LC_MESSAGES is available in <locale.h>.
223 # Ulrich Drepper <drepper@cygnus.com>, 1995.
225 # This file can be copied and used freely without restrictions. It can
226 # be used in projects which are not available under the GNU General Public
227 # License or the GNU Library General Public License but which still want
228 # to provide support for the GNU gettext functionality.
229 # Please note that the actual code of the GNU gettext library is covered
230 # by the GNU Library General Public License, and the rest of the GNU
231 # gettext package package is covered by the GNU General Public License.
232 # They are *not* in the public domain.
236 AC_DEFUN([AM_LC_MESSAGES],
237 [if test $ac_cv_header_locale_h = yes; then
238 AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES,
239 [AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
240 am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)])
241 if test $am_cv_val_LC_MESSAGES = yes; then
242 AC_DEFINE(HAVE_LC_MESSAGES, 1,
243 [Define if your <locale.h> file defines LC_MESSAGES.])