OSDN Git Service

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