OSDN Git Service

8c5eed0386f8d66aa039d33dce6ecedd5253d1fb
[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 AC_DEFUN(GC_CONFIGURE,
27 [
28
29 AM_INIT_AUTOMAKE(gc, 6.1a1, no-define)
30
31 # The autoconf 2.5x version of the no-executables hack.
32 sinclude(../config/no-executables.m4)
33 GCC_NO_EXECUTABLES
34
35 # Yak.  We must force CC and CXX to /not/ be precious variables; otherwise
36 # the wrong, non-multilib-adjusted value will be used in multilibs.
37 # As a side effect, we have to subst CFLAGS and CXXFLAGS ourselves.
38
39 m4_rename([_AC_ARG_VAR_PRECIOUS],[real_PRECIOUS])
40 m4_define([_AC_ARG_VAR_PRECIOUS],[])
41 AC_PROG_CC
42 AC_PROG_CXX
43 m4_rename([real_PRECIOUS],[_AC_ARG_VAR_PRECIOUS])
44
45 AC_SUBST(CFLAGS)
46 AC_SUBST(CXXFLAGS)
47
48 AC_CHECK_TOOL(AS, as)
49 AC_CHECK_TOOL(AR, ar)
50 AC_CHECK_TOOL(RANLIB, ranlib, :)
51
52 AC_PROG_INSTALL
53
54 AM_MAINTAINER_MODE
55
56 # We need AC_EXEEXT to keep automake happy in cygnus mode.  However,
57 # at least currently, we never actually build a program, so we never
58 # need to use $(EXEEXT).  Moreover, the test for EXEEXT normally
59 # fails, because we are probably configuring with a cross compiler
60 # which can't create executables.  So we include AC_EXEEXT to keep
61 # automake happy, but we don't execute it, since we don't care about
62 # the result.
63 if false; then
64   # autoconf 2.50 runs AC_EXEEXT by default, and the macro expands
65   # to nothing, so nothing would remain between `then' and `fi' if it
66   # were not for the `:' below.
67   :
68   AC_EXEEXT
69 fi
70
71 . [$]{srcdir}/configure.host
72
73 case [$]{gc_basedir} in
74 /* | [A-Za-z]:[/\\]*) gc_flagbasedir=[$]{gc_basedir} ;;
75 *) gc_flagbasedir='[$](top_builddir)/'[$]{gc_basedir} ;;
76 esac
77
78 gc_cflags="[$]{gc_cflags} -I"'[$](top_builddir)'"/$1/targ-include -I[$]{gc_flagbasedir}/libc/include"
79 case "${host}" in
80   *-*-cygwin32*)
81     gc_cflags="[$]{gc_cflags} -I[$]{gc_flagbasedir}/../winsup/include"
82     ;;
83 esac
84
85 dnl gc_cflags="[$]{gc_cflags} -fno-builtin"
86
87 GC_CFLAGS=${gc_cflags}
88 AC_SUBST(GC_CFLAGS)
89 ]))
90
91 ))))
92
93 sinclude(../libtool.m4)
94 dnl The line below arranges for aclocal not to bring a definition of
95 dnl AM_PROG_LIBTOOL into aclocal.m4, while still arranging for automake
96 dnl to add a definition of LIBTOOL to Makefile.in.
97 ifelse(yes,no,[AC_DEFUN([AM_PROG_LIBTOOL],[AC_SUBST(LIBTOOL)])])
98
99 # Do all the work for Automake.  This macro actually does too much --
100 # some checks are only needed if your package does certain things.
101 # But this isn't really a big deal.
102
103 # serial 1
104
105 dnl Usage:
106 dnl AM_INIT_AUTOMAKE(package,version, [no-define])
107
108 AC_DEFUN(AM_INIT_AUTOMAKE,
109 [AC_REQUIRE([AC_PROG_INSTALL])
110 PACKAGE=[$1]
111 AC_SUBST(PACKAGE)
112 VERSION=[$2]
113 AC_SUBST(VERSION)
114 dnl test to see if srcdir already configured
115 if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
116   AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
117 fi
118 ifelse([$3],,
119 AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
120 AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package]))
121 AC_REQUIRE([AM_SANITY_CHECK])
122 AC_REQUIRE([AC_ARG_PROGRAM])
123 dnl FIXME This is truly gross.
124 missing_dir=`cd $ac_aux_dir && pwd`
125 AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir)
126 AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
127 AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir)
128 AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
129 AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir)
130 AC_REQUIRE([AC_PROG_MAKE_SET])])
131
132 #
133 # Check to make sure that the build environment is sane.
134 #
135
136 AC_DEFUN(AM_SANITY_CHECK,
137 [AC_MSG_CHECKING([whether build environment is sane])
138 # Just in case
139 sleep 1
140 echo timestamp > conftestfile
141 # Do `set' in a subshell so we don't clobber the current shell's
142 # arguments.  Must try -L first in case configure is actually a
143 # symlink; some systems play weird games with the mod time of symlinks
144 # (eg FreeBSD returns the mod time of the symlink's containing
145 # directory).
146 if (
147    set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
148    if test "[$]*" = "X"; then
149       # -L didn't work.
150       set X `ls -t $srcdir/configure conftestfile`
151    fi
152    if test "[$]*" != "X $srcdir/configure conftestfile" \
153       && test "[$]*" != "X conftestfile $srcdir/configure"; then
154
155       # If neither matched, then we have a broken ls.  This can happen
156       # if, for instance, CONFIG_SHELL is bash and it inherits a
157       # broken ls alias from the environment.  This has actually
158       # happened.  Such a system could not be considered "sane".
159       AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
160 alias in your environment])
161    fi
162
163    test "[$]2" = conftestfile
164    )
165 then
166    # Ok.
167    :
168 else
169    AC_MSG_ERROR([newly created file is older than distributed files!
170 Check your system clock])
171 fi
172 rm -f conftest*
173 AC_MSG_RESULT(yes)])
174
175 dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY)
176 dnl The program must properly implement --version.
177 AC_DEFUN(AM_MISSING_PROG,
178 [AC_MSG_CHECKING(for working $2)
179 # Run test in a subshell; some versions of sh will print an error if
180 # an executable is not found, even if stderr is redirected.
181 # Redirect stdin to placate older versions of autoconf.  Sigh.
182 if ($2 --version) < /dev/null > /dev/null 2>&1; then
183    $1=$2
184    AC_MSG_RESULT(found)
185 else
186    $1="$3/missing $2"
187    AC_MSG_RESULT(missing)
188 fi
189 AC_SUBST($1)])
190
191 # Add --enable-maintainer-mode option to configure.
192 # From Jim Meyering
193
194 # serial 1
195
196 AC_DEFUN(AM_MAINTAINER_MODE,
197 [AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
198   dnl maintainer-mode is disabled by default
199   AC_ARG_ENABLE(maintainer-mode,
200 [  --enable-maintainer-mode enable make rules and dependencies not useful
201                           (and sometimes confusing) to the casual installer],
202       USE_MAINTAINER_MODE=$enableval,
203       USE_MAINTAINER_MODE=no)
204   AC_MSG_RESULT($USE_MAINTAINER_MODE)
205   AM_CONDITIONAL(MAINTAINER_MODE, test $USE_MAINTAINER_MODE = yes)
206   MAINT=$MAINTAINER_MODE_TRUE
207   AC_SUBST(MAINT)dnl
208 ]
209 )
210
211 # Define a conditional.
212
213 AC_DEFUN(AM_CONDITIONAL,
214 [AC_SUBST($1_TRUE)
215 AC_SUBST($1_FALSE)
216 if $2; then
217   $1_TRUE=
218   $1_FALSE='#'
219 else
220   $1_TRUE='#'
221   $1_FALSE=
222 fi])
223