Compiling libogg & libvorbis

Member
Posts: 29
Joined: 2008.10
Post: #1
I'm trying to compile libogg and libvorbis on my macbook. I managed to make libogg and now i have a file called libogg.la(it's size is onl 4 kb) and also a framework build with the xcode project that came with libogg. What is the file libogg.la? Why isn't it called libogg.a?
The next step is to compile livborbis. I included ogg.framework and also libogg.la but i receive link error regarding functions in the ogg library. What is the correct way to build libogg, because if i do this i think building libvorbis will be easy.
Quote this message in a reply
Luminary
Posts: 5,143
Joined: 2002.04
Post: #2
.la is a text file describing how to link to the library, not the library itself.

http://onesadcookie.com/svn/Third-Party knows how to build 4-way fat ogg & vorbis.
Quote this message in a reply
Moderator
Posts: 1,562
Joined: 2003.10
Post: #3
A lot of autoconf projects compile their .a files to a directory named ".libs", so you won't find it unless you know how to look. You'll also want to make sure you're building for the appropriate architectures. Keith's Third-Party projects know how to do it, but it's useful to know the general mechanism in case you need to compile other libraries. Here's the best way I've found so far:

Code:
CC="gcc -isysroot /Developer/SDKs/MacOSX10.4u.sdk -arch ppc -mmacosx-version-min=10.4" ./configure
make
cp .libs/libfoo.a libfoo.ppc.a
make clean
CC="gcc -isysroot /Developer/SDKs/MacOSX10.4u.sdk -arch i386 -mmacosx-version-min=10.4" ./configure
make
cp .libs/libfoo.a libfoo.i386.a
make clean
CC="gcc -isysroot /Developer/SDKs/MacOSX10.5.sdk -arch x86_64 -mmacosx-version-min=10.5" ./configure
make
cp .libs/libfoo.a libfoo.x86_64.a
lipo -create -output libfoo.a libfoo.ppc.a libfoo.i386.a libfoo.x86_64.a

That creates a universal libfoo.a in the top-level directory of the project. Adjust as necessary for more/fewer architectures and different Mac OS X minimum versions.
Quote this message in a reply
Member
Posts: 29
Joined: 2008.10
Post: #4
Thanks a bunch guys! I have the mac for only a week or so, and i'm still learning!
I have one more problem: where do i have to put the various headers from third party libraries in a way that lets me write something like: #include <GL/glfw.h>, for example?
Quote this message in a reply
Luminary
Posts: 5,143
Joined: 2002.04
Post: #5
In a folder called "GL"?
Quote this message in a reply
Member
Posts: 29
Joined: 2008.10
Post: #6
Haha! Well yeah, but i'm a little confused because coming from windows and using Microsoft Visual Studio i was used to put the library files .lib(those not created by me) in VC/Lib and headers in VC/Include. Now i searched the mac and saw that there are a lot of Headers and Lib folders and i don't know why there isn't just a single place for libraries and headers. I have put glfw.h in the OpenGL framework though and it works fine.
Quote this message in a reply
Luminary
Posts: 5,143
Joined: 2002.04
Post: #7
You really shouldn't modify /System at all, ever.
Quote this message in a reply
Post Reply