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