OSDN Git Service

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