diff options
| author | Tim Redfern <tim@eclectronics.org> | 2013-12-29 12:19:38 +0000 |
|---|---|---|
| committer | Tim Redfern <tim@eclectronics.org> | 2013-12-29 12:19:38 +0000 |
| commit | f7813a5324be39d13ab536c245d15dfc602a7849 (patch) | |
| tree | fad99148b88823d34a5df2f0a25881a002eb291b /ffmpeg/configure | |
| parent | b7a5a477b8ff4d4e3028b9dfb9a9df0a41463f92 (diff) | |
basic type mechanism working
Diffstat (limited to 'ffmpeg/configure')
| -rwxr-xr-x | ffmpeg/configure | 1127 |
1 files changed, 835 insertions, 292 deletions
diff --git a/ffmpeg/configure b/ffmpeg/configure index ba83376..9c210e9 100755 --- a/ffmpeg/configure +++ b/ffmpeg/configure @@ -82,10 +82,13 @@ Standard options: --prefix=PREFIX install in PREFIX [$prefix] --bindir=DIR install binaries in DIR [PREFIX/bin] --datadir=DIR install data files in DIR [PREFIX/share/ffmpeg] + --docdir=DIR install documentation in DIR [PREFIX/share/doc/ffmpeg] --libdir=DIR install libs in DIR [PREFIX/lib] --shlibdir=DIR install shared libs in DIR [PREFIX/lib] --incdir=DIR install includes in DIR [PREFIX/include] --mandir=DIR install man page in DIR [PREFIX/share/man] + --enable-rpath use rpath to allow installing libraries in paths + not part of the dynamic linker search path Licensing options: --enable-gpl allow use of GPL code, the resulting libs @@ -102,6 +105,9 @@ Configuration options: --enable-gray enable full grayscale support (slower color) --disable-swscale-alpha disable alpha channel support in swscale --disable-all disable building components, libraries and programs + --enable-incompatible-libav-abi enable incompatible Libav fork ABI [no] + --enable-incompatible-fork-abi enable incompatible Libav fork ABI (deprecated) [no] + --enable-raise-major increase major version numbers in sonames [no] Program options: --disable-programs do not build command line programs @@ -133,6 +139,7 @@ Component options: --disable-network disable network support [no] --disable-dct disable DCT code --disable-dwt disable DWT code + --disable-error-resilience disable error resilience code --disable-lsp disable LSP code --disable-lzo disable LZO decoder code --disable-mdct disable MDCT code @@ -140,10 +147,10 @@ Component options: --disable-fft disable FFT code Hardware accelerators: - --enable-dxva2 enable DXVA2 code - --enable-vaapi enable VAAPI code + --disable-dxva2 disable DXVA2 code [autodetect] + --disable-vaapi disable VAAPI code [autodetect] --enable-vda enable VDA code - --enable-vdpau enable VDPAU code + --disable-vdpau disable VDPAU code [autodetect] Individual component options: --disable-everything disable all components listed below @@ -183,12 +190,13 @@ Individual component options: --disable-filters disable all filters External library support: - --enable-avisynth enable reading of AVISynth script files [no] - --enable-bzlib enable bzlib [autodetect] + --enable-avisynth enable reading of AviSynth script files [no] + --disable-bzlib disable bzlib [autodetect] --enable-fontconfig enable fontconfig --enable-frei0r enable frei0r video filtering --enable-gnutls enable gnutls [no] - --enable-iconv enable iconv [autodetect] + --disable-iconv disable iconv [autodetect] + --enable-ladspa enable LADSPA audio filtering --enable-libaacplus enable AAC+ encoding via libaacplus [no] --enable-libass enable libass subtitles rendering [no] --enable-libbluray enable BluRay reading using libbluray [no] @@ -198,9 +206,10 @@ External library support: --enable-libdc1394 enable IIDC-1394 grabbing using libdc1394 and libraw1394 [no] --enable-libfaac enable AAC encoding via libfaac [no] - --enable-libfdk-aac enable AAC encoding via libfdk-aac [no] + --enable-libfdk-aac enable AAC de/encoding via libfdk-aac [no] --enable-libflite enable flite (voice synthesis) support via libflite [no] --enable-libfreetype enable libfreetype [no] + --enable-libgme enable Game Music Emu via libgme [no] --enable-libgsm enable GSM de/encoding via libgsm [no] --enable-libiec61883 enable iec61883 via libiec61883 [no] --enable-libilbc enable iLBC de/encoding via libilbc [no] @@ -214,28 +223,37 @@ External library support: --enable-libopenjpeg enable JPEG 2000 de/encoding via OpenJPEG [no] --enable-libopus enable Opus decoding via libopus [no] --enable-libpulse enable Pulseaudio input via libpulse [no] + --enable-libquvi enable quvi input via libquvi [no] --enable-librtmp enable RTMP[E] support via librtmp [no] --enable-libschroedinger enable Dirac de/encoding via libschroedinger [no] + --enable-libshine enable fixed-point MP3 encoding via libshine [no] --enable-libsoxr enable Include libsoxr resampling [no] --enable-libspeex enable Speex de/encoding via libspeex [no] + --enable-libssh enable SFTP protocol via libssh [no] --enable-libstagefright-h264 enable H.264 decoding via libstagefright [no] --enable-libtheora enable Theora encoding via libtheora [no] --enable-libtwolame enable MP2 encoding via libtwolame [no] --enable-libutvideo enable Ut Video encoding and decoding via libutvideo [no] --enable-libv4l2 enable libv4l2/v4l-utils [no] + --enable-libvidstab enable video stabilization using vid.stab [no] --enable-libvo-aacenc enable AAC encoding via libvo-aacenc [no] --enable-libvo-amrwbenc enable AMR-WB encoding via libvo-amrwbenc [no] --enable-libvorbis enable Vorbis en/decoding via libvorbis, native implementation exists [no] --enable-libvpx enable VP8 and VP9 de/encoding via libvpx [no] + --enable-libwavpack enable wavpack encoding via libwavpack [no] + --enable-libwebp enable WebP encoding via libwebp [no] --enable-libx264 enable H.264 encoding via x264 [no] --enable-libxavs enable AVS encoding via xavs [no] --enable-libxvid enable Xvid encoding via xvidcore, native MPEG-4/Xvid encoder exists [no] + --enable-libzmq enable message passing via libzmq [no] + --enable-libzvbi enable teletext support via libzvbi [no] --enable-openal enable OpenAL 1.1 capture support [no] + --enable-opencl enable OpenCL code --enable-openssl enable openssl [no] --enable-x11grab enable X11 grabbing [no] - --enable-zlib enable zlib [autodetect] + --disable-zlib disable zlib [autodetect] Advanced options (experts only): --cross-prefix=PREFIX use PREFIX for compilation tools [$cross_prefix] @@ -245,10 +263,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 + --target-samples=DIR path to samples directory on target + --tempprefix=PATH force fixed dir/prefix instead of mktemp for checks --toolchain=NAME set tool defaults according to NAME --nm=NM use nm tool NM [$nm_default] --ar=AR use archive tool AR [$ar_default] --as=AS use assembler AS [$as_default] + --windres=WINDRES use windows resource compiler WINDRES [$windres_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] @@ -299,6 +320,7 @@ Optimization options (experts only): --disable-sse42 disable SSE4.2 optimizations --disable-avx disable AVX optimizations --disable-fma4 disable FMA4 optimizations + --disable-avx2 disable AVX2 optimizations --disable-armv5te disable armv5te optimizations --disable-armv6 disable armv6 optimizations --disable-armv6t2 disable armv6t2 optimizations @@ -314,7 +336,6 @@ Optimization options (experts only): --disable-fast-unaligned consider unaligned accesses slow Developer options (useful when working on FFmpeg itself): - --enable-coverage build with test coverage instrumentation --disable-debug disable debugging symbols --enable-debug=LEVEL set the debug level [$debuglevel] --disable-optimizations disable compiler optimizations @@ -409,7 +430,7 @@ sh_quote(){ } cleanws(){ - echo "$@" | sed 's/^ *//;s/ */ /g;s/ *$//' + echo "$@" | sed 's/^ *//;s/ */ /g;s/ *$//;s/\r//g' } filter(){ @@ -471,21 +492,21 @@ get_safe(){ } pushvar(){ - for var in $*; do - eval level=\${${var}_level:=0} - eval ${var}_${level}="\$$var" - eval ${var}_level=$(($level+1)) + for pvar in $*; do + eval level=\${${pvar}_level:=0} + eval ${pvar}_${level}="\$$pvar" + eval ${pvar}_level=$(($level+1)) done } popvar(){ - for var in $*; do - eval level=\${${var}_level:-0} + for pvar in $*; do + eval level=\${${pvar}_level:-0} test $level = 0 && continue eval level=$(($level-1)) - eval $var="\${${var}_${level}}" - eval ${var}_level=$level - eval unset ${var}_${level} + eval $pvar="\${${pvar}_${level}}" + eval ${pvar}_level=$level + eval unset ${pvar}_${level} done } @@ -536,8 +557,13 @@ enable_deep(){ } enable_deep_weak(){ - do_enable_deep $* - enable_weak $* + for var; do + disabled $var && continue + pushvar var + do_enable_deep $var + popvar var + enable_weak $var + done } enabled(){ @@ -656,6 +682,12 @@ print_config(){ } else if (file ~ /\\.mak\$/) { n = -v ? \"\" : \"!\"; printf(\"%s%s=yes\\n\", n, c) >>file; + } else if (file ~ /\\.texi\$/) { + pre = -v ? \"\" : \"@c \"; + yesno = \$2; + c2 = tolower(c); + gsub(/_/, \"-\", c2); + printf(\"%s@set %s %s\\n\", pre, c2, yesno) >>file; } } }" @@ -701,6 +733,10 @@ add_ldflags(){ append LDFLAGS $($ldflags_filter "$@") } +add_stripflags(){ + append ASMSTRIPFLAGS "$@" +} + add_extralibs(){ prepend extralibs $($ldflags_filter "$@") } @@ -830,14 +866,19 @@ int x; EOF } -check_cflags(){ - log check_cflags "$@" +test_cflags(){ + log test_cflags "$@" set -- $($cflags_filter "$@") - check_cc "$@" <<EOF && append CFLAGS "$@" + check_cc "$@" <<EOF int x; EOF } +check_cflags(){ + log check_cflags "$@" + test_cflags "$@" && add_cflags "$@" +} + check_cxxflags(){ log check_cxxflags "$@" set -- $($cflags_filter "$@") @@ -858,6 +899,20 @@ check_ldflags(){ test_ldflags "$@" && add_ldflags "$@" } +test_stripflags(){ + log test_stripflags "$@" + # call check_cc to get a fresh TMPO + check_cc <<EOF +int main(void) { return 0; } +EOF + check_cmd $strip $ASMSTRIPFLAGS "$@" $TMPO +} + +check_stripflags(){ + log check_stripflags "$@" + test_stripflags "$@" && add_stripflags "$@" +} + check_header(){ log check_header "$@" header=$1 @@ -972,7 +1027,7 @@ check_pkg_config(){ headers="$2" funcs="$3" shift 3 - $pkg_config --exists $pkg 2>/dev/null || return + check_cmd $pkg_config --exists --print-errors $pkg || return pkg_cflags=$($pkg_config --cflags $pkg) pkg_libs=$($pkg_config --libs $pkg) check_func_headers "$headers" "$funcs" $pkg_cflags $pkg_libs "$@" && @@ -998,10 +1053,10 @@ check_exec_crash(){ static void sighandler(int sig){ raise(SIGTERM); } -int func(void){ +int foo(void){ $code } -int (*func_ptr)(void) = func; +int (*func_ptr)(void) = foo; int main(void){ signal(SIGILL, sighandler); signal(SIGFPE, sighandler); @@ -1075,6 +1130,30 @@ require_pkg_config(){ add_extralibs $(get_safe ${pkg}_libs) } +require_libfreetype(){ + log require_libfreetype "$@" + pkg="freetype2" + check_cmd $pkg_config --exists --print-errors $pkg \ + || die "ERROR: $pkg not found" + pkg_cflags=$($pkg_config --cflags $pkg) + pkg_libs=$($pkg_config --libs $pkg) + { + echo "#include <ft2build.h>" + echo "#include FT_FREETYPE_H" + echo "long check_func(void) { return (long) FT_Init_FreeType; }" + echo "int main(void) { return 0; }" + } | check_ld "cc" $pkg_cflags $pkg_libs \ + && set_safe ${pkg}_cflags $pkg_cflags \ + && set_safe ${pkg}_libs $pkg_libs \ + || die "ERROR: $pkg not found" + add_cflags $(get_safe ${pkg}_cflags) + add_extralibs $(get_safe ${pkg}_libs) +} + +hostcc_e(){ + eval printf '%s\\n' $HOSTCC_E +} + hostcc_o(){ eval printf '%s\\n' $HOSTCC_O } @@ -1086,6 +1165,13 @@ check_host_cc(){ check_cmd $host_cc $host_cflags "$@" $HOSTCC_C $(hostcc_o $TMPO) $TMPC } +check_host_cpp(){ + log check_host_cpp "$@" + cat > $TMPC + log_file $TMPC + check_cmd $host_cc $HOSTCPPFLAGS $HOSTCFLAGS "$@" $(hostcc_e $TMPO) $TMPC +} + check_host_cppflags(){ log check_host_cppflags "$@" check_host_cc "$@" <<EOF && append host_cppflags "$@" @@ -1101,6 +1187,19 @@ int x; EOF } +check_host_cpp_condition(){ + log check_host_cpp_condition "$@" + header=$1 + condition=$2 + shift 2 + check_host_cpp "$@" <<EOF +#include <$header> +#if !($condition) +#error "unsatisfied condition: $condition" +#endif +EOF +} + apply(){ file=$1 shift @@ -1130,6 +1229,18 @@ COMPONENT_LIST=" protocols " +EXAMPLE_LIST=" + decoding_encoding_example + demuxing_decoding_example + filtering_audio_example + filtering_video_example + metadata_example + muxing_example + resampling_audio_example + scaling_video_example + transcode_aac_example +" + EXTERNAL_LIBRARY_LIST=" avisynth bzlib @@ -1138,6 +1249,7 @@ EXTERNAL_LIBRARY_LIST=" frei0r gnutls iconv + ladspa libaacplus libass libbluray @@ -1149,6 +1261,7 @@ EXTERNAL_LIBRARY_LIST=" libfdk_aac libflite libfreetype + libgme libgsm libiec61883 libilbc @@ -1161,23 +1274,32 @@ EXTERNAL_LIBRARY_LIST=" libopenjpeg libopus libpulse + libquvi librtmp libschroedinger + libshine libsoxr libspeex + libssh libstagefright_h264 libtheora libtwolame libutvideo libv4l2 + libvidstab libvo_aacenc libvo_amrwbenc libvorbis libvpx + libwavpack + libwebp libx264 libxavs libxvid + libzmq + libzvbi openal + opencl openssl x11grab zlib @@ -1196,6 +1318,7 @@ HWACCEL_LIST=" vaapi vda vdpau + xvmc " LIBRARY_LIST=" @@ -1220,18 +1343,21 @@ PROGRAM_LIST=" CONFIG_LIST=" $COMPONENT_LIST $DOCUMENT_LIST + $EXAMPLE_LIST $EXTERNAL_LIBRARY_LIST $HWACCEL_LIST $LIBRARY_LIST $PROGRAM_LIST dct dwt + error_resilience fast_unaligned fft ftrapv gpl gray hardcoded_tables + incompatible_libav_abi incompatible_fork_abi lsp lzo @@ -1241,6 +1367,7 @@ CONFIG_LIST=" network nonfree pic + raise_major rdft runtime_cpudetect safe_bitstream_reader @@ -1260,6 +1387,12 @@ THREADS_LIST=' os2threads ' +ATOMICS_LIST=' + atomics_gcc + atomics_suncc + atomics_win32 +' + ARCH_LIST=' aarch64 alpha @@ -1300,7 +1433,9 @@ ARCH_EXT_LIST_X86=' amd3dnow amd3dnowext avx + avx2 fma4 + i686 mmx mmxext sse @@ -1332,6 +1467,7 @@ HAVE_LIST_CMDLINE=' HAVE_LIST_PUB=' bigendian fast_unaligned + incompatible_libav_abi incompatible_fork_abi ' @@ -1370,6 +1506,7 @@ HAVE_LIST=" $HAVE_LIST_CMDLINE $HAVE_LIST_PUB $THREADS_LIST + $ATOMICS_LIST $MATH_FUNCS access aligned_malloc @@ -1380,13 +1517,15 @@ HAVE_LIST=" asm_mod_q asm_mod_y asm_types_h + atomic_cas_ptr + atomics_native attribute_may_alias attribute_packed cdio_paranoia_h cdio_paranoia_paranoia_h + CL_cl_h clock_gettime closesocket - cmov CommandLineToArgvW cpunop CryptGenRandom @@ -1420,14 +1559,17 @@ HAVE_LIST=" gettimeofday glob gnu_as + gnu_windres gsm_h ibm_asm inet_aton io_h + inline_asm_labels isatty jack_port_get_latency_range kbhit ldbrx + libc_msvcrt libdc1394_1 libdc1394_2 local_aligned_16 @@ -1447,7 +1589,6 @@ HAVE_LIST=" mm_empty mmap mprotect - msvcrt nanosleep openjpeg_1_5_openjpeg_h PeekNamedPipe @@ -1455,9 +1596,11 @@ HAVE_LIST=" pod2man poll_h posix_memalign + pragma_deprecated pthread_cancel rdtsc rsync_contimeout + sarestart sched_getaffinity sdl SetConsoleTextAttribute @@ -1478,6 +1621,7 @@ HAVE_LIST=" struct_sockaddr_in6 struct_sockaddr_sa_len struct_sockaddr_storage + struct_stat_st_mtim_tv_nsec struct_v4l2_frmivalenum_discrete symver_asm_label symver_gnu_asm @@ -1490,17 +1634,20 @@ HAVE_LIST=" sys_select_h sys_soundcard_h sys_time_h + sys_un_h sys_videoio_h termios_h texi2html threads unistd_h usleep + vdpau_x11 vfp_args VirtualAlloc windows_h winsock2_h xform_asm + xlib xmm_clobbers " @@ -1510,11 +1657,12 @@ CONFIG_EXTRA=" ac3dsp audio_frame_queue dsputil - error_resilience + exif frame_thread_encoder gcrypt golomb gplv3 + h263dsp h264chroma h264dsp h264pred @@ -1529,6 +1677,8 @@ CONFIG_EXTRA=" mpegvideoenc nettle rangecoder + riffdec + riffenc rtpdec rtpenc_chain sinewin @@ -1542,19 +1692,20 @@ CMDLINE_SELECT=" $HAVE_LIST_CMDLINE $THREADS_LIST asm - coverage cross_compile debug extra_warnings logging lto optimizations + rpath stripping " PATHS_LIST=' bindir datadir + docdir incdir libdir mandir @@ -1597,6 +1748,8 @@ CMDLINE_SET=" target_exec target_os target_path + target_samples + tempprefix toolchain valgrind yasmexe @@ -1631,7 +1784,9 @@ ppc4xx_deps="ppc" vis_deps="sparc" -x86_64_suggest="cmov fast_cmov" +cpunop_deps="i686" +x86_64_select="i686" +x86_64_suggest="fast_cmov" amd3dnow_deps="mmx" amd3dnowext_deps="amd3dnow" @@ -1645,6 +1800,7 @@ sse4_deps="ssse3" sse42_deps="sse4" avx_deps="sse42" fma4_deps="avx" +avx2_deps="avx" mmx_external_deps="yasm" mmx_inline_deps="inline_asm" @@ -1662,22 +1818,30 @@ fast_64bit_if_any="alpha ia64 mips64 parisc64 ppc64 sparc64 x86_64" fast_clz_if_any="alpha avr32 mips ppc x86" fast_unaligned_if_any="ppc x86" -inline_asm_deps="!tms470" need_memalign="altivec neon sse" +# system capabilities +log2_deps="!libc_msvcrt" + symver_if_any="symver_asm_label symver_gnu_asm" -log2_deps="!msvcrt" +# threading support +atomics_gcc_if="sync_val_compare_and_swap" +atomics_suncc_if="atomic_cas_ptr machine_rw_barrier" +atomics_win32_if="MemoryBarrier" +atomics_native_if_any="$ATOMICS_LIST" +threads_if_any="$THREADS_LIST" # subsystems dct_select="rdft" error_resilience_select="dsputil" frame_thread_encoder_deps="encoders threads" +lpc_select="dsputil" mdct_select="fft" rdft_select="fft" mpegaudio_select="mpegaudiodsp" mpegaudiodsp_select="dct" -mpegvideo_select="dsputil error_resilience h264chroma hpeldsp videodsp" +mpegvideo_select="dsputil h264chroma hpeldsp videodsp" mpegvideoenc_select="mpegvideo" # decoders / encoders @@ -1687,19 +1851,25 @@ aac_latm_decoder_select="aac_decoder aac_latm_parser" ac3_decoder_select="mdct ac3dsp ac3_parser dsputil" ac3_encoder_select="mdct ac3dsp dsputil" ac3_fixed_encoder_select="mdct ac3dsp dsputil" +aic_decoder_select="dsputil golomb" alac_encoder_select="lpc" als_decoder_select="dsputil" amrnb_decoder_select="lsp" amrwb_decoder_select="lsp" +amv_decoder_select="dsputil hpeldsp exif" amv_encoder_select="aandcttables" ape_decoder_select="dsputil" -asv_decoder_select="dsputil" +asv1_decoder_select="dsputil" +asv1_encoder_select="dsputil" +asv2_decoder_select="dsputil" +asv2_encoder_select="dsputil" atrac1_decoder_select="mdct sinewin" atrac3_decoder_select="mdct" +avrn_decoder_select="exif" bink_decoder_select="dsputil hpeldsp" binkaudio_dct_decoder_select="mdct rdft dct sinewin" binkaudio_rdft_decoder_select="mdct rdft sinewin" -cavs_decoder_select="dsputil golomb h264chroma mpegvideo videodsp" +cavs_decoder_select="dsputil golomb h264chroma videodsp" cllc_decoder_select="dsputil" comfortnoise_encoder_select="lpc" cook_decoder_select="dsputil mdct sinewin" @@ -1709,17 +1879,19 @@ dca_decoder_select="mdct" dirac_decoder_select="dsputil dwt golomb videodsp" dnxhd_decoder_select="dsputil" dnxhd_encoder_select="aandcttables dsputil mpegvideoenc" -dv_decoder_select="dsputil" +dvvideo_decoder_select="dsputil" +dvvideo_encoder_select="dsputil" dxa_decoder_select="zlib" eac3_decoder_select="ac3_decoder" eac3_encoder_select="ac3_encoder" eamad_decoder_select="aandcttables dsputil mpegvideo" eatgq_decoder_select="aandcttables" -eatqi_decoder_select="aandcttables mpegvideo" +eatqi_decoder_select="aandcttables error_resilience mpegvideo" exr_decoder_select="zlib" ffv1_decoder_select="dsputil golomb rangecoder" -ffv1_encoder_select="rangecoder" -ffvhuff_encoder_select="huffman" +ffv1_encoder_select="dsputil rangecoder" +ffvhuff_decoder_select="dsputil" +ffvhuff_encoder_select="dsputil huffman" flac_decoder_select="golomb" flac_encoder_select="dsputil golomb lpc" flashsv_decoder_select="zlib" @@ -1730,29 +1902,34 @@ flv_decoder_select="h263_decoder" flv_encoder_select="h263_encoder" fourxm_decoder_select="dsputil" fraps_decoder_select="dsputil huffman" +g2m_decoder_select="dsputil zlib" g729_decoder_select="dsputil" h261_decoder_select="error_resilience mpegvideo" h261_encoder_select="aandcttables mpegvideoenc" -h263_decoder_select="error_resilience h263_parser mpegvideo" -h263_encoder_select="aandcttables mpegvideoenc" +h263_decoder_select="error_resilience h263_parser h263dsp mpegvideo" +h263_encoder_select="aandcttables h263dsp mpegvideoenc" h263i_decoder_select="h263_decoder" h263p_encoder_select="h263_encoder" h264_decoder_select="golomb h264chroma h264dsp h264pred h264qpel videodsp" +h264_decoder_suggest="error_resilience" +hevc_decoder_select="dsputil golomb videodsp" huffyuv_decoder_select="dsputil" -huffyuv_encoder_select="huffman" -iac_decoder_select="fft mdct sinewin" +huffyuv_encoder_select="dsputil huffman" +iac_decoder_select="dsputil fft mdct sinewin" imc_decoder_select="dsputil fft mdct sinewin" indeo3_decoder_select="hpeldsp" interplay_video_decoder_select="hpeldsp" -jpegls_decoder_select="golomb" +jpegls_decoder_select="dsputil golomb hpeldsp exif" jpegls_encoder_select="golomb" jv_decoder_select="dsputil" lagarith_decoder_select="dsputil" ljpeg_encoder_select="aandcttables mpegvideoenc" loco_decoder_select="golomb" mdec_decoder_select="dsputil error_resilience mpegvideo" +metasound_decoder_select="lsp mdct sinewin" mimic_decoder_select="dsputil hpeldsp" -mjpeg_decoder_select="dsputil hpeldsp" +mjpeg_decoder_select="dsputil hpeldsp exif" +mjpegb_decoder_select="dsputil hpeldsp exif" mjpeg_encoder_select="aandcttables dsputil mpegvideoenc" mlp_decoder_select="dsputil mlp_parser" motionpixels_decoder_select="dsputil" @@ -1769,7 +1946,7 @@ mp3on4float_decoder_select="mpegaudio" mpc7_decoder_select="dsputil mpegaudiodsp" mpc8_decoder_select="dsputil mpegaudiodsp" mpeg_xvmc_decoder_deps="X11_extensions_XvMClib_h" -mpeg_xvmc_decoder_select="mpegvideo_decoder" +mpeg_xvmc_decoder_select="mpeg2video_decoder" mpeg1video_decoder_select="error_resilience mpegvideo" mpeg1video_encoder_select="aandcttables mpegvideoenc" mpeg2video_decoder_select="error_resilience mpegvideo" @@ -1777,50 +1954,54 @@ mpeg2video_encoder_select="aandcttables mpegvideoenc" mpeg4_decoder_select="h263_decoder mpeg4video_parser" mpeg4_encoder_select="h263_encoder" msmpeg4v1_decoder_select="h263_decoder" -msmpeg4v1_encoder_select="h263_encoder" msmpeg4v2_decoder_select="h263_decoder" msmpeg4v2_encoder_select="h263_encoder" msmpeg4v3_decoder_select="h263_decoder" msmpeg4v3_encoder_select="h263_encoder" mss2_decoder_select="error_resilience vc1_decoder" +mxpeg_decoder_select="dsputil hpeldsp exif" nellymoser_decoder_select="mdct sinewin" nellymoser_encoder_select="audio_frame_queue mdct sinewin" nuv_decoder_select="dsputil lzo" png_decoder_select="zlib" png_encoder_select="dsputil zlib" prores_decoder_select="dsputil" +prores_encoder_select="dsputil" qcelp_decoder_select="lsp" qdm2_decoder_select="mdct rdft mpegaudiodsp" ra_144_encoder_select="audio_frame_queue lpc" ralf_decoder_select="golomb" rtjpeg_decoder_select="dsputil" -rv10_decoder_select="error_resilience h263_decoder" +rv10_decoder_select="error_resilience h263_decoder h263dsp" rv10_encoder_select="h263_encoder" -rv20_decoder_select="error_resilience h263_decoder" +rv20_decoder_select="error_resilience h263_decoder h263dsp" rv20_encoder_select="h263_encoder" rv30_decoder_select="error_resilience golomb h264chroma h264pred h264qpel mpegvideo videodsp" rv40_decoder_select="error_resilience golomb h264chroma h264pred h264qpel mpegvideo videodsp" shorten_decoder_select="golomb" sipr_decoder_select="lsp" snow_decoder_select="dsputil dwt h264qpel hpeldsp rangecoder" -snow_encoder_select="aandcttables dsputil dwt h264qpel hpeldsp error_resilience mpegvideoenc rangecoder" +snow_encoder_select="aandcttables dsputil dwt h264qpel hpeldsp mpegvideoenc rangecoder" sonic_decoder_select="golomb" sonic_encoder_select="golomb" sonic_ls_encoder_select="golomb" +sp5x_decoder_select="dsputil hpeldsp exif" svq1_decoder_select="hpeldsp" svq1_encoder_select="aandcttables dsputil hpeldsp mpegvideoenc" -svq3_decoder_select="dsputil error_resilience golomb h264chroma h264dsp h264pred h264qpel mpegvideo videodsp" -svq3_decoder_suggest="zlib" +svq3_decoder_select="golomb h264chroma h264dsp h264pred h264qpel hpeldsp mpegvideo videodsp" +svq3_decoder_suggest="error_resilience zlib" tak_decoder_select="dsputil" theora_decoder_select="vp3_decoder" tiff_decoder_suggest="zlib" tiff_encoder_suggest="zlib" +thp_decoder_select="dsputil hpeldsp exif" truehd_decoder_select="mlp_parser" truemotion2_decoder_select="dsputil" +truespeech_decoder_select="dsputil" tscc_decoder_select="zlib" twinvq_decoder_select="mdct lsp sinewin" utvideo_decoder_select="dsputil" -utvideo_encoder_select="huffman" +utvideo_encoder_select="dsputil huffman" vble_decoder_select="dsputil" vc1_decoder_select="error_resilience h263_decoder h264chroma h264qpel" vc1image_decoder_select="vc1_decoder" @@ -1832,6 +2013,8 @@ vp6_decoder_select="h264chroma hpeldsp huffman videodsp vp3dsp" vp6a_decoder_select="vp6_decoder" vp6f_decoder_select="vp6_decoder" vp8_decoder_select="h264pred videodsp" +vp9_decoder_select="videodsp" +webp_decoder_select="vp8_decoder" wmapro_decoder_select="mdct sinewin" wmav1_decoder_select="mdct sinewin" wmav1_encoder_select="mdct sinewin" @@ -1857,6 +2040,7 @@ vaapi_deps="va_va_h" vda_deps="VideoDecodeAcceleration_VDADecoder_h pthreads" vda_extralibs="-framework CoreFoundation -framework VideoDecodeAcceleration -framework QuartzCore" vdpau_deps="vdpau_vdpau_h vdpau_vdpau_x11_h" +xvmc_deps="X11_extensions_XvMClib_h" h263_vaapi_hwaccel_deps="vaapi" h263_vaapi_hwaccel_select="h263_decoder" @@ -1876,11 +2060,15 @@ h264_vdpau_decoder_select="h264_decoder" h264_vdpau_hwaccel_deps="vdpau" h264_vdpau_hwaccel_select="h264_decoder" mpeg_vdpau_decoder_deps="vdpau" -mpeg_vdpau_decoder_select="mpegvideo_decoder" +mpeg_vdpau_decoder_select="mpeg2video_decoder" +mpeg_xvmc_hwaccel_deps="xvmc" +mpeg_xvmc_hwaccel_select="mpeg2video_decoder" mpeg1_vdpau_decoder_deps="vdpau" mpeg1_vdpau_decoder_select="mpeg1video_decoder" mpeg1_vdpau_hwaccel_deps="vdpau" mpeg1_vdpau_hwaccel_select="mpeg1video_decoder" +mpeg1_xvmc_hwaccel_deps="xvmc" +mpeg1_xvmc_hwaccel_select="mpeg1video_decoder" mpeg2_crystalhd_decoder_select="crystalhd" mpeg2_dxva2_hwaccel_deps="dxva2" mpeg2_dxva2_hwaccel_select="mpeg2video_decoder" @@ -1888,6 +2076,8 @@ mpeg2_vaapi_hwaccel_deps="vaapi" mpeg2_vaapi_hwaccel_select="mpeg2video_decoder" mpeg2_vdpau_hwaccel_deps="vdpau" mpeg2_vdpau_hwaccel_select="mpeg2video_decoder" +mpeg2_xvmc_hwaccel_deps="xvmc" +mpeg2_xvmc_hwaccel_select="mpeg2video_decoder" mpeg4_crystalhd_decoder_select="crystalhd" mpeg4_vaapi_hwaccel_deps="vaapi" mpeg4_vaapi_hwaccel_select="mpeg4_decoder" @@ -1913,6 +2103,7 @@ wmv3_vdpau_hwaccel_select="vc1_vdpau_hwaccel" # parsers h264_parser_select="golomb h264chroma h264dsp h264pred h264qpel videodsp" +hevc_parser_select="hevc_decoder" mpeg4video_parser_select="error_resilience mpegvideo" mpegvideo_parser_select="error_resilience mpegvideo" vc1_parser_select="mpegvideo" @@ -1922,8 +2113,10 @@ libaacplus_encoder_deps="libaacplus" libcelt_decoder_deps="libcelt" libfaac_encoder_deps="libfaac" libfaac_encoder_select="audio_frame_queue" +libfdk_aac_decoder_deps="libfdk_aac" libfdk_aac_encoder_deps="libfdk_aac" libfdk_aac_encoder_select="audio_frame_queue" +libgme_demuxer_deps="libgme" libgsm_decoder_deps="libgsm" libgsm_encoder_deps="libgsm" libgsm_ms_decoder_deps="libgsm" @@ -1942,8 +2135,11 @@ libopenjpeg_encoder_deps="libopenjpeg" libopus_decoder_deps="libopus" libopus_encoder_deps="libopus" libopus_encoder_select="audio_frame_queue" +libquvi_demuxer_deps="libquvi" libschroedinger_decoder_deps="libschroedinger" libschroedinger_encoder_deps="libschroedinger" +libshine_encoder_deps="libshine" +libshine_encoder_select="audio_frame_queue" libspeex_decoder_deps="libspeex" libspeex_encoder_deps="libspeex" libspeex_encoder_select="audio_frame_queue" @@ -1960,40 +2156,57 @@ libvpx_vp8_decoder_deps="libvpx" libvpx_vp8_encoder_deps="libvpx" libvpx_vp9_decoder_deps="libvpx" libvpx_vp9_encoder_deps="libvpx" +libwavpack_encoder_deps="libwavpack" +libwebp_encoder_deps="libwebp" libx264_encoder_deps="libx264" libx264rgb_encoder_deps="libx264" libxavs_encoder_deps="libxavs" libxvid_encoder_deps="libxvid" libutvideo_decoder_deps="libutvideo" libutvideo_encoder_deps="libutvideo" +libzvbi_teletext_decoder_deps="libzvbi" # demuxers / muxers ac3_demuxer_select="ac3_parser" +asf_demuxer_select="riffdec" +asf_muxer_select="riffenc" asf_stream_muxer_select="asf_muxer" +avi_demuxer_select="riffdec" +avi_muxer_select="riffenc" avisynth_demuxer_deps="avisynth" +avisynth_demuxer_select="riffdec" +caf_demuxer_select="riffdec" dirac_demuxer_select="dirac_parser" dts_demuxer_select="dca_parser" dtshd_demuxer_select="dca_parser" +dxa_demuxer_select="riffdec" eac3_demuxer_select="ac3_parser" f4v_muxer_select="mov_muxer" flac_demuxer_select="flac_parser" +hds_muxer_select="flv_muxer" +hls_muxer_select="mpegts_muxer" ipod_muxer_select="mov_muxer" ismv_muxer_select="mov_muxer" libnut_demuxer_deps="libnut" libnut_muxer_deps="libnut" matroska_audio_muxer_select="matroska_muxer" +matroska_demuxer_select="riffdec" matroska_demuxer_suggest="bzlib lzo zlib" +matroska_muxer_select="riffenc" +mmf_muxer_select="riffenc" +mov_demuxer_select="riffdec" mov_demuxer_suggest="zlib" -mov_muxer_select="rtpenc_chain" +mov_muxer_select="riffenc rtpenc_chain" mp3_demuxer_select="mpegaudio_parser" mp4_muxer_select="mov_muxer" -mpegts_muxer_select="adts_muxer latm_muxer mpegvideo" +mpegts_muxer_select="adts_muxer latm_muxer" mpegtsraw_demuxer_select="mpegts_demuxer" mxf_d10_muxer_select="mxf_muxer" +nut_muxer_select="riffenc" +nuv_demuxer_select="riffdec" ogg_demuxer_select="golomb" psp_muxer_select="mov_muxer" rtp_demuxer_select="sdp_demuxer" -rtp_muxer_select="mpegvideo" rtpdec_select="asf_demuxer rm_demuxer rtp_protocol mpegts_demuxer mov_demuxer" rtsp_demuxer_select="http_protocol rtpdec" rtsp_muxer_select="rtp_muxer http_protocol rtp_protocol rtpenc_chain" @@ -2006,8 +2219,14 @@ tak_demuxer_select="tak_parser" tg2_muxer_select="mov_muxer" tgp_muxer_select="mov_muxer" vobsub_demuxer_select="mpegps_demuxer" -w64_demuxer_deps="wav_demuxer" -w64_muxer_deps="wav_muxer" +w64_demuxer_select="wav_demuxer" +w64_muxer_select="wav_muxer" +wav_demuxer_select="riffdec" +wav_muxer_select="riffenc" +webm_muxer_select="riffenc" +wtv_demuxer_select="riffdec" +xmv_demuxer_select="riffdec" +xwma_demuxer_select="riffdec" # indevs / outdevs alsa_indev_deps="alsa_asoundlib_h snd_pcm_htimestamp" @@ -2016,8 +2235,10 @@ bktr_indev_deps_any="dev_bktr_ioctl_bt848_h machine_ioctl_bt848_h dev_video_bktr caca_outdev_deps="libcaca" dshow_indev_deps="IBaseFilter" dshow_indev_extralibs="-lpsapi -lole32 -lstrmiids -luuid" -dv1394_indev_deps="dv1394 dv_demuxer" +dv1394_indev_deps="dv1394" +dv1394_indev_select="dv_demuxer" fbdev_indev_deps="linux_fb_h" +fbdev_outdev_deps="linux_fb_h" iec61883_indev_deps="libiec61883" jack_indev_deps="jack_jack_h sem_timedwait" lavfi_indev_deps="avfilter" @@ -2028,13 +2249,17 @@ openal_indev_deps="openal" oss_indev_deps_any="soundcard_h sys_soundcard_h" oss_outdev_deps_any="soundcard_h sys_soundcard_h" pulse_indev_deps="libpulse" +pulse_outdev_deps="libpulse" sdl_outdev_deps="sdl" sndio_indev_deps="sndio_h" sndio_outdev_deps="sndio_h" v4l_indev_deps="linux_videodev_h" v4l2_indev_deps_any="linux_videodev2_h sys_videoio_h" +v4l2_outdev_deps_any="linux_videodev2_h sys_videoio_h" vfwcap_indev_deps="capCreateCaptureWindow vfwcap_defines" vfwcap_indev_extralibs="-lavicap32" +xv_outdev_deps="X11_extensions_Xvlib_h XvGetPortAttribute" +xv_outdev_extralibs="-lXv -lX11 -lXext" x11grab_indev_deps="x11grab" # protocols @@ -2044,6 +2269,7 @@ ffrtmpcrypt_protocol_deps_any="gcrypt nettle openssl" ffrtmpcrypt_protocol_select="tcp_protocol" ffrtmphttp_protocol_deps="!librtmp_protocol" ffrtmphttp_protocol_select="http_protocol" +ftp_protocol_select="tcp_protocol" gopher_protocol_select="network" httpproxy_protocol_select="tcp_protocol" http_protocol_select="tcp_protocol" @@ -2053,6 +2279,7 @@ librtmpe_protocol_deps="librtmp" librtmps_protocol_deps="librtmp" librtmpt_protocol_deps="librtmp" librtmpte_protocol_deps="librtmp" +libssh_protocol_deps="libssh" mmsh_protocol_select="http_protocol" mmst_protocol_select="network" rtmp_protocol_deps="!librtmp_protocol" @@ -2071,6 +2298,8 @@ tcp_protocol_select="network" tls_protocol_deps_any="openssl gnutls" tls_protocol_select="tcp_protocol" udp_protocol_select="network" +unix_protocol_deps="sys_un_h" +unix_protocol_select="network" # filters aconvert_filter_deps="swresample" @@ -2078,14 +2307,18 @@ amovie_filter_deps="avcodec avformat" aresample_filter_deps="swresample" ass_filter_deps="libass" asyncts_filter_deps="avresample" -atempo_filter_deps="avcodec rdft" +atempo_filter_deps="avcodec" +atempo_filter_select="rdft" +azmq_filter_deps="libzmq" blackframe_filter_deps="gpl" boxblur_filter_deps="gpl" colormatrix_filter_deps="gpl" cropdetect_filter_deps="gpl" -decimate_filter_deps="gpl avcodec" +dctdnoiz_filter_deps="avcodec" +dctdnoiz_filter_select="fft" delogo_filter_deps="gpl" deshake_filter_deps="avcodec" +deshake_filter_select="dsputil" drawtext_filter_deps="libfreetype" ebur128_filter_deps="gpl" flite_filter_deps="libflite" @@ -2096,29 +2329,53 @@ frei0r_src_filter_extralibs='$ldl' geq_filter_deps="gpl" histeq_filter_deps="gpl" hqdn3d_filter_deps="gpl" -hue_filter_deps="gpl" +interlace_filter_deps="gpl" kerndeint_filter_deps="gpl" +ladspa_filter_deps="ladspa dlopen" +mcdeint_filter_deps="avcodec gpl" movie_filter_deps="avcodec avformat" mp_filter_deps="gpl avcodec swscale inline_asm" +mpdecimate_filter_deps="gpl avcodec" mptestsrc_filter_deps="gpl" negate_filter_deps="lut_filter" -noise_filter_deps="gpl" +perspective_filter_deps="gpl" resample_filter_deps="avresample" ocv_filter_deps="libopencv" +owdenoise_filter_deps="gpl" pan_filter_deps="swresample" +phase_filter_deps="gpl" pp_filter_deps="gpl postproc" +pullup_filter_deps="gpl" removelogo_filter_deps="avcodec avformat swscale" +sab_filter_deps="gpl swscale" scale_filter_deps="swscale" smartblur_filter_deps="gpl swscale" -showspectrum_filter_deps="avcodec rdft" +showspectrum_filter_deps="avcodec" +showspectrum_filter_select="rdft" +spp_filter_deps="gpl avcodec" +spp_filter_select="fft" stereo3d_filter_deps="gpl" subtitles_filter_deps="avformat avcodec libass" super2xsai_filter_deps="gpl" tinterlace_filter_deps="gpl" +vidstabdetect_filter_deps="libvidstab" +vidstabtransform_filter_deps="libvidstab" yadif_filter_deps="gpl" pixfmts_super2xsai_test_deps="super2xsai_filter" tinterlace_merge_test_deps="tinterlace_filter" tinterlace_pad_test_deps="tinterlace_filter" +zmq_filter_deps="libzmq" + +# examples +decoding_encoding_example_deps="avcodec avutil" +demuxing_decoding_example_deps="avcodec avformat avutil" +filtering_audio_example_deps="avfilter avcodec avformat avutil" +filtering_video_example_deps="avfilter avcodec avformat avutil" +metadata_example_deps="avformat avutil" +muxing_example_deps="avcodec avformat avutil swscale" +resampling_audio_example_deps="avutil swresample" +scaling_video_example_deps="avutil swscale" +transcode_aac_example_deps="avcodec avformat swresample" # libraries avcodec_deps="avutil" @@ -2130,20 +2387,22 @@ postproc_deps="avutil gpl" swscale_deps="avutil" # programs -ffmpeg_deps="avcodec avfilter avformat swscale swresample" -ffmpeg_select="format_filter aformat_filter - setpts_filter null_filter anull_filter" +ffmpeg_deps="avcodec avfilter avformat swresample" +ffmpeg_select="aformat_filter anull_filter atrim_filter format_filter + null_filter + setpts_filter trim_filter" ffplay_deps="avcodec avformat swscale swresample sdl" ffplay_select="rdft crop_filter" ffprobe_deps="avcodec avformat" -ffserver_deps="avformat ffm_muxer fork rtp_protocol rtsp_demuxer" +ffserver_deps="avformat fork sarestart" +ffserver_select="ffm_muxer rtp_protocol rtsp_demuxer" ffserver_extralibs='$ldl' # documentation podpages_deps="perl" manpages_deps="perl pod2man" -htmlpages_deps="texi2html" -txtpages_deps="makeinfo" +htmlpages_deps="perl texi2html" +txtpages_deps="perl makeinfo" doc_deps_any="manpages htmlpages podpages txtpages" # default parameters @@ -2154,6 +2413,7 @@ logfile="config.log" prefix_default="/usr/local" bindir_default='${prefix}/bin' datadir_default='${prefix}/share/ffmpeg' +docdir_default='${prefix}/share/doc/ffmpeg' incdir_default='${prefix}/include' libdir_default='${prefix}/lib' mandir_default='${prefix}/share/man' @@ -2173,6 +2433,7 @@ pkg_config_default=pkg-config ranlib="ranlib" strip_default="strip" yasmexe_default="yasm" +windres_default="windres" nogas=":" @@ -2187,6 +2448,7 @@ host_os=$target_os_default # configurable options enable $PROGRAM_LIST enable $DOCUMENT_LIST +enable $EXAMPLE_LIST enable $(filter_out avresample $LIBRARY_LIST) enable stripping @@ -2199,9 +2461,11 @@ enable safe_bitstream_reader enable static enable swscale_alpha +# Enable hwaccels by default. +enable dxva2 vaapi vdpau xvmc + # build settings SHFLAGS='-shared -Wl,-soname,$$(@F)' -FFSERVERLDFLAGS=-Wl,-E LIBPREF="lib" LIBSUF=".a" FULLNAME='$(NAME)$(BUILDSUF)' @@ -2230,11 +2494,12 @@ LD_O='-o $@' LD_LIB='-l%' LD_PATH='-L' HOSTCC_C='-c' +HOSTCC_E='-E -o $@' HOSTCC_O='-o $@' HOSTLD_O='-o $@' -host_cflags='-O3 -g' -host_cppflags='-D_ISOC99_SOURCE -D_XOPEN_SOURCE=600' +host_cflags='-O3' +host_cppflags='-D_ISOC99_SOURCE' host_libs='-lm' host_cflags_filter=echo host_ldflags_filter=echo @@ -2440,33 +2705,86 @@ nm_default="${cross_prefix}${nm_default}" pkg_config_default="${cross_prefix}${pkg_config_default}" ranlib="${cross_prefix}${ranlib}" strip_default="${cross_prefix}${strip_default}" +windres_default="${cross_prefix}${windres_default}" sysinclude_default="${sysroot}/usr/include" +test -n "$valgrind" && toolchain="valgrind-memcheck" + case "$toolchain" in clang-asan) cc_default="clang" - add_cflags -faddress-sanitizer - add_ldflags -faddress-sanitizer + add_cflags -fsanitize=address + add_ldflags -fsanitize=address ;; clang-tsan) cc_default="clang" - add_cflags -fthread-sanitizer - add_ldflags -fthread-sanitizer + add_cflags -fsanitize=thread -pie + add_ldflags -fsanitize=thread -pie + ;; + gcc-asan) + cc_default="gcc" + add_cflags -fsanitize=address + add_ldflags -fsanitize=address + ;; + gcc-tsan) + cc_default="gcc" + add_cflags -fsanitize=thread -pie -fPIC + add_ldflags -fsanitize=thread -pie -fPIC + ;; + valgrind-massif) + target_exec_default=${valgrind:-"valgrind"} + target_exec_args="--tool=massif --alloc-fn=av_malloc --alloc-fn=av_mallocz --alloc-fn=av_calloc --alloc-fn=av_fast_padded_malloc --alloc-fn=av_fast_malloc --alloc-fn=av_realloc_f --alloc-fn=av_fast_realloc --alloc-fn=av_realloc" + ;; + valgrind-memcheck) + target_exec_default=${valgrind:-"valgrind"} + target_exec_args="--error-exitcode=1 --malloc-fill=0x2a --track-origins=yes --leak-check=full --gen-suppressions=all --suppressions=$source_path/tests/fate-valgrind.supp" ;; msvc) - cc_default="c99wrap cl" - ld_default="c99wrap link" + # Check whether the current MSVC version needs the C99 converter. + # From MSVC 2013 (compiler major version 18) onwards, it does actually + # support enough of C99 to build ffmpeg. Default to the new + # behaviour if the regexp was unable to match anything, since this + # successfully parses the version number of existing supported + # versions that require the converter (MSVC 2010 and 2012). + cl_major_ver=$(cl 2>&1 | sed -n 's/.*Version \([[:digit:]]\{1,\}\)\..*/\1/p') + if [ -z "$cl_major_ver" ] || [ $cl_major_ver -ge 18 ]; then + cc_default="cl" + else + cc_default="c99wrap cl" + fi + ld_default="link" nm_default="dumpbin -symbols" ar_default="lib" target_os_default="win32" + # Use a relative path for TMPDIR. This makes sure all the + # ffconf temp files are written with a relative path, avoiding + # issues with msys/win32 path conversion for MSVC parameters + # such as -Fo<file> or -out:<file>. + TMPDIR=. + ;; + icl) + cc_default="icl" + ld_default="xilink" + nm_default="dumpbin -symbols" + ar_default="xilib" + target_os_default="win32" + TMPDIR=. + ;; + gcov) + add_cflags -fprofile-arcs -ftest-coverage + add_ldflags -fprofile-arcs -ftest-coverage + ;; + hardened) + add_cflags -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -fno-strict-overflow -fstack-protector-all + add_ldflags -Wl,-z,relro -Wl,-z,now ;; ?*) die "Unknown toolchain $toolchain" ;; esac -set_default arch cc cxx pkg_config strip sysinclude target_os yasmexe +set_default arch cc cxx pkg_config strip sysinclude target_exec target_os yasmexe enabled cross_compile || host_cc_default=$cc set_default host_cc @@ -2489,7 +2807,11 @@ HOSTEXESUF=$(exesuf $host_os) : ${TMPDIR:=$TMP} : ${TMPDIR:=/tmp} -if ! check_cmd mktemp -u XXXXXX; then +if [ -n "$tempprefix" ] ; then + mktemp(){ + echo $tempprefix.${HOSTNAME}.${UID} + } +elif ! check_cmd mktemp -u XXXXXX; then # simple replacement for missing mktemp # NOT SAFE FOR GENERAL USE mktemp(){ @@ -2552,21 +2874,35 @@ ccc_flags(){ done } -msvc_flags(){ +cparser_flags(){ for flag; do case $flag in - -fomit-frame-pointer) echo -Oy ;; - -g) echo -Z7 ;; - -Wall) echo -W4 -wd4244 -wd4127 -wd4018 -wd4389 \ - -wd4146 -wd4057 -wd4204 -wd4706 -wd4305 \ - -wd4152 -wd4324 -we4013 -wd4100 -wd4214 \ - -wd4554 \ - -wd4996 -wd4273 ;; + -Wno-switch) echo -Wno-switch-enum ;; + -Wno-format-zero-length) ;; + -Wdisabled-optimization) ;; + -Wno-pointer-sign) echo -Wno-other ;; + *) echo $flag ;; + esac + done +} + +msvc_common_flags(){ + for flag; do + case $flag in + # In addition to specifying certain flags under the compiler + # specific filters, they must be specified here as well or else the + # generic catch all at the bottom will print the original flag. + -Wall) ;; -std=c99) ;; + # Common flags + -fomit-frame-pointer) ;; + -g) echo -Z7 ;; -fno-math-errno) ;; -fno-common) ;; -fno-signed-zeros) ;; -fPIC) ;; + -mthumb) ;; + -march=*) ;; -lz) echo zlib.lib ;; -lavifil32) echo vfw32.lib ;; -lavicap32) echo vfw32.lib user32.lib ;; @@ -2576,6 +2912,31 @@ msvc_flags(){ done } +msvc_flags(){ + msvc_common_flags "$@" + for flag; do + case $flag in + -Wall) echo -W4 -wd4244 -wd4127 -wd4018 -wd4389 \ + -wd4146 -wd4057 -wd4204 -wd4706 -wd4305 \ + -wd4152 -wd4324 -we4013 -wd4100 -wd4214 \ + -wd4554 \ + -wd4273 ;; + esac + done +} + +icl_flags(){ + msvc_common_flags "$@" + for flag; do + case $flag in + # Despite what Intel's documentation says -Wall, which is supported + # on Windows, does enable remarks so disable them here. + -Wall) echo $flag -Qdiag-disable:remark ;; + -std=c99) echo -Qstd=c99 ;; + esac + done +} + pgi_flags(){ for flag; do case $flag in @@ -2606,12 +2967,12 @@ suncc_flags(){ core2) echo -xarch=ssse3 -xchip=core2 ;; corei7) echo -xarch=sse4_2 -xchip=nehalem ;; corei7-avx) echo -xarch=avx -xchip=sandybridge ;; - amdfam10|barcelona) echo -xtarget=barcelona ;; - bdver*) echo -xarch=avx ;; - athlon-4|athlon-[mx]p) echo -xarch=ssea ;; + amdfam10|barcelona) echo -xtarget=barcelona ;; + bdver*) echo -xarch=avx ;; + athlon-4|athlon-[mx]p) echo -xarch=ssea ;; k8|opteron|athlon64|athlon-fx) - echo -xarch=sse2a ;; - athlon*) echo -xarch=pentium_proa ;; + echo -xarch=sse2a ;; + athlon*) echo -xarch=pentium_proa ;; esac ;; -std=c99) echo -xc99 ;; @@ -2663,7 +3024,9 @@ probe_cc(){ unset _depflags _DEPCMD _DEPFLAGS _flags_filter=echo - if $_cc -v 2>&1 | grep -q '^gcc.*LLVM'; then + if $_cc --version 2>&1 | grep -q '^GNU assembler'; then + true # no-op to avoid reading stdin in following checks + elif $_cc -v 2>&1 | grep -q '^gcc.*LLVM'; then _type=llvm_gcc gcc_extra_ver=$(expr "$($_cc --version | head -n1)" : '.*\((.*)\)') _ident="llvm-gcc $($_cc -dumpversion) $gcc_extra_ver" @@ -2762,7 +3125,7 @@ probe_cc(){ opt_common='-alias=ansi -Mdse -Mlre -Mpre' _cflags_speed="-O3 -Mautoinline -Munroll=c:4 $opt_common" _cflags_size="-O2 -Munroll=c:1 $opt_common" - _cflags_noopt="-O1" + _cflags_noopt="-O" _flags_filter=pgi_flags elif $_cc 2>&1 | grep -q Microsoft; then _type=msvc @@ -2771,23 +3134,55 @@ probe_cc(){ _DEPFLAGS='$(CPPFLAGS) $(CFLAGS) -showIncludes -Zs' _cflags_speed="-O2" _cflags_size="-O1" - # Nonstandard output options, to avoid msys path conversion issues, relies on wrapper to remap it if $_cc 2>&1 | grep -q Linker; then - _ld_o='-out $@' + _ld_o='-out:$@' else _ld_o='-Fe$@' fi - _cc_o='-Fo $@' - _cc_e='-P -Fi $@' + _cc_o='-Fo$@' + _cc_e='-P -Fi$@' _flags_filter=msvc_flags _ld_lib='lib%.a' _ld_path='-libpath:' _flags='-nologo' - _cflags='-D_USE_MATH_DEFINES -Dinline=__inline -FIstdlib.h -Dstrtoll=_strtoi64' + _cflags='-D_USE_MATH_DEFINES -D_CRT_SECURE_NO_WARNINGS -Dinline=__inline -FIstdlib.h -Dstrtoll=_strtoi64' if [ $pfx = hostcc ]; then append _cflags -Dsnprintf=_snprintf fi disable stripping + elif $_cc 2>&1 | grep -q Intel; then + _type=icl + _ident=$($cc 2>&1 | head -n1) + _depflags='-QMMD -QMF$(@:.o=.d) -QMT$@' + # Not only is O3 broken on 13.x+ but it is slower on all previous + # versions (tested) as well. + _cflags_speed="-O2" + _cflags_size="-O1 -Oi" # -O1 without -Oi miscompiles stuff + if $_cc 2>&1 | grep -q Linker; then + _ld_o='-out:$@' + else + _ld_o='-Fe$@' + fi + _cc_o='-Fo$@' + _cc_e='-P' + _flags_filter=icl_flags + _ld_lib='lib%.a' + _ld_path='-libpath:' + # -Qdiag-error to make icl error when seeing certain unknown arguments + _flags='-nologo -Qdiag-error:4044,10157' + # -Qvec- -Qsimd- to prevent miscompilation, -GS for consistency + # with MSVC which enables it by default. + _cflags='-D_USE_MATH_DEFINES -FIstdlib.h -Dstrtoll=_strtoi64 -Qms0 -Qvec- -Qsimd- -GS' + if [ $pfx = hostcc ]; then + append _cflags -Dsnprintf=_snprintf + fi + elif $_cc --version 2>/dev/null | grep -q ^cparser; then + _type=cparser + _ident=$($_cc --version | head -n1) + _depflags='-MMD' + _cflags_speed='-O4' + _cflags_size='-O2' + _flags_filter=cparser_flags fi eval ${pfx}_type=\$_type @@ -2829,7 +3224,7 @@ test -n "$cc_type" && enable $cc_type || : ${dep_cc_default:=$cc} : ${ld_default:=$cc} : ${host_ld_default:=$host_cc} -set_default ar as dep_cc ld host_ld +set_default ar as dep_cc ld host_ld windres probe_cc as "$as" asflags_filter=$_flags_filter @@ -2862,6 +3257,9 @@ if $ar 2>&1 | grep -q Microsoft; then elif $ar 2>&1 | grep -q 'Texas Instruments'; then arflags="rq" ar_o='$@' +elif $ar 2>&1 | grep -q 'Usage: ar.*-X.*any'; then + arflags='-Xany -r -c' + ar_o='$@' else arflags="rc" ar_o='$@' @@ -2885,7 +3283,8 @@ if test -n "$sysroot"; then fi if test "$cpu" = host; then - enabled cross_compile && die "--cpu=host makes no sense when cross-compiling." + enabled cross_compile && + die "--cpu=host makes no sense when cross-compiling." case "$cc_type" in gcc|llvm_gcc) @@ -2901,7 +3300,8 @@ if test "$cpu" = host; then ;; esac - test "${cpu:-host}" = host && die "--cpu=host not supported with compiler $cc" + test "${cpu:-host}" = host && + die "--cpu=host not supported with compiler $cc" fi # Deal with common $arch aliases @@ -2909,7 +3309,7 @@ case "$arch" in aarch64|arm64) arch="aarch64" ;; - arm*|iPad*) + arm*|iPad*|iPhone*) arch="arm" ;; mips*|IP*) @@ -3133,21 +3533,21 @@ elif enabled x86; then cpuflags="-march=$cpu" disable mmx ;; - # targets that do NOT support conditional mov (cmov) + # targets that do NOT support nopl and conditional mov (cmov) pentium-mmx|k6|k6-[23]|winchip-c6|winchip2|c3) cpuflags="-march=$cpu" - disable cmov + disable i686 ;; - # targets that do support conditional mov (cmov) + # targets that do support nopl and conditional mov (cmov) i686|pentiumpro|pentium[23]|pentium-m|athlon|athlon-tbird|athlon-4|athlon-[mx]p|athlon64*|k8*|opteron*|athlon-fx|core2|corei7*|amdfam10|barcelona|atom|bdver*) cpuflags="-march=$cpu" - enable cmov + enable i686 enable fast_cmov ;; # targets that do support conditional mov but on which it's slow pentium4|pentium4m|prescott|nocona) cpuflags="-march=$cpu" - enable cmov + enable i686 disable fast_cmov ;; esac @@ -3227,27 +3627,32 @@ EOF esac enable $subarch -enabled spic && enable pic +enabled spic && enable_weak pic # OS specific case $target_os in + aix) + SHFLAGS=-shared + add_cppflags '-I\$(SRC_PATH)/compat/aix' + enabled shared && add_ldflags -Wl,-brtl + ;; haiku) prefix_default="/boot/common" network_extralibs="-lnetwork" host_libs= ;; sunos) - FFSERVERLDFLAGS="" SHFLAGS='-shared -Wl,-h,$$(@F)' enabled x86 && SHFLAGS="-mimpure-text $SHFLAGS" network_extralibs="-lsocket -lnsl" - add_cppflags -D__EXTENSIONS__ -D_XOPEN_SOURCE=600 # When using suncc to build, the Solaris linker will mark # an executable with each instruction set encountered by # the Solaris assembler. As our libraries contain their own # guards for processor-specific code, instead suppress # generation of the HWCAPS ELF section on Solaris x86 only. - enabled_all suncc x86 && echo "hwcap_1 = OVERRIDE;" > mapfile && add_ldflags -Wl,-M,mapfile + enabled_all suncc x86 && + echo "hwcap_1 = OVERRIDE;" > mapfile && + add_ldflags -Wl,-M,mapfile nm_default='nm -P -g' ;; netbsd) @@ -3283,7 +3688,6 @@ case $target_os in SLIBSUF=".dylib" SLIBNAME_WITH_VERSION='$(SLIBPREF)$(FULLNAME).$(LIBVERSION)$(SLIBSUF)' SLIBNAME_WITH_MAJOR='$(SLIBPREF)$(FULLNAME).$(LIBMAJOR)$(SLIBSUF)' - FFSERVERLDFLAGS=-Wl,-bind_at_load objformat="macho" enabled x86_64 && objformat="macho64" enabled_any pic shared || @@ -3301,6 +3705,9 @@ case $target_os in elif enabled arm; then LIBTARGET=arm-wince fi + enabled shared && ! enabled small && check_cmd $windres --version && enable gnu_windres + check_ldflags -Wl,--nxcompat + check_ldflags -Wl,--dynamicbase shlibdir_default="$bindir_default" SLIBPREF="" SLIBSUF=".dll" @@ -3325,12 +3732,12 @@ case $target_os in enable dos_paths ;; win32|win64) + disable symver if enabled shared; then # Link to the import library instead of the normal static library # for shared libs. LD_LIB='%.lib' - # Cannot build shared and static libraries at the same time with - # MSVC. + # Cannot build both shared and static libs with MSVC or icl. disable static fi shlibdir_default="$bindir_default" @@ -3338,7 +3745,7 @@ case $target_os in SLIBSUF=".dll" SLIBNAME_WITH_VERSION='$(SLIBPREF)$(FULLNAME)-$(LIBVERSION)$(SLIBSUF)' SLIBNAME_WITH_MAJOR='$(SLIBPREF)$(FULLNAME)-$(LIBMAJOR)$(SLIBSUF)' - SLIB_CREATE_DEF_CMD='makedef $(SUBDIR)lib$(NAME).ver $(OBJS) > $$(@:$(SLIBSUF)=.def)' + SLIB_CREATE_DEF_CMD='$(SRC_PATH)/compat/windows/makedef $(SUBDIR)lib$(NAME).ver $(OBJS) > $$(@:$(SLIBSUF)=.def)' SLIB_INSTALL_NAME='$(SLIBNAME_WITH_MAJOR)' SLIB_INSTALL_LINKS= SLIB_INSTALL_EXTRA_SHLIB='$(SLIBNAME:$(SLIBSUF)=.lib)' @@ -3361,6 +3768,7 @@ case $target_os in SHFLAGS='-shared -Wl,--out-implib,$(SUBDIR)lib$(FULLNAME).dll.a' objformat="win32" enable dos_paths + enabled shared && ! enabled small && check_cmd $windres --version && enable gnu_windres ;; *-dos|freedos|opendos) network_extralibs="-lsocket" @@ -3382,7 +3790,6 @@ case $target_os in add_cppflags -D_GNU_SOURCE add_ldflags -Zomf -Zbin-files -Zargs-wild -Zmap SHFLAGS='$(SUBDIR)$(NAME).def -Zdll -Zomf' - FFSERVERLDFLAGS="" LIBSUF="_s.a" SLIBPREF="" SLIBSUF=".dll" @@ -3423,7 +3830,6 @@ case $target_os in ;; osf1) add_cppflags -D_OSF_SOURCE -D_POSIX_PII -D_REENTRANT - FFSERVERLDFLAGS= ;; minix) ;; @@ -3448,44 +3854,79 @@ esac # determine libc flavour -# uclibc defines __GLIBC__, so it needs to be checked before glibc. -if check_cpp_condition features.h "defined __UCLIBC__"; then - libc_type=uclibc - add_cppflags -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600 -elif check_cpp_condition features.h "defined __GLIBC__"; then - libc_type=glibc - add_cppflags -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600 -# MinGW headers can be installed on Cygwin, so check for newlib first. -elif check_cpp_condition newlib.h "defined _NEWLIB_VERSION"; then - libc_type=newlib - add_cppflags -U__STRICT_ANSI__ -elif check_header _mingw.h; then - libc_type=mingw - check_cpp_condition _mingw.h \ - "defined (__MINGW64_VERSION_MAJOR) || (__MINGW32_MAJOR_VERSION > 3) || \ +probe_libc(){ + pfx=$1 + pfx_no_=${pfx%_} + # uclibc defines __GLIBC__, so it needs to be checked before glibc. + if check_${pfx}cpp_condition features.h "defined __UCLIBC__"; then + eval ${pfx}libc_type=uclibc + add_${pfx}cppflags -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600 + elif check_${pfx}cpp_condition features.h "defined __GLIBC__"; then + eval ${pfx}libc_type=glibc + add_${pfx}cppflags -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600 + # MinGW headers can be installed on Cygwin, so check for newlib first. + elif check_${pfx}cpp_condition newlib.h "defined _NEWLIB_VERSION"; then + eval ${pfx}libc_type=newlib + add_${pfx}cppflags -U__STRICT_ANSI__ + # MinGW64 is backwards compatible with MinGW32, so check for it first. + elif check_${pfx}cpp_condition _mingw.h "defined __MINGW64_VERSION_MAJOR"; then + eval ${pfx}libc_type=mingw64 + if check_${pfx}cpp_condition _mingw.h "__MINGW64_VERSION_MAJOR < 3"; then + add_compat msvcrt/snprintf.o + add_cflags "-include $source_path/compat/msvcrt/snprintf.h" + fi + add_${pfx}cppflags -U__STRICT_ANSI__ -D__USE_MINGW_ANSI_STDIO=1 + eval test \$${pfx_no_}cc_type = "gcc" && + add_${pfx}cppflags -D__printf__=__gnu_printf__ + elif check_${pfx}cpp_condition _mingw.h "defined __MINGW_VERSION" || + check_${pfx}cpp_condition _mingw.h "defined __MINGW32_VERSION"; then + eval ${pfx}libc_type=mingw32 + check_${pfx}cpp_condition _mingw.h "__MINGW32_MAJOR_VERSION > 3 || \ (__MINGW32_MAJOR_VERSION == 3 && __MINGW32_MINOR_VERSION >= 15)" || - die "ERROR: MinGW runtime version must be >= 3.15." - add_cppflags -U__STRICT_ANSI__ - if check_cpp_condition _mingw.h "defined(__MINGW64_VERSION_MAJOR) && \ - __MINGW64_VERSION_MAJOR < 3"; then - add_compat msvcrt/snprintf.o - add_cflags "-include $source_path/compat/msvcrt/snprintf.h" + die "ERROR: MinGW32 runtime version must be >= 3.15." + add_${pfx}cppflags -U__STRICT_ANSI__ -D__USE_MINGW_ANSI_STDIO=1 + eval test \$${pfx_no_}cc_type = "gcc" && + add_${pfx}cppflags -D__printf__=__gnu_printf__ + elif check_${pfx}cpp_condition crtversion.h "defined _VC_CRT_MAJOR_VERSION"; then + eval ${pfx}libc_type=msvcrt + # The MSVC 2010 headers (Win 7.0 SDK) set _WIN32_WINNT to + # 0x601 by default unless something else is set by the user. + # This can easily lead to us detecting functions only present + # in such new versions and producing binaries requiring windows 7.0. + # Therefore explicitly set the default to XP unless the user has + # set something else on the command line. + check_${pfx}cpp_condition stdlib.h "defined(_WIN32_WINNT)" || + add_${pfx}cppflags -D_WIN32_WINNT=0x0502 + elif check_${pfx}cpp_condition stddef.h "defined __KLIBC__"; then + eval ${pfx}libc_type=klibc + elif check_${pfx}cpp_condition sys/cdefs.h "defined __BIONIC__"; then + eval ${pfx}libc_type=bionic + elif check_${pfx}cpp_condition sys/brand.h "defined LABELED_BRAND_NAME"; then + eval ${pfx}libc_type=solaris + add_${pfx}cppflags -D__EXTENSIONS__ -D_XOPEN_SOURCE=600 fi -elif check_func_headers stdlib.h _get_doserrno; then - libc_type=msvcrt - add_compat strtod.o strtod=avpriv_strtod - add_compat msvcrt/snprintf.o snprintf=avpriv_snprintf \ - _snprintf=avpriv_snprintf \ - vsnprintf=avpriv_vsnprintf -elif check_cpp_condition stddef.h "defined __KLIBC__"; then - libc_type=klibc -fi +} -test -n "$libc_type" && enable $libc_type +probe_libc +test -n "$libc_type" && enable libc_$libc_type +probe_libc host_ +test -n "$host_libc_type" && enable host_libc_$host_libc_type + +case $libc_type in + bionic) + add_compat strtod.o strtod=avpriv_strtod + ;; + msvcrt) + add_compat strtod.o strtod=avpriv_strtod + add_compat msvcrt/snprintf.o snprintf=avpriv_snprintf \ + _snprintf=avpriv_snprintf \ + vsnprintf=avpriv_vsnprintf + ;; +esac # hacks for compiler/libc/os combinations -if enabled_all tms470 glibc; then +if enabled_all tms470 libc_glibc; then CPPFLAGS="-I${source_path}/compat/tms470 ${CPPFLAGS}" add_cppflags -D__USER_LABEL_PREFIX__= add_cppflags -D__builtin_memset=memset @@ -3493,7 +3934,7 @@ if enabled_all tms470 glibc; then add_cflags -pds=48 # incompatible redefinition of macro fi -if enabled_all ccc glibc; then +if enabled_all ccc libc_glibc; then add_ldflags -Wl,-z,now # calls to libots crash without this fi @@ -3503,7 +3944,7 @@ esc(){ echo "config:$arch:$subarch:$cpu:$target_os:$(esc $cc_ident):$(esc $FFMPEG_CONFIGURATION)" >config.fate -check_cpp_condition stdlib.h "defined(__PIC__) || defined(__pic__) || defined(PIC)" && enable pic +check_cpp_condition stdlib.h "defined(__PIC__) || defined(__pic__) || defined(PIC)" && enable_weak pic set_default $PATHS_LIST set_default nm @@ -3519,6 +3960,10 @@ EOF exit 1; fi +# backward compatibility layer for incompatible_libav/fork_abi +enabled incompatible_fork_abi && enable incompatible_libav_abi +enabled incompatible_libav_abi && enable incompatible_fork_abi + die_license_disabled() { enabled $1 || { enabled $2 && die "$2 is $1 and --enable-$1 is not specified."; } } @@ -3527,11 +3972,14 @@ die_license_disabled_gpl() { enabled $1 || { enabled $2 && die "$2 is incompatible with the gpl and --enable-$1 is not specified."; } } +die_license_disabled gpl frei0r die_license_disabled gpl libcdio die_license_disabled gpl libutvideo +die_license_disabled gpl libvidstab die_license_disabled gpl libx264 die_license_disabled gpl libxavs die_license_disabled gpl libxvid +die_license_disabled gpl libzvbi die_license_disabled gpl x11grab die_license_disabled nonfree libaacplus @@ -3548,14 +3996,21 @@ enabled version3 && { enabled gpl && enable gplv3 || enable lgplv3; } disabled optimizations || check_cflags -fomit-frame-pointer -enable_pic() { +enable_weak_pic() { + disabled pic && return enable pic add_cppflags -DPIC - add_cflags -fPIC + case "$target_os" in + mingw*|cygwin*) + ;; + *) + add_cflags -fPIC + ;; + esac add_asflags -fPIC } -enabled pic && enable_pic +enabled pic && enable_weak_pic check_cc <<EOF || die "Symbol mangling check failed." int ff_extern; @@ -3574,6 +4029,10 @@ void foo(char * $restrict_keyword p); EOF done +check_cc <<EOF && enable pragma_deprecated +void foo(void) { _Pragma("GCC diagnostic ignored \"-Wdeprecated-declarations\"") } +EOF + check_cc <<EOF && enable attribute_packed struct { int x; } __attribute__((packed)) x; EOF @@ -3587,6 +4046,8 @@ unsigned int endian = 'B' << 24 | 'I' << 16 | 'G' << 8 | 'E'; EOF od -t x1 $TMPO | grep -q '42 *49 *47 *45' && enable bigendian +check_inline_asm inline_asm_labels '"1:\n"' + if enabled alpha; then check_cflags -mieee @@ -3627,7 +4088,7 @@ EOF check_inline_asm asm_mod_q '"add r0, %Q0, %R0" :: "r"((long long)0)' check_inline_asm asm_mod_y '"vmul.i32 d0, d0, %y0" :: "x"(0)' - enabled_all armv6t2 shared !pic && enable_pic + [ $target_os != win32 ] && enabled_all armv6t2 shared !pic && enable_weak_pic elif enabled mips; then @@ -3660,7 +4121,9 @@ elif enabled ppc; then # AltiVec flags: The FSF version of GCC differs from the Apple version if enabled altivec; then - nogas=warn + if ! enabled_any pic ppc64; then + nogas=warn + fi check_cflags -maltivec -mabi=altivec && { check_header altivec.h && inc_altivec_h="#include <altivec.h>" ; } || check_cflags -faltivec @@ -3728,9 +4191,9 @@ EOF elf*) enabled debug && append YASMFLAGS $yasm_debug ;; esac - check_yasm "pextrd [eax], xmm0, 1" && enable yasm || - die "yasm not found, use --disable-yasm for a crippled build" - check_yasm "vextractf128 xmm0, ymm0, 0" || disable avx_external + check_yasm "movbe ecx, [5]" && enable yasm || + die "yasm/nasm not found or too old. Use --disable-yasm for a crippled build." + check_yasm "vextractf128 xmm0, ymm0, 0" || disable avx_external avresample check_yasm "vfmaddps ymm0, ymm1, ymm2, ymm3" || disable fma4_external check_yasm "CPU amdnop" && enable cpunop fi @@ -3805,6 +4268,7 @@ check_func access check_func clock_gettime || { check_func clock_gettime -lrt && add_extralibs -lrt; } check_func fcntl check_func fork +check_func_headers stdlib.h getenv check_func gethrtime check_func getopt check_func getrusage @@ -3820,11 +4284,14 @@ check_func mprotect check_func ${malloc_prefix}posix_memalign && enable posix_memalign check_func_headers malloc.h _aligned_malloc && enable aligned_malloc check_func setrlimit +check_struct "sys/stat.h" "struct stat" st_mtim.tv_nsec -D_BSD_SOURCE check_func strerror_r check_func sched_getaffinity check_builtin sync_val_compare_and_swap "" "int *ptr; int oldval, newval; __sync_val_compare_and_swap(ptr, oldval, newval)" check_builtin machine_rw_barrier mbarrier.h "__machine_rw_barrier()" +check_builtin atomic_cas_ptr atomic.h "void **ptr; void *oldval, *newval; atomic_cas_ptr(ptr, oldval, newval)" check_builtin MemoryBarrier windows.h "MemoryBarrier()" +check_builtin sarestart signal.h "SA_RESTART" check_func sysconf check_func sysctl check_func usleep @@ -3843,7 +4310,9 @@ check_func_headers windows.h SetConsoleTextAttribute check_func_headers windows.h Sleep check_func_headers windows.h VirtualAlloc check_func_headers glob.h glob +check_func_headers "X11/Xlib.h X11/extensions/Xvlib.h" XvGetPortAttribute -lXv -lX11 -lXext +check_header cl/cl.h check_header direct.h check_header dlfcn.h check_header dxva.h @@ -3857,6 +4326,7 @@ check_header sys/param.h check_header sys/resource.h check_header sys/select.h check_header sys/time.h +check_header sys/un.h check_header termios.h check_header unistd.h check_header vdpau/vdpau.h @@ -3866,28 +4336,26 @@ check_header windows.h check_header X11/extensions/XvMClib.h check_header asm/types.h -disabled zlib || check_lib zlib.h zlibVersion -lz || disable zlib -disabled bzlib || check_lib2 bzlib.h BZ2_bzlibVersion -lbz2 || disable bzlib - if ! disabled w32threads && ! enabled pthreads; then - check_func_headers "windows.h process.h" _beginthreadex && enable w32threads + check_func_headers "windows.h process.h" _beginthreadex && + enable w32threads || disable w32threads fi # check for some common methods of building with pthread support # do this before the optional library checks as some of them require pthreads if ! disabled pthreads && ! enabled w32threads && ! enabled os2threads; then enable pthreads - if check_func pthread_create; then - : - elif check_func pthread_create -pthread; then + if check_func pthread_join -pthread && check_func pthread_create -pthread; then add_cflags -pthread add_extralibs -pthread - elif check_func pthread_create -pthreads; then + elif check_func pthread_join -pthreads && check_func pthread_create -pthreads; then add_cflags -pthreads add_extralibs -pthreads - elif check_func pthread_create -lpthreadGC2; then + elif check_func pthread_join -lpthreadGC2 && check_func pthread_create -lpthreadGC2; then add_extralibs -lpthreadGC2 - elif ! check_lib pthread.h pthread_create -lpthread; then + elif check_lib pthread.h pthread_join -lpthread && check_lib pthread.h pthread_create -lpthread; then + : + elif ! check_func pthread_join && ! check_func pthread_create; then disable pthreads fi fi @@ -3904,9 +4372,11 @@ if enabled pthreads; then check_func pthread_cancel fi +disabled zlib || check_lib zlib.h zlibVersion -lz || disable zlib +disabled bzlib || check_lib2 bzlib.h BZ2_bzlibVersion -lbz2 || disable bzlib + check_lib math.h sin -lm && LIBM="-lm" disabled crystalhd || check_lib libcrystalhd/libcrystalhd_if.h DtsCrystalHDVersion -lcrystalhd || disable crystalhd -enabled vaapi && require vaapi va/va.h vaInitialize -lva atan2f_args=2 ldexpf_args=2 @@ -3917,77 +4387,95 @@ for func in $MATH_FUNCS; do done # these are off by default, so fail if requested and not available -enabled avisynth && { { check_lib2 "windows.h" LoadLibrary; } || - { check_lib2 "dlfcn.h" dlopen -ldl; } || - die "ERROR: LoadLibrary/dlopen not found for avisynth"; } -enabled fontconfig && require_pkg_config fontconfig "fontconfig/fontconfig.h" FcInit -enabled frei0r && { check_header frei0r.h || die "ERROR: frei0r.h header not found"; } -enabled gnutls && require_pkg_config gnutls gnutls/gnutls.h gnutls_global_init -enabled libiec61883 && require libiec61883 libiec61883/iec61883.h iec61883_cmp_connect -lraw1394 -lavc1394 -lrom1394 -liec61883 -enabled libaacplus && require "libaacplus >= 2.0.0" aacplus.h aacplusEncOpen -laacplus -enabled libass && require_pkg_config libass ass/ass.h ass_library_init -enabled libbluray && require libbluray libbluray/bluray.h bd_open -lbluray -enabled libcelt && require libcelt celt/celt.h celt_decode -lcelt0 && - { check_lib celt/celt.h celt_decoder_create_custom -lcelt0 || - die "ERROR: libcelt must be installed and version must be >= 0.11.0."; } -enabled libcaca && require_pkg_config caca caca.h caca_create_canvas -enabled libfaac && require2 libfaac "stdint.h faac.h" faacEncGetVersion -lfaac -enabled libfdk_aac && require libfdk_aac fdk-aac/aacenc_lib.h aacEncOpen -lfdk-aac +enabled avisynth && { { check_lib2 "windows.h" LoadLibrary; } || + { check_lib2 "dlfcn.h" dlopen -ldl; } || + die "ERROR: LoadLibrary/dlopen not found for avisynth"; } +enabled fontconfig && require_pkg_config fontconfig "fontconfig/fontconfig.h" FcInit +enabled frei0r && { check_header frei0r.h || die "ERROR: frei0r.h header not found"; } +enabled gnutls && require_pkg_config gnutls gnutls/gnutls.h gnutls_global_init +enabled ladspa && { check_header ladspa.h || die "ERROR: ladspa.h header not found"; } +enabled libiec61883 && require libiec61883 libiec61883/iec61883.h iec61883_cmp_connect -lraw1394 -lavc1394 -lrom1394 -liec61883 +enabled libaacplus && require "libaacplus >= 2.0.0" aacplus.h aacplusEncOpen -laacplus +enabled libass && require_pkg_config libass ass/ass.h ass_library_init +enabled libbluray && require libbluray libbluray/bluray.h bd_open -lbluray +enabled libcelt && require libcelt celt/celt.h celt_decode -lcelt0 && + { check_lib celt/celt.h celt_decoder_create_custom -lcelt0 || + die "ERROR: libcelt must be installed and version must be >= 0.11.0."; } +enabled libcaca && require_pkg_config caca caca.h caca_create_canvas +enabled libfaac && require2 libfaac "stdint.h faac.h" faacEncGetVersion -lfaac +enabled libfdk_aac && require libfdk_aac fdk-aac/aacenc_lib.h aacEncOpen -lfdk-aac flite_libs="-lflite_cmu_time_awb -lflite_cmu_us_awb -lflite_cmu_us_kal -lflite_cmu_us_kal16 -lflite_cmu_us_rms -lflite_cmu_us_slt -lflite_usenglish -lflite_cmulex -lflite" -enabled libflite && require2 libflite "flite/flite.h" flite_init $flite_libs -enabled libfreetype && require_pkg_config freetype2 "ft2build.h freetype/freetype.h" FT_Init_FreeType -enabled libgsm && { for gsm_hdr in "gsm.h" "gsm/gsm.h"; do - check_lib "${gsm_hdr}" gsm_create -lgsm && break; - done || die "ERROR: libgsm not found"; } -enabled libilbc && require libilbc ilbc.h WebRtcIlbcfix_InitDecode -lilbc -enabled libmodplug && require libmodplug libmodplug/modplug.h ModPlug_Load -lmodplug -enabled libmp3lame && require "libmp3lame >= 3.98.3" lame/lame.h lame_set_VBR_quality -lmp3lame -enabled libnut && require libnut libnut.h nut_demuxer_init -lnut -enabled libopencore_amrnb && require libopencore_amrnb opencore-amrnb/interf_dec.h Decoder_Interface_init -lopencore-amrnb -enabled libopencore_amrwb && require libopencore_amrwb opencore-amrwb/dec_if.h D_IF_init -lopencore-amrwb -enabled libopencv && require_pkg_config opencv opencv/cxcore.h cvCreateImageHeader -enabled libopenjpeg && { check_lib openjpeg-1.5/openjpeg.h opj_version -lopenjpeg || - check_lib openjpeg.h opj_version -lopenjpeg || - die "ERROR: libopenjpeg not found"; } -enabled libopus && require_pkg_config opus opus_multistream.h opus_multistream_decoder_create -enabled libpulse && require_pkg_config libpulse-simple pulse/simple.h pa_simple_new -enabled librtmp && require_pkg_config librtmp librtmp/rtmp.h RTMP_Socket -enabled libschroedinger && require_pkg_config schroedinger-1.0 schroedinger/schro.h schro_init -enabled libsoxr && require libsoxr soxr.h soxr_create -lsoxr -enabled libspeex && require libspeex speex/speex.h speex_decoder_init -lspeex -enabled libstagefright_h264 && require_cpp libstagefright_h264 "binder/ProcessState.h media/stagefright/MetaData.h +enabled libflite && require2 libflite "flite/flite.h" flite_init $flite_libs +enabled libfreetype && require_libfreetype +enabled libgme && require libgme gme/gme.h gme_new_emu -lgme -lstdc++ +enabled libgsm && { for gsm_hdr in "gsm.h" "gsm/gsm.h"; do + check_lib "${gsm_hdr}" gsm_create -lgsm && break; + done || die "ERROR: libgsm not found"; } +enabled libilbc && require libilbc ilbc.h WebRtcIlbcfix_InitDecode -lilbc +enabled libmodplug && require libmodplug libmodplug/modplug.h ModPlug_Load -lmodplug +enabled libmp3lame && require "libmp3lame >= 3.98.3" lame/lame.h lame_set_VBR_quality -lmp3lame +enabled libnut && require libnut libnut.h nut_demuxer_init -lnut +enabled libopencore_amrnb && require libopencore_amrnb opencore-amrnb/interf_dec.h Decoder_Interface_init -lopencore-amrnb +enabled libopencore_amrwb && require libopencore_amrwb opencore-amrwb/dec_if.h D_IF_init -lopencore-amrwb +enabled libopencv && require_pkg_config opencv opencv/cxcore.h cvCreateImageHeader +enabled libopenjpeg && { check_lib openjpeg-1.5/openjpeg.h opj_version -lopenjpeg || + check_lib openjpeg.h opj_version -lopenjpeg || + die "ERROR: libopenjpeg not found"; } +enabled libopus && require_pkg_config opus opus_multistream.h opus_multistream_decoder_create +enabled libpulse && require_pkg_config libpulse-simple pulse/simple.h pa_simple_new +enabled libquvi && require_pkg_config libquvi quvi/quvi.h quvi_init +enabled librtmp && require_pkg_config librtmp librtmp/rtmp.h RTMP_Socket +enabled libschroedinger && require_pkg_config schroedinger-1.0 schroedinger/schro.h schro_init +enabled libshine && require_pkg_config shine shine/layer3.h shine_encode_buffer +enabled libsoxr && require libsoxr soxr.h soxr_create -lsoxr +enabled libssh && require_pkg_config libssh libssh/sftp.h sftp_init +enabled libspeex && require libspeex speex/speex.h speex_decoder_init -lspeex +enabled libstagefright_h264 && require_cpp libstagefright_h264 "binder/ProcessState.h media/stagefright/MetaData.h media/stagefright/MediaBufferGroup.h media/stagefright/MediaDebug.h media/stagefright/MediaDefs.h media/stagefright/OMXClient.h media/stagefright/OMXCodec.h" android::OMXClient -lstagefright -lmedia -lutils -lbinder -lgnustl_static -enabled libtheora && require libtheora theora/theoraenc.h th_info_init -ltheoraenc -ltheoradec -logg -enabled libtwolame && require libtwolame twolame.h twolame_init -ltwolame && - { check_lib twolame.h twolame_encode_buffer_float32_interleaved -ltwolame || - die "ERROR: libtwolame must be installed and version must be >= 0.3.10"; } -enabled libutvideo && require_cpp utvideo "stdint.h stdlib.h utvideo/utvideo.h utvideo/Codec.h" 'CCodec*' -lutvideo -lstdc++ -enabled libv4l2 && require_pkg_config libv4l2 libv4l2.h v4l2_ioctl -enabled libvo_aacenc && require libvo_aacenc vo-aacenc/voAAC.h voGetAACEncAPI -lvo-aacenc -enabled libvo_amrwbenc && require libvo_amrwbenc vo-amrwbenc/enc_if.h E_IF_init -lvo-amrwbenc -enabled libvorbis && require libvorbis vorbis/vorbisenc.h vorbis_info_init -lvorbisenc -lvorbis -logg -enabled libvpx && { +enabled libtheora && require libtheora theora/theoraenc.h th_info_init -ltheoraenc -ltheoradec -logg +enabled libtwolame && require libtwolame twolame.h twolame_init -ltwolame && + { check_lib twolame.h twolame_encode_buffer_float32_interleaved -ltwolame || + die "ERROR: libtwolame must be installed and version must be >= 0.3.10"; } +enabled libutvideo && require_cpp utvideo "stdint.h stdlib.h utvideo/utvideo.h utvideo/Codec.h" 'CCodec*' -lutvideo -lstdc++ +enabled libv4l2 && require_pkg_config libv4l2 libv4l2.h v4l2_ioctl +enabled libvidstab && require_pkg_config vidstab vid.stab/libvidstab.h vsMotionDetectInit +enabled libvo_aacenc && require libvo_aacenc vo-aacenc/voAAC.h voGetAACEncAPI -lvo-aacenc +enabled libvo_amrwbenc && require libvo_amrwbenc vo-amrwbenc/enc_if.h E_IF_init -lvo-amrwbenc +enabled libvorbis && require libvorbis vorbis/vorbisenc.h vorbis_info_init -lvorbisenc -lvorbis -logg +enabled libvpx && { enabled libvpx_vp8_decoder && { check_lib2 "vpx/vpx_decoder.h vpx/vp8dx.h" vpx_codec_dec_init_ver -lvpx || - die "ERROR: libvpx decoder version must be >=0.9.1"; } + die "ERROR: libvpx decoder version must be >=0.9.1"; } enabled libvpx_vp8_encoder && { check_lib2 "vpx/vpx_encoder.h vpx/vp8cx.h" "vpx_codec_enc_init_ver VP8E_SET_MAX_INTRA_BITRATE_PCT" -lvpx || - die "ERROR: libvpx encoder version must be >=0.9.7"; } - enabled libvpx_vp9_decoder && { check_lib2 "vpx/vpx_decoder.h vpx/vp8dx.h" "vpx_codec_vp9_dx" -lvpx || disable libvpx_vp9_decoder; } - enabled libvpx_vp9_encoder && { check_lib2 "vpx/vpx_encoder.h vpx/vp8cx.h" "vpx_codec_vp9_cx" -lvpx || disable libvpx_vp9_encoder; } } -enabled libx264 && require libx264 x264.h x264_encoder_encode -lx264 && - { check_cpp_condition x264.h "X264_BUILD >= 118" || - die "ERROR: libx264 must be installed and version must be >= 0.118."; } -enabled libxavs && require libxavs xavs.h xavs_encoder_encode -lxavs -enabled libxvid && require libxvid xvid.h xvid_global -lxvidcore -enabled openal && { { for al_libs in "${OPENAL_LIBS}" "-lopenal" "-lOpenAL32"; do - check_lib 'AL/al.h' alGetError "${al_libs}" && break; done } || - die "ERROR: openal not found"; } && - { check_cpp_condition "AL/al.h" "defined(AL_VERSION_1_1)" || - die "ERROR: openal must be installed and version must be 1.1 or compatible"; } -enabled openssl && { check_lib openssl/ssl.h SSL_library_init -lssl -lcrypto || - check_lib openssl/ssl.h SSL_library_init -lssl32 -leay32 || - check_lib openssl/ssl.h SSL_library_init -lssl -lcrypto -lws2_32 -lgdi32 || - die "ERROR: openssl not found"; } + die "ERROR: libvpx encoder version must be >=0.9.7"; } + enabled libvpx_vp9_decoder && { check_lib2 "vpx/vpx_decoder.h vpx/vp8dx.h" "vpx_codec_vp9_dx" -lvpx || disable libvpx_vp9_decoder; } + enabled libvpx_vp9_encoder && { check_lib2 "vpx/vpx_encoder.h vpx/vp8cx.h" "vpx_codec_vp9_cx VP9E_SET_SVC" -lvpx || disable libvpx_vp9_encoder; } } +enabled libwavpack && require libwavpack wavpack/wavpack.h WavpackOpenFileOutput -lwavpack +enabled libwebp && require_pkg_config libwebp webp/encode.h WebPGetEncoderVersion +enabled libx264 && require libx264 x264.h x264_encoder_encode -lx264 && + { check_cpp_condition x264.h "X264_BUILD >= 118" || + die "ERROR: libx264 must be installed and version must be >= 0.118."; } +enabled libxavs && require libxavs xavs.h xavs_encoder_encode -lxavs +enabled libxvid && require libxvid xvid.h xvid_global -lxvidcore +enabled libzmq && require_pkg_config libzmq zmq.h zmq_ctx_new +enabled libzvbi && require libzvbi libzvbi.h vbi_decoder_new -lzvbi +enabled openal && { { for al_libs in "${OPENAL_LIBS}" "-lopenal" "-lOpenAL32"; do + check_lib 'AL/al.h' alGetError "${al_libs}" && break; done } || + die "ERROR: openal not found"; } && + { check_cpp_condition "AL/al.h" "defined(AL_VERSION_1_1)" || + die "ERROR: openal must be installed and version must be 1.1 or compatible"; } +enabled opencl && { check_lib2 OpenCL/cl.h clEnqueueNDRangeKernel -Wl,-framework,OpenCL || + check_lib2 CL/cl.h clEnqueueNDRangeKernel -lOpenCL || + die "ERROR: opencl not found"; } && + { ! enabled_any w32threads os2threads || + die "opencl currently needs --enable-pthreads or --disable-w32threads"; } && + { check_cpp_condition "OpenCL/cl.h" "defined(CL_VERSION_1_2)" || + check_cpp_condition "CL/cl.h" "defined(CL_VERSION_1_2)" || + die "ERROR: opencl must be installed and version must be 1.2 or compatible"; } +enabled openssl && { check_lib openssl/ssl.h SSL_library_init -lssl -lcrypto || + check_lib openssl/ssl.h SSL_library_init -lssl32 -leay32 || + check_lib openssl/ssl.h SSL_library_init -lssl -lcrypto -lws2_32 -lgdi32 || + die "ERROR: openssl not found"; } if enabled gnutls; then { check_lib nettle/bignum.h nettle_mpz_get_str_256 -lnettle -lhogweed -lgmp && enable nettle; } || @@ -4022,8 +4510,8 @@ enabled sdl && add_cflags $sdl_cflags && add_extralibs $sdl_libs texi2html --help 2> /dev/null | grep -q 'init-file' && enable texi2html || disable texi2html makeinfo --version > /dev/null 2>&1 && enable makeinfo || disable makeinfo -perl --version > /dev/null 2>&1 && enable perl || disable perl -pod2man --help > /dev/null 2>&1 && enable pod2man || disable pod2man +perl -v > /dev/null 2>&1 && enable perl || disable perl +pod2man --help > /dev/null 2>&1 && enable pod2man || disable pod2man rsync --help 2> /dev/null | grep -q 'contimeout' && enable rsync_contimeout || disable rsync_contimeout check_header linux/fb.h @@ -4060,7 +4548,8 @@ EOF fi check_header soundcard.h -enabled_any alsa_indev alsa_outdev && check_lib2 alsa/asoundlib.h snd_pcm_htimestamp -lasound +enabled_any alsa_indev alsa_outdev && + check_lib2 alsa/asoundlib.h snd_pcm_htimestamp -lasound enabled jack_indev && check_lib2 jack/jack.h jack_client_open -ljack && check_func sem_timedwait && check_func jack_port_get_latency_range -ljack @@ -4068,42 +4557,41 @@ enabled jack_indev && check_lib2 jack/jack.h jack_client_open -ljack && check_fu enabled_any sndio_indev sndio_outdev && check_lib2 sndio.h sio_open -lsndio if enabled libcdio; then - check_lib2 "cdio/cdda.h cdio/paranoia.h" cdio_cddap_open -lcdio_paranoia -lcdio_cdda -lcdio || check_lib2 "cdio/paranoia/cdda.h cdio/paranoia/paranoia.h" cdio_cddap_open -lcdio_paranoia -lcdio_cdda -lcdio + check_lib2 "cdio/cdda.h cdio/paranoia.h" cdio_cddap_open -lcdio_paranoia -lcdio_cdda -lcdio || + check_lib2 "cdio/paranoia/cdda.h cdio/paranoia/paranoia.h" cdio_cddap_open -lcdio_paranoia -lcdio_cdda -lcdio || + die "ERROR: libcdio-paranoia not found" fi +check_lib X11/Xlib.h XOpenDisplay -lX11 && enable xlib + enabled x11grab && -require X11 X11/Xlib.h XOpenDisplay -lX11 && require Xext X11/extensions/XShm.h XShmCreateImage -lXext && -require Xfixes X11/extensions/Xfixes.h XFixesGetCursorImage -lXfixes +require Xfixes X11/extensions/Xfixes.h XFixesGetCursorImage -lXfixes && +{ enabled xlib || die "ERROR: Xlib not found"; } -if ! disabled vaapi; then - check_lib va/va.h vaInitialize -lva && { - check_cpp_condition va/va_version.h "VA_CHECK_VERSION(0,32,0)" || - warn "Please upgrade to VA-API >= 0.32 if you would like full VA-API support."; - } || disable vaapi -fi +enabled vaapi && + check_lib va/va.h vaInitialize -lva || + disable vaapi enabled vdpau && check_cpp_condition vdpau/vdpau.h "defined VDP_DECODER_PROFILE_MPEG4_PART2_ASP" || disable vdpau +enabled vdpau && enabled xlib && + check_lib2 "vdpau/vdpau.h vdpau/vdpau_x11.h" vdp_device_create_x11 -lvdpau && + enable vdpau_x11 + # Funny iconv installations are not unusual, so check it after all flags have been set disabled iconv || check_func_headers iconv.h iconv || check_lib2 iconv.h iconv -liconv || disable iconv 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 check_cflags -Wall -check_cflags -Wno-parentheses -check_cflags -Wno-switch -check_cflags -Wno-format-zero-length check_cflags -Wdisabled-optimization check_cflags -Wpointer-arith check_cflags -Wredundant-decls -check_cflags -Wno-pointer-sign check_cflags -Wwrite-strings check_cflags -Wtype-limits check_cflags -Wundef @@ -4112,11 +4600,26 @@ check_cflags -Wno-pointer-to-int-cast check_cflags -Wstrict-prototypes enabled extra_warnings && check_cflags -Winline +check_disable_warning(){ + warning_flag=-W${1#-Wno-} + test_cflags $warning_flag && add_cflags $1 +} + +check_disable_warning -Wno-parentheses +check_disable_warning -Wno-switch +check_disable_warning -Wno-format-zero-length +check_disable_warning -Wno-pointer-sign + # add some linker flags check_ldflags -Wl,--warn-common check_ldflags -Wl,-rpath-link=libpostproc:libswresample:libswscale:libavfilter:libavdevice:libavformat:libavcodec:libavutil:libavresample +enabled rpath && add_ldflags -Wl,-rpath=$libdir test_ldflags -Wl,-Bsymbolic && append SHFLAGS -Wl,-Bsymbolic +# add some strip flags +# -wN '..@*' is more selective than -x, but not available everywhere. +check_stripflags -wN \'..@*\' || check_stripflags -x + enabled xmm_clobber_test && check_ldflags -Wl,--wrap,avcodec_open2 \ -Wl,--wrap,avcodec_decode_audio4 \ @@ -4124,6 +4627,7 @@ enabled xmm_clobber_test && -Wl,--wrap,avcodec_decode_subtitle2 \ -Wl,--wrap,avcodec_encode_audio2 \ -Wl,--wrap,avcodec_encode_video \ + -Wl,--wrap,avcodec_encode_video2 \ -Wl,--wrap,avcodec_encode_subtitle \ -Wl,--wrap,sws_scale || disable xmm_clobber_test @@ -4209,6 +4713,7 @@ elif enabled gcc; then check_cflags -Werror=missing-prototypes check_cflags -Werror=return-type check_cflags -Werror=vla + enabled extra_warnings || check_disable_warning -Wno-maybe-uninitialized elif enabled llvm_gcc; then check_cflags -mllvm -stack-alignment=16 elif enabled clang; then @@ -4217,6 +4722,9 @@ elif enabled clang; then check_cflags -Werror=implicit-function-declaration check_cflags -Werror=missing-prototypes check_cflags -Werror=return-type +elif enabled cparser; then + add_cflags -Wno-missing-variable-declarations + add_cflags -Wno-empty-statement elif enabled armcc; then # 2523: use of inline assembler is deprecated add_cflags -W${armcc_opt},--diag_suppress=2523 @@ -4227,10 +4735,24 @@ elif enabled armcc; then add_cflags -W${armcc_opt},--diag_suppress=513 # pointer sign elif enabled tms470; then add_cflags -pds=824 -pds=837 + disable inline_asm elif enabled pathscale; then add_cflags -fstrict-overflow -OPT:wrap_around_unsafe_opt=OFF -elif enabled msvc; then +elif enabled_any msvc icl; then enabled x86_32 && disable aligned_stack + enabled_all x86_32 debug && add_cflags -Oy- + enabled debug && add_ldflags -debug + enable pragma_deprecated + if enabled icl; then + # -Qansi-alias is basically -fstrict-aliasing, but does not work + # (correctly) on icl 13.x. + check_cpp_condition "windows.h" "__ICL < 1300 || __ICL >= 1400" && + add_cflags -Qansi-alias + # icl will pass the inline asm tests but inline asm is currently + # not supported (build will fail) + disabled inline_asm || warn "inline asm disabled due to issues with it in ICL" + disable inline_asm + fi fi case $target_os in @@ -4242,7 +4764,6 @@ case $target_os in ;; esac -enabled_any $THREADS_LIST && enable threads enable frame_thread_encoder enabled asm || { arch=c; disable $ARCH_LIST $ARCH_EXT_LIST; } @@ -4252,6 +4773,8 @@ check_deps $CONFIG_LIST \ $HAVE_LIST \ $ALL_COMPONENTS \ +enabled threads && ! enabled pthreads && ! enabled atomics_native && die "non pthread threading without atomics not supported, try adding --enable-pthreads or --cpu=i486 or higher if you are on x86" + if test $target_os = "haiku"; then disable memalign @@ -4291,6 +4814,11 @@ merge_deps libavfilter $FILTER_LIST echo "install prefix $prefix" echo "source path $source_path" echo "C compiler $cc" +echo "C library $libc_type" +if test "$host_cc" != "$cc"; then + echo "host C compiler $host_cc" + echo "host C library $host_libc_type" +fi echo "ARCH $arch ($cpu)" if test "$build_suffix" != ""; then echo "build suffix $build_suffix" @@ -4313,7 +4841,7 @@ if enabled x86; then echo "SSSE3 enabled ${ssse3-no}" echo "AVX enabled ${avx-no}" echo "FMA4 enabled ${fma4-no}" - echo "CMOV enabled ${cmov-no}" + echo "i686 features enabled ${i686-no}" echo "CMOV is fast ${fast_cmov-no}" echo "EBX available ${ebx_available-no}" echo "EBP available ${ebp_available-no}" @@ -4352,6 +4880,8 @@ echo "network support ${network-no}" echo "threading support ${thread_type-no}" echo "safe bitstream reader ${safe_bitstream_reader-no}" echo "SDL support ${sdl-no}" +echo "opencl enabled ${opencl-no}" +echo "libzvbi enabled ${libzvbi-no}" echo "texi2html enabled ${texi2html-no}" echo "perl enabled ${perl-no}" echo "pod2man enabled ${pod2man-no}" @@ -4384,13 +4914,13 @@ fi echo "License: $license" -echo "Creating config.mak and config.h..." +echo "Creating config.mak, config.h, and doc/config.texi..." -test -e Makefile || $ln_s "$source_path/Makefile" . +test -e Makefile || echo "include $source_path/Makefile" > Makefile enabled stripping || strip="echo skipping strip" -config_files="$TMPH config.mak" +config_files="$TMPH config.mak doc/config.texi" cat > config.mak <<EOF # Automatically generated by configure - do not modify! @@ -4403,6 +4933,7 @@ SHLIBDIR=\$(DESTDIR)$shlibdir INCDIR=\$(DESTDIR)$incdir BINDIR=\$(DESTDIR)$bindir DATADIR=\$(DESTDIR)$datadir +DOCDIR=\$(DESTDIR)$docdir MANDIR=\$(DESTDIR)$mandir SRC_PATH=$source_path ifndef MAIN_MAKEFILE @@ -4424,9 +4955,9 @@ AR=$ar ARFLAGS=$arflags AR_O=$ar_o RANLIB=$ranlib +STRIP=$strip CP=cp -p LN_S=$ln_s -STRIP=$strip CPPFLAGS=$CPPFLAGS CFLAGS=$CFLAGS CXXFLAGS=$CXXFLAGS @@ -4442,9 +4973,11 @@ LD_O=$LD_O LD_LIB=$LD_LIB LD_PATH=$LD_PATH DLLTOOL=$dlltool +WINDRES=$windres +DEPWINDRES=$dep_cc LDFLAGS=$LDFLAGS -LDFLAGS-ffserver=$FFSERVERLDFLAGS SHFLAGS=$(echo $($ldflags_filter $SHFLAGS)) +ASMSTRIPFLAGS=$ASMSTRIPFLAGS YASMFLAGS=$YASMFLAGS BUILDSUF=$build_suffix PROGSSUF=$progs_suffix @@ -4478,8 +5011,9 @@ HOSTCC_DEPFLAGS=$HOSTCC_DEPFLAGS HOSTCC_C=$HOSTCC_C HOSTCC_O=$HOSTCC_O HOSTLD_O=$HOSTLD_O -TARGET_EXEC=$target_exec +TARGET_EXEC=$target_exec $target_exec_args TARGET_PATH=$target_path +TARGET_SAMPLES=${target_samples:-\$(SAMPLES)} LIBS-ffplay=$sdl_libs CFLAGS-ffplay=$sdl_cflags ZLIB=$($ldflags_filter -lz) @@ -4507,6 +5041,7 @@ get_version(){ name=$(toupper $lcname) file=$source_path/$lcname/version.h eval $(awk "/#define ${name}_VERSION_M/ { print \$2 \"=\" \$3 }" "$file") + enabled raise_major && eval ${name}_VERSION_MAJOR=$((${name}_VERSION_MAJOR+100)) eval ${name}_VERSION=\$${name}_VERSION_MAJOR.\$${name}_VERSION_MINOR.\$${name}_VERSION_MICRO eval echo "${lcname}_VERSION=\$${name}_VERSION" >> config.mak eval echo "${lcname}_VERSION_MAJOR=\$${name}_VERSION_MAJOR" >> config.mak @@ -4521,12 +5056,14 @@ cat > $TMPH <<EOF #define FFMPEG_CONFIG_H #define FFMPEG_CONFIGURATION "$(c_escape $FFMPEG_CONFIGURATION)" #define FFMPEG_LICENSE "$(c_escape $license)" +#define CONFIG_THIS_YEAR 2013 #define FFMPEG_DATADIR "$(eval c_escape $datadir)" #define AVCONV_DATADIR "$(eval c_escape $datadir)" #define CC_IDENT "$(c_escape ${cc_ident:-Unknown compiler})" #define av_restrict $_restrict #define EXTERN_PREFIX "${extern_prefix}" #define EXTERN_ASM ${extern_prefix} +#define BUILDSUF "$build_suffix" #define SLIBSUF "$SLIBSUF" #define HAVE_MMX2 HAVE_MMXEXT EOF @@ -4542,6 +5079,12 @@ if enabled yasm; then printf '' >$TMPASM fi +enabled getenv || echo "#define getenv(x) NULL" >> $TMPH + + +mkdir -p doc +echo "@c auto-generated by configure" > doc/config.texi + print_config ARCH_ "$config_files" $ARCH_LIST print_config HAVE_ "$config_files" $HAVE_LIST print_config CONFIG_ "$config_files" $CONFIG_LIST \ @@ -4597,7 +5140,7 @@ Version: $version Requires: $(enabled shared || echo $requires) Requires.private: $(enabled shared && echo $requires) Conflicts: -Libs: -L\${libdir} -l${shortname} $(enabled shared || echo $libs) +Libs: -L\${libdir} $(enabled rpath && echo "-Wl,-rpath,\${libdir}") -l${shortname} $(enabled shared || echo $libs) Libs.private: $(enabled shared && echo $libs) Cflags: -I\${includedir} EOF @@ -4616,32 +5159,32 @@ Description: $comment Version: $version Requires: $requires Conflicts: -Libs: -L\${libdir} -l${shortname} $(enabled shared || echo $libs) +Libs: -L\${libdir} -Wl,-rpath,\${libdir} -l${shortname} $(enabled shared || echo $libs) Cflags: -I\${includedir} EOF } -libavfilter_pc_deps="libavutil${build_suffix} = $LIBAVUTIL_VERSION" -enabled libavfilter_deps_avcodec && prepend libavfilter_pc_deps "libavcodec${build_suffix} = $LIBAVCODEC_VERSION," -enabled libavfilter_deps_avformat && prepend libavfilter_pc_deps "libavformat${build_suffix} = $LIBAVFORMAT_VERSION," -enabled libavfilter_deps_avresample && prepend libavfilter_pc_deps "libavresample${build_suffix} = $LIBAVRESAMPLE_VERSION," -enabled libavfilter_deps_swscale && prepend libavfilter_pc_deps "libswscale${build_suffix} = $LIBSWSCALE_VERSION," -enabled libavfilter_deps_swresample && prepend libavfilter_pc_deps "libswresample${build_suffix} = $LIBSWRESAMPLE_VERSION," -enabled libavfilter_deps_postproc && prepend libavfilter_pc_deps "libpostproc${build_suffix} = $LIBPOSTPROC_VERSION," -libavfilter_pc_deps=${libavfilter_pc_deps%, } - -libavdevice_pc_deps="libavformat${build_suffix} = $LIBAVFORMAT_VERSION" -enabled lavfi_indev && prepend libavdevice_pc_deps "libavfilter${build_suffix} = $LIBAVFILTER_VERSION," - -pkgconfig_generate libavutil "FFmpeg utility library" "$LIBAVUTIL_VERSION" "$LIBM" -pkgconfig_generate libavcodec "FFmpeg codec library" "$LIBAVCODEC_VERSION" "$extralibs" "libavutil${build_suffix} = $LIBAVUTIL_VERSION" -pkgconfig_generate libavformat "FFmpeg container format library" "$LIBAVFORMAT_VERSION" "$extralibs" "libavcodec${build_suffix} = $LIBAVCODEC_VERSION" -pkgconfig_generate libavdevice "FFmpeg device handling library" "$LIBAVDEVICE_VERSION" "$extralibs" "$libavdevice_pc_deps" -pkgconfig_generate libavfilter "FFmpeg audio/video filtering library" "$LIBAVFILTER_VERSION" "$extralibs" "$libavfilter_pc_deps" -pkgconfig_generate libpostproc "FFmpeg postprocessing library" "$LIBPOSTPROC_VERSION" "" "libavutil${build_suffix} = $LIBAVUTIL_VERSION" -pkgconfig_generate libavresample "Libav audio resampling library" "$LIBAVRESAMPLE_VERSION" "$extralibs" "libavutil${build_suffix} = $LIBAVUTIL_VERSION" -pkgconfig_generate libswscale "FFmpeg image rescaling library" "$LIBSWSCALE_VERSION" "$LIBM" "libavutil${build_suffix} = $LIBAVUTIL_VERSION" -pkgconfig_generate libswresample "FFmpeg audio resampling library" "$LIBSWRESAMPLE_VERSION" "$LIBM" "libavutil${build_suffix} = $LIBAVUTIL_VERSION" +lavfi_libs="libavutil${build_suffix} = $LIBAVUTIL_VERSION" +enabled libavfilter_deps_avcodec && prepend lavfi_libs "libavcodec${build_suffix} = $LIBAVCODEC_VERSION," +enabled libavfilter_deps_avformat && prepend lavfi_libs "libavformat${build_suffix} = $LIBAVFORMAT_VERSION," +enabled libavfilter_deps_avresample && prepend lavfi_libs "libavresample${build_suffix} = $LIBAVRESAMPLE_VERSION," +enabled libavfilter_deps_swscale && prepend lavfi_libs "libswscale${build_suffix} = $LIBSWSCALE_VERSION," +enabled libavfilter_deps_swresample && prepend lavfi_libs "libswresample${build_suffix} = $LIBSWRESAMPLE_VERSION," +enabled libavfilter_deps_postproc && prepend lavfi_libs "libpostproc${build_suffix} = $LIBPOSTPROC_VERSION," +lavfi_libs=${lavfi_libs%, } + +lavd_libs="libavformat${build_suffix} = $LIBAVFORMAT_VERSION" +enabled lavfi_indev && prepend lavd_libs "libavfilter${build_suffix} = $LIBAVFILTER_VERSION," + +pkgconfig_generate libavutil "FFmpeg utility library" "$LIBAVUTIL_VERSION" "$LIBM" +pkgconfig_generate libavcodec "FFmpeg codec library" "$LIBAVCODEC_VERSION" "$extralibs" "libavutil${build_suffix} = $LIBAVUTIL_VERSION" +pkgconfig_generate libavformat "FFmpeg container format library" "$LIBAVFORMAT_VERSION" "$extralibs" "libavcodec${build_suffix} = $LIBAVCODEC_VERSION" +pkgconfig_generate libavdevice "FFmpeg device handling library" "$LIBAVDEVICE_VERSION" "$extralibs" "$lavd_libs" +pkgconfig_generate libavfilter "FFmpeg audio/video filtering library" "$LIBAVFILTER_VERSION" "$extralibs" "$lavfi_libs" +pkgconfig_generate libpostproc "FFmpeg postprocessing library" "$LIBPOSTPROC_VERSION" "" "libavutil${build_suffix} = $LIBAVUTIL_VERSION" +pkgconfig_generate libavresample "Libav audio resampling library" "$LIBAVRESAMPLE_VERSION" "$extralibs" "libavutil${build_suffix} = $LIBAVUTIL_VERSION" +pkgconfig_generate libswscale "FFmpeg image rescaling library" "$LIBSWSCALE_VERSION" "$LIBM" "libavutil${build_suffix} = $LIBAVUTIL_VERSION" +pkgconfig_generate libswresample "FFmpeg audio resampling library" "$LIBSWRESAMPLE_VERSION" "$LIBM" "libavutil${build_suffix} = $LIBAVUTIL_VERSION" fix_ffmpeg_remote(){ git_remote_from=$1 |
