| 1 |
#!/bin/sh |
|---|
| 2 |
PATH=$PATH:/usr/local/bin:/usr/bin:/sw/bin:/opt/local/bin |
|---|
| 3 |
buildid_ffmpeg="r`svn info ffmpeg | grep -F Revision | awk '{print $2}'`" |
|---|
| 4 |
|
|---|
| 5 |
if [ "$BUILD_STYLE" = "Development" ] ; then |
|---|
| 6 |
extraConfigureOptions="--disable-strip --disable-opts --disable-mmx --disable-altivec" |
|---|
| 7 |
else |
|---|
| 8 |
extraConfigureOptions="--enable-small" |
|---|
| 9 |
fi |
|---|
| 10 |
|
|---|
| 11 |
OUTPUT_FILE="$BUILT_PRODUCTS_DIR/Universal/buildid" |
|---|
| 12 |
|
|---|
| 13 |
if [[ -e "$OUTPUT_FILE" ]] ; then |
|---|
| 14 |
oldbuildid_ffmpeg=`cat "$OUTPUT_FILE"` |
|---|
| 15 |
else |
|---|
| 16 |
oldbuildid_ffmpeg="buildme" |
|---|
| 17 |
fi |
|---|
| 18 |
|
|---|
| 19 |
if [[ $buildid == "r" ]] ; then |
|---|
| 20 |
echo "error: you're using svk. Please ask someone to add svk support to the build system. There's a script in Adium svn that can do this." |
|---|
| 21 |
exit 1; |
|---|
| 22 |
fi |
|---|
| 23 |
|
|---|
| 24 |
if [ "$buildid_ffmpeg" = "$oldbuildid_ffmpeg" ] ; then |
|---|
| 25 |
echo "Static ffmpeg libs are up-to-date ; not rebuilding" |
|---|
| 26 |
else |
|---|
| 27 |
echo "Static ffmpeg libs are out-of-date ; rebuilding" |
|---|
| 28 |
mkdir "$BUILT_PRODUCTS_DIR" |
|---|
| 29 |
####################### |
|---|
| 30 |
# Intel shlibs |
|---|
| 31 |
####################### |
|---|
| 32 |
BUILDDIR="$BUILT_PRODUCTS_DIR/intel" |
|---|
| 33 |
mkdir "$BUILDDIR" |
|---|
| 34 |
|
|---|
| 35 |
cd "$SRCROOT/ffmpeg" |
|---|
| 36 |
|
|---|
| 37 |
cd "$BUILDDIR" |
|---|
| 38 |
if [ `arch` != i386 ] ; then |
|---|
| 39 |
"$SRCROOT/ffmpeg/configure" --cross-compile --cpu=x86 --enable-pp --enable-gpl --extra-ldflags='-arch i386 -isysroot /Developer/SDKs/MacOSX10.4u.sdk' --extra-cflags='-arch i386 -isysroot /Developer/SDKs/MacOSX10.4u.sdk' $extraConfigureOptions |
|---|
| 40 |
else |
|---|
| 41 |
"$SRCROOT/ffmpeg/configure" --enable-pp --enable-gpl --enable-memalign-hack $extraConfigureOptions |
|---|
| 42 |
fi |
|---|
| 43 |
make -j3 |
|---|
| 44 |
|
|---|
| 45 |
cd "$SRCROOT/ffmpeg" |
|---|
| 46 |
|
|---|
| 47 |
|
|---|
| 48 |
####################### |
|---|
| 49 |
# PPC shlibs |
|---|
| 50 |
####################### |
|---|
| 51 |
BUILDDIR="$BUILT_PRODUCTS_DIR/ppc" |
|---|
| 52 |
mkdir "$BUILDDIR" |
|---|
| 53 |
|
|---|
| 54 |
cd "$SRCROOT/ffmpeg" |
|---|
| 55 |
|
|---|
| 56 |
cd "$BUILDDIR" |
|---|
| 57 |
if [ `arch` = ppc ] ; then |
|---|
| 58 |
"$SRCROOT/ffmpeg/configure" --enable-pp --enable-gpl $extraConfigureOptions |
|---|
| 59 |
else |
|---|
| 60 |
"$SRCROOT/ffmpeg/configure" --enable-pp --enable-gpl --cpu=ppc --extra-ldflags='-arch ppc -isysroot /Developer/SDKs/MacOSX10.4u.sdk' --extra-cflags='-arch ppc -isysroot /Developer/SDKs/MacOSX10.4u.sdk' $extraConfigureOptions |
|---|
| 61 |
fi |
|---|
| 62 |
make -j3 |
|---|
| 63 |
|
|---|
| 64 |
cd "$SRCROOT/ffmpeg" |
|---|
| 65 |
|
|---|
| 66 |
####################### |
|---|
| 67 |
# lipo shlibs |
|---|
| 68 |
####################### |
|---|
| 69 |
BUILDDIR="$BUILT_PRODUCTS_DIR/Universal" |
|---|
| 70 |
INTEL="$BUILT_PRODUCTS_DIR/intel" |
|---|
| 71 |
PPC="$BUILT_PRODUCTS_DIR/ppc" |
|---|
| 72 |
rm -rf "$BUILDDIR" |
|---|
| 73 |
mkdir "$BUILDDIR" |
|---|
| 74 |
for aa in "$INTEL"/*/*.a ; do |
|---|
| 75 |
echo lipo -create $aa `echo -n $aa | sed 's/intel/ppc/'` -output `echo -n $aa | sed 's/intel\/.*\//Universal\//'` |
|---|
| 76 |
lipo -create $aa `echo -n $aa | sed 's/intel/ppc/'` -output `echo -n $aa | sed 's/intel\/.*\//Universal\//'` |
|---|
| 77 |
done |
|---|
| 78 |
echo -n "$buildid_ffmpeg" > $OUTPUT_FILE |
|---|
| 79 |
fi |
|---|
| 80 |
|
|---|
| 81 |
mkdir "$SYMROOT/Universal" || true |
|---|
| 82 |
cp "$BUILT_PRODUCTS_DIR/Universal"/* "$SYMROOT/Universal" |
|---|
| 83 |
ranlib "$SYMROOT/Universal"/*.a |
|---|