~drizzle-trunk/drizzle/development

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
#
# Copyright (c) 2006, 2009, Innobase Oy. All Rights Reserved.
# 
# This program is free software; you can redistribute it and/or modify it under
# the terms of the GNU General Public License as published by the Free Software
# Foundation; version 2 of the License.
# 
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
# 
# You should have received a copy of the GNU General Public License along with
# this program; if not, write to the Free Software Foundation, Inc., 59 Temple
# Place, Suite 330, Boston, MA 02111-1307 USA
#

AC_DEFUN([AC_INNODB_ACTIONS],[
  AC_REQUIRE([AC_PROG_LEX])
  AC_REQUIRE([AC_FUNC_MMAP])

  AC_CHECK_LIB(rt, aio_read, [innodb_system_libs="-lrt"])
  AC_SUBST(innodb_system_libs)
  AC_CHECK_HEADERS(aio.h sched.h)
  AC_CHECK_SIZEOF(int, 4)
  AC_CHECK_SIZEOF(long, 4)
  AC_CHECK_SIZEOF(void*, 4)
  AC_CHECK_FUNCS(sched_yield fdatasync localtime_r)
  AC_CHECK_FUNCS([uname munmap memchr getpagesize bzero])
  AC_C_BIGENDIAN
  case "$target_os" in
         lin*)
           AM_CFLAGS="$AM_CFLAGS -DUNIV_LINUX";;
         hpux10*)
           AM_CFLAGS="$AM_CFLAGS -DUNIV_MUST_NOT_INLINE -DUNIV_HPUX -DUNIV_HPUX10";;
         hp*)
           AM_CFLAGS="$AM_CFLAGS -DUNIV_MUST_NOT_INLINE -DUNIV_HPUX";;
         aix*)
           AM_CFLAGS="$AM_CFLAGS -DUNIV_AIX";;
         irix*|osf*|sysv5uw7*|openbsd*)
           AM_CFLAGS="$AM_CFLAGS -DUNIV_MUST_NOT_INLINE";;
	 *solaris*|*SunOS*)
           AM_CFLAGS="$AM_CFLAGS -DUNIV_SOLARIS";;
  esac
  INNODB_DYNAMIC_CFLAGS="-DDRIZZLE_DYNAMIC_PLUGIN"
  case "$target_cpu" in
	x86_64)
		# The AMD64 ABI forbids absolute addresses in shared libraries
		;;
	*86)
		# Use absolute addresses on IA-32
		INNODB_DYNAMIC_CFLAGS="$INNODB_DYNAMIC_CFLAGS -prefer-non-pic"
		;;
  esac
  AC_SUBST(INNODB_DYNAMIC_CFLAGS)
  AC_MSG_CHECKING(whether pthread_t can be used by GCC atomic builtins)
  AC_TRY_RUN(
    [
      #include <pthread.h>

      int main(int argc, char** argv) {
        pthread_t       x1;
        pthread_t       x2;
        pthread_t       x3;

        __sync_bool_compare_and_swap(&x1, x2, x3);

        return(0);
      }
    ],
    [
      AC_DEFINE([HAVE_ATOMIC_PTHREAD_T], [1],
                [pthread_t can be used by GCC atomic builtins])
      AC_MSG_RESULT(yes)
    ],
    [
      AC_MSG_RESULT(no)
    ]
    )
  ])

AC_INNODB_ACTIONS
# vim: set ft=config: