Breakthrough! Can now crosscompile unit tests!

Uwe Bonnes bon at elektron.ikp.physik.tu-darmstadt.de
Fri May 10 08:59:53 CDT 2002


>>>>> "Jakob" == Jakob Eriksson <jakob at vmlinux.org> writes:

    Jakob> On Thu, May 09, 2002 at 08:01:51PM -0400, Steven Edwards wrote:


    Jakob> Ah, but of course! :-) I'm happy now!

    Jakob> Now it works, at least for dlls/kernel/tests/file.c

    Jakob> If you compile with:

    Jakob> i586-mingw32msvc-gcc -o FILE.EXE -DREAL_EXE file.c


    Jakob> The magic is the defines of ok, todo_wine and START_TEST.

    Jakob> See this as proof of concept, I'm sure someone can make this look
    Jakob> better.

    Jakob> (If you have Debian 3.0, just "apt-get install mingw32-runtime
    Jakob> mingw32".)


    Jakob> How do I make this happen automagically when doing "make tests"?


You can test for __MINGW32__, __CYGWIN__ or __linux in your source:
#include <stdio.h>

int main(void)
{
  #ifdef __linux
  printf("compiled on linux\n");
  #endif
  #ifdef __MINGW32__
  printf("compiled with mingw\n");
  #endif
  return 0;
}

> gcc test.c
> ./a.out
compiled on linux
> i386-mingw32msvc-gcc test.c
> wine a.exe
compiled with mingw

Something like "make GCC=i586-mingw32msvc-gcc" (not sure about the syntax)
exchanges gcc against i586-mingw32msvc-gcc in well written Makefiles.

Are there any recent mingw rpm packages for linux?

Bye
-- 
Uwe Bonnes                bon at elektron.ikp.physik.tu-darmstadt.de

Institut fuer Kernphysik  Schlossgartenstrasse 9  64289 Darmstadt
--------- Tel. 06151 162516 -------- Fax. 06151 164321 ----------



More information about the wine-devel mailing list