]> git.sesse.net Git - ffmpeg/blobdiff - configure
parse aac extradata to fetch channels and sample rate, patch from Netgem
[ffmpeg] / configure
index 9ad386c4d2f5d473e9351905f49f1ac28950f2e7..b4c3b351defc653574cb110fd7f2267104e18366 100755 (executable)
--- a/configure
+++ b/configure
@@ -91,7 +91,6 @@ show_help(){
   echo "  --enable-w32threads      use Win32 threads [no]"
   echo "  --enable-x11grab         enable X11 grabbing [no]"
   echo "  --enable-vdpau           enable VDPAU support [no]"
-  echo "  --enable-xvmc            enable XvMC support [no]"
   echo "  --disable-network        disable network support [no]"
   echo "  --disable-ipv6           disable IPv6 support [no]"
   echo "  --disable-mpegaudio-hp   faster (but less accurate) MPEG audio decoding [no]"
@@ -175,6 +174,8 @@ show_help(){
   echo "  --source-path=PATH       path to source code [$source_path]"
   echo "  --cross-prefix=PREFIX    use PREFIX for compilation tools [$cross_prefix]"
   echo "  --enable-cross-compile   assume a cross-compiler is used"
+  echo "  --sysroot=PATH           root of cross-build tree"
+  echo "  --sysinclude=PATH        location of cross-build system headers"
   echo "  --target-os=OS           compiler targets OS [$target_os]"
   echo "  --target-exec=CMD        command to run executables on target"
   echo "  --target-path=DIR        path to view of build directory on target"
@@ -196,6 +197,7 @@ show_help(){
   echo "                           (requires enabling PMC)"
   echo "  --disable-altivec        disable AltiVec optimizations"
   echo "  --disable-amd3dnow       disable 3DNow! optimizations"
+  echo "  --disable-amd3dnowext    disable 3DNow! extended optimizations"
   echo "  --disable-mmx            disable MMX optimizations"
   echo "  --disable-mmx2           disable MMX2 optimizations"
   echo "  --disable-sse            disable SSE optimizations"
@@ -793,7 +795,6 @@ CONFIG_LIST="
     vdpau
     vhook
     x11grab
-    xvmc
     zlib
 "
 
@@ -825,6 +826,7 @@ ARCH_LIST='
 ARCH_EXT_LIST='
     altivec
     amd3dnow
+    amd3dnowext
     armv5te
     armv6
     armv6t2
@@ -898,6 +900,7 @@ HAVE_LIST="
     sys_select_h
     sys_soundcard_h
     sys_videoio_h
+    ten_operands
     termios_h
     threads
     truncf
@@ -907,7 +910,6 @@ HAVE_LIST="
 
 # options emitted with CONFIG_ prefix but not available on command line
 CONFIG_EXTRA="
-    fft_mmx
     oldscaler
 "
 
@@ -949,6 +951,8 @@ CMDLINE_SET="
     logfile
     nm
     source_path
+    sysinclude
+    sysroot
     target_exec
     target_os
     target_path
@@ -959,6 +963,7 @@ CMDLINE_SET="
 # architecture extensions
 altivec_deps="ppc"
 amd3dnow_deps="mmx"
+amd3dnowext_deps="amd3dnow"
 armv5te_deps="arm"
 armv6_deps="arm"
 armv6t2_deps="arm"
@@ -974,8 +979,6 @@ ssse3_deps="sse"
 vis_deps="sparc"
 
 # common features
-fft_suggest="fft_mmx"
-fft_mmx_deps="mmx yasm"
 oldscaler_deps="!swscale"
 
 # decoders / encoders
@@ -992,6 +995,7 @@ dxa_decoder_select="zlib"
 eac3_decoder_deps="gpl"
 eac3_decoder_select="fft mdct"
 eatgq_decoder_select="aandct"
+eatqi_decoder_select="aandct"
 ffv1_decoder_select="golomb"
 flac_decoder_select="golomb"
 flac_encoder_select="golomb"
@@ -1014,7 +1018,7 @@ mpeg2video_encoder_select="aandct"
 mpeg4_encoder_select="aandct"
 mpeg_vdpau_decoder_deps="vdpau"
 mpeg1_vdpau_decoder_deps="vdpau"
-mpeg_xvmc_decoder_deps="xvmc X11_extensions_XvMClib_h"
+mpeg_xvmc_decoder_deps="X11_extensions_XvMClib_h"
 msmpeg4v1_encoder_select="aandct"
 msmpeg4v2_encoder_select="aandct"
 msmpeg4v3_encoder_select="aandct"
@@ -1025,6 +1029,8 @@ png_encoder_select="zlib"
 qdm2_decoder_select="fft mdct rdft"
 rv10_encoder_select="aandct"
 rv20_encoder_select="aandct"
+rv30_decoder_select="golomb"
+rv40_decoder_select="golomb"
 shorten_decoder_select="golomb"
 sonic_decoder_select="golomb"
 sonic_encoder_select="golomb"
@@ -1109,6 +1115,7 @@ x11_grab_device_demuxer_deps="x11grab XShmCreateImage"
 x11_grab_device_demuxer_extralibs="-lX11 -lXext"
 
 # protocols
+gopher_protocol_deps="network"
 http_protocol_deps="network"
 rtp_protocol_deps="udp_protocol"
 tcp_protocol_deps="network"
@@ -1193,7 +1200,7 @@ target_path='.'
 
 # gcc stupidly only outputs the basename of targets with -MM, but we need the
 # full relative path for objects in subdirectories for non-recursive Make.
-DEPEND_CMD='$(CC) $(CFLAGS) -MM -MG $< | sed -e "/^\#.*/d" -e "s,^[[:space:]]*$(*F)\\.o,$(@D)/$(*F).o," -e "s,\\([[:space:]]\\)\\(version\\.h\\),\\1\$$(BUILD_ROOT_REL)/\\2,"'
+DEPEND_CMD='$(CC) $(CFLAGS) -MM $< | sed -e "/^\#.*/d" -e "s,^[[:space:]]*$(*F)\\.o,$(@D)/$(*F).o,"'
 
 # find source path
 source_path="`dirname \"$0\"`"
@@ -1313,7 +1320,9 @@ nm_default="${cross_prefix}${nm_default}"
 ranlib="${cross_prefix}${ranlib}"
 strip="${cross_prefix}${strip}"
 
-set_default cc nm
+sysinclude_default="${sysroot}/usr/include"
+
+set_default cc nm sysinclude
 enabled cross_compile || host_cc_default=$cc
 set_default host_cc
 
@@ -1347,6 +1356,25 @@ EOF
 fi
 rm $TMPSH
 
+if   $cc --version 2>/dev/null | grep -q '(GCC)'; then
+    cc_type=gcc
+elif $cc --version 2>/dev/null | grep -q Intel; then
+    cc_type=icc
+elif $cc -v 2>&1 | grep -q xlc; then
+    cc_type=xlc
+fi
+
+test -n "$cc_type" && enable $cc_type || echolog "Unknown C compiler $cc"
+
+if test -n "$sysroot"; then
+    case "$cc_type" in
+        gcc)
+            add_cflags  --sysroot="$sysroot"
+            add_ldflags --sysroot="$sysroot"
+        ;;
+    esac
+fi
+
 # compiler sanity check
 check_exec <<EOF
 int main(void){ return 0; }
@@ -1363,37 +1391,25 @@ fi
 check_cflags -std=c99
 
 case "$arch" in
-    i386|i486|i586|i686|i86pc|BePC)
-        arch="x86"
-        subarch="x86_32"
-        enable fast_unaligned
-    ;;
-    x86_64|amd64)
-        arch="x86"
-        subarch="x86_32"
-        enable cmov
-        enable fast_cmov
-        enable fast_unaligned
-        check_cc <<EOF && enable fast_64bit && subarch="x86_64"
-        int test[sizeof(char*) - 7];
-EOF
-    ;;
-    arm|armv[4567]*l)
-        arch="arm"
-    ;;
     alpha)
         arch="alpha"
         enable fast_64bit
         check_cflags -mieee
     ;;
