Hello, This is a patch inspired by numerous whining recently seen on ltp-list concerning compile failures when libaio is not present.
This includes changes: - add stubs to the aio tests - remove -laio from doio and pipeio makefile, as it was superfluous Changed the signatures of main() function (requested by Garrett Cooper). Regards Jiri Palecek Signed-Off-By: Jiri Palecek <[email protected]> --- testcases/kernel/fs/doio/Makefile | 2 +- testcases/kernel/io/aio/aio01/Makefile | 4 +++- testcases/kernel/io/aio/aio01/aio01.c | 21 +++++++++++++++++---- testcases/kernel/io/aio/aio02/Makefile | 7 ++++--- testcases/kernel/io/aio/aio02/main.c | 13 +++++++++++++ testcases/kernel/ipc/pipeio/Makefile | 2 +- 6 files changed, 39 insertions(+), 10 deletions(-) diff --git a/testcases/kernel/fs/doio/Makefile b/testcases/kernel/fs/doio/Makefile index c067fff..4e0cd24 100644 --- a/testcases/kernel/fs/doio/Makefile +++ b/testcases/kernel/fs/doio/Makefile @@ -1,6 +1,6 @@ CFLAGS+= -Wall -I../../../../include -D_LARGEFILE64_SOURCE -LDLIBS+= -L../../../../lib -lltp -laio -lrt +LDLIBS+= -L../../../../lib -lltp -lrt TARGETS=doio growfiles rwtest iogen SRCS=$(wildcard *.c) diff --git a/testcases/kernel/io/aio/aio01/Makefile b/testcases/kernel/io/aio/aio01/Makefile index b4aefa0..23b3f0f 100644 --- a/testcases/kernel/io/aio/aio01/Makefile +++ b/testcases/kernel/io/aio/aio01/Makefile @@ -20,8 +20,10 @@ # name of file : Makefile # # description : make(1) description file # ########################################################################### +include ../../../../../config.mk + CFLAGS+= -I../../../../../include -Wall -LOADLIBES+= -laio -L../../../../../lib -lltp +LOADLIBES+= $(AIO_LIBS) -L../../../../../lib -lltp SRCS=$(wildcard *.c) TARGETS=$(patsubst %.c,%,$(SRCS)) diff --git a/testcases/kernel/io/aio/aio01/aio01.c b/testcases/kernel/io/aio/aio01/aio01.c index 63a9cd9..12fa695 100644 --- a/testcases/kernel/io/aio/aio01/aio01.c +++ b/testcases/kernel/io/aio/aio01/aio01.c @@ -47,6 +47,14 @@ #define _XOPEN_SOURCE 600 +#include "test.h" +#include "usctest.h" + +char *TCID = "aio01"; +int TST_TOTAL=6; + +#ifdef HAVE_LIBAIO_H + #include <stdio.h> #include <stdlib.h> #include <unistd.h> @@ -58,8 +66,6 @@ #include <sys/stat.h> #include <sys/time.h> #include <sys/resource.h> -#include "test.h" -#include "usctest.h" void help(); void setup(); @@ -67,8 +73,6 @@ void cleanup(); #define mapsize (1 << 14) -char *TCID = "aio01"; -int TST_TOTAL=6; extern int Tst_count; int fd; char *maddr; @@ -417,3 +421,12 @@ void cleanup() { tst_rmdir(); tst_exit(); } + +#else + +int main(void) +{ + tst_brkm(TCONF, tst_exit, "libaio missing"); +} + +#endif diff --git a/testcases/kernel/io/aio/aio02/Makefile b/testcases/kernel/io/aio/aio02/Makefile index eaff098..b9f89e7 100644 --- a/testcases/kernel/io/aio/aio02/Makefile +++ b/testcases/kernel/io/aio/aio02/Makefile @@ -1,16 +1,17 @@ +include ../../../../../config.mk # foo. TEST_SRCS:=$(shell find cases/ -name \*.c | sort -n -t/ -k2) PROGS:=$(patsubst %.c,%,$(TEST_SRCS)) HARNESS_SRCS:=main.c # io_queue.c -CFLAGS=--static -Wall -g -O +CFLAGS=--static -Wall -g -O -I../../../../../include -Wall +LDFLAGS=-L../../../../../lib -lltp $(AIO_LIBS) #-lpthread -lrt -LIBAIO=-laio all: $(PROGS) $(PROGS): %: %.c $(HARNESS_SRCS) - $(CC) $(CFLAGS) -DTEST_NAME=\"$<\" -o $@ main.c $(LIBAIO) + $(CC) $(CFLAGS) -DTEST_NAME=\"$<\" -o $@ main.c $(LDFLAGS) clean: rm -f $(PROGS) *.o runtests.out rofile wofile rwfile diff --git a/testcases/kernel/io/aio/aio02/main.c b/testcases/kernel/io/aio/aio02/main.c index e91c384..fbf9301 100644 --- a/testcases/kernel/io/aio/aio02/main.c +++ b/testcases/kernel/io/aio/aio02/main.c @@ -7,6 +7,9 @@ #include <sys/types.h> #include <sys/stat.h> #include <unistd.h> +#include "test.h" + +#ifdef HAVE_LIBAIO_H #include <libaio.h> @@ -25,3 +28,13 @@ int main(void) fflush(stdout); return res ? 1 : 0; } +#else +char *TCID = "aio02/" TEST_NAME; +int TST_TOTAL=0; + +int main(void) +{ + tst_brkm(TCONF, tst_exit, "libaio missing"); +} + +#endif diff --git a/testcases/kernel/ipc/pipeio/Makefile b/testcases/kernel/ipc/pipeio/Makefile index 2bc6d92..afd3e8d 100644 --- a/testcases/kernel/ipc/pipeio/Makefile +++ b/testcases/kernel/ipc/pipeio/Makefile @@ -22,7 +22,7 @@ ########################################################################### CFLAGS += -Wall CPPFLAGS += -I../../../../include -LDLIBS += -L../../../../lib -lltp -lrt -laio +LDLIBS += -L../../../../lib -lltp -lrt SRCS=$(wildcard *.c) TARGETS=$(patsubst %.c,%,$(SRCS)) -- 1.6.0.6 ------------------------------------------------------------------------------ This SF.net email is sponsored by: SourcForge Community SourceForge wants to tell your story. http://p.sf.net/sfu/sf-spreadtheword _______________________________________________ Ltp-list mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/ltp-list
