aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordavilla <davilla@4pi.com>2012-05-14 03:53:10 -0400
committerdavilla <davilla@4pi.com>2012-05-15 01:06:06 -0400
commit2687fac6f995241e0dfb0baa4342b638b7bcae25 (patch)
tree9b088b97b1df9278e4ae0029b2749f1d534b6b51
parent6014bd67e74d3944a970c605ac4ed6151a528e3a (diff)
[osx/ios] fixed ios ffmpeg configure, patch out ffmpeg configure insisting on using 'gas-preprocessor.pl ' as that fails with clang, refactor the configure of ffmpeg to allow passing -as= when expands to multiple items
-rwxr-xr-xconfigure.in103
-rwxr-xr-xlib/ffmpeg/configure2
-rw-r--r--lib/ffmpeg/patches/0029-stop-forcing-gas-preprocessor-for-darwin.patch14
3 files changed, 77 insertions, 42 deletions
diff --git a/configure.in b/configure.in
index a92119d680..83cffe9bfb 100755
--- a/configure.in
+++ b/configure.in
@@ -2104,48 +2104,69 @@ fi
XB_CONFIG_MODULE([lib/ffmpeg], [
if test "$host_vendor" = "apple" ; then
- ./configure \
- --extra-cflags="$CFLAGS $FFMPEG_EXTRACFLAGS -w -D_DARWIN_C_SOURCE -Dattribute_deprecated=" \
- `if test "$use_arch" != "no"; then echo --enable-cross-compile; fi` \
- `if test "$use_arch" != "no"; then echo --arch=$use_arch; fi`\
- `if test "$use_cpu" != "no"; then echo --cpu=$use_cpu; fi`\
- `if test "$use_arch" = "arm"; then echo --enable-pic; fi`\
- `if test "$use_neon" = "yes"; then echo --enable-neon; else echo --disable-neon; fi`\
- --target-os=$(tolower $(uname -s)) \
- --disable-amd3dnow \
- --disable-armv5te \
- --disable-armv6t2 \
- --enable-static \
- `if test "$use_debug" = "no"; then echo --disable-debug; fi` \
- --disable-muxers \
- --enable-muxer=spdif \
- --enable-muxer=adts \
- --disable-encoders \
- --enable-encoder=ac3 \
- --enable-encoder=aac \
- `if test "$use_ffmpeg_libvorbis" = "yes"; then echo --enable-libvorbis --enable-muxer=ogg --enable-encoder=libvorbis; else echo --disable-libvorbis; fi` \
- --disable-devices \
- --disable-ffprobe \
- --disable-ffplay \
- --disable-ffserver \
- --disable-ffmpeg \
- --disable-doc \
- --disable-decoder=mpeg_xvmc \
- --disable-crystalhd \
- --disable-vda \
- --enable-postproc \
- --enable-gpl \
- --enable-protocol=http \
- --enable-pthreads \
- --enable-runtime-cpudetect \
- `case $CC in *llvm-gcc-4.2*) echo --cc=clang ;; *) echo --cc="$CC" ;; esac` &&
- sed -ie "s#YASM=yasm#YASM=${prefix}/bin/yasm#" config.mak &&
- sed -ie "s#YASMDEP=yasm#YASMDEP=${prefix}/bin/yasm#" config.mak &&
- sed -ie "s# -D_ISOC99_SOURCE -D_POSIX_C_SOURCE=200112 # #" config.mak
- if test "$use_arch" = "ppc"; then
- sed -ie "s/HAVE_GNU_AS 1/HAVE_GNU_AS 0/" config.h
- sed -ie "s/^HAVE_GNU_AS=yes/!HAVE_GNU_AS=yes/" config.mak
+ ffmpg_config="--target-os=$(tolower $(uname -s))"
+ # handle disables first, we do individual enables later
+ ffmpg_config="$ffmpg_config --disable-muxers --disable-encoders"
+ ffmpg_config="$ffmpg_config --disable-devices --disable-doc"
+ ffmpg_config="$ffmpg_config --disable-ffplay --disable-ffmpeg"
+ ffmpg_config="$ffmpg_config --disable-ffprobe --disable-ffserver"
+ ffmpg_config="$ffmpg_config --disable-vda --disable-crystalhd"
+ ffmpg_config="$ffmpg_config --disable-decoder=mpeg_xvmc"
+
+ # handle conditional enables/disables
+ if test "$use_debug" = "no"; then
+ ffmpg_config="$ffmpg_config --disable-debug"
+ fi
+ if test "$use_cpu" != "no"; then
+ ffmpg_config="$ffmpg_config --cpu=$use_cpu"
fi
+ if test "$use_arch" != "no"; then
+ ffmpg_config="$ffmpg_config --arch=$use_arch --enable-cross-compile"
+ fi
+ if test "$use_arch" = "arm"; then
+ ffmpg_config="$ffmpg_config --enable-pic"
+ ffmpg_config="$ffmpg_config --disable-armv5te --disable-armv6t2"
+ if test "$use_neon" = "yes"; then
+ ffmpg_config="$ffmpg_config --enable-neon"
+ else
+ ffmpg_config="$ffmpg_config --disable-neon"
+ fi
+ else
+ ffmpg_config="$ffmpg_config --disable-amd3dnow"
+ fi
+ if test "$use_ffmpeg_libvorbis" = "yes"; then
+ ffmpg_config="$ffmpg_config --enable-libvorbis --enable-muxer=ogg --enable-encoder=libvorbis"
+ else
+ ffmpg_config="$ffmpg_config --disable-libvorbis"
+ fi
+
+ # handle individual enables
+ ffmpg_config="$ffmpg_config --enable-gpl"
+ ffmpg_config="$ffmpg_config --enable-postproc"
+ ffmpg_config="$ffmpg_config --enable-static --enable-pthreads"
+ ffmpg_config="$ffmpg_config --enable-muxer=spdif --enable-muxer=adts"
+ ffmpg_config="$ffmpg_config --enable-encoder=ac3 --enable-encoder=aac"
+ ffmpg_config="$ffmpg_config --enable-protocol=http"
+ ffmpg_config="$ffmpg_config --enable-runtime-cpudetect"
+
+ # ffmpeg will not compile with llvm-gcc-4.2, use clang instead
+ case $CC in
+ *llvm-gcc-4.2*)
+ ffmpg_config="$ffmpg_config --cc=clang" ;;
+ *)
+ ffmpg_config="$ffmpg_config --cc=$CC" ;;
+ esac
+
+ # extra-cflags must be passed alone or it gets expanded wrong by the ffmpeg configure
+ FFMPEG_EXTRACFLAGS="$CFLAGS $FFMPEG_EXTRACFLAGS -w -D_DARWIN_C_SOURCE -Dattribute_deprecated="
+
+ ./configure --extra-cflags="$FFMPEG_EXTRACFLAGS" $ffmpg_config --as="$AS"
+
+ # ffmpeg will use yasm found at ${prefix}/bin during configure
+ # but then hardcodes 'yasm' in config.mak, fix it.
+ sed -ie "s#YASM=yasm#YASM=${prefix}/bin/yasm#" config.mak
+ sed -ie "s#YASMDEP=yasm#YASMDEP=${prefix}/bin/yasm#" config.mak
+ sed -ie "s# -D_ISOC99_SOURCE -D_POSIX_C_SOURCE=200112 # #" config.mak
else
CFLAGS="" \
LDFLAGS="$(echo "$LDFLAGS" | sed "s/-Wl,-Bsymbolic-functions//g")" \
diff --git a/lib/ffmpeg/configure b/lib/ffmpeg/configure
index 5e11b2d229..c06005b14c 100755
--- a/lib/ffmpeg/configure
+++ b/lib/ffmpeg/configure
@@ -2635,7 +2635,7 @@ case $target_os in
;;
darwin)
enable malloc_aligned
- gas="gas-preprocessor.pl $cc"
+ #gas="gas-preprocessor.pl $cc"
enabled ppc && add_asflags -force_cpusubtype_ALL
SHFLAGS='-dynamiclib -Wl,-single_module -Wl,-install_name,$(SHLIBDIR)/$(SLIBNAME),-current_version,$(LIBVERSION),-compatibility_version,$(LIBMAJOR)'
enabled x86_32 && append SHFLAGS -Wl,-read_only_relocs,suppress
diff --git a/lib/ffmpeg/patches/0029-stop-forcing-gas-preprocessor-for-darwin.patch b/lib/ffmpeg/patches/0029-stop-forcing-gas-preprocessor-for-darwin.patch
new file mode 100644
index 0000000000..fb3b558fbc
--- /dev/null
+++ b/lib/ffmpeg/patches/0029-stop-forcing-gas-preprocessor-for-darwin.patch
@@ -0,0 +1,14 @@
+diff --git a/configure b/configure
+index 5e11b2d..c06005b 100755
+--- a/configure
++++ b/configure
+@@ -2635,7 +2635,7 @@ case $target_os in
+ ;;
+ darwin)
+ enable malloc_aligned
+- gas="gas-preprocessor.pl $cc"
++ #gas="gas-preprocessor.pl $cc"
+ enabled ppc && add_asflags -force_cpusubtype_ALL
+ SHFLAGS='-dynamiclib -Wl,-single_module -Wl,-install_name,$(SHLIBDIR)/$(SLIBNAME),-current_version,$(LIBVERSION),-compatibility_version,$(LIBMAJOR)'
+ enabled x86_32 && append SHFLAGS -Wl,-read_only_relocs,suppress
+