summaryrefslogtreecommitdiffstats
path: root/gl/m4/alloca.m4
diff options
context:
space:
mode:
Diffstat (limited to 'gl/m4/alloca.m4')
-rw-r--r--gl/m4/alloca.m445
1 files changed, 16 insertions, 29 deletions
diff --git a/gl/m4/alloca.m4 b/gl/m4/alloca.m4
index 270abd0..ba2f679 100644
--- a/gl/m4/alloca.m4
+++ b/gl/m4/alloca.m4
@@ -1,5 +1,5 @@
1# alloca.m4 serial 14 1# alloca.m4 serial 20
2dnl Copyright (C) 2002-2004, 2006-2007, 2009-2013 Free Software Foundation, 2dnl Copyright (C) 2002-2004, 2006-2007, 2009-2021 Free Software Foundation,
3dnl Inc. 3dnl Inc.
4dnl This file is free software; the Free Software Foundation 4dnl This file is free software; the Free Software Foundation
5dnl gives unlimited permission to copy and/or distribute it, 5dnl gives unlimited permission to copy and/or distribute it,
@@ -37,19 +37,26 @@ AC_DEFUN([gl_FUNC_ALLOCA],
37 fi 37 fi
38 AC_SUBST([ALLOCA_H]) 38 AC_SUBST([ALLOCA_H])
39 AM_CONDITIONAL([GL_GENERATE_ALLOCA_H], [test -n "$ALLOCA_H"]) 39 AM_CONDITIONAL([GL_GENERATE_ALLOCA_H], [test -n "$ALLOCA_H"])
40
41 if test $ac_cv_working_alloca_h = yes; then
42 HAVE_ALLOCA_H=1
43 else
44 HAVE_ALLOCA_H=0
45 fi
46 AC_SUBST([HAVE_ALLOCA_H])
40]) 47])
41 48
42# Prerequisites of lib/alloca.c. 49# Prerequisites of lib/alloca.c.
43# STACK_DIRECTION is already handled by AC_FUNC_ALLOCA. 50# STACK_DIRECTION is already handled by AC_FUNC_ALLOCA.
44AC_DEFUN([gl_PREREQ_ALLOCA], [:]) 51AC_DEFUN([gl_PREREQ_ALLOCA], [:])
45 52
46# This works around a bug in autoconf <= 2.68. 53m4_version_prereq([2.70], [], [
47# See <http://lists.gnu.org/archive/html/bug-gnulib/2011-06/msg00277.html>.
48 54
49m4_version_prereq([2.69], [] ,[ 55# This works around a bug in autoconf <= 2.68 and has simplifications
50 56# from 2.70. See:
51# This is taken from the following Autoconf patch: 57# https://lists.gnu.org/r/bug-gnulib/2011-06/msg00277.html
52# http://git.savannah.gnu.org/cgit/autoconf.git/commit/?id=6cd9f12520b0d6f76d3230d7565feba1ecf29497 58# https://git.savannah.gnu.org/cgit/autoconf.git/commit/?id=6cd9f12520b0d6f76d3230d7565feba1ecf29497
59# https://git.savannah.gnu.org/cgit/autoconf.git/commit/?id=15edf7fd8094fd14a89d9891dd72a9624762597a
53 60
54# _AC_LIBOBJ_ALLOCA 61# _AC_LIBOBJ_ALLOCA
55# ----------------- 62# -----------------
@@ -65,26 +72,6 @@ AC_LIBSOURCES(alloca.c)
65AC_SUBST([ALLOCA], [\${LIBOBJDIR}alloca.$ac_objext])dnl 72AC_SUBST([ALLOCA], [\${LIBOBJDIR}alloca.$ac_objext])dnl
66AC_DEFINE(C_ALLOCA, 1, [Define to 1 if using 'alloca.c'.]) 73AC_DEFINE(C_ALLOCA, 1, [Define to 1 if using 'alloca.c'.])
67 74
68AC_CACHE_CHECK(whether 'alloca.c' needs Cray hooks, ac_cv_os_cray,
69[AC_EGREP_CPP(webecray,
70[#if defined CRAY && ! defined CRAY2
71webecray
72#else
73wenotbecray
74#endif
75], ac_cv_os_cray=yes, ac_cv_os_cray=no)])
76if test $ac_cv_os_cray = yes; then
77 for ac_func in _getb67 GETB67 getb67; do
78 AC_CHECK_FUNC($ac_func,
79 [AC_DEFINE_UNQUOTED(CRAY_STACKSEG_END, $ac_func,
80 [Define to one of '_getb67', 'GETB67',
81 'getb67' for Cray-2 and Cray-YMP
82 systems. This function is required for
83 'alloca.c' support on those systems.])
84 break])
85 done
86fi
87
88AC_CACHE_CHECK([stack direction for C alloca], 75AC_CACHE_CHECK([stack direction for C alloca],
89 [ac_cv_c_stack_direction], 76 [ac_cv_c_stack_direction],
90[AC_RUN_IFELSE([AC_LANG_SOURCE( 77[AC_RUN_IFELSE([AC_LANG_SOURCE(
@@ -115,7 +102,7 @@ AH_VERBATIM([STACK_DIRECTION],
115 STACK_DIRECTION > 0 => grows toward higher addresses 102 STACK_DIRECTION > 0 => grows toward higher addresses
116 STACK_DIRECTION < 0 => grows toward lower addresses 103 STACK_DIRECTION < 0 => grows toward lower addresses
117 STACK_DIRECTION = 0 => direction of growth unknown */ 104 STACK_DIRECTION = 0 => direction of growth unknown */
118@%:@undef STACK_DIRECTION])dnl 105#undef STACK_DIRECTION])dnl
119AC_DEFINE_UNQUOTED(STACK_DIRECTION, $ac_cv_c_stack_direction) 106AC_DEFINE_UNQUOTED(STACK_DIRECTION, $ac_cv_c_stack_direction)
120])# _AC_LIBOBJ_ALLOCA 107])# _AC_LIBOBJ_ALLOCA
121]) 108])