]> git.sesse.net Git - ffmpeg/blobdiff - configure
lavu: introduce av_parse_ratio() and use it in ffmpeg and lavfi/aspect
[ffmpeg] / configure
index d4fb20e75698da08a8f78997a17b659b3fd1466a..00f2ebe83a713243b25f5fb11b9a539f1c63dc85 100755 (executable)
--- a/configure
+++ b/configure
@@ -81,7 +81,6 @@ Configuration options:
                            and binaries will be unredistributable [no]
   --disable-doc            do not build documentation
   --disable-ffmpeg         disable ffmpeg build
-  --enable-avconv          enable  avconv build
   --disable-ffplay         disable ffplay build
   --disable-ffprobe        disable ffprobe build
   --disable-ffserver       disable ffserver build
@@ -218,12 +217,13 @@ Advanced options (experts only):
   --target-os=OS           compiler targets OS [$target_os]
   --target-exec=CMD        command to run executables on target
   --target-path=DIR        path to view of build directory on target
-  --nm=NM                  use nm tool
+  --nm=NM                  use nm tool NM [$nm_default]
   --ar=AR                  use archive tool AR [$ar_default]
   --as=AS                  use assembler AS [$as_default]
+  --yasmexe=EXE            use yasm-compatible assembler EXE [$yasmexe_default]
   --cc=CC                  use C compiler CC [$cc_default]
   --cxx=CXX                use C compiler CXX [$cxx_default]
-  --ld=LD                  use linker LD
+  --ld=LD                  use linker LD [$ld_default]
   --host-cc=HOSTCC         use host C compiler HOSTCC
   --host-cflags=HCFLAGS    use HCFLAGS when compiling for host
   --host-ldflags=HLDFLAGS  use HLDFLAGS when linking for host
@@ -253,7 +253,7 @@ Advanced options (experts only):
   --disable-armvfp         disable ARM VFP optimizations
   --disable-iwmmxt         disable iwmmxt optimizations
   --disable-mmi            disable MMI optimizations
-  --disable-neon           disable neon optimizations
+  --disable-neon           disable NEON optimizations
   --disable-vis            disable VIS optimizations
   --disable-yasm           disable use of yasm assembler
   --enable-pic             build position-independent code
@@ -261,6 +261,8 @@ Advanced options (experts only):
   --enable-sram            allow use of on-chip SRAM
   --disable-symver         disable symbol versioning
   --optflags               override optimization-related compiler flags
+  --postproc-version=V     build libpostproc version V.
+                           Where V can be '$ALT_PP_VER_MAJOR.$ALT_PP_VER_MINOR.$ALT_PP_VER_MICRO' or 'current'. [$postproc_version_default]
 
 Developer options (useful when working on FFmpeg itself):
   --enable-coverage        build with test coverage instrumentation
@@ -269,8 +271,13 @@ Developer options (useful when working on FFmpeg itself):
   --disable-optimizations  disable compiler optimizations
   --enable-extra-warnings  enable more compiler warnings
   --disable-stripping      disable stripping of executables and shared libraries
+  --valgrind=VALGRIND      run "make fate" tests through valgrind to detect memory
+                           leaks and errors, using the specified valgrind binary.
+                           Cannot be combined with --target-exec
   --samples=PATH           location of test samples for FATE, if not set use
                            \$FATE_SAMPLES at make invocation time.
+  --enable-xmm-clobber-test check XMM registers for clobbering (Win64-only;
+                           should be used only for debugging purposes)
 
 NOTE: Object files are built at the place where configure is launched.
 EOF
