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