]> git.sesse.net Git - ffmpeg/blobdiff - configure
Don't seek when streamed
[ffmpeg] / configure
index 3502702e3daacff7d5eb45b27a53f429fdaa379d..16b90f5ed30ccca891a4d3b66b36eeacd12a7ee8 100755 (executable)
--- a/configure
+++ b/configure
@@ -77,13 +77,13 @@ show_help(){
   echo
   echo "External library support:"
   echo "  --enable-sunmlib         use Sun medialib [default=no]"
-  echo "  --enable-dc1394          enable IIDC-1394 grabbing using libdc1394"
-  echo "                           and libraw1394 [default=no]"
   echo "  --enable-liba52          enable GPLed liba52 support [default=no]"
   echo "  --enable-liba52bin       open liba52.so.0 at runtime [default=no]"
   echo "  --enable-avisynth        allow reading AVISynth script files [default=no]"
   echo "  --enable-libamr-nb       enable libamr-nb floating point audio codec"
   echo "  --enable-libamr-wb       enable libamr-wb floating point audio codec"
+  echo "  --enable-libdc1394       enable IIDC-1394 grabbing using libdc1394"
+  echo "                           and libraw1394 [default=no]"
   echo "  --enable-libfaac         enable FAAC support via libfaac [default=no]"
   echo "  --enable-libfaad         enable FAAD support via libfaad [default=no]"
   echo "  --enable-libfaadbin      open libfaad.so.0 at runtime [default=no]"
@@ -125,7 +125,6 @@ show_help(){
   echo "  --disable-v4l            disable video4linux grabbing [default=no]"
   echo "  --disable-v4l2           disable video4linux2 grabbing [default=no]"
   echo "  --disable-bktr           disable bktr video grabbing [default=no]"
-  echo "  --disable-dv1394         disable DV1394 grabbing [default=no]"
   echo "  --disable-network        disable network support [default=no]"
   echo "  --disable-ipv6           disable ipv6 support [default=no]"
   echo "  --disable-zlib           disable zlib [default=no]"
@@ -291,6 +290,15 @@ disabled_any(){
     done
 }
 
+is_in(){
+    value=$1
+    shift
+    for var in $*; do
+        [ $var = $value ] && return 0
+    done
+    return 1
+}
+
 check_deps(){
     for cfg; do
         enabled ${cfg}_checking && die "Circular dependency for $cfg."
@@ -567,20 +575,23 @@ apply(){
     "$@" < "$file" > "$file.tmp" && mv "$file.tmp" "$file" || rm "$file.tmp"
 }
 
-CONFIG_LIST='
-    encoders
-    decoders
-    parsers
+COMPONENT_LIST="
     bsfs
-    muxers
+    decoders
     demuxers
+    encoders
+    muxers
+    parsers
+    protocols
+"
+
+CONFIG_LIST="
+    $COMPONENT_LIST
     audio_beos
     audio_oss
     avisynth
     beos_netserver
     bktr
-    dc1394
-    dv1394
     ffmpeg
     ffplay
     ffserver
@@ -593,6 +604,7 @@ CONFIG_LIST='
     libamr
     libamr_nb
     libamr_wb
+    libdc1394
     libfaac
     libfaad
     libfaadbin
@@ -609,7 +621,6 @@ CONFIG_LIST='
     network
     powerpc_perf
     pp
-    protocols
     small
     swscaler
     vhook
@@ -617,7 +628,7 @@ CONFIG_LIST='
     v4l2
     x11grab
     zlib
-'
+"
 
 THREADS_LIST='
     beosthreads
@@ -659,6 +670,7 @@ HAVE_LIST="
     altivec_h
     arpa_inet_h
     byteswap_h
+    closesocket
     cmov
     conio_h
     dcbzl
@@ -676,6 +688,7 @@ HAVE_LIST="
     fast_unaligned
     fork
     freetype2
+    gethrtime
     GetProcessTimes
     getrusage
     imlib2
@@ -695,6 +708,7 @@ HAVE_LIST="
     sys_soundcard_h
     termios_h
     threads
+    winsock2_h
 "
 
 CMDLINE_SELECT="
@@ -719,6 +733,7 @@ mmx_deps="x86"
 ssse3_deps="x86"
 
 # decoders / encoders
+ac3_decoder_deps="gpl"
 dxa_decoder_deps="zlib"
 flashsv_decoder_deps="zlib"
 flashsv_encoder_deps="zlib"
@@ -765,8 +780,8 @@ libxvid_encoder_deps="libxvid"
 ac3_demuxer_deps="ac3_parser"
 audio_demuxer_deps_any="audio_oss audio_beos"
 audio_muxer_deps_any="audio_oss audio_beos"
-dc1394_demuxer_deps="dc1394"
 dv1394_demuxer_deps="dv1394"
+libdc1394_demuxer_deps="libdc1394"
 libnut_demuxer_deps="libnut"
 libnut_muxer_deps="libnut"
 mp3_demuxer_deps="mpegaudio_parser"
@@ -837,7 +852,6 @@ targetos=$(tolower $(uname -s))
 # non-library system interfaces
 audio_oss="yes"
 bktr="yes"
-dv1394="yes"
 v4l2="yes"
 v4l="yes"
 
@@ -991,6 +1005,7 @@ for opt do
   ;;
   --list-*)
     NAME="${opt#--list-}"
+    is_in $NAME $COMPONENT_LIST || die_unknown $opt
     NAME=$(toupper ${NAME%s})
     eval show_list \$${NAME}_LIST
   ;;
@@ -1094,8 +1109,6 @@ case $targetos in
     esac
     LDCONFIG="echo ignoring ldconfig"
     SHFLAGS=-nostart
-    # disable Linux things
-    dv1394="no"
     # enable BeOS things
     disabled audio_beos || enable_audio_beos
     # no need for libm, but the inet stuff
@@ -1108,17 +1121,14 @@ case $targetos in
         osextralibs="-lnet"
     fi ;;
   sunos)
-    dv1394="no"
     FFSERVERLDFLAGS=""
     SHFLAGS="-shared -Wl,-h,\$@"
     add_extralibs "-lsocket -lnsl"
     ;;
   netbsd)
