Skip to content

Commit

Permalink
modified to support Xcode5 and 64-bit architectures
Browse files Browse the repository at this point in the history
  • Loading branch information
kewlbear committed Sep 23, 2013
1 parent bba0bff commit b8e2a29
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 10 deletions.
14 changes: 9 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,22 @@ This is a shell script to build FFmpeg libraries for iOS apps.
Tested with:

* FFmpeg git commit f18ccb529fb7231f9d40814fbf843d10d9434b43
* Xcode 4.6.3
* Xcode 5

Usage
-----

* To build armv7s libraries:
* To build everything:

./build-ffmpeg.sh armv7s
./build-ffmpeg.sh

* To build fat libraries for armv7 and i386 (simulator):
* To build arm64 libraries:

./build-ffmpeg.sh armv7 i386
./build-ffmpeg.sh arm64

* To build fat libraries for armv7 and x86_64 (64-bit simulator):

./build-ffmpeg.sh armv7 x86_64

* To build fat libraries from separately built thin libraries:

Expand Down
20 changes: 15 additions & 5 deletions build-ffmpeg.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ CONFIGURE_FLAGS="--enable-cross-compile --disable-debug --disable-ffmpeg \
LIBS="libavcodec libavformat libavutil libswscale libavdevice libavfilter \
libswresample"

ARCHS="armv7 armv7s i386"
ARCHS="armv7 armv7s i386 arm64 x86_64"

# directories
SOURCE="ffmpeg"
Expand Down Expand Up @@ -46,22 +46,32 @@ then
mkdir -p "$SCRATCH/$ARCH"
cd "$SCRATCH/$ARCH"

if [ "$ARCH" = "i386" ]
if [ "$ARCH" = "i386" -o "$ARCH" = "x86_64" ]
then
PLATFORM="iPhoneSimulator"
CPU=
if [ "$ARCH" = "x86_64" ]
then
SIMULATOR="-mios-simulator-version-min=7.0"
else
SIMULATOR="-mios-simulator-version-min=5.0"
fi
else
PLATFORM="iPhoneOS"
if [ $ARCH = "armv7s" ]
then
CPU="--cpu=swift"
else
CPU=
fi
SIMULATOR=
fi

XCRUN_SDK=`echo $PLATFORM | tr '[:upper:]' '[:lower:]'`
CC="xcrun -sdk $XCRUN_SDK clang"
CFLAGS="-arch $ARCH"
CXXFLAGS="-arch $ARCH"
LDFLAGS="-arch $ARCH"
CFLAGS="-arch $ARCH $SIMULATOR"
CXXFLAGS="$CFLAGS"
LDFLAGS="$CFLAGS"

$CWD/$SOURCE/configure \
--target-os=darwin \
Expand Down

0 comments on commit b8e2a29

Please sign in to comment.