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 333 - Endian in SDL_config.h and gcc-fat.sh
Summary: Endian in SDL_config.h and gcc-fat.sh
Status: RESOLVED INVALID
Alias: None
Product: SDL
Classification: Unclassified
Component: build (show other bugs)
Version: HG 1.2
Hardware: PowerPC Mac OS X (All)
: P2 critical
Assignee: Ryan C. Gordon
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-09-24 04:55 UTC by Peter Mulholland
Modified: 2006-09-25 14:00 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Peter Mulholland 2006-09-24 04:55:40 UTC
When built with gcc-fat.sh the ./configure script will write an SDL_config.h header that is ONLY VALID for the cpu being compiled on. This breaks the endian swap macro's as SDL_BYTEORDER will be wrong when the binary for the alternate cpu is being compiled.

I would recommend adding a configure option that prevents endian testing at build time, instead leaving it up to the preprocessor magic in SDL_endian.h
Comment 1 Sam Lantinga 2006-09-25 01:33:11 UTC
Are you sure?  Does it happen after a make distclean?  I tried it and here was my results:
sam-lantingas-computer:~/trunk/SDL-1.2 hercules$ find . -name SDL_config.h
./build/ppc/include/SDL_config.h
./build/x86/include/SDL_config.h
sam-lantingas-computer:~/trunk/SDL-1.2 hercules$ fgrep BYTEORDER */*/*/*config.h
build/ppc/include/SDL_config.h:#define SDL_BYTEORDER 4321
build/x86/include/SDL_config.h:#define SDL_BYTEORDER 1234

Then the installation process in fatbuild.sh installs SDL_config_macosx.h directly as SDL_config.h
Comment 2 Peter Mulholland 2006-09-25 08:31:14 UTC
Ahh... well that would be because you're supposed to use fatbuild.sh and not gcc-fat.sh :)

I had gotten so used to using gcc-fat.sh to build UB's for other libs that I mistakenly did this for SDL as well.

Feel free to apply the LART ;)
Comment 3 Sam Lantinga 2006-09-25 14:00:45 UTC
Heheh, no problem.