Re: Cross compiling Winboard in Linux

Byrial Jensen <[email protected]>
Newsgroups gmane.comp.gnu.xboard.devel
Message-ID <[email protected]>
Den 05-01-2012 17:10, Byrial Jensen skrev:
> Hi,
>
> I have tried to see if I could cross copmile Winboard in Linux in order
> to be able to see if any code changes I make will break Winboard.
>
> It was relatively easy to do with a ready-made minGW cross compiler I
> just had to install, and the cross compiled Winboard.exe runs fine with
> Wine.
>
> But I had to make a few changes in the sources:
>
> 1) I replaced the functions random() and srandom() with the standard C
> functions rand() and srand() in backend.c and zippy.c.
>
> Is there any particular reason to use the non-standard versions of these
> function?
>
> 2) I replaced the include file <Windowsx.h> with <windowsx.h> in
> winboard/wsettings.c and winboard/wchat.c.
>
> I have no idea about what the include file does. I just found one with a
> similar name to replace a non-existing file - and saw that it could
> compile with no errors. Is it safe to replace Windowsx.h with windowsx.h?
>
> 3) I changed the reference to "res\\winboard.exe.manifest" in
> winboard/winboard.rc to use "/" instead of "\"
>
> Is there any any need to have that file in a subdirectory. It would be
> easier for me if it could be referenced without the need of path separator.
>
> 4) I replaced windres with i586-mingw32msvc-windres in the makefile and
> added --include-dir /usr/i586-mingw32msvc/include to its call arguments.
>
> 5) I removed $(PROJ).exe's dependency of $(PROJ).hlp in the makefile, as
> I cannot build the help file (I found nothing to replace "C:/Program
> Files/Help Workshop/hcrtf"). That dependency seems unnecessary to me
> anyway.

I forgot the last change:

6) I replaced "%lld" with the s64Display macro in a printf format string 
in backend.c to kill a warning about format error.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.