~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to m4/pandora_drizzle_build.m4

pandora-build v0.72 - Moved remaining hard-coded tests into pandora-build
macros.
Add PANDORA_DRIZZLE_BUILD to run the extra checks that drizzle needs that 
plugins would also need to run so we can just use that macro in generated
external plugin builds.
Added support to register_plugins for external plugin building.
Renamed register_plugins.py to pandora-plugin.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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
  PANDORA_CXX_CSTDINT
 
17
  PANDORA_CXX_CINTTYPES
 
18
  CXXFLAGS="${save_CXXFLAGS}"
 
19
 
 
20
  #--------------------------------------------------------------------
 
21
  # Check for system header files
 
22
  #--------------------------------------------------------------------
 
23
  
 
24
  AC_HEADER_DIRENT
 
25
  AC_HEADER_STDC
 
26
  AC_HEADER_SYS_WAIT
 
27
  AC_HEADER_STDBOOL
 
28
  AC_CHECK_HEADERS(fcntl.h float.h fpu_control.h ieeefp.h)
 
29
  AC_CHECK_HEADERS(limits.h pwd.h select.h linux/config.h)
 
30
  AC_CHECK_HEADERS(sys/fpu.h utime.h sys/utime.h )
 
31
  AC_CHECK_HEADERS(synch.h sys/mman.h sys/socket.h)
 
32
  AC_CHECK_HEADERS([curses.h term.h],[],[],[[
 
33
    #ifdef HAVE_CURSES_H
 
34
    # include <curses.h>
 
35
    #endif
 
36
  ]])
 
37
  AC_CHECK_HEADERS(termio.h termios.h sched.h alloca.h)
 
38
  AC_CHECK_HEADERS(sys/prctl.h ieeefp.h)
 
39
  AC_CHECK_HEADERS(execinfo.h)
 
40
  
 
41
  #--------------------------------------------------------------------
 
42
  # Check for system libraries. Adds the library to $LIBS
 
43
  # and defines HAVE_LIBM etc
 
44
  #--------------------------------------------------------------------
 
45
  
 
46
  AC_CHECK_LIB(m, floor, [], AC_CHECK_LIB(m, __infinity))
 
47
  
 
48
  AC_CHECK_FUNC(setsockopt, [], [AC_CHECK_LIB(socket, setsockopt)])
 
49
  AC_CHECK_FUNC(yp_get_default_domain, [],
 
50
    [AC_CHECK_LIB(nsl, yp_get_default_domain)])
 
51
  AC_CHECK_FUNC(p2open, [], [AC_CHECK_LIB(gen, p2open)])
 
52
  # This may get things to compile even if bind-8 is installed
 
53
  AC_CHECK_FUNC(bind, [], [AC_CHECK_LIB(bind, bind)])
 
54
  # Check if crypt() exists in libc or libcrypt, sets LIBS if needed
 
55
  AC_SEARCH_LIBS(crypt, crypt, AC_DEFINE(HAVE_CRYPT, 1, [crypt]))
 
56
  
 
57
  # Check rt for aio_read
 
58
  AC_CHECK_LIB(rt, aio_read)
 
59
  
 
60
  # For the sched_yield() function on Solaris
 
61
  AC_CHECK_FUNC(sched_yield, [],
 
62
    [AC_CHECK_LIB(posix4, [sched_yield],
 
63
      [AC_DEFINE(HAVE_SCHED_YIELD, 1, [Have sched_yield function]) LIBS="$LIBS -lposix4"])])
 
64
  
 
65
  AS_IF([test "$ac_cv_header_termio_h" = "no" -a "$ac_cv_header_termios_h" = "no"],[
 
66
    AC_CHECK_FUNC(gtty, [], [AC_CHECK_LIB(compat, gtty)])
 
67
  ])
 
68
  
 
69
  AC_CHECK_TYPES([fp_except], [], [], [
 
70
    #include <sys/types.h>
 
71
    #include <ieeefp.h>
 
72
  ])
 
73
 
 
74
  dnl Checks for header files.
 
75
  AC_CHECK_HEADERS(malloc.h)
 
76
 
 
77
  dnl Checks for library functions.
 
78
  AC_FUNC_ALLOCA
 
79
 
 
80
  AC_CHECK_FUNCS(issetugid)
 
81
 
 
82
  # Already-done: stdlib.h string.h unistd.h termios.h
 
83
  AC_CHECK_HEADERS(stdarg.h dirent.h locale.h ndir.h sys/dir.h \
 
84
   sys/ndir.h sys/select.h \
 
85
   sys/mman.h termcap.h termio.h asm/termbits.h grp.h \
 
86
   paths.h)
 
87
 
 
88
  # Already-done: strcasecmp
 
89
  AC_CHECK_FUNCS(lstat select)
 
90
 
 
91
  dnl Checks for library functions.
 
92
  AC_HEADER_STAT
 
93
  AC_FUNC_UTIME_NULL
 
94
  AC_FUNC_VPRINTF
 
95
 
 
96
  AC_STRUCT_TM
 
97
  AC_CHECK_TYPES([sigset_t, off_t], [], [], [#include <sys/types.h>])
 
98
  AC_CHECK_TYPES([uint, ulong])
 
99
 
 
100
  AC_LANG_PUSH([C++])
 
101
  AC_CHECK_HEADERS(cxxabi.h)
 
102
  AC_CACHE_CHECK([checking for abi::__cxa_demangle], pandora_cv_cxa_demangle,
 
103
  [AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <cxxabi.h>]], [[
 
104
    char *foo= 0; int bar= 0;
 
105
    foo= abi::__cxa_demangle(foo, foo, 0, &bar);
 
106
  ]])],[pandora_cv_cxa_demangle=yes],[pandora_cv_cxa_demangle=no])])
 
107
  AC_LANG_POP([])
 
108
 
 
109
  AS_IF([test "x$pandora_cv_cxa_demangle" = xyes],[
 
110
    AC_DEFINE(HAVE_ABI_CXA_DEMANGLE, 1,
 
111
              [Define to 1 if you have the `abi::__cxa_demangle' function.])
 
112
  ])
 
113
 
 
114
 
 
115
  AC_CHECK_FUNCS( \
 
116
    cuserid fchmod \
 
117
    fpresetsticky fpsetmask fsync \
 
118
    getpassphrase getpwnam \
 
119
    getpwuid getrlimit getrusage index initgroups isnan \
 
120
    localtime_r log log2 gethrtime gmtime_r \
 
121
    madvise \
 
122
    mkstemp mlockall poll pread mmap mmap64 \
 
123
    readlink \
 
124
    realpath rename setupterm \
 
125
    sigaction \
 
126
    sigthreadmask \
 
127
    snprintf strpbrk \
 
128
    tell tempnam \
 
129
    backtrace backtrace_symbols backtrace_symbols_fd)
 
130
 
 
131
  PANDORA_WORKING_FDATASYNC
 
132
 
 
133
])