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