OSDN Git Service

2001-06-19 Mark J. Roberts <mjr@statesmean.com>
[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   # autoconf 2.50 runs AC_EXEEXT by default, and the macro expands
83   # to nothing, so nothing would remain between `then' and `fi' if it
84   # were not for the `:' below.
85   :
86   AC_EXEEXT
87 fi
88
89 # configure.host sets the following important variables
90 #       libgcj_cflags    - host specific C compiler flags
91 #       libgcj_cxxflags  - host specific C++ compiler flags
92 #       libgcj_javaflags - host specific Java compiler flags
93
94 libgcj_cflags=
95 libgcj_cxxflags=
96 libgcj_javaflags=
97
98 . [$]{srcdir}/configure.host
99
100 case [$]{libgcj_basedir} in
101 /* | [A-Za-z]:[/\\]*) libgcj_flagbasedir=[$]{libgcj_basedir} ;;
102 *) libgcj_flagbasedir='[$](top_builddir)/'[$]{libgcj_basedir} ;;
103 esac
104
105 LIBGCJ_CFLAGS="[$]{libgcj_cflags}"
106 LIBGCJ_CXXFLAGS="[$]{libgcj_cxxflags}"
107 LIBGCJ_JAVAFLAGS="[$]{libgcj_javaflags}"
108 AC_SUBST(LIBGCJ_CFLAGS)
109 AC_SUBST(LIBGCJ_CXXFLAGS)
110 AC_SUBST(LIBGCJ_JAVAFLAGS)
111 ])dnl
112
113 sinclude(../libtool.m4)
114 dnl The lines below arrange for aclocal not to bring libtool.m4
115 dnl AM_PROG_LIBTOOL into aclocal.m4, while still arranging for automake
116 dnl to add a definition of LIBTOOL to Makefile.in.
117 ifelse(yes,no,[
118 AC_DEFUN([AM_PROG_LIBTOOL],)
119 AC_DEFUN([AC_LIBTOOL_DLOPEN],)
120 AC_DEFUN([AC_LIBLTDL_CONVENIENCE],)
121 AC_DEFUN([LT_AC_PROG_GCJ],)
122 AC_SUBST(GCJ)
123 AC_SUBST(LIBTOOL)
124 ])
125
126 # Do all the work for Automake.  This macro actually does too much --
127 # some checks are only needed if your package does certain things.
128 # But this isn't really a big deal.
129
130 # serial 1
131
132 dnl Usage:
133 dnl AM_INIT_AUTOMAKE(package,version, [no-define])
134
135 AC_DEFUN(AM_INIT_AUTOMAKE,
136 [AC_REQUIRE([AC_PROG_INSTALL])
137 PACKAGE=[$1]
138 AC_SUBST(PACKAGE)
139 VERSION=[$2]
140 AC_SUBST(VERSION)
141 dnl test to see if srcdir already configured
142 if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
143   AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
144 fi
145 ifelse([$3],,
146 AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
147 AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package]))
148 AC_REQUIRE([AM_SANITY_CHECK])
149 AC_REQUIRE([AC_ARG_PROGRAM])
150 dnl FIXME This is truly gross.
151 missing_dir=`cd $ac_aux_dir && pwd`
152 AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir)
153 AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
154 AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir)
155 AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
156 AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir)
157 AC_REQUIRE([AC_PROG_MAKE_SET])])
158
159 #
160 # Check to make sure that the build environment is sane.
161 #
162
163 AC_DEFUN(AM_SANITY_CHECK,
164 [AC_MSG_CHECKING([whether build environment is sane])
165 # Just in case
166 sleep 1
167 echo timestamp > conftestfile
168 # Do `set' in a subshell so we don't clobber the current shell's
169 # arguments.  Must try -L first in case configure is actually a
170 # symlink; some systems play weird games with the mod time of symlinks
171 # (eg FreeBSD returns the mod time of the symlink's containing
172 # directory).
173 if (
174    set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
175    if test "[$]*" = "X"; then
176       # -L didn't work.
177       set X `ls -t $srcdir/configure conftestfile`
178    fi
179    if test "[$]*" != "X $srcdir/configure conftestfile" \
180       && test "[$]*" != "X conftestfile $srcdir/configure"; then
181
182       # If neither matched, then we have a broken ls.  This can happen
183       # if, for instance, CONFIG_SHELL is bash and it inherits a
184       # broken ls alias from the environment.  This has actually
185       # happened.  Such a system could not be considered "sane".
186       AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
187 alias in your environment])
188    fi
189
190    test "[$]2" = conftestfile
191    )
192 then
193    # Ok.
194    :
195 else
196    AC_MSG_ERROR([newly created file is older than distributed files!
197 Check your system clock])
198 fi
199 rm -f conftest*
200 AC_MSG_RESULT(yes)])
201
202 dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY)
203 dnl The program must properly implement --version.
204 AC_DEFUN(AM_MISSING_PROG,
205 [AC_MSG_CHECKING(for working $2)
206 # Run test in a subshell; some versions of sh will print an error if
207 # an executable is not found, even if stderr is redirected.
208 # Redirect stdin to placate older versions of autoconf.  Sigh.
209 if ($2 --version) < /dev/null > /dev/null 2>&1; then
210    $1=$2
211    AC_MSG_RESULT(found)
212 else
213    $1="$3/missing $2"
214    AC_MSG_RESULT(missing)
215 fi
216 AC_SUBST($1)])
217
218 # Add --enable-maintainer-mode option to configure.
219 # From Jim Meyering
220
221 # serial 1
222
223 AC_DEFUN(AM_MAINTAINER_MODE,
224 [AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
225   dnl maintainer-mode is disabled by default
226   AC_ARG_ENABLE(maintainer-mode,
227 [  --enable-maintainer-mode enable make rules and dependencies not useful
228                           (and sometimes confusing) to the casual installer],
229       USE_MAINTAINER_MODE=$enableval,
230       USE_MAINTAINER_MODE=no)
231   AC_MSG_RESULT($USE_MAINTAINER_MODE)
232   AM_CONDITIONAL(MAINTAINER_MODE, test $USE_MAINTAINER_MODE = yes)
233   MAINT=$MAINTAINER_MODE_TRUE
234   AC_SUBST(MAINT)dnl
235 ]
236 )
237
238 # Define a conditional.
239
240 AC_DEFUN(AM_CONDITIONAL,
241 [AC_SUBST($1_TRUE)
242 AC_SUBST($1_FALSE)
243 if $2; then
244   $1_TRUE=
245   $1_FALSE='#'
246 else
247   $1_TRUE='#'
248   $1_FALSE=
249 fi])
250
251 # Like AC_CONFIG_HEADER, but automatically create stamp file.
252
253 AC_DEFUN(AM_CONFIG_HEADER,
254 [AC_PREREQ([2.12])
255 AC_CONFIG_HEADER([$1])
256 dnl When config.status generates a header, we must update the stamp-h file.
257 dnl This file resides in the same directory as the config header
258 dnl that is generated.  We must strip everything past the first ":",
259 dnl and everything past the last "/".
260 AC_OUTPUT_COMMANDS(changequote(<<,>>)dnl
261 ifelse(patsubst(<<$1>>, <<[^ ]>>, <<>>), <<>>,
262 <<test -z "<<$>>CONFIG_HEADERS" || echo timestamp > patsubst(<<$1>>, <<^\([^:]*/\)?.*>>, <<\1>>)stamp-h<<>>dnl>>,
263 <<am_indx=1
264 for am_file in <<$1>>; do
265   case " <<$>>CONFIG_HEADERS " in
266   *" <<$>>am_file "*<<)>>
267     echo timestamp > `echo <<$>>am_file | sed -e 's%:.*%%' -e 's%[^/]*$%%'`stamp-h$am_indx
268     ;;
269   esac
270   am_indx=`expr "<<$>>am_indx" + 1`
271 done<<>>dnl>>)
272 changequote([,]))])
273