OSDN Git Service

* configure.in (AC_EXEEXT): Work around in case it expands to
[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   # autoconf 2.50 runs AC_EXEEXT by default, and the macro expands
153   # to nothing, so nothing would remain between `then' and `fi' if it
154   # were not for the `:' below.
155   :
156   AC_EXEEXT
157 fi
158
159 . [$]{boehm_gc_basedir}/configure.host
160
161 case [$]{boehm_gc_basedir} in
162 /* | [A-Za-z]:[/\\]*) boehm_gc_flagbasedir=[$]{boehm_gc_basedir} ;;
163 *) boehm_gc_flagbasedir='[$](top_builddir)/'[$]{boehm_gc_basedir} ;;
164 esac
165
166 boehm_gc_cflags="[$]{boehm_gc_cflags} -I"'[$](top_builddir)'"/$1/targ-include -I[$]{boehm_gc_flagbasedir}/libc/include"
167 case "${host}" in
168   *-*-cygwin32*)
169     boehm_gc_cflags="[$]{boehm_gc_cflags} -I[$]{boehm_gc_flagbasedir}/../winsup/include"
170     ;;
171 esac
172
173 boehm_gc_cflags="[$]{boehm_gc_cflags} -fno-builtin"
174
175 BOEHM_GC_CFLAGS=${boehm_gc_cflags}
176 AC_SUBST(BOEHM_GC_CFLAGS)
177 ]))
178
179 ))))
180
181 sinclude(../libtool.m4)
182 dnl The line below arranges for aclocal not to bring a definition of
183 dnl AM_PROG_LIBTOOL into aclocal.m4, while still arranging for automake
184 dnl to add a definition of LIBTOOL to Makefile.in.
185 ifelse(yes,no,[AC_DEFUN([AM_PROG_LIBTOOL],[AC_SUBST(LIBTOOL)])])
186
187 # Do all the work for Automake.  This macro actually does too much --
188 # some checks are only needed if your package does certain things.
189 # But this isn't really a big deal.
190
191 # serial 1
192
193 dnl Usage:
194 dnl AM_INIT_AUTOMAKE(package,version, [no-define])
195
196 AC_DEFUN(AM_INIT_AUTOMAKE,
197 [AC_REQUIRE([AC_PROG_INSTALL])
198 PACKAGE=[$1]
199 AC_SUBST(PACKAGE)
200 VERSION=[$2]
201 AC_SUBST(VERSION)
202 dnl test to see if srcdir already configured
203 if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
204   AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
205 fi
206 ifelse([$3],,
207 AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
208 AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package]))
209 AC_REQUIRE([AM_SANITY_CHECK])
210 AC_REQUIRE([AC_ARG_PROGRAM])
211 dnl FIXME This is truly gross.
212 missing_dir=`cd $ac_aux_dir && pwd`
213 AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir)
214 AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
215 AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir)
216 AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
217 AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir)
218 AC_REQUIRE([AC_PROG_MAKE_SET])])
219
220 #
221 # Check to make sure that the build environment is sane.
222 #
223
224 AC_DEFUN(AM_SANITY_CHECK,
225 [AC_MSG_CHECKING([whether build environment is sane])
226 # Just in case
227 sleep 1
228 echo timestamp > conftestfile
229 # Do `set' in a subshell so we don't clobber the current shell's
230 # arguments.  Must try -L first in case configure is actually a
231 # symlink; some systems play weird games with the mod time of symlinks
232 # (eg FreeBSD returns the mod time of the symlink's containing
233 # directory).
234 if (
235    set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
236    if test "[$]*" = "X"; then
237       # -L didn't work.
238       set X `ls -t $srcdir/configure conftestfile`
239    fi
240    if test "[$]*" != "X $srcdir/configure conftestfile" \
241       && test "[$]*" != "X conftestfile $srcdir/configure"; then
242
243       # If neither matched, then we have a broken ls.  This can happen
244       # if, for instance, CONFIG_SHELL is bash and it inherits a
245       # broken ls alias from the environment.  This has actually
246       # happened.  Such a system could not be considered "sane".
247       AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
248 alias in your environment])
249    fi
250
251    test "[$]2" = conftestfile
252    )
253 then
254    # Ok.
255    :
256 else
257    AC_MSG_ERROR([newly created file is older than distributed files!
258 Check your system clock])
259 fi
260 rm -f conftest*
261 AC_MSG_RESULT(yes)])
262
263 dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY)
264 dnl The program must properly implement --version.
265 AC_DEFUN(AM_MISSING_PROG,
266 [AC_MSG_CHECKING(for working $2)
267 # Run test in a subshell; some versions of sh will print an error if
268 # an executable is not found, even if stderr is redirected.
269 # Redirect stdin to placate older versions of autoconf.  Sigh.
270 if ($2 --version) < /dev/null > /dev/null 2>&1; then
271    $1=$2
272    AC_MSG_RESULT(found)
273 else
274    $1="$3/missing $2"
275    AC_MSG_RESULT(missing)
276 fi
277 AC_SUBST($1)])
278
279 # Add --enable-maintainer-mode option to configure.
280 # From Jim Meyering
281
282 # serial 1
283
284 AC_DEFUN(AM_MAINTAINER_MODE,
285 [AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
286   dnl maintainer-mode is disabled by default
287   AC_ARG_ENABLE(maintainer-mode,
288 [  --enable-maintainer-mode enable make rules and dependencies not useful
289                           (and sometimes confusing) to the casual installer],
290       USE_MAINTAINER_MODE=$enableval,
291       USE_MAINTAINER_MODE=no)
292   AC_MSG_RESULT($USE_MAINTAINER_MODE)
293   AM_CONDITIONAL(MAINTAINER_MODE, test $USE_MAINTAINER_MODE = yes)
294   MAINT=$MAINTAINER_MODE_TRUE
295   AC_SUBST(MAINT)dnl
296 ]
297 )
298
299 # Define a conditional.
300
301 AC_DEFUN(AM_CONDITIONAL,
302 [AC_SUBST($1_TRUE)
303 AC_SUBST($1_FALSE)
304 if $2; then
305   $1_TRUE=
306   $1_FALSE='#'
307 else
308   $1_TRUE='#'
309   $1_FALSE=
310 fi])
311