Register FAQ / Rules Forum Spy Search Today's Posts Mark Forums Read
Go Back   MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Reply
 
Thread Tools Search this Thread Display Modes
Old Apr 20, 2009, 11:30 PM   #1
GRMrGecko
macrumors member
 
Join Date: Jun 2008
Location: Nowhere and everywhere
Send a message via AIM to GRMrGecko Send a message via MSN to GRMrGecko Send a message via Yahoo to GRMrGecko Send a message via Skype™ to GRMrGecko
Compile Lame Universal

Hello, I'm trying to compile Lame MP3 Library for ppc and intel so I can include it in a ppc/intel ffmpeg compile and I'll like it to work on 10.4 as well. I know I can possibly use lipo to join the ppc and intel compiled versions into a universal file. But I'm unsure if it'll work.

Thanks for tips and recommendations,
Mr. Gecko
GRMrGecko is offline   0 Reply With Quote
Old Apr 21, 2009, 05:47 AM   #2
wrldwzrd89
macrumors G4
 
wrldwzrd89's Avatar
 
Join Date: Jun 2003
Location: Solon, OH
Why bother with LIPO? Add the other architecture to your build flags (i.e. specify both -arch i386 AND -arch ppc) and see if that works first. If it doesn't, the LIPO approach WILL work.
__________________
iMac Intel (Rev H, 27"), 1TB HDD, 16GB RAM, 10.8.4
wrldwzrd89 is offline   0 Reply With Quote
Old Apr 21, 2009, 07:14 AM   #3
GRMrGecko
Thread Starter
macrumors member
 
Join Date: Jun 2008
Location: Nowhere and everywhere
Send a message via AIM to GRMrGecko Send a message via MSN to GRMrGecko Send a message via Yahoo to GRMrGecko Send a message via Skype™ to GRMrGecko
Quote:
Originally Posted by wrldwzrd89 View Post
Why bother with LIPO? Add the other architecture to your build flags (i.e. specify both -arch i386 AND -arch ppc) and see if that works first. If it doesn't, the LIPO approach WILL work.
I tried that at first. And when I compile for -arch ppc only, it has an error during the compile.

edit
I compile with export CFLAGS="-arch ppc"; ./configure --prefix=/ffmpeg/lame --build=ppc --disable-nasm
and the error I get is
/bin/sh ../libtool --tag=CC --mode=link gcc -Wall -arch ppc -fno-common -static -o lame main.o console.o get_audio.o lametime.o parse.o portableio.o timestatus.o brhist.o ../libmp3lame/libmp3lame.la -lncurses -lm
mkdir .libs
gcc -Wall -arch ppc -fno-common -o lame main.o console.o get_audio.o lametime.o parse.o portableio.o timestatus.o brhist.o ../libmp3lame/.libs/libmp3lame.a -lncurses -lm
Undefined symbols:
"_init_xrpow_core_sse", referenced from:
_init_xrpow_core_sse$non_lazy_ptr in libmp3lame.a(quantize.o)
ld: symbol(s) not found
collect2: ld returned 1 exit status
make[2]: *** [lame] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2

Last edited by GRMrGecko; Apr 21, 2009 at 08:15 AM.
GRMrGecko is offline   0 Reply With Quote
Old Apr 21, 2009, 06:45 PM   #4
GRMrGecko
Thread Starter
macrumors member
 
Join Date: Jun 2008
Location: Nowhere and everywhere
Send a message via AIM to GRMrGecko Send a message via MSN to GRMrGecko Send a message via Yahoo to GRMrGecko Send a message via Skype™ to GRMrGecko
Ok I was able to get this to compile finally.

Code:
echo "Uncompressing Lame"
tar -xzf lame-398-2.tar.gz
mv lame-398-2 lame-398-2-i386
cp -R lame-398-2-i386 lame-398-2-ppc
echo "Configuring Lame"
cd lame-398-2-i386
HOST_CC=gcc CC="gcc-4.0 -arch i386" CXX="g++-4.0 -arch i386" ./configure --prefix=/ffmpeg/lame-i386 --host=i386-apple-darwin8.11.1
cd ../lame-398-2-ppc
HOST_CC=gcc CC="gcc-4.0 -arch ppc" CXX="g++-4.0 -arch ppc" ./configure --prefix=/ffmpeg/lame-ppc --host=ppc-apple-darwin8.11.1
echo "Compiling Lame"
cd ../lame-398-2-i386
make
cd ../lame-398-2-ppc
make
echo "Installing Lame"
cd ../lame-398-2-i386
make install
cd ../lame-398-2-ppc
make install
echo "Making Lame Universal"
cd ../
cp -R lame-i386 lame
lipo -create ./lame-i386/bin/lame ./lame-ppc/bin/lame -output ./lame/bin/lame
lipo -create ./lame-i386/lib/libmp3lame.0.0.0.dylib ./lame-ppc/lib/libmp3lame.0.0.0.dylib -output ./lame/lib/libmp3lame.0.0.0.dylib
lipo -create ./lame-i386/lib/libmp3lame.a ./lame-ppc/lib/libmp3lame.a -output ./lame/lib/libmp3lame.a
GRMrGecko is offline   0 Reply With Quote

Reply
MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Similar Threads
thread Thread Starter Forum Replies Last Post
The Footers Are Lame!! rneglia Site and Forum Feedback 12 Sep 14, 2012 03:07 PM
A lame Mountain Lion regression AfternoonDelete OS X 10.8 Mountain Lion 5 Aug 1, 2012 03:41 AM
Macbook Retina battery lame wamsankas MacBook Pro 15 Jul 22, 2012 04:52 AM
UPS support in OS X is sort of lame - ? smithrh OS X 13 Jul 19, 2012 04:18 PM

Forum Jump

All times are GMT -5. The time now is 05:24 AM.

Mac Rumors | Mac | iPhone | iPhone Game Reviews | iPhone Apps

Mobile Version | Fixed | Fluid | Fluid HD
Copyright 2002-2013, MacRumors.com, LLC