]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
configure: fix F_SETPIPE_SZ detection
authorIlya Dryomov <ilya.dryomov@inktank.com>
Mon, 10 Feb 2014 17:34:44 +0000 (19:34 +0200)
committerIlya Dryomov <ilya.dryomov@inktank.com>
Mon, 10 Feb 2014 17:37:30 +0000 (19:37 +0200)
Currently CEPH_HAVE_SETPIPE_SZ is not set even if F_SETPIPE_SZ is
available, because AC_COMPILE_IFELSE test program as written always
fails to compile.  F_SETPIPE_SZ is a macro, so use AC_EGREP_CPP which
works on the preprocessor output instead of trying to compile.

Signed-off-by: Ilya Dryomov <ilya.dryomov@inktank.com>
configure.ac

index 5773688b02342d8d9814b7549f924aad9479bbc2..c0c50fac597ee89e9d90362a978ccf496484225f 100644 (file)
@@ -640,11 +640,21 @@ AC_CHECK_FUNC([splice],
        [AC_DEFINE([CEPH_HAVE_SPLICE], [], [splice(2) is supported])],
        [])
 
-AC_COMPILE_IFELSE([AC_LANG_SOURCE([[#include <fcntl.h>
-F_SETPIPE_SZ]])],
-       [AC_DEFINE([CEPH_HAVE_SETPIPE_SZ], [], [F_SETPIPE_SZ is supported])],
-       [AC_MSG_NOTICE(["F_SETPIPE_SZ not found, zero-copy may be less efficent"])])
-
+# F_SETPIPE_SZ in fcntl.h
+AC_MSG_CHECKING([for F_SETPIPE_SZ in fcntl.h])
+AC_EGREP_CPP([yes_have_f_setpipe_sz], [
+  #define _GNU_SOURCE
+  #include <fcntl.h>
+  #ifdef F_SETPIPE_SZ
+  yes_have_f_setpipe_sz
+  #endif
+], [
+  AC_MSG_RESULT([yes])
+  AC_DEFINE([CEPH_HAVE_SETPIPE_SZ], [], [F_SETPIPE_SZ is supported])
+], [
+  AC_MSG_RESULT([no])
+  AC_MSG_NOTICE([F_SETPIPE_SZ not found, zero-copy may be less efficent])
+])
 
 AC_CHECK_FUNCS([posix_fallocate])
 AC_CHECK_HEADERS([sys/prctl.h])