From: Ilya Dryomov Date: Mon, 10 Feb 2014 17:34:44 +0000 (+0200) Subject: configure: fix F_SETPIPE_SZ detection X-Git-Tag: v0.78~208^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=a5f479c2aa7d64b36a5f71113761cb44174bd0be;p=ceph.git 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 --- diff --git a/configure.ac b/configure.ac index 5773688b0234..c0c50fac597e 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])