-    dv1394="no"
     add_extralibs "-lossaudio"
     ;;
   openbsd)
-    dv1394="no"
     need_memalign="no"
     LIBOBJFLAGS="\$(PIC)"
     LDCONFIG="ldconfig -m \$(SHLIBDIR)"
@@ -1129,21 +1139,17 @@ case $targetos in
     add_extralibs "-lossaudio"
     ;;
   freebsd)
-    dv1394="no"
     need_memalign="no"
     add_cflags "-pthread"
     ;;
   gnu/kfreebsd)
-    dv1394="no"
     add_cflags "-pthread"
     ;;
   bsd/os)
-    dv1394="no"
     osextralibs="-lpoll -lgnugetopt -lm"
     strip="strip -d"
     ;;
   darwin)
-    dv1394="no"
     need_memalign="no"
     SHFLAGS="-dynamiclib -Wl,-single_module -Wl,-install_name,\$(SHLIBDIR)/\$(SLIBNAME),-current_version,\$(SPPVERSION),-compatibility_version,\$(SPPVERSION) -Wl,-read_only_relocs,suppress"
     VHOOKSHFLAGS='-dynamiclib -Wl,-single_module -flat_namespace -undefined suppress -Wl,-install_name,$(SHLIBDIR)/vhook/$@'
@@ -1158,11 +1164,13 @@ case $targetos in
   mingw32*)
     targetos=mingw32
     shlibdir="$bindir"
-    dv1394="no"
-    VHOOKSHFLAGS='-shared -L$(BUILD_ROOT)/libavformat -L$(BUILD_ROOT)/libavcodec -L$(BUILD_ROOT)/libswscale -L$(BUILD_ROOT)/libavutil'
-    VHOOKLIBS='-lavformat$(BUILDSUF) -lavcodec$(BUILDSUF) -lswscale$(BUILDSUF) -lavutil$(BUILDSUF) $(EXTRALIBS)'
+    VHOOKSHFLAGS='-shared -L$(BUILD_ROOT)/libavformat -L$(BUILD_ROOT)/libavcodec -L$(BUILD_ROOT)/libavutil'
+    VHOOKLIBS='-lavformat$(BUILDSUF) -lavcodec$(BUILDSUF) -lavutil$(BUILDSUF) $(EXTRALIBS)'
+    if enabled swscaler; then
+        VHOOKSHFLAGS="$VHOOKSHFLAGS -L\$(BUILD_ROOT)/libswscale"
+        VHOOKLIBS="$VHOOKLIBS -lswscale\$(BUILDSUF)"
+    fi
     ffserver="no"
