OSDN Git Service

For PR bootstrap/3075:
[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 dont document:
25 dnl --with-target-subdir, --with-multisrctop, --with-multisubdir
26
27 if test "[$]{srcdir}" = "."; then
28   if test "[$]{with_target_subdir}" != "."; then
29     libgcj_basedir="[$]{srcdir}/[$]{with_multisrctop}../$1"
30   else
31     libgcj_basedir="[$]{srcdir}/[$]{with_multisrctop}$1"
32   fi
33 else
34   libgcj_basedir="[$]{srcdir}/$1"
35 fi
36 AC_SUBST(libgcj_basedir)
37 AC_CONFIG_AUX_DIR($libgcj_basedir/..)
38 if :; 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(..)
42 fi
43
44 AC_CANONICAL_SYSTEM
45
46 dnl This shouldn't be needed, as long as top-level dependencies are
47 dnl defined correctly and shared-library paths are set up so that
48 dnl execution tests succeed.  FIXME.
49 define([AC_PROG_CC_WORKS],[])
50 define([AC_PROG_CXX_WORKS],[])
51
52 AC_PROG_CC
53 AC_PROG_CXX
54
55 dnl version is pulled out to make it a bit easier to change using sed.
56 version=0.0.7
57 dnl Still use "libjava" here to placate dejagnu.
58 AM_INIT_AUTOMAKE(libjava, $version)
59
60 # AC_CHECK_TOOL does AC_REQUIRE (AC_CANONICAL_BUILD).  If we dont
61 # run it explicitly here, it will be run implicitly before
62 # LIBGCJ_CONFIGURE, which doesn't work because that means that it will
63 # be run before AC_CANONICAL_HOST.
64 AC_CANONICAL_BUILD
65
66 AC_CHECK_TOOL(AS, as)
67 AC_CHECK_TOOL(AR, ar)
68 AC_CHECK_TOOL(RANLIB, ranlib, :)
69
70 AC_PROG_INSTALL
71
72 AM_MAINTAINER_MODE
73
74 # We need AC_EXEEXT to keep automake happy in cygnus mode.  However,
75 # at least currently, we never actually build a program, so we never
76 # need to use $(EXEEXT).  Moreover, the test for EXEEXT normally
77 # fails, because we are probably configuring with a cross compiler
78 # which cant create executables.  So we include AC_EXEEXT to keep
79 # automake happy, but we dont execute it, since we dont care about
80 # the result.
81 if false; then
82   AC_EXEEXT
83 fi
84
85 # configure.host sets the following important variables
86 #       libgcj_cflags    - host specific C compiler flags
87 #       libgcj_cxxflags  - host specific C++ compiler flags
88 #       libgcj_javaflags - host specific Java compiler flags
89
90 libgcj_cflags=
91 libgcj_cxxflags=
92 libgcj_javaflags=
93
94 . [$]{libgcj_basedir}/configure.host
95
96 case [$]{libgcj_basedir} in
97 /* | [A-Za-z]:[/\\]*) libgcj_flagbasedir=[$]{libgcj_basedir} ;;
98 *) libgcj_flagbasedir='[$](top_builddir)/'[$]{libgcj_basedir} ;;
99 esac
100
101 LIBGCJ_CFLAGS="[$]{libgcj_cflags}"
102 LIBGCJ_CXXFLAGS="[$]{libgcj_cxxflags}"
103 LIBGCJ_JAVAFLAGS="[$]{libgcj_javaflags}"
104 AC_SUBST(LIBGCJ_CFLAGS)
105 AC_SUBST(LIBGCJ_CXXFLAGS)
106 AC_SUBST(LIBGCJ_JAVAFLAGS)
107 ])dnl
108
109 sinclude(../libtool.m4)
110 dnl The lines below arrange for aclocal not to bring libtool.m4
111 dnl AM_PROG_LIBTOOL into aclocal.m4, while still arranging for automake
112 dnl to add a definition of LIBTOOL to Makefile.in.
113 ifelse(yes,no,[
114 AC_DEFUN([AM_PROG_LIBTOOL],)
115 AC_DEFUN([AC_LIBTOOL_DLOPEN],)
116 AC_DEFUN([AC_LIBLTDL_CONVENIENCE],)
117 AC_DEFUN([LT_AC_PROG_GCJ],)
118 AC_SUBST(GCJ)
119 AC_SUBST(LIBTOOL)
120 ])
121
122 # Do all the work for Automake.  This macro actually does too much --
123 # some checks are only needed if your package does certain things.
124 # But this isn't really a big deal.
125
126 # serial 1
127
128 dnl Usage:
129 dnl AM_INIT_AUTOMAKE(package,version, [no-define])
130
131 AC_DEFUN(AM_INIT_AUTOMAKE,
132 [AC_REQUIRE([AC_PROG_INSTALL])
133 PACKAGE=[$1]
134 AC_SUBST(PACKAGE)
135 VERSION=[$2]
136 AC_SUBST(VERSION)
137 dnl test to see if srcdir already configured
138 if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
139   AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
140 fi
141 ifelse([$3],,
142 AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
143 AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package]))
144 AC_REQUIRE([AM_SANITY_CHECK])
145 AC_REQUIRE([AC_ARG_PROGRAM])
146 dnl FIXME This is truly gross.
147 missing_dir=`cd $ac_aux_dir && pwd`
148 AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir)
149 AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
150 AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir)
151 AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
152 AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir)
153 AC_REQUIRE([AC_PROG_MAKE_SET])])
154
155 #
156 # Check to make sure that the build environment is sane.
157 #
158
159 AC_DEFUN(AM_SANITY_CHECK,
160 [AC_MSG_CHECKING([whether build environment is sane])
161 # Just in case
162 sleep 1
163 echo timestamp > conftestfile
164 # Do `set' in a subshell so we don't clobber the current shell's
165 # arguments.  Must try -L first in case configure is actually a
166 # symlink; some systems play weird games with the mod time of symlinks
167 # (eg FreeBSD returns the mod time of the symlink's containing
168 # directory).
169 if (
170    set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
171    if test "[$]*" = "X"; then
172       # -L didn't work.
173       set X `ls -t $srcdir/configure conftestfile`
174    fi
175    if test "[$]*" != "X $srcdir/configure conftestfile" \
176       && test "[$]*" != "X conftestfile $srcdir/configure"; then
177
178       # If neither matched, then we have a broken ls.  This can happen
179       # if, for instance, CONFIG_SHELL is bash and it inherits a
180       # broken ls alias from the environment.  This has actually
181       # happened.  Such a system could not be considered "sane".
182       AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
183 alias in your environment])
184    fi
185
186    test "[$]2" = conftestfile
187    )
188 then
189    # Ok.
190    :
191 else
192    AC_MSG_ERROR([newly created file is older than distributed files!
193 Check your system clock])
194 fi
195 rm -f conftest*
196 AC_MSG_RESULT(yes)])
197
198 dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY)
199 dnl The program must properly implement --version.
200 AC_DEFUN(AM_MISSING_PROG,
201 [AC_MSG_CHECKING(for working $2)
202 # Run test in a subshell; some versions of sh will print an error if
203 # an executable is not found, even if stderr is redirected.
204 # Redirect stdin to placate older versions of autoconf.  Sigh.
205 if ($2 --version) < /dev/null > /dev/null 2>&1; then
206    $1=$2
207    AC_MSG_RESULT(found)
208 else
209    $1="$3/missing $2"
210    AC_MSG_RESULT(missing)
211 fi
212 AC_SUBST($1)])
213
214 # Add --enable-maintainer-mode option to configure.
215 # From Jim Meyering
216
217 # serial 1
218
219 AC_DEFUN(AM_MAINTAINER_MODE,
220 [AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
221   dnl maintainer-mode is disabled by default
222   AC_ARG_ENABLE(maintainer-mode,
223 [  --enable-maintainer-mode enable make rules and dependencies not useful
224                           (and sometimes confusing) to the casual installer],
225       USE_MAINTAINER_MODE=$enableval,
226       USE_MAINTAINER_MODE=no)
227   AC_MSG_RESULT($USE_MAINTAINER_MODE)
228   AM_CONDITIONAL(MAINTAINER_MODE, test $USE_MAINTAINER_MODE = yes)
229   MAINT=$MAINTAINER_MODE_TRUE
230   AC_SUBST(MAINT)dnl
231 ]
232 )
233
234 # Define a conditional.
235
236 AC_DEFUN(AM_CONDITIONAL,
237 [AC_SUBST($1_TRUE)
238 AC_SUBST($1_FALSE)
239 if $2; then
240   $1_TRUE=
241   $1_FALSE='#'
242 else
243   $1_TRUE='#'
244   $1_FALSE=
245 fi])
246
247 # Like AC_CONFIG_HEADER, but automatically create stamp file.
248
249 AC_DEFUN(AM_CONFIG_HEADER,
250 [AC_PREREQ([2.12])
251 AC_CONFIG_HEADER([$1])
252 dnl When config.status generates a header, we must update the stamp-h file.
253 dnl This file resides in the same directory as the config header
254 dnl that is generated.  We must strip everything past the first ":",
255 dnl and everything past the last "/".
256 AC_OUTPUT_COMMANDS(changequote(<<,>>)dnl
257 ifelse(patsubst(<<$1>>, <<[^ ]>>, <<>>), <<>>,
258 <<test -z "<<$>>CONFIG_HEADERS" || echo timestamp > patsubst(<<$1>>, <<^\([^:]*/\)?.*>>, <<\1>>)stamp-h<<>>dnl>>,
259 <<am_indx=1
260 for am_file in <<$1>>; do
261   case " <<$>>CONFIG_HEADERS " in
262   *" <<$>>am_file "*<<)>>
263     echo timestamp > `echo <<$>>am_file | sed -e 's%:.*%%' -e 's%[^/]*$%%'`stamp-h$am_indx
264     ;;
265   esac
266   am_indx=`expr "<<$>>am_indx" + 1`
267 done<<>>dnl>>)
268 changequote([,]))])
269