[Tuxnes-devel] compiling tuxnes for win32
Brought to you by:
tmmm
From: Jason D. S. <jd...@us...> - 2004-02-18 01:21:44
|
Since I happened to be compiling some other programs for win32, I did the same with Tuxnes. Naturally, it didn't work. I used mingw32 on debian unstable, compiled with export LD_LIBRARY_PATH=/usr/i586-mingw32msvc/lib export CC=i586-mingw32msvc-gcc export RANLIB=i586-mingw32msvc-ranlib export AR=i586-mingw32msvc-ar ./autogen.sh ./configure --host=i586-mingw32msvc --prefix=/usr/i586-mingw32msvc make and worked through the problems. The attached patch is as far as I got. Some notes: - I had to remove io.h since it conflicted with a header include file <io.h>. I didn't get far enough to find out if this caused problems. It should probably just be renamed. - I imported mkdir.m4 from another project to check to see if mkdir takes two arguments or one. I added this in m4/mkdir.m4 and modified autogen.sh accordingly. - types.h is a pretty generic name and may conflict with a header file on some systems. With mingw, I didn't have this problem but did have a problem with the _TYPES_H_ protective #definition. So I renamed it to __TYPES_H_. - Most of the other changes are good and obviously correct. They may help compilation on some posix systems. I've replaced some checks like "#ifdef __FreeBSD__" with better checks like "#ifdef HAVE_SYS_ENDIAN_H". - Where I finally hit a wall was with mmap, which isn't available on Windows. I don't know enough to write a replacement for it, although it looks like doing so would be possible (and would cause the code to make a lot more sense to me!). From "man mmap": On POSIX systems on which mmap, msync and munmap are available, _POSIX_MAPPED_FILES is defined in <unistd.h> to a value greater than 0. jason |