~drizzle-trunk/drizzle/development

319.1.1 by Grant Limberg
renamed all instances of MYSQL_ to DRIZZLE_
1
AC_DEFUN([DRIZZLE_FUNC_ALLOCA],
1 by brian
clean slate
2
[
3
# Since we have heard that alloca fails on IRIX never define it on a
4
# SGI machine
5
if test ! "$host_vendor" = "sgi"
6
then
7
 AC_REQUIRE_CPP()dnl Set CPP; we run AC_EGREP_CPP conditionally.
8
 # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works
9
 # for constant arguments.  Useless!
10
 AC_CACHE_CHECK([for working alloca.h], ac_cv_header_alloca_h,
11
 [AC_TRY_LINK([#include <alloca.h>], [char *p = alloca(2 * sizeof(int));],
12
   ac_cv_header_alloca_h=yes, ac_cv_header_alloca_h=no)])
13
 if test "$ac_cv_header_alloca_h" = "yes"
14
 then
15
	AC_DEFINE(HAVE_ALLOCA, 1)
16
 fi
17
 
18
 AC_CACHE_CHECK([for alloca], ac_cv_func_alloca_works,
19
 [AC_TRY_LINK([
20
 #ifdef __GNUC__
21
 # define alloca __builtin_alloca
22
 #else
23
 # if HAVE_ALLOCA_H
24
 #  include <alloca.h>
25
 # else
26
 #  ifdef _AIX
27
  #pragma alloca
28
 #  else
29
 #   ifndef alloca /* predefined by HP cc +Olibcalls */
30
 char *alloca ();
31
 #   endif
32
 #  endif
33
 # endif
34
 #endif
35
 ], [char *p = (char *) alloca(1);],
36
   ac_cv_func_alloca_works=yes, ac_cv_func_alloca_works=no)])
37
 if test "$ac_cv_func_alloca_works" = "yes"; then
38
   AC_DEFINE([HAVE_ALLOCA], [1], [If we have a working alloca() implementation])
39
 fi
40
 
41
 if test "$ac_cv_func_alloca_works" = "no"; then
42
   # The SVR3 libPW and SVR4 libucb both contain incompatible functions
43
   # that cause trouble.  Some versions do not even contain alloca or
44
   # contain a buggy version.  If you still want to use their alloca,
45
   # use ar to extract alloca.o from them instead of compiling alloca.c.
46
   ALLOCA=alloca.o
47
   AC_DEFINE(C_ALLOCA, 1)
48
 
49
 fi
50
 AC_SUBST(ALLOCA)dnl
51
else
52
 AC_MSG_RESULT("Skipped alloca tests")
53
fi
54
])