alloca.m4 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. # alloca.m4 serial 5
  2. dnl Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
  3. dnl This file is free software; the Free Software Foundation
  4. dnl gives unlimited permission to copy and/or distribute it,
  5. dnl with or without modifications, as long as this notice is preserved.
  6. AC_DEFUN([gl_FUNC_ALLOCA],
  7. [
  8. dnl Work around a bug of AC_EGREP_CPP in autoconf-2.57.
  9. AC_REQUIRE([AC_PROG_CPP])
  10. AC_REQUIRE([AC_PROG_EGREP])
  11. AC_REQUIRE([AC_FUNC_ALLOCA])
  12. if test $ac_cv_func_alloca_works = no; then
  13. gl_PREREQ_ALLOCA
  14. fi
  15. # Define an additional variable used in the Makefile substitution.
  16. if test $ac_cv_working_alloca_h = yes; then
  17. AC_EGREP_CPP([Need own alloca], [
  18. #if defined __GNUC__ || defined _AIX || defined _MSC_VER
  19. Need own alloca
  20. #endif
  21. ],
  22. [AC_DEFINE(HAVE_ALLOCA, 1,
  23. [Define to 1 if you have `alloca' after including <alloca.h>,
  24. a header that may be supplied by this distribution.])
  25. ALLOCA_H=alloca.h],
  26. [ALLOCA_H=])
  27. else
  28. ALLOCA_H=alloca.h
  29. fi
  30. AC_SUBST([ALLOCA_H])
  31. AC_DEFINE(HAVE_ALLOCA_H, 1,
  32. [Define HAVE_ALLOCA_H for backward compatibility with older code
  33. that includes <alloca.h> only if HAVE_ALLOCA_H is defined.])
  34. ])
  35. # Prerequisites of lib/alloca.c.
  36. # STACK_DIRECTION is already handled by AC_FUNC_ALLOCA.
  37. AC_DEFUN([gl_PREREQ_ALLOCA], [:])