FIFE forums

General Category => Help and troubleshooting => Topic started by: MattF on October 09, 2014, 09:45:09 am

Title: Building FIFE with SDL2
Post by: MattF on October 09, 2014, 09:45:09 am
Hi all.  I'm facing some challenges building FIFE.  I've obtained all of the necessary dependencies, but upon running "scons" I am told that SDL could not be found.

Due to X11/Quartz changes in some of the latest versions of OS X, I've found it much less problematic to install SDL2.  However, I would imagine that the "2" is preventing it from being picked up by the builder.

Does anyone know if there's a workaround to either get this working with SDL2 or get SDL1 to build from source in OS X?  I did add the runtime version of SDL1 to my "Frameworks" directory, but that couldn't be found by another dependency.

I'm on version 10.9.5 but I'd imagine it hasn't changed drastically in that regard in the last few dot releases.

Thanks!
Title: Re: Building FIFE with SDL2
Post by: helios on October 09, 2014, 10:02:44 am
Hey MattF,
the current version of FIFE needs SDL 1.2. There is a branch that already have support for SDL 2.0, we hope to merge that stuff into master within the next months.
I'm no expert for OSX systems but I think you are right, the "2" is a problem, normally both versions of SDL should be installed as SDL so it's not possible to have both versions at the same time.
SDL 1.2 for OSX can be found here https://www.libsdl.org/download-1.2.php (https://www.libsdl.org/download-1.2.php)
I'm no expert for OSX systems but maybe the link is helpful for you http://www.noquarterarcade.com/os-x-sdl-development-command-line-setup (http://www.noquarterarcade.com/os-x-sdl-development-command-line-setup)
Title: Re: Building FIFE with SDL2
Post by: MattF on October 09, 2014, 10:46:10 am
Thanks for that.

That OS X flavour of SDL 1.2 is what I'm talking about when I say that I added it to my Frameworks directory.

That guide says little more in terms of building SDL itself than the README.  I'm getting hung up on the "make" step with the following error:

Code: [Select]
In file included from ./src/events/SDL_events.c:27:
./include/SDL_syswm.h:58:10: fatal error: 'X11/Xlib.h' file not found

It's trying to include a couple of header files which can't be found on my system.  Even digging into SDL_events.c it looks like I'd have a lot to comment out or modify to eliminate the issue, and who knows what problems that could lead to.  So I figured I'd cut my losses and try SDL2.

If I can't figure anything out then perhaps I'll check out that branch.
Title: Re: Building FIFE with SDL2
Post by: helios on October 09, 2014, 11:50:22 am
You are welcome :)
Additional I can point you to the travis script for mac osx here: https://github.com/fifengine/fifengine/blob/master/.travis.mac.sh (https://github.com/fifengine/fifengine/blob/master/.travis.mac.sh)
and to the UH guide here: http://www.unknown-horizons.org/download/sources/s-osx/ (http://www.unknown-horizons.org/download/sources/s-osx/)
Maybe there are useful tips that can help you.
If it's possible you should use the master version of fife, simply because the branches are not well tested.