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 867

Summary: fatbuild.sh doesn't work with Mac OS X 10.4 build tools
Product: SDL Reporter: Tony J. White <tjw>
Component: buildAssignee: Sam Lantinga <slouken>
Status: RESOLVED WONTFIX QA Contact: Sam Lantinga <slouken>
Severity: minor    
Priority: P2 CC: icculus
Version: HG 1.2   
Hardware: All   
OS: Mac OS X 10.4 (Intel)   
Attachments: svn 5180 patch for fatbuild.sh
whups, updated
New patch correcting some problems with the previous patch
Replacement fatbuild.sh (full script, not a patch file)

Description Tony J. White 2009-10-28 20:18:03 UTC
Created attachment 433 [details]
svn 5180 patch for fatbuild.sh

An update betweein 1.2.11 and 1.2.12 broke building of the universal binary on
10.4 systems.  A recent update (after 1.2.14) fixed a similar issue with
building on 10.6 systems, this patch expands what was done there so that it
works with 10.4 as well.

I also removed a line in the script that creates a recursive symbolic link on
my system. It looks like it might do this on all systems?

Patch attached against SVN 5180.
Comment 1 Tony J. White 2009-10-28 20:25:09 UTC
Created attachment 434 [details]
whups, updated
Comment 2 Sidney 2009-11-29 18:55:10 UTC
Created attachment 452 [details]
New patch correcting some problems with the previous patch

That last patch had a number of problems in Snow Leopard. This patch seems to work on my Snow Leopard machine and I hope doesn't break anything new.

What it fixes:

1. Snow Leopard drops support for 10.3.9. There is no 10.3.9 SDK to use for the PPC build. The code assumed that PPC build should use the 10.3.9 SDK.
2. The previous patch set GCCUSERPATH to ...i686-apple-darwin... even in the PPC section, instead of using powerpc-apple-darwin
3. In the powerpc section GCCUSERPATH was never set to ...darwin10...
 Even though the PPC doesn't run Darwin10 (10.6), on a Snow leopard machine the directory is named powerpc-apple-darwin10
4. In Snow Leopard the 10.4 SDK is an optional component of the Xcode install, by default not installed. So it is necessary to check for the 10.4 SDK not being there, making 10.5 the minimum target version if it isn't.
5. On my system, the build process for ppc produces a directory named .dSYM which contains some files with the same name as files that are being build. That resulted in an error

lipo: ./ppc/build/.libs/libSDL-1.2.0.dylib and ./ppc/build/.libs/libSDL-1.2.0.dylib.dSYM/Contents/Resources/DWARF/libSDL-1.2.0.dylib have the same architectures (ppc) and can't be in the same fat output file

I fixed it by adding -maxdepth 4 to go along with the -mindepth 3 in the find loop that gathers up the dylib files to lipo.
6. If you build just static libraries, that same section of code that lipos the gathered dylibs errors out when there are no dylib files to lipo. I added an if around it to fix that.

I have only tested this in Snow Leopard. I'm sure it needs a shaking out in Tiger and Leopard.

However, I thought I read that SDL 1.2.14 abandons compatibility with anything earlier than 10.4. Is that true, and if it is, couldn't all the pre-10.4 stuff in this script be stripped out?
Comment 3 Sidney 2009-11-30 00:38:42 UTC
Created attachment 453 [details]
Replacement fatbuild.sh (full script, not a patch file)

That last patch I uploaded was a disaster. Even though it built SDL apparently ok, when I tried to build the various libSDL_* against it as universal binaries I got strange error messages that referenced /DeveloperSDKs/MacOSX10.4u.sdk/usr/lib/gcc/i686-apple-darwin10/ even though it was linking the PowerPC objects.

I don't understand why the separate phases have to contain all those complications that make up most of the script, when building for a single platform just works by running configure with mostly default options.

The attached file is a replacement fatbuild.sh that takes that simpler approach, and seems to work for me under Snow Leopard. It only allows building under Mac OS 10.4 or later because it is my understanding that as of SDL 1.2.14 older versions od Mac OS are no longer supported. Please correct me if I am wrong about that.
Comment 4 Ryan C. Gordon 2011-08-21 06:53:32 UTC
Resolving this bug (Sam removed the PowerPC support from fatbuild.sh, unrelated to this bug report, for the same effect).

--ryan.