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