Subrata Modak <[EMAIL PROTECTED]> wrote:
> make[4]: Entering directory
> `/root/subrata/ltp/ltp-intermediate-20080820/testcases/kernel/syscalls/move_pages'
> cc -Wall  -I../../include -g -Wall -I../../../../include -Wall   -c -o
> move_pages_support.o move_pages_support.c
> cc -Wall  -I../../include -g -Wall -I../../../../include -Wall
> move_pages01.c move_pages_support.o  -L../../../../lib -lltp -lnuma -lrt
> -o move_pages01
> move_pages01.c: In function main:
> move_pages01.c:101: warning: implicit declaration of function
> numa_move_pages

Hi Subrata,
as pointed out by Jin Bing Guo, only recent versions of libnuma have
support for move_pages(). It is necessary to check if move_pages()
support is available before compiling the test cases.

Changelog:

  * Check if move_pages() support is available in libnuma.

Signed-off-by: Vijay Kumar <[EMAIL PROTECTED]>

 testcases/kernel/syscalls/move_pages/Makefile |   19 ++++++++++++++++++-
 1 files changed, 18 insertions(+), 1 deletions(-)

diff --git a/testcases/kernel/syscalls/move_pages/Makefile 
b/testcases/kernel/syscalls/move_pages/Makefile
index 77cdbd9..4f861ed 100644
--- a/testcases/kernel/syscalls/move_pages/Makefile
+++ b/testcases/kernel/syscalls/move_pages/Makefile
@@ -19,12 +19,29 @@
 CFLAGS += -I../../../../include -Wall
 LDLIBS += -L../../../../lib -lltp -lnuma -lrt
 
-ifeq ($(HAS_NUMA),yes)
+check_numa_move_pages = $(shell \
+       if echo -e \
+       "\#include <numa.h>\n\
+       int main() \
+       { \
+       numa_move_pages(0, 0, NULL, NULL, NULL, 0); \
+       return 0; \
+       }" | $(CC) -xc -lnuma - > /dev/null 2>&1 ; \
+       then echo yes ; \
+       else echo no ; fi)
+
+HAS_NUMA_MOVE_PAGES := $(call check_numa_move_pages)
+
+ifeq ($(HAS_NUMA_MOVE_PAGES),yes)
 SRCS    = $(wildcard *.c)
 TARGETS = $(patsubst %.c, %, $(wildcard *[0-9].c))
 endif
 
 all: $(TARGETS)
+ifeq ($(HAS_NUMA_MOVE_PAGES),no)
+       @echo "Note: Libnuma with move_pages support is required for" \
+       "move_pages testcases.";
+endif
 
 move_pages_support.o: move_pages_support.h move_pages_support.c
 

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

Reply via email to