OSDN Git Service

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