[quake3] Building On Mac

Thilo Schulz arny at ats.s.bawue.de
Fri Mar 30 00:36:07 EDT 2007


On Friday 30 March 2007 06:16, Jorge Peña wrote:
> Thanks guys, sorry for the long message, but I'd really appreciate it. And
> yes, I AM using the mac build script (Always have been). Thanks again, I
> really appreciate it.

No problem mate, I think you have made very clear that you have gone to some 
trouble already. You don't strike me as the casual dork wanting to get free 
tech support without doing work and learning on his own, so I am glad to 
help :)

First of all, your approach was already a step in the right direction.
I think curl is present on MacOSX already so I don't think you'll need to 
build it yourself.
Now on the topic of ogg I can advise you on the steps that I took to get a 
working MacOSX build.

Get the source to the libraries libogg, libvorbis and libvorbisfile 
(libvorbisfile is built with libvorbis). run configure 
using  --enable-static --disable-shared and build all three of them this 
way .. if you redistribute these builds you really want static ogg libraries 
as users most likely won't have them installed. If you want to make a 
universal binary, you must cross compile these three libraries at least for 
the other platform you want to support.
After the build process is finished, you'll find the .a files for the static 
libraries somewhere in the lib/.libs/ directory. I suggest you copy them out 
of there and put them into some collective directory as you indicated you 
already did.
Then you have to edit the Makefile to indicate the include directories + where 
to find these libraries in the build process.

This is what the relevant sections of my Makefile look like in the macosx 
section:
for ppc:
    BASE_CFLAGS += -arch ppc -DSMP \
      -I/Users/thilo/libogg-1.1.3/include \
      -I/Users/thilo/libvorbis-1.1.2/include \
      -DMAC_OS_X_VERSION_MIN_REQUIRED=1020 -nostdinc \
      -F/Developer/SDKs/MacOSX10.2.8.sdk/System/Library/Frameworks \
...

    LDFLAGS += -arch ppc \
      -L/Users/thilo/libmerge/ppc \
      -L/Developer/SDKs/MacOSX10.2.8.sdk/usr/lib/gcc/darwin/3.3 \
      -F/Developer/SDKs/MacOSX10.2.8.sdk/System/Library/Frameworks \

as you can see, I added a few lines. libmerge/ppc happens to be the place 
where I put the ppc ogg and vorbis lib stuff into.

Similarly, for i386:
        BASE_CFLAGS += -arch i386 -DSMP \
      -mmacosx-version-min=10.4 \
      -I/Users/thilo/libogg-1.1.3/include \
      -I/Users/thilo/libvorbis-1.1.2/include \
      -DMAC_OS_X_VERSION_MIN_REQUIRED=1040 -nostdinc \
      -F/Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks \
      -I/Developer/SDKs/MacOSX10.4u.sdk/usr/lib/gcc/i686-apple-darwin8/4.0.1/include 
      -isystem /Developer/SDKs/MacOSX10.4u.sdk/usr/include
    LDFLAGS = -arch i386 -mmacosx-version-min=10.4 \
      -L/Users/thilo/libmerge/i386 \
      -L/Developer/SDKs/MacOSX10.4u.sdk/usr/lib/gcc/i686-apple-darwin8/4.0.1 \
      -F/Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks \
      -Wl,-syslibroot,/Developer/SDKs/MacOSX10.4u.sdk,-m

These are only meant as examples, you will have to give the directories 
depending on your setup of course. Notice, that I added a ",-m" in the very 
last block compared to the original, where no -m can be found after:
MacOSX10.4u.sdk
This may be required if building fails and the linker complains about some 
double defined OpenAL symbols if I remember correctly.

You will also want to defuse this line:
# Always include debug symbols...you can strip the binary later...
  BASE_CFLAGS += -gfull

by commenting it. You don't want debugging if you're not a developer or trying 
to hunt a bug. It will only bloat your binary and hurt speed.

I hope these instructions were sufficient. Good luck!

-- 
Thilo Schulz
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://icculus.org/pipermail/quake3/attachments/20070330/999b521f/attachment.pgp>


More information about the quake3 mailing list