This is tested on Mac OS 10.6.7 (a Mac Book Pro and a Mac Mini)
Get essential build environment
Install Xcode 3 - you don't need to spend $5 on Xcode 4
xcode_3.2.6_and_ios_sdk_4.3.dmg
Install
MacPorts
MacPorts-1.9.2-10.6-SnowLeopard.dmg
Behind a firewall
If you cannot rsync, for instance if you're in a corporation where its hard to get through firewalls, then edit /opt/local/etc/macports/sources.conf replacing the default entry at the end of the file
sudo vim /opt/local/etc/macports/sources.conf
[...]
#rsync://rsync.macports.org/release/ports/ [default]
http://www.macports.org/files/ports.tar.gz [default]
Then, If your corporation has an HTTP proxy server, you might need to set the http_proxy environment variable before 'port' commands, like this:
sudo http_proxy=http://www-cache.reith.bbc.co.uk:80 \
/opt/local/bin/port -d sync
Sync the
MacPorts sources, as I have done in this example:
sudo /opt/local/bin/port -d sync
Get tools to build the source
sudo /opt/local/bin/port install \
yasm git-core exi2html
Behind a socks proxy server?
To access source files for building parts of FFmpeg, git might need access through a SOCKS proxy:
sudo /opt/local/bin/port install tsocks
copy the sample tsocks.conf
sudo cp -a /opt/local/etc/tsocks.conf.sample /opt/local/etc/tsocks.conf
and edit /opt/local/etc/tsocks.conf. For example, in a corporation you might need to add something like:
local = 132.0.0.0/255.0.0.0
to the local block near the top and change server and server_port to
server = 132.185.136.18
server_port = 1085
tordns_enable = false
Then, when you have to do a 'git clone' or a 'git pull' do this instead:
tsocks git clone git://
OR
tsocks git pull --rebase
Get pre-built libraries
sudo /opt/local/bin/port install \
libsdl Xvid libvorbis jpeg speex-devel libtheora faac dirac openjpeg libdc1394
Build other libraries
Decide and create the place where you are going to do all your building, and set an environment variable so that it is easy to script the install:
export PREFIX=/usr/local
sudo mkdir $PREFIX/src
sudo chgrp staff $PREFIX/src
sudo chmod g+w $PREFIX/src
libx264
cd $PREFIX/src
PATH=$PATH:/opt/local/bin/ \
git clone git://git.videolan.org/x264.git
cd x264
OR
cd x264
PATH=$PATH:/opt/local/bin/ \
git pull --rebase
PKG_CONFIG_PATH=/opt/local/lib/pkgconfig/ \
PATH=$PATH:/opt/local/bin/ \
./configure \
--prefix=$PREFIX \
--enable-shared
PATH=$PATH:/opt/local/bin/ \
make
sudo make install
libvpx
cd $PREFIX/src
PATH=$PATH:/opt/local/bin/ \
git clone git://review.webmproject.org/libvpx.git
cd libvpx
PKG_CONFIG_PATH=/opt/local/lib/pkgconfig/ \
PATH=$PATH:/opt/local/bin/ \
./configure \
--prefix=$PREFIX
PATH=$PATH:/opt/local/bin/ \
make
sudo make install
FFmpeg
cd $PREFIX/src
PATH=$PATH:/opt/local/bin/ \
git clone git://git.videolan.org/ffmpeg.git
cd ffmpeg
OR
cd ffmpeg
PATH=$PATH:/opt/local/bin/ \
git pull --rebase
PKG_CONFIG_PATH=/opt/local/lib/pkgconfig/ \
PATH=$PATH:/opt/local/bin/ \
./configure \
--extra-cflags="-I$PREFIX/include -I/opt/local/include" \
--extra-libs="-L$PREFIX/lib -L/opt/local/lib -mmacosx-version-min=10.5" \
--prefix=$PREFIX \
--enable-ffplay \
--enable-ffprobe \
--enable-ffserver \
--enable-shared \
--disable-indev=jack \
--enable-gpl \
--enable-nonfree \
--enable-pthreads \
--enable-libdc1394 \
--enable-libdirac \
--enable-libfaac \
--enable-libopenjpeg \
--enable-libspeex \
--enable-libtheora \
--enable-libvorbis \
--enable-libvpx \
--enable-libx264 \
--enable-libxvid
PATH=$PATH:/opt/local/bin/ \
make
sudo make install
PKG_CONFIG_PATH=/opt/local/lib/pkgconfig/ \
PATH=$PATH:/opt/local/bin/ \
./configure \
--extra-cflags='-I$PREFIX/include -I/opt/local/include' \
--extra-libs='-L$PREFIX/lib -L/opt/local/lib -mmacosx-version-min=10.5' \
--prefix=/usr/local \
--enable-ffplay \
--enable-ffprobe \
--enable-ffserver \
--enable-shared \
--disable-indev=jack \
--cc=gcc-4.0 \
--enable-gpl \
--enable-nonfree \
--enable-pthreads \
--enable-libxvid \
--enable-libvorbis \
--enable-libspeex \
--enable-libtheora \
--enable-libfaac \
--enable-libdirac \
--enable-libmp3lame \
--enable-libx264 \
--enable-libschroedinger
PKG_CONFIG_PATH=/opt/local/lib/pkgconfig/ \
PATH=$PATH:/opt/local/bin/ \
./configure \
--prefix=$HOME/darwin-ppc \
--target-os=darwin \
--arch=ppc \
--extra-cflags="-O3 -arch ppc -mcpu=powerpc -isysroot /Developer/SDKs/MacOSX10.4u.sdk -mmacosx-version-min=10.4" \
--extra-ldflags="-arch ppc -isysroot /Developer/SDKs/MacOSX10.4u.sdk -mmacosx-version-min=10.4" \
--enable-gpl \
--enable-nonfree \
--enable-runtime-cpudetect \
--enable-memalign-hack \
--enable-pthreads \
--enable-static \
--disable-shared \
--disable-indev=jack \
--disable-altivec