We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 1976 - SDL2.m4 shares same variables as SDL.m4 so they cache values
Summary: SDL2.m4 shares same variables as SDL.m4 so they cache values
Status: RESOLVED FIXED
Alias: None
Product: SDL
Classification: Unclassified
Component: *don't know* (show other bugs)
Version: HG 2.0
Hardware: All All
: P2 normal
Assignee: Ryan C. Gordon
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-07-16 16:58 UTC by Edgar Simo
Modified: 2013-07-21 14:55 UTC (History)
0 users

See Also:


Attachments
Replaces SDL_CONFIG with SDL2_CONFIG in sdl2.m4 to allow AM_PATH_SDL2 to work with AM_PATH_SDL independently (4.12 KB, patch)
2013-07-16 16:58 UTC, Edgar Simo
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Edgar Simo 2013-07-16 16:58:46 UTC
Created attachment 1240 [details]
Replaces SDL_CONFIG with SDL2_CONFIG in sdl2.m4 to allow AM_PATH_SDL2 to work with AM_PATH_SDL independently

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. Attaching a tested patch that fixes this.
Comment 1 Sam Lantinga 2013-07-21 14:55:07 UTC
Fixed, thanks!
http://hg.libsdl.org/SDL/rev/98de3e4f1c36