#!/bin/sh

trap exit ERR

DIR=x264-armv7

git clone git://git.videolan.org/x264.git $DIR

cd $DIR
mkdir -p dist

CC=/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc-4.2 ./configure --host=arm-apple-darwin --sysroot=/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS3.0.sdk --prefix='dist' --extra-cflags='-arch armv7' --extra-ldflags='-arch armv7' --enable-pic

make && make install

echo "Installed: $DIR/dist"
