annotate m4/alloca.m4 @ 9592:d309fd90fbf3

gl_FUNC_ALLOCA no longer defines HAVE_ALLOCA_H unconditionally. See <http://lists.gnu.org/archive/html/bug-gnulib/2007-12/msg00149.html>. * NEWS: announce this. * m4/alloca.m4 (gl_FUNC_ALLOCA): Don't define HAVE_ALLOCA_H.
author Paul Eggert <eggert@cs.ucla.edu>
date Wed, 09 Jan 2008 17:22:52 -0800
parents 8c905c6c16a0
children f6cba5a556ce
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
9592
d309fd90fbf3 gl_FUNC_ALLOCA no longer defines HAVE_ALLOCA_H unconditionally.
Paul Eggert <eggert@cs.ucla.edu>
parents: 7662
diff changeset
1 # alloca.m4 serial 8
d309fd90fbf3 gl_FUNC_ALLOCA no longer defines HAVE_ALLOCA_H unconditionally.
Paul Eggert <eggert@cs.ucla.edu>
parents: 7662
diff changeset
2 dnl Copyright (C) 2002-2004, 2006, 2007 Free Software Foundation, Inc.
5611
87c42e194f4a Use an all-permissive copyright notice, recommended by RMS.
Paul Eggert <eggert@cs.ucla.edu>
parents: 5063
diff changeset
3 dnl This file is free software; the Free Software Foundation
87c42e194f4a Use an all-permissive copyright notice, recommended by RMS.
Paul Eggert <eggert@cs.ucla.edu>
parents: 5063
diff changeset
4 dnl gives unlimited permission to copy and/or distribute it,
87c42e194f4a Use an all-permissive copyright notice, recommended by RMS.
Paul Eggert <eggert@cs.ucla.edu>
parents: 5063
diff changeset
5 dnl with or without modifications, as long as this notice is preserved.
4107
7c1a6b73f48e An autoconf macro for its associated module.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
6
7c1a6b73f48e An autoconf macro for its associated module.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
7 AC_DEFUN([gl_FUNC_ALLOCA],
7c1a6b73f48e An autoconf macro for its associated module.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
8 [
4184
bd50be83d452 Work around a bug of AC_EGREP_CPP in autoconf-2.57.
Bruno Haible <bruno@clisp.org>
parents: 4156
diff changeset
9 dnl Work around a bug of AC_EGREP_CPP in autoconf-2.57.
bd50be83d452 Work around a bug of AC_EGREP_CPP in autoconf-2.57.
Bruno Haible <bruno@clisp.org>
parents: 4156
diff changeset
10 AC_REQUIRE([AC_PROG_CPP])
bd50be83d452 Work around a bug of AC_EGREP_CPP in autoconf-2.57.
Bruno Haible <bruno@clisp.org>
parents: 4156
diff changeset
11 AC_REQUIRE([AC_PROG_EGREP])
bd50be83d452 Work around a bug of AC_EGREP_CPP in autoconf-2.57.
Bruno Haible <bruno@clisp.org>
parents: 4156
diff changeset
12
4107
7c1a6b73f48e An autoconf macro for its associated module.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
13 AC_REQUIRE([AC_FUNC_ALLOCA])
7c1a6b73f48e An autoconf macro for its associated module.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
14 if test $ac_cv_func_alloca_works = no; then
7c1a6b73f48e An autoconf macro for its associated module.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
15 gl_PREREQ_ALLOCA
7c1a6b73f48e An autoconf macro for its associated module.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
16 fi
4156
99ea86c79f44 Make it possibly to simply write: #include <alloca.h>.
Bruno Haible <bruno@clisp.org>
parents: 4107
diff changeset
17
99ea86c79f44 Make it possibly to simply write: #include <alloca.h>.
Bruno Haible <bruno@clisp.org>
parents: 4107
diff changeset
18 # Define an additional variable used in the Makefile substitution.
5063
1aecdc8063ba alloca cleanup: always include <alloca.h>.
Paul Eggert <eggert@cs.ucla.edu>
parents: 4631
diff changeset
19 if test $ac_cv_working_alloca_h = yes; then
7662
8c905c6c16a0 Fix alloca.m4 message.
Bruno Haible <bruno@clisp.org>
parents: 7659
diff changeset
20 AC_CACHE_CHECK([for alloca as a compiler built-in], [gl_cv_rpl_alloca], [
7535
a0dfb5334b53 Cache a result.
Bruno Haible <bruno@clisp.org>
parents: 5611
diff changeset
21 AC_EGREP_CPP([Need own alloca], [
5063
1aecdc8063ba alloca cleanup: always include <alloca.h>.
Paul Eggert <eggert@cs.ucla.edu>
parents: 4631
diff changeset
22 #if defined __GNUC__ || defined _AIX || defined _MSC_VER
7662
8c905c6c16a0 Fix alloca.m4 message.
Bruno Haible <bruno@clisp.org>
parents: 7659
diff changeset
23 Need own alloca
4156
99ea86c79f44 Make it possibly to simply write: #include <alloca.h>.
Bruno Haible <bruno@clisp.org>
parents: 4107
diff changeset
24 #endif
7662
8c905c6c16a0 Fix alloca.m4 message.
Bruno Haible <bruno@clisp.org>
parents: 7659
diff changeset
25 ], [gl_cv_rpl_alloca=yes], [gl_cv_rpl_alloca=no])
7535
a0dfb5334b53 Cache a result.
Bruno Haible <bruno@clisp.org>
parents: 5611
diff changeset
26 ])
a0dfb5334b53 Cache a result.
Bruno Haible <bruno@clisp.org>
parents: 5611
diff changeset
27 if test $gl_cv_rpl_alloca = yes; then
7662
8c905c6c16a0 Fix alloca.m4 message.
Bruno Haible <bruno@clisp.org>
parents: 7659
diff changeset
28 dnl OK, alloca can be implemented through a compiler built-in.
7535
a0dfb5334b53 Cache a result.
Bruno Haible <bruno@clisp.org>
parents: 5611
diff changeset
29 AC_DEFINE([HAVE_ALLOCA], 1,
7662
8c905c6c16a0 Fix alloca.m4 message.
Bruno Haible <bruno@clisp.org>
parents: 7659
diff changeset
30 [Define to 1 if you have 'alloca' after including <alloca.h>,
8c905c6c16a0 Fix alloca.m4 message.
Bruno Haible <bruno@clisp.org>
parents: 7659
diff changeset
31 a header that may be supplied by this distribution.])
7535
a0dfb5334b53 Cache a result.
Bruno Haible <bruno@clisp.org>
parents: 5611
diff changeset
32 ALLOCA_H=alloca.h
a0dfb5334b53 Cache a result.
Bruno Haible <bruno@clisp.org>
parents: 5611
diff changeset
33 else
7662
8c905c6c16a0 Fix alloca.m4 message.
Bruno Haible <bruno@clisp.org>
parents: 7659
diff changeset
34 dnl alloca exists as a library function, i.e. it is slow and probably
8c905c6c16a0 Fix alloca.m4 message.
Bruno Haible <bruno@clisp.org>
parents: 7659
diff changeset
35 dnl a memory leak. Don't define HAVE_ALLOCA in this case.
7535
a0dfb5334b53 Cache a result.
Bruno Haible <bruno@clisp.org>
parents: 5611
diff changeset
36 ALLOCA_H=
a0dfb5334b53 Cache a result.
Bruno Haible <bruno@clisp.org>
parents: 5611
diff changeset
37 fi
5063
1aecdc8063ba alloca cleanup: always include <alloca.h>.
Paul Eggert <eggert@cs.ucla.edu>
parents: 4631
diff changeset
38 else
1aecdc8063ba alloca cleanup: always include <alloca.h>.
Paul Eggert <eggert@cs.ucla.edu>
parents: 4631
diff changeset
39 ALLOCA_H=alloca.h
1aecdc8063ba alloca cleanup: always include <alloca.h>.
Paul Eggert <eggert@cs.ucla.edu>
parents: 4631
diff changeset
40 fi
4156
99ea86c79f44 Make it possibly to simply write: #include <alloca.h>.
Bruno Haible <bruno@clisp.org>
parents: 4107
diff changeset
41 AC_SUBST([ALLOCA_H])
4107
7c1a6b73f48e An autoconf macro for its associated module.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
42 ])
7c1a6b73f48e An autoconf macro for its associated module.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
43
7c1a6b73f48e An autoconf macro for its associated module.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
44 # Prerequisites of lib/alloca.c.
7c1a6b73f48e An autoconf macro for its associated module.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
45 # STACK_DIRECTION is already handled by AC_FUNC_ALLOCA.
4631
069117fb861f Remove K&R cruft.
Paul Eggert <eggert@cs.ucla.edu>
parents: 4334
diff changeset
46 AC_DEFUN([gl_PREREQ_ALLOCA], [:])