source: trunk/third/gcc/libjava/aclocal.m4 @ 18474

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