Newer
Older
libx264rgb_encoder_select="libx264_encoder"
libxavs_encoder_deps="libxavs"
Diego Biurrun
committed
libxvid_encoder_deps="libxvid"
libzvbi_teletext_decoder_deps="libzvbi"
videotoolbox_suggest="coreservices"
videotoolbox_deps="corefoundation coremedia corevideo"
videotoolbox_encoder_deps="videotoolbox VTCompressionSessionPrepareToEncodeFrames"
ac3_demuxer_select="ac3_parser"
aiff_muxer_select="iso_media"
asf_demuxer_select="riffdec"
asf_o_demuxer_select="riffdec"
asf_stream_muxer_select="asf_muxer"
avi_demuxer_select="iso_media riffdec exif"
caf_demuxer_select="iso_media riffdec"
caf_muxer_select="iso_media"
dash_muxer_select="mp4_muxer"
dash_demuxer_deps="libxml2"
dirac_demuxer_select="dirac_parser"
dv_demuxer_select="dvprofile"
dv_muxer_select="dvprofile"
dxa_demuxer_select="riffdec"
Diego Biurrun
committed
eac3_demuxer_select="ac3_parser"
fifo_muxer_deps="threads"
flac_demuxer_select="flac_parser"
hls_muxer_select="mpegts_muxer"
hls_muxer_suggest="gcrypt openssl"
Carl Eugen Hoyos
committed
image2_alias_pix_demuxer_select="image2_demuxer"
image2_brender_pix_demuxer_select="image2_demuxer"
ipod_muxer_select="mov_muxer"
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"
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"
mp4_muxer_select="mov_muxer"
mpegts_muxer_select="adts_muxer latm_muxer"
mpegtsraw_demuxer_select="mpegts_demuxer"
mxf_d10_muxer_select="mxf_muxer"
mxf_opatom_muxer_select="mxf_muxer"
nuv_demuxer_select="riffdec"
oga_muxer_select="ogg_muxer"
ogg_demuxer_select="dirac_parse"
opus_muxer_select="ogg_muxer"
psp_muxer_select="mov_muxer"
rtp_demuxer_select="sdp_demuxer"
rtp_muxer_select="golomb"
rtpdec_select="asf_demuxer jpegtables mov_demuxer mpegts_demuxer rm_demuxer rtp_protocol srtp"
Martin Storsjö
committed
rtsp_demuxer_select="http_protocol rtpdec"
rtsp_muxer_select="rtp_muxer http_protocol rtp_protocol rtpenc_chain"
sap_muxer_select="rtp_muxer rtp_protocol rtpenc_chain"
Martin Storsjö
committed
sdp_demuxer_select="rtpdec"
smoothstreaming_muxer_select="ismv_muxer"
spdif_demuxer_select="adts_header"
spdif_muxer_select="adts_header"
spx_muxer_select="ogg_muxer"
tg2_muxer_select="mov_muxer"
tgp_muxer_select="mov_muxer"
w64_demuxer_select="wav_demuxer"
w64_muxer_select="wav_muxer"
wav_demuxer_select="riffdec"
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"
# indevs / outdevs
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"
decklink_deps_any="libdl LoadLibrary"
decklink_indev_deps="decklink threads"
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"
dshow_indev_extralibs="-lpsapi -lole32 -lstrmiids -luuid -loleaut32 -lshlwapi"
gdigrab_indev_deps="CreateDIBSection"
gdigrab_indev_extralibs="-lgdi32"
gdigrab_indev_select="bmp_decoder"
iec61883_indev_deps="libiec61883"
jack_indev_deps="libjack"
jack_indev_deps_any="sem_timedwait dispatch_dispatch_h"
lavfi_indev_deps="avfilter"
libcdio_indev_deps="libcdio"
libdc1394_indev_deps="libdc1394"
oss_indev_deps_any="sys_soundcard_h"
oss_outdev_deps_any="sys_soundcard_h"
sndio_indev_deps="sndio"
sndio_outdev_deps="sndio"
v4l2_indev_deps_any="linux_videodev2_h sys_videoio_h"
v4l2_indev_suggest="libv4l2"
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"
async_protocol_deps="threads"
ffrtmpcrypt_protocol_conflict="librtmp_protocol"
ffrtmpcrypt_protocol_deps_any="gcrypt gmp openssl"
ffrtmphttp_protocol_conflict="librtmp_protocol"
ffrtmphttp_protocol_select="http_protocol"
gopher_protocol_select="network"
http_protocol_select="tcp_protocol"
http_protocol_suggest="zlib"
httpproxy_protocol_select="tcp_protocol"
httpproxy_protocol_suggest="zlib"
https_protocol_suggest="zlib"
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"
mmst_protocol_select="network"
rtmp_protocol_conflict="librtmp_protocol"
rtmp_protocol_select="tcp_protocol"
rtmp_protocol_suggest="zlib"
rtmpe_protocol_suggest="zlib"
rtmps_protocol_conflict="librtmp_protocol"
rtmps_protocol_suggest="zlib"
rtmpt_protocol_select="ffrtmphttp_protocol"
rtmpt_protocol_suggest="zlib"
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"
sctp_protocol_select="network"
securetransport_conflict="openssl gnutls libtls"
srtp_protocol_select="rtp_protocol srtp"
tcp_protocol_select="network"
tls_protocol_deps_any="gnutls openssl schannel securetransport libtls"
tls_protocol_select="tcp_protocol"
udp_protocol_select="network"
udplite_protocol_select="network"
unix_protocol_deps="sys_un_h"
unix_protocol_select="network"
afftfilt_filter_deps="avcodec"
afftfilt_filter_select="fft"
afir_filter_deps="avcodec"
afir_filter_select="fft"
amovie_filter_deps="avcodec avformat"
atempo_filter_deps="avcodec"
atempo_filter_select="rdft"
boxblur_filter_deps="gpl"
bs2b_filter_deps="libbs2b"
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"
deconvolve_filter_deps="avcodec"
deconvolve_filter_select="fft"
deinterlace_qsv_filter_deps="libmfx"
denoise_vaapi_filter_deps="vaapi VAProcPipelineParameterBuffer"
deshake_filter_select="pixelutils"
drawtext_filter_deps="libfreetype"
drawtext_filter_suggest="libfontconfig libfribidi"
elbg_filter_deps="avcodec"
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"
ladspa_filter_deps="ladspa libdl"
mcdeint_filter_deps="avcodec gpl"
movie_filter_deps="avcodec avformat"
mpdecimate_filter_deps="gpl"
mpdecimate_filter_select="pixelutils"
ocv_filter_deps="libopencv"
openclsrc_filter_deps="opencl"
overlay_qsv_filter_deps="libmfx"
overlay_qsv_filter_select="qsvvpp"
owdenoise_filter_deps="gpl"
perspective_filter_deps="gpl"
pp7_filter_deps="gpl"
procamp_vaapi_filter_deps="vaapi VAProcPipelineParameterBuffer"
program_opencl_filter_deps="opencl"
removelogo_filter_deps="avcodec avformat swscale"
repeatfields_filter_deps="gpl"
sab_filter_deps="gpl swscale"
scale_filter_deps="swscale"
select_filter_select="pixelutils"
sharpness_vaapi_filter_deps="vaapi VAProcPipelineParameterBuffer"
showcqt_filter_deps="avcodec avformat swscale"
James Almer
committed
showcqt_filter_suggest="libfontconfig libfreetype"
showcqt_filter_select="fft"
showfreqs_filter_deps="avcodec"
showfreqs_filter_select="fft"
showspectrum_filter_deps="avcodec"
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"
sofalizer_filter_select="fft"
spectrumsynth_filter_deps="avcodec"
spectrumsynth_filter_select="fft"
spp_filter_deps="gpl avcodec"
spp_filter_select="fft idctdsp fdctdsp me_cmp pixblockdsp"
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"
vidstabdetect_filter_deps="libvidstab"
vidstabtransform_filter_deps="libvidstab"
libvmaf_filter_deps="libvmaf pthreads"
zscale_filter_deps="libzimg const_nan"
scale_vaapi_filter_deps="vaapi VAProcPipelineParameterBuffer"
vpp_qsv_filter_deps="libmfx"
vpp_qsv_filter_select="qsvvpp"
# examples
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_deps="avutil"
avcodec_suggest="libm"
avcodec_select="null_bsf"
avdevice_deps="avformat avcodec avutil"
avdevice_suggest="libm"
avfilter_deps="avutil"
avfilter_suggest="libm"
avformat_deps="avcodec avutil"
avformat_suggest="libm network zlib"
avresample_deps="avutil"
avresample_suggest="libm"
avutil_suggest="clock_gettime cuda libm libdrm libmfx opencl user32 vaapi videotoolbox corefoundation corevideo coremedia wincrypt"
postproc_suggest="libm"
swresample_suggest="libm libsoxr"
swscale_deps="avutil"
swscale_suggest="libm"
Vitor Sessak
committed
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"
Vitor Sessak
committed
ffmpeg_deps="avcodec avfilter avformat swresample"
ffmpeg_select="aformat_filter anull_filter atrim_filter format_filter
null_filter
trim_filter"
ffmpeg_suggest="ole32 psapi shell32"
ffplay_deps="avcodec avformat swscale swresample sdl2"
ffplay_select="rdft crop_filter transpose_filter hflip_filter vflip_filter rotate_filter"
ffplay_suggest="shell32"
ffprobe_deps="avcodec avformat"
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"
logfile="ffbuild/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'
cc_default="gcc"
Michael Niedermayer
committed
install="install"
ln_s_default="ln -s -f"
ranlib_default="ranlib"
strip_default="strip"
version_script='--version-script'
objformat="elf32"
windres_default="windres"
nvcc_default="nvcc"
nvccflags_default="-gencode arch=compute_30,code=sm_30 -O2"
Marton Balint
committed
striptype="direct"
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"
intrinsics="none"
enable $PROGRAM_LIST
enable $DOCUMENT_LIST
enable $EXAMPLE_LIST
enable $(filter_out avresample $LIBRARY_LIST)
enable asm
enable debug
enable doc
enable faan faandct faanidct
enable optimizations
enable runtime_cpudetect
enable safe_bitstream_reader
Cédric Schieli
committed
enable swscale_alpha
enable valgrind_backtrace
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
LIBPREF="lib"
LIBSUF=".a"
FULLNAME='$(NAME)$(BUILDSUF)'
LIBNAME='$(LIBPREF)$(FULLNAME)$(LIBSUF)'
SLIBPREF="lib"
SLIBSUF=".so"
SLIBNAME='$(SLIBPREF)$(FULLNAME)$(SLIBSUF)'
SLIBNAME_WITH_VERSION='$(SLIBNAME).$(LIBVERSION)'
SLIBNAME_WITH_MAJOR='$(SLIBNAME).$(LIBMAJOR)'
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
AS_O='-o $@'
OBJCC_C='-c'
OBJCC_E='-E -o $@'
OBJCC_O='-o $@'
X86ASM_O='-o $@'
LD_LIB='-l%'
LD_PATH='-L'
HOSTCC_O='-o $@'
NVCC_C='-c'
NVCC_O='-o $@'
host_extralibs='-lm'
host_cflags_filter=echo
host_ldflags_filter=echo
# 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)'
DEPFLAGS='-MM'
# find source path
if test -f configure; then
else
source_path=$(cd $(dirname "$0"); pwd)
Ganesh Ajjanagadde
committed
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."
fi
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="
$INDEV_LIST
$OUTDEV_LIST
"
AVFILTER_COMPONENTS_LIST="
$FILTER_LIST
"
AVFORMAT_COMPONENTS_LIST="
$DEMUXER_LIST
$MUXER_LIST
$PROTOCOL_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
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
}
Panagiotis Issaris
committed
show_list() {
echo $* | sed s/$suffix//g | print_in_columns
Panagiotis Issaris
committed
exit 0
}
3627
3628
3629
3630
3631
3632
3633
3634
3635
3636
3637
3638
3639
3640
3641
3642
3643
3644
3645
3646
3647
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 }")
}
for opt do
Diego Biurrun
committed
optval="${opt#*=}"
case "$opt" in
--extra-ldflags=*)
add_ldflags $optval
--extra-ldexeflags=*)
add_ldexeflags $optval
;;
--extra-ldsoflags=*)
add_ldsoflags $optval
;;
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
;;
Diego Biurrun
committed
--quiet|-q) quiet=yes
;;
--fatal-warnings) enable fatal_warnings
;;
--libfuzzer=*)
libfuzzer_path="$optval"
;;
*)
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
;;
Diego Biurrun
committed
esac
done
for e in $env; do
eval "export $e"
done
# 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
# 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(){
disabled ${1} && disable $(
eval components="\$$(toupper ${1})_COMPONENTS"
map 'eval echo \${$(toupper ${v%s})_LIST}' $components
)
}
map 'disable_components $v' $LIBRARY_LIST
echo "# $0 $FFMPEG_CONFIGURATION" > $logfile
Michael Niedermayer
committed
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
}
*-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"
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
cc_default="cl"
else
cc_default="c99wrap cl"
fi
Steve Lhomme
committed
ld_default="$source_path/compat/windows/mslink"
case "$arch" in
aarch64|arm64)
as_default="armasm64"
;;
arm*)
as_default="armasm"
;;
esac
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=.
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
;;
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"
fi
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
exesuf() {
case $1 in
mingw32*|mingw64*|win32|win64|cygwin*|*-dos|freedos|opendos|os/2*|symbian) echo .exe ;;
esac
}
EXESUF=$(exesuf $target_os)
HOSTEXESUF=$(exesuf $host_os)
: ${TMPDIR:=$TMP}
if [ -n "$tempprefix" ] ; then
mktemp(){
tmpname="$tempprefix.${HOSTNAME}.${UID}"