Skip to content
Snippets Groups Projects
Commit 8185aec4 authored by Alexey Lyashkov's avatar Alexey Lyashkov
Browse files

improve checks for exported symbols. This allow run check without sources, but with

Module.symvers shipped with kernel distribution.
add check for truncate_complete_page used by patchless client.

b=12415
i=adilger
i=scjody
parent 776615e6
No related merge requests found
...@@ -403,3 +403,40 @@ AC_DEFUN([LB_LINUX_CONDITIONALS], ...@@ -403,3 +403,40 @@ AC_DEFUN([LB_LINUX_CONDITIONALS],
[AM_CONDITIONAL(LINUX25, test x$linux25 = xyes) [AM_CONDITIONAL(LINUX25, test x$linux25 = xyes)
]) ])
#
# LB_CHECK_SYMBOL_EXPORT
# check symbol exported or not
# $1 - symbol
# $2 - file(s) for find.
# $3 - do 'yes'
# $4 - do 'no'
#
# 2.6 based kernels - put modversion info into $LINUX/Module.modvers
# or check
AC_DEFUN([LB_CHECK_SYMBOL_EXPORT],
[AC_MSG_CHECKING([if Linux was built with symbol $1 is exported])
grep -q -E '[[[:space:]]]$1[[[:space:]]]' $LINUX/Module.symvers 2>/dev/null
rc=$?
if test $rc -ne 0; then
export=0
for file in $2; do
grep -q -E "EXPORT_SYMBOL.*($1)" "$LINUX/$file" 2>/dev/null
rc=$?
if test $rc -eq 0; then
export=1
break;
fi
done
if test $export -eq 0; then
AC_MSG_RESULT([no])
$4
else
AC_MSG_RESULT([yes])
$3
fi
else
AC_MSG_RESULT([yes])
$3
fi
])
...@@ -1031,35 +1031,22 @@ LB_LINUX_TRY_COMPILE([ ...@@ -1031,35 +1031,22 @@ LB_LINUX_TRY_COMPILE([
# we export show_task(), but not all kernels have it (yet) # we export show_task(), but not all kernels have it (yet)
# #
AC_DEFUN([LN_FUNC_SHOW_TASK], AC_DEFUN([LN_FUNC_SHOW_TASK],
[AC_MSG_CHECKING([if kernel exports show_task]) [LB_CHECK_SYMBOL_EXPORT([show_task],
have_show_task=0 [kernel/ksyms.c kernel/sched.c],[
for file in ksyms sched ; do AC_DEFINE(HAVE_SHOW_TASK, 1, [show_task is exported])
if grep -q "EXPORT_SYMBOL(show_task)" \ ],[
"$LINUX/kernel/$file.c" 2>/dev/null ; then ])
have_show_task=1
break
fi
done
if test x$have_show_task = x1 ; then
AC_DEFINE(HAVE_SHOW_TASK, 1, [show_task is exported])
AC_MSG_RESULT([yes])
else
AC_MSG_RESULT([no])
fi
]) ])
# LN_TASKLIST_LOCK # LN_TASKLIST_LOCK
# 2.6.18 remove tasklist_lock export # 2.6.18 remove tasklist_lock export
AC_DEFUN([LN_TASKLIST_LOCK], AC_DEFUN([LN_TASKLIST_LOCK],
[AC_MSG_CHECKING([kernel export tasklist_lock]) [LB_CHECK_SYMBOL_EXPORT([tasklist_lock],
if grep -q "EXPORT_SYMBOL(tasklist_lock)" \ [kernel/fork.c],[
"$LINUX/kernel/fork.c" 2>/dev/null ; then AC_DEFINE(HAVE_TASKLIST_LOCK, 1,
AC_DEFINE(HAVE_TASKLIST_LOCK, 1, [tasklist_lock exported])
[tasklist_lock exported]) ],[
AC_MSG_RESULT([yes]) ])
else
AC_MSG_RESULT([no])
fi
]) ])
# 2.6.19 API changes # 2.6.19 API changes
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment