Mercurial > hg > octave-jordi > gnulib-hg
annotate m4/alloca.m4 @ 7662:8c905c6c16a0
Fix alloca.m4 message.
author | Bruno Haible <bruno@clisp.org> |
---|---|
date | Wed, 15 Nov 2006 20:54:48 +0000 |
parents | e2febe678452 |
children | d309fd90fbf3 |
rev | line source |
---|---|
7659
e2febe678452
* m4/alloca.m4 (gl_FUNC_ALLOCA): Use AC_CACHE_CHECK to avoid a
Eric Blake <ebb9@byu.net>
parents:
7535
diff
changeset
|
1 # alloca.m4 serial 7 |
7535 | 2 dnl Copyright (C) 2002-2004, 2006 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 | 20 AC_CACHE_CHECK([for alloca as a compiler built-in], [gl_cv_rpl_alloca], [ |
7535 | 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 | 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 | 25 ], [gl_cv_rpl_alloca=yes], [gl_cv_rpl_alloca=no]) |
7535 | 26 ]) |
27 if test $gl_cv_rpl_alloca = yes; then | |
7662 | 28 dnl OK, alloca can be implemented through a compiler built-in. |
7535 | 29 AC_DEFINE([HAVE_ALLOCA], 1, |
7662 | 30 [Define to 1 if you have 'alloca' after including <alloca.h>, |
31 a header that may be supplied by this distribution.]) | |
7535 | 32 ALLOCA_H=alloca.h |
33 else | |
7662 | 34 dnl alloca exists as a library function, i.e. it is slow and probably |
35 dnl a memory leak. Don't define HAVE_ALLOCA in this case. | |
7535 | 36 ALLOCA_H= |
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]) |
5063
1aecdc8063ba
alloca cleanup: always include <alloca.h>.
Paul Eggert <eggert@cs.ucla.edu>
parents:
4631
diff
changeset
|
42 |
1aecdc8063ba
alloca cleanup: always include <alloca.h>.
Paul Eggert <eggert@cs.ucla.edu>
parents:
4631
diff
changeset
|
43 AC_DEFINE(HAVE_ALLOCA_H, 1, |
1aecdc8063ba
alloca cleanup: always include <alloca.h>.
Paul Eggert <eggert@cs.ucla.edu>
parents:
4631
diff
changeset
|
44 [Define HAVE_ALLOCA_H for backward compatibility with older code |
1aecdc8063ba
alloca cleanup: always include <alloca.h>.
Paul Eggert <eggert@cs.ucla.edu>
parents:
4631
diff
changeset
|
45 that includes <alloca.h> only if HAVE_ALLOCA_H is defined.]) |
4107
7c1a6b73f48e
An autoconf macro for its associated module.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
46 ]) |
7c1a6b73f48e
An autoconf macro for its associated module.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
47 |
7c1a6b73f48e
An autoconf macro for its associated module.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
48 # Prerequisites of lib/alloca.c. |
7c1a6b73f48e
An autoconf macro for its associated module.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
49 # STACK_DIRECTION is already handled by AC_FUNC_ALLOCA. |
4631 | 50 AC_DEFUN([gl_PREREQ_ALLOCA], [:]) |