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.
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
10
AC_DEFUN([PANDORA_DRIZZLE_BUILD],[
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}"
16
CXXFLAGS="${save_CXXFLAGS}"
21
#--------------------------------------------------------------------
22
# Check for system header files
23
#--------------------------------------------------------------------
29
AC_CHECK_HEADERS(fcntl.h float.h fpu_control.h ieeefp.h)
30
AC_CHECK_HEADERS(limits.h pwd.h select.h linux/config.h)
31
AC_CHECK_HEADERS(sys/fpu.h utime.h sys/utime.h )
32
AC_CHECK_HEADERS(synch.h sys/mman.h sys/socket.h)
33
AC_CHECK_HEADERS([curses.h term.h],[],[],[[
38
AC_CHECK_HEADERS(termio.h termios.h sched.h alloca.h)
39
AC_CHECK_HEADERS(sys/prctl.h ieeefp.h)
40
AC_CHECK_HEADERS(execinfo.h)
42
#--------------------------------------------------------------------
43
# Check for system libraries. Adds the library to $LIBS
44
# and defines HAVE_LIBM etc
45
#--------------------------------------------------------------------
47
AC_CHECK_LIB(m, floor, [], AC_CHECK_LIB(m, __infinity))
49
AC_CHECK_FUNC(setsockopt, [], [AC_CHECK_LIB(socket, setsockopt)])
50
AC_CHECK_FUNC(yp_get_default_domain, [],
51
[AC_CHECK_LIB(nsl, yp_get_default_domain)])
52
AC_CHECK_FUNC(p2open, [], [AC_CHECK_LIB(gen, p2open)])
53
# This may get things to compile even if bind-8 is installed
54
AC_CHECK_FUNC(bind, [], [AC_CHECK_LIB(bind, bind)])
55
# Check if crypt() exists in libc or libcrypt, sets LIBS if needed
56
AC_SEARCH_LIBS(crypt, crypt, AC_DEFINE(HAVE_CRYPT, 1, [crypt]))
58
# Check rt for aio_read
59
AC_CHECK_LIB(rt, aio_read)
61
# For the sched_yield() function on Solaris
62
AC_CHECK_FUNC(sched_yield, [],
63
[AC_CHECK_LIB(posix4, [sched_yield],
64
[AC_DEFINE(HAVE_SCHED_YIELD, 1, [Have sched_yield function]) LIBS="$LIBS -lposix4"])])
66
AS_IF([test "$ac_cv_header_termio_h" = "no" -a "$ac_cv_header_termios_h" = "no"],[
67
AC_CHECK_FUNC(gtty, [], [AC_CHECK_LIB(compat, gtty)])
70
AC_CHECK_TYPES([fp_except], [], [], [
71
#include <sys/types.h>
75
dnl Checks for header files.
76
AC_CHECK_HEADERS(malloc.h)
78
dnl Checks for library functions.
81
AC_CHECK_FUNCS(issetugid)
83
# Already-done: stdlib.h string.h unistd.h termios.h
84
AC_CHECK_HEADERS(stdarg.h dirent.h locale.h ndir.h sys/dir.h \
85
sys/ndir.h sys/select.h \
86
sys/mman.h termcap.h termio.h asm/termbits.h grp.h \
89
# Already-done: strcasecmp
90
AC_CHECK_FUNCS(lstat select)
92
dnl Checks for library functions.
98
AC_CHECK_TYPES([sigset_t, off_t], [], [], [#include <sys/types.h>])
99
AC_CHECK_TYPES([uint, ulong])
102
AC_CHECK_HEADERS(cxxabi.h)
103
AC_CACHE_CHECK([checking for abi::__cxa_demangle], pandora_cv_cxa_demangle,
104
[AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <cxxabi.h>]], [[
105
char *foo= 0; int bar= 0;
106
foo= abi::__cxa_demangle(foo, foo, 0, &bar);
107
]])],[pandora_cv_cxa_demangle=yes],[pandora_cv_cxa_demangle=no])])
110
AS_IF([test "x$pandora_cv_cxa_demangle" = xyes],[
111
AC_DEFINE(HAVE_ABI_CXA_DEMANGLE, 1,
112
[Define to 1 if you have the `abi::__cxa_demangle' function.])
118
fpresetsticky fpsetmask fsync \
119
getpassphrase getpwnam \
120
getpwuid getrlimit getrusage index initgroups isnan \
121
localtime_r log log2 gethrtime gmtime_r \
123
mkstemp mlockall poll pread mmap mmap64 \
125
realpath rename setupterm \
130
backtrace backtrace_symbols backtrace_symbols_fd)
132
PANDORA_WORKING_FDATASYNC