3 # FFmpeg configure script
5 # Copyright (c) 2000-2002 Fabrice Bellard
6 # Copyright (c) 2005-2008 Diego Biurrun
7 # Copyright (c) 2005-2008 Mans Rullgard
10 # Prevent locale nonsense from breaking basic text processing.
14 # make sure we are running under a compatible shell
15 # try to make this part work with most shells
18 echo "Trying shell $1"
19 type "$1" > /dev/null 2>&1 && exec "$@"
23 (: ${foo%%bar}) 2> /dev/null
26 (: ${foo?}) 2> /dev/null
29 if test "$E1" != 0 || test "$E2" = 0; then
30 echo "Broken shell detected. Trying alternatives."
32 if test "0$FF_CONF_EXEC" -lt 1; then
34 try_exec bash "$0" "$@"
36 if test "0$FF_CONF_EXEC" -lt 2; then
38 try_exec ksh "$0" "$@"
40 if test "0$FF_CONF_EXEC" -lt 3; then
42 try_exec /usr/xpg4/bin/sh "$0" "$@"
44 echo "No compatible shell script interpreter found."
45 echo "This configure script requires a POSIX-compatible shell"
46 echo "such as bash or ksh."
47 echo "THIS IS NOT A BUG IN FFMPEG, DO NOT REPORT IT AS SUCH."
48 echo "Instead, install a working POSIX-compatible shell."
49 echo "Disabling this configure test will create a broken FFmpeg."
50 if test "$BASH_VERSION" = '2.04.0(1)-release'; then
51 echo "This bash version ($BASH_VERSION) is broken on your platform."
52 echo "Upgrade to a later version if available."
57 test -d /usr/xpg4/bin && PATH=/usr/xpg4/bin:$PATH
61 Usage: configure [options]
62 Options: [defaults in brackets after descriptions]
65 --help print this message
66 --quiet Suppress showing informative output
67 --list-decoders show all available decoders
68 --list-encoders show all available encoders
69 --list-hwaccels show all available hardware accelerators
70 --list-demuxers show all available demuxers
71 --list-muxers show all available muxers
72 --list-parsers show all available parsers
73 --list-protocols show all available protocols
74 --list-bsfs show all available bitstream filters
75 --list-indevs show all available input devices
76 --list-outdevs show all available output devices
77 --list-filters show all available filters
80 --logfile=FILE log tests and output to FILE [ffbuild/config.log]
81 --disable-logging do not log configure debug information
82 --fatal-warnings fail if any configure warning is generated
83 --prefix=PREFIX install in PREFIX [$prefix_default]
84 --bindir=DIR install binaries in DIR [PREFIX/bin]
85 --datadir=DIR install data files in DIR [PREFIX/share/ffmpeg]
86 --docdir=DIR install documentation in DIR [PREFIX/share/doc/ffmpeg]
87 --libdir=DIR install libs in DIR [PREFIX/lib]
88 --shlibdir=DIR install shared libs in DIR [LIBDIR]
89 --incdir=DIR install includes in DIR [PREFIX/include]
90 --mandir=DIR install man page in DIR [PREFIX/share/man]
91 --pkgconfigdir=DIR install pkg-config files in DIR [LIBDIR/pkgconfig]
92 --enable-rpath use rpath to allow installing libraries in paths
93 not part of the dynamic linker search path
94 use rpath when linking programs (USE WITH CARE)
95 --install-name-dir=DIR Darwin directory name for installed targets
98 --enable-gpl allow use of GPL code, the resulting libs
99 and binaries will be under GPL [no]
100 --enable-version3 upgrade (L)GPL to version 3 [no]
101 --enable-nonfree allow use of nonfree code, the resulting libs
102 and binaries will be unredistributable [no]
104 Configuration options:
105 --disable-static do not build static libraries [no]
106 --enable-shared build shared libraries [no]
107 --enable-small optimize for size instead of speed
108 --disable-runtime-cpudetect disable detecting CPU capabilities at runtime (smaller binary)
109 --enable-gray enable full grayscale support (slower color)
110 --disable-swscale-alpha disable alpha channel support in swscale
111 --disable-all disable building components, libraries and programs
112 --disable-autodetect disable automatically detected external libraries [no]
115 --disable-programs do not build command line programs
116 --disable-ffmpeg disable ffmpeg build
117 --disable-ffplay disable ffplay build
118 --disable-ffprobe disable ffprobe build
120 Documentation options:
121 --disable-doc do not build documentation
122 --disable-htmlpages do not build HTML documentation pages
123 --disable-manpages do not build man documentation pages
124 --disable-podpages do not build POD documentation pages
125 --disable-txtpages do not build text documentation pages
128 --disable-avdevice disable libavdevice build
129 --disable-avcodec disable libavcodec build
130 --disable-avformat disable libavformat build
131 --disable-swresample disable libswresample build
132 --disable-swscale disable libswscale build
133 --disable-postproc disable libpostproc build
134 --disable-avfilter disable libavfilter build
135 --disable-pthreads disable pthreads [autodetect]
136 --disable-w32threads disable Win32 threads [autodetect]
137 --disable-os2threads disable OS/2 threads [autodetect]
138 --disable-network disable network support [no]
139 --disable-dwt disable DWT code
140 --disable-error-resilience disable error resilience code
141 --disable-lsp disable LSP code
142 --disable-faan disable floating point AAN (I)DCT code
143 --disable-pixelutils disable pixel utils in libavutil
145 Individual component options:
146 --disable-everything disable all components listed below
147 --disable-encoder=NAME disable encoder NAME
148 --enable-encoder=NAME enable encoder NAME
149 --disable-encoders disable all encoders
150 --disable-decoder=NAME disable decoder NAME
151 --enable-decoder=NAME enable decoder NAME
152 --disable-decoders disable all decoders
153 --disable-hwaccel=NAME disable hwaccel NAME
154 --enable-hwaccel=NAME enable hwaccel NAME
155 --disable-hwaccels disable all hwaccels
156 --disable-muxer=NAME disable muxer NAME
157 --enable-muxer=NAME enable muxer NAME
158 --disable-muxers disable all muxers
159 --disable-demuxer=NAME disable demuxer NAME
160 --enable-demuxer=NAME enable demuxer NAME
161 --disable-demuxers disable all demuxers
162 --enable-parser=NAME enable parser NAME
163 --disable-parser=NAME disable parser NAME
164 --disable-parsers disable all parsers
165 --enable-bsf=NAME enable bitstream filter NAME
166 --disable-bsf=NAME disable bitstream filter NAME
167 --disable-bsfs disable all bitstream filters
168 --enable-protocol=NAME enable protocol NAME
169 --disable-protocol=NAME disable protocol NAME
170 --disable-protocols disable all protocols
171 --enable-indev=NAME enable input device NAME
172 --disable-indev=NAME disable input device NAME
173 --disable-indevs disable input devices
174 --enable-outdev=NAME enable output device NAME
175 --disable-outdev=NAME disable output device NAME
176 --disable-outdevs disable output devices
177 --disable-devices disable all devices
178 --enable-filter=NAME enable filter NAME
179 --disable-filter=NAME disable filter NAME
180 --disable-filters disable all filters
182 External library support:
184 Using any of the following switches will allow FFmpeg to link to the
185 corresponding external library. All the components depending on that library
186 will become enabled, if all their other dependencies are met and they are not
187 explicitly disabled. E.g. --enable-libopus will enable linking to
188 libopus and allow the libopus encoder to be built, unless it is
189 specifically disabled with --disable-encoder=libopus.
191 Note that only the system libraries are auto-detected. All the other external
192 libraries must be explicitly enabled.
194 Also note that the following help text describes the purpose of the libraries
195 themselves, not all their features will necessarily be usable by FFmpeg.
197 --disable-alsa disable ALSA support [autodetect]
198 --disable-appkit disable Apple AppKit framework [autodetect]
199 --disable-avfoundation disable Apple AVFoundation framework [autodetect]
200 --enable-avisynth enable reading of AviSynth script files [no]
201 --disable-bzlib disable bzlib [autodetect]
202 --disable-coreimage disable Apple CoreImage framework [autodetect]
203 --enable-chromaprint enable audio fingerprinting with chromaprint [no]
204 --enable-frei0r enable frei0r video filtering [no]
205 --enable-gcrypt enable gcrypt, needed for rtmp(t)e support
206 if openssl, librtmp or gmp is not used [no]
207 --enable-gmp enable gmp, needed for rtmp(t)e support
208 if openssl or librtmp is not used [no]
209 --enable-gnutls enable gnutls, needed for https support
210 if openssl, libtls or mbedtls is not used [no]
211 --disable-iconv disable iconv [autodetect]
212 --enable-jni enable JNI support [no]
213 --enable-ladspa enable LADSPA audio filtering [no]
214 --enable-lcms2 enable ICC profile support via LittleCMS 2 [no]
215 --enable-libaom enable AV1 video encoding/decoding via libaom [no]
216 --enable-libaribb24 enable ARIB text and caption decoding via libaribb24 [no]
217 --enable-libaribcaption enable ARIB text and caption decoding via libaribcaption [no]
218 --enable-libass enable libass subtitles rendering,
219 needed for subtitles and ass filter [no]
220 --enable-libbluray enable BluRay reading using libbluray [no]
221 --enable-libbs2b enable bs2b DSP library [no]
222 --enable-libcaca enable textual display using libcaca [no]
223 --enable-libcelt enable CELT decoding via libcelt [no]
224 --enable-libcdio enable audio CD grabbing with libcdio [no]
225 --enable-libcodec2 enable codec2 en/decoding using libcodec2 [no]
226 --enable-libdav1d enable AV1 decoding via libdav1d [no]
227 --enable-libdavs2 enable AVS2 decoding via libdavs2 [no]
228 --enable-libdc1394 enable IIDC-1394 grabbing using libdc1394
230 --enable-libfdk-aac enable AAC de/encoding via libfdk-aac [no]
231 --enable-libflite enable flite (voice synthesis) support via libflite [no]
232 --enable-libfontconfig enable libfontconfig, useful for drawtext filter [no]
233 --enable-libfreetype enable libfreetype, needed for drawtext filter [no]
234 --enable-libfribidi enable libfribidi, improves drawtext filter [no]
235 --enable-libharfbuzz enable libharfbuzz, needed for drawtext filter [no]
236 --enable-libglslang enable GLSL->SPIRV compilation via libglslang [no]
237 --enable-libgme enable Game Music Emu via libgme [no]
238 --enable-libgsm enable GSM de/encoding via libgsm [no]
239 --enable-libiec61883 enable iec61883 via libiec61883 [no]
240 --enable-libilbc enable iLBC de/encoding via libilbc [no]
241 --enable-libjack enable JACK audio sound server [no]
242 --enable-libjxl enable JPEG XL de/encoding via libjxl [no]
243 --enable-libklvanc enable Kernel Labs VANC processing [no]
244 --enable-libkvazaar enable HEVC encoding via libkvazaar [no]
245 --enable-liblensfun enable lensfun lens correction [no]
246 --enable-libmodplug enable ModPlug via libmodplug [no]
247 --enable-libmp3lame enable MP3 encoding via libmp3lame [no]
248 --enable-libopencore-amrnb enable AMR-NB de/encoding via libopencore-amrnb [no]
249 --enable-libopencore-amrwb enable AMR-WB decoding via libopencore-amrwb [no]
250 --enable-libopencv enable video filtering via libopencv [no]
251 --enable-libopenh264 enable H.264 encoding via OpenH264 [no]
252 --enable-libopenjpeg enable JPEG 2000 de/encoding via OpenJPEG [no]
253 --enable-libopenmpt enable decoding tracked files via libopenmpt [no]
254 --enable-libopenvino enable OpenVINO as a DNN module backend
255 for DNN based filters like dnn_processing [no]
256 --enable-libopus enable Opus de/encoding via libopus [no]
257 --enable-libplacebo enable libplacebo library [no]
258 --enable-libpulse enable Pulseaudio input via libpulse [no]
259 --enable-librabbitmq enable RabbitMQ library [no]
260 --enable-librav1e enable AV1 encoding via rav1e [no]
261 --enable-librist enable RIST via librist [no]
262 --enable-librsvg enable SVG rasterization via librsvg [no]
263 --enable-librubberband enable rubberband needed for rubberband filter [no]
264 --enable-librtmp enable RTMP[E] support via librtmp [no]
265 --enable-libshaderc enable GLSL->SPIRV compilation via libshaderc [no]
266 --enable-libshine enable fixed-point MP3 encoding via libshine [no]
267 --enable-libsmbclient enable Samba protocol via libsmbclient [no]
268 --enable-libsnappy enable Snappy compression, needed for hap encoding [no]
269 --enable-libsoxr enable Include libsoxr resampling [no]
270 --enable-libspeex enable Speex de/encoding via libspeex [no]
271 --enable-libsrt enable Haivision SRT protocol via libsrt [no]
272 --enable-libssh enable SFTP protocol via libssh [no]
273 --enable-libsvtav1 enable AV1 encoding via SVT [no]
274 --enable-libtensorflow enable TensorFlow as a DNN module backend
275 for DNN based filters like sr [no]
276 --enable-libtesseract enable Tesseract, needed for ocr filter [no]
277 --enable-libtheora enable Theora encoding via libtheora [no]
278 --enable-libtls enable LibreSSL (via libtls), needed for https support
279 if openssl, gnutls or mbedtls is not used [no]
280 --enable-libtwolame enable MP2 encoding via libtwolame [no]
281 --enable-libuavs3d enable AVS3 decoding via libuavs3d [no]
282 --enable-libv4l2 enable libv4l2/v4l-utils [no]
283 --enable-libvidstab enable video stabilization using vid.stab [no]
284 --enable-libvmaf enable vmaf filter via libvmaf [no]
285 --enable-libvo-amrwbenc enable AMR-WB encoding via libvo-amrwbenc [no]
286 --enable-libvorbis enable Vorbis en/decoding via libvorbis,
287 native implementation exists [no]
288 --enable-libvpx enable VP8 and VP9 de/encoding via libvpx [no]
289 --enable-libwebp enable WebP encoding via libwebp [no]
290 --enable-libx264 enable H.264 encoding via x264 [no]
291 --enable-libx265 enable HEVC encoding via x265 [no]
292 --enable-libxavs enable AVS encoding via xavs [no]
293 --enable-libxavs2 enable AVS2 encoding via xavs2 [no]
294 --enable-libxcb enable X11 grabbing using XCB [autodetect]
295 --enable-libxcb-shm enable X11 grabbing shm communication [autodetect]
296 --enable-libxcb-xfixes enable X11 grabbing mouse rendering [autodetect]
297 --enable-libxcb-shape enable X11 grabbing shape rendering [autodetect]
298 --enable-libxvid enable Xvid encoding via xvidcore,
299 native MPEG-4/Xvid encoder exists [no]
300 --enable-libxml2 enable XML parsing using the C library libxml2, needed
301 for dash and imf demuxing support [no]
302 --enable-libzimg enable z.lib, needed for zscale filter [no]
303 --enable-libzmq enable message passing via libzmq [no]
304 --enable-libzvbi enable teletext support via libzvbi [no]
305 --enable-lv2 enable LV2 audio filtering [no]
306 --disable-lzma disable lzma [autodetect]
307 --enable-decklink enable Blackmagic DeckLink I/O support [no]
308 --enable-mbedtls enable mbedTLS, needed for https support
309 if openssl, gnutls or libtls is not used [no]
310 --enable-mediacodec enable Android MediaCodec support [no]
311 --enable-mediafoundation enable encoding via MediaFoundation [auto]
312 --disable-metal disable Apple Metal framework [autodetect]
313 --enable-libmysofa enable libmysofa, needed for sofalizer filter [no]
314 --enable-openal enable OpenAL 1.1 capture support [no]
315 --enable-opencl enable OpenCL processing [no]
316 --enable-opengl enable OpenGL rendering [no]
317 --enable-openssl enable openssl, needed for https support
318 if gnutls, libtls or mbedtls is not used [no]
319 --enable-pocketsphinx enable PocketSphinx, needed for asr filter [no]
320 --disable-sndio disable sndio support [autodetect]
321 --disable-schannel disable SChannel SSP, needed for TLS support on
322 Windows if openssl and gnutls are not used [autodetect]
323 --disable-sdl2 disable sdl2 [autodetect]
324 --disable-securetransport disable Secure Transport, needed for TLS support
325 on OSX if openssl and gnutls are not used [autodetect]
326 --enable-vapoursynth enable VapourSynth demuxer [no]
327 --disable-xlib disable xlib [autodetect]
328 --disable-zlib disable zlib [autodetect]
330 The following libraries provide various hardware acceleration features:
331 --disable-amf disable AMF video encoding code [autodetect]
332 --disable-audiotoolbox disable Apple AudioToolbox code [autodetect]
333 --enable-cuda-nvcc enable Nvidia CUDA compiler [no]
334 --disable-cuda-llvm disable CUDA compilation using clang [autodetect]
335 --disable-cuvid disable Nvidia CUVID support [autodetect]
336 --disable-d3d11va disable Microsoft Direct3D 11 video acceleration code [autodetect]
337 --disable-dxva2 disable Microsoft DirectX 9 video acceleration code [autodetect]
338 --disable-ffnvcodec disable dynamically linked Nvidia code [autodetect]
339 --enable-libdrm enable DRM code (Linux) [no]
340 --enable-libmfx enable Intel MediaSDK (AKA Quick Sync Video) code via libmfx [no]
341 --enable-libvpl enable Intel oneVPL code via libvpl if libmfx is not used [no]
342 --enable-libnpp enable Nvidia Performance Primitives-based code [no]
343 --enable-mmal enable Broadcom Multi-Media Abstraction Layer (Raspberry Pi) via MMAL [no]
344 --disable-nvdec disable Nvidia video decoding acceleration (via hwaccel) [autodetect]
345 --disable-nvenc disable Nvidia video encoding code [autodetect]
346 --enable-omx enable OpenMAX IL code [no]
347 --enable-omx-rpi enable OpenMAX IL code for Raspberry Pi [no]
348 --enable-rkmpp enable Rockchip Media Process Platform code [no]
349 --disable-v4l2-m2m disable V4L2 mem2mem code [autodetect]
350 --disable-vaapi disable Video Acceleration API (mainly Unix/Intel) code [autodetect]
351 --disable-vdpau disable Nvidia Video Decode and Presentation API for Unix code [autodetect]
352 --disable-videotoolbox disable VideoToolbox code [autodetect]
353 --disable-vulkan disable Vulkan code [autodetect]
356 --arch=ARCH select architecture [$arch]
357 --cpu=CPU select the minimum required CPU (affects
358 instruction selection, may crash on older CPUs)
359 --cross-prefix=PREFIX use PREFIX for compilation tools [$cross_prefix]
360 --progs-suffix=SUFFIX program name suffix []
361 --enable-cross-compile assume a cross-compiler is used
362 --sysroot=PATH root of cross-build tree
363 --sysinclude=PATH location of cross-build system headers
364 --target-os=OS compiler targets OS [$target_os]
365 --target-exec=CMD command to run executables on target
366 --target-path=DIR path to view of build directory on target
367 --target-samples=DIR path to samples directory on target
368 --tempprefix=PATH force fixed dir/prefix instead of mktemp for checks
369 --toolchain=NAME set tool defaults according to NAME
370 (gcc-asan, clang-asan, gcc-msan, clang-msan,
371 gcc-tsan, clang-tsan, gcc-usan, clang-usan,
372 valgrind-massif, valgrind-memcheck,
373 msvc, icl, gcov, llvm-cov, hardened)
374 --nm=NM use nm tool NM [$nm_default]
375 --ar=AR use archive tool AR [$ar_default]
376 --as=AS use assembler AS [$as_default]
377 --ln_s=LN_S use symbolic link tool LN_S [$ln_s_default]
378 --strip=STRIP use strip tool STRIP [$strip_default]
379 --windres=WINDRES use windows resource compiler WINDRES [$windres_default]
380 --x86asmexe=EXE use nasm-compatible assembler EXE [$x86asmexe_default]
381 --cc=CC use C compiler CC [$cc_default]
382 --cxx=CXX use C compiler CXX [$cxx_default]
383 --objcc=OCC use ObjC compiler OCC [$cc_default]
384 --dep-cc=DEPCC use dependency generator DEPCC [$cc_default]
385 --nvcc=NVCC use Nvidia CUDA compiler NVCC or clang [$nvcc_default]
386 --ld=LD use linker LD [$ld_default]
387 --metalcc=METALCC use metal compiler METALCC [$metalcc_default]
388 --metallib=METALLIB use metal linker METALLIB [$metallib_default]
389 --pkg-config=PKGCONFIG use pkg-config tool PKGCONFIG [$pkg_config_default]
390 --pkg-config-flags=FLAGS pass additional flags to pkgconf []
391 --ranlib=RANLIB use ranlib RANLIB [$ranlib_default]
392 --doxygen=DOXYGEN use DOXYGEN to generate API doc [$doxygen_default]
393 --host-cc=HOSTCC use host C compiler HOSTCC
394 --host-cflags=HCFLAGS use HCFLAGS when compiling for host
395 --host-cppflags=HCPPFLAGS use HCPPFLAGS when compiling for host
396 --host-ld=HOSTLD use host linker HOSTLD
397 --host-ldflags=HLDFLAGS use HLDFLAGS when linking for host
398 --host-extralibs=HLIBS use libs HLIBS when linking for host
399 --host-os=OS compiler host OS [$target_os]
400 --extra-cflags=ECFLAGS add ECFLAGS to CFLAGS [$CFLAGS]
401 --extra-cxxflags=ECFLAGS add ECFLAGS to CXXFLAGS [$CXXFLAGS]
402 --extra-objcflags=FLAGS add FLAGS to OBJCFLAGS [$CFLAGS]
403 --extra-ldflags=ELDFLAGS add ELDFLAGS to LDFLAGS [$LDFLAGS]
404 --extra-ldexeflags=ELDFLAGS add ELDFLAGS to LDEXEFLAGS [$LDEXEFLAGS]
405 --extra-ldsoflags=ELDFLAGS add ELDFLAGS to LDSOFLAGS [$LDSOFLAGS]
406 --extra-libs=ELIBS add ELIBS [$ELIBS]
407 --extra-version=STRING version string suffix []
408 --optflags=OPTFLAGS override optimization-related compiler flags
409 --nvccflags=NVCCFLAGS override nvcc flags [$nvccflags_default]
410 --build-suffix=SUFFIX library name suffix []
411 --enable-pic build position-independent code
412 --enable-thumb compile for Thumb instruction set
413 --enable-lto[=arg] use link-time optimization
414 --env="ENV=override" override the environment variables
416 Advanced options (experts only):
417 --malloc-prefix=PREFIX prefix malloc and related names with PREFIX
418 --custom-allocator=NAME use a supported custom allocator
419 --disable-symver disable symbol versioning
420 --enable-hardcoded-tables use hardcoded tables instead of runtime generation
421 --disable-safe-bitstream-reader
422 disable buffer boundary checking in bitreaders
423 (faster, but may crash)
424 --sws-max-filter-size=N the max filter size swscale uses [$sws_max_filter_size_default]
426 Optimization options (experts only):
427 --disable-asm disable all assembly optimizations
428 --disable-altivec disable AltiVec optimizations
429 --disable-vsx disable VSX optimizations
430 --disable-power8 disable POWER8 optimizations
431 --disable-amd3dnow disable 3DNow! optimizations
432 --disable-amd3dnowext disable 3DNow! extended optimizations
433 --disable-mmx disable MMX optimizations
434 --disable-mmxext disable MMXEXT optimizations
435 --disable-sse disable SSE optimizations
436 --disable-sse2 disable SSE2 optimizations
437 --disable-sse3 disable SSE3 optimizations
438 --disable-ssse3 disable SSSE3 optimizations
439 --disable-sse4 disable SSE4 optimizations
440 --disable-sse42 disable SSE4.2 optimizations
441 --disable-avx disable AVX optimizations
442 --disable-xop disable XOP optimizations
443 --disable-fma3 disable FMA3 optimizations
444 --disable-fma4 disable FMA4 optimizations
445 --disable-avx2 disable AVX2 optimizations
446 --disable-avx512 disable AVX-512 optimizations
447 --disable-avx512icl disable AVX-512ICL optimizations
448 --disable-aesni disable AESNI optimizations
449 --disable-armv5te disable armv5te optimizations
450 --disable-armv6 disable armv6 optimizations
451 --disable-armv6t2 disable armv6t2 optimizations
452 --disable-vfp disable VFP optimizations
453 --disable-neon disable NEON optimizations
454 --disable-dotprod disable DOTPROD optimizations
455 --disable-i8mm disable I8MM optimizations
456 --disable-inline-asm disable use of inline assembly
457 --disable-x86asm disable use of standalone x86 assembly
458 --disable-mipsdsp disable MIPS DSP ASE R1 optimizations
459 --disable-mipsdspr2 disable MIPS DSP ASE R2 optimizations
460 --disable-msa disable MSA optimizations
461 --disable-mipsfpu disable floating point MIPS optimizations
462 --disable-mmi disable Loongson MMI optimizations
463 --disable-lsx disable Loongson LSX optimizations
464 --disable-lasx disable Loongson LASX optimizations
465 --disable-rvv disable RISC-V Vector optimizations
466 --disable-fast-unaligned consider unaligned accesses slow
468 Developer options (useful when working on FFmpeg itself):
469 --disable-debug disable debugging symbols
470 --enable-debug=LEVEL set the debug level [$debuglevel]
471 --disable-optimizations disable compiler optimizations
472 --enable-extra-warnings enable more compiler warnings
473 --disable-stripping disable stripping of executables and shared libraries
474 --assert-level=level 0(default), 1 or 2, amount of assertion testing,
475 2 causes a slowdown at runtime.
476 --enable-memory-poisoning fill heap uninitialized allocated space with arbitrary data
477 --valgrind=VALGRIND run "make fate" tests through valgrind to detect memory
478 leaks and errors, using the specified valgrind binary.
479 Cannot be combined with --target-exec
480 --enable-ftrapv Trap arithmetic overflows
481 --samples=PATH location of test samples for FATE, if not set use
482 \$FATE_SAMPLES at make invocation time.
483 --enable-neon-clobber-test check NEON registers for clobbering (should be
484 used only for debugging purposes)
485 --enable-xmm-clobber-test check XMM registers for clobbering (Win64-only;
486 should be used only for debugging purposes)
487 --enable-random randomly enable/disable components
489 --enable-random=LIST randomly enable/disable specific components or
490 --disable-random=LIST component groups. LIST is a comma-separated list
491 of NAME[:PROB] entries where NAME is a component
492 (group) and PROB the probability associated with
494 --random-seed=VALUE seed value for --enable/disable-random
495 --disable-valgrind-backtrace do not print a backtrace under Valgrind
496 (only applies to --disable-optimizations builds)
497 --enable-ossfuzz Enable building fuzzer tool
498 --libfuzzer=PATH path to libfuzzer
499 --ignore-tests=TESTS comma-separated list (without "fate-" prefix
500 in the name) of tests whose result is ignored
501 --enable-linux-perf enable Linux Performance Monitor API
502 --enable-macos-kperf enable macOS kperf (private) API
503 --disable-large-tests disable tests that use a large amount of memory
504 --disable-ptx-compression don't compress CUDA PTX code even when possible
506 NOTE: Object files are built at the place where configure is launched.
511 if test -t 1 && which tput >/dev/null 2>&1; then
512 ncolors=$(tput colors)
513 if test -n "$ncolors" && test $ncolors -ge 8; then
514 bold_color=$(tput bold)
515 warn_color=$(tput setaf 3)
516 error_color=$(tput setaf 1)
517 reset_color=$(tput sgr0)
519 # 72 used instead of 80 since that's the default of pr
525 echo "$@" >> $logfile
531 while IFS= read -r log_file_line; do
532 printf '%5d\t%s\n' "$log_file_i" "$log_file_line"
533 log_file_i=$(($log_file_i+1))
534 done < "$1" >> "$logfile"
540 WARNINGS="${WARNINGS}WARNING: $*\n"
545 echo "$error_color$bold_color$@$reset_color"
548 If you think configure made a mistake, make sure you are using the latest
549 version from Git. If the latest version fails, report the problem to the
550 ffmpeg-user@ffmpeg.org mailing list or IRC #ffmpeg on irc.libera.chat.
552 if disabled logging; then
554 Rerun configure with logging enabled (do not use --disable-logging), and
555 include the log this produces with your report.
559 Include the log file "$logfile" produced by configure as this will help
566 # Avoid locale weirdness, besides we really just want to translate ASCII.
568 echo "$@" | tr abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ
572 echo "$@" | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz
576 echo "$*" | sed 's/["\\]/\\\0/g'
580 v=$(echo "$1" | sed "s/'/'\\\\''/g")
581 test "x$v" = "x${v#*[!A-Za-z0-9_/.+-]}" || v="'$v'"
586 echo "$@" | sed 's/^ *//;s/[[:space:]][[:space:]]*/ /g;s/ *$//'
593 eval "case '$v' in $pat) printf '%s ' '$v' ;; esac"
601 eval "case '$v' in $pat) ;; *) printf '%s ' '$v' ;; esac"
608 for v; do eval $m; done
614 for v; do echo ${v}${suffix}; done
620 for v; do echo ${v%$suffix}; done
635 eval : \${$var:=$value}
640 echo $@ | sed 's/[^A-Za-z0-9_]/_/g'
646 eval $(sanitize_var_name "$var")='$*'
650 eval echo \$$(sanitize_var_name "$1")
655 eval level=\${${pvar}_level:=0}
656 eval ${pvar}_${level}="\$$pvar"
657 eval ${pvar}_level=$(($level+1))
663 eval level=\${${pvar}_level:-0}
664 test $level = 0 && continue
665 eval level=$(($level-1))
666 eval $pvar="\${${pvar}_${level}}"
667 eval ${pvar}_level=$level
668 eval unset ${pvar}_${level}
674 eval ${var}_requested=yes
679 warn_if_gets_disabled(){
681 WARN_IF_GETS_DISABLED_LIST="$WARN_IF_GETS_DISABLED_LIST $var"
693 disable_with_reason(){
695 eval "${1}_disable_reason=\"$2\""
696 if requested $1; then
697 die "ERROR: $1 requested, but $2"
711 enable $(sanitize_var_name $var)
717 disable $(sanitize_var_name $var)
723 enabled $var && continue
725 eval enable_deep \$${var}_select
727 eval enable_deep_weak \$${var}_suggest
738 disabled $var && continue
747 test "${1#!}" = "$1" && op="=" || op="!="
748 eval test "x\$${1#!}_requested" $op "xyes"
752 test "${1#!}" = "$1" && op="=" || op="!="
753 eval test "x\$${1#!}" $op "xyes"
757 test "${1#!}" = "$1" && op="=" || op="!="
758 eval test "x\$${1#!}" $op "xno"
763 enabled $opt || return 1
769 disabled $opt || return 1
775 enabled $opt && return 0
781 disabled $opt && return 0
788 eval : \${$opt:=\$${opt}_default}
796 [ $var = $value ] && return 0
801 # The cfg loop is very hot (several thousands iterations), and in bash also
802 # potentialy quite slow. Try to abort the iterations early, preferably without
803 # calling functions. 70%+ of the time cfg is already done or without deps.
806 eval [ x\$${cfg}_checking = xdone ] && continue
807 eval [ x\$${cfg}_checking = xinprogress ] && die "Circular dependency for $cfg."
810 dep_all=\$${cfg}_deps
811 dep_any=\$${cfg}_deps_any
812 dep_con=\$${cfg}_conflict
813 dep_sel=\$${cfg}_select
814 dep_sgs=\$${cfg}_suggest
816 dep_ifn=\$${cfg}_if_any
819 # most of the time here $cfg has no deps - avoid costly no-op work
820 if [ "$dep_all$dep_any$dep_con$dep_sel$dep_sgs$dep_ifa$dep_ifn" ]; then
821 eval ${cfg}_checking=inprogress
823 set -- $cfg "$dep_all" "$dep_any" "$dep_con" "$dep_sel" "$dep_sgs" "$dep_ifa" "$dep_ifn"
824 check_deps $dep_all $dep_any $dep_con $dep_sel $dep_sgs $dep_ifa $dep_ifn
825 cfg=$1; dep_all=$2; dep_any=$3; dep_con=$4; dep_sel=$5 dep_sgs=$6; dep_ifa=$7; dep_ifn=$8
827 [ -n "$dep_ifa" ] && { enabled_all $dep_ifa && enable_weak $cfg; }
828 [ -n "$dep_ifn" ] && { enabled_any $dep_ifn && enable_weak $cfg; }
829 enabled_all $dep_all || { disable_with_reason $cfg "not all dependencies are satisfied: $dep_all"; }
830 enabled_any $dep_any || { disable_with_reason $cfg "not any dependency is satisfied: $dep_any"; }
831 disabled_all $dep_con || { disable_with_reason $cfg "some conflicting dependencies are unsatisfied: $dep_con"; }
832 disabled_any $dep_sel && { disable_with_reason $cfg "some selected dependency is unsatisfied: $dep_sel"; }
834 enabled $cfg && enable_deep_weak $dep_sel $dep_sgs
836 for dep in $dep_all $dep_any $dep_sel $dep_sgs; do
837 # filter out library deps, these do not belong in extralibs
838 is_in $dep $LIBRARY_LIST && continue
839 enabled $dep && eval append ${cfg}_extralibs ${dep}_extralibs
843 eval ${cfg}_checking=done
851 map 'eval echo "$v \${$v:-no}"' "$@" |
852 awk "BEGIN { split(\"$files\", files) }
854 c = \"$pfx\" toupper(\$1);
860 if (file ~ /\\.h\$/) {
861 printf(\"#define %s %d\\n\", c, v) >>file;
862 } else if (file ~ /\\.asm\$/) {
863 printf(\"%%define %s %d\\n\", c, v) >>file;
864 } else if (file ~ /\\.mak\$/) {
865 n = -v ? \"\" : \"!\";
866 printf(\"%s%s=yes\\n\", n, c) >>file;
867 } else if (file ~ /\\.texi\$/) {
868 pre = -v ? \"\" : \"@c \";
871 gsub(/_/, \"-\", c2);
872 printf(\"%s@set %s %s\\n\", pre, c2, yesno) >>file;
882 enabled $v && printf "%s\n" ${v%$suf}
889 eval "$var=\"\$$var $*\""
895 eval "$var=\"$* \$$var\""
902 reverse_out="$v $reverse_out"
908 # keeps the last occurence of each non-unique item
913 for v in $unique_in; do
914 # " $unique_out" +space such that every item is surrounded with spaces
915 case " $unique_out" in *" $v "*) continue; esac # already in list
916 unique_out="$unique_out$v "
925 for v in $resolve_in; do
926 eval 'resolve_out="$resolve_out$'$v' "'
928 eval $1=\$resolve_out
936 append CFLAGS $($cflags_filter "$@")
939 add_cflags_headers(){
940 append CFLAGS_HEADERS $($cflags_filter "$@")
944 append CXXFLAGS $($cflags_filter "$@")
948 append OBJCFLAGS $($objcflags_filter "$@")
952 append ASFLAGS $($asflags_filter "$@")
956 append LDFLAGS $($ldflags_filter "$@")
960 append LDEXEFLAGS $($ldflags_filter "$@")
964 append LDSOFLAGS $($ldflags_filter "$@")
968 prepend extralibs $($ldflags_filter "$@")
972 append ASMSTRIPFLAGS "$@"
976 append host_cppflags "$@"
980 append host_cflags $($host_cflags_filter "$@")
984 append host_ldflags $($host_ldflags_filter "$@")
988 append compat_objs $1
990 map 'add_cppflags -D$v' "$@"
995 "$@" >> $logfile 2>&1
1000 stat "$1" >> $logfile 2>&1
1004 eval printf '%s\\n' $CC_E
1008 eval printf '%s\\n' $CC_O
1012 eval printf '%s\\n' $AS_O
1016 eval printf '%s\\n' $X86ASM_O
1020 eval printf '%s\\n' $LD_O
1024 eval printf '%s\\n' $HOSTCC_E
1028 eval printf '%s\\n' $HOSTCC_O
1032 eval printf '%s\\n' $NVCC_O
1039 test_cmd $cc $CPPFLAGS $CFLAGS "$@" $CC_C $(cc_o $TMPO) $TMPC
1046 test_cmd $cxx $CPPFLAGS $CFLAGS $CXXFLAGS "$@" $CXX_C -o $TMPO $TMPCPP
1053 test_cmd $objcc -Werror=missing-prototypes $CPPFLAGS $CFLAGS $OBJCFLAGS "$@" $OBJCC_C $(cc_o $TMPO) $TMPM
1062 [ -x "$(command -v cygpath)" ] && tmpcu_=$(cygpath -m $tmpcu_) && tmpo_=$(cygpath -m $tmpo_)
1063 test_cmd $nvcc $nvccflags "$@" $NVCC_C $(nvcc_o $tmpo_) $tmpcu_
1070 disabled $name && return
1072 test_nvcc "$@" <<EOF && enable $name
1074 __global__ void hello(unsigned char *data) {}
1083 test_cmd $cc $CPPFLAGS $CFLAGS "$@" $(cc_e $TMPO) $TMPC
1090 test_cmd $as $CPPFLAGS $ASFLAGS "$@" $AS_C $(as_o $TMPO) $TMPS
1094 log test_x86asm "$@"
1098 test_cmd $x86asmexe $X86ASMFLAGS -Werror "$@" $(x86asm_o $TMPO) $TMPASM
1104 disabled $cmd && return
1106 test_cmd $@ && enable $cmd
1115 test_as $@ <<EOF && enable $name
1121 log check_inline_asm "$@"
1126 test_cc "$@" <<EOF && enable $name
1127 void foo(void){ __asm__ volatile($code); }
1131 check_inline_asm_flags(){
1132 log check_inline_asm_flags "$@"
1137 while [ "$1" != "" ]; do
1143 void foo(void){ __asm__ volatile($code); }
1146 test_cmd $cc $CPPFLAGS $CFLAGS $flags "$@" $CC_C $(cc_o $TMPO) $TMPC &&
1147 enable $name && add_cflags $flags && add_asflags $flags && add_ldflags $flags
1152 check_inline_asm ${1}_inline "\"$2\""
1153 check_as ${1}_external "$2"
1157 log check_arch_level "$@"
1159 check_as tested_arch_level ".arch $level"
1160 enabled tested_arch_level && as_arch_level="$level"
1163 check_archext_insn(){
1164 log check_archext_insn "$@"
1167 # Check if the assembly is accepted in inline assembly.
1168 check_inline_asm ${feature}_inline "\"$instr\""
1169 # We don't check if the instruction is supported out of the box by the
1170 # external assembler (we don't try to set ${feature}_external) as we don't
1171 # need to use these instructions in non-runtime detected codepaths.
1175 enabled as_arch_directive && arch_directive=".arch $as_arch_level" || arch_directive=""
1177 # Test if the assembler supports the .arch_extension $feature directive.
1178 arch_extension_directive=".arch_extension $feature"
1179 test_as <<EOF && enable as_archext_${feature}_directive || arch_extension_directive=""
1181 $arch_extension_directive
1184 # Test if we can assemble the instruction after potential .arch and
1185 # .arch_extension directives.
1186 test_as <<EOF && enable ${feature}
1188 $arch_extension_directive
1194 log check_x86asm "$@"
1198 test_x86asm "$@" && enable $name
1205 flags=$(filter_out '-l*|*.so' $@)
1206 libs=$(filter '-l*|*.so' $@)
1207 test_$type $($cflags_filter $flags) || return
1208 flags=$($ldflags_filter $flags)
1209 libs=$($ldflags_filter $libs)
1210 test_cmd $ld $LDFLAGS $LDEXEFLAGS $flags $(ld_o $TMPE) $TMPO $libs $extralibs
1219 test_ld $type $@ && enable $name
1224 test "${hdr%.h}" = "${hdr}" &&
1225 echo "#include $hdr" ||
1226 echo "#include <$hdr>"
1236 for hdr in $headers; do
1239 echo "int main(void) { $code; return 0; }"
1240 } | test_$check "$@"
1244 log check_cppflags "$@"
1245 test_cpp "$@" <<EOF && append CPPFLAGS "$@"
1251 log test_cflags "$@"
1252 set -- $($cflags_filter "$@")
1259 log check_cflags "$@"
1260 test_cflags "$@" && add_cflags "$@"
1264 log check_cxxflags "$@"
1265 set -- $($cflags_filter "$@")
1266 test_cxx "$@" <<EOF && append CXXFLAGS "$@"
1272 log test_objcflags "$@"
1273 set -- $($objcflags_filter "$@")
1274 test_objcc "$@" <<EOF
1280 log check_objcflags "$@"
1281 test_objcflags "$@" && add_objcflags "$@"
1285 log test_ldflags "$@"
1286 set -- $($ldflags_filter "$@")
1287 test_ld "cc" "$@" <<EOF
1288 int main(void){ return 0; }
1293 log check_ldflags "$@"
1294 test_ldflags "$@" && add_ldflags "$@"
1298 log test_stripflags "$@"
1299 # call test_cc to get a fresh TMPO
1301 int main(void) { return 0; }
1303 test_cmd $strip $ASMSTRIPFLAGS "$@" $TMPO
1307 log check_stripflags "$@"
1308 test_stripflags "$@" && add_stripflags "$@"
1312 log check_headers "$@"
1315 disable_sanitized $headers
1317 for hdr in $headers; do
1321 } | test_cpp "$@" && enable_sanitized $headers
1324 check_header_objcc(){
1325 log check_header_objcc "$@"
1329 disable_sanitized $header
1331 echo "#include <$header>"
1332 echo "int main(void) { return 0; }"
1333 } | test_objcc && test_stat "$TMPO" && enable_sanitized $header
1336 check_apple_framework(){
1337 log check_apple_framework "$@"
1339 name="$(tolower $framework)"
1340 header="${framework}/${framework}.h"
1342 check_header_objcc $header &&
1343 enable $name && eval ${name}_extralibs='"-framework $framework"'
1351 test_ld "cc" "$@" <<EOF && enable $func
1353 int main(void){ $func(); }
1358 log check_mathfunc "$@"
1362 test $narg = 2 && args="f, g" || args="f"
1364 test_ld "cc" "$@" <<EOF && enable $func
1366 float foo(float f, float g) { return $func($args); }
1367 int main(void){ return (int) foo; }
1371 check_func_headers(){
1372 log check_func_headers "$@"
1377 for hdr in $headers; do
1380 echo "#include <stdint.h>"
1381 for func in $funcs; do
1382 echo "long check_$func(void) { return (long) $func; }"
1384 echo "int main(void) { int ret = 0;"
1385 # LTO could optimize out the test functions without this
1386 for func in $funcs; do
1387 echo " ret |= ((intptr_t)check_$func) & 0xFFFF;"
1389 echo "return ret; }"
1390 } | test_ld "cc" "$@" && enable $funcs && enable_sanitized $headers
1393 check_class_headers_cpp(){
1394 log check_class_headers_cpp "$@"
1399 for hdr in $headers; do
1400 echo "#include <$hdr>"
1402 echo "int main(void) { "
1404 for class in $classes; do
1405 echo "$class obj$i;"
1409 } | test_ld "cxx" "$@" && enable $funcs && enable_sanitized $headers
1412 test_cpp_condition(){
1413 log test_cpp_condition "$@"
1420 #error "unsatisfied condition: $condition"
1425 check_cpp_condition(){
1426 log check_cpp_condition "$@"
1430 test_cpp_condition "$@" && enable $name
1434 log test_cflags_cc "$@"
1439 set -- $($cflags_filter "$flags")
1443 #error "unsatisfied condition: $condition"
1455 check_func_headers "$headers" "$funcs" "$@" &&
1456 enable $name && eval ${name}_extralibs="\$@"
1460 log check_lib_cpp "$@"
1466 check_class_headers_cpp "$headers" "$classes" "$@" &&
1467 enable $name && eval ${name}_extralibs="\$@"
1471 log test_pkg_config "$@"
1479 test_cmd $pkg_config --exists --print-errors $pkg_version || return
1480 pkg_cflags=$($pkg_config --cflags $pkg_config_flags $pkg)
1481 pkg_libs=$($pkg_config --libs $pkg_config_flags $pkg)
1482 pkg_incdir=$($pkg_config --variable=includedir $pkg_config_flags $pkg)
1483 check_func_headers "$headers" "$funcs" $pkg_cflags $pkg_libs "$@" &&
1485 set_sanitized "${name}_cflags" $pkg_cflags &&
1486 set_sanitized "${name}_incdir" $pkg_incdir &&
1487 set_sanitized "${name}_extralibs" $pkg_libs
1490 test_pkg_config_cpp(){
1491 log test_pkg_config_cpp "$@"
1499 test_cmd $pkg_config --exists --print-errors $pkg_version || return
1500 pkg_cflags=$($pkg_config --cflags $pkg_config_flags $pkg)
1501 pkg_incdir=$($pkg_config --variable=includedir $pkg_config_flags $pkg)
1502 pkg_incflags=$($pkg_config --cflags-only-I $pkg_config_flags $pkg)
1503 test_cpp_condition "$pkg_incdir/$headers" "$cond" "$@" &&
1505 set_sanitized "${name}_cflags" $pkg_cflags &&
1506 set_sanitized "${name}_incdir" $pkg_incdir &&
1507 set_sanitized "${name}_incflags" $pkg_incflags
1511 log check_pkg_config "$@"
1513 test_pkg_config "$@" &&
1514 eval add_cflags \$${name}_cflags
1517 check_pkg_config_cpp(){
1518 log check_pkg_config_cpp "$@"
1520 test_pkg_config_cpp "$@" &&
1521 eval add_cflags \$${name}_cflags
1524 check_pkg_config_header_only(){
1525 log check_pkg_config_cpp "$@"
1527 test_pkg_config_cpp "$@" &&
1528 eval add_cflags \$${name}_incflags
1532 test_ld "cc" "$@" && { enabled cross_compile || $TMPE >> $logfile 2>&1; }
1536 log check_exec_crash "$@"
1539 # exit() is not async signal safe. _Exit (C99) and _exit (POSIX)
1540 # are safe but may not be available everywhere. Thus we use
1541 # raise(SIGTERM) instead. The check is run in a subshell so we
1542 # can redirect the "Terminated" message from the shell. SIGBUS
1543 # is not defined by standard C so it is used conditionally.
1545 (test_exec "$@") >> $logfile 2>&1 <<EOF
1547 static void sighandler(int sig){
1553 int (*func_ptr)(void) = foo;
1555 signal(SIGILL, sighandler);
1556 signal(SIGFPE, sighandler);
1557 signal(SIGSEGV, sighandler);
1559 signal(SIGBUS, sighandler);
1571 disable_sanitized "$type"
1572 test_code cc "$headers" "$type v" "$@" && enable_sanitized "$type"
1576 log check_struct "$@"
1581 disable_sanitized "${struct}_${member}"
1582 test_code cc "$headers" "const void *p = &(($struct *)0)->$member" "$@" &&
1583 enable_sanitized "${struct}_${member}"
1587 log check_builtin "$@"
1593 test_code ld "$headers" "$builtin" "cc" "$@" && enable "$name"
1596 check_compile_assert(){
1597 log check_compile_assert "$@"
1603 test_code cc "$headers" "char c[2 * !!($condition) - 1]" "$@" && enable "$name"
1611 test_code cc "$@" && enable "$name"
1619 check_lib $name "$@" || die "ERROR: $name_version not found"
1625 check_cc "$@" || die "ERROR: $name failed"
1629 log require_cpp "$@"
1633 check_lib_cpp "$name" "$@" || die "ERROR: $name_version not found"
1637 log require_headers "$@"
1639 check_headers "$@" || die "ERROR: $headers not found"
1642 require_cpp_condition(){
1643 log require_cpp_condition "$@"
1645 check_cpp_condition "$@" || die "ERROR: $condition not satisfied"
1648 require_pkg_config(){
1649 log require_pkg_config "$@"
1651 check_pkg_config "$@" || die "ERROR: $pkg_version not found using pkg-config$pkg_config_fail_message"
1654 require_pkg_config_cpp(){
1655 log require_pkg_config_cpp "$@"
1657 check_pkg_config_cpp "$@" || die "ERROR: $pkg_version not found using pkg-config$pkg_config_fail_message"
1661 log test_host_cc "$@"
1664 test_cmd $host_cc $host_cflags "$@" $HOSTCC_C $(hostcc_o $TMPO) $TMPC
1668 log test_host_cpp "$@"
1671 test_cmd $host_cc $host_cppflags $host_cflags "$@" $(hostcc_e $TMPO) $TMPC
1674 check_host_cppflags(){
1675 log check_host_cppflags "$@"
1676 test_host_cpp "$@" <<EOF && append host_cppflags "$@"
1681 check_host_cflags(){
1682 log check_host_cflags "$@"
1683 set -- $($host_cflags_filter "$@")
1684 test_host_cc "$@" <<EOF && append host_cflags "$@"
1689 test_host_cpp_condition(){
1690 log test_host_cpp_condition "$@"
1694 test_host_cpp "$@" <<EOF
1697 #error "unsatisfied condition: $condition"
1702 check_host_cpp_condition(){
1703 log check_host_cpp_condition "$@"
1707 test_host_cpp_condition "$@" && enable $name
1711 cmp -s "$1" "$2" && { test "$quiet" != "yes" && echo "$2 is unchanged"; } && return
1712 mkdir -p "$(dirname $2)"
1716 # CONFIG_LIST contains configurable options, while HAVE_LIST is for
1717 # system-dependent things.
1719 AVCODEC_COMPONENTS="
1727 AVDEVICE_COMPONENTS="
1732 AVFILTER_COMPONENTS="
1736 AVFORMAT_COMPONENTS="
1744 $AVDEVICE_COMPONENTS
1745 $AVFILTER_COMPONENTS
1746 $AVFORMAT_COMPONENTS
1750 avio_http_serve_files_example
1751 avio_list_dir_example
1752 avio_read_callback_example
1753 decode_audio_example
1754 decode_filter_audio_example
1755 decode_filter_video_example
1756 decode_video_example
1757 demux_decode_example
1758 encode_audio_example
1759 encode_video_example
1761 filter_audio_example
1766 resample_audio_example
1768 show_metadata_example
1769 transcode_aac_example
1771 vaapi_encode_example
1772 vaapi_transcode_example
1773 qsv_transcode_example
1776 EXTERNAL_AUTODETECT_LIBRARY_LIST="
1798 EXTERNAL_LIBRARY_GPL_LIST="
1812 EXTERNAL_LIBRARY_NONFREE_LIST="
1818 EXTERNAL_LIBRARY_VERSION3_LIST="
1829 EXTERNAL_LIBRARY_GPLV3_LIST="
1833 EXTERNAL_LIBRARY_LIST="
1834 $EXTERNAL_LIBRARY_GPL_LIST
1835 $EXTERNAL_LIBRARY_NONFREE_LIST
1836 $EXTERNAL_LIBRARY_VERSION3_LIST
1837 $EXTERNAL_LIBRARY_GPLV3_LIST
1917 HWACCEL_AUTODETECT_LIBRARY_LIST="
1936 # catchall list of things that require external libs to link
1942 HWACCEL_LIBRARY_NONFREE_LIST="
1948 HWACCEL_LIBRARY_LIST="
1949 $HWACCEL_LIBRARY_NONFREE_LIST
1971 safe_bitstream_reader
1978 # this list should be kept in linking order
2012 # COMPONENT_LIST needs to come last to ensure correct dependency checking
2016 $EXTERNAL_LIBRARY_LIST
2017 $EXTERNAL_AUTODETECT_LIBRARY_LIST
2018 $HWACCEL_LIBRARY_LIST
2019 $HWACCEL_AUTODETECT_LIBRARY_LIST
2054 $EXTERNAL_AUTODETECT_LIBRARY_LIST
2055 $HWACCEL_AUTODETECT_LIBRARY_LIST
2102 ARCH_EXT_LIST_MIPS="
2114 ARCH_EXT_LIST_LOONGSON="
2122 ARCH_EXT_LIST_X86_SIMD="
2152 ARCH_EXT_LIST_RISCV="
2157 $ARCH_EXT_LIST_X86_SIMD
2165 $ARCH_EXT_LIST_RISCV
2168 $ARCH_EXT_LIST_LOONGSON
2190 sync_val_compare_and_swap
2207 cdio_paranoia_paranoia_h
2210 dev_bktr_ioctl_bt848_h
2211 dev_bktr_ioctl_meteor_h
2213 dev_video_bktr_ioctl_bt848_h
2214 dev_video_meteor_ioctl_meteor_h
2224 machine_ioctl_bt848_h
2225 machine_ioctl_meteor_h
2227 opencv2_core_core_c_h
2284 MMAL_PARAMETER_VIDEO_MAX_NUM_CALLBACKS
2305 GetProcessAffinityMask
2306 GetProcessMemoryInfo
2310 GetSystemTimeAsFileTime
2334 SetConsoleTextAttribute
2335 SetConsoleCtrlHandler
2345 UTGetOSTypeFromString
2358 TOOLCHAIN_FEATURES="
2360 as_archext_dotprod_directive
2361 as_archext_i8mm_directive
2373 inline_asm_direct_symbol_refs
2375 inline_asm_nonlocal_labels
2386 DPI_AWARENESS_CONTEXT
2388 kCMVideoCodecType_HEVC
2389 kCMVideoCodecType_HEVCWithAlpha
2390 kCMVideoCodecType_VP9
2391 kCVPixelFormatType_420YpCbCr10BiPlanarVideoRange
2392 kCVPixelFormatType_422YpCbCr8BiPlanarVideoRange
2393 kCVPixelFormatType_422YpCbCr10BiPlanarVideoRange
2394 kCVPixelFormatType_422YpCbCr16BiPlanarVideoRange
2395 kCVPixelFormatType_444YpCbCr8BiPlanarVideoRange
2396 kCVPixelFormatType_444YpCbCr10BiPlanarVideoRange
2397 kCVPixelFormatType_444YpCbCr16BiPlanarVideoRange
2398 kCVImageBufferTransferFunction_SMPTE_ST_2084_PQ
2399 kCVImageBufferTransferFunction_ITU_R_2100_HLG
2400 kCVImageBufferTransferFunction_Linear
2401 kCVImageBufferYCbCrMatrix_ITU_R_2020
2402 kCVImageBufferColorPrimaries_ITU_R_2020
2403 kCVImageBufferTransferFunction_ITU_R_2020
2404 kCVImageBufferTransferFunction_SMPTE_ST_428_1
2407 struct_group_source_req
2408 struct_ip_mreq_source
2410 struct_msghdr_msg_flags
2412 struct_rusage_ru_maxrss
2413 struct_sctp_event_subscribe
2415 struct_sockaddr_sa_len
2416 struct_sockaddr_storage
2417 struct_stat_st_mtim_tv_nsec
2418 struct_v4l2_frmivalenum_discrete
2423 $(add_suffix _external $ARCH_EXT_LIST)
2424 $(add_suffix _inline $ARCH_EXT_LIST)
2446 opencl_vaapi_beignet
2447 opencl_vaapi_intel_media
2456 # options emitted with CONFIG_ prefix but not available on the command line
2486 frame_thread_encoder
2652 # code dependency declarations
2654 # architecture extensions
2659 armv8_deps="aarch64"
2660 neon_deps_any="aarch64 arm"
2661 intrinsics_neon_deps="neon"
2665 dotprod_deps="aarch64 neon"
2666 i8mm_deps="aarch64 neon"
2668 map 'eval ${v}_inline_deps=inline_asm' $ARCH_EXT_LIST_ARM
2679 loongson2_deps="mips"
2680 loongson3_deps="mips"
2681 mmi_deps_any="loongson2 loongson3"
2682 lsx_deps="loongarch"
2685 mips32r2_deps="mips"
2686 mips32r5_deps="mips"
2687 mips32r6_deps="mips"
2688 mips64r2_deps="mips"
2689 mips64r6_deps="mips"
2692 mipsdspr2_deps="mips"
2696 x86_64_select="i686"
2697 x86_64_suggest="fast_cmov"
2700 amd3dnowext_deps="amd3dnow"
2717 avx512icl_deps="avx512"
2719 mmx_external_deps="x86asm"
2720 mmx_inline_deps="inline_asm x86"
2721 mmx_suggest="mmx_external mmx_inline"
2723 for ext in $(filter_out mmx $ARCH_EXT_LIST_X86_SIMD); do
2724 eval dep=\$${ext}_deps
2725 eval ${ext}_external_deps='"${dep}_external"'
2726 eval ${ext}_inline_deps='"${dep}_inline"'
2727 eval ${ext}_suggest='"${ext}_external ${ext}_inline"'
2730 aligned_stack_if_any="aarch64 ppc x86"
2731 fast_64bit_if_any="aarch64 alpha ia64 mips64 parisc64 ppc64 riscv64 sparc64 x86_64"
2732 fast_clz_if_any="aarch64 alpha avr32 mips ppc x86"
2733 fast_unaligned_if_any="aarch64 ppc x86"
2734 simd_align_16_if_any="altivec neon sse"
2735 simd_align_32_if_any="avx"
2736 simd_align_64_if_any="avx512"
2738 # system capabilities
2739 linux_perf_deps="linux_perf_event_h"
2740 symver_if_any="symver_asm_label symver_gnu_asm"
2741 valgrind_backtrace_conflict="optimizations"
2742 valgrind_backtrace_deps="valgrind_valgrind_h"
2745 atomics_gcc_if="sync_val_compare_and_swap"
2746 atomics_suncc_if="atomic_cas_ptr machine_rw_barrier"
2747 atomics_win32_if="MemoryBarrier"
2748 atomics_native_if_any="$ATOMICS_LIST"
2749 w32threads_deps="atomics_native"
2750 threads_if_any="$THREADS_LIST"
2753 cbs_av1_select="cbs"
2754 cbs_h264_select="cbs"
2755 cbs_h265_select="cbs"
2756 cbs_h266_select="cbs"
2757 cbs_jpeg_select="cbs"
2758 cbs_mpeg2_select="cbs"
2759 cbs_vp9_select="cbs"
2760 deflate_wrapper_deps="zlib"
2761 dirac_parse_select="golomb"
2762 dovi_rpu_select="golomb"
2763 dnn_suggest="libtensorflow libopenvino"
2764 dnn_deps="avformat swscale"
2765 error_resilience_select="me_cmp"
2766 evcparse_select="golomb"
2768 faandct_select="fdctdsp"
2769 faanidct_deps="faan"
2770 faanidct_select="idctdsp"
2771 h264dsp_select="startcode"
2772 h264_sei_select="atsc_a53 golomb"
2773 hevcparse_select="golomb"
2774 hevc_sei_select="atsc_a53 golomb"
2775 frame_thread_encoder_deps="encoders threads"
2776 inflate_wrapper_deps="zlib"
2777 intrax8_select="blockdsp wmv2dsp"
2778 iso_media_select="mpeg4audio"
2779 me_cmp_select="idctdsp"
2780 mpeg_er_select="error_resilience"
2781 mpegaudio_select="mpegaudiodsp mpegaudioheader"
2782 mpegvideo_select="blockdsp hpeldsp idctdsp videodsp"
2783 mpegvideodec_select="h264chroma mpegvideo mpeg_er"
2784 mpegvideoenc_select="aandcttables fdctdsp me_cmp mpegvideo pixblockdsp"
2785 msmpeg4dec_select="h263_decoder"
2786 msmpeg4enc_select="h263_encoder"
2787 vc1dsp_select="h264chroma qpeldsp startcode"
2789 # decoders / encoders
2790 aac_decoder_select="adts_header mpeg4audio sinewin"
2791 aac_fixed_decoder_select="adts_header mpeg4audio"
2792 aac_encoder_select="audio_frame_queue iirfilter lpc sinewin"
2793 aac_latm_decoder_select="aac_decoder aac_latm_parser"
2794 ac3_decoder_select="ac3_parser ac3dsp bswapdsp fmtconvert"
2795 ac3_fixed_decoder_select="ac3_parser ac3dsp bswapdsp"
2796 ac3_encoder_select="ac3dsp audiodsp me_cmp"
2797 ac3_fixed_encoder_select="ac3dsp audiodsp me_cmp"
2798 acelp_kelvin_decoder_select="audiodsp"
2799 adpcm_g722_decoder_select="g722dsp"
2800 adpcm_g722_encoder_select="g722dsp"
2801 agm_decoder_select="idctdsp"
2802 aic_decoder_select="golomb idctdsp"
2803 alac_encoder_select="lpc"
2804 als_decoder_select="bswapdsp mpeg4audio"
2805 amrnb_decoder_select="lsp"
2806 amrwb_decoder_select="lsp"
2807 amv_decoder_select="sp5x_decoder exif"
2808 amv_encoder_select="jpegtables mpegvideoenc"
2809 ape_decoder_select="bswapdsp llauddsp"
2810 apng_decoder_select="inflate_wrapper"
2811 apng_encoder_select="deflate_wrapper llvidencdsp"
2812 aptx_encoder_select="audio_frame_queue"
2813 aptx_hd_encoder_select="audio_frame_queue"
2814 asv1_decoder_select="blockdsp bswapdsp idctdsp"
2815 asv1_encoder_select="aandcttables bswapdsp fdctdsp pixblockdsp"
2816 asv2_decoder_select="blockdsp bswapdsp idctdsp"
2817 asv2_encoder_select="aandcttables bswapdsp fdctdsp pixblockdsp"
2818 atrac1_decoder_select="sinewin"
2819 av1_decoder_select="cbs_av1 atsc_a53"
2820 bink_decoder_select="blockdsp hpeldsp"
2821 binkaudio_dct_decoder_select="wma_freqs"
2822 binkaudio_rdft_decoder_select="wma_freqs"
2823 cavs_decoder_select="blockdsp golomb h264chroma idctdsp qpeldsp videodsp"
2824 clearvideo_decoder_select="idctdsp"
2825 cllc_decoder_select="bswapdsp"
2826 comfortnoise_encoder_select="lpc"
2827 cook_decoder_select="audiodsp sinewin"
2828 cri_decoder_select="mjpeg_decoder"
2829 cscd_decoder_suggest="zlib"
2830 dds_decoder_select="texturedsp"
2831 dirac_decoder_select="dirac_parse dwt golomb videodsp mpegvideoenc"
2832 dnxhd_decoder_select="blockdsp idctdsp"
2833 dnxhd_encoder_select="blockdsp fdctdsp idctdsp mpegvideoenc pixblockdsp videodsp"
2834 dvvideo_decoder_select="dvprofile idctdsp"
2835 dvvideo_encoder_select="dvprofile fdctdsp me_cmp pixblockdsp"
2836 dxa_decoder_deps="zlib"
2837 dxv_decoder_select="lzf texturedsp"
2838 eac3_decoder_select="ac3_decoder"
2839 eac3_encoder_select="ac3_encoder"
2840 eamad_decoder_select="aandcttables blockdsp bswapdsp"
2841 eatgq_decoder_select="aandcttables"
2842 eatqi_decoder_select="aandcttables blockdsp bswapdsp"
2843 exr_decoder_deps="zlib"
2844 exr_encoder_deps="zlib"
2845 ffv1_decoder_select="rangecoder"
2846 ffv1_encoder_select="rangecoder"
2847 ffvhuff_decoder_select="huffyuv_decoder"
2848 ffvhuff_encoder_select="huffyuv_encoder"
2849 fic_decoder_select="golomb"
2850 flac_encoder_select="bswapdsp lpc"
2851 flashsv2_decoder_select="inflate_wrapper"
2852 flashsv2_encoder_select="deflate_wrapper"
2853 flashsv_decoder_select="inflate_wrapper"
2854 flashsv_encoder_deps="zlib"
2855 flv_decoder_select="h263_decoder"
2856 flv_encoder_select="h263_encoder"
2857 fourxm_decoder_select="blockdsp bswapdsp"
2858 fraps_decoder_select="bswapdsp huffman"
2859 g2m_decoder_deps="zlib"
2860 g2m_decoder_select="blockdsp idctdsp jpegtables"
2861 g729_decoder_select="audiodsp"
2862 h261_decoder_select="mpegvideodec"
2863 h261_encoder_select="mpegvideoenc"
2864 h263_decoder_select="h263_parser h263dsp mpegvideodec qpeldsp"
2865 h263_encoder_select="h263dsp mpegvideoenc"
2866 h263i_decoder_select="h263_decoder"
2867 h263p_decoder_select="h263_decoder"
2868 h263p_encoder_select="h263_encoder"
2869 h264_decoder_select="cabac golomb h264chroma h264dsp h264parse h264pred h264qpel h264_sei videodsp"
2870 h264_decoder_suggest="error_resilience"
2871 hap_decoder_select="snappy texturedsp"
2872 hap_encoder_deps="libsnappy"
2873 hap_encoder_select="texturedspenc"
2874 hevc_decoder_select="bswapdsp cabac dovi_rpu golomb hevcparse hevc_sei videodsp"
2875 huffyuv_decoder_select="bswapdsp huffyuvdsp llviddsp"
2876 huffyuv_encoder_select="bswapdsp huffman huffyuvencdsp llvidencdsp"
2877 hymt_decoder_select="huffyuv_decoder"
2878 iac_decoder_select="imc_decoder"
2879 imc_decoder_select="bswapdsp sinewin"
2880 imm4_decoder_select="bswapdsp idctdsp"
2881 imm5_decoder_select="h264_decoder hevc_decoder"
2882 indeo3_decoder_select="hpeldsp"
2883 indeo4_decoder_select="ividsp"
2884 indeo5_decoder_select="ividsp"
2885 interplay_video_decoder_select="hpeldsp"
2886 ipu_decoder_select="mpegvideodec"
2887 jpegls_decoder_select="mjpeg_decoder"
2888 jv_decoder_select="blockdsp"
2889 lagarith_decoder_select="llviddsp"
2890 ljpeg_encoder_select="jpegtables"
2891 lscr_decoder_select="inflate_wrapper"
2892 magicyuv_decoder_select="llviddsp"
2893 magicyuv_encoder_select="llvidencdsp"
2894 mdec_decoder_select="blockdsp bswapdsp idctdsp"
2895 media100_decoder_select="media100_to_mjpegb_bsf mjpegb_decoder"
2896 metasound_decoder_select="lsp sinewin"
2897 mimic_decoder_select="blockdsp bswapdsp hpeldsp idctdsp"
2898 mjpeg_decoder_select="blockdsp hpeldsp exif idctdsp jpegtables"
2899 mjpeg_encoder_select="jpegtables mpegvideoenc"
2900 mjpegb_decoder_select="mjpeg_decoder"
2901 mlp_decoder_select="mlp_parser"
2902 mlp_encoder_select="lpc audio_frame_queue"
2903 mobiclip_decoder_select="bswapdsp golomb"
2904 motionpixels_decoder_select="bswapdsp"
2905 mp1_decoder_select="mpegaudio"
2906 mp1float_decoder_select="mpegaudio"
2907 mp2_decoder_select="mpegaudio"
2908 mp2float_decoder_select="mpegaudio"
2909 mp3_decoder_select="mpegaudio"
2910 mp3adu_decoder_select="mpegaudio"
2911 mp3adufloat_decoder_select="mpegaudio"
2912 mp3float_decoder_select="mpegaudio"
2913 mp3on4_decoder_select="mpegaudio mpeg4audio"
2914 mp3on4float_decoder_select="mpegaudio mpeg4audio"
2915 mpc7_decoder_select="bswapdsp mpegaudiodsp"
2916 mpc8_decoder_select="mpegaudiodsp"
2917 mpegvideo_decoder_select="mpegvideodec"
2918 mpeg1video_decoder_select="mpegvideodec"
2919 mpeg1video_encoder_select="mpegvideoenc"
2920 mpeg2video_decoder_select="mpegvideodec"
2921 mpeg2video_encoder_select="mpegvideoenc"
2922 mpeg4_decoder_select="h263_decoder mpeg4video_parser"
2923 mpeg4_encoder_select="h263_encoder qpeldsp"
2924 msa1_decoder_select="mss34dsp"
2925 mscc_decoder_select="inflate_wrapper"
2926 msmpeg4v1_decoder_select="msmpeg4dec"
2927 msmpeg4v2_decoder_select="msmpeg4dec"
2928 msmpeg4v2_encoder_select="msmpeg4enc"
2929 msmpeg4v3_decoder_select="msmpeg4dec"
2930 msmpeg4v3_encoder_select="msmpeg4enc"
2931 mss2_decoder_select="mpegvideodec qpeldsp vc1_decoder"
2932 mts2_decoder_select="jpegtables mss34dsp"
2933 mv30_decoder_select="aandcttables blockdsp"
2934 mvha_decoder_select="inflate_wrapper llviddsp"
2935 mwsc_decoder_select="inflate_wrapper"
2936 mxpeg_decoder_select="mjpeg_decoder"
2937 nellymoser_decoder_select="sinewin"
2938 nellymoser_encoder_select="audio_frame_queue sinewin"
2939 notchlc_decoder_select="lzf"
2940 nuv_decoder_select="idctdsp"
2941 opus_decoder_deps="swresample"
2942 opus_encoder_select="audio_frame_queue"
2943 pdv_decoder_deps="zlib"
2944 png_decoder_select="inflate_wrapper"
2945 png_encoder_select="deflate_wrapper llvidencdsp"
2946 prores_decoder_select="blockdsp idctdsp"
2947 prores_encoder_select="fdctdsp"
2948 prores_aw_encoder_select="fdctdsp"
2949 prores_ks_encoder_select="fdctdsp"
2950 qcelp_decoder_select="lsp"
2951 qdm2_decoder_select="mpegaudiodsp"
2952 ra_144_decoder_select="audiodsp"
2953 ra_144_encoder_select="audio_frame_queue lpc audiodsp"
2954 ralf_decoder_select="golomb"
2955 rasc_decoder_select="inflate_wrapper"
2956 rawvideo_decoder_select="bswapdsp"
2957 rscc_decoder_deps="zlib"
2958 rtv1_decoder_select="texturedsp"
2959 rv10_decoder_select="h263_decoder"
2960 rv10_encoder_select="h263_encoder"
2961 rv20_decoder_select="h263_decoder"
2962 rv20_encoder_select="h263_encoder"
2963 rv30_decoder_select="golomb h264pred h264qpel mpegvideodec rv34dsp"
2964 rv40_decoder_select="golomb h264pred h264qpel mpegvideodec rv34dsp"
2965 screenpresso_decoder_deps="zlib"
2966 shorten_decoder_select="bswapdsp"
2967 sipr_decoder_select="lsp"
2968 smvjpeg_decoder_select="mjpeg_decoder"
2969 snow_decoder_select="dwt h264qpel rangecoder videodsp"
2970 snow_encoder_select="dwt h264qpel hpeldsp me_cmp mpegvideoenc rangecoder videodsp"
2971 sonic_decoder_select="golomb rangecoder"
2972 sonic_encoder_select="golomb rangecoder"
2973 sonic_ls_encoder_select="golomb rangecoder"
2974 sp5x_decoder_select="mjpeg_decoder"
2975 speedhq_decoder_select="blockdsp idctdsp"
2976 speedhq_encoder_select="mpegvideoenc"
2977 srgc_decoder_select="inflate_wrapper"
2978 svq1_decoder_select="hpeldsp"
2979 svq1_encoder_select="hpeldsp me_cmp mpegvideoenc"
2980 svq3_decoder_select="golomb h264dsp h264parse h264pred hpeldsp tpeldsp videodsp"
2981 svq3_decoder_suggest="zlib"
2982 tak_decoder_select="audiodsp"
2983 tdsc_decoder_deps="zlib"
2984 tdsc_decoder_select="mjpeg_decoder"
2985 theora_decoder_select="vp3_decoder"
2986 thp_decoder_select="mjpeg_decoder"
2987 tiff_decoder_select="mjpeg_decoder"
2988 tiff_decoder_suggest="zlib lzma"
2989 tiff_encoder_suggest="zlib"
2990 truehd_decoder_select="mlp_parser"
2991 truehd_encoder_select="lpc audio_frame_queue"
2992 truemotion2_decoder_select="bswapdsp"
2993 truespeech_decoder_select="bswapdsp"
2994 tscc_decoder_select="inflate_wrapper"
2995 twinvq_decoder_select="lsp sinewin"
2996 txd_decoder_select="texturedsp"
2997 utvideo_decoder_select="bswapdsp llviddsp"
2998 utvideo_encoder_select="bswapdsp huffman llvidencdsp"
2999 vble_decoder_select="llviddsp"
3000 vbn_decoder_select="texturedsp"
3001 vbn_encoder_select="texturedspenc"
3002 vmix_decoder_select="idctdsp"
3003 vc1_decoder_select="blockdsp h264qpel intrax8 mpegvideodec qpeldsp vc1dsp"
3004 vc1image_decoder_select="vc1_decoder"
3005 vorbis_encoder_select="audio_frame_queue"
3006 vp3_decoder_select="hpeldsp vp3dsp videodsp"
3007 vp4_decoder_select="vp3_decoder"
3008 vp5_decoder_select="h264chroma hpeldsp videodsp vp3dsp vp56dsp"
3009 vp6_decoder_select="h264chroma hpeldsp huffman videodsp vp3dsp vp56dsp"
3010 vp6a_decoder_select="vp6_decoder"
3011 vp6f_decoder_select="vp6_decoder"
3012 vp7_decoder_select="h264pred videodsp vp8dsp"
3013 vp8_decoder_select="h264pred videodsp vp8dsp"
3014 vp9_decoder_select="videodsp vp9_parser vp9_superframe_split_bsf"
3015 wcmv_decoder_select="inflate_wrapper"
3016 webp_decoder_select="vp8_decoder exif"
3017 wmalossless_decoder_select="llauddsp"
3018 wmapro_decoder_select="sinewin wma_freqs"
3019 wmav1_decoder_select="sinewin wma_freqs"
3020 wmav1_encoder_select="sinewin wma_freqs"
3021 wmav2_decoder_select="sinewin wma_freqs"
3022 wmav2_encoder_select="sinewin wma_freqs"
3023 wmavoice_decoder_select="lsp sinewin"
3024 wmv1_decoder_select="msmpeg4dec"
3025 wmv1_encoder_select="msmpeg4enc"
3026 wmv2_decoder_select="blockdsp error_resilience idctdsp intrax8 msmpeg4dec videodsp wmv2dsp"
3027 wmv2_encoder_select="msmpeg4enc wmv2dsp"
3028 wmv3_decoder_select="vc1_decoder"
3029 wmv3image_decoder_select="wmv3_decoder"
3030 xma1_decoder_select="wmapro_decoder"
3031 xma2_decoder_select="wmapro_decoder"
3032 ylc_decoder_select="bswapdsp"
3033 zerocodec_decoder_select="inflate_wrapper"
3034 zlib_decoder_select="inflate_wrapper"
3035 zlib_encoder_select="deflate_wrapper"
3036 zmbv_decoder_select="inflate_wrapper"
3037 zmbv_encoder_select="deflate_wrapper"
3039 # hardware accelerators
3040 crystalhd_deps="libcrystalhd_libcrystalhd_if_h"
3041 cuda_deps="ffnvcodec"
3042 cuvid_deps="ffnvcodec"
3043 d3d11va_deps="dxva_h ID3D11VideoDecoder ID3D11VideoContext"
3044 dxva2_deps="dxva2api_h DXVA2_ConfigPictureDecode ole32 user32"
3045 ffnvcodec_deps_any="libdl LoadLibrary"
3046 mediacodec_deps="android"
3047 nvdec_deps="ffnvcodec"
3048 vaapi_x11_deps="xlib_x11"
3049 videotoolbox_hwaccel_deps="videotoolbox pthreads"
3050 videotoolbox_hwaccel_extralibs="-framework QuartzCore"
3051 vulkan_deps_any="libdl LoadLibrary"
3053 av1_d3d11va_hwaccel_deps="d3d11va DXVA_PicParams_AV1"
3054 av1_d3d11va_hwaccel_select="av1_decoder"
3055 av1_d3d11va2_hwaccel_deps="d3d11va DXVA_PicParams_AV1"
3056 av1_d3d11va2_hwaccel_select="av1_decoder"
3057 av1_dxva2_hwaccel_deps="dxva2 DXVA_PicParams_AV1"
3058 av1_dxva2_hwaccel_select="av1_decoder"
3059 av1_nvdec_hwaccel_deps="nvdec CUVIDAV1PICPARAMS"
3060 av1_nvdec_hwaccel_select="av1_decoder"
3061 av1_vaapi_hwaccel_deps="vaapi VADecPictureParameterBufferAV1_bit_depth_idx"
3062 av1_vaapi_hwaccel_select="av1_decoder"
3063 av1_vdpau_hwaccel_deps="vdpau VdpPictureInfoAV1"
3064 av1_vdpau_hwaccel_select="av1_decoder"
3065 av1_vulkan_hwaccel_deps="vulkan"
3066 av1_vulkan_hwaccel_select="av1_decoder"
3067 h263_vaapi_hwaccel_deps="vaapi"
3068 h263_vaapi_hwaccel_select="h263_decoder"
3069 h263_videotoolbox_hwaccel_deps="videotoolbox"
3070 h263_videotoolbox_hwaccel_select="h263_decoder"
3071 h264_d3d11va_hwaccel_deps="d3d11va"
3072 h264_d3d11va_hwaccel_select="h264_decoder"
3073 h264_d3d11va2_hwaccel_deps="d3d11va"
3074 h264_d3d11va2_hwaccel_select="h264_decoder"
3075 h264_dxva2_hwaccel_deps="dxva2"
3076 h264_dxva2_hwaccel_select="h264_decoder"
3077 h264_nvdec_hwaccel_deps="nvdec"
3078 h264_nvdec_hwaccel_select="h264_decoder"
3079 h264_vaapi_hwaccel_deps="vaapi"
3080 h264_vaapi_hwaccel_select="h264_decoder"
3081 h264_vdpau_hwaccel_deps="vdpau"
3082 h264_vdpau_hwaccel_select="h264_decoder"
3083 h264_videotoolbox_hwaccel_deps="videotoolbox"
3084 h264_videotoolbox_hwaccel_select="h264_decoder"
3085 h264_vulkan_hwaccel_deps="vulkan"
3086 h264_vulkan_hwaccel_select="h264_decoder"
3087 hevc_d3d11va_hwaccel_deps="d3d11va DXVA_PicParams_HEVC"
3088 hevc_d3d11va_hwaccel_select="hevc_decoder"
3089 hevc_d3d11va2_hwaccel_deps="d3d11va DXVA_PicParams_HEVC"
3090 hevc_d3d11va2_hwaccel_select="hevc_decoder"
3091 hevc_dxva2_hwaccel_deps="dxva2 DXVA_PicParams_HEVC"
3092 hevc_dxva2_hwaccel_select="hevc_decoder"
3093 hevc_nvdec_hwaccel_deps="nvdec"
3094 hevc_nvdec_hwaccel_select="hevc_decoder"
3095 hevc_vaapi_hwaccel_deps="vaapi VAPictureParameterBufferHEVC"
3096 hevc_vaapi_hwaccel_select="hevc_decoder"
3097 hevc_vdpau_hwaccel_deps="vdpau VdpPictureInfoHEVC"
3098 hevc_vdpau_hwaccel_select="hevc_decoder"
3099 hevc_videotoolbox_hwaccel_deps="videotoolbox"
3100 hevc_videotoolbox_hwaccel_select="hevc_decoder"
3101 hevc_vulkan_hwaccel_deps="vulkan"
3102 hevc_vulkan_hwaccel_select="hevc_decoder"
3103 mjpeg_nvdec_hwaccel_deps="nvdec"
3104 mjpeg_nvdec_hwaccel_select="mjpeg_decoder"
3105 mjpeg_vaapi_hwaccel_deps="vaapi"
3106 mjpeg_vaapi_hwaccel_select="mjpeg_decoder"
3107 mpeg1_nvdec_hwaccel_deps="nvdec"
3108 mpeg1_nvdec_hwaccel_select="mpeg1video_decoder"
3109 mpeg1_vdpau_hwaccel_deps="vdpau"
3110 mpeg1_vdpau_hwaccel_select="mpeg1video_decoder"
3111 mpeg1_videotoolbox_hwaccel_deps="videotoolbox"
3112 mpeg1_videotoolbox_hwaccel_select="mpeg1video_decoder"
3113 mpeg2_d3d11va_hwaccel_deps="d3d11va"
3114 mpeg2_d3d11va_hwaccel_select="mpeg2video_decoder"
3115 mpeg2_d3d11va2_hwaccel_deps="d3d11va"
3116 mpeg2_d3d11va2_hwaccel_select="mpeg2video_decoder"
3117 mpeg2_dxva2_hwaccel_deps="dxva2"
3118 mpeg2_dxva2_hwaccel_select="mpeg2video_decoder"
3119 mpeg2_nvdec_hwaccel_deps="nvdec"
3120 mpeg2_nvdec_hwaccel_select="mpeg2video_decoder"
3121 mpeg2_vaapi_hwaccel_deps="vaapi"
3122 mpeg2_vaapi_hwaccel_select="mpeg2video_decoder"
3123 mpeg2_vdpau_hwaccel_deps="vdpau"
3124 mpeg2_vdpau_hwaccel_select="mpeg2video_decoder"
3125 mpeg2_videotoolbox_hwaccel_deps="videotoolbox"
3126 mpeg2_videotoolbox_hwaccel_select="mpeg2video_decoder"
3127 mpeg4_nvdec_hwaccel_deps="nvdec"
3128 mpeg4_nvdec_hwaccel_select="mpeg4_decoder"
3129 mpeg4_vaapi_hwaccel_deps="vaapi"
3130 mpeg4_vaapi_hwaccel_select="mpeg4_decoder"
3131 mpeg4_vdpau_hwaccel_deps="vdpau"
3132 mpeg4_vdpau_hwaccel_select="mpeg4_decoder"
3133 mpeg4_videotoolbox_hwaccel_deps="videotoolbox"
3134 mpeg4_videotoolbox_hwaccel_select="mpeg4_decoder"
3135 prores_videotoolbox_hwaccel_deps="videotoolbox"
3136 prores_videotoolbox_hwaccel_select="prores_decoder"
3137 vc1_d3d11va_hwaccel_deps="d3d11va"
3138 vc1_d3d11va_hwaccel_select="vc1_decoder"
3139 vc1_d3d11va2_hwaccel_deps="d3d11va"
3140 vc1_d3d11va2_hwaccel_select="vc1_decoder"
3141 vc1_dxva2_hwaccel_deps="dxva2"
3142 vc1_dxva2_hwaccel_select="vc1_decoder"
3143 vc1_nvdec_hwaccel_deps="nvdec"
3144 vc1_nvdec_hwaccel_select="vc1_decoder"
3145 vc1_vaapi_hwaccel_deps="vaapi"
3146 vc1_vaapi_hwaccel_select="vc1_decoder"
3147 vc1_vdpau_hwaccel_deps="vdpau"
3148 vc1_vdpau_hwaccel_select="vc1_decoder"
3149 vp8_nvdec_hwaccel_deps="nvdec"
3150 vp8_nvdec_hwaccel_select="vp8_decoder"
3151 vp8_vaapi_hwaccel_deps="vaapi"
3152 vp8_vaapi_hwaccel_select="vp8_decoder"
3153 vp9_d3d11va_hwaccel_deps="d3d11va DXVA_PicParams_VP9"
3154 vp9_d3d11va_hwaccel_select="vp9_decoder"
3155 vp9_d3d11va2_hwaccel_deps="d3d11va DXVA_PicParams_VP9"
3156 vp9_d3d11va2_hwaccel_select="vp9_decoder"
3157 vp9_dxva2_hwaccel_deps="dxva2 DXVA_PicParams_VP9"
3158 vp9_dxva2_hwaccel_select="vp9_decoder"
3159 vp9_nvdec_hwaccel_deps="nvdec"
3160 vp9_nvdec_hwaccel_select="vp9_decoder"
3161 vp9_vaapi_hwaccel_deps="vaapi VADecPictureParameterBufferVP9_bit_depth"
3162 vp9_vaapi_hwaccel_select="vp9_decoder"
3163 vp9_vdpau_hwaccel_deps="vdpau VdpPictureInfoVP9"
3164 vp9_vdpau_hwaccel_select="vp9_decoder"
3165 vp9_videotoolbox_hwaccel_deps="videotoolbox"
3166 vp9_videotoolbox_hwaccel_select="vp9_decoder"
3167 wmv3_d3d11va_hwaccel_select="vc1_d3d11va_hwaccel"
3168 wmv3_d3d11va2_hwaccel_select="vc1_d3d11va2_hwaccel"
3169 wmv3_dxva2_hwaccel_select="vc1_dxva2_hwaccel"
3170 wmv3_nvdec_hwaccel_select="vc1_nvdec_hwaccel"
3171 wmv3_vaapi_hwaccel_select="vc1_vaapi_hwaccel"
3172 wmv3_vdpau_hwaccel_select="vc1_vdpau_hwaccel"
3174 # hardware-accelerated codecs
3175 mediafoundation_deps="mftransform_h MFCreateAlignedMemoryBuffer"
3176 omx_deps="libdl pthreads"
3177 omx_rpi_select="omx"
3182 vaapi_encode_deps="vaapi"
3183 v4l2_m2m_deps="linux_videodev2_h sem_timedwait"
3185 bilateral_cuda_filter_deps="ffnvcodec"
3186 bilateral_cuda_filter_deps_any="cuda_nvcc cuda_llvm"
3187 chromakey_cuda_filter_deps="ffnvcodec"
3188 chromakey_cuda_filter_deps_any="cuda_nvcc cuda_llvm"
3189 colorspace_cuda_filter_deps="ffnvcodec"
3190 colorspace_cuda_filter_deps_any="cuda_nvcc cuda_llvm"
3191 hwupload_cuda_filter_deps="ffnvcodec"
3192 scale_npp_filter_deps="ffnvcodec libnpp"
3193 scale2ref_npp_filter_deps="ffnvcodec libnpp"
3194 scale_cuda_filter_deps="ffnvcodec"
3195 scale_cuda_filter_deps_any="cuda_nvcc cuda_llvm"
3196 thumbnail_cuda_filter_deps="ffnvcodec"
3197 thumbnail_cuda_filter_deps_any="cuda_nvcc cuda_llvm"
3198 transpose_npp_filter_deps="ffnvcodec libnpp"
3199 overlay_cuda_filter_deps="ffnvcodec"
3200 overlay_cuda_filter_deps_any="cuda_nvcc cuda_llvm"
3201 sharpen_npp_filter_deps="ffnvcodec libnpp"
3203 ddagrab_filter_deps="d3d11va IDXGIOutput1 DXGI_OUTDUPL_FRAME_INFO"
3205 amf_deps_any="libdl LoadLibrary"
3206 nvenc_deps="ffnvcodec"
3207 nvenc_deps_any="libdl LoadLibrary"
3209 aac_mf_encoder_deps="mediafoundation"
3210 ac3_mf_encoder_deps="mediafoundation"
3211 av1_cuvid_decoder_deps="cuvid CUVIDAV1PICPARAMS"
3212 av1_mediacodec_decoder_deps="mediacodec"
3213 av1_mediacodec_encoder_deps="mediacodec"
3214 av1_nvenc_encoder_deps="nvenc NV_ENC_PIC_PARAMS_AV1"
3215 av1_nvenc_encoder_select="atsc_a53"
3216 h263_v4l2m2m_decoder_deps="v4l2_m2m h263_v4l2_m2m"
3217 h263_v4l2m2m_encoder_deps="v4l2_m2m h263_v4l2_m2m"
3218 h264_amf_encoder_deps="amf"
3219 h264_crystalhd_decoder_select="crystalhd h264_mp4toannexb_bsf h264_parser"
3220 h264_cuvid_decoder_deps="cuvid"
3221 h264_cuvid_decoder_select="h264_mp4toannexb_bsf"
3222 h264_mediacodec_decoder_deps="mediacodec"
3223 h264_mediacodec_decoder_select="h264_mp4toannexb_bsf h264_parser"
3224 h264_mediacodec_encoder_deps="mediacodec"
3225 h264_mediacodec_encoder_select="h264_metadata"
3226 h264_mf_encoder_deps="mediafoundation"
3227 h264_mmal_decoder_deps="mmal"
3228 h264_nvenc_encoder_deps="nvenc"
3229 h264_nvenc_encoder_select="atsc_a53"
3230 h264_omx_encoder_deps="omx"
3231 h264_qsv_decoder_select="h264_mp4toannexb_bsf qsvdec"
3232 h264_qsv_encoder_select="atsc_a53 qsvenc"
3233 h264_rkmpp_decoder_deps="rkmpp"
3234 h264_rkmpp_decoder_select="h264_mp4toannexb_bsf"
3235 h264_vaapi_encoder_select="atsc_a53 cbs_h264 vaapi_encode"
3236 h264_v4l2m2m_decoder_deps="v4l2_m2m h264_v4l2_m2m"
3237 h264_v4l2m2m_decoder_select="h264_mp4toannexb_bsf"
3238 h264_v4l2m2m_encoder_deps="v4l2_m2m h264_v4l2_m2m"
3239 hevc_amf_encoder_deps="amf"
3240 hevc_cuvid_decoder_deps="cuvid"
3241 hevc_cuvid_decoder_select="hevc_mp4toannexb_bsf"
3242 hevc_mediacodec_decoder_deps="mediacodec"
3243 hevc_mediacodec_decoder_select="hevc_mp4toannexb_bsf hevc_parser"
3244 hevc_mediacodec_encoder_deps="mediacodec"
3245 hevc_mediacodec_encoder_select="hevc_metadata"
3246 hevc_mf_encoder_deps="mediafoundation"
3247 hevc_nvenc_encoder_deps="nvenc"
3248 hevc_nvenc_encoder_select="atsc_a53"
3249 hevc_qsv_decoder_select="hevc_mp4toannexb_bsf qsvdec"
3250 hevc_qsv_encoder_select="hevcparse qsvenc"
3251 hevc_rkmpp_decoder_deps="rkmpp"
3252 hevc_rkmpp_decoder_select="hevc_mp4toannexb_bsf"
3253 hevc_vaapi_encoder_deps="VAEncPictureParameterBufferHEVC"
3254 hevc_vaapi_encoder_select="atsc_a53 cbs_h265 vaapi_encode"
3255 hevc_v4l2m2m_decoder_deps="v4l2_m2m hevc_v4l2_m2m"
3256 hevc_v4l2m2m_decoder_select="hevc_mp4toannexb_bsf"
3257 hevc_v4l2m2m_encoder_deps="v4l2_m2m hevc_v4l2_m2m"
3258 mjpeg_cuvid_decoder_deps="cuvid"
3259 mjpeg_qsv_decoder_select="qsvdec"
3260 mjpeg_qsv_encoder_deps="libmfx"
3261 mjpeg_qsv_encoder_select="qsvenc"
3262 mjpeg_vaapi_encoder_deps="VAEncPictureParameterBufferJPEG"
3263 mjpeg_vaapi_encoder_select="cbs_jpeg jpegtables vaapi_encode"
3264 mp3_mf_encoder_deps="mediafoundation"
3265 mpeg1_cuvid_decoder_deps="cuvid"
3266 mpeg1_v4l2m2m_decoder_deps="v4l2_m2m mpeg1_v4l2_m2m"
3267 mpeg2_crystalhd_decoder_select="crystalhd"
3268 mpeg2_cuvid_decoder_deps="cuvid"
3269 mpeg2_mmal_decoder_deps="mmal"
3270 mpeg2_mediacodec_decoder_deps="mediacodec"
3271 mpeg2_qsv_decoder_select="qsvdec"
3272 mpeg2_qsv_encoder_select="qsvenc"
3273 mpeg2_vaapi_encoder_select="cbs_mpeg2 vaapi_encode"
3274 mpeg2_v4l2m2m_decoder_deps="v4l2_m2m mpeg2_v4l2_m2m"
3275 mpeg4_crystalhd_decoder_select="crystalhd"
3276 mpeg4_cuvid_decoder_deps="cuvid"
3277 mpeg4_mediacodec_decoder_deps="mediacodec"
3278 mpeg4_mediacodec_encoder_deps="mediacodec"
3279 mpeg4_mmal_decoder_deps="mmal"
3280 mpeg4_omx_encoder_deps="omx"
3281 mpeg4_v4l2m2m_decoder_deps="v4l2_m2m mpeg4_v4l2_m2m"
3282 mpeg4_v4l2m2m_encoder_deps="v4l2_m2m mpeg4_v4l2_m2m"
3283 msmpeg4_crystalhd_decoder_select="crystalhd"
3284 vc1_crystalhd_decoder_select="crystalhd"
3285 vc1_cuvid_decoder_deps="cuvid"
3286 vc1_mmal_decoder_deps="mmal"
3287 vc1_qsv_decoder_select="qsvdec"
3288 vc1_v4l2m2m_decoder_deps="v4l2_m2m vc1_v4l2_m2m"
3289 vp8_cuvid_decoder_deps="cuvid"
3290 vp8_mediacodec_decoder_deps="mediacodec"
3291 vp8_mediacodec_encoder_deps="mediacodec"
3292 vp8_qsv_decoder_select="qsvdec"
3293 vp8_rkmpp_decoder_deps="rkmpp"
3294 vp8_vaapi_encoder_deps="VAEncPictureParameterBufferVP8"
3295 vp8_vaapi_encoder_select="vaapi_encode"
3296 vp8_v4l2m2m_decoder_deps="v4l2_m2m vp8_v4l2_m2m"
3297 vp8_v4l2m2m_encoder_deps="v4l2_m2m vp8_v4l2_m2m"
3298 vp9_cuvid_decoder_deps="cuvid"
3299 vp9_mediacodec_decoder_deps="mediacodec"
3300 vp9_mediacodec_encoder_deps="mediacodec"
3301 vp9_qsv_decoder_select="qsvdec"
3302 vp9_rkmpp_decoder_deps="rkmpp"
3303 vp9_vaapi_encoder_deps="VAEncPictureParameterBufferVP9"
3304 vp9_vaapi_encoder_select="vaapi_encode"
3305 vp9_qsv_encoder_deps="libmfx MFX_CODEC_VP9"
3306 vp9_qsv_encoder_select="qsvenc"
3307 vp9_v4l2m2m_decoder_deps="v4l2_m2m vp9_v4l2_m2m"
3308 wmv3_crystalhd_decoder_select="crystalhd"
3309 av1_qsv_decoder_select="qsvdec"
3310 av1_qsv_encoder_select="qsvenc"
3311 av1_qsv_encoder_deps="libvpl"
3312 av1_amf_encoder_deps="amf"
3313 av1_vaapi_encoder_deps="VAEncPictureParameterBufferAV1"
3314 av1_vaapi_encoder_select="cbs_av1 vaapi_encode"
3317 aac_parser_select="adts_header mpeg4audio"
3318 av1_parser_select="cbs_av1"
3319 evc_parser_select="evcparse"
3320 h264_parser_select="golomb h264dsp h264parse h264_sei"
3321 hevc_parser_select="hevcparse hevc_sei"
3322 mpegaudio_parser_select="mpegaudioheader"
3323 mpeg4video_parser_select="h263dsp mpegvideodec qpeldsp"
3324 vc1_parser_select="vc1dsp"
3325 vvc_parser_select="cbs_h266"
3328 aac_adtstoasc_bsf_select="adts_header mpeg4audio"
3329 av1_frame_merge_bsf_select="cbs_av1"
3330 av1_frame_split_bsf_select="cbs_av1"
3331 av1_metadata_bsf_select="cbs_av1"
3332 dts2pts_bsf_select="cbs_h264 h264parse"
3333 eac3_core_bsf_select="ac3_parser"
3334 evc_frame_merge_bsf_select="evcparse"
3335 filter_units_bsf_select="cbs"
3336 h264_metadata_bsf_deps="const_nan"
3337 h264_metadata_bsf_select="cbs_h264"
3338 h264_redundant_pps_bsf_select="cbs_h264"
3339 hevc_metadata_bsf_select="cbs_h265"
3340 mjpeg2jpeg_bsf_select="jpegtables"
3341 mpeg2_metadata_bsf_select="cbs_mpeg2"
3342 trace_headers_bsf_select="cbs"
3343 vp9_metadata_bsf_select="cbs_vp9"
3344 vvc_metadata_bsf_select="cbs_h266"
3346 # external libraries
3347 aac_at_decoder_deps="audiotoolbox"
3348 aac_at_decoder_select="aac_adtstoasc_bsf"
3349 ac3_at_decoder_deps="audiotoolbox"
3350 ac3_at_decoder_select="ac3_parser"
3351 adpcm_ima_qt_at_decoder_deps="audiotoolbox"
3352 alac_at_decoder_deps="audiotoolbox"
3353 amr_nb_at_decoder_deps="audiotoolbox"
3354 avisynth_deps_any="libdl LoadLibrary"
3355 avisynth_demuxer_deps="avisynth"
3356 avisynth_demuxer_select="riffdec"
3357 eac3_at_decoder_deps="audiotoolbox"
3358 eac3_at_decoder_select="ac3_parser"
3359 gsm_ms_at_decoder_deps="audiotoolbox"
3360 ilbc_at_decoder_deps="audiotoolbox"
3361 mp1_at_decoder_deps="audiotoolbox"
3362 mp2_at_decoder_deps="audiotoolbox"
3363 mp3_at_decoder_deps="audiotoolbox"
3364 mp1_at_decoder_select="mpegaudioheader"
3365 mp2_at_decoder_select="mpegaudioheader"
3366 mp3_at_decoder_select="mpegaudioheader"
3367 pcm_alaw_at_decoder_deps="audiotoolbox"
3368 pcm_mulaw_at_decoder_deps="audiotoolbox"
3369 qdmc_at_decoder_deps="audiotoolbox"
3370 qdm2_at_decoder_deps="audiotoolbox"
3371 aac_at_encoder_deps="audiotoolbox"
3372 aac_at_encoder_select="audio_frame_queue"
3373 alac_at_encoder_deps="audiotoolbox"
3374 alac_at_encoder_select="audio_frame_queue"
3375 ilbc_at_encoder_deps="audiotoolbox"
3376 ilbc_at_encoder_select="audio_frame_queue"
3377 pcm_alaw_at_encoder_deps="audiotoolbox"
3378 pcm_alaw_at_encoder_select="audio_frame_queue"
3379 pcm_mulaw_at_encoder_deps="audiotoolbox"
3380 pcm_mulaw_at_encoder_select="audio_frame_queue"
3381 chromaprint_muxer_deps="chromaprint"
3382 h264_videotoolbox_encoder_deps="pthreads"
3383 h264_videotoolbox_encoder_select="atsc_a53 videotoolbox_encoder"
3384 hevc_videotoolbox_encoder_deps="pthreads"
3385 hevc_videotoolbox_encoder_select="atsc_a53 videotoolbox_encoder"
3386 prores_videotoolbox_encoder_deps="pthreads"
3387 prores_videotoolbox_encoder_select="videotoolbox_encoder"
3388 libaom_av1_decoder_deps="libaom"
3389 libaom_av1_encoder_deps="libaom"
3390 libaom_av1_encoder_select="extract_extradata_bsf"
3391 libaribb24_decoder_deps="libaribb24"
3392 libaribcaption_decoder_deps="libaribcaption"
3393 libcelt_decoder_deps="libcelt"
3394 libcodec2_decoder_deps="libcodec2"
3395 libcodec2_encoder_deps="libcodec2"
3396 libdav1d_decoder_deps="libdav1d"
3397 libdav1d_decoder_select="atsc_a53"
3398 libdavs2_decoder_deps="libdavs2"
3399 libdavs2_decoder_select="avs2_parser"
3400 libfdk_aac_decoder_deps="libfdk_aac"
3401 libfdk_aac_encoder_deps="libfdk_aac"
3402 libfdk_aac_encoder_select="audio_frame_queue"
3403 libgme_demuxer_deps="libgme"
3404 libgsm_decoder_deps="libgsm"
3405 libgsm_encoder_deps="libgsm"
3406 libgsm_ms_decoder_deps="libgsm"
3407 libgsm_ms_encoder_deps="libgsm"
3408 libilbc_decoder_deps="libilbc"
3409 libilbc_encoder_deps="libilbc"
3410 libjxl_decoder_deps="libjxl libjxl_threads"
3411 libjxl_encoder_deps="libjxl libjxl_threads"
3412 libkvazaar_encoder_deps="libkvazaar"
3413 libmodplug_demuxer_deps="libmodplug"
3414 libmp3lame_encoder_deps="libmp3lame"
3415 libmp3lame_encoder_select="audio_frame_queue mpegaudioheader"
3416 libopencore_amrnb_decoder_deps="libopencore_amrnb"
3417 libopencore_amrnb_encoder_deps="libopencore_amrnb"
3418 libopencore_amrnb_encoder_select="audio_frame_queue"
3419 libopencore_amrwb_decoder_deps="libopencore_amrwb"
3420 libopenh264_decoder_deps="libopenh264"
3421 libopenh264_decoder_select="h264_mp4toannexb_bsf"
3422 libopenh264_encoder_deps="libopenh264"
3423 libopenjpeg_encoder_deps="libopenjpeg"
3424 libopenmpt_demuxer_deps="libopenmpt"
3425 libopus_decoder_deps="libopus"
3426 libopus_encoder_deps="libopus"
3427 libopus_encoder_select="audio_frame_queue"
3428 librav1e_encoder_deps="librav1e"
3429 librsvg_decoder_deps="librsvg"
3430 libshine_encoder_deps="libshine"
3431 libshine_encoder_select="audio_frame_queue mpegaudioheader"
3432 libspeex_decoder_deps="libspeex"
3433 libspeex_encoder_deps="libspeex"
3434 libspeex_encoder_select="audio_frame_queue"
3435 libsvtav1_encoder_deps="libsvtav1"
3436 libtheora_encoder_deps="libtheora"
3437 libtwolame_encoder_deps="libtwolame"
3438 libuavs3d_decoder_deps="libuavs3d"
3439 libvo_amrwbenc_encoder_deps="libvo_amrwbenc"
3440 libvorbis_decoder_deps="libvorbis"
3441 libvorbis_encoder_deps="libvorbis libvorbisenc"
3442 libvorbis_encoder_select="audio_frame_queue"
3443 libvpx_vp8_decoder_deps="libvpx"
3444 libvpx_vp8_encoder_deps="libvpx"
3445 libvpx_vp9_decoder_deps="libvpx"
3446 libvpx_vp9_encoder_deps="libvpx"
3447 libwebp_encoder_deps="libwebp"
3448 libwebp_anim_encoder_deps="libwebp"
3449 libx262_encoder_deps="libx262"
3450 libx264_encoder_deps="libx264"
3451 libx264_encoder_select="atsc_a53"
3452 libx264rgb_encoder_deps="libx264"
3453 libx264rgb_encoder_select="libx264_encoder"
3454 libx265_encoder_deps="libx265"
3455 libx265_encoder_select="atsc_a53"
3456 libxavs_encoder_deps="libxavs"
3457 libxavs2_encoder_deps="libxavs2"
3458 libxvid_encoder_deps="libxvid"
3459 libzvbi_teletext_decoder_deps="libzvbi"
3460 vapoursynth_demuxer_deps="vapoursynth"
3461 videotoolbox_suggest="coreservices"
3462 videotoolbox_deps="corefoundation coremedia corevideo"
3463 videotoolbox_encoder_deps="videotoolbox VTCompressionSessionPrepareToEncodeFrames"
3466 ac3_demuxer_select="ac3_parser"
3467 act_demuxer_select="riffdec"
3468 adts_muxer_select="mpeg4audio"
3469 aiff_muxer_select="iso_media"
3470 amv_muxer_select="riffenc"
3471 asf_demuxer_select="riffdec"
3472 asf_o_demuxer_select="riffdec"
3473 asf_muxer_select="riffenc"
3474 asf_stream_muxer_select="asf_muxer"
3475 av1_demuxer_select="av1_frame_merge_bsf av1_parser"
3476 avi_demuxer_select="riffdec exif"
3477 avi_muxer_select="riffenc"
3478 avif_muxer_select="mov_muxer"
3479 caf_demuxer_select="iso_media"
3480 caf_muxer_select="iso_media"
3481 dash_muxer_select="mp4_muxer"
3482 dash_demuxer_deps="libxml2"
3483 dirac_demuxer_select="dirac_parser"
3484 dts_demuxer_select="dca_parser"
3485 dtshd_demuxer_select="dca_parser"
3486 dv_demuxer_select="dvprofile"
3487 dv_muxer_select="dvprofile"
3488 dxa_demuxer_select="riffdec"
3489 eac3_demuxer_select="ac3_parser"
3490 evc_demuxer_select="evc_frame_merge_bsf evc_parser"
3491 f4v_muxer_select="mov_muxer"
3492 fifo_muxer_deps="threads"
3493 flac_demuxer_select="flac_parser"
3494 flv_muxer_select="aac_adtstoasc_bsf"
3495 gxf_muxer_select="pcm_rechunk_bsf"
3496 hds_muxer_select="flv_muxer"
3497 hls_demuxer_select="adts_header ac3_parser mov_demuxer mpegts_demuxer"
3498 hls_muxer_select="mov_muxer mpegts_muxer"
3499 image2_alias_pix_demuxer_select="image2_demuxer"
3500 image2_brender_pix_demuxer_select="image2_demuxer"
3501 imf_demuxer_deps="libxml2"
3502 imf_demuxer_select="mxf_demuxer"
3503 ipod_muxer_select="mov_muxer"
3504 ismv_muxer_select="mov_muxer"
3505 ivf_muxer_select="av1_metadata_bsf vp9_superframe_bsf"
3506 latm_muxer_select="aac_adtstoasc_bsf mpeg4audio"
3507 matroska_audio_muxer_select="matroska_muxer"
3508 matroska_demuxer_select="riffdec"
3509 matroska_demuxer_suggest="bzlib zlib"
3510 matroska_muxer_select="mpeg4audio riffenc aac_adtstoasc_bsf pgs_frame_merge_bsf vp9_superframe_bsf"
3511 mlp_demuxer_select="mlp_parser"
3512 mmf_muxer_select="riffenc"
3513 mov_demuxer_select="iso_media riffdec"
3514 mov_demuxer_suggest="zlib"
3515 mov_muxer_select="iso_media riffenc rtpenc_chain vp9_superframe_bsf aac_adtstoasc_bsf ac3_parser"
3516 mp3_demuxer_select="mpegaudio_parser"
3517 mp3_muxer_select="mpegaudioheader"
3518 mp4_muxer_select="mov_muxer"
3519 mpegts_demuxer_select="iso_media"
3520 mpegts_muxer_select="ac3_parser adts_muxer latm_muxer h264_mp4toannexb_bsf hevc_mp4toannexb_bsf"
3521 mpegtsraw_demuxer_select="mpegts_demuxer"
3522 mxf_muxer_select="pcm_rechunk_bsf rangecoder"
3523 mxf_d10_muxer_select="mxf_muxer"
3524 mxf_opatom_muxer_select="mxf_muxer"
3525 nut_muxer_select="riffenc"
3526 nuv_demuxer_select="riffdec"
3527 obu_demuxer_select="av1_frame_merge_bsf av1_parser"
3528 obu_muxer_select="av1_metadata_bsf"
3529 oga_muxer_select="ogg_muxer"
3530 ogg_demuxer_select="dirac_parse"
3531 ogv_muxer_select="ogg_muxer"
3532 opus_muxer_select="ogg_muxer"
3533 psp_muxer_select="mov_muxer"
3534 rtp_demuxer_select="sdp_demuxer"
3535 rtp_mpegts_muxer_select="mpegts_muxer rtp_muxer"
3536 rtpdec_select="asf_demuxer mov_demuxer mpegts_demuxer rm_demuxer rtp_protocol srtp"
3537 rtsp_demuxer_select="http_protocol rtpdec"
3538 rtsp_muxer_select="rtp_muxer http_protocol rtp_protocol rtpenc_chain"
3539 sap_demuxer_select="sdp_demuxer"
3540 sap_muxer_select="rtp_muxer rtp_protocol rtpenc_chain"
3541 sdp_demuxer_select="rtpdec"
3542 smoothstreaming_muxer_select="ismv_muxer"
3543 spdif_demuxer_select="adts_header"
3544 spdif_muxer_select="adts_header"
3545 spx_muxer_select="ogg_muxer"
3546 swf_demuxer_suggest="zlib"
3547 tak_demuxer_select="tak_parser"
3548 truehd_demuxer_select="mlp_parser"
3549 tg2_muxer_select="mov_muxer"
3550 tgp_muxer_select="mov_muxer"
3551 vobsub_demuxer_select="mpegps_demuxer"
3552 w64_demuxer_select="wav_demuxer"
3553 w64_muxer_select="wav_muxer"
3554 wav_demuxer_select="riffdec"
3555 wav_muxer_select="riffenc"
3556 webm_chunk_muxer_select="webm_muxer"
3557 webm_dash_manifest_demuxer_select="matroska_demuxer"
3558 wtv_demuxer_select="mpegts_demuxer riffdec"
3559 wtv_muxer_select="mpegts_muxer riffenc"
3560 xmv_demuxer_select="riffdec"
3561 xwma_demuxer_select="riffdec"
3564 android_camera_indev_deps="android camera2ndk mediandk pthreads"
3565 alsa_indev_deps="alsa"
3566 alsa_outdev_deps="alsa"
3567 avfoundation_indev_deps="avfoundation corevideo coremedia pthreads"
3568 avfoundation_indev_suggest="coregraphics applicationservices"
3569 avfoundation_indev_extralibs="-framework Foundation"
3570 audiotoolbox_outdev_deps="audiotoolbox pthreads"
3571 audiotoolbox_outdev_extralibs="-framework AudioToolbox -framework CoreAudio"
3572 bktr_indev_deps_any="dev_bktr_ioctl_bt848_h machine_ioctl_bt848_h dev_video_bktr_ioctl_bt848_h dev_ic_bt8xx_h"
3573 caca_outdev_deps="libcaca"
3574 decklink_deps_any="libdl LoadLibrary"
3575 decklink_indev_deps="decklink threads"
3576 decklink_indev_extralibs="-lstdc++"
3577 decklink_indev_suggest="libzvbi"
3578 decklink_outdev_deps="decklink threads"
3579 decklink_outdev_suggest="libklvanc"
3580 decklink_outdev_extralibs="-lstdc++"
3581 dshow_indev_deps="IBaseFilter"
3582 dshow_indev_extralibs="-lpsapi -lole32 -lstrmiids -luuid -loleaut32 -lshlwapi"
3583 fbdev_indev_deps="linux_fb_h"
3584 fbdev_outdev_deps="linux_fb_h"
3585 gdigrab_indev_deps="CreateDIBSection"
3586 gdigrab_indev_extralibs="-lgdi32"
3587 gdigrab_indev_select="bmp_decoder"
3588 iec61883_indev_deps="libiec61883"
3589 iec61883_indev_select="dv_demuxer"
3590 jack_indev_deps="libjack"
3591 jack_indev_deps_any="sem_timedwait dispatch_dispatch_h"
3592 kmsgrab_indev_deps="libdrm"
3593 lavfi_indev_deps="avfilter"
3594 libcdio_indev_deps="libcdio"
3595 libdc1394_indev_deps="libdc1394"
3596 openal_indev_deps="openal"
3597 opengl_outdev_deps="opengl"
3598 opengl_outdev_suggest="sdl2"
3599 oss_indev_deps_any="sys_soundcard_h"
3600 oss_outdev_deps_any="sys_soundcard_h"
3601 pulse_indev_deps="libpulse"
3602 pulse_outdev_deps="libpulse"
3603 sdl2_outdev_deps="sdl2"
3604 sndio_indev_deps="sndio"
3605 sndio_outdev_deps="sndio"
3606 v4l2_indev_deps_any="linux_videodev2_h sys_videoio_h"
3607 v4l2_indev_suggest="libv4l2"
3608 v4l2_outdev_deps_any="linux_videodev2_h sys_videoio_h"
3609 v4l2_outdev_suggest="libv4l2"
3610 vfwcap_indev_deps="vfw32 vfwcap_defines"
3611 xcbgrab_indev_deps="libxcb"
3612 xcbgrab_indev_suggest="libxcb_shm libxcb_shape libxcb_xfixes"
3613 xv_outdev_deps="xlib_xv xlib_x11 xlib_xext"
3616 async_protocol_deps="threads"
3617 bluray_protocol_deps="libbluray"
3618 ffrtmpcrypt_protocol_conflict="librtmp_protocol"
3619 ffrtmpcrypt_protocol_deps_any="gcrypt gmp openssl mbedtls"
3620 ffrtmpcrypt_protocol_select="tcp_protocol"
3621 ffrtmphttp_protocol_conflict="librtmp_protocol"
3622 ffrtmphttp_protocol_select="http_protocol"
3623 ftp_protocol_select="tcp_protocol"
3624 gopher_protocol_select="tcp_protocol"
3625 gophers_protocol_select="tls_protocol"
3626 http_protocol_select="tcp_protocol"
3627 http_protocol_suggest="zlib"
3628 httpproxy_protocol_select="tcp_protocol"
3629 httpproxy_protocol_suggest="zlib"
3630 https_protocol_select="tls_protocol"
3631 https_protocol_suggest="zlib"
3632 icecast_protocol_select="http_protocol"
3633 mmsh_protocol_select="http_protocol"
3634 mmst_protocol_select="network"
3635 rtmp_protocol_conflict="librtmp_protocol"
3636 rtmp_protocol_select="tcp_protocol"
3637 rtmp_protocol_suggest="zlib"
3638 rtmpe_protocol_select="ffrtmpcrypt_protocol"
3639 rtmpe_protocol_suggest="zlib"
3640 rtmps_protocol_conflict="librtmp_protocol"
3641 rtmps_protocol_select="tls_protocol"
3642 rtmps_protocol_suggest="zlib"
3643 rtmpt_protocol_select="ffrtmphttp_protocol"
3644 rtmpt_protocol_suggest="zlib"
3645 rtmpte_protocol_select="ffrtmpcrypt_protocol ffrtmphttp_protocol"
3646 rtmpte_protocol_suggest="zlib"
3647 rtmpts_protocol_select="ffrtmphttp_protocol https_protocol"
3648 rtmpts_protocol_suggest="zlib"
3649 rtp_protocol_select="udp_protocol"
3650 schannel_conflict="openssl gnutls libtls mbedtls"
3651 sctp_protocol_deps="struct_sctp_event_subscribe struct_msghdr_msg_flags"
3652 sctp_protocol_select="network"
3653 securetransport_conflict="openssl gnutls libtls mbedtls"
3654 srtp_protocol_select="rtp_protocol srtp"
3655 tcp_protocol_select="network"
3656 tls_protocol_deps_any="gnutls openssl schannel securetransport libtls mbedtls"
3657 tls_protocol_select="tcp_protocol"
3658 udp_protocol_select="network"
3659 udplite_protocol_select="network"
3660 unix_protocol_deps="sys_un_h"
3661 unix_protocol_select="network"
3662 ipfs_gateway_protocol_select="https_protocol"
3663 ipns_gateway_protocol_select="https_protocol"
3665 # external library protocols
3666 libamqp_protocol_deps="librabbitmq"
3667 libamqp_protocol_select="network"
3668 librist_protocol_deps="librist"
3669 librist_protocol_select="network"
3670 librtmp_protocol_deps="librtmp"
3671 librtmpe_protocol_deps="librtmp"
3672 librtmps_protocol_deps="librtmp"
3673 librtmpt_protocol_deps="librtmp"
3674 librtmpte_protocol_deps="librtmp"
3675 libsmbclient_protocol_deps="libsmbclient gplv3"
3676 libsrt_protocol_deps="libsrt"
3677 libsrt_protocol_select="network"
3678 libssh_protocol_deps="libssh"
3679 libtls_conflict="openssl gnutls mbedtls"
3680 libzmq_protocol_deps="libzmq"
3681 libzmq_protocol_select="network"
3684 ametadata_filter_deps="avformat"
3685 amovie_filter_deps="avcodec avformat"
3686 aresample_filter_deps="swresample"
3687 asr_filter_deps="pocketsphinx"
3688 ass_filter_deps="libass"
3689 avgblur_opencl_filter_deps="opencl"
3690 avgblur_vulkan_filter_deps="vulkan spirv_compiler"
3691 azmq_filter_deps="libzmq"
3692 blackframe_filter_deps="gpl"
3693 blend_vulkan_filter_deps="vulkan spirv_compiler"
3694 boxblur_filter_deps="gpl"
3695 boxblur_opencl_filter_deps="opencl gpl"
3696 bs2b_filter_deps="libbs2b"
3697 bwdif_cuda_filter_deps="ffnvcodec"
3698 bwdif_cuda_filter_deps_any="cuda_nvcc cuda_llvm"
3699 bwdif_vulkan_filter_deps="vulkan spirv_compiler"
3700 chromaber_vulkan_filter_deps="vulkan spirv_compiler"
3701 color_vulkan_filter_deps="vulkan spirv_compiler"
3702 colorkey_opencl_filter_deps="opencl"
3703 colormatrix_filter_deps="gpl"
3704 convolution_opencl_filter_deps="opencl"
3705 coreimage_filter_deps="coreimage appkit"
3706 coreimage_filter_extralibs="-framework OpenGL"
3707 coreimagesrc_filter_deps="coreimage appkit"
3708 coreimagesrc_filter_extralibs="-framework OpenGL"
3709 cover_rect_filter_deps="avcodec avformat gpl"
3710 cropdetect_filter_deps="gpl"
3711 deinterlace_qsv_filter_deps="libmfx"
3712 deinterlace_qsv_filter_select="qsvvpp"
3713 deinterlace_vaapi_filter_deps="vaapi"
3714 delogo_filter_deps="gpl"
3715 denoise_vaapi_filter_deps="vaapi"
3716 derain_filter_select="dnn"
3717 deshake_filter_select="pixelutils"
3718 deshake_opencl_filter_deps="opencl"
3719 dilation_opencl_filter_deps="opencl"
3720 dnn_classify_filter_select="dnn"
3721 dnn_detect_filter_select="dnn"
3722 dnn_processing_filter_select="dnn"
3723 drawtext_filter_deps="libfreetype libharfbuzz"
3724 drawtext_filter_suggest="libfontconfig libfribidi"
3725 elbg_filter_deps="avcodec"
3726 eq_filter_deps="gpl"
3727 erosion_opencl_filter_deps="opencl"
3728 find_rect_filter_deps="avcodec avformat gpl"
3729 flip_vulkan_filter_deps="vulkan spirv_compiler"
3730 flite_filter_deps="libflite threads"
3731 framerate_filter_select="scene_sad"
3732 freezedetect_filter_select="scene_sad"
3733 frei0r_deps_any="libdl LoadLibrary"
3734 frei0r_filter_deps="frei0r"
3735 frei0r_src_filter_deps="frei0r"
3736 fspp_filter_deps="gpl"
3737 gblur_vulkan_filter_deps="vulkan spirv_compiler"
3738 hflip_vulkan_filter_deps="vulkan spirv_compiler"
3739 histeq_filter_deps="gpl"
3740 hqdn3d_filter_deps="gpl"
3741 iccdetect_filter_deps="lcms2"
3742 iccgen_filter_deps="lcms2"
3743 interlace_filter_deps="gpl"
3744 kerndeint_filter_deps="gpl"
3745 ladspa_filter_deps="ladspa libdl"
3746 lensfun_filter_deps="liblensfun version3"
3747 libplacebo_filter_deps="libplacebo vulkan"
3748 lv2_filter_deps="lv2"
3749 mcdeint_filter_deps="avcodec gpl"
3750 metadata_filter_deps="avformat"
3751 movie_filter_deps="avcodec avformat"
3752 mpdecimate_filter_deps="gpl"
3753 mpdecimate_filter_select="pixelutils"
3754 minterpolate_filter_select="scene_sad"
3755 mptestsrc_filter_deps="gpl"
3756 negate_filter_deps="lut_filter"
3757 nlmeans_opencl_filter_deps="opencl"
3758 nlmeans_vulkan_filter_deps="vulkan spirv_compiler"
3759 nnedi_filter_deps="gpl"
3760 ocr_filter_deps="libtesseract"
3761 ocv_filter_deps="libopencv"
3762 openclsrc_filter_deps="opencl"
3763 overlay_opencl_filter_deps="opencl"
3764 overlay_qsv_filter_deps="libmfx"
3765 overlay_qsv_filter_select="qsvvpp"
3766 overlay_vaapi_filter_deps="vaapi VAProcPipelineCaps_blend_flags"
3767 overlay_vulkan_filter_deps="vulkan spirv_compiler"
3768 owdenoise_filter_deps="gpl"
3769 pad_opencl_filter_deps="opencl"
3770 pan_filter_deps="swresample"
3771 perspective_filter_deps="gpl"
3772 phase_filter_deps="gpl"
3773 pp7_filter_deps="gpl"
3774 pp_filter_deps="gpl postproc"
3775 prewitt_opencl_filter_deps="opencl"
3776 procamp_vaapi_filter_deps="vaapi"
3777 program_opencl_filter_deps="opencl"
3778 pullup_filter_deps="gpl"
3779 remap_opencl_filter_deps="opencl"
3780 removelogo_filter_deps="avcodec avformat swscale"
3781 repeatfields_filter_deps="gpl"
3782 roberts_opencl_filter_deps="opencl"
3783 rubberband_filter_deps="librubberband"
3784 sab_filter_deps="gpl swscale"
3785 scale2ref_filter_deps="swscale"
3786 scale_filter_deps="swscale"
3787 scale_qsv_filter_deps="libmfx"
3788 scale_qsv_filter_select="qsvvpp"
3789 scdet_filter_select="scene_sad"
3790 select_filter_select="scene_sad"
3791 sharpness_vaapi_filter_deps="vaapi"
3792 showcqt_filter_deps="avformat swscale"
3793 showcqt_filter_suggest="libfontconfig libfreetype"
3794 signature_filter_deps="gpl avcodec avformat"
3795 smartblur_filter_deps="gpl swscale"
3796 sobel_opencl_filter_deps="opencl"
3797 sofalizer_filter_deps="libmysofa"
3798 spp_filter_deps="gpl avcodec"
3799 spp_filter_select="idctdsp fdctdsp me_cmp pixblockdsp"
3800 sr_filter_deps="avformat swscale"
3801 sr_filter_select="dnn"
3802 stereo3d_filter_deps="gpl"
3803 subtitles_filter_deps="avformat avcodec libass"
3804 super2xsai_filter_deps="gpl"
3805 pixfmts_super2xsai_test_deps="super2xsai_filter"
3806 tinterlace_filter_deps="gpl"
3807 tinterlace_merge_test_deps="tinterlace_filter"
3808 tinterlace_pad_test_deps="tinterlace_filter"
3809 tonemap_filter_deps="const_nan"
3810 tonemap_vaapi_filter_deps="vaapi VAProcFilterParameterBufferHDRToneMapping"
3811 tonemap_opencl_filter_deps="opencl const_nan"
3812 transpose_opencl_filter_deps="opencl"
3813 transpose_vaapi_filter_deps="vaapi VAProcPipelineCaps_rotation_flags"
3814 transpose_vt_filter_deps="videotoolbox VTPixelRotationSessionCreate"
3815 transpose_vulkan_filter_deps="vulkan spirv_compiler"
3816 unsharp_opencl_filter_deps="opencl"
3817 uspp_filter_deps="gpl avcodec"
3818 vaguedenoiser_filter_deps="gpl"
3819 vflip_vulkan_filter_deps="vulkan spirv_compiler"
3820 vidstabdetect_filter_deps="libvidstab"
3821 vidstabtransform_filter_deps="libvidstab"
3822 libvmaf_filter_deps="libvmaf"
3823 libvmaf_cuda_filter_deps="libvmaf libvmaf_cuda ffnvcodec"
3824 zmq_filter_deps="libzmq"
3825 zoompan_filter_deps="swscale"
3826 zscale_filter_deps="libzimg const_nan"
3827 scale_vaapi_filter_deps="vaapi"
3828 scale_vt_filter_deps="videotoolbox"
3829 scale_vulkan_filter_deps="vulkan spirv_compiler"
3830 vpp_qsv_filter_deps="libmfx"
3831 vpp_qsv_filter_select="qsvvpp"
3832 xfade_opencl_filter_deps="opencl"
3833 xfade_vulkan_filter_deps="vulkan spirv_compiler"
3834 yadif_cuda_filter_deps="ffnvcodec"
3835 yadif_cuda_filter_deps_any="cuda_nvcc cuda_llvm"
3836 yadif_videotoolbox_filter_deps="metal corevideo videotoolbox"
3837 hstack_vaapi_filter_deps="vaapi_1"
3838 vstack_vaapi_filter_deps="vaapi_1"
3839 xstack_vaapi_filter_deps="vaapi_1"
3840 hstack_qsv_filter_deps="libmfx"
3841 hstack_qsv_filter_select="qsvvpp"
3842 vstack_qsv_filter_deps="libmfx"
3843 vstack_qsv_filter_select="qsvvpp"
3844 xstack_qsv_filter_deps="libmfx"
3845 xstack_qsv_filter_select="qsvvpp"
3848 avio_http_serve_files_deps="avformat avutil fork"
3849 avio_list_dir_deps="avformat avutil"
3850 avio_read_callback_deps="avformat avcodec avutil"
3851 decode_audio_example_deps="avcodec avutil"
3852 decode_filter_audio_example_deps="avfilter avcodec avformat avutil"
3853 decode_filter_video_example_deps="avfilter avcodec avformat avutil"
3854 decode_video_example_deps="avcodec avutil"
3855 demux_decode_example_deps="avcodec avformat avutil"
3856 encode_audio_example_deps="avcodec avutil"
3857 encode_video_example_deps="avcodec avutil"
3858 extract_mvs_example_deps="avcodec avformat avutil"
3859 filter_audio_example_deps="avfilter avutil"
3860 hw_decode_example_deps="avcodec avformat avutil"
3861 mux_example_deps="avcodec avformat avutil swscale"
3862 qsv_decode_example_deps="avcodec avutil libmfx h264_qsv_decoder"
3863 remux_example_deps="avcodec avformat avutil"
3864 resample_audio_example_deps="avutil swresample"
3865 scale_video_example_deps="avutil swscale"
3866 show_metadata_example_deps="avformat avutil"
3867 transcode_aac_example_deps="avcodec avformat swresample"
3868 transcode_example_deps="avfilter avcodec avformat avutil"
3869 vaapi_encode_example_deps="avcodec avutil h264_vaapi_encoder"
3870 vaapi_transcode_example_deps="avcodec avformat avutil h264_vaapi_encoder"
3871 qsv_transcode_example_deps="avcodec avformat avutil h264_qsv_encoder"
3874 cpu_init_extralibs="pthreads_extralibs"
3875 cws2fws_extralibs="zlib_extralibs"
3877 # libraries, in any order
3878 avcodec_deps="avutil"
3879 avcodec_suggest="libm stdatomic"
3880 avdevice_deps="avformat avcodec avutil"
3881 avdevice_suggest="libm stdatomic"
3882 avfilter_deps="avutil"
3883 avfilter_suggest="libm stdatomic"
3884 avformat_deps="avcodec avutil"
3885 avformat_suggest="libm network zlib stdatomic"
3886 avutil_suggest="clock_gettime ffnvcodec gcrypt libm libdrm libmfx opencl openssl user32 vaapi vulkan videotoolbox corefoundation corevideo coremedia bcrypt stdatomic"
3887 postproc_deps="avutil gpl"
3888 postproc_suggest="libm stdatomic"
3889 swresample_deps="avutil"
3890 swresample_suggest="libm libsoxr stdatomic"
3891 swscale_deps="avutil"
3892 swscale_suggest="libm stdatomic"
3894 avcodec_extralibs="pthreads_extralibs iconv_extralibs dxva2_extralibs lcms2_extralibs"
3895 avfilter_extralibs="pthreads_extralibs"
3896 avutil_extralibs="d3d11va_extralibs mediacodec_extralibs nanosleep_extralibs pthreads_extralibs vaapi_drm_extralibs vaapi_x11_extralibs vaapi_win32_extralibs vdpau_x11_extralibs"
3899 ffmpeg_deps="avcodec avfilter avformat threads"
3900 ffmpeg_select="aformat_filter anull_filter atrim_filter format_filter
3901 hflip_filter null_filter
3902 transpose_filter trim_filter vflip_filter"
3903 ffmpeg_suggest="ole32 psapi shell32"
3904 ffplay_deps="avcodec avformat avfilter swscale swresample sdl2"
3905 ffplay_select="crop_filter transpose_filter hflip_filter vflip_filter rotate_filter"
3906 ffplay_suggest="shell32"
3907 ffprobe_deps="avcodec avformat"
3908 ffprobe_suggest="shell32"
3911 podpages_deps="perl"
3912 manpages_deps="perl pod2man"
3913 htmlpages_deps="perl"
3914 htmlpages_deps_any="makeinfo_html texi2html"
3915 txtpages_deps="perl makeinfo"
3916 doc_deps_any="manpages htmlpages podpages txtpages"
3918 # default parameters
3920 logfile="ffbuild/config.log"
3922 # installation paths
3923 prefix_default="/usr/local"
3924 bindir_default='${prefix}/bin'
3925 datadir_default='${prefix}/share/ffmpeg'
3926 docdir_default='${prefix}/share/doc/ffmpeg'
3927 incdir_default='${prefix}/include'
3928 libdir_default='${prefix}/lib'
3929 mandir_default='${prefix}/share/man'
3935 host_cc_default="gcc"
3936 doxygen_default="doxygen"
3938 ln_s_default="ln -s -f"
3939 metalcc_default="xcrun -sdk macosx metal"
3940 metallib_default="xcrun -sdk macosx metallib"
3942 pkg_config_default=pkg-config
3943 ranlib_default="ranlib"
3944 strip_default="strip"
3945 version_script='--version-script'
3947 x86asmexe_default="nasm"
3948 windres_default="windres"
3952 target_os_default=$(tolower $(uname -s))
3953 host_os=$target_os_default
3956 if test "$target_os_default" = aix; then
3957 arch_default=$(uname -p)
3958 strip_default="strip -X32_64"
3959 nm_default="nm -g -X32_64"
3961 arch_default=$(uname -m)
3966 # configurable options
3967 enable $PROGRAM_LIST
3968 enable $DOCUMENT_LIST
3969 enable $EXAMPLE_LIST
3970 enable $LIBRARY_LIST
3976 enable faan faandct faanidct
3978 enable optimizations
3979 enable ptx_compression
3980 enable runtime_cpudetect
3981 enable safe_bitstream_reader
3983 enable swscale_alpha
3984 enable valgrind_backtrace
3986 sws_max_filter_size_default=256
3987 set_default sws_max_filter_size
3989 # internal components are enabled by default
3990 enable $EXTRALIBS_LIST
3992 # Avoid external, non-system, libraries getting enabled by dependency resolution
3993 disable $EXTERNAL_LIBRARY_LIST $HWACCEL_LIBRARY_LIST
3996 SHFLAGS='-shared -Wl,-soname,$$(@F)'
3999 FULLNAME='$(NAME)$(BUILDSUF)'
4000 LIBNAME='$(LIBPREF)$(FULLNAME)$(LIBSUF)'
4003 SLIBNAME='$(SLIBPREF)$(FULLNAME)$(SLIBSUF)'
4004 SLIBNAME_WITH_VERSION='$(SLIBNAME).$(LIBVERSION)'
4005 SLIBNAME_WITH_MAJOR='$(SLIBNAME).$(LIBMAJOR)'
4006 LIB_INSTALL_EXTRA_CMD='$$(RANLIB) "$(LIBDIR)/$(LIBNAME)"'
4007 SLIB_INSTALL_NAME='$(SLIBNAME_WITH_VERSION)'
4008 SLIB_INSTALL_LINKS='$(SLIBNAME_WITH_MAJOR) $(SLIBNAME)'
4009 VERSION_SCRIPT_POSTPROCESS_CMD="cat"
4036 host_extralibs='-lm'
4037 host_cflags_filter=echo
4038 host_ldflags_filter=echo
4040 target_path='$(CURDIR)'
4042 # since the object filename is not given with the -MM flag, the compiler
4043 # is only able to print the basename, and we must add the path ourselves
4044 DEPCMD='$(DEP$(1)) $(DEP$(1)FLAGS) $($(1)DEP_FLAGS) $< 2>/dev/null | sed -e "/^\#.*/d" -e "s,^[[:space:]]*$(@F),$(@D)/$(@F)," > $(@:.o=.d)'
4050 if test -f configure; then
4052 elif test -f src/configure; then
4055 source_path=$(cd $(dirname "$0"); pwd)
4056 case "$source_path" in
4057 *[[:blank:]]*) die "Out of tree builds are impossible with whitespace in source path." ;;
4059 test -e "$source_path/config.h" &&
4060 die "Out of tree builds are impossible with config.h in source dir."
4067 FFMPEG_CONFIGURATION="${FFMPEG_CONFIGURATION# } ${l}${r}"
4070 find_things_extern(){
4073 file=$source_path/$3
4075 sed -n "s/^[^#]*extern.*$pattern *ff_\([^ ]*\)_$thing;/\1_$out/p" "$file"
4078 find_filters_extern(){
4079 file=$source_path/$1
4080 sed -n 's/^extern const AVFilter ff_[avfsinkrc]\{2,5\}_\([[:alnum:]_]\{1,\}\);/\1_filter/p' $file
4083 FILTER_LIST=$(find_filters_extern libavfilter/allfilters.c)
4084 OUTDEV_LIST=$(find_things_extern muxer FFOutputFormat libavdevice/alldevices.c outdev)
4085 INDEV_LIST=$(find_things_extern demuxer AVInputFormat libavdevice/alldevices.c indev)
4086 MUXER_LIST=$(find_things_extern muxer FFOutputFormat libavformat/allformats.c)
4087 DEMUXER_LIST=$(find_things_extern demuxer AVInputFormat libavformat/allformats.c)
4088 ENCODER_LIST=$(find_things_extern encoder FFCodec libavcodec/allcodecs.c)
4089 DECODER_LIST=$(find_things_extern decoder FFCodec libavcodec/allcodecs.c)
4094 PARSER_LIST=$(find_things_extern parser AVCodecParser libavcodec/parsers.c)
4095 BSF_LIST=$(find_things_extern bsf FFBitStreamFilter libavcodec/bitstream_filters.c)
4096 HWACCEL_LIST=$(find_things_extern hwaccel FFHWAccel libavcodec/hwaccels.h)
4097 PROTOCOL_LIST=$(find_things_extern protocol URLProtocol libavformat/protocols.c)
4099 AVCODEC_COMPONENTS_LIST="
4107 AVDEVICE_COMPONENTS_LIST="
4112 AVFILTER_COMPONENTS_LIST="
4116 AVFORMAT_COMPONENTS_LIST="
4123 $AVCODEC_COMPONENTS_LIST
4124 $AVDEVICE_COMPONENTS_LIST
4125 $AVFILTER_COMPONENTS_LIST
4126 $AVFORMAT_COMPONENTS_LIST
4129 for n in $COMPONENT_LIST; do
4130 v=$(toupper ${n%s})_LIST
4132 eval ${n}_if_any="\$$v"
4135 enable $ARCH_EXT_LIST
4138 echo "Unknown option \"$1\"."
4139 echo "See $0 --help for available options."
4143 print_in_columns() {
4144 tr ' ' '\n' | sort | tr '\r\n' ' ' | awk -v col_width=24 -v width="$ncols" '
4146 num_cols = width > col_width ? int(width / col_width) : 1;
4147 num_rows = int((NF + num_cols-1) / num_cols);
4149 for (y = 1; y <= num_rows; y++) {
4151 for (x = 1; x <= num_cols; x++) {
4153 line = sprintf("%s%-" col_width "s", line, $i);
4157 print line; line = "";
4165 echo $* | sed s/$suffix//g | print_in_columns
4177 is_in ${comp} $COMPONENT_LIST && eval comp=\$$(toupper ${comp%s})_LIST
4178 echo "prob ${prob:-0.5}"
4186 random_seed=$(awk "BEGIN { srand($random_seed); print srand() }")
4187 $action $(rand_list "$@" | awk "BEGIN { srand($random_seed) } \$1 == \"prob\" { prob = \$2; next } rand() < prob { print }")
4196 --extra-ldexeflags=*)
4197 add_ldexeflags $optval
4199 --extra-ldsoflags=*)
4200 add_ldsoflags $optval
4202 --extra-ldlibflags=*)
4203 warn "The --extra-ldlibflags option is only provided for compatibility and will be\n"\
4204 "removed in the future. Use --extra-ldsoflags instead."
4205 add_ldsoflags $optval
4208 add_extralibs $optval
4211 disable $INDEV_LIST $OUTDEV_LIST
4214 debuglevel="$optval"
4217 disable $PROGRAM_LIST
4219 --disable-everything)
4220 map 'eval unset \${$(toupper ${v%s})_LIST}' $COMPONENT_LIST
4223 map 'eval unset \${$(toupper ${v%s})_LIST}' $COMPONENT_LIST
4224 disable $LIBRARY_LIST $PROGRAM_LIST doc
4227 --enable-random|--disable-random)
4228 action=${opt%%-random}
4229 do_random ${action#--} $COMPONENT_LIST
4231 --enable-random=*|--disable-random=*)
4232 action=${opt%%-random=*}
4233 do_random ${action#--} $optval
4239 lto=-f${opt#--enable-}
4241 --enable-*=*|--disable-*=*)
4242 eval $(echo "${opt%%=*}" | sed 's/--/action=/;s/-/ thing=/')
4243 is_in "${thing}s" $COMPONENT_LIST || die_unknown "$opt"
4244 eval list=\$$(toupper $thing)_LIST
4245 name=$(echo "${optval}" | sed "s/,/_${thing}|/g")_${thing}
4246 list=$(filter "$name" $list)
4247 [ "$list" = "" ] && warn "Option $opt did not match anything"
4248 test $action = enable && warn_if_gets_disabled $list
4251 --enable-yasm|--disable-yasm)
4252 warn "The ${opt} option is only provided for compatibility and will be\n"\
4253 "removed in the future. Use --enable-x86asm / --disable-x86asm instead."
4254 test $opt = --enable-yasm && x86asm=yes || x86asm=no
4257 warn "The --yasmexe option is only provided for compatibility and will be\n"\
4258 "removed in the future. Use --x86asmexe instead."
4261 --enable-?*|--disable-?*)
4262 eval $(echo "$opt" | sed 's/--/action=/;s/-/ option=/;s/-/_/g')
4263 if is_in $option $COMPONENT_LIST; then
4264 test $action = disable && action=unset
4265 eval $action \$$(toupper ${option%s})_LIST
4266 elif is_in $option $CMDLINE_SELECT; then
4273 NAME="${opt#--list-}"
4274 is_in $NAME $COMPONENT_LIST || die_unknown $opt
4276 eval show_list $NAME \$$(toupper $NAME)_LIST
4278 --help|-h) show_help
4280 --quiet|-q) quiet=yes
4282 --fatal-warnings) enable fatal_warnings
4285 libfuzzer_path="$optval"
4288 optname="${opt%%=*}"
4289 optname="${optname#--}"
4290 optname=$(echo "$optname" | sed 's/-/_/g')
4291 if is_in $optname $CMDLINE_SET; then
4292 eval $optname='$optval'
4293 elif is_in $optname $CMDLINE_APPEND; then
4294 append $optname "$optval"
4306 if disabled autodetect; then
4308 # Unless iconv is explicitely disabled by the user, we still want to probe
4309 # for the iconv from the libc.
4310 disabled iconv || enable libc_iconv
4312 disable_weak $EXTERNAL_AUTODETECT_LIBRARY_LIST
4313 disable_weak $HWACCEL_AUTODETECT_LIBRARY_LIST
4315 # Mark specifically enabled, but normally autodetected libraries as requested.
4316 for lib in $AUTODETECT_LIBS; do
4317 enabled $lib && request $lib
4319 #TODO: switch to $AUTODETECT_LIBS when $THREADS_LIST is supported the same way
4320 enable_weak $EXTERNAL_AUTODETECT_LIBRARY_LIST
4321 enable_weak $HWACCEL_AUTODETECT_LIBRARY_LIST
4323 disabled logging && logfile=/dev/null
4325 # command line configuration sanity checks
4327 # we need to build at least one lib type
4328 if ! enabled_any static shared; then
4330 At least one library type must be built.
4331 Specify --enable-static to build the static libraries or --enable-shared to
4332 build the shared libraries as well. To only build the shared libraries specify
4333 --disable-static in addition to --enable-shared.
4338 die_license_disabled() {
4339 enabled $1 || { enabled $v && die "$v is $1 and --enable-$1 is not specified."; }
4342 die_license_disabled_gpl() {
4343 enabled $1 || { enabled $v && die "$v is incompatible with the gpl and --enable-$1 is not specified."; }
4346 map "die_license_disabled gpl" $EXTERNAL_LIBRARY_GPL_LIST $EXTERNAL_LIBRARY_GPLV3_LIST
4347 map "die_license_disabled version3" $EXTERNAL_LIBRARY_VERSION3_LIST $EXTERNAL_LIBRARY_GPLV3_LIST
4349 enabled gpl && map "die_license_disabled_gpl nonfree" $EXTERNAL_LIBRARY_NONFREE_LIST
4350 map "die_license_disabled nonfree" $HWACCEL_LIBRARY_NONFREE_LIST
4352 enabled version3 && { enabled gpl && enable gplv3 || enable lgplv3; }
4354 if enabled nonfree; then
4355 license="nonfree and unredistributable"
4356 elif enabled gplv3; then
4357 license="GPL version 3 or later"
4358 elif enabled lgplv3; then
4359 license="LGPL version 3 or later"
4360 elif enabled gpl; then
4361 license="GPL version 2 or later"
4363 license="LGPL version 2.1 or later"
4366 enabled_all gnutls openssl &&
4367 die "GnuTLS and OpenSSL must not be enabled at the same time."
4369 enabled_all gnutls mbedtls &&
4370 die "GnuTLS and mbedTLS must not be enabled at the same time."
4372 enabled_all openssl mbedtls &&
4373 die "OpenSSL and mbedTLS must not be enabled at the same time."
4375 # Disable all the library-specific components if the library itself
4376 # is disabled, see AVCODEC_LIST and following _LIST variables.
4378 disable_components(){
4379 disabled ${1} && disable $(
4380 eval components="\$$(toupper ${1})_COMPONENTS"
4381 map 'eval echo \${$(toupper ${v%s})_LIST}' $components
4385 map 'disable_components $v' $LIBRARY_LIST
4387 echo "# $0 $FFMPEG_CONFIGURATION" > $logfile
4390 test -n "$valgrind" && toolchain="valgrind-memcheck"
4392 enabled ossfuzz && ! echo $CFLAGS | grep -q -- "-fsanitize=" && ! echo $CFLAGS | grep -q -- "-fcoverage-mapping" &&{
4393 add_cflags -fsanitize=address,undefined -fsanitize-coverage=trace-pc-guard,trace-cmp -fno-omit-frame-pointer
4394 add_ldflags -fsanitize=address,undefined -fsanitize-coverage=trace-pc-guard,trace-cmp
4397 case "$toolchain" in
4399 cc_default="${toolchain%-asan}"
4400 add_cflags -fsanitize=address
4401 add_ldflags -fsanitize=address
4404 cc_default="${toolchain%-lsan}"
4405 add_cflags -fsanitize=leak
4406 add_ldflags -fsanitize=leak
4409 cc_default="${toolchain%-msan}"
4410 add_cflags -fsanitize=memory -fsanitize-memory-track-origins
4411 add_ldflags -fsanitize=memory
4414 cc_default="${toolchain%-tsan}"
4415 add_cflags -fsanitize=thread
4416 add_ldflags -fsanitize=thread
4417 case "$toolchain" in
4425 cc_default="${toolchain%-usan}"
4426 add_cflags -fsanitize=undefined
4427 add_ldflags -fsanitize=undefined
4430 target_exec_default="valgrind"
4431 case "$toolchain" in
4433 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"
4436 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"
4441 cl_major_ver=$(cl.exe 2>&1 | sed -n 's/.*Version \([[:digit:]]\{1,\}\)\..*/\1/p')
4442 if [ -z "$cl_major_ver" ] || [ $cl_major_ver -ge 18 ]; then
4444 cxx_default="cl.exe"
4446 die "Unsupported MSVC version (2013 or newer required)"
4448 ld_default="$source_path/compat/windows/mslink"
4449 windres_default="$source_path/compat/windows/mswindres"
4450 nm_default="dumpbin.exe -symbols"
4451 ar_default="lib.exe"
4452 case "${arch:-$arch_default}" in
4454 as_default="armasm64.exe"
4457 as_default="armasm.exe"
4460 target_os_default="win32"
4461 # Use a relative path for TMPDIR. This makes sure all the
4462 # ffconf temp files are written with a relative path, avoiding
4463 # issues with msys/win32 path conversion for MSVC parameters
4464 # such as -Fo<file> or -out:<file>.
4470 nm_default="dumpbin -symbols"
4472 target_os_default="win32"
4476 add_cflags -fprofile-arcs -ftest-coverage
4477 add_ldflags -fprofile-arcs -ftest-coverage
4480 add_cflags -fprofile-arcs -ftest-coverage
4481 add_ldflags --coverage
4484 add_cppflags -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2
4485 add_cflags -fno-strict-overflow -fstack-protector-all
4486 add_ldflags -Wl,-z,relro -Wl,-z,now
4488 add_ldexeflags -fPIE -pie
4491 die "Unknown toolchain $toolchain"
4495 if test -n "$cross_prefix"; then
4496 test -n "$arch" && test -n "$target_os" ||
4497 die "Must specify target arch (--arch) and OS (--target-os) when cross-compiling"
4498 enable cross_compile
4501 set_default target_os
4502 if test "$target_os" = android; then
4506 ar_default="${cross_prefix}${ar_default}"
4507 cc_default="${cross_prefix}${cc_default}"
4508 cxx_default="${cross_prefix}${cxx_default}"
4509 nm_default="${cross_prefix}${nm_default}"
4510 pkg_config_default="${cross_prefix}${pkg_config_default}"
4511 ranlib_default="${cross_prefix}${ranlib_default}"
4512 strip_default="${cross_prefix}${strip_default}"
4513 windres_default="${cross_prefix}${windres_default}"
4515 sysinclude_default="${sysroot}/usr/include"
4517 if enabled cuda_sdk; then
4518 warn "Option --enable-cuda-sdk is deprecated. Use --enable-cuda-nvcc instead."
4522 if enabled cuda_nvcc; then
4524 nvccflags_default="-gencode arch=compute_30,code=sm_30 -O2"
4526 nvcc_default="clang"
4527 nvccflags_default="--cuda-gpu-arch=sm_30 -O2"
4533 if enabled cuda_nvcc; then
4534 if $nvcc $nvccflags_default 2>&1 | grep -qi unsupported; then
4535 nvccflags_default="-gencode arch=compute_60,code=sm_60 -O2"
4539 set_default arch cc cxx doxygen pkg_config ranlib strip sysinclude \
4540 target_exec x86asmexe metalcc metallib
4541 enabled cross_compile || host_cc_default=$cc
4544 if ${ranlib} 2>&1 | grep -q "\-D "; then
4545 ranlib="${ranlib} -D"
4548 pkg_config_fail_message=""
4549 if ! $pkg_config --version >/dev/null 2>&1; then
4550 warn "$pkg_config not found, library detection may fail."
4552 elif is_in -static $cc $LDFLAGS && ! is_in --static $pkg_config $pkg_config_flags; then
4553 pkg_config_fail_message="
4554 Note: When building a static binary, add --pkg-config-flags=\"--static\"."
4557 if test $doxygen != $doxygen_default && \
4558 ! $doxygen --version >/dev/null 2>&1; then
4559 warn "Specified doxygen \"$doxygen\" not found, API documentation will fail to build."
4564 mingw32*|mingw64*|msys*|win32|win64|cygwin*|*-dos|freedos|opendos|os/2*|symbian) echo .exe ;;
4568 EXESUF=$(exesuf $target_os)
4569 HOSTEXESUF=$(exesuf $host_os)
4571 # set temporary file name
4572 : ${TMPDIR:=$TEMPDIR}
4576 if [ -n "$tempprefix" ] ; then
4578 tmpname="$tempprefix.${HOSTNAME}.${UID}"
4582 elif ! test_cmd mktemp -u XXXXXX; then
4583 # simple replacement for missing mktemp
4584 # NOT SAFE FOR GENERAL USE
4586 tmpname="${2%%XXX*}.${HOSTNAME}.${UID}.$$"
4592 FFTMPDIR=$(mktemp -d "${TMPDIR}/ffconf.XXXXXXXX" 2> /dev/null) ||
4593 die "Unable to create temporary directory in $TMPDIR."
4596 tmp="${FFTMPDIR}/test"$2
4597 (set -C; exec > $tmp) 2> /dev/null ||
4598 die "Unable to create temporary file in $FFTMPDIR."
4602 trap 'rm -rf -- "$FFTMPDIR"' EXIT
4608 tmpfile TMPE $EXESUF
4621 # make sure we can execute files in $TMPDIR
4622 cat > $TMPSH 2>> $logfile <<EOF
4625 chmod +x $TMPSH >> $logfile 2>&1
4626 if ! $TMPSH >> $logfile 2>&1; then
4628 Unable to create and execute files in $TMPDIR. Set the TMPDIR environment
4629 variable to another directory and make sure that it is not mounted noexec.
4631 die "Sanity test failed."
4637 # Filter out MSVC cl.exe options from cflags that shouldn't
4638 # be passed to gas-preprocessor
4648 -Wno-switch) echo -Wno-switch-enum ;;
4649 -Wno-format-zero-length) ;;
4650 -Wdisabled-optimization) ;;
4651 -Wno-pointer-sign) echo -Wno-other ;;
4657 msvc_common_flags(){
4660 # In addition to specifying certain flags under the compiler
4661 # specific filters, they must be specified here as well or else the
4662 # generic catch all at the bottom will print the original flag.
4667 -fomit-frame-pointer) ;;
4671 -fno-signed-zeros) ;;
4675 -lz) echo zlib.lib ;;
4676 -lx264) echo libx264.lib ;;
4678 -l*) echo ${flag#-l}.lib ;;
4679 -LARGEADDRESSAWARE) echo $flag ;;
4680 -L*) echo -libpath:${flag#-L} ;;
4688 msvc_common_flags "$@"
4691 -Wall) echo -W3 -wd4018 -wd4146 -wd4244 -wd4305 \
4693 -Wextra) echo -W4 -wd4244 -wd4127 -wd4018 -wd4389 \
4694 -wd4146 -wd4057 -wd4204 -wd4706 -wd4305 \
4695 -wd4152 -wd4324 -we4013 -wd4100 -wd4214 \
4697 -wd4273 -wd4554 -wd4701 -wd4703 ;;
4703 msvc_common_flags "$@"
4706 # Despite what Intel's documentation says -Wall, which is supported
4707 # on Windows, does enable remarks so disable them here.
4708 -Wall) echo $flag -Qdiag-disable:remark ;;
4709 -std=c99) echo -Qstd=c99 ;;
4710 -flto*) echo -ipo ;;
4718 -flto*) echo -ipo ;;
4728 case "${flag#*=}" in
4729 native) echo -xtarget=native ;;
4730 v9|niagara) echo -xarch=sparc ;;
4731 ultrasparc) echo -xarch=sparcvis ;;
4732 ultrasparc3|niagara2) echo -xarch=sparcvis2 ;;
4733 i586|pentium) echo -xchip=pentium ;;
4734 i686|pentiumpro|pentium2) echo -xtarget=pentium_pro ;;
4735 pentium3*|c3-2) echo -xtarget=pentium3 ;;
4736 pentium-m) echo -xarch=sse2 -xchip=pentium3 ;;
4737 pentium4*) echo -xtarget=pentium4 ;;
4738 prescott|nocona) echo -xarch=sse3 -xchip=pentium4 ;;
4739 *-sse3) echo -xarch=sse3 ;;
4740 core2) echo -xarch=ssse3 -xchip=core2 ;;
4741 bonnell) echo -xarch=ssse3 ;;
4742 corei7|nehalem) echo -xtarget=nehalem ;;
4743 westmere) echo -xtarget=westmere ;;
4744 silvermont) echo -xarch=sse4_2 ;;
4745 corei7-avx|sandybridge) echo -xtarget=sandybridge ;;
4746 core-avx*|ivybridge|haswell|broadwell|skylake*|knl)
4748 amdfam10|barcelona) echo -xtarget=barcelona ;;
4749 btver1) echo -xarch=amdsse4a ;;
4750 btver2|bdver*|znver*) echo -xarch=avx ;;
4751 athlon-4|athlon-[mx]p) echo -xarch=ssea ;;
4752 k8|opteron|athlon64|athlon-fx)
4753 echo -xarch=sse2a ;;
4754 athlon*) echo -xarch=pentium_proa ;;
4757 -std=c99) echo -xc99 ;;
4758 -fomit-frame-pointer) echo -xregs=frameptr ;;
4759 -fPIC) echo -KPIC -xcode=pic32 ;;
4760 -W*,*) echo $flag ;;
4761 -f*-*|-W*|-mimpure-text) ;;
4773 unset _type _ident _cc_c _cc_e _cc_o _flags _cflags
4774 unset _ld_o _ldflags _ld_lib _ld_path
4775 unset _depflags _DEPCMD _DEPFLAGS
4778 if $_cc --version 2>&1 | grep -q '^GNU assembler'; then
4779 true # no-op to avoid reading stdin in following checks
4780 elif $_cc -v 2>&1 | grep -q '^gcc.*LLVM'; then
4782 gcc_extra_ver=$(expr "$($_cc --version 2>/dev/null | head -n1)" : '.*\((.*)\)')
4783 _ident="llvm-gcc $($_cc -dumpversion 2>/dev/null) $gcc_extra_ver"
4784 _depflags='-MMD -MF $(@:.o=.d) -MT $@'
4787 elif $_cc -v 2>&1 | grep -qi ^gcc; then
4789 gcc_version=$($_cc --version | head -n1)
4790 gcc_basever=$($_cc -dumpversion)
4791 gcc_pkg_ver=$(expr "$gcc_version" : '[^ ]* \(([^)]*)\)')
4792 gcc_ext_ver=$(expr "$gcc_version" : ".*$gcc_pkg_ver $gcc_basever \\(.*\\)")
4793 _ident=$(cleanws "gcc $gcc_basever $gcc_pkg_ver $gcc_ext_ver")
4794 case $gcc_basever in
4797 *) _depflags='-MMD -MF $(@:.o=.d) -MT $@' ;;
4799 if [ "$first" = true ]; then
4800 case $gcc_basever in
4802 warn "gcc 4.2 is outdated and may miscompile FFmpeg. Please use a newer compiler." ;;
4807 elif $_cc --version 2>/dev/null | grep -q ^icc; then
4809 _ident=$($_cc --version | head -n1)
4814 _flags_filter=icc_flags
4815 elif $_cc -v 2>&1 | grep -q xlc; then
4817 _ident=$($_cc -qversion 2>/dev/null | head -n1)
4819 _cflags_size='-O5 -qcompact'
4820 elif $_cc --vsn 2>/dev/null | grep -Eq "ARM (C/C\+\+ )?Compiler"; then
4821 test -d "$sysroot" || die "No valid sysroot specified."
4823 _ident=$($_cc --vsn | grep -i build | head -n1 | sed 's/.*: //')
4824 armcc_conf="$PWD/armcc.conf"
4825 $_cc --arm_linux_configure \
4826 --arm_linux_config_file="$armcc_conf" \
4827 --configure_sysroot="$sysroot" \
4828 --configure_cpp_headers="$sysinclude" >>$logfile 2>&1 ||
4829 die "Error creating armcc configuration file."
4830 $_cc --vsn | grep -q RVCT && armcc_opt=rvct || armcc_opt=armcc
4831 _flags="--arm_linux_config_file=$armcc_conf --translate_gcc"
4832 as_default="${cross_prefix}gcc"
4836 elif $_cc -v 2>&1 | grep -q clang && ! $_cc -? > /dev/null 2>&1; then
4838 _ident=$($_cc --version 2>/dev/null | head -n1)
4839 _depflags='-MMD -MF $(@:.o=.d) -MT $@'
4842 elif $_cc -V 2>&1 | grep -q Sun; then
4844 _ident=$($_cc -V 2>&1 | head -n1 | cut -d' ' -f 2-)
4845 _DEPCMD='$(DEP$(1)) $(DEP$(1)FLAGS) $($(1)DEP_FLAGS) $< | sed -e "1s,^.*: ,$@: ," -e "\$$!s,\$$, \\\," -e "1!s,^.*: , ," > $(@:.o=.d)'
4846 _DEPFLAGS='-xM1 -xc99'
4849 _cflags_size='-O5 -xspace'
4850 _flags_filter=suncc_flags
4851 elif $_cc -v 2>&1 | grep -q 'PathScale\|Path64'; then
4853 _ident=$($_cc -v 2>&1 | head -n1 | tr -d :)
4854 _depflags='-MMD -MF $(@:.o=.d) -MT $@'
4857 _flags_filter='filter_out -Wdisabled-optimization'
4858 elif $_cc -v 2>&1 | grep -q Open64; then
4860 _ident=$($_cc -v 2>&1 | head -n1 | tr -d :)
4861 _depflags='-MMD -MF $(@:.o=.d) -MT $@'
4864 _flags_filter='filter_out -Wdisabled-optimization|-Wtype-limits|-fno-signed-zeros'
4865 elif $_cc 2>&1 | grep -q 'Microsoft.*ARM.*Assembler'; then
4867 _ident=$($_cc | head -n1)
4868 # 4509: "This form of conditional instruction is deprecated"
4869 _flags="-nologo -ignore 4509"
4870 _flags_filter=armasm_flags
4871 elif $_cc 2>&1 | grep -q Intel; then
4873 _ident=$($_cc 2>&1 | head -n1)
4874 _depflags='-QMMD -QMF$(@:.o=.d) -QMT$@'
4875 # Not only is O3 broken on 13.x+ but it is slower on all previous
4876 # versions (tested) as well.
4878 _cflags_size="-O1 -Oi" # -O1 without -Oi miscompiles stuff
4879 if $_cc 2>&1 | grep -q Linker; then
4886 _flags_filter=icl_flags
4888 _ld_path='-libpath:'
4889 # -Qdiag-error to make icl error when seeing certain unknown arguments
4890 _flags='-nologo -Qdiag-error:4044,10157'
4891 # -Qvec- -Qsimd- to prevent miscompilation, -GS, fp:precise for consistency
4892 # with MSVC which enables it by default.
4893 _cflags='-Qms0 -Qvec- -Qsimd- -GS -fp:precise'
4895 elif $_cc -? 2>/dev/null | grep -q 'LLVM.*Linker'; then
4896 # lld can emulate multiple different linkers; in ms link.exe mode,
4897 # the -? parameter gives the help output which contains an identifyable
4898 # string, while it gives an error in other modes.
4900 # The link.exe mode doesn't have a switch for getting the version,
4901 # but we can force it back to gnu mode and get the version from there.
4902 _ident=$($_cc -flavor gnu --version 2>/dev/null)
4904 _flags_filter=msvc_flags
4906 _ld_path='-libpath:'
4907 elif $_cc -nologo- 2>&1 | grep -q Microsoft || { $_cc -v 2>&1 | grep -q clang && $_cc -? > /dev/null 2>&1; }; then
4909 if $_cc -nologo- 2>&1 | grep -q Microsoft; then
4910 _ident=$($_cc 2>&1 | head -n1 | tr -d '\r')
4912 _ident=$($_cc --version 2>/dev/null | head -n1 | tr -d '\r')
4914 _DEPCMD='$(DEP$(1)) $(DEP$(1)FLAGS) $($(1)DEP_FLAGS) $< 2>&1 | awk '\''/including/ { sub(/^.*file: */, ""); gsub(/\\/, "/"); if (!match($$0, / /)) print "$@:", $$0 }'\'' > $(@:.o=.d)'
4915 _DEPFLAGS='$(CPPFLAGS) $(CFLAGS) -showIncludes -Zs'
4919 if $_cc -nologo- 2>&1 | grep -q Linker; then
4926 _flags_filter=msvc_flags
4928 _ld_path='-libpath:'
4931 elif $_cc --version 2>/dev/null | grep -q ^cparser; then
4933 _ident=$($_cc --version | head -n1)
4937 _flags_filter=cparser_flags
4940 eval ${pfx}_type=\$_type
4941 eval ${pfx}_ident=\$_ident
4945 eval ${1}_C=\${_cc_c-\${${1}_C}}
4946 eval ${1}_E=\${_cc_e-\${${1}_E}}
4947 eval ${1}_O=\${_cc_o-\${${1}_O}}
4949 if [ -n "$_depflags" ]; then
4950 eval ${1}_DEPFLAGS=\$_depflags
4952 eval ${1}DEP=\${_DEPCMD:-\$DEPCMD}
4953 eval ${1}DEP_FLAGS=\${_DEPFLAGS:-\$DEPFLAGS}
4954 eval DEP${1}FLAGS=\$_flags
4958 probe_cc cc "$cc" "true"
4959 cflags_filter=$_flags_filter
4960 cflags_speed=$_cflags_speed
4961 cflags_size=$_cflags_size
4962 cflags_noopt=$_cflags_noopt
4963 add_cflags $_flags $_cflags
4964 cc_ldflags=$_ldflags
4968 probe_cc hostcc "$host_cc"
4969 host_cflags_filter=$_flags_filter
4970 host_cflags_speed=$_cflags_speed
4971 add_host_cflags $_flags $_cflags
4974 test -n "$cc_type" && enable $cc_type ||
4975 warn "Unknown C compiler $cc, unable to select optimal CFLAGS"
4977 : ${as_default:=$cc}
4978 : ${objcc_default:=$cc}
4979 : ${dep_cc_default:=$cc}
4980 : ${ld_default:=$cc}
4981 : ${host_ld_default:=$host_cc}
4982 set_default ar as objcc dep_cc ld ln_s host_ld windres
4985 asflags_filter=$_flags_filter
4986 add_asflags $_flags $_cflags
4989 probe_cc objcc "$objcc"
4990 objcflags_filter=$_flags_filter
4991 add_objcflags $_flags $_cflags
4995 ldflags_filter=$_flags_filter
4996 add_ldflags $_flags $_ldflags
4997 test "$cc_type" != "$ld_type" && add_ldflags $cc_ldflags
4999 LD_LIB=${_ld_lib-$LD_LIB}
5000 LD_PATH=${_ld_path-$LD_PATH}
5002 probe_cc hostld "$host_ld"
5003 host_ldflags_filter=$_flags_filter
5004 add_host_ldflags $_flags $_ldflags
5005 HOSTLD_O=${_ld_o-$HOSTLD_O}
5007 if [ -z "$CC_DEPFLAGS" ] && [ "$dep_cc" != "$cc" ]; then
5008 probe_cc depcc "$dep_cc"
5009 CCDEP=${_DEPCMD:-$DEPCMD}
5010 CCDEP_FLAGS=${_DEPFLAGS:=$DEPFLAGS}
5014 if $ar 2>&1 | grep -q Microsoft; then
5017 elif $ar 2>&1 | grep -q "\[D\] "; then
5025 add_cflags $extra_cflags
5026 add_cxxflags $extra_cxxflags
5027 add_objcflags $extra_objcflags
5028 add_asflags $extra_cflags
5030 if test -n "$sysroot"; then
5033 add_cppflags --sysroot="$sysroot"
5034 add_ldflags --sysroot="$sysroot"
5039 if test "$cpu" = host; then
5040 enabled cross_compile &&
5041 warn "--cpu=host makes no sense when cross-compiling."
5046 $cc $1=native -v -c -o $TMPO $TMPC >$TMPE 2>&1 || return
5048 s/.*$1=\\([^ ]*\\).*/\\1/
5053 cpu=$(check_native -march || check_native -mcpu)
5057 $cc $1=native -v -c -o $TMPO $TMPC >$TMPE 2>&1 || return
5058 sed -n "/cc1.*-target-cpu /{
5059 s/.*-target-cpu \\([^ ]*\\).*/\\1/
5064 cpu=$(check_native -march)
5068 test "${cpu:-host}" = host &&
5069 die "--cpu=host not supported with compiler $cc"
5072 # Deal with common $arch aliases
5099 "Power Macintosh"|ppc*|powerpc*)
5117 i[3-6]86*|i86pc|BePC|x86pc|x86_64|x86_32|amd64)
5122 is_in $arch $ARCH_LIST || warn "unknown architecture $arch"
5125 # Add processor-specific flags
5126 if enabled aarch64; then
5130 cpuflags="-march=$cpu"
5133 cpuflags="-mcpu=$cpu"
5137 elif enabled alpha; then
5139 cpuflags="-mcpu=$cpu"
5141 elif enabled arm; then
5144 test_cpp_condition stddef.h \
5145 "defined __ARM_ARCH_${1}__ || defined __TARGET_ARCH_${2:-$1}" \
5150 if check_arm_arch 4; then echo armv4
5151 elif check_arm_arch 4T; then echo armv4t
5152 elif check_arm_arch 5; then echo armv5
5153 elif check_arm_arch 5E; then echo armv5e
5154 elif check_arm_arch 5T; then echo armv5t
5155 elif check_arm_arch 5TE; then echo armv5te
5156 elif check_arm_arch 5TEJ; then echo armv5te
5157 elif check_arm_arch 6; then echo armv6
5158 elif check_arm_arch 6J; then echo armv6j
5159 elif check_arm_arch 6K; then echo armv6k
5160 elif check_arm_arch 6Z; then echo armv6z
5161 elif check_arm_arch 6KZ; then echo armv6zk
5162 elif check_arm_arch 6ZK; then echo armv6zk
5163 elif check_arm_arch 6T2; then echo armv6t2
5164 elif check_arm_arch 7; then echo armv7
5165 elif check_arm_arch 7A 7_A; then echo armv7-a
5166 elif check_arm_arch 7S; then echo armv7-a
5167 elif check_arm_arch 7R 7_R; then echo armv7-r
5168 elif check_arm_arch 7M 7_M; then echo armv7-m
5169 elif check_arm_arch 7EM 7E_M; then echo armv7-m
5170 elif check_arm_arch 8A 8_A; then echo armv8-a
5177 subarch=$(probe_arm_arch | sed 's/[^a-z0-9]//g')
5180 cpuflags="-march=$cpu"
5181 subarch=$(echo $cpu | sed 's/[^a-z0-9]//g')
5184 cpuflags="-mcpu=$cpu"
5186 cortex-a*) subarch=armv7a ;;
5187 cortex-r*) subarch=armv7r ;;
5188 cortex-m*) enable thumb; subarch=armv7m ;;
5189 arm11*) subarch=armv6 ;;
5190 arm[79]*e*|arm9[24]6*|arm96*|arm102[26]) subarch=armv5te ;;
5191 armv4*|arm7*|arm9[24]*) subarch=armv4 ;;
5192 *) subarch=$(probe_arm_arch) ;;
5198 armv5t*) enable fast_clz ;;
5201 disabled fast_unaligned || enable fast_unaligned
5205 test_cflags -mfp16-format=ieee && add_cflags -mfp16-format=ieee
5207 elif enabled avr32; then
5212 cpuflags="-mpart=$cpu"
5216 cpuflags="-march=$cpu"
5220 cpuflags="-mcpu=$cpu"
5224 cpuflags="-march=$cpu"
5228 elif enabled bfin; then
5230 cpuflags="-mcpu=$cpu"
5232 elif enabled loongarch; then
5234 enable local_aligned
5235 enable simd_align_32
5238 enable fast_unaligned
5241 cpuflags="-march=$cpu"
5244 elif enabled mips; then
5246 if [ "$cpu" != "generic" ]; then
5257 cpuflags="-march=$cpu"
5260 # General ISA levels
5274 # Cores from MIPS(MTI)
5279 24kf*|24kec|34kc|74Kc|1004kc)
5282 24kef*|34kf*|1004kf*)
5289 check_cflags "-mtune=p5600" && check_cflags "-msched-weight -mload-store-pairs -funroll-loops"
5293 check_cflags "-mtune=i6400 -mabi=64" && check_cflags "-msched-weight -mload-store-pairs -funroll-loops" && check_ldflags "-mabi=64"
5297 check_cflags "-mtune=p6600 -mabi=64" && check_cflags "-msched-weight -mload-store-pairs -funroll-loops" && check_ldflags "-mabi=64"
5299 # Cores from Loongson
5300 loongson2e|loongson2f|loongson3*)
5301 enable local_aligned
5302 enable simd_align_16
5306 enable fast_unaligned
5307 disable aligned_stack
5308 # When gcc version less than 5.3.0, add -fno-expensive-optimizations flag.
5309 if test "$cc_type" = "gcc"; then
5310 case $gcc_basever in
5311 2|2.*|3.*|4.*|5.0|5.1|5.2)
5312 expensive_optimization_flag="-fno-expensive-optimizations"
5315 expensive_optimization_flag=""
5323 cpuflags="-march=loongson3a -mhard-float $expensive_optimization_flag"
5327 cpuflags="-march=loongson2e -mhard-float $expensive_optimization_flag"
5331 cpuflags="-march=loongson2f -mhard-float $expensive_optimization_flag"
5336 warn "unknown MIPS CPU"
5343 # Disable DSP stuff for generic CPU, it can't be detected at runtime.
5344 warn 'generic cpu selected'
5347 elif enabled ppc; then
5351 case $(tolower $cpu) in
5352 601|ppc601|powerpc601)
5353 cpuflags="-mcpu=601"
5356 603*|ppc603*|powerpc603*)
5357 cpuflags="-mcpu=603"
5360 604*|ppc604*|powerpc604*)
5361 cpuflags="-mcpu=604"
5364 g3|75*|ppc75*|powerpc75*)
5365 cpuflags="-mcpu=750"
5368 g4|745*|ppc745*|powerpc745*)
5369 cpuflags="-mcpu=7450"
5372 74*|ppc74*|powerpc74*)
5373 cpuflags="-mcpu=7400"
5376 g5|970|ppc970|powerpc970)
5377 cpuflags="-mcpu=970"
5381 cpuflags="-mcpu=$cpu"
5385 cpuflags="-mcpu=$cpu"
5388 cpuflags="-mcpu=cell"
5393 cpuflags="-mcpu=e500mc"
5397 cpuflags="-mcpu=8548 -mhard-float -mfloat-gprs=double"
5402 cpuflags="-mcpu=8540 -mhard-float"
5408 elif enabled riscv; then
5410 if test_cpp_condition stddef.h "__riscv_zbb"; then
5414 elif enabled sparc; then
5417 cypress|f93[04]|tsc701|sparcl*|supersparc|hypersparc|niagara|v[789])
5418 cpuflags="-mcpu=$cpu"
5420 ultrasparc*|niagara[234])
5421 cpuflags="-mcpu=$cpu"
5425 elif enabled x86; then
5429 cpuflags="-march=$cpu"
5433 # targets that do NOT support nopl and conditional mov (cmov)
5434 pentium-mmx|k6|k6-[23]|winchip-c6|winchip2|c3)
5435 cpuflags="-march=$cpu"
5438 # targets that do support conditional mov but on which it's slow
5439 pentium4|pentium4m|prescott|nocona)
5440 cpuflags="-march=$cpu"
5444 # everything else should support nopl and conditional mov (cmov)
5446 cpuflags="-march=$cpu"
5454 if [ "$cpu" != generic ]; then
5455 add_cflags $cpuflags
5456 add_asflags $cpuflags
5457 test "$cc_type" = "$ld_type" && add_ldflags $cpuflags
5460 # compiler sanity check
5462 int main(void){ return 0; }
5464 if test "$?" != 0; then
5465 echo "$cc is unable to create an executable file."
5466 if test -z "$cross_prefix" && ! enabled cross_compile ; then
5467 echo "If $cc is a cross-compiler, use the --enable-cross-compile option."
5468 echo "Only do this if you know what cross compiling means."
5470 die "C compiler test failed."
5473 add_cppflags -D_ISOC99_SOURCE
5474 add_cxxflags -D__STDC_CONSTANT_MACROS
5475 check_cxxflags -std=c++11 || check_cxxflags -std=c++0x
5477 # some compilers silently accept -std=c11, so we also need to check that the
5478 # version macro is defined properly
5479 test_cflags_cc -std=c11 ctype.h "__STDC_VERSION__ >= 201112L" &&
5480 add_cflags -std=c11 ||
5481 check_cflags -std=c99
5483 check_cppflags -D_FILE_OFFSET_BITS=64
5484 check_cppflags -D_LARGEFILE_SOURCE
5486 add_host_cppflags -D_ISOC99_SOURCE
5487 check_host_cflags -std=c99
5488 check_host_cflags -Wall
5489 check_host_cflags $host_cflags_speed
5494 expr=${3:-'sizeof(void *) > 4'}
5495 test_code cc "" "int test[2*($expr) - 1]" &&
5496 subarch=$arch64 || subarch=$arch32
5502 enabled shared && enable_weak pic
5505 check_64bit loongarch32 loongarch64
5506 enabled loongarch64 && disable loongarch32
5507 enabled shared && enable_weak pic
5510 check_64bit mips mips64 '_MIPS_SIM > 1'
5511 enabled shared && enable_weak pic
5514 check_64bit parisc parisc64
5515 enabled shared && enable_weak pic
5518 check_64bit ppc ppc64
5519 enabled shared && enable_weak pic
5522 check_64bit riscv32 riscv64
5523 enabled shared && enable_weak pic
5526 check_64bit s390 s390x
5527 enabled shared && enable_weak pic
5530 check_64bit sparc sparc64
5531 enabled shared && enable_weak pic
5534 check_64bit x86_32 x86_64
5535 # Treat x32 as x64 for now. Note it also needs pic if shared
5536 test "$subarch" = "x86_32" && test_cpp_condition stddef.h 'defined(__x86_64__)' &&
5537 subarch=x86_64 && enable x86_64 && disable x86_32
5538 if enabled x86_64; then
5539 enabled shared && enable_weak pic
5549 add_cppflags '-I\$(SRC_PATH)/compat/aix'
5550 enabled shared && add_ldflags -Wl,-brtl
5551 arflags='-Xany -r -c'
5556 enable section_data_rel_ro
5558 add_ldexeflags -fPIE -pie
5559 SLIB_INSTALL_NAME='$(SLIBNAME)'
5561 SHFLAGS='-shared -Wl,-soname,$(SLIBNAME)'
5564 prefix_default="/boot/common"
5565 network_extralibs="-lnetwork"
5569 SHFLAGS='-shared -Wl,-h,$$(@F)'
5570 enabled x86 && append SHFLAGS -mimpure-text
5571 network_extralibs="-lsocket -lnsl"
5572 add_cppflags -D__EXTENSIONS__
5573 # When using suncc to build, the Solaris linker will mark
5574 # an executable with each instruction set encountered by
5575 # the Solaris assembler. As our libraries contain their own
5576 # guards for processor-specific code, instead suppress
5577 # generation of the HWCAPS ELF section on Solaris x86 only.
5578 enabled_all suncc x86 &&
5579 echo "hwcap_1 = OVERRIDE;" > mapfile &&
5580 add_ldflags -Wl,-M,mapfile
5581 nm_default='nm -P -g'
5584 VERSION_SCRIPT_POSTPROCESS_CMD='perl $(SRC_PATH)/compat/solaris/make_sunver.pl - $(OBJS)'
5588 oss_indev_extralibs="-lossaudio"
5589 oss_outdev_extralibs="-lossaudio"
5590 enabled gcc || check_ldflags -Wl,-zmuldefs
5594 enable section_data_rel_ro
5597 SLIB_INSTALL_NAME='$(SLIBNAME).$(LIBMAJOR).$(LIBMINOR)'
5599 oss_indev_extralibs="-lossaudio"
5600 oss_outdev_extralibs="-lossaudio"
5608 add_extralibs -lpoll -lgnugetopt
5612 enabled ppc && add_asflags -force_cpusubtype_ALL
5613 install_name_dir_default='$(SHLIBDIR)'
5614 SHFLAGS='-dynamiclib -Wl,-single_module -Wl,-install_name,$(INSTALL_NAME_DIR)/$(SLIBNAME_WITH_MAJOR),-current_version,$(LIBVERSION),-compatibility_version,$(LIBMAJOR)'
5615 enabled x86_32 && append SHFLAGS -Wl,-read_only_relocs,suppress
5617 add_ldflags -Wl,-dynamic,-search_paths_first
5618 check_cflags -Werror=partial-availability
5620 SLIBNAME_WITH_VERSION='$(SLIBPREF)$(FULLNAME).$(LIBVERSION)$(SLIBSUF)'
5621 SLIBNAME_WITH_MAJOR='$(SLIBPREF)$(FULLNAME).$(LIBMAJOR)$(SLIBSUF)'
5622 enabled x86_64 && objformat="macho64" || objformat="macho32"
5623 enabled_any pic shared x86_64 ||
5624 { check_cflags -mdynamic-no-pic && add_asflags -mdynamic-no-pic; }
5625 check_headers dispatch/dispatch.h &&
5626 add_cppflags '-I\$(SRC_PATH)/compat/dispatch_semaphore'
5627 if test -n "$sysroot"; then
5628 is_in -isysroot $cc $CPPFLAGS $CFLAGS || check_cppflags -isysroot $sysroot
5629 is_in -isysroot $ld $LDFLAGS || check_ldflags -isysroot $sysroot
5631 version_script='-exported_symbols_list'
5632 VERSION_SCRIPT_POSTPROCESS_CMD='tr " " "\n" | sed -n /global:/,/local:/p | grep ";" | tr ";" "\n" | sed -E "s/(.+)/_\1/g" | sed -E "s/(.+[^*])$$$$/\1*/"'
5633 # Workaround for Xcode 11 -fstack-check bug
5634 if enabled clang; then
5635 clang_version=$($cc -dumpversion)
5636 test ${clang_version%%.*} -eq 11 && add_cflags -fno-stack-check
5640 die "Native MSYS builds are discouraged, please use the MINGW environment."
5645 if enabled x86_64; then
5646 LIBTARGET="i386:x86-64"
5647 elif enabled arm; then
5649 elif enabled aarch64; then
5652 if enabled shared; then
5653 # Cannot build both shared and static libs when using dllimport.
5656 ! enabled small && test_cmd $windres --version && enable gnu_windres
5657 enabled x86_32 && check_ldflags -Wl,--large-address-aware
5658 add_cppflags -DWIN32_LEAN_AND_MEAN
5659 shlibdir_default="$bindir_default"
5662 SLIBNAME_WITH_VERSION='$(SLIBPREF)$(FULLNAME)-$(LIBVERSION)$(SLIBSUF)'
5663 SLIBNAME_WITH_MAJOR='$(SLIBPREF)$(FULLNAME)-$(LIBMAJOR)$(SLIBSUF)'
5664 if test_cmd lib.exe -list; then
5665 SLIB_EXTRA_CMD=-'lib.exe -nologo -machine:$(LIBTARGET) -def:$$(@:$(SLIBSUF)=.def) -out:$(SUBDIR)$(SLIBNAME:$(SLIBSUF)=.lib)'
5666 if enabled x86_64; then
5670 SLIB_EXTRA_CMD=-'$(DLLTOOL) -m $(LIBTARGET) -d $$(@:$(SLIBSUF)=.def) -l $(SUBDIR)$(SLIBNAME:$(SLIBSUF)=.lib) -D $(SLIBNAME_WITH_MAJOR)'
5672 SLIB_INSTALL_NAME='$(SLIBNAME_WITH_MAJOR)'
5674 SLIB_INSTALL_EXTRA_SHLIB='$(SLIBNAME:$(SLIBSUF)=.lib)'
5675 SLIB_INSTALL_EXTRA_LIB='lib$(SLIBNAME:$(SLIBSUF)=.dll.a) $(SLIBNAME_WITH_MAJOR:$(SLIBSUF)=.def)'
5676 SLIB_CREATE_DEF_CMD='EXTERN_PREFIX="$(EXTERN_PREFIX)" AR="$(AR_CMD)" NM="$(NM_CMD)" $(SRC_PATH)/compat/windows/makedef $(SUBDIR)lib$(NAME).ver $(OBJS) > $$(@:$(SLIBSUF)=.def)'
5677 SHFLAGS='-shared -Wl,--out-implib,$(SUBDIR)lib$(SLIBNAME:$(SLIBSUF)=.dll.a) -Wl,--disable-auto-image-base $$(@:$(SLIBSUF)=.def)'
5678 enabled x86_64 && objformat="win64" || objformat="win32"
5679 dlltool="${cross_prefix}dlltool"
5682 check_ldflags -Wl,--nxcompat,--dynamicbase
5683 # Lets work around some stupidity in binutils.
5684 # ld will strip relocations from executables even though we need them
5685 # for dynamicbase (ASLR). Using -pie does retain the reloc section
5686 # however ld then forgets what the entry point should be (oops) so we
5687 # have to manually (re)set it.
5688 if enabled x86_32; then
5689 disabled debug && add_ldexeflags -Wl,--pic-executable,-e,_mainCRTStartup
5690 elif enabled x86_64; then
5691 disabled debug && add_ldexeflags -Wl,--pic-executable,-e,mainCRTStartup
5692 check_ldflags -Wl,--high-entropy-va # binutils 2.25
5693 # Set image base >4GB for extra entropy with HEASLR
5694 add_ldexeflags -Wl,--image-base,0x140000000
5695 append SHFLAGS -Wl,--image-base,0x180000000
5700 if enabled shared; then
5701 # Link to the import library instead of the normal static library
5704 # Cannot build both shared and static libs with MSVC or icl.
5707 ! enabled small && test_cmd $windres --version && enable gnu_windres
5708 enabled x86_32 && check_ldflags -LARGEADDRESSAWARE
5709 add_cppflags -DWIN32_LEAN_AND_MEAN
5710 shlibdir_default="$bindir_default"
5713 SLIBNAME_WITH_VERSION='$(SLIBPREF)$(FULLNAME)-$(LIBVERSION)$(SLIBSUF)'
5714 SLIBNAME_WITH_MAJOR='$(SLIBPREF)$(FULLNAME)-$(LIBMAJOR)$(SLIBSUF)'
5715 SLIB_CREATE_DEF_CMD='EXTERN_PREFIX="$(EXTERN_PREFIX)" $(SRC_PATH)/compat/windows/makedef $(SUBDIR)lib$(NAME).ver $(OBJS) > $$(@:$(SLIBSUF)=.def)'
5716 SLIB_INSTALL_NAME='$(SLIBNAME_WITH_MAJOR)'
5718 SLIB_INSTALL_EXTRA_SHLIB='$(SLIBNAME:$(SLIBSUF)=.lib)'
5719 SLIB_INSTALL_EXTRA_LIB='$(SLIBNAME_WITH_MAJOR:$(SLIBSUF)=.def)'
5720 SHFLAGS='-dll -def:$$(@:$(SLIBSUF)=.def) -implib:$(SUBDIR)$(SLIBNAME:$(SLIBSUF)=.lib)'
5721 enabled x86_64 && objformat="win64" || objformat="win32"
5727 shlibdir_default="$bindir_default"
5730 SLIBNAME_WITH_VERSION='$(SLIBPREF)$(FULLNAME)-$(LIBVERSION)$(SLIBSUF)'
5731 SLIBNAME_WITH_MAJOR='$(SLIBPREF)$(FULLNAME)-$(LIBMAJOR)$(SLIBSUF)'
5732 SLIB_INSTALL_NAME='$(SLIBNAME_WITH_MAJOR)'
5734 SLIB_INSTALL_EXTRA_LIB='lib$(FULLNAME).dll.a'
5735 SHFLAGS='-shared -Wl,--out-implib,$(SUBDIR)lib$(FULLNAME).dll.a'
5736 enabled x86_64 && objformat="win64" || objformat="win32"
5738 ! enabled small && test_cmd $windres --version && enable gnu_windres
5739 add_cppflags -DWIN32_LEAN_AND_MEAN
5740 add_cppflags -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600
5742 *-dos|freedos|opendos)
5743 network_extralibs="-lsocket"
5748 enable section_data_rel_ro
5749 enabled_any arm aarch64 && enable_weak linux_perf
5753 ranlib="echo ignoring ranlib"
5759 add_cppflags -D_GNU_SOURCE
5760 add_ldflags -Zomf -Zbin-files -Zargs-wild -Zhigh-mem -Zmap
5761 SHFLAGS='$(SUBDIR)$(NAME).def -Zdll -Zomf'
5765 SLIBNAME_WITH_VERSION='$(SLIBPREF)$(FULLNAME)-$(LIBVERSION)$(SLIBSUF)'
5766 SLIBNAME_WITH_MAJOR='$(SLIBPREF)$(shell echo $(FULLNAME) | cut -c1-6)$(LIBMAJOR)$(SLIBSUF)'
5767 SLIB_CREATE_DEF_CMD='echo LIBRARY $(SLIBNAME_WITH_MAJOR:$(SLIBSUF)=) INITINSTANCE TERMINSTANCE > $(SUBDIR)$(FULLNAME).def; \
5768 echo CODE PRELOAD MOVEABLE DISCARDABLE >> $(SUBDIR)$(FULLNAME).def; \
5769 echo DATA PRELOAD MOVEABLE MULTIPLE NONSHARED >> $(SUBDIR)$(FULLNAME).def; \
5770 echo EXPORTS >> $(SUBDIR)$(FULLNAME).def; \
5771 emxexp $(OBJS) >> $(SUBDIR)$(FULLNAME).def'
5772 SLIB_EXTRA_CMD='emximp -o $(SUBDIR)$(LIBPREF)$(FULLNAME)_dll.a $(SUBDIR)$(FULLNAME).def; \
5773 emximp -o $(SUBDIR)$(LIBPREF)$(FULLNAME)_dll.lib $(SUBDIR)$(FULLNAME).def;'
5774 SLIB_INSTALL_NAME='$(SLIBNAME_WITH_MAJOR)'
5776 SLIB_INSTALL_EXTRA_LIB='$(LIBPREF)$(FULLNAME)_dll.a $(LIBPREF)$(FULLNAME)_dll.lib'
5778 enable_weak os2threads
5781 add_cppflags -D_BSD_SOURCE
5786 add_cppflags -D_QNX_SOURCE
5787 network_extralibs="-lsocket"
5792 add_cflags --include=$sysinclude/gcce/gcce.h -fvisibility=default
5793 add_cppflags -D__GCCE__ -D__SYMBIAN32__ -DSYMBIAN_OE_POSIX_SIGNALS
5794 add_ldflags -Wl,--target1-abs,--no-undefined \
5795 -Wl,-Ttext,0x80000,-Tdata,0x1000000 -shared \
5796 -Wl,--entry=_E32Startup -Wl,-u,_E32Startup
5797 add_extralibs -l:eexe.lib -l:usrt2_2.lib -l:dfpaeabi.dso \
5798 -l:drtaeabi.dso -l:scppnwdl.dso -lsupc++ -lgcc \
5799 -l:libc.dso -l:libm.dso -l:euser.dso -l:libcrt0.lib
5806 die "Unknown OS '$target_os'."
5810 # test if creating links works
5811 link_dest=$(mktemp -u $TMPDIR/dest_XXXXXXXX)
5812 link_name=$(mktemp -u $TMPDIR/name_XXXXXXXX)
5814 $ln_s "$link_dest" "$link_name"
5815 touch "$link_dest/test_file"
5816 if [ "$source_path" != "." ] && [ "$source_path" != "src" ] && ([ ! -d src ] || [ -L src ]) && [ -e "$link_name/test_file" ]; then
5817 # create link to source path
5818 [ -e src ] && rm src
5819 $ln_s "$source_path" src
5822 # creating directory links doesn't work
5823 # fall back to using the full source path
5824 source_link="$source_path"
5830 # determine libc flavour
5835 # uclibc defines __GLIBC__, so it needs to be checked before glibc.
5836 if test_${pfx}cpp_condition features.h "defined __UCLIBC__"; then
5837 eval ${pfx}libc_type=uclibc
5838 add_${pfx}cppflags -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600
5839 elif test_${pfx}cpp_condition features.h "defined __GLIBC__"; then
5840 eval ${pfx}libc_type=glibc
5841 add_${pfx}cppflags -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600
5842 # MinGW headers can be installed on Cygwin, so check for newlib first.
5843 elif test_${pfx}cpp_condition newlib.h "defined _NEWLIB_VERSION"; then
5844 eval ${pfx}libc_type=newlib
5845 add_${pfx}cppflags -U__STRICT_ANSI__ -D_XOPEN_SOURCE=600
5846 # MinGW64 is backwards compatible with MinGW32, so check for it first.
5847 elif test_${pfx}cpp_condition _mingw.h "defined __MINGW64_VERSION_MAJOR"; then
5848 eval ${pfx}libc_type=mingw64
5849 if test_${pfx}cpp_condition _mingw.h "__MINGW64_VERSION_MAJOR < 3"; then
5850 add_compat msvcrt/snprintf.o
5851 add_cflags "-include $source_path/compat/msvcrt/snprintf.h"
5853 add_${pfx}cppflags -U__STRICT_ANSI__ -D__USE_MINGW_ANSI_STDIO=1
5854 eval test \$${pfx_no_}cc_type = "gcc" &&
5855 add_${pfx}cppflags -D__printf__=__gnu_printf__
5856 test_${pfx}cpp_condition windows.h "!defined(_WIN32_WINNT) || _WIN32_WINNT < 0x0600" &&
5857 add_${pfx}cppflags -D_WIN32_WINNT=0x0600
5858 add_${pfx}cppflags -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600
5859 elif test_${pfx}cpp_condition _mingw.h "defined __MINGW_VERSION" ||
5860 test_${pfx}cpp_condition _mingw.h "defined __MINGW32_VERSION"; then
5861 eval ${pfx}libc_type=mingw32
5862 test_${pfx}cpp_condition _mingw.h "__MINGW32_MAJOR_VERSION > 3 || \
5863 (__MINGW32_MAJOR_VERSION == 3 && __MINGW32_MINOR_VERSION >= 15)" ||
5864 die "ERROR: MinGW32 runtime version must be >= 3.15."
5865 add_${pfx}cppflags -U__STRICT_ANSI__ -D__USE_MINGW_ANSI_STDIO=1
5866 test_${pfx}cpp_condition _mingw.h "__MSVCRT_VERSION__ < 0x0700" &&
5867 add_${pfx}cppflags -D__MSVCRT_VERSION__=0x0700
5868 test_${pfx}cpp_condition windows.h "!defined(_WIN32_WINNT) || _WIN32_WINNT < 0x0600" &&
5869 add_${pfx}cppflags -D_WIN32_WINNT=0x0600
5870 eval test \$${pfx_no_}cc_type = "gcc" &&
5871 add_${pfx}cppflags -D__printf__=__gnu_printf__
5872 add_${pfx}cppflags -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600
5873 elif test_${pfx}cpp_condition crtversion.h "defined _VC_CRT_MAJOR_VERSION"; then
5874 eval ${pfx}libc_type=msvcrt
5875 if test_${pfx}cpp_condition crtversion.h "_VC_CRT_MAJOR_VERSION < 14"; then
5876 if [ "$pfx" = host_ ]; then
5877 add_host_cppflags -Dsnprintf=_snprintf
5879 add_compat strtod.o strtod=avpriv_strtod
5880 add_compat msvcrt/snprintf.o snprintf=avpriv_snprintf \
5881 _snprintf=avpriv_snprintf \
5882 vsnprintf=avpriv_vsnprintf
5885 add_${pfx}cppflags -D_USE_MATH_DEFINES -D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_WARNINGS
5886 # The MSVC 2010 headers (Win 7.0 SDK) set _WIN32_WINNT to
5887 # 0x601 by default unless something else is set by the user.
5888 # This can easily lead to us detecting functions only present
5889 # in such new versions and producing binaries requiring windows 7.0.
5890 # Therefore explicitly set the default to Vista unless the user has
5891 # set something else on the command line.
5892 # Don't do this if WINAPI_FAMILY is set and is set to a non-desktop
5893 # family. For these cases, configure is free to use any functions
5894 # found in the SDK headers by default. (Alternatively, we could force
5895 # _WIN32_WINNT to 0x0602 in that case.)
5896 test_${pfx}cpp_condition stdlib.h "defined(_WIN32_WINNT)" ||
5897 { test_${pfx}cpp <<EOF && add_${pfx}cppflags -D_WIN32_WINNT=0x0600; }
5898 #ifdef WINAPI_FAMILY
5899 #include <winapifamily.h>
5900 #if !WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
5905 if [ "$pfx" = "" ]; then
5906 check_func strtoll || add_cflags -Dstrtoll=_strtoi64
5907 check_func strtoull || add_cflags -Dstrtoull=_strtoui64
5909 elif test_${pfx}cpp_condition stddef.h "defined __KLIBC__"; then
5910 eval ${pfx}libc_type=klibc
5911 elif test_${pfx}cpp_condition sys/cdefs.h "defined __BIONIC__"; then
5912 eval ${pfx}libc_type=bionic
5913 elif test_${pfx}cpp_condition sys/brand.h "defined LABELED_BRAND_NAME"; then
5914 eval ${pfx}libc_type=solaris
5915 add_${pfx}cppflags -D__EXTENSIONS__ -D_XOPEN_SOURCE=600
5916 elif test_${pfx}cpp_condition sys/version.h "defined __DJGPP__"; then
5917 eval ${pfx}libc_type=djgpp
5918 add_cppflags -U__STRICT_ANSI__
5919 add_cflags "-include $source_path/compat/djgpp/math.h"
5920 add_compat djgpp/math.o
5924 void *v = localtime_r;
5926 test "$?" != 0 && test_${pfx}cc -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600 <<EOF && add_${pfx}cppflags -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600
5928 void *v = localtime_r;
5931 eval test -n "\${${pfx}libc_type}" && enable ${pfx}libc_${libc_type}
5937 # hacks for compiler/libc/os combinations
5941 add_compat strtod.o strtod=avpriv_strtod
5945 check_compile_assert flt_lim "float.h limits.h" "DBL_MAX == (double)DBL_MAX" ||
5946 add_cppflags '-I\$(SRC_PATH)/compat/float'
5948 test_cpp_condition stdlib.h "defined(__PIC__) || defined(__pic__) || defined(PIC)" && enable_weak pic
5951 : ${shlibdir_default:="$libdir"}
5952 : ${pkgconfigdir_default:="$libdir/pkgconfig"}
5954 set_default $PATHS_LIST
5957 disabled optimizations || enabled ossfuzz || check_cflags -fomit-frame-pointer
5960 disabled pic && return
5963 case "$target_os" in
5964 mingw*|cygwin*|win*)
5973 enabled pic && enable_weak_pic
5975 test_cc <<EOF || die "Symbol mangling check failed."
5978 sym=$($nm $TMPO | awk '/ff_extern/{ print substr($0, match($0, /[^ \t]*ff_extern/)) }')
5979 extern_prefix=${sym%%ff_extern*}
5981 ! disabled inline_asm && check_inline_asm inline_asm '"" ::'
5983 for restrict_keyword in restrict __restrict__ __restrict ""; do
5984 test_code cc "" "char * $restrict_keyword p" && break
5987 check_cc pragma_deprecated "" '_Pragma("GCC diagnostic ignored \"-Wdeprecated-declarations\"")'
5989 # The global variable ensures the bits appear unchanged in the object file.
5990 test_cc <<EOF || die "endian test failed"
5991 unsigned int endian = 'B' << 24 | 'I' << 16 | 'G' << 8 | 'E';
5993 od -t x1 $TMPO | grep -q '42 *49 *47 *45' && enable bigendian
5995 check_cc const_nan math.h "struct { double d; } static const bar[] = { { NAN } }"
5997 if ! enabled ppc64 || enabled bigendian; then
6002 log "check_gas using '$as' as AS"
6003 # :vararg is used on aarch64, arm and ppc altivec
6005 .macro m n, y:vararg=0
6009 # .altmacro is only used in arm asm
6010 ! enabled arm || check_as gnu_as ".altmacro"
6013 if enabled_any arm aarch64 || enabled_all ppc altivec && enabled asm; then
6015 enabled_any arm aarch64 && nogas=die
6016 enabled_all ppc altivec && [ $target_os_default != aix ] && nogas=warn
6020 arm*) gaspp_as_type=armasm; as_noop=-h ;;
6021 gcc) gaspp_as_type=gas ;;
6022 *) gaspp_as_type=$as_type ;;
6025 [ $target_os = "darwin" ] && gaspp_as_type="apple-$gaspp_as_type"
6027 test "${as#*gas-preprocessor.pl}" != "$as" ||
6028 test_cmd gas-preprocessor.pl -arch $arch -as-type $gaspp_as_type -- ${as:=$cc} $as_noop &&
6029 gas="${gas:=gas-preprocessor.pl} -arch $arch -as-type $gaspp_as_type -- ${as:=$cc}"
6031 if ! check_gas ; then
6034 $nogas "GNU assembler not found, install/update gas-preprocessor"
6037 check_as as_func ".func test
6041 check_inline_asm inline_asm_labels '"1:\n"'
6043 check_inline_asm inline_asm_nonlocal_labels '"Label:\n"'
6045 if enabled aarch64; then
6046 as_arch_level="armv8-a"
6047 check_as as_arch_directive ".arch $as_arch_level"
6048 enabled as_arch_directive && check_arch_level armv8.2-a
6050 enabled armv8 && check_insn armv8 'prfm pldl1strm, [x0]'
6051 # internal assembler in clang 3.3 does not support this instruction
6052 enabled neon && check_insn neon 'ext v0.8B, v0.8B, v1.8B, #1'
6054 archext_list="dotprod i8mm"
6055 enabled dotprod && check_archext_insn dotprod 'udot v0.4s, v0.16b, v0.16b'
6056 enabled i8mm && check_archext_insn i8mm 'usdot v0.4s, v0.16b, v0.16b'
6058 # Disable the main feature (e.g. HAVE_NEON) if neither inline nor external
6059 # assembly support the feature out of the box. Skip this for the features
6060 # checked with check_archext_insn above, as that function takes care of
6061 # updating all the variables as necessary.
6062 for v in $ARCH_EXT_LIST_ARM; do
6063 is_in $v $archext_list && continue
6064 enabled_any ${v}_external ${v}_inline || disable $v
6067 elif enabled alpha; then
6071 elif enabled arm; then
6073 enabled msvc && check_cpp_condition thumb stddef.h "defined _M_ARMT"
6074 test_cpp_condition stddef.h "defined __thumb__" && test_cc <<EOF && enable_weak thumb
6075 float func(float a, float b){ return a+b; }
6077 enabled thumb && check_cflags -mthumb || check_cflags -marm
6079 if check_cpp_condition vfp_args stddef.h "defined __ARM_PCS_VFP"; then
6081 elif check_cpp_condition vfp_args stddef.h "defined _M_ARM_FP && _M_ARM_FP >= 30"; then
6083 elif ! test_cpp_condition stddef.h "defined __ARM_PCS || defined __SOFTFP__" && [ $target_os != darwin ]; then
6084 case "${cross_prefix:-$cc}" in
6085 *hardfloat*) enable vfp_args; fpabi=vfp ;;
6086 *) check_ld "cc" vfp_args <<EOF && fpabi=vfp || fpabi=soft ;;
6087 __asm__ (".eabi_attribute 28, 1");
6088 int main(void) { return 0; }
6091 warn "Compiler does not indicate floating-point ABI, guessing $fpabi."
6094 # Test for various instruction sets, testing support both in inline and
6095 # external assembly. This sets the ${v}_inline or ${v}_external flags
6096 # if the instruction can be used unconditionally in either inline or
6097 # external assembly. This means that if the ${v}_external feature is set,
6098 # that feature can be used unconditionally in various support macros
6099 # anywhere in external assembly, in any function.
6100 enabled armv5te && check_insn armv5te 'qadd r0, r0, r0'
6101 enabled armv6 && check_insn armv6 'sadd16 r0, r0, r0'
6102 enabled armv6t2 && check_insn armv6t2 'movt r0, #0'
6103 enabled neon && check_insn neon 'vadd.i16 q0, q0, q0'
6104 enabled vfp && check_insn vfp 'fadds s0, s0, s0'
6105 enabled vfpv3 && check_insn vfpv3 'vmov.f32 s0, #1.0'
6106 enabled setend && check_insn setend 'setend be'
6108 # If neither inline nor external assembly can use the feature by default,
6109 # disable the main unsuffixed feature (e.g. HAVE_NEON).
6111 # For targets that support runtime CPU feature detection, don't disable
6112 # the main feature flag - there we assume that all supported toolchains
6113 # can assemble code for all instruction set features (e.g. NEON) with
6114 # suitable assembly flags (such as ".fpu neon"); we don't check
6115 # specifically that they really do.
6116 [ $target_os = linux ] || [ $target_os = android ] ||
6117 map 'enabled_any ${v}_external ${v}_inline || disable $v' \
6120 check_inline_asm asm_mod_q '"add r0, %Q0, %R0" :: "r"((long long)0)'
6122 check_as as_arch_directive ".arch armv7-a"
6123 check_as as_dn_directive "ra .dn d0.i16"
6124 check_as as_fpu_directive ".fpu neon"
6126 # llvm's integrated assembler supports .object_arch from llvm 3.5
6127 [ "$objformat" = elf32 ] || [ "$objformat" = elf64 ] &&
6128 check_as as_object_arch ".object_arch armv4"
6130 # MS armasm fails to assemble our PIC constructs
6131 [ $target_os != win32 ] && enabled_all armv6t2 shared !pic && enable_weak_pic
6133 elif enabled mips; then
6135 # Check toolchain ISA level
6136 if enabled mips64; then
6137 enabled mips64r6 && check_inline_asm mips64r6 '"dlsa $0, $0, $0, 1"' &&
6140 enabled mips64r2 && check_inline_asm mips64r2 '"dext $0, $0, 0, 1"'
6142 disable mips32r6 && disable mips32r5 && disable mips32r2
6144 enabled mips32r6 && check_inline_asm mips32r6 '"aui $0, $0, 0"' &&
6145 disable mips32r5 && disable mips32r2
6147 enabled mips32r5 && check_inline_asm mips32r5 '"eretnc"'
6148 enabled mips32r2 && check_inline_asm mips32r2 '"ext $0, $0, 0, 1"'
6150 disable mips64r6 && disable mips64r5 && disable mips64r2
6153 enabled mipsfpu && check_inline_asm mipsfpu '"cvt.d.l $f0, $f2"'
6154 enabled mipsfpu && (enabled mips32r5 || enabled mips32r6 || enabled mips64r6) && check_inline_asm_flags mipsfpu '"cvt.d.l $f0, $f1"' '-mfp64'
6156 enabled mipsdsp && check_inline_asm_flags mipsdsp '"addu.qb $t0, $t1, $t2"' '-mdsp'
6157 enabled mipsdspr2 && check_inline_asm_flags mipsdspr2 '"absq_s.qb $t0, $t1"' '-mdspr2'
6159 # MSA can be detected at runtime so we supply extra flags here
6160 enabled mipsfpu && enabled msa && check_inline_asm msa '"addvi.b $w0, $w1, 1"' '-mmsa' && append MSAFLAGS '-mmsa'
6162 # loongson2 have no switch cflag so we can only probe toolchain ability
6163 enabled loongson2 && check_inline_asm loongson2 '"dmult.g $8, $9, $10"' && disable loongson3
6165 # loongson3 is paired with MMI
6166 enabled loongson3 && check_inline_asm loongson3 '"gsldxc1 $f0, 0($2, $3)"' '-mloongson-ext' && append MMIFLAGS '-mloongson-ext'
6168 # MMI can be detected at runtime too
6169 enabled mmi && check_inline_asm mmi '"pxor $f0, $f0, $f0"' '-mloongson-mmi' && append MMIFLAGS '-mloongson-mmi'
6171 if enabled bigendian && enabled msa; then
6175 elif enabled parisc; then
6177 if enabled gcc; then
6178 case $($cc -dumpversion) in
6179 4.[3-9].*) check_cflags -fno-optimize-sibling-calls ;;
6183 elif enabled ppc; then
6185 enable local_aligned
6187 check_inline_asm dcbzl '"dcbzl 0, %0" :: "r"(0)'
6188 check_inline_asm ibm_asm '"add 0, 0, 0"'
6189 check_inline_asm ppc4xx '"maclhw r10, r11, r12"'
6190 check_inline_asm xform_asm '"lwzx %1, %y0" :: "Z"(*(int*)0), "r"(0)'
6192 if enabled altivec; then
6193 check_cflags -maltivec -mabi=altivec
6195 # check if our compiler supports Motorola AltiVec C API
6196 check_cc altivec altivec.h "vector signed int v1 = (vector signed int) { 0 };
6197 vector signed int v2 = (vector signed int) { 1 };
6198 v1 = vec_add(v1, v2);"
6200 enabled altivec || warn "Altivec disabled, possibly missing --cpu flag"
6203 if enabled vsx; then
6204 check_cflags -mvsx &&
6205 check_cc vsx altivec.h "int v[4] = { 0 };
6206 vector signed int v1 = vec_vsx_ld(0, v);"
6209 if enabled power8; then
6210 check_cpp_condition power8 "altivec.h" "defined(_ARCH_PWR8)"
6213 elif enabled riscv; then
6215 enabled rvv && check_inline_asm rvv '".option arch, +v\nvsetivli zero, 0, e8, m1, ta, ma"'
6217 elif enabled x86; then
6219 check_builtin rdtsc intrin.h "__rdtsc()"
6220 check_builtin mm_empty mmintrin.h "_mm_empty()"
6222 enable local_aligned
6224 # check whether EBP is available on x86
6225 # As 'i' is stored on the stack, this program will crash
6226 # if the base pointer is used to access it because the
6227 # base pointer is cleared in the inline assembly code.
6228 check_exec_crash <<EOF && enable ebp_available
6230 __asm__ volatile ("xorl %%ebp, %%ebp" ::: "%ebp");
6234 # check whether EBX is available on x86
6235 check_inline_asm ebx_available '""::"b"(0)' &&
6236 check_inline_asm ebx_available '"":::"%ebx"'
6238 # check whether xmm clobbers are supported
6239 check_inline_asm xmm_clobbers '"":::"%xmm0"'
6241 check_inline_asm inline_asm_direct_symbol_refs '"movl '$extern_prefix'test, %eax"' ||
6242 check_inline_asm inline_asm_direct_symbol_refs '"movl '$extern_prefix'test(%rip), %eax"'
6244 # check whether binutils is new enough to compile SSSE3/MMXEXT
6245 enabled ssse3 && check_inline_asm ssse3_inline '"pabsw %xmm0, %xmm0"'
6246 enabled mmxext && check_inline_asm mmxext_inline '"pmaxub %mm0, %mm1"'
6250 if test_cmd $x86asmexe_probe -v; then
6251 x86asmexe=$x86asmexe_probe
6253 x86asm_debug="-g -F dwarf"
6255 X86ASM_DEPFLAGS='-MD $(@:.o=.d)'
6256 elif test_cmd $x86asmexe_probe --version; then
6257 x86asmexe=$x86asmexe_probe
6259 x86asm_debug="-g dwarf2"
6260 X86ASMDEP='$(DEPX86ASM) $(X86ASMFLAGS) -M $(X86ASM_O) $< > $(@:.o=.d)'
6263 check_x86asm x86asm "movbe ecx, [5]"
6266 if ! disabled_any asm mmx x86asm; then
6268 for program in $x86asmexe nasm yasm; do
6269 probe_x86asm $program && break
6271 disabled x86asm && die "nasm/yasm not found or too old. Use --disable-x86asm for a crippled build."
6272 X86ASMFLAGS="-f $objformat"
6273 enabled pic && append X86ASMFLAGS "-DPIC"
6274 test -n "$extern_prefix" && append X86ASMFLAGS "-DPREFIX"
6275 case "$objformat" in
6276 elf*) enabled debug && append X86ASMFLAGS $x86asm_debug ;;
6279 enabled avx512 && check_x86asm avx512_external "vmovdqa32 [eax]{k1}{z}, zmm0"
6280 enabled avx512icl && check_x86asm avx512icl_external "vpdpwssds zmm31{k1}{z}, zmm29, zmm28"
6281 enabled avx2 && check_x86asm avx2_external "vextracti128 xmm0, ymm0, 0"
6282 enabled xop && check_x86asm xop_external "vpmacsdd xmm0, xmm1, xmm2, xmm3"
6283 enabled fma4 && check_x86asm fma4_external "vfmaddps ymm0, ymm1, ymm2, ymm3"
6284 check_x86asm cpunop "CPU amdnop"
6288 athlon*|opteron*|k8*|pentium|pentium-mmx|prescott|nocona|atom|geode)
6293 elif enabled loongarch; then
6294 enabled lsx && check_inline_asm lsx '"vadd.b $vr0, $vr1, $vr2"' '-mlsx' && append LSXFLAGS '-mlsx'
6295 enabled lasx && check_inline_asm lasx '"xvadd.b $xr0, $xr1, $xr2"' '-mlasx' && append LASXFLAGS '-mlasx'
6298 check_cc intrinsics_neon arm_neon.h "int16x8_t test = vdupq_n_s16(0)"
6300 check_ldflags -Wl,--as-needed
6301 check_ldflags -Wl,-z,noexecstack
6303 if ! disabled network; then
6304 check_func getaddrinfo $network_extralibs
6305 check_func inet_aton $network_extralibs
6307 check_type netdb.h "struct addrinfo"
6308 check_type netinet/in.h "struct group_source_req" -D_BSD_SOURCE
6309 check_type netinet/in.h "struct ip_mreq_source" -D_BSD_SOURCE
6310 check_type netinet/in.h "struct ipv6_mreq" -D_DARWIN_C_SOURCE
6311 check_type poll.h "struct pollfd"
6312 check_type netinet/sctp.h "struct sctp_event_subscribe"
6313 check_struct "sys/socket.h" "struct msghdr" msg_flags
6314 check_struct "sys/types.h sys/socket.h" "struct sockaddr" sa_len
6315 check_type netinet/in.h "struct sockaddr_in6"
6316 check_type "sys/types.h sys/socket.h" "struct sockaddr_storage"
6317 check_type "sys/types.h sys/socket.h" socklen_t
6319 # Prefer arpa/inet.h over winsock2
6320 if check_headers arpa/inet.h ; then
6321 check_func closesocket
6322 elif check_headers winsock2.h ; then
6323 check_func_headers winsock2.h closesocket -lws2 &&
6324 network_extralibs="-lws2" ||
6325 { check_func_headers winsock2.h closesocket -lws2_32 &&
6326 network_extralibs="-lws2_32"; } || disable winsock2_h network
6327 check_func_headers ws2tcpip.h getaddrinfo $network_extralibs
6329 check_type ws2tcpip.h socklen_t
6330 check_type ws2tcpip.h "struct addrinfo"
6331 check_type ws2tcpip.h "struct group_source_req"
6332 check_type ws2tcpip.h "struct ip_mreq_source"
6333 check_type ws2tcpip.h "struct ipv6_mreq"
6334 check_type winsock2.h "struct pollfd"
6335 check_struct winsock2.h "struct sockaddr" sa_len
6336 check_type ws2tcpip.h "struct sockaddr_in6"
6337 check_type ws2tcpip.h "struct sockaddr_storage"
6343 check_builtin atomic_cas_ptr atomic.h "void **ptr; void *oldval, *newval; atomic_cas_ptr(ptr, oldval, newval)"
6344 check_builtin machine_rw_barrier mbarrier.h "__machine_rw_barrier()"
6345 check_builtin MemoryBarrier windows.h "MemoryBarrier()"
6346 check_builtin sync_val_compare_and_swap "" "int *ptr; int oldval, newval; __sync_val_compare_and_swap(ptr, oldval, newval)"
6347 check_builtin gmtime_r time.h "time_t *time; struct tm *tm; gmtime_r(time, tm)"
6348 check_builtin localtime_r time.h "time_t *time; struct tm *tm; localtime_r(time, tm)"
6350 check_builtin float16 "" "_Float16 f16var"
6351 if enabled float16; then
6352 if enabled x86; then
6353 test_cpp_condition stddef.h "defined(__F16C__)" && enable fast_float16
6354 elif enabled arm || enabled aarch64; then
6359 case "$custom_allocator" in
6363 test -n "$malloc_prefix" ||
6364 malloc_prefix=$($pkg_config --variable=jemalloc_prefix $pkg_config_flags jemalloc 2>/dev/null)
6365 require_pkg_config custom_allocator jemalloc jemalloc/jemalloc.h ${malloc_prefix}malloc
6368 require_pkg_config custom_allocator libtcmalloc gperftools/tcmalloc.h tc_malloc
6372 require_pkg_config custom_allocator "$custom_allocator" stdlib.h malloc
6376 if test -n "$custom_allocator"; then
6377 add_extralibs "$custom_allocator_extralibs"
6380 check_func_headers malloc.h _aligned_malloc && enable aligned_malloc
6381 check_func ${malloc_prefix}memalign && enable memalign
6382 check_func ${malloc_prefix}posix_memalign && enable posix_memalign
6385 check_func_headers stdlib.h arc4random_buf
6386 check_lib clock_gettime time.h clock_gettime || check_lib clock_gettime time.h clock_gettime -lrt
6389 check_func gethrtime
6391 check_func getrusage
6392 check_func gettimeofday
6397 # Solaris has nanosleep in -lrt, OpenSolaris no longer needs that
6398 check_func_headers time.h nanosleep || check_lib nanosleep time.h nanosleep -lrt
6399 check_func_headers sys/prctl.h prctl
6400 check_func sched_getaffinity
6401 check_func setrlimit
6402 check_struct "sys/stat.h" "struct stat" st_mtim.tv_nsec -D_BSD_SOURCE
6403 check_func strerror_r
6408 check_func_headers conio.h kbhit
6409 check_func_headers io.h setmode
6410 check_func_headers lzo/lzo1x.h lzo1x_999_compress
6411 check_func_headers mach/mach_time.h mach_absolute_time
6412 check_func_headers stdlib.h getenv
6413 check_func_headers sys/stat.h lstat
6414 check_func_headers sys/auxv.h getauxval
6415 check_func_headers sys/sysctl.h sysctlbyname
6417 check_func_headers windows.h GetModuleHandle
6418 check_func_headers windows.h GetProcessAffinityMask
6419 check_func_headers windows.h GetProcessTimes
6420 check_func_headers windows.h GetStdHandle
6421 check_func_headers windows.h GetSystemTimeAsFileTime
6422 check_func_headers windows.h LoadLibrary
6423 check_func_headers windows.h MapViewOfFile
6424 check_func_headers windows.h PeekNamedPipe
6425 check_func_headers windows.h SetConsoleTextAttribute
6426 check_func_headers windows.h SetConsoleCtrlHandler
6427 check_func_headers windows.h SetDllDirectory
6428 check_func_headers windows.h Sleep
6429 check_func_headers windows.h VirtualAlloc
6430 check_func_headers glob.h glob
6432 if enabled xlib; then
6433 check_pkg_config xlib_x11 x11 "X11/Xlib.h" XPending ||
6434 check_lib xlib_x11 "X11/Xlib.h" XPending -lX11 ||
6437 check_pkg_config xlib_xext xext "X11/Xlib.h X11/extensions/XShm.h" XShmAttach ||
6438 check_lib xlib_xext "X11/Xlib.h X11/extensions/XShm.h" XShmAttach -lXext ||
6441 check_pkg_config xlib_xv xv "X11/Xlib.h X11/extensions/Xvlib.h" XvGetPortAttribute ||
6442 check_lib xlib_xv "X11/Xlib.h X11/extensions/Xvlib.h" XvGetPortAttribute -lXv ||
6446 check_headers direct.h
6447 check_headers dirent.h
6448 check_headers dxgidebug.h
6449 check_headers dxva.h
6450 check_headers dxva2api.h -D_WIN32_WINNT=0x0600
6453 check_headers linux/dma-buf.h
6455 check_headers linux/perf_event.h
6456 check_headers libcrystalhd/libcrystalhd_if.h
6457 check_headers malloc.h
6458 check_headers mftransform.h
6459 check_headers net/udplite.h
6460 check_headers poll.h
6461 check_headers sys/param.h
6462 check_headers sys/resource.h
6463 check_headers sys/select.h
6464 check_headers sys/time.h
6465 check_headers sys/un.h
6466 check_headers termios.h
6467 check_headers unistd.h
6468 check_headers valgrind/valgrind.h
6469 check_func_headers VideoToolbox/VTCompressionSession.h VTCompressionSessionPrepareToEncodeFrames -framework VideoToolbox
6470 check_func_headers VideoToolbox/VideoToolbox.h VTPixelRotationSessionCreate -framework VideoToolbox
6471 check_headers windows.h
6472 check_headers asm/types.h
6474 # it seems there are versions of clang in some distros that try to use the
6475 # gcc headers, which explodes for stdatomic
6476 # so we also check that atomics actually work here
6478 # some configurations also require linking to libatomic, so try
6479 # both with -latomic and without
6480 for LATOMIC in "-latomic" ""; do
6481 check_builtin stdatomic stdatomic.h \
6482 "atomic_int foo, bar = ATOMIC_VAR_INIT(-1); atomic_store(&foo, 0); foo += bar" \
6483 $LATOMIC && eval stdatomic_extralibs="\$LATOMIC" && break
6486 check_lib advapi32 "windows.h" RegCloseKey -ladvapi32
6487 check_lib bcrypt "windows.h bcrypt.h" BCryptGenRandom -lbcrypt &&
6488 check_cpp_condition bcrypt bcrypt.h "defined BCRYPT_RNG_ALGORITHM"
6489 check_lib ole32 "windows.h objbase.h" CoTaskMemFree -lole32
6490 check_lib shell32 "windows.h shellapi.h" CommandLineToArgvW -lshell32
6491 check_lib psapi "windows.h psapi.h" GetProcessMemoryInfo -lpsapi
6493 check_lib android android/native_window.h ANativeWindow_acquire -landroid
6494 check_lib mediandk "stdint.h media/NdkImage.h" AImage_delete -lmediandk
6495 check_lib camera2ndk "stdbool.h stdint.h camera/NdkCameraManager.h" ACameraManager_create -lcamera2ndk
6497 enabled appkit && check_apple_framework AppKit
6498 enabled audiotoolbox && check_apple_framework AudioToolbox
6499 enabled avfoundation && check_apple_framework AVFoundation
6500 enabled coreimage && check_apple_framework CoreImage
6501 enabled metal && check_apple_framework Metal
6502 enabled videotoolbox && check_apple_framework VideoToolbox
6504 check_apple_framework CoreFoundation
6505 check_apple_framework CoreMedia
6506 check_apple_framework CoreVideo
6507 check_apple_framework CoreAudio
6509 enabled avfoundation && {
6510 disable coregraphics applicationservices
6511 check_lib coregraphics CoreGraphics/CoreGraphics.h CGGetActiveDisplayList "-framework CoreGraphics" ||
6512 check_lib applicationservices ApplicationServices/ApplicationServices.h CGGetActiveDisplayList "-framework ApplicationServices"; }
6514 enabled videotoolbox && {
6515 check_lib coreservices CoreServices/CoreServices.h UTGetOSTypeFromString "-framework CoreServices"
6516 check_func_headers CoreMedia/CMFormatDescription.h kCMVideoCodecType_HEVC "-framework CoreMedia"
6517 check_func_headers CoreMedia/CMFormatDescription.h kCMVideoCodecType_HEVCWithAlpha "-framework CoreMedia"
6518 check_func_headers CoreMedia/CMFormatDescription.h kCMVideoCodecType_VP9 "-framework CoreMedia"
6519 check_func_headers CoreVideo/CVPixelBuffer.h kCVPixelFormatType_420YpCbCr10BiPlanarVideoRange "-framework CoreVideo"
6520 check_func_headers CoreVideo/CVPixelBuffer.h kCVPixelFormatType_422YpCbCr8BiPlanarVideoRange "-framework CoreVideo"
6521 check_func_headers CoreVideo/CVPixelBuffer.h kCVPixelFormatType_422YpCbCr10BiPlanarVideoRange "-framework CoreVideo"
6522 check_func_headers CoreVideo/CVPixelBuffer.h kCVPixelFormatType_422YpCbCr16BiPlanarVideoRange "-framework CoreVideo"
6523 check_func_headers CoreVideo/CVPixelBuffer.h kCVPixelFormatType_444YpCbCr8BiPlanarVideoRange "-framework CoreVideo"
6524 check_func_headers CoreVideo/CVPixelBuffer.h kCVPixelFormatType_444YpCbCr10BiPlanarVideoRange "-framework CoreVideo"
6525 check_func_headers CoreVideo/CVPixelBuffer.h kCVPixelFormatType_444YpCbCr16BiPlanarVideoRange "-framework CoreVideo"
6526 check_func_headers CoreVideo/CVImageBuffer.h kCVImageBufferTransferFunction_SMPTE_ST_2084_PQ "-framework CoreVideo"
6527 check_func_headers CoreVideo/CVImageBuffer.h kCVImageBufferTransferFunction_ITU_R_2100_HLG "-framework CoreVideo"
6528 check_func_headers CoreVideo/CVImageBuffer.h kCVImageBufferTransferFunction_Linear "-framework CoreVideo"
6529 check_func_headers CoreVideo/CVImageBuffer.h kCVImageBufferYCbCrMatrix_ITU_R_2020 "-framework CoreVideo"
6530 check_func_headers CoreVideo/CVImageBuffer.h kCVImageBufferColorPrimaries_ITU_R_2020 "-framework CoreVideo"
6531 check_func_headers CoreVideo/CVImageBuffer.h kCVImageBufferTransferFunction_ITU_R_2020 "-framework CoreVideo"
6532 check_func_headers CoreVideo/CVImageBuffer.h kCVImageBufferTransferFunction_SMPTE_ST_428_1 "-framework CoreVideo"
6535 enabled metal && test_cmd $metalcc -v || disable metal
6537 check_struct "sys/time.h sys/resource.h" "struct rusage" ru_maxrss
6539 check_type "windows.h dxva.h" "DXVA_PicParams_AV1" -DWINAPI_FAMILY=WINAPI_FAMILY_DESKTOP_APP -D_CRT_BUILD_DESKTOP_APP=0
6540 check_type "windows.h dxva.h" "DXVA_PicParams_HEVC" -DWINAPI_FAMILY=WINAPI_FAMILY_DESKTOP_APP -D_CRT_BUILD_DESKTOP_APP=0
6541 check_type "windows.h dxva.h" "DXVA_PicParams_VP9" -DWINAPI_FAMILY=WINAPI_FAMILY_DESKTOP_APP -D_CRT_BUILD_DESKTOP_APP=0
6542 check_type "windows.h dxgi1_2.h" "DXGI_OUTDUPL_FRAME_INFO"
6543 check_type "windows.h dxgi1_2.h" "IDXGIOutput1"
6544 check_type "windows.h dxgi1_5.h" "IDXGIOutput5"
6545 check_type "windows.h d3d11.h" "ID3D11VideoDecoder"
6546 check_type "windows.h d3d11.h" "ID3D11VideoContext"
6547 check_type "windows.h" "DPI_AWARENESS_CONTEXT" -D_WIN32_WINNT=0x0A00
6548 check_type "d3d9.h dxva2api.h" DXVA2_ConfigPictureDecode -D_WIN32_WINNT=0x0602
6549 check_func_headers mfapi.h MFCreateAlignedMemoryBuffer -lmfplat
6551 check_type "vdpau/vdpau.h" "VdpPictureInfoHEVC"
6552 check_type "vdpau/vdpau.h" "VdpPictureInfoVP9"
6553 check_type "vdpau/vdpau.h" "VdpPictureInfoAV1"
6555 if [ -z "$nvccflags" ]; then
6556 nvccflags=$nvccflags_default
6559 nvccflags="$nvccflags -std=c++11"
6561 if enabled x86_64 || enabled ppc64 || enabled aarch64; then
6562 nvccflags="$nvccflags -m64"
6564 nvccflags="$nvccflags -m32"
6567 if enabled cuda_nvcc; then
6568 nvccflags="$nvccflags -ptx"
6570 nvccflags="$nvccflags -S -nocudalib -nocudainc --cuda-device-only -Wno-c++11-narrowing -include ${source_link}/compat/cuda/cuda_runtime.h"
6571 check_nvcc cuda_llvm
6574 if ! disabled ffnvcodec; then
6575 ffnv_hdr_list="ffnvcodec/nvEncodeAPI.h ffnvcodec/dynlink_cuda.h ffnvcodec/dynlink_cuviddec.h ffnvcodec/dynlink_nvcuvid.h"
6576 check_pkg_config ffnvcodec "ffnvcodec >= 12.1.14.0" "$ffnv_hdr_list" "" || \
6577 check_pkg_config ffnvcodec "ffnvcodec >= 12.0.16.1 ffnvcodec < 12.1" "$ffnv_hdr_list" "" || \
6578 check_pkg_config ffnvcodec "ffnvcodec >= 11.1.5.3 ffnvcodec < 12.0" "$ffnv_hdr_list" "" || \
6579 check_pkg_config ffnvcodec "ffnvcodec >= 11.0.10.3 ffnvcodec < 11.1" "$ffnv_hdr_list" "" || \
6580 check_pkg_config ffnvcodec "ffnvcodec >= 8.1.24.15 ffnvcodec < 8.2" "$ffnv_hdr_list" ""
6583 if enabled_all libglslang libshaderc; then
6584 die "ERROR: libshaderc and libglslang are mutually exclusive, if in doubt, disable libglslang"
6587 check_cpp_condition winrt windows.h "!WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)"
6589 if ! disabled w32threads && ! enabled pthreads; then
6590 check_func_headers "windows.h process.h" _beginthreadex &&
6591 check_type "windows.h" CONDITION_VARIABLE &&
6592 check_type "windows.h" INIT_ONCE &&
6593 enable w32threads || disable w32threads
6594 if ! enabled w32threads && enabled winrt; then
6595 check_func_headers "windows.h" CreateThread &&
6596 enable w32threads || disable w32threads
6600 # check for some common methods of building with pthread support
6601 # do this before the optional library checks as some of them require pthreads
6602 if ! disabled pthreads && ! enabled w32threads && ! enabled os2threads; then
6603 if check_lib pthreads pthread.h pthread_join -pthread &&
6604 check_lib pthreads pthread.h pthread_create -pthread; then
6606 elif check_lib pthreads pthread.h pthread_join -pthreads &&
6607 check_lib pthreads pthread.h pthread_create -pthreads; then
6608 add_cflags -pthreads
6609 elif check_lib pthreads pthread.h pthread_join -ldl -pthread &&
6610 check_lib pthreads pthread.h pthread_create -ldl -pthread; then
6611 add_cflags -ldl -pthread
6612 elif check_lib pthreads pthread.h pthread_join -lpthreadGC2 &&
6613 check_lib pthreads pthread.h pthread_create -lpthreadGC2; then
6615 elif check_lib pthreads pthread.h pthread_join -lpthread &&
6616 check_lib pthreads pthread.h pthread_create -lpthread; then
6618 elif check_func pthread_join && check_func pthread_create; then
6621 check_cc pthreads "pthread.h" "static pthread_mutex_t atomic_lock = PTHREAD_MUTEX_INITIALIZER"
6623 if enabled pthreads; then
6624 check_builtin sem_timedwait semaphore.h "sem_t *s; sem_init(s,0,0); sem_timedwait(s,0); sem_destroy(s)" $pthreads_extralibs
6625 check_func pthread_cancel $pthreads_extralibs
6629 enabled zlib && { check_pkg_config zlib zlib "zlib.h" zlibVersion ||
6630 check_lib zlib zlib.h zlibVersion -lz; }
6631 enabled bzlib && check_lib bzlib bzlib.h BZ2_bzlibVersion -lbz2
6632 enabled lzma && check_lib lzma lzma.h lzma_version_number -llzma
6634 enabled zlib && test_exec $zlib_extralibs <<EOF && enable zlib_gzip
6637 if (zlibCompileFlags() & (1 << 17)) return 1;
6642 [ -x "$(command -v gzip)" ] && enable gzip
6644 enabled zlib_gzip && enabled gzip || disable ptx_compression
6646 # On some systems dynamic loading requires no extra linker flags
6647 check_lib libdl dlfcn.h "dlopen dlsym" || check_lib libdl dlfcn.h "dlopen dlsym" -ldl
6649 check_lib libm math.h sin -lm
6657 for func in $MATH_FUNCS; do
6658 eval check_mathfunc $func \${${func}_args:-1} $libm_extralibs
6661 # these are off by default, so fail if requested and not available
6662 enabled avisynth && { require_headers "avisynth/avisynth_c.h avisynth/avs/version.h" &&
6663 { test_cpp_condition avisynth/avs/version.h "AVS_MAJOR_VER >= 3 && AVS_MINOR_VER >= 7 && AVS_BUGFIX_VER >= 3 || AVS_MAJOR_VER >= 3 && AVS_MINOR_VER > 7 || AVS_MAJOR_VER > 3" ||
6664 die "ERROR: AviSynth+ header version must be >= 3.7.3"; } }
6665 enabled cuda_nvcc && { check_nvcc cuda_nvcc || die "ERROR: failed checking for nvcc."; }
6666 enabled chromaprint && { check_pkg_config chromaprint libchromaprint "chromaprint.h" chromaprint_get_version ||
6667 require chromaprint chromaprint.h chromaprint_get_version -lchromaprint; }
6668 enabled decklink && { require_headers DeckLinkAPI.h &&
6669 { test_cpp_condition DeckLinkAPIVersion.h "BLACKMAGIC_DECKLINK_API_VERSION >= 0x0a0b0000" || die "ERROR: Decklink API version must be >= 10.11"; } }
6670 enabled frei0r && require_headers "frei0r.h"
6671 enabled gmp && require gmp gmp.h mpz_export -lgmp
6672 enabled gnutls && require_pkg_config gnutls gnutls gnutls/gnutls.h gnutls_global_init
6673 enabled jni && { [ $target_os = "android" ] && check_headers jni.h && enabled pthreads || die "ERROR: jni not found"; }
6674 enabled ladspa && require_headers "ladspa.h dlfcn.h"
6675 enabled lcms2 && require_pkg_config lcms2 "lcms2 >= 2.13" lcms2.h cmsCreateContext
6676 enabled libaom && require_pkg_config libaom "aom >= 1.0.0" aom/aom_codec.h aom_codec_version
6677 enabled libaribb24 && { check_pkg_config libaribb24 "aribb24 > 1.0.3" "aribb24/aribb24.h" arib_instance_new ||
6678 { enabled gpl && require_pkg_config libaribb24 aribb24 "aribb24/aribb24.h" arib_instance_new; } ||
6679 die "ERROR: libaribb24 requires version higher than 1.0.3 or --enable-gpl."; }
6680 enabled libaribcaption && require_pkg_config libaribcaption "libaribcaption >= 1.1.1" "aribcaption/aribcaption.h" aribcc_context_alloc
6681 enabled lv2 && require_pkg_config lv2 lilv-0 "lilv/lilv.h" lilv_world_new
6682 enabled libiec61883 && require libiec61883 libiec61883/iec61883.h iec61883_cmp_connect -lraw1394 -lavc1394 -lrom1394 -liec61883
6683 enabled libass && require_pkg_config libass "libass >= 0.11.0" ass/ass.h ass_library_init
6684 enabled libbluray && require_pkg_config libbluray libbluray libbluray/bluray.h bd_open
6685 enabled libbs2b && require_pkg_config libbs2b libbs2b bs2b.h bs2b_open
6686 enabled libcelt && require libcelt celt/celt.h celt_decode -lcelt0 &&
6687 { check_lib libcelt celt/celt.h celt_decoder_create_custom -lcelt0 ||
6688 die "ERROR: libcelt must be installed and version must be >= 0.11.0."; }
6689 enabled libcaca && require_pkg_config libcaca caca caca.h caca_create_canvas
6690 enabled libcodec2 && require libcodec2 codec2/codec2.h codec2_create -lcodec2
6691 enabled libdav1d && require_pkg_config libdav1d "dav1d >= 0.5.0" "dav1d/dav1d.h" dav1d_version
6692 enabled libdavs2 && require_pkg_config libdavs2 "davs2 >= 1.6.0" davs2.h davs2_decoder_open
6693 enabled libdc1394 && require_pkg_config libdc1394 libdc1394-2 dc1394/dc1394.h dc1394_new
6694 enabled libdrm && require_pkg_config libdrm libdrm xf86drm.h drmGetVersion
6695 enabled libfdk_aac && { check_pkg_config libfdk_aac fdk-aac "fdk-aac/aacenc_lib.h" aacEncOpen ||
6696 { require libfdk_aac fdk-aac/aacenc_lib.h aacEncOpen -lfdk-aac &&
6697 warn "using libfdk without pkg-config"; } }
6698 flite_extralibs="-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"
6699 enabled libflite && require libflite "flite/flite.h" flite_init $flite_extralibs
6700 enabled fontconfig && enable libfontconfig
6701 enabled libfontconfig && require_pkg_config libfontconfig fontconfig "fontconfig/fontconfig.h" FcInit
6702 enabled libfreetype && require_pkg_config libfreetype freetype2 "ft2build.h FT_FREETYPE_H" FT_Init_FreeType
6703 enabled libfribidi && require_pkg_config libfribidi fribidi fribidi.h fribidi_version_info
6704 enabled libharfbuzz && require_pkg_config libharfbuzz harfbuzz hb.h hb_buffer_create
6705 enabled libglslang && { check_lib spirv_compiler glslang/Include/glslang_c_interface.h glslang_initialize_process \
6706 -lglslang -lMachineIndependent -lOSDependent -lHLSL -lOGLCompiler -lGenericCodeGen \
6707 -lSPVRemapper -lSPIRV -lSPIRV-Tools-opt -lSPIRV-Tools -lpthread -lstdc++ -lm ||
6708 require spirv_compiler glslang/Include/glslang_c_interface.h glslang_initialize_process \
6709 -lglslang -lOSDependent -lHLSL -lOGLCompiler \
6710 -lSPVRemapper -lSPIRV -lSPIRV-Tools-opt -lSPIRV-Tools -lpthread -lstdc++ -lm; }
6711 enabled libgme && { check_pkg_config libgme libgme gme/gme.h gme_new_emu ||
6712 require libgme gme/gme.h gme_new_emu -lgme -lstdc++; }
6713 enabled libgsm && { for gsm_hdr in "gsm.h" "gsm/gsm.h"; do
6714 check_lib libgsm "${gsm_hdr}" gsm_create -lgsm && break;
6715 done || die "ERROR: libgsm not found"; }
6716 enabled libilbc && require libilbc ilbc.h WebRtcIlbcfix_InitDecode -lilbc $pthreads_extralibs
6717 enabled libjxl && require_pkg_config libjxl "libjxl >= 0.7.0" jxl/decode.h JxlDecoderVersion &&
6718 require_pkg_config libjxl_threads "libjxl_threads >= 0.7.0" jxl/thread_parallel_runner.h JxlThreadParallelRunner
6719 enabled libklvanc && require libklvanc libklvanc/vanc.h klvanc_context_create -lklvanc
6720 enabled libkvazaar && require_pkg_config libkvazaar "kvazaar >= 2.0.0" kvazaar.h kvz_api_get
6721 enabled liblensfun && require_pkg_config liblensfun lensfun lensfun.h lf_db_new
6723 if enabled libmfx && enabled libvpl; then
6724 die "ERROR: can not use libmfx and libvpl together"
6725 # While it may appear that require is being used as a pkg-config
6726 # fallback for libmfx, it is actually being used to detect a different
6727 # installation route altogether. If libmfx is installed via the Intel
6728 # Media SDK or Intel Media Server Studio, these don't come with
6729 # pkg-config support. Instead, users should make sure that the build
6730 # can find the libraries and headers through other means.
6731 elif enabled libmfx; then
6732 { check_pkg_config libmfx "libmfx >= 1.28 libmfx < 2.0" "mfxvideo.h" MFXInit ||
6733 # Some old versions of libmfx have the following settings in libmfx.pc:
6734 # includedir=/usr/include
6735 # Cflags: -I${includedir}
6736 # So add -I${includedir}/mfx to CFLAGS
6737 { check_pkg_config libmfx "libmfx >= 1.28 libmfx < 2.0" "mfx/mfxvideo.h" MFXInit && add_cflags -I${libmfx_incdir}/mfx; } ||
6738 { require libmfx "mfxvideo.h mfxdefs.h" MFXInit "-llibmfx $advapi32_extralibs" &&
6739 { test_cpp_condition mfxdefs.h "MFX_VERSION >= 1028 && MFX_VERSION < 2000" || die "ERROR: libmfx version must be >= 1.28 and < 2.0"; } &&
6740 warn "using libmfx without pkg-config"; } } &&
6741 warn "libmfx is deprecated. Please run configure with --enable-libvpl to use libvpl instead."
6742 elif enabled libvpl; then
6743 # Consider pkg-config only. The name of libmfx is still passed to check_pkg_config function for --enable-libvpl option
6744 # because QSV has dependency on libmfx, we can use the same dependency if using libmfx in this check. The package name
6745 # is extracted from "vpl >= 2.6"
6746 check_pkg_config libmfx "vpl >= 2.6" "mfxvideo.h mfxdispatcher.h" MFXLoad || \
6747 die "ERROR: libvpl >= 2.6 not found"
6750 if enabled libmfx; then
6751 check_cc MFX_CODEC_VP9 "mfxdefs.h mfxstructures.h" "MFX_CODEC_VP9"
6754 enabled libmodplug && require_pkg_config libmodplug libmodplug libmodplug/modplug.h ModPlug_Load
6755 enabled libmp3lame && require "libmp3lame >= 3.98.3" lame/lame.h lame_set_VBR_quality -lmp3lame $libm_extralibs
6756 enabled libmysofa && { check_pkg_config libmysofa libmysofa mysofa.h mysofa_neighborhood_init_withstepdefine ||
6757 require libmysofa mysofa.h mysofa_neighborhood_init_withstepdefine -lmysofa $zlib_extralibs; }
6758 enabled libnpp && { check_lib libnpp npp.h nppGetLibVersion -lnppig -lnppicc -lnppc -lnppidei -lnppif ||
6759 check_lib libnpp npp.h nppGetLibVersion -lnppi -lnppif -lnppc -lnppidei ||
6760 die "ERROR: libnpp not found"; }
6761 enabled libopencore_amrnb && require libopencore_amrnb opencore-amrnb/interf_dec.h Decoder_Interface_init -lopencore-amrnb
6762 enabled libopencore_amrwb && require libopencore_amrwb opencore-amrwb/dec_if.h D_IF_init -lopencore-amrwb
6763 enabled libopencv && { check_headers opencv2/core/core_c.h &&
6764 { check_pkg_config libopencv opencv opencv2/core/core_c.h cvCreateImageHeader ||
6765 require libopencv opencv2/core/core_c.h cvCreateImageHeader -lopencv_core -lopencv_imgproc; } ||
6766 require_pkg_config libopencv opencv opencv/cxcore.h cvCreateImageHeader; }
6767 enabled libopenh264 && require_pkg_config libopenh264 openh264 wels/codec_api.h WelsGetCodecVersion
6768 enabled libopenjpeg && { check_pkg_config libopenjpeg "libopenjp2 >= 2.1.0" openjpeg.h opj_version ||
6769 { require_pkg_config libopenjpeg "libopenjp2 >= 2.1.0" openjpeg.h opj_version -DOPJ_STATIC && add_cppflags -DOPJ_STATIC; } }
6770 enabled libopenmpt && require_pkg_config libopenmpt "libopenmpt >= 0.2.6557" libopenmpt/libopenmpt.h openmpt_module_create -lstdc++ && append libopenmpt_extralibs "-lstdc++"
6771 enabled libopenvino && { { check_pkg_config libopenvino openvino openvino/c/openvino.h ov_core_create && enable openvino2; } ||
6772 { check_pkg_config libopenvino openvino c_api/ie_c_api.h ie_c_api_version ||
6773 require libopenvino c_api/ie_c_api.h ie_c_api_version -linference_engine_c_api; } }
6774 enabled libopus && {
6775 enabled libopus_decoder && {
6776 require_pkg_config libopus opus opus_multistream.h opus_multistream_decoder_create
6778 enabled libopus_encoder && {
6779 require_pkg_config libopus opus opus_multistream.h opus_multistream_surround_encoder_create
6782 enabled libplacebo && require_pkg_config libplacebo "libplacebo >= 4.192.0" libplacebo/vulkan.h pl_vulkan_create
6783 enabled libpulse && require_pkg_config libpulse libpulse pulse/pulseaudio.h pa_context_new
6784 enabled librabbitmq && require_pkg_config librabbitmq "librabbitmq >= 0.7.1" amqp.h amqp_new_connection
6785 enabled librav1e && require_pkg_config librav1e "rav1e >= 0.5.0" rav1e.h rav1e_context_new
6786 enabled librist && require_pkg_config librist "librist >= 0.2.7" librist/librist.h rist_receiver_create
6787 enabled librsvg && require_pkg_config librsvg librsvg-2.0 librsvg-2.0/librsvg/rsvg.h rsvg_handle_new_from_data
6788 enabled librtmp && require_pkg_config librtmp librtmp librtmp/rtmp.h RTMP_Socket
6789 enabled librubberband && require_pkg_config librubberband "rubberband >= 1.8.1" rubberband/rubberband-c.h rubberband_new -lstdc++ && append librubberband_extralibs "-lstdc++"
6790 enabled libshaderc && require_pkg_config spirv_compiler "shaderc >= 2019.1" shaderc/shaderc.h shaderc_compiler_initialize
6791 enabled libshine && require_pkg_config libshine shine shine/layer3.h shine_encode_buffer
6792 enabled libsmbclient && { check_pkg_config libsmbclient smbclient libsmbclient.h smbc_init ||
6793 require libsmbclient libsmbclient.h smbc_init -lsmbclient; }
6794 enabled libsnappy && require libsnappy snappy-c.h snappy_compress -lsnappy -lstdc++
6795 enabled libsoxr && require libsoxr soxr.h soxr_create -lsoxr
6796 enabled libssh && require_pkg_config libssh "libssh >= 0.6.0" libssh/sftp.h sftp_init
6797 enabled libspeex && require_pkg_config libspeex speex speex/speex.h speex_decoder_init
6798 enabled libsrt && require_pkg_config libsrt "srt >= 1.3.0" srt/srt.h srt_socket
6799 enabled libsvtav1 && require_pkg_config libsvtav1 "SvtAv1Enc >= 0.9.0" EbSvtAv1Enc.h svt_av1_enc_init_handle
6800 enabled libtensorflow && require libtensorflow tensorflow/c/c_api.h TF_Version -ltensorflow
6801 enabled libtesseract && require_pkg_config libtesseract tesseract tesseract/capi.h TessBaseAPICreate
6802 enabled libtheora && require libtheora theora/theoraenc.h th_info_init -ltheoraenc -ltheoradec -logg
6803 enabled libtls && require_pkg_config libtls libtls tls.h tls_configure
6804 enabled libtwolame && require libtwolame twolame.h twolame_init -ltwolame &&
6805 { check_lib libtwolame twolame.h twolame_encode_buffer_float32_interleaved -ltwolame ||
6806 die "ERROR: libtwolame must be installed and version must be >= 0.3.10"; }
6807 enabled libuavs3d && require_pkg_config libuavs3d "uavs3d >= 1.1.41" uavs3d.h uavs3d_decode
6808 enabled libv4l2 && require_pkg_config libv4l2 libv4l2 libv4l2.h v4l2_ioctl
6809 enabled libvidstab && require_pkg_config libvidstab "vidstab >= 0.98" vid.stab/libvidstab.h vsMotionDetectInit
6810 enabled libvmaf && require_pkg_config libvmaf "libvmaf >= 2.0.0" libvmaf.h vmaf_init
6811 enabled libvmaf && check_pkg_config libvmaf_cuda "libvmaf >= 2.0.0" libvmaf_cuda.h vmaf_cuda_state_init
6812 enabled libvo_amrwbenc && require libvo_amrwbenc vo-amrwbenc/enc_if.h E_IF_init -lvo-amrwbenc
6813 enabled libvorbis && require_pkg_config libvorbis vorbis vorbis/codec.h vorbis_info_init &&
6814 require_pkg_config libvorbisenc vorbisenc vorbis/vorbisenc.h vorbis_encode_init
6817 enabled libvpx_vp8_decoder && {
6818 check_pkg_config libvpx_vp8_decoder "vpx >= 1.4.0" "vpx/vpx_decoder.h vpx/vp8dx.h" vpx_codec_vp8_dx ||
6819 check_lib libvpx_vp8_decoder "vpx/vpx_decoder.h vpx/vp8dx.h" "vpx_codec_vp8_dx VPX_IMG_FMT_HIGHBITDEPTH" "-lvpx $libm_extralibs $pthreads_extralibs"
6821 enabled libvpx_vp8_encoder && {
6822 check_pkg_config libvpx_vp8_encoder "vpx >= 1.4.0" "vpx/vpx_encoder.h vpx/vp8cx.h" vpx_codec_vp8_cx ||
6823 check_lib libvpx_vp8_encoder "vpx/vpx_encoder.h vpx/vp8cx.h" "vpx_codec_vp8_cx VPX_IMG_FMT_HIGHBITDEPTH" "-lvpx $libm_extralibs $pthreads_extralibs"
6825 enabled libvpx_vp9_decoder && {
6826 check_pkg_config libvpx_vp9_decoder "vpx >= 1.4.0" "vpx/vpx_decoder.h vpx/vp8dx.h" vpx_codec_vp9_dx ||
6827 check_lib libvpx_vp9_decoder "vpx/vpx_decoder.h vpx/vp8dx.h" "vpx_codec_vp9_dx VPX_IMG_FMT_HIGHBITDEPTH" "-lvpx $libm_extralibs $pthreads_extralibs"
6829 enabled libvpx_vp9_encoder && {
6830 check_pkg_config libvpx_vp9_encoder "vpx >= 1.4.0" "vpx/vpx_encoder.h vpx/vp8cx.h" vpx_codec_vp9_cx ||
6831 check_lib libvpx_vp9_encoder "vpx/vpx_encoder.h vpx/vp8cx.h" "vpx_codec_vp9_cx VPX_IMG_FMT_HIGHBITDEPTH" "-lvpx $libm_extralibs $pthreads_extralibs"
6833 if disabled_all libvpx_vp8_decoder libvpx_vp9_decoder libvpx_vp8_encoder libvpx_vp9_encoder; then
6834 die "libvpx enabled but no supported decoders found"
6838 enabled libwebp && {
6839 enabled libwebp_encoder && require_pkg_config libwebp "libwebp >= 0.2.0" webp/encode.h WebPGetEncoderVersion
6840 enabled libwebp_anim_encoder && check_pkg_config libwebp_anim_encoder "libwebpmux >= 0.4.0" webp/mux.h WebPAnimEncoderOptionsInit; }
6841 enabled libx264 && require_pkg_config libx264 x264 "stdint.h x264.h" x264_encoder_encode &&
6842 require_cpp_condition libx264 x264.h "X264_BUILD >= 122" && {
6843 [ "$toolchain" != "msvc" ] ||
6844 require_cpp_condition libx264 x264.h "X264_BUILD >= 158"; } &&
6845 check_cpp_condition libx262 x264.h "X264_MPEG2"
6846 enabled libx265 && require_pkg_config libx265 x265 x265.h x265_api_get &&
6847 require_cpp_condition libx265 x265.h "X265_BUILD >= 89"
6848 enabled libxavs && require libxavs "stdint.h xavs.h" xavs_encoder_encode "-lxavs $pthreads_extralibs $libm_extralibs"
6849 enabled libxavs2 && require_pkg_config libxavs2 "xavs2 >= 1.3.0" "stdint.h xavs2.h" xavs2_api_get
6850 enabled libxvid && require libxvid xvid.h xvid_global -lxvidcore
6851 enabled libzimg && require_pkg_config libzimg "zimg >= 2.7.0" zimg.h zimg_get_api_version
6852 enabled libzmq && require_pkg_config libzmq "libzmq >= 4.2.1" zmq.h zmq_ctx_new
6853 enabled libzvbi && require_pkg_config libzvbi zvbi-0.2 libzvbi.h vbi_decoder_new &&
6854 { test_cpp_condition libzvbi.h "VBI_VERSION_MAJOR > 0 || VBI_VERSION_MINOR > 2 || VBI_VERSION_MINOR == 2 && VBI_VERSION_MICRO >= 28" ||
6855 enabled gpl || die "ERROR: libzvbi requires version 0.2.28 or --enable-gpl."; }
6856 enabled libxml2 && require_pkg_config libxml2 libxml-2.0 libxml2/libxml/xmlversion.h xmlCheckVersion
6857 enabled mbedtls && { check_pkg_config mbedtls mbedtls mbedtls/x509_crt.h mbedtls_x509_crt_init ||
6858 check_pkg_config mbedtls mbedtls mbedtls/ssl.h mbedtls_ssl_init ||
6859 check_lib mbedtls mbedtls/ssl.h mbedtls_ssl_init -lmbedtls -lmbedx509 -lmbedcrypto ||
6860 die "ERROR: mbedTLS not found"; }
6861 enabled mediacodec && { enabled jni || die "ERROR: mediacodec requires --enable-jni"; }
6862 enabled mmal && { check_lib mmal interface/mmal/mmal.h mmal_port_connect -lmmal_core -lmmal_util -lmmal_vc_client -lbcm_host ||
6863 { ! enabled cross_compile &&
6864 add_cflags -isystem/opt/vc/include/ -isystem/opt/vc/include/interface/vmcs_host/linux -isystem/opt/vc/include/interface/vcos/pthreads -fgnu89-inline &&
6865 add_ldflags -L/opt/vc/lib/ &&
6866 check_lib mmal interface/mmal/mmal.h mmal_port_connect -lmmal_core -lmmal_util -lmmal_vc_client -lbcm_host; } ||
6867 die "ERROR: mmal not found" &&
6868 check_func_headers interface/mmal/mmal.h "MMAL_PARAMETER_VIDEO_MAX_NUM_CALLBACKS"; }
6869 enabled openal && { check_pkg_config openal "openal >= 1.1" "AL/al.h" alGetError ||
6870 { for al_extralibs in "${OPENAL_LIBS}" "-lopenal" "-lOpenAL32"; do
6871 check_lib openal 'AL/al.h' alGetError "${al_extralibs}" && break; done } ||
6872 die "ERROR: openal not found"; } &&
6873 { test_cpp_condition "AL/al.h" "defined(AL_VERSION_1_1)" ||
6874 die "ERROR: openal must be installed and version must be 1.1 or compatible"; }
6875 enabled opencl && { check_pkg_config opencl OpenCL CL/cl.h clEnqueueNDRangeKernel ||
6876 check_lib opencl OpenCL/cl.h clEnqueueNDRangeKernel -Wl,-framework,OpenCL ||
6877 check_lib opencl CL/cl.h clEnqueueNDRangeKernel -lOpenCL ||
6878 die "ERROR: opencl not found"; } &&
6879 { test_cpp_condition "OpenCL/cl.h" "defined(CL_VERSION_1_2)" ||
6880 test_cpp_condition "CL/cl.h" "defined(CL_VERSION_1_2)" ||
6881 die "ERROR: opencl must be installed and version must be 1.2 or compatible"; }
6882 enabled opengl && { check_lib opengl GL/glx.h glXGetProcAddress "-lGL" ||
6883 check_lib opengl windows.h wglGetProcAddress "-lopengl32 -lgdi32" ||
6884 check_lib opengl OpenGL/gl3.h glGetError "-Wl,-framework,OpenGL" ||
6885 check_lib opengl ES2/gl.h glGetError "-isysroot=${sysroot} -Wl,-framework,OpenGLES" ||
6886 die "ERROR: opengl not found."
6888 enabled omx_rpi && { test_code cc OMX_Core.h OMX_IndexConfigBrcmVideoRequestIFrame ||
6889 { ! enabled cross_compile &&
6890 add_cflags -isystem/opt/vc/include/IL &&
6891 test_code cc OMX_Core.h OMX_IndexConfigBrcmVideoRequestIFrame; } ||
6892 die "ERROR: OpenMAX IL headers from raspberrypi/firmware not found"; } &&
6894 enabled omx && require_headers OMX_Core.h
6895 enabled openssl && { { check_pkg_config openssl "openssl >= 3.0.0" openssl/ssl.h OPENSSL_init_ssl &&
6896 { enabled gplv3 || ! enabled gpl || enabled nonfree || die "ERROR: OpenSSL >=3.0.0 requires --enable-version3"; }; } ||
6897 { enabled gpl && ! enabled nonfree && die "ERROR: OpenSSL <3.0.0 is incompatible with the gpl"; } ||
6898 check_pkg_config openssl openssl openssl/ssl.h OPENSSL_init_ssl ||
6899 check_pkg_config openssl openssl openssl/ssl.h SSL_library_init ||
6900 check_lib openssl openssl/ssl.h OPENSSL_init_ssl -lssl -lcrypto ||
6901 check_lib openssl openssl/ssl.h SSL_library_init -lssl -lcrypto ||
6902 check_lib openssl openssl/ssl.h SSL_library_init -lssl32 -leay32 ||
6903 check_lib openssl openssl/ssl.h SSL_library_init -lssl -lcrypto -lws2_32 -lgdi32 ||
6904 die "ERROR: openssl not found"; }
6905 enabled pocketsphinx && require_pkg_config pocketsphinx pocketsphinx pocketsphinx/pocketsphinx.h ps_init
6906 enabled rkmpp && { require_pkg_config rkmpp rockchip_mpp rockchip/rk_mpi.h mpp_create &&
6907 require_pkg_config rockchip_mpp "rockchip_mpp >= 1.3.7" rockchip/rk_mpi.h mpp_create &&
6909 die "ERROR: rkmpp requires --enable-libdrm"; }
6911 enabled vapoursynth && require_pkg_config vapoursynth "vapoursynth-script >= 42" VSScript.h vsscript_init
6914 if enabled gcrypt; then
6915 GCRYPT_CONFIG="${cross_prefix}libgcrypt-config"
6916 if "${GCRYPT_CONFIG}" --version > /dev/null 2>&1; then
6917 gcrypt_cflags=$("${GCRYPT_CONFIG}" --cflags)
6918 gcrypt_extralibs=$("${GCRYPT_CONFIG}" --libs)
6919 check_func_headers gcrypt.h gcry_mpi_new $gcrypt_cflags $gcrypt_extralibs ||
6920 die "ERROR: gcrypt not found"
6921 add_cflags $gcrypt_cflags
6923 require gcrypt gcrypt.h gcry_mpi_new -lgcrypt
6927 if enabled sdl2; then
6928 SDL2_CONFIG="${cross_prefix}sdl2-config"
6929 test_pkg_config sdl2 "sdl2 >= 2.0.1 sdl2 < 3.0.0" SDL_events.h SDL_PollEvent
6930 if disabled sdl2 && "${SDL2_CONFIG}" --version > /dev/null 2>&1; then
6931 sdl2_cflags=$("${SDL2_CONFIG}" --cflags)
6932 sdl2_extralibs=$("${SDL2_CONFIG}" --libs)
6933 test_cpp_condition SDL.h "(SDL_MAJOR_VERSION<<16 | SDL_MINOR_VERSION<<8 | SDL_PATCHLEVEL) >= 0x020001" $sdl2_cflags &&
6934 test_cpp_condition SDL.h "(SDL_MAJOR_VERSION<<16 | SDL_MINOR_VERSION<<8 | SDL_PATCHLEVEL) < 0x030000" $sdl2_cflags &&
6935 check_func_headers SDL_events.h SDL_PollEvent $sdl2_extralibs $sdl2_cflags &&
6938 if test $target_os = "mingw32"; then
6939 sdl2_extralibs=$(filter_out '-mwindows' $sdl2_extralibs)
6943 if enabled decklink; then
6945 mingw32*|mingw64*|win32|win64)
6946 decklink_outdev_extralibs="$decklink_outdev_extralibs -lole32 -loleaut32"
6947 decklink_indev_extralibs="$decklink_indev_extralibs -lole32 -loleaut32"
6952 enabled securetransport &&
6953 check_func SecIdentityCreate "-Wl,-framework,CoreFoundation -Wl,-framework,Security" &&
6954 check_lib securetransport "Security/SecureTransport.h Security/Security.h" "SSLCreateContext" "-Wl,-framework,CoreFoundation -Wl,-framework,Security" ||
6955 disable securetransport
6957 enabled securetransport &&
6958 check_func SecItemImport "-Wl,-framework,CoreFoundation -Wl,-framework,Security"
6961 check_func_headers "windows.h security.h" InitializeSecurityContext -DSECURITY_WIN32 -lsecur32 &&
6962 test_cpp_condition winerror.h "defined(SEC_I_CONTEXT_EXPIRED)" &&
6963 schannel_extralibs="-lsecur32" ||
6966 makeinfo --version > /dev/null 2>&1 && enable makeinfo || disable makeinfo
6968 && [ 0$(makeinfo --version | grep "texinfo" | sed 's/.*texinfo[^0-9]*\([0-9]*\)\..*/\1/') -ge 5 ] \
6969 && enable makeinfo_html || disable makeinfo_html
6970 disabled makeinfo_html && texi2html --help 2> /dev/null | grep -q 'init-file' && enable texi2html || disable texi2html
6971 perl -v > /dev/null 2>&1 && enable perl || disable perl
6972 pod2man --help > /dev/null 2>&1 && enable pod2man || disable pod2man
6973 rsync --help 2> /dev/null | grep -q 'contimeout' && enable rsync_contimeout || disable rsync_contimeout
6974 xmllint --version > /dev/null 2>&1 && enable xmllint || disable xmllint
6976 # check V4L2 codecs available in the API
6977 if enabled v4l2_m2m; then
6978 check_headers linux/fb.h
6979 check_headers linux/videodev2.h
6980 test_code cc linux/videodev2.h "struct v4l2_frmsizeenum vfse; vfse.discrete.width = 0;" && enable_sanitized struct_v4l2_frmivalenum_discrete
6981 check_cc v4l2_m2m linux/videodev2.h "int i = V4L2_CAP_VIDEO_M2M_MPLANE | V4L2_CAP_VIDEO_M2M | V4L2_BUF_FLAG_LAST;"
6982 check_cc vc1_v4l2_m2m linux/videodev2.h "int i = V4L2_PIX_FMT_VC1_ANNEX_G;"
6983 check_cc mpeg1_v4l2_m2m linux/videodev2.h "int i = V4L2_PIX_FMT_MPEG1;"
6984 check_cc mpeg2_v4l2_m2m linux/videodev2.h "int i = V4L2_PIX_FMT_MPEG2;"
6985 check_cc mpeg4_v4l2_m2m linux/videodev2.h "int i = V4L2_PIX_FMT_MPEG4;"
6986 check_cc hevc_v4l2_m2m linux/videodev2.h "int i = V4L2_PIX_FMT_HEVC;"
6987 check_cc h263_v4l2_m2m linux/videodev2.h "int i = V4L2_PIX_FMT_H263;"
6988 check_cc h264_v4l2_m2m linux/videodev2.h "int i = V4L2_PIX_FMT_H264;"
6989 check_cc vp8_v4l2_m2m linux/videodev2.h "int i = V4L2_PIX_FMT_VP8;"
6990 check_cc vp9_v4l2_m2m linux/videodev2.h "int i = V4L2_PIX_FMT_VP9;"
6993 check_headers sys/videoio.h
6994 test_code cc sys/videoio.h "struct v4l2_frmsizeenum vfse; vfse.discrete.width = 0;" && enable_sanitized struct_v4l2_frmivalenum_discrete
6996 check_lib user32 "windows.h winuser.h" GetShellWindow -luser32
6997 check_lib vfw32 "windows.h vfw.h" capCreateCaptureWindow -lvfw32
6998 # check that WM_CAP_DRIVER_CONNECT is defined to the proper value
6999 # w32api 3.12 had it defined wrong
7000 check_cpp_condition vfwcap_defines vfw.h "WM_CAP_DRIVER_CONNECT > WM_USER"
7002 check_type "dshow.h" IBaseFilter
7004 # check for ioctl_meteor.h, ioctl_bt848.h and alternatives
7005 check_headers "dev/bktr/ioctl_meteor.h dev/bktr/ioctl_bt848.h" ||
7006 check_headers "machine/ioctl_meteor.h machine/ioctl_bt848.h" ||
7007 check_headers "dev/video/meteor/ioctl_meteor.h dev/video/bktr/ioctl_bt848.h" ||
7008 check_headers "dev/ic/bt8xx.h"
7010 if check_struct sys/soundcard.h audio_buf_info bytes; then
7011 enable_sanitized sys/soundcard.h
7013 test_cc -D__BSD_VISIBLE -D__XSI_VISIBLE <<EOF && add_cppflags -D__BSD_VISIBLE -D__XSI_VISIBLE && enable_sanitized sys/soundcard.h
7014 #include <sys/soundcard.h>
7019 enabled alsa && { check_pkg_config alsa alsa "alsa/asoundlib.h" snd_pcm_htimestamp ||
7020 check_lib alsa alsa/asoundlib.h snd_pcm_htimestamp -lasound; }
7023 require_pkg_config libjack jack jack/jack.h jack_port_get_latency_range
7025 enabled sndio && check_pkg_config sndio sndio sndio.h sio_open
7027 if enabled libcdio; then
7028 check_pkg_config libcdio libcdio_paranoia "cdio/cdda.h cdio/paranoia.h" cdio_cddap_open ||
7029 check_pkg_config libcdio libcdio_paranoia "cdio/paranoia/cdda.h cdio/paranoia/paranoia.h" cdio_cddap_open ||
7030 check_lib libcdio "cdio/cdda.h cdio/paranoia.h" cdio_cddap_open -lcdio_paranoia -lcdio_cdda -lcdio ||
7031 check_lib libcdio "cdio/paranoia/cdda.h cdio/paranoia/paranoia.h" cdio_cddap_open -lcdio_paranoia -lcdio_cdda -lcdio ||
7032 die "ERROR: No usable libcdio/cdparanoia found"
7035 enabled libxcb && check_pkg_config libxcb "xcb >= 1.4" xcb/xcb.h xcb_connect ||
7036 disable libxcb_shm libxcb_shape libxcb_xfixes
7038 if enabled libxcb; then
7039 enabled libxcb_shm && check_pkg_config libxcb_shm xcb-shm xcb/shm.h xcb_shm_attach
7040 enabled libxcb_shape && check_pkg_config libxcb_shape xcb-shape xcb/shape.h xcb_shape_get_rectangles
7041 enabled libxcb_xfixes && check_pkg_config libxcb_xfixes xcb-xfixes xcb/xfixes.h xcb_xfixes_get_cursor_image
7044 check_func_headers "windows.h" CreateDIBSection "$gdigrab_indev_extralibs"
7046 # d3d11va requires linking directly to dxgi and d3d11 if not building for
7047 # the desktop api partition
7048 test_cpp <<EOF && enable uwp && d3d11va_extralibs="-ldxgi -ld3d11"
7049 #ifdef WINAPI_FAMILY
7050 #include <winapifamily.h>
7051 #if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
7052 #error desktop, not uwp
7054 // WINAPI_FAMILY_APP, WINAPI_FAMILY_PHONE_APP => UWP
7057 #error no family set
7061 # vaapi_win32 requires linking directly to dxgi if not building for
7062 # the desktop api partition
7063 test_cpp <<EOF && enable uwp && vaapi_win32_extralibs="-ldxgi"
7064 #ifdef WINAPI_FAMILY
7065 #include <winapifamily.h>
7066 #if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
7067 #error desktop, not uwp
7069 // WINAPI_FAMILY_APP, WINAPI_FAMILY_PHONE_APP => UWP
7072 #error no family set
7076 # mediafoundation requires linking directly to mfplat if building for uwp target
7077 enabled uwp && mediafoundation_extralibs="-lmfplat -lmfuuid -lole32 -lstrmiids" || mediafoundation_extralibs="-lmfuuid -lole32 -lstrmiids"
7080 check_pkg_config libdrm_getfb2 libdrm "xf86drmMode.h" drmModeGetFB2
7083 check_pkg_config vaapi "libva >= 0.35.0" "va/va.h" vaInitialize
7085 if enabled vaapi; then
7087 mingw32*|mingw64*|win32|win64)
7088 check_pkg_config vaapi_win32 "libva-win32" "va/va_win32.h" vaGetDisplayWin32
7091 check_pkg_config vaapi_drm "libva-drm" "va/va_drm.h" vaGetDisplayDRM
7095 if enabled xlib_x11; then
7096 check_pkg_config vaapi_x11 "libva-x11" "va/va_x11.h" vaGetDisplay
7099 check_cpp_condition vaapi_1 "va/va.h" "VA_CHECK_VERSION(1, 0, 0)"
7101 check_type "va/va.h va/va_dec_hevc.h" "VAPictureParameterBufferHEVC"
7102 check_struct "va/va.h" "VADecPictureParameterBufferVP9" bit_depth
7103 check_struct "va/va.h" "VADecPictureParameterBufferAV1" bit_depth_idx
7104 check_type "va/va.h va/va_vpp.h" "VAProcFilterParameterBufferHDRToneMapping"
7105 check_struct "va/va.h va/va_vpp.h" "VAProcPipelineCaps" rotation_flags
7106 check_struct "va/va.h va/va_vpp.h" "VAProcPipelineCaps" blend_flags
7107 check_type "va/va.h va/va_enc_hevc.h" "VAEncPictureParameterBufferHEVC"
7108 check_type "va/va.h va/va_enc_jpeg.h" "VAEncPictureParameterBufferJPEG"
7109 check_type "va/va.h va/va_enc_vp8.h" "VAEncPictureParameterBufferVP8"
7110 check_type "va/va.h va/va_enc_vp9.h" "VAEncPictureParameterBufferVP9"
7111 check_type "va/va.h va/va_enc_av1.h" "VAEncPictureParameterBufferAV1"
7114 if enabled_all opencl libdrm ; then
7115 check_type "CL/cl_intel.h" "clCreateImageFromFdINTEL_fn" &&
7116 enable opencl_drm_beignet
7117 check_func_headers "CL/cl_ext.h" clImportMemoryARM &&
7118 enable opencl_drm_arm
7121 if enabled_all opencl vaapi ; then
7122 if enabled opencl_drm_beignet ; then
7123 enable opencl_vaapi_beignet
7125 check_type "CL/cl.h CL/cl_va_api_media_sharing_intel.h" "clCreateFromVA_APIMediaSurfaceINTEL_fn" &&
7126 enable opencl_vaapi_intel_media
7130 if enabled_all opencl dxva2 ; then
7131 check_type "CL/cl_dx9_media_sharing.h" cl_dx9_surface_info_khr &&
7135 if enabled_all opencl d3d11va ; then
7136 check_type "CL/cl_d3d11.h" clGetDeviceIDsFromD3D11KHR_fn &&
7141 check_cpp_condition vdpau vdpau/vdpau.h "defined VDP_DECODER_PROFILE_MPEG4_PART2_ASP"
7144 check_lib vdpau_x11 "vdpau/vdpau.h vdpau/vdpau_x11.h" vdp_device_create_x11 -lvdpau -lX11
7146 enabled crystalhd && check_lib crystalhd "stdint.h libcrystalhd/libcrystalhd_if.h" DtsCrystalHDVersion -lcrystalhd && \
7147 warn "CrystalHD support is deprecated and will be removed, please contact the developers if you are interested" \
7148 "in maintaining it."
7150 if enabled vulkan; then
7151 check_pkg_config_header_only vulkan "vulkan >= 1.3.255" "vulkan/vulkan.h" "defined VK_VERSION_1_3" ||
7152 check_cpp_condition vulkan "vulkan/vulkan.h" "defined(VK_VERSION_1_4) || (defined(VK_VERSION_1_3) && VK_HEADER_VERSION >= 255)"
7155 if disabled vulkan; then
7156 disable libglslang libshaderc spirv_compiler
7159 if enabled x86; then
7161 mingw32*|mingw64*|win32|win64|linux|cygwin*)
7164 disable ffnvcodec cuvid nvdec nvenc
7167 elif enabled_any aarch64 ppc64 && ! enabled bigendian; then
7172 disable ffnvcodec cuvid nvdec nvenc
7176 disable ffnvcodec cuvid nvdec nvenc
7179 enabled ffnvcodec && enable cuda
7182 test_cc -I$source_path <<EOF || disable nvenc
7183 #include <ffnvcodec/nvEncodeAPI.h>
7184 NV_ENCODE_API_FUNCTION_LIST flist;
7185 void f(void) { struct { const GUID guid; } s[] = { { NV_ENC_CODEC_H264_GUID } }; }
7186 int main(void) { return 0; }
7189 if enabled nvenc; then
7190 check_type "ffnvcodec/nvEncodeAPI.h" "NV_ENC_PIC_PARAMS_AV1"
7193 if enabled_any nvdec cuvid; then
7194 check_type "ffnvcodec/dynlink_cuda.h ffnvcodec/dynlink_cuviddec.h" "CUVIDAV1PICPARAMS"
7198 check_cpp_condition amf "AMF/core/Version.h" \
7199 "(AMF_VERSION_MAJOR << 48 | AMF_VERSION_MINOR << 32 | AMF_VERSION_RELEASE << 16 | AMF_VERSION_BUILD_NUM) >= 0x00010004001d0000"
7201 # Funny iconv installations are not unusual, so check it after all flags have been set
7202 if enabled libc_iconv; then
7203 check_func_headers iconv.h iconv
7204 elif enabled iconv; then
7205 check_func_headers iconv.h iconv || check_lib iconv iconv.h iconv -liconv
7208 enabled debug && add_cflags -g"$debuglevel" && add_asflags -g"$debuglevel"
7210 # add some useful compiler flags if supported
7211 check_cflags -Wdeclaration-after-statement
7213 check_cflags -Wdisabled-optimization
7214 check_cflags -Wpointer-arith
7215 check_cflags -Wredundant-decls
7216 check_cflags -Wwrite-strings
7217 check_cflags -Wtype-limits
7218 check_cflags -Wundef
7219 check_cflags -Wmissing-prototypes
7220 check_cflags -Wstrict-prototypes
7221 check_cflags -Wempty-body
7223 if enabled extra_warnings; then
7224 check_cflags -Wcast-qual
7225 check_cflags -Wextra
7226 check_cflags -Wpedantic
7229 check_disable_warning(){
7230 warning_flag=-W${1#-Wno-}
7231 test_cflags $unknown_warning_flags $warning_flag && add_cflags $1
7234 test_cflags -Werror=unused-command-line-argument &&
7235 append unknown_warning_flags "-Werror=unused-command-line-argument"
7236 test_cflags -Werror=unknown-warning-option &&
7237 append unknown_warning_flags "-Werror=unknown-warning-option"
7239 check_disable_warning -Wno-parentheses
7240 check_disable_warning -Wno-switch
7241 check_disable_warning -Wno-format-zero-length
7242 check_disable_warning -Wno-pointer-sign
7243 check_disable_warning -Wno-unused-const-variable
7244 check_disable_warning -Wno-bool-operation
7245 check_disable_warning -Wno-char-subscripts
7247 check_disable_warning_headers(){
7248 warning_flag=-W${1#-Wno-}
7249 test_cflags $warning_flag && add_cflags_headers $1
7252 check_disable_warning_headers -Wno-deprecated-declarations
7253 check_disable_warning_headers -Wno-unused-variable
7255 test_cc <<EOF && enable blocks_extension
7256 void (^block)(void);
7259 # add some linker flags
7260 check_ldflags -Wl,--warn-common
7261 check_ldflags -Wl,-rpath-link=:libpostproc:libswresample:libswscale:libavfilter:libavdevice:libavformat:libavcodec:libavutil
7262 enabled rpath && add_ldexeflags -Wl,-rpath,$libdir && add_ldsoflags -Wl,-rpath,$libdir
7263 test_ldflags -Wl,-Bsymbolic && append SHFLAGS -Wl,-Bsymbolic
7265 # add some strip flags
7268 enabled neon_clobber_test &&
7269 check_ldflags -Wl,--wrap,avcodec_open2 \
7270 -Wl,--wrap,avcodec_decode_subtitle2 \
7271 -Wl,--wrap,avcodec_encode_subtitle \
7272 -Wl,--wrap,avcodec_send_packet \
7273 -Wl,--wrap,avcodec_receive_packet \
7274 -Wl,--wrap,avcodec_send_frame \
7275 -Wl,--wrap,avcodec_receive_frame \
7276 -Wl,--wrap,swr_convert ||
7277 disable neon_clobber_test
7279 enabled xmm_clobber_test &&
7280 check_ldflags -Wl,--wrap,avcodec_open2 \
7281 -Wl,--wrap,avcodec_decode_subtitle2 \
7282 -Wl,--wrap,avcodec_encode_subtitle \
7283 -Wl,--wrap,avcodec_send_packet \
7284 -Wl,--wrap,avcodec_receive_packet \
7285 -Wl,--wrap,avcodec_send_frame \
7286 -Wl,--wrap,avcodec_receive_frame \
7287 -Wl,--wrap,swr_convert \
7288 -Wl,--wrap,sws_scale ||
7289 disable xmm_clobber_test
7291 check_ld "cc" proper_dce <<EOF
7292 extern const int array[512];
7293 static inline int func(void) { return array[0]; }
7294 int main(void) { return 0; }
7297 if enabled proper_dce; then
7298 echo "X { local: *; };" > $TMPV
7299 if test_ldflags -Wl,${version_script},$TMPV; then
7300 append SHFLAGS '-Wl,${version_script},\$(SUBDIR)lib\$(NAME).ver'
7302 test_cc <<EOF && enable symver_asm_label
7303 void ff_foo(void) __asm__ ("av_foo@VERSION");
7304 void ff_foo(void) { ${inline_asm+__asm__($quotes);} }
7306 test_cc <<EOF && enable symver_gnu_asm
7307 __asm__(".symver ff_foo,av_foo@VERSION");
7308 void ff_foo(void) {}
7313 if [ -z "$optflags" ]; then
7314 if enabled small; then
7315 optflags=$cflags_size
7316 elif enabled optimizations; then
7317 optflags=$cflags_speed
7319 optflags=$cflags_noopt
7325 [ -n "$lto" ] && check_ldflags "$@"
7328 check_optflags $optflags
7329 check_optflags -fno-math-errno
7330 check_optflags -fno-signed-zeros
7332 if [ -n "$lto" ]; then
7333 test "$cc_type" != "$ld_type" && die "LTO requires same compiler and linker"
7335 check_ldflags $lto $cpuflags
7336 disable inline_asm_direct_symbol_refs
7339 enabled ftrapv && check_cflags -ftrapv
7341 test_cc -mno-red-zone <<EOF && noredzone_flags="-mno-red-zone"
7346 if enabled icc; then
7347 # Just warnings, no remarks
7349 # -wd: Disable following warnings
7350 # 144, 167, 556: -Wno-pointer-sign
7351 # 188: enumerated type mixed with another type
7352 # 1292: attribute "foo" ignored
7353 # 1419: external declaration in primary source file
7354 # 10006: ignoring unknown option -fno-signed-zeros
7355 # 10148: ignoring unknown option -Wno-parentheses
7356 # 10156: ignoring option '-W'; no argument required
7357 # 13200: No EMMS instruction before call to function
7358 # 13203: No EMMS instruction before return from function
7359 check_cflags -wd144,167,188,556,1292,1419,10006,10148,10156,13200,13203
7360 # 11030: Warning unknown option --as-needed
7361 # 10156: ignoring option '-export'; no argument required
7362 check_ldflags -wd10156,11030
7363 # icc 11.0 and 11.1 work with ebp_available, but don't pass the test
7364 enable ebp_available
7365 # The test above does not test linking
7366 [ -n "$lto" ] && disable symver_asm_label
7367 if enabled x86_32; then
7368 icc_version=$($cc -dumpversion)
7369 test ${icc_version%%.*} -ge 11 &&
7370 check_cflags -falign-stack=maintain-16-byte ||
7371 disable aligned_stack
7373 elif enabled gcc; then
7374 check_optflags -fno-tree-vectorize
7375 check_cflags -Werror=format-security
7376 check_cflags -Werror=implicit-function-declaration
7377 check_cflags -Werror=missing-prototypes
7378 check_cflags -Werror=return-type
7379 check_cflags -Werror=vla
7380 check_cflags -Wformat
7381 check_cflags -fdiagnostics-color=auto
7382 enabled extra_warnings || check_disable_warning -Wno-maybe-uninitialized
7383 if enabled x86_32; then
7386 # BSDs don't guarantee a 16 byte aligned stack, but we can
7387 # request GCC to try to maintain 16 byte alignment throughout
7388 # function calls. Library entry points that might call assembly
7389 # functions align the stack. (The parameter means 2^4 bytes.)
7390 check_cflags -mpreferred-stack-boundary=4
7394 elif enabled llvm_gcc; then
7395 check_cflags -mllvm -stack-alignment=16
7396 elif enabled clang; then
7397 if enabled x86_32; then
7398 # Clang doesn't support maintaining alignment without assuming the
7399 # same alignment in every function. If 16 byte alignment would be
7400 # enabled, one would also have to either add attribute_align_arg on
7401 # every single entry point into the libraries or enable -mstackrealign
7402 # (doing stack realignment in every single function).
7404 mingw32|win32|*bsd*)
7405 disable aligned_stack
7408 check_cflags -mllvm -stack-alignment=16
7409 check_cflags -mstack-alignment=16
7413 check_cflags -mllvm -stack-alignment=16
7414 check_cflags -mstack-alignment=16
7416 check_cflags -Qunused-arguments
7417 check_cflags -Werror=implicit-function-declaration
7418 check_cflags -Werror=missing-prototypes
7419 check_cflags -Werror=return-type
7420 elif enabled cparser; then
7421 add_cflags -Wno-missing-variable-declarations
7422 add_cflags -Wno-empty-statement
7423 elif enabled armcc; then
7424 add_cflags -W${armcc_opt},--diag_suppress=4343 # hardfp compat
7425 add_cflags -W${armcc_opt},--diag_suppress=3036 # using . as system include dir
7426 # 2523: use of inline assembly is deprecated
7427 add_cflags -W${armcc_opt},--diag_suppress=2523
7428 add_cflags -W${armcc_opt},--diag_suppress=1207
7429 add_cflags -W${armcc_opt},--diag_suppress=1293 # assignment in condition
7430 add_cflags -W${armcc_opt},--diag_suppress=3343 # hardfp compat
7431 add_cflags -W${armcc_opt},--diag_suppress=167 # pointer sign
7432 add_cflags -W${armcc_opt},--diag_suppress=513 # pointer sign
7433 elif enabled pathscale; then
7434 add_cflags -fstrict-overflow -OPT:wrap_around_unsafe_opt=OFF
7436 elif enabled_any msvc icl; then
7437 enabled x86_32 && disable aligned_stack
7438 enabled_all x86_32 debug && add_cflags -Oy-
7439 enabled debug && add_ldflags -debug
7440 enable pragma_deprecated
7441 if enabled icl; then
7442 # -Qansi-alias is basically -fstrict-aliasing, but does not work
7443 # (correctly) on icl 13.x.
7444 test_cpp_condition "windows.h" "__ICL < 1300 || __ICL >= 1400" &&
7445 add_cflags -Qansi-alias
7446 # Some inline asm is not compilable in debug
7447 if enabled debug; then
7448 disable ebp_available
7449 disable ebx_available
7452 # msvcrt10 x64 incorrectly enables log2, only msvcrt12 (MSVC 2013) onwards actually has log2.
7453 check_cpp_condition log2 crtversion.h "_VC_CRT_MAJOR_VERSION >= 12"
7454 # The CRT headers contain __declspec(restrict) in a few places, but if redefining
7455 # restrict, this might break. MSVC 2010 and 2012 fail with __declspec(__restrict)
7456 # (as it ends up if the restrict redefine is done before including stdlib.h), while
7457 # MSVC 2013 and newer can handle it fine.
7458 # If this declspec fails, force including stdlib.h before the restrict redefinition
7459 # happens in config.h.
7460 if [ $restrict_keyword != restrict ]; then
7461 test_cc <<EOF || add_cflags -FIstdlib.h
7462 __declspec($restrict_keyword) void *foo(int);
7465 # the new SSA optimzer in VS2015 U3 is mis-optimizing some parts of the code
7466 # Issue has been fixed in MSVC v19.00.24218.
7467 test_cpp_condition windows.h "_MSC_FULL_VER >= 190024218" ||
7468 check_cflags -d2SSAOptimizer-
7469 # enable utf-8 source processing on VS2015 U2 and newer
7470 test_cpp_condition windows.h "_MSC_FULL_VER >= 190023918" &&
7474 for pfx in "" host_; do
7475 varname=${pfx%_}cc_type
7476 eval "type=\$$varname"
7477 if [ "$type" = "msvc" ]; then
7478 test_${pfx}cc <<EOF || add_${pfx}cflags -Dinline=__inline
7479 static inline int foo(int a) { return a; }
7486 add_asflags -Qunused-arguments
7492 check_ldflags -Qunused-arguments
7496 enable frame_thread_encoder
7498 enabled asm || { arch=c; disable $ARCH_LIST $ARCH_EXT_LIST; }
7500 check_deps $CONFIG_LIST \
7505 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"
7510 disable posix_memalign
7512 *-dos|freedos|opendos)
7513 if test_cpp_condition sys/version.h "defined(__DJGPP__) && __DJGPP__ == 2 && __DJGPP_MINOR__ == 5"; then
7519 flatten_extralibs(){
7523 for entry in $list; do
7527 for e in $entry_copy; do
7529 *_extralibs) nested_entries="$nested_entries$e ";;
7530 *) flat_entries="$flat_entries$e ";;
7533 eval $entry="\$flat_entries"
7535 append $list_name "$nested_entries"
7537 resolve nested_entries
7538 if test -n "$(filter '*_extralibs' $nested_entries)"; then
7539 flatten_extralibs $list_name
7543 flatten_extralibs_wrapper(){
7545 flatten_extralibs $list_name
7548 eval $list_name=\$\(\$ldflags_filter \$$list_name\)
7549 eval printf \''%s'\' \""\$$list_name"\"
7552 for linkunit in $LIBRARY_LIST; do
7553 unset current_extralibs
7554 eval components=\$$(toupper ${linkunit})_COMPONENTS_LIST
7555 for comp in ${components}; do
7556 enabled $comp || continue
7557 comp_extralibs="${comp}_extralibs"
7558 append current_extralibs $comp_extralibs
7560 eval prepend ${linkunit}_extralibs $current_extralibs
7563 for linkunit in $LIBRARY_LIST $PROGRAM_LIST $EXTRALIBS_LIST; do
7564 eval ${linkunit}_extralibs=\$\(flatten_extralibs_wrapper ${linkunit}_extralibs\)
7567 map 'enabled $v && intrinsics=${v#intrinsics_}' $INTRINSICS_LIST
7569 for thread in $THREADS_LIST; do
7570 if enabled $thread; then
7571 test -n "$thread_type" &&
7572 die "ERROR: Only one thread type must be selected." ||
7573 thread_type="$thread"
7577 if disabled stdatomic; then
7578 if enabled atomics_gcc; then
7579 add_cppflags '-I\$(SRC_PATH)/compat/atomics/gcc'
7580 elif enabled atomics_win32; then
7581 add_cppflags '-I\$(SRC_PATH)/compat/atomics/win32'
7582 elif enabled atomics_suncc; then
7583 add_cppflags '-I\$(SRC_PATH)/compat/atomics/suncc'
7584 elif enabled pthreads; then
7585 add_compat atomics/pthread/stdatomic.o
7586 add_cppflags '-I\$(SRC_PATH)/compat/atomics/pthread'
7588 enabled threads && die "Threading is enabled, but no atomics are available"
7589 add_cppflags '-I\$(SRC_PATH)/compat/atomics/dummy'
7593 # Check if requested libraries were found.
7594 for lib in $AUTODETECT_LIBS; do
7595 requested $lib && ! enabled $lib && die "ERROR: $lib requested but not found";
7598 enabled zlib && add_cppflags -DZLIB_CONST
7600 # conditional library dependencies, in any order
7601 enabled amovie_filter && prepend avfilter_deps "avformat avcodec"
7602 enabled aresample_filter && prepend avfilter_deps "swresample"
7603 enabled cover_rect_filter && prepend avfilter_deps "avformat avcodec"
7604 enabled ebur128_filter && enabled swresample && prepend avfilter_deps "swresample"
7605 enabled elbg_filter && prepend avfilter_deps "avcodec"
7606 enabled find_rect_filter && prepend avfilter_deps "avformat avcodec"
7607 enabled mcdeint_filter && prepend avfilter_deps "avcodec"
7608 enabled movie_filter && prepend avfilter_deps "avformat avcodec"
7609 enabled pan_filter && prepend avfilter_deps "swresample"
7610 enabled pp_filter && prepend avfilter_deps "postproc"
7611 enabled removelogo_filter && prepend avfilter_deps "avformat avcodec swscale"
7612 enabled sab_filter && prepend avfilter_deps "swscale"
7613 enabled scale_filter && prepend avfilter_deps "swscale"
7614 enabled scale2ref_filter && prepend avfilter_deps "swscale"
7615 enabled showcqt_filter && prepend avfilter_deps "avformat swscale"
7616 enabled signature_filter && prepend avfilter_deps "avcodec avformat"
7617 enabled smartblur_filter && prepend avfilter_deps "swscale"
7618 enabled spp_filter && prepend avfilter_deps "avcodec"
7619 enabled sr_filter && prepend avfilter_deps "avformat swscale"
7620 enabled subtitles_filter && prepend avfilter_deps "avformat avcodec"
7621 enabled uspp_filter && prepend avfilter_deps "avcodec"
7622 enabled zoompan_filter && prepend avfilter_deps "swscale"
7624 enabled lavfi_indev && prepend avdevice_deps "avfilter"
7627 enabled_any sdl2_outdev opengl_outdev && enabled sdl2 &&
7628 add_cflags $(filter_out '-Dmain=SDL_main' $sdl2_cflags)
7630 enabled opus_decoder && prepend avcodec_deps "swresample"
7632 # reorder the items at var $1 to align with the items order at var $2 .
7633 # die if an item at $1 is not at $2 .
7636 eval rb_ordered=\$$2
7638 for rb in $rb_in; do
7639 is_in $rb $rb_ordered || die "$rb at \$$1 is not at \$$2"
7643 for rb in $rb_ordered; do
7644 is_in $rb $rb_in && rb_out="$rb_out$rb "
7649 # deps-expand fflib $1: N x {append all expanded deps; unique}
7650 # within a set of N items, N expansions are enough to expose a cycle.
7652 unique ${1}_deps # required for the early break test.
7653 for dummy in $LIBRARY_LIST; do # N iteratios
7654 eval deps=\$${1}_deps
7655 append ${1}_deps $(map 'eval echo \$${v}_deps' $deps)
7657 eval '[ ${#deps} = ${#'${1}_deps'} ]' && break # doesn't expand anymore
7660 eval is_in $1 \$${1}_deps && die "Dependency cycle at ${1}_deps"
7661 reorder_by ${1}_deps LIBRARY_LIST # linking order is expected later
7664 #we have to remove gpl from the deps here as some code assumes all lib deps are libs
7665 postproc_deps="$(filter_out 'gpl' $postproc_deps)"
7667 map 'expand_deps $v' $LIBRARY_LIST
7669 if test "$quiet" != "yes"; then
7671 echo "install prefix $prefix"
7672 echo "source path $source_path"
7673 echo "C compiler $cc"
7674 echo "C library $libc_type"
7675 if test "$host_cc" != "$cc"; then
7676 echo "host C compiler $host_cc"
7677 echo "host C library $host_libc_type"
7679 echo "ARCH $arch ($cpu)"
7680 if test "$build_suffix" != ""; then
7681 echo "build suffix $build_suffix"
7683 if test "$progs_suffix" != ""; then
7684 echo "progs suffix $progs_suffix"
7686 if test "$extra_version" != ""; then
7687 echo "version string suffix $extra_version"
7689 echo "big-endian ${bigendian-no}"
7690 echo "runtime cpu detection ${runtime_cpudetect-no}"
7691 if enabled x86; then
7692 echo "standalone assembly ${x86asm-no}"
7693 echo "x86 assembler ${x86asmexe}"
7694 echo "MMX enabled ${mmx-no}"
7695 echo "MMXEXT enabled ${mmxext-no}"
7696 echo "3DNow! enabled ${amd3dnow-no}"
7697 echo "3DNow! extended enabled ${amd3dnowext-no}"
7698 echo "SSE enabled ${sse-no}"
7699 echo "SSSE3 enabled ${ssse3-no}"
7700 echo "AESNI enabled ${aesni-no}"
7701 echo "AVX enabled ${avx-no}"
7702 echo "AVX2 enabled ${avx2-no}"
7703 echo "AVX-512 enabled ${avx512-no}"
7704 echo "AVX-512ICL enabled ${avx512icl-no}"
7705 echo "XOP enabled ${xop-no}"
7706 echo "FMA3 enabled ${fma3-no}"
7707 echo "FMA4 enabled ${fma4-no}"
7708 echo "i686 features enabled ${i686-no}"
7709 echo "CMOV is fast ${fast_cmov-no}"
7710 echo "EBX available ${ebx_available-no}"
7711 echo "EBP available ${ebp_available-no}"
7713 if enabled aarch64; then
7714 echo "NEON enabled ${neon-no}"
7715 echo "DOTPROD enabled ${dotprod-no}"
7716 echo "I8MM enabled ${i8mm-no}"
7718 if enabled arm; then
7719 echo "ARMv5TE enabled ${armv5te-no}"
7720 echo "ARMv6 enabled ${armv6-no}"
7721 echo "ARMv6T2 enabled ${armv6t2-no}"
7722 echo "VFP enabled ${vfp-no}"
7723 echo "NEON enabled ${neon-no}"
7724 echo "THUMB enabled ${thumb-no}"
7726 if enabled mips; then
7727 echo "MIPS FPU enabled ${mipsfpu-no}"
7728 echo "MIPS DSP R1 enabled ${mipsdsp-no}"
7729 echo "MIPS DSP R2 enabled ${mipsdspr2-no}"
7730 echo "MIPS MSA enabled ${msa-no}"
7731 echo "LOONGSON MMI enabled ${mmi-no}"
7733 if enabled ppc; then
7734 echo "AltiVec enabled ${altivec-no}"
7735 echo "VSX enabled ${vsx-no}"
7736 echo "POWER8 enabled ${power8-no}"
7737 echo "PPC 4xx optimizations ${ppc4xx-no}"
7738 echo "dcbzl available ${dcbzl-no}"
7740 if enabled loongarch; then
7741 echo "LSX enabled ${lsx-no}"
7742 echo "LASX enabled ${lasx-no}"
7744 if enabled riscv; then
7745 echo "RISC-V Vector enabled ${rvv-no}"
7747 echo "debug symbols ${debug-no}"
7748 echo "strip symbols ${stripping-no}"
7749 echo "optimize for size ${small-no}"
7750 echo "optimizations ${optimizations-no}"
7751 echo "static ${static-no}"
7752 echo "shared ${shared-no}"
7753 echo "postprocessing support ${postproc-no}"
7754 echo "network support ${network-no}"
7755 echo "threading support ${thread_type-no}"
7756 echo "safe bitstream reader ${safe_bitstream_reader-no}"
7757 echo "texi2html enabled ${texi2html-no}"
7758 echo "perl enabled ${perl-no}"
7759 echo "pod2man enabled ${pod2man-no}"
7760 echo "makeinfo enabled ${makeinfo-no}"
7761 echo "makeinfo supports HTML ${makeinfo_html-no}"
7762 echo "xmllint enabled ${xmllint-no}"
7763 test -n "$random_seed" &&
7764 echo "random seed ${random_seed}"
7767 echo "External libraries:"
7768 print_enabled '' $EXTERNAL_LIBRARY_LIST $EXTERNAL_AUTODETECT_LIBRARY_LIST | print_in_columns
7771 echo "External libraries providing hardware acceleration:"
7772 print_enabled '' $HWACCEL_LIBRARY_LIST $HWACCEL_AUTODETECT_LIBRARY_LIST | print_in_columns
7776 print_enabled '' $LIBRARY_LIST | print_in_columns
7780 print_enabled '' $PROGRAM_LIST | print_in_columns
7783 for type in decoder encoder hwaccel parser demuxer muxer protocol filter bsf indev outdev; do
7784 echo "Enabled ${type}s:"
7785 eval list=\$$(toupper $type)_LIST
7786 print_enabled '_*' $list | print_in_columns
7790 if test -n "$ignore_tests"; then
7791 ignore_tests=$(echo $ignore_tests | tr ',' ' ')
7792 echo "Ignored FATE tests:"
7793 echo $ignore_tests | print_in_columns
7797 echo "License: $license"
7799 fi # test "$quiet" != "yes"
7801 if test -n "$WARN_IF_GETS_DISABLED_LIST"; then
7802 for cfg in $WARN_IF_GETS_DISABLED_LIST; do
7803 if disabled $cfg; then
7804 varname=${cfg}_disable_reason
7805 eval "warn \"Disabled $cfg because \$$varname\""
7810 if test -n "$WARNINGS"; then
7811 printf "\n%s%s$WARNINGS%s" "$warn_color" "$bold_color" "$reset_color"
7812 enabled fatal_warnings && exit 1
7815 test -e Makefile || echo "include $source_path/Makefile" > Makefile
7818 echo "$*" | sed 's/%/%25/g;s/:/%3a/g'
7821 echo "config:$arch:$subarch:$cpu:$target_os:$(esc $cc_ident):$(esc $FFMPEG_CONFIGURATION)" > ffbuild/config.fate
7823 enabled stripping || strip="echo skipping strip"
7824 enabled stripping || striptype=""
7826 config_files="$TMPH ffbuild/config.mak doc/config.texi"
7828 cat > ffbuild/config.mak <<EOF
7829 # Automatically generated by configure - do not modify!
7830 ifndef FFMPEG_CONFIG_MAK
7832 FFMPEG_CONFIGURATION=$FFMPEG_CONFIGURATION
7834 LIBDIR=\$(DESTDIR)$libdir
7835 SHLIBDIR=\$(DESTDIR)$shlibdir
7836 INCDIR=\$(DESTDIR)$incdir
7837 BINDIR=\$(DESTDIR)$bindir
7838 DATADIR=\$(DESTDIR)$datadir
7839 DOCDIR=\$(DESTDIR)$docdir
7840 MANDIR=\$(DESTDIR)$mandir
7841 PKGCONFIGDIR=\$(DESTDIR)$pkgconfigdir
7842 INSTALL_NAME_DIR=$install_name_dir
7843 SRC_PATH=$source_path
7844 SRC_LINK=$source_link
7845 ifndef MAIN_MAKEFILE
7846 SRC_PATH:=\$(SRC_PATH:.%=..%)
7850 INTRINSICS=$intrinsics
7851 EXTERN_PREFIX=$extern_prefix
7858 DEPCCFLAGS=$DEPCCFLAGS \$(CPPFLAGS)
7860 DEPASFLAGS=$DEPASFLAGS \$(CPPFLAGS)
7862 DEPX86ASM=$x86asmexe
7863 DEPX86ASMFLAGS=\$(X86ASMFLAGS)
7873 STRIPTYPE=$striptype
7880 OBJCCFLAGS=$OBJCFLAGS
7882 NVCCFLAGS=$nvccflags
7903 LDEXEFLAGS=$LDEXEFLAGS
7904 LDSOFLAGS=$LDSOFLAGS
7905 SHFLAGS=$(echo $($ldflags_filter $SHFLAGS))
7906 ASMSTRIPFLAGS=$ASMSTRIPFLAGS
7907 X86ASMFLAGS=$X86ASMFLAGS
7911 LASXFLAGS=$LASXFLAGS
7912 BUILDSUF=$build_suffix
7913 PROGSSUF=$progs_suffix
7921 EXTRA_VERSION=$extra_version
7924 CCDEP_FLAGS=$CCDEP_FLAGS
7926 ASDEP_FLAGS=$ASDEP_FLAGS
7927 X86ASMDEP=$X86ASMDEP
7928 X86ASMDEP_FLAGS=$X86ASMDEP_FLAGS
7929 CC_DEPFLAGS=$CC_DEPFLAGS
7930 CXX_DEPFLAGS=$CXX_DEPFLAGS
7931 OBJCC_DEPFLAGS=$OBJC_DEPFLAGS
7932 AS_DEPFLAGS=$AS_DEPFLAGS
7933 X86ASM_DEPFLAGS=$X86ASM_DEPFLAGS
7936 HOSTCFLAGS=$host_cflags
7937 HOSTCPPFLAGS=$host_cppflags
7938 HOSTEXESUF=$HOSTEXESUF
7939 HOSTLDFLAGS=$host_ldflags
7940 HOSTEXTRALIBS=$host_extralibs
7942 DEPHOSTCCFLAGS=$DEPHOSTCCFLAGS \$(HOSTCCFLAGS)
7943 HOSTCCDEP=$HOSTCCDEP
7944 HOSTCCDEP_FLAGS=$HOSTCCDEP_FLAGS
7945 HOSTCC_DEPFLAGS=$HOSTCC_DEPFLAGS
7949 TARGET_EXEC=$target_exec $target_exec_args
7950 TARGET_PATH=$target_path
7951 TARGET_SAMPLES=${target_samples:-\$(SAMPLES)}
7952 CFLAGS-ffplay=${sdl2_cflags}
7953 CFLAGS_HEADERS=$CFLAGS_HEADERS
7954 LIB_INSTALL_EXTRA_CMD=$LIB_INSTALL_EXTRA_CMD
7955 EXTRALIBS=$extralibs
7956 COMPAT_OBJS=$compat_objs
7958 LIBTARGET=${LIBTARGET}
7959 SLIBNAME=${SLIBNAME}
7960 SLIBNAME_WITH_VERSION=${SLIBNAME_WITH_VERSION}
7961 SLIBNAME_WITH_MAJOR=${SLIBNAME_WITH_MAJOR}
7962 SLIB_CREATE_DEF_CMD=${SLIB_CREATE_DEF_CMD}
7963 SLIB_EXTRA_CMD=${SLIB_EXTRA_CMD}
7964 SLIB_INSTALL_NAME=${SLIB_INSTALL_NAME}
7965 SLIB_INSTALL_LINKS=${SLIB_INSTALL_LINKS}
7966 SLIB_INSTALL_EXTRA_LIB=${SLIB_INSTALL_EXTRA_LIB}
7967 SLIB_INSTALL_EXTRA_SHLIB=${SLIB_INSTALL_EXTRA_SHLIB}
7968 VERSION_SCRIPT_POSTPROCESS_CMD=${VERSION_SCRIPT_POSTPROCESS_CMD}
7969 SAMPLES:=${samples:-\$(FATE_SAMPLES)}
7970 NOREDZONE_FLAGS=$noredzone_flags
7971 LIBFUZZER_PATH=$libfuzzer_path
7972 IGNORE_TESTS=$ignore_tests
7975 map 'eval echo "${v}_FFLIBS=\$${v}_deps" >> ffbuild/config.mak' $LIBRARY_LIST
7977 for entry in $LIBRARY_LIST $PROGRAM_LIST $EXTRALIBS_LIST; do
7978 eval echo "EXTRALIBS-${entry}=\$${entry}_extralibs" >> ffbuild/config.mak
7982 /* Automatically generated by configure - do not modify! */
7983 #ifndef FFMPEG_CONFIG_H
7984 #define FFMPEG_CONFIG_H
7985 #define FFMPEG_CONFIGURATION "$(c_escape $FFMPEG_CONFIGURATION)"
7986 #define FFMPEG_LICENSE "$(c_escape $license)"
7987 #define CONFIG_THIS_YEAR 2023
7988 #define FFMPEG_DATADIR "$(eval c_escape $datadir)"
7989 #define AVCONV_DATADIR "$(eval c_escape $datadir)"
7990 #define CC_IDENT "$(c_escape ${cc_ident:-Unknown compiler})"
7991 #define OS_NAME $target_os
7992 #define av_restrict $restrict_keyword
7993 #define EXTERN_PREFIX "${extern_prefix}"
7994 #define EXTERN_ASM ${extern_prefix}
7995 #define BUILDSUF "$build_suffix"
7996 #define SLIBSUF "$SLIBSUF"
7997 #define HAVE_MMX2 HAVE_MMXEXT
7998 #define SWS_MAX_FILTER_SIZE $sws_max_filter_size
8001 test -n "$assert_level" &&
8002 echo "#define ASSERT_LEVEL $assert_level" >>$TMPH
8004 test -n "$malloc_prefix" &&
8005 echo "#define MALLOC_PREFIX $malloc_prefix" >>$TMPH
8008 echo "#define AS_ARCH_LEVEL $as_arch_level" >>$TMPH
8010 if enabled x86asm; then
8011 append config_files $TMPASM
8013 ; Automatically generated by configure - do not modify!
8017 enabled getenv || echo "#define getenv(x) NULL" >> $TMPH
8023 echo "@c auto-generated by configure - do not modify! " > doc/config.texi
8025 print_config ARCH_ "$config_files" $ARCH_LIST
8026 print_config HAVE_ "$config_files" $HAVE_LIST
8027 print_config CONFIG_ "$config_files" $CONFIG_LIST \
8030 echo "#endif /* FFMPEG_CONFIG_H */" >> $TMPH
8032 # Do not overwrite an unchanged config.h to avoid superfluous rebuilds.
8033 cp_if_changed $TMPH config.h
8034 touch ffbuild/.config
8036 # Copy config.asm before printing ALL_COMPONENTS; that's not needed in assembly.
8037 enabled x86asm && cp_if_changed $TMPASM config.asm
8039 # Reopen a new TMPH for config_components.h.
8041 /* Automatically generated by configure - do not modify! */
8042 #ifndef FFMPEG_CONFIG_COMPONENTS_H
8043 #define FFMPEG_CONFIG_COMPONENTS_H
8046 print_config CONFIG_ "$config_files" $ALL_COMPONENTS
8048 echo "#endif /* FFMPEG_CONFIG_COMPONENTS_H */" >> $TMPH
8049 echo "endif # FFMPEG_CONFIG_MAK" >> ffbuild/config.mak
8051 cp_if_changed $TMPH config_components.h
8054 /* Generated by ffmpeg configure */
8055 #ifndef AVUTIL_AVCONFIG_H
8056 #define AVUTIL_AVCONFIG_H
8059 print_config AV_HAVE_ $TMPH $HAVE_LIST_PUB
8061 echo "#endif /* AVUTIL_AVCONFIG_H */" >> $TMPH
8063 cp_if_changed $TMPH libavutil/avconfig.h
8065 # full_filter_name_foo=vf_foo
8066 # full_filter_name_bar=asrc_bar
8068 eval "$(sed -n "s/^extern const AVFilter ff_\([avfsinkrc]\{2,5\}\)_\(.*\);/full_filter_name_\2=\1_\2/p" $source_path/libavfilter/allfilters.c)"
8070 # generate the lists of enabled components
8071 print_enabled_components(){
8076 echo "static const $struct_name * const $name[] = {" > $TMPH
8081 eval c=\$full_filter_name_${c%_filter}
8084 c=${c%_indev}_demuxer
8087 c=${c%_outdev}_muxer
8090 printf " &ff_%s,\n" $c >> $TMPH
8093 if [ "$name" = "filter_list" ]; then
8094 for c in asrc_abuffer vsrc_buffer asink_abuffer vsink_buffer; do
8095 printf " &ff_%s,\n" $c >> $TMPH
8098 echo " NULL };" >> $TMPH
8099 cp_if_changed $TMPH $file
8102 print_enabled_components libavfilter/filter_list.c AVFilter filter_list $FILTER_LIST
8103 print_enabled_components libavcodec/codec_list.c FFCodec codec_list $CODEC_LIST
8104 print_enabled_components libavcodec/parser_list.c AVCodecParser parser_list $PARSER_LIST
8105 print_enabled_components libavcodec/bsf_list.c FFBitStreamFilter bitstream_filters $BSF_LIST
8106 print_enabled_components libavformat/demuxer_list.c AVInputFormat demuxer_list $DEMUXER_LIST
8107 print_enabled_components libavformat/muxer_list.c FFOutputFormat muxer_list $MUXER_LIST
8108 print_enabled_components libavdevice/indev_list.c AVInputFormat indev_list $INDEV_LIST
8109 print_enabled_components libavdevice/outdev_list.c FFOutputFormat outdev_list $OUTDEV_LIST
8110 print_enabled_components libavformat/protocol_list.c URLProtocol url_protocols $PROTOCOL_LIST
8112 # Settings for pkg-config files
8115 # Automatically generated by configure - do not modify!
8117 build_suffix=$build_suffix
8121 rpath=$(enabled rpath && echo "-Wl,-rpath,\${libdir}")
8122 source_path=${source_path}
8125 extralibs_avutil="$avutil_extralibs"
8126 extralibs_avcodec="$avcodec_extralibs"
8127 extralibs_avformat="$avformat_extralibs"
8128 extralibs_avdevice="$avdevice_extralibs"
8129 extralibs_avfilter="$avfilter_extralibs"
8130 extralibs_postproc="$postproc_extralibs"
8131 extralibs_swscale="$swscale_extralibs"
8132 extralibs_swresample="$swresample_extralibs"
8135 for lib in $LIBRARY_LIST; do
8136 lib_deps="$(eval echo \$${lib}_deps)"
8137 echo ${lib}_deps=\"$lib_deps\" >> $TMPH
8140 cp_if_changed $TMPH ffbuild/config.sh