-    "Power Macintosh"|ppc|powerpc)
-        arch="ppc"
-        enable fast_unaligned
+    arm|armv[4567]*l)
+        arch="arm"
     ;;
-    ppc64)
-        arch="ppc"
+    avr32)
+    ;;
+    bfin)
+        arch="bfin"
+    ;;
+    ia64)
+        arch="ia64"
         enable fast_64bit
-        enable fast_unaligned
+    ;;
+    m68k)
+        arch="m68k"
     ;;
     mips|mipsel|IP*)
         arch="mips"
@@ -1402,17 +1418,6 @@ EOF
         arch="mips"
         enable fast_64bit
     ;;
-    sun4u|sparc64)
-        arch="sparc"
-        subarch="sparc64"
-        enable fast_64bit
-    ;;
-    sparc)
-        arch="sparc"
-    ;;
-    sh4|sh)
-        arch="sh4"
-    ;;
     parisc|hppa)
         arch="parisc"
     ;;
@@ -1420,18 +1425,43 @@ EOF
         arch="parisc"
         enable fast_64bit
     ;;
+    "Power Macintosh"|ppc|powerpc)
+        arch="ppc"
+        enable fast_unaligned
+    ;;
+    ppc64)
+        arch="ppc"
+        enable fast_64bit
+        enable fast_unaligned
+    ;;
     s390|s390x)
         arch="s390"
     ;;
-    m68k)
-        arch="m68k"
+    sh4|sh)
+        arch="sh4"
     ;;
-    ia64)
-        arch="ia64"
+    sparc)
+        arch="sparc"
+    ;;
+    sun4u|sparc64)
+        arch="sparc"
+        subarch="sparc64"
         enable fast_64bit
     ;;
