From a5f479c2aa7d64b36a5f71113761cb44174bd0be Mon Sep 17 00:00:00 2001 From: Ilya Dryomov Date: Mon, 10 Feb 2014 19:34:44 +0200 Subject: [PATCH] configure: fix F_SETPIPE_SZ detection 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 --- configure.ac | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/configure.ac b/configure.ac index 5773688b023..c0c50fac597 100644 --- a/configure.ac +++ b/configure.ac @@ -640,11 +640,21 @@ AC_CHECK_FUNC([splice], [AC_DEFINE([CEPH_HAVE_SPLICE], [], [splice(2) is supported])], []) -AC_COMPILE_IFELSE([AC_LANG_SOURCE([[#include -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 + #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]) -- 2.47.3