]> gcc.gnu.org Git - gcc.git/blame - libjava/acinclude.m4
re PR java/5080 (gcc/java/jcf-parse.c:908: `LC_CTYPE' undeclared (first use in this...
[gcc.git] / libjava / acinclude.m4
CommitLineData
ee9dd372
TT
1AC_DEFUN(LIBGCJ_CONFIGURE,
2[
3dnl Default to --enable-multilib
4AC_ARG_ENABLE(multilib,
7941ceab 5[ --enable-multilib build many library versions (default)],
ee9dd372
TT
6[case "${enableval}" in
7 yes) multilib=yes ;;
8 no) multilib=no ;;
9 *) AC_MSG_ERROR(bad value ${enableval} for multilib option) ;;
10 esac], [multilib=yes])dnl
11
18e1f2bd 12dnl We may get other options which we don't document:
ee9dd372
TT
13dnl --with-target-subdir, --with-multisrctop, --with-multisubdir
14
fe3dac3d
TT
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
19# source directory.
20if test "${srcdir}" = "."; then
21 if test -z "${with_target_subdir}"; then
22 toprel=".."
ee9dd372 23 else
fe3dac3d
TT
24 if test "${with_target_subdir}" != "."; then
25 toprel="${with_multisrctop}../.."
26 else
27 toprel="${with_multisrctop}.."
28 fi
ee9dd372
TT
29 fi
30else
fe3dac3d 31 toprel=".."
ee9dd372 32fi
fe3dac3d
TT
33
34libgcj_basedir=$srcdir/$toprel/$1/libjava
ee9dd372 35AC_SUBST(libgcj_basedir)
fe3dac3d
TT
36
37AC_CONFIG_AUX_DIR(${srcdir}/$toprel)
7f7ba9bf
TT
38if :; then :; else
39 # This overrides the previous occurrence for automake, but not for
40 # autoconf, which is exactly what we want.
41 AC_CONFIG_AUX_DIR(..)
42fi
ee9dd372 43
fe3dac3d
TT
44# This works around an automake problem.
45mkinstalldirs="`cd $ac_aux_dir && pwd`/mkinstalldirs"
46AC_SUBST(mkinstalldirs)
47
7f7ba9bf 48AC_CANONICAL_SYSTEM
ee9dd372 49
158a8e6b
AO
50dnl This shouldn't be needed, as long as top-level dependencies are
51dnl defined correctly and shared-library paths are set up so that
52dnl execution tests succeed. FIXME.
53define([AC_PROG_CC_WORKS],[])
54define([AC_PROG_CXX_WORKS],[])
55
56AC_PROG_CC
57AC_PROG_CXX
58
550c2492
TT
59dnl version is pulled out to make it a bit easier to change using sed.
60version=0.0.7
ee9dd372 61dnl Still use "libjava" here to placate dejagnu.
550c2492 62AM_INIT_AUTOMAKE(libjava, $version)
ee9dd372 63
18e1f2bd 64# AC_CHECK_TOOL does AC_REQUIRE (AC_CANONICAL_BUILD). If we don't
ee9dd372
TT
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.
68AC_CANONICAL_BUILD
69
70AC_CHECK_TOOL(AS, as)
71AC_CHECK_TOOL(AR, ar)
72AC_CHECK_TOOL(RANLIB, ranlib, :)
73
74AC_PROG_INSTALL
75
76AM_MAINTAINER_MODE
77
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
18e1f2bd 83# automake happy, but we don't execute it, since we don't care about
ee9dd372
TT
84# the result.
85if false; then
4e0abb1d
AO
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.
89 :
ee9dd372
TT
90 AC_EXEEXT
91fi
92
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
97
98libgcj_cflags=
99libgcj_cxxflags=
100libgcj_javaflags=
101
2ee7cd3e 102. [$]{srcdir}/configure.host
ee9dd372 103
ee9dd372
TT
104LIBGCJ_CFLAGS="[$]{libgcj_cflags}"
105LIBGCJ_CXXFLAGS="[$]{libgcj_cxxflags}"
106LIBGCJ_JAVAFLAGS="[$]{libgcj_javaflags}"
107AC_SUBST(LIBGCJ_CFLAGS)
108AC_SUBST(LIBGCJ_CXXFLAGS)
109AC_SUBST(LIBGCJ_JAVAFLAGS)
110])dnl
6d0860ee
AO
111
112sinclude(../libtool.m4)
113dnl The lines below arrange for aclocal not to bring libtool.m4
114dnl AM_PROG_LIBTOOL into aclocal.m4, while still arranging for automake
115dnl to add a definition of LIBTOOL to Makefile.in.
116ifelse(yes,no,[
117AC_DEFUN([AM_PROG_LIBTOOL],)
118AC_DEFUN([AC_LIBTOOL_DLOPEN],)
119AC_DEFUN([AC_LIBLTDL_CONVENIENCE],)
58d2986d
AO
120AC_DEFUN([LT_AC_PROG_GCJ],)
121AC_SUBST(GCJ)
6d0860ee
AO
122AC_SUBST(LIBTOOL)
123])
860a1536
TT
124
125#serial AM2
126
127dnl From Bruno Haible.
128
129AC_DEFUN([AM_ICONV],
130[
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).
133
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
139 done
140 ])
141
142 AC_CACHE_CHECK(for iconv, am_cv_func_iconv, [
143 am_cv_func_iconv="no, consider installing GNU libiconv"
144 am_cv_lib_iconv=no
145 AC_TRY_LINK([#include <stdlib.h>
146#include <iconv.h>],
147 [iconv_t cd = iconv_open("","");
148 iconv(cd,NULL,NULL,NULL,NULL);
149 iconv_close(cd);],
150 am_cv_func_iconv=yes)
151 if test "$am_cv_func_iconv" != yes; then
152 am_save_LIBS="$LIBS"
153 LIBS="$LIBS -liconv"
154 AC_TRY_LINK([#include <stdlib.h>
155#include <iconv.h>],
156 [iconv_t cd = iconv_open("","");
157 iconv(cd,NULL,NULL,NULL,NULL);
158 iconv_close(cd);],
159 am_cv_lib_iconv=yes
160 am_cv_func_iconv=yes)
161 LIBS="$am_save_LIBS"
162 fi
163 ])
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, [
168 AC_TRY_COMPILE([
169#include <stdlib.h>
170#include <iconv.h>
171extern
172#ifdef __cplusplus
173"C"
174#endif
175#if defined(__STDC__) || defined(__cplusplus)
176size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);
177#else
178size_t iconv();
179#endif
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.])
187 fi
188 LIBICONV=
189 if test "$am_cv_lib_iconv" = yes; then
190 LIBICONV="-liconv"
191 fi
192 AC_SUBST(LIBICONV)
193])
999825b0
TT
194
195# Check whether LC_MESSAGES is available in <locale.h>.
196# Ulrich Drepper <drepper@cygnus.com>, 1995.
197#
198# This file can be copied and used freely without restrictions. It can
199# be used in projects which are not available under the GNU General Public
200# License or the GNU Library General Public License but which still want
201# to provide support for the GNU gettext functionality.
202# Please note that the actual code of the GNU gettext library is covered
203# by the GNU Library General Public License, and the rest of the GNU
204# gettext package package is covered by the GNU General Public License.
205# They are *not* in the public domain.
206
207# serial 2
208
209AC_DEFUN([AM_LC_MESSAGES],
210 [if test $ac_cv_header_locale_h = yes; then
211 AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES,
212 [AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
213 am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)])
214 if test $am_cv_val_LC_MESSAGES = yes; then
215 AC_DEFINE(HAVE_LC_MESSAGES, 1,
216 [Define if your <locale.h> file defines LC_MESSAGES.])
217 fi
218 fi])
This page took 0.213783 seconds and 5 git commands to generate.