-    bfin)
-        arch="bfin"
+    i386|i486|i586|i686|i86pc|BePC)
+        arch="x86"
+        subarch="x86_32"
+        enable fast_unaligned
+    ;;
+    x86_64|amd64)
+        arch="x86"
+        subarch="x86_32"
+        enable cmov
+        enable fast_cmov
+        enable fast_unaligned
+        check_cc <<EOF && enable fast_64bit && subarch="x86_64"
+        int test[sizeof(char*) - 7];
+EOF
     ;;
     *)
         arch="unknown"
@@ -1663,7 +1693,7 @@ test -z "$need_memalign" && need_memalign="$mmx"
 
 #Darwin CC versions
 if test $target_os = darwin; then
-    if $cc -v 2>&1 | grep -q xlc; then
+    if enabled xlc; then
         add_cflags -qpdf2 -qlanglvl=extc99 -qmaxmem=-1 -qarch=auto -qtune=auto
     else
         add_cflags -pipe
@@ -1778,6 +1808,18 @@ EOF
     # check wether EBX is available on x86
     check_asm ebx_available '"":::"%ebx"'
 
+    # check whether more than 10 operands are supported
+    check_cc <<EOF && enable ten_operands
+int main(void) {
+    int x=0;
+    __asm__ volatile(
+        ""
+        :"+&rm"(x), "+&rm"(x), "+&rm"(x), "+&rm"(x), "+&rm"(x), "+&rm"(x)
+    );
+    return 0;
+}
+EOF
+
     # check whether binutils is new enough to compile SSSE3/MMX2
     enabled ssse3 && check_asm ssse3 '"pabsw %xmm0, %xmm0"'
     enabled mmx2  && check_asm mmx2  '"movss %xmm0, %xmm0"'
@@ -1931,7 +1973,7 @@ enabled libfaad    && require2 libfaad faad.h faacDecOpen -lfaad
 enabled libgsm     && require  libgsm gsm.h gsm_create -lgsm
 enabled libmp3lame && require  libmp3lame lame/lame.h lame_init -lmp3lame -lm
 enabled libnut     && require  libnut libnut.h nut_demuxer_init -lnut
-enabled libopenjpeg && require libopenjpeg libopenjpeg/openjpeg.h opj_version -lopenjpeg
+enabled libopenjpeg && require libopenjpeg openjpeg.h opj_version -lopenjpeg
 enabled libschroedinger && add_cflags $(pkg-config --cflags schroedinger-1.0) &&
                            require libschroedinger schroedinger/schro.h schro_init $(pkg-config --libs schroedinger-1.0)
 enabled libspeex   && require  libspeex speex/speex.h speex_decoder_init -lspeex
@@ -2095,7 +2137,7 @@ if enabled small; then
     check_cflags -Os            # not all compilers support -Os
     optimizations="small"
 elif enabled optimizations; then
-    if $cc -v 2>&1 | grep -q xlc; then
+    if enabled xlc; then
         add_cflags  -O5
         add_ldflags -O5
     else
@@ -2106,19 +2148,19 @@ check_cflags -fno-math-errno
 check_cflags -fno-signed-zeros
 
 # add some flags for Intel C Compiler
-if $cc --version 2> /dev/null | grep -q Intel; then
-  # Just warnings, no remarks
-  check_cflags -w1
-  # -wd: Disable following warnings
-  # 144, 167, 556: -Wno-pointer-sign
-  # 10006: ignoring unknown option -fno-signed-zeros
-  # 10156: ignoring option '-W'; no argument required
-  check_cflags -wd144,167,556,10006,10156
-  # 11030: Warning unknown option --as-needed
-  # 10156: ignoring option '-export'; no argument required
-  check_ldflags -wd10156,11030
-  # Allow to compile with optimizations
-  check_ldflags -march=$cpu
+if enabled icc; then
+    # Just warnings, no remarks
+    check_cflags -w1
+    # -wd: Disable following warnings
+    # 144, 167, 556: -Wno-pointer-sign
+    # 10006: ignoring unknown option -fno-signed-zeros
+    # 10156: ignoring option '-W'; no argument required
+    check_cflags -wd144,167,556,10006,10156
+    # 11030: Warning unknown option --as-needed
+    # 10156: ignoring option '-export'; no argument required
+    check_ldflags -wd10156,11030
+    # Allow to compile with optimizations
+    check_ldflags -march=$cpu
 fi
 
 # PIC flags for shared library objects where they are needed
@@ -2184,12 +2226,14 @@ if enabled x86; then
     echo "MMX enabled               ${mmx-no}"
     echo "MMX2 enabled              ${mmx2-no}"
     echo "3DNow! enabled            ${amd3dnow-no}"
+    echo "3DNow! extended enabled   ${amd3dnowext-no}"
     echo "SSE enabled               ${sse-no}"
     echo "SSSE3 enabled             ${ssse3-no}"
     echo "CMOV enabled              ${cmov-no}"
     echo "CMOV is fast              ${fast_cmov-no}"
     echo "EBX available             ${ebx_available-no}"
     echo "EBP available             ${ebp_available-no}"
+    echo "10 operands supported     ${ten_operands-no}"
 fi
 if enabled arm; then
     echo "ARMv5TE enabled           ${armv5te-no}"