[Ocfs2-test-devel] [PATCH 1/4] Ocfs2-test: Add kfeature.m4 for ocfs2 to define macro OCFS2_CHECK_KERNEL.

Tristan Ye tristan.ye at oracle.com
Tue Apr 14 00:37:31 PDT 2009


It was ported from ocfs2-1.4.1 git src.

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

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/kfeature.m4 b/kfeature.m4
new file mode 100644
index 0000000..ebd230b
--- /dev/null
+++ b/kfeature.m4
@@ -0,0 +1,17 @@
+AC_DEFUN([OCFS2_CHECK_KERNEL],
+  [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 $6/$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_KERNEL
-- 
1.5.5




More information about the Ocfs2-test-devel mailing list