OSDN Git Service

* parse.y (check_static_final_variable_assignment_flag): Fix spelling.
[pf3gnuchains/gcc-fork.git] / boehm-gc / 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 # FIXME: We temporarily define our own version of AC_PROG_CC.  This is
14 # copied from autoconf 2.12, but does not call AC_PROG_CC_WORKS.  We
15 # are probably using a cross compiler, which will not be able to fully
16 # link an executable.  This should really be fixed in autoconf
17 # itself.
18
19 AC_DEFUN(BOEHM_CONFIGURE,
20 [
21 dnl Default to --enable-multilib
22 AC_ARG_ENABLE(multilib,
23 [  --enable-multilib       build many library versions (default)],
24 [case "${enableval}" in
25   yes) multilib=yes ;;
26   no)  multilib=no ;;
27   *)   AC_MSG_ERROR(bad value ${enableval} for multilib option) ;;
28  esac], [multilib=yes])dnl
29
30 dnl We may get other options which we don't document:
31 dnl --with-target-subdir, --with-multisrctop, --with-multisubdir
32
33 if test "[$]{srcdir}" = "."; then
34   if test "[$]{with_target_subdir}" != "."; then
35     boehm_gc_basedir="[$]{srcdir}/[$]{with_multisrctop}../$1"
36   else
37     boehm_gc_basedir="[$]{srcdir}/[$]{with_multisrctop}$1"
38   fi
39 else
40   boehm_gc_basedir="[$]{srcdir}/$1"
41 fi
42 AC_SUBST(boehm_gc_basedir)
43
44 AC_CANONICAL_HOST
45
46 AM_INIT_AUTOMAKE(boehm-gc, 5.1, no-define)
47
48 # FIXME: We temporarily define our own version of AC_PROG_CC.  This is
49 # copied from autoconf 2.12, but does not call AC_PROG_CC_WORKS.  We
50 # are probably using a cross compiler, which will not be able to fully
51 # link an executable.  This should really be fixed in autoconf
52 # itself.
53
54 AC_DEFUN(LIB_AC_PROG_CC,
55 [AC_BEFORE([$0], [AC_PROG_CPP])dnl
56 dnl Fool anybody using AC_PROG_CC.
57 AC_PROVIDE([AC_PROG_CC])
58 AC_CHECK_PROG(CC, gcc, gcc)
59 if test -z "$CC"; then
60   AC_CHECK_PROG(CC, cc, cc, , , /usr/ucb/cc)
61   test -z "$CC" && AC_MSG_ERROR([no acceptable cc found in \$PATH])
62 fi
63
64 AC_PROG_CC_GNU
65
66 if test $ac_cv_prog_gcc = yes; then
67   GCC=yes
68 dnl Check whether -g works, even if CFLAGS is set, in case the package
69 dnl plays around with CFLAGS (such as to build both debugging and
70 dnl normal versions of a library), tasteless as that idea is.
71   ac_test_CFLAGS="${CFLAGS+set}"
72   ac_save_CFLAGS="$CFLAGS"
73   CFLAGS=
74   AC_PROG_CC_G
75   if test "$ac_test_CFLAGS" = set; then
76     CFLAGS="$ac_save_CFLAGS"
77   elif test $ac_cv_prog_cc_g = yes; then
78     CFLAGS="-g -O2"
79   else
80     CFLAGS="-O2"
81   fi
82 else
83   GCC=
84   test "${CFLAGS+set}" = set || CFLAGS="-g"
85 fi
86 ])
87
88 LIB_AC_PROG_CC
89
90 # Likewise for AC_PROG_CXX.
91 AC_DEFUN(LIB_AC_PROG_CXX,
92 [AC_BEFORE([$0], [AC_PROG_CXXCPP])dnl
93 dnl Fool anybody using AC_PROG_CXX.
94 AC_PROVIDE([AC_PROG_CXX])
95 AC_CHECK_PROGS(CXX, $CCC c++ g++ gcc CC cxx cc++, gcc)
96 test -z "$CXX" && AC_MSG_ERROR([no acceptable c++ found in \$PATH])
97
98 AC_PROG_CXX_GNU
99
100 if test $ac_cv_prog_gxx = yes; then
101   GXX=yes
102 dnl Check whether -g works, even if CXXFLAGS is set, in case the package
103 dnl plays around with CXXFLAGS (such as to build both debugging and
104 dnl normal versions of a library), tasteless as that idea is.
105   ac_test_CXXFLAGS="${CXXFLAGS+set}"
106   ac_save_CXXFLAGS="$CXXFLAGS"
107   CXXFLAGS=
108   AC_PROG_CXX_G
109   if test "$ac_test_CXXFLAGS" = set; then
110     CXXFLAGS="$ac_save_CXXFLAGS"
111   elif test $ac_cv_prog_cxx_g = yes; then
112     CXXFLAGS="-g -O2"
113   else
114     CXXFLAGS="-O2"
115   fi
116 else
117   GXX=
118   test "${CXXFLAGS+set}" = set || CXXFLAGS="-g"
119 fi
120 ])
121
122 LIB_AC_PROG_CXX
123
124 # AC_CHECK_TOOL does AC_REQUIRE (AC_CANONICAL_BUILD).  If we don't
125 # run it explicitly here, it will be run implicitly before
126 # NEWLIB_CONFIGURE, which doesn't work because that means that it will
127 # be run before AC_CANONICAL_HOST.
128 AC_CANONICAL_BUILD
129
130 AC_CHECK_TOOL(AS, as)
131 AC_CHECK_TOOL(AR, ar)
132 AC_CHECK_TOOL(RANLIB, ranlib, :)
133
134 AC_PROG_INSTALL
135
136 AM_MAINTAINER_MODE
137
138 # We need AC_EXEEXT to keep automake happy in cygnus mode.  However,
139 # at least currently, we never actually build a program, so we never
140 # need to use $(EXEEXT).  Moreover, the test for EXEEXT normally
141 # fails, because we are probably configuring with a cross compiler
142 # which can't create executables.  So we include AC_EXEEXT to keep
143 # automake happy, but we don't execute it, since we don't care about
144 # the result.
145 if false; then
146   AC_EXEEXT
147 fi
148
149 . [$]{boehm_gc_basedir}/configure.host
150
151 case [$]{boehm_gc_basedir} in
152 /* | [A-Za-z]:[/\\]*) boehm_gc_flagbasedir=[$]{boehm_gc_basedir} ;;
153 *) boehm_gc_flagbasedir='[$](top_builddir)/'[$]{boehm_gc_basedir} ;;
154 esac
155
156 boehm_gc_cflags="[$]{boehm_gc_cflags} -I"'[$](top_builddir)'"/$1/targ-include -I[$]{boehm_gc_flagbasedir}/libc/include"
157 case "${host}" in
158   *-*-cygwin32*)
159     boehm_gc_cflags="[$]{boehm_gc_cflags} -I[$]{boehm_gc_flagbasedir}/../winsup/include"
160     ;;
161 esac
162
163 boehm_gc_cflags="[$]{boehm_gc_cflags} -fno-builtin"
164
165 BOEHM_GC_CFLAGS=${boehm_gc_cflags}
166 AC_SUBST(BOEHM_GC_CFLAGS)
167 ]))
168
169 ))))
170
171 sinclude(../libtool.m4)
172 dnl The line below arranges for aclocal not to bring a definition of
173 dnl AM_PROG_LIBTOOL into aclocal.m4, while still arranging for automake
174 dnl to add a definition of LIBTOOL to Makefile.in.
175 ifelse(yes,no,[AC_DEFUN([AM_PROG_LIBTOOL],[AC_SUBST(LIBTOOL)])])
176
177 # Do all the work for Automake.  This macro actually does too much --
178 # some checks are only needed if your package does certain things.
179 # But this isn't really a big deal.
180
181 # serial 1
182
183 dnl Usage:
184 dnl AM_INIT_AUTOMAKE(package,version, [no-define])
185
186 AC_DEFUN(AM_INIT_AUTOMAKE,
187 [AC_REQUIRE([AC_PROG_INSTALL])
188 PACKAGE=[$1]
189 AC_SUBST(PACKAGE)
190 VERSION=[$2]
191 AC_SUBST(VERSION)
192 dnl test to see if srcdir already configured
193 if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
194   AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
195 fi
196 ifelse([$3],,
197 AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
198 AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package]))
199 AC_REQUIRE([AM_SANITY_CHECK])
200 AC_REQUIRE([AC_ARG_PROGRAM])
201 dnl FIXME This is truly gross.
202 missing_dir=`cd $ac_aux_dir && pwd`
203 AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir)
204 AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
205 AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir)
206 AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
207 AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir)
208 AC_REQUIRE([AC_PROG_MAKE_SET])])
209
210 #
211 # Check to make sure that the build environment is sane.
212 #
213
214 AC_DEFUN(AM_SANITY_CHECK,
215 [AC_MSG_CHECKING([whether build environment is sane])
216 # Just in case
217 sleep 1
218 echo timestamp > conftestfile
219 # Do `set' in a subshell so we don't clobber the current shell's
220 # arguments.  Must try -L first in case configure is actually a
221 # symlink; some systems play weird games with the mod time of symlinks
222 # (eg FreeBSD returns the mod time of the symlink's containing
223 # directory).
224 if (
225    set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
226    if test "[$]*" = "X"; then
227       # -L didn't work.
228       set X `ls -t $srcdir/configure conftestfile`
229    fi
230    if test "[$]*" != "X $srcdir/configure conftestfile" \
231       && test "[$]*" != "X conftestfile $srcdir/configure"; then
232
233       # If neither matched, then we have a broken ls.  This can happen
234       # if, for instance, CONFIG_SHELL is bash and it inherits a
235       # broken ls alias from the environment.  This has actually
236       # happened.  Such a system could not be considered "sane".
237       AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
238 alias in your environment])
239    fi
240
241    test "[$]2" = conftestfile
242    )
243 then
244    # Ok.
245    :
246 else
247    AC_MSG_ERROR([newly created file is older than distributed files!
248 Check your system clock])
249 fi
250 rm -f conftest*
251 AC_MSG_RESULT(yes)])
252
253 dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY)
254 dnl The program must properly implement --version.
255 AC_DEFUN(AM_MISSING_PROG,
256 [AC_MSG_CHECKING(for working $2)
257 # Run test in a subshell; some versions of sh will print an error if
258 # an executable is not found, even if stderr is redirected.
259 # Redirect stdin to placate older versions of autoconf.  Sigh.
260 if ($2 --version) < /dev/null > /dev/null 2>&1; then
261    $1=$2
262    AC_MSG_RESULT(found)
263 else
264    $1="$3/missing $2"
265    AC_MSG_RESULT(missing)
266 fi
267 AC_SUBST($1)])
268
269 # Add --enable-maintainer-mode option to configure.
270 # From Jim Meyering
271
272 # serial 1
273
274 AC_DEFUN(AM_MAINTAINER_MODE,
275 [AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
276   dnl maintainer-mode is disabled by default
277   AC_ARG_ENABLE(maintainer-mode,
278 [  --enable-maintainer-mode enable make rules and dependencies not useful
279                           (and sometimes confusing) to the casual installer],
280       USE_MAINTAINER_MODE=$enableval,
281       USE_MAINTAINER_MODE=no)
282   AC_MSG_RESULT($USE_MAINTAINER_MODE)
283   AM_CONDITIONAL(MAINTAINER_MODE, test $USE_MAINTAINER_MODE = yes)
284   MAINT=$MAINTAINER_MODE_TRUE
285   AC_SUBST(MAINT)dnl
286 ]
287 )
288
289 # Define a conditional.
290
291 AC_DEFUN(AM_CONDITIONAL,
292 [AC_SUBST($1_TRUE)
293 AC_SUBST($1_FALSE)
294 if $2; then
295   $1_TRUE=
296   $1_FALSE='#'
297 else
298   $1_TRUE='#'
299   $1_FALSE=
300 fi])
301