mmaldec: print the MMAL format FourCC automatically
[libav.git] / configure
CommitLineData
aeb29222 1#!/bin/sh
0f3cb305 2#
070c5d0f 3# Libav configure script
f57620d5 4#
949906ea
DB
5# Copyright (c) 2000-2002 Fabrice Bellard
6# Copyright (c) 2005-2008 Diego Biurrun
7# Copyright (c) 2005-2008 Mans Rullgard
0f3cb305 8#
cf9d24ad 9
31e647f8 10# Prevent locale nonsense from breaking basic text processing.
79ab96ba
DB
11LC_ALL=C
12export LC_ALL
31e647f8 13
cde2d79a 14# make sure we are running under a compatible shell
c21d6325
MR
15# try to make this part work with most shells
16
17try_exec(){
0dbe81bb 18 echo "Trying shell $1"
2270b4b2 19 type "$1" > /dev/null 2>&1 && exec "$@"
c21d6325
MR
20}
21
5237ce67 22unset foo
2270b4b2 23(: ${foo%%bar}) 2> /dev/null
0dbe81bb
MR
24E1="$?"
25
2270b4b2 26(: ${foo?}) 2> /dev/null
0dbe81bb
MR
27E2="$?"
28
29if test "$E1" != 0 || test "$E2" = 0; then
30 echo "Broken shell detected. Trying alternatives."
c21d6325
MR
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" "$@"
35 fi
36 if test "0$FF_CONF_EXEC" -lt 2; then
37 FF_CONF_EXEC=2
38 try_exec ksh "$0" "$@"
39 fi
40 if test "0$FF_CONF_EXEC" -lt 3; then
41 FF_CONF_EXEC=3
42 try_exec /usr/xpg4/bin/sh "$0" "$@"
cde2d79a
MR
43 fi
44 echo "No compatible shell script interpreter found."
fc53da20 45 echo "This configure script requires a POSIX-compatible shell"
c21d6325 46 echo "such as bash or ksh."
070c5d0f 47 echo "THIS IS NOT A BUG IN LIBAV, DO NOT REPORT IT AS SUCH."
505dfb09 48 echo "Instead, install a working POSIX-compatible shell."
070c5d0f 49 echo "Disabling this configure test will create a broken Libav."
c21d6325
MR
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."
53 fi
cde2d79a
MR
54 exit 1
55fi
56
a77f01c7
MR
57test -d /usr/xpg4/bin && PATH=/usr/xpg4/bin:$PATH
58
74c53c2d 59show_help(){
f69f51b3 60 cat <<EOF
06454877
MR
61Usage: configure [options]
62Options: [defaults in brackets after descriptions]
63
3b327a4b 64Help options:
06454877 65 --help print this message
3b327a4b
DB
66 --list-decoders show all available decoders
67 --list-encoders show all available encoders
68 --list-hwaccels show all available hardware accelerators
69 --list-demuxers show all available demuxers
70 --list-muxers show all available muxers
71 --list-parsers show all available parsers
72 --list-protocols show all available protocols
73 --list-bsfs show all available bitstream filters
74 --list-indevs show all available input devices
75 --list-outdevs show all available output devices
76 --list-filters show all available filters
77
78Standard options:
19bd477d 79 --logfile=FILE log tests and output to FILE [config.log]
06454877
MR
80 --disable-logging do not log configure debug information
81 --prefix=PREFIX install in PREFIX [$prefix]
82 --bindir=DIR install binaries in DIR [PREFIX/bin]
6291d7e4 83 --datadir=DIR install data files in DIR [PREFIX/share/avconv]
f4ca970d 84 --docdir=DIR install documentation in DIR [PREFIX/share/doc/libav]
06454877
MR
85 --libdir=DIR install libs in DIR [PREFIX/lib]
86 --shlibdir=DIR install shared libs in DIR [PREFIX/lib]
87 --incdir=DIR install includes in DIR [PREFIX/include]
88 --mandir=DIR install man page in DIR [PREFIX/share/man]
749b1f13 89 --enable-rpath use rpath when linking programs [USE WITH CARE]
06454877 90
3b327a4b 91Licensing options:
06454877
MR
92 --enable-gpl allow use of GPL code, the resulting libs
93 and binaries will be under GPL [no]
94 --enable-version3 upgrade (L)GPL to version 3 [no]
95 --enable-nonfree allow use of nonfree code, the resulting libs
96 and binaries will be unredistributable [no]
3b327a4b
DB
97
98Configuration options:
99 --disable-static do not build static libraries [no]
100 --enable-shared build shared libraries [no]
101 --enable-small optimize for size instead of speed
102 --enable-runtime-cpudetect detect cpu capabilities at runtime (bigger binary)
103 --enable-gray enable full grayscale support (slower color)
104 --disable-swscale-alpha disable alpha channel support in swscale
844c6852 105 --disable-all disable building components, libraries and programs
3b327a4b 106
e28b7553
DB
107Program options:
108 --disable-programs do not build command line programs
6291d7e4 109 --disable-avconv disable avconv build
266463da 110 --disable-avplay disable avplay build
9e12f0bf 111 --disable-avprobe disable avprobe build
894682a9 112 --disable-avserver deprecated, does nothing
e28b7553
DB
113
114Component options:
115 --disable-doc do not build documentation
5a0f7131
MR
116 --disable-avdevice disable libavdevice build
117 --disable-avcodec disable libavcodec build
118 --disable-avformat disable libavformat build
d89f2fa9 119 --disable-avutil disable libavutil build
5a0f7131 120 --disable-swscale disable libswscale build
cccc039f 121 --disable-avfilter disable video filter support [no]
c8af852b 122 --disable-avresample disable libavresample build [no]
0dbfc1db 123 --disable-pthreads disable pthreads [auto]
7b7b220c 124 --disable-w32threads disable Win32 threads [auto]
06454877 125 --disable-network disable network support [no]
7f3f5f46 126 --disable-dct disable DCT code
0b499c9b 127 --disable-error-resilience disable error resilience code
193cdd9a 128 --disable-lsp disable LSP code
2a91ada8 129 --disable-lzo disable LZO decoder code
06454877
MR
130 --disable-mdct disable MDCT code
131 --disable-rdft disable RDFT code
3b327a4b 132 --disable-fft disable FFT code
1274ea8d 133 --disable-faan disable floating point AAN (I)DCT code
70b348ec
DB
134
135Hardware accelerators:
d8039ef8 136 --enable-d3d11va enable D3D11VA code
3b327a4b 137 --enable-dxva2 enable DXVA2 code
dcb73592 138 --enable-vaapi enable VAAPI code
ac3dbb4d 139 --enable-vda enable VDA code
e8f6bd4b 140 --enable-vdpau enable VDPAU code
3b327a4b 141
330177b5
DB
142Hardware-accelerated decoding/encoding:
143 --enable-cuda enable dynamically linked CUDA [no]
144 --enable-libmfx enable HW acceleration through libmfx
145 --enable-mmal enable decoding via MMAL [no]
146 --enable-nvenc enable encoding via NVENC [no]
e8919ec4 147 --enable-omx enable encoding via OpenMAX IL [no]
f1cd9b03 148 --enable-omx-rpi enable encoding via OpenMAX IL for Raspberry Pi [no]
330177b5 149
3b327a4b 150Individual component options:
bb55e3a3 151 --disable-everything disable all components listed below
06454877
MR
152 --disable-encoder=NAME disable encoder NAME
153 --enable-encoder=NAME enable encoder NAME
154 --disable-encoders disable all encoders
155 --disable-decoder=NAME disable decoder NAME
156 --enable-decoder=NAME enable decoder NAME
157 --disable-decoders disable all decoders
158 --disable-hwaccel=NAME disable hwaccel NAME
159 --enable-hwaccel=NAME enable hwaccel NAME
160 --disable-hwaccels disable all hwaccels
161 --disable-muxer=NAME disable muxer NAME
162 --enable-muxer=NAME enable muxer NAME
163 --disable-muxers disable all muxers
164 --disable-demuxer=NAME disable demuxer NAME
165 --enable-demuxer=NAME enable demuxer NAME
166 --disable-demuxers disable all demuxers
167 --enable-parser=NAME enable parser NAME
168 --disable-parser=NAME disable parser NAME
169 --disable-parsers disable all parsers
170 --enable-bsf=NAME enable bitstream filter NAME
171 --disable-bsf=NAME disable bitstream filter NAME
172 --disable-bsfs disable all bitstream filters
173 --enable-protocol=NAME enable protocol NAME
174 --disable-protocol=NAME disable protocol NAME
175 --disable-protocols disable all protocols
3b327a4b 176 --enable-indev=NAME enable input device NAME
06454877 177 --disable-indev=NAME disable input device NAME
06454877 178 --disable-indevs disable input devices
3b327a4b
DB
179 --enable-outdev=NAME enable output device NAME
180 --disable-outdev=NAME disable output device NAME
06454877
MR
181 --disable-outdevs disable output devices
182 --disable-devices disable all devices
183 --enable-filter=NAME enable filter NAME
184 --disable-filter=NAME disable filter NAME
185 --disable-filters disable all filters
06454877
MR
186
187External library support:
03039f4c 188 --enable-avisynth enable reading of AviSynth script files [no]
06454877 189 --enable-bzlib enable bzlib [autodetect]
47941088 190 --enable-frei0r enable frei0r video filtering
bc8c1395 191 --enable-gnutls enable gnutls [no]
1c0210c7 192 --enable-libbs2b enable bs2b DSP library [no]
e417d80d 193 --enable-libcdio enable audio CD grabbing with libcdio
06454877
MR
194 --enable-libdc1394 enable IIDC-1394 grabbing using libdc1394
195 and libraw1394 [no]
72025ac3 196 --enable-libdcadec enable DCA decoding via libdcadec [no]
c547e5ff 197 --enable-libfaac enable AAC encoding via libfaac [no]
4f2b469d 198 --enable-libfdk-aac enable AAC de/encoding via libfdk-aac [no]
a5b64584 199 --enable-libfreetype enable libfreetype [no]
c547e5ff 200 --enable-libgsm enable GSM de/encoding via libgsm [no]
3641b048 201 --enable-libilbc enable iLBC de/encoding via libilbc [no]
233d2fa0 202 --enable-libkvazaar enable HEVC encoding via libkvazaar [no]
06454877 203 --enable-libmp3lame enable MP3 encoding via libmp3lame [no]
8a02a803 204 --enable-libnpp enable NVIDIA Performance Primitives-based code [no]
becc3c62
MS
205 --enable-libopencore-amrnb enable AMR-NB de/encoding via libopencore-amrnb [no]
206 --enable-libopencore-amrwb enable AMR-WB decoding via libopencore-amrwb [no]
207 --enable-libopencv enable video filtering via libopencv [no]
3852e2c9 208 --enable-libopenh264 enable H.264 encoding via OpenH264 [no]
453c02f9 209 --enable-libopenjpeg enable JPEG 2000 de/encoding via OpenJPEG [no]
7c5ca546 210 --enable-libopus enable Opus de/encoding via libopus [no]
7c922411 211 --enable-libpulse enable Pulseaudio input via libpulse [no]
0f943ce6 212 --enable-librtmp enable RTMP[E] support via librtmp [no]
c547e5ff 213 --enable-libschroedinger enable Dirac de/encoding via libschroedinger [no]
7ca3e520 214 --enable-libsnappy enable Snappy compression [no]
c547e5ff 215 --enable-libspeex enable Speex de/encoding via libspeex [no]
06454877 216 --enable-libtheora enable Theora encoding via libtheora [no]
718907cd 217 --enable-libtwolame enable MP2 encoding via libtwolame [no]
d89e738a 218 --enable-libvo-aacenc enable AAC encoding via libvo-aacenc [no]
f502ff3f 219 --enable-libvo-amrwbenc enable AMR-WB encoding via libvo-amrwbenc [no]
c547e5ff 220 --enable-libvorbis enable Vorbis encoding via libvorbis [no]
3f111804 221 --enable-libvpx enable VP8 and VP9 de/encoding via libvpx [no]
84d3ff50 222 --enable-libwavpack enable wavpack encoding via libwavpack [no]
be7c3231 223 --enable-libwebp enable WebP encoding via libwebp [no]
06454877 224 --enable-libx264 enable H.264 encoding via x264 [no]
50ea9315 225 --enable-libx265 enable HEVC encoding via x265 [no]
de295976 226 --enable-libxavs enable AVS encoding via xavs [no]
a6674d2e
LB
227 --enable-libxcb enable X11 grabbing using XCB [no]
228 --enable-libxcb-shm enable X11 grabbing shm communication [auto]
229 --enable-libxcb-xfixes enable X11 grabbing mouse rendering [auto]
06454877
MR
230 --enable-libxvid enable Xvid encoding via xvidcore,
231 native MPEG-4/Xvid encoder exists [no]
a060866f 232 --enable-openssl enable openssl [no]
a6674d2e 233 --enable-x11grab enable X11 grabbing (legacy) [no]
06454877
MR
234 --enable-zlib enable zlib [autodetect]
235
b3c6ee19
DB
236Toolchain options:
237 --arch=ARCH select architecture [$arch]
238 --cpu=CPU select the minimum required CPU (affects
239 instruction selection, may crash on older CPUs)
06454877
MR
240 --cross-prefix=PREFIX use PREFIX for compilation tools [$cross_prefix]
241 --enable-cross-compile assume a cross-compiler is used
242 --sysroot=PATH root of cross-build tree
243 --sysinclude=PATH location of cross-build system headers
244 --target-os=OS compiler targets OS [$target_os]
245 --target-exec=CMD command to run executables on target
246 --target-path=DIR path to view of build directory on target
ba13606c 247 --target-samples=DIR path to samples directory on target
aeeb782c 248 --toolchain=NAME set tool defaults according to NAME
06454877 249 --nm=NM use nm tool
121d78d0 250 --ar=AR use archive tool AR [$ar_default]
06454877
MR
251 --as=AS use assembler AS [$as_default]
252 --cc=CC use C compiler CC [$cc_default]
9f57f134 253 --objcc=OCC use ObjC compiler OCC [$cc_default]
193cdd9a 254 --dep-cc=DEPCC use dependency generator DEPCC [$cc_default]
06454877 255 --ld=LD use linker LD
852c329a 256 --pkg-config=PKGCONFIG use pkg-config tool PKGCONFIG [$pkg_config_default]
390acbea 257 --pkg-config-flags=FLAGS pass additional flags to pkgconf []
06454877
MR
258 --host-cc=HOSTCC use host C compiler HOSTCC
259 --host-cflags=HCFLAGS use HCFLAGS when compiling for host
4cc4b33f 260 --host-cppflags=HCPPFLAGS use HCPPFLAGS when compiling for host
095792f2 261 --host-ld=HOSTLD use host linker HOSTLD
06454877
MR
262 --host-ldflags=HLDFLAGS use HLDFLAGS when linking for host
263 --host-libs=HLIBS use libs HLIBS when linking for host
193cdd9a 264 --host-os=OS compiler host OS [$target_os]
06454877 265 --extra-cflags=ECFLAGS add ECFLAGS to CFLAGS [$CFLAGS]
9f57f134 266 --extra-objcflags=FLAGS add FLAGS to OBJCFLAGS [$CFLAGS]
06454877 267 --extra-ldflags=ELDFLAGS add ELDFLAGS to LDFLAGS [$LDFLAGS]
bb0babd7 268 --extra-ldexeflags=ELDFLAGS add ELDFLAGS to LDEXEFLAGS [$LDEXEFLAGS]
06454877
MR
269 --extra-libs=ELIBS add ELIBS [$ELIBS]
270 --extra-version=STRING version string suffix []
193cdd9a 271 --optflags=OPTFLAGS override optimization-related compiler flags
06454877 272 --build-suffix=SUFFIX library name suffix []
3b327a4b 273 --enable-pic build position-independent code
193cdd9a 274 --enable-thumb compile for Thumb instruction set
b3c6ee19 275 --enable-lto use link-time optimization
604abd02 276 --env="ENV=override" override the environment variables
b3c6ee19
DB
277
278Advanced options (experts only):
279 --malloc-prefix=PREFIX prefix malloc and related names with PREFIX
8ae1d87a 280 --custom-allocator=NAME use a supported custom allocator
3b327a4b 281 --disable-symver disable symbol versioning
3b327a4b
DB
282 --enable-hardcoded-tables use hardcoded tables instead of runtime generation
283 --disable-safe-bitstream-reader
284 disable buffer boundary checking in bitreaders
285 (faster, but may crash)
286 --enable-memalign-hack emulate memalign, interferes with memory debuggers
b3c6ee19 287 --enable-sram allow use of on-chip SRAM
3b327a4b
DB
288
289Optimization options (experts only):
463a7cde 290 --disable-asm disable all assembly optimizations
06454877 291 --disable-altivec disable AltiVec optimizations
f22ebd25
LB
292 --disable-vsx disable VSX optimizations
293 --disable-power8 disable POWER8 optimizations
06454877
MR
294 --disable-amd3dnow disable 3DNow! optimizations
295 --disable-amd3dnowext disable 3DNow! extended optimizations
296 --disable-mmx disable MMX optimizations
239fdf1b 297 --disable-mmxext disable MMXEXT optimizations
06454877 298 --disable-sse disable SSE optimizations
50cd43f2
DB
299 --disable-sse2 disable SSE2 optimizations
300 --disable-sse3 disable SSE3 optimizations
06454877 301 --disable-ssse3 disable SSSE3 optimizations
50cd43f2
DB
302 --disable-sse4 disable SSE4 optimizations
303 --disable-sse42 disable SSE4.2 optimizations
87f1355f 304 --disable-avx disable AVX optimizations
10b0161d 305 --disable-xop disable XOP optimizations
1b932eb1 306 --disable-fma3 disable FMA3 optimizations
79687079 307 --disable-fma4 disable FMA4 optimizations
4d6ee072 308 --disable-avx2 disable AVX2 optimizations
06454877
MR
309 --disable-armv5te disable armv5te optimizations
310 --disable-armv6 disable armv6 optimizations
311 --disable-armv6t2 disable armv6t2 optimizations
b3267559 312 --disable-vfp disable VFP optimizations
5ea20630 313 --disable-neon disable NEON optimizations
463a7cde
DB
314 --disable-inline-asm disable use of inline assembly
315 --disable-yasm disable use of nasm/yasm assembly
06454877 316
070c5d0f 317Developer options (useful when working on Libav itself):
06454877
MR
318 --disable-debug disable debugging symbols
319 --enable-debug=LEVEL set the debug level [$debuglevel]
06454877
MR
320 --disable-optimizations disable compiler optimizations
321 --enable-extra-warnings enable more compiler warnings
52b3cc60 322 --samples=PATH location of test samples for FATE, if not set use
9309bdfe 323 \$LIBAV_SAMPLES at make invocation time.
44a0a98f
MS
324 --enable-neon-clobber-test check NEON registers for clobbering (should be
325 used only for debugging purposes)
7e4d9d5d
RB
326 --enable-xmm-clobber-test check XMM registers for clobbering (Win64-only;
327 should be used only for debugging purposes)
154caa67
MR
328 --enable-random randomly enable/disable components
329 --disable-random
330 --enable-random=LIST randomly enable/disable specific components or
331 --disable-random=LIST component groups. LIST is a comma-separated list
332 of NAME[:PROB] entries where NAME is a component
333 (group) and PROB the probability associated with
334 NAME (default 0.5).
335 --random-seed=VALUE seed value for --enable/disable-random
eaa2d123
VG
336 --disable-valgrind-backtrace do not print a backtrace under Valgrind
337 (only applies to --disable-optimizations builds)
06454877
MR
338
339NOTE: Object files are built at the place where configure is launched.
340EOF
60e8bc13 341 exit 0
74c53c2d 342}
cf9d24ad 343
0884fadf
MR
344quotes='""'
345
57bd82d4 346log(){
2270b4b2 347 echo "$@" >> $logfile
57bd82d4
MR
348}
349
720c69da 350log_file(){
c8e9f801 351 log BEGIN $1
bf12a81c
KM
352 i=1
353 while read line; do
354 printf '%5s %s\n' "${i}" "${line}"
355 i=$(($i+1))
356 done < $1 >> $logfile
c8e9f801
MR
357 log END $1
358}
359
2ba042a7 360echolog(){
c8e9f801 361 log "$@"
57bd82d4 362 echo "$@"
2ba042a7
MR
363}
364
7bfc8ae6
MR
365warn(){
366 log "WARNING: $*"
367 WARNINGS="${WARNINGS}WARNING: $*\n"
368}
369
2ba042a7
MR
370die(){
371 echolog "$@"
372 cat <<EOF
d326cf7f 373
2ba042a7 374If you think configure made a mistake, make sure you are using the latest
4a6a21f5 375version from Git. If the latest version fails, report the problem to the
5045f6bd 376libav-tools@libav.org mailing list or IRC #libav on irc.freenode.net.
2ba042a7 377EOF
e155a21a 378 if disabled logging; then
2ba042a7 379 cat <<EOF
e155a21a
DB
380Rerun configure with logging enabled (do not use --disable-logging), and
381include the log this produces with your report.
2ba042a7
MR
382EOF
383 else
f69f51b3 384 cat <<EOF
e155a21a
DB
385Include the log file "$logfile" produced by configure as this will help
386solving the problem.
2ba042a7
MR
387EOF
388 fi
57bd82d4
MR
389 exit 1
390}
391
6c6007d6 392# Avoid locale weirdness, besides we really just want to translate ASCII.
44161118 393toupper(){
6c6007d6 394 echo "$@" | tr abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ
44161118
MR
395}
396
4a5444db 397tolower(){
6c6007d6 398 echo "$@" | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz
4a5444db
MR
399}
400
14a8acf1
MR
401c_escape(){
402 echo "$*" | sed 's/["\\]/\\\0/g'
403}
404
b04251c5
MR
405sh_quote(){
406 v=$(echo "$1" | sed "s/'/'\\\\''/g")
d72c981c 407 test "x$v" = "x${v#*[!A-Za-z0-9_/.+-]}" || v="'$v'"
b04251c5
MR
408 echo "$v"
409}
410
bb7a22b5
MR
411cleanws(){
412 echo "$@" | sed 's/^ *//;s/ */ /g;s/ *$//'
413}
414
be8f2501
MR
415filter(){
416 pat=$1
417 shift
418 for v; do
98ef6079 419 eval "case $v in $pat) echo $v ;; esac"
be8f2501
MR
420 done
421}
422
9d201b26
MR
423filter_out(){
424 pat=$1
425 shift
426 for v; do
427 eval "case $v in $pat) ;; *) echo $v ;; esac"
428 done
429}
430
36e2dea0
MR
431map(){
432 m=$1
433 shift
e0e335a0 434 for v; do eval $m; done
36e2dea0
MR
435}
436
43b73d59
DB
437add_suffix(){
438 suffix=$1
439 shift
440 for v; do echo ${v}${suffix}; done
441}
442
a8d04fba
MR
443set_all(){
444 value=$1
445 shift
446 for var in $*; do
447 eval $var=$value
448 done
449}
450
72a43668
MR
451set_weak(){
452 value=$1
453 shift
454 for var; do
455 eval : \${$var:=$value}
456 done
457}
458
f868b24d
DB
459sanitize_var_name(){
460 echo $@ | sed 's/[^A-Za-z0-9_]/_/g'
461}
462
3f8040db
MR
463set_safe(){
464 var=$1
465 shift
f868b24d 466 eval $(sanitize_var_name "$var")='$*'
3f8040db
MR
467}
468
469get_safe(){
f868b24d 470 eval echo \$$(sanitize_var_name "$1")
3f8040db
MR
471}
472
799c9e9b 473pushvar(){
4d810ad2
MS
474 for pvar in $*; do
475 eval level=\${${pvar}_level:=0}
476 eval ${pvar}_${level}="\$$pvar"
477 eval ${pvar}_level=$(($level+1))
799c9e9b
MR
478 done
479}
480
481popvar(){
4d810ad2
MS
482 for pvar in $*; do
483 eval level=\${${pvar}_level:-0}
799c9e9b
MR
484 test $level = 0 && continue
485 eval level=$(($level-1))
4d810ad2
MS
486 eval $pvar="\${${pvar}_${level}}"
487 eval ${pvar}_level=$level
488 eval unset ${pvar}_${level}
799c9e9b
MR
489 done
490}
491
a8d04fba
MR
492enable(){
493 set_all yes $*
494}
495
496disable(){
497 set_all no $*
498}
499
72a43668
MR
500enable_weak(){
501 set_weak yes $*
502}
503
504disable_weak(){
505 set_weak no $*
506}
507
72702705 508enable_safe(){
fd07f803
MR
509 for var; do
510 enable $(echo "$var" | sed 's/[^A-Za-z0-9_]/_/g')
511 done
72702705
MR
512}
513
514disable_safe(){
fd07f803
MR
515 for var; do
516 disable $(echo "$var" | sed 's/[^A-Za-z0-9_]/_/g')
517 done
72702705
MR
518}
519
f9d328da
MR
520do_enable_deep(){
521 for var; do
522 enabled $var && continue
e93aa2c9 523 eval sel="\$${var}_select"
c510c7b5
MR
524 eval sgs="\$${var}_suggest"
525 pushvar var sgs
f9d328da 526 enable_deep $sel
c510c7b5
MR
527 popvar sgs
528 enable_deep_weak $sgs
f9d328da
MR
529 popvar var
530 done
531}
532
533enable_deep(){
534 do_enable_deep $*
535 enable $*
536}
537
72a43668 538enable_deep_weak(){
ffb068ce
MS
539 for var; do
540 disabled $var && continue
541 pushvar var
542 do_enable_deep $var
543 popvar var
544 enable_weak $var
545 done
72a43668
MR
546}
547
57bd82d4 548enabled(){
3250003c
MR
549 test "${1#!}" = "$1" && op== || op=!=
550 eval test "x\$${1#!}" $op "xyes"
44161118
MR
551}
552
37970ebf 553disabled(){
3250003c
MR
554 test "${1#!}" = "$1" && op== || op=!=
555 eval test "x\$${1#!}" $op "xno"
37970ebf
RP
556}
557
44161118
MR
558enabled_all(){
559 for opt; do
560 enabled $opt || return 1
561 done
562}
563
85bca2c5
DB
564disabled_all(){
565 for opt; do
566 disabled $opt || return 1
567 done
568}
569
44161118
MR
570enabled_any(){
571 for opt; do
572 enabled $opt && return 0
573 done
574}
575
85bca2c5
DB
576disabled_any(){
577 for opt; do
578 disabled $opt && return 0
579 done
f7b230a7 580 return 1
85bca2c5
DB
581}
582
c9d19248
MR
583set_default(){
584 for opt; do
88268e94 585 eval : \${$opt:=\$${opt}_default}
c9d19248
MR
586 done
587}
588
4a0d6686
AJ
589is_in(){
590 value=$1
591 shift
592 for var in $*; do
593 [ $var = $value ] && return 0
594 done
595 return 1
596}
597
d4f8cecc 598do_check_deps(){
30fd06be 599 for cfg; do
3250003c 600 cfg="${cfg#!}"
799c9e9b
MR
601 enabled ${cfg}_checking && die "Circular dependency for $cfg."
602 disabled ${cfg}_checking && continue
603 enable ${cfg}_checking
d4f8cecc 604 append allopts $cfg
799c9e9b 605
30fd06be 606 eval dep_all="\$${cfg}_deps"
b4a0f172 607 eval dep_any="\$${cfg}_deps_any"
7ef3425f 608 eval dep_sel="\$${cfg}_select"
c510c7b5 609 eval dep_sgs="\$${cfg}_suggest"
3d7453e0
MR
610 eval dep_ifa="\$${cfg}_if"
611 eval dep_ifn="\$${cfg}_if_any"
799c9e9b 612
3d7453e0 613 pushvar cfg dep_all dep_any dep_sel dep_sgs dep_ifa dep_ifn
d4f8cecc 614 do_check_deps $dep_all $dep_any $dep_sel $dep_sgs $dep_ifa $dep_ifn
3d7453e0 615 popvar cfg dep_all dep_any dep_sel dep_sgs dep_ifa dep_ifn
799c9e9b 616
3d7453e0
MR
617 [ -n "$dep_ifa" ] && { enabled_all $dep_ifa && enable_weak $cfg; }
618 [ -n "$dep_ifn" ] && { enabled_any $dep_ifn && enable_weak $cfg; }
6a702d4c
MR
619 enabled_all $dep_all || disable $cfg
620 enabled_any $dep_any || disable $cfg
7ef3425f 621 disabled_any $dep_sel && disable $cfg
799c9e9b 622
4ec45764 623 if enabled $cfg; then
f9d328da 624 enable_deep $dep_sel
c510c7b5 625 enable_deep_weak $dep_sgs
4ec45764
RP
626 fi
627
799c9e9b 628 disable ${cfg}_checking
30fd06be
MR
629 done
630}
631
d4f8cecc
MR
632check_deps(){
633 unset allopts
634
635 do_check_deps "$@"
636
637 for cfg in $allopts; do
638 enabled $cfg || continue
639 eval dep_extralibs="\$${cfg}_extralibs"
640 test -n "$dep_extralibs" && add_extralibs $dep_extralibs
641 done
642}
643
44161118
MR
644print_config(){
645 pfx=$1
72cfcf41
MR
646 files=$2
647 shift 2
f454e879
MR
648 map 'eval echo "$v \${$v:-no}"' "$@" |
649 awk "BEGIN { split(\"$files\", files) }
650 {
651 c = \"$pfx\" toupper(\$1);
652 v = \$2;
653 sub(/yes/, 1, v);
654 sub(/no/, 0, v);
655 for (f in files) {
656 file = files[f];
657 if (file ~ /\\.h\$/) {
658 printf(\"#define %s %d\\n\", c, v) >>file;
659 } else if (file ~ /\\.asm\$/) {
660 printf(\"%%define %s %d\\n\", c, v) >>file;
661 } else if (file ~ /\\.mak\$/) {
d16c4aeb 662 n = -v ? \"\" : \"!\";
f454e879
MR
663 printf(\"%s%s=yes\\n\", n, c) >>file;
664 }
665 }
666 }"
57bd82d4
MR
667}
668
31c0121d 669print_enabled(){
31c0121d
MR
670 suf=$1
671 shift
672 for v; do
e656a6cc 673 enabled $v && printf "%s\n" ${v%$suf}
31c0121d
MR
674 done
675}
676
57bd82d4
MR
677append(){
678 var=$1
679 shift
57bd82d4
MR
680 eval "$var=\"\$$var $*\""
681}
682
60361817
MR
683prepend(){
684 var=$1
685 shift
686 eval "$var=\"$* \$$var\""
687}
688
44951174
JG
689unique(){
690 var=$1
691 uniq_list=""
692 for tok in $(eval echo \$$var); do
693 uniq_list="$(filter_out $tok $uniq_list) $tok"
694 done
695 eval "$var=\"${uniq_list}\""
696}
697
50a334e4 698add_cppflags(){
cd52ec95 699 append CPPFLAGS "$@"
50a334e4
MR
700}
701
57bd82d4 702add_cflags(){
01d31e16 703 append CFLAGS $($cflags_filter "$@")
57bd82d4
MR
704}
705
2f2e6c7c 706add_asflags(){
01d31e16 707 append ASFLAGS $($asflags_filter "$@")
2f2e6c7c
MR
708}
709
9f57f134
LB
710add_objcflags(){
711 append OBJCFLAGS $($objcflags_filter "$@")
712}
713
57bd82d4 714add_ldflags(){
64933b6c 715 append LDFLAGS $($ldflags_filter "$@")
57bd82d4
MR
716}
717
bb0babd7
LB
718add_ldexeflags(){
719 append LDEXEFLAGS $($ldflags_filter "$@")
720}
721
0673ede9
VG
722add_stripflags(){
723 append STRIPFLAGS "$@"
724}
725
57bd82d4 726add_extralibs(){
64933b6c 727 prepend extralibs $($ldflags_filter "$@")
57bd82d4
MR
728}
729
4cc4b33f
DB
730add_host_cppflags(){
731 append host_cppflags "$@"
732}
733
6c3fa06a
MR
734add_host_cflags(){
735 append host_cflags $($host_cflags_filter "$@")
736}
737
738add_host_ldflags(){
739 append host_ldflags $($host_ldflags_filter "$@")
740}
741
84e65c76
MR
742add_compat(){
743 append compat_objs $1
744 shift
745 map 'add_cppflags -D$v' "$@"
746}
747
b0cfb663 748check_cmd(){
b3cb5d51 749 log "$@"
2270b4b2 750 "$@" >> $logfile 2>&1
b0cfb663
MR
751}
752
b2704a65
MR
753cc_o(){
754 eval printf '%s\\n' $CC_O
755}
756
18031c49
MR
757cc_e(){
758 eval printf '%s\\n' $CC_E
759}
760
dcd479c0 761check_cc(){
57bd82d4 762 log check_cc "$@"
2270b4b2 763 cat > $TMPC
720c69da 764 log_file $TMPC
23565c26 765 check_cmd $cc $CPPFLAGS $CFLAGS "$@" $CC_C $(cc_o $TMPO) $TMPC
57bd82d4
MR
766}
767
9f57f134
LB
768check_objcc(){
769 log check_objcc "$@"
770 cat > $TMPC
771 log_file $TMPC
772 check_cmd $objcc $CPPFLAGS $CFLAGS $OBJCFLAGS "$@" $OBJCC_C $(cc_o $TMPO) $TMPC
773}
774
57bd82d4
MR
775check_cpp(){
776 log check_cpp "$@"
2270b4b2 777 cat > $TMPC
720c69da 778 log_file $TMPC
18031c49 779 check_cmd $cc $CPPFLAGS $CFLAGS "$@" $(cc_e $TMPO) $TMPC
dcd479c0
MR
780}
781
df0d6341
MR
782as_o(){
783 eval printf '%s\\n' $AS_O
784}
785
f65883c8
MR
786check_as(){
787 log check_as "$@"
7fd90119
MR
788 cat > $TMPS
789 log_file $TMPS
790 check_cmd $as $CPPFLAGS $ASFLAGS "$@" $AS_C $(as_o $TMPO) $TMPS
f65883c8
MR
791}
792
575db883
DB
793check_inline_asm(){
794 log check_inline_asm "$@"
940f335a 795 name="$1"
3784e82e 796 code="$2"
940f335a 797 shift 2
49214f61 798 disable $name
7fd90119 799 check_cc "$@" <<EOF && enable $name
3784e82e 800void foo(void){ __asm__ volatile($code); }
940f335a
MR
801EOF
802}
803
c6ebc9fa
MR
804check_insn(){
805 log check_insn "$@"
806 check_inline_asm ${1}_inline "\"$2\""
807 echo "$2" | check_as && enable ${1}_external || disable ${1}_external
808}
809
304d586d
LM
810check_yasm(){
811 log check_yasm "$@"
812 echo "$1" > $TMPS
813 log_file $TMPS
814 shift 1
815 check_cmd $yasmexe $YASMFLAGS "$@" -o $TMPO $TMPS
816}
817
29b64b68
MR
818ld_o(){
819 eval printf '%s\\n' $LD_O
820}
821
dcd479c0 822check_ld(){
57bd82d4 823 log check_ld "$@"
66a1ccd7
MR
824 flags=$(filter_out '-l*' "$@")
825 libs=$(filter '-l*' "$@")
01d31e16 826 check_cc $($cflags_filter $flags) || return
64933b6c
MR
827 flags=$($ldflags_filter $flags)
828 libs=$($ldflags_filter $libs)
29b64b68 829 check_cmd $ld $LDFLAGS $flags $(ld_o $TMPE) $TMPO $libs $extralibs
dcd479c0
MR
830}
831
52ccc4a0
DB
832print_include(){
833 hdr=$1
834 test "${hdr%.h}" = "${hdr}" &&
835 echo "#include $hdr" ||
836 echo "#include <$hdr>"
837}
838
5adc829e
MR
839check_code(){
840 log check_code "$@"
841 check=$1
842 headers=$2
843 code=$3
844 shift 3
845 {
846 for hdr in $headers; do
52ccc4a0 847 print_include $hdr
5adc829e
MR
848 done
849 echo "int main(void) { $code; return 0; }"
850 } | check_$check "$@"
851}
852
50a334e4
MR
853check_cppflags(){
854 log check_cppflags "$@"
caf458dd 855 check_cc "$@" <<EOF && append CPPFLAGS "$@"
50a334e4
MR
856int x;
857EOF
858}
859
23157d72
DB
860test_cflags(){
861 log test_cflags "$@"
01d31e16 862 set -- $($cflags_filter "$@")
23157d72 863 check_cc "$@" <<EOF
dcd479c0
MR
864int x;
865EOF
866}
867
23157d72
DB
868check_cflags(){
869 log check_cflags "$@"
870 test_cflags "$@" && add_cflags "$@"
871}
872
9f57f134
LB
873test_objcflags(){
874 log test_cflags "$@"
875 set -- $($cflags_filter "$@")
876 check_objcc "$@" <<EOF
877int x;
878EOF
879}
880
881check_objcflags(){
882 log check_cflags "$@"
883 test_objcflags "$@" && add_objcflags "$@"
884}
885
2ed46eea
MR
886test_ldflags(){
887 log test_ldflags "$@"
888 check_ld "$@" <<EOF
c23a0ac8 889int main(void){ return 0; }
dcd479c0
MR
890EOF
891}
892
2ed46eea
MR
893check_ldflags(){
894 log check_ldflags "$@"
895 test_ldflags "$@" && add_ldflags "$@"
896}
897
0673ede9
VG
898test_stripflags(){
899 log test_stripflags "$@"
900 # call check_cc to get a fresh TMPO
901 check_cc <<EOF
902int main(void) { return 0; }
903EOF
904 check_cmd $strip $STRIPFLAGS "$@" $TMPO
905}
906
907check_stripflags(){
908 log check_stripflags "$@"
909 test_stripflags "$@" && add_stripflags "$@"
910}
911
dcd479c0 912check_header(){
57bd82d4 913 log check_header "$@"
dcd479c0
MR
914 header=$1
915 shift
b77df637
MR
916 disable_safe $header
917 check_cpp "$@" <<EOF && enable_safe $header
dcd479c0
MR
918#include <$header>
919int x;
920EOF
921}
922
923check_func(){
57bd82d4 924 log check_func "$@"
dcd479c0
MR
925 func=$1
926 shift
d8bc5f06
MR
927 disable $func
928 check_ld "$@" <<EOF && enable $func
dcd479c0 929extern int $func();
c23a0ac8 930int main(void){ $func(); }
dcd479c0
MR
931EOF
932}
933
645d2652 934check_mathfunc(){
6b73c0ae 935 log check_mathfunc "$@"
645d2652 936 func=$1
1aa07aa2
MR
937 narg=$2
938 shift 2
939 test $narg = 2 && args="f, g" || args="f"
645d2652
MR
940 disable $func
941 check_ld "$@" <<EOF && enable $func
942#include <math.h>
1aa07aa2 943float foo(float f, float g) { return $func($args); }
33bd38db 944int main(void){ return 0; }
645d2652
MR
945EOF
946}
947
2446d3d6
DB
948check_func_headers(){
949 log check_func_headers "$@"
f8d7b072 950 headers=$1
edaf1ae2 951 funcs=$2
f8d7b072 952 shift 2
edaf1ae2
MR
953 {
954 for hdr in $headers; do
52ccc4a0 955 print_include $hdr
edaf1ae2
MR
956 done
957 for func in $funcs; do
958 echo "long check_$func(void) { return (long) $func; }"
959 done
960 echo "int main(void) { return 0; }"
961 } | check_ld "$@" && enable $funcs && enable_safe $headers
f8d7b072
MR
962}
963
a5344cf7
SS
964check_cpp_condition(){
965 log check_cpp_condition "$@"
966 header=$1
967 condition=$2
f855b7b9 968 shift 2
cd52ec95 969 check_cpp "$@" <<EOF
a5344cf7
SS
970#include <$header>
971#if !($condition)
972#error "unsatisfied condition: $condition"
973#endif
974EOF
975}
976
57bd82d4
MR
977check_lib(){
978 log check_lib "$@"
979 header="$1"
980 func="$2"
981 shift 2
84400e9d 982 check_header $header && check_func $func "$@" && add_extralibs "$@"
57bd82d4
MR
983}
984
f8d7b072
MR
985check_lib2(){
986 log check_lib2 "$@"
987 headers="$1"
edaf1ae2 988 funcs="$2"
f8d7b072 989 shift 2
edaf1ae2 990 check_func_headers "$headers" "$funcs" "$@" && add_extralibs "$@"
f8d7b072
MR
991}
992
3f8040db
MR
993check_pkg_config(){
994 log check_pkg_config "$@"
995 pkg="$1"
996 headers="$2"
997 funcs="$3"
998 shift 3
7f9e893f 999 check_cmd $pkg_config --exists --print-errors $pkg || return
390acbea
LB
1000 pkg_cflags=$($pkg_config --cflags $pkg_config_flags $pkg)
1001 pkg_libs=$($pkg_config --libs $pkg_config_flags $pkg)
3f8040db 1002 check_func_headers "$headers" "$funcs" $pkg_cflags $pkg_libs "$@" &&
06db4552
LB
1003 set_safe "${pkg}_cflags" $pkg_cflags &&
1004 set_safe "${pkg}_libs" $pkg_libs
3f8040db
MR
1005}
1006
dcd479c0 1007check_exec(){
2270b4b2 1008 check_ld "$@" && { enabled cross_compile || $TMPE >> $logfile 2>&1; }
57bd82d4
MR
1009}
1010
7dfef245 1011check_exec_crash(){
5e622c40 1012 code=$(cat)
7dfef245
MR
1013
1014 # exit() is not async signal safe. _Exit (C99) and _exit (POSIX)
1015 # are safe but may not be available everywhere. Thus we use
1016 # raise(SIGTERM) instead. The check is run in a subshell so we
1017 # can redirect the "Terminated" message from the shell. SIGBUS
1018 # is not defined by standard C so it is used conditionally.
1019
2270b4b2 1020 (check_exec "$@") >> $logfile 2>&1 <<EOF
7dfef245
MR
1021#include <signal.h>
1022static void sighandler(int sig){
1023 raise(SIGTERM);
1024}
692dd8ed
MR
1025int foo(void){
1026 $code
1027}
9495cd17 1028int (*func_ptr)(void) = foo;
e5af4a11 1029int main(void){
7dfef245
MR
1030 signal(SIGILL, sighandler);
1031 signal(SIGFPE, sighandler);
1032 signal(SIGSEGV, sighandler);
1033#ifdef SIGBUS
1034 signal(SIGBUS, sighandler);
1035#endif
9495cd17 1036 return func_ptr();
7dfef245
MR
1037}
1038EOF
1039}
1040
72be9e73
DY
1041check_type(){
1042 log check_type "$@"
1043 headers=$1
1044 type=$2
1045 shift 2
ae550ce9 1046 disable_safe "$type"
5adc829e 1047 check_code cc "$headers" "$type v" "$@" && enable_safe "$type"
72be9e73
DY
1048}
1049
14d36751 1050check_struct(){
813b82b9 1051 log check_struct "$@"
14d36751
MR
1052 headers=$1
1053 struct=$2
1054 member=$3
1055 shift 3
1056 disable_safe "${struct}_${member}"
5adc829e
MR
1057 check_code cc "$headers" "const void *p = &(($struct *)0)->$member" "$@" &&
1058 enable_safe "${struct}_${member}"
14d36751
MR
1059}
1060
9c7d85b3
DB
1061check_builtin(){
1062 log check_builtin "$@"
1063 name=$1
1064 headers=$2
1065 builtin=$3
1066 shift 3
1067 disable "$name"
1068 check_code ld "$headers" "$builtin" "$@" && enable "$name"
1069}
1070
e854b8f9
AK
1071check_compile_assert(){
1072 log check_compile_assert "$@"
1073 name=$1
1074 headers=$2
1075 condition=$3
1076 shift 3
1077 disable "$name"
1078 check_code cc "$headers" "char c[2 * !!($condition) - 1]" "$@" && enable "$name"
1079}
1080
57bd82d4
MR
1081require(){
1082 name="$1"
1083 header="$2"
1084 func="$3"
1085 shift 3
1086 check_lib $header $func "$@" || die "ERROR: $name not found"
dcd479c0
MR
1087}
1088
f8d7b072
MR
1089require2(){
1090 name="$1"
1091 headers="$2"
1092 func="$3"
1093 shift 3
1094 check_lib2 "$headers" $func "$@" || die "ERROR: $name not found"
1095}
1096
3f8040db
MR
1097require_pkg_config(){
1098 pkg="$1"
1099 check_pkg_config "$@" || die "ERROR: $pkg not found"
06db4552
LB
1100 add_cflags $(get_safe "${pkg}_cflags")
1101 add_extralibs $(get_safe "${pkg}_libs")
3f8040db
MR
1102}
1103
27565164
DB
1104hostcc_e(){
1105 eval printf '%s\\n' $HOSTCC_E
1106}
1107
ae43c4c0
MR
1108hostcc_o(){
1109 eval printf '%s\\n' $HOSTCC_O
1110}
1111
f0125de9
MR
1112check_host_cc(){
1113 log check_host_cc "$@"
1114 cat > $TMPC
1115 log_file $TMPC
ae43c4c0 1116 check_cmd $host_cc $host_cflags "$@" $HOSTCC_C $(hostcc_o $TMPO) $TMPC
f0125de9
MR
1117}
1118
27565164
DB
1119check_host_cpp(){
1120 log check_host_cpp "$@"
1121 cat > $TMPC
1122 log_file $TMPC
3f2c7035 1123 check_cmd $host_cc $host_cppflags $host_cflags "$@" $(hostcc_e $TMPO) $TMPC
27565164
DB
1124}
1125
4cc4b33f
DB
1126check_host_cppflags(){
1127 log check_host_cppflags "$@"
1128 check_host_cc "$@" <<EOF && append host_cppflags "$@"
1129int x;
1130EOF
1131}
1132
f0125de9
MR
1133check_host_cflags(){
1134 log check_host_cflags "$@"
6c3fa06a 1135 set -- $($host_cflags_filter "$@")
f0125de9
MR
1136 check_host_cc "$@" <<EOF && append host_cflags "$@"
1137int x;
1138EOF
1139}
1140
27565164
DB
1141check_host_cpp_condition(){
1142 log check_host_cpp_condition "$@"
1143 header=$1
1144 condition=$2
1145 shift 2
1146 check_host_cpp "$@" <<EOF
1147#include <$header>
1148#if !($condition)
1149#error "unsatisfied condition: $condition"
1150#endif
1151EOF
1152}
1153
c505dd31
MR
1154apply(){
1155 file=$1
1156 shift
1157 "$@" < "$file" > "$file.tmp" && mv "$file.tmp" "$file" || rm "$file.tmp"
1158}
1159
c34681df 1160cp_if_changed(){
5e27ec28
MR
1161 cmp -s "$1" "$2" && echo "$2 is unchanged" && return
1162 mkdir -p "$(dirname $2)"
4ebc6a74 1163 $cp_f "$1" "$2"
c34681df
MR
1164}
1165
dcd61286
DB
1166# CONFIG_LIST contains configurable options, while HAVE_LIST is for
1167# system-dependent things.
1168
d7a5a178 1169AVCODEC_COMPONENTS="
4a0d6686
AJ
1170 bsfs
1171 decoders
4a0d6686 1172 encoders
5666fd73 1173 hwaccels
d7a5a178
LB
1174 parsers
1175"
1176
1177AVDEVICE_COMPONENTS="
c552605c 1178 indevs
c552605c 1179 outdevs
d7a5a178
LB
1180"
1181AVFILTER_COMPONENTS="
1182 filters
1183"
1184AVFORMAT_COMPONENTS="
1185 demuxers
1186 muxers
4a0d6686
AJ
1187 protocols
1188"
1189
d7a5a178
LB
1190AVRESAMPLE_COMPONENTS=""
1191AVUTIL_COMPONENTS=""
1192
1193COMPONENT_LIST="
1194 $AVCODEC_COMPONENTS
1195 $AVDEVICE_COMPONENTS
1196 $AVFILTER_COMPONENTS
1197 $AVFORMAT_COMPONENTS
1198 $AVRESAMPLE_COMPONENTS
1199 $AVUTIL_COMPONENTS
1200"
1201
ab81f24a 1202EXAMPLE_LIST="
b339182e 1203 avcodec_example
e7dfaf16 1204 filter_audio_example
b339182e 1205 metadata_example
ab81f24a 1206 output_example
990e4a66 1207 qsvdec_example
10421bcf 1208 transcode_aac_example
ab81f24a
DB
1209"
1210
3fc09b00
MR
1211EXTERNAL_LIBRARY_LIST="
1212 avisynth
1213 bzlib
1214 frei0r
1215 gnutls
1c0210c7 1216 libbs2b
3fc09b00
MR
1217 libcdio
1218 libdc1394
72025ac3 1219 libdcadec
3fc09b00
MR
1220 libfaac
1221 libfdk_aac
f1b239ec 1222 libfontconfig
3fc09b00
MR
1223 libfreetype
1224 libgsm
1225 libilbc
233d2fa0 1226 libkvazaar
3fc09b00 1227 libmp3lame
8a02a803 1228 libnpp
3fc09b00
MR
1229 libopencore_amrnb
1230 libopencore_amrwb
1231 libopencv
8a3d9ca6 1232 libopenh264
3fc09b00
MR
1233 libopenjpeg
1234 libopus
1235 libpulse
1236 librtmp
1237 libschroedinger
7ca3e520 1238 libsnappy
3fc09b00
MR
1239 libspeex
1240 libtheora
718907cd 1241 libtwolame
3fc09b00
MR
1242 libvo_aacenc
1243 libvo_amrwbenc
1244 libvorbis
1245 libvpx
84d3ff50 1246 libwavpack
be7c3231 1247 libwebp
3fc09b00 1248 libx264
50ea9315 1249 libx265
3fc09b00 1250 libxavs
a6674d2e
LB
1251 libxcb
1252 libxcb_shm
1253 libxcb_xfixes
3fc09b00
MR
1254 libxvid
1255 openssl
1256 x11grab
1257 zlib
1258"
1259
d0adf55c
DB
1260FEATURE_LIST="
1261 gray
1262 hardcoded_tables
f1cd9b03 1263 omx_rpi
d0adf55c
DB
1264 runtime_cpudetect
1265 safe_bitstream_reader
1266 shared
1267 small
1268 sram
1269 static
1270 swscale_alpha
1271"
1272
330177b5
DB
1273HW_CODECS_LIST="
1274 cuda
1275 libmfx
1276 mmal
1277 nvenc
e8919ec4 1278 omx
330177b5
DB
1279"
1280
70b348ec 1281HWACCEL_LIST="
d8039ef8 1282 d3d11va
70b348ec
DB
1283 dxva2
1284 vaapi
1285 vda
1286 vdpau
1287"
7caf48e0 1288
d89f2fa9
DB
1289LIBRARY_LIST="
1290 avcodec
1291 avdevice
1292 avfilter
1293 avformat
1294 avresample
1295 avutil
1296 swscale
1297"
1298
d0adf55c
DB
1299LICENSE_LIST="
1300 gpl
1301 nonfree
1302 version3
1303"
1304
055c61b8
DB
1305PROGRAM_LIST="
1306 avconv
1307 avplay
1308 avprobe
055c61b8
DB
1309"
1310
d0adf55c 1311SUBSYSTEM_LIST="
7f3f5f46 1312 dct
4da3f410 1313 doc
0b499c9b 1314 error_resilience
1274ea8d 1315 faan
1848f7d9 1316 fft
b781cc12 1317 lsp
2a91ada8 1318 lzo
47a158cb 1319 mdct
d0adf55c
DB
1320 network
1321 rdft
1322"
1323
1324CONFIG_LIST="
1325 $COMPONENT_LIST
1326 $EXAMPLE_LIST
1327 $EXTERNAL_LIBRARY_LIST
1328 $FEATURE_LIST
330177b5 1329 $HW_CODECS_LIST
d0adf55c
DB
1330 $HWACCEL_LIST
1331 $LICENSE_LIST
1332 $LIBRARY_LIST
1333 $PROGRAM_LIST
1334 $SUBSYSTEM_LIST
c88f5d72 1335 memalign_hack
44a0a98f 1336 neon_clobber_test
8a3c8627 1337 pic
7caf48e0 1338 pod2man
f187557a 1339 texi2html
8986fddc 1340 thumb
eaa2d123 1341 valgrind_backtrace
7e4d9d5d 1342 xmm_clobber_test
4a0d6686 1343"
c88f5d72 1344
7caf48e0 1345THREADS_LIST="
8eee7025
DB
1346 pthreads
1347 w32threads
7caf48e0 1348"
8eee7025 1349
7caf48e0 1350ATOMICS_LIST="
f9f6402e 1351 atomics_gcc
f9f6402e 1352 atomics_suncc
93e65e9a 1353 atomics_win32
7caf48e0 1354"
f9f6402e 1355
7caf48e0 1356ARCH_LIST="
5873b623 1357 aarch64
3f5b56e5 1358 alpha
a2fc0f6a 1359 arm
fdcd782d
MR
1360 avr32
1361 avr32_ap
1362 avr32_uc
3f5b56e5
MR
1363 bfin
1364 ia64
1365 m68k
1366 mips
bae3abb0 1367 mips64
3f5b56e5 1368 parisc
79cb09b2 1369 ppc
34d11b87 1370 ppc64
3f5b56e5
MR
1371 s390
1372 sh4
1373 sparc
1374 sparc64
c75848cd
DB
1375 tilegx
1376 tilepro
0844bae1 1377 tomi
3f5b56e5
MR
1378 x86
1379 x86_32
1380 x86_64
7caf48e0 1381"
3f5b56e5 1382
7caf48e0 1383ARCH_EXT_LIST_ARM="
81dfa21e
MR
1384 armv5te
1385 armv6
1386 armv6t2
8675bcb0 1387 armv8
81dfa21e 1388 neon
b3267559 1389 vfp
81dfa21e 1390 vfpv3
7caf48e0 1391"
81dfa21e 1392
7caf48e0 1393ARCH_EXT_LIST_X86_SIMD="
3bf96eec 1394 amd3dnow
a1ef9f08 1395 amd3dnowext
50cd43f2 1396 avx
4d6ee072 1397 avx2
1b932eb1 1398 fma3
50cd43f2
DB
1399 fma4
1400 mmx
1401 mmxext
1402 sse
1403 sse2
1404 sse3
1405 sse4
1406 sse42
1407 ssse3
7caf48e0
DB
1408 xop
1409"
50cd43f2 1410
7a650caf
DB
1411ARCH_EXT_LIST_PPC="
1412 altivec
1413 dcbzl
1414 ldbrx
f22ebd25 1415 power8
7a650caf 1416 ppc4xx
f22ebd25 1417 vsx
7a650caf
DB
1418"
1419
84bf8817
DB
1420ARCH_EXT_LIST_X86="
1421 $ARCH_EXT_LIST_X86_SIMD
1422 cpunop
1423 i686
1424"
1425
1016a75c
LB
1426ARCH_EXT_LIST_MIPS="
1427 loongson
1428 mips32r1
1429 mips64r1
1430 mips32r2
1431 mips64r2
1432 mips32r6
1433 mips64r6
1434"
1435
50cd43f2 1436ARCH_EXT_LIST="
81dfa21e 1437 $ARCH_EXT_LIST_ARM
1016a75c 1438 $ARCH_EXT_LIST_MIPS
7a650caf 1439 $ARCH_EXT_LIST_PPC
50cd43f2 1440 $ARCH_EXT_LIST_X86
7a650caf 1441 vis
50cd43f2 1442"
3f5b56e5 1443
7a650caf
DB
1444ARCH_FEATURES="
1445 aligned_stack
1446 fast_64bit
1447 fast_clz
1448 fast_cmov
1449 local_aligned_8
1450 local_aligned_16
eba2233b 1451 simd_align_16
7a650caf
DB
1452"
1453
1454BUILTIN_LIST="
1455 atomic_cas_ptr
1456 machine_rw_barrier
1457 MemoryBarrier
1458 mm_empty
1459 rdtsc
6bb99757 1460 sem_timedwait
7a650caf
DB
1461 sync_val_compare_and_swap
1462"
7caf48e0 1463HAVE_LIST_CMDLINE="
fd712a55
DB
1464 inline_asm
1465 symver
1466 yasm
7caf48e0 1467"
fd712a55 1468
7caf48e0 1469HAVE_LIST_PUB="
a3e02a8c 1470 bigendian
d268eee9 1471 fast_unaligned
7caf48e0 1472"
a3e02a8c 1473
7a650caf 1474HEADERS_LIST="
4f979418 1475 AVFoundation_AVFoundation_h
7a650caf
DB
1476 alsa_asoundlib_h
1477 altivec_h
1478 arpa_inet_h
1479 cdio_paranoia_h
1480 cdio_paranoia_paranoia_h
6bb99757 1481 dispatch_dispatch_h
7a650caf
DB
1482 dev_bktr_ioctl_bt848_h
1483 dev_bktr_ioctl_meteor_h
1484 dev_ic_bt8xx_h
1485 dev_video_bktr_ioctl_bt848_h
1486 dev_video_meteor_ioctl_meteor_h
1487 direct_h
1488 dlfcn_h
d8039ef8 1489 d3d11_h
7a650caf
DB
1490 dxva_h
1491 gsm_h
1492 io_h
1493 mach_mach_time_h
1494 machine_ioctl_bt848_h
1495 machine_ioctl_meteor_h
1496 malloc_h
1497 poll_h
1498 sndio_h
1499 soundcard_h
1500 sys_mman_h
1501 sys_param_h
1502 sys_resource_h
1503 sys_select_h
1504 sys_soundcard_h
1505 sys_time_h
1506 sys_un_h
1507 sys_videoio_h
1508 unistd_h
eaa2d123 1509 valgrind_valgrind_h
7a650caf
DB
1510 windows_h
1511 winsock2_h
1512"
1513
d45ebd48
JG
1514INTRINSICS_LIST="
1515 intrinsics_neon
1516"
1517
79042ab3 1518MATH_FUNCS="
fab0a8b2
MR
1519 atanf
1520 atan2f
79042ab3 1521 cbrtf
fab0a8b2 1522 cosf
79042ab3
DB
1523 exp2
1524 exp2f
fab0a8b2 1525 expf
79042ab3
DB
1526 isinf
1527 isnan
fab0a8b2 1528 ldexpf
79042ab3
DB
1529 llrint
1530 llrintf
1531 log2
1532 log2f
fab0a8b2 1533 log10f
79042ab3
DB
1534 lrint
1535 lrintf
fab0a8b2 1536 powf
79042ab3
DB
1537 rint
1538 round
1539 roundf
fab0a8b2 1540 sinf
79042ab3
DB
1541 trunc
1542 truncf
1543"
1544
7a650caf 1545SYSTEM_FUNCS="
be1a839c 1546 aligned_malloc
ebef9f5a 1547 clock_gettime
ecf97f22 1548 closesocket
15caccb9 1549 CommandLineToArgvW
a61c2115 1550 CoTaskMemFree
1093383d 1551 CryptGenRandom
c88f5d72 1552 dlopen
534a2231 1553 fcntl
e854b8f9 1554 flt_lim
9d99cc5a 1555 fork
84882df6 1556 getaddrinfo
da9e86f8 1557 gethrtime
667fb97a 1558 getopt
02e8f427 1559 GetProcessAffinityMask
fc5607f8 1560 GetProcessMemoryInfo
4e68cb8a 1561 GetProcessTimes
66be5b45 1562 getrusage
7caf48e0 1563 GetSystemTimeAsFileTime
61183b5a 1564 gettimeofday
3f8f1c6f 1565 gmtime_r
2e1913b1 1566 inet_aton
abfc8d05 1567 isatty
8772997d 1568 jack_port_get_latency_range
b08caa87 1569 LoadLibrary
a5b64584 1570 localtime_r
c708b540 1571 mach_absolute_time
73f6d31e 1572 MapViewOfFile
c88f5d72 1573 memalign
6ffa87d3 1574 mkstemp
0328b9ea 1575 mmap
e98b02de 1576 mprotect
d3d3a32c 1577 nanosleep
1f91cdce 1578 posix_memalign
ea4d5f48 1579 sched_getaffinity
7e6a11bc 1580 SetConsoleTextAttribute
b507ebd1 1581 setmode
3e0b1c9a 1582 setrlimit
d3d3a32c 1583 Sleep
87958234 1584 strerror_r
7a650caf
DB
1585 sysconf
1586 sysctl
1587 usleep
1588 VirtualAlloc
1589"
1590
1591TOOLCHAIN_FEATURES="
896a5bff 1592 as_dn_directive
d5a55981 1593 as_func
dcae2e32 1594 as_object_arch
7a650caf
DB
1595 asm_mod_q
1596 attribute_may_alias
1597 attribute_packed
1598 ebp_available
1599 ebx_available
1600 gnu_as
1601 ibm_asm
1602 inline_asm_labels
1603 pragma_deprecated
1604 symver_asm_label
1605 symver_gnu_asm
1606 vfp_args
1607 xform_asm
1608 xmm_clobbers
1609"
1610
1611TYPES_LIST="
73ea3ffc 1612 CONDITION_VARIABLE_Ptr
7a650caf 1613 socklen_t
c0018613 1614 struct_addrinfo
75d339e0
MS
1615 struct_group_source_req
1616 struct_ip_mreq_source
b4d68544 1617 struct_ipv6_mreq
cdee08e3 1618 struct_pollfd
3e0b1c9a 1619 struct_rusage_ru_maxrss
b4d68544 1620 struct_sockaddr_in6
3b2372bf 1621 struct_sockaddr_sa_len
33a4dbdd 1622 struct_sockaddr_storage
a6a4793d 1623 struct_v4l2_frmivalenum_discrete
7a650caf
DB
1624"
1625
1626HAVE_LIST="
1627 $ARCH_EXT_LIST
1628 $(add_suffix _external $ARCH_EXT_LIST)
1629 $(add_suffix _inline $ARCH_EXT_LIST)
1630 $ARCH_FEATURES
1631 $ATOMICS_LIST
1632 $BUILTIN_LIST
1633 $HAVE_LIST_CMDLINE
1634 $HAVE_LIST_PUB
1635 $HEADERS_LIST
d45ebd48 1636 $INTRINSICS_LIST
7a650caf
DB
1637 $MATH_FUNCS
1638 $SYSTEM_FUNCS
1639 $THREADS_LIST
1640 $TOOLCHAIN_FEATURES
1641 $TYPES_LIST
1642 atomics_native
1643 dos_paths
a61c2115 1644 dxva2_lib
7a650caf
DB
1645 libc_msvcrt
1646 libdc1394_1
1647 libdc1394_2
1648 sdl
f963f803 1649 section_data_rel_ro
b265431e 1650 threads
5d273d3e 1651 vaapi_drm
990e4a66 1652 vaapi_x11
7671dd7c 1653 vdpau_x11
7671dd7c 1654 xlib
0cb78cef 1655"
44161118 1656
511cf612 1657# options emitted with CONFIG_ prefix but not available on the command line
b6bb00b0 1658CONFIG_EXTRA="
87849592 1659 aandcttables
bfe9f48a 1660 ac3dsp
aa11cb79 1661 audio_frame_queue
9a9e2f1c 1662 audiodsp
e74433a8 1663 blockdsp
c67b449b 1664 bswapdsp
8ef33497 1665 cabac
e02de9df 1666 dirac_parse
f6ee61fb 1667 dvprofile
1274ea8d
DB
1668 faandct
1669 faanidct
a9aee08d 1670 fdctdsp
b075869b 1671 flacdsp
71f1ad37 1672 fmtconvert
f5ee2300 1673 g722dsp
bfe9f48a 1674 gcrypt
63ce9fd2 1675 gmp
478fd534 1676 golomb
9cad0e4e 1677 gplv3
0338c396 1678 h263dsp
478fd534
DB
1679 h264chroma
1680 h264dsp
1681 h264pred
915a2a0a 1682 h264qpel
68d8238c 1683 hpeldsp
478fd534 1684 huffman
0d439fbe 1685 huffyuvdsp
512f3ffe 1686 huffyuvencdsp
e3fcb143 1687 idctdsp
bd499d9a 1688 iirfilter
3d5d4623 1689 imdct15
dc4d726b 1690 intrax8
624e2355 1691 iso_media
2edc77dc 1692 ividsp
4978850c 1693 jpegtables
e1319aa1 1694 libx262
9cad0e4e 1695 lgplv3
478fd534 1696 lpc
0c770761 1697 lzf
2d604443 1698 me_cmp
7b9ef8d7 1699 mpeg_er
1e164c0b 1700 mpegaudio
bfe9f48a 1701 mpegaudiodsp
18bbca1f 1702 mpegvideo
ad08dfd5 1703 mpegvideoenc
575ec60e 1704 mss34dsp
f46bb608 1705 pixblockdsp
368f5035 1706 qpeldsp
d0a63d8b 1707 qsv
b04d009b 1708 qsvdec
72b7441a 1709 qsvenc
f704a079 1710 rangecoder
255d9c57 1711 riffdec
3dd5c95d 1712 riffenc
bfe9f48a 1713 rtpdec
5ad2f0bf 1714 rtpenc_chain
5cb4bdb2 1715 rv34dsp
bfe9f48a 1716 sinewin
2ecfd451 1717 snappy
65a80240 1718 srtp
db7f1c7c 1719 startcode
8337e0c5
VG
1720 texturedsp
1721 texturedspenc
57f09608 1722 tpeldsp
104c804b 1723 vaapi_encode
15a24614 1724 vc1dsp
8c53d39e 1725 videodsp
ab9f9876 1726 vp3dsp
d4aea1aa 1727 vp56dsp
d42191c7 1728 vp8dsp
f2051856 1729 wma_freqs
a623aa00 1730 wmv2dsp
b6bb00b0
MR
1731"
1732
520cc7f1 1733CMDLINE_SELECT="
3f5b56e5 1734 $ARCH_EXT_LIST
520cc7f1 1735 $CONFIG_LIST
fd712a55 1736 $HAVE_LIST_CMDLINE
8eee7025 1737 $THREADS_LIST
c8a4ae00 1738 asm
db6107b6 1739 cross_compile
520cc7f1
MR
1740 debug
1741 extra_warnings
8c6afa4d 1742 logging
65d12900 1743 lto
d2bbb2f7 1744 optimizations
749b1f13 1745 rpath
520cc7f1 1746"
426be5dc 1747
7caf48e0 1748PATHS_LIST="
d156bede 1749 bindir
14a8acf1 1750 datadir
f4ca970d 1751 docdir
26759c44
MR
1752 incdir
1753 libdir
26759c44
MR
1754 mandir
1755 prefix
1756 shlibdir
7caf48e0 1757"
426be5dc
DB
1758
1759CMDLINE_SET="
1760 $PATHS_LIST
121d78d0 1761 ar
426be5dc 1762 arch
313c46a6 1763 as
426be5dc
DB
1764 build_suffix
1765 cc
9f57f134 1766 objcc
426be5dc
DB
1767 cpu
1768 cross_prefix
8ae1d87a 1769 custom_allocator
50567afa 1770 dep_cc
604abd02 1771 env
ac63af34 1772 extra_version
9da6609f
MR
1773 host_cc
1774 host_cflags
095792f2 1775 host_ld
9da6609f
MR
1776 host_ldflags
1777 host_libs
82bb3329 1778 host_os
684b28e0 1779 ld
426be5dc 1780 logfile
4ae40685 1781 malloc_prefix
89641463 1782 nm
9cd7b854 1783 optflags
3f8040db 1784 pkg_config
390acbea 1785 pkg_config_flags
154caa67 1786 random_seed
2fad0977 1787 samples
c5200f17
MR
1788 sysinclude
1789 sysroot
a7ada2ba 1790 target_exec
26759c44 1791 target_os
a7ada2ba 1792 target_path
ba13606c 1793 target_samples
aeeb782c 1794 toolchain
426be5dc 1795"
520cc7f1 1796
89f2932b
MR
1797CMDLINE_APPEND="
1798 extra_cflags
9f57f134 1799 extra_objcflags
4cc4b33f 1800 host_cppflags
89f2932b
MR
1801"
1802
912f3148
DB
1803# code dependency declarations
1804
9eeed841 1805# architecture extensions
808fa33c 1806
a2fc0f6a
MR
1807armv5te_deps="arm"
1808armv6_deps="arm"
ab5cb084 1809armv6t2_deps="arm"
8675bcb0 1810armv8_deps="aarch64"
b7b17ed6 1811neon_deps_any="aarch64 arm"
d45ebd48 1812intrinsics_neon_deps="neon"
b7b17ed6 1813vfp_deps_any="aarch64 arm"
b3267559 1814vfpv3_deps="vfp"
808fa33c 1815
637606de
MR
1816map 'eval ${v}_inline_deps=inline_asm' $ARCH_EXT_LIST_ARM
1817
808fa33c
MR
1818altivec_deps="ppc"
1819ppc4xx_deps="ppc"
f22ebd25
LB
1820vsx_deps="altivec"
1821power8_deps="vsx"
808fa33c 1822
84146963
DB
1823cpunop_deps="i686"
1824x86_64_select="i686"
1825x86_64_suggest="fast_cmov"
50cd43f2 1826
808fa33c
MR
1827amd3dnow_deps="mmx"
1828amd3dnowext_deps="amd3dnow"
fb87e69f 1829i686_deps="x86"
9eeed841 1830mmx_deps="x86"
239fdf1b 1831mmxext_deps="mmx"
50cd43f2
DB
1832sse_deps="mmxext"
1833sse2_deps="sse"
1834sse3_deps="sse2"
1835ssse3_deps="sse3"
1836sse4_deps="ssse3"
1837sse42_deps="sse4"
1838avx_deps="sse42"
10b0161d 1839xop_deps="avx"
1b932eb1 1840fma3_deps="avx"
79687079 1841fma4_deps="avx"
4d6ee072 1842avx2_deps="avx"
9eeed841 1843
43b73d59
DB
1844mmx_external_deps="yasm"
1845mmx_inline_deps="inline_asm"
1846mmx_suggest="mmx_external mmx_inline"
1847
84bf8817 1848for ext in $(filter_out mmx $ARCH_EXT_LIST_X86_SIMD); do
43b73d59
DB
1849 eval dep=\$${ext}_deps
1850 eval ${ext}_external_deps='"${dep}_external"'
1851 eval ${ext}_inline_deps='"${dep}_inline"'
1852 eval ${ext}_suggest='"${ext}_external ${ext}_inline"'
1853done
1854
032d4da8
JG
1855aligned_stack_if_any="aarch64 ppc x86"
1856fast_64bit_if_any="aarch64 alpha ia64 mips64 parisc64 ppc64 sparc64 x86_64"
1857fast_clz_if_any="aarch64 alpha avr32 mips ppc x86"
1858fast_unaligned_if_any="aarch64 ppc x86"
eba2233b 1859simd_align_16_if_any="altivec neon sse"
89e053f8 1860
1a5fdf95 1861# system capabilities
b462d132 1862symver_if_any="symver_asm_label symver_gnu_asm"
eaa2d123 1863valgrind_backtrace_deps="!optimizations valgrind_valgrind_h"
b462d132 1864
8558595a
DB
1865# threading support
1866atomics_gcc_if="sync_val_compare_and_swap"
1867atomics_suncc_if="atomic_cas_ptr machine_rw_barrier"
1868atomics_win32_if="MemoryBarrier"
1869atomics_native_if_any="$ATOMICS_LIST"
874c751c 1870w32threads_deps="atomics_native"
8558595a
DB
1871threads_if_any="$THREADS_LIST"
1872
26fbcc85 1873# subsystems
dc609252 1874dct_select="rdft"
e02de9df 1875dirac_parse_select="golomb"
2d604443 1876error_resilience_select="me_cmp"
1274ea8d
DB
1877faandct_deps="faan fdctdsp"
1878faanidct_deps="faan idctdsp"
7d16d853 1879h264dsp_select="startcode"
15932389 1880intrax8_select="blockdsp idctdsp"
26fbcc85
MR
1881mdct_select="fft"
1882rdft_select="fft"
2d604443 1883me_cmp_select="fdctdsp idctdsp pixblockdsp"
7b9ef8d7 1884mpeg_er_select="error_resilience"
1e164c0b 1885mpegaudio_select="mpegaudiodsp"
c4f5c2d6 1886mpegaudiodsp_select="dct"
2870972e 1887mpegvideo_select="blockdsp hpeldsp idctdsp me_cmp mpeg_er videodsp"
2d604443 1888mpegvideoenc_select="me_cmp mpegvideo pixblockdsp qpeldsp"
15a24614 1889vc1dsp_select="h264chroma qpeldsp startcode"
26fbcc85 1890
ed40b6bf 1891# decoders / encoders
d615187f 1892aac_decoder_select="imdct15 mdct sinewin"
bd499d9a 1893aac_encoder_select="audio_frame_queue iirfilter mdct sinewin"
136e19e1 1894aac_latm_decoder_select="aac_decoder aac_latm_parser"
71f1ad37 1895ac3_decoder_select="ac3_parser ac3dsp bswapdsp fmtconvert mdct"
2d604443
DB
1896ac3_encoder_select="ac3dsp audiodsp mdct me_cmp"
1897ac3_fixed_encoder_select="ac3dsp audiodsp mdct me_cmp"
f5ee2300
VG
1898adpcm_g722_decoder_select="g722dsp"
1899adpcm_g722_encoder_select="g722dsp"
e3fcb143 1900aic_decoder_select="golomb idctdsp"
f4d608e3 1901alac_encoder_select="lpc"
c67b449b 1902als_decoder_select="bswapdsp"
b781cc12 1903amrnb_decoder_select="lsp"
2b2a597e 1904amrwb_decoder_select="lsp"
0a36988e 1905amv_decoder_select="sp5x_decoder"
c67b449b 1906ape_decoder_select="bswapdsp"
e3fcb143 1907asv1_decoder_select="blockdsp bswapdsp idctdsp"
f46bb608 1908asv1_encoder_select="bswapdsp fdctdsp pixblockdsp"
e3fcb143 1909asv2_decoder_select="blockdsp bswapdsp idctdsp"
f46bb608 1910asv2_encoder_select="bswapdsp fdctdsp pixblockdsp"
4538729a 1911atrac1_decoder_select="mdct sinewin"
26fbcc85 1912atrac3_decoder_select="mdct"
e6f0bb65 1913atrac3p_decoder_select="mdct sinewin"
e74433a8 1914bink_decoder_select="blockdsp hpeldsp"
f2051856
DB
1915binkaudio_dct_decoder_select="mdct rdft dct sinewin wma_freqs"
1916binkaudio_rdft_decoder_select="mdct rdft sinewin wma_freqs"
e3fcb143 1917cavs_decoder_select="blockdsp golomb h264chroma idctdsp qpeldsp videodsp"
c67b449b 1918cllc_decoder_select="bswapdsp"
9b500b8f 1919comfortnoise_encoder_select="lpc"
9a9e2f1c 1920cook_decoder_select="audiodsp mdct sinewin"
2a91ada8 1921cscd_decoder_select="lzo"
2eef7c62 1922cscd_decoder_suggest="zlib"
71f1ad37 1923dca_decoder_select="fmtconvert mdct"
5c018ee1 1924dds_decoder_select="texturedsp"
e3fcb143 1925dnxhd_decoder_select="blockdsp idctdsp"
f46bb608 1926dnxhd_encoder_select="aandcttables blockdsp fdctdsp idctdsp mpegvideoenc pixblockdsp"
f6ee61fb 1927dvvideo_decoder_select="dvprofile idctdsp"
2d604443 1928dvvideo_encoder_select="dvprofile fdctdsp me_cmp pixblockdsp"
61c31e4e 1929dxa_decoder_deps="zlib"
c45fcf30 1930dxv_decoder_select="lzf texturedsp"
baf91bb9 1931eac3_decoder_select="ac3_decoder"
4264a0dd 1932eac3_encoder_select="ac3_encoder"
e3fcb143
DB
1933eamad_decoder_select="aandcttables blockdsp bswapdsp idctdsp mpegvideo"
1934eatgq_decoder_select="aandcttables idctdsp"
f7d77b9a 1935eatqi_decoder_select="aandcttables blockdsp bswapdsp idctdsp"
38389058 1936exr_decoder_deps="zlib"
cd832f03
DB
1937ffv1_decoder_select="golomb rangecoder"
1938ffv1_encoder_select="rangecoder"
2f02bbcc
DB
1939ffvhuff_decoder_select="huffyuv_decoder"
1940ffvhuff_encoder_select="huffyuv_encoder"
93e15a32 1941fic_decoder_select="golomb"
b075869b
VG
1942flac_decoder_select="flacdsp golomb"
1943flac_encoder_select="bswapdsp flacdsp golomb lpc"
61c31e4e
DB
1944flashsv_decoder_deps="zlib"
1945flashsv_encoder_deps="zlib"
1946flashsv2_decoder_deps="zlib"
4414137e 1947flv_decoder_select="h263_decoder"
4d4b4bd1 1948flv_encoder_select="h263_encoder"
c67b449b
DB
1949fourxm_decoder_select="blockdsp bswapdsp"
1950fraps_decoder_select="bswapdsp huffman"
61c31e4e 1951g2m_decoder_deps="zlib"
4978850c 1952g2m_decoder_select="blockdsp idctdsp jpegtables"
7b9ef8d7 1953h261_decoder_select="mpeg_er mpegvideo"
ad08dfd5 1954h261_encoder_select="aandcttables mpegvideoenc"
7b9ef8d7 1955h263_decoder_select="error_resilience h263_parser h263dsp mpeg_er mpegvideo qpeldsp"
0338c396 1956h263_encoder_select="aandcttables h263dsp mpegvideoenc"
4414137e 1957h263i_decoder_select="h263_decoder"
fe629c2d 1958h263p_encoder_select="h263_encoder"
7d16d853 1959h264_decoder_select="cabac golomb h264chroma h264dsp h264pred h264qpel videodsp"
0b499c9b 1960h264_decoder_suggest="error_resilience"
7ca3e520
VG
1961hap_decoder_select="snappy texturedsp"
1962hap_encoder_deps="libsnappy"
1963hap_encoder_select="texturedspenc"
c67b449b
DB
1964hevc_decoder_select="bswapdsp cabac golomb videodsp"
1965huffyuv_decoder_select="bswapdsp huffyuvdsp"
1966huffyuv_encoder_select="bswapdsp huffman huffyuvencdsp"
34150be5 1967iac_decoder_select="imc_decoder"
c67b449b 1968imc_decoder_select="bswapdsp fft mdct sinewin"
8f992dc8 1969indeo3_decoder_select="hpeldsp"
2edc77dc
VG
1970indeo4_decoder_select="ividsp"
1971indeo5_decoder_select="ividsp"
8071264f 1972interplay_video_decoder_select="hpeldsp"
8e0cf39f 1973jpegls_decoder_select="golomb mjpeg_decoder"
4f034993 1974jpegls_encoder_select="golomb"
e74433a8 1975jv_decoder_select="blockdsp"
0d439fbe 1976lagarith_decoder_select="huffyuvdsp"
4978850c 1977ljpeg_encoder_select="aandcttables idctdsp jpegtables"
4f034993 1978loco_decoder_select="golomb"
e3fcb143 1979mdec_decoder_select="blockdsp idctdsp mpegvideo"
3e589878 1980metasound_decoder_select="lsp mdct sinewin"
e3fcb143 1981mimic_decoder_select="blockdsp bswapdsp hpeldsp idctdsp"
4978850c
DB
1982mjpeg_decoder_select="blockdsp hpeldsp idctdsp jpegtables"
1983mjpeg_encoder_select="aandcttables jpegtables mpegvideoenc"
7caf48e0 1984mjpegb_decoder_select="mjpeg_decoder"
83f230c2
MT
1985mjpeg_vaapi_encoder_deps="VAEncPictureParameterBufferJPEG"
1986mjpeg_vaapi_encoder_select="vaapi_encode jpegtables"
9ecf1b62 1987mlp_decoder_select="mlp_parser"
c67b449b 1988motionpixels_decoder_select="bswapdsp"
1e164c0b
DB
1989mp1_decoder_select="mpegaudio"
1990mp1float_decoder_select="mpegaudio"
1991mp2_decoder_select="mpegaudio"
1992mp2float_decoder_select="mpegaudio"
1993mp3_decoder_select="mpegaudio"
1994mp3adu_decoder_select="mpegaudio"
1995mp3adufloat_decoder_select="mpegaudio"
1996mp3float_decoder_select="mpegaudio"
1997mp3on4_decoder_select="mpegaudio"
1998mp3on4float_decoder_select="mpegaudio"
c67b449b 1999mpc7_decoder_select="bswapdsp mpegaudiodsp"
88b24064 2000mpc8_decoder_select="mpegaudiodsp"
3e0b1c9a 2001mpeg_xvmc_decoder_deps="X11_extensions_XvMClib_h"
d767e2f9 2002mpeg_xvmc_decoder_select="mpeg2video_decoder"
7b9ef8d7 2003mpeg1video_decoder_select="error_resilience mpeg_er mpegvideo"
06b54e84 2004mpeg1video_encoder_select="aandcttables mpegvideoenc"
7b9ef8d7 2005mpeg2video_decoder_select="error_resilience mpeg_er mpegvideo"
06b54e84 2006mpeg2video_encoder_select="aandcttables mpegvideoenc"
3e0b1c9a
DB
2007mpeg4_decoder_select="h263_decoder mpeg4video_parser"
2008mpeg4_encoder_select="h263_encoder"
575ec60e 2009msa1_decoder_select="mss34dsp"
4414137e 2010msmpeg4v1_decoder_select="h263_decoder"
4414137e 2011msmpeg4v2_decoder_select="h263_decoder"
4e169d89 2012msmpeg4v2_encoder_select="h263_encoder"
4414137e 2013msmpeg4v3_decoder_select="h263_decoder"
4e169d89 2014msmpeg4v3_encoder_select="h263_encoder"
b10c33c5 2015mss2_decoder_select="error_resilience mpeg_er mpegvideo vc1_decoder"
575ec60e 2016mts2_decoder_select="mss34dsp"
8e0cf39f 2017mxpeg_decoder_select="mjpeg_decoder"
4538729a 2018nellymoser_decoder_select="mdct sinewin"
aa11cb79 2019nellymoser_encoder_select="audio_frame_queue mdct sinewin"
e3fcb143 2020nuv_decoder_select="idctdsp lzo"
e2834567 2021on2avc_decoder_select="mdct"
b70d7a4a 2022opus_decoder_deps="avresample"
3d5d4623 2023opus_decoder_select="imdct15"
61c31e4e 2024png_decoder_deps="zlib"
61c31e4e 2025png_encoder_deps="zlib"
512f3ffe 2026png_encoder_select="huffyuvencdsp"
e3fcb143 2027prores_decoder_select="idctdsp"
a9aee08d 2028prores_encoder_select="fdctdsp"
b781cc12 2029qcelp_decoder_select="lsp"
c4f5c2d6 2030qdm2_decoder_select="mdct rdft mpegaudiodsp"
aa11cb79 2031ra_144_encoder_select="audio_frame_queue lpc"
9f43fdda 2032ralf_decoder_select="golomb"
533a6198 2033rscc_decoder_deps="zlib"
7b9ef8d7 2034rv10_decoder_select="error_resilience h263_decoder h263dsp mpeg_er"
b2bf38b4 2035rv10_encoder_select="h263_encoder"
7b9ef8d7 2036rv20_decoder_select="error_resilience h263_decoder h263dsp mpeg_er"
b2bf38b4 2037rv20_encoder_select="h263_encoder"
5cb4bdb2
VG
2038rv30_decoder_select="error_resilience golomb h264chroma h264pred h264qpel mpeg_er mpegvideo rv34dsp videodsp"
2039rv40_decoder_select="error_resilience golomb h264chroma h264pred h264qpel mpeg_er mpegvideo rv34dsp videodsp"
9a3202a9 2040screenpresso_decoder_deps="zlib"
4f034993 2041shorten_decoder_select="golomb"
b781cc12 2042sipr_decoder_select="lsp"
8e0cf39f 2043sp5x_decoder_select="mjpeg_decoder"
6caa44aa 2044svq1_decoder_select="hpeldsp"
2d604443 2045svq1_encoder_select="aandcttables hpeldsp me_cmp mpegvideoenc"
add1467e 2046svq3_decoder_select="golomb h264dsp h264pred hpeldsp tpeldsp videodsp"
d48430c3 2047svq3_decoder_suggest="zlib"
9a9e2f1c 2048tak_decoder_select="audiodsp"
247e370e
VG
2049tdsc_decoder_deps="zlib"
2050tdsc_decoder_select="mjpeg_decoder"
4eef77c1 2051theora_decoder_select="vp3_decoder"
7caf48e0 2052thp_decoder_select="mjpeg_decoder"
2eef7c62
AJ
2053tiff_decoder_suggest="zlib"
2054tiff_encoder_suggest="zlib"
aec09a00 2055truehd_decoder_select="mlp_decoder"
c67b449b
DB
2056truemotion2_decoder_select="bswapdsp"
2057truespeech_decoder_select="bswapdsp"
61c31e4e 2058tscc_decoder_deps="zlib"
c0b10575 2059txd_decoder_select="texturedsp"
4538729a 2060twinvq_decoder_select="mdct lsp sinewin"
c67b449b
DB
2061utvideo_decoder_select="bswapdsp"
2062utvideo_encoder_select="bswapdsp huffman huffyuvencdsp"
0d439fbe 2063vble_decoder_select="huffyuvdsp"
15a24614 2064vc1_decoder_select="blockdsp error_resilience h263_decoder h264qpel intrax8 mpeg_er mpegvideo vc1dsp"
45ecda85 2065vc1image_decoder_select="vc1_decoder"
26fbcc85
MR
2066vorbis_decoder_select="mdct"
2067vorbis_encoder_select="mdct"
3bd062bf 2068vp3_decoder_select="hpeldsp vp3dsp videodsp"
d4aea1aa
VG
2069vp5_decoder_select="h264chroma hpeldsp videodsp vp3dsp vp56dsp"
2070vp6_decoder_select="h264chroma hpeldsp huffman videodsp vp3dsp vp56dsp"
e82dc4c9
DB
2071vp6a_decoder_select="vp6_decoder"
2072vp6f_decoder_select="vp6_decoder"
d42191c7
VG
2073vp7_decoder_select="h264pred videodsp vp8dsp"
2074vp8_decoder_select="h264pred videodsp vp8dsp"
72ca830f 2075vp9_decoder_select="videodsp"
c4bfa098 2076webp_decoder_select="vp8_decoder"
f2051856
DB
2077wmapro_decoder_select="mdct sinewin wma_freqs"
2078wmav1_decoder_select="mdct sinewin wma_freqs"
2079wmav1_encoder_select="mdct sinewin wma_freqs"
2080wmav2_decoder_select="mdct sinewin wma_freqs"
2081wmav2_encoder_select="mdct sinewin wma_freqs"
4538729a 2082wmavoice_decoder_select="lsp rdft dct mdct sinewin"
f95bfab0 2083wmv1_decoder_select="h263_decoder"
665507aa 2084wmv1_encoder_select="h263_encoder"
0c6a7087 2085wmv2_decoder_select="blockdsp error_resilience h263_decoder idctdsp intrax8 videodsp wmv2dsp"
a623aa00 2086wmv2_encoder_select="h263_encoder wmv2dsp"
015f8ee0 2087wmv3_decoder_select="vc1_decoder"
45ecda85 2088wmv3image_decoder_select="wmv3_decoder"
61c31e4e
DB
2089zerocodec_decoder_deps="zlib"
2090zlib_decoder_deps="zlib"
2091zlib_encoder_deps="zlib"
2092zmbv_decoder_deps="zlib"
2093zmbv_encoder_deps="zlib"
30fd06be 2094
ed40b6bf 2095# hardware accelerators
31de41ba 2096d3d11va_deps="d3d11_h dxva_h ID3D11VideoDecoder"
e97446e6 2097dxva2_deps="dxva2api_h DXVA2_ConfigPictureDecode"
0afab17e 2098vaapi_deps="va_va_h"
ac3dbb4d 2099vda_deps="VideoDecodeAcceleration_VDADecoder_h pthreads"
9840130e 2100vda_extralibs="-framework CoreFoundation -framework VideoDecodeAcceleration -framework QuartzCore"
c89c96e9
MR
2101vdpau_deps="vdpau_vdpau_h vdpau_vdpau_x11_h"
2102
82ca17ac
DB
2103h263_vaapi_hwaccel_deps="vaapi"
2104h263_vaapi_hwaccel_select="h263_decoder"
d8039ef8
SL
2105h264_d3d11va_hwaccel_deps="d3d11va"
2106h264_d3d11va_hwaccel_select="h264_decoder"
215cdd35
DB
2107h264_dxva2_hwaccel_deps="dxva2"
2108h264_dxva2_hwaccel_select="h264_decoder"
c4845616 2109h264_mmal_decoder_deps="mmal"
84bba368 2110h264_mmal_decoder_select="mmal"
c4845616 2111h264_mmal_hwaccel_deps="mmal"
e8919ec4 2112h264_omx_encoder_deps="omx"
11c22dfd 2113h264_qsv_hwaccel_deps="libmfx"
82ca17ac
DB
2114h264_vaapi_hwaccel_deps="vaapi"
2115h264_vaapi_hwaccel_select="h264_decoder"
2116h264_vda_hwaccel_deps="vda"
2117h264_vda_hwaccel_select="h264_decoder"
67afcefb
AK
2118h264_vda_old_hwaccel_deps="vda"
2119h264_vda_old_hwaccel_select="h264_decoder"
82ca17ac
DB
2120h264_vdpau_hwaccel_deps="vdpau"
2121h264_vdpau_hwaccel_select="h264_decoder"
d8039ef8
SL
2122hevc_d3d11va_hwaccel_deps="d3d11va DXVA_PicParams_HEVC"
2123hevc_d3d11va_hwaccel_select="hevc_decoder"
7e850fa6
HL
2124hevc_dxva2_hwaccel_deps="dxva2 DXVA_PicParams_HEVC"
2125hevc_dxva2_hwaccel_select="hevc_decoder"
41d47ea8 2126hevc_qsv_hwaccel_deps="libmfx"
8d34a2f8 2127hevc_vdpau_hwaccel_deps="vdpau VdpPictureInfoHEVC"
ab9068cc 2128hevc_vdpau_hwaccel_select="hevc_decoder"
82ca17ac
DB
2129mpeg1_vdpau_hwaccel_deps="vdpau"
2130mpeg1_vdpau_hwaccel_select="mpeg1video_decoder"
d8039ef8
SL
2131mpeg2_d3d11va_hwaccel_deps="d3d11va"
2132mpeg2_d3d11va_hwaccel_select="mpeg2video_decoder"
215cdd35
DB
2133mpeg2_dxva2_hwaccel_deps="dxva2"
2134mpeg2_dxva2_hwaccel_select="mpeg2video_decoder"
d52208e8 2135mpeg2_mmal_decoder_deps="mmal"
84bba368 2136mpeg2_mmal_decoder_select="mmal"
d52208e8 2137mpeg2_mmal_hwaccel_deps="mmal"
bf52f773 2138mpeg2_qsv_hwaccel_deps="libmfx"
82ca17ac
DB
2139mpeg2_vaapi_hwaccel_deps="vaapi"
2140mpeg2_vaapi_hwaccel_select="mpeg2video_decoder"
2141mpeg2_vdpau_hwaccel_deps="vdpau"
2142mpeg2_vdpau_hwaccel_select="mpeg2video_decoder"
e8919ec4 2143mpeg4_omx_encoder_deps="omx"
82ca17ac
DB
2144mpeg4_vaapi_hwaccel_deps="vaapi"
2145mpeg4_vaapi_hwaccel_select="mpeg4_decoder"
82ca17ac
DB
2146mpeg4_vdpau_hwaccel_deps="vdpau"
2147mpeg4_vdpau_hwaccel_select="mpeg4_decoder"
d8039ef8
SL
2148vc1_d3d11va_hwaccel_deps="d3d11va"
2149vc1_d3d11va_hwaccel_select="vc1_decoder"
215cdd35
DB
2150vc1_dxva2_hwaccel_deps="dxva2"
2151vc1_dxva2_hwaccel_select="vc1_decoder"
84bba368 2152vc1_mmal_decoder_deps="mmal"
2153vc1_mmal_decoder_select="mmal"
2154vc1_mmal_hwaccel_deps="mmal"
82ca17ac
DB
2155vc1_vaapi_hwaccel_deps="vaapi"
2156vc1_vaapi_hwaccel_select="vc1_decoder"
82ca17ac
DB
2157vc1_vdpau_hwaccel_deps="vdpau"
2158vc1_vdpau_hwaccel_select="vc1_decoder"
d8039ef8 2159wmv3_d3d11va_hwaccel_select="vc1_d3d11va_hwaccel"
ed40b6bf
DB
2160wmv3_dxva2_hwaccel_select="vc1_dxva2_hwaccel"
2161wmv3_vaapi_hwaccel_select="vc1_vaapi_hwaccel"
77525327 2162wmv3_vdpau_hwaccel_select="vc1_vdpau_hwaccel"
ed40b6bf 2163
330177b5
DB
2164# hardware-accelerated codecs
2165nvenc_deps_any="dlopen LoadLibrary"
2166nvenc_extralibs='$ldl'
e8919ec4
MS
2167omx_deps="dlopen pthreads"
2168omx_extralibs='$ldl'
330177b5
DB
2169qsvdec_select="qsv"
2170qsvenc_select="qsv"
2171vaapi_encode_deps="vaapi"
2172
2173hwupload_cuda_filter_deps="cuda"
2174scale_npp_filter_deps="cuda libnpp"
2175
2176h264_nvenc_encoder_deps="nvenc"
2177h264_qsv_decoder_deps="libmfx"
2178h264_qsv_decoder_select="h264_mp4toannexb_bsf h264_parser qsvdec h264_qsv_hwaccel"
2179h264_qsv_encoder_deps="libmfx"
2180h264_qsv_encoder_select="qsvenc"
2181h264_vaapi_encoder_deps="VAEncPictureParameterBufferH264"
2182h264_vaapi_encoder_select="vaapi_encode golomb"
2183
2184hevc_nvenc_encoder_deps="nvenc"
2185hevc_qsv_decoder_deps="libmfx"
2186hevc_qsv_encoder_deps="libmfx"
2187hevc_qsv_decoder_select="hevc_mp4toannexb_bsf hevc_parser hevc_qsv_hwaccel qsvdec"
2188hevc_qsv_encoder_select="qsvenc"
2189hevc_vaapi_encoder_deps="VAEncPictureParameterBufferHEVC"
2190hevc_vaapi_encoder_select="vaapi_encode golomb"
2191mpeg2_qsv_decoder_deps="libmfx"
2192mpeg2_qsv_decoder_select="qsvdec mpeg2_qsv_hwaccel mpegvideo_parser"
2193mpeg2_qsv_encoder_deps="libmfx"
2194mpeg2_qsv_encoder_select="qsvenc"
2195
2196nvenc_h264_encoder_deps="nvenc"
2197nvenc_hevc_encoder_deps="nvenc"
2198
28b80940 2199# parsers
72da8d9b 2200h264_parser_select="golomb h264dsp"
650060df 2201hevc_parser_select="golomb"
a6a675a7 2202mpegvideo_parser_select="mpegvideo"
de3b134b 2203mpeg4video_parser_select="error_resilience h263dsp mpegvideo qpeldsp"
d24bd96b 2204vc1_parser_select="vc1dsp"
28b80940 2205
4978850c
DB
2206# bitstream_filters
2207mjpeg2jpeg_bsf_select="jpegtables"
2208
912f3148 2209# external libraries
72025ac3 2210libdcadec_decoder_deps="libdcadec"
c9171a83 2211libfaac_encoder_deps="libfaac"
aa11cb79 2212libfaac_encoder_select="audio_frame_queue"
4f2b469d 2213libfdk_aac_decoder_deps="libfdk_aac"
37eeb5e2 2214libfdk_aac_encoder_deps="libfdk_aac"
aa11cb79 2215libfdk_aac_encoder_select="audio_frame_queue"
299c77d5
MR
2216libgsm_decoder_deps="libgsm"
2217libgsm_encoder_deps="libgsm"
8ffed8d8
MR
2218libgsm_ms_decoder_deps="libgsm"
2219libgsm_ms_encoder_deps="libgsm"
3641b048
MS
2220libilbc_decoder_deps="libilbc"
2221libilbc_encoder_deps="libilbc"
233d2fa0 2222libkvazaar_encoder_deps="libkvazaar"
1cc60c47 2223libmp3lame_encoder_deps="libmp3lame"
aa11cb79 2224libmp3lame_encoder_select="audio_frame_queue"
0b175caa
DB
2225libopencore_amrnb_decoder_deps="libopencore_amrnb"
2226libopencore_amrnb_encoder_deps="libopencore_amrnb"
aa11cb79 2227libopencore_amrnb_encoder_select="audio_frame_queue"
0b175caa 2228libopencore_amrwb_decoder_deps="libopencore_amrwb"
8a3d9ca6 2229libopenh264_encoder_deps="libopenh264"
9a77d59a 2230libopenjpeg_decoder_deps="libopenjpeg"
453c02f9 2231libopenjpeg_encoder_deps="libopenjpeg"
44617d6e 2232libopus_decoder_deps="libopus"
6cb8c854 2233libopus_encoder_deps="libopus"
aa11cb79 2234libopus_encoder_select="audio_frame_queue"
f7cd9eed
AS
2235libschroedinger_decoder_deps="libschroedinger"
2236libschroedinger_encoder_deps="libschroedinger"
ae14f311 2237libspeex_decoder_deps="libspeex"
b606a017 2238libspeex_encoder_deps="libspeex"
aa11cb79 2239libspeex_encoder_select="audio_frame_queue"
150d2772 2240libtheora_encoder_deps="libtheora"
718907cd 2241libtwolame_encoder_deps="libtwolame"
d89e738a 2242libvo_aacenc_encoder_deps="libvo_aacenc"
aa11cb79 2243libvo_aacenc_encoder_select="audio_frame_queue"
f502ff3f 2244libvo_amrwbenc_encoder_deps="libvo_amrwbenc"
b0caf888 2245libvorbis_encoder_deps="libvorbis"
aa11cb79 2246libvorbis_encoder_select="audio_frame_queue"
3f111804
LB
2247libvpx_vp8_decoder_deps="libvpx"
2248libvpx_vp8_encoder_deps="libvpx"
2249libvpx_vp9_decoder_deps="libvpx"
2250libvpx_vp9_encoder_deps="libvpx"
84d3ff50 2251libwavpack_encoder_deps="libwavpack"
be7c3231 2252libwebp_encoder_deps="libwebp"
e1319aa1 2253libx262_encoder_deps="libx262"
1cc60c47 2254libx264_encoder_deps="libx264"
50ea9315 2255libx265_encoder_deps="libx265"
de295976 2256libxavs_encoder_deps="libxavs"
1cc60c47 2257libxvid_encoder_deps="libxvid"
30fd06be 2258
912f3148 2259# demuxers / muxers
c2dd0e9e 2260ac3_demuxer_select="ac3_parser"
255d9c57 2261asf_demuxer_select="riffdec"
3dd5c95d 2262asf_muxer_select="riffenc"
647c2356 2263asf_stream_muxer_select="asf_muxer"
624e2355 2264avi_demuxer_select="iso_media riffdec"
3dd5c95d 2265avi_muxer_select="riffenc"
4e622dea 2266avisynth_demuxer_deps="avisynth"
255d9c57 2267avisynth_demuxer_select="riffdec"
624e2355 2268caf_demuxer_select="iso_media riffdec"
fe5e6e34 2269dash_muxer_select="mp4_muxer"
c2dd0e9e 2270dirac_demuxer_select="dirac_parser"
f6ee61fb
AK
2271dv_demuxer_select="dvprofile"
2272dv_muxer_select="dvprofile"
255d9c57 2273dxa_demuxer_select="riffdec"
5b423887 2274eac3_demuxer_select="ac3_parser"
e01fba55 2275f4v_muxer_select="mov_muxer"
c2dd0e9e 2276flac_demuxer_select="flac_parser"
435214a7 2277hds_muxer_select="flv_muxer"
c9031c7c 2278hls_muxer_select="mpegts_muxer"
647c2356 2279ipod_muxer_select="mov_muxer"
31f16dc1 2280ismv_muxer_select="mov_muxer"
647c2356 2281matroska_audio_muxer_select="matroska_muxer"
624e2355 2282matroska_demuxer_select="iso_media riffdec"
2a91ada8 2283matroska_demuxer_suggest="bzlib lzo zlib"
624e2355 2284matroska_muxer_select="iso_media riffenc"
3dd5c95d 2285mmf_muxer_select="riffenc"
624e2355 2286mov_demuxer_select="iso_media riffdec"
4e622dea 2287mov_demuxer_suggest="zlib"
624e2355 2288mov_muxer_select="iso_media riffenc rtpenc_chain"
c2dd0e9e 2289mp3_demuxer_select="mpegaudio_parser"
647c2356 2290mp4_muxer_select="mov_muxer"
624e2355 2291mpegts_demuxer_select="iso_media"
75644335 2292mpegts_muxer_select="adts_muxer latm_muxer"
647c2356
DB
2293mpegtsraw_demuxer_select="mpegts_demuxer"
2294mxf_d10_muxer_select="mxf_muxer"
3dd5c95d 2295nut_muxer_select="riffenc"
255d9c57 2296nuv_demuxer_select="riffdec"
051aadee 2297oga_muxer_select="ogg_muxer"
e02de9df 2298ogg_demuxer_select="dirac_parse"
051aadee 2299opus_muxer_select="ogg_muxer"
647c2356 2300psp_muxer_select="mov_muxer"
44594cc7 2301rtp_demuxer_select="sdp_demuxer"
65a80240 2302rtpdec_select="asf_demuxer jpegtables mov_demuxer mpegts_demuxer rm_demuxer rtp_protocol srtp"
44b70ce5 2303rtsp_demuxer_select="http_protocol rtpdec"
5ad2f0bf 2304rtsp_muxer_select="rtp_muxer http_protocol rtp_protocol rtpenc_chain"
01c8d258 2305sap_demuxer_select="sdp_demuxer"
5ad2f0bf 2306sap_muxer_select="rtp_muxer rtp_protocol rtpenc_chain"
44b70ce5 2307sdp_demuxer_select="rtpdec"
e772f9fa 2308smoothstreaming_muxer_select="ismv_muxer"
f1e94694 2309spdif_muxer_select="aac_parser"
051aadee 2310spx_muxer_select="ogg_muxer"
7570c9e0 2311swf_demuxer_suggest="zlib"
57231e4d 2312tak_demuxer_select="tak_parser"
647c2356
DB
2313tg2_muxer_select="mov_muxer"
2314tgp_muxer_select="mov_muxer"
a7d45e06 2315w64_demuxer_select="wav_demuxer"
255d9c57 2316wav_demuxer_select="riffdec"
3dd5c95d 2317wav_muxer_select="riffenc"
624e2355 2318webm_muxer_select="iso_media riffenc"
e176639b 2319webm_muxer_suggest="libopus_encoder libvorbis_encoder libvpx_vp8_encoder libvpx_vp9_encoder"
82454c3a 2320wtv_demuxer_select="mpegts_demuxer riffdec"
255d9c57
DB
2321xmv_demuxer_select="riffdec"
2322xwma_demuxer_select="riffdec"
4e622dea
SS
2323
2324# indevs / outdevs
38e54a75 2325alsa_indev_deps="alsa_asoundlib_h snd_pcm_htimestamp"
38e54a75 2326alsa_outdev_deps="alsa_asoundlib_h"
4f979418 2327avfoundation_indev_deps="AVFoundation_AVFoundation_h"
38e54a75 2328bktr_indev_deps_any="dev_bktr_ioctl_bt848_h machine_ioctl_bt848_h dev_video_bktr_ioctl_bt848_h dev_ic_bt8xx_h"
6fb65973
DB
2329dv1394_indev_deps="dv1394"
2330dv1394_indev_select="dv_demuxer"
c6f95144 2331fbdev_indev_deps="linux_fb_h"
6bb99757
JK
2332jack_indev_deps="jack_jack_h"
2333jack_indev_deps_any="sem_timedwait dispatch_dispatch_h"
e417d80d 2334libcdio_indev_deps="libcdio"
38e54a75 2335libdc1394_indev_deps="libdc1394"
38e54a75
SS
2336oss_indev_deps_any="soundcard_h sys_soundcard_h"
2337oss_outdev_deps_any="soundcard_h sys_soundcard_h"
0de9c41f 2338pulse_indev_deps="libpulse"
15d59d2c
B
2339sndio_indev_deps="sndio_h"
2340sndio_outdev_deps="sndio_h"
38e54a75 2341v4l2_indev_deps_any="linux_videodev2_h sys_videoio_h"
ec1ee802 2342vfwcap_indev_deps="capCreateCaptureWindow vfwcap_defines"
a1b3c5a3 2343vfwcap_indev_extralibs="-lavicap32"
a6674d2e
LB
2344x11grab_indev_deps="x11grab"
2345x11grab_xcb_indev_deps="libxcb"
30fd06be 2346
912f3148 2347# protocols
acd554c1 2348ffrtmpcrypt_protocol_deps="!librtmp_protocol"
63ce9fd2 2349ffrtmpcrypt_protocol_deps_any="gcrypt gmp openssl"
acd554c1 2350ffrtmpcrypt_protocol_select="tcp_protocol"
775c4d36
SP
2351ffrtmphttp_protocol_deps="!librtmp_protocol"
2352ffrtmphttp_protocol_select="http_protocol"
998c1ee1 2353gopher_protocol_select="network"
279a0c97 2354http_protocol_select="tcp_protocol"
7caf48e0 2355httpproxy_protocol_select="tcp_protocol"
183baead 2356https_protocol_select="tls_protocol"
eb9244f2 2357icecast_protocol_select="http_protocol"
c3b57d6e
DB
2358librtmp_protocol_deps="librtmp"
2359librtmpe_protocol_deps="librtmp"
2360librtmps_protocol_deps="librtmp"
2361librtmpt_protocol_deps="librtmp"
2362librtmpte_protocol_deps="librtmp"
c60a2d70 2363mmsh_protocol_select="http_protocol"
998c1ee1 2364mmst_protocol_select="network"
c3b57d6e 2365rtmp_protocol_deps="!librtmp_protocol"
deeb7012 2366rtmp_protocol_select="tcp_protocol"
acd554c1 2367rtmpe_protocol_select="ffrtmpcrypt_protocol"
6aedabc9
SP
2368rtmps_protocol_deps="!librtmp_protocol"
2369rtmps_protocol_select="tls_protocol"
775c4d36 2370rtmpt_protocol_select="ffrtmphttp_protocol"
08cd95e8 2371rtmpte_protocol_select="ffrtmpcrypt_protocol ffrtmphttp_protocol"
6c1ed454 2372rtmpts_protocol_select="ffrtmphttp_protocol https_protocol"
deeb7012 2373rtp_protocol_select="udp_protocol"
998c1ee1
DB
2374sctp_protocol_deps="struct_sctp_event_subscribe"
2375sctp_protocol_select="network"
65a80240 2376srtp_protocol_select="rtp_protocol srtp"
998c1ee1 2377tcp_protocol_select="network"
d8ffb205 2378tls_gnutls_protocol_deps="gnutls"
876d441f 2379tls_gnutls_protocol_select="tcp_protocol"
d8ffb205 2380tls_openssl_protocol_deps="openssl !tls_gnutls_protocol"
876d441f 2381tls_openssl_protocol_select="tcp_protocol"
b4a0f172 2382tls_protocol_deps_any="tls_gnutls_protocol tls_openssl_protocol"
998c1ee1 2383udp_protocol_select="network"
60538758
LB
2384unix_protocol_deps="sys_un_h"
2385unix_protocol_select="network"
c08fb000 2386
6ebf0bfc 2387# filters
13fabd7a 2388blackframe_filter_deps="gpl"
ce6b6ef6 2389boxblur_filter_deps="gpl"
1c0210c7 2390bs2b_filter_deps="libbs2b"
68b79bfc 2391cropdetect_filter_deps="gpl"
b157be1f 2392delogo_filter_deps="gpl"
a5b64584 2393drawtext_filter_deps="libfreetype"
61b323ce 2394frei0r_filter_deps="frei0r dlopen"
cfec77aa 2395frei0r_filter_extralibs='$ldl'
61b323ce 2396frei0r_src_filter_deps="frei0r dlopen"
cfec77aa 2397frei0r_src_filter_extralibs='$ldl'
a4dc7aa5 2398hqdn3d_filter_deps="gpl"
3fce1367 2399interlace_filter_deps="gpl"
cf69ad35 2400ocv_filter_deps="libopencv"
7caf48e0 2401resample_filter_deps="avresample"
2f296e39 2402scale_filter_deps="swscale"
98114d70 2403scale_vaapi_filter_deps="vaapi VAProcPipelineParameterBuffer"
6ebf0bfc 2404
ab81f24a 2405# examples
b339182e 2406avcodec_example_deps="avcodec avutil"
e7dfaf16 2407filter_audio_example_deps="avfilter avutil"
b339182e 2408metadata_example_deps="avformat avutil"
ab81f24a 2409output_example_deps="avcodec avformat avutil swscale"
990e4a66 2410qsvdec_example_deps="avcodec avutil libmfx h264_qsv_decoder vaapi_x11"
10421bcf 2411transcode_aac_example_deps="avcodec avformat avresample"
ab81f24a 2412
44951174 2413# libraries, in linking order
d89f2fa9 2414avcodec_deps="avutil"
44951174 2415avdevice_deps="avformat avcodec avutil"
d89f2fa9 2416avfilter_deps="avutil"
44951174 2417avformat_deps="avcodec avutil"
d89f2fa9
DB
2418avresample_deps="avutil"
2419swscale_deps="avutil"
f7679c54 2420
912f3148 2421# programs
54fd593a 2422avconv_deps="avcodec avfilter avformat avresample swscale"
bce70f81 2423avconv_select="aformat_filter anull_filter asyncts_filter atrim_filter format_filter
0a0e340f 2424 fps_filter null_filter resample_filter scale_filter
bce70f81 2425 setpts_filter trim_filter"
dd53af4b 2426avplay_deps="avcodec avfilter avformat avresample sdl"
d2617193 2427avplay_libs='$sdl_libs'
dd53af4b 2428avplay_select="rdft format_filter transpose_filter hflip_filter vflip_filter"
9e12f0bf 2429avprobe_deps="avcodec avformat"
a2830dca 2430
4da3f410 2431# documentation
92f0abb2 2432pod2man_deps="doc"
4da3f410
DB
2433texi2html_deps="doc"
2434
de6d9b64 2435# default parameters
8a608357 2436
19bd477d 2437logfile="config.log"
8a608357
MR
2438
2439# installation paths
c9d19248
MR
2440prefix_default="/usr/local"
2441bindir_default='${prefix}/bin'
6291d7e4 2442datadir_default='${prefix}/share/avconv'
f4ca970d 2443docdir_default='${prefix}/share/doc/libav'
c9d19248
MR
2444incdir_default='${prefix}/include'
2445libdir_default='${prefix}/lib'
2446mandir_default='${prefix}/share/man'
2447shlibdir_default="$libdir_default"
8a608357
MR
2448
2449# toolchain
121d78d0 2450ar_default="ar"
13c7df3d 2451cc_default="gcc"
9da6609f 2452host_cc_default="gcc"
4ebc6a74 2453cp_f="cp -f"
b58b00ae 2454ln_s="ln -s -f"
2a8a860a 2455nm_default="nm -g"
11e6d03a 2456objformat="elf"
3f8040db 2457pkg_config_default=pkg-config
be7109c1 2458ranlib="ranlib"
e52567c2 2459strip="strip"
11e6d03a 2460yasmexe="yasm"
8a608357
MR
2461
2462# machine
8d4c00ed 2463arch_default=$(uname -m)
38d0a8aa 2464cpu="generic"
d45ebd48 2465intrinsics="none"
8a608357 2466
8a608357 2467# OS
8d4c00ed
MR
2468target_os_default=$(tolower $(uname -s))
2469host_os=$target_os_default
8a608357 2470
8a608357 2471# configurable options
b4a0f172
DB
2472enable $EXAMPLE_LIST $LIBRARY_LIST $PROGRAM_LIST
2473
3e0b1c9a
DB
2474enable asm
2475enable debug
2476enable doc
1274ea8d 2477enable faan faandct faanidct
8400d6b8 2478enable optimizations
8cfbbd92 2479enable safe_bitstream_reader
530dc538 2480enable static
a9ddb5b1 2481enable swscale_alpha
eaa2d123 2482enable valgrind_backtrace
8a608357 2483
2e2ec667 2484# By default, enable only those hwaccels that have no external dependencies.
d8039ef8 2485enable d3d11va dxva2 vda vdpau
2e2ec667 2486
8a608357 2487# build settings
9987769a 2488SHFLAGS='-shared -Wl,-soname,$$(@F)'
f3ec2d46
SG
2489LIBPREF="lib"
2490LIBSUF=".a"
c5f14466
RP
2491FULLNAME='$(NAME)$(BUILDSUF)'
2492LIBNAME='$(LIBPREF)$(FULLNAME)$(LIBSUF)'
f3ec2d46
SG
2493SLIBPREF="lib"
2494SLIBSUF=".so"
c5f14466 2495SLIBNAME='$(SLIBPREF)$(FULLNAME)$(SLIBSUF)'
b29bddab
DB
2496SLIBNAME_WITH_VERSION='$(SLIBNAME).$(LIBVERSION)'
2497SLIBNAME_WITH_MAJOR='$(SLIBNAME).$(LIBMAJOR)'
6cfac0e9 2498LIB_INSTALL_EXTRA_CMD='$$(RANLIB) "$(LIBDIR)/$(LIBNAME)"'
2f138f0b
MR
2499SLIB_INSTALL_NAME='$(SLIBNAME_WITH_VERSION)'
2500SLIB_INSTALL_LINKS='$(SLIBNAME_WITH_MAJOR) $(SLIBNAME)'
ef0bc4c9 2501
68485d1f
MR
2502asflags_filter=echo
2503cflags_filter=echo
64933b6c
MR
2504ldflags_filter=echo
2505
23565c26 2506AS_C='-c'
bc877faf 2507AS_O='-o $@'
23565c26 2508CC_C='-c'
18031c49 2509CC_E='-E -o $@'
7e6c86e6 2510CC_O='-o $@'
9f57f134
LB
2511OBJCC_C='-c'
2512OBJCC_E='-E -o $@'
2513OBJCC_O='-o $@'
a758c5e2 2514LD_O='-o $@'
8db73c61
MR
2515LD_LIB='-l%'
2516LD_PATH='-L'
23565c26 2517HOSTCC_C='-c'
27565164 2518HOSTCC_E='-E -o $@'
a758c5e2 2519HOSTCC_O='-o $@'
095792f2 2520HOSTLD_O='-o $@'
7e6c86e6 2521
9da6609f 2522host_libs='-lm'
6c3fa06a
MR
2523host_cflags_filter=echo
2524host_ldflags_filter=echo
9da6609f 2525
9b861379 2526target_path='$(CURDIR)'
a7ada2ba 2527
a158446b
MR
2528# since the object filename is not given with the -MM flag, the compiler
2529# is only able to print the basename, and we must add the path ourselves
a758c5e2
MR
2530DEPCMD='$(DEP$(1)) $(DEP$(1)FLAGS) $($(1)DEP_FLAGS) $< | sed -e "/^\#.*/d" -e "s,^[[:space:]]*$(*F)\\.o,$(@D)/$(*F).o," > $(@:.o=.d)'
2531DEPFLAGS='-MM'
315c741d 2532
c597172e 2533# find source path
24524f36 2534if test -f configure; then
f038cf3c 2535 source_path=.
c597172e 2536else
8477f2de 2537 source_path=$(cd $(dirname "$0"); pwd)
c597172e 2538 echo "$source_path" | grep -q '[[:blank:]]' &&
7483e694 2539 die "Out of tree builds are impossible with whitespace in source path."
337cee68
MC
2540 test -e "$source_path/config.h" &&
2541 die "Out of tree builds are impossible with config.h in source dir."
c597172e
MR
2542fi
2543
13cbe2c0 2544for v in "$@"; do
b04251c5
MR
2545 r=${v#*=}
2546 l=${v%"$r"}
2547 r=$(sh_quote "$r")
29ba0911 2548 LIBAV_CONFIGURATION="${LIBAV_CONFIGURATION# } ${l}${r}"
13cbe2c0 2549done
c597172e 2550
73ef8980
MR
2551find_things(){
2552 thing=$1
2553 pattern=$2
2554 file=$source_path/$3
932ccf39 2555 sed -n "s/^[^#]*$pattern.*([^,]*, *\([^,]*\)\(,.*\)*).*/\1_$thing/p" "$file"
73ef8980
MR
2556}
2557
2558ENCODER_LIST=$(find_things encoder ENC libavcodec/allcodecs.c)
2559DECODER_LIST=$(find_things decoder DEC libavcodec/allcodecs.c)
5666fd73 2560HWACCEL_LIST=$(find_things hwaccel HWACCEL libavcodec/allcodecs.c)
73ef8980 2561PARSER_LIST=$(find_things parser PARSER libavcodec/allcodecs.c)
73ef8980
MR
2562MUXER_LIST=$(find_things muxer _MUX libavformat/allformats.c)
2563DEMUXER_LIST=$(find_things demuxer DEMUX libavformat/allformats.c)
38e54a75
SS
2564OUTDEV_LIST=$(find_things outdev OUTDEV libavdevice/alldevices.c)
2565INDEV_LIST=$(find_things indev _IN libavdevice/alldevices.c)
81124ba0 2566FILTER_LIST=$(find_things filter FILTER libavfilter/allfilters.c)
c597172e 2567
2758cded
AK
2568find_things_extern(){
2569 thing=$1
2570 pattern=$2
2571 file=$source_path/$3
2572 sed -n "s/^[^#]*extern.*$pattern *ff_\([^ ]*\)_$thing;/\1_$thing/p" "$file"
2573}
2574
33d18982 2575BSF_LIST=$(find_things_extern bsf AVBitStreamFilter libavcodec/bitstream_filters.c)
2758cded
AK
2576PROTOCOL_LIST=$(find_things_extern protocol URLProtocol libavformat/protocols.c)
2577
54e75be4
DB
2578ALL_COMPONENTS="
2579 $BSF_LIST
2580 $DECODER_LIST
2581 $DEMUXER_LIST
2582 $ENCODER_LIST
2583 $FILTER_LIST
2584 $HWACCEL_LIST
2585 $INDEV_LIST
2586 $MUXER_LIST
2587 $OUTDEV_LIST
2588 $PARSER_LIST
2589 $PROTOCOL_LIST
2590"
2591
b4a0f172
DB
2592for n in $COMPONENT_LIST; do
2593 v=$(toupper ${n%s})_LIST
2594 eval enable \$$v
2595 eval ${n}_if_any="\$$v"
2596done
2597
206a070d 2598enable $ARCH_EXT_LIST
c597172e
MR
2599
2600die_unknown(){
2601 echo "Unknown option \"$1\"."
2602 echo "See $0 --help for available options."
2603 exit 1
2604}
2605
7432e872 2606print_3_columns() {
bf12a81c 2607 printf "%-25s %-25s %-25s\n" $(cat | tr ' ' '\n' | sort)
7432e872
DB
2608}
2609
794f8e97 2610show_list() {
bf0c4afa
RP
2611 suffix=_$1
2612 shift
7432e872 2613 echo $* | sed s/$suffix//g | print_3_columns
794f8e97
PI
2614 exit 0
2615}
2616
154caa67
MR
2617rand_list(){
2618 IFS=', '
2619 set -- $*
2620 unset IFS
2621 for thing; do
2622 comp=${thing%:*}
2623 prob=${thing#$comp}
2624 prob=${prob#:}
2625 is_in ${comp} $COMPONENT_LIST && eval comp=\$$(toupper ${comp%s})_LIST
2626 echo "prob ${prob:-0.5}"
2627 printf '%s\n' $comp
2628 done
2629}
2630
2631do_random(){
2632 action=$1
2633 shift
2634 random_seed=$(awk "BEGIN { srand($random_seed); print srand() }")
2635 $action $(rand_list "$@" | awk "BEGIN { srand($random_seed) } \$1 == \"prob\" { prob = \$2; next } rand() < prob { print }")
2636}
2637
c597172e 2638for opt do
7483e694
DB
2639 optval="${opt#*=}"
2640 case "$opt" in
ea061af1
DB
2641 --extra-ldflags=*)
2642 add_ldflags $optval
7e9e7cc2 2643 ;;
bb0babd7
LB
2644 --extra-ldexeflags=*)
2645 add_ldexeflags $optval
2646 ;;
ea061af1
DB
2647 --extra-libs=*)
2648 add_extralibs $optval
7e9e7cc2 2649 ;;
ea061af1
DB
2650 --disable-devices)
2651 disable $INDEV_LIST $OUTDEV_LIST
7e9e7cc2 2652 ;;
ea061af1
DB
2653 --enable-debug=*)
2654 debuglevel="$optval"
7e9e7cc2
MR
2655 ;;
2656 --disable-programs)
2657 disable $PROGRAM_LIST
2658 ;;
2659 --disable-everything)
b4a0f172 2660 map 'eval unset \${$(toupper ${v%s})_LIST}' $COMPONENT_LIST
7e9e7cc2 2661 ;;
844c6852 2662 --disable-all)
b4a0f172 2663 map 'eval unset \${$(toupper ${v%s})_LIST}' $COMPONENT_LIST
844c6852
DB
2664 disable $LIBRARY_LIST $PROGRAM_LIST doc
2665 ;;
7e9e7cc2
MR
2666 --enable-random|--disable-random)
2667 action=${opt%%-random}
2668 do_random ${action#--} $COMPONENT_LIST
2669 ;;
2670 --enable-random=*|--disable-random=*)
2671 action=${opt%%-random=*}
2672 do_random ${action#--} $optval
2673 ;;
2674 --enable-*=*|--disable-*=*)
2675 eval $(echo "${opt%%=*}" | sed 's/--/action=/;s/-/ thing=/')
2676 is_in "${thing}s" $COMPONENT_LIST || die_unknown "$opt"
2677 eval list=\$$(toupper $thing)_LIST
2678 name=$(echo "${optval}" | sed "s/,/_${thing}|/g")_${thing}
2679 $action $(filter "$name" $list)
2680 ;;
894682a9
AK
2681 --enable-avserver|--disable-avserver*)
2682 warn "avserver has been removed, the ${opt} option is only"\
2683 "provided for compatibility and will be removed in the future"
2684 ;;
7e9e7cc2
MR
2685 --enable-?*|--disable-?*)
2686 eval $(echo "$opt" | sed 's/--/action=/;s/-/ option=/;s/-/_/g')
2687 if is_in $option $COMPONENT_LIST; then
b4a0f172 2688 test $action = disable && action=unset
7e9e7cc2
MR
2689 eval $action \$$(toupper ${option%s})_LIST
2690 elif is_in $option $CMDLINE_SELECT; then
2691 $action $option
2692 else
2693 die_unknown $opt
2694 fi
2695 ;;
2696 --list-*)
2697 NAME="${opt#--list-}"
2698 is_in $NAME $COMPONENT_LIST || die_unknown $opt
2699 NAME=${NAME%s}
2700 eval show_list $NAME \$$(toupper $NAME)_LIST
2701 ;;
2702 --help|-h) show_help
2703 ;;
2704 *)
2705 optname="${opt%%=*}"
2706 optname="${optname#--}"
2707 optname=$(echo "$optname" | sed 's/-/_/g')
2708 if is_in $optname $CMDLINE_SET; then
2709 eval $optname='$optval'
2710 elif is_in $optname $CMDLINE_APPEND; then
2711 append $optname "$optval"
2712 else
2713 die_unknown $opt
2714 fi
2715 ;;
7483e694 2716 esac
c597172e 2717done
604abd02 2718
76eb0950 2719for e in $env; do
604abd02
LB
2720 eval "export $e"
2721done
c597172e 2722
bcea99bb
MR
2723disabled logging && logfile=/dev/null
2724
d7a5a178
LB
2725# Disable all the library-specific components if the library itself
2726# is disabled, see AVCODEC_LIST and following _LIST variables.
2727
2728disable_components(){
b4a0f172 2729 disabled ${1} && disable $(
d7a5a178
LB
2730 eval components="\$$(toupper ${1})_COMPONENTS"
2731 map 'eval echo \${$(toupper ${v%s})_LIST}' $components
2732 )
2733}
2734
2735map 'disable_components $v' $LIBRARY_LIST
2736
29ba0911 2737echo "# $0 $LIBAV_CONFIGURATION" > $logfile
bcea99bb
MR
2738set >> $logfile
2739
aeeb782c 2740case "$toolchain" in
34c9eba9
DB
2741 *-asan)
2742 cc_default="${toolchain%-asan}"
19f251a2
LB
2743 add_cflags -fsanitize=address
2744 add_ldflags -fsanitize=address
0fbb62a8 2745 ;;
c11a8586
LB
2746 *-msan)
2747 cc_default="${toolchain%-msan}"
2748 add_cflags -fsanitize=memory -fsanitize-memory-track-origins
2749 add_ldflags -fsanitize=memory
2750 ;;
34c9eba9
DB
2751 *-tsan)
2752 cc_default="${toolchain%-tsan}"
19f251a2
LB
2753 add_cflags -fsanitize=thread -pie
2754 add_ldflags -fsanitize=thread -pie
34c9eba9
DB
2755 case "$toolchain" in
2756 gcc-tsan)
2757 add_cflags -fPIC
2758 add_ldflags -fPIC
2759 ;;
2760 esac
0fbb62a8 2761 ;;
34c9eba9
DB
2762 *-usan)
2763 cc_default="${toolchain%-usan}"
d6a27f88
LB
2764 add_cflags -fsanitize=undefined
2765 add_ldflags -fsanitize=undefined
34c9eba9
DB
2766 case "$toolchain" in
2767 clang-usan)
2768 add_cflags -O1
2769 ;;
2770 esac
d6a27f88 2771 ;;
34c9eba9 2772 valgrind-*)
b1ee8eec 2773 target_exec_default="valgrind"
34c9eba9
DB
2774 case "$toolchain" in
2775 valgrind-massif)
2776 target_exec_args="--alloc-fn=av_malloc --alloc-fn=av_mallocz"
2777 ;;
2778 valgrind-memcheck)
2779 target_exec_args="--track-origins=yes --leak-check=full"
2780 ;;
2781 esac
b1ee8eec 2782 ;;
aeeb782c 2783 msvc)
16381923
MS
2784 # Check whether the current MSVC version needs the C99 converter.
2785 # From MSVC 2013 (compiler major version 18) onwards, it does actually
ea9f7173 2786 # support enough of C99 to build libav. Default to the new
16381923
MS
2787 # behaviour if the regexp was unable to match anything, since this
2788 # successfully parses the version number of existing supported
2789 # versions that require the converter (MSVC 2010 and 2012).
2790 cl_major_ver=$(cl 2>&1 | sed -n 's/.*Version \([[:digit:]]\{1,\}\)\..*/\1/p')
2791 if [ -z "$cl_major_ver" ] || [ $cl_major_ver -ge 18 ]; then
ea9f7173 2792 cc_default="cl"
16381923
MS
2793 else
2794 cc_default="c99wrap cl"
2795 fi
c9edbe4a 2796 ld_default="$source_path/compat/windows/mslink"
aeeb782c 2797 nm_default="dumpbin -symbols"
ac3a9b51 2798 ar_default="lib"
2192ff84
MS
2799 case "$arch" in
2800 arm*)
2801 as_default="armasm"
2802 ;;
2803 esac
53e8cd68 2804 target_os_default="win32"
ea9f7173
MS
2805 # Use a relative path for TMPDIR. This makes sure all the
2806 # ffconf temp files are written with a relative path, avoiding
2807 # issues with msys/win32 path conversion for MSVC parameters
2808 # such as -Fo<file> or -out:<file>.
2809 TMPDIR=.
aeeb782c 2810 ;;
322e4194 2811 icl)
ea9f7173
MS
2812 cc_default="icl"
2813 ld_default="xilink"
322e4194
AS
2814 nm_default="dumpbin -symbols"
2815 ar_default="xilib"
2816 target_os_default="win32"
ea9f7173 2817 TMPDIR=.
322e4194 2818 ;;
a862c7d3
RT
2819 gcov)
2820 add_cflags -fprofile-arcs -ftest-coverage
2821 add_ldflags -fprofile-arcs -ftest-coverage
2822 ;;
59b9d2f6
LB
2823 llvm-cov)
2824 add_cflags -fprofile-arcs -ftest-coverage
2825 add_ldflags --coverage
2826 ;;
e7891305 2827 hardened)
2d589273
DB
2828 add_cppflags -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2
2829 add_cflags -fno-strict-overflow -fstack-protector-all
2830 add_ldflags -Wl,-z,relro -Wl,-z,now
e7891305 2831 ;;
aeeb782c
MR
2832 ?*)
2833 die "Unknown toolchain $toolchain"
2834 ;;
2835esac
2836
faab8f9f
JG
2837test -n "$cross_prefix" && enable cross_compile
2838
2839if enabled cross_compile; then
2840 test -n "$arch" && test -n "$target_os" ||
2841 die "Must specify target arch and OS when cross-compiling"
2842fi
2843
82b6e451
LB
2844ar_default="${cross_prefix}${ar_default}"
2845cc_default="${cross_prefix}${cc_default}"
9f57f134 2846occ_default="${cross_prefix}${occ_default}"
82b6e451
LB
2847nm_default="${cross_prefix}${nm_default}"
2848pkg_config_default="${cross_prefix}${pkg_config_default}"
2849ranlib="${cross_prefix}${ranlib}"
2850strip="${cross_prefix}${strip}"
2851
2852sysinclude_default="${sysroot}/usr/include"
2853
b1ee8eec 2854set_default arch cc pkg_config sysinclude target_exec target_os
9da6609f
MR
2855enabled cross_compile || host_cc_default=$cc
2856set_default host_cc
13c7df3d 2857
762f95e4
MR
2858if ! $pkg_config --version >/dev/null 2>&1; then
2859 warn "$pkg_config not found, library detection may fail."
2860 pkg_config=false
2861fi
2862
82bb3329
MR
2863exesuf() {
2864 case $1 in
a38a4f44 2865 mingw32*|mingw64*|win32|win64|cygwin*|*-dos|freedos|opendos|os/2*|symbian) echo .exe ;;
82bb3329
MR
2866 esac
2867}
2868
2869EXESUF=$(exesuf $target_os)
2870HOSTEXESUF=$(exesuf $host_os)
c0f5b7f1 2871
e4e69e0b 2872# set temporary file name
a49d42c2 2873: ${TMPDIR:=$TEMPDIR}
c51fafa1 2874: ${TMPDIR:=$TMP}
a49d42c2 2875: ${TMPDIR:=/tmp}
e4e69e0b 2876
a210bce2 2877if ! check_cmd mktemp -u XXXXXX; then
54460a83
MR
2878 # simple replacement for missing mktemp
2879 # NOT SAFE FOR GENERAL USE
2880 mktemp(){
09a5c245 2881 echo "${2%%XXX*}.${HOSTNAME}.${UID}.$$"
54460a83
MR
2882 }
2883fi
2884
2885tmpfile(){
2886 tmp=$(mktemp -u "${TMPDIR}/ffconf.XXXXXXXX")$2 &&
2887 (set -C; exec > $tmp) 2>/dev/null ||
f7ba16a7 2888 die "Unable to create temporary file in $TMPDIR."
54460a83
MR
2889 append TMPFILES $tmp
2890 eval $1=$tmp
2891}
2892
2893trap 'rm -f -- $TMPFILES' EXIT
54460a83 2894
55127e7b 2895tmpfile TMPASM .asm
3e0b1c9a
DB
2896tmpfile TMPC .c
2897tmpfile TMPE $EXESUF
2898tmpfile TMPH .h
2899tmpfile TMPO .o
2900tmpfile TMPS .S
2901tmpfile TMPSH .sh
2902tmpfile TMPV .ver
54460a83
MR
2903
2904unset -f mktemp
e4e69e0b 2905
fb3c4ffc
MR
2906chmod +x $TMPE
2907
993f2d0f
MR
2908# make sure we can execute files in $TMPDIR
2909cat > $TMPSH 2>> $logfile <<EOF
2910#! /bin/sh
2911EOF
2912chmod +x $TMPSH >> $logfile 2>&1
2913if ! $TMPSH >> $logfile 2>&1; then
2914 cat <<EOF
2915Unable to create and execute files in $TMPDIR. Set the TMPDIR environment
2916variable to another directory and make sure that it is not mounted noexec.
2917EOF
2918 die "Sanity test failed."
2919fi
993f2d0f 2920
08b94f16
MS
2921armasm_flags(){
2922 for flag; do
2923 case $flag in
2924 # Filter out MSVC cl.exe options from cflags that shouldn't
2925 # be passed to gas-preprocessor
2926 -M[TD]*) ;;
2927 *) echo $flag ;;
2928 esac
2929 done
2930}
2931
457cc333
MR
2932ccc_flags(){
2933 for flag; do
2934 case $flag in
2935 -std=c99) echo -c99 ;;
2936 -mcpu=*) echo -arch ${flag#*=} ;;
2937 -mieee) echo -ieee ;;
2938 -O*|-fast) echo $flag ;;
2939 -fno-math-errno) echo -assume nomath_errno ;;
2940 -g) echo -g3 ;;
2941 -Wall) echo -msg_enable level2 ;;
2942 -Wno-pointer-sign) echo -msg_disable ptrmismatch1 ;;
2943 -Wl,*) echo $flag ;;
2944 -f*|-W*) ;;
2945 *) echo $flag ;;
2946 esac
2947 done
2948}
2949
e5d45e02
LB
2950cparser_flags(){
2951 for flag; do
2952 case $flag in
2953 -Wno-switch) echo -Wno-switch-enum ;;
2954 -Wno-format-zero-length) ;;
2955 -Wdisabled-optimization) ;;
2956 -Wno-pointer-sign) echo -Wno-other ;;
2957 *) echo $flag ;;
2958 esac
2959 done
2960}
2961
14fb9d3d 2962msvc_common_flags(){
dfa559bc
RB
2963 for flag; do
2964 case $flag in
14fb9d3d
AS
2965 # In addition to specifying certain flags under the compiler
2966 # specific filters, they must be specified here as well or else the
2967 # generic catch all at the bottom will print the original flag.
2968 -Wall) ;;
2969 -std=c99) ;;
2970 # Common flags
9f4a16c5 2971 -fomit-frame-pointer) ;;
dfa559bc 2972 -g) echo -Z7 ;;
dfa559bc
RB
2973 -fno-math-errno) ;;
2974 -fno-common) ;;
2975 -fno-signed-zeros) ;;
50640977 2976 -fPIC) ;;
9f30fb5a
MS
2977 -mthumb) ;;
2978 -march=*) ;;
dfa559bc 2979 -lz) echo zlib.lib ;;
bd680c7b
DB
2980 -lavifil32) echo vfw32.lib ;;
2981 -lavicap32) echo vfw32.lib user32.lib ;;
389b7984 2982 -lx264) echo libx264.lib ;;
dfa559bc 2983 -l*) echo ${flag#-l}.lib ;;
f4d4e66a 2984 -L*) echo -libpath:${flag#-L} ;;
dfa559bc
RB
2985 *) echo $flag ;;
2986 esac
2987 done
2988}
2989
14fb9d3d
AS
2990msvc_flags(){
2991 msvc_common_flags "$@"
2992 for flag; do
2993 case $flag in
ace87c19 2994 -Wall) echo -W4 -wd4244 -wd4127 -wd4018 -wd4389 \
14fb9d3d
AS
2995 -wd4146 -wd4057 -wd4204 -wd4706 -wd4305 \
2996 -wd4152 -wd4324 -we4013 -wd4100 -wd4214 \
91894f27 2997 -wd4273 -wd4554 -wd4701 ;;
14fb9d3d
AS
2998 esac
2999 done
3000}
3001
3002icl_flags(){
3003 msvc_common_flags "$@"
3004 for flag; do
3005 case $flag in
3006 # Despite what Intel's documentation says -Wall, which is supported
3007 # on Windows, does enable remarks so disable them here.
3008 -Wall) echo $flag -Qdiag-disable:remark ;;
3009 -std=c99) echo -Qstd=c99 ;;
3010 esac
3011 done
3012}
3013
d0c6d424
MR
3014pgi_flags(){
3015 for flag; do
3016 case $flag in
643933f5 3017 -flto) echo -Mipa=fast,libopt,libinline,vestigial ;;
d0c6d424
MR
3018 -fomit-frame-pointer) echo -Mnoframe ;;
3019 -g) echo -gopt ;;
3020 *) echo $flag ;;
3021 esac
3022 done
3023}
3024
3025suncc_flags(){
3026 for flag; do
3027 case $flag in
3028 -march=*|-mcpu=*)
3029 case "${flag#*=}" in
3030 native) echo -xtarget=native ;;
3031 v9|niagara) echo -xarch=sparc ;;
3032 ultrasparc) echo -xarch=sparcvis ;;
3033 ultrasparc3|niagara2) echo -xarch=sparcvis2 ;;
3034 i586|pentium) echo -xchip=pentium ;;
3035 i686|pentiumpro|pentium2) echo -xtarget=pentium_pro ;;
3036 pentium3*|c3-2) echo -xtarget=pentium3 ;;
3037 pentium-m) echo -xarch=sse2 -xchip=pentium3 ;;
3038 pentium4*) echo -xtarget=pentium4 ;;
3039 prescott|nocona) echo -xarch=sse3 -xchip=pentium4 ;;
3040 *-sse3) echo -xarch=sse3 ;;
3041 core2) echo -xarch=ssse3 -xchip=core2 ;;
f2ce813e
SM
3042 corei7) echo -xarch=sse4_2 -xchip=nehalem ;;
3043 corei7-avx) echo -xarch=avx -xchip=sandybridge ;;
b36f87ff 3044 amdfam10|barcelona|bdver*) echo -xarch=sse4_1 ;;
ace87c19 3045 athlon-4|athlon-[mx]p) echo -xarch=ssea ;;
d0c6d424 3046 k8|opteron|athlon64|athlon-fx)
ace87c19
DB
3047 echo -xarch=sse2a ;;
3048 athlon*) echo -xarch=pentium_proa ;;
d0c6d424
MR
3049 esac
3050 ;;
3051 -std=c99) echo -xc99 ;;
3052 -fomit-frame-pointer) echo -xregs=frameptr ;;
3053 -fPIC) echo -KPIC -xcode=pic32 ;;
3054 -W*,*) echo $flag ;;
5e753ed5
SM
3055 -f*-*|-W*|-mimpure-text) ;;
3056 -shared) echo -G ;;
d0c6d424
MR
3057 *) echo $flag ;;
3058 esac
3059 done
3060}
3061
3062tms470_flags(){
3063 for flag; do
3064 case $flag in
3065 -march=*|-mcpu=*)
3066 case "${flag#*=}" in
3067 armv7-a|cortex-a*) echo -mv=7a8 ;;
3068 armv7-r|cortex-r*) echo -mv=7r4 ;;
3069 armv7-m|cortex-m*) echo -mv=7m3 ;;
3070 armv6*|arm11*) echo -mv=6 ;;
3071 armv5*e|arm[79]*e*|arm9[24]6*|arm96*|arm102[26])
3072 echo -mv=5e ;;
3073 armv4*|arm7*|arm9[24]*) echo -mv=4 ;;
3074 esac
3075 ;;
3076 -mfpu=neon) echo --float_support=vfpv3 --neon ;;
3077 -mfpu=vfp) echo --float_support=vfpv2 ;;
3078 -mfpu=vfpv3) echo --float_support=vfpv3 ;;
b5198a26 3079 -mfpu=vfpv3-d16) echo --float_support=vfpv3d16 ;;
d0c6d424
MR
3080 -msoft-float) echo --float_support=vfplib ;;
3081 -O[0-3]|-mf=*) echo $flag ;;
3082 -g) echo -g -mn ;;
3083 -pds=*) echo $flag ;;
ad93dccb
MR
3084 -D*|-I*) echo $flag ;;
3085 --gcc|--abi=*) echo $flag ;;
3086 -me) echo $flag ;;
d0c6d424
MR
3087 esac
3088 done
3089}
3090
a758c5e2
MR
3091probe_cc(){
3092 pfx=$1
3093 _cc=$2
3094
8db73c61
MR
3095 unset _type _ident _cc_c _cc_e _cc_o _flags _cflags
3096 unset _ld_o _ldflags _ld_lib _ld_path
18031c49 3097 unset _depflags _DEPCMD _DEPFLAGS
a758c5e2
MR
3098 _flags_filter=echo
3099
3100 if $_cc -v 2>&1 | grep -q '^gcc.*LLVM'; then
3101 _type=llvm_gcc
b197f783
S
3102 gcc_extra_ver=$(expr "$($_cc --version 2>/dev/null | head -n1)" : '.*\((.*)\)')
3103 _ident="llvm-gcc $($_cc -dumpversion 2>/dev/null) $gcc_extra_ver"
a758c5e2
MR
3104 _depflags='-MMD -MF $(@:.o=.d) -MT $@'
3105 _cflags_speed='-O3'
3106 _cflags_size='-Os'
3107 elif $_cc -v 2>&1 | grep -qi ^gcc; then
3108 _type=gcc
3109 gcc_version=$($_cc --version | head -n1)
3110 gcc_basever=$($_cc -dumpversion)
3111 gcc_pkg_ver=$(expr "$gcc_version" : '[^ ]* \(([^)]*)\)')
3112 gcc_ext_ver=$(expr "$gcc_version" : ".*$gcc_pkg_ver $gcc_basever \\(.*\\)")
3113 _ident=$(cleanws "gcc $gcc_basever $gcc_pkg_ver $gcc_ext_ver")
3114 if ! $_cc -dumpversion | grep -q '^2\.'; then
3115 _depflags='-MMD -MF $(@:.o=.d) -MT $@'
3116 fi
3117 _cflags_speed='-O3'
3118 _cflags_size='-Os'
b2d688ea 3119 elif $_cc --version 2>/dev/null | grep -q ^icc; then
a758c5e2
MR
3120 _type=icc
3121 _ident=$($_cc --version | head -n1)
3122 _depflags='-MMD'
3123 _cflags_speed='-O3'
3124 _cflags_size='-Os'
3125 _cflags_noopt='-O1'
3126 elif $_cc -v 2>&1 | grep -q xlc; then
3127 _type=xlc
3128 _ident=$($_cc -qversion 2>/dev/null | head -n1)
3129 _cflags_speed='-O5'
3130 _cflags_size='-O5 -qcompact'
3131 elif $_cc -V 2>/dev/null | grep -q Compaq; then
3132 _type=ccc
3133 _ident=$($_cc -V | head -n1 | cut -d' ' -f1-3)
3134 _DEPFLAGS='-M'
a758c5e2
MR
3135 _cflags_speed='-fast'
3136 _cflags_size='-O1'
457cc333 3137 _flags_filter=ccc_flags
4936ef64 3138 elif $_cc --vsn 2>/dev/null | grep -Eq "ARM (C/C\+\+ )?Compiler"; then
a758c5e2
MR
3139 test -d "$sysroot" || die "No valid sysroot specified."
3140 _type=armcc
ed6d9ce9 3141 _ident=$($_cc --vsn | grep -i build | head -n1 | sed 's/.*: //')
a758c5e2
MR
3142 armcc_conf="$PWD/armcc.conf"
3143 $_cc --arm_linux_configure \
3144 --arm_linux_config_file="$armcc_conf" \
3145 --configure_sysroot="$sysroot" \
3146 --configure_cpp_headers="$sysinclude" >>$logfile 2>&1 ||
3147 die "Error creating armcc configuration file."
3148 $_cc --vsn | grep -q RVCT && armcc_opt=rvct || armcc_opt=armcc
3149 _flags="--arm_linux_config_file=$armcc_conf --translate_gcc"
3150 as_default="${cross_prefix}gcc"
3151 _depflags='-MMD'
3152 _cflags_speed='-O3'
3153 _cflags_size='-Os'
0122118e 3154 elif $_cc -version 2>/dev/null | grep -Eq 'TMS470|TI ARM'; then
a758c5e2
MR
3155 _type=tms470
3156 _ident=$($_cc -version | head -n1 | tr -s ' ')
3157 _flags='--gcc --abi=eabi -me'
18031c49 3158 _cc_e='-ppl -fe=$@'
a758c5e2 3159 _cc_o='-fe=$@'
a758c5e2
MR
3160 _depflags='-ppa -ppd=$(@:.o=.d)'
3161 _cflags_speed='-O3 -mf=5'
3162 _cflags_size='-O3 -mf=2'
3163 _flags_filter=tms470_flags
3164 elif $_cc -v 2>&1 | grep -q clang; then
3165 _type=clang
b197f783 3166 _ident=$($_cc --version 2>/dev/null | head -n1)
9e057f53 3167 _depflags='-MMD -MF $(@:.o=.d) -MT $@'
a758c5e2
MR
3168 _cflags_speed='-O3'
3169 _cflags_size='-Os'
3170 elif $_cc -V 2>&1 | grep -q Sun; then
3171 _type=suncc
3172 _ident=$($_cc -V 2>&1 | head -n1 | cut -d' ' -f 2-)
3173 _DEPCMD='$(DEP$(1)) $(DEP$(1)FLAGS) $($(1)DEP_FLAGS) $< | sed -e "1s,^.*: ,$@: ," -e "\$$!s,\$$, \\\," -e "1!s,^.*: , ," > $(@:.o=.d)'
c72f12cb 3174 _DEPFLAGS='-xM1 -xc99'
a758c5e2
MR
3175 _ldflags='-std=c99'
3176 _cflags_speed='-O5'
3177 _cflags_size='-O5 -xspace'
3178 _flags_filter=suncc_flags
3179 elif $_cc -v 2>&1 | grep -q 'PathScale\|Path64'; then
3180 _type=pathscale
3181 _ident=$($_cc -v 2>&1 | head -n1 | tr -d :)
3182 _depflags='-MMD -MF $(@:.o=.d) -MT $@'
3183 _cflags_speed='-O2'
3184 _cflags_size='-Os'
3185 _flags_filter='filter_out -Wdisabled-optimization'
3186 elif $_cc -v 2>&1 | grep -q Open64; then
3187 _type=open64
3188 _ident=$($_cc -v 2>&1 | head -n1 | tr -d :)
3189 _depflags='-MMD -MF $(@:.o=.d) -MT $@'
3190 _cflags_speed='-O2'
3191 _cflags_size='-Os'
3192 _flags_filter='filter_out -Wdisabled-optimization|-Wtype-limits|-fno-signed-zeros'
3193 elif $_cc -V 2>&1 | grep -q Portland; then
3194 _type=pgi
3195 _ident="PGI $($_cc -V 2>&1 | awk '/^pgcc/ { print $2; exit }')"
8f23907f 3196 opt_common='-alias=ansi -Mdse -Mlre -Mpre'
a758c5e2
MR
3197 _cflags_speed="-O3 -Mautoinline -Munroll=c:4 $opt_common"
3198 _cflags_size="-O2 -Munroll=c:1 $opt_common"
3199 _cflags_noopt="-O1"
3200 _flags_filter=pgi_flags
f4312352
MS
3201 elif $_cc 2>&1 | grep -q 'Microsoft.*ARM.*Assembler'; then
3202 _type=armasm
3203 _ident=$($_cc | head -n1)
3204 # 4509: "This form of conditional instruction is deprecated"
3205 _flags="-nologo -ignore 4509"
08b94f16 3206 _flags_filter=armasm_flags
a54e720e 3207 elif $_cc -nologo- 2>&1 | grep -q Microsoft; then
dfa559bc 3208 _type=msvc
863ee068 3209 _ident=$($_cc 2>&1 | head -n1)
dfa559bc
RB
3210 _DEPCMD='$(DEP$(1)) $(DEP$(1)FLAGS) $($(1)DEP_FLAGS) $< 2>&1 | awk '\''/including/ { sub(/^.*file: */, ""); gsub(/\\/, "/"); if (!match($$0, / /)) print "$@:", $$0 }'\'' > $(@:.o=.d)'
3211 _DEPFLAGS='$(CPPFLAGS) $(CFLAGS) -showIncludes -Zs'
3212 _cflags_speed="-O2"
3213 _cflags_size="-O1"
a54e720e 3214 if $_cc -nologo- 2>&1 | grep -q Linker; then
ea9f7173 3215 _ld_o='-out:$@'
dfa559bc
RB
3216 else
3217 _ld_o='-Fe$@'
3218 fi
ea9f7173
MS
3219 _cc_o='-Fo$@'
3220 _cc_e='-P -Fi$@'
dfa559bc
RB
3221 _flags_filter=msvc_flags
3222 _ld_lib='lib%.a'
3223 _ld_path='-libpath:'
3224 _flags='-nologo'
567ca142 3225 _cflags='-D_USE_MATH_DEFINES -D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_WARNINGS'
322e4194
AS
3226 elif $_cc 2>&1 | grep -q Intel; then
3227 _type=icl
863ee068 3228 _ident=$($_cc 2>&1 | head -n1)
322e4194 3229 _depflags='-QMMD -QMF$(@:.o=.d) -QMT$@'
ace87c19
DB
3230 # Not only is O3 broken on 13.x+ but it is slower on all previous
3231 # versions (tested) as well.
322e4194
AS
3232 _cflags_speed="-O2"
3233 _cflags_size="-O1 -Oi" # -O1 without -Oi miscompiles stuff
322e4194 3234 if $_cc 2>&1 | grep -q Linker; then
ea9f7173 3235 _ld_o='-out:$@'
322e4194
AS
3236 else
3237 _ld_o='-Fe$@'
3238 fi
ea9f7173 3239 _cc_o='-Fo$@'
322e4194 3240 _cc_e='-P'
14fb9d3d 3241 _flags_filter=icl_flags
322e4194
AS
3242 _ld_lib='lib%.a'
3243 _ld_path='-libpath:'
ace87c19 3244 # -Qdiag-error to make icl error when seeing certain unknown arguments
60f09c04 3245 _flags='-nologo -Qdiag-error:4044,10157'
ace87c19
DB
3246 # -Qvec- -Qsimd- to prevent miscompilation, -GS for consistency
3247 # with MSVC which enables it by default.
342b0ba5 3248 _cflags='-D_USE_MATH_DEFINES -Qms0 -Qvec- -Qsimd- -GS'
e5d45e02
LB
3249 elif $_cc --version 2>/dev/null | grep -q ^cparser; then
3250 _type=cparser
3251 _ident=$($_cc --version | head -n1)
3252 _depflags='-MMD'
3253 _cflags_speed='-O4'
3254 _cflags_size='-O2'
3255 _flags_filter=cparser_flags
aef6bd1b 3256 fi
a758c5e2
MR
3257
3258 eval ${pfx}_type=\$_type
3259 eval ${pfx}_ident=\$_ident
3260}
3261
3262set_ccvars(){
23565c26 3263 eval ${1}_C=\${_cc_c-\${${1}_C}}
18031c49 3264 eval ${1}_E=\${_cc_e-\${${1}_E}}
a758c5e2
MR
3265 eval ${1}_O=\${_cc_o-\${${1}_O}}
3266
3267 if [ -n "$_depflags" ]; then
3268 eval ${1}_DEPFLAGS=\$_depflags
3269 else
3270 eval ${1}DEP=\${_DEPCMD:-\$DEPCMD}
3271 eval ${1}DEP_FLAGS=\${_DEPFLAGS:-\$DEPFLAGS}
3272 eval DEP${1}FLAGS=\$_flags
3273 fi
3274}
3275
3276probe_cc cc "$cc"