1 AC_DEFUN(LIBGCJ_CONFIGURE,
3 dnl Default to --enable-multilib
4 AC_ARG_ENABLE(multilib,
5 [ --enable-multilib build many library versions (default)],
6 [case "${enableval}" in
9 *) AC_MSG_ERROR(bad value ${enableval} for multilib option) ;;
10 esac], [multilib=yes])dnl
12 dnl We may get other options which we dont document:
13 dnl --with-target-subdir, --with-multisrctop, --with-multisubdir
15 # When building with srcdir == objdir, links to the source files will
16 # be created in directories within the target_subdir. We have to
17 # adjust toplevel_srcdir accordingly, so that configure finds
18 # install-sh and other auxiliary files that live in the top-level
20 if test "${srcdir}" = "."; then
21 if test -z "${with_target_subdir}"; then
24 if test "${with_target_subdir}" != "."; then
25 toprel="${with_multisrctop}../.."
27 toprel="${with_multisrctop}.."
34 libgcj_basedir=$srcdir/$toprel/$1/libjava
35 AC_SUBST(libgcj_basedir)
37 AC_CONFIG_AUX_DIR(${srcdir}/$toprel)
39 # This overrides the previous occurrence for automake, but not for
40 # autoconf, which is exactly what we want.
44 # This works around an automake problem.
45 mkinstalldirs="`cd $ac_aux_dir && pwd`/mkinstalldirs"
46 AC_SUBST(mkinstalldirs)
50 dnl This shouldn't be needed, as long as top-level dependencies are
51 dnl defined correctly and shared-library paths are set up so that
52 dnl execution tests succeed. FIXME.
53 define([AC_PROG_CC_WORKS],[])
54 define([AC_PROG_CXX_WORKS],[])
59 dnl version is pulled out to make it a bit easier to change using sed.
61 dnl Still use "libjava" here to placate dejagnu.
62 AM_INIT_AUTOMAKE(libjava, $version)
64 # AC_CHECK_TOOL does AC_REQUIRE (AC_CANONICAL_BUILD). If we dont
65 # run it explicitly here, it will be run implicitly before
66 # LIBGCJ_CONFIGURE, which doesn't work because that means that it will
67 # be run before AC_CANONICAL_HOST.
72 AC_CHECK_TOOL(RANLIB, ranlib, :)
78 # We need AC_EXEEXT to keep automake happy in cygnus mode. However,
79 # at least currently, we never actually build a program, so we never
80 # need to use $(EXEEXT). Moreover, the test for EXEEXT normally
81 # fails, because we are probably configuring with a cross compiler
82 # which cant create executables. So we include AC_EXEEXT to keep
83 # automake happy, but we dont execute it, since we dont care about
86 # autoconf 2.50 runs AC_EXEEXT by default, and the macro expands
87 # to nothing, so nothing would remain between `then' and `fi' if it
88 # were not for the `:' below.
93 # configure.host sets the following important variables
94 # libgcj_cflags - host specific C compiler flags
95 # libgcj_cxxflags - host specific C++ compiler flags
96 # libgcj_javaflags - host specific Java compiler flags
102 . [$]{srcdir}/configure.host
104 LIBGCJ_CFLAGS="[$]{libgcj_cflags}"
105 LIBGCJ_CXXFLAGS="[$]{libgcj_cxxflags}"
106 LIBGCJ_JAVAFLAGS="[$]{libgcj_javaflags}"
107 AC_SUBST(LIBGCJ_CFLAGS)
108 AC_SUBST(LIBGCJ_CXXFLAGS)
109 AC_SUBST(LIBGCJ_JAVAFLAGS)
112 sinclude(../libtool.m4)
113 dnl The lines below arrange for aclocal not to bring libtool.m4
114 dnl AM_PROG_LIBTOOL into aclocal.m4, while still arranging for automake
115 dnl to add a definition of LIBTOOL to Makefile.in.
117 AC_DEFUN([AM_PROG_LIBTOOL],)
118 AC_DEFUN([AC_LIBTOOL_DLOPEN],)
119 AC_DEFUN([AC_LIBLTDL_CONVENIENCE],)
120 AC_DEFUN([LT_AC_PROG_GCJ],)
127 dnl From Bruno Haible.
131 dnl Some systems have iconv in libc, some have it in libiconv (OSF/1 and
132 dnl those with the standalone portable GNU libiconv installed).
134 AC_ARG_WITH([libiconv-prefix],
135 [ --with-libiconv-prefix=DIR search for libiconv in DIR/include and DIR/lib], [
136 for dir in `echo "$withval" | tr : ' '`; do
137 if test -d $dir/include; then CPPFLAGS="$CPPFLAGS -I$dir/include"; fi
138 if test -d $dir/lib; then LDFLAGS="$LDFLAGS -L$dir/lib"; fi
142 AC_CACHE_CHECK(for iconv, am_cv_func_iconv, [
143 am_cv_func_iconv="no, consider installing GNU libiconv"
145 AC_TRY_LINK([#include <stdlib.h>
147 [iconv_t cd = iconv_open("","");
148 iconv(cd,NULL,NULL,NULL,NULL);
150 am_cv_func_iconv=yes)
151 if test "$am_cv_func_iconv" != yes; then
154 AC_TRY_LINK([#include <stdlib.h>
156 [iconv_t cd = iconv_open("","");
157 iconv(cd,NULL,NULL,NULL,NULL);
160 am_cv_func_iconv=yes)
164 if test "$am_cv_func_iconv" = yes; then
165 AC_DEFINE(HAVE_ICONV, 1, [Define if you have the iconv() function.])
166 AC_MSG_CHECKING([for iconv declaration])
167 AC_CACHE_VAL(am_cv_proto_iconv, [
175 #if defined(__STDC__) || defined(__cplusplus)
176 size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);
180 ], [], am_cv_proto_iconv_arg1="", am_cv_proto_iconv_arg1="const")
181 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);"])
182 am_cv_proto_iconv=`echo "[$]am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'`
183 AC_MSG_RESULT([$]{ac_t:-
184 }[$]am_cv_proto_iconv)
185 AC_DEFINE_UNQUOTED(ICONV_CONST, $am_cv_proto_iconv_arg1,
186 [Define as const if the declaration of iconv() needs const.])
189 if test "$am_cv_lib_iconv" = yes; then