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 171 - include/SDL_config.h is always flagged "modified" by CVS...
Summary: include/SDL_config.h is always flagged "modified" by CVS...
Status: RESOLVED FIXED
Alias: None
Product: SDL
Classification: Unclassified
Component: *don't know* (show other bugs)
Version: HG 1.2
Hardware: All All
: P2 normal
Assignee: Ryan C. Gordon
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-03-22 00:07 UTC by Ryan C. Gordon
Modified: 2006-03-23 16:29 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ryan C. Gordon 2006-03-22 00:07:09 UTC
Running autogen.sh and configure will overwrite include/SDL_config.h, making CVS treat this file as modified everytime you perform an update/diff/commit.

Is there any platform that _needs_ this to be in CVS, or do all the non-autoconf platforms use SDL_config_win32.h, etc? If we don't explicitly need it, we should delete the file from CVS and add it to .cvsignore ...

--ryan.
Comment 1 Sam Lantinga 2006-03-22 00:32:03 UTC
Any platform where the code is checked out from CVS and then directly built from an IDE needs this.  (e.g. Win32, MacOS X Xcode, etc.)
Comment 2 Ryan C. Gordon 2006-03-22 03:58:31 UTC
Maybe we should generate an SDL_config_local.h that's never checked into CVS?

--ryan.

Comment 3 Sam Lantinga 2006-03-22 04:11:51 UTC
The trick is how do we know to include it?
Comment 4 Sam Lantinga 2006-03-22 04:25:43 UTC
Got it, I'll check it in shortly.
Comment 5 Sam Lantinga 2006-03-22 04:30:14 UTC
I take it back.

The trick is, if we check out and build under an IDE, then we want the default config for that platform.  But if we build using the configure method, then we want to use the generated header, overriding the default config.  We also need to know in applications which are built using SDL_config.h, which we ended up doing. :)

I'm open to suggestions...
Comment 6 Ryan C. Gordon 2006-03-22 06:28:33 UTC
How about this:

- Rename SDL_config.h.minimal to SDL_config_minimal.h
- Make the current #else section in SDL_config.h into an #elif defined(__SDL_MINIMAL__)
- Make a new #else section that includes SDL_config_local.h
- SDL_config_local.h is built by configure and installed with "make install"
- Platforms that don't use autoconf and don't have an explicit section in SDL_config.h can either be added where reasonable (#elif defined(__MY_EMBEDDED_PLATFORM__)), or force use of the minimal config header in their build system. Everyone else uses autoconf or something that can generate an SDL_config_local.h header.
- Never check SDL_config_local.h into CVS.
- Add SDL_config_local.h to .cvsignore.

Also, my assumption is that using the default minimal config is almost always an error, so it might be better to leave the SDL_config.h.minimal as a guideline, and let people deal with incorrectly falling into SDL_config_local.h as a platform-specific issue that's usually resolved with a new #elif in SDL_config.h.

That might be totally off the wall, but that's the best I've got right now.

--ryan.

Comment 7 Sam Lantinga 2006-03-22 10:48:13 UTC
I actually had this completely done and set up exactly this way and about to check in last night, when I realized that in this setup, the configure generated header would never override the default Win32 configuration when building SDL with gcc for Windows.

I'm stumped.
Comment 8 Max Horn 2006-03-22 12:17:39 UTC
I just noticed the same issue and sent a mail to Sam before noticing we now have a Bugzilla (yay to that, BTW :-).

FYI, this is how I handled a very similar issue when I ported Exult to MacOS Classic (back in the good old days ;-):

Instead of having SDL_config_PLATFORM.h, use PLATFORM/SDL_config.h . Then, the default "unix" installer ignores these files (to this end, one may want to keep those outside the "include" dir, maybe in a new "dists" directory or so). The "unix" build is unchanged. All custom non-native build systems simply are changed to add their corresponding PLATFORM/ dir to the includ dir list at the front. And their installers simply install PLATFORM/SDL_config.h

Of course, for this to work the "install" method used by the custom build method must be powerful enough to install PLATFORM/SDL_config.h into the right place.
Comment 9 Sam Lantinga 2006-03-23 16:29:34 UTC
SDL_config.h is no longer in CVS.  Instead, configure will generate it for
systems that use configure, and we always copy SDL_config.h.default to
SDL_config.h before generating a snapshot or release archive.