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

Summary: Endian in SDL_config.h and gcc-fat.sh
Product: SDL Reporter: Peter Mulholland <darkmatter>
Component: buildAssignee: Ryan C. Gordon <icculus>
Status: RESOLVED INVALID QA Contact: Sam Lantinga <slouken>
Severity: critical    
Priority: P2    
Version: HG 1.2   
Hardware: PowerPC   
OS: Mac OS X (All)   

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.