Imported Upstream version 0.19.7
[platform/upstream/gettext.git] / gettext-tools / gnulib-m4 / alloca.m4
1 # alloca.m4 serial 4 (gettext-0.18.2)
2 dnl Copyright (C) 2002-2003, 2006, 2011, 2015 Free Software Foundation,
3 dnl 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 AC_DEFUN([gl_FUNC_ALLOCA],
9 [
10   dnl Work around a bug of AC_EGREP_CPP in autoconf-2.57.
11   AC_REQUIRE([AC_PROG_CPP])
12   AC_REQUIRE([AC_PROG_EGREP])
13
14   AC_REQUIRE([AC_FUNC_ALLOCA])
15   if test $ac_cv_func_alloca_works = no; then
16     gl_PREREQ_ALLOCA
17   fi
18
19   # Define an additional variable used in the Makefile substitution.
20
21   AC_EGREP_CPP([Need own alloca], [
22 #if defined __GNUC__ || defined _MSC_VER || !HAVE_ALLOCA_H
23   Need own alloca
24 #endif
25     ],
26     ALLOCA_H=alloca.h,
27     ALLOCA_H=)
28   AC_SUBST([ALLOCA_H])
29   AM_CONDITIONAL([GL_GENERATE_ALLOCA_H], [test -n "$ALLOCA_H"])
30 ])
31
32 # Prerequisites of lib/alloca.c.
33 # STACK_DIRECTION is already handled by AC_FUNC_ALLOCA.
34 AC_DEFUN([gl_PREREQ_ALLOCA], [
35   AC_CHECK_HEADERS_ONCE(stdlib.h string.h)
36   :
37 ])