| 1 |
#!/bin/sh -v |
|---|
| 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 |
generalConfigureOptions="--disable-encoders --disable-muxers --disable-strip --enable-pthreads --disable-ffmpeg --disable-network --disable-ffplay --disable-vhook" |
|---|
| 6 |
|
|---|
| 7 |
if [ "$BUILD_STYLE" = "Development" ] ; then |
|---|
| 8 |
generalConfigureOptions="$generalConfigureOptions --disable-opts" |
|---|
| 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 |
QUICKBUILD="$BUILT_PRODUCTS_DIR/Universal/quickbuild" |
|---|
| 20 |
if [[ -e "$QUICKBUILD" ]] ; then |
|---|
| 21 |
oldbuildid_ffmpeg="quick" |
|---|
| 22 |
rm "$QUICKBUILD" |
|---|
| 23 |
fi |
|---|
| 24 |
|
|---|
| 25 |
if [[ $buildid == "r" ]] ; then |
|---|
| 26 |
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." |
|---|
| 27 |
exit 1; |
|---|
| 28 |
fi |
|---|
| 29 |
|
|---|
| 30 |
if [ "$buildid_ffmpeg" = "$oldbuildid_ffmpeg" ] ; then |
|---|
| 31 |
echo "Static ffmpeg libs are up-to-date ; not rebuilding" |
|---|
| 32 |
else |
|---|
| 33 |
echo "Static ffmpeg libs are out-of-date ; rebuilding" |
|---|
| 34 |
|
|---|
| 35 |
mkdir "$BUILT_PRODUCTS_DIR" |
|---|
| 36 |
####################### |
|---|
| 37 |
# Intel shlibs |
|---|
| 38 |
####################### |
|---|
| 39 |
BUILDDIR="$BUILT_PRODUCTS_DIR/intel" |
|---|
| 40 |
mkdir "$BUILDDIR" |
|---|
| 41 |
|
|---|
| 42 |
export optCFlags="-mtune=nocona -fstrict-aliasing -frerun-cse-after-loop -fweb -gstabs+ -mdynamic-no-pic -Dattribute_deprecated=" |
|---|
| 43 |
|
|---|
| 44 |
cd "$BUILDDIR" |
|---|
| 45 |
if [ "$oldbuildid_ffmpeg" != "quick" ] ; then |
|---|
| 46 |
if [ `arch` != i386 ] ; then |
|---|
| 47 |
"$SRCROOT/ffmpeg/configure" --cross-compile --arch=i386 --extra-ldflags='-arch i386 -isysroot /Developer/SDKs/MacOSX10.4u.sdk' --extra-cflags='-arch i386 -isysroot /Developer/SDKs/MacOSX10.4u.sdk $optCFlags' $extraConfigureOptions $generalConfigureOptions --cpu=pentium-m |
|---|
| 48 |
else |
|---|
| 49 |
"$SRCROOT/ffmpeg/configure" $extraConfigureOptions $generalConfigureOptions --cpu=pentium-m --extra-cflags='$optCFlags' |
|---|
| 50 |
fi |
|---|
| 51 |
|
|---|
| 52 |
make depend > /dev/null 2>&1 || true |
|---|
| 53 |
fi |
|---|
| 54 |
if [ "$BUILD_STYLE" = "Development" ] ; then |
|---|
| 55 |
cd libavcodec |
|---|
| 56 |
export CFLAGS="-O1 -fomit-frame-pointer -funit-at-a-time"; make h264.o cabac.o |
|---|
| 57 |
unset CFLAGS; |
|---|
| 58 |
cd .. |
|---|
| 59 |
fi |
|---|
| 60 |
make -j3 lib |
|---|
| 61 |
|
|---|
| 62 |
|
|---|
| 63 |
####################### |
|---|
| 64 |
# PPC shlibs |
|---|
| 65 |
####################### |
|---|
| 66 |
BUILDDIR="$BUILT_PRODUCTS_DIR/ppc" |
|---|
| 67 |
mkdir "$BUILDDIR" |
|---|
| 68 |
|
|---|
| 69 |
export optCFlags="-mcpu=G3 -mtune=G5 -fstrict-aliasing -funroll-loops -mmultiple -gstabs+ -mdynamic-no-pic -Dattribute_deprecated=" |
|---|
| 70 |
|
|---|
| 71 |
cd "$BUILDDIR" |
|---|
| 72 |
if [ "$oldbuildid_ffmpeg" != "quick" ] ; then |
|---|
| 73 |
if [ `arch` = ppc ] ; then |
|---|
| 74 |
"$SRCROOT/ffmpeg/configure" $extraConfigureOptions $generalConfigureOptions --extra-cflags='$optCFlags' |
|---|
| 75 |
else |
|---|
| 76 |
"$SRCROOT/ffmpeg/configure" --cross-compile --arch=ppc --extra-ldflags='-arch ppc -isysroot /Developer/SDKs/MacOSX10.4u.sdk' --extra-cflags='-arch ppc -isysroot /Developer/SDKs/MacOSX10.4u.sdk $optCFlags' $extraConfigureOptions $generalConfigureOptions |
|---|
| 77 |
fi |
|---|
| 78 |
|
|---|
| 79 |
make depend > /dev/null 2>&1 || true |
|---|
| 80 |
fi |
|---|
| 81 |
make -j3 lib |
|---|
| 82 |
|
|---|
| 83 |
####################### |
|---|
| 84 |
# lipo shlibs |
|---|
| 85 |
####################### |
|---|
| 86 |
BUILDDIR="$BUILT_PRODUCTS_DIR/Universal" |
|---|
| 87 |
INTEL="$BUILT_PRODUCTS_DIR/intel" |
|---|
| 88 |
PPC="$BUILT_PRODUCTS_DIR/ppc" |
|---|
| 89 |
rm -rf "$BUILDDIR" |
|---|
| 90 |
mkdir "$BUILDDIR" |
|---|
| 91 |
for aa in "$INTEL"/*/*.a ; do |
|---|
| 92 |
echo lipo -create $aa `echo -n $aa | sed 's/intel/ppc/'` -output `echo -n $aa | sed 's/intel\/.*\//Universal\//'` |
|---|
| 93 |
lipo -create $aa `echo -n $aa | sed 's/intel/ppc/'` -output `echo -n $aa | sed 's/intel\/.*\//Universal\//'` |
|---|
| 94 |
done |
|---|
| 95 |
echo -n "$buildid_ffmpeg" > $OUTPUT_FILE |
|---|
| 96 |
fi |
|---|
| 97 |
|
|---|
| 98 |
mkdir "$SYMROOT/Universal" || true |
|---|
| 99 |
cp "$BUILT_PRODUCTS_DIR/Universal"/* "$SYMROOT/Universal" |
|---|
| 100 |
if [ "$BUILD_STYLE" = "Deployment" ] ; then |
|---|
| 101 |
strip -S "$SYMROOT/Universal"/*.a |
|---|
| 102 |
fi |
|---|
| 103 |
ranlib "$SYMROOT/Universal"/*.a |
|---|