File: ac_check_aio.m4

package info (click to toggle)
sysbench 1.0.20%2Bds-7
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,840 kB
  • sloc: ansic: 11,830; sh: 1,752; xml: 736; makefile: 195
file content (38 lines) | stat: -rw-r--r-- 1,259 bytes parent folder | download | duplicates (3)
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
dnl ---------------------------------------------------------------------------
dnl Macro: AC_CHECK_AIO
dnl Check for Linux AIO availability on the target system
dnl Also, check the version of libaio library (at the moment, there are two
dnl versions with incompatible interfaces).
dnl ---------------------------------------------------------------------------

AC_DEFUN([AC_CHECK_AIO],[
if test x$enable_aio = xyes; then
    AC_CHECK_HEADER([libaio.h], 
                    [AC_DEFINE(HAVE_LIBAIO_H,1,[Define to 1 if your system has <libaio.h> header file])],
                    [enable_aio=no])
fi
if test x$enable_aio = xyes; then 
    AC_CHECK_LIB([aio], [io_queue_init], , [enable_aio=no])
fi
if test x$enable_aio = xyes; then
    AC_MSG_CHECKING(if io_getevents() has an old interface)
    AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
                       [[
#ifdef HAVE_LIBAIO_H
# include <libaio.h>
#endif
struct io_event event; 
io_context_t ctxt;
                       ]],
                       [[
(void)io_getevents(ctxt, 1, &event, NULL);
                       ]] )
    ], [
        AC_DEFINE([HAVE_OLD_GETEVENTS], 1, [Define to 1 if libaio has older getevents() interface])
        AC_MSG_RESULT(yes)
       ],
    [AC_MSG_RESULT(no)]
    )
fi
])