On November 21, 2003 12:16 pm, Ferenc Wagner wrote:
I've got a more or less standalone version which can run the tests and submit the results to a CGI script, if possible. It also differentiates between libwine and cross builds. I would be grateful for a review. One week point is its integration into the build system: I hacked something together which works, but not sure at all if that's the right way.
Hi Feri,
Nice work! It looks pretty clean, I think we're close to submit it. A few comments: -- yes, I think we can do better in terms of build integration (see patch) -- I don't think we need that many header files, it's a small app. It is just a tiny little nit, but I'd simply stick all of them in the winetests.h file. -- please use 4 space indentation throughout. This is partly a personal request, partly for consistency. 2 space indentation is slick, but it's hard on the eyes, and I find lately (hey, we're only growing old!) that I have a hard time following the code. -- I'm not sure about the WINELIB define. I'm afraid that one doesn't work as intended in the new scheme, we'll have to find something else. Anyway, we should just minimize it's use to the absolute minimum.
And here is the completely untested patch of trying to better integrate the cross compilation with the build system:
Index: configure.ac =================================================================== RCS file: /var/cvs/wine/configure.ac,v retrieving revision 1.209 diff -u -r1.209 configure.ac --- configure.ac 20 Nov 2003 04:17:33 -0000 1.209 +++ configure.ac 21 Nov 2003 19:59:40 -0000 @@ -1633,6 +1633,7 @@ programs/winemenubuilder/Makefile programs/winemine/Makefile programs/winepath/Makefile +programs/winetests/Makefile programs/winevdm/Makefile programs/winhelp/Makefile programs/winver/Makefile Index: Make.rules.in =================================================================== RCS file: /var/cvs/wine/Make.rules.in,v retrieving revision 1.163 diff -u -r1.163 Make.rules.in --- Make.rules.in 11 Oct 2003 01:05:18 -0000 1.163 +++ Make.rules.in 21 Nov 2003 19:44:04 -0000 @@ -53,6 +53,8 @@ MV = mv LINT = @LINT@ LINTFLAGS = @LINTFLAGS@ +CROSSCC = @CROSSCC@ +CROSSWINDRES = @CROSSWINDRES@ INCLUDES = -I$(SRCDIR) -I. -I$(TOPSRCDIR)/include -I$(TOPOBJDIR)/include $(EXTRAINCL) EXTRACFLAGS = @EXTRACFLAGS@ ALLCFLAGS = $(INCLUDES) $(DEFS) $(DLLFLAGS) $(EXTRACFLAGS) $(CPPFLAGS) $(CFLAGS) @@ -105,18 +107,22 @@ CLEAN_FILES = *.o *.a *.so *.ln *.$(LIBEXT) \#*\# *~ *% .\#* *.bak *.orig *.rej \ *.flc *.spec.c *.spec.def *.dbg.c y.tab.c y.tab.h @LEX_OUTPUT_ROOT@.c core
-OBJS = $(C_SRCS:.c=.o) $(EXTRA_OBJS) +OBJS = $(C_SRCS:.c=.o) $(EXTRA_OBJS) +CROSSOBJS = $(C_SRCS:.c=.cross.o) $(EXTRA_OBJS:.o=.cross.o) $(RC_SRCS:.rc=.res.cross.o)
RCOBJS = $(RC_SRCS:.rc=.res.o) LINTS = $(C_SRCS:.c=.ln)
# Implicit rules
-.SUFFIXES: .mc .rc .mc.rc .res .res.o .spec .spec.c .spec.def .ok +.SUFFIXES: .mc .rc .mc.rc .res .res.o .spec .spec.c .spec.def .ok .cross.o .res.cross.o
.c.o: $(CC) -c $(ALLCFLAGS) -o $@ $<
+.c.cross.o: + $(CROSSCC) -c $(ALLCFLAGS) -o $@ $< + .s.o: $(AS) -o $@ $<
@@ -128,6 +134,9 @@
.res.res.o: $(WINDRES) -i $< -o $@ + +.res.res.cross.o: + $(CROSSWINDRES) -i $< -o $@
.spec.spec.c: $(WINEBUILD) $(DEFS) -o $@ --main-module $(MODULE) --spec $< Index: dlls/Maketest.rules.in =================================================================== RCS file: /var/cvs/wine/dlls/Maketest.rules.in,v retrieving revision 1.28 diff -u -r1.28 Maketest.rules.in --- dlls/Maketest.rules.in 11 Oct 2003 01:05:18 -0000 1.28 +++ dlls/Maketest.rules.in 21 Nov 2003 19:50:35 -0000 @@ -25,9 +25,6 @@ IMPORTLIBS = $(IMPORTS:%=$(DLLDIR)/lib%.$(IMPLIBEXT))
CROSSTEST = $(TESTDLL:%.dll=%)_crosstest.exe -CROSSOBJS = $(C_SRCS:.c=.cross.o) $(RC_SRCS:.rc=.res.cross.o) $(TESTLIST:.c=.cross.o) -CROSSCC = @CROSSCC@ -CROSSWINDRES = @CROSSWINDRES@
@MAKE_RULES@
@@ -62,14 +59,6 @@ $(TESTRESULTS): $(MODULE)$(DLLEXT) $(DLLDIR)/$(TESTDLL)$(DLLEXT)
# Rules for cross-compiling tests - -.SUFFIXES: .cross.o .res.cross.o - -.c.cross.o: - $(CROSSCC) -c $(ALLCFLAGS) -o $@ $< - -.res.res.cross.o: - $(CROSSWINDRES) -i $< -o $@
crosstest:: @CROSSTEST@
diff -u programs/winetests.feri/Makefile.in programs/winetests/Makefile.in --- programs/winetests.feri/Makefile.in 2003-11-19 22:01:05.000000000 -0500 +++ programs/winetests/Makefile.in 2003-11-21 14:55:59.000000000 -0500 @@ -9,20 +9,18 @@
C_SRCS = main.c send.c util.c EXTRA_OBJS = winetests.o -RC_SRCS = winetests.rc - -CROSS_GCC = i586-mingw32msvc-gcc -CROSS_RC = i586-mingw32msvc-windres -CROSS_CFLAGS = -Wall -W -O2 -CROSS_OBJS = $(C_SRCS:.c=_cross.o) winetests_cross.o +RC_SRCS = winetests_so.rc
@MAKE_PROG_RULES@
# Special rules
-winetests.rc: maketests tests.list +winetests_so.rc: maketests tests.list $(SRCDIR)/maketests -r_so > $@
+winetests_pe.rc: maketests tests.list + $(SRCDIR)/maketests -r_pe > $@ + winetests.subtests: maketests tests.list $(SRCDIR)/maketests -s > $@
@@ -32,21 +30,12 @@ winetests.c: winetests.tests winetests.subtests (echo '#include "winetests.h"'; cat winetests.{sub,}tests) > $@
-res_cross.rc: maketests tests.list - $(SRCDIR)/maketests -r_pe > $@ - -$(CROSS_OBJS): %_cross.o: %.c - $(CROSS_GCC) $(CROSS_CFLAGS) -o $@ -c $< - -res_cross.o: res_cross.rc - $(CROSS_RC) -o $@ $< - -winetests_cross.exe: $(CROSS_OBJS) res_cross.o - $(CROSS_GCC) $^ -lws2_32 -o $@ +winetests_cross.exe: $(CROSSOBJS:_so.res.cross.o=_pe.res.cross.o) + $(CROSSCC) $^ -o $@ $(IMPORTS:%=-l%) $(LIBS)
clean:: rm -f winetests.c winetests.rc winetests.subtests \ winetests.tests winetests_cross.exe $(CROSS_OBJS) \ - res_cross.rc res_cross.o + winetests_pe.rc winetests_pe.res.cross.o
### Dependencies: diff -u programs/winetests.feri/util.h programs/winetests/util.h --- programs/winetests.feri/util.h 2003-11-17 14:36:43.000000000 -0500 +++ programs/winetests/util.h 2003-11-21 14:23:43.000000000 -0500 @@ -2,9 +2,7 @@ #define __UTIL_H
#include <stdio.h> -#ifndef WINELIB -# include <stdlib.h> -#endif +#include <stdlib.h>
void fatal (const char* msg); void *xmalloc (size_t len);