[Ocfs2-test-devel] [PATCH 1/2] Ocfs2-test: Port header-checker macro and api-compat mechanism from ocfs2 to better use system call.

Tristan Ye tristan.ye at oracle.com
Tue Apr 14 21:03:06 PDT 2009


It was ported from ocfs2-1.4.1 git src.

Signed-off-by: Tristan Ye <tristan.ye at oracle.com>
---
 Config.make.in |    2 ++
 Makefile       |    1 +
 aclocal.m4     |    1 +
 configure.in   |    5 +++++
 kfeature.m4    |   17 +++++++++++++++++
 5 files changed, 26 insertions(+), 0 deletions(-)
 create mode 100644 kfeature.m4

diff --git a/Config.make.in b/Config.make.in
index d6c9a75..a03274e 100644
--- a/Config.make.in
+++ b/Config.make.in
@@ -29,6 +29,8 @@ TESTDIR = $(libdir)/ocfs2-test
 
 top_builddir = .
 
+EXTRA_CFLAGS += @API_COMPAT_CFLAGS@
+
 INSTALL = @INSTALL@
 INSTALL_PROGRAM = @INSTALL_PROGRAM@
 INSTALL_LIBRARY = @INSTALL_PROGRAM@
diff --git a/Makefile b/Makefile
index d8d3f52..3988a39 100644
--- a/Makefile
+++ b/Makefile
@@ -26,6 +26,7 @@ SUBDIRS = programs utilities tests suites
 
 SUBDIRS += vendor
 
+API_COMPAT_FILES =
 
 DIST_FILES = \
 	COPYING					\
diff --git a/aclocal.m4 b/aclocal.m4
index 4c1b940..fb56765 100644
--- a/aclocal.m4
+++ b/aclocal.m4
@@ -1,3 +1,4 @@
 m4_include([pkg.m4])
 m4_include([runlog.m4])
 m4_include([python.m4])
+m4_include([kfeature.m4])
diff --git a/configure.in b/configure.in
index 6461599..da5cd14 100644
--- a/configure.in
+++ b/configure.in
@@ -127,6 +127,11 @@ 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.]))
 
+API_COMPAT_HEADERS=""
+API_COMPAT_CFLAGS=""
+
+AC_SUBST(API_COMPAT_CFLAGS)
+
 AC_CONFIG_FILES([
 Config.make
 vendor/common/ocfs2-test.spec-generic
diff --git a/kfeature.m4 b/kfeature.m4
new file mode 100644
index 0000000..5e1774b
--- /dev/null
+++ b/kfeature.m4
@@ -0,0 +1,17 @@
+AC_DEFUN([OCFS2_CHECK_HEADERS],
+  [AC_MSG_CHECKING([for $1])
+   kernel_check_regexp="m4_default([$5], [\<$1(])"
+
+   kernel_check_headers=
+   for kfile in $2; do
+     kernel_check_headers="$kernel_check_headers /usr/include/$kfile"
+   done
+
+   if grep "$kernel_check_regexp" $kernel_check_headers >/dev/null 2>&1 ; then
+     m4_default([$3], :)
+     AC_MSG_RESULT(yes)
+   else
+     m4_default([$4], :)
+     AC_MSG_RESULT(no)
+   fi
+])# OCFS2_CHECK_HEADERS
-- 
1.5.5




More information about the Ocfs2-test-devel mailing list