[quake3] Building On Mac

Jorge Peña jorgepblank at gmail.com
Sat Mar 31 16:28:59 EDT 2007


I found this (
http://www.ipodlinux.org/forums/viewtopic.php?t=216&view=previous&sid=bde0a3071e484f13eea61ffa33c122e8)
which looks like I need zlib for freetype, but I built freetype and it
seemed to have compiled perfectly (freetype, I mean). By the way, I didn't
do the "run configure using  --enable-static --disable-shared", because I
found the .a files in the lib folder anyways, is this okay? If not then I'll
rebuild the things. I also tried with USE_CURL_DLOPEN and USE_OPENAL_DLOPEN
set to 0, no go.

Okay, I made it so it looks in /usr/local/lib and /usr/local/include now
instead of my /libs/macosx directory. I configured all the paths and they
should be working now, but now I'm getting mismatching architecture reports,
having to do with the dylib, so I'm recompiling the libraries with
--enable-shared=no and --enable-static=yes, hopefully that does it.

Thanks un dead, but now I know that it's from zlib :D

On 3/31/07, Jorge Peña <jorgepblank at gmail.com> wrote:
>
> Hey sorry to keep bothering, but here are the things I added (The relevant
> stuff at least):
>
> For PPC:
>
>     BASE_CFLAGS += -arch ppc -DSMP \
>       -I$(PWD)/code \
>       -I$(PWD)/code/vorbis/include \
>       -I$(PWD)/code/freetype \
>       -DMAC_OS_X_VERSION_MIN_REQUIRED=1020 -nostdinc \
>       -F/Developer/SDKs/MacOSX10.2.8.sdk/System/Library/Frameworks \
>       -I/Developer/SDKs/MacOSX10.2.8.sdk/usr/include/gcc/darwin/3.3 \
>       -isystem /Developer/SDKs/MacOSX10.2.8.sdk/usr/include
>
>     LDFLAGS += -arch ppc \
>       -L$(PWD)/code/libs/macosx \
>       -L/Developer/SDKs/MacOSX10.2.8.sdk/usr/lib/gcc/darwin/3.3 \
>       -F/Developer/SDKs/MacOSX10.2.8.sdk/System/Library/Frameworks \
>       -Wl,-syslibroot,/Developer/SDKs/MacOSX10.2.8.sdk,-m
>     ARCH=ppc
>
> I did the same for i386, I didn't show it though because I'm actually
> building on PPC at the moment. Anyways, I also commented out the line:
>
>   # Always include debug symbols...you can strip the binary later...
>   #BASE_CFLAGS += -gfull
>
> It gets a lot further into the build process now, and then it spits out
> the following:
>
> ld: Undefined symbols:
> _fprintf$LDBLStub
> _sprintf$LDBLStub
> _inflate
> _inflateEnd
> _inflateInit2_
> _inflateReset
> make[1]: *** [build/release-darwin-ppc/tip.ppc] Error 1
> make: *** [build_release] Error 2
>
> I google'd this and I found out it's a linker error (ld, duh). I google'd
> for the symbols, and I can't find what library they correspond to, I thinkit's zlib. Does anything make use of zlib from the following: libogg,
> libvorbis, libfreetype, libcurl? I'm just wondering, because before this,
> the engine built perfectly. But come to think of it, it probably IS a zlib
> dependency, I'll go and get the library. Actually, they said the library
> should already be in there, it wasn't there so I downloaded the tarball and
> built it myself. I then put the resulting static library ( libz.a) in the
> macosx libs directory which has already been -L'd by the makefile, I ran the
> bash make script and it still gave me the error. So I edited the Makefile
> and added a -lz to a random part (To a part where it does -lvorbisfile as
> well), since I'm building with OGG I figured It'd pick it up, but it's still
> giving me the error.
>
> Anyways, I'm just curious because I didn't find any reference to zlib in
> the Makefile and I only found a reference in the README, but it only
> includes header files and source files of it, in other platforms like
> Windows, I don't have to go and download it and build it along with the
> game.
>
> I'm just wondering if you guys know anything about this, I've been
> investigating since yesterday I was up till 12 haha, I think I'm getting
> closer to finally being able to build though, I think it's just this that's
> left.
>
> On 3/29/07, Jorge Peña <jorgepblank at gmail.com> wrote:
> >
> > Thanks I really really appreciate it! I definitely worked hard on it
> > haha, I was at it for about two hours, all trial and error as I personally
> > have no exposure/experience at all to Macs. One question though, in the -L
> > and -I switches, you put absolute paths, is this necessary? Sorry, I didn't
> > find any information on this in the manual page, and I was wondering
> > because, seeing how it was already hard enough for me, having other people
> > build it might be difficult, so I was thinking about including these things
> > in my subversion repository, for which I'd need relevant paths, no? Or maybe
> > there's a variable such as:
> >
> > -I/Users/$(USER)/libogg-1.1.3/include
> >
> > Just double checked, looks like there is. No wait, better yet:
> >
> > -I/$(PWD)/code/whatever
> >
> > Seems right. I think this will definitely help, next time my friend is
> > available I'll SSH and keep trying, but it all makes sense now, thanks I
> > really, honestly appreciate your help!
> >
> > On 3/29/07, Thilo Schulz < arny at ats.s.bawue.de> wrote:
> > >
> > > 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 --------------
An HTML attachment was scrubbed...
URL: <http://icculus.org/pipermail/quake3/attachments/20070331/521469b9/attachment.htm>


More information about the quake3 mailing list