~drizzle-trunk/drizzle/development

2062.3.1 by Andrew Hutchings
Get drizzle build system to support Linux native AIO for InnoDB
1
dnl  Copyright (C) 2011 Andrew Hutchings
2
dnl This file is free software; Sun Microsystems, Inc.
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
#--------------------------------------------------------------------
7
# Check for libaio
8
#--------------------------------------------------------------------
9
10
11
AC_DEFUN([_PANDORA_SEARCH_LIBAIO],[
12
  AC_REQUIRE([AC_LIB_PREFIX])
13
14
  AC_CHECK_HEADERS(libaio.h)
15
  AC_LIB_HAVE_LINKFLAGS(aio,,
16
  [
17
    #include <libaio.h>
18
  ],
19
  [
20
    int aio_cmd= IO_CMD_PREAD;
21
  ])
22
23
  AM_CONDITIONAL(HAVE_LIBAIO, [test "x${ac_cv_libaio}" = "xyes"])
24
25
  AS_IF([test "x${ac_cv_libaio}" = "xyes"],[
26
    AC_DEFINE([LINUX_NATIVE_AIO], [1], [Enabel libaio support in InnoDB])
27
  ])
28
])
29
30
AC_DEFUN([_PANDORA_HAVE_LIBAIO],[
31
32
  AC_ARG_ENABLE([libaio],
33
    [AS_HELP_STRING([--disable-libaio],
34
      [Build with libaio support @<:@default=on@:>@])],
35
    [ac_enable_libaio="$enableval"],
36
    [ac_enable_libaio="yes"])
37
38
  _PANDORA_SEARCH_LIBAIO
39
])
40
41
42
AC_DEFUN([PANDORA_HAVE_LIBAIO],[
43
  AC_REQUIRE([_PANDORA_HAVE_LIBAIO])
44
])
45
46
AC_DEFUN([_PANDORA_REQUIRE_LIBAIO],[
47
  ac_enable_libaio="yes"
48
  _PANDORA_SEARCH_LIBAIO
49
  AS_IF([test "x$ac_cv_header_libaio_h" = "xno"],[
2221.1.8 by Monty Taylor
Adds ability to just build libdrizzle without needing all of the rest of the
50
    PANDORA_MSG_ERROR([Couldn't find libaio.h. On Debian this can be found in libaio-dev. On Redhat this can be found in libaio-devel.])
2062.3.1 by Andrew Hutchings
Get drizzle build system to support Linux native AIO for InnoDB
51
  ])
52
])
53
54
AC_DEFUN([PANDORA_REQUIRE_LIBAIO],[
55
  AC_REQUIRE([_PANDORA_REQUIRE_LIBAIO])
56
])