Updated pandora-build.
[awesomized/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 PANDORA_CXX_STL_HASH
14
15 PANDORA_CXX_CSTDINT
16 PANDORA_CXX_CINTTYPES
17
18 AC_STRUCT_TM
19
20 AC_FUNC_ALLOCA
21 AC_FUNC_UTIME_NULL
22 AC_FUNC_VPRINTF
23
24 PANDORA_WORKING_FDATASYNC
25
26 AC_CHECK_FUNCS(\
27 gethrtime \
28 setupterm \
29 backtrace \
30 backtrace_symbols \
31 backtrace_symbols_fd)
32
33 AC_HEADER_STAT
34 AC_HEADER_DIRENT
35 AC_HEADER_STDC
36 AC_HEADER_SYS_WAIT
37 AC_HEADER_STDBOOL
38
39 AC_CHECK_HEADERS(sys/types.h sys/fpu.h fpu_control.h ieeefp.h)
40 AC_CHECK_HEADERS(select.h sys/select.h)
41 AC_CHECK_HEADERS(utime.h sys/utime.h )
42 AC_CHECK_HEADERS(synch.h sys/mman.h sys/socket.h)
43 AC_CHECK_HEADERS(sched.h)
44 AC_CHECK_HEADERS(sys/prctl.h)
45 AC_CHECK_HEADERS(execinfo.h)
46 AC_CHECK_HEADERS(locale.h)
47 AC_CHECK_HEADERS(termcap.h termio.h termios.h asm/termbits.h)
48 AC_CHECK_HEADERS(paths.h)
49
50
51 #--------------------------------------------------------------------
52 # Check for system libraries. Adds the library to $LIBS
53 # and defines HAVE_LIBM etc
54 #--------------------------------------------------------------------
55
56 # For the sched_yield() function on Solaris
57 AC_CHECK_FUNC(sched_yield, [],
58 [AC_CHECK_LIB(posix4, [sched_yield],
59 [AC_DEFINE(HAVE_SCHED_YIELD, 1, [Have sched_yield function]) LIBS="$LIBS -lposix4"])])
60
61 AS_IF([test "$ac_cv_header_termio_h" = "no" -a "$ac_cv_header_termios_h" = "no"],[
62 AC_CHECK_FUNC(gtty, [], [AC_CHECK_LIB(compat, gtty)])
63 ])
64
65 AC_CHECK_HEADERS([curses.h term.h],[],[],[[
66 #ifdef HAVE_CURSES_H
67 # include <curses.h>
68 #endif
69 ]])
70 AC_CHECK_TYPES([uint, ulong])
71
72 PANDORA_CXX_DEMANGLE
73
74 AH_TOP([
75 #ifndef __CONFIG_H__
76 #define __CONFIG_H__
77
78 #include "config/top.h"
79 ])
80 mkdir -p config
81 cat > config/top.h.stamp <<EOF_CONFIG_TOP
82
83 #if defined(i386) && !defined(__i386__)
84 #define __i386__
85 #endif
86
87 #if defined(_FILE_OFFSET_BITS)
88 # undef _FILE_OFFSET_BITS
89 #endif
90 EOF_CONFIG_TOP
91 diff config/top.h.stamp config/top.h >/dev/null 2>&1 || mv config/top.h.stamp config/top.h
92 rm -f config/top.h.stamp
93
94
95 AH_BOTTOM([
96 #if defined(__cplusplus)
97 # include CSTDINT_H
98 # include CINTTYPES_H
99 #else
100 # include <stdint.h>
101 # include <inttypes.h>
102 #endif
103
104 #if !defined(HAVE_ULONG) && !defined(__USE_MISC)
105 typedef unsigned long int ulong;
106 #endif
107
108 #endif /* __CONFIG_H__ */
109 ])
110 ])