Commit graph

7 commits

Author SHA1 Message Date
Sam Lantinga
31c6c491c3 Fixed bug 4544 - SDL2.m4 SDL2.framework patch made it impossible to fail detection
Stian Skjelstad

check if $sdl_framework is set, before checking if directory exists

Patch that was merged here https://hg.libsdl.org/SDL/rev/9befd0acb9ef made it impossible for the SDL2 detection to fail, since one of the if statements fails to check if a variable is set or not.

if test -d $sdl_framework; then

can evaluate to true in some shells. I guess it falls into undefined behaviour when looking at the POSIX standard.
2019-03-16 18:45:10 -07:00
Sam Lantinga
295b8597ae Fixed bug 3429 - Update AM_PATH_SDL2() to also check for SDL2.framework
neoaggelos

It is common for Mac OS X to use the SDL2.framework instead of the classic UNIX dynamic lib.

Therefore, it makes sense for AM_PATH_SDL2() to be able to locate it. Attached is a patched sdl2.m4 (updated for that purpose).

Changes:
* look for SDL2.framework ONLY if pkg-config and sdl2-config tests failed (this is to ensure compatibility with the old behaviour)

* adds option ('--disable-sdlframework') to retreat to the old behaviour

* adds variable 'SDL2_FRAMEWORK' for the user to specify the exact path to SDL2.framework (e.g. if it is installed in a non-standard location)

Open to suggestions for further improvements
2016-09-29 16:37:08 -07:00
Sam Lantinga
958740dffc Fixed bug 1976 - SDL2.m4 shares same variables as SDL.m4 so they cache values
Edgar Simo

So basically the issue is that:

AC_PATH_PROG(SDL_CONFIG, sdl2-config, no, [$PATH])

in sdl2.m4 shares the same variable (SDL_CONFIG) as sdl.m4:

AC_PATH_PROG(SDL_CONFIG, sdl-config, no, [$PATH])

What happens is if you run the AM_PATH_SDL2 and then AM_PATH_SDL to say fall back on SDL if SDL2 isn't found, the AM_PATH_PROG command gets cached (ac_cv_path_SDL_CONFIG) so that unless you unset this cache variable, the result for AM_PATH_SDL will be EXACTLY the same as for AM_PATH_SDL2.

To fix I would recommend renaming SDL_CONFIG to SDL2_CONFIG in sdl2.m4, replacing all instances so it won't cache to the same variable.
2013-07-21 11:52:16 -07:00
Sam Lantinga
8792a8d88a Default the minimum required version to 2.0.0 2013-06-01 08:57:17 -07:00
Sam Lantinga
36344c7379 Updated macro comment 2013-02-15 15:22:12 -08:00
Sam Lantinga
37d3ab36d1 Switched the SDL 2 autoconf macro to AM_PATH_SDL2 2012-01-30 21:39:26 -05:00
Sam Lantinga
d71e0546a9 Updated to SDL 2.0, and SDL 2.0 can now be installed coexisting with SDL 1.2
--HG--
rename : sdl-config.in => sdl2-config.in
rename : sdl.m4 => sdl2.m4
rename : sdl.pc.in => sdl2.pc.in
2012-01-22 17:21:00 -05:00
Renamed from sdl.m4 (Browse further)