You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

52 lines
1.6 KiB

  1. dnl -*- Autoconf -*-
  2. dnl Copyright (C) 1993-2003 Free Software Foundation, Inc.
  3. dnl This file is free software, distributed under the terms of the GNU
  4. dnl General Public License. As a special exception to the GNU General
  5. dnl Public License, this file may be distributed as part of a program
  6. dnl that contains a configuration script generated by Autoconf, under
  7. dnl the same distribution terms as the rest of that program.
  8. dnl From Bruno Haible, Marcus Daniels, Sam Steingold.
  9. AC_PREREQ(2.57)
  10. AC_DEFUN([CL_ALLOCA],
  11. [# The Ultrix 4.2 mips builtin alloca declared by alloca.h only works
  12. # for constant arguments. Useless!
  13. CL_LINK_CHECK(working alloca.h, cl_cv_header_alloca_h,
  14. [#include <alloca.h>], [char *p = (char *) alloca(2 * sizeof(int));],
  15. AC_DEFINE(HAVE_ALLOCA_H,,[have <alloca.h> and it should be used (not Ultrix)]))
  16. decl="#ifdef __GNUC__
  17. #define alloca __builtin_alloca
  18. #else
  19. #ifdef _MSC_VER
  20. #include <malloc.h>
  21. #define alloca _alloca
  22. #else
  23. #ifdef HAVE_ALLOCA_H
  24. #include <alloca.h>
  25. #else
  26. #ifdef _AIX
  27. #pragma alloca
  28. #else
  29. #ifndef alloca
  30. char *alloca ();
  31. #endif
  32. #endif
  33. #endif
  34. #endif
  35. #endif
  36. "
  37. CL_LINK_CHECK([alloca], cl_cv_func_alloca,
  38. $decl, [char *p = (char *) alloca(1);],
  39. , [alloca_missing=1])dnl
  40. if test -n "$alloca_missing"; then
  41. # The SVR3 libPW and SVR4 libucb both contain incompatible functions
  42. # that cause trouble. Some versions do not even contain alloca or
  43. # contain a buggy version. If you still want to use their alloca,
  44. # use ar to extract alloca.o from them instead of compiling alloca.c.
  45. ALLOCA=alloca.${ac_objext}
  46. AC_DEFINE(NO_ALLOCA,,[need to link with an external alloca.o when using alloca()])
  47. fi
  48. AC_SUBST(ALLOCA)dnl
  49. ])