OSDN Git Service

* trans-decl.c (gfc_build_function_decl): Remove dead code.
[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 sinclude(../config/accross.m4)
14 sinclude(../config/acx.m4)
15 sinclude(../config/no-executables.m4)
16
17 sinclude(../libtool.m4)
18 dnl The lines below arrange for aclocal not to bring libtool.m4
19 dnl AM_PROG_LIBTOOL into aclocal.m4, while still arranging for automake
20 dnl to add a definition of LIBTOOL to Makefile.in.
21 ifelse(yes,no,[
22 AC_DEFUN([AM_PROG_LIBTOOL],)
23 AC_DEFUN([AC_LIBTOOL_DLOPEN],)
24 AC_DEFUN([AC_LIBLTDL_CONVENIENCE],)
25 AC_DEFUN([LT_AC_PROG_GCJ],)
26 AC_SUBST(GCJ)
27 AC_SUBST(LIBTOOL)
28 ])
29
30 #serial AM2
31
32 dnl From Bruno Haible.
33
34 AC_DEFUN([AM_ICONV],
35 [
36   dnl Some systems have iconv in libc, some have it in libiconv (OSF/1 and
37   dnl those with the standalone portable GNU libiconv installed).
38
39   am_cv_lib_iconv_ldpath=
40   AC_ARG_WITH([libiconv-prefix],
41 [  --with-libiconv-prefix=DIR  search for libiconv in DIR/include and DIR/lib], [
42     for dir in `echo "$withval" | tr : ' '`; do
43       if test -d $dir/include; then CPPFLAGS="$CPPFLAGS -I$dir/include"; fi
44       if test -d $dir/lib; then am_cv_lib_iconv_ldpath="-L$dir/lib"; fi
45     done
46    ])
47
48   AC_CACHE_CHECK(for iconv, am_cv_func_iconv, [
49     am_cv_func_iconv="no, consider installing GNU libiconv"
50     am_cv_lib_iconv=no
51     AC_TRY_LINK([#include <stdlib.h>
52 #include <iconv.h>],
53       [iconv_t cd = iconv_open("","");
54        iconv(cd,NULL,NULL,NULL,NULL);
55        iconv_close(cd);],
56       am_cv_func_iconv=yes)
57     if test "$am_cv_func_iconv" != yes; then
58       am_save_LIBS="$LIBS"
59       LIBS="$LIBS $am_cv_libiconv_ldpath -liconv"
60       AC_TRY_LINK([#include <stdlib.h>
61 #include <iconv.h>],
62         [iconv_t cd = iconv_open("","");
63          iconv(cd,NULL,NULL,NULL,NULL);
64          iconv_close(cd);],
65         am_cv_lib_iconv=yes
66         am_cv_func_iconv=yes)
67       LIBS="$am_save_LIBS"
68     fi
69   ])
70   if test "$am_cv_func_iconv" = yes; then
71     AC_DEFINE(HAVE_ICONV, 1, [Define if you have the iconv() function.])
72     AC_MSG_CHECKING([for iconv declaration])
73     AC_CACHE_VAL(am_cv_proto_iconv, [
74       AC_TRY_COMPILE([
75 #include <stdlib.h>
76 #include <iconv.h>
77 extern
78 #ifdef __cplusplus
79 "C"
80 #endif
81 #if defined(__STDC__) || defined(__cplusplus)
82 size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);
83 #else
84 size_t iconv();
85 #endif
86 ], [], am_cv_proto_iconv_arg1="", am_cv_proto_iconv_arg1="const")
87       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);"])
88     am_cv_proto_iconv=`echo "[$]am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'`
89     AC_MSG_RESULT([$]{ac_t:-
90          }[$]am_cv_proto_iconv)
91     AC_DEFINE_UNQUOTED(ICONV_CONST, $am_cv_proto_iconv_arg1,
92       [Define as const if the declaration of iconv() needs const.])
93   fi
94   LIBICONV=
95   if test "$am_cv_lib_iconv" = yes; then
96     LIBICONV="$am_cv_lib_iconv_ldpath -liconv"
97   fi
98   AC_SUBST(LIBICONV)
99 ])
100
101 # Check whether LC_MESSAGES is available in <locale.h>.
102 # Ulrich Drepper <drepper@cygnus.com>, 1995.
103 #
104 # This file can be copied and used freely without restrictions.  It can
105 # be used in projects which are not available under the GNU General Public
106 # License or the GNU Library General Public License but which still want
107 # to provide support for the GNU gettext functionality.
108 # Please note that the actual code of the GNU gettext library is covered
109 # by the GNU Library General Public License, and the rest of the GNU
110 # gettext package package is covered by the GNU General Public License.
111 # They are *not* in the public domain.
112
113 # serial 2
114
115 AC_DEFUN([AM_LC_MESSAGES],
116   [AC_CHECK_HEADERS(locale.h)
117   if test $ac_cv_header_locale_h = yes; then
118     AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES,
119       [AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
120        am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)])
121     if test $am_cv_val_LC_MESSAGES = yes; then
122       AC_DEFINE(HAVE_LC_MESSAGES, 1,
123         [Define if your <locale.h> file defines LC_MESSAGES.])
124     fi
125   fi])
126
127 AC_DEFUN([CHECK_FOR_BROKEN_MINGW_LD],
128 [
129 AC_MSG_CHECKING(whether 'ld' is at least 2.13)
130 LD_PROG=`$CC --print-prog-name=ld`
131 LD_VERSION=`$LD_PROG --version`
132 LD_VERSION_MAJOR=`echo "$LD_VERSION" | head -1 | cut -d '.' -f 1 | cut -d ' ' -f 4`
133 LD_VERSION_MINOR=`echo "$LD_VERSION" | head -1 | cut -d '.' -f 2`
134 if expr "$LD_VERSION_MAJOR" \> 2 > /dev/null; then
135   LD_OK="ok"
136 else
137   if expr "$LD_VERSION_MAJOR" = 2 && expr "$LD_VERSION_MINOR" \>= 13 > /dev/null; then
138     LD_OK="ok"
139   fi
140 fi
141 if test "x$LD_OK" != x; then
142   AC_MSG_RESULT([yes; major=$LD_VERSION_MAJOR, minor=$LD_VERSION_MINOR])
143 else
144   AC_MSG_RESULT([no; major=$LD_VERSION_MAJOR, minor=$LD_VERSION_MINOR])
145   AC_MSG_WARN([ld <2.13 detected; enabling JV_LINKER_CANNOT_8BYTE_ALIGN_STATICS hack...])
146   AC_DEFINE(JV_LINKER_CANNOT_8BYTE_ALIGN_STATICS, 1,
147             [Indicate that linker is not able to 8-byte align static data])
148 fi[]dnl
149 ])# CHECK_FOR_BROKEN_MINGW_LD
150
151 dnl PKG_CHECK_MODULES(GSTUFF, gtk+-2.0 >= 1.3 glib = 1.3.4, action-if, action-not)
152 dnl defines GSTUFF_LIBS, GSTUFF_CFLAGS, see pkg-config man page
153 dnl also defines GSTUFF_PKG_ERRORS on error
154 AC_DEFUN([PKG_CHECK_MODULES], [
155   succeeded=no
156
157   if test -z "$PKG_CONFIG"; then
158     AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
159   fi
160
161   if test "$PKG_CONFIG" = "no" ; then
162      echo "*** The pkg-config script could not be found. Make sure it is"
163      echo "*** in your path, or set the PKG_CONFIG environment variable"
164      echo "*** to the full path to pkg-config."
165      echo "*** Or see http://www.freedesktop.org/software/pkgconfig to get pkg-config."
166   else
167      PKG_CONFIG_MIN_VERSION=0.9.0
168      if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then
169         AC_MSG_CHECKING(for $2)
170
171         if $PKG_CONFIG --exists "$2" ; then
172             AC_MSG_RESULT(yes)
173             succeeded=yes
174
175             AC_MSG_CHECKING($1_CFLAGS)
176             $1_CFLAGS=`$PKG_CONFIG --cflags "$2"`
177             AC_MSG_RESULT($$1_CFLAGS)
178
179             AC_MSG_CHECKING($1_LIBS)
180             $1_LIBS=`$PKG_CONFIG --libs "$2"`
181             AC_MSG_RESULT($$1_LIBS)
182         else
183             $1_CFLAGS=""
184             $1_LIBS=""
185             ## If we have a custom action on failure, don't print errors, but 
186             ## do set a variable so people can do so.
187             $1_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$2"`
188             ifelse([$4], ,echo $$1_PKG_ERRORS,)
189         fi
190
191         AC_SUBST($1_CFLAGS)
192         AC_SUBST($1_LIBS)
193      else
194         echo "*** Your version of pkg-config is too old. You need version $PKG_CONFIG_MIN_VERSION or newer."
195         echo "*** See http://www.freedesktop.org/software/pkgconfig"
196      fi
197   fi
198
199   if test $succeeded = yes; then
200      ifelse([$3], , :, [$3])
201   else
202      ifelse([$4], , AC_MSG_ERROR([Library requirements ($2) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them.]), [$4])
203   fi
204 ])
205
206
207
208 # Do all the work for Automake.  This macro actually does too much --
209 # some checks are only needed if your package does certain things.
210 # But this isn't really a big deal.
211
212 # serial 1
213
214 dnl Usage:
215 dnl AM_INIT_AUTOMAKE(package,version, [no-define])
216
217 AC_DEFUN(AM_INIT_AUTOMAKE,
218 [AC_REQUIRE([AC_PROG_INSTALL])
219 PACKAGE=[$1]
220 AC_SUBST(PACKAGE)
221 VERSION=[$2]
222 AC_SUBST(VERSION)
223 dnl test to see if srcdir already configured
224 if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
225   AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
226 fi
227 ifelse([$3],,
228 AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
229 AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package]))
230 AC_REQUIRE([AM_SANITY_CHECK])
231 AC_REQUIRE([AC_ARG_PROGRAM])
232 dnl FIXME This is truly gross.
233 missing_dir=`cd $ac_aux_dir && pwd`
234 AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir)
235 AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
236 AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir)
237 AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
238 AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir)
239 AC_REQUIRE([AC_PROG_MAKE_SET])])
240
241 #
242 # Check to make sure that the build environment is sane.
243 #
244
245 AC_DEFUN(AM_SANITY_CHECK,
246 [AC_MSG_CHECKING([whether build environment is sane])
247 # Just in case
248 sleep 1
249 echo timestamp > conftestfile
250 # Do `set' in a subshell so we don't clobber the current shell's
251 # arguments.  Must try -L first in case configure is actually a
252 # symlink; some systems play weird games with the mod time of symlinks
253 # (eg FreeBSD returns the mod time of the symlink's containing
254 # directory).
255 if (
256    set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
257    if test "[$]*" = "X"; then
258       # -L didn't work.
259       set X `ls -t $srcdir/configure conftestfile`
260    fi
261    if test "[$]*" != "X $srcdir/configure conftestfile" \
262       && test "[$]*" != "X conftestfile $srcdir/configure"; then
263
264       # If neither matched, then we have a broken ls.  This can happen
265       # if, for instance, CONFIG_SHELL is bash and it inherits a
266       # broken ls alias from the environment.  This has actually
267       # happened.  Such a system could not be considered "sane".
268       AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
269 alias in your environment])
270    fi
271
272    test "[$]2" = conftestfile
273    )
274 then
275    # Ok.
276    :
277 else
278    AC_MSG_ERROR([newly created file is older than distributed files!
279 Check your system clock])
280 fi
281 rm -f conftest*
282 AC_MSG_RESULT(yes)])
283
284 dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY)
285 dnl The program must properly implement --version.
286 AC_DEFUN(AM_MISSING_PROG,
287 [AC_MSG_CHECKING(for working $2)
288 # Run test in a subshell; some versions of sh will print an error if
289 # an executable is not found, even if stderr is redirected.
290 # Redirect stdin to placate older versions of autoconf.  Sigh.
291 if ($2 --version) < /dev/null > /dev/null 2>&1; then
292    $1=$2
293    AC_MSG_RESULT(found)
294 else
295    $1="$3/missing $2"
296    AC_MSG_RESULT(missing)
297 fi
298 AC_SUBST($1)])
299
300 # Add --enable-maintainer-mode option to configure.
301 # From Jim Meyering
302
303 # serial 1
304
305 AC_DEFUN(AM_MAINTAINER_MODE,
306 [AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
307   dnl maintainer-mode is disabled by default
308   AC_ARG_ENABLE(maintainer-mode,
309 [  --enable-maintainer-mode enable make rules and dependencies not useful
310                           (and sometimes confusing) to the casual installer],
311       USE_MAINTAINER_MODE=$enableval,
312       USE_MAINTAINER_MODE=no)
313   AC_MSG_RESULT($USE_MAINTAINER_MODE)
314   AM_CONDITIONAL(MAINTAINER_MODE, test $USE_MAINTAINER_MODE = yes)
315   MAINT=$MAINTAINER_MODE_TRUE
316   AC_SUBST(MAINT)dnl
317 ]
318 )
319
320 # Define a conditional.
321
322 AC_DEFUN(AM_CONDITIONAL,
323 [AC_SUBST($1_TRUE)
324 AC_SUBST($1_FALSE)
325 if $2; then
326   $1_TRUE=
327   $1_FALSE='#'
328 else
329   $1_TRUE='#'
330   $1_FALSE=
331 fi])
332
333 # Like AC_CONFIG_HEADER, but automatically create stamp file.
334
335 AC_DEFUN(AM_CONFIG_HEADER,
336 [AC_PREREQ([2.12])
337 AC_CONFIG_HEADER([$1])
338 dnl When config.status generates a header, we must update the stamp-h file.
339 dnl This file resides in the same directory as the config header
340 dnl that is generated.  We must strip everything past the first ":",
341 dnl and everything past the last "/".
342 AC_OUTPUT_COMMANDS(changequote(<<,>>)dnl
343 ifelse(patsubst(<<$1>>, <<[^ ]>>, <<>>), <<>>,
344 <<test -z "<<$>>CONFIG_HEADERS" || echo timestamp > patsubst(<<$1>>, <<^\([^:]*/\)?.*>>, <<\1>>)stamp-h<<>>dnl>>,
345 <<am_indx=1
346 for am_file in <<$1>>; do
347   case " <<$>>CONFIG_HEADERS " in
348   *" <<$>>am_file "*<<)>>
349     echo timestamp > `echo <<$>>am_file | sed -e 's%:.*%%' -e 's%[^/]*$%%'`stamp-h$am_indx
350     ;;
351   esac
352   am_indx=`expr "<<$>>am_indx" + 1`
353 done<<>>dnl>>)
354 changequote([,]))])
355