Commit 3d685b6a authored by Pierre d'Herbemont's avatar Pierre d'Herbemont

contrib: Support for iOS.

parent e46f4108
...@@ -164,6 +164,9 @@ case $TARGET in ...@@ -164,6 +164,9 @@ case $TARGET in
arm*eabi) arm*eabi)
ARCH="armel" ARCH="armel"
;; ;;
arm*)
ARCH="arm"
;;
esac esac
add_makefile_cfg "ARCH = $ARCH" add_makefile_cfg "ARCH = $ARCH"
...@@ -330,6 +333,10 @@ case $TARGET in ...@@ -330,6 +333,10 @@ case $TARGET in
;; ;;
esac esac
#
# Fix up the Distro
#
if test -z "${DISTRO}" -a "$TARGET" = "$BUILD"; then if test -z "${DISTRO}" -a "$TARGET" = "$BUILD"; then
if test -d "/usr/lib/pkgconfig"; then if test -d "/usr/lib/pkgconfig"; then
if test -z "$PKG_CONFIG_PATH"; then if test -z "$PKG_CONFIG_PATH"; then
...@@ -356,6 +363,22 @@ test -z "${DISTRO}" && DISTRO=unix ...@@ -356,6 +363,22 @@ test -z "${DISTRO}" && DISTRO=unix
cat src/Distributions/"${DISTRO}".mak >> "${distro_mak}" cat src/Distributions/"${DISTRO}".mak >> "${distro_mak}"
#
# Distro specific settings
#
case "$DISTRO" in
ios)
add_makefile_cfg 'HAVE_IOS = 1'
if test -z "$IOS_SDK_ROOT"; then
error "The bootstrap script requires the IOS_SDK_ROOT environment "
error "variable to be set when building for iOS"
exit 1
fi
add_makefile_cfg "IOS_SDK_ROOT = ${IOS_SDK_ROOT}"
;;
esac
# Save passed flags # Save passed flags
EXTRA_CFLAGS+=" $CFLAGS" EXTRA_CFLAGS+=" $CFLAGS"
EXTRA_LDFLAGS+=" $LDFLAGS" EXTRA_LDFLAGS+=" $LDFLAGS"
......
# iOS rules
all: .ffmpeg .live .dvbpsi .faad
...@@ -101,7 +101,11 @@ ifneq ($(BUILD),$(HOST)) ...@@ -101,7 +101,11 @@ ifneq ($(BUILD),$(HOST))
# #
ifndef HAVE_CYGWIN ifndef HAVE_CYGWIN
# We are REALLY cross compiling # We are REALLY cross compiling
ifdef HAVE_IOS
FFMPEGCONF+=--enable-cross-compile
else
FFMPEGCONF+=--cross-prefix=$(HOST)- --enable-cross-compile FFMPEGCONF+=--cross-prefix=$(HOST)- --enable-cross-compile
endif
X264CONF=--host=$(HOST) X264CONF=--host=$(HOST)
PTHREADSCONF=CROSS="$(HOST)-" PTHREADSCONF=CROSS="$(HOST)-"
else else
...@@ -137,9 +141,11 @@ FFMPEGCONF+= --enable-small --disable-mpegaudio-hp ...@@ -137,9 +141,11 @@ FFMPEGCONF+= --enable-small --disable-mpegaudio-hp
FFMPEG_CFLAGS += -DHAVE_LRINTF --std=c99 FFMPEG_CFLAGS += -DHAVE_LRINTF --std=c99
else else
ifndef HAVE_WINCE ifndef HAVE_WINCE
ifndef HAVE_IOS
FFMPEGCONF+= --enable-libmp3lame --enable-libgsm FFMPEGCONF+= --enable-libmp3lame --enable-libgsm
endif endif
endif endif
endif
ifdef HAVE_DARWIN_OS_ON_INTEL ifdef HAVE_DARWIN_OS_ON_INTEL
FFMPEGCONF += --enable-memalign-hack FFMPEGCONF += --enable-memalign-hack
...@@ -1086,11 +1092,21 @@ FFMPEGCONF += --disable-bzlib --disable-decoder=dca --disable-encoder=vorbis --e ...@@ -1086,11 +1092,21 @@ FFMPEGCONF += --disable-bzlib --disable-decoder=dca --disable-encoder=vorbis --e
else else
ifdef HAVE_WIN32 ifdef HAVE_WIN32
FFMPEGCONF += --disable-bzlib --disable-decoder=dca --disable-encoder=vorbis --enable-libmp3lame --enable-w32threads --enable-dxva2 --disable-bsfs --enable-libvpx FFMPEGCONF += --disable-bzlib --disable-decoder=dca --disable-encoder=vorbis --enable-libmp3lame --enable-w32threads --enable-dxva2 --disable-bsfs --enable-libvpx
else
ifdef HAVE_IOS
FFMPEGCONF += --target-os=darwin --sysroot=${IOS_SDK_ROOT}
ifeq ($(ARCH),arm)
FFMPEGCONF += --disable-runtime-cpudetect --enable-neon --cpu=cortex-a8
else
FFMPEGCONF += --disable-mmx
endif
else else
FFMPEGCONF += --enable-pthreads FFMPEGCONF += --enable-pthreads
endif endif
FFMPEG_CFLAGS += --std=gnu99 FFMPEG_CFLAGS += --std=gnu99
endif endif
endif
ifdef HAVE_WINCE ifdef HAVE_WINCE
.ffmpeg: ffmpeg .zlib .ffmpeg: ffmpeg .zlib
...@@ -1098,6 +1114,9 @@ else ...@@ -1098,6 +1114,9 @@ else
ifdef HAVE_UCLIBC ifdef HAVE_UCLIBC
.ffmpeg: ffmpeg .ffmpeg: ffmpeg
else else
ifdef HAVE_IOS
.ffmpeg: ffmpeg
else
ifeq ($(ARCH),armel) ifeq ($(ARCH),armel)
.ffmpeg: ffmpeg .lame .gsm .zlib .ffmpeg: ffmpeg .lame .gsm .zlib
else else
...@@ -1108,6 +1127,7 @@ else ...@@ -1108,6 +1127,7 @@ else
endif endif
endif endif
endif endif
endif
endif endif
(cd $<; $(HOSTCC) ./configure --prefix=$(PREFIX) --extra-cflags="$(FFMPEG_CFLAGS) -DHAVE_STDINT_H" --extra-ldflags="$(LDFLAGS)" $(FFMPEGCONF) --disable-shared --enable-static && make && make install-libs install-headers) (cd $<; $(HOSTCC) ./configure --prefix=$(PREFIX) --extra-cflags="$(FFMPEG_CFLAGS) -DHAVE_STDINT_H" --extra-ldflags="$(LDFLAGS)" $(FFMPEGCONF) --disable-shared --enable-static && make && make install-libs install-headers)
touch $@ touch $@
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment