[Aranym-dev] Windows/Cygwin build of 1.0.2
halgara at yahoo.de
Mon Feb 9 18:05:45 CET 2015
> This is actually quite dangerous. For example, with this approach you're using SDL_config_minimal.h instead of SDL_config_win32.h
Not really. I'm using the SDL_config.h that was generated by configure.
> I've taken the liberty to try it on my own, again, The Right Way this time.
I fear there is no "Right Way" to do this ;)
> Now we can build aranym: ./configure --prefix=/usr/i686-w64-mingw32/sys-root/mingw
That definitely does not work. That will compile all of aranym using the mingw headers instead of cygwin headers.
BTW, with SDL2 things are getting even worse. I never managed to SDL2 from scratch myself, mostly because they are apparently using some headers from the latest Platform SDK that are not yet ported to MinGW. You can use the binary distribution though, with a small patch to the include headers that is included in the tools directory.
> It's possible to build fully Cygwin-aware build of Aranym, i.e. that SDL will use the X11
No it isn't. There is no SDL build for cygwin. It does not make sense anyway, because such an executable would require the user to install cygwins X server first.
> Previous Windows binary releases mixed up Cygwin and MinGW pretty badly
Yes, thats true, but its the way it is working currently. The only solution to this would be to get rid of the cygwin related stuff, but for now this would break other things (most file related stuff, e.g. symlinks, maybe network, VM handling etc.)
> -> SDL_image -> cygwin.dll
I had noticed that already. Apparently SDL_image was compiled for cygwin, thus also the dependencies to cygpng*.dll etc. The version i compiled uses a MinGW version, just like yours.
Miro Kropáček <miro.kropacek at gmail.com> schrieb am 13:40 Montag, 9.Februar 2015:
thank you for your input! Thanks to you I've decided to explore the wonderful world of mingw, mingw-w64, cygwin and win32 universe :)
TL;DR: there's a new, fixed, clean build at the end of this email.
On Mon, Feb 9, 2015 at 7:09 AM, Thorsten Otto <halgara at yahoo.de> wrote:
When i compiled aranym on cygwin, i used a separate MinGW32 installation instead to compile SDL and SDL_image, then copied the resulting libraries and headers to the cygwin directories before compiling aranym.
This is actually quite dangerous. For example, with this approach you're using SDL_config_minimal.h instead of SDL_config_win32.h which can define totally different things (size of int etc).
I've taken the liberty to try it on my own, again, The Right Way this time. Here's a quick howto, so if someone decides to build Aranym on Windows from scratch he wont be cutting his hair out again:
- Install http://cygwin.com/setup-x86.exe with basic prerequisites like gcc, g++, make, auto tools, ... plus the mingw64-i686 stuff (wont hurt to install everything, definitely go for gcc, g++, binutils, zlib, ... most of it gets installed automatically as a dependency anyway)
- Download http://libsdl.org/release/SDL-devel-1.2.15-mingw32.tar.gz and install it into /usr/i686-w64-mingw32/sys-root/mingw (you can do it either by hand -- bin, include and lib folders or with editing the Makefile's CROSS_PATH and "make cross")
- ln -s /usr/i686-w64-mingw32/sys-root/mingw/include/SDL/SDL_config_win32.h /usr/i686-w64-mingw32/sys-root/mingw/include/SDL/SDL_config_minimal.h
- Download & install development files of SDL_image 1.2.12 ... this is a bit tricky because there are no dev files available for mingw, so we'll build it by ourselves but include the runtime binaries in the end:
- Download http://sourceforge.net/projects/libpng/files/libpng15/older-releases/1.5.15/libpng-1.5.15.tar.gz/download, ./configure --host=i686-w64-mingw32 --prefix=/usr/i686-w64-mingw32/sys-root/mingw && make && make install (it depends on [mingw] zlib, so that's why we had installed it in the first step)
- Download https://www.libsdl.org/projects/SDL_image/release/SDL_image-1.2.12.tar.gz, PATH=/usr/i686-w64-mingw32/sys-root/mingw/bin:$PATH ./configure --host=i686-w64-mingw32 --prefix=/usr/i686-w64-mingw32/sys-root/mingw && make install
- ln -s /usr/i686-w64-mingw32/sys-root/mingw/include/SDL_image.h /usr/i686-w64-mingw32/sys-root/mingw/include/SDL/SDL_image.h
- Now we can build aranym: ./configure --prefix=/usr/i686-w64-mingw32/sys-root/mingw && make
- Package it all:
- *.dll from https://www.libsdl.org/projects/SDL_image/release/SDL_image-1.2.12-win32.zip
- SDL.dll from http://libsdl.org/release/SDL-1.2.15-win32.zip
- cygwin1.dll, cygstdc++-6.dll, cyggcc_s-1.dll from c:\cygwin\bin
Note for 3.: this step is required. SDL expects to be compiled against win32 (it had been compiled for the win32 host) but right now, we're forcing it to accept the Cygwin target (without #defined __WIN32__) which may or may not share the same settings. So this makes sure size of ints, longs etc stays exactly the same as it was by the time of SDL compilation.
Note for 4.: we do this only as a mean to get *.a files because there are no SDL_image devel builds for mingw.
Note for 4.3. & 5: Aranym has got big troubles to understand where to look for SDL includes and have no way to specify where to look for SDL_image includes. Even with --with-sdl-prefix it insists on /usr/local/include/SDL (default --prefix)
Note for 6: this step assures we use official binaries only, i.e. we get as close to the latest maintainer's versions as possible.
- Aranym is really mean to cross compilers. I.e. it's impossible to build cygwin targets under Linux for instance
- Aranym is somewhat compatible to MinGW. I did my best to overcome various obstacles, had a complete build in the end but it kept crashing :( However, you can't build the JIT version with it + it lacks networking
- It's possible to build fully Cygwin-aware build of Aranym, i.e. that SDL will use the X11 emulation layer but it's madness to have it slow down in such way (no hardware acceleration for graphics, too)
- Previous releases have missed some 3rd library licenses
- Previous Windows binary releases mixed up Cygwin and MinGW pretty badly: Aranym, SDL_image, zlib and the image libraries depended on Cygwin while SDL was a win32 build. The dependency tree looked like this:
Aranym-> cygwin.dll-> SDL.dll-> SDL_image -> cygwin.dll, SDL.dll
Now it looks like this:
Aranym-> cygwin.dll-> SDL.dll-> SDL_image.dll (and its dependents, also pure mingw/win32 binaries) -> SDL.dll
You can grab the result here: http://ge.tt/1wnxT9A2/v/0?c (completely packaged for the official distribution). No hard feelings if you wont use but I like things clean and official so this is going to be my dev environment since now. I'd like to try out 64-bit builds as the next step.
MiKRO / Mystic Bytes
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the cz-bobek-lists-aranym