-    network="no"
     SLIBPREF=""
     SLIBSUF=".dll"
     EXESUF=".exe"
@@ -1171,12 +1179,10 @@ case $targetos in
     SLIB_EXTRA_CMD="-lib /machine:i386 /def:\$(@:${SLIBSUF}=.def)"
     SLIB_INSTALL_EXTRA_CMD="-install -m 644 \$(SLIBNAME_WITH_MAJOR:\$(SLIBSUF)=.lib) \"\$(SHLIBDIR)/\$(SLIBNAME_WITH_MAJOR:\$(SLIBSUF)=.lib)\""
     SHFLAGS="-shared -Wl,--output-def,\$(@:${SLIBSUF}=.def),--out-implib,lib\$(SLIBNAME:\$(SLIBSUF)=.dll.a) -Wl,--enable-runtime-pseudo-reloc -Wl,--enable-auto-image-base"
-    enabled network && add_extralibs -lws2_32
     ;;
   cygwin*)
     targetos=cygwin
     shlibdir="$bindir"
-    dv1394="no"
     VHOOKSHFLAGS='-shared -L$(BUILD_ROOT)/libavformat -L$(BUILD_ROOT)/libavcodec -L$(BUILD_ROOT)/libavutil'
     VHOOKLIBS='-lavformat$(BUILDSUF) -lavcodec$(BUILDSUF) -lavutil$(BUILDSUF) $(EXTRALIBS)'
     if enabled swscaler; then
@@ -1193,6 +1199,7 @@ case $targetos in
     ;;
   linux)
     LDLATEFLAGS="-Wl,--as-needed $LDLATEFLAGS"
+    dv1394="yes"
     ;;
   irix*)
     targetos=irix
@@ -1223,7 +1230,7 @@ ranlib="${cross_prefix}${ranlib}"
 strip="${cross_prefix}${strip}"
 
 # we need to build at least one lib type
-if disabled_all static shared; then
+if ! enabled_any static shared; then
     cat <<EOF
 At least one library type must be built.
 Specify --enable-static to build the static libraries or --enable-shared to
@@ -1233,7 +1240,11 @@ EOF
     exit 1;
 fi
 
-if disabled libogg; then
+if disabled static; then
+    LIB=""
+fi
+
+if ! enabled libogg; then
     enabled libtheora && die "libogg must be enabled to enable libtheora."
     enabled libvorbis && die "libogg must be enabled to enable libvorbis."
 fi
@@ -1254,7 +1265,7 @@ EOF
 fi
 
 
