@@ -0,0 +1,41 @@
+--- configure.ac.orig 2010-04-02 22:12:22.000000000 +0200
++++ configure.ac 2010-04-02 22:14:10.000000000 +0200
+@@ -134,35 +134,9 @@
+ fi
+
+ # Checking for libaio
+-libaio_arg="not_available"
+-AC_MSG_CHECKING([which argument is required to compile libaio])
+-
+-libaio_header="#include<libaio.h>"
+-libaio_body="io_submit(0,0,0)"
+-# Check if compile with no extra argument
+-AC_LINK_IFELSE([AC_LANG_PROGRAM($libaio_header, $libaio_body)],
+-libaio_arg="")
+-
+-if test x"$libaio_arg" = x"not_available"; then
+- bkp_LDFLAGS="$LDFLAGS"
+- for altheader in -laio; do
+- LDFLAGS="$bkp_LDFLAGS $altheader"
+- AC_LINK_IFELSE([AC_LANG_PROGRAM($libaio_header, $libaio_body)],
+- libaio_arg="$altheader")
+- LDFLAGS="$bkp_LDFLAGS"
+- done
+-fi
+-
+-if test x"$libaio_arg" = x"not_available"; then
+- AC_MSG_FAILURE([Cannot find libaio library, please install libaio-dev])
+-else
+- if test x"$libaio_arg" = x; then
+- AC_MSG_RESULT([none])
+- else
+- AC_MSG_RESULT([$libaio_arg])
+- fi
+- LDFLAGS="$LDFLAGS $libaio_arg"
+-fi
++AC_CHECK_LIB(aio, io_setup, AIO_LIBS="-laio", AIO_LIBS="")
++AC_SUBST(AIO_LIBS)
++LDFLAGS="$LDFLAGS $AIO_LIBS"
+
+ # Checks for library functions.
+ AC_FUNC_CLOSEDIR_VOID
|