Skip to content
Snippets Groups Projects
configure 232 KiB
Newer Older
  • Learn to ignore specific revisions
  • libx264rgb_encoder_select="libx264_encoder"
    
    Derek Buitenhuis's avatar
    Derek Buitenhuis committed
    libx265_encoder_deps="libx265"
    
    libxavs_encoder_deps="libxavs"
    
    libzvbi_teletext_decoder_deps="libzvbi"
    
    videotoolbox_suggest="coreservices"
    videotoolbox_deps="corefoundation coremedia corevideo"
    
    videotoolbox_encoder_deps="videotoolbox VTCompressionSessionPrepareToEncodeFrames"
    
    # demuxers / muxers
    
    ac3_demuxer_select="ac3_parser"
    
    asf_demuxer_select="riffdec"
    
    asf_o_demuxer_select="riffdec"
    
    asf_muxer_select="riffenc"
    
    asf_stream_muxer_select="asf_muxer"
    
    avi_demuxer_select="iso_media riffdec exif"
    
    avi_muxer_select="riffenc"
    
    caf_demuxer_select="iso_media riffdec"
    
    dash_muxer_select="mp4_muxer"
    
    dash_demuxer_deps="libxml2"
    
    dirac_demuxer_select="dirac_parser"
    
    dts_demuxer_select="dca_parser"
    
    Paul B Mahol's avatar
    Paul B Mahol committed
    dtshd_demuxer_select="dca_parser"
    
    dv_demuxer_select="dvprofile"
    dv_muxer_select="dvprofile"
    
    dxa_demuxer_select="riffdec"
    
    f4v_muxer_select="mov_muxer"
    
    fifo_muxer_deps="threads"
    
    flac_demuxer_select="flac_parser"
    
    hds_muxer_select="flv_muxer"
    
    hls_muxer_select="mpegts_muxer"
    
    image2_alias_pix_demuxer_select="image2_demuxer"
    image2_brender_pix_demuxer_select="image2_demuxer"
    
    ismv_muxer_select="mov_muxer"
    
    matroska_audio_muxer_select="matroska_muxer"
    
    matroska_demuxer_select="iso_media riffdec"
    
    matroska_demuxer_suggest="bzlib lzo zlib"
    
    matroska_muxer_select="iso_media riffenc"
    
    mmf_muxer_select="riffenc"
    
    mov_demuxer_select="iso_media riffdec"
    
    mov_demuxer_suggest="zlib"
    
    mov_muxer_select="iso_media riffenc rtpenc_chain"
    
    mp3_demuxer_select="mpegaudio_parser"
    
    mp3_muxer_select="mpegaudioheader"
    
    mpegts_demuxer_select="iso_media"
    
    mpegts_muxer_select="adts_muxer latm_muxer"
    
    mpegtsraw_demuxer_select="mpegts_demuxer"
    mxf_d10_muxer_select="mxf_muxer"
    
    mxf_opatom_muxer_select="mxf_muxer"
    
    nut_muxer_select="riffenc"
    
    nuv_demuxer_select="riffdec"
    
    oga_muxer_select="ogg_muxer"
    
    ogg_demuxer_select="dirac_parse"
    
    ogv_muxer_select="ogg_muxer"
    
    opus_muxer_select="ogg_muxer"
    
    rtpdec_select="asf_demuxer jpegtables mov_demuxer mpegts_demuxer rm_demuxer rtp_protocol srtp"
    
    rtsp_demuxer_select="http_protocol rtpdec"
    
    rtsp_muxer_select="rtp_muxer http_protocol rtp_protocol rtpenc_chain"
    
    Martin Storsjö's avatar
    Martin Storsjö committed
    sap_demuxer_select="sdp_demuxer"
    
    sap_muxer_select="rtp_muxer rtp_protocol rtpenc_chain"
    
    smoothstreaming_muxer_select="ismv_muxer"
    
    spdif_demuxer_select="adts_header"
    spdif_muxer_select="adts_header"
    
    spx_muxer_select="ogg_muxer"
    
    swf_demuxer_suggest="zlib"
    
    tak_demuxer_select="tak_parser"
    
    tg2_muxer_select="mov_muxer"
    tgp_muxer_select="mov_muxer"
    
    Clément Bœsch's avatar
    Clément Bœsch committed
    vobsub_demuxer_select="mpegps_demuxer"
    
    w64_muxer_select="wav_muxer"
    
    wav_demuxer_select="riffdec"
    
    wav_muxer_select="riffenc"
    
    webm_muxer_select="iso_media riffenc"
    
    webm_dash_manifest_demuxer_select="matroska_demuxer"
    
    wtv_demuxer_select="mpegts_demuxer riffdec"
    
    wtv_muxer_select="mpegts_muxer riffenc"
    
    xmv_demuxer_select="riffdec"
    xwma_demuxer_select="riffdec"
    
    android_camera_indev_deps="android camera2ndk mediandk pthreads"
    android_camera_indev_extralibs="-landroid -lcamera2ndk -lmediandk"
    
    alsa_indev_deps="alsa"
    alsa_outdev_deps="alsa"
    
    avfoundation_indev_deps="avfoundation corevideo coremedia pthreads"
    avfoundation_indev_suggest="coregraphics applicationservices"
    avfoundation_indev_extralibs="-framework Foundation"
    
    bktr_indev_deps_any="dev_bktr_ioctl_bt848_h machine_ioctl_bt848_h dev_video_bktr_ioctl_bt848_h dev_ic_bt8xx_h"
    
    Paul B Mahol's avatar
    Paul B Mahol committed
    caca_outdev_deps="libcaca"
    
    decklink_deps_any="libdl LoadLibrary"
    decklink_indev_deps="decklink threads"
    
    decklink_indev_extralibs="-lstdc++"
    
    decklink_outdev_deps="decklink threads"
    
    decklink_outdev_extralibs="-lstdc++"
    
    libndi_newtek_indev_deps="libndi_newtek"
    
    libndi_newtek_indev_extralibs="-lndi"
    
    libndi_newtek_outdev_deps="libndi_newtek"
    
    libndi_newtek_outdev_extralibs="-lndi"
    
    Ramiro Polla's avatar
    Ramiro Polla committed
    dshow_indev_deps="IBaseFilter"
    
    dshow_indev_extralibs="-lpsapi -lole32 -lstrmiids -luuid -loleaut32 -lshlwapi"
    
    fbdev_indev_deps="linux_fb_h"
    
    fbdev_outdev_deps="linux_fb_h"
    
    gdigrab_indev_deps="CreateDIBSection"
    gdigrab_indev_extralibs="-lgdi32"
    gdigrab_indev_select="bmp_decoder"
    
    jack_indev_deps="libjack"
    
    jack_indev_deps_any="sem_timedwait dispatch_dispatch_h"
    
    kmsgrab_indev_deps="libdrm"
    
    lavfi_indev_deps="avfilter"
    
    libcdio_indev_deps="libcdio"
    
    libdc1394_indev_deps="libdc1394"
    
    openal_indev_deps="openal"
    
    Lukasz Marek's avatar
    Lukasz Marek committed
    opengl_outdev_deps="opengl"
    
    oss_indev_deps_any="sys_soundcard_h"
    oss_outdev_deps_any="sys_soundcard_h"
    
    pulse_indev_deps="libpulse"
    
    Lukasz Marek's avatar
    Lukasz Marek committed
    pulse_outdev_deps="libpulse"
    
    sdl2_outdev_deps="sdl2"
    
    sndio_indev_deps="sndio"
    sndio_outdev_deps="sndio"
    
    v4l2_indev_deps_any="linux_videodev2_h sys_videoio_h"
    
    v4l2_indev_suggest="libv4l2"
    
    Clément Bœsch's avatar
    Clément Bœsch committed
    v4l2_outdev_deps_any="linux_videodev2_h sys_videoio_h"
    
    v4l2_outdev_suggest="libv4l2"
    
    vfwcap_indev_deps="vfw32 vfwcap_defines"
    
    xcbgrab_indev_deps="libxcb"
    
    xcbgrab_indev_suggest="libxcb_shm libxcb_shape libxcb_xfixes"
    
    xv_outdev_deps="X11_extensions_Xvlib_h XvGetPortAttribute"
    xv_outdev_extralibs="-lXv -lX11 -lXext"
    
    # protocols
    
    async_protocol_deps="threads"
    
    Petri Hintukainen's avatar
    Petri Hintukainen committed
    bluray_protocol_deps="libbluray"
    
    ffrtmpcrypt_protocol_conflict="librtmp_protocol"
    
    ffrtmpcrypt_protocol_deps_any="gcrypt gmp openssl"
    
    Samuel Pitoiset's avatar
    Samuel Pitoiset committed
    ffrtmpcrypt_protocol_select="tcp_protocol"
    
    ffrtmphttp_protocol_conflict="librtmp_protocol"
    
    ffrtmphttp_protocol_select="http_protocol"
    
    Lukasz Marek's avatar
    Lukasz Marek committed
    ftp_protocol_select="tcp_protocol"
    
    http_protocol_select="tcp_protocol"
    
    http_protocol_suggest="zlib"
    
    httpproxy_protocol_select="tcp_protocol"
    
    httpproxy_protocol_suggest="zlib"
    
    https_protocol_select="tls_protocol"
    
    https_protocol_suggest="zlib"
    
    Marvin Scholz's avatar
    Marvin Scholz committed
    icecast_protocol_select="http_protocol"
    
    librtmp_protocol_deps="librtmp"
    librtmpe_protocol_deps="librtmp"
    librtmps_protocol_deps="librtmp"
    librtmpt_protocol_deps="librtmp"
    librtmpte_protocol_deps="librtmp"
    
    libsmbclient_protocol_deps="libsmbclient gplv3"
    
    libssh_protocol_deps="libssh"
    
    libtls_conflict="openssl gnutls"
    
    Måns Rullgård's avatar
    Måns Rullgård committed
    mmsh_protocol_select="http_protocol"
    
    rtmp_protocol_conflict="librtmp_protocol"
    
    rtmp_protocol_select="tcp_protocol"
    
    rtmp_protocol_suggest="zlib"
    
    Samuel Pitoiset's avatar
    Samuel Pitoiset committed
    rtmpe_protocol_select="ffrtmpcrypt_protocol"
    
    rtmpe_protocol_suggest="zlib"
    
    rtmps_protocol_conflict="librtmp_protocol"
    
    Samuel Pitoiset's avatar
    Samuel Pitoiset committed
    rtmps_protocol_select="tls_protocol"
    
    rtmps_protocol_suggest="zlib"
    
    rtmpt_protocol_select="ffrtmphttp_protocol"
    
    rtmpt_protocol_suggest="zlib"
    
    Samuel Pitoiset's avatar
    Samuel Pitoiset committed
    rtmpte_protocol_select="ffrtmpcrypt_protocol ffrtmphttp_protocol"
    
    rtmpte_protocol_suggest="zlib"
    
    rtmpts_protocol_select="ffrtmphttp_protocol https_protocol"
    
    rtmpts_protocol_suggest="zlib"
    
    rtp_protocol_select="udp_protocol"
    
    schannel_conflict="openssl gnutls libtls"
    
    sctp_protocol_deps="struct_sctp_event_subscribe struct_msghdr_msg_flags"
    
    securetransport_conflict="openssl gnutls libtls"
    
    srtp_protocol_select="rtp_protocol srtp"
    
    tls_protocol_deps_any="gnutls openssl schannel securetransport libtls"
    
    tls_protocol_select="tcp_protocol"
    
    udplite_protocol_select="network"
    
    Luca Barbato's avatar
    Luca Barbato committed
    unix_protocol_deps="sys_un_h"
    unix_protocol_select="network"
    
    Paul B Mahol's avatar
    Paul B Mahol committed
    afftfilt_filter_deps="avcodec"
    afftfilt_filter_select="fft"
    
    afir_filter_deps="avcodec"
    afir_filter_select="fft"
    
    amovie_filter_deps="avcodec avformat"
    
    aresample_filter_deps="swresample"
    
    ass_filter_deps="libass"
    
    atempo_filter_deps="avcodec"
    atempo_filter_select="rdft"
    
    Stefano Sabatini's avatar
    Stefano Sabatini committed
    azmq_filter_deps="libzmq"
    
    blackframe_filter_deps="gpl"
    
    boxblur_filter_deps="gpl"
    
    bs2b_filter_deps="libbs2b"
    
    colormatrix_filter_deps="gpl"
    
    convolve_filter_deps="avcodec"
    convolve_filter_select="fft"
    
    coreimage_filter_deps="coreimage appkit"
    coreimage_filter_extralibs="-framework OpenGL"
    coreimagesrc_filter_deps="coreimage appkit"
    coreimagesrc_filter_extralibs="-framework OpenGL"
    
    cover_rect_filter_deps="avcodec avformat gpl"
    
    cropdetect_filter_deps="gpl"
    
    deconvolve_filter_deps="avcodec"
    deconvolve_filter_select="fft"
    
    deinterlace_qsv_filter_deps="libmfx"
    
    deinterlace_vaapi_filter_deps="vaapi"
    
    delogo_filter_deps="gpl"
    
    denoise_vaapi_filter_deps="vaapi VAProcPipelineParameterBuffer"
    
    deshake_filter_select="pixelutils"
    
    drawtext_filter_deps="libfreetype"
    
    drawtext_filter_suggest="libfontconfig libfribidi"
    
    elbg_filter_deps="avcodec"
    
    eq_filter_deps="gpl"
    
    fftfilt_filter_deps="avcodec"
    fftfilt_filter_select="rdft"
    
    find_rect_filter_deps="avcodec avformat gpl"
    
    firequalizer_filter_deps="avcodec"
    firequalizer_filter_select="rdft"
    
    flite_filter_deps="libflite"
    
    framerate_filter_select="pixelutils"
    
    frei0r_filter_deps="frei0r libdl"
    frei0r_src_filter_deps="frei0r libdl"
    
    fspp_filter_deps="gpl"
    
    Clément Bœsch's avatar
    Clément Bœsch committed
    geq_filter_deps="gpl"
    
    histeq_filter_deps="gpl"
    
    hqdn3d_filter_deps="gpl"
    
    interlace_filter_deps="gpl"
    
    kerndeint_filter_deps="gpl"
    
    ladspa_filter_deps="ladspa libdl"
    
    lv2_filter_deps="lv2"
    
    mcdeint_filter_deps="avcodec gpl"
    
    movie_filter_deps="avcodec avformat"
    
    mpdecimate_filter_deps="gpl"
    mpdecimate_filter_select="pixelutils"
    
    mptestsrc_filter_deps="gpl"
    
    negate_filter_deps="lut_filter"
    
    nnedi_filter_deps="gpl"
    
    Paul B Mahol's avatar
    Paul B Mahol committed
    ocr_filter_deps="libtesseract"
    
    openclsrc_filter_deps="opencl"
    
    overlay_opencl_filter_deps="opencl"
    
    overlay_qsv_filter_deps="libmfx"
    overlay_qsv_filter_select="qsvvpp"
    
    owdenoise_filter_deps="gpl"
    
    pan_filter_deps="swresample"
    
    perspective_filter_deps="gpl"
    
    phase_filter_deps="gpl"
    
    pp7_filter_deps="gpl"
    
    Clément Bœsch's avatar
    Clément Bœsch committed
    pp_filter_deps="gpl postproc"
    
    procamp_vaapi_filter_deps="vaapi VAProcPipelineParameterBuffer"
    
    program_opencl_filter_deps="opencl"
    
    pullup_filter_deps="gpl"
    
    removelogo_filter_deps="avcodec avformat swscale"
    
    repeatfields_filter_deps="gpl"
    
    resample_filter_deps="avresample"
    
    rubberband_filter_deps="librubberband"
    
    sab_filter_deps="gpl swscale"
    
    scale2ref_filter_deps="swscale"
    
    scale_filter_deps="swscale"
    
    scale_qsv_filter_deps="libmfx"
    
    select_filter_select="pixelutils"
    
    sharpness_vaapi_filter_deps="vaapi VAProcPipelineParameterBuffer"
    
    showcqt_filter_deps="avcodec avformat swscale"
    
    showcqt_filter_suggest="libfontconfig libfreetype"
    
    showcqt_filter_select="fft"
    
    showfreqs_filter_deps="avcodec"
    showfreqs_filter_select="fft"
    
    showspectrum_filter_select="fft"
    showspectrumpic_filter_deps="avcodec"
    showspectrumpic_filter_select="fft"
    
    signature_filter_deps="gpl avcodec avformat"
    
    smartblur_filter_deps="gpl swscale"
    
    sofalizer_filter_deps="libmysofa avcodec"
    
    spectrumsynth_filter_deps="avcodec"
    spectrumsynth_filter_select="fft"
    
    spp_filter_select="fft idctdsp fdctdsp me_cmp pixblockdsp"
    
    stereo3d_filter_deps="gpl"
    
    subtitles_filter_deps="avformat avcodec libass"
    
    super2xsai_filter_deps="gpl"
    
    pixfmts_super2xsai_test_deps="super2xsai_filter"
    
    tinterlace_filter_deps="gpl"
    
    tinterlace_merge_test_deps="tinterlace_filter"
    tinterlace_pad_test_deps="tinterlace_filter"
    
    tonemap_filter_deps="const_nan"
    
    unsharp_opencl_filter_deps="opencl"
    
    Arwa Arif's avatar
    Arwa Arif committed
    uspp_filter_deps="gpl avcodec"
    
    vaguedenoiser_filter_deps="gpl"
    
    vidstabdetect_filter_deps="libvidstab"
    vidstabtransform_filter_deps="libvidstab"
    
    libvmaf_filter_deps="libvmaf pthreads"
    
    Stefano Sabatini's avatar
    Stefano Sabatini committed
    zmq_filter_deps="libzmq"
    
    Paul B Mahol's avatar
    Paul B Mahol committed
    zoompan_filter_deps="swscale"
    
    zscale_filter_deps="libzimg const_nan"
    
    Mark Thompson's avatar
    Mark Thompson committed
    scale_vaapi_filter_deps="vaapi VAProcPipelineParameterBuffer"
    
    vpp_qsv_filter_deps="libmfx"
    vpp_qsv_filter_select="qsvvpp"
    
    avio_dir_cmd_deps="avformat avutil"
    avio_reading_deps="avformat avcodec avutil"
    
    decode_audio_example_deps="avcodec avutil"
    
    decode_video_example_deps="avcodec avutil"
    
    demuxing_decoding_example_deps="avcodec avformat avutil"
    
    encode_audio_example_deps="avcodec avutil"
    
    encode_video_example_deps="avcodec avutil"
    
    extract_mvs_example_deps="avcodec avformat avutil"
    
    filter_audio_example_deps="avfilter avutil"
    
    filtering_audio_example_deps="avfilter avcodec avformat avutil"
    filtering_video_example_deps="avfilter avcodec avformat avutil"
    
    http_multiclient_example_deps="avformat avutil fork"
    
    hw_decode_example_deps="avcodec avformat avutil"
    
    metadata_example_deps="avformat avutil"
    
    muxing_example_deps="avcodec avformat avutil swscale"
    
    qsvdec_example_deps="avcodec avutil libmfx h264_qsv_decoder"
    
    remuxing_example_deps="avcodec avformat avutil"
    
    resampling_audio_example_deps="avutil swresample"
    scaling_video_example_deps="avutil swscale"
    
    transcode_aac_example_deps="avcodec avformat swresample"
    
    transcoding_example_deps="avfilter avcodec avformat avutil"
    
    vaapi_encode_example_deps="avcodec avutil h264_vaapi_encoder"
    
    vaapi_transcode_example_deps="avcodec avformat avutil h264_vaapi_encoder"
    
    # EXTRALIBS_LIST
    cpu_init_extralibs="pthreads_extralibs"
    cws2fws_extralibs="zlib_extralibs"
    
    
    # libraries, in linking order
    
    avcodec_select="null_bsf"
    
    avdevice_deps="avformat avcodec avutil"
    
    avformat_deps="avcodec avutil"
    
    avformat_suggest="libm network zlib"
    
    avresample_suggest="libm"
    
    avutil_suggest="clock_gettime cuda libm libdrm libmfx opencl user32 vaapi videotoolbox corefoundation corevideo coremedia wincrypt"
    
    postproc_deps="avutil gpl"
    
    swresample_deps="avutil"
    
    swresample_suggest="libm libsoxr"
    
    avcodec_extralibs="pthreads_extralibs iconv_extralibs"
    avfilter_extralibs="pthreads_extralibs"
    
    avutil_extralibs="d3d11va_extralibs nanosleep_extralibs pthreads_extralibs vaapi_drm_extralibs vaapi_x11_extralibs vdpau_x11_extralibs"
    
    # programs
    
    ffmpeg_deps="avcodec avfilter avformat swresample"
    
    ffmpeg_select="aformat_filter anull_filter atrim_filter format_filter
                   null_filter
    
    ffmpeg_suggest="ole32 psapi shell32"
    
    Marton Balint's avatar
    Marton Balint committed
    ffplay_deps="avcodec avformat swscale swresample sdl2"
    
    ffplay_select="rdft crop_filter transpose_filter hflip_filter vflip_filter rotate_filter"
    
    ffplay_suggest="shell32"
    
    ffprobe_suggest="shell32"
    
    # documentation
    podpages_deps="perl"
    manpages_deps="perl pod2man"
    
    htmlpages_deps="perl"
    htmlpages_deps_any="makeinfo_html texi2html"
    
    txtpages_deps="perl makeinfo"
    
    doc_deps_any="manpages htmlpages podpages txtpages"
    
    Fabrice Bellard's avatar
    Fabrice Bellard committed
    # default parameters
    
    logfile="ffbuild/config.log"
    
    
    # installation paths
    
    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'
    
    ar_default="ar"
    
    Mohamed Naufal's avatar
    Mohamed Naufal committed
    cxx_default="g++"
    
    host_cc_default="gcc"
    
    doxygen_default="doxygen"
    
    ln_s_default="ln -s -f"
    
    nm_default="nm -g"
    
    pkg_config_default=pkg-config
    
    version_script='--version-script'
    
    x86asmexe_default="nasm"
    
    windres_default="windres"
    
    nvcc_default="nvcc"
    nvccflags_default="-gencode arch=compute_30,code=sm_30 -O2"
    
    target_os_default=$(tolower $(uname -s))
    host_os=$target_os_default
    
    # machine
    if test "$target_os_default" = aix; then
        arch_default=$(uname -p)
    
        strip_default="strip -X32_64"
    
    else
        arch_default=$(uname -m)
    fi
    cpu="generic"
    
    # configurable options
    
    enable $DOCUMENT_LIST
    
    enable $EXAMPLE_LIST
    enable $(filter_out avresample $LIBRARY_LIST)
    
    enable faan faandct faanidct
    
    enable runtime_cpudetect
    
    enable safe_bitstream_reader
    
    enable static
    
    sws_max_filter_size_default=256
    set_default sws_max_filter_size
    
    
    # internal components are enabled by default
    enable $EXTRALIBS_LIST
    
    
    # Avoid external, non-system, libraries getting enabled by dependency resolution
    
    disable $EXTERNAL_LIBRARY_LIST $HWACCEL_LIBRARY_LIST
    
    # build settings
    
    SHFLAGS='-shared -Wl,-soname,$$(@F)'
    
    FULLNAME='$(NAME)$(BUILDSUF)'
    LIBNAME='$(LIBPREF)$(FULLNAME)$(LIBSUF)'
    
    SLIBNAME='$(SLIBPREF)$(FULLNAME)$(SLIBSUF)'
    
    SLIBNAME_WITH_VERSION='$(SLIBNAME).$(LIBVERSION)'
    SLIBNAME_WITH_MAJOR='$(SLIBNAME).$(LIBMAJOR)'
    
    Måns Rullgård's avatar
    Måns Rullgård committed
    LIB_INSTALL_EXTRA_CMD='$$(RANLIB) "$(LIBDIR)/$(LIBNAME)"'
    
    SLIB_INSTALL_NAME='$(SLIBNAME_WITH_VERSION)'
    SLIB_INSTALL_LINKS='$(SLIBNAME_WITH_MAJOR) $(SLIBNAME)'
    
    VERSION_SCRIPT_POSTPROCESS_CMD="cat"
    
    asflags_filter=echo
    cflags_filter=echo
    
    ldflags_filter=echo
    
    
    Mohamed Naufal's avatar
    Mohamed Naufal committed
    CXX_O='-o $@'
    
    Luca Barbato's avatar
    Luca Barbato committed
    OBJCC_C='-c'
    OBJCC_E='-E -o $@'
    OBJCC_O='-o $@'
    
    HOSTCC_E='-E -o $@'
    
    HOSTLD_O='-o $@'
    
    host_cflags_filter=echo
    host_ldflags_filter=echo
    
    target_path='$(CURDIR)'
    
    # since the object filename is not given with the -MM flag, the compiler
    # is only able to print the basename, and we must add the path ourselves
    
    DEPCMD='$(DEP$(1)) $(DEP$(1)FLAGS) $($(1)DEP_FLAGS) $< 2>/dev/null | sed -e "/^\#.*/d" -e "s,^[[:space:]]*$(@F),$(@D)/$(@F)," > $(@:.o=.d)'
    
    if test -f configure; then
    
        source_path=.
    
        source_path=$(cd $(dirname "$0"); pwd)
    
        case "$source_path" in
            *[[:blank:]]*) die "Out of tree builds are impossible with whitespace in source path." ;;
        esac
    
        test -e "$source_path/config.h" &&
            die "Out of tree builds are impossible with config.h in source dir."
    
        r=${v#*=}
        l=${v%"$r"}
        r=$(sh_quote "$r")
    
        FFMPEG_CONFIGURATION="${FFMPEG_CONFIGURATION# } ${l}${r}"
    
    find_things(){
        thing=$1
        pattern=$2
        file=$source_path/$3
    
        sed -n "s/^[^#]*$pattern.*([^,]*, *\([^,]*\)\(,.*\)*).*/\1_$thing/p" "$file"
    
    FILTER_LIST=$(find_things   filter   FILTER   libavfilter/allfilters.c)
    
    find_things_extern(){
        thing=$1
        pattern=$2
        file=$source_path/$3
    
        out=${4:-$thing}
        sed -n "s/^[^#]*extern.*$pattern *ff_\([^ ]*\)_$thing;/\1_$out/p" "$file"
    
    OUTDEV_LIST=$(find_things_extern muxer AVOutputFormat libavdevice/alldevices.c outdev)
    INDEV_LIST=$(find_things_extern demuxer AVInputFormat libavdevice/alldevices.c indev)
    
    MUXER_LIST=$(find_things_extern muxer AVOutputFormat libavformat/allformats.c)
    DEMUXER_LIST=$(find_things_extern demuxer AVInputFormat libavformat/allformats.c)
    
    ENCODER_LIST=$(find_things_extern encoder AVCodec libavcodec/allcodecs.c)
    DECODER_LIST=$(find_things_extern decoder AVCodec libavcodec/allcodecs.c)
    CODEC_LIST="
        $ENCODER_LIST
        $DECODER_LIST
    "
    PARSER_LIST=$(find_things_extern parser AVCodecParser libavcodec/parser.c)
    
    BSF_LIST=$(find_things_extern bsf AVBitStreamFilter libavcodec/bitstream_filters.c)
    
    HWACCEL_LIST=$(find_things_extern hwaccel AVHWAccel libavcodec/hwaccels.h)
    
    PROTOCOL_LIST=$(find_things_extern protocol URLProtocol libavformat/protocols.c)
    
    
    AVCODEC_COMPONENTS_LIST="
    
        $BSF_LIST
        $DECODER_LIST
        $ENCODER_LIST
        $HWACCEL_LIST
    
        $PARSER_LIST
    "
    
    AVDEVICE_COMPONENTS_LIST="
    
    "
    
    AVFILTER_COMPONENTS_LIST="
        $FILTER_LIST
    "
    
    AVFORMAT_COMPONENTS_LIST="
        $DEMUXER_LIST
        $MUXER_LIST
    
    ALL_COMPONENTS="
        $AVCODEC_COMPONENTS_LIST
        $AVDEVICE_COMPONENTS_LIST
        $AVFILTER_COMPONENTS_LIST
        $AVFORMAT_COMPONENTS_LIST
    "
    
    
    for n in $COMPONENT_LIST; do
        v=$(toupper ${n%s})_LIST
        eval enable \$$v
        eval ${n}_if_any="\$$v"
    done
    
    
    enable $ARCH_EXT_LIST
    
    
    die_unknown(){
        echo "Unknown option \"$1\"."
        echo "See $0 --help for available options."
        exit 1
    }
    
    
    print_in_columns() {
        cols=$(expr $ncols / 24)
        cat | tr ' ' '\n' | sort | pr -r "-$cols" -w $ncols -t
    
    Ramiro Polla's avatar
    Ramiro Polla committed
        suffix=_$1
        shift
    
        echo $* | sed s/$suffix//g | print_in_columns
    
    rand_list(){
        IFS=', '
        set -- $*
        unset IFS
        for thing; do
            comp=${thing%:*}
            prob=${thing#$comp}
            prob=${prob#:}
            is_in ${comp} $COMPONENT_LIST && eval comp=\$$(toupper ${comp%s})_LIST
            echo "prob ${prob:-0.5}"
            printf '%s\n' $comp
        done
    }
    
    do_random(){
        action=$1
        shift
        random_seed=$(awk "BEGIN { srand($random_seed); print srand() }")
        $action $(rand_list "$@" | awk "BEGIN { srand($random_seed) } \$1 == \"prob\" { prob = \$2; next } rand() < prob { print }")
    }
    
    
            --extra-ldflags=*)
                add_ldflags $optval
    
            --extra-ldexeflags=*)
                add_ldexeflags $optval
            ;;
    
            --extra-ldlibflags=*)
    
                warn "The --extra-ldlibflags option is only provided for compatibility and will be\n"\
                     "removed in the future. Use --extra-ldsoflags instead."
                add_ldsoflags $optval
    
            --extra-libs=*)
                add_extralibs $optval
    
            --disable-devices)
                disable $INDEV_LIST $OUTDEV_LIST
    
            --enable-debug=*)
                debuglevel="$optval"
    
            ;;
            --disable-programs)
                disable $PROGRAM_LIST
            ;;
            --disable-everything)
    
                map 'eval unset \${$(toupper ${v%s})_LIST}' $COMPONENT_LIST
    
                map 'eval unset \${$(toupper ${v%s})_LIST}' $COMPONENT_LIST
    
                disable $LIBRARY_LIST $PROGRAM_LIST doc
    
            --enable-random|--disable-random)
                action=${opt%%-random}
                do_random ${action#--} $COMPONENT_LIST
            ;;
            --enable-random=*|--disable-random=*)
                action=${opt%%-random=*}
                do_random ${action#--} $optval
            ;;
    
            --enable-sdl)
                enable sdl2
            ;;
    
            --enable-*=*|--disable-*=*)
                eval $(echo "${opt%%=*}" | sed 's/--/action=/;s/-/ thing=/')
                is_in "${thing}s" $COMPONENT_LIST || die_unknown "$opt"
                eval list=\$$(toupper $thing)_LIST
                name=$(echo "${optval}" | sed "s/,/_${thing}|/g")_${thing}
    
                list=$(filter "$name" $list)
                [ "$list" = "" ] && warn "Option $opt did not match anything"
                $action $list
    
            --enable-yasm|--disable-yasm)
                warn "The ${opt} option is only provided for compatibility and will be\n"\
                     "removed in the future. Use --enable-x86asm / --disable-x86asm instead."
                test $opt = --enable-yasm && x86asm=yes || x86asm=no
            ;;
            --yasmexe=*)
                warn "The --yasmexe option is only provided for compatibility and will be\n"\
                     "removed in the future. Use --x86asmexe instead."
                x86asmexe="$optval"
            ;;
    
            --enable-?*|--disable-?*)
                eval $(echo "$opt" | sed 's/--/action=/;s/-/ option=/;s/-/_/g')
                if is_in $option $COMPONENT_LIST; then
    
                    test $action = disable && action=unset
    
                    eval $action \$$(toupper ${option%s})_LIST
                elif is_in $option $CMDLINE_SELECT; then
                    $action $option
                else
                    die_unknown $opt
                fi
            ;;
            --list-*)
                NAME="${opt#--list-}"
                is_in $NAME $COMPONENT_LIST || die_unknown $opt
                NAME=${NAME%s}
                eval show_list $NAME \$$(toupper $NAME)_LIST
            ;;
            --help|-h) show_help
            ;;
    
            --fatal-warnings) enable fatal_warnings
            ;;
    
            *)
                optname="${opt%%=*}"
                optname="${optname#--}"
                optname=$(echo "$optname" | sed 's/-/_/g')
                if is_in $optname $CMDLINE_SET; then
                    eval $optname='$optval'
                elif is_in $optname $CMDLINE_APPEND; then
                    append $optname "$optval"
                else
                    die_unknown $opt
                fi
            ;;
    
    if disabled autodetect; then
    
    
        # Unless iconv is explicitely disabled by the user, we still want to probe
        # for the iconv from the libc.
        disabled iconv || enable libc_iconv
    
    
        disable_weak $EXTERNAL_AUTODETECT_LIBRARY_LIST
        disable_weak $HWACCEL_AUTODETECT_LIBRARY_LIST
    fi
    
    # Mark specifically enabled, but normally autodetected libraries as requested.
    for lib in $AUTODETECT_LIBS; do
        enabled $lib && request $lib
    done
    
    #TODO: switch to $AUTODETECT_LIBS when $THREADS_LIST is supported the same way
    enable_weak $EXTERNAL_AUTODETECT_LIBRARY_LIST
    enable_weak $HWACCEL_AUTODETECT_LIBRARY_LIST
    
    Måns Rullgård's avatar
    Måns Rullgård committed
    disabled logging && logfile=/dev/null
    
    
    # command line configuration sanity checks
    
    
    # we need to build at least one lib type
    if ! enabled_any static shared; then
        cat <<EOF
    At least one library type must be built.
    Specify --enable-static to build the static libraries or --enable-shared to
    build the shared libraries as well. To only build the shared libraries specify
    --disable-static in addition to --enable-shared.
    EOF
        exit 1
    fi
    
    
    die_license_disabled() {
        enabled $1 || { enabled $v && die "$v is $1 and --enable-$1 is not specified."; }
    }
    
    
    die_license_disabled_gpl() {
        enabled $1 || { enabled $v && die "$v is incompatible with the gpl and --enable-$1 is not specified."; }
    }
    
    map "die_license_disabled gpl"      $EXTERNAL_LIBRARY_GPL_LIST $EXTERNAL_LIBRARY_GPLV3_LIST
    map "die_license_disabled version3" $EXTERNAL_LIBRARY_VERSION3_LIST $EXTERNAL_LIBRARY_GPLV3_LIST
    
    enabled gpl && map "die_license_disabled_gpl nonfree" $EXTERNAL_LIBRARY_NONFREE_LIST
    map "die_license_disabled nonfree" $HWACCEL_LIBRARY_NONFREE_LIST
    
    
    enabled version3 && { enabled gpl && enable gplv3 || enable lgplv3; }
    
    
    if enabled nonfree; then
        license="nonfree and unredistributable"
    elif enabled gplv3; then
        license="GPL version 3 or later"
    elif enabled lgplv3; then
        license="LGPL version 3 or later"
    elif enabled gpl; then
        license="GPL version 2 or later"
    else
        license="LGPL version 2.1 or later"
    fi
    
    
    enabled_all gnutls openssl &&
        die "GnuTLS and OpenSSL must not be enabled at the same time."
    
    
    # Disable all the library-specific components if the library itself
    # is disabled, see AVCODEC_LIST and following _LIST variables.
    
    disable_components(){
    
            eval components="\$$(toupper ${1})_COMPONENTS"
            map 'eval echo \${$(toupper ${v%s})_LIST}' $components
        )
    }
    
    map 'disable_components $v' $LIBRARY_LIST
    
    
    echo "# $0 $FFMPEG_CONFIGURATION" > $logfile
    
    Måns Rullgård's avatar
    Måns Rullgård committed
    set >> $logfile
    
    
    test -n "$valgrind" && toolchain="valgrind-memcheck"
    
    
    enabled ossfuzz && {
        add_cflags  -fsanitize=address,undefined -fsanitize-coverage=trace-pc-guard,trace-cmp -fno-omit-frame-pointer
        add_ldflags -fsanitize=address,undefined -fsanitize-coverage=trace-pc-guard,trace-cmp
    }
    
    
    case "$toolchain" in
    
        *-asan)
            cc_default="${toolchain%-asan}"
    
            add_cflags  -fsanitize=address
            add_ldflags -fsanitize=address
    
        *-msan)
            cc_default="${toolchain%-msan}"
            add_cflags  -fsanitize=memory -fsanitize-memory-track-origins
            add_ldflags -fsanitize=memory
        ;;
    
        *-tsan)
            cc_default="${toolchain%-tsan}"
    
            add_cflags  -fsanitize=thread -fPIE
    
            add_ldflags -fsanitize=thread -pie
    
            case "$toolchain" in
                gcc-tsan)
                    add_cflags  -fPIC
                    add_ldflags -fPIC
                    ;;
            esac
    
        *-usan)
            cc_default="${toolchain%-usan}"
    
            add_cflags  -fsanitize=undefined
            add_ldflags -fsanitize=undefined
        ;;
    
            target_exec_default="valgrind"
    
            case "$toolchain" in
                valgrind-massif)
    
                    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_args="--error-exitcode=1 --malloc-fill=0x2a --track-origins=yes --leak-check=full --gen-suppressions=all --suppressions=$source_path/tests/fate-valgrind.supp"
    
            # 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
    
                cxx_default="cl"
    
                cxx_default="c99wrap cl"
    
            ld_default="$source_path/compat/windows/mslink"
    
            nm_default="dumpbin -symbols"
    
            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=.
    
            nm_default="dumpbin -symbols"
            ar_default="xilib"
            target_os_default="win32"
    
        gcov)
            add_cflags  -fprofile-arcs -ftest-coverage
            add_ldflags -fprofile-arcs -ftest-coverage
        ;;
    
        llvm-cov)
            add_cflags -fprofile-arcs -ftest-coverage
            add_ldflags --coverage
        ;;
    
            add_cppflags -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2
            add_cflags   -fno-strict-overflow -fstack-protector-all
            add_ldflags  -Wl,-z,relro -Wl,-z,now
    
            add_cflags   -fPIE
            add_ldexeflags -fPIE -pie
    
        ?*)
            die "Unknown toolchain $toolchain"
        ;;
    esac
    
    
    if test -n "$cross_prefix"; then
    
        test -n "$arch" && test -n "$target_os" ||
    
            die "Must specify target arch (--arch) and OS (--target-os) when cross-compiling"
    
        enable cross_compile
    
    ar_default="${cross_prefix}${ar_default}"
    cc_default="${cross_prefix}${cc_default}"
    
    cxx_default="${cross_prefix}${cxx_default}"
    
    nm_default="${cross_prefix}${nm_default}"
    pkg_config_default="${cross_prefix}${pkg_config_default}"
    
    if ${cross_prefix}${ranlib_default} 2>&1 | grep -q "\-D "; then
        ranlib_default="${cross_prefix}${ranlib_default} -D"
    else
        ranlib_default="${cross_prefix}${ranlib_default}"
    fi
    
    strip_default="${cross_prefix}${strip_default}"
    windres_default="${cross_prefix}${windres_default}"
    
    
    sysinclude_default="${sysroot}/usr/include"
    
    
    set_default arch cc cxx doxygen pkg_config ranlib strip sysinclude \
    
        target_exec target_os x86asmexe nvcc
    
    enabled cross_compile || host_cc_default=$cc
    set_default host_cc
    
    pkg_config_fail_message=""
    
    if ! $pkg_config --version >/dev/null 2>&1; then
        warn "$pkg_config not found, library detection may fail."
        pkg_config=false
    
    elif is_in -static $cc $LDFLAGS && ! is_in --static $pkg_config $pkg_config_flags; then
        pkg_config_fail_message="
    Note: When building a static binary, add --pkg-config-flags=\"--static\"."
    
    if test $doxygen != $doxygen_default && \
      ! $doxygen --version >/dev/null 2>&1; then
        warn "Specified doxygen \"$doxygen\" not found, API documentation will fail to build."
    fi
    
    
            mingw32*|mingw64*|win32|win64|cygwin*|*-dos|freedos|opendos|os/2*|symbian) echo .exe ;;
    
        esac
    }
    
    EXESUF=$(exesuf $target_os)
    HOSTEXESUF=$(exesuf $host_os)
    
    # set temporary file name
    
    : ${TMPDIR:=$TEMPDIR}
    
    : ${TMPDIR:=/tmp}
    
    if [ -n "$tempprefix" ] ; then
        mktemp(){
    
            tmpname="$tempprefix.${HOSTNAME}.${UID}"