Mac OS X 10.4 FAT build from CVS

A few of the utilities are missing that the build-script
fatbuild.sh’ relies on.
So I dragged them over from 1.2.9.

But then I got this running ‘configure’:

checking how to run the C preprocessor… /lib/cpp
configure: error: C preprocessor “/lib/cpp” fails sanity check
See `config.log’ for more details.

For what it is worth, I cannot build SDL 1.2.9 on OS X 10.4 i386 either.

Daniel

A few of the utilities are missing that the build-script
fatbuild.sh’ relies on.
So I dragged them over from 1.2.9.

You need the following items:
Xcode 2.2 (including gcc 3.3 and 4.0, and the 10.2 and 10.4 SDKs)
Then run autogen.sh followed by build-scripts/fatbuild.sh

If you still have problems, let me know what you had to copy over
from SDL 1.2.9, and attach config.log

-Sam Lantinga, Senior Software Engineer, Blizzard Entertainment

You need the following items:
Xcode 2.2 (including gcc 3.3 and 4.0, and the 10.2 and 10.4 SDKs)
Then run autogen.sh followed by build-scripts/fatbuild.sh

If you still have problems, let me know what you had to copy over
from SDL 1.2.9, and attach config.log

ENVOn Apr 23, 2006, at 17:48, Sam Lantinga wrote:

XCode:
v 2.2.1

gcc versions:
[daniello at mercury.local]$ sudo gcc_select 3.3
Default compiler has been set to:
gcc version 3.3 20030304 (Apple Computer, Inc. build 1819)
[daniello at mercury.local]$ sudo gcc_select 4.0
Default compiler has been set to:
gcc version 4.0.1 (Apple Computer, Inc. build 5250)

SDKs:
[daniello at mercury.local]$ cd /Developer/SDKs/
[daniello at mercury.local]$ ls
MacOSX10.2.8.sdk MacOSX10.3.9.sdk
MacOSX10.4.0.sdk MacOSX10.4u.sdk

INSTALLATION

[daniello at mercury.local]$ cd ~/Project/ioQuake/SDL/
[daniello at mercury.local]$ cvs -d :pserver:guest at libsdl.org:/home/
sdlweb/libsdl.org/cvs login
Logging in to :pserver:guest at libsdl.org:2401/home/sdlweb/libsdl.org/cvs
CVS password:
[daniello at mercury.local]$ cvs -z3 -d :pserver:guest at libsdl.org:/home/
sdlweb/libsdl.org/cvs checkout SDL12
cvs checkout: Updating SDL12
U SDL12/.cvsignore
U SDL12/BUGS
U SDL12/Borland.html
---- snipped ------
U SDL12/test/testwin.c
U SDL12/test/testwm.c
U SDL12/test/threadwin.c
U SDL12/test/torturethread.c
U SDL12/test/utf8.txt
[daniello at mercury.local]$

BUILD ATTEMPTS

[daniello at mercury.local]$ cd SDL12
[daniello at mercury.local]$ ./autogen.sh
Generating build information using autoconf
This may take a while …
Now you are ready to run ./configure
[daniello at mercury.local]$ ./configure
checking build system type… i386-apple-darwin8.6.1
checking host system type… i386-apple-darwin8.6.1
checking for gcc… gcc
checking for C compiler default output file name… a.out
— snipped —
Generating dependencies for ./src/cdrom/macosx/CDPlayer.c
Generating dependencies for ./src/cdrom/macosx/SDLOSXCAGuard.c
Generating dependencies for ./src/cdrom/macosx/SDL_syscdrom.c
Generating dependencies for ./src/timer/unix/SDL_systimer.c
[daniello at mercury.local]$

BUT

[daniello at mercury.local]$ sh build-scripts/fatbuild.sh
checking build system type… i386-apple-darwin
checking host system type… powerpc-apple-darwin
checking for powerpc-apple-darwin-gcc… gcc-3.3
checking for C compiler default output file name… a.out
checking whether the C compiler works… yes
checking whether we are cross compiling… yes
checking for suffix of executables…
checking for suffix of object files… o
checking whether we are using the GNU C compiler… yes
checking whether gcc-3.3 accepts -g… no
checking for gcc-3.3 option to accept ANSI C… none needed
checking whether byte ordering is bigendian… yes
checking for a sed that does not truncate output… /usr/bin/sed
checking for egrep… grep -E
checking for ld used by gcc-3.3… /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld… no
checking for /usr/bin/ld option to reload object files… -r
checking for BSD-compatible nm… nm
checking whether ln -s works… yes
checking how to recognise dependent libraries… pass_all
checking how to run the C preprocessor… /lib/cpp
configure: error: C preprocessor “/lib/cpp” fails sanity check
See `config.log’ for more details.
[daniello at mercury.local]$

Just using the regular (./configure | make | sudo make install) from
the top directory made the static libs (.a) FAT but not the shared
libs (dylib).
I see what I can do to add dylibs. So this complex fat_build script
is not necessary if one just wants static FAT libs.

[daniello at mercury.local]$ file /usr/local/lib/libSDL.a
/usr/local/lib/libSDL.a: Mach-O universal binary with 2 architectures
/usr/local/lib/libSDL.a (for architecture i386): current ar
archive random library
/usr/local/lib/libSDL.a (for architecture ppc): current ar archive

[daniello at mercury.local]$ file /usr/local/lib/libSDL.dylib
/usr/local/lib/libSDL.dylib: symbolic link to `libSDL-1.2.0.7.3.dylib’

[daniello at mercury.local]$ file /usr/local/lib/libSDLmain.a
/usr/local/lib/libSDLmain.a: Mach-O universal binary with 2
architectures
/usr/local/lib/libSDLmain.a (for architecture ppc): current ar
archive
/usr/local/lib/libSDLmain.a (for architecture i386): current ar
archive

Oops! It was late and I pasted in the wrong lines :wink:

[daniello at mercury.local]$ file /usr/local/lib/libSDL-1.2.0.7.3.dylib
/usr/local/lib/libSDL-1.2.0.7.3.dylib: Mach-O dynamically linked
shared library i386On Apr 23, 2006, at 23:13, Daniel Lord wrote:

Just using the regular (./configure | make | sudo make install) from
the top directory made the static libs (.a) FAT but not the shared
libs (dylib).
I see what I can do to add dylibs. So this complex fat_build script
is not necessary if one just wants static FAT libs.

[daniello at mercury.local]$ file /usr/local/lib/libSDL.a
/usr/local/lib/libSDL.a: Mach-O universal binary with 2 architectures
/usr/local/lib/libSDL.a (for architecture i386): current ar
archive random library
/usr/local/lib/libSDL.a (for architecture ppc): current ar archive

[daniello at mercury.local]$ file /usr/local/lib/libSDL.dylib
/usr/local/lib/libSDL.dylib: symbolic link to
`libSDL-1.2.0.7.3.dylib’

[daniello at mercury.local]$ file /usr/local/lib/libSDLmain.a
/usr/local/lib/libSDLmain.a: Mach-O universal binary with 2
architectures
/usr/local/lib/libSDLmain.a (for architecture ppc): current ar
archive
/usr/local/lib/libSDLmain.a (for architecture i386): current ar
archive


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl

Okay, we got all the kinks worked out.
fatbuild.sh builds Universal binaries using the configure method,
building on Mac OS X 10.4, targeting 10.2 Power PC and 10.4 Intel.

Thanks!
-Sam Lantinga, Senior Software Engineer, Blizzard Entertainment