avutil/tests/opt: test values > INT_MAX for INT64 type
[FFMpeg-mirror.git] / configure
blobed74583a6f35234eeb5a853c3608a1c24b6d36fc
1 #!/bin/sh
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.
11 LC_ALL=C
12 export LC_ALL
14 # make sure we are running under a compatible shell
15 # try to make this part work with most shells
17 try_exec(){
18 echo "Trying shell $1"
19 type "$1" > /dev/null 2>&1 && exec "$@"
22 unset foo
23 (: ${foo%%bar}) 2> /dev/null
24 E1="$?"
26 (: ${foo?}) 2> /dev/null
27 E2="$?"
29 if test "$E1" != 0 || test "$E2" = 0; then
30 echo "Broken shell detected. Trying alternatives."
31 export FF_CONF_EXEC
32 if test "0$FF_CONF_EXEC" -lt 1; then
33 FF_CONF_EXEC=1
34 try_exec bash "$0" "$@"
36 if test "0$FF_CONF_EXEC" -lt 2; then
37 FF_CONF_EXEC=2
38 try_exec ksh "$0" "$@"
40 if test "0$FF_CONF_EXEC" -lt 3; then
41 FF_CONF_EXEC=3
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."
54 exit 1
57 test -d /usr/xpg4/bin && PATH=/usr/xpg4/bin:$PATH
59 show_help(){
60 cat <<EOF
61 Usage: configure [options]
62 Options: [defaults in brackets after descriptions]
64 Help options:
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
79 Standard options:
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
97 Licensing options:
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]
114 Program options:
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
127 Component options:
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-iamf disable support for Immersive Audio Model
144 --disable-pixelutils disable pixel utils in libavutil
146 Individual component options:
147 --disable-everything disable all components listed below
148 --disable-encoder=NAME disable encoder NAME
149 --enable-encoder=NAME enable encoder NAME
150 --disable-encoders disable all encoders
151 --disable-decoder=NAME disable decoder NAME
152 --enable-decoder=NAME enable decoder NAME
153 --disable-decoders disable all decoders
154 --disable-hwaccel=NAME disable hwaccel NAME
155 --enable-hwaccel=NAME enable hwaccel NAME
156 --disable-hwaccels disable all hwaccels
157 --disable-muxer=NAME disable muxer NAME
158 --enable-muxer=NAME enable muxer NAME
159 --disable-muxers disable all muxers
160 --disable-demuxer=NAME disable demuxer NAME
161 --enable-demuxer=NAME enable demuxer NAME
162 --disable-demuxers disable all demuxers
163 --enable-parser=NAME enable parser NAME
164 --disable-parser=NAME disable parser NAME
165 --disable-parsers disable all parsers
166 --enable-bsf=NAME enable bitstream filter NAME
167 --disable-bsf=NAME disable bitstream filter NAME
168 --disable-bsfs disable all bitstream filters
169 --enable-protocol=NAME enable protocol NAME
170 --disable-protocol=NAME disable protocol NAME
171 --disable-protocols disable all protocols
172 --enable-indev=NAME enable input device NAME
173 --disable-indev=NAME disable input device NAME
174 --disable-indevs disable input devices
175 --enable-outdev=NAME enable output device NAME
176 --disable-outdev=NAME disable output device NAME
177 --disable-outdevs disable output devices
178 --disable-devices disable all devices
179 --enable-filter=NAME enable filter NAME
180 --disable-filter=NAME disable filter NAME
181 --disable-filters disable all filters
183 External library support:
185 Using any of the following switches will allow FFmpeg to link to the
186 corresponding external library. All the components depending on that library
187 will become enabled, if all their other dependencies are met and they are not
188 explicitly disabled. E.g. --enable-libopus will enable linking to
189 libopus and allow the libopus encoder to be built, unless it is
190 specifically disabled with --disable-encoder=libopus.
192 Note that only the system libraries are auto-detected. All the other external
193 libraries must be explicitly enabled.
195 Also note that the following help text describes the purpose of the libraries
196 themselves, not all their features will necessarily be usable by FFmpeg.
198 --disable-alsa disable ALSA support [autodetect]
199 --disable-appkit disable Apple AppKit framework [autodetect]
200 --disable-avfoundation disable Apple AVFoundation framework [autodetect]
201 --enable-avisynth enable reading of AviSynth script files [no]
202 --disable-bzlib disable bzlib [autodetect]
203 --disable-coreimage disable Apple CoreImage framework [autodetect]
204 --enable-chromaprint enable audio fingerprinting with chromaprint [no]
205 --enable-frei0r enable frei0r video filtering [no]
206 --enable-gcrypt enable gcrypt, needed for rtmp(t)e support
207 if openssl, librtmp or gmp is not used [no]
208 --enable-gmp enable gmp, needed for rtmp(t)e support
209 if openssl or librtmp is not used [no]
210 --enable-gnutls enable gnutls, needed for https support
211 if openssl, libtls or mbedtls is not used [no]
212 --disable-iconv disable iconv [autodetect]
213 --enable-jni enable JNI support [no]
214 --enable-ladspa enable LADSPA audio filtering [no]
215 --enable-lcms2 enable ICC profile support via LittleCMS 2 [no]
216 --enable-libaom enable AV1 video encoding/decoding via libaom [no]
217 --enable-libaribb24 enable ARIB text and caption decoding via libaribb24 [no]
218 --enable-libaribcaption enable ARIB text and caption decoding via libaribcaption [no]
219 --enable-libass enable libass subtitles rendering,
220 needed for subtitles and ass filter [no]
221 --enable-libbluray enable BluRay reading using libbluray [no]
222 --enable-libbs2b enable bs2b DSP library [no]
223 --enable-libcaca enable textual display using libcaca [no]
224 --enable-libcelt enable CELT decoding via libcelt [no]
225 --enable-libcdio enable audio CD grabbing with libcdio [no]
226 --enable-libcodec2 enable codec2 en/decoding using libcodec2 [no]
227 --enable-libdav1d enable AV1 decoding via libdav1d [no]
228 --enable-libdavs2 enable AVS2 decoding via libdavs2 [no]
229 --enable-libdc1394 enable IIDC-1394 grabbing using libdc1394
230 and libraw1394 [no]
231 --enable-libdvdnav enable libdvdnav, needed for DVD demuxing [no]
232 --enable-libdvdread enable libdvdread, needed for DVD demuxing [no]
233 --enable-libfdk-aac enable AAC de/encoding via libfdk-aac [no]
234 --enable-libflite enable flite (voice synthesis) support via libflite [no]
235 --enable-libfontconfig enable libfontconfig, useful for drawtext filter [no]
236 --enable-libfreetype enable libfreetype, needed for drawtext filter [no]
237 --enable-libfribidi enable libfribidi, improves drawtext filter [no]
238 --enable-libharfbuzz enable libharfbuzz, needed for drawtext filter [no]
239 --enable-libglslang enable GLSL->SPIRV compilation via libglslang [no]
240 --enable-libgme enable Game Music Emu via libgme [no]
241 --enable-libgsm enable GSM de/encoding via libgsm [no]
242 --enable-libiec61883 enable iec61883 via libiec61883 [no]
243 --enable-libilbc enable iLBC de/encoding via libilbc [no]
244 --enable-libjack enable JACK audio sound server [no]
245 --enable-libjxl enable JPEG XL de/encoding via libjxl [no]
246 --enable-libklvanc enable Kernel Labs VANC processing [no]
247 --enable-libkvazaar enable HEVC encoding via libkvazaar [no]
248 --enable-liblc3 enable LC3 de/encoding via liblc3 [no]
249 --enable-liblensfun enable lensfun lens correction [no]
250 --enable-libmodplug enable ModPlug via libmodplug [no]
251 --enable-libmp3lame enable MP3 encoding via libmp3lame [no]
252 --enable-libopencore-amrnb enable AMR-NB de/encoding via libopencore-amrnb [no]
253 --enable-libopencore-amrwb enable AMR-WB decoding via libopencore-amrwb [no]
254 --enable-libopencv enable video filtering via libopencv [no]
255 --enable-libopenh264 enable H.264 encoding via OpenH264 [no]
256 --enable-libopenjpeg enable JPEG 2000 de/encoding via OpenJPEG [no]
257 --enable-libopenmpt enable decoding tracked files via libopenmpt [no]
258 --enable-libopenvino enable OpenVINO as a DNN module backend
259 for DNN based filters like dnn_processing [no]
260 --enable-libopus enable Opus de/encoding via libopus [no]
261 --enable-libplacebo enable libplacebo library [no]
262 --enable-libpulse enable Pulseaudio input via libpulse [no]
263 --enable-libqrencode enable QR encode generation via libqrencode [no]
264 --enable-libquirc enable QR decoding via libquirc [no]
265 --enable-librabbitmq enable RabbitMQ library [no]
266 --enable-librav1e enable AV1 encoding via rav1e [no]
267 --enable-librist enable RIST via librist [no]
268 --enable-librsvg enable SVG rasterization via librsvg [no]
269 --enable-librubberband enable rubberband needed for rubberband filter [no]
270 --enable-librtmp enable RTMP[E] support via librtmp [no]
271 --enable-libshaderc enable GLSL->SPIRV compilation via libshaderc [no]
272 --enable-libshine enable fixed-point MP3 encoding via libshine [no]
273 --enable-libsmbclient enable Samba protocol via libsmbclient [no]
274 --enable-libsnappy enable Snappy compression, needed for hap encoding [no]
275 --enable-libsoxr enable Include libsoxr resampling [no]
276 --enable-libspeex enable Speex de/encoding via libspeex [no]
277 --enable-libsrt enable Haivision SRT protocol via libsrt [no]
278 --enable-libssh enable SFTP protocol via libssh [no]
279 --enable-libsvtav1 enable AV1 encoding via SVT [no]
280 --enable-libtensorflow enable TensorFlow as a DNN module backend
281 for DNN based filters like sr [no]
282 --enable-libtesseract enable Tesseract, needed for ocr filter [no]
283 --enable-libtheora enable Theora encoding via libtheora [no]
284 --enable-libtls enable LibreSSL (via libtls), needed for https support
285 if openssl, gnutls or mbedtls is not used [no]
286 --enable-libtorch enable Torch as one DNN backend [no]
287 --enable-libtwolame enable MP2 encoding via libtwolame [no]
288 --enable-libuavs3d enable AVS3 decoding via libuavs3d [no]
289 --enable-libv4l2 enable libv4l2/v4l-utils [no]
290 --enable-libvidstab enable video stabilization using vid.stab [no]
291 --enable-libvmaf enable vmaf filter via libvmaf [no]
292 --enable-libvo-amrwbenc enable AMR-WB encoding via libvo-amrwbenc [no]
293 --enable-libvorbis enable Vorbis en/decoding via libvorbis,
294 native implementation exists [no]
295 --enable-libvpx enable VP8 and VP9 de/encoding via libvpx [no]
296 --enable-libwebp enable WebP encoding via libwebp [no]
297 --enable-libx264 enable H.264 encoding via x264 [no]
298 --enable-libx265 enable HEVC encoding via x265 [no]
299 --enable-libxeve enable EVC encoding via libxeve [no]
300 --enable-libxevd enable EVC decoding via libxevd [no]
301 --enable-libxavs enable AVS encoding via xavs [no]
302 --enable-libxavs2 enable AVS2 encoding via xavs2 [no]
303 --enable-libxcb enable X11 grabbing using XCB [autodetect]
304 --enable-libxcb-shm enable X11 grabbing shm communication [autodetect]
305 --enable-libxcb-xfixes enable X11 grabbing mouse rendering [autodetect]
306 --enable-libxcb-shape enable X11 grabbing shape rendering [autodetect]
307 --enable-libxvid enable Xvid encoding via xvidcore,
308 native MPEG-4/Xvid encoder exists [no]
309 --enable-libxml2 enable XML parsing using the C library libxml2, needed
310 for dash and imf demuxing support [no]
311 --enable-libzimg enable z.lib, needed for zscale filter [no]
312 --enable-libzmq enable message passing via libzmq [no]
313 --enable-libzvbi enable teletext support via libzvbi [no]
314 --enable-lv2 enable LV2 audio filtering [no]
315 --disable-lzma disable lzma [autodetect]
316 --enable-decklink enable Blackmagic DeckLink I/O support [no]
317 --enable-mbedtls enable mbedTLS, needed for https support
318 if openssl, gnutls or libtls is not used [no]
319 --enable-mediacodec enable Android MediaCodec support [no]
320 --enable-mediafoundation enable encoding via MediaFoundation [auto]
321 --disable-metal disable Apple Metal framework [autodetect]
322 --enable-libmysofa enable libmysofa, needed for sofalizer filter [no]
323 --enable-openal enable OpenAL 1.1 capture support [no]
324 --enable-opencl enable OpenCL processing [no]
325 --enable-opengl enable OpenGL rendering [no]
326 --enable-openssl enable openssl, needed for https support
327 if gnutls, libtls or mbedtls is not used [no]
328 --enable-pocketsphinx enable PocketSphinx, needed for asr filter [no]
329 --disable-sndio disable sndio support [autodetect]
330 --disable-schannel disable SChannel SSP, needed for TLS support on
331 Windows if openssl and gnutls are not used [autodetect]
332 --disable-sdl2 disable sdl2 [autodetect]
333 --disable-securetransport disable Secure Transport, needed for TLS support
334 on OSX if openssl and gnutls are not used [autodetect]
335 --enable-vapoursynth enable VapourSynth demuxer [no]
336 --disable-xlib disable xlib [autodetect]
337 --disable-zlib disable zlib [autodetect]
339 The following libraries provide various hardware acceleration features:
340 --disable-amf disable AMF video encoding code [autodetect]
341 --disable-audiotoolbox disable Apple AudioToolbox code [autodetect]
342 --enable-cuda-nvcc enable Nvidia CUDA compiler [no]
343 --disable-cuda-llvm disable CUDA compilation using clang [autodetect]
344 --disable-cuvid disable Nvidia CUVID support [autodetect]
345 --disable-d3d11va disable Microsoft Direct3D 11 video acceleration code [autodetect]
346 --disable-d3d12va disable Microsoft Direct3D 12 video acceleration code [autodetect]
347 --disable-dxva2 disable Microsoft DirectX 9 video acceleration code [autodetect]
348 --disable-ffnvcodec disable dynamically linked Nvidia code [autodetect]
349 --disable-libdrm disable DRM code (Linux) [autodetect]
350 --enable-libmfx enable Intel MediaSDK (AKA Quick Sync Video) code via libmfx [no]
351 --enable-libvpl enable Intel oneVPL code via libvpl if libmfx is not used [no]
352 --enable-libnpp enable Nvidia Performance Primitives-based code [no]
353 --enable-mmal enable Broadcom Multi-Media Abstraction Layer (Raspberry Pi) via MMAL [no]
354 --disable-nvdec disable Nvidia video decoding acceleration (via hwaccel) [autodetect]
355 --disable-nvenc disable Nvidia video encoding code [autodetect]
356 --enable-omx enable OpenMAX IL code [no]
357 --enable-omx-rpi enable OpenMAX IL code for Raspberry Pi [no]
358 --enable-rkmpp enable Rockchip Media Process Platform code [no]
359 --disable-v4l2-m2m disable V4L2 mem2mem code [autodetect]
360 --disable-vaapi disable Video Acceleration API (mainly Unix/Intel) code [autodetect]
361 --disable-vdpau disable Nvidia Video Decode and Presentation API for Unix code [autodetect]
362 --disable-videotoolbox disable VideoToolbox code [autodetect]
363 --disable-vulkan disable Vulkan code [autodetect]
365 Toolchain options:
366 --arch=ARCH select architecture [$arch]
367 --cpu=CPU select the minimum required CPU (affects
368 instruction selection, may crash on older CPUs)
369 --cross-prefix=PREFIX use PREFIX for compilation tools [$cross_prefix]
370 --progs-suffix=SUFFIX program name suffix []
371 --enable-cross-compile assume a cross-compiler is used
372 --sysroot=PATH root of cross-build tree
373 --sysinclude=PATH location of cross-build system headers
374 --target-os=OS compiler targets OS [$target_os]
375 --target-exec=CMD command to run executables on target
376 --target-path=DIR path to view of build directory on target
377 --target-samples=DIR path to samples directory on target
378 --tempprefix=PATH force fixed dir/prefix instead of mktemp for checks
379 --toolchain=NAME set tool defaults according to NAME
380 (gcc-asan, clang-asan, gcc-msan, clang-msan,
381 gcc-tsan, clang-tsan, gcc-usan, clang-usan,
382 valgrind-massif, valgrind-memcheck,
383 msvc, icl, gcov, llvm-cov, hardened)
384 --nm=NM use nm tool NM [$nm_default]
385 --ar=AR use archive tool AR [$ar_default]
386 --as=AS use assembler AS [$as_default]
387 --ln_s=LN_S use symbolic link tool LN_S [$ln_s_default]
388 --strip=STRIP use strip tool STRIP [$strip_default]
389 --windres=WINDRES use windows resource compiler WINDRES [$windres_default]
390 --x86asmexe=EXE use nasm-compatible assembler EXE [$x86asmexe_default]
391 --cc=CC use C compiler CC [$cc_default]
392 --stdc=STDC use C standard STDC [$stdc_default]
393 --cxx=CXX use C compiler CXX [$cxx_default]
394 --stdcxx=STDCXX use C standard STDCXX [$stdcxx_default]
395 --objcc=OCC use ObjC compiler OCC [$cc_default]
396 --dep-cc=DEPCC use dependency generator DEPCC [$cc_default]
397 --nvcc=NVCC use Nvidia CUDA compiler NVCC or clang [$nvcc_default]
398 --ld=LD use linker LD [$ld_default]
399 --metalcc=METALCC use metal compiler METALCC [$metalcc_default]
400 --metallib=METALLIB use metal linker METALLIB [$metallib_default]
401 --pkg-config=PKGCONFIG use pkg-config tool PKGCONFIG [$pkg_config_default]
402 --pkg-config-flags=FLAGS pass additional flags to pkgconf []
403 --ranlib=RANLIB use ranlib RANLIB [$ranlib_default]
404 --doxygen=DOXYGEN use DOXYGEN to generate API doc [$doxygen_default]
405 --host-cc=HOSTCC use host C compiler HOSTCC
406 --host-cflags=HCFLAGS use HCFLAGS when compiling for host
407 --host-cppflags=HCPPFLAGS use HCPPFLAGS when compiling for host
408 --host-ld=HOSTLD use host linker HOSTLD
409 --host-ldflags=HLDFLAGS use HLDFLAGS when linking for host
410 --host-extralibs=HLIBS use libs HLIBS when linking for host
411 --host-os=OS compiler host OS [$target_os]
412 --extra-cflags=ECFLAGS add ECFLAGS to CFLAGS [$CFLAGS]
413 --extra-cxxflags=ECFLAGS add ECFLAGS to CXXFLAGS [$CXXFLAGS]
414 --extra-objcflags=FLAGS add FLAGS to OBJCFLAGS [$CFLAGS]
415 --extra-ldflags=ELDFLAGS add ELDFLAGS to LDFLAGS [$LDFLAGS]
416 --extra-ldexeflags=ELDFLAGS add ELDFLAGS to LDEXEFLAGS [$LDEXEFLAGS]
417 --extra-ldsoflags=ELDFLAGS add ELDFLAGS to LDSOFLAGS [$LDSOFLAGS]
418 --extra-libs=ELIBS add ELIBS [$ELIBS]
419 --extra-version=STRING version string suffix []
420 --optflags=OPTFLAGS override optimization-related compiler flags
421 --nvccflags=NVCCFLAGS override nvcc flags [$nvccflags_default]
422 --build-suffix=SUFFIX library name suffix []
423 --enable-pic build position-independent code
424 --enable-thumb compile for Thumb instruction set
425 --enable-lto[=arg] use link-time optimization
426 --env="ENV=override" override the environment variables
428 Advanced options (experts only):
429 --malloc-prefix=PREFIX prefix malloc and related names with PREFIX
430 --custom-allocator=NAME use a supported custom allocator
431 --disable-symver disable symbol versioning
432 --enable-hardcoded-tables use hardcoded tables instead of runtime generation
433 --disable-safe-bitstream-reader
434 disable buffer boundary checking in bitreaders
435 (faster, but may crash)
436 --sws-max-filter-size=N the max filter size swscale uses [$sws_max_filter_size_default]
438 Optimization options (experts only):
439 --disable-asm disable all assembly optimizations
440 --disable-altivec disable AltiVec optimizations
441 --disable-vsx disable VSX optimizations
442 --disable-power8 disable POWER8 optimizations
443 --disable-amd3dnow disable 3DNow! optimizations
444 --disable-amd3dnowext disable 3DNow! extended optimizations
445 --disable-mmx disable MMX optimizations
446 --disable-mmxext disable MMXEXT optimizations
447 --disable-sse disable SSE optimizations
448 --disable-sse2 disable SSE2 optimizations
449 --disable-sse3 disable SSE3 optimizations
450 --disable-ssse3 disable SSSE3 optimizations
451 --disable-sse4 disable SSE4 optimizations
452 --disable-sse42 disable SSE4.2 optimizations
453 --disable-avx disable AVX optimizations
454 --disable-xop disable XOP optimizations
455 --disable-fma3 disable FMA3 optimizations
456 --disable-fma4 disable FMA4 optimizations
457 --disable-avx2 disable AVX2 optimizations
458 --disable-avx512 disable AVX-512 optimizations
459 --disable-avx512icl disable AVX-512ICL optimizations
460 --disable-aesni disable AESNI optimizations
461 --disable-armv5te disable armv5te optimizations
462 --disable-armv6 disable armv6 optimizations
463 --disable-armv6t2 disable armv6t2 optimizations
464 --disable-vfp disable VFP optimizations
465 --disable-neon disable NEON optimizations
466 --disable-dotprod disable DOTPROD optimizations
467 --disable-i8mm disable I8MM optimizations
468 --disable-inline-asm disable use of inline assembly
469 --disable-x86asm disable use of standalone x86 assembly
470 --disable-mipsdsp disable MIPS DSP ASE R1 optimizations
471 --disable-mipsdspr2 disable MIPS DSP ASE R2 optimizations
472 --disable-msa disable MSA optimizations
473 --disable-mipsfpu disable floating point MIPS optimizations
474 --disable-mmi disable Loongson MMI optimizations
475 --disable-lsx disable Loongson LSX optimizations
476 --disable-lasx disable Loongson LASX optimizations
477 --disable-rvv disable RISC-V Vector optimizations
478 --disable-fast-unaligned consider unaligned accesses slow
480 Developer options (useful when working on FFmpeg itself):
481 --disable-debug disable debugging symbols
482 --enable-debug=LEVEL set the debug level [$debuglevel]
483 --disable-optimizations disable compiler optimizations
484 --enable-extra-warnings enable more compiler warnings
485 --disable-stripping disable stripping of executables and shared libraries
486 --assert-level=level 0(default), 1 or 2, amount of assertion testing,
487 2 causes a slowdown at runtime.
488 --enable-memory-poisoning fill heap uninitialized allocated space with arbitrary data
489 --valgrind=VALGRIND run "make fate" tests through valgrind to detect memory
490 leaks and errors, using the specified valgrind binary.
491 Cannot be combined with --target-exec
492 --enable-ftrapv Trap arithmetic overflows
493 --samples=PATH location of test samples for FATE, if not set use
494 \$FATE_SAMPLES at make invocation time.
495 --enable-neon-clobber-test check NEON registers for clobbering (should be
496 used only for debugging purposes)
497 --enable-xmm-clobber-test check XMM registers for clobbering (Win64-only;
498 should be used only for debugging purposes)
499 --enable-random randomly enable/disable components
500 --disable-random
501 --enable-random=LIST randomly enable/disable specific components or
502 --disable-random=LIST component groups. LIST is a comma-separated list
503 of NAME[:PROB] entries where NAME is a component
504 (group) and PROB the probability associated with
505 NAME (default 0.5).
506 --random-seed=VALUE seed value for --enable/disable-random
507 --disable-valgrind-backtrace do not print a backtrace under Valgrind
508 (only applies to --disable-optimizations builds)
509 --enable-ossfuzz Enable building fuzzer tool
510 --libfuzzer=PATH path to libfuzzer
511 --ignore-tests=TESTS comma-separated list (without "fate-" prefix
512 in the name) of tests whose result is ignored
513 --enable-linux-perf enable Linux Performance Monitor API
514 --enable-macos-kperf enable macOS kperf (private) API
515 --disable-large-tests disable tests that use a large amount of memory
516 --disable-ptx-compression don't compress CUDA PTX code even when possible
517 --disable-version-tracking don't include the git/release version in the build
519 NOTE: Object files are built at the place where configure is launched.
521 exit 0
524 if test -t 1 && which tput >/dev/null 2>&1; then
525 ncolors=$(tput colors)
526 if test -n "$ncolors" && test $ncolors -ge 8; then
527 bold_color=$(tput bold)
528 warn_color=$(tput setaf 3)
529 error_color=$(tput setaf 1)
530 reset_color=$(tput sgr0)
532 # 72 used instead of 80 since that's the default of pr
533 ncols=$(tput cols)
535 : ${ncols:=72}
537 log(){
538 echo "$@" >> $logfile
541 log_file(){
542 log BEGIN "$1"
543 log_file_i=1
544 while IFS= read -r log_file_line; do
545 printf '%5d\t%s\n' "$log_file_i" "$log_file_line"
546 log_file_i=$(($log_file_i+1))
547 done < "$1" >> "$logfile"
548 log END "$1"
551 warn(){
552 log "WARNING: $*"
553 WARNINGS="${WARNINGS}WARNING: $*\n"
556 die(){
557 log "$@"
558 echo "$error_color$bold_color$@$reset_color"
559 cat <<EOF
561 If you think configure made a mistake, make sure you are using the latest
562 version from Git. If the latest version fails, report the problem to the
563 ffmpeg-user@ffmpeg.org mailing list or IRC #ffmpeg on irc.libera.chat.
565 if disabled logging; then
566 cat <<EOF
567 Rerun configure with logging enabled (do not use --disable-logging), and
568 include the log this produces with your report.
570 else
571 cat <<EOF
572 Include the log file "$logfile" produced by configure as this will help
573 solve the problem.
576 exit 1
579 # Avoid locale weirdness, besides we really just want to translate ASCII.
580 toupper(){
581 echo "$@" | tr abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ
584 tolower(){
585 echo "$@" | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz
588 c_escape(){
589 echo "$*" | sed 's/["\\]/\\\0/g'
592 sh_quote(){
593 v=$(echo "$1" | sed "s/'/'\\\\''/g")
594 test "x$v" = "x${v#*[!A-Za-z0-9_/.+-]}" || v="'$v'"
595 echo "$v"
598 cleanws(){
599 echo "$@" | sed 's/^ *//;s/[[:space:]][[:space:]]*/ /g;s/ *$//'
602 filter(){
603 pat=$1
604 shift
605 for v; do
606 eval "case '$v' in $pat) printf '%s ' '$v' ;; esac"
607 done
610 filter_out(){
611 pat=$1
612 shift
613 for v; do
614 eval "case '$v' in $pat) ;; *) printf '%s ' '$v' ;; esac"
615 done
618 map(){
619 m=$1
620 shift
621 for v; do eval $m; done
624 add_suffix(){
625 suffix=$1
626 shift
627 for v; do echo ${v}${suffix}; done
630 remove_suffix(){
631 suffix=$1
632 shift
633 for v; do echo ${v%$suffix}; done
636 set_all(){
637 value=$1
638 shift
639 for var in $*; do
640 eval $var=$value
641 done
644 set_weak(){
645 value=$1
646 shift
647 for var; do
648 eval : \${$var:=$value}
649 done
652 sanitize_var_name(){
653 echo $@ | sed 's/[^A-Za-z0-9_]/_/g'
656 set_sanitized(){
657 var=$1
658 shift
659 eval $(sanitize_var_name "$var")='$*'
662 get_sanitized(){
663 eval echo \$$(sanitize_var_name "$1")
666 pushvar(){
667 for pvar in $*; do
668 eval level=\${${pvar}_level:=0}
669 eval ${pvar}_${level}="\$$pvar"
670 eval ${pvar}_level=$(($level+1))
671 done
674 popvar(){
675 for pvar in $*; do
676 eval level=\${${pvar}_level:-0}
677 test $level = 0 && continue
678 eval level=$(($level-1))
679 eval $pvar="\${${pvar}_${level}}"
680 eval ${pvar}_level=$level
681 eval unset ${pvar}_${level}
682 done
685 request(){
686 for var in $*; do
687 eval ${var}_requested=yes
688 eval $var=
689 done
692 warn_if_gets_disabled(){
693 for var in $*; do
694 WARN_IF_GETS_DISABLED_LIST="$WARN_IF_GETS_DISABLED_LIST $var"
695 done
698 enable(){
699 set_all yes $*
702 disable(){
703 set_all no $*
706 disable_with_reason(){
707 disable $1
708 eval "${1}_disable_reason=\"$2\""
709 if requested $1; then
710 die "ERROR: $1 requested, but $2"
714 enable_weak(){
715 set_weak yes $*
718 disable_weak(){
719 set_weak no $*
722 enable_sanitized(){
723 for var; do
724 enable $(sanitize_var_name $var)
725 done
728 disable_sanitized(){
729 for var; do
730 disable $(sanitize_var_name $var)
731 done
734 do_enable_deep(){
735 for var; do
736 enabled $var && continue
737 set -- $var
738 eval enable_deep \$${var}_select
739 var=$1
740 eval enable_deep_weak \$${var}_suggest
741 done
744 enable_deep(){
745 do_enable_deep $*
746 enable $*
749 enable_deep_weak(){
750 for var; do
751 disabled $var && continue
752 set -- $var
753 do_enable_deep $var
754 var=$1
755 enable_weak $var
756 done
759 requested(){
760 test "${1#!}" = "$1" && op="=" || op="!="
761 eval test "x\$${1#!}_requested" $op "xyes"
764 enabled(){
765 test "${1#!}" = "$1" && op="=" || op="!="
766 eval test "x\$${1#!}" $op "xyes"
769 disabled(){
770 test "${1#!}" = "$1" && op="=" || op="!="
771 eval test "x\$${1#!}" $op "xno"
774 enabled_all(){
775 for opt; do
776 enabled $opt || return 1
777 done
780 disabled_all(){
781 for opt; do
782 disabled $opt || return 1
783 done
786 enabled_any(){
787 for opt; do
788 enabled $opt && return 0
789 done
792 disabled_any(){
793 for opt; do
794 disabled $opt && return 0
795 done
796 return 1
799 set_default(){
800 for opt; do
801 eval : \${$opt:=\$${opt}_default}
802 done
805 is_in(){
806 value=$1
807 shift
808 for var in $*; do
809 [ $var = $value ] && return 0
810 done
811 return 1
814 # The cfg loop is very hot (several thousands iterations), and in bash also
815 # potentialy quite slow. Try to abort the iterations early, preferably without
816 # calling functions. 70%+ of the time cfg is already done or without deps.
817 check_deps(){
818 for cfg; do
819 eval [ x\$${cfg}_checking = xdone ] && continue
820 eval [ x\$${cfg}_checking = xinprogress ] && die "Circular dependency for $cfg."
822 eval "
823 dep_all=\$${cfg}_deps
824 dep_any=\$${cfg}_deps_any
825 dep_con=\$${cfg}_conflict
826 dep_sel=\$${cfg}_select
827 dep_sgs=\$${cfg}_suggest
828 dep_ifa=\$${cfg}_if
829 dep_ifn=\$${cfg}_if_any
832 # most of the time here $cfg has no deps - avoid costly no-op work
833 if [ "$dep_all$dep_any$dep_con$dep_sel$dep_sgs$dep_ifa$dep_ifn" ]; then
834 eval ${cfg}_checking=inprogress
836 set -- $cfg "$dep_all" "$dep_any" "$dep_con" "$dep_sel" "$dep_sgs" "$dep_ifa" "$dep_ifn"
837 check_deps $dep_all $dep_any $dep_con $dep_sel $dep_sgs $dep_ifa $dep_ifn
838 cfg=$1; dep_all=$2; dep_any=$3; dep_con=$4; dep_sel=$5 dep_sgs=$6; dep_ifa=$7; dep_ifn=$8
840 [ -n "$dep_ifa" ] && { enabled_all $dep_ifa && enable_weak $cfg; }
841 [ -n "$dep_ifn" ] && { enabled_any $dep_ifn && enable_weak $cfg; }
842 enabled_all $dep_all || { disable_with_reason $cfg "not all dependencies are satisfied: $dep_all"; }
843 enabled_any $dep_any || { disable_with_reason $cfg "not any dependency is satisfied: $dep_any"; }
844 disabled_all $dep_con || { disable_with_reason $cfg "some conflicting dependencies are unsatisfied: $dep_con"; }
845 disabled_any $dep_sel && { disable_with_reason $cfg "some selected dependency is unsatisfied: $dep_sel"; }
847 enabled $cfg && enable_deep_weak $dep_sel $dep_sgs
849 for dep in $dep_all $dep_any $dep_sel $dep_sgs; do
850 # filter out library deps, these do not belong in extralibs
851 is_in $dep $LIBRARY_LIST && continue
852 enabled $dep && eval append ${cfg}_extralibs ${dep}_extralibs
853 done
856 eval ${cfg}_checking=done
857 done
860 print_config(){
861 pfx=$1
862 files=$2
863 shift 2
864 map 'eval echo "$v \${$v:-no}"' "$@" |
865 awk "BEGIN { split(\"$files\", files) }
867 c = \"$pfx\" toupper(\$1);
868 v = \$2;
869 sub(/yes/, 1, v);
870 sub(/no/, 0, v);
871 for (f in files) {
872 file = files[f];
873 if (file ~ /\\.h\$/) {
874 printf(\"#define %s %d\\n\", c, v) >>file;
875 } else if (file ~ /\\.asm\$/) {
876 printf(\"%%define %s %d\\n\", c, v) >>file;
877 } else if (file ~ /\\.mak\$/) {
878 n = -v ? \"\" : \"!\";
879 printf(\"%s%s=yes\\n\", n, c) >>file;
880 } else if (file ~ /\\.texi\$/) {
881 pre = -v ? \"\" : \"@c \";
882 yesno = \$2;
883 c2 = tolower(c);
884 gsub(/_/, \"-\", c2);
885 printf(\"%s@set %s %s\\n\", pre, c2, yesno) >>file;
891 print_enabled(){
892 suf=$1
893 shift
894 for v; do
895 enabled $v && printf "%s\n" ${v%$suf}
896 done
899 append(){
900 var=$1
901 shift
902 eval "$var=\"\$$var $*\""
905 prepend(){
906 var=$1
907 shift
908 eval "$var=\"$* \$$var\""
911 reverse () {
912 eval '
913 reverse_out=
914 for v in $'$1'; do
915 reverse_out="$v $reverse_out"
916 done
917 '$1'=$reverse_out
921 # keeps the last occurence of each non-unique item
922 unique(){
923 unique_out=
924 eval unique_in=\$$1
925 reverse unique_in
926 for v in $unique_in; do
927 # " $unique_out" +space such that every item is surrounded with spaces
928 case " $unique_out" in *" $v "*) continue; esac # already in list
929 unique_out="$unique_out$v "
930 done
931 reverse unique_out
932 eval $1=\$unique_out
935 resolve(){
936 resolve_out=
937 eval resolve_in=\$$1
938 for v in $resolve_in; do
939 eval 'resolve_out="$resolve_out$'$v' "'
940 done
941 eval $1=\$resolve_out
944 add_cppflags(){
945 append CPPFLAGS "$@"
948 add_cflags(){
949 append CFLAGS $($cflags_filter "$@")
952 add_cflags_headers(){
953 append CFLAGS_HEADERS $($cflags_filter "$@")
956 add_cxxflags(){
957 append CXXFLAGS $($cflags_filter "$@")
960 add_objcflags(){
961 append OBJCFLAGS $($objcflags_filter "$@")
964 add_asflags(){
965 append ASFLAGS $($asflags_filter "$@")
968 add_ldflags(){
969 append LDFLAGS $($ldflags_filter "$@")
972 add_ldexeflags(){
973 append LDEXEFLAGS $($ldflags_filter "$@")
976 add_ldsoflags(){
977 append LDSOFLAGS $($ldflags_filter "$@")
980 add_extralibs(){
981 prepend extralibs $($ldflags_filter "$@")
984 add_stripflags(){
985 append ASMSTRIPFLAGS "$@"
988 add_host_cppflags(){
989 append host_cppflags "$@"
992 add_host_cflags(){
993 append host_cflags $($host_cflags_filter "$@")
996 add_host_ldflags(){
997 append host_ldflags $($host_ldflags_filter "$@")
1000 add_compat(){
1001 append compat_objs $1
1002 shift
1003 map 'add_cppflags -D$v' "$@"
1006 test_cmd(){
1007 log "$@"
1008 "$@" >> $logfile 2>&1
1011 test_stat(){
1012 log test_stat "$@"
1013 stat "$1" >> $logfile 2>&1
1016 cc_e(){
1017 eval printf '%s\\n' $CC_E
1020 cc_o(){
1021 eval printf '%s\\n' $CC_O
1024 as_o(){
1025 eval printf '%s\\n' $AS_O
1028 x86asm_o(){
1029 eval printf '%s\\n' $X86ASM_O
1032 ld_o(){
1033 eval printf '%s\\n' $LD_O
1036 hostcc_e(){
1037 eval printf '%s\\n' $HOSTCC_E
1040 hostcc_o(){
1041 eval printf '%s\\n' $HOSTCC_O
1044 nvcc_o(){
1045 eval printf '%s\\n' $NVCC_O
1048 test_cc(){
1049 log test_cc "$@"
1050 cat > $TMPC
1051 log_file $TMPC
1052 test_cmd $cc $CPPFLAGS $CFLAGS "$@" $CC_C $(cc_o $TMPO) $TMPC
1055 test_cxx(){
1056 log test_cxx "$@"
1057 cat > $TMPCPP
1058 log_file $TMPCPP
1059 test_cmd $cxx $CPPFLAGS $CFLAGS $CXXFLAGS "$@" $CXX_C -o $TMPO $TMPCPP
1062 test_objcc(){
1063 log test_objcc "$@"
1064 cat > $TMPM
1065 log_file $TMPM
1066 test_cmd $objcc -Werror=missing-prototypes $CPPFLAGS $CFLAGS $OBJCFLAGS "$@" $OBJCC_C $(cc_o $TMPO) $TMPM
1069 test_nvcc(){
1070 log test_nvcc "$@"
1071 cat > $TMPCU
1072 log_file $TMPCU
1073 tmpcu_=$TMPCU
1074 tmpo_=$TMPO
1075 [ -x "$(command -v cygpath)" ] && tmpcu_=$(cygpath -m $tmpcu_) && tmpo_=$(cygpath -m $tmpo_)
1076 test_cmd $nvcc $nvccflags "$@" $NVCC_C $(nvcc_o $tmpo_) $tmpcu_
1079 check_nvcc() {
1080 log check_nvcc "$@"
1081 name=$1
1082 shift 1
1083 disabled $name && return
1084 disable $name
1085 test_nvcc "$@" <<EOF && enable $name
1086 extern "C" {
1087 __global__ void hello(unsigned char *data) {}
1092 test_cpp(){
1093 log test_cpp "$@"
1094 cat > $TMPC
1095 log_file $TMPC
1096 test_cmd $cc $CPPFLAGS $CFLAGS "$@" $(cc_e $TMPO) $TMPC
1099 test_as(){
1100 log test_as "$@"
1101 cat > $TMPS
1102 log_file $TMPS
1103 test_cmd $as $CPPFLAGS $ASFLAGS "$@" $AS_C $(as_o $TMPO) $TMPS
1106 test_x86asm(){
1107 log test_x86asm "$@"
1108 echo "$1" > $TMPASM
1109 log_file $TMPASM
1110 shift
1111 test_cmd $x86asmexe $X86ASMFLAGS -Werror "$@" $(x86asm_o $TMPO) $TMPASM
1114 check_cmd(){
1115 log check_cmd "$@"
1116 cmd=$1
1117 disabled $cmd && return
1118 disable $cmd
1119 test_cmd $@ && enable $cmd
1122 check_as(){
1123 log check_as "$@"
1124 name=$1
1125 code=$2
1126 shift 2
1127 disable $name
1128 test_as $@ <<EOF && enable $name
1129 $code
1133 check_inline_asm(){
1134 log check_inline_asm "$@"
1135 name="$1"
1136 code="$2"
1137 shift 2
1138 disable $name
1139 test_cc "$@" <<EOF && enable $name
1140 void foo(void){ __asm__ volatile($code); }
1144 check_inline_asm_flags(){
1145 log check_inline_asm_flags "$@"
1146 name="$1"
1147 code="$2"
1148 flags=''
1149 shift 2
1150 while [ "$1" != "" ]; do
1151 append flags $1
1152 shift
1153 done;
1154 disable $name
1155 cat > $TMPC <<EOF
1156 void foo(void){ __asm__ volatile($code); }
1158 log_file $TMPC
1159 test_cmd $cc $CPPFLAGS $CFLAGS $flags "$@" $CC_C $(cc_o $TMPO) $TMPC &&
1160 enable $name && add_cflags $flags && add_asflags $flags && add_ldflags $flags
1163 check_insn(){
1164 log check_insn "$@"
1165 check_inline_asm ${1}_inline "\"$2\""
1166 check_as ${1}_external "$2"
1169 check_arch_level(){
1170 log check_arch_level "$@"
1171 level="$1"
1172 check_as tested_arch_level ".arch $level"
1173 enabled tested_arch_level && as_arch_level="$level"
1176 check_archext_insn(){
1177 log check_archext_insn "$@"
1178 feature="$1"
1179 instr="$2"
1180 # Check if the assembly is accepted in inline assembly.
1181 check_inline_asm ${feature}_inline "\"$instr\""
1182 # We don't check if the instruction is supported out of the box by the
1183 # external assembler (we don't try to set ${feature}_external) as we don't
1184 # need to use these instructions in non-runtime detected codepaths.
1186 disable $feature
1188 enabled as_arch_directive && arch_directive=".arch $as_arch_level" || arch_directive=""
1190 # Test if the assembler supports the .arch_extension $feature directive.
1191 arch_extension_directive=".arch_extension $feature"
1192 test_as <<EOF && enable as_archext_${feature}_directive || arch_extension_directive=""
1193 $arch_directive
1194 $arch_extension_directive
1197 # Test if we can assemble the instruction after potential .arch and
1198 # .arch_extension directives.
1199 test_as <<EOF && enable ${feature}
1200 $arch_directive
1201 $arch_extension_directive
1202 $instr
1206 check_x86asm(){
1207 log check_x86asm "$@"
1208 name=$1
1209 shift
1210 disable $name
1211 test_x86asm "$@" && enable $name
1214 test_ld(){
1215 log test_ld "$@"
1216 type=$1
1217 shift 1
1218 flags=$(filter_out '-l*|*.so' $@)
1219 libs=$(filter '-l*|*.so' $@)
1220 test_$type $($cflags_filter $flags) || return
1221 flags=$($ldflags_filter $flags)
1222 libs=$($ldflags_filter $libs)
1223 test_cmd $ld $LDFLAGS $LDEXEFLAGS $flags $(ld_o $TMPE) $TMPO $libs $extralibs
1226 check_ld(){
1227 log check_ld "$@"
1228 type=$1
1229 name=$2
1230 shift 2
1231 disable $name
1232 test_ld $type $@ && enable $name
1235 print_include(){
1236 hdr=$1
1237 test "${hdr%.h}" = "${hdr}" &&
1238 echo "#include $hdr" ||
1239 echo "#include <$hdr>"
1242 test_code(){
1243 log test_code "$@"
1244 check=$1
1245 headers=$2
1246 code=$3
1247 shift 3
1249 for hdr in $headers; do
1250 print_include $hdr
1251 done
1252 echo "int main(void) { $code; return 0; }"
1253 } | test_$check "$@"
1256 check_cppflags(){
1257 log check_cppflags "$@"
1258 test_cpp "$@" <<EOF && append CPPFLAGS "$@"
1259 #include <stdlib.h>
1263 test_cflags(){
1264 log test_cflags "$@"
1265 set -- $($cflags_filter "$@")
1266 test_cc "$@" <<EOF
1267 int x;
1271 check_cflags(){
1272 log check_cflags "$@"
1273 test_cflags "$@" && add_cflags "$@"
1276 check_cxxflags(){
1277 log check_cxxflags "$@"
1278 set -- $($cflags_filter "$@")
1279 test_cxx "$@" <<EOF && append CXXFLAGS "$@"
1280 int x;
1284 test_objcflags(){
1285 log test_objcflags "$@"
1286 set -- $($objcflags_filter "$@")
1287 test_objcc "$@" <<EOF
1288 int x;
1292 check_objcflags(){
1293 log check_objcflags "$@"
1294 test_objcflags "$@" && add_objcflags "$@"
1297 test_ldflags(){
1298 log test_ldflags "$@"
1299 set -- $($ldflags_filter "$@")
1300 test_ld "cc" "$@" <<EOF
1301 int main(void){ return 0; }
1305 check_ldflags(){
1306 log check_ldflags "$@"
1307 test_ldflags "$@" && add_ldflags "$@"
1310 test_stripflags(){
1311 log test_stripflags "$@"
1312 # call test_cc to get a fresh TMPO
1313 test_cc <<EOF
1314 int main(void) { return 0; }
1316 test_cmd $strip $ASMSTRIPFLAGS "$@" $TMPO
1319 check_stripflags(){
1320 log check_stripflags "$@"
1321 test_stripflags "$@" && add_stripflags "$@"
1324 check_headers(){
1325 log check_headers "$@"
1326 headers=$1
1327 shift
1328 disable_sanitized $headers
1330 for hdr in $headers; do
1331 print_include $hdr
1332 done
1333 echo "int x;"
1334 } | test_cpp "$@" && enable_sanitized $headers
1337 check_header_objcc(){
1338 log check_header_objcc "$@"
1339 rm -f -- "$TMPO"
1340 header=$1
1341 shift
1342 disable_sanitized $header
1344 echo "#include <$header>"
1345 echo "int main(void) { return 0; }"
1346 } | test_objcc && test_stat "$TMPO" && enable_sanitized $header
1349 check_apple_framework(){
1350 log check_apple_framework "$@"
1351 framework="$1"
1352 name="$(tolower $framework)"
1353 header="${framework}/${framework}.h"
1354 disable $name
1355 check_header_objcc $header &&
1356 enable $name && eval ${name}_extralibs='"-framework $framework"'
1359 check_func(){
1360 log check_func "$@"
1361 func=$1
1362 shift
1363 disable $func
1364 test_ld "cc" "$@" <<EOF && enable $func
1365 extern int $func();
1366 int main(void){ $func(); }
1370 check_mathfunc(){
1371 log check_mathfunc "$@"
1372 func=$1
1373 narg=$2
1374 shift 2
1375 test $narg = 2 && args="f, g" || args="f"
1376 disable $func
1377 test_ld "cc" "$@" <<EOF && enable $func
1378 #include <math.h>
1379 float foo(float f, float g) { return $func($args); }
1380 int main(void){ return (int) foo; }
1384 check_func_headers(){
1385 log check_func_headers "$@"
1386 headers=$1
1387 funcs=$2
1388 shift 2
1390 for hdr in $headers; do
1391 print_include $hdr
1392 done
1393 echo "#include <stdint.h>"
1394 for func in $funcs; do
1395 echo "long check_$func(void) { return (long) $func; }"
1396 done
1397 echo "int main(void) { int ret = 0;"
1398 # LTO could optimize out the test functions without this
1399 for func in $funcs; do
1400 echo " ret |= ((intptr_t)check_$func) & 0xFFFF;"
1401 done
1402 echo "return ret; }"
1403 } | test_ld "cc" "$@" && enable $funcs && enable_sanitized $headers
1406 check_class_headers_cpp(){
1407 log check_class_headers_cpp "$@"
1408 headers=$1
1409 classes=$2
1410 shift 2
1412 for hdr in $headers; do
1413 echo "#include <$hdr>"
1414 done
1415 echo "int main(void) { "
1417 for class in $classes; do
1418 echo "$class obj$i;"
1419 i=$(expr $i + 1)
1420 done
1421 echo "return 0; }"
1422 } | test_ld "cxx" "$@" && enable $funcs && enable_sanitized $headers
1425 test_cpp_condition(){
1426 log test_cpp_condition "$@"
1427 header=$1
1428 condition=$2
1429 shift 2
1430 test_cpp "$@" <<EOF
1431 #include <$header>
1432 #if !($condition)
1433 #error "unsatisfied condition: $condition"
1434 #endif
1438 check_cpp_condition(){
1439 log check_cpp_condition "$@"
1440 name=$1
1441 shift 1
1442 disable $name
1443 test_cpp_condition "$@" && enable $name
1446 test_cflags_cc(){
1447 log test_cflags_cc "$@"
1448 flags=$1
1449 header=$2
1450 condition=$3
1451 shift 3
1452 set -- $($cflags_filter "$flags")
1453 test_cc "$@" <<EOF
1454 #include <$header>
1455 #if !($condition)
1456 #error "unsatisfied condition: $condition"
1457 #endif
1461 check_cflags_cc(){
1462 log check_cflags_cc "$@"
1463 flags=$1
1464 test_cflags_cc "$@" && add_cflags $flags
1467 test_cxxflags_cc(){
1468 log test_cxxflags_cc "$@"
1469 flags=$1
1470 header=$2
1471 condition=$3
1472 shift 3
1473 set -- $($cflags_filter "$flags")
1474 test_cxx "$@" <<EOF
1475 #include <$header>
1476 #if !($condition)
1477 #error "unsatisfied condition: $condition"
1478 #endif
1482 check_cxxflags_cc(){
1483 log check_cxxflags_cc "$@"
1484 flags=$1
1485 test_cxxflags_cc "$@" && add_cxxflags $flags
1488 check_lib(){
1489 log check_lib "$@"
1490 name="$1"
1491 headers="$2"
1492 funcs="$3"
1493 shift 3
1494 disable $name
1495 check_func_headers "$headers" "$funcs" "$@" &&
1496 enable $name && eval ${name}_extralibs="\$@"
1499 check_lib_cpp(){
1500 log check_lib_cpp "$@"
1501 name="$1"
1502 headers="$2"
1503 classes="$3"
1504 shift 3
1505 disable $name
1506 check_class_headers_cpp "$headers" "$classes" "$@" &&
1507 enable $name && eval ${name}_extralibs="\$@"
1510 test_pkg_config(){
1511 log test_pkg_config "$@"
1512 name="$1"
1513 pkg_version="$2"
1514 pkg="${2%% *}"
1515 headers="$3"
1516 funcs="$4"
1517 shift 4
1518 disable $name
1519 test_cmd $pkg_config --exists --print-errors $pkg_version || return
1520 pkg_cflags=$($pkg_config --cflags $pkg_config_flags $pkg)
1521 pkg_libs=$($pkg_config --libs $pkg_config_flags $pkg)
1522 pkg_incdir=$($pkg_config --variable=includedir $pkg_config_flags $pkg)
1523 check_func_headers "$headers" "$funcs" $pkg_cflags $pkg_libs "$@" &&
1524 enable $name &&
1525 set_sanitized "${name}_cflags" $pkg_cflags &&
1526 set_sanitized "${name}_incdir" $pkg_incdir &&
1527 set_sanitized "${name}_extralibs" $pkg_libs
1530 test_pkg_config_cpp(){
1531 log test_pkg_config_cpp "$@"
1532 name="$1"
1533 pkg_version="$2"
1534 pkg="${2%% *}"
1535 headers="$3"
1536 cond="$4"
1537 shift 4
1538 disable $name
1539 test_cmd $pkg_config --exists --print-errors $pkg_version || return
1540 pkg_cflags=$($pkg_config --cflags $pkg_config_flags $pkg)
1541 pkg_incdir=$($pkg_config --variable=includedir $pkg_config_flags $pkg)
1542 pkg_incflags=$($pkg_config --cflags-only-I $pkg_config_flags $pkg)
1543 test_cpp_condition "$pkg_incdir/$headers" "$cond" "$@" &&
1544 enable $name &&
1545 set_sanitized "${name}_cflags" $pkg_cflags &&
1546 set_sanitized "${name}_incdir" $pkg_incdir &&
1547 set_sanitized "${name}_incflags" $pkg_incflags
1550 check_pkg_config(){
1551 log check_pkg_config "$@"
1552 name="$1"
1553 test_pkg_config "$@" &&
1554 eval add_cflags \$${name}_cflags
1557 check_pkg_config_cpp(){
1558 log check_pkg_config_cpp "$@"
1559 name="$1"
1560 test_pkg_config_cpp "$@" &&
1561 eval add_cflags \$${name}_cflags
1564 check_pkg_config_header_only(){
1565 log check_pkg_config_cpp "$@"
1566 name="$1"
1567 test_pkg_config_cpp "$@" &&
1568 eval add_cflags \$${name}_incflags
1571 test_exec(){
1572 test_ld "cc" "$@" && { enabled cross_compile || $TMPE >> $logfile 2>&1; }
1575 check_exec_crash(){
1576 log check_exec_crash "$@"
1577 code=$(cat)
1579 # exit() is not async signal safe. _Exit (C99) and _exit (POSIX)
1580 # are safe but may not be available everywhere. Thus we use
1581 # raise(SIGTERM) instead. The check is run in a subshell so we
1582 # can redirect the "Terminated" message from the shell. SIGBUS
1583 # is not defined by standard C so it is used conditionally.
1585 (test_exec "$@") >> $logfile 2>&1 <<EOF
1586 #include <signal.h>
1587 static void sighandler(int sig){
1588 raise(SIGTERM);
1590 int foo(void){
1591 $code
1593 int (*func_ptr)(void) = foo;
1594 int main(void){
1595 signal(SIGILL, sighandler);
1596 signal(SIGFPE, sighandler);
1597 signal(SIGSEGV, sighandler);
1598 #ifdef SIGBUS
1599 signal(SIGBUS, sighandler);
1600 #endif
1601 return func_ptr();
1606 check_type(){
1607 log check_type "$@"
1608 headers=$1
1609 type=$2
1610 shift 2
1611 disable_sanitized "$type"
1612 test_code cc "$headers" "$type v" "$@" && enable_sanitized "$type"
1615 check_struct(){
1616 log check_struct "$@"
1617 headers=$1
1618 struct=$2
1619 member=$3
1620 shift 3
1621 disable_sanitized "${struct}_${member}"
1622 test_code cc "$headers" "const void *p = &(($struct *)0)->$member" "$@" &&
1623 enable_sanitized "${struct}_${member}"
1626 check_builtin(){
1627 log check_builtin "$@"
1628 name=$1
1629 headers=$2
1630 builtin=$3
1631 shift 3
1632 disable "$name"
1633 test_code ld "$headers" "$builtin" "cc" "$@" && enable "$name"
1636 check_compile_assert(){
1637 log check_compile_assert "$@"
1638 name=$1
1639 headers=$2
1640 condition=$3
1641 shift 3
1642 disable "$name"
1643 test_code cc "$headers" "char c[2 * !!($condition) - 1]" "$@" && enable "$name"
1646 check_cc(){
1647 log check_cc "$@"
1648 name=$1
1649 shift
1650 disable "$name"
1651 test_code cc "$@" && enable "$name"
1654 require(){
1655 log require "$@"
1656 name_version="$1"
1657 name="${1%% *}"
1658 shift
1659 check_lib $name "$@" || die "ERROR: $name_version not found"
1662 require_cc(){
1663 log require_cc "$@"
1664 name="$1"
1665 check_cc "$@" || die "ERROR: $name failed"
1668 require_cpp(){
1669 log require_cpp "$@"
1670 name_version="$1"
1671 name="${1%% *}"
1672 shift
1673 check_lib_cpp "$name" "$@" || die "ERROR: $name_version not found"
1676 require_headers(){
1677 log require_headers "$@"
1678 headers="$1"
1679 check_headers "$@" || die "ERROR: $headers not found"
1682 require_cpp_condition(){
1683 log require_cpp_condition "$@"
1684 condition="$3"
1685 check_cpp_condition "$@" || die "ERROR: $condition not satisfied"
1688 require_pkg_config(){
1689 log require_pkg_config "$@"
1690 pkg_version="$2"
1691 check_pkg_config "$@" || die "ERROR: $pkg_version not found using pkg-config$pkg_config_fail_message"
1694 require_pkg_config_cpp(){
1695 log require_pkg_config_cpp "$@"
1696 pkg_version="$2"
1697 check_pkg_config_cpp "$@" || die "ERROR: $pkg_version not found using pkg-config$pkg_config_fail_message"
1700 test_host_cc(){
1701 log test_host_cc "$@"
1702 cat > $TMPC
1703 log_file $TMPC
1704 test_cmd $host_cc $host_cflags "$@" $HOSTCC_C $(hostcc_o $TMPO) $TMPC
1707 test_host_cpp(){
1708 log test_host_cpp "$@"
1709 cat > $TMPC
1710 log_file $TMPC
1711 test_cmd $host_cc $host_cppflags $host_cflags "$@" $(hostcc_e $TMPO) $TMPC
1714 check_host_cppflags(){
1715 log check_host_cppflags "$@"
1716 test_host_cpp "$@" <<EOF && append host_cppflags "$@"
1717 #include <stdlib.h>
1721 check_host_cflags(){
1722 log check_host_cflags "$@"
1723 set -- $($host_cflags_filter "$@")
1724 test_host_cc "$@" <<EOF && append host_cflags "$@"
1725 int x;
1729 test_host_cflags_cc(){
1730 log test_host_cflags_cc "$@"
1731 flags=$1
1732 header=$2
1733 condition=$3
1734 shift 3
1735 set -- $($host_cflags_filter "$flags")
1736 test_host_cc "$@" <<EOF
1737 #include <$header>
1738 #if !($condition)
1739 #error "unsatisfied condition: $condition"
1740 #endif
1744 check_host_cflags_cc(){
1745 log check_host_cflags_cc "$@"
1746 flags=$1
1747 test_host_cflags_cc "$@" && add_host_cflags $flags
1750 test_host_cpp_condition(){
1751 log test_host_cpp_condition "$@"
1752 header=$1
1753 condition=$2
1754 shift 2
1755 test_host_cpp "$@" <<EOF
1756 #include <$header>
1757 #if !($condition)
1758 #error "unsatisfied condition: $condition"
1759 #endif
1763 check_host_cpp_condition(){
1764 log check_host_cpp_condition "$@"
1765 name=$1
1766 shift 1
1767 disable $name
1768 test_host_cpp_condition "$@" && enable $name
1771 cp_if_changed(){
1772 cmp -s "$1" "$2" && { test "$quiet" != "yes" && echo "$2 is unchanged"; } && return
1773 mkdir -p "$(dirname $2)"
1774 cp -f "$1" "$2"
1777 # CONFIG_LIST contains configurable options, while HAVE_LIST is for
1778 # system-dependent things.
1780 AVCODEC_COMPONENTS="
1781 bsfs
1782 decoders
1783 encoders
1784 hwaccels
1785 parsers
1788 AVDEVICE_COMPONENTS="
1789 indevs
1790 outdevs
1793 AVFILTER_COMPONENTS="
1794 filters
1797 AVFORMAT_COMPONENTS="
1798 demuxers
1799 muxers
1800 protocols
1803 COMPONENT_LIST="
1804 $AVCODEC_COMPONENTS
1805 $AVDEVICE_COMPONENTS
1806 $AVFILTER_COMPONENTS
1807 $AVFORMAT_COMPONENTS
1810 EXAMPLE_LIST="
1811 avio_http_serve_files_example
1812 avio_list_dir_example
1813 avio_read_callback_example
1814 decode_audio_example
1815 decode_filter_audio_example
1816 decode_filter_video_example
1817 decode_video_example
1818 demux_decode_example
1819 encode_audio_example
1820 encode_video_example
1821 extract_mvs_example
1822 filter_audio_example
1823 hw_decode_example
1824 mux_example
1825 qsv_decode_example
1826 remux_example
1827 resample_audio_example
1828 scale_video_example
1829 show_metadata_example
1830 transcode_aac_example
1831 transcode_example
1832 vaapi_encode_example
1833 vaapi_transcode_example
1834 qsv_transcode_example
1837 EXTERNAL_AUTODETECT_LIBRARY_LIST="
1838 alsa
1839 appkit
1840 avfoundation
1841 bzlib
1842 coreimage
1843 iconv
1844 libxcb
1845 libxcb_shm
1846 libxcb_shape
1847 libxcb_xfixes
1848 lzma
1849 mediafoundation
1850 metal
1851 schannel
1852 sdl2
1853 securetransport
1854 sndio
1855 xlib
1856 zlib
1859 EXTERNAL_LIBRARY_GPL_LIST="
1860 avisynth
1861 frei0r
1862 libcdio
1863 libdavs2
1864 libdvdnav
1865 libdvdread
1866 librubberband
1867 libvidstab
1868 libx264
1869 libx265
1870 libxavs
1871 libxavs2
1872 libxvid
1875 EXTERNAL_LIBRARY_NONFREE_LIST="
1876 decklink
1877 libfdk_aac
1878 libtls
1881 EXTERNAL_LIBRARY_VERSION3_LIST="
1883 libaribb24
1884 liblensfun
1885 libopencore_amrnb
1886 libopencore_amrwb
1887 libvo_amrwbenc
1888 mbedtls
1889 rkmpp
1892 EXTERNAL_LIBRARY_GPLV3_LIST="
1893 libsmbclient
1896 EXTERNAL_LIBRARY_LIST="
1897 $EXTERNAL_LIBRARY_GPL_LIST
1898 $EXTERNAL_LIBRARY_NONFREE_LIST
1899 $EXTERNAL_LIBRARY_VERSION3_LIST
1900 $EXTERNAL_LIBRARY_GPLV3_LIST
1901 chromaprint
1902 gcrypt
1903 gnutls
1905 ladspa
1906 lcms2
1907 libaom
1908 libaribcaption
1909 libass
1910 libbluray
1911 libbs2b
1912 libcaca
1913 libcelt
1914 libcodec2
1915 libdav1d
1916 libdc1394
1917 libflite
1918 libfontconfig
1919 libfreetype
1920 libfribidi
1921 libharfbuzz
1922 libglslang
1923 libgme
1924 libgsm
1925 libiec61883
1926 libilbc
1927 libjack
1928 libjxl
1929 libklvanc
1930 libkvazaar
1931 liblc3
1932 libmodplug
1933 libmp3lame
1934 libmysofa
1935 libopencv
1936 libopenh264
1937 libopenjpeg
1938 libopenmpt
1939 libopenvino
1940 libopus
1941 libplacebo
1942 libpulse
1943 libqrencode
1944 libquirc
1945 librabbitmq
1946 librav1e
1947 librist
1948 librsvg
1949 librtmp
1950 libshaderc
1951 libshine
1952 libsmbclient
1953 libsnappy
1954 libsoxr
1955 libspeex
1956 libsrt
1957 libssh
1958 libsvtav1
1959 libtensorflow
1960 libtesseract
1961 libtheora
1962 libtorch
1963 libtwolame
1964 libuavs3d
1965 libv4l2
1966 libvmaf
1967 libvorbis
1968 libvpx
1969 libwebp
1970 libxevd
1971 libxeve
1972 libxml2
1973 libzimg
1974 libzmq
1975 libzvbi
1977 mediacodec
1978 openal
1979 opengl
1980 openssl
1981 pocketsphinx
1982 vapoursynth
1985 HWACCEL_AUTODETECT_LIBRARY_LIST="
1987 audiotoolbox
1988 cuda
1989 cuda_llvm
1990 cuvid
1991 d3d11va
1992 d3d12va
1993 dxva2
1994 ffnvcodec
1995 libdrm
1996 nvdec
1997 nvenc
1998 vaapi
1999 vdpau
2000 videotoolbox
2001 vulkan
2002 v4l2_m2m
2005 # catchall list of things that require external libs to link
2006 EXTRALIBS_LIST="
2007 cpu_init
2008 cws2fws
2011 HWACCEL_LIBRARY_NONFREE_LIST="
2012 cuda_nvcc
2013 cuda_sdk
2014 libnpp
2017 HWACCEL_LIBRARY_LIST="
2018 $HWACCEL_LIBRARY_NONFREE_LIST
2019 libmfx
2020 libvpl
2021 mmal
2023 opencl
2026 DOCUMENT_LIST="
2028 htmlpages
2029 manpages
2030 podpages
2031 txtpages
2034 FEATURE_LIST="
2035 ftrapv
2036 gray
2037 hardcoded_tables
2038 omx_rpi
2039 runtime_cpudetect
2040 safe_bitstream_reader
2041 shared
2042 small
2043 static
2044 swscale_alpha
2047 # this list should be kept in linking order
2048 LIBRARY_LIST="
2049 avdevice
2050 avfilter
2051 swscale
2052 postproc
2053 avformat
2054 avcodec
2055 swresample
2056 avutil
2059 LICENSE_LIST="
2061 nonfree
2062 version3
2065 PROGRAM_LIST="
2066 ffplay
2067 ffprobe
2068 ffmpeg
2071 SUBSYSTEM_LIST="
2073 error_resilience
2074 faan
2075 fast_unaligned
2076 iamf
2078 pixelutils
2079 network
2082 # COMPONENT_LIST needs to come last to ensure correct dependency checking
2083 CONFIG_LIST="
2084 $DOCUMENT_LIST
2085 $EXAMPLE_LIST
2086 $EXTERNAL_LIBRARY_LIST
2087 $EXTERNAL_AUTODETECT_LIBRARY_LIST
2088 $HWACCEL_LIBRARY_LIST
2089 $HWACCEL_AUTODETECT_LIBRARY_LIST
2090 $FEATURE_LIST
2091 $LICENSE_LIST
2092 $LIBRARY_LIST
2093 $PROGRAM_LIST
2094 $SUBSYSTEM_LIST
2095 autodetect
2096 fontconfig
2097 large_tests
2098 linux_perf
2099 macos_kperf
2100 memory_poisoning
2101 neon_clobber_test
2102 ossfuzz
2104 ptx_compression
2105 thumb
2106 valgrind_backtrace
2107 xmm_clobber_test
2108 $COMPONENT_LIST
2111 THREADS_LIST="
2112 pthreads
2113 os2threads
2114 w32threads
2117 ATOMICS_LIST="
2118 atomics_gcc
2119 atomics_suncc
2120 atomics_win32
2123 AUTODETECT_LIBS="
2124 $EXTERNAL_AUTODETECT_LIBRARY_LIST
2125 $HWACCEL_AUTODETECT_LIBRARY_LIST
2126 $THREADS_LIST
2129 ARCH_LIST="
2130 aarch64
2131 alpha
2133 avr32
2134 avr32_ap
2135 avr32_uc
2136 bfin
2137 ia64
2138 loongarch
2139 loongarch32
2140 loongarch64
2141 m68k
2142 mips
2143 mips64
2144 parisc
2146 ppc64
2147 riscv
2148 s390
2150 sparc
2151 sparc64
2152 tilegx
2153 tilepro
2155 x86_32
2156 x86_64
2159 ARCH_EXT_LIST_ARM="
2160 armv5te
2161 armv6
2162 armv6t2
2163 armv8
2164 dotprod
2165 i8mm
2166 neon
2168 vfpv3
2169 setend
2172 ARCH_EXT_LIST_MIPS="
2173 mipsfpu
2174 mips32r2
2175 mips32r5
2176 mips64r2
2177 mips32r6
2178 mips64r6
2179 mipsdsp
2180 mipsdspr2
2184 ARCH_EXT_LIST_LOONGSON="
2185 loongson2
2186 loongson3
2189 lasx
2192 ARCH_EXT_LIST_X86_SIMD="
2193 aesni
2194 amd3dnow
2195 amd3dnowext
2197 avx2
2198 avx512
2199 avx512icl
2200 fma3
2201 fma4
2203 mmxext
2205 sse2
2206 sse3
2207 sse4
2208 sse42
2209 ssse3
2213 ARCH_EXT_LIST_PPC="
2214 altivec
2215 dcbzl
2216 ldbrx
2217 power8
2218 ppc4xx
2222 ARCH_EXT_LIST_RISCV="
2227 ARCH_EXT_LIST_X86="
2228 $ARCH_EXT_LIST_X86_SIMD
2229 i686
2232 ARCH_EXT_LIST="
2233 $ARCH_EXT_LIST_ARM
2234 $ARCH_EXT_LIST_PPC
2235 $ARCH_EXT_LIST_RISCV
2236 $ARCH_EXT_LIST_X86
2237 $ARCH_EXT_LIST_MIPS
2238 $ARCH_EXT_LIST_LOONGSON
2241 ARCH_FEATURES="
2242 aligned_stack
2243 fast_64bit
2244 fast_clz
2245 fast_cmov
2246 fast_float16
2247 local_aligned
2248 simd_align_16
2249 simd_align_32
2250 simd_align_64
2253 BUILTIN_LIST="
2254 atomic_cas_ptr
2255 machine_rw_barrier
2256 MemoryBarrier
2257 mm_empty
2258 rdtsc
2259 sem_timedwait
2260 sync_val_compare_and_swap
2262 HAVE_LIST_CMDLINE="
2263 inline_asm
2264 symver
2265 x86asm
2268 HAVE_LIST_PUB="
2269 bigendian
2270 fast_unaligned
2273 HEADERS_LIST="
2274 arpa_inet_h
2275 asm_types_h
2276 cdio_paranoia_h
2277 cdio_paranoia_paranoia_h
2278 cuda_h
2279 dispatch_dispatch_h
2280 dev_bktr_ioctl_bt848_h
2281 dev_bktr_ioctl_meteor_h
2282 dev_ic_bt8xx_h
2283 dev_video_bktr_ioctl_bt848_h
2284 dev_video_meteor_ioctl_meteor_h
2285 direct_h
2286 dirent_h
2287 dxgidebug_h
2288 dxva_h
2289 ES2_gl_h
2290 gsm_h
2291 io_h
2292 linux_dma_buf_h
2293 linux_perf_event_h
2294 machine_ioctl_bt848_h
2295 machine_ioctl_meteor_h
2296 malloc_h
2297 opencv2_core_core_c_h
2298 OpenGL_gl3_h
2299 poll_h
2300 pthread_np_h
2301 sys_param_h
2302 sys_resource_h
2303 sys_select_h
2304 sys_soundcard_h
2305 sys_time_h
2306 sys_un_h
2307 sys_videoio_h
2308 termios_h
2309 udplite_h
2310 unistd_h
2311 valgrind_valgrind_h
2312 windows_h
2313 winsock2_h
2316 INTRINSICS_LIST="
2317 intrinsics_neon
2320 MATH_FUNCS="
2321 atanf
2322 atan2f
2323 cbrt
2324 cbrtf
2325 copysign
2326 cosf
2328 exp2
2329 exp2f
2330 expf
2331 hypot
2332 isfinite
2333 isinf
2334 isnan
2335 ldexpf
2336 llrint
2337 llrintf
2338 log2
2339 log2f
2340 log10f
2341 lrint
2342 lrintf
2343 powf
2344 rint
2345 round
2346 roundf
2347 sinf
2348 trunc
2349 truncf
2352 SYSTEM_FEATURES="
2353 dos_paths
2354 libc_msvcrt
2355 MMAL_PARAMETER_VIDEO_MAX_NUM_CALLBACKS
2356 section_data_rel_ro
2357 threads
2359 winrt
2362 SYSTEM_FUNCS="
2363 access
2364 aligned_malloc
2365 arc4random_buf
2366 clock_gettime
2367 closesocket
2368 CommandLineToArgvW
2369 fcntl
2370 getaddrinfo
2371 getauxval
2372 getenv
2373 gethrtime
2374 getopt
2375 GetModuleHandle
2376 GetProcessAffinityMask
2377 GetProcessMemoryInfo
2378 GetProcessTimes
2379 getrusage
2380 GetStdHandle
2381 GetSystemTimeAsFileTime
2382 gettimeofday
2383 glob
2384 glXGetProcAddress
2385 gmtime_r
2386 inet_aton
2387 isatty
2388 kbhit
2389 localtime_r
2390 lstat
2391 lzo1x_999_compress
2392 mach_absolute_time
2393 MapViewOfFile
2394 memalign
2395 mkstemp
2396 mmap
2397 mprotect
2398 nanosleep
2399 PeekNamedPipe
2400 posix_memalign
2401 prctl
2402 pthread_cancel
2403 pthread_set_name_np
2404 pthread_setname_np
2405 sched_getaffinity
2406 SecItemImport
2407 SetConsoleTextAttribute
2408 SetConsoleCtrlHandler
2409 SetDllDirectory
2410 setmode
2411 setrlimit
2412 Sleep
2413 strerror_r
2414 sysconf
2415 sysctl
2416 sysctlbyname
2417 usleep
2418 UTGetOSTypeFromString
2419 VirtualAlloc
2420 wglGetProcAddress
2423 SYSTEM_LIBRARIES="
2424 bcrypt
2425 vaapi_drm
2426 vaapi_x11
2427 vaapi_win32
2428 vdpau_x11
2431 TOOLCHAIN_FEATURES="
2432 as_arch_directive
2433 as_archext_dotprod_directive
2434 as_archext_i8mm_directive
2435 as_dn_directive
2436 as_fpu_directive
2437 as_func
2438 as_object_arch
2439 asm_mod_q
2440 blocks_extension
2441 ebp_available
2442 ebx_available
2443 gnu_as
2444 gnu_windres
2445 ibm_asm
2446 inline_asm_direct_symbol_refs
2447 inline_asm_labels
2448 inline_asm_nonlocal_labels
2449 pragma_deprecated
2450 rsync_contimeout
2451 symver_asm_label
2452 symver_gnu_asm
2453 vfp_args
2454 xform_asm
2455 xmm_clobbers
2458 TYPES_LIST="
2459 DPI_AWARENESS_CONTEXT
2460 IDXGIOutput5
2461 kCMVideoCodecType_HEVC
2462 kCMVideoCodecType_HEVCWithAlpha
2463 kCMVideoCodecType_VP9
2464 kCVPixelFormatType_420YpCbCr10BiPlanarVideoRange
2465 kCVPixelFormatType_422YpCbCr8BiPlanarVideoRange
2466 kCVPixelFormatType_422YpCbCr10BiPlanarVideoRange
2467 kCVPixelFormatType_422YpCbCr16BiPlanarVideoRange
2468 kCVPixelFormatType_444YpCbCr8BiPlanarVideoRange
2469 kCVPixelFormatType_444YpCbCr10BiPlanarVideoRange
2470 kCVPixelFormatType_444YpCbCr16BiPlanarVideoRange
2471 kCVImageBufferTransferFunction_SMPTE_ST_2084_PQ
2472 kCVImageBufferTransferFunction_ITU_R_2100_HLG
2473 kCVImageBufferTransferFunction_Linear
2474 kCVImageBufferYCbCrMatrix_ITU_R_2020
2475 kCVImageBufferColorPrimaries_ITU_R_2020
2476 kCVImageBufferTransferFunction_ITU_R_2020
2477 kCVImageBufferTransferFunction_SMPTE_ST_428_1
2478 socklen_t
2479 struct_addrinfo
2480 struct_group_source_req
2481 struct_ip_mreq_source
2482 struct_ipv6_mreq
2483 struct_msghdr_msg_flags
2484 struct_pollfd
2485 struct_rusage_ru_maxrss
2486 struct_sctp_event_subscribe
2487 struct_sockaddr_in6
2488 struct_sockaddr_sa_len
2489 struct_sockaddr_storage
2490 struct_stat_st_mtim_tv_nsec
2491 struct_v4l2_frmivalenum_discrete
2494 HAVE_LIST="
2495 $ARCH_EXT_LIST
2496 $(add_suffix _external $ARCH_EXT_LIST)
2497 $(add_suffix _inline $ARCH_EXT_LIST)
2498 $ARCH_FEATURES
2499 $BUILTIN_LIST
2500 $HAVE_LIST_CMDLINE
2501 $HAVE_LIST_PUB
2502 $HEADERS_LIST
2503 $INTRINSICS_LIST
2504 $MATH_FUNCS
2505 $SYSTEM_FEATURES
2506 $SYSTEM_FUNCS
2507 $SYSTEM_LIBRARIES
2508 $THREADS_LIST
2509 $TOOLCHAIN_FEATURES
2510 $TYPES_LIST
2511 gzip
2512 libdrm_getfb2
2513 makeinfo
2514 makeinfo_html
2515 opencl_d3d11
2516 opencl_drm_arm
2517 opencl_drm_beignet
2518 opencl_dxva2
2519 opencl_vaapi_beignet
2520 opencl_vaapi_intel_media
2521 opencl_videotoolbox
2522 perl
2523 pod2man
2524 texi2html
2525 xmllint
2526 zlib_gzip
2527 openvino2
2530 # options emitted with CONFIG_ prefix but not available on the command line
2531 CONFIG_EXTRA="
2532 aandcttables
2533 ac3dsp
2534 adts_header
2535 atsc_a53
2536 audio_frame_queue
2537 audiodsp
2538 blockdsp
2539 bswapdsp
2540 cabac
2542 cbs_av1
2543 cbs_h264
2544 cbs_h265
2545 cbs_h266
2546 cbs_jpeg
2547 cbs_mpeg2
2548 cbs_vp8
2549 cbs_vp9
2550 deflate_wrapper
2551 dirac_parse
2553 dovi_rpudec
2554 dovi_rpuenc
2555 dvprofile
2556 evcparse
2557 exif
2558 faandct
2559 faanidct
2560 fdctdsp
2561 fmtconvert
2562 frame_thread_encoder
2563 g722dsp
2564 golomb
2565 gplv3
2566 h263dsp
2567 h264chroma
2568 h264dsp
2569 h264parse
2570 h264pred
2571 h264qpel
2572 h264_sei
2573 hevcparse
2574 hevc_sei
2575 hpeldsp
2576 huffman
2577 huffyuvdsp
2578 huffyuvencdsp
2579 iamfdec
2580 iamfenc
2581 idctdsp
2582 iirfilter
2583 inflate_wrapper
2584 intrax8
2585 iso_media
2586 ividsp
2587 jpegtables
2588 lgplv3
2589 libx262
2590 libx264_hdr10
2591 llauddsp
2592 llviddsp
2593 llvidencdsp
2596 me_cmp
2597 mpeg_er
2598 mpegaudio
2599 mpegaudiodsp
2600 mpegaudioheader
2601 mpeg4audio
2602 mpegvideo
2603 mpegvideodec
2604 mpegvideoenc
2605 msmpeg4dec
2606 msmpeg4enc
2607 mss34dsp
2608 pixblockdsp
2609 qpeldsp
2611 qsvdec
2612 qsvenc
2613 qsvvpp
2614 rangecoder
2615 riffdec
2616 riffenc
2617 rtpdec
2618 rtpenc_chain
2619 rv34dsp
2620 scene_sad
2621 sinewin
2622 snappy
2623 srtp
2624 startcode
2625 texturedsp
2626 texturedspenc
2627 tpeldsp
2628 vaapi_1
2629 vaapi_encode
2630 vc1dsp
2631 videodsp
2632 vp3dsp
2633 vp56dsp
2634 vp8dsp
2635 wma_freqs
2636 wmv2dsp
2639 CMDLINE_SELECT="
2640 $ARCH_EXT_LIST
2641 $CONFIG_LIST
2642 $HAVE_LIST_CMDLINE
2643 $THREADS_LIST
2645 cross_compile
2646 debug
2647 extra_warnings
2648 logging
2649 optimizations
2650 rpath
2651 stripping
2652 version_tracking
2655 PATHS_LIST="
2656 bindir
2657 datadir
2658 docdir
2659 incdir
2660 libdir
2661 mandir
2662 pkgconfigdir
2663 prefix
2664 shlibdir
2665 install_name_dir
2668 CMDLINE_SET="
2669 $PATHS_LIST
2671 arch
2673 assert_level
2674 build_suffix
2676 objcc
2678 cross_prefix
2679 custom_allocator
2681 dep_cc
2682 doxygen
2684 extra_version
2686 host_cc
2687 host_cflags
2688 host_extralibs
2689 host_ld
2690 host_ldflags
2691 host_os
2692 ignore_tests
2693 install
2695 ln_s
2696 logfile
2697 malloc_prefix
2698 metalcc
2699 metallib
2701 optflags
2702 nvcc
2703 nvccflags
2704 pkg_config
2705 pkg_config_flags
2706 progs_suffix
2707 random_seed
2708 ranlib
2709 samples
2710 stdc
2711 stdcxx
2712 strip
2713 sws_max_filter_size
2714 sysinclude
2715 sysroot
2716 target_exec
2717 target_os
2718 target_path
2719 target_samples
2720 tempprefix
2721 toolchain
2722 valgrind
2723 windres
2724 x86asmexe
2727 CMDLINE_APPEND="
2728 extra_cflags
2729 extra_cxxflags
2730 extra_objcflags
2731 host_cppflags
2734 # code dependency declarations
2736 # architecture extensions
2738 armv5te_deps="arm"
2739 armv6_deps="arm"
2740 armv6t2_deps="arm"
2741 armv8_deps="aarch64"
2742 neon_deps_any="aarch64 arm"
2743 intrinsics_neon_deps="neon"
2744 vfp_deps="arm"
2745 vfpv3_deps="vfp"
2746 setend_deps="arm"
2747 dotprod_deps="aarch64 neon"
2748 i8mm_deps="aarch64 neon"
2750 map 'eval ${v}_inline_deps=inline_asm' $ARCH_EXT_LIST_ARM
2752 altivec_deps="ppc"
2753 dcbzl_deps="ppc"
2754 ldbrx_deps="ppc"
2755 ppc4xx_deps="ppc"
2756 vsx_deps="altivec"
2757 power8_deps="vsx"
2759 rv_deps="riscv"
2760 rvv_deps="rv"
2762 loongson2_deps="mips"
2763 loongson3_deps="mips"
2764 mmi_deps_any="loongson2 loongson3"
2765 lsx_deps="loongarch"
2766 lasx_deps="lsx"
2768 mips32r2_deps="mips"
2769 mips32r5_deps="mips"
2770 mips32r6_deps="mips"
2771 mips64r2_deps="mips"
2772 mips64r6_deps="mips"
2773 mipsfpu_deps="mips"
2774 mipsdsp_deps="mips"
2775 mipsdspr2_deps="mips"
2776 msa_deps="mipsfpu"
2778 x86_64_select="i686"
2779 x86_64_suggest="fast_cmov"
2781 amd3dnow_deps="mmx"
2782 amd3dnowext_deps="amd3dnow"
2783 i686_deps="x86"
2784 mmx_deps="x86"
2785 mmxext_deps="mmx"
2786 sse_deps="mmxext"
2787 sse2_deps="sse"
2788 sse3_deps="sse2"
2789 ssse3_deps="sse3"
2790 sse4_deps="ssse3"
2791 sse42_deps="sse4"
2792 aesni_deps="sse42"
2793 avx_deps="sse42"
2794 xop_deps="avx"
2795 fma3_deps="avx"
2796 fma4_deps="avx"
2797 avx2_deps="avx"
2798 avx512_deps="avx2"
2799 avx512icl_deps="avx512"
2801 mmx_external_deps="x86asm"
2802 mmx_inline_deps="inline_asm x86"
2803 mmx_suggest="mmx_external mmx_inline"
2805 for ext in $(filter_out mmx $ARCH_EXT_LIST_X86_SIMD); do
2806 eval dep=\$${ext}_deps
2807 eval ${ext}_external_deps='"${dep}_external"'
2808 eval ${ext}_inline_deps='"${dep}_inline"'
2809 eval ${ext}_suggest='"${ext}_external ${ext}_inline"'
2810 done
2812 aligned_stack_if_any="aarch64 ppc x86"
2813 fast_64bit_if_any="aarch64 alpha ia64 mips64 parisc64 ppc64 riscv64 sparc64 x86_64"
2814 fast_clz_if_any="aarch64 alpha avr32 mips ppc x86"
2815 fast_unaligned_if_any="aarch64 ppc x86"
2816 simd_align_16_if_any="altivec neon sse"
2817 simd_align_32_if_any="avx"
2818 simd_align_64_if_any="avx512"
2820 # system capabilities
2821 linux_perf_deps="linux_perf_event_h"
2822 symver_if_any="symver_asm_label symver_gnu_asm"
2823 valgrind_backtrace_conflict="optimizations"
2824 valgrind_backtrace_deps="valgrind_valgrind_h"
2826 # threading support
2827 atomics_gcc_if="sync_val_compare_and_swap"
2828 atomics_suncc_if="atomic_cas_ptr machine_rw_barrier"
2829 atomics_win32_if="MemoryBarrier"
2830 atomics_native_if_any="$ATOMICS_LIST"
2831 w32threads_deps="atomics_native"
2832 threads_if_any="$THREADS_LIST"
2834 # subsystems
2835 cbs_av1_select="cbs"
2836 cbs_h264_select="cbs"
2837 cbs_h265_select="cbs"
2838 cbs_h266_select="cbs"
2839 cbs_jpeg_select="cbs"
2840 cbs_mpeg2_select="cbs"
2841 cbs_vp8_select="cbs"
2842 cbs_vp9_select="cbs"
2843 deflate_wrapper_deps="zlib"
2844 dirac_parse_select="golomb"
2845 dovi_rpudec_select="golomb"
2846 dovi_rpuenc_select="golomb"
2847 dnn_suggest="libtensorflow libopenvino libtorch"
2848 dnn_deps="avformat swscale"
2849 error_resilience_select="me_cmp"
2850 evcparse_select="golomb"
2851 faandct_deps="faan"
2852 faandct_select="fdctdsp"
2853 faanidct_deps="faan"
2854 faanidct_select="idctdsp"
2855 h264dsp_select="startcode"
2856 h264_sei_select="atsc_a53 golomb"
2857 hevcparse_select="golomb"
2858 hevc_sei_select="atsc_a53 golomb"
2859 frame_thread_encoder_deps="encoders threads"
2860 iamfdec_deps="iamf"
2861 iamfdec_select="iso_media mpeg4audio"
2862 iamfenc_deps="iamf"
2863 inflate_wrapper_deps="zlib"
2864 intrax8_select="blockdsp wmv2dsp"
2865 iso_media_select="mpeg4audio"
2866 me_cmp_select="idctdsp"
2867 mpeg_er_select="error_resilience"
2868 mpegaudio_select="mpegaudiodsp mpegaudioheader"
2869 mpegvideo_select="blockdsp hpeldsp idctdsp videodsp"
2870 mpegvideodec_select="h264chroma mpegvideo mpeg_er"
2871 mpegvideoenc_select="aandcttables fdctdsp me_cmp mpegvideo pixblockdsp"
2872 msmpeg4dec_select="h263_decoder"
2873 msmpeg4enc_select="h263_encoder"
2874 vc1dsp_select="h264chroma qpeldsp startcode"
2876 # decoders / encoders
2877 aac_decoder_select="adts_header mpeg4audio sinewin"
2878 aac_fixed_decoder_select="adts_header mpeg4audio"
2879 aac_encoder_select="audio_frame_queue iirfilter lpc sinewin"
2880 aac_latm_decoder_select="aac_decoder aac_latm_parser"
2881 ac3_decoder_select="ac3_parser ac3dsp bswapdsp fmtconvert"
2882 ac3_fixed_decoder_select="ac3_parser ac3dsp bswapdsp"
2883 ac3_encoder_select="ac3dsp audiodsp me_cmp"
2884 ac3_fixed_encoder_select="ac3dsp audiodsp me_cmp"
2885 acelp_kelvin_decoder_select="audiodsp"
2886 adpcm_g722_decoder_select="g722dsp"
2887 adpcm_g722_encoder_select="g722dsp"
2888 agm_decoder_select="idctdsp"
2889 aic_decoder_select="golomb idctdsp"
2890 alac_encoder_select="lpc"
2891 als_decoder_select="bswapdsp mpeg4audio"
2892 amrnb_decoder_select="lsp"
2893 amrwb_decoder_select="lsp"
2894 amv_decoder_select="sp5x_decoder exif"
2895 amv_encoder_select="jpegtables mpegvideoenc"
2896 ape_decoder_select="bswapdsp llauddsp"
2897 apng_decoder_select="inflate_wrapper"
2898 apng_encoder_select="deflate_wrapper llvidencdsp"
2899 aptx_encoder_select="audio_frame_queue"
2900 aptx_hd_encoder_select="audio_frame_queue"
2901 asv1_decoder_select="blockdsp bswapdsp idctdsp"
2902 asv1_encoder_select="aandcttables bswapdsp fdctdsp pixblockdsp"
2903 asv2_decoder_select="blockdsp bswapdsp idctdsp"
2904 asv2_encoder_select="aandcttables bswapdsp fdctdsp pixblockdsp"
2905 atrac1_decoder_select="sinewin"
2906 av1_decoder_select="atsc_a53 cbs_av1 dovi_rpudec"
2907 bink_decoder_select="blockdsp hpeldsp"
2908 binkaudio_dct_decoder_select="wma_freqs"
2909 binkaudio_rdft_decoder_select="wma_freqs"
2910 cavs_decoder_select="blockdsp golomb h264chroma idctdsp qpeldsp videodsp"
2911 clearvideo_decoder_select="idctdsp"
2912 cllc_decoder_select="bswapdsp"
2913 comfortnoise_encoder_select="lpc"
2914 cook_decoder_select="audiodsp sinewin"
2915 cri_decoder_select="mjpeg_decoder"
2916 cscd_decoder_suggest="zlib"
2917 dds_decoder_select="texturedsp"
2918 dirac_decoder_select="dirac_parse dwt golomb videodsp mpegvideoenc"
2919 dnxhd_decoder_select="blockdsp idctdsp"
2920 dnxhd_encoder_select="blockdsp fdctdsp idctdsp mpegvideoenc pixblockdsp videodsp"
2921 dvvideo_decoder_select="dvprofile idctdsp"
2922 dvvideo_encoder_select="dvprofile fdctdsp me_cmp pixblockdsp"
2923 dxa_decoder_deps="zlib"
2924 dxv_decoder_select="lzf texturedsp"
2925 dxv_encoder_select="texturedspenc"
2926 eac3_decoder_select="ac3_decoder"
2927 eac3_encoder_select="ac3_encoder"
2928 eamad_decoder_select="aandcttables blockdsp bswapdsp"
2929 eatgq_decoder_select="aandcttables"
2930 eatqi_decoder_select="aandcttables blockdsp bswapdsp"
2931 exr_decoder_deps="zlib"
2932 exr_encoder_deps="zlib"
2933 ffv1_decoder_select="rangecoder"
2934 ffv1_encoder_select="rangecoder"
2935 ffvhuff_decoder_select="huffyuv_decoder"
2936 ffvhuff_encoder_select="huffyuv_encoder"
2937 fic_decoder_select="golomb"
2938 flac_encoder_select="bswapdsp lpc"
2939 flashsv2_decoder_select="inflate_wrapper"
2940 flashsv2_encoder_select="deflate_wrapper"
2941 flashsv_decoder_select="inflate_wrapper"
2942 flashsv_encoder_deps="zlib"
2943 flv_decoder_select="h263_decoder"
2944 flv_encoder_select="h263_encoder"
2945 fourxm_decoder_select="blockdsp bswapdsp"
2946 fraps_decoder_select="bswapdsp huffman"
2947 g2m_decoder_deps="zlib"
2948 g2m_decoder_select="blockdsp idctdsp jpegtables"
2949 g729_decoder_select="audiodsp"
2950 h261_decoder_select="mpegvideodec"
2951 h261_encoder_select="mpegvideoenc"
2952 h263_decoder_select="h263_parser h263dsp mpegvideodec qpeldsp"
2953 h263_encoder_select="h263dsp mpegvideoenc"
2954 h263i_decoder_select="h263_decoder"
2955 h263p_decoder_select="h263_decoder"
2956 h263p_encoder_select="h263_encoder"
2957 h264_decoder_select="cabac golomb h264chroma h264dsp h264parse h264pred h264qpel h264_sei videodsp"
2958 h264_decoder_suggest="error_resilience"
2959 hap_decoder_select="snappy texturedsp"
2960 hap_encoder_deps="libsnappy"
2961 hap_encoder_select="texturedspenc"
2962 hevc_decoder_select="bswapdsp cabac dovi_rpudec golomb hevcparse hevc_sei videodsp"
2963 huffyuv_decoder_select="bswapdsp huffyuvdsp llviddsp"
2964 huffyuv_encoder_select="bswapdsp huffman huffyuvencdsp llvidencdsp"
2965 hymt_decoder_select="huffyuv_decoder"
2966 iac_decoder_select="imc_decoder"
2967 imc_decoder_select="bswapdsp sinewin"
2968 imm4_decoder_select="bswapdsp idctdsp"
2969 imm5_decoder_select="h264_decoder hevc_decoder"
2970 indeo3_decoder_select="hpeldsp"
2971 indeo4_decoder_select="ividsp"
2972 indeo5_decoder_select="ividsp"
2973 interplay_video_decoder_select="hpeldsp"
2974 ipu_decoder_select="mpegvideodec"
2975 jpegls_decoder_select="mjpeg_decoder"
2976 jv_decoder_select="blockdsp"
2977 lagarith_decoder_select="llviddsp"
2978 lead_decoder_select="idctdsp jpegtables"
2979 ljpeg_encoder_select="jpegtables"
2980 lscr_decoder_select="inflate_wrapper"
2981 magicyuv_decoder_select="llviddsp"
2982 magicyuv_encoder_select="llvidencdsp"
2983 mdec_decoder_select="blockdsp bswapdsp idctdsp"
2984 media100_decoder_select="media100_to_mjpegb_bsf mjpegb_decoder"
2985 metasound_decoder_select="lsp sinewin"
2986 mimic_decoder_select="blockdsp bswapdsp hpeldsp idctdsp"
2987 mjpeg_decoder_select="blockdsp hpeldsp exif idctdsp jpegtables"
2988 mjpeg_encoder_select="jpegtables mpegvideoenc"
2989 mjpegb_decoder_select="mjpeg_decoder"
2990 mlp_decoder_select="mlp_parser"
2991 mlp_encoder_select="lpc audio_frame_queue"
2992 mobiclip_decoder_select="bswapdsp golomb"
2993 motionpixels_decoder_select="bswapdsp"
2994 mp1_decoder_select="mpegaudio"
2995 mp1float_decoder_select="mpegaudio"
2996 mp2_decoder_select="mpegaudio"
2997 mp2float_decoder_select="mpegaudio"
2998 mp3_decoder_select="mpegaudio"
2999 mp3adu_decoder_select="mpegaudio"
3000 mp3adufloat_decoder_select="mpegaudio"
3001 mp3float_decoder_select="mpegaudio"
3002 mp3on4_decoder_select="mpegaudio mpeg4audio"
3003 mp3on4float_decoder_select="mpegaudio mpeg4audio"
3004 mpc7_decoder_select="bswapdsp mpegaudiodsp"
3005 mpc8_decoder_select="mpegaudiodsp"
3006 mpegvideo_decoder_select="mpegvideodec"
3007 mpeg1video_decoder_select="mpegvideodec"
3008 mpeg1video_encoder_select="mpegvideoenc"
3009 mpeg2video_decoder_select="mpegvideodec"
3010 mpeg2video_encoder_select="mpegvideoenc"
3011 mpeg4_decoder_select="h263_decoder mpeg4video_parser"
3012 mpeg4_encoder_select="h263_encoder qpeldsp"
3013 msa1_decoder_select="mss34dsp"
3014 mscc_decoder_select="inflate_wrapper"
3015 msmpeg4v1_decoder_select="msmpeg4dec"
3016 msmpeg4v2_decoder_select="msmpeg4dec"
3017 msmpeg4v2_encoder_select="msmpeg4enc"
3018 msmpeg4v3_decoder_select="msmpeg4dec"
3019 msmpeg4v3_encoder_select="msmpeg4enc"
3020 mss2_decoder_select="mpegvideodec qpeldsp vc1_decoder"
3021 mts2_decoder_select="jpegtables mss34dsp"
3022 mv30_decoder_select="aandcttables blockdsp"
3023 mvha_decoder_select="inflate_wrapper llviddsp"
3024 mwsc_decoder_select="inflate_wrapper"
3025 mxpeg_decoder_select="mjpeg_decoder"
3026 nellymoser_decoder_select="sinewin"
3027 nellymoser_encoder_select="audio_frame_queue sinewin"
3028 notchlc_decoder_select="lzf"
3029 nuv_decoder_select="idctdsp"
3030 opus_decoder_deps="swresample"
3031 opus_encoder_select="audio_frame_queue"
3032 pdv_decoder_deps="zlib"
3033 png_decoder_select="inflate_wrapper"
3034 png_encoder_select="deflate_wrapper llvidencdsp"
3035 prores_decoder_select="blockdsp idctdsp"
3036 prores_encoder_select="fdctdsp"
3037 prores_aw_encoder_select="fdctdsp"
3038 prores_ks_encoder_select="fdctdsp"
3039 qcelp_decoder_select="lsp"
3040 qdm2_decoder_select="mpegaudiodsp"
3041 ra_144_decoder_select="audiodsp"
3042 ra_144_encoder_select="audio_frame_queue lpc audiodsp"
3043 ralf_decoder_select="golomb"
3044 rasc_decoder_select="inflate_wrapper"
3045 rawvideo_decoder_select="bswapdsp"
3046 rscc_decoder_deps="zlib"
3047 rtv1_decoder_select="texturedsp"
3048 rv10_decoder_select="h263_decoder"
3049 rv10_encoder_select="h263_encoder"
3050 rv20_decoder_select="h263_decoder"
3051 rv20_encoder_select="h263_encoder"
3052 rv30_decoder_select="golomb h264pred h264qpel mpegvideodec rv34dsp"
3053 rv40_decoder_select="golomb h264pred h264qpel mpegvideodec rv34dsp"
3054 screenpresso_decoder_deps="zlib"
3055 shorten_decoder_select="bswapdsp"
3056 sipr_decoder_select="lsp"
3057 smvjpeg_decoder_select="mjpeg_decoder"
3058 snow_decoder_select="dwt h264qpel rangecoder videodsp"
3059 snow_encoder_select="dwt h264qpel hpeldsp me_cmp mpegvideoenc rangecoder videodsp"
3060 sonic_decoder_select="golomb rangecoder"
3061 sonic_encoder_select="golomb rangecoder"
3062 sonic_ls_encoder_select="golomb rangecoder"
3063 sp5x_decoder_select="mjpeg_decoder"
3064 speedhq_decoder_select="blockdsp idctdsp"
3065 speedhq_encoder_select="mpegvideoenc"
3066 srgc_decoder_select="inflate_wrapper"
3067 svq1_decoder_select="hpeldsp"
3068 svq1_encoder_select="hpeldsp me_cmp mpegvideoenc"
3069 svq3_decoder_select="golomb h264dsp h264parse h264pred hpeldsp tpeldsp videodsp"
3070 svq3_decoder_suggest="zlib"
3071 tak_decoder_select="audiodsp"
3072 tdsc_decoder_deps="zlib"
3073 tdsc_decoder_select="mjpeg_decoder"
3074 theora_decoder_select="vp3_decoder"
3075 thp_decoder_select="mjpeg_decoder"
3076 tiff_decoder_select="mjpeg_decoder"
3077 tiff_decoder_suggest="zlib lzma"
3078 tiff_encoder_suggest="zlib"
3079 truehd_decoder_select="mlp_parser"
3080 truehd_encoder_select="lpc audio_frame_queue"
3081 truemotion2_decoder_select="bswapdsp"
3082 truespeech_decoder_select="bswapdsp"
3083 tscc_decoder_select="inflate_wrapper"
3084 twinvq_decoder_select="lsp sinewin"
3085 txd_decoder_select="texturedsp"
3086 utvideo_decoder_select="bswapdsp llviddsp"
3087 utvideo_encoder_select="bswapdsp huffman llvidencdsp"
3088 vble_decoder_select="llviddsp"
3089 vbn_decoder_select="texturedsp"
3090 vbn_encoder_select="texturedspenc"
3091 vmix_decoder_select="idctdsp"
3092 vc1_decoder_select="blockdsp h264qpel intrax8 mpegvideodec qpeldsp vc1dsp"
3093 vc1image_decoder_select="vc1_decoder"
3094 vorbis_encoder_select="audio_frame_queue"
3095 vp3_decoder_select="hpeldsp vp3dsp videodsp"
3096 vp4_decoder_select="vp3_decoder"
3097 vp5_decoder_select="h264chroma hpeldsp videodsp vp3dsp vp56dsp"
3098 vp6_decoder_select="h264chroma hpeldsp huffman videodsp vp3dsp vp56dsp"
3099 vp6a_decoder_select="vp6_decoder"
3100 vp6f_decoder_select="vp6_decoder"
3101 vp7_decoder_select="h264pred videodsp vp8dsp"
3102 vp8_decoder_select="h264pred videodsp vp8dsp"
3103 vp9_decoder_select="videodsp vp9_parser vp9_superframe_split_bsf"
3104 vvc_decoder_select="cabac cbs_h266 golomb videodsp"
3105 wcmv_decoder_select="inflate_wrapper"
3106 webp_decoder_select="vp8_decoder exif"
3107 wmalossless_decoder_select="llauddsp"
3108 wmapro_decoder_select="sinewin wma_freqs"
3109 wmav1_decoder_select="sinewin wma_freqs"
3110 wmav1_encoder_select="sinewin wma_freqs"
3111 wmav2_decoder_select="sinewin wma_freqs"
3112 wmav2_encoder_select="sinewin wma_freqs"
3113 wmavoice_decoder_select="lsp sinewin"
3114 wmv1_decoder_select="msmpeg4dec"
3115 wmv1_encoder_select="msmpeg4enc"
3116 wmv2_decoder_select="blockdsp error_resilience idctdsp intrax8 msmpeg4dec videodsp wmv2dsp"
3117 wmv2_encoder_select="msmpeg4enc wmv2dsp"
3118 wmv3_decoder_select="vc1_decoder"
3119 wmv3image_decoder_select="wmv3_decoder"
3120 xma1_decoder_select="wmapro_decoder"
3121 xma2_decoder_select="wmapro_decoder"
3122 ylc_decoder_select="bswapdsp"
3123 zerocodec_decoder_select="inflate_wrapper"
3124 zlib_decoder_select="inflate_wrapper"
3125 zlib_encoder_select="deflate_wrapper"
3126 zmbv_decoder_select="inflate_wrapper"
3127 zmbv_encoder_select="deflate_wrapper"
3129 # hardware accelerators
3130 cuda_deps="ffnvcodec"
3131 cuvid_deps="ffnvcodec"
3132 d3d11va_deps="dxva_h ID3D11VideoDecoder ID3D11VideoContext"
3133 d3d12va_deps="dxva_h ID3D12Device ID3D12VideoDecoder"
3134 dxva2_deps="dxva2api_h DXVA2_ConfigPictureDecode ole32 user32"
3135 ffnvcodec_deps_any="libdl LoadLibrary"
3136 mediacodec_deps="android mediandk"
3137 nvdec_deps="ffnvcodec"
3138 vaapi_x11_deps="xlib_x11"
3139 videotoolbox_hwaccel_deps="videotoolbox pthreads"
3140 videotoolbox_hwaccel_extralibs="-framework QuartzCore"
3141 vulkan_deps="threads"
3142 vulkan_deps_any="libdl LoadLibrary"
3144 av1_d3d11va_hwaccel_deps="d3d11va DXVA_PicParams_AV1"
3145 av1_d3d11va_hwaccel_select="av1_decoder"
3146 av1_d3d11va2_hwaccel_deps="d3d11va DXVA_PicParams_AV1"
3147 av1_d3d11va2_hwaccel_select="av1_decoder"
3148 av1_d3d12va_hwaccel_deps="d3d12va DXVA_PicParams_AV1"
3149 av1_d3d12va_hwaccel_select="av1_decoder"
3150 av1_dxva2_hwaccel_deps="dxva2 DXVA_PicParams_AV1"
3151 av1_dxva2_hwaccel_select="av1_decoder"
3152 av1_nvdec_hwaccel_deps="nvdec CUVIDAV1PICPARAMS"
3153 av1_nvdec_hwaccel_select="av1_decoder"
3154 av1_vaapi_hwaccel_deps="vaapi VADecPictureParameterBufferAV1_bit_depth_idx"
3155 av1_vaapi_hwaccel_select="av1_decoder"
3156 av1_vdpau_hwaccel_deps="vdpau VdpPictureInfoAV1"
3157 av1_vdpau_hwaccel_select="av1_decoder"
3158 av1_vulkan_hwaccel_deps="vulkan"
3159 av1_vulkan_hwaccel_select="av1_decoder"
3160 h263_vaapi_hwaccel_deps="vaapi"
3161 h263_vaapi_hwaccel_select="h263_decoder"
3162 h263_videotoolbox_hwaccel_deps="videotoolbox"
3163 h263_videotoolbox_hwaccel_select="h263_decoder"
3164 h264_d3d11va_hwaccel_deps="d3d11va"
3165 h264_d3d11va_hwaccel_select="h264_decoder"
3166 h264_d3d11va2_hwaccel_deps="d3d11va"
3167 h264_d3d11va2_hwaccel_select="h264_decoder"
3168 h264_d3d12va_hwaccel_deps="d3d12va"
3169 h264_d3d12va_hwaccel_select="h264_decoder"
3170 h264_dxva2_hwaccel_deps="dxva2"
3171 h264_dxva2_hwaccel_select="h264_decoder"
3172 h264_nvdec_hwaccel_deps="nvdec"
3173 h264_nvdec_hwaccel_select="h264_decoder"
3174 h264_vaapi_hwaccel_deps="vaapi"
3175 h264_vaapi_hwaccel_select="h264_decoder"
3176 h264_vdpau_hwaccel_deps="vdpau"
3177 h264_vdpau_hwaccel_select="h264_decoder"
3178 h264_videotoolbox_hwaccel_deps="videotoolbox"
3179 h264_videotoolbox_hwaccel_select="h264_decoder"
3180 h264_vulkan_hwaccel_deps="vulkan"
3181 h264_vulkan_hwaccel_select="h264_decoder"
3182 hevc_d3d11va_hwaccel_deps="d3d11va DXVA_PicParams_HEVC"
3183 hevc_d3d11va_hwaccel_select="hevc_decoder"
3184 hevc_d3d11va2_hwaccel_deps="d3d11va DXVA_PicParams_HEVC"
3185 hevc_d3d11va2_hwaccel_select="hevc_decoder"
3186 hevc_d3d12va_hwaccel_deps="d3d12va DXVA_PicParams_HEVC"
3187 hevc_d3d12va_hwaccel_select="hevc_decoder"
3188 hevc_dxva2_hwaccel_deps="dxva2 DXVA_PicParams_HEVC"
3189 hevc_dxva2_hwaccel_select="hevc_decoder"
3190 hevc_nvdec_hwaccel_deps="nvdec"
3191 hevc_nvdec_hwaccel_select="hevc_decoder"
3192 hevc_vaapi_hwaccel_deps="vaapi VAPictureParameterBufferHEVC"
3193 hevc_vaapi_hwaccel_select="hevc_decoder"
3194 hevc_vdpau_hwaccel_deps="vdpau VdpPictureInfoHEVC"
3195 hevc_vdpau_hwaccel_select="hevc_decoder"
3196 hevc_videotoolbox_hwaccel_deps="videotoolbox"
3197 hevc_videotoolbox_hwaccel_select="hevc_decoder"
3198 hevc_vulkan_hwaccel_deps="vulkan"
3199 hevc_vulkan_hwaccel_select="hevc_decoder"
3200 mjpeg_nvdec_hwaccel_deps="nvdec"
3201 mjpeg_nvdec_hwaccel_select="mjpeg_decoder"
3202 mjpeg_vaapi_hwaccel_deps="vaapi"
3203 mjpeg_vaapi_hwaccel_select="mjpeg_decoder"
3204 mpeg1_nvdec_hwaccel_deps="nvdec"
3205 mpeg1_nvdec_hwaccel_select="mpeg1video_decoder"
3206 mpeg1_vdpau_hwaccel_deps="vdpau"
3207 mpeg1_vdpau_hwaccel_select="mpeg1video_decoder"
3208 mpeg1_videotoolbox_hwaccel_deps="videotoolbox"
3209 mpeg1_videotoolbox_hwaccel_select="mpeg1video_decoder"
3210 mpeg2_d3d11va_hwaccel_deps="d3d11va"
3211 mpeg2_d3d11va_hwaccel_select="mpeg2video_decoder"
3212 mpeg2_d3d11va2_hwaccel_deps="d3d11va"
3213 mpeg2_d3d11va2_hwaccel_select="mpeg2video_decoder"
3214 mpeg2_d3d12va_hwaccel_deps="d3d12va"
3215 mpeg2_d3d12va_hwaccel_select="mpeg2video_decoder"
3216 mpeg2_dxva2_hwaccel_deps="dxva2"
3217 mpeg2_dxva2_hwaccel_select="mpeg2video_decoder"
3218 mpeg2_nvdec_hwaccel_deps="nvdec"
3219 mpeg2_nvdec_hwaccel_select="mpeg2video_decoder"
3220 mpeg2_vaapi_hwaccel_deps="vaapi"
3221 mpeg2_vaapi_hwaccel_select="mpeg2video_decoder"
3222 mpeg2_vdpau_hwaccel_deps="vdpau"
3223 mpeg2_vdpau_hwaccel_select="mpeg2video_decoder"
3224 mpeg2_videotoolbox_hwaccel_deps="videotoolbox"
3225 mpeg2_videotoolbox_hwaccel_select="mpeg2video_decoder"
3226 mpeg4_nvdec_hwaccel_deps="nvdec"
3227 mpeg4_nvdec_hwaccel_select="mpeg4_decoder"
3228 mpeg4_vaapi_hwaccel_deps="vaapi"
3229 mpeg4_vaapi_hwaccel_select="mpeg4_decoder"
3230 mpeg4_vdpau_hwaccel_deps="vdpau"
3231 mpeg4_vdpau_hwaccel_select="mpeg4_decoder"
3232 mpeg4_videotoolbox_hwaccel_deps="videotoolbox"
3233 mpeg4_videotoolbox_hwaccel_select="mpeg4_decoder"
3234 prores_videotoolbox_hwaccel_deps="videotoolbox"
3235 prores_videotoolbox_hwaccel_select="prores_decoder"
3236 vc1_d3d11va_hwaccel_deps="d3d11va"
3237 vc1_d3d11va_hwaccel_select="vc1_decoder"
3238 vc1_d3d11va2_hwaccel_deps="d3d11va"
3239 vc1_d3d11va2_hwaccel_select="vc1_decoder"
3240 vc1_d3d12va_hwaccel_deps="d3d12va"
3241 vc1_d3d12va_hwaccel_select="vc1_decoder"
3242 vc1_dxva2_hwaccel_deps="dxva2"
3243 vc1_dxva2_hwaccel_select="vc1_decoder"
3244 vc1_nvdec_hwaccel_deps="nvdec"
3245 vc1_nvdec_hwaccel_select="vc1_decoder"
3246 vc1_vaapi_hwaccel_deps="vaapi"
3247 vc1_vaapi_hwaccel_select="vc1_decoder"
3248 vc1_vdpau_hwaccel_deps="vdpau"
3249 vc1_vdpau_hwaccel_select="vc1_decoder"
3250 vp8_nvdec_hwaccel_deps="nvdec"
3251 vp8_nvdec_hwaccel_select="vp8_decoder"
3252 vp8_vaapi_hwaccel_deps="vaapi"
3253 vp8_vaapi_hwaccel_select="vp8_decoder"
3254 vp9_d3d11va_hwaccel_deps="d3d11va DXVA_PicParams_VP9"
3255 vp9_d3d11va_hwaccel_select="vp9_decoder"
3256 vp9_d3d11va2_hwaccel_deps="d3d11va DXVA_PicParams_VP9"
3257 vp9_d3d11va2_hwaccel_select="vp9_decoder"
3258 vp9_d3d12va_hwaccel_deps="d3d12va DXVA_PicParams_VP9"
3259 vp9_d3d12va_hwaccel_select="vp9_decoder"
3260 vp9_dxva2_hwaccel_deps="dxva2 DXVA_PicParams_VP9"
3261 vp9_dxva2_hwaccel_select="vp9_decoder"
3262 vp9_nvdec_hwaccel_deps="nvdec"
3263 vp9_nvdec_hwaccel_select="vp9_decoder"
3264 vp9_vaapi_hwaccel_deps="vaapi VADecPictureParameterBufferVP9_bit_depth"
3265 vp9_vaapi_hwaccel_select="vp9_decoder"
3266 vp9_vdpau_hwaccel_deps="vdpau VdpPictureInfoVP9"
3267 vp9_vdpau_hwaccel_select="vp9_decoder"
3268 vp9_videotoolbox_hwaccel_deps="videotoolbox"
3269 vp9_videotoolbox_hwaccel_select="vp9_decoder"
3270 wmv3_d3d11va_hwaccel_select="vc1_d3d11va_hwaccel"
3271 wmv3_d3d11va2_hwaccel_select="vc1_d3d11va2_hwaccel"
3272 wmv3_d3d12va_hwaccel_select="vc1_d3d12va_hwaccel"
3273 wmv3_dxva2_hwaccel_select="vc1_dxva2_hwaccel"
3274 wmv3_nvdec_hwaccel_select="vc1_nvdec_hwaccel"
3275 wmv3_vaapi_hwaccel_select="vc1_vaapi_hwaccel"
3276 wmv3_vdpau_hwaccel_select="vc1_vdpau_hwaccel"
3278 # hardware-accelerated codecs
3279 mediafoundation_deps="mftransform_h MFCreateAlignedMemoryBuffer"
3280 omx_deps="libdl pthreads"
3281 omx_rpi_select="omx"
3282 qsv_deps="libmfx"
3283 qsvdec_select="qsv"
3284 qsvenc_select="qsv"
3285 qsvvpp_select="qsv"
3286 vaapi_encode_deps="vaapi"
3287 v4l2_m2m_deps="linux_videodev2_h sem_timedwait"
3289 bilateral_cuda_filter_deps="ffnvcodec"
3290 bilateral_cuda_filter_deps_any="cuda_nvcc cuda_llvm"
3291 chromakey_cuda_filter_deps="ffnvcodec"
3292 chromakey_cuda_filter_deps_any="cuda_nvcc cuda_llvm"
3293 colorspace_cuda_filter_deps="ffnvcodec"
3294 colorspace_cuda_filter_deps_any="cuda_nvcc cuda_llvm"
3295 hwupload_cuda_filter_deps="ffnvcodec"
3296 scale_npp_filter_deps="ffnvcodec libnpp"
3297 scale2ref_npp_filter_deps="ffnvcodec libnpp"
3298 scale_cuda_filter_deps="ffnvcodec"
3299 scale_cuda_filter_deps_any="cuda_nvcc cuda_llvm"
3300 thumbnail_cuda_filter_deps="ffnvcodec"
3301 thumbnail_cuda_filter_deps_any="cuda_nvcc cuda_llvm"
3302 transpose_npp_filter_deps="ffnvcodec libnpp"
3303 overlay_cuda_filter_deps="ffnvcodec"
3304 overlay_cuda_filter_deps_any="cuda_nvcc cuda_llvm"
3305 sharpen_npp_filter_deps="ffnvcodec libnpp"
3307 ddagrab_filter_deps="d3d11va IDXGIOutput1 DXGI_OUTDUPL_FRAME_INFO"
3309 amf_deps_any="libdl LoadLibrary"
3310 nvenc_deps="ffnvcodec"
3311 nvenc_deps_any="libdl LoadLibrary"
3313 aac_mf_encoder_deps="mediafoundation"
3314 ac3_mf_encoder_deps="mediafoundation"
3315 av1_cuvid_decoder_deps="cuvid CUVIDAV1PICPARAMS"
3316 av1_mediacodec_decoder_deps="mediacodec"
3317 av1_mediacodec_encoder_deps="mediacodec"
3318 av1_mediacodec_encoder_select="extract_extradata_bsf"
3319 av1_nvenc_encoder_deps="nvenc NV_ENC_PIC_PARAMS_AV1"
3320 av1_nvenc_encoder_select="atsc_a53"
3321 h263_v4l2m2m_decoder_deps="v4l2_m2m h263_v4l2_m2m"
3322 h263_v4l2m2m_encoder_deps="v4l2_m2m h263_v4l2_m2m"
3323 h264_amf_encoder_deps="amf"
3324 h264_cuvid_decoder_deps="cuvid"
3325 h264_cuvid_decoder_select="h264_mp4toannexb_bsf"
3326 h264_mediacodec_decoder_deps="mediacodec"
3327 h264_mediacodec_decoder_select="h264_mp4toannexb_bsf h264_parser"
3328 h264_mediacodec_encoder_deps="mediacodec"
3329 h264_mediacodec_encoder_select="extract_extradata_bsf h264_metadata"
3330 h264_mf_encoder_deps="mediafoundation"
3331 h264_mmal_decoder_deps="mmal"
3332 h264_nvenc_encoder_deps="nvenc"
3333 h264_nvenc_encoder_select="atsc_a53"
3334 h264_omx_encoder_deps="omx"
3335 h264_qsv_decoder_select="h264_mp4toannexb_bsf qsvdec"
3336 h264_qsv_encoder_select="atsc_a53 qsvenc"
3337 h264_rkmpp_decoder_deps="rkmpp"
3338 h264_rkmpp_decoder_select="h264_mp4toannexb_bsf"
3339 h264_vaapi_encoder_select="atsc_a53 cbs_h264 vaapi_encode"
3340 h264_v4l2m2m_decoder_deps="v4l2_m2m h264_v4l2_m2m"
3341 h264_v4l2m2m_decoder_select="h264_mp4toannexb_bsf"
3342 h264_v4l2m2m_encoder_deps="v4l2_m2m h264_v4l2_m2m"
3343 hevc_amf_encoder_deps="amf"
3344 hevc_cuvid_decoder_deps="cuvid"
3345 hevc_cuvid_decoder_select="hevc_mp4toannexb_bsf"
3346 hevc_mediacodec_decoder_deps="mediacodec"
3347 hevc_mediacodec_decoder_select="hevc_mp4toannexb_bsf hevc_parser"
3348 hevc_mediacodec_encoder_deps="mediacodec"
3349 hevc_mediacodec_encoder_select="extract_extradata_bsf hevc_metadata"
3350 hevc_mf_encoder_deps="mediafoundation"
3351 hevc_nvenc_encoder_deps="nvenc"
3352 hevc_nvenc_encoder_select="atsc_a53"
3353 hevc_qsv_decoder_select="hevc_mp4toannexb_bsf qsvdec"
3354 hevc_qsv_encoder_select="hevcparse qsvenc"
3355 hevc_rkmpp_decoder_deps="rkmpp"
3356 hevc_rkmpp_decoder_select="hevc_mp4toannexb_bsf"
3357 hevc_vaapi_encoder_deps="VAEncPictureParameterBufferHEVC"
3358 hevc_vaapi_encoder_select="atsc_a53 cbs_h265 vaapi_encode"
3359 hevc_v4l2m2m_decoder_deps="v4l2_m2m hevc_v4l2_m2m"
3360 hevc_v4l2m2m_decoder_select="hevc_mp4toannexb_bsf"
3361 hevc_v4l2m2m_encoder_deps="v4l2_m2m hevc_v4l2_m2m"
3362 mjpeg_cuvid_decoder_deps="cuvid"
3363 mjpeg_qsv_decoder_select="qsvdec"
3364 mjpeg_qsv_encoder_deps="libmfx"
3365 mjpeg_qsv_encoder_select="qsvenc"
3366 mjpeg_vaapi_encoder_deps="VAEncPictureParameterBufferJPEG"
3367 mjpeg_vaapi_encoder_select="cbs_jpeg jpegtables vaapi_encode"
3368 mp3_mf_encoder_deps="mediafoundation"
3369 mpeg1_cuvid_decoder_deps="cuvid"
3370 mpeg1_v4l2m2m_decoder_deps="v4l2_m2m mpeg1_v4l2_m2m"
3371 mpeg2_cuvid_decoder_deps="cuvid"
3372 mpeg2_mmal_decoder_deps="mmal"
3373 mpeg2_mediacodec_decoder_deps="mediacodec"
3374 mpeg2_qsv_decoder_select="qsvdec"
3375 mpeg2_qsv_encoder_select="qsvenc"
3376 mpeg2_vaapi_encoder_select="cbs_mpeg2 vaapi_encode"
3377 mpeg2_v4l2m2m_decoder_deps="v4l2_m2m mpeg2_v4l2_m2m"
3378 mpeg4_cuvid_decoder_deps="cuvid"
3379 mpeg4_mediacodec_decoder_deps="mediacodec"
3380 mpeg4_mediacodec_encoder_deps="mediacodec"
3381 mpeg4_mediacodec_encoder_select="extract_extradata_bsf"
3382 mpeg4_mmal_decoder_deps="mmal"
3383 mpeg4_omx_encoder_deps="omx"
3384 mpeg4_v4l2m2m_decoder_deps="v4l2_m2m mpeg4_v4l2_m2m"
3385 mpeg4_v4l2m2m_encoder_deps="v4l2_m2m mpeg4_v4l2_m2m"
3386 vc1_cuvid_decoder_deps="cuvid"
3387 vc1_mmal_decoder_deps="mmal"
3388 vc1_qsv_decoder_select="qsvdec"
3389 vc1_v4l2m2m_decoder_deps="v4l2_m2m vc1_v4l2_m2m"
3390 vp8_cuvid_decoder_deps="cuvid"
3391 vp8_mediacodec_decoder_deps="mediacodec"
3392 vp8_mediacodec_encoder_deps="mediacodec"
3393 vp8_qsv_decoder_select="qsvdec"
3394 vp8_rkmpp_decoder_deps="rkmpp"
3395 vp8_vaapi_encoder_deps="VAEncPictureParameterBufferVP8"
3396 vp8_vaapi_encoder_select="vaapi_encode"
3397 vp8_v4l2m2m_decoder_deps="v4l2_m2m vp8_v4l2_m2m"
3398 vp8_v4l2m2m_encoder_deps="v4l2_m2m vp8_v4l2_m2m"
3399 vp9_cuvid_decoder_deps="cuvid"
3400 vp9_mediacodec_decoder_deps="mediacodec"
3401 vp9_mediacodec_encoder_deps="mediacodec"
3402 vp9_qsv_decoder_select="qsvdec"
3403 vp9_rkmpp_decoder_deps="rkmpp"
3404 vp9_vaapi_encoder_deps="VAEncPictureParameterBufferVP9"
3405 vp9_vaapi_encoder_select="vaapi_encode"
3406 vp9_qsv_encoder_deps="libmfx MFX_CODEC_VP9"
3407 vp9_qsv_encoder_select="qsvenc"
3408 vp9_v4l2m2m_decoder_deps="v4l2_m2m vp9_v4l2_m2m"
3409 av1_qsv_decoder_select="qsvdec"
3410 av1_qsv_encoder_select="qsvenc"
3411 av1_qsv_encoder_deps="libvpl"
3412 av1_amf_encoder_deps="amf"
3413 av1_vaapi_encoder_deps="VAEncPictureParameterBufferAV1"
3414 av1_vaapi_encoder_select="cbs_av1 vaapi_encode"
3416 # parsers
3417 aac_parser_select="adts_header mpeg4audio"
3418 av1_parser_select="cbs_av1"
3419 evc_parser_select="evcparse"
3420 h264_parser_select="golomb h264dsp h264parse h264_sei"
3421 hevc_parser_select="hevcparse hevc_sei"
3422 mpegaudio_parser_select="mpegaudioheader"
3423 mpeg4video_parser_select="h263dsp mpegvideodec qpeldsp"
3424 vc1_parser_select="vc1dsp"
3425 vvc_parser_select="cbs_h266"
3427 # bitstream_filters
3428 aac_adtstoasc_bsf_select="adts_header mpeg4audio"
3429 av1_frame_merge_bsf_select="cbs_av1"
3430 av1_frame_split_bsf_select="cbs_av1"
3431 av1_metadata_bsf_select="cbs_av1"
3432 dts2pts_bsf_select="cbs_h264 h264parse"
3433 eac3_core_bsf_select="ac3_parser"
3434 evc_frame_merge_bsf_select="evcparse"
3435 filter_units_bsf_select="cbs"
3436 h264_metadata_bsf_deps="const_nan"
3437 h264_metadata_bsf_select="cbs_h264"
3438 h264_redundant_pps_bsf_select="cbs_h264"
3439 hevc_metadata_bsf_select="cbs_h265"
3440 mjpeg2jpeg_bsf_select="jpegtables"
3441 mpeg2_metadata_bsf_select="cbs_mpeg2"
3442 trace_headers_bsf_select="cbs cbs_vp8"
3443 vp9_metadata_bsf_select="cbs_vp9"
3444 vvc_metadata_bsf_select="cbs_h266"
3446 # external libraries
3447 aac_at_decoder_deps="audiotoolbox"
3448 aac_at_decoder_select="aac_adtstoasc_bsf"
3449 ac3_at_decoder_deps="audiotoolbox"
3450 ac3_at_decoder_select="ac3_parser"
3451 adpcm_ima_qt_at_decoder_deps="audiotoolbox"
3452 alac_at_decoder_deps="audiotoolbox"
3453 amr_nb_at_decoder_deps="audiotoolbox"
3454 avisynth_deps_any="libdl LoadLibrary"
3455 avisynth_demuxer_deps="avisynth"
3456 avisynth_demuxer_select="riffdec"
3457 eac3_at_decoder_deps="audiotoolbox"
3458 eac3_at_decoder_select="ac3_parser"
3459 gsm_ms_at_decoder_deps="audiotoolbox"
3460 ilbc_at_decoder_deps="audiotoolbox"
3461 mp1_at_decoder_deps="audiotoolbox"
3462 mp2_at_decoder_deps="audiotoolbox"
3463 mp3_at_decoder_deps="audiotoolbox"
3464 mp1_at_decoder_select="mpegaudioheader"
3465 mp2_at_decoder_select="mpegaudioheader"
3466 mp3_at_decoder_select="mpegaudioheader"
3467 pcm_alaw_at_decoder_deps="audiotoolbox"
3468 pcm_mulaw_at_decoder_deps="audiotoolbox"
3469 qdmc_at_decoder_deps="audiotoolbox"
3470 qdm2_at_decoder_deps="audiotoolbox"
3471 aac_at_encoder_deps="audiotoolbox"
3472 aac_at_encoder_select="audio_frame_queue"
3473 alac_at_encoder_deps="audiotoolbox"
3474 alac_at_encoder_select="audio_frame_queue"
3475 ilbc_at_encoder_deps="audiotoolbox"
3476 ilbc_at_encoder_select="audio_frame_queue"
3477 pcm_alaw_at_encoder_deps="audiotoolbox"
3478 pcm_alaw_at_encoder_select="audio_frame_queue"
3479 pcm_mulaw_at_encoder_deps="audiotoolbox"
3480 pcm_mulaw_at_encoder_select="audio_frame_queue"
3481 chromaprint_muxer_deps="chromaprint"
3482 h264_videotoolbox_encoder_deps="pthreads"
3483 h264_videotoolbox_encoder_select="atsc_a53 videotoolbox_encoder"
3484 hevc_videotoolbox_encoder_deps="pthreads"
3485 hevc_videotoolbox_encoder_select="atsc_a53 videotoolbox_encoder"
3486 prores_videotoolbox_encoder_deps="pthreads"
3487 prores_videotoolbox_encoder_select="videotoolbox_encoder"
3488 libaom_av1_decoder_deps="libaom"
3489 libaom_av1_encoder_deps="libaom"
3490 libaom_av1_encoder_select="extract_extradata_bsf dovi_rpuenc"
3491 libaribb24_decoder_deps="libaribb24"
3492 libaribcaption_decoder_deps="libaribcaption"
3493 libcelt_decoder_deps="libcelt"
3494 libcodec2_decoder_deps="libcodec2"
3495 libcodec2_encoder_deps="libcodec2"
3496 libdav1d_decoder_deps="libdav1d"
3497 libdav1d_decoder_select="atsc_a53 dovi_rpudec"
3498 libdavs2_decoder_deps="libdavs2"
3499 libdavs2_decoder_select="avs2_parser"
3500 libfdk_aac_decoder_deps="libfdk_aac"
3501 libfdk_aac_encoder_deps="libfdk_aac"
3502 libfdk_aac_encoder_select="audio_frame_queue"
3503 libgme_demuxer_deps="libgme"
3504 libgsm_decoder_deps="libgsm"
3505 libgsm_encoder_deps="libgsm"
3506 libgsm_ms_decoder_deps="libgsm"
3507 libgsm_ms_encoder_deps="libgsm"
3508 libilbc_decoder_deps="libilbc"
3509 libilbc_encoder_deps="libilbc"
3510 libjxl_decoder_deps="libjxl libjxl_threads"
3511 libjxl_encoder_deps="libjxl libjxl_threads"
3512 libkvazaar_encoder_deps="libkvazaar"
3513 liblc3_decoder_deps="liblc3"
3514 liblc3_encoder_deps="liblc3"
3515 liblc3_encoder_select="audio_frame_queue"
3516 libmodplug_demuxer_deps="libmodplug"
3517 libmp3lame_encoder_deps="libmp3lame"
3518 libmp3lame_encoder_select="audio_frame_queue mpegaudioheader"
3519 libopencore_amrnb_decoder_deps="libopencore_amrnb"
3520 libopencore_amrnb_encoder_deps="libopencore_amrnb"
3521 libopencore_amrnb_encoder_select="audio_frame_queue"
3522 libopencore_amrwb_decoder_deps="libopencore_amrwb"
3523 libopenh264_decoder_deps="libopenh264"
3524 libopenh264_decoder_select="h264_mp4toannexb_bsf"
3525 libopenh264_encoder_deps="libopenh264"
3526 libopenjpeg_encoder_deps="libopenjpeg"
3527 libopenmpt_demuxer_deps="libopenmpt"
3528 libopus_decoder_deps="libopus"
3529 libopus_encoder_deps="libopus"
3530 libopus_encoder_select="audio_frame_queue"
3531 librav1e_encoder_deps="librav1e"
3532 librsvg_decoder_deps="librsvg"
3533 libshine_encoder_deps="libshine"
3534 libshine_encoder_select="audio_frame_queue mpegaudioheader"
3535 libspeex_decoder_deps="libspeex"
3536 libspeex_encoder_deps="libspeex"
3537 libspeex_encoder_select="audio_frame_queue"
3538 libsvtav1_encoder_deps="libsvtav1"
3539 libsvtav1_encoder_select="dovi_rpuenc"
3540 libtheora_encoder_deps="libtheora"
3541 libtwolame_encoder_deps="libtwolame"
3542 libuavs3d_decoder_deps="libuavs3d"
3543 libvo_amrwbenc_encoder_deps="libvo_amrwbenc"
3544 libvorbis_decoder_deps="libvorbis"
3545 libvorbis_encoder_deps="libvorbis libvorbisenc"
3546 libvorbis_encoder_select="audio_frame_queue"
3547 libvpx_vp8_decoder_deps="libvpx"
3548 libvpx_vp8_encoder_deps="libvpx"
3549 libvpx_vp9_decoder_deps="libvpx"
3550 libvpx_vp9_encoder_deps="libvpx"
3551 libwebp_encoder_deps="libwebp"
3552 libwebp_anim_encoder_deps="libwebp"
3553 libx262_encoder_deps="libx262"
3554 libx264_encoder_deps="libx264"
3555 libx264_encoder_select="atsc_a53 golomb"
3556 libx264rgb_encoder_deps="libx264"
3557 libx264rgb_encoder_select="libx264_encoder"
3558 libx265_encoder_deps="libx265"
3559 libx265_encoder_select="atsc_a53 dovi_rpuenc"
3560 libxavs_encoder_deps="libxavs"
3561 libxavs2_encoder_deps="libxavs2"
3562 libxevd_decoder_deps="libxevd"
3563 libxeve_encoder_deps="libxeve"
3564 libxvid_encoder_deps="libxvid"
3565 libzvbi_teletext_decoder_deps="libzvbi"
3566 vapoursynth_demuxer_deps="vapoursynth"
3567 videotoolbox_suggest="coreservices"
3568 videotoolbox_deps="corefoundation coremedia corevideo"
3569 videotoolbox_encoder_deps="videotoolbox VTCompressionSessionPrepareToEncodeFrames"
3571 # demuxers / muxers
3572 ac3_demuxer_select="ac3_parser"
3573 act_demuxer_select="riffdec"
3574 adts_muxer_select="mpeg4audio"
3575 aiff_muxer_select="iso_media"
3576 amv_muxer_select="riffenc"
3577 asf_demuxer_select="riffdec"
3578 asf_o_demuxer_select="riffdec"
3579 asf_muxer_select="riffenc"
3580 asf_stream_muxer_select="asf_muxer"
3581 av1_demuxer_select="av1_frame_merge_bsf av1_parser"
3582 avi_demuxer_select="riffdec exif"
3583 avi_muxer_select="riffenc"
3584 avif_muxer_select="mov_muxer"
3585 caf_demuxer_select="iso_media"
3586 caf_muxer_select="iso_media"
3587 dash_muxer_select="mp4_muxer"
3588 dash_demuxer_deps="libxml2"
3589 daud_muxer_select="pcm_rechunk_bsf"
3590 dirac_demuxer_select="dirac_parser"
3591 dts_demuxer_select="dca_parser"
3592 dtshd_demuxer_select="dca_parser"
3593 dv_demuxer_select="dvprofile"
3594 dv_muxer_select="dvprofile"
3595 dvdvideo_demuxer_select="mpegps_demuxer"
3596 dvdvideo_demuxer_deps="libdvdnav libdvdread"
3597 dxa_demuxer_select="riffdec"
3598 eac3_demuxer_select="ac3_parser"
3599 evc_demuxer_select="evc_frame_merge_bsf evc_parser"
3600 f4v_muxer_select="mov_muxer"
3601 fifo_muxer_deps="threads"
3602 flac_demuxer_select="flac_parser"
3603 flv_muxer_select="aac_adtstoasc_bsf"
3604 gxf_muxer_select="pcm_rechunk_bsf"
3605 hds_muxer_select="flv_muxer"
3606 hls_demuxer_select="aac_demuxer ac3_demuxer adts_header ac3_parser eac3_demuxer mov_demuxer mpegts_demuxer"
3607 hls_muxer_select="mov_muxer mpegts_muxer"
3608 iamf_demuxer_select="iamfdec"
3609 iamf_muxer_select="iamfenc"
3610 image2_alias_pix_demuxer_select="image2_demuxer"
3611 image2_brender_pix_demuxer_select="image2_demuxer"
3612 imf_demuxer_deps="libxml2"
3613 imf_demuxer_select="mxf_demuxer"
3614 ipod_muxer_select="mov_muxer"
3615 ismv_muxer_select="mov_muxer"
3616 ivf_muxer_select="av1_metadata_bsf vp9_superframe_bsf"
3617 latm_muxer_select="aac_adtstoasc_bsf mpeg4audio"
3618 matroska_audio_muxer_select="matroska_muxer"
3619 matroska_demuxer_select="riffdec"
3620 matroska_demuxer_suggest="bzlib zlib"
3621 matroska_muxer_select="mpeg4audio riffenc aac_adtstoasc_bsf pgs_frame_merge_bsf vp9_superframe_bsf"
3622 mlp_demuxer_select="mlp_parser"
3623 mmf_muxer_select="riffenc"
3624 mov_demuxer_select="iso_media riffdec"
3625 mov_demuxer_suggest="iamfdec zlib"
3626 mov_muxer_select="iso_media riffenc rtpenc_chain vp9_superframe_bsf aac_adtstoasc_bsf ac3_parser"
3627 mov_muxer_suggest="iamfenc"
3628 mp3_demuxer_select="mpegaudio_parser"
3629 mp3_muxer_select="mpegaudioheader"
3630 mp4_muxer_select="mov_muxer"
3631 mpegts_demuxer_select="iso_media"
3632 mpegts_muxer_select="ac3_parser adts_muxer latm_muxer h264_mp4toannexb_bsf hevc_mp4toannexb_bsf vvc_mp4toannexb_bsf"
3633 mpegtsraw_demuxer_select="mpegts_demuxer"
3634 mxf_muxer_select="pcm_rechunk_bsf rangecoder"
3635 mxf_d10_muxer_select="mxf_muxer"
3636 mxf_opatom_muxer_select="mxf_muxer"
3637 nut_muxer_select="riffenc"
3638 nuv_demuxer_select="riffdec"
3639 obu_demuxer_select="av1_frame_merge_bsf av1_parser"
3640 obu_muxer_select="av1_metadata_bsf"
3641 oga_muxer_select="ogg_muxer"
3642 ogg_demuxer_select="dirac_parse"
3643 ogv_muxer_select="ogg_muxer"
3644 opus_muxer_select="ogg_muxer"
3645 psp_muxer_select="mov_muxer"
3646 rtp_demuxer_select="sdp_demuxer"
3647 rtp_mpegts_muxer_select="mpegts_muxer rtp_muxer"
3648 rtpdec_select="asf_demuxer mov_demuxer mpegts_demuxer rm_demuxer rtp_protocol srtp"
3649 rtsp_demuxer_select="http_protocol rtpdec"
3650 rtsp_muxer_select="rtp_muxer http_protocol rtp_protocol rtpenc_chain"
3651 sap_demuxer_select="sdp_demuxer"
3652 sap_muxer_select="rtp_muxer rtp_protocol rtpenc_chain"
3653 sdp_demuxer_select="rtpdec"
3654 smoothstreaming_muxer_select="ismv_muxer"
3655 spdif_demuxer_select="adts_header"
3656 spdif_muxer_select="adts_header"
3657 spx_muxer_select="ogg_muxer"
3658 swf_demuxer_suggest="zlib"
3659 tak_demuxer_select="tak_parser"
3660 truehd_demuxer_select="mlp_parser"
3661 tg2_muxer_select="mov_muxer"
3662 tgp_muxer_select="mov_muxer"
3663 vobsub_demuxer_select="mpegps_demuxer"
3664 w64_demuxer_select="wav_demuxer"
3665 w64_muxer_select="wav_muxer"
3666 wav_demuxer_select="riffdec"
3667 wav_muxer_select="riffenc"
3668 webm_chunk_muxer_select="webm_muxer"
3669 webm_dash_manifest_demuxer_select="matroska_demuxer"
3670 wtv_demuxer_select="mpegts_demuxer riffdec"
3671 wtv_muxer_select="mpegts_muxer riffenc"
3672 xmv_demuxer_select="riffdec"
3673 xwma_demuxer_select="riffdec"
3675 # indevs / outdevs
3676 android_camera_indev_deps="android camera2ndk mediandk pthreads"
3677 alsa_indev_deps="alsa"
3678 alsa_outdev_deps="alsa"
3679 avfoundation_indev_deps="avfoundation corevideo coremedia pthreads"
3680 avfoundation_indev_suggest="coregraphics applicationservices"
3681 avfoundation_indev_extralibs="-framework Foundation"
3682 audiotoolbox_outdev_deps="audiotoolbox pthreads"
3683 audiotoolbox_outdev_extralibs="-framework AudioToolbox -framework CoreAudio"
3684 bktr_indev_deps_any="dev_bktr_ioctl_bt848_h machine_ioctl_bt848_h dev_video_bktr_ioctl_bt848_h dev_ic_bt8xx_h"
3685 caca_outdev_deps="libcaca"
3686 decklink_deps_any="libdl LoadLibrary"
3687 decklink_indev_deps="decklink threads"
3688 decklink_indev_extralibs="-lstdc++"
3689 decklink_indev_suggest="libzvbi"
3690 decklink_outdev_deps="decklink threads"
3691 decklink_outdev_suggest="libklvanc"
3692 decklink_outdev_extralibs="-lstdc++"
3693 dshow_indev_deps="IBaseFilter"
3694 dshow_indev_extralibs="-lpsapi -lole32 -lstrmiids -luuid -loleaut32 -lshlwapi"
3695 fbdev_indev_deps="linux_fb_h"
3696 fbdev_outdev_deps="linux_fb_h"
3697 gdigrab_indev_deps="CreateDIBSection"
3698 gdigrab_indev_extralibs="-lgdi32"
3699 gdigrab_indev_select="bmp_decoder"
3700 iec61883_indev_deps="libiec61883"
3701 iec61883_indev_select="dv_demuxer"
3702 jack_indev_deps="libjack"
3703 jack_indev_deps_any="sem_timedwait dispatch_dispatch_h"
3704 kmsgrab_indev_deps="libdrm"
3705 lavfi_indev_deps="avfilter"
3706 libcdio_indev_deps="libcdio"
3707 libdc1394_indev_deps="libdc1394"
3708 openal_indev_deps="openal"
3709 opengl_outdev_deps="opengl"
3710 opengl_outdev_suggest="sdl2"
3711 oss_indev_deps_any="sys_soundcard_h"
3712 oss_outdev_deps_any="sys_soundcard_h"
3713 pulse_indev_deps="libpulse"
3714 pulse_outdev_deps="libpulse"
3715 sdl2_outdev_deps="sdl2"
3716 sndio_indev_deps="sndio"
3717 sndio_outdev_deps="sndio"
3718 v4l2_indev_deps_any="linux_videodev2_h sys_videoio_h"
3719 v4l2_indev_suggest="libv4l2"
3720 v4l2_outdev_deps_any="linux_videodev2_h sys_videoio_h"
3721 v4l2_outdev_suggest="libv4l2"
3722 vfwcap_indev_deps="vfw32 vfwcap_defines"
3723 xcbgrab_indev_deps="libxcb"
3724 xcbgrab_indev_suggest="libxcb_shm libxcb_shape libxcb_xfixes"
3725 xv_outdev_deps="xlib_xv xlib_x11 xlib_xext"
3727 # protocols
3728 android_content_protocol_deps="jni"
3729 android_content_protocol_select="file_protocol"
3730 async_protocol_deps="threads"
3731 bluray_protocol_deps="libbluray"
3732 ffrtmpcrypt_protocol_conflict="librtmp_protocol"
3733 ffrtmpcrypt_protocol_deps_any="gcrypt gmp openssl mbedtls"
3734 ffrtmpcrypt_protocol_select="tcp_protocol"
3735 ffrtmphttp_protocol_conflict="librtmp_protocol"
3736 ffrtmphttp_protocol_select="http_protocol"
3737 ftp_protocol_select="tcp_protocol"
3738 gopher_protocol_select="tcp_protocol"
3739 gophers_protocol_select="tls_protocol"
3740 http_protocol_select="tcp_protocol"
3741 http_protocol_suggest="zlib"
3742 httpproxy_protocol_select="tcp_protocol"
3743 httpproxy_protocol_suggest="zlib"
3744 https_protocol_select="tls_protocol"
3745 https_protocol_suggest="zlib"
3746 icecast_protocol_select="http_protocol"
3747 mmsh_protocol_select="http_protocol"
3748 mmst_protocol_select="network"
3749 rtmp_protocol_conflict="librtmp_protocol"
3750 rtmp_protocol_select="tcp_protocol"
3751 rtmp_protocol_suggest="zlib"
3752 rtmpe_protocol_select="ffrtmpcrypt_protocol"
3753 rtmpe_protocol_suggest="zlib"
3754 rtmps_protocol_conflict="librtmp_protocol"
3755 rtmps_protocol_select="tls_protocol"
3756 rtmps_protocol_suggest="zlib"
3757 rtmpt_protocol_select="ffrtmphttp_protocol"
3758 rtmpt_protocol_suggest="zlib"
3759 rtmpte_protocol_select="ffrtmpcrypt_protocol ffrtmphttp_protocol"
3760 rtmpte_protocol_suggest="zlib"
3761 rtmpts_protocol_select="ffrtmphttp_protocol https_protocol"
3762 rtmpts_protocol_suggest="zlib"
3763 rtp_protocol_select="udp_protocol"
3764 schannel_conflict="openssl gnutls libtls mbedtls"
3765 sctp_protocol_deps="struct_sctp_event_subscribe struct_msghdr_msg_flags"
3766 sctp_protocol_select="network"
3767 securetransport_conflict="openssl gnutls libtls mbedtls"
3768 srtp_protocol_select="rtp_protocol srtp"
3769 tcp_protocol_select="network"
3770 tls_protocol_deps_any="gnutls openssl schannel securetransport libtls mbedtls"
3771 tls_protocol_select="tcp_protocol"
3772 udp_protocol_select="network"
3773 udplite_protocol_select="network"
3774 unix_protocol_deps="sys_un_h"
3775 unix_protocol_select="network"
3776 ipfs_gateway_protocol_select="https_protocol"
3777 ipns_gateway_protocol_select="https_protocol"
3779 # external library protocols
3780 libamqp_protocol_deps="librabbitmq"
3781 libamqp_protocol_select="network"
3782 librist_protocol_deps="librist"
3783 librist_protocol_select="network"
3784 librtmp_protocol_deps="librtmp"
3785 librtmpe_protocol_deps="librtmp"
3786 librtmps_protocol_deps="librtmp"
3787 librtmpt_protocol_deps="librtmp"
3788 librtmpte_protocol_deps="librtmp"
3789 libsmbclient_protocol_deps="libsmbclient gplv3"
3790 libsrt_protocol_deps="libsrt"
3791 libsrt_protocol_select="network"
3792 libssh_protocol_deps="libssh"
3793 libtls_conflict="openssl gnutls mbedtls"
3794 libzmq_protocol_deps="libzmq"
3795 libzmq_protocol_select="network"
3797 # filters
3798 ametadata_filter_deps="avformat"
3799 amovie_filter_deps="avcodec avformat"
3800 aresample_filter_deps="swresample"
3801 asr_filter_deps="pocketsphinx"
3802 ass_filter_deps="libass"
3803 avgblur_opencl_filter_deps="opencl"
3804 avgblur_vulkan_filter_deps="vulkan spirv_compiler"
3805 azmq_filter_deps="libzmq"
3806 blackframe_filter_deps="gpl"
3807 blend_vulkan_filter_deps="vulkan spirv_compiler"
3808 boxblur_filter_deps="gpl"
3809 boxblur_opencl_filter_deps="opencl gpl"
3810 bs2b_filter_deps="libbs2b"
3811 bwdif_cuda_filter_deps="ffnvcodec"
3812 bwdif_cuda_filter_deps_any="cuda_nvcc cuda_llvm"
3813 bwdif_vulkan_filter_deps="vulkan spirv_compiler"
3814 chromaber_vulkan_filter_deps="vulkan spirv_compiler"
3815 color_vulkan_filter_deps="vulkan spirv_compiler"
3816 colorkey_opencl_filter_deps="opencl"
3817 colormatrix_filter_deps="gpl"
3818 convolution_opencl_filter_deps="opencl"
3819 coreimage_filter_deps="coreimage appkit"
3820 coreimage_filter_extralibs="-framework OpenGL"
3821 coreimagesrc_filter_deps="coreimage appkit"
3822 coreimagesrc_filter_extralibs="-framework OpenGL"
3823 cover_rect_filter_deps="avcodec avformat gpl"
3824 cropdetect_filter_deps="gpl"
3825 deinterlace_qsv_filter_deps="libmfx"
3826 deinterlace_qsv_filter_select="qsvvpp"
3827 deinterlace_vaapi_filter_deps="vaapi"
3828 delogo_filter_deps="gpl"
3829 denoise_vaapi_filter_deps="vaapi"
3830 derain_filter_select="dnn"
3831 deshake_filter_select="pixelutils"
3832 deshake_opencl_filter_deps="opencl"
3833 dilation_opencl_filter_deps="opencl"
3834 dnn_classify_filter_select="dnn"
3835 dnn_detect_filter_select="dnn"
3836 dnn_processing_filter_select="dnn"
3837 drawtext_filter_deps="libfreetype libharfbuzz"
3838 drawtext_filter_suggest="libfontconfig libfribidi"
3839 elbg_filter_deps="avcodec"
3840 eq_filter_deps="gpl"
3841 erosion_opencl_filter_deps="opencl"
3842 find_rect_filter_deps="avcodec avformat gpl"
3843 flip_vulkan_filter_deps="vulkan spirv_compiler"
3844 flite_filter_deps="libflite threads"
3845 framerate_filter_select="scene_sad"
3846 freezedetect_filter_select="scene_sad"
3847 frei0r_deps_any="libdl LoadLibrary"
3848 frei0r_filter_deps="frei0r"
3849 frei0r_src_filter_deps="frei0r"
3850 fspp_filter_deps="gpl"
3851 fsync_filter_deps="avformat"
3852 gblur_vulkan_filter_deps="vulkan spirv_compiler"
3853 hflip_vulkan_filter_deps="vulkan spirv_compiler"
3854 histeq_filter_deps="gpl"
3855 hqdn3d_filter_deps="gpl"
3856 iccdetect_filter_deps="lcms2"
3857 iccgen_filter_deps="lcms2"
3858 interlace_filter_deps="gpl"
3859 kerndeint_filter_deps="gpl"
3860 ladspa_filter_deps="ladspa libdl"
3861 lensfun_filter_deps="liblensfun version3"
3862 libplacebo_filter_deps="libplacebo vulkan"
3863 lv2_filter_deps="lv2"
3864 mcdeint_filter_deps="avcodec gpl"
3865 metadata_filter_deps="avformat"
3866 movie_filter_deps="avcodec avformat"
3867 mpdecimate_filter_deps="gpl"
3868 mpdecimate_filter_select="pixelutils"
3869 minterpolate_filter_select="scene_sad"
3870 mptestsrc_filter_deps="gpl"
3871 negate_filter_deps="lut_filter"
3872 nlmeans_opencl_filter_deps="opencl"
3873 nlmeans_vulkan_filter_deps="vulkan spirv_compiler"
3874 nnedi_filter_deps="gpl"
3875 ocr_filter_deps="libtesseract"
3876 ocv_filter_deps="libopencv"
3877 openclsrc_filter_deps="opencl"
3878 qrencode_filter_deps="libqrencode"
3879 qrencodesrc_filter_deps="libqrencode"
3880 quirc_filter_deps="libquirc"
3881 overlay_opencl_filter_deps="opencl"
3882 overlay_qsv_filter_deps="libmfx"
3883 overlay_qsv_filter_select="qsvvpp"
3884 overlay_vaapi_filter_deps="vaapi VAProcPipelineCaps_blend_flags"
3885 overlay_vulkan_filter_deps="vulkan spirv_compiler"
3886 owdenoise_filter_deps="gpl"
3887 pad_opencl_filter_deps="opencl"
3888 pan_filter_deps="swresample"
3889 perspective_filter_deps="gpl"
3890 phase_filter_deps="gpl"
3891 pp7_filter_deps="gpl"
3892 pp_filter_deps="gpl postproc"
3893 prewitt_opencl_filter_deps="opencl"
3894 procamp_vaapi_filter_deps="vaapi"
3895 program_opencl_filter_deps="opencl"
3896 pullup_filter_deps="gpl"
3897 remap_opencl_filter_deps="opencl"
3898 removelogo_filter_deps="avcodec avformat swscale"
3899 repeatfields_filter_deps="gpl"
3900 roberts_opencl_filter_deps="opencl"
3901 rubberband_filter_deps="librubberband"
3902 sab_filter_deps="gpl swscale"
3903 scale2ref_filter_deps="swscale"
3904 scale_filter_deps="swscale"
3905 scale_qsv_filter_deps="libmfx"
3906 scale_qsv_filter_select="qsvvpp"
3907 scdet_filter_select="scene_sad"
3908 select_filter_select="scene_sad"
3909 sharpness_vaapi_filter_deps="vaapi"
3910 showcqt_filter_deps="avformat swscale"
3911 showcqt_filter_suggest="libfontconfig libfreetype"
3912 signature_filter_deps="gpl avcodec avformat"
3913 smartblur_filter_deps="gpl swscale"
3914 sobel_opencl_filter_deps="opencl"
3915 sofalizer_filter_deps="libmysofa"
3916 spp_filter_deps="gpl avcodec"
3917 spp_filter_select="idctdsp fdctdsp me_cmp pixblockdsp"
3918 sr_filter_deps="avformat swscale"
3919 sr_filter_select="dnn"
3920 stereo3d_filter_deps="gpl"
3921 subtitles_filter_deps="avformat avcodec libass"
3922 super2xsai_filter_deps="gpl"
3923 pixfmts_super2xsai_test_deps="super2xsai_filter"
3924 tinterlace_filter_deps="gpl"
3925 tinterlace_merge_test_deps="tinterlace_filter"
3926 tinterlace_pad_test_deps="tinterlace_filter"
3927 tonemap_filter_deps="const_nan"
3928 tonemap_vaapi_filter_deps="vaapi VAProcFilterParameterBufferHDRToneMapping"
3929 tonemap_opencl_filter_deps="opencl const_nan"
3930 transpose_opencl_filter_deps="opencl"
3931 transpose_vaapi_filter_deps="vaapi VAProcPipelineCaps_rotation_flags"
3932 transpose_vt_filter_deps="videotoolbox VTPixelRotationSessionCreate"
3933 transpose_vulkan_filter_deps="vulkan spirv_compiler"
3934 unsharp_opencl_filter_deps="opencl"
3935 uspp_filter_deps="gpl avcodec"
3936 vaguedenoiser_filter_deps="gpl"
3937 vflip_vulkan_filter_deps="vulkan spirv_compiler"
3938 vidstabdetect_filter_deps="libvidstab"
3939 vidstabtransform_filter_deps="libvidstab"
3940 libvmaf_filter_deps="libvmaf"
3941 libvmaf_cuda_filter_deps="libvmaf libvmaf_cuda ffnvcodec"
3942 zmq_filter_deps="libzmq"
3943 zoompan_filter_deps="swscale"
3944 zscale_filter_deps="libzimg const_nan"
3945 scale_vaapi_filter_deps="vaapi"
3946 scale_vt_filter_deps="videotoolbox VTPixelTransferSessionCreate"
3947 scale_vulkan_filter_deps="vulkan spirv_compiler"
3948 vpp_qsv_filter_deps="libmfx"
3949 vpp_qsv_filter_select="qsvvpp"
3950 xfade_opencl_filter_deps="opencl"
3951 xfade_vulkan_filter_deps="vulkan spirv_compiler"
3952 yadif_cuda_filter_deps="ffnvcodec"
3953 yadif_cuda_filter_deps_any="cuda_nvcc cuda_llvm"
3954 yadif_videotoolbox_filter_deps="metal corevideo videotoolbox"
3955 hstack_vaapi_filter_deps="vaapi_1"
3956 vstack_vaapi_filter_deps="vaapi_1"
3957 xstack_vaapi_filter_deps="vaapi_1"
3958 hstack_qsv_filter_deps="libmfx"
3959 hstack_qsv_filter_select="qsvvpp"
3960 vstack_qsv_filter_deps="libmfx"
3961 vstack_qsv_filter_select="qsvvpp"
3962 xstack_qsv_filter_deps="libmfx"
3963 xstack_qsv_filter_select="qsvvpp"
3964 pad_vaapi_filter_deps="vaapi_1"
3965 drawbox_vaapi_filter_deps="vaapi_1"
3967 # examples
3968 avio_http_serve_files_deps="avformat avutil fork"
3969 avio_list_dir_deps="avformat avutil"
3970 avio_read_callback_deps="avformat avcodec avutil"
3971 decode_audio_example_deps="avcodec avutil"
3972 decode_filter_audio_example_deps="avfilter avcodec avformat avutil"
3973 decode_filter_video_example_deps="avfilter avcodec avformat avutil"
3974 decode_video_example_deps="avcodec avutil"
3975 demux_decode_example_deps="avcodec avformat avutil"
3976 encode_audio_example_deps="avcodec avutil"
3977 encode_video_example_deps="avcodec avutil"
3978 extract_mvs_example_deps="avcodec avformat avutil"
3979 filter_audio_example_deps="avfilter avutil"
3980 hw_decode_example_deps="avcodec avformat avutil"
3981 mux_example_deps="avcodec avformat avutil swscale"
3982 qsv_decode_example_deps="avcodec avutil libmfx h264_qsv_decoder"
3983 remux_example_deps="avcodec avformat avutil"
3984 resample_audio_example_deps="avutil swresample"
3985 scale_video_example_deps="avutil swscale"
3986 show_metadata_example_deps="avformat avutil"
3987 transcode_aac_example_deps="avcodec avformat swresample"
3988 transcode_example_deps="avfilter avcodec avformat avutil"
3989 vaapi_encode_example_deps="avcodec avutil h264_vaapi_encoder"
3990 vaapi_transcode_example_deps="avcodec avformat avutil h264_vaapi_encoder"
3991 qsv_transcode_example_deps="avcodec avformat avutil h264_qsv_encoder"
3993 # EXTRALIBS_LIST
3994 cpu_init_extralibs="pthreads_extralibs"
3995 cws2fws_extralibs="zlib_extralibs"
3997 # libraries, in any order
3998 avcodec_deps="avutil"
3999 avcodec_suggest="libm stdatomic"
4000 avdevice_deps="avformat avcodec avutil"
4001 avdevice_suggest="libm stdatomic"
4002 avfilter_deps="avutil"
4003 avfilter_suggest="libm stdatomic"
4004 avformat_deps="avcodec avutil"
4005 avformat_suggest="libm network zlib stdatomic"
4006 avutil_suggest="clock_gettime ffnvcodec gcrypt libm libdrm libmfx opencl openssl user32 vaapi vulkan videotoolbox corefoundation corevideo coremedia bcrypt stdatomic"
4007 postproc_deps="avutil gpl"
4008 postproc_suggest="libm stdatomic"
4009 swresample_deps="avutil"
4010 swresample_suggest="libm libsoxr stdatomic"
4011 swscale_deps="avutil"
4012 swscale_suggest="libm stdatomic"
4014 avcodec_extralibs="pthreads_extralibs iconv_extralibs dxva2_extralibs lcms2_extralibs"
4015 avfilter_extralibs="pthreads_extralibs"
4016 avutil_extralibs="d3d11va_extralibs d3d12va_extralibs mediacodec_extralibs nanosleep_extralibs pthreads_extralibs vaapi_drm_extralibs vaapi_x11_extralibs vaapi_win32_extralibs vdpau_x11_extralibs"
4018 # programs
4019 ffmpeg_deps="avcodec avfilter avformat threads"
4020 ffmpeg_select="aformat_filter anull_filter atrim_filter format_filter
4021 hflip_filter null_filter
4022 transpose_filter trim_filter vflip_filter"
4023 ffmpeg_suggest="ole32 psapi shell32"
4024 ffplay_deps="avcodec avformat avfilter swscale swresample sdl2"
4025 ffplay_select="crop_filter transpose_filter hflip_filter vflip_filter rotate_filter"
4026 ffplay_suggest="shell32 libplacebo vulkan"
4027 ffprobe_deps="avcodec avformat"
4028 ffprobe_suggest="shell32"
4030 # documentation
4031 podpages_deps="perl"
4032 manpages_deps="perl pod2man"
4033 htmlpages_deps="perl"
4034 htmlpages_deps_any="makeinfo_html texi2html"
4035 txtpages_deps="perl makeinfo"
4036 doc_deps_any="manpages htmlpages podpages txtpages"
4038 # default parameters
4040 logfile="ffbuild/config.log"
4042 # installation paths
4043 prefix_default="/usr/local"
4044 bindir_default='${prefix}/bin'
4045 datadir_default='${prefix}/share/ffmpeg'
4046 docdir_default='${prefix}/share/doc/ffmpeg'
4047 incdir_default='${prefix}/include'
4048 libdir_default='${prefix}/lib'
4049 mandir_default='${prefix}/share/man'
4051 # toolchain
4052 ar_default="ar"
4053 cc_default="gcc"
4054 stdc_default="c17"
4055 stdcxx_default="c++11"
4056 cxx_default="g++"
4057 host_cc_default="gcc"
4058 doxygen_default="doxygen"
4059 install="install"
4060 ln_s_default="ln -s -f"
4061 metalcc_default="xcrun -sdk macosx metal"
4062 metallib_default="xcrun -sdk macosx metallib"
4063 nm_default="nm -g"
4064 pkg_config_default=pkg-config
4065 ranlib_default="ranlib"
4066 strip_default="strip"
4067 version_script='--version-script'
4068 objformat="elf32"
4069 x86asmexe_default="nasm"
4070 windres_default="windres"
4071 striptype="direct"
4073 # OS
4074 target_os_default=$(tolower $(uname -s))
4075 host_os=$target_os_default
4077 # machine
4078 if test "$target_os_default" = aix; then
4079 arch_default=$(uname -p)
4080 strip_default="strip -X32_64"
4081 nm_default="nm -g -X32_64"
4082 else
4083 arch_default=$(uname -m)
4085 cpu="generic"
4086 intrinsics="none"
4088 # configurable options
4089 enable $PROGRAM_LIST
4090 enable $DOCUMENT_LIST
4091 enable $EXAMPLE_LIST
4092 enable $LIBRARY_LIST
4093 enable stripping
4094 enable version_tracking
4096 enable asm
4097 enable debug
4098 enable doc
4099 enable faan faandct faanidct
4100 enable iamf
4101 enable large_tests
4102 enable optimizations
4103 enable ptx_compression
4104 enable runtime_cpudetect
4105 enable safe_bitstream_reader
4106 enable static
4107 enable swscale_alpha
4108 enable valgrind_backtrace
4110 sws_max_filter_size_default=256
4111 set_default sws_max_filter_size
4113 # internal components are enabled by default
4114 enable $EXTRALIBS_LIST
4116 # Avoid external, non-system, libraries getting enabled by dependency resolution
4117 disable $EXTERNAL_LIBRARY_LIST $HWACCEL_LIBRARY_LIST
4119 # build settings
4120 SHFLAGS='-shared -Wl,-soname,$$(@F)'
4121 LIBPREF="lib"
4122 LIBSUF=".a"
4123 FULLNAME='$(NAME)$(BUILDSUF)'
4124 LIBNAME='$(LIBPREF)$(FULLNAME)$(LIBSUF)'
4125 SLIBPREF="lib"
4126 SLIBSUF=".so"
4127 SLIBNAME='$(SLIBPREF)$(FULLNAME)$(SLIBSUF)'
4128 SLIBNAME_WITH_VERSION='$(SLIBNAME).$(LIBVERSION)'
4129 SLIBNAME_WITH_MAJOR='$(SLIBNAME).$(LIBMAJOR)'
4130 LIB_INSTALL_EXTRA_CMD='$$(RANLIB) "$(LIBDIR)/$(LIBNAME)"'
4131 SLIB_INSTALL_NAME='$(SLIBNAME_WITH_VERSION)'
4132 SLIB_INSTALL_LINKS='$(SLIBNAME_WITH_MAJOR) $(SLIBNAME)'
4133 VERSION_SCRIPT_POSTPROCESS_CMD="cat"
4135 asflags_filter=echo
4136 cflags_filter=echo
4137 ldflags_filter=echo
4139 AS_C='-c'
4140 AS_O='-o $@'
4141 CC_C='-c'
4142 CC_E='-E -o $@'
4143 CC_O='-o $@'
4144 CXX_C='-c'
4145 CXX_O='-o $@'
4146 OBJCC_C='-c'
4147 OBJCC_E='-E -o $@'
4148 OBJCC_O='-o $@'
4149 X86ASM_O='-o $@'
4150 LD_O='-o $@'
4151 LD_LIB='-l%'
4152 LD_PATH='-L'
4153 HOSTCC_C='-c'
4154 HOSTCC_E='-E -o $@'
4155 HOSTCC_O='-o $@'
4156 HOSTLD_O='-o $@'
4157 NVCC_C='-c'
4158 NVCC_O='-o $@'
4160 host_extralibs='-lm'
4161 host_cflags_filter=echo
4162 host_ldflags_filter=echo
4164 target_path='$(CURDIR)'
4166 # since the object filename is not given with the -MM flag, the compiler
4167 # is only able to print the basename, and we must add the path ourselves
4168 DEPCMD='$(DEP$(1)) $(DEP$(1)FLAGS) $($(1)DEP_FLAGS) $< 2>/dev/null | sed -e "/^\#.*/d" -e "s,^[[:space:]]*$(@F),$(@D)/$(@F)," > $(@:.o=.d)'
4169 DEPFLAGS='-MM'
4171 mkdir -p ffbuild
4173 # find source path
4174 if test -f configure; then
4175 source_path=.
4176 elif test -f src/configure; then
4177 source_path=src
4178 else
4179 source_path=$(cd $(dirname "$0"); pwd)
4180 case "$source_path" in
4181 *[[:blank:]]*) die "Out of tree builds are impossible with whitespace in source path." ;;
4182 esac
4183 test -e "$source_path/config.h" &&
4184 die "Out of tree builds are impossible with config.h in source dir."
4187 for v in "$@"; do
4188 r=${v#*=}
4189 l=${v%"$r"}
4190 r=$(sh_quote "$r")
4191 FFMPEG_CONFIGURATION="${FFMPEG_CONFIGURATION# } ${l}${r}"
4192 done
4194 find_things_extern(){
4195 thing=$1
4196 pattern=$2
4197 file=$source_path/$3
4198 out=${4:-$thing}
4199 sed -n "s/^[^#]*extern.*$pattern *ff_\([^ ]*\)_$thing;/\1_$out/p" "$file"
4202 find_filters_extern(){
4203 file=$source_path/$1
4204 sed -n 's/^extern const AVFilter ff_[avfsinkrc]\{2,5\}_\([[:alnum:]_]\{1,\}\);/\1_filter/p' $file
4207 FILTER_LIST=$(find_filters_extern libavfilter/allfilters.c)
4208 OUTDEV_LIST=$(find_things_extern muxer FFOutputFormat libavdevice/alldevices.c outdev)
4209 INDEV_LIST=$(find_things_extern demuxer FFInputFormat libavdevice/alldevices.c indev)
4210 MUXER_LIST=$(find_things_extern muxer FFOutputFormat libavformat/allformats.c)
4211 DEMUXER_LIST=$(find_things_extern demuxer FFInputFormat libavformat/allformats.c)
4212 ENCODER_LIST=$(find_things_extern encoder FFCodec libavcodec/allcodecs.c)
4213 DECODER_LIST=$(find_things_extern decoder FFCodec libavcodec/allcodecs.c)
4214 CODEC_LIST="
4215 $ENCODER_LIST
4216 $DECODER_LIST
4218 PARSER_LIST=$(find_things_extern parser AVCodecParser libavcodec/parsers.c)
4219 BSF_LIST=$(find_things_extern bsf FFBitStreamFilter libavcodec/bitstream_filters.c)
4220 HWACCEL_LIST=$(find_things_extern hwaccel FFHWAccel libavcodec/hwaccels.h)
4221 PROTOCOL_LIST=$(find_things_extern protocol URLProtocol libavformat/protocols.c)
4223 AVCODEC_COMPONENTS_LIST="
4224 $BSF_LIST
4225 $DECODER_LIST
4226 $ENCODER_LIST
4227 $HWACCEL_LIST
4228 $PARSER_LIST
4231 AVDEVICE_COMPONENTS_LIST="
4232 $INDEV_LIST
4233 $OUTDEV_LIST
4236 AVFILTER_COMPONENTS_LIST="
4237 $FILTER_LIST
4240 AVFORMAT_COMPONENTS_LIST="
4241 $DEMUXER_LIST
4242 $MUXER_LIST
4243 $PROTOCOL_LIST
4246 ALL_COMPONENTS="
4247 $AVCODEC_COMPONENTS_LIST
4248 $AVDEVICE_COMPONENTS_LIST
4249 $AVFILTER_COMPONENTS_LIST
4250 $AVFORMAT_COMPONENTS_LIST
4253 for n in $COMPONENT_LIST; do
4254 v=$(toupper ${n%s})_LIST
4255 eval enable \$$v
4256 eval ${n}_if_any="\$$v"
4257 done
4259 enable $ARCH_EXT_LIST
4261 die_unknown(){
4262 echo "Unknown option \"$1\"."
4263 echo "See $0 --help for available options."
4264 exit 1
4267 print_in_columns() {
4268 tr ' ' '\n' | sort | tr '\r\n' ' ' | awk -v col_width=24 -v width="$ncols" '
4270 num_cols = width > col_width ? int(width / col_width) : 1;
4271 num_rows = int((NF + num_cols-1) / num_cols);
4272 y = x = 1;
4273 for (y = 1; y <= num_rows; y++) {
4274 i = y;
4275 for (x = 1; x <= num_cols; x++) {
4276 if (i <= NF) {
4277 line = sprintf("%s%-" col_width "s", line, $i);
4279 i = i + num_rows;
4281 print line; line = "";
4283 }' | sed 's/ *$//'
4286 show_list() {
4287 suffix=_$1
4288 shift
4289 echo $* | sed s/$suffix//g | print_in_columns
4290 exit 0
4293 rand_list(){
4294 IFS=', '
4295 set -- $*
4296 unset IFS
4297 for thing; do
4298 comp=${thing%:*}
4299 prob=${thing#$comp}
4300 prob=${prob#:}
4301 is_in ${comp} $COMPONENT_LIST && eval comp=\$$(toupper ${comp%s})_LIST
4302 echo "prob ${prob:-0.5}"
4303 printf '%s\n' $comp
4304 done
4307 do_random(){
4308 action=$1
4309 shift
4310 random_seed=$(awk "BEGIN { srand($random_seed); print srand() }")
4311 $action $(rand_list "$@" | awk "BEGIN { srand($random_seed) } \$1 == \"prob\" { prob = \$2; next } rand() < prob { print }")
4314 for opt do
4315 optval="${opt#*=}"
4316 case "$opt" in
4317 --extra-ldflags=*)
4318 add_ldflags $optval
4320 --extra-ldexeflags=*)
4321 add_ldexeflags $optval
4323 --extra-ldsoflags=*)
4324 add_ldsoflags $optval
4326 --extra-ldlibflags=*)
4327 warn "The --extra-ldlibflags option is only provided for compatibility and will be\n"\
4328 "removed in the future. Use --extra-ldsoflags instead."
4329 add_ldsoflags $optval
4331 --extra-libs=*)
4332 add_extralibs $optval
4334 --disable-devices)
4335 disable $INDEV_LIST $OUTDEV_LIST
4337 --enable-debug=*)
4338 debuglevel="$optval"
4340 --disable-programs)
4341 disable $PROGRAM_LIST
4343 --disable-everything)
4344 map 'eval unset \${$(toupper ${v%s})_LIST}' $COMPONENT_LIST
4346 --disable-all)
4347 map 'eval unset \${$(toupper ${v%s})_LIST}' $COMPONENT_LIST
4348 disable $LIBRARY_LIST $PROGRAM_LIST doc
4349 enable avutil
4351 --enable-random|--disable-random)
4352 action=${opt%%-random}
4353 do_random ${action#--} $COMPONENT_LIST
4355 --enable-random=*|--disable-random=*)
4356 action=${opt%%-random=*}
4357 do_random ${action#--} $optval
4359 --enable-sdl)
4360 enable sdl2
4362 --enable-lto*)
4363 lto=-f${opt#--enable-}
4365 --enable-*=*|--disable-*=*)
4366 eval $(echo "${opt%%=*}" | sed 's/--/action=/;s/-/ thing=/')
4367 is_in "${thing}s" $COMPONENT_LIST || die_unknown "$opt"
4368 eval list=\$$(toupper $thing)_LIST
4369 name=$(echo "${optval}" | sed "s/,/_${thing}|/g")_${thing}
4370 list=$(filter "$name" $list)
4371 [ "$list" = "" ] && warn "Option $opt did not match anything"
4372 test $action = enable && warn_if_gets_disabled $list
4373 $action $list
4375 --enable-yasm|--disable-yasm)
4376 warn "The ${opt} option is only provided for compatibility and will be\n"\
4377 "removed in the future. Use --enable-x86asm / --disable-x86asm instead."
4378 test $opt = --enable-yasm && x86asm=yes || x86asm=no
4380 --yasmexe=*)
4381 warn "The --yasmexe option is only provided for compatibility and will be\n"\
4382 "removed in the future. Use --x86asmexe instead."
4383 x86asmexe="$optval"
4385 --enable-?*|--disable-?*)
4386 eval $(echo "$opt" | sed 's/--/action=/;s/-/ option=/;s/-/_/g')
4387 if is_in $option $COMPONENT_LIST; then
4388 test $action = disable && action=unset
4389 eval $action \$$(toupper ${option%s})_LIST
4390 elif is_in $option $CMDLINE_SELECT; then
4391 $action $option
4392 else
4393 die_unknown $opt
4396 --list-*)
4397 NAME="${opt#--list-}"
4398 is_in $NAME $COMPONENT_LIST || die_unknown $opt
4399 NAME=${NAME%s}
4400 eval show_list $NAME \$$(toupper $NAME)_LIST
4402 --help|-h) show_help
4404 --quiet|-q) quiet=yes
4406 --fatal-warnings) enable fatal_warnings
4408 --libfuzzer=*)
4409 libfuzzer_path="$optval"
4412 optname="${opt%%=*}"
4413 optname="${optname#--}"
4414 optname=$(echo "$optname" | sed 's/-/_/g')
4415 if is_in $optname $CMDLINE_SET; then
4416 eval $optname='$optval'
4417 elif is_in $optname $CMDLINE_APPEND; then
4418 append $optname "$optval"
4419 else
4420 die_unknown $opt
4423 esac
4424 done
4426 for e in $env; do
4427 eval "export $e"
4428 done
4430 if disabled autodetect; then
4432 # Unless iconv is explicitely disabled by the user, we still want to probe
4433 # for the iconv from the libc.
4434 disabled iconv || enable libc_iconv
4436 disable_weak $EXTERNAL_AUTODETECT_LIBRARY_LIST
4437 disable_weak $HWACCEL_AUTODETECT_LIBRARY_LIST
4439 # Mark specifically enabled, but normally autodetected libraries as requested.
4440 for lib in $AUTODETECT_LIBS; do
4441 enabled $lib && request $lib
4442 done
4443 #TODO: switch to $AUTODETECT_LIBS when $THREADS_LIST is supported the same way
4444 enable_weak $EXTERNAL_AUTODETECT_LIBRARY_LIST
4445 enable_weak $HWACCEL_AUTODETECT_LIBRARY_LIST
4447 disabled logging && logfile=/dev/null
4449 # command line configuration sanity checks
4451 # we need to build at least one lib type
4452 if ! enabled_any static shared; then
4453 cat <<EOF
4454 At least one library type must be built.
4455 Specify --enable-static to build the static libraries or --enable-shared to
4456 build the shared libraries as well. To only build the shared libraries specify
4457 --disable-static in addition to --enable-shared.
4459 exit 1
4462 die_license_disabled() {
4463 enabled $1 || { enabled $v && die "$v is $1 and --enable-$1 is not specified."; }
4466 die_license_disabled_gpl() {
4467 enabled $1 || { enabled $v && die "$v is incompatible with the gpl and --enable-$1 is not specified."; }
4470 map "die_license_disabled gpl" $EXTERNAL_LIBRARY_GPL_LIST $EXTERNAL_LIBRARY_GPLV3_LIST
4471 map "die_license_disabled version3" $EXTERNAL_LIBRARY_VERSION3_LIST $EXTERNAL_LIBRARY_GPLV3_LIST
4473 enabled gpl && map "die_license_disabled_gpl nonfree" $EXTERNAL_LIBRARY_NONFREE_LIST
4474 map "die_license_disabled nonfree" $HWACCEL_LIBRARY_NONFREE_LIST
4476 enabled version3 && { enabled gpl && enable gplv3 || enable lgplv3; }
4478 if enabled nonfree; then
4479 license="nonfree and unredistributable"
4480 elif enabled gplv3; then
4481 license="GPL version 3 or later"
4482 elif enabled lgplv3; then
4483 license="LGPL version 3 or later"
4484 elif enabled gpl; then
4485 license="GPL version 2 or later"
4486 else
4487 license="LGPL version 2.1 or later"
4490 enabled_all gnutls openssl &&
4491 die "GnuTLS and OpenSSL must not be enabled at the same time."
4493 enabled_all gnutls mbedtls &&
4494 die "GnuTLS and mbedTLS must not be enabled at the same time."
4496 enabled_all openssl mbedtls &&
4497 die "OpenSSL and mbedTLS must not be enabled at the same time."
4499 # Disable all the library-specific components if the library itself
4500 # is disabled, see AVCODEC_LIST and following _LIST variables.
4502 disable_components(){
4503 disabled ${1} && disable $(
4504 eval components="\$$(toupper ${1})_COMPONENTS"
4505 map 'eval echo \${$(toupper ${v%s})_LIST}' $components
4509 map 'disable_components $v' $LIBRARY_LIST
4511 echo "# $0 $FFMPEG_CONFIGURATION" > $logfile
4512 set >> $logfile
4514 test -n "$valgrind" && toolchain="valgrind-memcheck"
4516 enabled ossfuzz && ! echo $CFLAGS | grep -q -- "-fsanitize=" && ! echo $CFLAGS | grep -q -- "-fcoverage-mapping" &&{
4517 add_cflags -fsanitize=address,undefined -fsanitize-coverage=trace-pc-guard,trace-cmp -fno-omit-frame-pointer
4518 add_ldflags -fsanitize=address,undefined -fsanitize-coverage=trace-pc-guard,trace-cmp
4521 case "$toolchain" in
4522 *-asan)
4523 cc_default="${toolchain%-asan}"
4524 add_cflags -fsanitize=address
4525 add_ldflags -fsanitize=address
4527 *-lsan)
4528 cc_default="${toolchain%-lsan}"
4529 add_cflags -fsanitize=leak
4530 add_ldflags -fsanitize=leak
4532 *-msan)
4533 cc_default="${toolchain%-msan}"
4534 add_cflags -fsanitize=memory -fsanitize-memory-track-origins
4535 add_ldflags -fsanitize=memory
4537 *-tsan)
4538 cc_default="${toolchain%-tsan}"
4539 add_cflags -fsanitize=thread
4540 add_ldflags -fsanitize=thread
4541 case "$toolchain" in
4542 gcc-tsan)
4543 add_cflags -fPIC
4544 add_ldflags -fPIC
4546 esac
4548 *-usan)
4549 cc_default="${toolchain%-usan}"
4550 add_cflags -fsanitize=undefined
4551 add_ldflags -fsanitize=undefined
4553 valgrind-*)
4554 target_exec_default="valgrind"
4555 case "$toolchain" in
4556 valgrind-massif)
4557 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"
4559 valgrind-memcheck)
4560 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"
4562 esac
4564 msvc)
4565 cl_major_ver=$(cl.exe 2>&1 | sed -n 's/.*Version \([[:digit:]]\{1,\}\)\..*/\1/p')
4566 if [ -z "$cl_major_ver" ] || [ $cl_major_ver -ge 18 ]; then
4567 cc_default="cl.exe"
4568 cxx_default="cl.exe"
4569 else
4570 die "Unsupported MSVC version (2013 or newer required)"
4572 ld_default="$source_path/compat/windows/mslink"
4573 windres_default="$source_path/compat/windows/mswindres"
4574 nm_default="dumpbin.exe -symbols"
4575 ar_default="lib.exe"
4576 case "${arch:-$arch_default}" in
4577 aarch64|arm64)
4578 as_default="armasm64.exe"
4580 arm*)
4581 as_default="armasm.exe"
4583 esac
4584 target_os_default="win32"
4585 # Use a relative path for TMPDIR. This makes sure all the
4586 # ffconf temp files are written with a relative path, avoiding
4587 # issues with msys/win32 path conversion for MSVC parameters
4588 # such as -Fo<file> or -out:<file>.
4589 TMPDIR=.
4591 icl)
4592 cc_default="icl"
4593 ld_default="xilink"
4594 nm_default="dumpbin -symbols"
4595 ar_default="xilib"
4596 target_os_default="win32"
4597 TMPDIR=.
4599 gcov)
4600 add_cflags -fprofile-arcs -ftest-coverage
4601 add_ldflags -fprofile-arcs -ftest-coverage
4603 llvm-cov)
4604 add_cflags -fprofile-arcs -ftest-coverage
4605 add_ldflags --coverage
4607 hardened)
4608 add_cppflags -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2
4609 add_cflags -fno-strict-overflow -fstack-protector-all
4610 add_ldflags -Wl,-z,relro -Wl,-z,now
4611 add_cflags -fPIE
4612 add_ldexeflags -fPIE -pie
4615 die "Unknown toolchain $toolchain"
4617 esac
4619 if test -n "$cross_prefix"; then
4620 test -n "$arch" && test -n "$target_os" ||
4621 die "Must specify target arch (--arch) and OS (--target-os) when cross-compiling"
4622 enable cross_compile
4625 set_default target_os
4626 if test "$target_os" = android; then
4627 cc_default="clang"
4630 ar_default="${cross_prefix}${ar_default}"
4631 cc_default="${cross_prefix}${cc_default}"
4632 cxx_default="${cross_prefix}${cxx_default}"
4633 nm_default="${cross_prefix}${nm_default}"
4634 pkg_config_default="${cross_prefix}${pkg_config_default}"
4635 ranlib_default="${cross_prefix}${ranlib_default}"
4636 strip_default="${cross_prefix}${strip_default}"
4637 windres_default="${cross_prefix}${windres_default}"
4639 sysinclude_default="${sysroot}/usr/include"
4641 if enabled cuda_sdk; then
4642 warn "Option --enable-cuda-sdk is deprecated. Use --enable-cuda-nvcc instead."
4643 enable cuda_nvcc
4646 if enabled cuda_nvcc; then
4647 nvcc_default="nvcc"
4648 nvccflags_default="-gencode arch=compute_30,code=sm_30 -O2"
4649 else
4650 nvcc_default="clang"
4651 nvccflags_default="--cuda-gpu-arch=sm_30 -O2"
4652 NVCC_C=""
4655 set_default nvcc
4657 if enabled cuda_nvcc; then
4658 if $nvcc $nvccflags_default 2>&1 | grep -qi unsupported; then
4659 nvccflags_default="-gencode arch=compute_60,code=sm_60 -O2"
4663 set_default arch cc cxx doxygen pkg_config ranlib strip sysinclude \
4664 target_exec x86asmexe metalcc metallib stdc stdcxx
4665 enabled cross_compile || host_cc_default=$cc
4666 set_default host_cc
4668 if ${ranlib} 2>&1 | grep -q "\-D "; then
4669 ranlib="${ranlib} -D"
4672 pkg_config_fail_message=""
4673 if ! $pkg_config --version >/dev/null 2>&1; then
4674 warn "$pkg_config not found, library detection may fail."
4675 pkg_config=false
4676 elif is_in -static $cc $LDFLAGS && ! is_in --static $pkg_config $pkg_config_flags; then
4677 pkg_config_fail_message="
4678 Note: When building a static binary, add --pkg-config-flags=\"--static\"."
4681 if test $doxygen != $doxygen_default && \
4682 ! $doxygen --version >/dev/null 2>&1; then
4683 warn "Specified doxygen \"$doxygen\" not found, API documentation will fail to build."
4686 exesuf() {
4687 case $1 in
4688 mingw32*|mingw64*|msys*|win32|win64|cygwin*|*-dos|freedos|opendos|os/2*|symbian) echo .exe ;;
4689 esac
4692 EXESUF=$(exesuf $target_os)
4693 HOSTEXESUF=$(exesuf $host_os)
4695 # set temporary file name
4696 : ${TMPDIR:=$TEMPDIR}
4697 : ${TMPDIR:=$TMP}
4698 : ${TMPDIR:=/tmp}
4700 if [ -n "$tempprefix" ] ; then
4701 mktemp(){
4702 tmpname="$tempprefix.${HOSTNAME}.${UID}"
4703 echo "$tmpname"
4704 mkdir "$tmpname"
4706 elif ! test_cmd mktemp -u XXXXXX; then
4707 # simple replacement for missing mktemp
4708 # NOT SAFE FOR GENERAL USE
4709 mktemp(){
4710 tmpname="${2%%XXX*}.${HOSTNAME}.${UID}.$$"
4711 echo "$tmpname"
4712 mkdir "$tmpname"
4716 FFTMPDIR=$(mktemp -d "${TMPDIR}/ffconf.XXXXXXXX" 2> /dev/null) ||
4717 die "Unable to create temporary directory in $TMPDIR."
4719 tmpfile(){
4720 tmp="${FFTMPDIR}/test"$2
4721 (set -C; exec > $tmp) 2> /dev/null ||
4722 die "Unable to create temporary file in $FFTMPDIR."
4723 eval $1=$tmp
4726 trap 'rm -rf -- "$FFTMPDIR"' EXIT
4727 trap 'exit 2' INT
4729 tmpfile TMPASM .asm
4730 tmpfile TMPC .c
4731 tmpfile TMPCPP .cpp
4732 tmpfile TMPE $EXESUF
4733 tmpfile TMPH .h
4734 tmpfile TMPM .m
4735 tmpfile TMPCU .cu
4736 tmpfile TMPO .o
4737 tmpfile TMPS .S
4738 tmpfile TMPSH .sh
4739 tmpfile TMPV .ver
4741 unset -f mktemp
4743 chmod +x $TMPE
4745 # make sure we can execute files in $TMPDIR
4746 cat > $TMPSH 2>> $logfile <<EOF
4747 #!/bin/sh
4749 chmod +x $TMPSH >> $logfile 2>&1
4750 if ! $TMPSH >> $logfile 2>&1; then
4751 cat <<EOF
4752 Unable to create and execute files in $TMPDIR. Set the TMPDIR environment
4753 variable to another directory and make sure that it is not mounted noexec.
4755 die "Sanity test failed."
4758 armasm_flags(){
4759 for flag; do
4760 case $flag in
4761 # Filter out MSVC cl.exe options from cflags that shouldn't
4762 # be passed to gas-preprocessor
4763 -M[TD]*) ;;
4764 *) echo $flag ;;
4765 esac
4766 done
4769 cparser_flags(){
4770 for flag; do
4771 case $flag in
4772 -Wno-switch) echo -Wno-switch-enum ;;
4773 -Wno-format-zero-length) ;;
4774 -Wdisabled-optimization) ;;
4775 -Wno-pointer-sign) echo -Wno-other ;;
4776 *) echo $flag ;;
4777 esac
4778 done
4781 msvc_common_flags(){
4782 for flag; do
4783 case $flag in
4784 # In addition to specifying certain flags under the compiler
4785 # specific filters, they must be specified here as well or else the
4786 # generic catch all at the bottom will print the original flag.
4787 -Wall) ;;
4788 -Wextra) ;;
4789 -std=c*) echo /std:${flag#-std=};;
4790 # Common flags
4791 -fomit-frame-pointer) ;;
4792 -g) echo -Z7 ;;
4793 -fno-math-errno) ;;
4794 -fno-common) ;;
4795 -fno-signed-zeros) ;;
4796 -fPIC) ;;
4797 -mthumb) ;;
4798 -march=*) ;;
4799 -mfp16-format=*) ;;
4800 -lz) echo zlib.lib ;;
4801 -lx264) echo libx264.lib ;;
4802 -lstdc++) ;;
4803 -l*) echo ${flag#-l}.lib ;;
4804 -LARGEADDRESSAWARE) echo $flag ;;
4805 -L*) echo -libpath:${flag#-L} ;;
4806 -Wl,*) ;;
4807 *) echo $flag ;;
4808 esac
4809 done
4812 msvc_flags(){
4813 msvc_common_flags "$@"
4814 for flag; do
4815 case $flag in
4816 -Wall) echo -W3 -wd4018 -wd4146 -wd4244 -wd4305 \
4817 -wd4554 ;;
4818 -Wextra) echo -W4 -wd4244 -wd4127 -wd4018 -wd4389 \
4819 -wd4146 -wd4057 -wd4204 -wd4706 -wd4305 \
4820 -wd4152 -wd4324 -we4013 -wd4100 -wd4214 \
4821 -wd4307 \
4822 -wd4273 -wd4554 -wd4701 -wd4703 ;;
4823 esac
4824 done
4827 icl_flags(){
4828 msvc_common_flags "$@"
4829 for flag; do
4830 case $flag in
4831 # Despite what Intel's documentation says -Wall, which is supported
4832 # on Windows, does enable remarks so disable them here.
4833 -Wall) echo $flag -Qdiag-disable:remark ;;
4834 -std=$stdc) echo -Qstd=$stdc ;;
4835 -flto*) echo -ipo ;;
4836 esac
4837 done
4840 icc_flags(){
4841 for flag; do
4842 case $flag in
4843 -flto*) echo -ipo ;;
4844 *) echo $flag ;;
4845 esac
4846 done
4849 suncc_flags(){
4850 for flag; do
4851 case $flag in
4852 -march=*|-mcpu=*)
4853 case "${flag#*=}" in
4854 native) echo -xtarget=native ;;
4855 v9|niagara) echo -xarch=sparc ;;
4856 ultrasparc) echo -xarch=sparcvis ;;
4857 ultrasparc3|niagara2) echo -xarch=sparcvis2 ;;
4858 i586|pentium) echo -xchip=pentium ;;
4859 i686|pentiumpro|pentium2) echo -xtarget=pentium_pro ;;
4860 pentium3*|c3-2) echo -xtarget=pentium3 ;;
4861 pentium-m) echo -xarch=sse2 -xchip=pentium3 ;;
4862 pentium4*) echo -xtarget=pentium4 ;;
4863 prescott|nocona) echo -xarch=sse3 -xchip=pentium4 ;;
4864 *-sse3) echo -xarch=sse3 ;;
4865 core2) echo -xarch=ssse3 -xchip=core2 ;;
4866 bonnell) echo -xarch=ssse3 ;;
4867 corei7|nehalem) echo -xtarget=nehalem ;;
4868 westmere) echo -xtarget=westmere ;;
4869 silvermont) echo -xarch=sse4_2 ;;
4870 corei7-avx|sandybridge) echo -xtarget=sandybridge ;;
4871 core-avx*|ivybridge|haswell|broadwell|skylake*|knl)
4872 echo -xarch=avx ;;
4873 amdfam10|barcelona) echo -xtarget=barcelona ;;
4874 btver1) echo -xarch=amdsse4a ;;
4875 btver2|bdver*|znver*) echo -xarch=avx ;;
4876 athlon-4|athlon-[mx]p) echo -xarch=ssea ;;
4877 k8|opteron|athlon64|athlon-fx)
4878 echo -xarch=sse2a ;;
4879 athlon*) echo -xarch=pentium_proa ;;
4880 esac
4882 -std=$stdc) echo -x$stdc ;;
4883 -fomit-frame-pointer) echo -xregs=frameptr ;;
4884 -fPIC) echo -KPIC -xcode=pic32 ;;
4885 -W*,*) echo $flag ;;
4886 -f*-*|-W*|-mimpure-text) ;;
4887 -shared) echo -G ;;
4888 *) echo $flag ;;
4889 esac
4890 done
4893 probe_cc(){
4894 pfx=$1
4895 _cc=$2
4896 first=$3
4898 unset _type _ident _cc_c _cc_e _cc_o _flags _cflags
4899 unset _ld_o _ldflags _ld_lib _ld_path
4900 unset _depflags _DEPCMD _DEPFLAGS
4901 _flags_filter=echo
4903 if $_cc --version 2>&1 | grep -q '^GNU assembler'; then
4904 true # no-op to avoid reading stdin in following checks
4905 elif $_cc -v 2>&1 | grep -q '^gcc.*LLVM'; then
4906 _type=llvm_gcc
4907 gcc_extra_ver=$(expr "$($_cc --version 2>/dev/null | head -n1)" : '.*\((.*)\)')
4908 _ident="llvm-gcc $($_cc -dumpversion 2>/dev/null) $gcc_extra_ver"
4909 _depflags='-MMD -MF $(@:.o=.d) -MT $@'
4910 _cflags_speed='-O3'
4911 _cflags_size='-Os'
4912 elif $_cc -v 2>&1 | grep -qi ^gcc; then
4913 _type=gcc
4914 gcc_version=$($_cc --version | head -n1)
4915 gcc_basever=$($_cc -dumpversion)
4916 gcc_pkg_ver=$(expr "$gcc_version" : '[^ ]* \(([^)]*)\)')
4917 gcc_ext_ver=$(expr "$gcc_version" : ".*$gcc_pkg_ver $gcc_basever \\(.*\\)")
4918 _ident=$(cleanws "gcc $gcc_basever $gcc_pkg_ver $gcc_ext_ver")
4919 case $gcc_basever in
4920 2) ;;
4921 2.*) ;;
4922 *) _depflags='-MMD -MF $(@:.o=.d) -MT $@' ;;
4923 esac
4924 if [ "$first" = true ]; then
4925 case $gcc_basever in
4926 4.2*)
4927 warn "gcc 4.2 is outdated and may miscompile FFmpeg. Please use a newer compiler." ;;
4928 esac
4930 _cflags_speed='-O3'
4931 _cflags_size='-Os'
4932 elif $_cc --version 2>/dev/null | grep -q ^icc; then
4933 _type=icc
4934 _ident=$($_cc --version | head -n1)
4935 _depflags='-MMD'
4936 _cflags_speed='-O3'
4937 _cflags_size='-Os'
4938 _cflags_noopt='-O1'
4939 _flags_filter=icc_flags
4940 elif $_cc -v 2>&1 | grep -q xlc; then
4941 _type=xlc
4942 _ident=$($_cc -qversion 2>/dev/null | head -n1)
4943 _cflags_speed='-O5'
4944 _cflags_size='-O5 -qcompact'
4945 elif $_cc --vsn 2>/dev/null | grep -Eq "ARM (C/C\+\+ )?Compiler"; then
4946 test -d "$sysroot" || die "No valid sysroot specified."
4947 _type=armcc
4948 _ident=$($_cc --vsn | grep -i build | head -n1 | sed 's/.*: //')
4949 armcc_conf="$PWD/armcc.conf"
4950 $_cc --arm_linux_configure \
4951 --arm_linux_config_file="$armcc_conf" \
4952 --configure_sysroot="$sysroot" \
4953 --configure_cpp_headers="$sysinclude" >>$logfile 2>&1 ||
4954 die "Error creating armcc configuration file."
4955 $_cc --vsn | grep -q RVCT && armcc_opt=rvct || armcc_opt=armcc
4956 _flags="--arm_linux_config_file=$armcc_conf --translate_gcc"
4957 as_default="${cross_prefix}gcc"
4958 _depflags='-MMD'
4959 _cflags_speed='-O3'
4960 _cflags_size='-Os'
4961 elif $_cc -v 2>&1 | grep -q clang && ! $_cc -? > /dev/null 2>&1; then
4962 _type=clang
4963 _ident=$($_cc --version 2>/dev/null | head -n1)
4964 _depflags='-MMD -MF $(@:.o=.d) -MT $@'
4965 _cflags_speed='-O3'
4966 _cflags_size='-Oz'
4967 elif $_cc -V 2>&1 | grep -q Sun; then
4968 _type=suncc
4969 _ident=$($_cc -V 2>&1 | head -n1 | cut -d' ' -f 2-)
4970 _DEPCMD='$(DEP$(1)) $(DEP$(1)FLAGS) $($(1)DEP_FLAGS) $< | sed -e "1s,^.*: ,$@: ," -e "\$$!s,\$$, \\\," -e "1!s,^.*: , ," > $(@:.o=.d)'
4971 _DEPFLAGS='-xM1 -x$stdc'
4972 _ldflags='-std=$stdc'
4973 _cflags_speed='-O5'
4974 _cflags_size='-O5 -xspace'
4975 _flags_filter=suncc_flags
4976 elif $_cc -v 2>&1 | grep -q 'PathScale\|Path64'; then
4977 _type=pathscale
4978 _ident=$($_cc -v 2>&1 | head -n1 | tr -d :)
4979 _depflags='-MMD -MF $(@:.o=.d) -MT $@'
4980 _cflags_speed='-O2'
4981 _cflags_size='-Os'
4982 _flags_filter='filter_out -Wdisabled-optimization'
4983 elif $_cc -v 2>&1 | grep -q Open64; then
4984 _type=open64
4985 _ident=$($_cc -v 2>&1 | head -n1 | tr -d :)
4986 _depflags='-MMD -MF $(@:.o=.d) -MT $@'
4987 _cflags_speed='-O2'
4988 _cflags_size='-Os'
4989 _flags_filter='filter_out -Wdisabled-optimization|-Wtype-limits|-fno-signed-zeros'
4990 elif $_cc 2>&1 | grep -q 'Microsoft.*ARM.*Assembler'; then
4991 _type=armasm
4992 _ident=$($_cc | head -n1)
4993 # 4509: "This form of conditional instruction is deprecated"
4994 _flags="-nologo -ignore 4509"
4995 _flags_filter=armasm_flags
4996 elif $_cc 2>&1 | grep -q Intel; then
4997 _type=icl
4998 _ident=$($_cc 2>&1 | head -n1)
4999 _depflags='-QMMD -QMF$(@:.o=.d) -QMT$@'
5000 # Not only is O3 broken on 13.x+ but it is slower on all previous
5001 # versions (tested) as well.
5002 _cflags_speed="-O2"
5003 _cflags_size="-O1 -Oi" # -O1 without -Oi miscompiles stuff
5004 if $_cc 2>&1 | grep -q Linker; then
5005 _ld_o='-out:$@'
5006 else
5007 _ld_o='-Fe$@'
5009 _cc_o='-Fo$@'
5010 _cc_e='-P'
5011 _flags_filter=icl_flags
5012 _ld_lib='lib%.a'
5013 _ld_path='-libpath:'
5014 # -Qdiag-error to make icl error when seeing certain unknown arguments
5015 _flags='-nologo -Qdiag-error:4044,10157'
5016 # -Qvec- -Qsimd- to prevent miscompilation, -GS, fp:precise for consistency
5017 # with MSVC which enables it by default.
5018 _cflags='-Qms0 -Qvec- -Qsimd- -GS -fp:precise'
5019 disable stripping
5020 elif $_cc -? 2>/dev/null | grep -q 'LLVM.*Linker'; then
5021 # lld can emulate multiple different linkers; in ms link.exe mode,
5022 # the -? parameter gives the help output which contains an identifyable
5023 # string, while it gives an error in other modes.
5024 _type=lld-link
5025 # The link.exe mode doesn't have a switch for getting the version,
5026 # but we can force it back to gnu mode and get the version from there.
5027 _ident=$($_cc -flavor gnu --version 2>/dev/null)
5028 _ld_o='-out:$@'
5029 _flags_filter=msvc_flags
5030 _ld_lib='lib%.a'
5031 _ld_path='-libpath:'
5032 elif $_cc -nologo- 2>&1 | grep -q Microsoft || { $_cc -v 2>&1 | grep -q clang && $_cc -? > /dev/null 2>&1; }; then
5033 _type=msvc
5034 if $_cc -nologo- 2>&1 | grep -q Microsoft; then
5035 _ident=$($_cc 2>&1 | head -n1 | tr -d '\r')
5036 else
5037 _ident=$($_cc --version 2>/dev/null | head -n1 | tr -d '\r')
5039 if [ -x "$(command -v wslpath)" ]; then
5040 _DEPCMD='$(DEP$(1)) $(DEP$(1)FLAGS) $($(1)DEP_FLAGS) $< 2>&1 | awk '\''/including/ { sub(/^.*file: */, ""); if (!match($$0, / /)) { print $$0 } }'\'' | xargs -r -d\\n -n1 wslpath -u | awk '\''BEGIN { printf "%s:", "$@" }; { sub(/\r/,""); printf " %s", $$0 }; END { print "" }'\'' > $(@:.o=.d)'
5042 else
5043 _DEPCMD='$(DEP$(1)) $(DEP$(1)FLAGS) $($(1)DEP_FLAGS) $< 2>&1 | awk '\''/including/ { sub(/^.*file: */, ""); gsub(/\\/, "/"); if (!match($$0, / /)) print "$@:", $$0 }'\'' > $(@:.o=.d)'
5045 _DEPFLAGS='$(CPPFLAGS) $(CFLAGS) -showIncludes -Zs'
5046 _cflags_speed="-O2"
5047 _cflags_size="-O1"
5048 _cflags_noopt="-O1"
5049 if $_cc -nologo- 2>&1 | grep -q Linker; then
5050 _ld_o='-out:$@'
5051 else
5052 _ld_o='-Fe$@'
5054 _cc_o='-Fo$@'
5055 _cc_e='-P -Fi$@'
5056 _flags_filter=msvc_flags
5057 _ld_lib='lib%.a'
5058 _ld_path='-libpath:'
5059 _flags='-nologo'
5060 disable stripping
5061 elif $_cc --version 2>/dev/null | grep -q ^cparser; then
5062 _type=cparser
5063 _ident=$($_cc --version | head -n1)
5064 _depflags='-MMD'
5065 _cflags_speed='-O4'
5066 _cflags_size='-O2'
5067 _flags_filter=cparser_flags
5070 eval ${pfx}_type=\$_type
5071 eval ${pfx}_ident=\$_ident
5074 set_ccvars(){
5075 eval ${1}_C=\${_cc_c-\${${1}_C}}
5076 eval ${1}_E=\${_cc_e-\${${1}_E}}
5077 eval ${1}_O=\${_cc_o-\${${1}_O}}
5079 if [ -n "$_depflags" ]; then
5080 eval ${1}_DEPFLAGS=\$_depflags
5081 else
5082 eval ${1}DEP=\${_DEPCMD:-\$DEPCMD}
5083 eval ${1}DEP_FLAGS=\${_DEPFLAGS:-\$DEPFLAGS}
5084 eval DEP${1}FLAGS=\$_flags
5088 probe_cc cc "$cc" "true"
5089 cflags_filter=$_flags_filter
5090 cflags_speed=$_cflags_speed
5091 cflags_size=$_cflags_size
5092 cflags_noopt=$_cflags_noopt
5093 add_cflags $_flags $_cflags
5094 cc_ldflags=$_ldflags
5095 set_ccvars CC
5096 set_ccvars CXX
5098 probe_cc hostcc "$host_cc"
5099 host_cflags_filter=$_flags_filter
5100 host_cflags_speed=$_cflags_speed
5101 add_host_cflags $_flags $_cflags
5102 set_ccvars HOSTCC
5104 test -n "$cc_type" && enable $cc_type ||
5105 warn "Unknown C compiler $cc, unable to select optimal CFLAGS"
5107 : ${as_default:=$cc}
5108 : ${objcc_default:=$cc}
5109 : ${dep_cc_default:=$cc}
5110 : ${ld_default:=$cc}
5111 : ${host_ld_default:=$host_cc}
5112 set_default ar as objcc dep_cc ld ln_s host_ld windres
5114 probe_cc as "$as"
5115 asflags_filter=$_flags_filter
5116 add_asflags $_flags $_cflags
5117 set_ccvars AS
5119 probe_cc objcc "$objcc"
5120 objcflags_filter=$_flags_filter
5121 add_objcflags $_flags $_cflags
5122 set_ccvars OBJC
5124 probe_cc ld "$ld"
5125 ldflags_filter=$_flags_filter
5126 add_ldflags $_flags $_ldflags
5127 test "$cc_type" != "$ld_type" && add_ldflags $cc_ldflags
5128 LD_O=${_ld_o-$LD_O}
5129 LD_LIB=${_ld_lib-$LD_LIB}
5130 LD_PATH=${_ld_path-$LD_PATH}
5132 probe_cc hostld "$host_ld"
5133 host_ldflags_filter=$_flags_filter
5134 add_host_ldflags $_flags $_ldflags
5135 HOSTLD_O=${_ld_o-$HOSTLD_O}
5137 if [ -z "$CC_DEPFLAGS" ] && [ "$dep_cc" != "$cc" ]; then
5138 probe_cc depcc "$dep_cc"
5139 CCDEP=${_DEPCMD:-$DEPCMD}
5140 CCDEP_FLAGS=${_DEPFLAGS:=$DEPFLAGS}
5141 DEPCCFLAGS=$_flags
5144 if $ar 2>&1 | grep -q Microsoft; then
5145 arflags="-nologo"
5146 ar_o='-out:$@'
5147 elif $ar 2>&1 | grep -q "\[D\] "; then
5148 arflags="rcD"
5149 ar_o='$@'
5150 else
5151 arflags="rc"
5152 ar_o='$@'
5155 add_cflags $extra_cflags
5156 add_cxxflags $extra_cxxflags
5157 add_objcflags $extra_objcflags
5158 add_asflags $extra_cflags
5160 if test -n "$sysroot"; then
5161 case "$cc_type" in
5162 gcc|llvm_gcc|clang)
5163 add_cppflags --sysroot="$sysroot"
5164 add_ldflags --sysroot="$sysroot"
5166 esac
5169 if test "$cpu" = host; then
5170 enabled cross_compile &&
5171 warn "--cpu=host makes no sense when cross-compiling."
5173 case "$cc_type" in
5174 gcc|llvm_gcc)
5175 check_native(){
5176 $cc $1=native -v -c -o $TMPO $TMPC >$TMPE 2>&1 || return
5177 sed -n "/cc1.*$1=/{
5178 s/.*$1=\\([^ ]*\\).*/\\1/
5181 }" $TMPE
5183 cpu=$(check_native -march || check_native -mcpu)
5185 clang)
5186 check_native(){
5187 $cc $1=native -v -c -o $TMPO $TMPC >$TMPE 2>&1 || return
5188 sed -n "/cc1.*-target-cpu /{
5189 s/.*-target-cpu \\([^ ]*\\).*/\\1/
5192 }" $TMPE
5194 cpu=$(check_native -march)
5196 esac
5198 test "${cpu:-host}" = host &&
5199 die "--cpu=host not supported with compiler $cc"
5202 # Deal with common $arch aliases
5203 case "$arch" in
5204 aarch64|arm64)
5205 arch="aarch64"
5207 arm*|iPad*|iPhone*)
5208 arch="arm"
5210 loongarch*)
5211 arch="loongarch"
5213 mips*|IP*)
5214 case "$arch" in
5215 *el)
5216 add_cppflags -EL
5217 add_ldflags -EL
5219 *eb)
5220 add_cppflags -EB
5221 add_ldflags -EB
5223 esac
5224 arch="mips"
5226 parisc*|hppa*)
5227 arch="parisc"
5229 "Power Macintosh"|ppc*|powerpc*)
5230 arch="ppc"
5232 riscv*)
5233 arch="riscv"
5235 s390|s390x)
5236 arch="s390"
5238 sh4|sh)
5239 arch="sh4"
5241 sun4*|sparc*)
5242 arch="sparc"
5244 tilegx|tile-gx)
5245 arch="tilegx"
5247 i[3-6]86*|i86pc|BePC|x86pc|x86_64|x86_32|amd64)
5248 arch="x86"
5250 esac
5252 is_in $arch $ARCH_LIST || warn "unknown architecture $arch"
5253 enable $arch
5255 # Add processor-specific flags
5256 if enabled aarch64; then
5258 case $cpu in
5259 armv*)
5260 cpuflags="-march=$cpu"
5263 cpuflags="-mcpu=$cpu"
5265 esac
5267 elif enabled alpha; then
5269 cpuflags="-mcpu=$cpu"
5271 elif enabled arm; then
5273 check_arm_arch() {
5274 test_cpp_condition stddef.h \
5275 "defined __ARM_ARCH_${1}__ || defined __TARGET_ARCH_${2:-$1}" \
5276 $cpuflags
5279 probe_arm_arch() {
5280 if check_arm_arch 4; then echo armv4
5281 elif check_arm_arch 4T; then echo armv4t
5282 elif check_arm_arch 5; then echo armv5
5283 elif check_arm_arch 5E; then echo armv5e
5284 elif check_arm_arch 5T; then echo armv5t
5285 elif check_arm_arch 5TE; then echo armv5te
5286 elif check_arm_arch 5TEJ; then echo armv5te
5287 elif check_arm_arch 6; then echo armv6
5288 elif check_arm_arch 6J; then echo armv6j
5289 elif check_arm_arch 6K; then echo armv6k
5290 elif check_arm_arch 6Z; then echo armv6z
5291 elif check_arm_arch 6KZ; then echo armv6zk
5292 elif check_arm_arch 6ZK; then echo armv6zk
5293 elif check_arm_arch 6T2; then echo armv6t2
5294 elif check_arm_arch 7; then echo armv7
5295 elif check_arm_arch 7A 7_A; then echo armv7-a
5296 elif check_arm_arch 7S; then echo armv7-a
5297 elif check_arm_arch 7R 7_R; then echo armv7-r
5298 elif check_arm_arch 7M 7_M; then echo armv7-m
5299 elif check_arm_arch 7EM 7E_M; then echo armv7-m
5300 elif check_arm_arch 8A 8_A; then echo armv8-a
5305 case $cpu in
5306 generic)
5307 subarch=$(probe_arm_arch | sed 's/[^a-z0-9]//g')
5309 armv*)
5310 cpuflags="-march=$cpu"
5311 subarch=$(echo $cpu | sed 's/[^a-z0-9]//g')
5314 cpuflags="-mcpu=$cpu"
5315 case $cpu in
5316 cortex-a*) subarch=armv7a ;;
5317 cortex-r*) subarch=armv7r ;;
5318 cortex-m*) enable thumb; subarch=armv7m ;;
5319 arm11*) subarch=armv6 ;;
5320 arm[79]*e*|arm9[24]6*|arm96*|arm102[26]) subarch=armv5te ;;
5321 armv4*|arm7*|arm9[24]*) subarch=armv4 ;;
5322 *) subarch=$(probe_arm_arch) ;;
5323 esac
5325 esac
5327 case "$subarch" in
5328 armv5t*) enable fast_clz ;;
5329 armv[6-8]*)
5330 enable fast_clz
5331 disabled fast_unaligned || enable fast_unaligned
5333 esac
5335 test_cflags -mfp16-format=ieee && add_cflags -mfp16-format=ieee
5337 elif enabled avr32; then
5339 case $cpu in
5340 ap7[02]0[0-2])
5341 subarch="avr32_ap"
5342 cpuflags="-mpart=$cpu"
5345 subarch="avr32_ap"
5346 cpuflags="-march=$cpu"
5348 uc3[ab]*)
5349 subarch="avr32_uc"
5350 cpuflags="-mcpu=$cpu"
5353 subarch="avr32_uc"
5354 cpuflags="-march=$cpu"
5356 esac
5358 elif enabled bfin; then
5360 cpuflags="-mcpu=$cpu"
5362 elif enabled loongarch; then
5364 enable local_aligned
5365 enable simd_align_32
5366 enable fast_64bit
5367 enable fast_clz
5368 enable fast_unaligned
5369 case $cpu in
5370 la464)
5371 cpuflags="-march=$cpu"
5373 esac
5374 elif enabled mips; then
5376 if [ "$cpu" != "generic" ]; then
5377 disable mips32r2
5378 disable mips32r5
5379 disable mips64r2
5380 disable mips32r6
5381 disable mips64r6
5382 disable loongson2
5383 disable loongson3
5384 disable mipsdsp
5385 disable mipsdspr2
5387 cpuflags="-march=$cpu"
5389 case $cpu in
5390 # General ISA levels
5391 mips1|mips3)
5393 mips32r2)
5394 enable mips32r2
5396 mips32r5)
5397 enable mips32r2
5398 enable mips32r5
5400 mips64r2|mips64r5)
5401 enable mips64r2
5402 enable loongson3
5404 # Cores from MIPS(MTI)
5405 24kc)
5406 disable mipsfpu
5407 enable mips32r2
5409 24kf*|24kec|34kc|74Kc|1004kc)
5410 enable mips32r2
5412 24kef*|34kf*|1004kf*)
5413 enable mipsdsp
5414 enable mips32r2
5416 p5600)
5417 enable mips32r2
5418 enable mips32r5
5419 check_cflags "-mtune=p5600" && check_cflags "-msched-weight -mload-store-pairs -funroll-loops"
5421 i6400)
5422 enable mips64r6
5423 check_cflags "-mtune=i6400 -mabi=64" && check_cflags "-msched-weight -mload-store-pairs -funroll-loops" && check_ldflags "-mabi=64"
5425 p6600)
5426 enable mips64r6
5427 check_cflags "-mtune=p6600 -mabi=64" && check_cflags "-msched-weight -mload-store-pairs -funroll-loops" && check_ldflags "-mabi=64"
5429 # Cores from Loongson
5430 loongson2e|loongson2f|loongson3*)
5431 enable local_aligned
5432 enable simd_align_16
5433 enable fast_64bit
5434 enable fast_clz
5435 enable fast_cmov
5436 enable fast_unaligned
5437 disable aligned_stack
5438 # When gcc version less than 5.3.0, add -fno-expensive-optimizations flag.
5439 if test "$cc_type" = "gcc"; then
5440 case $gcc_basever in
5441 2|2.*|3.*|4.*|5.0|5.1|5.2)
5442 expensive_optimization_flag="-fno-expensive-optimizations"
5445 expensive_optimization_flag=""
5447 esac
5450 case $cpu in
5451 loongson3*)
5452 enable loongson3
5453 cpuflags="-march=loongson3a -mhard-float $expensive_optimization_flag"
5455 loongson2e)
5456 enable loongson2
5457 cpuflags="-march=loongson2e -mhard-float $expensive_optimization_flag"
5459 loongson2f)
5460 enable loongson2
5461 cpuflags="-march=loongson2f -mhard-float $expensive_optimization_flag"
5463 esac
5466 warn "unknown MIPS CPU"
5468 esac
5470 else
5471 disable mipsdsp
5472 disable mipsdspr2
5473 # Disable DSP stuff for generic CPU, it can't be detected at runtime.
5474 warn 'generic cpu selected'
5477 elif enabled ppc; then
5479 disable ldbrx
5481 case $(tolower $cpu) in
5482 601|ppc601|powerpc601)
5483 cpuflags="-mcpu=601"
5484 disable altivec
5486 603*|ppc603*|powerpc603*)
5487 cpuflags="-mcpu=603"
5488 disable altivec
5490 604*|ppc604*|powerpc604*)
5491 cpuflags="-mcpu=604"
5492 disable altivec
5494 g3|75*|ppc75*|powerpc75*)
5495 cpuflags="-mcpu=750"
5496 disable altivec
5498 g4|745*|ppc745*|powerpc745*)
5499 cpuflags="-mcpu=7450"
5500 disable vsx
5502 74*|ppc74*|powerpc74*)
5503 cpuflags="-mcpu=7400"
5504 disable vsx
5506 g5|970|ppc970|powerpc970)
5507 cpuflags="-mcpu=970"
5508 disable vsx
5510 power[3-6]*)
5511 cpuflags="-mcpu=$cpu"
5512 disable vsx
5514 power[7-8]*)
5515 cpuflags="-mcpu=$cpu"
5517 cell)
5518 cpuflags="-mcpu=cell"
5519 enable ldbrx
5520 disable vsx
5522 e500mc)
5523 cpuflags="-mcpu=e500mc"
5524 disable altivec
5526 e500v2)
5527 cpuflags="-mcpu=8548 -mhard-float -mfloat-gprs=double"
5528 disable altivec
5529 disable dcbzl
5531 e500)
5532 cpuflags="-mcpu=8540 -mhard-float"
5533 disable altivec
5534 disable dcbzl
5536 esac
5538 elif enabled riscv; then
5540 if test_cpp_condition stddef.h "__riscv_zbb"; then
5541 enable fast_clz
5543 if test_cpp_condition stddef.h "__riscv_zfhmin"; then
5544 enable fast_float16
5547 elif enabled sparc; then
5549 case $cpu in
5550 cypress|f93[04]|tsc701|sparcl*|supersparc|hypersparc|niagara|v[789])
5551 cpuflags="-mcpu=$cpu"
5553 ultrasparc*|niagara[234])
5554 cpuflags="-mcpu=$cpu"
5556 esac
5558 elif enabled x86; then
5560 case $cpu in
5561 i[345]86|pentium)
5562 cpuflags="-march=$cpu"
5563 disable i686
5564 disable mmx
5566 # targets that do NOT support nopl and conditional mov (cmov)
5567 pentium-mmx|k6|k6-[23]|winchip-c6|winchip2|c3)
5568 cpuflags="-march=$cpu"
5569 disable i686
5571 # targets that do support conditional mov but on which it's slow
5572 pentium4|pentium4m|prescott|nocona)
5573 cpuflags="-march=$cpu"
5574 enable i686
5575 disable fast_cmov
5577 # everything else should support nopl and conditional mov (cmov)
5579 cpuflags="-march=$cpu"
5580 enable i686
5581 enable fast_cmov
5583 esac
5587 if [ "$cpu" != generic ]; then
5588 add_cflags $cpuflags
5589 add_asflags $cpuflags
5590 test "$cc_type" = "$ld_type" && add_ldflags $cpuflags
5593 # compiler sanity check
5594 test_exec <<EOF
5595 int main(void){ return 0; }
5597 if test "$?" != 0; then
5598 echo "$cc is unable to create an executable file."
5599 if test -z "$cross_prefix" && ! enabled cross_compile ; then
5600 echo "If $cc is a cross-compiler, use the --enable-cross-compile option."
5601 echo "Only do this if you know what cross compiling means."
5603 die "C compiler test failed."
5606 add_cppflags -D_ISOC11_SOURCE
5607 add_cxxflags -D__STDC_CONSTANT_MACROS
5608 check_cxxflags_cc -std=$stdcxx ctype.h "__cplusplus >= 201103L" ||
5609 { check_cxxflags -std=c++11 && stdcxx="c++11" || { check_cxxflags -std=c++0x && stdcxx="c++0x"; }; }
5611 # some compilers silently accept -std=c11, so we also need to check that the
5612 # version macro is defined properly
5613 check_cflags_cc -std=$stdc ctype.h "__STDC_VERSION__ >= 201112L" ||
5614 { check_cflags_cc -std=c11 ctype.h "__STDC_VERSION__ >= 201112L" && stdc="c11" || die "Compiler lacks C11 support"; }
5616 test_cc <<EOF || die "Compiler lacks support for C11 static assertions"
5617 #include <assert.h>
5618 #include <stddef.h>
5619 struct Foo {
5620 int a;
5621 void *ptr;
5622 } obj;
5623 static_assert(offsetof(struct Foo, a) == 0,
5624 "First element of struct does not have offset 0");
5625 _Static_assert(offsetof(struct Foo, ptr) >= offsetof(struct Foo, a) + sizeof(obj.a),
5626 "elements not properly ordered in struct");
5629 check_cppflags -D_FILE_OFFSET_BITS=64
5630 check_cppflags -D_LARGEFILE_SOURCE
5632 add_host_cppflags -D_ISOC11_SOURCE
5633 check_host_cflags_cc -std=$stdc ctype.h "__STDC_VERSION__ >= 201112L" ||
5634 check_host_cflags_cc -std=c11 ctype.h "__STDC_VERSION__ >= 201112L" || die "Host compiler lacks C11 support"
5636 check_host_cflags -Wall
5637 check_host_cflags $host_cflags_speed
5639 check_64bit(){
5640 arch32=$1
5641 arch64=$2
5642 expr=${3:-'sizeof(void *) > 4'}
5643 test_code cc "" "int test[2*($expr) - 1]" &&
5644 subarch=$arch64 || subarch=$arch32
5645 enable $subarch
5648 case "$arch" in
5649 aarch64|alpha|ia64)
5650 enabled shared && enable_weak pic
5652 loongarch)
5653 check_64bit loongarch32 loongarch64
5654 enabled loongarch64 && disable loongarch32
5655 enabled shared && enable_weak pic
5657 mips)
5658 check_64bit mips mips64 '_MIPS_SIM > 1'
5659 enabled shared && enable_weak pic
5661 parisc)
5662 check_64bit parisc parisc64
5663 enabled shared && enable_weak pic
5665 ppc)
5666 check_64bit ppc ppc64
5667 enabled shared && enable_weak pic
5669 riscv)
5670 check_64bit riscv32 riscv64
5671 enabled shared && enable_weak pic
5673 s390)
5674 check_64bit s390 s390x
5675 enabled shared && enable_weak pic
5677 sparc)
5678 check_64bit sparc sparc64
5679 enabled shared && enable_weak pic
5681 x86)
5682 check_64bit x86_32 x86_64
5683 # Treat x32 as x64 for now. Note it also needs pic if shared
5684 test "$subarch" = "x86_32" && test_cpp_condition stddef.h 'defined(__x86_64__)' &&
5685 subarch=x86_64 && enable x86_64 && disable x86_32
5686 if enabled x86_64; then
5687 enabled shared && enable_weak pic
5688 objformat=elf64
5691 esac
5693 # OS specific
5694 case $target_os in
5695 aix)
5696 SHFLAGS=-shared
5697 add_cppflags '-I\$(SRC_PATH)/compat/aix'
5698 enabled shared && add_ldflags -Wl,-brtl
5699 arflags='-Xany -r -c'
5700 striptype=""
5702 android)
5703 disable symver
5704 enable section_data_rel_ro
5705 add_cflags -fPIE
5706 add_ldexeflags -fPIE -pie
5707 SLIB_INSTALL_NAME='$(SLIBNAME)'
5708 SLIB_INSTALL_LINKS=
5709 SHFLAGS='-shared -Wl,-soname,$(SLIBNAME)'
5711 haiku)
5712 prefix_default="/boot/common"
5713 network_extralibs="-lnetwork"
5714 host_extralibs=
5716 sunos)
5717 SHFLAGS='-shared -Wl,-h,$$(@F)'
5718 enabled x86 && append SHFLAGS -mimpure-text
5719 network_extralibs="-lsocket -lnsl"
5720 add_cppflags -D__EXTENSIONS__
5721 # When using suncc to build, the Solaris linker will mark
5722 # an executable with each instruction set encountered by
5723 # the Solaris assembler. As our libraries contain their own
5724 # guards for processor-specific code, instead suppress
5725 # generation of the HWCAPS ELF section on Solaris x86 only.
5726 enabled_all suncc x86 &&
5727 echo "hwcap_1 = OVERRIDE;" > mapfile &&
5728 add_ldflags -Wl,-M,mapfile
5729 nm_default='nm -P -g'
5730 striptype=""
5731 version_script='-M'
5732 VERSION_SCRIPT_POSTPROCESS_CMD='perl $(SRC_PATH)/compat/solaris/make_sunver.pl - $(OBJS)'
5734 netbsd)
5735 disable symver
5736 enable section_data_rel_ro
5737 oss_indev_extralibs="-lossaudio"
5738 oss_outdev_extralibs="-lossaudio"
5739 enabled gcc || check_ldflags -Wl,-zmuldefs
5741 openbsd)
5742 disable symver
5743 enable section_data_rel_ro
5744 striptype=""
5745 SHFLAGS='-shared'
5746 SLIB_INSTALL_NAME='$(SLIBNAME).$(LIBMAJOR).$(LIBMINOR)'
5747 SLIB_INSTALL_LINKS=
5748 oss_indev_extralibs="-lossaudio"
5749 oss_outdev_extralibs="-lossaudio"
5751 dragonfly)
5752 disable symver
5754 freebsd)
5755 enable section_data_rel_ro
5757 bsd/os)
5758 add_extralibs -lpoll -lgnugetopt
5759 strip="strip -d"
5761 darwin)
5762 enabled ppc && add_asflags -force_cpusubtype_ALL
5763 install_name_dir_default='$(SHLIBDIR)'
5764 SHFLAGS='-dynamiclib -Wl,-single_module -Wl,-install_name,$(INSTALL_NAME_DIR)/$(SLIBNAME_WITH_MAJOR),-current_version,$(LIBVERSION),-compatibility_version,$(LIBMAJOR)'
5765 enabled x86_32 && append SHFLAGS -Wl,-read_only_relocs,suppress
5766 strip="${strip} -x"
5767 add_ldflags -Wl,-dynamic,-search_paths_first
5768 check_cflags -Werror=partial-availability
5769 SLIBSUF=".dylib"
5770 SLIBNAME_WITH_VERSION='$(SLIBPREF)$(FULLNAME).$(LIBVERSION)$(SLIBSUF)'
5771 SLIBNAME_WITH_MAJOR='$(SLIBPREF)$(FULLNAME).$(LIBMAJOR)$(SLIBSUF)'
5772 enabled x86_64 && objformat="macho64" || objformat="macho32"
5773 enabled_any pic shared x86_64 ||
5774 { check_cflags -mdynamic-no-pic && add_asflags -mdynamic-no-pic; }
5775 check_headers dispatch/dispatch.h &&
5776 add_cppflags '-I\$(SRC_PATH)/compat/dispatch_semaphore'
5777 if test -n "$sysroot"; then
5778 is_in -isysroot $cc $CPPFLAGS $CFLAGS || check_cppflags -isysroot $sysroot
5779 is_in -isysroot $ld $LDFLAGS || check_ldflags -isysroot $sysroot
5781 version_script='-exported_symbols_list'
5782 VERSION_SCRIPT_POSTPROCESS_CMD='tr " " "\n" | sed -n /global:/,/local:/p | grep ";" | tr ";" "\n" | sed -E "s/(.+)/_\1/g" | sed -E "s/(.+[^*])$$$$/\1*/"'
5783 # Workaround for Xcode 11 -fstack-check bug
5784 if enabled clang; then
5785 clang_version=$($cc -dumpversion)
5786 test ${clang_version%%.*} -eq 11 && add_cflags -fno-stack-check
5789 msys*)
5790 die "Native MSYS builds are discouraged, please use the MINGW environment."
5792 mingw32*|mingw64*)
5793 target_os=mingw32
5794 LIBTARGET=i386
5795 if enabled x86_64; then
5796 LIBTARGET="i386:x86-64"
5797 elif enabled arm; then
5798 LIBTARGET="arm"
5799 elif enabled aarch64; then
5800 LIBTARGET="arm64"
5802 if enabled shared; then
5803 # Cannot build both shared and static libs when using dllimport.
5804 disable static
5806 ! enabled small && test_cmd $windres --version && enable gnu_windres
5807 enabled x86_32 && check_ldflags -Wl,--large-address-aware
5808 add_cppflags -DWIN32_LEAN_AND_MEAN
5809 shlibdir_default="$bindir_default"
5810 SLIBPREF=""
5811 SLIBSUF=".dll"
5812 SLIBNAME_WITH_VERSION='$(SLIBPREF)$(FULLNAME)-$(LIBVERSION)$(SLIBSUF)'
5813 SLIBNAME_WITH_MAJOR='$(SLIBPREF)$(FULLNAME)-$(LIBMAJOR)$(SLIBSUF)'
5814 if test_cmd lib.exe -list; then
5815 SLIB_EXTRA_CMD=-'lib.exe -nologo -machine:$(LIBTARGET) -def:$$(@:$(SLIBSUF)=.def) -out:$(SUBDIR)$(SLIBNAME:$(SLIBSUF)=.lib)'
5816 if enabled x86_64; then
5817 LIBTARGET=x64
5819 else
5820 SLIB_EXTRA_CMD=-'$(DLLTOOL) -m $(LIBTARGET) -d $$(@:$(SLIBSUF)=.def) -l $(SUBDIR)$(SLIBNAME:$(SLIBSUF)=.lib) -D $(SLIBNAME_WITH_MAJOR)'
5822 SLIB_INSTALL_NAME='$(SLIBNAME_WITH_MAJOR)'
5823 SLIB_INSTALL_LINKS=
5824 SLIB_INSTALL_EXTRA_SHLIB='$(SLIBNAME:$(SLIBSUF)=.lib)'
5825 SLIB_INSTALL_EXTRA_LIB='lib$(SLIBNAME:$(SLIBSUF)=.dll.a) $(SLIBNAME_WITH_MAJOR:$(SLIBSUF)=.def)'
5826 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)'
5827 SHFLAGS='-shared -Wl,--out-implib,$(SUBDIR)lib$(SLIBNAME:$(SLIBSUF)=.dll.a) -Wl,--disable-auto-image-base $$(@:$(SLIBSUF)=.def)'
5828 enabled x86_64 && objformat="win64" || objformat="win32"
5829 dlltool="${cross_prefix}dlltool"
5830 ranlib=:
5831 enable dos_paths
5832 check_ldflags -Wl,--nxcompat,--dynamicbase
5833 # Lets work around some stupidity in binutils.
5834 # ld will strip relocations from executables even though we need them
5835 # for dynamicbase (ASLR). Using -pie does retain the reloc section
5836 # however ld then forgets what the entry point should be (oops) so we
5837 # have to manually (re)set it.
5838 if enabled x86_32; then
5839 disabled debug && add_ldexeflags -Wl,--pic-executable,-e,_mainCRTStartup
5840 elif enabled x86_64; then
5841 disabled debug && add_ldexeflags -Wl,--pic-executable,-e,mainCRTStartup
5842 check_ldflags -Wl,--high-entropy-va # binutils 2.25
5843 # Set image base >4GB for extra entropy with HEASLR
5844 add_ldexeflags -Wl,--image-base,0x140000000
5845 append SHFLAGS -Wl,--image-base,0x180000000
5848 win32|win64)
5849 disable symver
5850 if enabled shared; then
5851 # Link to the import library instead of the normal static library
5852 # for shared libs.
5853 LD_LIB='%.lib'
5854 # Cannot build both shared and static libs with MSVC or icl.
5855 disable static
5857 ! enabled small && test_cmd $windres --version && enable gnu_windres
5858 enabled x86_32 && check_ldflags -LARGEADDRESSAWARE
5859 add_cppflags -DWIN32_LEAN_AND_MEAN
5860 shlibdir_default="$bindir_default"
5861 SLIBPREF=""
5862 SLIBSUF=".dll"
5863 SLIBNAME_WITH_VERSION='$(SLIBPREF)$(FULLNAME)-$(LIBVERSION)$(SLIBSUF)'
5864 SLIBNAME_WITH_MAJOR='$(SLIBPREF)$(FULLNAME)-$(LIBMAJOR)$(SLIBSUF)'
5865 SLIB_CREATE_DEF_CMD='EXTERN_PREFIX="$(EXTERN_PREFIX)" $(SRC_PATH)/compat/windows/makedef $(SUBDIR)lib$(NAME).ver $(OBJS) > $$(@:$(SLIBSUF)=.def)'
5866 SLIB_INSTALL_NAME='$(SLIBNAME_WITH_MAJOR)'
5867 SLIB_INSTALL_LINKS=
5868 SLIB_INSTALL_EXTRA_SHLIB='$(SLIBNAME:$(SLIBSUF)=.lib)'
5869 SLIB_INSTALL_EXTRA_LIB='$(SLIBNAME_WITH_MAJOR:$(SLIBSUF)=.def)'
5870 SHFLAGS='-dll -def:$$(@:$(SLIBSUF)=.def) -implib:$(SUBDIR)$(SLIBNAME:$(SLIBSUF)=.lib)'
5871 enabled x86_64 && objformat="win64" || objformat="win32"
5872 ranlib=:
5873 enable dos_paths
5875 cygwin*)
5876 target_os=cygwin
5877 shlibdir_default="$bindir_default"
5878 SLIBPREF="cyg"
5879 SLIBSUF=".dll"
5880 SLIBNAME_WITH_VERSION='$(SLIBPREF)$(FULLNAME)-$(LIBVERSION)$(SLIBSUF)'
5881 SLIBNAME_WITH_MAJOR='$(SLIBPREF)$(FULLNAME)-$(LIBMAJOR)$(SLIBSUF)'
5882 SLIB_INSTALL_NAME='$(SLIBNAME_WITH_MAJOR)'
5883 SLIB_INSTALL_LINKS=
5884 SLIB_INSTALL_EXTRA_LIB='lib$(FULLNAME).dll.a'
5885 SHFLAGS='-shared -Wl,--out-implib,$(SUBDIR)lib$(FULLNAME).dll.a'
5886 enabled x86_64 && objformat="win64" || objformat="win32"
5887 enable dos_paths
5888 ! enabled small && test_cmd $windres --version && enable gnu_windres
5889 add_cppflags -DWIN32_LEAN_AND_MEAN
5890 add_cppflags -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600
5892 *-dos|freedos|opendos)
5893 network_extralibs="-lsocket"
5894 objformat="coff"
5895 enable dos_paths
5897 linux)
5898 enable section_data_rel_ro
5899 enabled_any arm aarch64 && enable_weak linux_perf
5901 irix*)
5902 target_os=irix
5903 ranlib="echo ignoring ranlib"
5905 os/2*)
5906 strip="lxlite -CS"
5907 striptype=""
5908 objformat="aout"
5909 add_cppflags -D_GNU_SOURCE
5910 add_ldflags -Zomf -Zbin-files -Zargs-wild -Zhigh-mem -Zmap
5911 SHFLAGS='$(SUBDIR)$(NAME).def -Zdll -Zomf'
5912 LIBSUF="_s.a"
5913 SLIBPREF=""
5914 SLIBSUF=".dll"
5915 SLIBNAME_WITH_VERSION='$(SLIBPREF)$(FULLNAME)-$(LIBVERSION)$(SLIBSUF)'
5916 SLIBNAME_WITH_MAJOR='$(SLIBPREF)$(shell echo $(FULLNAME) | cut -c1-6)$(LIBMAJOR)$(SLIBSUF)'
5917 SLIB_CREATE_DEF_CMD='echo LIBRARY $(SLIBNAME_WITH_MAJOR:$(SLIBSUF)=) INITINSTANCE TERMINSTANCE > $(SUBDIR)$(FULLNAME).def; \
5918 echo CODE PRELOAD MOVEABLE DISCARDABLE >> $(SUBDIR)$(FULLNAME).def; \
5919 echo DATA PRELOAD MOVEABLE MULTIPLE NONSHARED >> $(SUBDIR)$(FULLNAME).def; \
5920 echo EXPORTS >> $(SUBDIR)$(FULLNAME).def; \
5921 emxexp $(OBJS) >> $(SUBDIR)$(FULLNAME).def'
5922 SLIB_EXTRA_CMD='emximp -o $(SUBDIR)$(LIBPREF)$(FULLNAME)_dll.a $(SUBDIR)$(FULLNAME).def; \
5923 emximp -o $(SUBDIR)$(LIBPREF)$(FULLNAME)_dll.lib $(SUBDIR)$(FULLNAME).def;'
5924 SLIB_INSTALL_NAME='$(SLIBNAME_WITH_MAJOR)'
5925 SLIB_INSTALL_LINKS=
5926 SLIB_INSTALL_EXTRA_LIB='$(LIBPREF)$(FULLNAME)_dll.a $(LIBPREF)$(FULLNAME)_dll.lib'
5927 enable dos_paths
5928 enable_weak os2threads
5930 gnu/kfreebsd)
5931 add_cppflags -D_BSD_SOURCE
5933 gnu)
5935 qnx)
5936 add_cppflags -D_QNX_SOURCE
5937 network_extralibs="-lsocket"
5939 symbian)
5940 SLIBSUF=".dll"
5941 enable dos_paths
5942 add_cflags --include=$sysinclude/gcce/gcce.h -fvisibility=default
5943 add_cppflags -D__GCCE__ -D__SYMBIAN32__ -DSYMBIAN_OE_POSIX_SIGNALS
5944 add_ldflags -Wl,--target1-abs,--no-undefined \
5945 -Wl,-Ttext,0x80000,-Tdata,0x1000000 -shared \
5946 -Wl,--entry=_E32Startup -Wl,-u,_E32Startup
5947 add_extralibs -l:eexe.lib -l:usrt2_2.lib -l:dfpaeabi.dso \
5948 -l:drtaeabi.dso -l:scppnwdl.dso -lsupc++ -lgcc \
5949 -l:libc.dso -l:libm.dso -l:euser.dso -l:libcrt0.lib
5951 minix)
5953 none)
5956 die "Unknown OS '$target_os'."
5958 esac
5960 # test if creating links works
5961 link_dest=$(mktemp -u $TMPDIR/dest_XXXXXXXX)
5962 link_name=$(mktemp -u $TMPDIR/name_XXXXXXXX)
5963 mkdir "$link_dest"
5964 $ln_s "$link_dest" "$link_name"
5965 touch "$link_dest/test_file"
5966 if [ "$source_path" != "." ] && [ "$source_path" != "src" ] && ([ ! -d src ] || [ -L src ]) && [ -e "$link_name/test_file" ]; then
5967 # create link to source path
5968 [ -e src ] && rm src
5969 $ln_s "$source_path" src
5970 source_link=src
5971 else
5972 # creating directory links doesn't work
5973 # fall back to using the full source path
5974 source_link="$source_path"
5976 # cleanup
5977 rm -r "$link_dest"
5978 rm -r "$link_name"
5980 # determine libc flavour
5982 probe_libc(){
5983 pfx=$1
5984 pfx_no_=${pfx%_}
5985 # uclibc defines __GLIBC__, so it needs to be checked before glibc.
5986 if test_${pfx}cpp_condition features.h "defined __UCLIBC__"; then
5987 eval ${pfx}libc_type=uclibc
5988 add_${pfx}cppflags -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600
5989 elif test_${pfx}cpp_condition features.h "defined __GLIBC__"; then
5990 eval ${pfx}libc_type=glibc
5991 add_${pfx}cppflags -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600
5992 # MinGW headers can be installed on Cygwin, so check for newlib first.
5993 elif test_${pfx}cpp_condition newlib.h "defined _NEWLIB_VERSION"; then
5994 eval ${pfx}libc_type=newlib
5995 add_${pfx}cppflags -U__STRICT_ANSI__ -D_XOPEN_SOURCE=600
5996 # MinGW64 is backwards compatible with MinGW32, so check for it first.
5997 elif test_${pfx}cpp_condition _mingw.h "defined __MINGW64_VERSION_MAJOR"; then
5998 eval ${pfx}libc_type=mingw64
5999 if test_${pfx}cpp_condition _mingw.h "__MINGW64_VERSION_MAJOR < 3"; then
6000 add_compat msvcrt/snprintf.o
6001 add_cflags "-include $source_path/compat/msvcrt/snprintf.h"
6003 add_${pfx}cppflags -U__STRICT_ANSI__ -D__USE_MINGW_ANSI_STDIO=1
6004 eval test \$${pfx_no_}cc_type = "gcc" &&
6005 add_${pfx}cppflags -D__printf__=__gnu_printf__
6006 test_${pfx}cpp_condition windows.h "!defined(_WIN32_WINNT) || _WIN32_WINNT < 0x0600" &&
6007 add_${pfx}cppflags -D_WIN32_WINNT=0x0600
6008 add_${pfx}cppflags -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600
6009 elif test_${pfx}cpp_condition _mingw.h "defined __MINGW_VERSION" ||
6010 test_${pfx}cpp_condition _mingw.h "defined __MINGW32_VERSION"; then
6011 eval ${pfx}libc_type=mingw32
6012 test_${pfx}cpp_condition _mingw.h "__MINGW32_MAJOR_VERSION > 3 || \
6013 (__MINGW32_MAJOR_VERSION == 3 && __MINGW32_MINOR_VERSION >= 15)" ||
6014 die "ERROR: MinGW32 runtime version must be >= 3.15."
6015 add_${pfx}cppflags -U__STRICT_ANSI__ -D__USE_MINGW_ANSI_STDIO=1
6016 test_${pfx}cpp_condition _mingw.h "__MSVCRT_VERSION__ < 0x0700" &&
6017 add_${pfx}cppflags -D__MSVCRT_VERSION__=0x0700
6018 test_${pfx}cpp_condition windows.h "!defined(_WIN32_WINNT) || _WIN32_WINNT < 0x0600" &&
6019 add_${pfx}cppflags -D_WIN32_WINNT=0x0600
6020 eval test \$${pfx_no_}cc_type = "gcc" &&
6021 add_${pfx}cppflags -D__printf__=__gnu_printf__
6022 add_${pfx}cppflags -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600
6023 elif test_${pfx}cpp_condition crtversion.h "defined _VC_CRT_MAJOR_VERSION"; then
6024 eval ${pfx}libc_type=msvcrt
6025 if test_${pfx}cpp_condition crtversion.h "_VC_CRT_MAJOR_VERSION < 14"; then
6026 if [ "$pfx" = host_ ]; then
6027 add_host_cppflags -Dsnprintf=_snprintf
6028 else
6029 add_compat strtod.o strtod=avpriv_strtod
6030 add_compat msvcrt/snprintf.o snprintf=avpriv_snprintf \
6031 _snprintf=avpriv_snprintf \
6032 vsnprintf=avpriv_vsnprintf
6035 add_${pfx}cppflags -D_USE_MATH_DEFINES -D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_WARNINGS
6036 # The MSVC 2010 headers (Win 7.0 SDK) set _WIN32_WINNT to
6037 # 0x601 by default unless something else is set by the user.
6038 # This can easily lead to us detecting functions only present
6039 # in such new versions and producing binaries requiring windows 7.0.
6040 # Therefore explicitly set the default to Vista unless the user has
6041 # set something else on the command line.
6042 # Don't do this if WINAPI_FAMILY is set and is set to a non-desktop
6043 # family. For these cases, configure is free to use any functions
6044 # found in the SDK headers by default. (Alternatively, we could force
6045 # _WIN32_WINNT to 0x0602 in that case.)
6046 test_${pfx}cpp_condition stdlib.h "defined(_WIN32_WINNT)" ||
6047 { test_${pfx}cpp <<EOF && add_${pfx}cppflags -D_WIN32_WINNT=0x0600; }
6048 #ifdef WINAPI_FAMILY
6049 #include <winapifamily.h>
6050 #if !WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
6051 #error not desktop
6052 #endif
6053 #endif
6055 if [ "$pfx" = "" ]; then
6056 check_func strtoll || add_cflags -Dstrtoll=_strtoi64
6057 check_func strtoull || add_cflags -Dstrtoull=_strtoui64
6059 elif test_${pfx}cpp_condition stddef.h "defined __KLIBC__"; then
6060 eval ${pfx}libc_type=klibc
6061 elif test_${pfx}cpp_condition sys/cdefs.h "defined __BIONIC__"; then
6062 eval ${pfx}libc_type=bionic
6063 elif test_${pfx}cpp_condition sys/brand.h "defined LABELED_BRAND_NAME"; then
6064 eval ${pfx}libc_type=solaris
6065 add_${pfx}cppflags -D__EXTENSIONS__ -D_XOPEN_SOURCE=600
6066 elif test_${pfx}cpp_condition sys/version.h "defined __DJGPP__"; then
6067 eval ${pfx}libc_type=djgpp
6068 add_cppflags -U__STRICT_ANSI__
6069 add_cflags "-include $source_path/compat/djgpp/math.h"
6070 add_compat djgpp/math.o
6072 test_${pfx}cc <<EOF
6073 #include <time.h>
6074 void *v = localtime_r;
6076 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
6077 #include <time.h>
6078 void *v = localtime_r;
6081 eval test -n "\${${pfx}libc_type}" && enable ${pfx}libc_${libc_type}
6084 probe_libc
6085 probe_libc host_
6087 # hacks for compiler/libc/os combinations
6089 case $libc_type in
6090 bionic)
6091 add_compat strtod.o strtod=avpriv_strtod
6093 esac
6095 check_compile_assert flt_lim "float.h limits.h" "DBL_MAX == (double)DBL_MAX" ||
6096 add_cppflags '-I\$(SRC_PATH)/compat/float'
6098 test_cpp_condition stdlib.h "defined(__PIC__) || defined(__pic__) || defined(PIC)" && enable_weak pic
6100 set_default libdir
6101 : ${shlibdir_default:="$libdir"}
6102 : ${pkgconfigdir_default:="$libdir/pkgconfig"}
6104 set_default $PATHS_LIST
6105 set_default nm
6107 disabled optimizations || enabled ossfuzz || check_cflags -fomit-frame-pointer
6109 enable_weak_pic() {
6110 disabled pic && return
6111 enable pic
6112 add_cppflags -DPIC
6113 case "$target_os" in
6114 mingw*|cygwin*|win*)
6117 add_cflags -fPIC
6118 add_asflags -fPIC
6120 esac
6123 enabled pic && enable_weak_pic
6125 test_cc <<EOF || die "Symbol mangling check failed."
6126 int ff_extern;
6128 sym=$($nm $TMPO | awk '/ff_extern/{ print substr($0, match($0, /[^ \t]*ff_extern/)) }')
6129 extern_prefix=${sym%%ff_extern*}
6131 ! disabled inline_asm && check_inline_asm inline_asm '"" ::'
6133 check_cc pragma_deprecated "" '_Pragma("GCC diagnostic push") _Pragma("GCC diagnostic ignored \"-Wdeprecated-declarations\"")'
6135 test_cpp_condition stdlib.h "defined(__BYTE_ORDER__) && (__BYTE_ORDER__ == __ORDER_BIG_ENDIAN__)" && enable bigendian
6137 check_cc const_nan math.h "struct { double d; } static const bar[] = { { NAN } }"
6139 if ! enabled ppc64 || enabled bigendian; then
6140 disable vsx
6143 check_gas() {
6144 log "check_gas using '$as' as AS"
6145 # :vararg is used on aarch64, arm and ppc altivec
6146 check_as vararg "
6147 .macro m n, y:vararg=0
6148 \n: .int \y
6149 .endm
6150 m x" || return 1
6151 # .altmacro is only used in arm asm
6152 ! enabled arm || check_as gnu_as ".altmacro"
6155 if enabled_any arm aarch64 || enabled_all ppc altivec && enabled asm; then
6156 nogas=:
6157 enabled_any arm aarch64 && nogas=die
6158 enabled_all ppc altivec && [ $target_os_default != aix ] && nogas=warn
6159 as_noop=-v
6161 case $as_type in
6162 arm*) gaspp_as_type=armasm; as_noop=-h ;;
6163 gcc) gaspp_as_type=gas ;;
6164 *) gaspp_as_type=$as_type ;;
6165 esac
6167 [ $target_os = "darwin" ] && gaspp_as_type="apple-$gaspp_as_type"
6169 test "${as#*gas-preprocessor.pl}" != "$as" ||
6170 test_cmd gas-preprocessor.pl -arch $arch -as-type $gaspp_as_type -- ${as:=$cc} $as_noop &&
6171 gas="${gas:=gas-preprocessor.pl} -arch $arch -as-type $gaspp_as_type -- ${as:=$cc}"
6173 if ! check_gas ; then
6174 as=${gas:=$as}
6175 check_gas || \
6176 $nogas "GNU assembler not found, install/update gas-preprocessor"
6179 check_as as_func ".func test
6180 .endfunc"
6183 check_inline_asm inline_asm_labels '"1:\n"'
6185 check_inline_asm inline_asm_nonlocal_labels '"Label:\n"'
6187 if enabled aarch64; then
6188 as_arch_level="armv8-a"
6189 check_as as_arch_directive ".arch $as_arch_level"
6190 if enabled as_arch_directive; then
6191 # Check for higher .arch levels. We only need armv8.2-a in order to
6192 # enable the extensions we want below - we primarily want to control
6193 # them via .arch_extension. However:
6195 # Clang before version 17 (Xcode versions up to and including 15.0)
6196 # didn't support controlling the dotprod/i8mm extensions via
6197 # .arch_extension; thus try to enable them via the .arch level as well.
6198 for level in armv8.2-a armv8.4-a armv8.6-a; do
6199 check_arch_level $level
6200 done
6201 # Clang before version 17 (Xcode versions up to and including 15.0)
6202 # also had a bug (https://github.com/llvm/llvm-project/issues/32220)
6203 # causing a plain ".arch <level>" to not have any effect unless it
6204 # had an extra "+<feature>" included - but it was activated on the next
6205 # ".arch_extension" directive. Check if we can include "+crc" as dummy
6206 # feature to make the .arch directive behave as expected and take
6207 # effect right away.
6208 check_arch_level "${as_arch_level}+crc"
6211 enabled armv8 && check_insn armv8 'prfm pldl1strm, [x0]'
6212 # internal assembler in clang 3.3 does not support this instruction
6213 enabled neon && check_insn neon 'ext v0.8B, v0.8B, v1.8B, #1'
6215 archext_list="dotprod i8mm"
6216 enabled dotprod && check_archext_insn dotprod 'udot v0.4s, v0.16b, v0.16b'
6217 enabled i8mm && check_archext_insn i8mm 'usdot v0.4s, v0.16b, v0.16b'
6219 # Disable the main feature (e.g. HAVE_NEON) if neither inline nor external
6220 # assembly support the feature out of the box. Skip this for the features
6221 # checked with check_archext_insn above, as that function takes care of
6222 # updating all the variables as necessary.
6223 for v in $ARCH_EXT_LIST_ARM; do
6224 is_in $v $archext_list && continue
6225 enabled_any ${v}_external ${v}_inline || disable $v
6226 done
6228 elif enabled alpha; then
6230 check_cflags -mieee
6232 elif enabled arm; then
6234 enabled msvc && check_cpp_condition thumb stddef.h "defined _M_ARMT"
6235 test_cpp_condition stddef.h "defined __thumb__" && test_cc <<EOF && enable_weak thumb
6236 float func(float a, float b){ return a+b; }
6238 enabled thumb && check_cflags -mthumb || check_cflags -marm
6240 if check_cpp_condition vfp_args stddef.h "defined __ARM_PCS_VFP"; then
6242 elif check_cpp_condition vfp_args stddef.h "defined _M_ARM_FP && _M_ARM_FP >= 30"; then
6244 elif ! test_cpp_condition stddef.h "defined __ARM_PCS || defined __SOFTFP__" && [ $target_os != darwin ]; then
6245 case "${cross_prefix:-$cc}" in
6246 *hardfloat*) enable vfp_args; fpabi=vfp ;;
6247 *) check_ld "cc" vfp_args <<EOF && fpabi=vfp || fpabi=soft ;;
6248 __asm__ (".eabi_attribute 28, 1");
6249 int main(void) { return 0; }
6251 esac
6252 warn "Compiler does not indicate floating-point ABI, guessing $fpabi."
6255 # Test for various instruction sets, testing support both in inline and
6256 # external assembly. This sets the ${v}_inline or ${v}_external flags
6257 # if the instruction can be used unconditionally in either inline or
6258 # external assembly. This means that if the ${v}_external feature is set,
6259 # that feature can be used unconditionally in various support macros
6260 # anywhere in external assembly, in any function.
6261 enabled armv5te && check_insn armv5te 'qadd r0, r0, r0'
6262 enabled armv6 && check_insn armv6 'sadd16 r0, r0, r0'
6263 enabled armv6t2 && check_insn armv6t2 'movt r0, #0'
6264 enabled neon && check_insn neon 'vadd.i16 q0, q0, q0'
6265 enabled vfp && check_insn vfp 'fadds s0, s0, s0'
6266 enabled vfpv3 && check_insn vfpv3 'vmov.f32 s0, #1.0'
6267 enabled setend && check_insn setend 'setend be'
6269 # If neither inline nor external assembly can use the feature by default,
6270 # disable the main unsuffixed feature (e.g. HAVE_NEON).
6272 # For targets that support runtime CPU feature detection, don't disable
6273 # the main feature flag - there we assume that all supported toolchains
6274 # can assemble code for all instruction set features (e.g. NEON) with
6275 # suitable assembly flags (such as ".fpu neon"); we don't check
6276 # specifically that they really do.
6277 [ $target_os = linux ] || [ $target_os = android ] ||
6278 map 'enabled_any ${v}_external ${v}_inline || disable $v' \
6279 $ARCH_EXT_LIST_ARM
6281 check_inline_asm asm_mod_q '"add r0, %Q0, %R0" :: "r"((long long)0)'
6283 check_as as_arch_directive ".arch armv7-a"
6284 check_as as_dn_directive "ra .dn d0.i16"
6285 check_as as_fpu_directive ".fpu neon"
6287 # llvm's integrated assembler supports .object_arch from llvm 3.5
6288 [ "$objformat" = elf32 ] || [ "$objformat" = elf64 ] &&
6289 check_as as_object_arch ".object_arch armv4"
6291 # MS armasm fails to assemble our PIC constructs
6292 [ $target_os != win32 ] && enabled_all armv6t2 shared !pic && enable_weak_pic
6294 elif enabled mips; then
6296 # Check toolchain ISA level
6297 if enabled mips64; then
6298 enabled mips64r6 && check_inline_asm mips64r6 '"dlsa $0, $0, $0, 1"' &&
6299 disable mips64r2
6301 enabled mips64r2 && check_inline_asm mips64r2 '"dext $0, $0, 0, 1"'
6303 disable mips32r6 && disable mips32r5 && disable mips32r2
6304 else
6305 enabled mips32r6 && check_inline_asm mips32r6 '"aui $0, $0, 0"' &&
6306 disable mips32r5 && disable mips32r2
6308 enabled mips32r5 && check_inline_asm mips32r5 '"eretnc"'
6309 enabled mips32r2 && check_inline_asm mips32r2 '"ext $0, $0, 0, 1"'
6311 disable mips64r6 && disable mips64r5 && disable mips64r2
6314 enabled mipsfpu && check_inline_asm mipsfpu '"cvt.d.l $f0, $f2"'
6315 enabled mipsfpu && (enabled mips32r5 || enabled mips32r6 || enabled mips64r6) && check_inline_asm_flags mipsfpu '"cvt.d.l $f0, $f1"' '-mfp64'
6317 enabled mipsdsp && check_inline_asm_flags mipsdsp '"addu.qb $t0, $t1, $t2"' '-mdsp'
6318 enabled mipsdspr2 && check_inline_asm_flags mipsdspr2 '"absq_s.qb $t0, $t1"' '-mdspr2'
6320 # MSA can be detected at runtime so we supply extra flags here
6321 enabled mipsfpu && enabled msa && check_inline_asm msa '"addvi.b $w0, $w1, 1"' '-mmsa' && append MSAFLAGS '-mmsa'
6323 # loongson2 have no switch cflag so we can only probe toolchain ability
6324 enabled loongson2 && check_inline_asm loongson2 '"dmult.g $8, $9, $10"' && disable loongson3
6326 # loongson3 is paired with MMI
6327 enabled loongson3 && check_inline_asm loongson3 '"gsldxc1 $f0, 0($2, $3)"' '-mloongson-ext' && append MMIFLAGS '-mloongson-ext'
6329 # MMI can be detected at runtime too
6330 enabled mmi && check_inline_asm mmi '"pxor $f0, $f0, $f0"' '-mloongson-mmi' && append MMIFLAGS '-mloongson-mmi'
6332 if enabled bigendian && enabled msa; then
6333 disable msa
6336 elif enabled parisc; then
6338 if enabled gcc; then
6339 case $($cc -dumpversion) in
6340 4.[3-9].*) check_cflags -fno-optimize-sibling-calls ;;
6341 esac
6344 elif enabled ppc; then
6346 enable local_aligned
6348 check_inline_asm dcbzl '"dcbzl 0, %0" :: "r"(0)'
6349 check_inline_asm ibm_asm '"add 0, 0, 0"'
6350 check_inline_asm ppc4xx '"maclhw r10, r11, r12"'
6351 check_inline_asm xform_asm '"lwzx %1, %y0" :: "Z"(*(int*)0), "r"(0)'
6353 if enabled altivec; then
6354 check_cflags -maltivec -mabi=altivec
6356 # check if our compiler supports Motorola AltiVec C API
6357 check_cc altivec altivec.h "vector signed int v1 = (vector signed int) { 0 };
6358 vector signed int v2 = (vector signed int) { 1 };
6359 v1 = vec_add(v1, v2);"
6361 enabled altivec || warn "Altivec disabled, possibly missing --cpu flag"
6364 if enabled vsx; then
6365 check_cflags -mvsx &&
6366 check_cc vsx altivec.h "int v[4] = { 0 };
6367 vector signed int v1 = vec_vsx_ld(0, v);"
6370 if enabled power8; then
6371 check_cpp_condition power8 "altivec.h" "defined(_ARCH_PWR8)"
6374 elif enabled riscv; then
6376 enabled rv && check_inline_asm rv '".option arch, +zbb\nrev8 t0, t1"'
6377 enabled rvv && check_inline_asm rvv '".option arch, +v\nvsetivli zero, 0, e8, m1, ta, ma"'
6379 elif enabled x86; then
6381 check_builtin rdtsc intrin.h "__rdtsc()"
6382 check_builtin mm_empty mmintrin.h "_mm_empty()"
6384 enable local_aligned
6386 # check whether EBP is available on x86
6387 # As 'i' is stored on the stack, this program will crash
6388 # if the base pointer is used to access it because the
6389 # base pointer is cleared in the inline assembly code.
6390 check_exec_crash <<EOF && enable ebp_available
6391 volatile int i=0;
6392 __asm__ volatile ("xorl %%ebp, %%ebp" ::: "%ebp");
6393 return i;
6396 # check whether EBX is available on x86
6397 check_inline_asm ebx_available '""::"b"(0)' &&
6398 check_inline_asm ebx_available '"":::"%ebx"'
6400 # check whether xmm clobbers are supported
6401 check_inline_asm xmm_clobbers '"":::"%xmm0"'
6403 check_inline_asm inline_asm_direct_symbol_refs '"movl '$extern_prefix'test, %eax"' ||
6404 check_inline_asm inline_asm_direct_symbol_refs '"movl '$extern_prefix'test(%rip), %eax"'
6406 # check whether binutils is new enough to compile SSSE3/MMXEXT
6407 enabled ssse3 && check_inline_asm ssse3_inline '"pabsw %xmm0, %xmm0"'
6408 enabled mmxext && check_inline_asm mmxext_inline '"pmaxub %mm0, %mm1"'
6410 probe_x86asm(){
6411 x86asmexe_probe=$1
6412 if test_cmd $x86asmexe_probe -v; then
6413 x86asmexe=$x86asmexe_probe
6414 x86asm_type=nasm
6415 x86asm_debug="-g -F dwarf"
6416 X86ASMDEP=
6417 X86ASM_DEPFLAGS='-MD $(@:.o=.d)'
6418 elif test_cmd $x86asmexe_probe --version; then
6419 x86asmexe=$x86asmexe_probe
6420 x86asm_type=yasm
6421 x86asm_debug="-g dwarf2"
6422 X86ASMDEP='$(DEPX86ASM) $(X86ASMFLAGS) -M $(X86ASM_O) $< > $(@:.o=.d)'
6423 X86ASM_DEPFLAGS=
6425 check_x86asm x86asm "movbe ecx, [5]"
6428 if ! disabled_any asm mmx x86asm; then
6429 disable x86asm
6430 for program in $x86asmexe nasm yasm; do
6431 probe_x86asm $program && break
6432 done
6433 disabled x86asm && die "nasm/yasm not found or too old. Use --disable-x86asm for a crippled build."
6434 X86ASMFLAGS="-f $objformat"
6435 test -n "$extern_prefix" && append X86ASMFLAGS "-DPREFIX"
6436 case "$objformat" in
6437 elf*) enabled debug && append X86ASMFLAGS $x86asm_debug ;;
6438 esac
6440 enabled avx512 && check_x86asm avx512_external "vmovdqa32 [eax]{k1}{z}, zmm0"
6441 enabled avx512icl && check_x86asm avx512icl_external "vpdpwssds zmm31{k1}{z}, zmm29, zmm28"
6442 enabled avx2 && check_x86asm avx2_external "vextracti128 xmm0, ymm0, 0"
6443 enabled xop && check_x86asm xop_external "vpmacsdd xmm0, xmm1, xmm2, xmm3"
6444 enabled fma4 && check_x86asm fma4_external "vfmaddps ymm0, ymm1, ymm2, ymm3"
6447 case "$cpu" in
6448 athlon*|opteron*|k8*|pentium|pentium-mmx|prescott|nocona|atom|geode)
6449 disable fast_clz
6451 esac
6453 elif enabled loongarch; then
6454 enabled lsx && check_inline_asm lsx '"vadd.b $vr0, $vr1, $vr2"' '-mlsx' && append LSXFLAGS '-mlsx'
6455 enabled lasx && check_inline_asm lasx '"xvadd.b $xr0, $xr1, $xr2"' '-mlasx' && append LASXFLAGS '-mlasx'
6458 check_cc intrinsics_neon arm_neon.h "int16x8_t test = vdupq_n_s16(0)"
6460 check_ldflags -Wl,--as-needed
6461 check_ldflags -Wl,-z,noexecstack
6463 if ! disabled network; then
6464 check_func getaddrinfo $network_extralibs
6465 check_func inet_aton $network_extralibs
6467 check_type netdb.h "struct addrinfo"
6468 check_type netinet/in.h "struct group_source_req" -D_BSD_SOURCE
6469 check_type netinet/in.h "struct ip_mreq_source" -D_BSD_SOURCE
6470 check_type netinet/in.h "struct ipv6_mreq" -D_DARWIN_C_SOURCE
6471 check_type poll.h "struct pollfd"
6472 check_type netinet/sctp.h "struct sctp_event_subscribe"
6473 check_struct "sys/socket.h" "struct msghdr" msg_flags
6474 check_struct "sys/types.h sys/socket.h" "struct sockaddr" sa_len
6475 check_type netinet/in.h "struct sockaddr_in6"
6476 check_type "sys/types.h sys/socket.h" "struct sockaddr_storage"
6477 check_type "sys/types.h sys/socket.h" socklen_t
6479 # Prefer arpa/inet.h over winsock2
6480 if check_headers arpa/inet.h ; then
6481 check_func closesocket
6482 elif check_headers winsock2.h ; then
6483 check_func_headers winsock2.h closesocket -lws2 &&
6484 network_extralibs="-lws2" ||
6485 { check_func_headers winsock2.h closesocket -lws2_32 &&
6486 network_extralibs="-lws2_32"; } || disable winsock2_h network
6487 check_func_headers ws2tcpip.h getaddrinfo $network_extralibs
6489 check_type ws2tcpip.h socklen_t
6490 check_type ws2tcpip.h "struct addrinfo"
6491 check_type ws2tcpip.h "struct group_source_req"
6492 check_type ws2tcpip.h "struct ip_mreq_source"
6493 check_type ws2tcpip.h "struct ipv6_mreq"
6494 check_type winsock2.h "struct pollfd"
6495 check_struct winsock2.h "struct sockaddr" sa_len
6496 check_type ws2tcpip.h "struct sockaddr_in6"
6497 check_type ws2tcpip.h "struct sockaddr_storage"
6498 else
6499 disable network
6503 check_builtin atomic_cas_ptr atomic.h "void **ptr; void *oldval, *newval; atomic_cas_ptr(ptr, oldval, newval)"
6504 check_builtin machine_rw_barrier mbarrier.h "__machine_rw_barrier()"
6505 check_builtin MemoryBarrier windows.h "MemoryBarrier()"
6506 check_builtin sync_val_compare_and_swap "" "int *ptr; int oldval, newval; __sync_val_compare_and_swap(ptr, oldval, newval)"
6507 check_builtin gmtime_r time.h "time_t *time; struct tm *tm; gmtime_r(time, tm)"
6508 check_builtin localtime_r time.h "time_t *time; struct tm *tm; localtime_r(time, tm)"
6510 check_builtin float16 "" "_Float16 f16var"
6511 if enabled float16; then
6512 if enabled x86; then
6513 test_cpp_condition stddef.h "defined(__F16C__)" && enable fast_float16
6514 elif enabled arm || enabled aarch64; then
6515 enable fast_float16
6519 case "$custom_allocator" in
6522 jemalloc)
6523 test -n "$malloc_prefix" ||
6524 malloc_prefix=$($pkg_config --variable=jemalloc_prefix $pkg_config_flags jemalloc 2>/dev/null)
6525 require_pkg_config custom_allocator jemalloc jemalloc/jemalloc.h ${malloc_prefix}malloc
6527 tcmalloc)
6528 require_pkg_config custom_allocator libtcmalloc gperftools/tcmalloc.h tc_malloc
6529 malloc_prefix=tc_
6532 require_pkg_config custom_allocator "$custom_allocator" stdlib.h malloc
6534 esac
6536 if test -n "$custom_allocator"; then
6537 add_extralibs "$custom_allocator_extralibs"
6540 check_func_headers malloc.h _aligned_malloc && enable aligned_malloc
6541 check_func ${malloc_prefix}memalign && enable memalign
6542 check_func ${malloc_prefix}posix_memalign && enable posix_memalign
6544 check_func access
6545 check_func_headers stdlib.h arc4random_buf
6546 check_lib clock_gettime time.h clock_gettime || check_lib clock_gettime time.h clock_gettime -lrt
6547 check_func fcntl
6548 check_func fork
6549 check_func gethrtime
6550 check_func getopt
6551 check_func getrusage
6552 check_func gettimeofday
6553 check_func isatty
6554 check_func mkstemp
6555 check_func mmap
6556 check_func mprotect
6557 # Solaris has nanosleep in -lrt, OpenSolaris no longer needs that
6558 check_func_headers time.h nanosleep || check_lib nanosleep time.h nanosleep -lrt
6559 check_func_headers sys/prctl.h prctl
6560 check_func sched_getaffinity
6561 check_func setrlimit
6562 check_struct "sys/stat.h" "struct stat" st_mtim.tv_nsec -D_BSD_SOURCE
6563 check_func strerror_r
6564 check_func sysconf
6565 check_func sysctl
6566 check_func usleep
6568 check_func_headers conio.h kbhit
6569 check_func_headers io.h setmode
6570 check_func_headers lzo/lzo1x.h lzo1x_999_compress
6571 check_func_headers mach/mach_time.h mach_absolute_time
6572 check_func_headers stdlib.h getenv
6573 check_func_headers sys/stat.h lstat
6574 check_func_headers sys/auxv.h getauxval
6575 check_func_headers sys/sysctl.h sysctlbyname
6577 check_func_headers windows.h GetModuleHandle
6578 check_func_headers windows.h GetProcessAffinityMask
6579 check_func_headers windows.h GetProcessTimes
6580 check_func_headers windows.h GetStdHandle
6581 check_func_headers windows.h GetSystemTimeAsFileTime
6582 check_func_headers windows.h LoadLibrary
6583 check_func_headers windows.h MapViewOfFile
6584 check_func_headers windows.h PeekNamedPipe
6585 check_func_headers windows.h SetConsoleTextAttribute
6586 check_func_headers windows.h SetConsoleCtrlHandler
6587 check_func_headers windows.h SetDllDirectory
6588 check_func_headers windows.h Sleep
6589 check_func_headers windows.h VirtualAlloc
6590 check_func_headers glob.h glob
6592 if enabled xlib; then
6593 check_pkg_config xlib_x11 x11 "X11/Xlib.h" XPending ||
6594 check_lib xlib_x11 "X11/Xlib.h" XPending -lX11 ||
6595 disable xlib
6597 check_pkg_config xlib_xext xext "X11/Xlib.h X11/extensions/XShm.h" XShmAttach ||
6598 check_lib xlib_xext "X11/Xlib.h X11/extensions/XShm.h" XShmAttach -lXext ||
6599 disable xlib
6601 check_pkg_config xlib_xv xv "X11/Xlib.h X11/extensions/Xvlib.h" XvGetPortAttribute ||
6602 check_lib xlib_xv "X11/Xlib.h X11/extensions/Xvlib.h" XvGetPortAttribute -lXv ||
6603 disable xlib
6606 check_headers direct.h
6607 check_headers dirent.h
6608 check_headers dxgidebug.h
6609 check_headers dxva.h
6610 check_headers dxva2api.h -D_WIN32_WINNT=0x0600
6611 check_headers io.h
6612 enabled libdrm &&
6613 check_headers linux/dma-buf.h
6615 check_headers linux/perf_event.h
6616 check_headers malloc.h
6617 check_headers mftransform.h
6618 check_headers net/udplite.h
6619 check_headers poll.h
6620 check_headers pthread_np.h
6621 check_headers sys/param.h
6622 check_headers sys/resource.h
6623 check_headers sys/select.h
6624 check_headers sys/time.h
6625 check_headers sys/un.h
6626 check_headers termios.h
6627 check_headers unistd.h
6628 check_headers valgrind/valgrind.h
6629 check_func_headers VideoToolbox/VTCompressionSession.h VTCompressionSessionPrepareToEncodeFrames -framework VideoToolbox
6630 check_func_headers VideoToolbox/VideoToolbox.h VTPixelTransferSessionCreate -framework VideoToolbox
6631 check_func_headers VideoToolbox/VideoToolbox.h VTPixelRotationSessionCreate -framework VideoToolbox
6632 check_headers windows.h
6633 check_headers asm/types.h
6635 # it seems there are versions of clang in some distros that try to use the
6636 # gcc headers, which explodes for stdatomic
6637 # so we also check that atomics actually work here
6639 # some configurations also require linking to libatomic, so try
6640 # both with -latomic and without
6641 for LATOMIC in "-latomic" ""; do
6642 check_builtin stdatomic stdatomic.h \
6643 "atomic_int foo, bar = -1; atomic_store(&foo, 0); foo += bar" \
6644 $LATOMIC && eval stdatomic_extralibs="\$LATOMIC" && break
6645 done
6647 check_lib advapi32 "windows.h" RegCloseKey -ladvapi32
6648 check_lib bcrypt "windows.h bcrypt.h" BCryptGenRandom -lbcrypt &&
6649 check_cpp_condition bcrypt bcrypt.h "defined BCRYPT_RNG_ALGORITHM"
6650 check_lib ole32 "windows.h objbase.h" CoTaskMemFree -lole32
6651 check_lib shell32 "windows.h shellapi.h" CommandLineToArgvW -lshell32
6652 check_lib psapi "windows.h psapi.h" GetProcessMemoryInfo -lpsapi
6654 check_lib android android/native_window.h ANativeWindow_acquire -landroid
6655 check_lib mediandk "stdint.h media/NdkMediaFormat.h" AMediaFormat_new -lmediandk
6656 check_lib camera2ndk "stdbool.h stdint.h camera/NdkCameraManager.h" ACameraManager_create -lcamera2ndk
6658 enabled appkit && check_apple_framework AppKit
6659 enabled audiotoolbox && check_apple_framework AudioToolbox
6660 enabled avfoundation && check_apple_framework AVFoundation
6661 enabled coreimage && check_apple_framework CoreImage
6662 enabled metal && check_apple_framework Metal
6663 enabled videotoolbox && check_apple_framework VideoToolbox
6665 check_apple_framework CoreFoundation
6666 check_apple_framework CoreMedia
6667 check_apple_framework CoreVideo
6668 check_apple_framework CoreAudio
6670 enabled avfoundation && {
6671 disable coregraphics applicationservices
6672 check_lib coregraphics CoreGraphics/CoreGraphics.h CGGetActiveDisplayList "-framework CoreGraphics" ||
6673 check_lib applicationservices ApplicationServices/ApplicationServices.h CGGetActiveDisplayList "-framework ApplicationServices"; }
6675 enabled videotoolbox && {
6676 check_lib coreservices CoreServices/CoreServices.h UTGetOSTypeFromString "-framework CoreServices"
6677 check_func_headers CoreMedia/CMFormatDescription.h kCMVideoCodecType_HEVC "-framework CoreMedia"
6678 check_func_headers CoreMedia/CMFormatDescription.h kCMVideoCodecType_HEVCWithAlpha "-framework CoreMedia"
6679 check_func_headers CoreMedia/CMFormatDescription.h kCMVideoCodecType_VP9 "-framework CoreMedia"
6680 check_func_headers CoreVideo/CVPixelBuffer.h kCVPixelFormatType_420YpCbCr10BiPlanarVideoRange "-framework CoreVideo"
6681 check_func_headers CoreVideo/CVPixelBuffer.h kCVPixelFormatType_422YpCbCr8BiPlanarVideoRange "-framework CoreVideo"
6682 check_func_headers CoreVideo/CVPixelBuffer.h kCVPixelFormatType_422YpCbCr10BiPlanarVideoRange "-framework CoreVideo"
6683 check_func_headers CoreVideo/CVPixelBuffer.h kCVPixelFormatType_422YpCbCr16BiPlanarVideoRange "-framework CoreVideo"
6684 check_func_headers CoreVideo/CVPixelBuffer.h kCVPixelFormatType_444YpCbCr8BiPlanarVideoRange "-framework CoreVideo"
6685 check_func_headers CoreVideo/CVPixelBuffer.h kCVPixelFormatType_444YpCbCr10BiPlanarVideoRange "-framework CoreVideo"
6686 check_func_headers CoreVideo/CVPixelBuffer.h kCVPixelFormatType_444YpCbCr16BiPlanarVideoRange "-framework CoreVideo"
6687 check_func_headers CoreVideo/CVImageBuffer.h kCVImageBufferTransferFunction_SMPTE_ST_2084_PQ "-framework CoreVideo"
6688 check_func_headers CoreVideo/CVImageBuffer.h kCVImageBufferTransferFunction_ITU_R_2100_HLG "-framework CoreVideo"
6689 check_func_headers CoreVideo/CVImageBuffer.h kCVImageBufferTransferFunction_Linear "-framework CoreVideo"
6690 check_func_headers CoreVideo/CVImageBuffer.h kCVImageBufferYCbCrMatrix_ITU_R_2020 "-framework CoreVideo"
6691 check_func_headers CoreVideo/CVImageBuffer.h kCVImageBufferColorPrimaries_ITU_R_2020 "-framework CoreVideo"
6692 check_func_headers CoreVideo/CVImageBuffer.h kCVImageBufferTransferFunction_ITU_R_2020 "-framework CoreVideo"
6693 check_func_headers CoreVideo/CVImageBuffer.h kCVImageBufferTransferFunction_SMPTE_ST_428_1 "-framework CoreVideo"
6696 enabled metal && test_cmd $metalcc -v || disable metal
6698 check_struct "sys/time.h sys/resource.h" "struct rusage" ru_maxrss
6700 check_type "windows.h dxva.h" "DXVA_PicParams_AV1" -DWINAPI_FAMILY=WINAPI_FAMILY_DESKTOP_APP -D_CRT_BUILD_DESKTOP_APP=0
6701 check_type "windows.h dxva.h" "DXVA_PicParams_HEVC" -DWINAPI_FAMILY=WINAPI_FAMILY_DESKTOP_APP -D_CRT_BUILD_DESKTOP_APP=0
6702 check_type "windows.h dxva.h" "DXVA_PicParams_VP9" -DWINAPI_FAMILY=WINAPI_FAMILY_DESKTOP_APP -D_CRT_BUILD_DESKTOP_APP=0
6703 check_type "windows.h dxgi1_2.h" "DXGI_OUTDUPL_FRAME_INFO"
6704 check_type "windows.h dxgi1_2.h" "IDXGIOutput1"
6705 check_type "windows.h dxgi1_5.h" "IDXGIOutput5"
6706 check_type "windows.h d3d11.h" "ID3D11VideoDecoder"
6707 check_type "windows.h d3d11.h" "ID3D11VideoContext"
6708 check_type "windows.h d3d12.h" "ID3D12Device"
6709 check_type "windows.h d3d12video.h" "ID3D12VideoDecoder"
6710 check_type "windows.h" "DPI_AWARENESS_CONTEXT" -D_WIN32_WINNT=0x0A00
6711 check_type "d3d9.h dxva2api.h" DXVA2_ConfigPictureDecode -D_WIN32_WINNT=0x0602
6712 check_func_headers mfapi.h MFCreateAlignedMemoryBuffer -lmfplat
6714 check_type "vdpau/vdpau.h" "VdpPictureInfoHEVC"
6715 check_type "vdpau/vdpau.h" "VdpPictureInfoVP9"
6716 check_type "vdpau/vdpau.h" "VdpPictureInfoAV1"
6718 if [ -z "$nvccflags" ]; then
6719 nvccflags=$nvccflags_default
6722 nvccflags="$nvccflags -std=c++11"
6724 if enabled x86_64 || enabled ppc64 || enabled aarch64; then
6725 nvccflags="$nvccflags -m64"
6726 else
6727 nvccflags="$nvccflags -m32"
6730 if enabled cuda_nvcc; then
6731 nvccflags="$nvccflags -ptx"
6732 else
6733 nvccflags="$nvccflags -S -nocudalib -nocudainc --cuda-device-only -Wno-c++11-narrowing -include ${source_link}/compat/cuda/cuda_runtime.h"
6734 check_nvcc cuda_llvm
6737 if ! disabled ffnvcodec; then
6738 ffnv_hdr_list="ffnvcodec/nvEncodeAPI.h ffnvcodec/dynlink_cuda.h ffnvcodec/dynlink_cuviddec.h ffnvcodec/dynlink_nvcuvid.h"
6739 check_pkg_config ffnvcodec "ffnvcodec >= 12.1.14.0" "$ffnv_hdr_list" "" || \
6740 check_pkg_config ffnvcodec "ffnvcodec >= 12.0.16.1 ffnvcodec < 12.1" "$ffnv_hdr_list" "" || \
6741 check_pkg_config ffnvcodec "ffnvcodec >= 11.1.5.3 ffnvcodec < 12.0" "$ffnv_hdr_list" "" || \
6742 check_pkg_config ffnvcodec "ffnvcodec >= 11.0.10.3 ffnvcodec < 11.1" "$ffnv_hdr_list" "" || \
6743 check_pkg_config ffnvcodec "ffnvcodec >= 8.1.24.15 ffnvcodec < 8.2" "$ffnv_hdr_list" ""
6746 if enabled_all libglslang libshaderc; then
6747 die "ERROR: libshaderc and libglslang are mutually exclusive, if in doubt, disable libglslang"
6750 check_cpp_condition winrt windows.h "!WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)"
6752 if ! disabled w32threads && ! enabled pthreads; then
6753 check_func_headers "windows.h process.h" _beginthreadex &&
6754 check_type "windows.h" CONDITION_VARIABLE &&
6755 check_type "windows.h" INIT_ONCE &&
6756 enable w32threads || disable w32threads
6757 if ! enabled w32threads && enabled winrt; then
6758 check_func_headers "windows.h" CreateThread &&
6759 enable w32threads || disable w32threads
6763 # check for some common methods of building with pthread support
6764 # do this before the optional library checks as some of them require pthreads
6765 if ! disabled pthreads && ! enabled w32threads && ! enabled os2threads; then
6766 if check_lib pthreads pthread.h pthread_join -pthread &&
6767 check_lib pthreads pthread.h pthread_create -pthread; then
6768 add_cflags -pthread
6769 elif check_lib pthreads pthread.h pthread_join -pthreads &&
6770 check_lib pthreads pthread.h pthread_create -pthreads; then
6771 add_cflags -pthreads
6772 elif check_lib pthreads pthread.h pthread_join -ldl -pthread &&
6773 check_lib pthreads pthread.h pthread_create -ldl -pthread; then
6774 add_cflags -ldl -pthread
6775 elif check_lib pthreads pthread.h pthread_join -lpthreadGC2 &&
6776 check_lib pthreads pthread.h pthread_create -lpthreadGC2; then
6778 elif check_lib pthreads pthread.h pthread_join -lpthread &&
6779 check_lib pthreads pthread.h pthread_create -lpthread; then
6781 elif check_func pthread_join && check_func pthread_create; then
6782 enable pthreads
6784 check_cc pthreads "pthread.h" "static pthread_mutex_t atomic_lock = PTHREAD_MUTEX_INITIALIZER"
6786 if enabled pthreads; then
6787 check_builtin sem_timedwait semaphore.h "sem_t *s; sem_init(s,0,0); sem_timedwait(s,0); sem_destroy(s)" $pthreads_extralibs
6788 check_func pthread_cancel $pthreads_extralibs
6789 hdrs=pthread.h
6790 if enabled pthread_np_h; then
6791 hdrs="$hdrs pthread_np.h"
6793 check_lib pthread_set_name_np "$hdrs" pthread_set_name_np -lpthread
6794 check_lib pthread_setname_np "$hdrs" pthread_setname_np -lpthread
6798 enabled zlib && { check_pkg_config zlib zlib "zlib.h" zlibVersion ||
6799 check_lib zlib zlib.h zlibVersion -lz; }
6800 enabled bzlib && check_lib bzlib bzlib.h BZ2_bzlibVersion -lbz2
6801 enabled lzma && check_lib lzma lzma.h lzma_version_number -llzma
6803 enabled zlib && test_exec $zlib_extralibs <<EOF && enable zlib_gzip
6804 #include <zlib.h>
6805 int main(void) {
6806 if (zlibCompileFlags() & (1 << 17)) return 1;
6807 return 0;
6811 [ -x "$(command -v gzip)" ] && enable gzip
6813 enabled zlib_gzip && enabled gzip || disable ptx_compression
6815 # On some systems dynamic loading requires no extra linker flags
6816 check_lib libdl dlfcn.h "dlopen dlsym" || check_lib libdl dlfcn.h "dlopen dlsym" -ldl
6818 check_lib libm math.h sin -lm
6820 atan2f_args=2
6821 copysign_args=2
6822 hypot_args=2
6823 ldexpf_args=2
6824 powf_args=2
6826 for func in $MATH_FUNCS; do
6827 eval check_mathfunc $func \${${func}_args:-1} $libm_extralibs
6828 done
6830 # these are off by default, so fail if requested and not available
6831 enabled avisynth && { require_headers "avisynth/avisynth_c.h avisynth/avs/version.h" &&
6832 { 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" ||
6833 die "ERROR: AviSynth+ header version must be >= 3.7.3"; } }
6834 enabled cuda_nvcc && { check_nvcc cuda_nvcc || die "ERROR: failed checking for nvcc."; }
6835 enabled chromaprint && { check_pkg_config chromaprint libchromaprint "chromaprint.h" chromaprint_get_version ||
6836 require chromaprint chromaprint.h chromaprint_get_version -lchromaprint; }
6837 enabled decklink && { require_headers DeckLinkAPI.h &&
6838 { test_cpp_condition DeckLinkAPIVersion.h "BLACKMAGIC_DECKLINK_API_VERSION >= 0x0a0b0000" || die "ERROR: Decklink API version must be >= 10.11"; } }
6839 enabled frei0r && require_headers "frei0r.h"
6840 enabled gmp && require gmp gmp.h mpz_export -lgmp
6841 enabled gnutls && require_pkg_config gnutls gnutls gnutls/gnutls.h gnutls_global_init
6842 enabled jni && { [ $target_os = "android" ] && check_headers jni.h && enabled pthreads || die "ERROR: jni not found"; }
6843 enabled ladspa && require_headers "ladspa.h dlfcn.h"
6844 enabled lcms2 && require_pkg_config lcms2 "lcms2 >= 2.13" lcms2.h cmsCreateContext
6845 enabled libaom && require_pkg_config libaom "aom >= 2.0.0" aom/aom_codec.h aom_codec_version
6846 enabled libaribb24 && { check_pkg_config libaribb24 "aribb24 > 1.0.3" "aribb24/aribb24.h" arib_instance_new ||
6847 { enabled gpl && require_pkg_config libaribb24 aribb24 "aribb24/aribb24.h" arib_instance_new; } ||
6848 die "ERROR: libaribb24 requires version higher than 1.0.3 or --enable-gpl."; }
6849 enabled libaribcaption && require_pkg_config libaribcaption "libaribcaption >= 1.1.1" "aribcaption/aribcaption.h" aribcc_context_alloc
6850 enabled lv2 && require_pkg_config lv2 lilv-0 "lilv/lilv.h" lilv_world_new
6851 enabled libiec61883 && require libiec61883 libiec61883/iec61883.h iec61883_cmp_connect -lraw1394 -lavc1394 -lrom1394 -liec61883
6852 enabled libass && require_pkg_config libass "libass >= 0.11.0" ass/ass.h ass_library_init
6853 enabled libbluray && require_pkg_config libbluray libbluray libbluray/bluray.h bd_open
6854 enabled libbs2b && require_pkg_config libbs2b libbs2b bs2b.h bs2b_open
6855 enabled libcelt && require libcelt celt/celt.h celt_decode -lcelt0 &&
6856 { check_lib libcelt celt/celt.h celt_decoder_create_custom -lcelt0 ||
6857 die "ERROR: libcelt must be installed and version must be >= 0.11.0."; }
6858 enabled libcaca && require_pkg_config libcaca caca caca.h caca_create_canvas
6859 enabled libcodec2 && require libcodec2 codec2/codec2.h codec2_create -lcodec2
6860 enabled libdav1d && require_pkg_config libdav1d "dav1d >= 0.5.0" "dav1d/dav1d.h" dav1d_version
6861 enabled libdavs2 && require_pkg_config libdavs2 "davs2 >= 1.6.0" davs2.h davs2_decoder_open
6862 enabled libdc1394 && require_pkg_config libdc1394 libdc1394-2 dc1394/dc1394.h dc1394_new
6863 enabled libdrm && check_pkg_config libdrm libdrm xf86drm.h drmGetVersion
6864 enabled libdvdnav && require_pkg_config libdvdnav "dvdnav >= 6.1.1" dvdnav/dvdnav.h dvdnav_open2
6865 enabled libdvdread && require_pkg_config libdvdread "dvdread >= 6.1.2" dvdread/dvd_reader.h DVDOpen2
6866 enabled libfdk_aac && { check_pkg_config libfdk_aac fdk-aac "fdk-aac/aacenc_lib.h" aacEncOpen ||
6867 { require libfdk_aac fdk-aac/aacenc_lib.h aacEncOpen -lfdk-aac &&
6868 warn "using libfdk without pkg-config"; } }
6869 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"
6870 enabled libflite && require libflite "flite/flite.h" flite_init $flite_extralibs
6871 enabled fontconfig && enable libfontconfig
6872 enabled libfontconfig && require_pkg_config libfontconfig fontconfig "fontconfig/fontconfig.h" FcInit
6873 enabled libfreetype && require_pkg_config libfreetype freetype2 "ft2build.h FT_FREETYPE_H" FT_Init_FreeType
6874 enabled libfribidi && require_pkg_config libfribidi fribidi fribidi.h fribidi_version_info
6875 enabled libharfbuzz && require_pkg_config libharfbuzz harfbuzz hb.h hb_buffer_create
6876 enabled libglslang && { check_lib spirv_compiler glslang/Include/glslang_c_interface.h glslang_initialize_process \
6877 -lglslang -lMachineIndependent -lGenericCodeGen \
6878 -lSPVRemapper -lSPIRV -lSPIRV-Tools-opt -lSPIRV-Tools -lpthread -lstdc++ -lm ||
6879 require spirv_compiler glslang/Include/glslang_c_interface.h glslang_initialize_process \
6880 -lglslang -lMachineIndependent -lOSDependent -lHLSL -lOGLCompiler -lGenericCodeGen \
6881 -lSPVRemapper -lSPIRV -lSPIRV-Tools-opt -lSPIRV-Tools -lpthread -lstdc++ -lm ; }
6882 enabled libgme && { check_pkg_config libgme libgme gme/gme.h gme_new_emu ||
6883 require libgme gme/gme.h gme_new_emu -lgme -lstdc++; }
6884 enabled libgsm && { for gsm_hdr in "gsm.h" "gsm/gsm.h"; do
6885 check_lib libgsm "${gsm_hdr}" gsm_create -lgsm && break;
6886 done || die "ERROR: libgsm not found"; }
6887 enabled libilbc && require libilbc ilbc.h WebRtcIlbcfix_InitDecode -lilbc $pthreads_extralibs
6888 enabled libjxl && require_pkg_config libjxl "libjxl >= 0.7.0" jxl/decode.h JxlDecoderVersion &&
6889 require_pkg_config libjxl_threads "libjxl_threads >= 0.7.0" jxl/thread_parallel_runner.h JxlThreadParallelRunner
6890 enabled libklvanc && require libklvanc libklvanc/vanc.h klvanc_context_create -lklvanc
6891 enabled libkvazaar && require_pkg_config libkvazaar "kvazaar >= 2.0.0" kvazaar.h kvz_api_get
6892 enabled liblc3 && require_pkg_config liblc3 "lc3 >= 1.1.0" lc3.h lc3_hr_setup_encoder
6893 enabled liblensfun && require_pkg_config liblensfun lensfun lensfun.h lf_db_create
6895 if enabled libmfx && enabled libvpl; then
6896 die "ERROR: can not use libmfx and libvpl together"
6897 # While it may appear that require is being used as a pkg-config
6898 # fallback for libmfx, it is actually being used to detect a different
6899 # installation route altogether. If libmfx is installed via the Intel
6900 # Media SDK or Intel Media Server Studio, these don't come with
6901 # pkg-config support. Instead, users should make sure that the build
6902 # can find the libraries and headers through other means.
6903 elif enabled libmfx; then
6904 { check_pkg_config libmfx "libmfx >= 1.28 libmfx < 2.0" "mfxvideo.h" MFXInit ||
6905 # Some old versions of libmfx have the following settings in libmfx.pc:
6906 # includedir=/usr/include
6907 # Cflags: -I${includedir}
6908 # So add -I${includedir}/mfx to CFLAGS
6909 { check_pkg_config libmfx "libmfx >= 1.28 libmfx < 2.0" "mfx/mfxvideo.h" MFXInit && add_cflags -I${libmfx_incdir}/mfx; } ||
6910 { require libmfx "mfxvideo.h mfxdefs.h" MFXInit "-llibmfx $advapi32_extralibs" &&
6911 { test_cpp_condition mfxdefs.h "MFX_VERSION >= 1028 && MFX_VERSION < 2000" || die "ERROR: libmfx version must be >= 1.28 and < 2.0"; } &&
6912 warn "using libmfx without pkg-config"; } } &&
6913 warn "libmfx is deprecated. Please run configure with --enable-libvpl to use libvpl instead."
6914 elif enabled libvpl; then
6915 # Consider pkg-config only. The name of libmfx is still passed to check_pkg_config function for --enable-libvpl option
6916 # because QSV has dependency on libmfx, we can use the same dependency if using libmfx in this check. The package name
6917 # is extracted from "vpl >= 2.6"
6918 check_pkg_config libmfx "vpl >= 2.6" "mfxvideo.h mfxdispatcher.h" MFXLoad || \
6919 die "ERROR: libvpl >= 2.6 not found"
6920 add_cflags -DMFX_DEPRECATED_OFF
6923 if enabled libmfx; then
6924 check_cc MFX_CODEC_VP9 "mfxdefs.h mfxstructures.h" "MFX_CODEC_VP9"
6927 enabled libmodplug && require_pkg_config libmodplug libmodplug libmodplug/modplug.h ModPlug_Load
6928 enabled libmp3lame && require "libmp3lame >= 3.98.3" lame/lame.h lame_set_VBR_quality -lmp3lame $libm_extralibs
6929 enabled libmysofa && { check_pkg_config libmysofa libmysofa mysofa.h mysofa_neighborhood_init_withstepdefine ||
6930 require libmysofa mysofa.h mysofa_neighborhood_init_withstepdefine -lmysofa $zlib_extralibs; }
6931 enabled libnpp && { check_lib libnpp npp.h nppGetLibVersion -lnppig -lnppicc -lnppc -lnppidei -lnppif ||
6932 check_lib libnpp npp.h nppGetLibVersion -lnppi -lnppif -lnppc -lnppidei ||
6933 die "ERROR: libnpp not found"; }
6934 enabled libopencore_amrnb && require libopencore_amrnb opencore-amrnb/interf_dec.h Decoder_Interface_init -lopencore-amrnb
6935 enabled libopencore_amrwb && require libopencore_amrwb opencore-amrwb/dec_if.h D_IF_init -lopencore-amrwb
6936 enabled libopencv && { check_headers opencv2/core/core_c.h &&
6937 { check_pkg_config libopencv opencv opencv2/core/core_c.h cvCreateImageHeader ||
6938 require libopencv opencv2/core/core_c.h cvCreateImageHeader -lopencv_core -lopencv_imgproc; } ||
6939 require_pkg_config libopencv opencv opencv/cxcore.h cvCreateImageHeader; }
6940 enabled libopenh264 && require_pkg_config libopenh264 "openh264 >= 1.3.0" wels/codec_api.h WelsGetCodecVersion
6941 enabled libopenjpeg && { check_pkg_config libopenjpeg "libopenjp2 >= 2.1.0" openjpeg.h opj_version ||
6942 { require_pkg_config libopenjpeg "libopenjp2 >= 2.1.0" openjpeg.h opj_version -DOPJ_STATIC && add_cppflags -DOPJ_STATIC; } }
6943 enabled libopenmpt && require_pkg_config libopenmpt "libopenmpt >= 0.2.6557" libopenmpt/libopenmpt.h openmpt_module_create -lstdc++ && append libopenmpt_extralibs "-lstdc++"
6944 enabled libopenvino && { { check_pkg_config libopenvino openvino openvino/c/openvino.h ov_core_create && enable openvino2; } ||
6945 { check_pkg_config libopenvino openvino c_api/ie_c_api.h ie_c_api_version ||
6946 require libopenvino c_api/ie_c_api.h ie_c_api_version -linference_engine_c_api; } }
6947 enabled libopus && {
6948 enabled libopus_decoder && {
6949 require_pkg_config libopus opus opus_multistream.h opus_multistream_decoder_create
6951 enabled libopus_encoder && {
6952 require_pkg_config libopus opus opus_multistream.h opus_multistream_surround_encoder_create
6955 enabled libplacebo && require_pkg_config libplacebo "libplacebo >= 4.192.0" libplacebo/vulkan.h pl_vulkan_create
6956 enabled libpulse && require_pkg_config libpulse libpulse pulse/pulseaudio.h pa_context_new
6957 enabled libqrencode && require_pkg_config libqrencode libqrencode qrencode.h QRcode_encodeString
6958 enabled libquirc && require libquirc quirc.h quirc_decode -lquirc
6959 enabled librabbitmq && require_pkg_config librabbitmq "librabbitmq >= 0.7.1" amqp.h amqp_new_connection
6960 enabled librav1e && require_pkg_config librav1e "rav1e >= 0.5.0" rav1e.h rav1e_context_new
6961 enabled librist && require_pkg_config librist "librist >= 0.2.7" librist/librist.h rist_receiver_create
6962 enabled librsvg && require_pkg_config librsvg librsvg-2.0 librsvg-2.0/librsvg/rsvg.h rsvg_handle_new_from_data
6963 enabled librtmp && require_pkg_config librtmp librtmp librtmp/rtmp.h RTMP_Socket
6964 enabled librubberband && require_pkg_config librubberband "rubberband >= 1.8.1" rubberband/rubberband-c.h rubberband_new -lstdc++ && append librubberband_extralibs "-lstdc++"
6965 enabled libshaderc && require_pkg_config spirv_compiler "shaderc >= 2019.1" shaderc/shaderc.h shaderc_compiler_initialize
6966 enabled libshine && require_pkg_config libshine shine shine/layer3.h shine_encode_buffer
6967 enabled libsmbclient && { check_pkg_config libsmbclient smbclient libsmbclient.h smbc_init ||
6968 require libsmbclient libsmbclient.h smbc_init -lsmbclient; }
6969 enabled libsnappy && require libsnappy snappy-c.h snappy_compress -lsnappy -lstdc++
6970 enabled libsoxr && require libsoxr soxr.h soxr_create -lsoxr
6971 enabled libssh && require_pkg_config libssh "libssh >= 0.6.0" libssh/sftp.h sftp_init
6972 enabled libspeex && require_pkg_config libspeex speex speex/speex.h speex_decoder_init
6973 enabled libsrt && require_pkg_config libsrt "srt >= 1.3.0" srt/srt.h srt_socket
6974 enabled libsvtav1 && require_pkg_config libsvtav1 "SvtAv1Enc >= 0.9.0" EbSvtAv1Enc.h svt_av1_enc_init_handle
6975 enabled libtensorflow && require libtensorflow tensorflow/c/c_api.h TF_Version -ltensorflow
6976 enabled libtesseract && require_pkg_config libtesseract tesseract tesseract/capi.h TessBaseAPICreate
6977 enabled libtheora && require libtheora theora/theoraenc.h th_info_init -ltheoraenc -ltheoradec -logg
6978 enabled libtls && require_pkg_config libtls libtls tls.h tls_configure
6979 enabled libtorch && check_cxxflags -std=c++17 && require_cpp libtorch torch/torch.h "torch::Tensor" -ltorch -lc10 -ltorch_cpu -lstdc++ -lpthread
6980 enabled libtwolame && require libtwolame twolame.h twolame_init -ltwolame &&
6981 { check_lib libtwolame twolame.h twolame_encode_buffer_float32_interleaved -ltwolame ||
6982 die "ERROR: libtwolame must be installed and version must be >= 0.3.10"; }
6983 enabled libuavs3d && require_pkg_config libuavs3d "uavs3d >= 1.1.41" uavs3d.h uavs3d_decode
6984 enabled libv4l2 && require_pkg_config libv4l2 libv4l2 libv4l2.h v4l2_ioctl
6985 enabled libvidstab && require_pkg_config libvidstab "vidstab >= 0.98" vid.stab/libvidstab.h vsMotionDetectInit
6986 enabled libvmaf && require_pkg_config libvmaf "libvmaf >= 2.0.0" libvmaf.h vmaf_init
6987 enabled libvmaf && check_pkg_config libvmaf_cuda "libvmaf >= 2.0.0" libvmaf_cuda.h vmaf_cuda_state_init
6988 enabled libvo_amrwbenc && require libvo_amrwbenc vo-amrwbenc/enc_if.h E_IF_init -lvo-amrwbenc
6989 enabled libvorbis && require_pkg_config libvorbis vorbis vorbis/codec.h vorbis_info_init &&
6990 require_pkg_config libvorbisenc vorbisenc vorbis/vorbisenc.h vorbis_encode_init
6992 enabled libvpx && {
6993 enabled libvpx_vp8_decoder && {
6994 check_pkg_config libvpx_vp8_decoder "vpx >= 1.4.0" "vpx/vpx_decoder.h vpx/vp8dx.h" vpx_codec_vp8_dx ||
6995 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"
6997 enabled libvpx_vp8_encoder && {
6998 check_pkg_config libvpx_vp8_encoder "vpx >= 1.4.0" "vpx/vpx_encoder.h vpx/vp8cx.h" vpx_codec_vp8_cx ||
6999 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"
7001 enabled libvpx_vp9_decoder && {
7002 check_pkg_config libvpx_vp9_decoder "vpx >= 1.4.0" "vpx/vpx_decoder.h vpx/vp8dx.h" vpx_codec_vp9_dx ||
7003 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"
7005 enabled libvpx_vp9_encoder && {
7006 check_pkg_config libvpx_vp9_encoder "vpx >= 1.4.0" "vpx/vpx_encoder.h vpx/vp8cx.h" vpx_codec_vp9_cx ||
7007 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"
7009 if disabled_all libvpx_vp8_decoder libvpx_vp9_decoder libvpx_vp8_encoder libvpx_vp9_encoder; then
7010 die "libvpx enabled but no supported decoders found"
7014 enabled libwebp && {
7015 enabled libwebp_encoder && require_pkg_config libwebp "libwebp >= 0.2.0" webp/encode.h WebPGetEncoderVersion
7016 enabled libwebp_anim_encoder && check_pkg_config libwebp_anim_encoder "libwebpmux >= 0.4.0" webp/mux.h WebPAnimEncoderOptionsInit; }
7017 enabled libx264 && require_pkg_config libx264 x264 "stdint.h x264.h" x264_encoder_encode &&
7018 require_cpp_condition libx264 x264.h "X264_BUILD >= 155" && {
7019 [ "$toolchain" != "msvc" ] ||
7020 require_cpp_condition libx264 x264.h "X264_BUILD >= 158"; } &&
7021 check_cpp_condition libx264_hdr10 x264.h "X264_BUILD >= 163" &&
7022 check_cpp_condition libx262 x264.h "X264_MPEG2"
7023 enabled libx265 && require_pkg_config libx265 x265 x265.h x265_api_get &&
7024 require_cpp_condition libx265 x265.h "X265_BUILD >= 89"
7025 enabled libxavs && require libxavs "stdint.h xavs.h" xavs_encoder_encode "-lxavs $pthreads_extralibs $libm_extralibs"
7026 enabled libxavs2 && require_pkg_config libxavs2 "xavs2 >= 1.3.0" "stdint.h xavs2.h" xavs2_api_get
7027 enabled libxevd && require_pkg_config libxevd "xevd >= 0.4.1" "xevd.h" xevd_decode
7028 enabled libxeve && require_pkg_config libxeve "xeve >= 0.4.3" "xeve.h" xeve_encode
7029 enabled libxvid && require libxvid xvid.h xvid_global -lxvidcore
7030 enabled libzimg && require_pkg_config libzimg "zimg >= 2.7.0" zimg.h zimg_get_api_version
7031 enabled libzmq && require_pkg_config libzmq "libzmq >= 4.2.1" zmq.h zmq_ctx_new
7032 enabled libzvbi && require_pkg_config libzvbi zvbi-0.2 libzvbi.h vbi_decoder_new &&
7033 { test_cpp_condition libzvbi.h "VBI_VERSION_MAJOR > 0 || VBI_VERSION_MINOR > 2 || VBI_VERSION_MINOR == 2 && VBI_VERSION_MICRO >= 28" ||
7034 enabled gpl || die "ERROR: libzvbi requires version 0.2.28 or --enable-gpl."; }
7035 enabled libxml2 && require_pkg_config libxml2 libxml-2.0 libxml2/libxml/xmlversion.h xmlCheckVersion
7036 enabled mbedtls && { check_pkg_config mbedtls mbedtls mbedtls/x509_crt.h mbedtls_x509_crt_init ||
7037 check_pkg_config mbedtls mbedtls mbedtls/ssl.h mbedtls_ssl_init ||
7038 check_lib mbedtls mbedtls/ssl.h mbedtls_ssl_init -lmbedtls -lmbedx509 -lmbedcrypto ||
7039 die "ERROR: mbedTLS not found"; }
7040 enabled mediacodec && { enabled jni || die "ERROR: mediacodec requires --enable-jni"; }
7041 enabled mmal && { check_lib mmal interface/mmal/mmal.h mmal_port_connect -lmmal_core -lmmal_util -lmmal_vc_client -lbcm_host ||
7042 { ! enabled cross_compile &&
7043 add_cflags -isystem/opt/vc/include/ -isystem/opt/vc/include/interface/vmcs_host/linux -isystem/opt/vc/include/interface/vcos/pthreads -fgnu89-inline &&
7044 add_ldflags -L/opt/vc/lib/ &&
7045 check_lib mmal interface/mmal/mmal.h mmal_port_connect -lmmal_core -lmmal_util -lmmal_vc_client -lbcm_host; } ||
7046 die "ERROR: mmal not found" &&
7047 check_func_headers interface/mmal/mmal.h "MMAL_PARAMETER_VIDEO_MAX_NUM_CALLBACKS"; }
7048 enabled openal && { check_pkg_config openal "openal >= 1.1" "AL/al.h" alGetError ||
7049 { for al_extralibs in "${OPENAL_LIBS}" "-lopenal" "-lOpenAL32"; do
7050 check_lib openal 'AL/al.h' alGetError "${al_extralibs}" && break; done } ||
7051 die "ERROR: openal not found"; } &&
7052 { test_cpp_condition "AL/al.h" "defined(AL_VERSION_1_1)" ||
7053 die "ERROR: openal must be installed and version must be 1.1 or compatible"; }
7054 enabled opencl && { check_pkg_config opencl OpenCL CL/cl.h clEnqueueNDRangeKernel ||
7055 check_lib opencl OpenCL/cl.h clEnqueueNDRangeKernel -Wl,-framework,OpenCL ||
7056 check_lib opencl CL/cl.h clEnqueueNDRangeKernel -lOpenCL ||
7057 die "ERROR: opencl not found"; } &&
7058 { test_cpp_condition "OpenCL/cl.h" "defined(CL_VERSION_1_2)" ||
7059 test_cpp_condition "CL/cl.h" "defined(CL_VERSION_1_2)" ||
7060 die "ERROR: opencl must be installed and version must be 1.2 or compatible"; }
7061 enabled opengl && { check_lib opengl GL/glx.h glXGetProcAddress "-lGL" ||
7062 check_lib opengl windows.h wglGetProcAddress "-lopengl32 -lgdi32" ||
7063 check_lib opengl OpenGL/gl3.h glGetError "-Wl,-framework,OpenGL" ||
7064 check_lib opengl ES2/gl.h glGetError "-isysroot=${sysroot} -Wl,-framework,OpenGLES" ||
7065 die "ERROR: opengl not found."
7067 enabled omx_rpi && { test_code cc OMX_Core.h OMX_IndexConfigBrcmVideoRequestIFrame ||
7068 { ! enabled cross_compile &&
7069 add_cflags -isystem/opt/vc/include/IL &&
7070 test_code cc OMX_Core.h OMX_IndexConfigBrcmVideoRequestIFrame; } ||
7071 die "ERROR: OpenMAX IL headers from raspberrypi/firmware not found"; } &&
7072 enable omx
7073 enabled omx && require_headers OMX_Core.h
7074 enabled openssl && { { check_pkg_config openssl "openssl >= 3.0.0" openssl/ssl.h OPENSSL_init_ssl &&
7075 { enabled gplv3 || ! enabled gpl || enabled nonfree || die "ERROR: OpenSSL >=3.0.0 requires --enable-version3"; }; } ||
7076 { enabled gpl && ! enabled nonfree && die "ERROR: OpenSSL <3.0.0 is incompatible with the gpl"; } ||
7077 check_pkg_config openssl openssl openssl/ssl.h OPENSSL_init_ssl ||
7078 check_pkg_config openssl openssl openssl/ssl.h SSL_library_init ||
7079 check_lib openssl openssl/ssl.h OPENSSL_init_ssl -lssl -lcrypto ||
7080 check_lib openssl openssl/ssl.h SSL_library_init -lssl -lcrypto ||
7081 check_lib openssl openssl/ssl.h SSL_library_init -lssl32 -leay32 ||
7082 check_lib openssl openssl/ssl.h SSL_library_init -lssl -lcrypto -lws2_32 -lgdi32 ||
7083 die "ERROR: openssl not found"; }
7084 enabled pocketsphinx && require_pkg_config pocketsphinx pocketsphinx pocketsphinx/pocketsphinx.h ps_init
7085 enabled rkmpp && { require_pkg_config rkmpp rockchip_mpp rockchip/rk_mpi.h mpp_create &&
7086 require_pkg_config rockchip_mpp "rockchip_mpp >= 1.3.7" rockchip/rk_mpi.h mpp_create &&
7087 { enabled libdrm ||
7088 die "ERROR: rkmpp requires --enable-libdrm"; }
7090 enabled vapoursynth && require_pkg_config vapoursynth "vapoursynth-script >= 42" VSScript.h vsscript_init
7093 if enabled gcrypt; then
7094 GCRYPT_CONFIG="${cross_prefix}libgcrypt-config"
7095 if "${GCRYPT_CONFIG}" --version > /dev/null 2>&1; then
7096 gcrypt_cflags=$("${GCRYPT_CONFIG}" --cflags)
7097 gcrypt_extralibs=$("${GCRYPT_CONFIG}" --libs)
7098 check_func_headers gcrypt.h gcry_mpi_new $gcrypt_cflags $gcrypt_extralibs ||
7099 die "ERROR: gcrypt not found"
7100 add_cflags $gcrypt_cflags
7101 else
7102 require gcrypt gcrypt.h gcry_mpi_new -lgcrypt
7106 if enabled sdl2; then
7107 SDL2_CONFIG="${cross_prefix}sdl2-config"
7108 test_pkg_config sdl2 "sdl2 >= 2.0.1 sdl2 < 3.0.0" SDL_events.h SDL_PollEvent
7109 if disabled sdl2 && "${SDL2_CONFIG}" --version > /dev/null 2>&1; then
7110 sdl2_cflags=$("${SDL2_CONFIG}" --cflags)
7111 sdl2_extralibs=$("${SDL2_CONFIG}" --libs)
7112 test_cpp_condition SDL.h "(SDL_MAJOR_VERSION<<16 | SDL_MINOR_VERSION<<8 | SDL_PATCHLEVEL) >= 0x020001" $sdl2_cflags &&
7113 test_cpp_condition SDL.h "(SDL_MAJOR_VERSION<<16 | SDL_MINOR_VERSION<<8 | SDL_PATCHLEVEL) < 0x030000" $sdl2_cflags &&
7114 check_func_headers SDL_events.h SDL_PollEvent $sdl2_extralibs $sdl2_cflags &&
7115 enable sdl2
7117 if test $target_os = "mingw32"; then
7118 sdl2_extralibs=$(filter_out '-mwindows' $sdl2_extralibs)
7122 if enabled decklink; then
7123 case $target_os in
7124 mingw32*|mingw64*|win32|win64)
7125 decklink_outdev_extralibs="$decklink_outdev_extralibs -lole32 -loleaut32"
7126 decklink_indev_extralibs="$decklink_indev_extralibs -lole32 -loleaut32"
7128 esac
7131 enabled securetransport &&
7132 check_func SecIdentityCreate "-Wl,-framework,CoreFoundation -Wl,-framework,Security" &&
7133 check_lib securetransport "Security/SecureTransport.h Security/Security.h" "SSLCreateContext" "-Wl,-framework,CoreFoundation -Wl,-framework,Security" ||
7134 disable securetransport
7136 enabled securetransport &&
7137 check_func SecItemImport "-Wl,-framework,CoreFoundation -Wl,-framework,Security"
7139 enabled schannel &&
7140 check_func_headers "windows.h security.h" InitializeSecurityContext -DSECURITY_WIN32 -lsecur32 &&
7141 test_cpp_condition winerror.h "defined(SEC_I_CONTEXT_EXPIRED)" &&
7142 schannel_extralibs="-lsecur32" ||
7143 disable schannel
7145 makeinfo --version > /dev/null 2>&1 && enable makeinfo || disable makeinfo
7146 enabled makeinfo \
7147 && [ 0$(makeinfo --version | grep "texinfo" | sed 's/.*texinfo[^0-9]*\([0-9]*\)\..*/\1/') -ge 5 ] \
7148 && enable makeinfo_html || disable makeinfo_html
7149 disabled makeinfo_html && texi2html --help 2> /dev/null | grep -q 'init-file' && enable texi2html || disable texi2html
7150 perl -v > /dev/null 2>&1 && enable perl || disable perl
7151 pod2man --help > /dev/null 2>&1 && enable pod2man || disable pod2man
7152 rsync --help 2> /dev/null | grep -q 'contimeout' && enable rsync_contimeout || disable rsync_contimeout
7153 xmllint --version > /dev/null 2>&1 && enable xmllint || disable xmllint
7155 # check V4L2 codecs available in the API
7156 if enabled v4l2_m2m; then
7157 check_headers linux/fb.h
7158 check_headers linux/videodev2.h
7159 test_code cc linux/videodev2.h "struct v4l2_frmsizeenum vfse; vfse.discrete.width = 0;" && enable_sanitized struct_v4l2_frmivalenum_discrete
7160 check_cc v4l2_m2m linux/videodev2.h "int i = V4L2_CAP_VIDEO_M2M_MPLANE | V4L2_CAP_VIDEO_M2M | V4L2_BUF_FLAG_LAST;"
7161 check_cc vc1_v4l2_m2m linux/videodev2.h "int i = V4L2_PIX_FMT_VC1_ANNEX_G;"
7162 check_cc mpeg1_v4l2_m2m linux/videodev2.h "int i = V4L2_PIX_FMT_MPEG1;"
7163 check_cc mpeg2_v4l2_m2m linux/videodev2.h "int i = V4L2_PIX_FMT_MPEG2;"
7164 check_cc mpeg4_v4l2_m2m linux/videodev2.h "int i = V4L2_PIX_FMT_MPEG4;"
7165 check_cc hevc_v4l2_m2m linux/videodev2.h "int i = V4L2_PIX_FMT_HEVC;"
7166 check_cc h263_v4l2_m2m linux/videodev2.h "int i = V4L2_PIX_FMT_H263;"
7167 check_cc h264_v4l2_m2m linux/videodev2.h "int i = V4L2_PIX_FMT_H264;"
7168 check_cc vp8_v4l2_m2m linux/videodev2.h "int i = V4L2_PIX_FMT_VP8;"
7169 check_cc vp9_v4l2_m2m linux/videodev2.h "int i = V4L2_PIX_FMT_VP9;"
7172 check_headers sys/videoio.h
7173 test_code cc sys/videoio.h "struct v4l2_frmsizeenum vfse; vfse.discrete.width = 0;" && enable_sanitized struct_v4l2_frmivalenum_discrete
7175 check_lib user32 "windows.h winuser.h" GetShellWindow -luser32
7176 check_lib vfw32 "windows.h vfw.h" capCreateCaptureWindow -lvfw32
7177 # check that WM_CAP_DRIVER_CONNECT is defined to the proper value
7178 # w32api 3.12 had it defined wrong
7179 check_cpp_condition vfwcap_defines vfw.h "WM_CAP_DRIVER_CONNECT > WM_USER"
7181 check_type "dshow.h" IBaseFilter
7183 # check for ioctl_meteor.h, ioctl_bt848.h and alternatives
7184 check_headers "dev/bktr/ioctl_meteor.h dev/bktr/ioctl_bt848.h" ||
7185 check_headers "machine/ioctl_meteor.h machine/ioctl_bt848.h" ||
7186 check_headers "dev/video/meteor/ioctl_meteor.h dev/video/bktr/ioctl_bt848.h" ||
7187 check_headers "dev/ic/bt8xx.h"
7189 if check_struct sys/soundcard.h audio_buf_info bytes; then
7190 enable_sanitized sys/soundcard.h
7191 else
7192 test_cc -D__BSD_VISIBLE -D__XSI_VISIBLE <<EOF && add_cppflags -D__BSD_VISIBLE -D__XSI_VISIBLE && enable_sanitized sys/soundcard.h
7193 #include <sys/soundcard.h>
7194 audio_buf_info abc;
7198 enabled alsa && { check_pkg_config alsa alsa "alsa/asoundlib.h" snd_pcm_htimestamp ||
7199 check_lib alsa alsa/asoundlib.h snd_pcm_htimestamp -lasound; }
7201 enabled libjack &&
7202 require_pkg_config libjack jack jack/jack.h jack_port_get_latency_range
7204 enabled sndio && check_pkg_config sndio sndio sndio.h sio_open
7206 if enabled libcdio; then
7207 check_pkg_config libcdio libcdio_paranoia "cdio/cdda.h cdio/paranoia.h" cdio_cddap_open ||
7208 check_pkg_config libcdio libcdio_paranoia "cdio/paranoia/cdda.h cdio/paranoia/paranoia.h" cdio_cddap_open ||
7209 check_lib libcdio "cdio/cdda.h cdio/paranoia.h" cdio_cddap_open -lcdio_paranoia -lcdio_cdda -lcdio ||
7210 check_lib libcdio "cdio/paranoia/cdda.h cdio/paranoia/paranoia.h" cdio_cddap_open -lcdio_paranoia -lcdio_cdda -lcdio ||
7211 die "ERROR: No usable libcdio/cdparanoia found"
7214 enabled libxcb && check_pkg_config libxcb "xcb >= 1.4" xcb/xcb.h xcb_connect ||
7215 disable libxcb_shm libxcb_shape libxcb_xfixes
7217 if enabled libxcb; then
7218 enabled libxcb_shm && check_pkg_config libxcb_shm xcb-shm xcb/shm.h xcb_shm_attach
7219 enabled libxcb_shape && check_pkg_config libxcb_shape xcb-shape xcb/shape.h xcb_shape_get_rectangles
7220 enabled libxcb_xfixes && check_pkg_config libxcb_xfixes xcb-xfixes xcb/xfixes.h xcb_xfixes_get_cursor_image
7223 check_func_headers "windows.h" CreateDIBSection "$gdigrab_indev_extralibs"
7225 # check if building for desktop or uwp
7226 test_cpp <<EOF && enable uwp
7227 #ifdef WINAPI_FAMILY
7228 #include <winapifamily.h>
7229 #if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
7230 #error desktop, not uwp
7231 #else
7232 // WINAPI_FAMILY_APP, WINAPI_FAMILY_PHONE_APP => UWP
7233 #endif
7234 #else
7235 #error no family set
7236 #endif
7239 mediafoundation_extralibs="-lmfuuid -lole32 -lstrmiids"
7241 if enabled uwp; then
7242 # In UWP mode, we can't use LoadLibrary+GetProcAddress to conditionally
7243 # try to load these APIs at runtime, like we do in regular desktop mode -
7244 # therefore, we need to link directly against these APIs.
7245 d3d11va_extralibs="-ldxgi -ld3d11"
7246 d3d12va_extralibs="-ldxgi -ld3d12"
7247 vaapi_win32_extralibs="-ldxgi"
7248 mediafoundation_extralibs="-lmfplat $mediafoundation_extralibs"
7251 enabled libdrm &&
7252 check_pkg_config libdrm_getfb2 libdrm "xf86drmMode.h" drmModeGetFB2
7254 enabled vaapi &&
7255 check_pkg_config vaapi "libva >= 0.35.0" "va/va.h" vaInitialize
7257 if enabled vaapi; then
7258 case $target_os in
7259 mingw32*|mingw64*|win32|win64)
7260 check_pkg_config vaapi_win32 "libva-win32" "va/va_win32.h" vaGetDisplayWin32
7263 check_pkg_config vaapi_drm "libva-drm" "va/va_drm.h" vaGetDisplayDRM
7265 esac
7267 if enabled xlib_x11; then
7268 check_pkg_config vaapi_x11 "libva-x11" "va/va_x11.h" vaGetDisplay
7271 check_cpp_condition vaapi_1 "va/va.h" "VA_CHECK_VERSION(1, 0, 0)"
7273 check_type "va/va.h va/va_dec_hevc.h" "VAPictureParameterBufferHEVC"
7274 check_struct "va/va.h" "VADecPictureParameterBufferVP9" bit_depth
7275 check_struct "va/va.h" "VADecPictureParameterBufferAV1" bit_depth_idx
7276 check_type "va/va.h va/va_vpp.h" "VAProcFilterParameterBufferHDRToneMapping"
7277 check_struct "va/va.h va/va_vpp.h" "VAProcPipelineCaps" rotation_flags
7278 check_struct "va/va.h va/va_vpp.h" "VAProcPipelineCaps" blend_flags
7279 check_type "va/va.h va/va_enc_hevc.h" "VAEncPictureParameterBufferHEVC"
7280 check_type "va/va.h va/va_enc_jpeg.h" "VAEncPictureParameterBufferJPEG"
7281 check_type "va/va.h va/va_enc_vp8.h" "VAEncPictureParameterBufferVP8"
7282 check_type "va/va.h va/va_enc_vp9.h" "VAEncPictureParameterBufferVP9"
7283 check_type "va/va.h va/va_enc_av1.h" "VAEncPictureParameterBufferAV1"
7286 if enabled_all opencl libdrm ; then
7287 check_type "CL/cl_intel.h" "clCreateImageFromFdINTEL_fn" &&
7288 enable opencl_drm_beignet
7289 check_func_headers "CL/cl_ext.h" clImportMemoryARM &&
7290 enable opencl_drm_arm
7293 if enabled_all opencl vaapi ; then
7294 if enabled opencl_drm_beignet ; then
7295 enable opencl_vaapi_beignet
7296 else
7297 check_type "CL/cl.h CL/cl_va_api_media_sharing_intel.h" "clCreateFromVA_APIMediaSurfaceINTEL_fn" &&
7298 enable opencl_vaapi_intel_media
7302 if enabled_all opencl dxva2 ; then
7303 check_type "CL/cl_dx9_media_sharing.h" cl_dx9_surface_info_khr &&
7304 enable opencl_dxva2
7307 if enabled_all opencl d3d11va ; then
7308 check_type "CL/cl_d3d11.h" clGetDeviceIDsFromD3D11KHR_fn &&
7309 enable opencl_d3d11
7312 if enabled_all opencl videotoolbox ; then
7313 check_func_headers OpenCL/cl_gl_ext.h clCreateImageFromIOSurfaceWithPropertiesAPPLE -framework VideoToolbox -framework OpenCL &&
7314 enable opencl_videotoolbox
7317 enabled vdpau &&
7318 check_cpp_condition vdpau vdpau/vdpau.h "defined VDP_DECODER_PROFILE_MPEG4_PART2_ASP"
7320 enabled vdpau &&
7321 check_lib vdpau_x11 "vdpau/vdpau.h vdpau/vdpau_x11.h" vdp_device_create_x11 -lvdpau -lX11
7323 if enabled vulkan; then
7324 check_pkg_config_header_only vulkan "vulkan >= 1.3.277" "vulkan/vulkan.h" "defined VK_VERSION_1_3" ||
7325 check_cpp_condition vulkan "vulkan/vulkan.h" "defined(VK_VERSION_1_4) || (defined(VK_VERSION_1_3) && VK_HEADER_VERSION >= 277)"
7328 if disabled vulkan; then
7329 disable libglslang libshaderc spirv_compiler
7332 if enabled x86; then
7333 case $target_os in
7334 mingw32*|mingw64*|win32|win64|linux|cygwin*)
7337 disable ffnvcodec cuvid nvdec nvenc
7339 esac
7340 elif enabled_any aarch64 ppc64 && ! enabled bigendian; then
7341 case $target_os in
7342 linux)
7345 disable ffnvcodec cuvid nvdec nvenc
7347 esac
7348 else
7349 disable ffnvcodec cuvid nvdec nvenc
7352 enabled ffnvcodec && enable cuda
7354 enabled nvenc &&
7355 test_cc -I$source_path <<EOF || disable nvenc
7356 #include <ffnvcodec/nvEncodeAPI.h>
7357 NV_ENCODE_API_FUNCTION_LIST flist;
7358 void f(void) { struct { const GUID guid; } s[] = { { NV_ENC_CODEC_H264_GUID } }; }
7359 int main(void) { return 0; }
7362 if enabled nvenc; then
7363 check_type "ffnvcodec/nvEncodeAPI.h" "NV_ENC_PIC_PARAMS_AV1"
7366 if enabled_any nvdec cuvid; then
7367 check_type "ffnvcodec/dynlink_cuda.h ffnvcodec/dynlink_cuviddec.h" "CUVIDAV1PICPARAMS"
7370 enabled amf &&
7371 check_cpp_condition amf "AMF/core/Version.h" \
7372 "(AMF_VERSION_MAJOR << 48 | AMF_VERSION_MINOR << 32 | AMF_VERSION_RELEASE << 16 | AMF_VERSION_BUILD_NUM) >= 0x00010004001d0000"
7374 # Funny iconv installations are not unusual, so check it after all flags have been set
7375 if enabled libc_iconv; then
7376 check_func_headers iconv.h iconv
7377 elif enabled iconv; then
7378 check_func_headers iconv.h iconv || check_lib iconv iconv.h iconv -liconv
7381 enabled debug && add_cflags -g"$debuglevel" && add_asflags -g"$debuglevel"
7383 # add some useful compiler flags if supported
7384 check_cflags -Wdeclaration-after-statement
7385 check_cflags -Wall
7386 check_cflags -Wdisabled-optimization
7387 check_cflags -Wpointer-arith
7388 check_cflags -Wredundant-decls
7389 check_cflags -Wwrite-strings
7390 check_cflags -Wtype-limits
7391 check_cflags -Wundef
7392 check_cflags -Wmissing-prototypes
7393 check_cflags -Wstrict-prototypes
7394 check_cflags -Wempty-body
7396 if enabled extra_warnings; then
7397 check_cflags -Wcast-qual
7398 check_cflags -Wextra
7399 check_cflags -Wpedantic
7402 check_disable_warning(){
7403 warning_flag=-W${1#-Wno-}
7404 test_cflags $unknown_warning_flags $warning_flag && add_cflags $1
7407 test_cflags -Werror=unused-command-line-argument &&
7408 append unknown_warning_flags "-Werror=unused-command-line-argument"
7409 test_cflags -Werror=unknown-warning-option &&
7410 append unknown_warning_flags "-Werror=unknown-warning-option"
7412 check_disable_warning -Wno-parentheses
7413 check_disable_warning -Wno-switch
7414 check_disable_warning -Wno-format-zero-length
7415 check_disable_warning -Wno-pointer-sign
7416 check_disable_warning -Wno-unused-const-variable
7417 check_disable_warning -Wno-bool-operation
7418 check_disable_warning -Wno-char-subscripts
7420 check_disable_warning_headers(){
7421 warning_flag=-W${1#-Wno-}
7422 test_cflags $warning_flag && add_cflags_headers $1
7425 check_disable_warning_headers -Wno-deprecated-declarations
7426 check_disable_warning_headers -Wno-unused-variable
7428 test_cc <<EOF && enable blocks_extension
7429 void (^block)(void);
7432 # add some linker flags
7433 check_ldflags -Wl,-rpath-link=:libpostproc:libswresample:libswscale:libavfilter:libavdevice:libavformat:libavcodec:libavutil
7434 enabled rpath && add_ldexeflags -Wl,-rpath,$libdir && add_ldsoflags -Wl,-rpath,$libdir
7435 test_ldflags -Wl,-Bsymbolic && append SHFLAGS -Wl,-Bsymbolic
7437 # add some strip flags
7438 check_stripflags -x
7440 enabled neon_clobber_test &&
7441 check_ldflags -Wl,--wrap,avcodec_open2 \
7442 -Wl,--wrap,avcodec_decode_subtitle2 \
7443 -Wl,--wrap,avcodec_encode_subtitle \
7444 -Wl,--wrap,avcodec_send_packet \
7445 -Wl,--wrap,avcodec_receive_packet \
7446 -Wl,--wrap,avcodec_send_frame \
7447 -Wl,--wrap,avcodec_receive_frame \
7448 -Wl,--wrap,swr_convert ||
7449 disable neon_clobber_test
7451 enabled xmm_clobber_test &&
7452 check_ldflags -Wl,--wrap,avcodec_open2 \
7453 -Wl,--wrap,avcodec_decode_subtitle2 \
7454 -Wl,--wrap,avcodec_encode_subtitle \
7455 -Wl,--wrap,avcodec_send_packet \
7456 -Wl,--wrap,avcodec_receive_packet \
7457 -Wl,--wrap,avcodec_send_frame \
7458 -Wl,--wrap,avcodec_receive_frame \
7459 -Wl,--wrap,swr_convert \
7460 -Wl,--wrap,sws_scale ||
7461 disable xmm_clobber_test
7463 check_ld "cc" proper_dce <<EOF
7464 extern const int array[512];
7465 static inline int func(void) { return array[0]; }
7466 int main(void) { return 0; }
7469 if enabled proper_dce; then
7470 echo "X { local: *; };" > $TMPV
7471 if test_ldflags -Wl,${version_script},$TMPV; then
7472 append SHFLAGS '-Wl,${version_script},\$(SUBDIR)lib\$(NAME).ver'
7473 quotes='""'
7474 test_cc <<EOF && enable symver_asm_label
7475 void ff_foo(void) __asm__ ("av_foo@VERSION");
7476 void ff_foo(void) { ${inline_asm+__asm__($quotes);} }
7478 test_cc <<EOF && enable symver_gnu_asm
7479 __asm__(".symver ff_foo,av_foo@VERSION");
7480 void ff_foo(void) {}
7485 if [ -z "$optflags" ]; then
7486 if enabled small; then
7487 optflags=$cflags_size
7488 elif enabled optimizations; then
7489 optflags=$cflags_speed
7490 else
7491 optflags=$cflags_noopt
7495 check_optflags(){
7496 check_cflags "$@"
7497 [ -n "$lto" ] && check_ldflags "$@"
7500 check_optflags $optflags
7501 check_optflags -fno-math-errno
7502 check_optflags -fno-signed-zeros
7504 if [ -n "$lto" ]; then
7505 test "$cc_type" != "$ld_type" && die "LTO requires same compiler and linker"
7506 check_cflags $lto
7507 check_ldflags $lto $cpuflags
7508 disable inline_asm_direct_symbol_refs
7509 if test "$cc_type" = "clang"; then
7510 # Clang's LTO fails on Windows, when there are references outside
7511 # of inline assembly to nonlocal labels defined within inline assembly,
7512 # see https://github.com/llvm/llvm-project/issues/76046.
7513 case $target_os in
7514 mingw32|win32)
7515 disable inline_asm_nonlocal_labels
7517 esac
7521 enabled ftrapv && check_cflags -ftrapv
7523 test_cc -mno-red-zone <<EOF && noredzone_flags="-mno-red-zone"
7524 int x;
7528 if enabled icc; then
7529 # Just warnings, no remarks
7530 check_cflags -w1
7531 # -wd: Disable following warnings
7532 # 144, 167, 556: -Wno-pointer-sign
7533 # 188: enumerated type mixed with another type
7534 # 1292: attribute "foo" ignored
7535 # 1419: external declaration in primary source file
7536 # 10006: ignoring unknown option -fno-signed-zeros
7537 # 10148: ignoring unknown option -Wno-parentheses
7538 # 10156: ignoring option '-W'; no argument required
7539 # 13200: No EMMS instruction before call to function
7540 # 13203: No EMMS instruction before return from function
7541 check_cflags -wd144,167,188,556,1292,1419,10006,10148,10156,13200,13203
7542 # 11030: Warning unknown option --as-needed
7543 # 10156: ignoring option '-export'; no argument required
7544 check_ldflags -wd10156,11030
7545 # icc 11.0 and 11.1 work with ebp_available, but don't pass the test
7546 enable ebp_available
7547 # The test above does not test linking
7548 [ -n "$lto" ] && disable symver_asm_label
7549 if enabled x86_32; then
7550 icc_version=$($cc -dumpversion)
7551 test ${icc_version%%.*} -ge 11 &&
7552 check_cflags -falign-stack=maintain-16-byte ||
7553 disable aligned_stack
7555 elif enabled gcc; then
7556 check_optflags -fno-tree-vectorize
7557 check_cflags -Werror=format-security
7558 check_cflags -Werror=implicit-function-declaration
7559 check_cflags -Werror=missing-prototypes
7560 check_cflags -Werror=return-type
7561 check_cflags -Werror=vla
7562 check_cflags -Wformat
7563 check_cflags -fdiagnostics-color=auto
7564 enabled extra_warnings || check_disable_warning -Wno-maybe-uninitialized
7565 if enabled x86_32; then
7566 case $target_os in
7567 *bsd*)
7568 # BSDs don't guarantee a 16 byte aligned stack, but we can
7569 # request GCC to try to maintain 16 byte alignment throughout
7570 # function calls. Library entry points that might call assembly
7571 # functions align the stack. (The parameter means 2^4 bytes.)
7572 check_cflags -mpreferred-stack-boundary=4
7574 esac
7576 elif enabled llvm_gcc; then
7577 check_cflags -mllvm -stack-alignment=16
7578 elif enabled clang; then
7579 if enabled x86_32; then
7580 # Clang doesn't support maintaining alignment without assuming the
7581 # same alignment in every function. If 16 byte alignment would be
7582 # enabled, one would also have to either add attribute_align_arg on
7583 # every single entry point into the libraries or enable -mstackrealign
7584 # (doing stack realignment in every single function).
7585 case $target_os in
7586 mingw32|win32|*bsd*)
7587 disable aligned_stack
7590 check_cflags -mllvm -stack-alignment=16
7591 check_cflags -mstack-alignment=16
7593 esac
7594 else
7595 check_cflags -mllvm -stack-alignment=16
7596 check_cflags -mstack-alignment=16
7598 check_cflags -Qunused-arguments
7599 check_cflags -Werror=implicit-function-declaration
7600 check_cflags -Werror=missing-prototypes
7601 check_cflags -Werror=return-type
7602 elif enabled cparser; then
7603 add_cflags -Wno-missing-variable-declarations
7604 add_cflags -Wno-empty-statement
7605 elif enabled armcc; then
7606 add_cflags -W${armcc_opt},--diag_suppress=4343 # hardfp compat
7607 add_cflags -W${armcc_opt},--diag_suppress=3036 # using . as system include dir
7608 # 2523: use of inline assembly is deprecated
7609 add_cflags -W${armcc_opt},--diag_suppress=2523
7610 add_cflags -W${armcc_opt},--diag_suppress=1207
7611 add_cflags -W${armcc_opt},--diag_suppress=1293 # assignment in condition
7612 add_cflags -W${armcc_opt},--diag_suppress=3343 # hardfp compat
7613 add_cflags -W${armcc_opt},--diag_suppress=167 # pointer sign
7614 add_cflags -W${armcc_opt},--diag_suppress=513 # pointer sign
7615 elif enabled pathscale; then
7616 add_cflags -fstrict-overflow -OPT:wrap_around_unsafe_opt=OFF
7617 disable inline_asm
7618 elif enabled_any msvc icl; then
7619 enabled x86_32 && disable aligned_stack
7620 enabled_all x86_32 debug && add_cflags -Oy-
7621 enabled debug && add_ldflags -debug
7622 enable pragma_deprecated
7623 if enabled icl; then
7624 # -Qansi-alias is basically -fstrict-aliasing, but does not work
7625 # (correctly) on icl 13.x.
7626 test_cpp_condition "windows.h" "__ICL < 1300 || __ICL >= 1400" &&
7627 add_cflags -Qansi-alias
7628 # Some inline asm is not compilable in debug
7629 if enabled debug; then
7630 disable ebp_available
7631 disable ebx_available
7634 # msvcrt10 x64 incorrectly enables log2, only msvcrt12 (MSVC 2013) onwards actually has log2.
7635 check_cpp_condition log2 crtversion.h "_VC_CRT_MAJOR_VERSION >= 12"
7636 # the new SSA optimzer in VS2015 U3 is mis-optimizing some parts of the code
7637 # Issue has been fixed in MSVC v19.00.24218.
7638 test_cpp_condition windows.h "_MSC_FULL_VER >= 190024218" ||
7639 check_cflags -d2SSAOptimizer-
7640 # enable utf-8 source processing on VS2015 U2 and newer
7641 test_cpp_condition windows.h "_MSC_FULL_VER >= 190023918" &&
7642 add_cflags -utf-8
7645 for pfx in "" host_; do
7646 varname=${pfx%_}cc_type
7647 eval "type=\$$varname"
7648 if [ "$type" = "msvc" ]; then
7649 test_${pfx}cc <<EOF || add_${pfx}cflags -Dinline=__inline
7650 static inline int foo(int a) { return a; }
7653 done
7655 case $as_type in
7656 clang)
7657 add_asflags -Qunused-arguments
7659 esac
7661 case $ld_type in
7662 clang)
7663 check_ldflags -Qunused-arguments
7665 esac
7667 enable frame_thread_encoder
7669 enabled asm || { arch=c; disable $ARCH_LIST $ARCH_EXT_LIST; }
7671 check_deps $CONFIG_LIST \
7672 $CONFIG_EXTRA \
7673 $HAVE_LIST \
7674 $ALL_COMPONENTS \
7676 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"
7678 enabled threads || warn \
7679 "Threading support was disabled or is not available on the target platform." \
7680 "This means that not only is this build not multi-threaded, but also" \
7681 "that the libraries from this build MUST NOT be used in a multi-threaded"\
7682 "environment."
7684 case $target_os in
7685 haiku)
7686 disable memalign
7687 disable posix_memalign
7689 *-dos|freedos|opendos)
7690 if test_cpp_condition sys/version.h "defined(__DJGPP__) && __DJGPP__ == 2 && __DJGPP_MINOR__ == 5"; then
7691 disable memalign
7694 esac
7696 flatten_extralibs(){
7697 nested_entries=
7698 list_name=$1
7699 eval list=\$${1}
7700 for entry in $list; do
7701 entry_copy=$entry
7702 resolve entry_copy
7703 flat_entries=
7704 for e in $entry_copy; do
7705 case $e in
7706 *_extralibs) nested_entries="$nested_entries$e ";;
7707 *) flat_entries="$flat_entries$e ";;
7708 esac
7709 done
7710 eval $entry="\$flat_entries"
7711 done
7712 append $list_name "$nested_entries"
7714 resolve nested_entries
7715 if test -n "$(filter '*_extralibs' $nested_entries)"; then
7716 flatten_extralibs $list_name
7720 flatten_extralibs_wrapper(){
7721 list_name=$1
7722 flatten_extralibs $list_name
7723 unique $list_name
7724 resolve $list_name
7725 eval $list_name=\$\(\$ldflags_filter \$$list_name\)
7726 eval printf \''%s'\' \""\$$list_name"\"
7729 for linkunit in $LIBRARY_LIST; do
7730 unset current_extralibs
7731 eval components=\$$(toupper ${linkunit})_COMPONENTS_LIST
7732 for comp in ${components}; do
7733 enabled $comp || continue
7734 comp_extralibs="${comp}_extralibs"
7735 append current_extralibs $comp_extralibs
7736 done
7737 eval prepend ${linkunit}_extralibs $current_extralibs
7738 done
7740 for linkunit in $LIBRARY_LIST $PROGRAM_LIST $EXTRALIBS_LIST; do
7741 eval ${linkunit}_extralibs=\$\(flatten_extralibs_wrapper ${linkunit}_extralibs\)
7742 done
7744 map 'enabled $v && intrinsics=${v#intrinsics_}' $INTRINSICS_LIST
7746 for thread in $THREADS_LIST; do
7747 if enabled $thread; then
7748 test -n "$thread_type" &&
7749 die "ERROR: Only one thread type must be selected." ||
7750 thread_type="$thread"
7752 done
7754 if disabled stdatomic; then
7755 if enabled atomics_gcc; then
7756 add_cppflags '-I\$(SRC_PATH)/compat/atomics/gcc'
7757 elif enabled atomics_win32; then
7758 add_cppflags '-I\$(SRC_PATH)/compat/atomics/win32'
7759 elif enabled atomics_suncc; then
7760 add_cppflags '-I\$(SRC_PATH)/compat/atomics/suncc'
7761 elif enabled pthreads; then
7762 add_compat atomics/pthread/stdatomic.o
7763 add_cppflags '-I\$(SRC_PATH)/compat/atomics/pthread'
7764 else
7765 enabled threads && die "Threading is enabled, but no atomics are available"
7766 add_cppflags '-I\$(SRC_PATH)/compat/atomics/dummy'
7770 # Check if requested libraries were found.
7771 for lib in $AUTODETECT_LIBS; do
7772 requested $lib && ! enabled $lib && die "ERROR: $lib requested but not found";
7773 done
7775 enabled zlib && add_cppflags -DZLIB_CONST
7777 # conditional library dependencies, in any order
7778 enabled amovie_filter && prepend avfilter_deps "avformat avcodec"
7779 enabled aresample_filter && prepend avfilter_deps "swresample"
7780 enabled cover_rect_filter && prepend avfilter_deps "avformat avcodec"
7781 enabled ebur128_filter && enabled swresample && prepend avfilter_deps "swresample"
7782 enabled elbg_filter && prepend avfilter_deps "avcodec"
7783 enabled find_rect_filter && prepend avfilter_deps "avformat avcodec"
7784 enabled fsync_filter && prepend avfilter_deps "avformat"
7785 enabled mcdeint_filter && prepend avfilter_deps "avcodec"
7786 enabled movie_filter && prepend avfilter_deps "avformat avcodec"
7787 enabled pan_filter && prepend avfilter_deps "swresample"
7788 enabled pp_filter && prepend avfilter_deps "postproc"
7789 enabled qrencode_filter && prepend_avfilter_deps "swscale"
7790 enabled qrencodesrc_filter && prepend_avfilter_deps "swscale"
7791 enabled removelogo_filter && prepend avfilter_deps "avformat avcodec swscale"
7792 enabled sab_filter && prepend avfilter_deps "swscale"
7793 enabled scale_filter && prepend avfilter_deps "swscale"
7794 enabled scale2ref_filter && prepend avfilter_deps "swscale"
7795 enabled showcqt_filter && prepend avfilter_deps "avformat swscale"
7796 enabled signature_filter && prepend avfilter_deps "avcodec avformat"
7797 enabled smartblur_filter && prepend avfilter_deps "swscale"
7798 enabled spp_filter && prepend avfilter_deps "avcodec"
7799 enabled sr_filter && prepend avfilter_deps "avformat swscale"
7800 enabled subtitles_filter && prepend avfilter_deps "avformat avcodec"
7801 enabled uspp_filter && prepend avfilter_deps "avcodec"
7802 enabled zoompan_filter && prepend avfilter_deps "swscale"
7804 enabled lavfi_indev && prepend avdevice_deps "avfilter"
7806 #FIXME
7807 enabled_any sdl2_outdev opengl_outdev && enabled sdl2 &&
7808 add_cflags $(filter_out '-Dmain=SDL_main' $sdl2_cflags)
7810 enabled opus_decoder && prepend avcodec_deps "swresample"
7812 # reorder the items at var $1 to align with the items order at var $2 .
7813 # die if an item at $1 is not at $2 .
7814 reorder_by(){
7815 eval rb_in=\$$1
7816 eval rb_ordered=\$$2
7818 for rb in $rb_in; do
7819 is_in $rb $rb_ordered || die "$rb at \$$1 is not at \$$2"
7820 done
7822 rb_out=
7823 for rb in $rb_ordered; do
7824 is_in $rb $rb_in && rb_out="$rb_out$rb "
7825 done
7826 eval $1=\$rb_out
7829 # deps-expand fflib $1: N x {append all expanded deps; unique}
7830 # within a set of N items, N expansions are enough to expose a cycle.
7831 expand_deps(){
7832 unique ${1}_deps # required for the early break test.
7833 for dummy in $LIBRARY_LIST; do # N iteratios
7834 eval deps=\$${1}_deps
7835 append ${1}_deps $(map 'eval echo \$${v}_deps' $deps)
7836 unique ${1}_deps
7837 eval '[ ${#deps} = ${#'${1}_deps'} ]' && break # doesn't expand anymore
7838 done
7840 eval is_in $1 \$${1}_deps && die "Dependency cycle at ${1}_deps"
7841 reorder_by ${1}_deps LIBRARY_LIST # linking order is expected later
7844 #we have to remove gpl from the deps here as some code assumes all lib deps are libs
7845 postproc_deps="$(filter_out 'gpl' $postproc_deps)"
7847 map 'expand_deps $v' $LIBRARY_LIST
7849 if test "$quiet" != "yes"; then
7851 echo "install prefix $prefix"
7852 echo "source path $source_path"
7853 echo "C compiler $cc"
7854 echo "C library $libc_type"
7855 if test "$host_cc" != "$cc"; then
7856 echo "host C compiler $host_cc"
7857 echo "host C library $host_libc_type"
7859 echo "ARCH $arch ($cpu)"
7860 if test "$build_suffix" != ""; then
7861 echo "build suffix $build_suffix"
7863 if test "$progs_suffix" != ""; then
7864 echo "progs suffix $progs_suffix"
7866 if test "$extra_version" != ""; then
7867 echo "version string suffix $extra_version"
7869 echo "big-endian ${bigendian-no}"
7870 echo "runtime cpu detection ${runtime_cpudetect-no}"
7871 if enabled x86; then
7872 echo "standalone assembly ${x86asm-no}"
7873 echo "x86 assembler ${x86asmexe}"
7874 echo "MMX enabled ${mmx-no}"
7875 echo "MMXEXT enabled ${mmxext-no}"
7876 echo "3DNow! enabled ${amd3dnow-no}"
7877 echo "3DNow! extended enabled ${amd3dnowext-no}"
7878 echo "SSE enabled ${sse-no}"
7879 echo "SSSE3 enabled ${ssse3-no}"
7880 echo "AESNI enabled ${aesni-no}"
7881 echo "AVX enabled ${avx-no}"
7882 echo "AVX2 enabled ${avx2-no}"
7883 echo "AVX-512 enabled ${avx512-no}"
7884 echo "AVX-512ICL enabled ${avx512icl-no}"
7885 echo "XOP enabled ${xop-no}"
7886 echo "FMA3 enabled ${fma3-no}"
7887 echo "FMA4 enabled ${fma4-no}"
7888 echo "i686 features enabled ${i686-no}"
7889 echo "CMOV is fast ${fast_cmov-no}"
7890 echo "EBX available ${ebx_available-no}"
7891 echo "EBP available ${ebp_available-no}"
7893 if enabled aarch64; then
7894 echo "NEON enabled ${neon-no}"
7895 echo "DOTPROD enabled ${dotprod-no}"
7896 echo "I8MM enabled ${i8mm-no}"
7898 if enabled arm; then
7899 echo "ARMv5TE enabled ${armv5te-no}"
7900 echo "ARMv6 enabled ${armv6-no}"
7901 echo "ARMv6T2 enabled ${armv6t2-no}"
7902 echo "VFP enabled ${vfp-no}"
7903 echo "NEON enabled ${neon-no}"
7904 echo "THUMB enabled ${thumb-no}"
7906 if enabled mips; then
7907 echo "MIPS FPU enabled ${mipsfpu-no}"
7908 echo "MIPS DSP R1 enabled ${mipsdsp-no}"
7909 echo "MIPS DSP R2 enabled ${mipsdspr2-no}"
7910 echo "MIPS MSA enabled ${msa-no}"
7911 echo "LOONGSON MMI enabled ${mmi-no}"
7913 if enabled ppc; then
7914 echo "AltiVec enabled ${altivec-no}"
7915 echo "VSX enabled ${vsx-no}"
7916 echo "POWER8 enabled ${power8-no}"
7917 echo "PPC 4xx optimizations ${ppc4xx-no}"
7918 echo "dcbzl available ${dcbzl-no}"
7920 if enabled loongarch; then
7921 echo "LSX enabled ${lsx-no}"
7922 echo "LASX enabled ${lasx-no}"
7924 if enabled riscv; then
7925 echo "RISC-V Vector enabled ${rvv-no}"
7927 echo "debug symbols ${debug-no}"
7928 echo "strip symbols ${stripping-no}"
7929 echo "optimize for size ${small-no}"
7930 echo "optimizations ${optimizations-no}"
7931 echo "static ${static-no}"
7932 echo "shared ${shared-no}"
7933 echo "postprocessing support ${postproc-no}"
7934 echo "network support ${network-no}"
7935 echo "threading support ${thread_type-no}"
7936 echo "safe bitstream reader ${safe_bitstream_reader-no}"
7937 echo "texi2html enabled ${texi2html-no}"
7938 echo "perl enabled ${perl-no}"
7939 echo "pod2man enabled ${pod2man-no}"
7940 echo "makeinfo enabled ${makeinfo-no}"
7941 echo "makeinfo supports HTML ${makeinfo_html-no}"
7942 echo "xmllint enabled ${xmllint-no}"
7943 test -n "$random_seed" &&
7944 echo "random seed ${random_seed}"
7945 echo
7947 echo "External libraries:"
7948 print_enabled '' $EXTERNAL_LIBRARY_LIST $EXTERNAL_AUTODETECT_LIBRARY_LIST | print_in_columns
7949 echo
7951 echo "External libraries providing hardware acceleration:"
7952 print_enabled '' $HWACCEL_LIBRARY_LIST $HWACCEL_AUTODETECT_LIBRARY_LIST | print_in_columns
7953 echo
7955 echo "Libraries:"
7956 print_enabled '' $LIBRARY_LIST | print_in_columns
7957 echo
7959 echo "Programs:"
7960 print_enabled '' $PROGRAM_LIST | print_in_columns
7961 echo
7963 for type in decoder encoder hwaccel parser demuxer muxer protocol filter bsf indev outdev; do
7964 echo "Enabled ${type}s:"
7965 eval list=\$$(toupper $type)_LIST
7966 print_enabled '_*' $list | print_in_columns
7967 echo
7968 done
7970 if test -n "$ignore_tests"; then
7971 ignore_tests=$(echo $ignore_tests | tr ',' ' ')
7972 echo "Ignored FATE tests:"
7973 echo $ignore_tests | print_in_columns
7974 echo
7977 echo "License: $license"
7979 fi # test "$quiet" != "yes"
7981 if test -n "$WARN_IF_GETS_DISABLED_LIST"; then
7982 for cfg in $WARN_IF_GETS_DISABLED_LIST; do
7983 if disabled $cfg; then
7984 varname=${cfg}_disable_reason
7985 eval "warn \"Disabled $cfg because \$$varname\""
7987 done
7990 if test -n "$WARNINGS"; then
7991 printf "\n%s%s$WARNINGS%s" "$warn_color" "$bold_color" "$reset_color"
7992 enabled fatal_warnings && exit 1
7995 test -e Makefile || echo "include $source_path/Makefile" > Makefile
7997 esc(){
7998 echo "$*" | sed 's/%/%25/g;s/:/%3a/g'
8001 echo "config:$arch:$subarch:$cpu:$target_os:$(esc $cc_ident):$(esc $FFMPEG_CONFIGURATION)" > ffbuild/config.fate
8003 enabled stripping || strip="echo skipping strip"
8004 enabled stripping || striptype=""
8006 config_files="$TMPH ffbuild/config.mak doc/config.texi"
8008 cat > ffbuild/config.mak <<EOF
8009 # Automatically generated by configure - do not modify!
8010 ifndef FFMPEG_CONFIG_MAK
8011 FFMPEG_CONFIG_MAK=1
8012 FFMPEG_CONFIGURATION=$FFMPEG_CONFIGURATION
8013 prefix=$prefix
8014 LIBDIR=\$(DESTDIR)$libdir
8015 SHLIBDIR=\$(DESTDIR)$shlibdir
8016 INCDIR=\$(DESTDIR)$incdir
8017 BINDIR=\$(DESTDIR)$bindir
8018 DATADIR=\$(DESTDIR)$datadir
8019 DOCDIR=\$(DESTDIR)$docdir
8020 MANDIR=\$(DESTDIR)$mandir
8021 PKGCONFIGDIR=\$(DESTDIR)$pkgconfigdir
8022 INSTALL_NAME_DIR=$install_name_dir
8023 SRC_PATH=$source_path
8024 SRC_LINK=$source_link
8025 ifndef MAIN_MAKEFILE
8026 SRC_PATH:=\$(SRC_PATH:.%=..%)
8027 endif
8028 CC_IDENT=$cc_ident
8029 ARCH=$arch
8030 INTRINSICS=$intrinsics
8031 EXTERN_PREFIX=$extern_prefix
8032 CC=$cc
8033 CXX=$cxx
8034 AS=$as
8035 OBJCC=$objcc
8036 LD=$ld
8037 DEPCC=$dep_cc
8038 DEPCCFLAGS=$DEPCCFLAGS \$(CPPFLAGS)
8039 DEPAS=$as
8040 DEPASFLAGS=$DEPASFLAGS \$(CPPFLAGS)
8041 X86ASM=$x86asmexe
8042 DEPX86ASM=$x86asmexe
8043 DEPX86ASMFLAGS=\$(X86ASMFLAGS)
8044 AR=$ar
8045 ARFLAGS=$arflags
8046 AR_O=$ar_o
8047 AR_CMD=$ar
8048 NM_CMD=$nm
8049 METALCC=$metalcc
8050 METALLIB=$metallib
8051 RANLIB=$ranlib
8052 STRIP=$strip
8053 STRIPTYPE=$striptype
8054 NVCC=$nvcc
8055 CP=cp -p
8056 LN_S=$ln_s
8057 CPPFLAGS=$CPPFLAGS
8058 CFLAGS=$CFLAGS
8059 CXXFLAGS=$CXXFLAGS
8060 OBJCCFLAGS=$OBJCFLAGS
8061 ASFLAGS=$ASFLAGS
8062 NVCCFLAGS=$nvccflags
8063 AS_C=$AS_C
8064 AS_O=$AS_O
8065 OBJCC_C=$OBJCC_C
8066 OBJCC_E=$OBJCC_E
8067 OBJCC_O=$OBJCC_O
8068 CC_C=$CC_C
8069 CC_E=$CC_E
8070 CC_O=$CC_O
8071 CXX_C=$CXX_C
8072 CXX_O=$CXX_O
8073 NVCC_C=$NVCC_C
8074 NVCC_O=$NVCC_O
8075 LD_O=$LD_O
8076 X86ASM_O=$X86ASM_O
8077 LD_LIB=$LD_LIB
8078 LD_PATH=$LD_PATH
8079 DLLTOOL=$dlltool
8080 WINDRES=$windres
8081 DOXYGEN=$doxygen
8082 LDFLAGS=$LDFLAGS
8083 LDEXEFLAGS=$LDEXEFLAGS
8084 LDSOFLAGS=$LDSOFLAGS
8085 SHFLAGS=$(echo $($ldflags_filter $SHFLAGS))
8086 ASMSTRIPFLAGS=$ASMSTRIPFLAGS
8087 X86ASMFLAGS=$X86ASMFLAGS
8088 MSAFLAGS=$MSAFLAGS
8089 MMIFLAGS=$MMIFLAGS
8090 LSXFLAGS=$LSXFLAGS
8091 LASXFLAGS=$LASXFLAGS
8092 BUILDSUF=$build_suffix
8093 PROGSSUF=$progs_suffix
8094 FULLNAME=$FULLNAME
8095 LIBPREF=$LIBPREF
8096 LIBSUF=$LIBSUF
8097 LIBNAME=$LIBNAME
8098 SLIBPREF=$SLIBPREF
8099 SLIBSUF=$SLIBSUF
8100 EXESUF=$EXESUF
8101 EXTRA_VERSION=$extra_version
8102 CCDEP=$CCDEP
8103 CXXDEP=$CXXDEP
8104 CCDEP_FLAGS=$CCDEP_FLAGS
8105 ASDEP=$ASDEP
8106 ASDEP_FLAGS=$ASDEP_FLAGS
8107 X86ASMDEP=$X86ASMDEP
8108 X86ASMDEP_FLAGS=$X86ASMDEP_FLAGS
8109 CC_DEPFLAGS=$CC_DEPFLAGS
8110 CXX_DEPFLAGS=$CXX_DEPFLAGS
8111 OBJCC_DEPFLAGS=$OBJC_DEPFLAGS
8112 AS_DEPFLAGS=$AS_DEPFLAGS
8113 X86ASM_DEPFLAGS=$X86ASM_DEPFLAGS
8114 HOSTCC=$host_cc
8115 HOSTLD=$host_ld
8116 HOSTCFLAGS=$host_cflags
8117 HOSTCPPFLAGS=$host_cppflags
8118 HOSTEXESUF=$HOSTEXESUF
8119 HOSTLDFLAGS=$host_ldflags
8120 HOSTEXTRALIBS=$host_extralibs
8121 DEPHOSTCC=$host_cc
8122 DEPHOSTCCFLAGS=$DEPHOSTCCFLAGS \$(HOSTCCFLAGS)
8123 HOSTCCDEP=$HOSTCCDEP
8124 HOSTCCDEP_FLAGS=$HOSTCCDEP_FLAGS
8125 HOSTCC_DEPFLAGS=$HOSTCC_DEPFLAGS
8126 HOSTCC_C=$HOSTCC_C
8127 HOSTCC_O=$HOSTCC_O
8128 HOSTLD_O=$HOSTLD_O
8129 TARGET_EXEC=$target_exec $target_exec_args
8130 TARGET_PATH=$target_path
8131 TARGET_SAMPLES=${target_samples:-\$(SAMPLES)}
8132 CFLAGS-ffplay=${sdl2_cflags}
8133 CFLAGS_HEADERS=$CFLAGS_HEADERS
8134 LIB_INSTALL_EXTRA_CMD=$LIB_INSTALL_EXTRA_CMD
8135 EXTRALIBS=$extralibs
8136 COMPAT_OBJS=$compat_objs
8137 INSTALL=$install
8138 LIBTARGET=${LIBTARGET}
8139 SLIBNAME=${SLIBNAME}
8140 SLIBNAME_WITH_VERSION=${SLIBNAME_WITH_VERSION}
8141 SLIBNAME_WITH_MAJOR=${SLIBNAME_WITH_MAJOR}
8142 SLIB_CREATE_DEF_CMD=${SLIB_CREATE_DEF_CMD}
8143 SLIB_EXTRA_CMD=${SLIB_EXTRA_CMD}
8144 SLIB_INSTALL_NAME=${SLIB_INSTALL_NAME}
8145 SLIB_INSTALL_LINKS=${SLIB_INSTALL_LINKS}
8146 SLIB_INSTALL_EXTRA_LIB=${SLIB_INSTALL_EXTRA_LIB}
8147 SLIB_INSTALL_EXTRA_SHLIB=${SLIB_INSTALL_EXTRA_SHLIB}
8148 VERSION_SCRIPT_POSTPROCESS_CMD=${VERSION_SCRIPT_POSTPROCESS_CMD}
8149 SAMPLES:=${samples:-\$(FATE_SAMPLES)}
8150 NOREDZONE_FLAGS=$noredzone_flags
8151 LIBFUZZER_PATH=$libfuzzer_path
8152 IGNORE_TESTS=$ignore_tests
8153 VERSION_TRACKING=$version_tracking
8156 map 'eval echo "${v}_FFLIBS=\$${v}_deps" >> ffbuild/config.mak' $LIBRARY_LIST
8158 for entry in $LIBRARY_LIST $PROGRAM_LIST $EXTRALIBS_LIST; do
8159 eval echo "EXTRALIBS-${entry}=\$${entry}_extralibs" >> ffbuild/config.mak
8160 done
8162 cat > $TMPH <<EOF
8163 /* Automatically generated by configure - do not modify! */
8164 #ifndef FFMPEG_CONFIG_H
8165 #define FFMPEG_CONFIG_H
8166 #define FFMPEG_CONFIGURATION "$(c_escape $FFMPEG_CONFIGURATION)"
8167 #define FFMPEG_LICENSE "$(c_escape $license)"
8168 #define CONFIG_THIS_YEAR 2024
8169 #define FFMPEG_DATADIR "$(eval c_escape $datadir)"
8170 #define AVCONV_DATADIR "$(eval c_escape $datadir)"
8171 #define CC_IDENT "$(c_escape ${cc_ident:-Unknown compiler})"
8172 #define OS_NAME $target_os
8173 #define EXTERN_PREFIX "${extern_prefix}"
8174 #define EXTERN_ASM ${extern_prefix}
8175 #define BUILDSUF "$build_suffix"
8176 #define SLIBSUF "$SLIBSUF"
8177 #define SWS_MAX_FILTER_SIZE $sws_max_filter_size
8180 test -n "$assert_level" &&
8181 echo "#define ASSERT_LEVEL $assert_level" >>$TMPH
8183 test -n "$malloc_prefix" &&
8184 echo "#define MALLOC_PREFIX $malloc_prefix" >>$TMPH
8186 enabled aarch64 &&
8187 echo "#define AS_ARCH_LEVEL $as_arch_level" >>$TMPH
8189 if enabled x86asm; then
8190 append config_files $TMPASM
8191 cat > $TMPASM <<EOF
8192 ; Automatically generated by configure - do not modify!
8196 enabled getenv || echo "#define getenv(x) NULL" >> $TMPH
8199 mkdir -p doc
8200 mkdir -p tests
8201 mkdir -p tests/api
8202 echo "@c auto-generated by configure - do not modify! " > doc/config.texi
8204 print_config ARCH_ "$config_files" $ARCH_LIST
8205 print_config HAVE_ "$config_files" $HAVE_LIST
8206 print_config CONFIG_ "$config_files" $CONFIG_LIST \
8207 $CONFIG_EXTRA \
8209 echo "#endif /* FFMPEG_CONFIG_H */" >> $TMPH
8211 # Do not overwrite an unchanged config.h to avoid superfluous rebuilds.
8212 cp_if_changed $TMPH config.h
8213 touch ffbuild/.config
8215 # Copy config.asm before printing ALL_COMPONENTS; that's not needed in assembly.
8216 enabled x86asm && cp_if_changed $TMPASM config.asm
8218 # Reopen a new TMPH for config_components.h.
8219 cat > $TMPH <<EOF
8220 /* Automatically generated by configure - do not modify! */
8221 #ifndef FFMPEG_CONFIG_COMPONENTS_H
8222 #define FFMPEG_CONFIG_COMPONENTS_H
8225 print_config CONFIG_ "$config_files" $ALL_COMPONENTS
8227 echo "#endif /* FFMPEG_CONFIG_COMPONENTS_H */" >> $TMPH
8228 echo "endif # FFMPEG_CONFIG_MAK" >> ffbuild/config.mak
8230 cp_if_changed $TMPH config_components.h
8232 cat > $TMPH <<EOF
8233 /* Generated by ffmpeg configure */
8234 #ifndef AVUTIL_AVCONFIG_H
8235 #define AVUTIL_AVCONFIG_H
8238 print_config AV_HAVE_ $TMPH $HAVE_LIST_PUB
8240 echo "#endif /* AVUTIL_AVCONFIG_H */" >> $TMPH
8242 cp_if_changed $TMPH libavutil/avconfig.h
8244 # full_filter_name_foo=vf_foo
8245 # full_filter_name_bar=asrc_bar
8246 # ...
8247 eval "$(sed -n "s/^extern const AVFilter ff_\([avfsinkrc]\{2,5\}\)_\(.*\);/full_filter_name_\2=\1_\2/p" $source_path/libavfilter/allfilters.c)"
8249 # generate the lists of enabled components
8250 print_enabled_components(){
8251 file=$1
8252 struct_name=$2
8253 name=$3
8254 shift 3
8255 echo "static const $struct_name * const $name[] = {" > $TMPH
8256 for c in $*; do
8257 if enabled $c; then
8258 case $name in
8259 filter_list)
8260 eval c=\$full_filter_name_${c%_filter}
8262 indev_list)
8263 c=${c%_indev}_demuxer
8265 outdev_list)
8266 c=${c%_outdev}_muxer
8268 esac
8269 printf " &ff_%s,\n" $c >> $TMPH
8271 done
8272 if [ "$name" = "filter_list" ]; then
8273 for c in asrc_abuffer vsrc_buffer asink_abuffer vsink_buffer; do
8274 printf " &ff_%s,\n" $c >> $TMPH
8275 done
8277 echo " NULL };" >> $TMPH
8278 cp_if_changed $TMPH $file
8281 print_enabled_components libavfilter/filter_list.c AVFilter filter_list $FILTER_LIST
8282 print_enabled_components libavcodec/codec_list.c FFCodec codec_list $CODEC_LIST
8283 print_enabled_components libavcodec/parser_list.c AVCodecParser parser_list $PARSER_LIST
8284 print_enabled_components libavcodec/bsf_list.c FFBitStreamFilter bitstream_filters $BSF_LIST
8285 print_enabled_components libavformat/demuxer_list.c FFInputFormat demuxer_list $DEMUXER_LIST
8286 print_enabled_components libavformat/muxer_list.c FFOutputFormat muxer_list $MUXER_LIST
8287 print_enabled_components libavdevice/indev_list.c FFInputFormat indev_list $INDEV_LIST
8288 print_enabled_components libavdevice/outdev_list.c FFOutputFormat outdev_list $OUTDEV_LIST
8289 print_enabled_components libavformat/protocol_list.c URLProtocol url_protocols $PROTOCOL_LIST
8291 # Settings for pkg-config files
8293 cat > $TMPH <<EOF
8294 # Automatically generated by configure - do not modify!
8295 shared=$shared
8296 build_suffix=$build_suffix
8297 prefix=$prefix
8298 libdir=$libdir
8299 incdir=$incdir
8300 rpath=$(enabled rpath && echo "-Wl,-rpath,\${libdir}")
8301 source_path=${source_path}
8302 LIBPREF=${LIBPREF}
8303 LIBSUF=${LIBSUF}
8304 extralibs_avutil="$avutil_extralibs"
8305 extralibs_avcodec="$avcodec_extralibs"
8306 extralibs_avformat="$avformat_extralibs"
8307 extralibs_avdevice="$avdevice_extralibs"
8308 extralibs_avfilter="$avfilter_extralibs"
8309 extralibs_postproc="$postproc_extralibs"
8310 extralibs_swscale="$swscale_extralibs"
8311 extralibs_swresample="$swresample_extralibs"
8314 for lib in $LIBRARY_LIST; do
8315 lib_deps="$(eval echo \$${lib}_deps)"
8316 echo ${lib}_deps=\"$lib_deps\" >> $TMPH
8317 done
8319 cp_if_changed $TMPH ffbuild/config.sh