PDA

View Full Version : The Instagib Project Universal Binaries


blank
2007.04.10, 12:38 AM
Hey guys I don't have a Mac and worse I've never used one in my life. The only access I have to one is my friend's PPC through SSH, the only way I know my ways around is through the experience of Linux. With that out of the way...

I'm working on a game called (For now at least) The Instagib Project (http://instagib.jorgepena.be/). It uses id's Quake 3 Engine, further patched, enhanced, and modified by IOQuake3 (http://ioquake3.org). My game should theoretically build on many platforms and I've built it on PC Windows, Linux, and PPC Mac (My friend's). However, recently a friend told me his friend would like to try it out, but after telling him to run uname -a I discovered that he's on Intel/i386.

In the beginning, my game built Universal Binaries for Intel and PPC on Mac. However, I recently added more features and now my game has more dependencies. I then began to get compilation errors (Actually, linking errors about mismatching architecture types) and so I gave up and removed the Intel building part of the build process. After I heard about this guy on Intel that wanted to play, I re-added them and I continued to get the errors. After some reading:

http://developer.apple.com/documentation/MacOSX/Conceptual/universal_binary/universal_binary.pdf
http://developer.apple.com/technotes/tn2005/tn2137.html
http://www.hmug.org/man/1/lipo.php
http://www.idevapps.com/forum/showthread.php?t=5792

I figured that I probably needed Universal Binaries of my dependencies, since I only had PPC versions. However I didn't have access to a Mac Intel so someone was kind enough to compile some libraries for me. I then used lipo to 'merge' them, but it still wouldn't work because of dylib errors.

It's actually a really long and painful story that I'm trying to forget, and there's no reason in boring you, but basically I want to create Universal Binaries of my game. I already have a script that does this and I know it works, the only reason it isn't working is because of dependencies, so I was wondering if you guys were kind enough to build these for me as Universal Binaries, or if you knew where I could find them. To build them as Universal Binaries, you need this:


env CFLAGS="-O -g -isysroot /Developer/SDKs/MacOSX10.4u.sdk -arch i386 -arch ppc" LDFLAGS="-arch i386 -arch ppc" ./configure --disable-dependency-tracking --enable-static=yes --enable-shared=no


Instead of just simply issuing the configure script. If you can't build Universal Binaries for whatever reason, I would still appreciate Intel binaries with this configure script switch:


./configure --enable-static=yes --enable-shared=no


The libraries I'm in desperate need of are:

libfreetype - http://downloads.sourceforge.net/freetype/freetype-2.3.3.tar.gz?modtime=1175748597&big_mirror=0
libcurl - http://curl.haxx.se/download/curl-7.16.1.tar.gz
libogg - http://downloads.xiph.org/releases/ogg/libogg-1.1.3.tar.gz
libvorbis - http://downloads.xiph.org/releases/vorbis/libvorbis-1.1.2.tar.gz
zlib - http://www.zlib.net/zlib-1.2.3.tar.gz

It is crucial that you add the --enable-static=yes --enable-shared=no flags to ./configure because I don't want to depend on any dylibs, if it builds the dylibs anyways then I'd like to have them as well.

I'll want the Static Libraries (.a) only, they should end up in /usr/local/lib, for example /usr/local/lib/libcurl.a. If you see the dylib then I'll want it too just in case. Feel free to use your own --prefix= if you like. Thanks guys, I would extremely appreciate this. I'm the only one working on my game unfortunately and I really want my friends on Mac to be able to play.

OneSadCookie
2007.04.10, 01:08 AM
zlib is already on the system, as universal, so you don't need a new one.

passing -arch ppc -arch i386 to configure is dangerous, since it'll often detect endianness, type sizes, etc. Generally you should build twice and lipo the results, once for PowerPC and once for Intel, to work around potential issues like that.

Static libraries don't have a hard-coded install location, so the prefix is irrelevant.

blank
2007.04.10, 03:35 AM
Thanks! But I don't see how that helped. The prefix was obviously personal preference, if you guys didn't want it actually installing or whatever. I mentioned zlib only because I was getting undefined symbol errors and by linking it everything quited down, but I guess it shouldn't be a problem then. Even if I did lipo the results, which I did for most of the libraries, I don't have the i386/Intel parts so it'd be impossible. And I only used -arch ppc -arch i386 because that's what the apple developer site said, I know no better, but thanks I guess.

I'd still very much appreciate said libraries, and I appreciate your input.

OneSadCookie
2007.04.10, 04:47 AM
http://onesadcookie.com/~keith/Libraries.tar.bz2 has freetype, ogg, vorbis and a couple of others (but not curl) prebuilt as both ppc and i386. It's about 3.5MB

blank
2007.04.10, 03:35 PM
OneSadCookie, I can't thank you enough, I'll try again with these libraries.

blank
2007.04.10, 05:58 PM
It actually worked one time. I lipo'd the libraries together and placed them in the source tree and included its path using -L switch and it actually worked. However I went back and I get this error now:


/usr/bin/ld: can't open: (No such file or directory, errno = 2)
collect2: ld returned 1 exit status
make[1]: *** [build/release-darwin-i386/tip.i386] Error 1
make: *** [build_release] Error 2


Weird because it doesn't even say what library it can't open heh, I'm still trying to figure this out :) But it sucks because it actually worked once, I don't know what could have happened.

OneSadCookie
2007.04.10, 10:14 PM
you've got a -l argument with no library name in your build now somehow?

I forgot to say libcurl is included universal with 10.4 so you shouldn't need that either.

crespowu
2008.01.09, 04:01 AM
http://onesadcookie.com/~keith/Libraries.tar.bz2 has freetype, ogg, vorbis and a couple of others (but not curl) prebuilt as both ppc and i386. It's about 3.5MB
Great!I like free resources.