~drizzle-trunk/drizzle/development

1192.3.28 by Monty Taylor
pandora-build v0.72 - Moved remaining hard-coded tests into pandora-build
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
1192.3.29 by Monty Taylor
Moved cstdint checks outside of the warnings context.
14
1192.3.28 by Monty Taylor
pandora-build v0.72 - Moved remaining hard-coded tests into pandora-build
15
  PANDORA_CXX_CSTDINT
16
  PANDORA_CXX_CINTTYPES
17
1192.3.43 by Monty Taylor
Removed many, many checks for functions that do not need to be checked.
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
1192.3.28 by Monty Taylor
pandora-build v0.72 - Moved remaining hard-coded tests into pandora-build
34
  AC_HEADER_DIRENT
35
  AC_HEADER_STDC
36
  AC_HEADER_SYS_WAIT
37
  AC_HEADER_STDBOOL
1192.3.43 by Monty Taylor
Removed many, many checks for functions that do not need to be checked.
38
1192.3.65 by Monty Taylor
Fixed OSX.
39
  AC_CHECK_HEADERS(sys/types.h sys/fpu.h fpu_control.h ieeefp.h)
1192.3.44 by Monty Taylor
Removed checks for things that are either defined ISO/POSIX standard, or that
40
  AC_CHECK_HEADERS(select.h sys/select.h)
41
  AC_CHECK_HEADERS(utime.h sys/utime.h )
1192.3.28 by Monty Taylor
pandora-build v0.72 - Moved remaining hard-coded tests into pandora-build
42
  AC_CHECK_HEADERS(synch.h sys/mman.h sys/socket.h)
1192.3.44 by Monty Taylor
Removed checks for things that are either defined ISO/POSIX standard, or that
43
  AC_CHECK_HEADERS(sched.h)
44
  AC_CHECK_HEADERS(sys/prctl.h)
1192.3.28 by Monty Taylor
pandora-build v0.72 - Moved remaining hard-coded tests into pandora-build
45
  AC_CHECK_HEADERS(execinfo.h)
1192.3.44 by Monty Taylor
Removed checks for things that are either defined ISO/POSIX standard, or that
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)
1192.3.43 by Monty Taylor
Removed many, many checks for functions that do not need to be checked.
49
1192.3.28 by Monty Taylor
pandora-build v0.72 - Moved remaining hard-coded tests into pandora-build
50
  
51
  #--------------------------------------------------------------------
52
  # Check for system libraries. Adds the library to $LIBS
53
  # and defines HAVE_LIBM etc
54
  #--------------------------------------------------------------------
55
  
1192.3.46 by Monty Taylor
pandora-build v0.76
56
    # For the sched_yield() function on Solaris
1192.3.28 by Monty Taylor
pandora-build v0.72 - Moved remaining hard-coded tests into pandora-build
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
  
1192.3.43 by Monty Taylor
Removed many, many checks for functions that do not need to be checked.
65
  AC_CHECK_HEADERS([curses.h term.h],[],[],[[
66
    #ifdef HAVE_CURSES_H
67
    # include <curses.h>
68
    #endif
69
  ]])
1192.3.65 by Monty Taylor
Fixed OSX.
70
  AC_CHECK_TYPES([uint, ulong])
1192.3.28 by Monty Taylor
pandora-build v0.72 - Moved remaining hard-coded tests into pandora-build
71
1192.3.46 by Monty Taylor
pandora-build v0.76
72
  PANDORA_CXX_DEMANGLE
1192.3.28 by Monty Taylor
pandora-build v0.72 - Moved remaining hard-coded tests into pandora-build
73
1241.9.1 by Monty Taylor
Removed global.h. Fixed all the headers.
74
  AH_TOP([
75
#ifndef __CONFIG_H__
76
#define __CONFIG_H__
77
1241.15.5 by Monty Taylor
Fixed solaris 32-bit.
78
#include "config/top.h"
79
])
1241.15.6 by Monty Taylor
Fixed 32-bit solaris build. Again.
80
  mkdir -p config
1241.15.5 by Monty Taylor
Fixed solaris 32-bit.
81
  cat > config/top.h.stamp <<EOF_CONFIG_TOP
1241.15.6 by Monty Taylor
Fixed 32-bit solaris build. Again.
82
1241.9.1 by Monty Taylor
Removed global.h. Fixed all the headers.
83
#if defined(i386) && !defined(__i386__)
84
#define __i386__
85
#endif
86
1241.15.5 by Monty Taylor
Fixed solaris 32-bit.
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
1241.15.6 by Monty Taylor
Fixed 32-bit solaris build. Again.
94
1241.9.1 by Monty Taylor
Removed global.h. Fixed all the headers.
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
  ])
1192.3.28 by Monty Taylor
pandora-build v0.72 - Moved remaining hard-coded tests into pandora-build
110
])