~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to m4/pandora_drizzle_build.m4

  • Committer: Eric Day
  • Date: 2010-01-07 20:02:38 UTC
  • mfrom: (1259.4.2 staging)
  • mto: This revision was merged to the branch mainline in revision 1271.
  • Revision ID: eday@oddments.org-20100107200238-uqw8v6kv9pl7nny5
Merged trunk.

Show diffs side-by-side

added added

removed removed

Lines of Context:
10
10
AC_DEFUN([PANDORA_DRIZZLE_BUILD],[
11
11
 
12
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
13
  PANDORA_CXX_STL_HASH
16
 
  CXXFLAGS="${save_CXXFLAGS}"
17
14
 
18
15
  PANDORA_CXX_CSTDINT
19
16
  PANDORA_CXX_CINTTYPES
20
17
 
21
 
  #--------------------------------------------------------------------
22
 
  # Check for system header files
23
 
  #--------------------------------------------------------------------
24
 
  
 
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
25
34
  AC_HEADER_DIRENT
26
35
  AC_HEADER_STDC
27
36
  AC_HEADER_SYS_WAIT
28
37
  AC_HEADER_STDBOOL
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 )
 
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 )
32
42
  AC_CHECK_HEADERS(synch.h sys/mman.h sys/socket.h)
33
 
  AC_CHECK_HEADERS([curses.h term.h],[],[],[[
34
 
    #ifdef HAVE_CURSES_H
35
 
    # include <curses.h>
36
 
    #endif
37
 
  ]])
38
 
  AC_CHECK_HEADERS(termio.h termios.h sched.h alloca.h)
39
 
  AC_CHECK_HEADERS(sys/prctl.h ieeefp.h)
 
43
  AC_CHECK_HEADERS(sched.h)
 
44
  AC_CHECK_HEADERS(sys/prctl.h)
40
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
 
41
50
  
42
51
  #--------------------------------------------------------------------
43
52
  # Check for system libraries. Adds the library to $LIBS
44
53
  # and defines HAVE_LIBM etc
45
54
  #--------------------------------------------------------------------
46
55
  
47
 
  AC_CHECK_LIB(m, floor, [], AC_CHECK_LIB(m, __infinity))
48
 
  
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]))
57
 
  
58
 
  # Check rt for aio_read
59
 
  AC_CHECK_LIB(rt, aio_read)
60
 
  
61
 
  # For the sched_yield() function on Solaris
 
56
    # For the sched_yield() function on Solaris
62
57
  AC_CHECK_FUNC(sched_yield, [],
63
58
    [AC_CHECK_LIB(posix4, [sched_yield],
64
59
      [AC_DEFINE(HAVE_SCHED_YIELD, 1, [Have sched_yield function]) LIBS="$LIBS -lposix4"])])
67
62
    AC_CHECK_FUNC(gtty, [], [AC_CHECK_LIB(compat, gtty)])
68
63
  ])
69
64
  
70
 
  AC_CHECK_TYPES([fp_except], [], [], [
71
 
    #include <sys/types.h>
72
 
    #include <ieeefp.h>
73
 
  ])
74
 
 
75
 
  dnl Checks for header files.
76
 
  AC_CHECK_HEADERS(malloc.h)
77
 
 
78
 
  dnl Checks for library functions.
79
 
  AC_FUNC_ALLOCA
80
 
 
81
 
  AC_CHECK_FUNCS(issetugid)
82
 
 
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 \
87
 
   paths.h)
88
 
 
89
 
  # Already-done: strcasecmp
90
 
  AC_CHECK_FUNCS(lstat select)
91
 
 
92
 
  dnl Checks for library functions.
93
 
  AC_HEADER_STAT
94
 
  AC_FUNC_UTIME_NULL
95
 
  AC_FUNC_VPRINTF
96
 
 
97
 
  AC_STRUCT_TM
98
 
  AC_CHECK_TYPES([sigset_t, off_t], [], [], [#include <sys/types.h>])
 
65
  AC_CHECK_HEADERS([curses.h term.h],[],[],[[
 
66
    #ifdef HAVE_CURSES_H
 
67
    # include <curses.h>
 
68
    #endif
 
69
  ]])
99
70
  AC_CHECK_TYPES([uint, ulong])
100
71
 
101
 
  AC_LANG_PUSH([C++])
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])])
108
 
  AC_LANG_POP([])
109
 
 
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.])
 
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__ */
113
109
  ])
114
 
 
115
 
 
116
 
  AC_CHECK_FUNCS( \
117
 
    cuserid fchmod \
118
 
    fpresetsticky fpsetmask fsync \
119
 
    getpassphrase getpwnam \
120
 
    getpwuid getrlimit getrusage index initgroups isnan \
121
 
    localtime_r log log2 gethrtime gmtime_r \
122
 
    madvise \
123
 
    mkstemp mlockall poll pread mmap mmap64 \
124
 
    readlink \
125
 
    realpath rename setupterm \
126
 
    sigaction \
127
 
    sigthreadmask \
128
 
    snprintf strpbrk \
129
 
    tell tempnam \
130
 
    backtrace backtrace_symbols backtrace_symbols_fd)
131
 
 
132
 
  PANDORA_WORKING_FDATASYNC
133
 
 
134
110
])