@@ -558,7 +565,8 @@ print_config_mak(){
 }
 
 print_config_asm(){
-    enabled $1 && echo "%define $2"
+    enabled $1 && v=1 || v=0
+    echo "%define $2 $v"
 }
 
 print_config(){
@@ -991,7 +999,6 @@ PROGRAM_LIST="
 CONFIG_LIST="
     $COMPONENT_LIST
     $PROGRAM_LIST
-    avconv
     avplay
     avprobe
     avserver
@@ -1080,6 +1087,7 @@ CONFIG_LIST="
     vda
     vdpau
     version3
+    xmm_clobber_test
     x11grab
     zlib
 "
@@ -1175,9 +1183,9 @@ HAVE_LIST="
     fork
     getaddrinfo
     gethrtime
+    GetProcessAffinityMask
     GetProcessMemoryInfo
     GetProcessTimes
-    GetSystemInfo
     getrusage
     gnu_as
     ibm_asm
@@ -1186,6 +1194,8 @@ HAVE_LIST="
     isatty
     kbhit
     ldbrx
+    libdc1394_1
+    libdc1394_2
     llrint
     llrintf
     local_aligned_16
@@ -1226,9 +1236,11 @@ HAVE_LIST="
     struct_sockaddr_in6
     struct_sockaddr_sa_len
     struct_sockaddr_storage
+    struct_v4l2_frmivalenum_discrete
     symver
     symver_asm_label
     symver_gnu_asm
+    sysconf
     sysctl
     sys_mman_h
     sys_param_h
@@ -1287,7 +1299,6 @@ CMDLINE_SET="
     arch
     as
     build_suffix
-    progs_suffix
     cc
     cpu
     cross_prefix
@@ -1306,6 +1317,8 @@ CMDLINE_SET="
     nm
     optflags
     pkg_config
+    postproc_version
+    progs_suffix
     samples
     strip
     sysinclude
@@ -1313,6 +1326,8 @@ CMDLINE_SET="
     target_exec
     target_os
     target_path
+    valgrind
+    yasmexe
 "
 
 CMDLINE_APPEND="
@@ -1636,7 +1651,9 @@ tls_protocol_select="tcp_protocol"
 udp_protocol_deps="network"
 
 # filters
+aconvert_filter_deps="swresample"
 amovie_filter_deps="avcodec avformat"
+aresample_filter_deps="swresample"
 ass_filter_deps="libass"
 blackframe_filter_deps="gpl"
 boxblur_filter_deps="gpl"
@@ -1651,7 +1668,9 @@ mp_filter_deps="gpl avcodec"
 mptestsrc_filter_deps="gpl"
 negate_filter_deps="lut_filter"
 ocv_filter_deps="libopencv"
+pan_filter_deps="swresample"
 scale_filter_deps="swscale"
+tinterlace_filter_deps="gpl"
 yadif_filter_deps="gpl"
 
 # libraries
@@ -1660,7 +1679,6 @@ avformat_deps="avcodec"
 postproc_deps="gpl"
 
 # programs
-avconv_deps="avcodec avformat swscale"
 ffplay_deps="avcodec avformat swscale sdl"
 ffplay_select="buffersink_filter rdft"
 ffprobe_deps="avcodec avformat"
@@ -1764,7 +1782,7 @@ test_deps _muxer _demuxer                                               \
     wav                                                                 \
     yuv4mpegpipe=yuv4mpeg                                               \
 
-ac3_fixed_test_deps="ac3_fixed_encoder ac3_decoder rm_muxer rm_demuxer"
+ac3_fixed_test_deps="ac3_fixed_encoder ac3_decoder"
 mpg_test_deps="mpeg1system_muxer mpegps_demuxer"
 
 # default parameters
@@ -1779,6 +1797,7 @@ incdir_default='${prefix}/include'
 libdir_default='${prefix}/lib'
 mandir_default='${prefix}/share/man'
 shlibdir_default="$libdir_default"
+postproc_version_default="current"
 
 # toolchain
 ar_default="ar"
@@ -1793,7 +1812,7 @@ objformat="elf"
 pkg_config_default=pkg-config
 ranlib="ranlib"
 strip_default="strip"
-yasmexe="yasm"
+yasmexe_default="yasm"
 
 nm_opts='-g'
 nogas=":"
@@ -1806,6 +1825,12 @@ cpu="generic"
 target_os_default=$(tolower $(uname -s))
 host_os=$target_os_default
 
+# alternative libpostproc version
+ALT_PP_VER_MAJOR=51
+ALT_PP_VER_MINOR=2
+ALT_PP_VER_MICRO=101
+ALT_PP_VER=$ALT_PP_VER_MAJOR.$ALT_PP_VER_MINOR.$ALT_PP_VER_MICRO
+
 # configurable options
 enable $PROGRAM_LIST
 
@@ -2012,7 +2037,17 @@ if enabled cross_compile; then
         die "Must specify target arch and OS when cross-compiling"
 fi
 
-set_default arch target_os
+set_default arch target_os postproc_version
+
+# Check if we should build alternative libpostproc version instead of current
+if   test "$postproc_version" = $ALT_PP_VER; then
+  LIBPOSTPROC_VERSION=$ALT_PP_VER
+  LIBPOSTPROC_VERSION_MAJOR=$ALT_PP_VER_MAJOR
+  LIBPOSTPROC_VERSION_MINOR=$ALT_PP_VER_MINOR
+  LIBPOSTPROC_VERSION_MICRO=$ALT_PP_VER_MICRO
+elif test "$postproc_version" != current; then
+  die "Invalid argument to --postproc-version. See --help output."
+fi
 
 ar_default="${cross_prefix}${ar_default}"
 cc_default="${cross_prefix}${cc_default}"
@@ -2024,7 +2059,7 @@ strip_default="${cross_prefix}${strip_default}"
 
 sysinclude_default="${sysroot}/usr/include"
 
-set_default cc cxx nm pkg_config strip sysinclude
+set_default cc cxx nm pkg_config strip sysinclude yasmexe
 enabled cross_compile || host_cc_default=$cc
 set_default host_cc
 
@@ -3007,14 +3042,15 @@ check_func  setrlimit
 check_func  strerror_r
 check_func  strptime
 check_func  sched_getaffinity
+check_func  sysconf
 check_func  sysctl
 check_func_headers conio.h kbhit
 check_func_headers windows.h PeekNamedPipe
 check_func_headers io.h setmode
 check_func_headers lzo/lzo1x.h lzo1x_999_compress
 check_lib2 "windows.h psapi.h" GetProcessMemoryInfo -lpsapi
+check_func_headers windows.h GetProcessAffinityMask
 check_func_headers windows.h GetProcessTimes
-check_func_headers windows.h GetSystemInfo
 check_func_headers windows.h MapViewOfFile
 check_func_headers windows.h VirtualAlloc
 
@@ -3099,8 +3135,9 @@ enabled frei0r     && { check_header frei0r.h || die "ERROR: frei0r.h header not
 enabled gnutls     && require_pkg_config gnutls gnutls/gnutls.h gnutls_global_init
 enabled libaacplus && require  "libaacplus >= 2.0.0" aacplus.h aacplusEncOpen -laacplus
 enabled libass     && require_pkg_config libass ass/ass.h ass_library_init
-enabled libcelt    && require libcelt celt/celt.h celt_decode -lcelt0
-enabled libdc1394  && require_pkg_config libdc1394-2 dc1394/dc1394.h dc1394_new
+enabled libcelt    && require libcelt celt/celt.h celt_decode -lcelt0 &&
+                      { check_lib celt/celt.h celt_decoder_create_custom -lcelt0 ||
+                        die "ERROR: libcelt version must be >= 0.11.0."; }
 enabled libdirac   && require_pkg_config dirac                          \
     "libdirac_decoder/dirac_parser.h libdirac_encoder/dirac_encoder.h"  \
     "dirac_decoder_init dirac_encoder_init"
@@ -3148,6 +3185,15 @@ enabled openssl    && { check_lib openssl/ssl.h SSL_library_init -lssl -lcrypto
                         check_lib openssl/ssl.h SSL_library_init -lssl -lcrypto -lws2_32 -lgdi32 ||
                         die "ERROR: openssl not found"; }
 
+# libdc1394 check
+if enabled libdc1394; then
+    { check_lib dc1394/dc1394.h dc1394_new -ldc1394 -lraw1394 &&
+        enable libdc1394_2; } ||
+    { check_lib libdc1394/dc1394_control.h dc1394_create_handle -ldc1394_control -lraw1394 &&
+        enable libdc1394_1; } ||
+    die "ERROR: No version of libdc1394 found "
+fi
+
 SDL_CONFIG="${cross_prefix}sdl-config"
 if check_pkg_config sdl SDL_version.h SDL_Linked_Version; then
     check_cpp_condition SDL.h "(SDL_MAJOR_VERSION<<16 | SDL_MINOR_VERSION<<8 | SDL_PATCHLEVEL) >= 0x010201" $sdl_cflags &&
@@ -3171,6 +3217,8 @@ makeinfo --version > /dev/null 2>&1 && enable makeinfo  || disable makeinfo
 check_header linux/fb.h
 check_header linux/videodev.h
 check_header linux/videodev2.h
+check_struct linux/videodev2.h "struct v4l2_frmivalenum" discrete
+
 check_header sys/videoio.h
 
 check_func_headers "windows.h vfw.h" capCreateCaptureWindow "$vfwcap_indev_extralibs"
@@ -3233,6 +3281,7 @@ fi
 
 enabled debug && add_cflags -g"$debuglevel" && add_asflags -g"$debuglevel"
 enabled coverage && add_cflags "-fprofile-arcs -ftest-coverage" && add_ldflags "-fprofile-arcs -ftest-coverage"
+test -n "$valgrind" && target_exec="$valgrind --error-exitcode=1 --malloc-fill=0x2a --track-origins=yes --leak-check=full --gen-suppressions=all --suppressions=$source_path/tests/fate-valgrind.supp"
 
 # add some useful compiler flags if supported
 check_cflags -Wdeclaration-after-statement
@@ -3258,6 +3307,17 @@ check_ldflags -Wl,--warn-common
 check_ldflags -Wl,-rpath-link=libpostproc:libswresample:libswscale:libavfilter:libavdevice:libavformat:libavcodec:libavutil
 test_ldflags -Wl,-Bsymbolic && append SHFLAGS -Wl,-Bsymbolic
 
+enabled xmm_clobber_test &&                             \
+    check_ldflags -Wl,--wrap,avcodec_open2              \
+                  -Wl,--wrap,avcodec_decode_audio4      \
+                  -Wl,--wrap,avcodec_decode_video2      \
+                  -Wl,--wrap,avcodec_decode_subtitle2   \
+                  -Wl,--wrap,avcodec_encode_audio2      \
+                  -Wl,--wrap,avcodec_encode_video       \
+                  -Wl,--wrap,avcodec_encode_subtitle    \
+                  -Wl,--wrap,sws_scale ||               \
+    disable xmm_clobber_test
+
 echo "X{};" > $TMPV
 if test_ldflags -Wl,--version-script,$TMPV; then
     append SHFLAGS '-Wl,--version-script,\$(SUBDIR)lib\$(NAME).ver'
@@ -3575,8 +3635,11 @@ EOF
 get_version(){
     name=$1
     file=$source_path/$2
+# This condition will be removed when we stop supporting old libpostproc versions
+if ! test "$name" = LIBPOSTPROC || test "$postproc_version" = current; then
     eval $(grep "#define ${name}_VERSION_M" "$file" | awk '{ print $2"="$3 }')
     eval ${name}_VERSION=\$${name}_VERSION_MAJOR.\$${name}_VERSION_MINOR.\$${name}_VERSION_MICRO
+fi
     lcname=$(tolower $name)
     eval echo "${lcname}_VERSION=\$${name}_VERSION" >> config.mak
     eval echo "${lcname}_VERSION_MAJOR=\$${name}_VERSION_MAJOR" >> config.mak
@@ -3584,7 +3647,7 @@ get_version(){
 
 get_version LIBAVCODEC  libavcodec/version.h
 get_version LIBAVDEVICE libavdevice/avdevice.h
-get_version LIBAVFILTER libavfilter/avfilter.h
+get_version LIBAVFILTER libavfilter/version.h
 get_version LIBAVFORMAT libavformat/version.h
 get_version LIBAVUTIL   libavutil/avutil.h
 get_version LIBPOSTPROC libpostproc/postprocess.h
@@ -3653,6 +3716,12 @@ cat > $TMPH <<EOF
 #define AVUTIL_AVCONFIG_H
 EOF
 
+test "$postproc_version" != current && cat >> $TMPH <<EOF
+#define LIBPOSTPROC_VERSION_MAJOR $LIBPOSTPROC_VERSION_MAJOR
+#define LIBPOSTPROC_VERSION_MINOR $LIBPOSTPROC_VERSION_MINOR
+#define LIBPOSTPROC_VERSION_MICRO $LIBPOSTPROC_VERSION_MICRO
+EOF
+
 print_config AV_HAVE_ $TMPH $HAVE_LIST_PUB
 
 echo "#endif /* AVUTIL_AVCONFIG_H */" >> $TMPH