Skip to content

Commit

Permalink
Ocfs2-test: Port header-checker macro and api-compat mechanism from o…
Browse files Browse the repository at this point in the history
…cfs2 to better use system call.

This patch adds OCFS2_CHECK_HEADERS macro in the build infrastructure
to allow us to search for symbols in userspace headers.

Signed-off-by: Tristan Ye <[email protected]>
Signed-off-by: Sunil Mushran <[email protected]>
  • Loading branch information
Tristan Ye committed Apr 16, 2009
1 parent 11d1858 commit 6dd6ab2
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Config.make.in
Original file line number Diff line number Diff line change
Expand Up @@ -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@
Expand Down
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ SUBDIRS = programs utilities tests suites

SUBDIRS += vendor

API_COMPAT_FILES =

DIST_FILES = \
COPYING \
Expand Down
1 change: 1 addition & 0 deletions aclocal.m4
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
m4_include([pkg.m4])
m4_include([runlog.m4])
m4_include([python.m4])
m4_include([kfeature.m4])
5 changes: 5 additions & 0 deletions configure.in
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
17 changes: 17 additions & 0 deletions kfeature.m4
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 6dd6ab2

Please sign in to comment.