From: shadow Date: Fri, 22 Jun 2007 07:01:49 +0000 (+0000) Subject: improve checks for exported symbols. This allow run check without sources, but with X-Git-Tag: v1_7_100~42 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=8185aec408075c19f6e04bfb2d20f59ef9f59fe8;ds=sidebyside 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 --- diff --git a/build/autoconf/lustre-build-linux.m4 b/build/autoconf/lustre-build-linux.m4 index 37ce1c4..2608f9a 100644 --- a/build/autoconf/lustre-build-linux.m4 +++ b/build/autoconf/lustre-build-linux.m4 @@ -403,3 +403,40 @@ AC_DEFUN([LB_LINUX_CONDITIONALS], [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 +]) diff --git a/lnet/autoconf/lustre-lnet.m4 b/lnet/autoconf/lustre-lnet.m4 index 94d7475..4e88907 100644 --- a/lnet/autoconf/lustre-lnet.m4 +++ b/lnet/autoconf/lustre-lnet.m4 @@ -1031,35 +1031,22 @@ LB_LINUX_TRY_COMPILE([ # we export show_task(), but not all kernels have it (yet) # AC_DEFUN([LN_FUNC_SHOW_TASK], -[AC_MSG_CHECKING([if kernel exports show_task]) -have_show_task=0 -for file in ksyms sched ; do - 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 +[LB_CHECK_SYMBOL_EXPORT([show_task], +[kernel/ksyms.c kernel/sched.c],[ +AC_DEFINE(HAVE_SHOW_TASK, 1, [show_task is exported]) +],[ +]) ]) # LN_TASKLIST_LOCK # 2.6.18 remove tasklist_lock export AC_DEFUN([LN_TASKLIST_LOCK], -[AC_MSG_CHECKING([kernel export tasklist_lock]) - if grep -q "EXPORT_SYMBOL(tasklist_lock)" \ - "$LINUX/kernel/fork.c" 2>/dev/null ; then - AC_DEFINE(HAVE_TASKLIST_LOCK, 1, - [tasklist_lock exported]) - AC_MSG_RESULT([yes]) - else - AC_MSG_RESULT([no]) - fi +[LB_CHECK_SYMBOL_EXPORT([tasklist_lock], +[kernel/fork.c],[ +AC_DEFINE(HAVE_TASKLIST_LOCK, 1, + [tasklist_lock exported]) +],[ +]) ]) # 2.6.19 API changes