57941052eb6f59b52991495ce916467941094db2
[m6w6/libmemcached] / m4 / pandora_drizzle_build.m4
1 dnl Copyright (C) 2009 Sun Microsystems
2 dnl This file is free software; Sun Microsystems
3 dnl gives unlimited permission to copy and/or distribute it,
4 dnl with or without modifications, as long as this notice is preserved.
5
6 dnl Check for all of the headers and libs that Drizzle needs. We check all
7 dnl of these for plugins too, to ensure that all of the appropriate defines
8 dnl are set.
9
10 AC_DEFUN([PANDORA_DRIZZLE_BUILD],[
11
12 dnl We need to turn on our CXXFLAGS to make sure it shows up correctly
13 save_CXXFLAGS="${CXXFLAGS}"
14 CXXFLAGS="${CXXFLAGS} ${AM_CXXFLAGS}"
15 PANDORA_CXX_STL_HASH
16 CXXFLAGS="${save_CXXFLAGS}"
17
18 PANDORA_CXX_CSTDINT
19 PANDORA_CXX_CINTTYPES
20
21 AC_STRUCT_TM
22
23 AC_FUNC_ALLOCA
24 AC_FUNC_UTIME_NULL
25 AC_FUNC_VPRINTF
26
27 PANDORA_WORKING_FDATASYNC
28
29 AC_CHECK_FUNCS(\
30 gethrtime \
31 setupterm \
32 backtrace \
33 backtrace_symbols \
34 backtrace_symbols_fd)
35
36 AC_HEADER_STAT
37 AC_HEADER_DIRENT
38 AC_HEADER_STDC
39 AC_HEADER_SYS_WAIT
40 AC_HEADER_STDBOOL
41
42 AC_CHECK_HEADERS(sys/fpu.h fpu_control.h ieeefp.h)
43 AC_CHECK_HEADERS(select.h sys/select.h)
44 AC_CHECK_HEADERS(utime.h sys/utime.h )
45 AC_CHECK_HEADERS(synch.h sys/mman.h sys/socket.h)
46 AC_CHECK_HEADERS(sched.h)
47 AC_CHECK_HEADERS(sys/prctl.h)
48 AC_CHECK_HEADERS(execinfo.h)
49 AC_CHECK_HEADERS(locale.h)
50 AC_CHECK_HEADERS(termcap.h termio.h termios.h asm/termbits.h)
51 AC_CHECK_HEADERS(paths.h)
52
53
54 #--------------------------------------------------------------------
55 # Check for system libraries. Adds the library to $LIBS
56 # and defines HAVE_LIBM etc
57 #--------------------------------------------------------------------
58
59 AC_CHECK_LIB(m, floor, [], AC_CHECK_LIB(m, __infinity))
60
61 AC_CHECK_FUNC(setsockopt, [], [AC_CHECK_LIB(socket, setsockopt)])
62 # This may get things to compile even if bind-8 is installed
63 AC_CHECK_FUNC(bind, [], [AC_CHECK_LIB(bind, bind)])
64
65 # For the sched_yield() function on Solaris
66 AC_CHECK_FUNC(sched_yield, [],
67 [AC_CHECK_LIB(posix4, [sched_yield],
68 [AC_DEFINE(HAVE_SCHED_YIELD, 1, [Have sched_yield function]) LIBS="$LIBS -lposix4"])])
69
70 AS_IF([test "$ac_cv_header_termio_h" = "no" -a "$ac_cv_header_termios_h" = "no"],[
71 AC_CHECK_FUNC(gtty, [], [AC_CHECK_LIB(compat, gtty)])
72 ])
73
74 AC_CHECK_HEADERS([curses.h term.h],[],[],[[
75 #ifdef HAVE_CURSES_H
76 # include <curses.h>
77 #endif
78 ]])
79 AC_CHECK_TYPES([ulong])
80
81 AC_LANG_PUSH([C++])
82 AC_CHECK_HEADERS(cxxabi.h)
83 AC_CACHE_CHECK([checking for abi::__cxa_demangle], pandora_cv_cxa_demangle,
84 [AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <cxxabi.h>]], [[
85 char *foo= 0; int bar= 0;
86 foo= abi::__cxa_demangle(foo, foo, 0, &bar);
87 ]])],[pandora_cv_cxa_demangle=yes],[pandora_cv_cxa_demangle=no])])
88 AC_LANG_POP([])
89
90 AS_IF([test "x$pandora_cv_cxa_demangle" = xyes],[
91 AC_DEFINE(HAVE_ABI_CXA_DEMANGLE, 1,
92 [Define to 1 if you have the `abi::__cxa_demangle' function.])
93 ])
94
95
96 ])