[LTP] [PATCH 1/3] m4/ltp-numa.m4: fixed numa config

Zhouping Liu
2012-04-28T07:48:06Z

numa_alloc_onnode() and numa_move_pages() all need numa lib '-lnuma',
but in ltp-numa.m4, we just checked the two functions using
AC_CHECK_FUNCS, without the patch, it always report such error
log in numa system: "undefined reference to `numa_alloc_onnode`",
which blocked syscalls/move_pages/* cases, the patch fixed it.

Signed-off-by: Zhouping Liu <zliu@redhat.com>
---
m4/ltp-numa.m4 | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/m4/ltp-numa.m4 b/m4/ltp-numa.m4
index bcc5e6b..d03bc80 100644
--- a/m4/ltp-numa.m4
+++ b/m4/ltp-numa.m4
@@ -26,7 +26,14 @@ AC_DEFUN([LTP_CHECK_SYSCALL_NUMA],
[dnl
AC_CHECK_HEADERS([linux/mempolicy.h numa.h numaif.h],[
LTP_SYSCALL_NUMA_HEADERS=yes
- AC_CHECK_FUNCS(numa_alloc_onnode,numa_move_pages)
+ AC_CHECK_LIB(numa,numa_alloc_onnode,[have_numa_alloc_onnode="yes"])
+ if test "x$have_numa_alloc_onnode" = "xyes"; then
+ AC_DEFINE(HAVE_NUMA_ALLOC_ONNODE,1,[define to 1 if you have 'numa_alloc_onnode' function])
+ fi
+ AC_CHECK_LIB(numa,numa_move_pages,[have_numa_move_pages="yes"])
+ if test "x$have_numa_move_pages" = "xyes"; then
+ AC_DEFINE(HAVE_NUMA_MOVE_PAGES,1,[define to 1 if you have 'numa_move_pages' function])
+ fi
]
AC_CHECK_LIB(numa,numa_available,[
NUMA_CPPFLAGS="-DNUMA_VERSION1_COMPATIBILITY"
--
1.7.10