1 sinclude(../config/accross.m4)
3 AC_DEFUN(LIBGCJ_CONFIGURE,
5 dnl Default to --enable-multilib
6 AC_ARG_ENABLE(multilib,
7 [ --enable-multilib build many library versions (default)],
8 [case "${enableval}" in
11 *) AC_MSG_ERROR(bad value ${enableval} for multilib option) ;;
12 esac], [multilib=yes])dnl
14 dnl We may get other options which we don't document:
15 dnl --with-target-subdir, --with-multisrctop, --with-multisubdir
17 # When building with srcdir == objdir, links to the source files will
18 # be created in directories within the target_subdir. We have to
19 # adjust toplevel_srcdir accordingly, so that configure finds
20 # install-sh and other auxiliary files that live in the top-level
22 if test "${srcdir}" = "."; then
23 if test -z "${with_target_subdir}"; then
26 if test "${with_target_subdir}" != "."; then
27 toprel="${with_multisrctop}../.."
29 toprel="${with_multisrctop}.."
36 libgcj_basedir=$srcdir/$toprel/$1/libjava
37 AC_SUBST(libgcj_basedir)
39 AC_CONFIG_AUX_DIR(${srcdir}/$toprel)
41 # This overrides the previous occurrence for automake, but not for
42 # autoconf, which is exactly what we want.
46 # This works around an automake problem.
47 mkinstalldirs="`cd $ac_aux_dir && ${PWDCMD-pwd}`/mkinstalldirs"
48 AC_SUBST(mkinstalldirs)
52 dnl This shouldn't be needed, as long as top-level dependencies are
53 dnl defined correctly and shared-library paths are set up so that
54 dnl execution tests succeed. FIXME.
55 define([AC_PROG_CC_WORKS],[])
56 define([AC_PROG_CXX_WORKS],[])
60 # We use the libstdc++-v3 version of LIB_AC_PROG_CXX, but use
61 # glibjava_CXX instead of glibcpp_CXX. That's because we're passed a
62 # different definition of CXX than other directories, since we don't
63 # depend on libstdc++-v3 having already been built.
64 AC_DEFUN(LIB_AC_PROG_CXX,
65 [AC_BEFORE([$0], [AC_PROG_CXXCPP])dnl
66 dnl Fool anybody using AC_PROG_CXX.
67 AC_PROVIDE([AC_PROG_CXX])
68 # Use glibjava_CXX so that we do not cause CXX to be cached with the
69 # flags that come in CXX while configuring libjava. They're different
70 # from those used for all other target libraries. If CXX is set in
71 # the environment, respect that here.
73 AC_CHECK_PROGS(glibjava_CXX, $CCC c++ g++ gcc CC cxx cc++, gcc)
76 test -z "$glibjava_CXX" && AC_MSG_ERROR([no acceptable c++ found in \$PATH])
80 if test $ac_cv_prog_gxx = yes; then
82 dnl Check whether -g works, even if CXXFLAGS is set, in case the package
83 dnl plays around with CXXFLAGS (such as to build both debugging and
84 dnl normal versions of a library), tasteless as that idea is.
85 ac_test_CXXFLAGS="${CXXFLAGS+set}"
86 ac_save_CXXFLAGS="$CXXFLAGS"
89 if test "$ac_test_CXXFLAGS" = set; then
90 CXXFLAGS="$ac_save_CXXFLAGS"
91 elif test $ac_cv_prog_cxx_g = yes; then
98 test "${CXXFLAGS+set}" = set || CXXFLAGS="-g"
104 dnl version is pulled out to make it a bit easier to change using sed.
106 dnl Still use "libjava" here to placate dejagnu.
107 AM_INIT_AUTOMAKE(libjava, $version)
109 # AC_CHECK_TOOL does AC_REQUIRE (AC_CANONICAL_BUILD). If we don't
110 # run it explicitly here, it will be run implicitly before
111 # LIBGCJ_CONFIGURE, which doesn't work because that means that it will
112 # be run before AC_CANONICAL_HOST.
115 AC_CHECK_TOOL(AS, as)
116 AC_CHECK_TOOL(AR, ar)
117 AC_CHECK_TOOL(RANLIB, ranlib, :)
125 # configure.host sets the following important variables
126 # libgcj_cflags - host specific C compiler flags
127 # libgcj_cxxflags - host specific C++ compiler flags
128 # libgcj_javaflags - host specific Java compiler flags
134 . [$]{srcdir}/configure.host
136 LIBGCJ_CFLAGS="[$]{libgcj_cflags}"
137 LIBGCJ_CXXFLAGS="[$]{libgcj_cxxflags}"
138 LIBGCJ_JAVAFLAGS="[$]{libgcj_javaflags}"
139 AC_SUBST(LIBGCJ_CFLAGS)
140 AC_SUBST(LIBGCJ_CXXFLAGS)
141 AC_SUBST(LIBGCJ_JAVAFLAGS)
144 sinclude(../libtool.m4)
145 dnl The lines below arrange for aclocal not to bring libtool.m4
146 dnl AM_PROG_LIBTOOL into aclocal.m4, while still arranging for automake
147 dnl to add a definition of LIBTOOL to Makefile.in.
149 AC_DEFUN([AM_PROG_LIBTOOL],)
150 AC_DEFUN([AC_LIBTOOL_DLOPEN],)
151 AC_DEFUN([AC_LIBLTDL_CONVENIENCE],)
152 AC_DEFUN([LT_AC_PROG_GCJ],)
159 dnl From Bruno Haible.
163 dnl Some systems have iconv in libc, some have it in libiconv (OSF/1 and
164 dnl those with the standalone portable GNU libiconv installed).
166 am_cv_lib_iconv_ldpath=
167 AC_ARG_WITH([libiconv-prefix],
168 [ --with-libiconv-prefix=DIR search for libiconv in DIR/include and DIR/lib], [
169 for dir in `echo "$withval" | tr : ' '`; do
170 if test -d $dir/include; then CPPFLAGS="$CPPFLAGS -I$dir/include"; fi
171 if test -d $dir/lib; then am_cv_lib_iconv_ldpath="-L$dir/lib"; fi
175 AC_CACHE_CHECK(for iconv, am_cv_func_iconv, [
176 am_cv_func_iconv="no, consider installing GNU libiconv"
178 AC_TRY_LINK([#include <stdlib.h>
180 [iconv_t cd = iconv_open("","");
181 iconv(cd,NULL,NULL,NULL,NULL);
183 am_cv_func_iconv=yes)
184 if test "$am_cv_func_iconv" != yes; then
186 LIBS="$LIBS $am_cv_libiconv_ldpath -liconv"
187 AC_TRY_LINK([#include <stdlib.h>
189 [iconv_t cd = iconv_open("","");
190 iconv(cd,NULL,NULL,NULL,NULL);
193 am_cv_func_iconv=yes)
197 if test "$am_cv_func_iconv" = yes; then
198 AC_DEFINE(HAVE_ICONV, 1, [Define if you have the iconv() function.])
199 AC_MSG_CHECKING([for iconv declaration])
200 AC_CACHE_VAL(am_cv_proto_iconv, [
208 #if defined(__STDC__) || defined(__cplusplus)
209 size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);
213 ], [], am_cv_proto_iconv_arg1="", am_cv_proto_iconv_arg1="const")
214 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);"])
215 am_cv_proto_iconv=`echo "[$]am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'`
216 AC_MSG_RESULT([$]{ac_t:-
217 }[$]am_cv_proto_iconv)
218 AC_DEFINE_UNQUOTED(ICONV_CONST, $am_cv_proto_iconv_arg1,
219 [Define as const if the declaration of iconv() needs const.])
222 if test "$am_cv_lib_iconv" = yes; then
223 LIBICONV="$am_cv_lib_iconv_ldpath -liconv"
228 # Check whether LC_MESSAGES is available in <locale.h>.
229 # Ulrich Drepper <drepper@cygnus.com>, 1995.
231 # This file can be copied and used freely without restrictions. It can
232 # be used in projects which are not available under the GNU General Public
233 # License or the GNU Library General Public License but which still want
234 # to provide support for the GNU gettext functionality.
235 # Please note that the actual code of the GNU gettext library is covered
236 # by the GNU Library General Public License, and the rest of the GNU
237 # gettext package package is covered by the GNU General Public License.
238 # They are *not* in the public domain.
242 AC_DEFUN([AM_LC_MESSAGES],
243 [if test $ac_cv_header_locale_h = yes; then
244 AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES,
245 [AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
246 am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)])
247 if test $am_cv_val_LC_MESSAGES = yes; then
248 AC_DEFINE(HAVE_LC_MESSAGES, 1,
249 [Define if your <locale.h> file defines LC_MESSAGES.])
253 AC_DEFUN([CHECK_FOR_BROKEN_MINGW_LD],
255 AC_MSG_CHECKING(whether 'ld' is at least 2.13)
256 LD_PROG=`$CC --print-prog-name=ld`
257 LD_VERSION=`$LD_PROG --version`
258 LD_VERSION_MAJOR=`echo "$LD_VERSION" | head -1 | cut -d '.' -f 1 | cut -d ' ' -f 4`
259 LD_VERSION_MINOR=`echo "$LD_VERSION" | head -1 | cut -d '.' -f 2`
260 if expr "$LD_VERSION_MAJOR" \> 2 > /dev/null; then
263 if expr "$LD_VERSION_MAJOR" = 2 && expr "$LD_VERSION_MINOR" \>= 13 > /dev/null; then
267 if test "x$LD_OK" != x; then
268 AC_MSG_RESULT([yes; major=$LD_VERSION_MAJOR, minor=$LD_VERSION_MINOR])
270 AC_MSG_RESULT([no; major=$LD_VERSION_MAJOR, minor=$LD_VERSION_MINOR])
271 AC_MSG_WARN([ld <2.13 detected; enabling JV_LINKER_CANNOT_8BYTE_ALIGN_STATICS hack...])
272 AC_DEFINE(JV_LINKER_CANNOT_8BYTE_ALIGN_STATICS, 1,
273 [Indicate that linker is not able to 8-byte align static data])
275 ])# CHECK_FOR_BROKEN_MINGW_LD