-if disabled gpl ; then
+if ! enabled gpl; then
     die_gpl_disabled(){
         name=$1
         shift
@@ -1274,7 +1285,6 @@ check_deps $ARCH_EXT_LIST
 test -z "$need_memalign" && need_memalign="$mmx"
 
 #Darwin CC versions
-needmdynamicnopic="no"
 if test $targetos = darwin; then
     if test -n "`$cc -v 2>&1 | grep xlc`"; then
         add_cflags "-qpdf2 -qlanglvl=extc99 -qmaxmem=-1 -qarch=auto -qtune=auto"
@@ -1282,10 +1292,9 @@ if test $targetos = darwin; then
         add_cflags "-no-cpp-precomp -pipe"
         check_cflags "-force_cpusubtype_ALL"
         check_cflags "-Wno-sign-compare"
-        disabled shared && needmdynamicnopic="yes"
+        disabled shared && add_cflags -mdynamic-no-pic
     fi
 fi
-enabled needmdynamicnopic && add_cflags -mdynamic-no-pic
 
 disabled optimize || add_cflags -fomit-frame-pointer
 
@@ -1390,7 +1399,7 @@ int main(){
 EOF
 if test "$?" != 0; then
     echo "$cc is unable to create an executable file."
-    if test -z "$cross_prefix" && disabled cross_compile ; then
+    if test -z "$cross_prefix" && ! enabled cross_compile ; then
         echo "If $cc is a cross-compiler, use the --cross-compile option."
         echo "Only do this if you know what cross compiling means."
     fi
@@ -1496,20 +1505,10 @@ EOF
 
 # ---
 # big/little-endian test
-if disabled cross_compile; then
-    check_ld <<EOF || die "endian test failed" && $TMPE && bigendian="yes"
-#include <inttypes.h>
-int main(int argc, char ** argv){
-        volatile uint32_t i=0x01234567;
-        return (*((uint8_t*)(&i))) == 0x67;
-}
+check_cc <<EOF || die "endian test failed"
+unsigned int endian = 'B' << 24 | 'I' << 16 | 'G' << 8 | 'E';
 EOF
-else
-    # programs cannot be launched if cross compiling, so make a static guess
-    if test "$arch" = "powerpc" -o "$arch" = "mips" ; then
-        bigendian="yes"
-    fi
-fi
+grep -q BIGE $TMPO && enable bigendian
 
 # ---
 # check availability of some header files
@@ -1517,19 +1516,18 @@ fi
 check_header malloc.h
 check_func memalign
 
-if disabled_all memalign memalign_hack && enabled need_memalign ; then
+if ! enabled_any memalign memalign_hack && enabled need_memalign ; then
     die "Error, no memalign() but SSE enabled, disable it or use --enable-memalign-hack."
 fi
 
 check_header byteswap.h
 
 check_func mkstemp
+check_func gethrtime
 
 check_header termios.h
 check_header conio.h
 
-check_header arpa/inet.h
-
 check_func inet_aton
 enabled zlib && check_lib zlib.h zlibVersion -lz || zlib="no"
 
@@ -1578,6 +1576,7 @@ enabled_any libamr_nb libamr_wb && enable libamr
 enabled liba52     && require liba52 a52dec/a52.h a52_init -la52
 enabled libamr_nb  && require libamrnb amrnb/interf_dec.h Speech_Decode_Frame_init -lamrnb -lm
 enabled libamr_wb  && require libamrwb amrwb/dec_if.h D_IF_init -lamrwb -lm
+enabled libdc1394  && require libdc1394 libdc1394/dc1394_control.h dc1394_create_handle -ldc1394_control -lraw1394
 enabled libgsm     && require libgsm gsm.h gsm_create -lgsm
 enabled libmp3lame && require LAME lame/lame.h lame_init -lmp3lame -lm
 enabled libtheora  && require libtheora theora/theora.h theora_info_init -ltheora -logg
@@ -1586,12 +1585,14 @@ enabled libogg     && require libogg ogg/ogg.h ogg_sync_init -logg
 enabled libnut     && require libnut libnut.h nut_demuxer_init -lnut
 enabled libx264    && require x264 x264.h x264_encoder_open -lx264
 enabled libxvid    && require Xvid xvid.h xvid_global -lxvidcore
-enabled dc1394     && require libdc1394 libdc1394/dc1394_control.h dc1394_create_handle -ldc1394_control -lraw1394
 enabled mlib       && require mediaLib mlib_types.h mlib_VectorSub_S16_U8_Mod -lmlib
 enabled libfaac    && require2 libfaac "stdint.h faac.h" faacEncGetVersion -lfaac
 enabled libfaad    && require2 libfaad faad.h faacDecOpen -lfaad
 enabled avisynth   && require2 vfw32 "windows.h vfw.h" AVIFileInit -lvfw32
 
+# disable the native AC-3 decoder if liba52 is enabled
+enabled liba52 && disable ac3_decoder
+
 _restrict=
 for restrict_keyword in restrict __restrict__ __restrict; do
     check_cc <<EOF && _restrict=$restrict_keyword && break
@@ -1667,6 +1668,19 @@ fi
 
 texi2html -version >/dev/null 2>&1 && enable texi2html || disable texi2html
 
+##########################################
+# Network check
+
+if enabled network; then
+    # Prefer arpa/inet.h over winsock2
+    if check_header arpa/inet.h ; then
+        check_func closesocket
+    elif check_header winsock2.h ; then
+        add_extralibs -lws2_32
+        check_func2 winsock2.h closesocket
+    fi
+fi
+
 ##########################################
 # IPv6 check
 
@@ -1778,10 +1792,10 @@ enabled_any $THREADS_LIST  && enable threads
 check_deps $CONFIG_LIST $HAVE_LIST $DECODER_LIST $ENCODER_LIST $PARSER_LIST \
     $BSF_LIST $DEMUXER_LIST $MUXER_LIST $PROTOCOL_LIST
 
+enabled libdc1394 && append pkg_requires "libraw1394"
 enabled libogg    && append pkg_requires "ogg >= 1.1"
 enabled libtheora && append pkg_requires "theora"
 enabled libvorbis && append pkg_requires "vorbis vorbisenc"
-enabled dc1394    && append pkg_requires "libraw1394"
 
 echo "install prefix            $PREFIX"
 echo "source path               $source_path"
@@ -1797,6 +1811,8 @@ if test $arch = "x86_32" -o $arch = "x86_64"; then
     echo "MMX enabled               ${mmx-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}"
 fi
 if test $arch = "armv4l"; then
     echo "ARMv5TE enabled           ${armv5te-no}"
@@ -1838,6 +1854,7 @@ echo "liba52 support            ${liba52-no}"
 echo "liba52 dlopened           ${liba52bin-no}"
 echo "libamr-nb support         ${libamr_nb-no}"
 echo "libamr-wb support         ${libamr_wb-no}"
+echo "libdc1394 support         ${libdc1394-no}"
 echo "libfaac enabled           ${libfaac-no}"
 echo "libfaad enabled           ${libfaad-no}"
 echo "libfaad dlopened          ${libfaadbin-no}"
@@ -1850,7 +1867,7 @@ echo "libvorbis enabled         ${libvorbis-no}"
 echo "x264 enabled              ${libx264-no}"
 echo "XviD enabled              ${libxvid-no}"
 echo "zlib enabled              ${zlib-no}"
-if disabled gpl; then
+if ! enabled gpl; then
     echo "License: LGPL"
 else
     echo "License: GPL"
@@ -1892,11 +1909,7 @@ echo "BUILD_STATIC=$static" >> config.mak
 echo "BUILDSUF=$BUILDSUF" >> config.mak
 echo "LIBPREF=$LIBPREF" >> config.mak
 echo "LIBSUF=\${BUILDSUF}$LIBSUF" >> config.mak
-if enabled static; then
-  echo "LIB=$LIB" >> config.mak
-else # Some Make complain if this variable does not exist.
-  echo "LIB=" >> config.mak
-fi
+echo "LIB=$LIB" >> config.mak
 echo "SLIBPREF=$SLIBPREF" >> config.mak
 echo "SLIBSUF=\${BUILDSUF}$SLIBSUF" >> config.mak
 echo "EXESUF=\${BUILDSUF}$EXESUF" >> config.mak
@@ -1958,14 +1971,10 @@ print_config CONFIG_ $TMPH config.mak $CONFIG_LIST   \
                                       $MUXER_LIST    \
                                       $PROTOCOL_LIST \
 
-if test "$targetos" = darwin; then
-  echo "#define CONFIG_DARWIN 1"  >> $TMPH
-fi
-
 echo "#define restrict $_restrict" >> $TMPH
 
 if enabled small; then
-  echo "#define always_inline"  >> $TMPH
+  echo "#define av_always_inline"  >> $TMPH
 fi
 
 echo "SRC_PATH=\"$source_path\"" >> config.mak
@@ -1993,17 +2002,18 @@ rm -f $TMPO $TMPC $TMPE $TMPS $TMPH
 if enabled source_path_used; then
     DIRS="\
          doc \
-         libavformat \
          libavcodec \
          libavcodec/alpha \
          libavcodec/armv4l \
          libavcodec/bfin \
          libavcodec/i386 \
-         libavcodec/sparc \
          libavcodec/mlib \
          libavcodec/ppc \
-         libpostproc \
+         libavcodec/sh4 \
+         libavcodec/sparc \
+         libavformat \
          libavutil \
+         libpostproc \
          libswscale \
          tests \
          tools \
@@ -2012,12 +2022,12 @@ if enabled source_path_used; then
     FILES="\
           Makefile \
           common.mak \
-          libavformat/Makefile \
+          doc/texi2pod.pl \
           libavcodec/Makefile \
-          libpostproc/Makefile \
+          libavformat/Makefile \
           libavutil/Makefile \
+          libpostproc/Makefile \
           libswscale/Makefile \
-          doc/texi2pod.pl \
           "
     for dir in $DIRS ; do
             mkdir -p $dir