[Ocfs2-test-devel] [PATCH 3/4] Ocfs2-test: Check if prototype of splice() can be found in bits/fcntl.h

Tristan Ye tristan.ye at oracle.com
Tue Apr 14 00:27:53 PDT 2009


We use splice() defined in kapi-compat header splice.h instead only if it
can not be found in bits/fcntl.h

Signed-off-by: Tristan Ye <tristan.ye at oracle.com>
---
 Config.make.in |    2 ++
 configure.in   |   10 ++++++++++
 2 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/Config.make.in b/Config.make.in
index d6c9a75..5b70b64 100644
--- a/Config.make.in
+++ b/Config.make.in
@@ -29,6 +29,8 @@ TESTDIR = $(libdir)/ocfs2-test
 
 top_builddir = .
 
+EXTRA_CFLAGS += @KAPI_COMPAT_CFLAGS@
+
 INSTALL = @INSTALL@
 INSTALL_PROGRAM = @INSTALL_PROGRAM@
 INSTALL_LIBRARY = @INSTALL_PROGRAM@
diff --git a/configure.in b/configure.in
index 6461599..9821f7a 100644
--- a/configure.in
+++ b/configure.in
@@ -127,6 +127,16 @@ AC_MSG_RESULT($enable_third_party)
 dnl check for Python
 AM_PATH_PYTHON(2.3, , AC_MSG_ERROR([could not find Python 2.3 or higher.]))
 
+splice_compat_header=""
+OCFS2_CHECK_KERNEL([splice() in bits/fcntl.h], bits/fcntl.h,
+  , splice_compat_header="splice.h", [splice (int __fdin],/usr/include)
+KAPI_COMPAT_HEADERS="$KAPI_COMPAT_HEADERS $splice_compat_header"
+
+for h in $KAPI_COMPAT_HEADERS; do
+  KAPI_COMPAT_CFLAGS="$KAPI_COMPAT_CFLAGS -include \$(TOPDIR)/kapi-compat/include/$h"
+done
+AC_SUBST(KAPI_COMPAT_CFLAGS)
+
 AC_CONFIG_FILES([
 Config.make
 vendor/common/ocfs2-test.spec-generic
-- 
1.5.5




More information about the Ocfs2-test-devel mailing list