OSDN Git Service

2002-02-01 Craig Rodrigues <rodrigc@gcc.gnu.org>
[pf3gnuchains/gcc-fork.git] / libjava / aclocal.m4
1 dnl aclocal.m4 generated automatically by aclocal 1.4
2
3 dnl Copyright (C) 1994, 1995-8, 1999 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.
7
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.
12
13 AC_DEFUN(LIBGCJ_CONFIGURE,
14 [
15 dnl Default to --enable-multilib
16 AC_ARG_ENABLE(multilib,
17 [  --enable-multilib       build many library versions (default)],
18 [case "${enableval}" in
19   yes) multilib=yes ;;
20   no)  multilib=no ;;
21   *)   AC_MSG_ERROR(bad value ${enableval} for multilib option) ;;
22  esac], [multilib=yes])dnl
23
24 dnl We may get other options which we don't document:
25 dnl --with-target-subdir, --with-multisrctop, --with-multisubdir
26
27 # When building with srcdir == objdir, links to the source files will
28 # be created in directories within the target_subdir.  We have to
29 # adjust toplevel_srcdir accordingly, so that configure finds
30 # install-sh and other auxiliary files that live in the top-level
31 # source directory.
32 if test "${srcdir}" = "."; then
33   if test -z "${with_target_subdir}"; then
34     toprel=".."
35   else
36     if test "${with_target_subdir}" != "."; then
37       toprel="${with_multisrctop}../.."
38     else
39       toprel="${with_multisrctop}.."
40     fi
41   fi
42 else
43   toprel=".."
44 fi
45
46 libgcj_basedir=$srcdir/$toprel/$1/libjava
47 AC_SUBST(libgcj_basedir)
48
49 AC_CONFIG_AUX_DIR(${srcdir}/$toprel)
50 if :; then :; else
51   # This overrides the previous occurrence for automake, but not for
52   # autoconf, which is exactly what we want.
53   AC_CONFIG_AUX_DIR(..)
54 fi
55
56 # This works around an automake problem.
57 mkinstalldirs="`cd $ac_aux_dir && pwd`/mkinstalldirs"
58 AC_SUBST(mkinstalldirs)
59
60 AC_CANONICAL_SYSTEM
61
62 dnl This shouldn't be needed, as long as top-level dependencies are
63 dnl defined correctly and shared-library paths are set up so that
64 dnl execution tests succeed.  FIXME.
65 define([AC_PROG_CC_WORKS],[])
66 define([AC_PROG_CXX_WORKS],[])
67
68 AC_PROG_CC
69 AC_PROG_CXX
70
71 dnl version is pulled out to make it a bit easier to change using sed.
72 version=0.0.7
73 dnl Still use "libjava" here to placate dejagnu.
74 AM_INIT_AUTOMAKE(libjava, $version)
75
76 # AC_CHECK_TOOL does AC_REQUIRE (AC_CANONICAL_BUILD).  If we don't
77 # run it explicitly here, it will be run implicitly before
78 # LIBGCJ_CONFIGURE, which doesn't work because that means that it will
79 # be run before AC_CANONICAL_HOST.
80 AC_CANONICAL_BUILD
81
82 AC_CHECK_TOOL(AS, as)
83 AC_CHECK_TOOL(AR, ar)
84 AC_CHECK_TOOL(RANLIB, ranlib, :)
85
86 AC_PROG_INSTALL
87
88 AM_MAINTAINER_MODE
89
90 # We need AC_EXEEXT to keep automake happy in cygnus mode.  However,
91 # at least currently, we never actually build a program, so we never
92 # need to use $(EXEEXT).  Moreover, the test for EXEEXT normally
93 # fails, because we are probably configuring with a cross compiler
94 # which cant create executables.  So we include AC_EXEEXT to keep
95 # automake happy, but we don't execute it, since we don't care about
96 # the result.
97 if false; then
98   # autoconf 2.50 runs AC_EXEEXT by default, and the macro expands
99   # to nothing, so nothing would remain between `then' and `fi' if it
100   # were not for the `:' below.
101   :
102   AC_EXEEXT
103 fi
104
105 # configure.host sets the following important variables
106 #       libgcj_cflags    - host specific C compiler flags
107 #       libgcj_cxxflags  - host specific C++ compiler flags
108 #       libgcj_javaflags - host specific Java compiler flags
109
110 libgcj_cflags=
111 libgcj_cxxflags=
112 libgcj_javaflags=
113
114 . [$]{srcdir}/configure.host
115
116 LIBGCJ_CFLAGS="[$]{libgcj_cflags}"
117 LIBGCJ_CXXFLAGS="[$]{libgcj_cxxflags}"
118 LIBGCJ_JAVAFLAGS="[$]{libgcj_javaflags}"
119 AC_SUBST(LIBGCJ_CFLAGS)
120 AC_SUBST(LIBGCJ_CXXFLAGS)
121 AC_SUBST(LIBGCJ_JAVAFLAGS)
122 ])dnl
123
124 sinclude(../libtool.m4)
125 dnl The lines below arrange for aclocal not to bring libtool.m4
126 dnl AM_PROG_LIBTOOL into aclocal.m4, while still arranging for automake
127 dnl to add a definition of LIBTOOL to Makefile.in.
128 ifelse(yes,no,[
129 AC_DEFUN([AM_PROG_LIBTOOL],)
130 AC_DEFUN([AC_LIBTOOL_DLOPEN],)
131 AC_DEFUN([AC_LIBLTDL_CONVENIENCE],)
132 AC_DEFUN([LT_AC_PROG_GCJ],)
133 AC_SUBST(GCJ)
134 AC_SUBST(LIBTOOL)
135 ])
136
137 #serial AM2
138
139 dnl From Bruno Haible.
140
141 AC_DEFUN([AM_ICONV],
142 [
143   dnl Some systems have iconv in libc, some have it in libiconv (OSF/1 and
144   dnl those with the standalone portable GNU libiconv installed).
145
146   am_cv_lib_iconv_ldpath=
147   AC_ARG_WITH([libiconv-prefix],
148 [  --with-libiconv-prefix=DIR  search for libiconv in DIR/include and DIR/lib], [
149     for dir in `echo "$withval" | tr : ' '`; do
150       if test -d $dir/include; then CPPFLAGS="$CPPFLAGS -I$dir/include"; fi
151       if test -d $dir/lib; then am_cv_lib_iconv_ldpath="-L$dir/lib"; fi
152     done
153    ])
154
155   AC_CACHE_CHECK(for iconv, am_cv_func_iconv, [
156     am_cv_func_iconv="no, consider installing GNU libiconv"
157     am_cv_lib_iconv=no
158     AC_TRY_LINK([#include <stdlib.h>
159 #include <iconv.h>],
160       [iconv_t cd = iconv_open("","");
161        iconv(cd,NULL,NULL,NULL,NULL);
162        iconv_close(cd);],
163       am_cv_func_iconv=yes)
164     if test "$am_cv_func_iconv" != yes; then
165       am_save_LIBS="$LIBS"
166       LIBS="$LIBS $am_cv_libiconv_ldpath -liconv"
167       AC_TRY_LINK([#include <stdlib.h>
168 #include <iconv.h>],
169         [iconv_t cd = iconv_open("","");
170          iconv(cd,NULL,NULL,NULL,NULL);
171          iconv_close(cd);],
172         am_cv_lib_iconv=yes
173         am_cv_func_iconv=yes)
174       LIBS="$am_save_LIBS"
175     fi
176   ])
177   if test "$am_cv_func_iconv" = yes; then
178     AC_DEFINE(HAVE_ICONV, 1, [Define if you have the iconv() function.])
179     AC_MSG_CHECKING([for iconv declaration])
180     AC_CACHE_VAL(am_cv_proto_iconv, [
181       AC_TRY_COMPILE([
182 #include <stdlib.h>
183 #include <iconv.h>
184 extern
185 #ifdef __cplusplus
186 "C"
187 #endif
188 #if defined(__STDC__) || defined(__cplusplus)
189 size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);
190 #else
191 size_t iconv();
192 #endif
193 ], [], am_cv_proto_iconv_arg1="", am_cv_proto_iconv_arg1="const")
194       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);"])
195     am_cv_proto_iconv=`echo "[$]am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'`
196     AC_MSG_RESULT([$]{ac_t:-
197          }[$]am_cv_proto_iconv)
198     AC_DEFINE_UNQUOTED(ICONV_CONST, $am_cv_proto_iconv_arg1,
199       [Define as const if the declaration of iconv() needs const.])
200   fi
201   LIBICONV=
202   if test "$am_cv_lib_iconv" = yes; then
203     LIBICONV="$am_cv_lib_iconv_ldpath -liconv"
204   fi
205   AC_SUBST(LIBICONV)
206 ])
207
208 # Check whether LC_MESSAGES is available in <locale.h>.
209 # Ulrich Drepper <drepper@cygnus.com>, 1995.
210 #
211 # This file can be copied and used freely without restrictions.  It can
212 # be used in projects which are not available under the GNU General Public
213 # License or the GNU Library General Public License but which still want
214 # to provide support for the GNU gettext functionality.
215 # Please note that the actual code of the GNU gettext library is covered
216 # by the GNU Library General Public License, and the rest of the GNU
217 # gettext package package is covered by the GNU General Public License.
218 # They are *not* in the public domain.
219
220 # serial 2
221
222 AC_DEFUN([AM_LC_MESSAGES],
223   [if test $ac_cv_header_locale_h = yes; then
224     AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES,
225       [AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
226        am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)])
227     if test $am_cv_val_LC_MESSAGES = yes; then
228       AC_DEFINE(HAVE_LC_MESSAGES, 1,
229         [Define if your <locale.h> file defines LC_MESSAGES.])
230     fi
231   fi])
232
233 # Do all the work for Automake.  This macro actually does too much --
234 # some checks are only needed if your package does certain things.
235 # But this isn't really a big deal.
236
237 # serial 1
238
239 dnl Usage:
240 dnl AM_INIT_AUTOMAKE(package,version, [no-define])
241
242 AC_DEFUN(AM_INIT_AUTOMAKE,
243 [AC_REQUIRE([AC_PROG_INSTALL])
244 PACKAGE=[$1]
245 AC_SUBST(PACKAGE)
246 VERSION=[$2]
247 AC_SUBST(VERSION)
248 dnl test to see if srcdir already configured
249 if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
250   AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
251 fi
252 ifelse([$3],,
253 AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
254 AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package]))
255 AC_REQUIRE([AM_SANITY_CHECK])
256 AC_REQUIRE([AC_ARG_PROGRAM])
257 dnl FIXME This is truly gross.
258 missing_dir=`cd $ac_aux_dir && pwd`
259 AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir)
260 AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
261 AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir)
262 AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
263 AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir)
264 AC_REQUIRE([AC_PROG_MAKE_SET])])
265
266 #
267 # Check to make sure that the build environment is sane.
268 #
269
270 AC_DEFUN(AM_SANITY_CHECK,
271 [AC_MSG_CHECKING([whether build environment is sane])
272 # Just in case
273 sleep 1
274 echo timestamp > conftestfile
275 # Do `set' in a subshell so we don't clobber the current shell's
276 # arguments.  Must try -L first in case configure is actually a
277 # symlink; some systems play weird games with the mod time of symlinks
278 # (eg FreeBSD returns the mod time of the symlink's containing
279 # directory).
280 if (
281    set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
282    if test "[$]*" = "X"; then
283       # -L didn't work.
284       set X `ls -t $srcdir/configure conftestfile`
285    fi
286    if test "[$]*" != "X $srcdir/configure conftestfile" \
287       && test "[$]*" != "X conftestfile $srcdir/configure"; then
288
289       # If neither matched, then we have a broken ls.  This can happen
290       # if, for instance, CONFIG_SHELL is bash and it inherits a
291       # broken ls alias from the environment.  This has actually
292       # happened.  Such a system could not be considered "sane".
293       AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
294 alias in your environment])
295    fi
296
297    test "[$]2" = conftestfile
298    )
299 then
300    # Ok.
301    :
302 else
303    AC_MSG_ERROR([newly created file is older than distributed files!
304 Check your system clock])
305 fi
306 rm -f conftest*
307 AC_MSG_RESULT(yes)])
308
309 dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY)
310 dnl The program must properly implement --version.
311 AC_DEFUN(AM_MISSING_PROG,
312 [AC_MSG_CHECKING(for working $2)
313 # Run test in a subshell; some versions of sh will print an error if
314 # an executable is not found, even if stderr is redirected.
315 # Redirect stdin to placate older versions of autoconf.  Sigh.
316 if ($2 --version) < /dev/null > /dev/null 2>&1; then
317    $1=$2
318    AC_MSG_RESULT(found)
319 else
320    $1="$3/missing $2"
321    AC_MSG_RESULT(missing)
322 fi
323 AC_SUBST($1)])
324
325 # Add --enable-maintainer-mode option to configure.
326 # From Jim Meyering
327
328 # serial 1
329
330 AC_DEFUN(AM_MAINTAINER_MODE,
331 [AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
332   dnl maintainer-mode is disabled by default
333   AC_ARG_ENABLE(maintainer-mode,
334 [  --enable-maintainer-mode enable make rules and dependencies not useful
335                           (and sometimes confusing) to the casual installer],
336       USE_MAINTAINER_MODE=$enableval,
337       USE_MAINTAINER_MODE=no)
338   AC_MSG_RESULT($USE_MAINTAINER_MODE)
339   AM_CONDITIONAL(MAINTAINER_MODE, test $USE_MAINTAINER_MODE = yes)
340   MAINT=$MAINTAINER_MODE_TRUE
341   AC_SUBST(MAINT)dnl
342 ]
343 )
344
345 # Define a conditional.
346
347 AC_DEFUN(AM_CONDITIONAL,
348 [AC_SUBST($1_TRUE)
349 AC_SUBST($1_FALSE)
350 if $2; then
351   $1_TRUE=
352   $1_FALSE='#'
353 else
354   $1_TRUE='#'
355   $1_FALSE=
356 fi])
357
358 # Like AC_CONFIG_HEADER, but automatically create stamp file.
359
360 AC_DEFUN(AM_CONFIG_HEADER,
361 [AC_PREREQ([2.12])
362 AC_CONFIG_HEADER([$1])
363 dnl When config.status generates a header, we must update the stamp-h file.
364 dnl This file resides in the same directory as the config header
365 dnl that is generated.  We must strip everything past the first ":",
366 dnl and everything past the last "/".
367 AC_OUTPUT_COMMANDS(changequote(<<,>>)dnl
368 ifelse(patsubst(<<$1>>, <<[^ ]>>, <<>>), <<>>,
369 <<test -z "<<$>>CONFIG_HEADERS" || echo timestamp > patsubst(<<$1>>, <<^\([^:]*/\)?.*>>, <<\1>>)stamp-h<<>>dnl>>,
370 <<am_indx=1
371 for am_file in <<$1>>; do
372   case " <<$>>CONFIG_HEADERS " in
373   *" <<$>>am_file "*<<)>>
374     echo timestamp > `echo <<$>>am_file | sed -e 's%:.*%%' -e 's%[^/]*$%%'`stamp-h$am_indx
375     ;;
376   esac
377   am_indx=`expr "<<$>>am_indx" + 1`
378 done<<>>dnl>>)
379 changequote([,]))])
380