osx-x264.sh 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. echo ""
  2. echo "----------------------------------------------------"
  3. echo "-- Building x264 for MAC OS X"
  4. echo "-- Example: $0 i386"
  5. echo "-- Valid parameters: i386 x86_64 ppc"
  6. echo "-- Location: copy this file in x264 root directory"
  7. echo "-- Git URL: git://git.videolan.org/x264.git"
  8. echo "-- Git date: Wed Aug 10 00:16:46 2011 -070"
  9. echo "--"
  10. echo ""
  11. if [ "$1" == "i386" ]; then
  12. export ARCH="i386"
  13. export CFLAGS=$CFLAGS" -arch $ARCH"
  14. export LDFLAGS=$LDFLAGS" -arch $ARCH"
  15. export HOST="$ARCH-apple-darwin"
  16. elif [ "$1" == "x86_64" ]; then
  17. export ARCH="x86_64"
  18. export CFLAGS=$CFLAGS" -arch $ARCH"
  19. export LDFLAGS=$LDFLAGS" -arch $ARCH"
  20. export HOST="$ARCH-apple-darwin"
  21. elif [ "$1" == "ppc" ]; then
  22. export ARCH="ppc"
  23. export CFLAGS=$CFLAGS" -arch $ARCH"
  24. export LDFLAGS=$LDFLAGS" -arch $ARCH"
  25. export HOST="$ARCH-apple-darwin"
  26. else
  27. echo "\n=ERROR: '$1' is not a valid architecture\n"
  28. exit 1
  29. fi
  30. export HOME="$( cd "$( dirname "$0" )" && pwd )"
  31. export PREFIX=$HOME"/"$ARCH
  32. echo "PREFIX="$PREFIX
  33. echo "Start building...\n\n"
  34. $HOME/configure --prefix=$PREFIX --host=$HOST --enable-static --extra-cflags="$CFLAGS" --extra-ldflags="$LDFLAGS" --disable-cli
  35. make clean && make && make install
  36. #mv ./x264.h $PREFIX/include/x264.h
  37. #mv ./libx264.a $PREFIX/lib/libx264.a