3 # Libav configure script
5 # Copyright (c) 2000-2002 Fabrice Bellard
6 # Copyright (c) 2005-2008 Diego Biurrun
7 # Copyright (c) 2005-2008 Mans Rullgard
10 # Prevent locale nonsense from breaking basic text processing.
14 # make sure we are running under a compatible shell
15 # try to make this part work with most shells
18 echo "Trying shell $1"
19 type "$1" > /dev
/null
2>&1 && exec "$@"
23 (: ${foo%%bar}) 2> /dev
/null
26 (: ${foo?}) 2> /dev
/null
29 if test "$E1" != 0 ||
test "$E2" = 0; then
30 echo "Broken shell detected. Trying alternatives."
32 if test "0$FF_CONF_EXEC" -lt
1; then
34 try_exec bash
"$0" "$@"
36 if test "0$FF_CONF_EXEC" -lt
2; then
38 try_exec ksh
"$0" "$@"
40 if test "0$FF_CONF_EXEC" -lt
3; then
42 try_exec
/usr
/xpg4
/bin
/sh
"$0" "$@"
44 echo "No compatible shell script interpreter found."
45 echo "This configure script requires a POSIX-compatible shell"
46 echo "such as bash or ksh."
47 echo "THIS IS NOT A BUG IN LIBAV, DO NOT REPORT IT AS SUCH."
48 echo "Instead, install a working POSIX-compatible shell."
49 echo "Disabling this configure test will create a broken Libav."
50 if test "$BASH_VERSION" = '2.04.0(1)-release'; then
51 echo "This bash version ($BASH_VERSION) is broken on your platform."
52 echo "Upgrade to a later version if available."
57 test -d
/usr
/xpg4
/bin
&& PATH
=/usr
/xpg4
/bin
:$PATH
61 Usage: configure [options]
62 Options: [defaults in brackets after descriptions]
65 --help print this message
66 --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
79 --logfile=FILE log tests and output to FILE [config.log]
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]
83 --datadir=DIR install data files in DIR [PREFIX/share/avconv]
84 --docdir=DIR install documentation in DIR [PREFIX/share/doc/libav]
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]
89 --enable-rpath use rpath when linking programs [USE WITH CARE]
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]
98 Configuration 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
105 --disable-all disable building components, libraries and programs
108 --disable-programs do not build command line programs
109 --disable-avconv disable avconv build
110 --disable-avplay disable avplay build
111 --disable-avprobe disable avprobe build
112 --disable-avserver deprecated, does nothing
115 --disable-doc do not build documentation
116 --disable-avdevice disable libavdevice build
117 --disable-avcodec disable libavcodec build
118 --disable-avformat disable libavformat build
119 --disable-avutil disable libavutil build
120 --disable-swscale disable libswscale build
121 --disable-avfilter disable video filter support [no]
122 --disable-avresample disable libavresample build [no]
123 --disable-pthreads disable pthreads [auto]
124 --disable-w32threads disable Win32 threads [auto]
125 --disable-network disable network support [no]
126 --disable-dct disable DCT code
127 --disable-error-resilience disable error resilience code
128 --disable-lsp disable LSP code
129 --disable-lzo disable LZO decoder code
130 --disable-mdct disable MDCT code
131 --disable-rdft disable RDFT code
132 --disable-fft disable FFT code
133 --disable-faan disable floating point AAN (I)DCT code
135 Hardware accelerators:
136 --enable-d3d11va enable D3D11VA code
137 --enable-dxva2 enable DXVA2 code
138 --enable-vaapi enable VAAPI code
139 --enable-vda enable VDA code
140 --enable-vdpau enable VDPAU code
142 Individual component options:
143 --disable-everything disable all components listed below
144 --disable-encoder=NAME disable encoder NAME
145 --enable-encoder=NAME enable encoder NAME
146 --disable-encoders disable all encoders
147 --disable-decoder=NAME disable decoder NAME
148 --enable-decoder=NAME enable decoder NAME
149 --disable-decoders disable all decoders
150 --disable-hwaccel=NAME disable hwaccel NAME
151 --enable-hwaccel=NAME enable hwaccel NAME
152 --disable-hwaccels disable all hwaccels
153 --disable-muxer=NAME disable muxer NAME
154 --enable-muxer=NAME enable muxer NAME
155 --disable-muxers disable all muxers
156 --disable-demuxer=NAME disable demuxer NAME
157 --enable-demuxer=NAME enable demuxer NAME
158 --disable-demuxers disable all demuxers
159 --enable-parser=NAME enable parser NAME
160 --disable-parser=NAME disable parser NAME
161 --disable-parsers disable all parsers
162 --enable-bsf=NAME enable bitstream filter NAME
163 --disable-bsf=NAME disable bitstream filter NAME
164 --disable-bsfs disable all bitstream filters
165 --enable-protocol=NAME enable protocol NAME
166 --disable-protocol=NAME disable protocol NAME
167 --disable-protocols disable all protocols
168 --enable-indev=NAME enable input device NAME
169 --disable-indev=NAME disable input device NAME
170 --disable-indevs disable input devices
171 --enable-outdev=NAME enable output device NAME
172 --disable-outdev=NAME disable output device NAME
173 --disable-outdevs disable output devices
174 --disable-devices disable all devices
175 --enable-filter=NAME enable filter NAME
176 --disable-filter=NAME disable filter NAME
177 --disable-filters disable all filters
179 External library support:
180 --enable-avisynth enable reading of AviSynth script files [no]
181 --enable-bzlib enable bzlib [autodetect]
182 --enable-frei0r enable frei0r video filtering
183 --enable-gnutls enable gnutls [no]
184 --enable-libbs2b enable bs2b DSP library [no]
185 --enable-libcdio enable audio CD grabbing with libcdio
186 --enable-libdc1394 enable IIDC-1394 grabbing using libdc1394
188 --enable-libdcadec enable DCA decoding via libdcadec [no]
189 --enable-libfaac enable AAC encoding via libfaac [no]
190 --enable-libfdk-aac enable AAC de/encoding via libfdk-aac [no]
191 --enable-libfreetype enable libfreetype [no]
192 --enable-libgsm enable GSM de/encoding via libgsm [no]
193 --enable-libilbc enable iLBC de/encoding via libilbc [no]
194 --enable-libkvazaar enable HEVC encoding via libkvazaar [no]
195 --enable-libmfx enable HW acceleration through libmfx
196 --enable-libmp3lame enable MP3 encoding via libmp3lame [no]
197 --enable-libopencore-amrnb enable AMR-NB de/encoding via libopencore-amrnb [no]
198 --enable-libopencore-amrwb enable AMR-WB decoding via libopencore-amrwb [no]
199 --enable-libopencv enable video filtering via libopencv [no]
200 --enable-libopenh264 enable H.264 encoding via OpenH264 [no]
201 --enable-libopenjpeg enable JPEG 2000 de/encoding via OpenJPEG [no]
202 --enable-libopus enable Opus de/encoding via libopus [no]
203 --enable-libpulse enable Pulseaudio input via libpulse [no]
204 --enable-librtmp enable RTMP[E] support via librtmp [no]
205 --enable-libschroedinger enable Dirac de/encoding via libschroedinger [no]
206 --enable-libsnappy enable Snappy compression [no]
207 --enable-libspeex enable Speex de/encoding via libspeex [no]
208 --enable-libtheora enable Theora encoding via libtheora [no]
209 --enable-libtwolame enable MP2 encoding via libtwolame [no]
210 --enable-libvo-aacenc enable AAC encoding via libvo-aacenc [no]
211 --enable-libvo-amrwbenc enable AMR-WB encoding via libvo-amrwbenc [no]
212 --enable-libvorbis enable Vorbis encoding via libvorbis [no]
213 --enable-libvpx enable VP8 and VP9 de/encoding via libvpx [no]
214 --enable-libwavpack enable wavpack encoding via libwavpack [no]
215 --enable-libwebp enable WebP encoding via libwebp [no]
216 --enable-libx264 enable H.264 encoding via x264 [no]
217 --enable-libx265 enable HEVC encoding via x265 [no]
218 --enable-libxavs enable AVS encoding via xavs [no]
219 --enable-libxcb enable X11 grabbing using XCB [no]
220 --enable-libxcb-shm enable X11 grabbing shm communication [auto]
221 --enable-libxcb-xfixes enable X11 grabbing mouse rendering [auto]
222 --enable-libxvid enable Xvid encoding via xvidcore,
223 native MPEG-4/Xvid encoder exists [no]
224 --enable-mmal enable decoding via MMAL [no]
225 --enable-nvenc enable encoding via NVENC [no]
226 --enable-openssl enable openssl [no]
227 --enable-x11grab enable X11 grabbing (legacy) [no]
228 --enable-zlib enable zlib [autodetect]
231 --arch=ARCH select architecture [$arch]
232 --cpu=CPU select the minimum required CPU (affects
233 instruction selection, may crash on older CPUs)
234 --cross-prefix=PREFIX use PREFIX for compilation tools [$cross_prefix]
235 --enable-cross-compile assume a cross-compiler is used
236 --sysroot=PATH root of cross-build tree
237 --sysinclude=PATH location of cross-build system headers
238 --target-os=OS compiler targets OS [$target_os]
239 --target-exec=CMD command to run executables on target
240 --target-path=DIR path to view of build directory on target
241 --target-samples=DIR path to samples directory on target
242 --toolchain=NAME set tool defaults according to NAME
244 --ar=AR use archive tool AR [$ar_default]
245 --as=AS use assembler AS [$as_default]
246 --cc=CC use C compiler CC [$cc_default]
247 --objcc=OCC use ObjC compiler OCC [$cc_default]
248 --dep-cc=DEPCC use dependency generator DEPCC [$cc_default]
249 --ld=LD use linker LD
250 --pkg-config=PKGCONFIG use pkg-config tool PKGCONFIG [$pkg_config_default]
251 --pkg-config-flags=FLAGS pass additional flags to pkgconf []
252 --host-cc=HOSTCC use host C compiler HOSTCC
253 --host-cflags=HCFLAGS use HCFLAGS when compiling for host
254 --host-cppflags=HCPPFLAGS use HCPPFLAGS when compiling for host
255 --host-ld=HOSTLD use host linker HOSTLD
256 --host-ldflags=HLDFLAGS use HLDFLAGS when linking for host
257 --host-libs=HLIBS use libs HLIBS when linking for host
258 --host-os=OS compiler host OS [$target_os]
259 --extra-cflags=ECFLAGS add ECFLAGS to CFLAGS [$CFLAGS]
260 --extra-objcflags=FLAGS add FLAGS to OBJCFLAGS [$CFLAGS]
261 --extra-ldflags=ELDFLAGS add ELDFLAGS to LDFLAGS [$LDFLAGS]
262 --extra-ldexeflags=ELDFLAGS add ELDFLAGS to LDEXEFLAGS [$LDEXEFLAGS]
263 --extra-libs=ELIBS add ELIBS [$ELIBS]
264 --extra-version=STRING version string suffix []
265 --optflags=OPTFLAGS override optimization-related compiler flags
266 --build-suffix=SUFFIX library name suffix []
267 --enable-pic build position-independent code
268 --enable-thumb compile for Thumb instruction set
269 --enable-lto use link-time optimization
270 --env="ENV=override" override the environment variables
272 Advanced options (experts only):
273 --malloc-prefix=PREFIX prefix malloc and related names with PREFIX
274 --custom-allocator=NAME use a supported custom allocator
275 --disable-symver disable symbol versioning
276 --enable-hardcoded-tables use hardcoded tables instead of runtime generation
277 --disable-safe-bitstream-reader
278 disable buffer boundary checking in bitreaders
279 (faster, but may crash)
280 --enable-memalign-hack emulate memalign, interferes with memory debuggers
281 --enable-sram allow use of on-chip SRAM
283 Optimization options (experts only):
284 --disable-asm disable all assembly optimizations
285 --disable-altivec disable AltiVec optimizations
286 --disable-vsx disable VSX optimizations
287 --disable-power8 disable POWER8 optimizations
288 --disable-amd3dnow disable 3DNow! optimizations
289 --disable-amd3dnowext disable 3DNow! extended optimizations
290 --disable-mmx disable MMX optimizations
291 --disable-mmxext disable MMXEXT optimizations
292 --disable-sse disable SSE optimizations
293 --disable-sse2 disable SSE2 optimizations
294 --disable-sse3 disable SSE3 optimizations
295 --disable-ssse3 disable SSSE3 optimizations
296 --disable-sse4 disable SSE4 optimizations
297 --disable-sse42 disable SSE4.2 optimizations
298 --disable-avx disable AVX optimizations
299 --disable-xop disable XOP optimizations
300 --disable-fma3 disable FMA3 optimizations
301 --disable-fma4 disable FMA4 optimizations
302 --disable-avx2 disable AVX2 optimizations
303 --disable-armv5te disable armv5te optimizations
304 --disable-armv6 disable armv6 optimizations
305 --disable-armv6t2 disable armv6t2 optimizations
306 --disable-vfp disable VFP optimizations
307 --disable-neon disable NEON optimizations
308 --disable-inline-asm disable use of inline assembly
309 --disable-yasm disable use of nasm/yasm assembly
311 Developer options (useful when working on Libav itself):
312 --disable-debug disable debugging symbols
313 --enable-debug=LEVEL set the debug level [$debuglevel]
314 --disable-optimizations disable compiler optimizations
315 --enable-extra-warnings enable more compiler warnings
316 --samples=PATH location of test samples for FATE, if not set use
317 \$LIBAV_SAMPLES at make invocation time.
318 --enable-neon-clobber-test check NEON registers for clobbering (should be
319 used only for debugging purposes)
320 --enable-xmm-clobber-test check XMM registers for clobbering (Win64-only;
321 should be used only for debugging purposes)
322 --enable-random randomly enable/disable components
324 --enable-random=LIST randomly enable/disable specific components or
325 --disable-random=LIST component groups. LIST is a comma-separated list
326 of NAME[:PROB] entries where NAME is a component
327 (group) and PROB the probability associated with
329 --random-seed=VALUE seed value for --enable/disable-random
330 --disable-valgrind-backtrace do not print a backtrace under Valgrind
331 (only applies to --disable-optimizations builds)
333 NOTE: Object files are built at the place where configure is launched.
341 echo "$@" >> $logfile
348 printf '%5s %s\n' "${i}" "${line}"
350 done < $1 >> $logfile
361 WARNINGS
="${WARNINGS}WARNING: $*\n"
368 If you think configure made a mistake, make sure you are using the latest
369 version from Git. If the latest version fails, report the problem to the
370 libav-tools@libav.org mailing list or IRC #libav on irc.freenode.net.
372 if disabled logging
; then
374 Rerun configure with logging enabled (do not use --disable-logging), and
375 include the log this produces with your report.
379 Include the log file "$logfile" produced by configure as this will help
386 # Avoid locale weirdness, besides we really just want to translate ASCII.
388 echo "$@" |
tr abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ
392 echo "$@" |
tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz
396 echo "$*" |
sed 's/["\\]/\\\0/g'
400 v
=$
(echo "$1" |
sed "s/'/'\\\\''/g")
401 test "x$v" = "x${v#*[!A-Za-z0-9_/.+-]}" || v
="'$v'"
406 echo "$@" |
sed 's/^ *//;s/ */ /g;s/ *$//'
413 eval "case $v in $pat) echo $v ;; esac"
421 eval "case $v in $pat) ;; *) echo $v ;; esac"
428 for v
; do eval $m; done
434 for v
; do echo ${v}${suffix}; done
449 eval : \
${$var:=$value}
454 echo $@ |
sed 's/[^A-Za-z0-9_]/_/g'
460 eval $
(sanitize_var_name
"$var")='$*'
464 eval echo \$$
(sanitize_var_name
"$1")
469 eval level
=\
${${pvar}_level
:=0}
470 eval ${pvar}_
${level}="\$$pvar"
471 eval ${pvar}_level
=$
(($level+1))
477 eval level
=\
${${pvar}_level
:-0}
478 test $level = 0 && continue
479 eval level
=$
(($level-1))
480 eval $pvar="\${${pvar}_${level}}"
481 eval ${pvar}_level
=$level
482 eval unset ${pvar}_
${level}
492 eval test "x\$${var#!}_requested" = "xyes" && die
"${var#*_} ${var/_*} cannot be enabled"
511 enable $
(echo "$var" |
sed 's/[^A-Za-z0-9_]/_/g')
517 disable $
(echo "$var" |
sed 's/[^A-Za-z0-9_]/_/g')
523 enabled
$var && continue
524 eval sel
="\$${var}_select\ \$${var}_select_any"
525 eval sgs
="\$${var}_suggest"
529 enable_deep_weak
$sgs
541 disabled
$var && continue
551 enable ${var}_requested
557 test "${1#!}" = "$1" && op
== || op
=!=
558 eval test "x\$${1#!}" $op "xyes"
562 test "${1#!}" = "$1" && op
== || op
=!=
563 eval test "x\$${1#!}" $op "xno"
568 enabled
$opt ||
return 1
574 disabled
$opt ||
return 1
580 enabled
$opt && return 0
586 disabled
$opt && return 0
593 eval : \
${$opt:=\$${opt}_default
}
601 [ $var = $value ] && return 0
609 enabled
${cfg}_checking
&& die
"Circular dependency for $cfg."
610 disabled
${cfg}_checking
&& continue
611 enable ${cfg}_checking
614 eval dep_all
="\$${cfg}_deps"
615 eval dep_any
="\$${cfg}_deps_any\ \$${cfg}_select_any"
616 eval dep_sel
="\$${cfg}_select"
617 eval dep_sgs
="\$${cfg}_suggest"
618 eval dep_ifa
="\$${cfg}_if"
619 eval dep_ifn
="\$${cfg}_if_any"
621 pushvar cfg dep_all dep_any dep_sel dep_sgs dep_ifa dep_ifn
622 do_check_deps
$dep_all $dep_any $dep_sel $dep_sgs $dep_ifa $dep_ifn
623 popvar cfg dep_all dep_any dep_sel dep_sgs dep_ifa dep_ifn
625 [ -n
"$dep_ifa" ] && { enabled_all
$dep_ifa && enable_weak
$cfg; }
626 [ -n
"$dep_ifn" ] && { enabled_any
$dep_ifn && enable_weak
$cfg; }
627 enabled_all
$dep_all || disable
$cfg
628 enabled_any
$dep_any || disable
$cfg
629 disabled_any
$dep_sel && disable
$cfg
631 if enabled
$cfg; then
633 enable_deep_weak
$dep_sgs
636 disable
${cfg}_checking
645 for cfg
in $allopts; do
646 enabled
$cfg ||
continue
647 eval dep_extralibs
="\$${cfg}_extralibs"
648 test -n
"$dep_extralibs" && add_extralibs
$dep_extralibs
656 map
'eval echo "$v \${$v:-no}"' "$@" |
657 awk "BEGIN { split(\"$files\", files) }
659 c = \"$pfx\" toupper(\$1);
665 if (file ~ /\\.h\$/) {
666 printf(\"#define %s %d\\n\", c, v) >>file;
667 } else if (file ~ /\\.asm\$/) {
668 printf(\"%%define %s %d\\n\", c, v) >>file;
669 } else if (file ~ /\\.mak\$/) {
670 n = -v ? \"\" : \"!\";
671 printf(\"%s%s=yes\\n\", n, c) >>file;
681 enabled
$v && printf "%s\n" ${v%$suf};
688 eval "$var=\"\$$var $*\""
694 eval "$var=\"$* \$$var\""
700 for tok
in $
(eval echo \$
$var); do
701 uniq_list
="$(filter_out $tok $uniq_list) $tok"
703 eval "$var=\"${uniq_list}\""
711 append CFLAGS $
($cflags_filter "$@")
715 append ASFLAGS $
($asflags_filter "$@")
719 append OBJCFLAGS $
($objcflags_filter "$@")
723 append LDFLAGS $
($ldflags_filter "$@")
727 append LDEXEFLAGS $
($ldflags_filter "$@")
731 append STRIPFLAGS
"$@"
735 prepend extralibs $
($ldflags_filter "$@")
739 append host_cppflags
"$@"
743 append host_cflags $
($host_cflags_filter "$@")
747 append host_ldflags $
($host_ldflags_filter "$@")
751 append compat_objs
$1
753 map
'add_cppflags -D$v' "$@"
758 "$@" >> $logfile 2>&1
762 eval printf '%s\\n' $CC_O
766 eval printf '%s\\n' $CC_E
773 check_cmd
$cc $CPPFLAGS $CFLAGS "$@" $CC_C $
(cc_o
$TMPO) $TMPC
780 check_cmd
$objcc $CPPFLAGS $CFLAGS $OBJCFLAGS "$@" $OBJCC_C $
(cc_o
$TMPO) $TMPC
787 check_cmd
$cc $CPPFLAGS $CFLAGS "$@" $
(cc_e
$TMPO) $TMPC
791 eval printf '%s\\n' $AS_O
798 check_cmd
$as $CPPFLAGS $ASFLAGS "$@" $AS_C $
(as_o
$TMPO) $TMPS
802 log check_inline_asm
"$@"
807 check_cc
"$@" <<EOF && enable $name
808 void foo(void){ __asm__ volatile($code); }
814 check_inline_asm
${1}_inline
"\"$2\""
815 echo "$2" | check_as
&& enable ${1}_external || disable
${1}_external
823 check_cmd
$yasmexe $YASMFLAGS "$@" -o
$TMPO $TMPS
827 eval printf '%s\\n' $LD_O
832 flags
=$
(filter_out
'-l*' "$@")
833 libs
=$
(filter
'-l*' "$@")
834 check_cc $
($cflags_filter $flags) ||
return
835 flags
=$
($ldflags_filter $flags)
836 libs
=$
($ldflags_filter $libs)
837 check_cmd
$ld $LDFLAGS $flags $
(ld_o
$TMPE) $TMPO $libs $extralibs
842 test "${hdr%.h}" = "${hdr}" &&
843 echo "#include $hdr" ||
844 echo "#include <$hdr>"
854 for hdr
in $headers; do
857 echo "int main(void) { $code; return 0; }"
858 } | check_
$check "$@"
862 log check_cppflags
"$@"
863 check_cc
"$@" <<EOF && append CPPFLAGS "$@"
870 set -- $
($cflags_filter "$@")
877 log check_cflags
"$@"
878 test_cflags
"$@" && add_cflags
"$@"
883 set -- $
($cflags_filter "$@")
884 check_objcc
"$@" <<EOF
890 log check_cflags
"$@"
891 test_objcflags
"$@" && add_objcflags
"$@"
895 log test_ldflags
"$@"
897 int main(void){ return 0; }
902 log check_ldflags
"$@"
903 test_ldflags
"$@" && add_ldflags
"$@"
907 log test_stripflags
"$@"
908 # call check_cc to get a fresh TMPO
910 int main(void) { return 0; }
912 check_cmd
$strip $STRIPFLAGS "$@" $TMPO
916 log check_stripflags
"$@"
917 test_stripflags
"$@" && add_stripflags
"$@"
921 log check_header
"$@"
925 check_cpp
"$@" <<EOF && enable_safe $header
936 check_ld
"$@" <<EOF && enable $func
938 int main(void){ $func(); }
943 log check_mathfunc
"$@"
947 test $narg = 2 && args
="f, g" || args
="f"
949 check_ld
"$@" <<EOF && enable $func
951 float foo(float f, float g) { return $func($args); }
952 int main(void){ return 0; }
956 check_func_headers
(){
957 log check_func_headers
"$@"
962 for hdr
in $headers; do
965 for func
in $funcs; do
966 echo "long check_$func(void) { return (long) $func; }"
968 echo "int main(void) { return 0; }"
969 } | check_ld
"$@" && enable $funcs && enable_safe
$headers
972 check_cpp_condition
(){
973 log check_cpp_condition
"$@"
980 #error "unsatisfied condition: $condition"
990 check_header
$header && check_func
$func "$@" && add_extralibs
"$@"
998 check_func_headers
"$headers" "$funcs" "$@" && add_extralibs
"$@"
1002 log check_pkg_config
"$@"
1007 check_cmd
$pkg_config --exists
--print-errors
$pkg ||
return
1008 pkg_cflags
=$
($pkg_config --cflags
$pkg_config_flags $pkg)
1009 pkg_libs
=$
($pkg_config --libs
$pkg_config_flags $pkg)
1010 check_func_headers
"$headers" "$funcs" $pkg_cflags $pkg_libs "$@" &&
1011 set_safe
"${pkg}_cflags" $pkg_cflags &&
1012 set_safe
"${pkg}_libs" $pkg_libs
1016 check_ld
"$@" && { enabled cross_compile ||
$TMPE >> $logfile 2>&1; }
1022 # exit() is not async signal safe. _Exit (C99) and _exit (POSIX)
1023 # are safe but may not be available everywhere. Thus we use
1024 # raise(SIGTERM) instead. The check is run in a subshell so we
1025 # can redirect the "Terminated" message from the shell. SIGBUS
1026 # is not defined by standard C so it is used conditionally.
1028 (check_exec
"$@") >> $logfile 2>&1 <<EOF
1030 static void sighandler(int sig){
1036 int (*func_ptr)(void) = foo;
1038 signal(SIGILL, sighandler);
1039 signal(SIGFPE, sighandler);
1040 signal(SIGSEGV, sighandler);
1042 signal(SIGBUS, sighandler);
1054 disable_safe
"$type"
1055 check_code cc
"$headers" "$type v" "$@" && enable_safe
"$type"
1059 log check_struct
"$@"
1064 disable_safe
"${struct}_${member}"
1065 check_code cc
"$headers" "const void *p = &(($struct *)0)->$member" "$@" &&
1066 enable_safe
"${struct}_${member}"
1070 log check_builtin
"$@"
1076 check_code ld
"$headers" "$builtin" "$@" && enable "$name"
1079 check_compile_assert
(){
1080 log check_compile_assert
"$@"
1086 check_code cc
"$headers" "char c[2 * !!($condition) - 1]" "$@" && enable "$name"
1094 check_lib
$header $func "$@" || die
"ERROR: $name not found"
1102 check_lib2
"$headers" $func "$@" || die
"ERROR: $name not found"
1105 require_pkg_config
(){
1107 check_pkg_config
"$@" || die
"ERROR: $pkg not found"
1108 add_cflags $
(get_safe
"${pkg}_cflags")
1109 add_extralibs $
(get_safe
"${pkg}_libs")
1113 eval printf '%s\\n' $HOSTCC_E
1117 eval printf '%s\\n' $HOSTCC_O
1121 log check_host_cc
"$@"
1124 check_cmd
$host_cc $host_cflags "$@" $HOSTCC_C $
(hostcc_o
$TMPO) $TMPC
1128 log check_host_cpp
"$@"
1131 check_cmd
$host_cc $host_cppflags $host_cflags "$@" $
(hostcc_e
$TMPO) $TMPC
1134 check_host_cppflags
(){
1135 log check_host_cppflags
"$@"
1136 check_host_cc
"$@" <<EOF && append host_cppflags "$@"
1141 check_host_cflags
(){
1142 log check_host_cflags
"$@"
1143 set -- $
($host_cflags_filter "$@")
1144 check_host_cc
"$@" <<EOF && append host_cflags "$@"
1149 check_host_cpp_condition
(){
1150 log check_host_cpp_condition
"$@"
1154 check_host_cpp
"$@" <<EOF
1157 #error "unsatisfied condition: $condition"
1165 "$@" < "$file" > "$file.tmp" && mv "$file.tmp" "$file" ||
rm "$file.tmp"
1169 cmp -s
"$1" "$2" && echo "$2 is unchanged" && return
1170 mkdir
-p
"$(dirname $2)"
1174 # CONFIG_LIST contains configurable options, while HAVE_LIST is for
1175 # system-dependent things.
1177 AVCODEC_COMPONENTS
="
1185 AVDEVICE_COMPONENTS
="
1189 AVFILTER_COMPONENTS
="
1192 AVFORMAT_COMPONENTS
="
1198 AVRESAMPLE_COMPONENTS
=""
1199 AVUTIL_COMPONENTS
=""
1203 $AVDEVICE_COMPONENTS
1204 $AVFILTER_COMPONENTS
1205 $AVFORMAT_COMPONENTS
1206 $AVRESAMPLE_COMPONENTS
1212 filter_audio_example
1216 transcode_aac_example
1219 EXTERNAL_LIBRARY_LIST
="
1274 safe_bitstream_reader
1328 $EXTERNAL_LIBRARY_LIST
1393 ARCH_EXT_LIST_X86_SIMD
="
1421 $ARCH_EXT_LIST_X86_SIMD
1426 ARCH_EXT_LIST_MIPS
="
1460 sync_val_compare_and_swap
1474 AVFoundation_AVFoundation_h
1479 cdio_paranoia_paranoia_h
1480 dev_bktr_ioctl_bt848_h
1481 dev_bktr_ioctl_meteor_h
1483 dev_video_bktr_ioctl_bt848_h
1484 dev_video_meteor_ioctl_meteor_h
1492 machine_ioctl_bt848_h
1493 machine_ioctl_meteor_h
1557 GetProcessAffinityMask
1558 GetProcessMemoryInfo
1561 GetSystemTimeAsFileTime
1566 jack_port_get_latency_range
1578 SetConsoleTextAttribute
1589 TOOLCHAIN_FEATURES
="
1610 CONDITION_VARIABLE_Ptr
1613 struct_group_source_req
1614 struct_ip_mreq_source
1617 struct_rusage_ru_maxrss
1619 struct_sockaddr_sa_len
1620 struct_sockaddr_storage
1621 struct_v4l2_frmivalenum_discrete
1626 $(add_suffix _external $ARCH_EXT_LIST)
1627 $(add_suffix _inline $ARCH_EXT_LIST)
1654 # options emitted with CONFIG_ prefix but not available on the command line
1796 # code dependency declarations
1798 # architecture extensions
1803 armv8_deps
="aarch64"
1804 neon_deps_any
="aarch64 arm"
1805 intrinsics_neon_deps
="neon"
1806 vfp_deps_any
="aarch64 arm"
1809 map
'eval ${v}_inline_deps=inline_asm' $ARCH_EXT_LIST_ARM
1817 x86_64_select
="i686"
1818 x86_64_suggest
="fast_cmov"
1821 amd3dnowext_deps
="amd3dnow"
1837 mmx_external_deps
="yasm"
1838 mmx_inline_deps
="inline_asm"
1839 mmx_suggest
="mmx_external mmx_inline"
1841 for ext
in $
(filter_out mmx
$ARCH_EXT_LIST_X86_SIMD); do
1842 eval dep
=\$
${ext}_deps
1843 eval ${ext}_external_deps
='"${dep}_external"'
1844 eval ${ext}_inline_deps
='"${dep}_inline"'
1845 eval ${ext}_suggest
='"${ext}_external ${ext}_inline"'
1848 aligned_stack_if_any
="aarch64 ppc x86"
1849 fast_64bit_if_any
="aarch64 alpha ia64 mips64 parisc64 ppc64 sparc64 x86_64"
1850 fast_clz_if_any
="aarch64 alpha avr32 mips ppc x86"
1851 fast_unaligned_if_any
="aarch64 ppc x86"
1852 simd_align_16_if_any
="altivec neon sse"
1854 # system capabilities
1855 symver_if_any
="symver_asm_label symver_gnu_asm"
1856 valgrind_backtrace_deps
="!optimizations valgrind_valgrind_h"
1859 atomics_gcc_if
="sync_val_compare_and_swap"
1860 atomics_suncc_if
="atomic_cas_ptr machine_rw_barrier"
1861 atomics_win32_if
="MemoryBarrier"
1862 atomics_native_if_any
="$ATOMICS_LIST"
1863 w32threads_deps
="atomics_native"
1864 threads_if_any
="$THREADS_LIST"
1868 dirac_parse_select
="golomb"
1869 error_resilience_select
="me_cmp"
1870 faandct_deps
="faan fdctdsp"
1871 faanidct_deps
="faan idctdsp"
1872 intrax8_select
="error_resilience"
1875 me_cmp_select
="fdctdsp idctdsp pixblockdsp"
1876 mpeg_er_select
="error_resilience"
1877 mpegaudio_select
="mpegaudiodsp"
1878 mpegaudiodsp_select
="dct"
1879 mpegvideo_select
="blockdsp hpeldsp idctdsp me_cmp videodsp"
1880 mpegvideoenc_select
="me_cmp mpegvideo pixblockdsp qpeldsp"
1881 nvenc_deps_any
="dlopen LoadLibrary"
1882 nvenc_extralibs
='$ldl'
1886 # decoders / encoders
1887 aac_decoder_select
="imdct15 mdct sinewin"
1888 aac_encoder_select
="audio_frame_queue iirfilter mdct sinewin"
1889 aac_latm_decoder_select
="aac_decoder aac_latm_parser"
1890 ac3_decoder_select
="ac3_parser ac3dsp bswapdsp fmtconvert mdct"
1891 ac3_encoder_select
="ac3dsp audiodsp mdct me_cmp"
1892 ac3_fixed_encoder_select
="ac3dsp audiodsp mdct me_cmp"
1893 adpcm_g722_decoder_select
="g722dsp"
1894 adpcm_g722_encoder_select
="g722dsp"
1895 aic_decoder_select
="golomb idctdsp"
1896 alac_encoder_select
="lpc"
1897 als_decoder_select
="bswapdsp"
1898 amrnb_decoder_select
="lsp"
1899 amrwb_decoder_select
="lsp"
1900 amv_decoder_select
="sp5x_decoder"
1901 ape_decoder_select
="bswapdsp"
1902 asv1_decoder_select
="blockdsp bswapdsp idctdsp"
1903 asv1_encoder_select
="bswapdsp fdctdsp pixblockdsp"
1904 asv2_decoder_select
="blockdsp bswapdsp idctdsp"
1905 asv2_encoder_select
="bswapdsp fdctdsp pixblockdsp"
1906 atrac1_decoder_select
="mdct sinewin"
1907 atrac3_decoder_select
="mdct"
1908 atrac3p_decoder_select
="mdct sinewin"
1909 bink_decoder_select
="blockdsp hpeldsp"
1910 binkaudio_dct_decoder_select
="mdct rdft dct sinewin wma_freqs"
1911 binkaudio_rdft_decoder_select
="mdct rdft sinewin wma_freqs"
1912 cavs_decoder_select
="blockdsp golomb h264chroma idctdsp qpeldsp videodsp"
1913 cllc_decoder_select
="bswapdsp"
1914 comfortnoise_encoder_select
="lpc"
1915 cook_decoder_select
="audiodsp mdct sinewin"
1916 cscd_decoder_select
="lzo"
1917 cscd_decoder_suggest
="zlib"
1918 dca_decoder_select
="fmtconvert mdct"
1919 dds_decoder_select
="texturedsp"
1920 dnxhd_decoder_select
="blockdsp idctdsp"
1921 dnxhd_encoder_select
="aandcttables blockdsp fdctdsp idctdsp mpegvideoenc pixblockdsp"
1922 dvvideo_decoder_select
="dvprofile idctdsp"
1923 dvvideo_encoder_select
="dvprofile fdctdsp me_cmp pixblockdsp"
1924 dxa_decoder_deps
="zlib"
1925 dxv_decoder_select
="lzf texturedsp"
1926 eac3_decoder_select
="ac3_decoder"
1927 eac3_encoder_select
="ac3_encoder"
1928 eamad_decoder_select
="aandcttables blockdsp bswapdsp idctdsp mpegvideo"
1929 eatgq_decoder_select
="aandcttables idctdsp"
1930 eatqi_decoder_select
="aandcttables blockdsp bswapdsp idctdsp mpeg1video_decoder"
1931 exr_decoder_deps
="zlib"
1932 ffv1_decoder_select
="golomb rangecoder"
1933 ffv1_encoder_select
="rangecoder"
1934 ffvhuff_decoder_select
="huffyuv_decoder"
1935 ffvhuff_encoder_select
="huffyuv_encoder"
1936 fic_decoder_select
="golomb"
1937 flac_decoder_select
="flacdsp golomb"
1938 flac_encoder_select
="bswapdsp flacdsp golomb lpc"
1939 flashsv_decoder_deps
="zlib"
1940 flashsv_encoder_deps
="zlib"
1941 flashsv2_decoder_deps
="zlib"
1942 flv_decoder_select
="h263_decoder"
1943 flv_encoder_select
="h263_encoder"
1944 fourxm_decoder_select
="blockdsp bswapdsp"
1945 fraps_decoder_select
="bswapdsp huffman"
1946 g2m_decoder_deps
="zlib"
1947 g2m_decoder_select
="blockdsp idctdsp jpegtables"
1948 h261_decoder_select
="mpeg_er mpegvideo"
1949 h261_encoder_select
="aandcttables mpegvideoenc"
1950 h263_decoder_select
="error_resilience h263_parser h263dsp mpeg_er mpegvideo qpeldsp"
1951 h263_encoder_select
="aandcttables h263dsp mpegvideoenc"
1952 h263i_decoder_select
="h263_decoder"
1953 h263p_encoder_select
="h263_encoder"
1954 h264_decoder_select
="cabac golomb h264chroma h264dsp h264pred h264qpel startcode videodsp"
1955 h264_decoder_suggest
="error_resilience"
1956 h264_nvenc_encoder_deps
="nvenc"
1957 h264_qsv_decoder_deps
="libmfx"
1958 h264_qsv_decoder_select
="h264_mp4toannexb_bsf h264_parser qsvdec h264_qsv_hwaccel"
1959 h264_qsv_encoder_deps
="libmfx"
1960 h264_qsv_encoder_select
="qsvenc"
1961 hap_decoder_select
="snappy texturedsp"
1962 hap_encoder_deps
="libsnappy"
1963 hap_encoder_select
="texturedspenc"
1964 hevc_decoder_select
="bswapdsp cabac golomb videodsp"
1965 hevc_nvenc_encoder_deps
="nvenc"
1966 hevc_qsv_encoder_deps
="libmfx"
1967 hevc_qsv_decoder_deps
="libmfx"
1968 hevc_qsv_decoder_select
="hevc_mp4toannexb_bsf hevc_parser qsvdec hevc_qsv_hwaccel"
1969 hevc_qsv_encoder_select
="qsvenc"
1970 huffyuv_decoder_select
="bswapdsp huffyuvdsp"
1971 huffyuv_encoder_select
="bswapdsp huffman huffyuvencdsp"
1972 iac_decoder_select
="imc_decoder"
1973 imc_decoder_select
="bswapdsp fft mdct sinewin"
1974 indeo3_decoder_select
="hpeldsp"
1975 indeo4_decoder_select
="ividsp"
1976 indeo5_decoder_select
="ividsp"
1977 interplay_video_decoder_select
="hpeldsp"
1978 jpegls_decoder_select
="golomb mjpeg_decoder"
1979 jpegls_encoder_select
="golomb"
1980 jv_decoder_select
="blockdsp"
1981 lagarith_decoder_select
="huffyuvdsp"
1982 ljpeg_encoder_select
="aandcttables idctdsp jpegtables"
1983 loco_decoder_select
="golomb"
1984 mdec_decoder_select
="blockdsp idctdsp mpegvideo"
1985 metasound_decoder_select
="lsp mdct sinewin"
1986 mimic_decoder_select
="blockdsp bswapdsp hpeldsp idctdsp"
1987 mjpeg_decoder_select
="blockdsp hpeldsp idctdsp jpegtables"
1988 mjpeg_encoder_select
="aandcttables jpegtables mpegvideoenc"
1989 mjpegb_decoder_select
="mjpeg_decoder"
1990 mlp_decoder_select
="mlp_parser"
1991 motionpixels_decoder_select
="bswapdsp"
1992 mp1_decoder_select
="mpegaudio"
1993 mp1float_decoder_select
="mpegaudio"
1994 mp2_decoder_select
="mpegaudio"
1995 mp2float_decoder_select
="mpegaudio"
1996 mp3_decoder_select
="mpegaudio"
1997 mp3adu_decoder_select
="mpegaudio"
1998 mp3adufloat_decoder_select
="mpegaudio"
1999 mp3float_decoder_select
="mpegaudio"
2000 mp3on4_decoder_select
="mpegaudio"
2001 mp3on4float_decoder_select
="mpegaudio"
2002 mpc7_decoder_select
="bswapdsp mpegaudiodsp"
2003 mpc8_decoder_select
="mpegaudiodsp"
2004 mpeg_xvmc_decoder_deps
="X11_extensions_XvMClib_h"
2005 mpeg_xvmc_decoder_select
="mpeg2video_decoder"
2006 mpeg1video_decoder_select
="error_resilience mpeg_er mpegvideo"
2007 mpeg1video_encoder_select
="aandcttables mpegvideoenc"
2008 mpeg2video_decoder_select
="error_resilience mpeg_er mpegvideo"
2009 mpeg2video_encoder_select
="aandcttables mpegvideoenc"
2010 mpeg2_qsv_decoder_deps
="libmfx"
2011 mpeg2_qsv_decoder_select
="qsvdec mpeg2_qsv_hwaccel mpegvideo_parser"
2012 mpeg2_qsv_encoder_deps
="libmfx"
2013 mpeg2_qsv_encoder_select
="qsvenc"
2014 mpeg4_decoder_select
="h263_decoder mpeg4video_parser"
2015 mpeg4_encoder_select
="h263_encoder"
2016 msa1_decoder_select
="mss34dsp"
2017 msmpeg4v1_decoder_select
="h263_decoder"
2018 msmpeg4v2_decoder_select
="h263_decoder"
2019 msmpeg4v2_encoder_select
="h263_encoder"
2020 msmpeg4v3_decoder_select
="h263_decoder"
2021 msmpeg4v3_encoder_select
="h263_encoder"
2022 mss2_decoder_select
="error_resilience mpeg_er qpeldsp vc1_decoder"
2023 mts2_decoder_select
="mss34dsp"
2024 mxpeg_decoder_select
="mjpeg_decoder"
2025 nellymoser_decoder_select
="mdct sinewin"
2026 nellymoser_encoder_select
="audio_frame_queue mdct sinewin"
2027 nuv_decoder_select
="idctdsp lzo"
2028 nvenc_h264_encoder_deps
="nvenc"
2029 nvenc_hevc_encoder_deps
="nvenc"
2030 on2avc_decoder_select
="mdct"
2031 opus_decoder_deps
="avresample"
2032 opus_decoder_select
="imdct15"
2033 png_decoder_deps
="zlib"
2034 png_encoder_deps
="zlib"
2035 png_encoder_select
="huffyuvencdsp"
2036 prores_decoder_select
="idctdsp"
2037 prores_encoder_select
="fdctdsp"
2038 qcelp_decoder_select
="lsp"
2039 qdm2_decoder_select
="mdct rdft mpegaudiodsp"
2040 ra_144_encoder_select
="audio_frame_queue lpc"
2041 ralf_decoder_select
="golomb"
2042 rscc_decoder_deps
="zlib"
2043 rv10_decoder_select
="error_resilience h263_decoder h263dsp mpeg_er"
2044 rv10_encoder_select
="h263_encoder"
2045 rv20_decoder_select
="error_resilience h263_decoder h263dsp mpeg_er"
2046 rv20_encoder_select
="h263_encoder"
2047 rv30_decoder_select
="error_resilience golomb h264chroma h264pred h264qpel mpeg_er mpegvideo rv34dsp videodsp"
2048 rv40_decoder_select
="error_resilience golomb h264chroma h264pred h264qpel mpeg_er mpegvideo rv34dsp videodsp"
2049 screenpresso_decoder_deps
="zlib"
2050 shorten_decoder_select
="golomb"
2051 sipr_decoder_select
="lsp"
2052 sp5x_decoder_select
="mjpeg_decoder"
2053 svq1_decoder_select
="hpeldsp"
2054 svq1_encoder_select
="aandcttables hpeldsp me_cmp mpegvideoenc"
2055 svq3_decoder_select
="h264_decoder hpeldsp tpeldsp"
2056 svq3_decoder_suggest
="zlib"
2057 tak_decoder_select
="audiodsp"
2058 tdsc_decoder_deps
="zlib"
2059 tdsc_decoder_select
="mjpeg_decoder"
2060 theora_decoder_select
="vp3_decoder"
2061 thp_decoder_select
="mjpeg_decoder"
2062 tiff_decoder_suggest
="zlib"
2063 tiff_encoder_suggest
="zlib"
2064 truehd_decoder_select
="mlp_decoder"
2065 truemotion2_decoder_select
="bswapdsp"
2066 truespeech_decoder_select
="bswapdsp"
2067 tscc_decoder_deps
="zlib"
2068 txd_decoder_select
="texturedsp"
2069 twinvq_decoder_select
="mdct lsp sinewin"
2070 utvideo_decoder_select
="bswapdsp"
2071 utvideo_encoder_select
="bswapdsp huffman huffyuvencdsp"
2072 vble_decoder_select
="huffyuvdsp"
2073 vc1_decoder_select
="blockdsp error_resilience h263_decoder h264chroma h264qpel intrax8 mpeg_er qpeldsp startcode"
2074 vc1image_decoder_select
="vc1_decoder"
2075 vorbis_decoder_select
="mdct"
2076 vorbis_encoder_select
="mdct"
2077 vp3_decoder_select
="hpeldsp vp3dsp videodsp"
2078 vp5_decoder_select
="h264chroma hpeldsp videodsp vp3dsp vp56dsp"
2079 vp6_decoder_select
="h264chroma hpeldsp huffman videodsp vp3dsp vp56dsp"
2080 vp6a_decoder_select
="vp6_decoder"
2081 vp6f_decoder_select
="vp6_decoder"
2082 vp7_decoder_select
="h264pred videodsp vp8dsp"
2083 vp8_decoder_select
="h264pred videodsp vp8dsp"
2084 vp9_decoder_select
="videodsp"
2085 webp_decoder_select
="vp8_decoder"
2086 wmapro_decoder_select
="mdct sinewin wma_freqs"
2087 wmav1_decoder_select
="mdct sinewin wma_freqs"
2088 wmav1_encoder_select
="mdct sinewin wma_freqs"
2089 wmav2_decoder_select
="mdct sinewin wma_freqs"
2090 wmav2_encoder_select
="mdct sinewin wma_freqs"
2091 wmavoice_decoder_select
="lsp rdft dct mdct sinewin"
2092 wmv1_decoder_select
="h263_decoder"
2093 wmv1_encoder_select
="h263_encoder"
2094 wmv2_decoder_select
="blockdsp h263_decoder idctdsp intrax8 videodsp wmv2dsp"
2095 wmv2_encoder_select
="h263_encoder wmv2dsp"
2096 wmv3_decoder_select
="vc1_decoder"
2097 wmv3image_decoder_select
="wmv3_decoder"
2098 zerocodec_decoder_deps
="zlib"
2099 zlib_decoder_deps
="zlib"
2100 zlib_encoder_deps
="zlib"
2101 zmbv_decoder_deps
="zlib"
2102 zmbv_encoder_deps
="zlib"
2104 # hardware accelerators
2105 d3d11va_deps
="d3d11_h dxva_h ID3D11VideoDecoder"
2106 dxva2_deps
="dxva2api_h DXVA2_ConfigPictureDecode"
2107 vaapi_deps
="va_va_h"
2108 vda_deps
="VideoDecodeAcceleration_VDADecoder_h pthreads"
2109 vda_extralibs
="-framework CoreFoundation -framework VideoDecodeAcceleration -framework QuartzCore"
2110 vdpau_deps
="vdpau_vdpau_h vdpau_vdpau_x11_h"
2112 h263_vaapi_hwaccel_deps
="vaapi"
2113 h263_vaapi_hwaccel_select
="h263_decoder"
2114 h264_d3d11va_hwaccel_deps
="d3d11va"
2115 h264_d3d11va_hwaccel_select
="h264_decoder"
2116 h264_dxva2_hwaccel_deps
="dxva2"
2117 h264_dxva2_hwaccel_select
="h264_decoder"
2118 h264_mmal_decoder_deps
="mmal"
2119 h264_mmal_hwaccel_deps
="mmal"
2120 h264_mmal_decoder_select
="h264_decoder"
2121 h264_mmal_encoder_deps
="mmal"
2122 h264_qsv_hwaccel_deps
="libmfx"
2123 h264_vaapi_hwaccel_deps
="vaapi"
2124 h264_vaapi_hwaccel_select
="h264_decoder"
2125 h264_vda_hwaccel_deps
="vda"
2126 h264_vda_hwaccel_select
="h264_decoder"
2127 h264_vda_old_hwaccel_deps
="vda"
2128 h264_vda_old_hwaccel_select
="h264_decoder"
2129 h264_vdpau_hwaccel_deps
="vdpau"
2130 h264_vdpau_hwaccel_select
="h264_decoder"
2131 hevc_d3d11va_hwaccel_deps
="d3d11va DXVA_PicParams_HEVC"
2132 hevc_d3d11va_hwaccel_select
="hevc_decoder"
2133 hevc_dxva2_hwaccel_deps
="dxva2 DXVA_PicParams_HEVC"
2134 hevc_dxva2_hwaccel_select
="hevc_decoder"
2135 hevc_qsv_hwaccel_deps
="libmfx"
2136 mpeg1_vdpau_hwaccel_deps
="vdpau"
2137 mpeg1_vdpau_hwaccel_select
="mpeg1video_decoder"
2138 mpeg2_d3d11va_hwaccel_deps
="d3d11va"
2139 mpeg2_d3d11va_hwaccel_select
="mpeg2video_decoder"
2140 mpeg2_dxva2_hwaccel_deps
="dxva2"
2141 mpeg2_dxva2_hwaccel_select
="mpeg2video_decoder"
2142 mpeg2_qsv_hwaccel_deps
="libmfx"
2143 mpeg2_vaapi_hwaccel_deps
="vaapi"
2144 mpeg2_vaapi_hwaccel_select
="mpeg2video_decoder"
2145 mpeg2_vdpau_hwaccel_deps
="vdpau"
2146 mpeg2_vdpau_hwaccel_select
="mpeg2video_decoder"
2147 mpeg4_vaapi_hwaccel_deps
="vaapi"
2148 mpeg4_vaapi_hwaccel_select
="mpeg4_decoder"
2149 mpeg4_vdpau_hwaccel_deps
="vdpau"
2150 mpeg4_vdpau_hwaccel_select
="mpeg4_decoder"
2151 vc1_d3d11va_hwaccel_deps
="d3d11va"
2152 vc1_d3d11va_hwaccel_select
="vc1_decoder"
2153 vc1_dxva2_hwaccel_deps
="dxva2"
2154 vc1_dxva2_hwaccel_select
="vc1_decoder"
2155 vc1_vaapi_hwaccel_deps
="vaapi"
2156 vc1_vaapi_hwaccel_select
="vc1_decoder"
2157 vc1_vdpau_hwaccel_deps
="vdpau"
2158 vc1_vdpau_hwaccel_select
="vc1_decoder"
2159 wmv3_d3d11va_hwaccel_select
="vc1_d3d11va_hwaccel"
2160 wmv3_dxva2_hwaccel_select
="vc1_dxva2_hwaccel"
2161 wmv3_vaapi_hwaccel_select
="vc1_vaapi_hwaccel"
2162 wmv3_vdpau_hwaccel_select
="vc1_vdpau_hwaccel"
2165 h264_parser_select
="h264_decoder"
2166 hevc_parser_select
="golomb"
2167 mpegvideo_parser_select
="mpegvideo"
2168 mpeg4video_parser_select
="error_resilience h263dsp mpeg_er mpegvideo qpeldsp"
2169 vc1_parser_select
="mpegvideo startcode vc1_decoder"
2172 mjpeg2jpeg_bsf_select
="jpegtables"
2174 # external libraries
2175 libdcadec_decoder_deps
="libdcadec"
2176 libfaac_encoder_deps
="libfaac"
2177 libfaac_encoder_select
="audio_frame_queue"
2178 libfdk_aac_decoder_deps
="libfdk_aac"
2179 libfdk_aac_encoder_deps
="libfdk_aac"
2180 libfdk_aac_encoder_select
="audio_frame_queue"
2181 libgsm_decoder_deps
="libgsm"
2182 libgsm_encoder_deps
="libgsm"
2183 libgsm_ms_decoder_deps
="libgsm"
2184 libgsm_ms_encoder_deps
="libgsm"
2185 libilbc_decoder_deps
="libilbc"
2186 libilbc_encoder_deps
="libilbc"
2187 libkvazaar_encoder_deps
="libkvazaar"
2188 libmp3lame_encoder_deps
="libmp3lame"
2189 libmp3lame_encoder_select
="audio_frame_queue"
2190 libopencore_amrnb_decoder_deps
="libopencore_amrnb"
2191 libopencore_amrnb_encoder_deps
="libopencore_amrnb"
2192 libopencore_amrnb_encoder_select
="audio_frame_queue"
2193 libopencore_amrwb_decoder_deps
="libopencore_amrwb"
2194 libopenh264_encoder_deps
="libopenh264"
2195 libopenjpeg_decoder_deps
="libopenjpeg"
2196 libopenjpeg_encoder_deps
="libopenjpeg"
2197 libopus_decoder_deps
="libopus"
2198 libopus_encoder_deps
="libopus"
2199 libopus_encoder_select
="audio_frame_queue"
2200 libschroedinger_decoder_deps
="libschroedinger"
2201 libschroedinger_encoder_deps
="libschroedinger"
2202 libspeex_decoder_deps
="libspeex"
2203 libspeex_encoder_deps
="libspeex"
2204 libspeex_encoder_select
="audio_frame_queue"
2205 libtheora_encoder_deps
="libtheora"
2206 libtwolame_encoder_deps
="libtwolame"
2207 libvo_aacenc_encoder_deps
="libvo_aacenc"
2208 libvo_aacenc_encoder_select
="audio_frame_queue"
2209 libvo_amrwbenc_encoder_deps
="libvo_amrwbenc"
2210 libvorbis_encoder_deps
="libvorbis"
2211 libvorbis_encoder_select
="audio_frame_queue"
2212 libvpx_vp8_decoder_deps
="libvpx"
2213 libvpx_vp8_encoder_deps
="libvpx"
2214 libvpx_vp9_decoder_deps
="libvpx"
2215 libvpx_vp9_encoder_deps
="libvpx"
2216 libwavpack_encoder_deps
="libwavpack"
2217 libwebp_encoder_deps
="libwebp"
2218 libx262_encoder_deps
="libx262"
2219 libx264_encoder_deps
="libx264"
2220 libx265_encoder_deps
="libx265"
2221 libxavs_encoder_deps
="libxavs"
2222 libxvid_encoder_deps
="libxvid"
2225 ac3_demuxer_select
="ac3_parser"
2226 asf_demuxer_select
="riffdec"
2227 asf_muxer_select
="riffenc"
2228 asf_stream_muxer_select
="asf_muxer"
2229 avi_demuxer_select
="riffdec"
2230 avi_muxer_select
="riffenc"
2231 avisynth_demuxer_deps
="avisynth"
2232 avisynth_demuxer_select
="riffdec"
2233 caf_demuxer_select
="riffdec"
2234 dash_muxer_select
="mp4_muxer"
2235 dirac_demuxer_select
="dirac_parser"
2236 dv_demuxer_select
="dvprofile"
2237 dv_muxer_select
="dvprofile"
2238 dxa_demuxer_select
="riffdec"
2239 eac3_demuxer_select
="ac3_parser"
2240 f4v_muxer_select
="mov_muxer"
2241 flac_demuxer_select
="flac_parser"
2242 hds_muxer_select
="flv_muxer"
2243 hls_muxer_select
="mpegts_muxer"
2244 ipod_muxer_select
="mov_muxer"
2245 ismv_muxer_select
="mov_muxer"
2246 matroska_audio_muxer_select
="matroska_muxer"
2247 matroska_demuxer_select
="riffdec"
2248 matroska_demuxer_suggest
="bzlib lzo zlib"
2249 matroska_muxer_select
="riffenc"
2250 mmf_muxer_select
="riffenc"
2251 mov_demuxer_select
="riffdec"
2252 mov_demuxer_suggest
="zlib"
2253 mov_muxer_select
="riffenc rtpenc_chain"
2254 mp3_demuxer_select
="mpegaudio_parser"
2255 mp4_muxer_select
="mov_muxer"
2256 mpegts_muxer_select
="adts_muxer latm_muxer"
2257 mpegtsraw_demuxer_select
="mpegts_demuxer"
2258 mxf_d10_muxer_select
="mxf_muxer"
2259 nut_muxer_select
="riffenc"
2260 nuv_demuxer_select
="riffdec"
2261 oga_muxer_select
="ogg_muxer"
2262 ogg_demuxer_select
="dirac_parse"
2263 opus_muxer_select
="ogg_muxer"
2264 psp_muxer_select
="mov_muxer"
2265 rtp_demuxer_select
="sdp_demuxer"
2266 rtpdec_select
="asf_demuxer jpegtables mov_demuxer mpegts_demuxer rm_demuxer rtp_protocol"
2267 rtsp_demuxer_select
="http_protocol rtpdec"
2268 rtsp_muxer_select
="rtp_muxer http_protocol rtp_protocol rtpenc_chain"
2269 sap_demuxer_select
="sdp_demuxer"
2270 sap_muxer_select
="rtp_muxer rtp_protocol rtpenc_chain"
2271 sdp_demuxer_select
="rtpdec"
2272 smoothstreaming_muxer_select
="ismv_muxer"
2273 spdif_muxer_select
="aac_parser"
2274 spx_muxer_select
="ogg_muxer"
2275 swf_demuxer_suggest
="zlib"
2276 tak_demuxer_select
="tak_parser"
2277 tg2_muxer_select
="mov_muxer"
2278 tgp_muxer_select
="mov_muxer"
2279 w64_demuxer_select
="wav_demuxer"
2280 wav_demuxer_select
="riffdec"
2281 wav_muxer_select
="riffenc"
2282 webm_muxer_select
="riffenc"
2283 webm_muxer_suggest
="libopus_encoder libvorbis_encoder libvpx_vp8_encoder libvpx_vp9_encoder"
2284 wtv_demuxer_select
="riffdec"
2285 xmv_demuxer_select
="riffdec"
2286 xwma_demuxer_select
="riffdec"
2289 alsa_indev_deps
="alsa_asoundlib_h snd_pcm_htimestamp"
2290 alsa_outdev_deps
="alsa_asoundlib_h"
2291 avfoundation_indev_deps
="AVFoundation_AVFoundation_h"
2292 bktr_indev_deps_any
="dev_bktr_ioctl_bt848_h machine_ioctl_bt848_h dev_video_bktr_ioctl_bt848_h dev_ic_bt8xx_h"
2293 dv1394_indev_deps
="dv1394"
2294 dv1394_indev_select
="dv_demuxer"
2295 fbdev_indev_deps
="linux_fb_h"
2296 jack_indev_deps
="jack_jack_h pthreads"
2297 libcdio_indev_deps
="libcdio"
2298 libdc1394_indev_deps
="libdc1394"
2299 oss_indev_deps_any
="soundcard_h sys_soundcard_h"
2300 oss_outdev_deps_any
="soundcard_h sys_soundcard_h"
2301 pulse_indev_deps
="libpulse"
2302 sndio_indev_deps
="sndio_h"
2303 sndio_outdev_deps
="sndio_h"
2304 v4l2_indev_deps_any
="linux_videodev2_h sys_videoio_h"
2305 vfwcap_indev_deps
="capCreateCaptureWindow vfwcap_defines"
2306 vfwcap_indev_extralibs
="-lavicap32"
2307 x11grab_indev_deps
="x11grab"
2308 x11grab_xcb_indev_deps
="libxcb"
2311 ffrtmpcrypt_protocol_deps
="!librtmp_protocol"
2312 ffrtmpcrypt_protocol_deps_any
="gcrypt gmp openssl"
2313 ffrtmpcrypt_protocol_select
="tcp_protocol"
2314 ffrtmphttp_protocol_deps
="!librtmp_protocol"
2315 ffrtmphttp_protocol_select
="http_protocol"
2316 gopher_protocol_select
="network"
2317 http_protocol_select
="tcp_protocol"
2318 httpproxy_protocol_select
="tcp_protocol"
2319 https_protocol_select
="tls_protocol"
2320 icecast_protocol_select
="http_protocol"
2321 librtmp_protocol_deps
="librtmp"
2322 librtmpe_protocol_deps
="librtmp"
2323 librtmps_protocol_deps
="librtmp"
2324 librtmpt_protocol_deps
="librtmp"
2325 librtmpte_protocol_deps
="librtmp"
2326 mmsh_protocol_select
="http_protocol"
2327 mmst_protocol_select
="network"
2328 rtmp_protocol_deps
="!librtmp_protocol"
2329 rtmp_protocol_select
="tcp_protocol"
2330 rtmpe_protocol_select
="ffrtmpcrypt_protocol"
2331 rtmps_protocol_deps
="!librtmp_protocol"
2332 rtmps_protocol_select
="tls_protocol"
2333 rtmpt_protocol_select
="ffrtmphttp_protocol"
2334 rtmpte_protocol_select
="ffrtmpcrypt_protocol ffrtmphttp_protocol"
2335 rtmpts_protocol_select
="ffrtmphttp_protocol https_protocol"
2336 rtp_protocol_select
="udp_protocol"
2337 sctp_protocol_deps
="struct_sctp_event_subscribe"
2338 sctp_protocol_select
="network"
2339 srtp_protocol_select
="rtp_protocol"
2340 tcp_protocol_select
="network"
2341 tls_gnutls_protocol_deps
="gnutls"
2342 tls_gnutls_protocol_select
="tcp_protocol"
2343 tls_openssl_protocol_deps
="openssl !tls_gnutls_protocol"
2344 tls_openssl_protocol_select
="tcp_protocol"
2345 tls_protocol_select_any
="tls_gnutls_protocol tls_openssl_protocol"
2346 udp_protocol_select
="network"
2347 unix_protocol_deps
="sys_un_h"
2348 unix_protocol_select
="network"
2351 blackframe_filter_deps
="gpl"
2352 boxblur_filter_deps
="gpl"
2353 bs2b_filter_deps
="libbs2b"
2354 cropdetect_filter_deps
="gpl"
2355 delogo_filter_deps
="gpl"
2356 drawtext_filter_deps
="libfreetype"
2357 frei0r_filter_deps
="frei0r dlopen"
2358 frei0r_filter_extralibs
='$ldl'
2359 frei0r_src_filter_deps
="frei0r dlopen"
2360 frei0r_src_filter_extralibs
='$ldl'
2361 hqdn3d_filter_deps
="gpl"
2362 interlace_filter_deps
="gpl"
2363 ocv_filter_deps
="libopencv"
2364 resample_filter_deps
="avresample"
2365 scale_filter_deps
="swscale"
2368 avcodec_example_deps
="avcodec avutil"
2369 filter_audio_example_deps
="avfilter avutil"
2370 metadata_example_deps
="avformat avutil"
2371 output_example_deps
="avcodec avformat avutil swscale"
2372 qsvdec_example_deps
="avcodec avutil libmfx h264_qsv_decoder vaapi_x11"
2373 transcode_aac_example_deps
="avcodec avformat avresample"
2375 # libraries, in linking order
2376 avcodec_deps
="avutil"
2377 avdevice_deps
="avformat avcodec avutil"
2378 avfilter_deps
="avutil"
2379 avformat_deps
="avcodec avutil"
2380 avresample_deps
="avutil"
2381 swscale_deps
="avutil"
2384 avconv_deps
="avcodec avfilter avformat avresample swscale"
2385 avconv_select
="aformat_filter anull_filter asyncts_filter atrim_filter format_filter
2386 fps_filter null_filter resample_filter scale_filter
2387 setpts_filter trim_filter"
2388 avplay_deps
="avcodec avformat avresample swscale sdl"
2389 avplay_libs
='$sdl_libs'
2390 avplay_select
="rdft transpose_filter hflip_filter vflip_filter"
2391 avprobe_deps
="avcodec avformat"
2395 texi2html_deps
="doc"
2397 # default parameters
2399 logfile
="config.log"
2401 # installation paths
2402 prefix_default
="/usr/local"
2403 bindir_default
='${prefix}/bin'
2404 datadir_default
='${prefix}/share/avconv'
2405 docdir_default
='${prefix}/share/doc/libav'
2406 incdir_default
='${prefix}/include'
2407 libdir_default
='${prefix}/lib'
2408 mandir_default
='${prefix}/share/man'
2409 shlibdir_default
="$libdir_default"
2414 host_cc_default
="gcc"
2419 pkg_config_default
=pkg-config
2425 arch_default
=$
(uname
-m
)
2430 target_os_default
=$
(tolower $
(uname
-s
))
2431 host_os
=$target_os_default
2433 # configurable options
2434 enable $EXAMPLE_LIST $LIBRARY_LIST $PROGRAM_LIST
2439 enable faan faandct faanidct
2440 enable optimizations
2441 enable safe_bitstream_reader
2443 enable swscale_alpha
2444 enable valgrind_backtrace
2446 # By default, enable only those hwaccels that have no external dependencies.
2447 enable d3d11va dxva2 vda vdpau
2450 SHFLAGS
='-shared -Wl,-soname,$$(@F)'
2453 FULLNAME
='$(NAME)$(BUILDSUF)'
2454 LIBNAME
='$(LIBPREF)$(FULLNAME)$(LIBSUF)'
2457 SLIBNAME
='$(SLIBPREF)$(FULLNAME)$(SLIBSUF)'
2458 SLIBNAME_WITH_VERSION
='$(SLIBNAME).$(LIBVERSION)'
2459 SLIBNAME_WITH_MAJOR
='$(SLIBNAME).$(LIBMAJOR)'
2460 LIB_INSTALL_EXTRA_CMD
='$$(RANLIB) "$(LIBDIR)/$(LIBNAME)"'
2461 SLIB_INSTALL_NAME
='$(SLIBNAME_WITH_VERSION)'
2462 SLIB_INSTALL_LINKS
='$(SLIBNAME_WITH_MAJOR) $(SLIBNAME)'
2485 host_cflags_filter
=echo
2486 host_ldflags_filter
=echo
2488 target_path
='$(CURDIR)'
2490 # since the object filename is not given with the -MM flag, the compiler
2491 # is only able to print the basename, and we must add the path ourselves
2492 DEPCMD
='$(DEP$(1)) $(DEP$(1)FLAGS) $($(1)DEP_FLAGS) $< | sed -e "/^\#.*/d" -e "s,^[[:space:]]*$(*F)\\.o,$(@D)/$(*F).o," > $(@:.o=.d)'
2496 if test -f configure
; then
2499 source_path
=$
(cd $
(dirname "$0"); pwd)
2500 echo "$source_path" |
grep -q
'[[:blank:]]' &&
2501 die
"Out of tree builds are impossible with whitespace in source path."
2502 test -e
"$source_path/config.h" &&
2503 die
"Out of tree builds are impossible with config.h in source dir."
2510 LIBAV_CONFIGURATION
="${LIBAV_CONFIGURATION# } ${l}${r}"
2516 file=$source_path/$3
2517 sed -n
"s/^[^#]*$pattern.*([^,]*, *\([^,]*\)\(,.*\)*).*/\1_$thing/p" "$file"
2520 ENCODER_LIST
=$
(find_things encoder ENC libavcodec
/allcodecs.c
)
2521 DECODER_LIST
=$
(find_things decoder DEC libavcodec
/allcodecs.c
)
2522 HWACCEL_LIST
=$
(find_things hwaccel HWACCEL libavcodec
/allcodecs.c
)
2523 PARSER_LIST
=$
(find_things parser PARSER libavcodec
/allcodecs.c
)
2524 BSF_LIST
=$
(find_things bsf BSF libavcodec
/allcodecs.c
)
2525 MUXER_LIST
=$
(find_things muxer _MUX libavformat
/allformats.c
)
2526 DEMUXER_LIST
=$
(find_things demuxer DEMUX libavformat
/allformats.c
)
2527 OUTDEV_LIST
=$
(find_things outdev OUTDEV libavdevice
/alldevices.c
)
2528 INDEV_LIST
=$
(find_things indev _IN libavdevice
/alldevices.c
)
2529 PROTOCOL_LIST
=$
(find_things protocol PROTOCOL libavformat
/allformats.c
)
2530 FILTER_LIST
=$
(find_things filter FILTER libavfilter
/allfilters.c
)
2546 enable $ARCH_EXT_LIST
2549 echo "Unknown option \"$1\"."
2550 echo "See $0 --help for available options."
2555 printf "%-25s %-25s %-25s\n" $
(cat |
tr ' ' '\n' |
sort)
2561 echo $
* |
sed s
/$suffix//g | print_3_columns
2573 is_in
${comp} $COMPONENT_LIST && eval comp
=\$$
(toupper
${comp%s})_LIST
2574 echo "prob ${prob:-0.5}"
2582 random_seed
=$
(awk "BEGIN { srand($random_seed); print srand() }")
2583 $action $
(rand_list
"$@" |
awk "BEGIN { srand($random_seed) } \$1 == \"prob\" { prob = \$2; next } rand() < prob { print }")
2592 --extra-ldexeflags
=*)
2593 add_ldexeflags
$optval
2596 add_extralibs
$optval
2599 disable
$INDEV_LIST $OUTDEV_LIST
2602 debuglevel
="$optval"
2605 disable
$PROGRAM_LIST
2607 --disable-everything
)
2608 map
'eval disable \${$(toupper ${v%s})_LIST}' $COMPONENT_LIST
2611 map
'eval disable \${$(toupper ${v%s})_LIST}' $COMPONENT_LIST
2612 disable
$LIBRARY_LIST $PROGRAM_LIST doc
2614 --enable-random|
--disable-random
)
2615 action
=${opt%%-random}
2616 do_random
${action#--} $COMPONENT_LIST
2618 --enable-random
=*|
--disable-random
=*)
2619 action
=${opt%%-random=*}
2620 do_random
${action#--} $optval
2622 --enable-
*=*|
--disable-
*=*)
2623 eval $
(echo "${opt%%=*}" |
sed 's/--/action=/;s/-/ thing=/')
2624 is_in
"${thing}s" $COMPONENT_LIST || die_unknown
"$opt"
2625 eval list
=\$$
(toupper
$thing)_LIST
2626 name
=$
(echo "${optval}" |
sed "s/,/_${thing}|/g")_
${thing}
2627 test $action = enable && action
="request"
2628 $action $
(filter
"$name" $list)
2630 --enable-avserver|
--disable-avserver
*)
2631 warn
"avserver has been removed, the ${opt} option is only"\
2632 "provided for compatibility and will be removed in the future"
2634 --enable-?
*|
--disable-?
*)
2635 eval $
(echo "$opt" |
sed 's/--/action=/;s/-/ option=/;s/-/_/g')
2636 if is_in
$option $COMPONENT_LIST; then
2637 eval $action \$$
(toupper
${option%s})_LIST
2638 elif is_in
$option $CMDLINE_SELECT; then
2645 NAME
="${opt#--list-}"
2646 is_in
$NAME $COMPONENT_LIST || die_unknown
$opt
2648 eval show_list
$NAME \$$
(toupper
$NAME)_LIST
2650 --help|
-h
) show_help
2653 optname
="${opt%%=*}"
2654 optname
="${optname#--}"
2655 optname
=$
(echo "$optname" |
sed 's/-/_/g')
2656 if is_in
$optname $CMDLINE_SET; then
2657 eval $optname='$optval'
2658 elif is_in
$optname $CMDLINE_APPEND; then
2659 append
$optname "$optval"
2671 disabled logging
&& logfile
=/dev
/null
2673 # Disable all the library-specific components if the library itself
2674 # is disabled, see AVCODEC_LIST and following _LIST variables.
2676 disable_components
(){
2677 disabled
${1} && disable_weak $
(
2678 eval components
="\$$(toupper ${1})_COMPONENTS"
2679 map
'eval echo \${$(toupper ${v%s})_LIST}' $components
2683 map
'disable_components $v' $LIBRARY_LIST
2685 # Mark components that had not been enabled/disabled explicitly
2688 for n
in $COMPONENT_LIST; do
2689 v
=$
(toupper
${n%s})_LIST
2690 eval enable_weak \$
$v
2691 eval ${n}_if_any
="\$$v"
2694 # Make so that disabled libraries are enabled if a component
2695 # of them is requested
2697 for n
in $LIBRARY_LIST; do
2698 v
=$
(toupper
${n})_COMPONENTS
2699 eval ${n}_if_any
="\$$v"
2702 echo "# $0 $LIBAV_CONFIGURATION" > $logfile
2705 case "$toolchain" in
2708 add_cflags
-fsanitize
=address
2709 add_ldflags
-fsanitize
=address
2713 add_cflags
-fsanitize
=thread
-pie
2714 add_ldflags
-fsanitize
=thread
-pie
2718 add_cflags
-fsanitize
=undefined
-O1
2719 add_ldflags
-fsanitize
=undefined
2723 add_cflags
-fsanitize
=address
2724 add_ldflags
-fsanitize
=address
2728 add_cflags
-fsanitize
=thread
-pie
-fPIC
2729 add_ldflags
-fsanitize
=thread
-pie
-fPIC
2733 add_cflags
-fsanitize
=undefined
2734 add_ldflags
-fsanitize
=undefined
2737 target_exec_default
="valgrind"
2738 target_exec_args
="--alloc-fn=av_malloc --alloc-fn=av_mallocz"
2741 target_exec_default
="valgrind"
2742 target_exec_args
="--track-origins=yes --leak-check=full"
2745 # Check whether the current MSVC version needs the C99 converter.
2746 # From MSVC 2013 (compiler major version 18) onwards, it does actually
2747 # support enough of C99 to build libav. Default to the new
2748 # behaviour if the regexp was unable to match anything, since this
2749 # successfully parses the version number of existing supported
2750 # versions that require the converter (MSVC 2010 and 2012).
2751 cl_major_ver
=$
(cl
2>&1 |
sed -n
's/.*Version \([[:digit:]]\{1,\}\)\..*/\1/p')
2752 if [ -z
"$cl_major_ver" ] ||
[ $cl_major_ver -ge
18 ]; then
2755 cc_default
="c99wrap cl"
2757 ld_default
="$source_path/compat/windows/mslink"
2758 nm_default
="dumpbin -symbols"
2765 target_os_default
="win32"
2766 # Use a relative path for TMPDIR. This makes sure all the
2767 # ffconf temp files are written with a relative path, avoiding
2768 # issues with msys/win32 path conversion for MSVC parameters
2769 # such as -Fo<file> or -out:<file>.
2775 nm_default
="dumpbin -symbols"
2777 target_os_default
="win32"
2781 add_cflags
-fprofile-arcs
-ftest-coverage
2782 add_ldflags
-fprofile-arcs
-ftest-coverage
2785 add_cppflags
-U_FORTIFY_SOURCE
-D_FORTIFY_SOURCE
=2
2786 add_cflags
-fno-strict-overflow
-fstack-protector-all
2787 add_ldflags
-Wl
,-z
,relro
-Wl
,-z
,now
2790 die
"Unknown toolchain $toolchain"
2794 test -n
"$cross_prefix" && enable cross_compile
2796 if enabled cross_compile
; then
2797 test -n
"$arch" && test -n
"$target_os" ||
2798 die
"Must specify target arch and OS when cross-compiling"
2801 ar_default
="${cross_prefix}${ar_default}"
2802 cc_default
="${cross_prefix}${cc_default}"
2803 occ_default
="${cross_prefix}${occ_default}"
2804 nm_default
="${cross_prefix}${nm_default}"
2805 pkg_config_default
="${cross_prefix}${pkg_config_default}"
2806 ranlib
="${cross_prefix}${ranlib}"
2807 strip
="${cross_prefix}${strip}"
2809 sysinclude_default
="${sysroot}/usr/include"
2811 set_default arch cc pkg_config sysinclude target_exec target_os
2812 enabled cross_compile || host_cc_default
=$cc
2815 if ! $pkg_config --version
>/dev
/null
2>&1; then
2816 warn
"$pkg_config not found, library detection may fail."
2822 mingw32
*|win32|win64|cygwin
*|
*-dos|freedos|opendos|os
/2*|symbian
) echo .exe
;;
2826 EXESUF
=$
(exesuf
$target_os)
2827 HOSTEXESUF
=$
(exesuf
$host_os)
2829 # set temporary file name
2830 : ${TMPDIR:=$TEMPDIR}
2834 if ! check_cmd mktemp
-u XXXXXX
; then
2835 # simple replacement for missing mktemp
2836 # NOT SAFE FOR GENERAL USE
2838 echo "${2%%XXX*}.${HOSTNAME}.${UID}.$$"
2843 tmp
=$
(mktemp
-u
"${TMPDIR}/ffconf.XXXXXXXX")$2 &&
2844 (set -C
; exec > $tmp) 2>/dev
/null ||
2845 die
"Unable to create temporary file in $TMPDIR."
2846 append TMPFILES
$tmp
2850 trap 'rm -f -- $TMPFILES' EXIT
2854 tmpfile TMPE
$EXESUF
2865 # make sure we can execute files in $TMPDIR
2866 cat > $TMPSH 2>> $logfile <<EOF
2869 chmod +x
$TMPSH >> $logfile 2>&1
2870 if ! $TMPSH >> $logfile 2>&1; then
2872 Unable to create and execute files in $TMPDIR. Set the TMPDIR environment
2873 variable to another directory and make sure that it is not mounted noexec.
2875 die
"Sanity test failed."
2881 # Filter out MSVC cl.exe options from cflags that shouldn't
2882 # be passed to gas-preprocessor
2892 -std
=c99
) echo -c99
;;
2893 -mcpu
=*) echo -arch
${flag#*=} ;;
2894 -mieee
) echo -ieee
;;
2895 -O
*|
-fast
) echo $flag ;;
2896 -fno-math-errno
) echo -assume nomath_errno
;;
2898 -Wall
) echo -msg_enable level2
;;
2899 -Wno-pointer-sign
) echo -msg_disable ptrmismatch1
;;
2900 -Wl
,*) echo $flag ;;
2910 -Wno-switch
) echo -Wno-switch-enum
;;
2911 -Wno-format-zero-length
) ;;
2912 -Wdisabled-optimization
) ;;
2913 -Wno-pointer-sign
) echo -Wno-other
;;
2919 msvc_common_flags
(){
2922 # In addition to specifying certain flags under the compiler
2923 # specific filters, they must be specified here as well or else the
2924 # generic catch all at the bottom will print the original flag.
2928 -fomit-frame-pointer
) ;;
2932 -fno-signed-zeros
) ;;
2936 -lz
) echo zlib.lib
;;
2937 -lavifil32
) echo vfw32.lib
;;
2938 -lavicap32
) echo vfw32.lib user32.lib
;;
2939 -l
*) echo ${flag#-l}.lib
;;
2940 -L
*) echo -libpath
:${flag#-L} ;;
2947 msvc_common_flags
"$@"
2950 -Wall
) echo -W4
-wd4244
-wd4127
-wd4018
-wd4389 \
2951 -wd4146
-wd4057
-wd4204
-wd4706
-wd4305 \
2952 -wd4152
-wd4324
-we4013
-wd4100
-wd4214 \
2953 -wd4273
-wd4554
-wd4701
;;
2959 msvc_common_flags
"$@"
2962 # Despite what Intel's documentation says -Wall, which is supported
2963 # on Windows, does enable remarks so disable them here.
2964 -Wall
) echo $flag -Qdiag-disable
:remark
;;
2965 -std
=c99
) echo -Qstd
=c99
;;
2973 -flto
) echo -Mipa
=fast
,libopt
,libinline
,vestigial
;;
2974 -fomit-frame-pointer
) echo -Mnoframe
;;
2985 case "${flag#*=}" in
2986 native
) echo -xtarget
=native
;;
2987 v9|niagara
) echo -xarch
=sparc
;;
2988 ultrasparc
) echo -xarch
=sparcvis
;;
2989 ultrasparc3|niagara2
) echo -xarch
=sparcvis2
;;
2990 i586|pentium
) echo -xchip
=pentium
;;
2991 i686|pentiumpro|pentium2
) echo -xtarget
=pentium_pro
;;
2992 pentium3
*|c3-2
) echo -xtarget
=pentium3
;;
2993 pentium-m
) echo -xarch
=sse2
-xchip
=pentium3
;;
2994 pentium4
*) echo -xtarget
=pentium4
;;
2995 prescott|nocona
) echo -xarch
=sse3
-xchip
=pentium4
;;
2996 *-sse3
) echo -xarch
=sse3
;;
2997 core2
) echo -xarch
=ssse3
-xchip
=core2
;;
2998 corei7
) echo -xarch
=sse4_2
-xchip
=nehalem
;;
2999 corei7-avx
) echo -xarch
=avx
-xchip
=sandybridge
;;
3000 amdfam10|barcelona|bdver
*) echo -xarch
=sse4_1
;;
3001 athlon-4|athlon-
[mx
]p
) echo -xarch
=ssea
;;
3002 k8|opteron|athlon64|athlon-fx
)
3003 echo -xarch
=sse2a
;;
3004 athlon
*) echo -xarch
=pentium_proa
;;
3007 -std
=c99
) echo -xc99
;;
3008 -fomit-frame-pointer
) echo -xregs
=frameptr
;;
3009 -fPIC
) echo -KPIC
-xcode
=pic32
;;
3010 -W
*,*) echo $flag ;;
3011 -f
*-*|
-W
*|
-mimpure-text
) ;;
3022 case "${flag#*=}" in
3023 armv7-a|cortex-a
*) echo -mv=7a8
;;
3024 armv7-r|cortex-r
*) echo -mv=7r4
;;
3025 armv7-m|cortex-m
*) echo -mv=7m3
;;
3026 armv6
*|arm11
*) echo -mv=6 ;;
3027 armv5
*e|arm
[79]*e
*|arm9
[24]6*|arm96
*|arm102
[26])
3029 armv4
*|arm7
*|arm9
[24]*) echo -mv=4 ;;
3032 -mfpu
=neon
) echo --float_support
=vfpv3
--neon
;;
3033 -mfpu
=vfp
) echo --float_support
=vfpv2
;;
3034 -mfpu
=vfpv3
) echo --float_support
=vfpv3
;;
3035 -mfpu
=vfpv3-d16
) echo --float_support
=vfpv3d16
;;
3036 -msoft-float
) echo --float_support
=vfplib
;;
3037 -O
[0-3]|
-mf
=*) echo $flag ;;
3039 -pds
=*) echo $flag ;;
3040 -D
*|
-I
*) echo $flag ;;
3041 --gcc|
--abi
=*) echo $flag ;;
3051 unset _type _ident _cc_c _cc_e _cc_o _flags _cflags
3052 unset _ld_o _ldflags _ld_lib _ld_path
3053 unset _depflags _DEPCMD _DEPFLAGS
3056 if $_cc -v
2>&1 |
grep -q
'^gcc.*LLVM'; then
3058 gcc_extra_ver
=$
(expr "$($_cc --version 2>/dev/null | head -n1)" : '.*\((.*)\)')
3059 _ident
="llvm-gcc $($_cc -dumpversion 2>/dev/null) $gcc_extra_ver"
3060 _depflags
='-MMD -MF $(@:.o=.d) -MT $@'
3063 elif $_cc -v
2>&1 |
grep -qi ^gcc
; then
3065 gcc_version
=$
($_cc --version |
head -n1
)
3066 gcc_basever
=$
($_cc -dumpversion
)
3067 gcc_pkg_ver
=$
(expr "$gcc_version" : '[^ ]* \(([^)]*)\)')
3068 gcc_ext_ver
=$
(expr "$gcc_version" : ".*$gcc_pkg_ver $gcc_basever \\(.*\\)")
3069 _ident
=$
(cleanws
"gcc $gcc_basever $gcc_pkg_ver $gcc_ext_ver")
3070 if ! $_cc -dumpversion |
grep -q
'^2\.'; then
3071 _depflags
='-MMD -MF $(@:.o=.d) -MT $@'
3075 elif $_cc --version
2>/dev
/null |
grep -q ^icc
; then
3077 _ident
=$
($_cc --version |
head -n1
)
3082 elif $_cc -v
2>&1 |
grep -q xlc
; then
3084 _ident
=$
($_cc -qversion
2>/dev
/null |
head -n1
)
3086 _cflags_size
='-O5 -qcompact'
3087 elif $_cc -V
2>/dev
/null |
grep -q Compaq
; then
3089 _ident
=$
($_cc -V |
head -n1 | cut
-d
' ' -f1-3
)
3091 _cflags_speed
='-fast'
3093 _flags_filter
=ccc_flags
3094 elif $_cc --vsn
2>/dev
/null |
grep -Eq
"ARM (C/C\+\+ )?Compiler"; then
3095 test -d
"$sysroot" || die
"No valid sysroot specified."
3097 _ident
=$
($_cc --vsn |
grep -i build |
head -n1 |
sed 's/.*: //')
3098 armcc_conf
="$PWD/armcc.conf"
3099 $_cc --arm_linux_configure \
3100 --arm_linux_config_file
="$armcc_conf" \
3101 --configure_sysroot
="$sysroot" \
3102 --configure_cpp_headers
="$sysinclude" >>$logfile 2>&1 ||
3103 die
"Error creating armcc configuration file."
3104 $_cc --vsn |
grep -q RVCT
&& armcc_opt
=rvct || armcc_opt
=armcc
3105 _flags
="--arm_linux_config_file=$armcc_conf --translate_gcc"
3106 as_default
="${cross_prefix}gcc"
3110 elif $_cc -version
2>/dev
/null |
grep -Eq
'TMS470|TI ARM'; then
3112 _ident
=$
($_cc -version |
head -n1 |
tr -s
' ')
3113 _flags
='--gcc --abi=eabi -me'
3116 _depflags
='-ppa -ppd=$(@:.o=.d)'
3117 _cflags_speed
='-O3 -mf=5'
3118 _cflags_size
='-O3 -mf=2'
3119 _flags_filter
=tms470_flags
3120 elif $_cc -v
2>&1 |
grep -q clang
; then
3122 _ident
=$
($_cc --version
2>/dev
/null |
head -n1
)
3123 _depflags
='-MMD -MF $(@:.o=.d) -MT $@'
3126 elif $_cc -V
2>&1 |
grep -q Sun
; then
3128 _ident
=$
($_cc -V
2>&1 |
head -n1 | cut
-d
' ' -f
2-)
3129 _DEPCMD
='$(DEP$(1)) $(DEP$(1)FLAGS) $($(1)DEP_FLAGS) $< | sed -e "1s,^.*: ,$@: ," -e "\$$!s,\$$, \\\," -e "1!s,^.*: , ," > $(@:.o=.d)'
3130 _DEPFLAGS
='-xM1 -xc99'
3133 _cflags_size
='-O5 -xspace'
3134 _flags_filter
=suncc_flags
3135 elif $_cc -v
2>&1 |
grep -q
'PathScale\|Path64'; then
3137 _ident
=$
($_cc -v
2>&1 |
head -n1 |
tr -d
:)
3138 _depflags
='-MMD -MF $(@:.o=.d) -MT $@'
3141 _flags_filter
='filter_out -Wdisabled-optimization'
3142 elif $_cc -v
2>&1 |
grep -q Open64
; then
3144 _ident
=$
($_cc -v
2>&1 |
head -n1 |
tr -d
:)
3145 _depflags
='-MMD -MF $(@:.o=.d) -MT $@'
3148 _flags_filter
='filter_out -Wdisabled-optimization|-Wtype-limits|-fno-signed-zeros'
3149 elif $_cc -V
2>&1 |
grep -q Portland
; then
3151 _ident
="PGI $($_cc -V 2>&1 | awk '/^pgcc/ { print $2; exit }')"
3152 opt_common
='-alias=ansi -Mdse -Mlre -Mpre'
3153 _cflags_speed
="-O3 -Mautoinline -Munroll=c:4 $opt_common"
3154 _cflags_size
="-O2 -Munroll=c:1 $opt_common"
3156 _flags_filter
=pgi_flags
3157 elif $_cc 2>&1 |
grep -q
'Microsoft.*ARM.*Assembler'; then
3159 _ident
=$
($_cc |
head -n1
)
3160 # 4509: "This form of conditional instruction is deprecated"
3161 _flags
="-nologo -ignore 4509"
3162 _flags_filter
=armasm_flags
3163 elif $_cc -nologo-
2>&1 |
grep -q Microsoft
; then
3165 _ident
=$
($_cc 2>&1 |
head -n1
)
3166 _DEPCMD
='$(DEP$(1)) $(DEP$(1)FLAGS) $($(1)DEP_FLAGS) $< 2>&1 | awk '\''/including/ { sub(/^.*file: */, ""); gsub(/\\/, "/"); if (!match($$0, / /)) print "$@:", $$0 }'\'' > $(@:.o=.d)'
3167 _DEPFLAGS
='$(CPPFLAGS) $(CFLAGS) -showIncludes -Zs'
3170 if $_cc -nologo-
2>&1 |
grep -q Linker
; then
3177 _flags_filter
=msvc_flags
3179 _ld_path
='-libpath:'
3181 _cflags
='-D_USE_MATH_DEFINES -D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_WARNINGS'
3182 elif $_cc 2>&1 |
grep -q Intel
; then
3184 _ident
=$
($_cc 2>&1 |
head -n1
)
3185 _depflags
='-QMMD -QMF$(@:.o=.d) -QMT$@'
3186 # Not only is O3 broken on 13.x+ but it is slower on all previous
3187 # versions (tested) as well.
3189 _cflags_size
="-O1 -Oi" # -O1 without -Oi miscompiles stuff
3190 if $_cc 2>&1 |
grep -q Linker
; then
3197 _flags_filter
=icl_flags
3199 _ld_path
='-libpath:'
3200 # -Qdiag-error to make icl error when seeing certain unknown arguments
3201 _flags
='-nologo -Qdiag-error:4044,10157'
3202 # -Qvec- -Qsimd- to prevent miscompilation, -GS for consistency
3203 # with MSVC which enables it by default.
3204 _cflags
='-D_USE_MATH_DEFINES -Qms0 -Qvec- -Qsimd- -GS'
3205 elif $_cc --version
2>/dev
/null |
grep -q ^cparser
; then
3207 _ident
=$
($_cc --version |
head -n1
)
3211 _flags_filter
=cparser_flags
3214 eval ${pfx}_type
=\
$_type
3215 eval ${pfx}_ident
=\
$_ident
3219 eval ${1}_C
=\
${_cc_c-\${${1}_C
}}
3220 eval ${1}_E
=\
${_cc_e-\${${1}_E
}}
3221 eval ${1}_O
=\
${_cc_o-\${${1}_O
}}
3223 if [ -n
"$_depflags" ]; then
3224 eval ${1}_DEPFLAGS
=\
$_depflags
3226 eval ${1}DEP
=\
${_DEPCMD:-\$DEPCMD}
3227 eval ${1}DEP_FLAGS
=\
${_DEPFLAGS:-\$DEPFLAGS}
3228 eval DEP
${1}FLAGS
=\
$_flags
3233 cflags_filter
=$_flags_filter
3234 cflags_speed
=$_cflags_speed
3235 cflags_size
=$_cflags_size
3236 cflags_noopt
=$_cflags_noopt
3237 add_cflags
$_flags $_cflags
3238 cc_ldflags
=$_ldflags
3241 probe_cc hostcc
"$host_cc"
3242 host_cflags_filter
=$_flags_filter
3243 add_host_cflags
$_flags $_cflags
3246 test -n
"$cc_type" && enable $cc_type ||
3247 warn
"Unknown C compiler $cc, unable to select optimal CFLAGS"
3249 : ${as_default:=$cc}
3250 : ${objcc_default:=$cc}
3251 : ${dep_cc_default:=$cc}
3252 : ${ld_default:=$cc}
3253 : ${host_ld_default:=$host_cc}
3254 set_default
ar as objcc dep_cc ld host_ld
3257 asflags_filter
=$_flags_filter
3258 add_asflags
$_flags $_cflags
3261 probe_cc objcc
"$objcc"
3262 objcflags_filter
=$_flags_filter
3263 add_objcflags
$_flags $_cflags
3267 ldflags_filter
=$_flags_filter
3268 add_ldflags
$_flags $_ldflags
3269 test "$cc_type" != "$ld_type" && add_ldflags
$cc_ldflags
3271 LD_LIB
=${_ld_lib-$LD_LIB}
3272 LD_PATH
=${_ld_path-$LD_PATH}
3274 probe_cc hostld
"$host_ld"
3275 host_ldflags_filter
=$_flags_filter
3276 add_host_ldflags
$_flags $_ldflags
3277 HOSTLD_O
=${_ld_o-$HOSTLD_O}
3279 if [ -z
"$CC_DEPFLAGS" ] && [ "$dep_cc" != "$cc" ]; then
3280 probe_cc depcc
"$dep_cc"
3281 CCDEP
=${_DEPCMD:-$DEPCMD}
3282 CCDEP_FLAGS
=${_DEPFLAGS:=$DEPFLAGS}
3286 if $ar 2>&1 |
grep -q Microsoft
; then
3289 elif $ar 2>&1 |
grep -q
'Texas Instruments'; then
3292 elif $ar 2>&1 |
grep -q
'Usage: ar.*-X.*any'; then
3293 arflags
='-Xany -r -c'
3300 add_cflags
$extra_cflags
3301 add_objcflags
$extra_objcflags
3302 add_asflags
$extra_cflags
3304 if test -n
"$sysroot"; then
3307 add_cppflags
--sysroot
="$sysroot"
3308 add_ldflags
--sysroot
="$sysroot"
3311 add_cppflags
-I
"$sysinclude"
3312 add_ldflags
--sysroot
="$sysroot"
3317 if test "$cpu" = host; then
3318 enabled cross_compile
&&
3319 die
"--cpu=host makes no sense when cross-compiling."
3324 $cc $1=native
-v
-c
-o
$TMPO $TMPC >$TMPE 2>&1 ||
return
3326 s/.*$1=\\([^ ]*\\).*/\\1/
3331 cpu
=$
(check_native
-march || check_native
-mcpu
)
3335 test "${cpu:-host}" = host &&
3336 die
"--cpu=host not supported with compiler $cc"
3339 # Deal with common $arch aliases
3363 "Power Macintosh"|ppc
*|powerpc
*)
3378 i
[3-6]86|i86pc|BePC|x86pc|x86_64|amd64
)
3383 is_in
$arch $ARCH_LIST || warn
"unknown architecture $arch"
3386 # Add processor-specific flags
3387 if enabled aarch64
; then
3391 cpuflags
="-march=$cpu"
3394 cpuflags
="-mcpu=$cpu"
3398 elif enabled alpha
; then
3400 cpuflags
="-mcpu=$cpu"
3402 elif enabled arm
; then
3405 check_cpp_condition stddef.h \
3406 "defined __ARM_ARCH_${1}__ || defined __TARGET_ARCH_${2:-$1}" \
3411 if check_arm_arch
4; then echo armv4
;
3412 elif check_arm_arch
4T
; then echo armv4t
;
3413 elif check_arm_arch
5; then echo armv5
;
3414 elif check_arm_arch
5E
; then echo armv5e
;
3415 elif check_arm_arch
5T
; then echo armv5t
;
3416 elif check_arm_arch
5TE
; then echo armv5te
;
3417 elif check_arm_arch
5TEJ
; then echo armv5te
;
3418 elif check_arm_arch
6; then echo armv6
;
3419 elif check_arm_arch
6J
; then echo armv6j
;
3420 elif check_arm_arch
6K
; then echo armv6k
;
3421 elif check_arm_arch
6Z
; then echo armv6z
;
3422 elif check_arm_arch
6ZK
; then echo armv6zk
;
3423 elif check_arm_arch
6T2
; then echo armv6t2
;
3424 elif check_arm_arch
7; then echo armv7
;
3425 elif check_arm_arch
7A
7_A
; then echo armv7-a
;
3426 elif check_arm_arch
7S
; then echo armv7-a
;
3427 elif check_arm_arch
7R
7_R
; then echo armv7-r
;
3428 elif check_arm_arch
7M
7_M
; then echo armv7-m
;
3429 elif check_arm_arch
7EM
7E_M
; then echo armv7-m
;
3430 elif check_arm_arch
8A
8_A
; then echo armv8-a
;
3434 [ "$cpu" = generic
] && cpu
=$
(probe_arm_arch
)
3438 cpuflags
="-march=$cpu"
3439 subarch
=$
(echo $cpu |
sed 's/[^a-z0-9]//g')
3442 cpuflags
="-mcpu=$cpu"
3444 cortex-a
*) subarch
=armv7a
;;
3445 cortex-r
*) subarch
=armv7r
;;
3446 cortex-m
*) enable thumb
; subarch
=armv7m
;;
3447 arm11
*) subarch
=armv6
;;
3448 arm
[79]*e
*|arm9
[24]6*|arm96
*|arm102
[26]) subarch
=armv5te
;;
3449 armv4
*|arm7
*|arm9
[24]*) subarch
=armv4
;;
3450 *) subarch
=$
(probe_arm_arch
) ;;
3456 armv5t
*) enable fast_clz
;;
3457 armv
[6-8]*) enable fast_clz fast_unaligned
;;
3460 elif enabled avr32
; then
3465 cpuflags
="-mpart=$cpu"
3469 cpuflags
="-march=$cpu"
3473 cpuflags
="-mcpu=$cpu"
3477 cpuflags
="-march=$cpu"
3481 elif enabled bfin
; then
3483 cpuflags
="-mcpu=$cpu"
3485 elif enabled mips
; then
3487 cpuflags
="-march=$cpu"
3489 elif enabled ppc
; then
3493 case $
(tolower
$cpu) in
3494 601|ppc601|powerpc601
)
3495 cpuflags
="-mcpu=601"
3498 603*|ppc603
*|powerpc603
*)
3499 cpuflags
="-mcpu=603"
3502 604*|ppc604
*|powerpc604
*)
3503 cpuflags
="-mcpu=604"
3506 g3|
75*|ppc75
*|powerpc75
*)
3507 cpuflags
="-mcpu=750"
3510 g4|
745*|ppc745
*|powerpc745
*)
3511 cpuflags
="-mcpu=7450"
3514 74*|ppc74
*|powerpc74
*)
3515 cpuflags
="-mcpu=7400"
3518 g5|
970|ppc970|powerpc970
)
3519 cpuflags
="-mcpu=970"
3523 cpuflags
="-mcpu=$cpu"
3527 cpuflags
="-mcpu=$cpu"
3531 cpuflags
="-mcpu=cell"
3536 cpuflags
="-mcpu=e500mc"
3540 cpuflags
="-mcpu=8548 -mhard-float -mfloat-gprs=double"
3545 cpuflags
="-mcpu=8540 -mhard-float"
3551 elif enabled sparc
; then
3554 cypress|f93
[04]|tsc701|sparcl
*|supersparc|hypersparc|niagara|v
[789])
3555 cpuflags
="-mcpu=$cpu"
3557 ultrasparc
*|niagara
[234])
3558 cpuflags
="-mcpu=$cpu"
3562 elif enabled x86
; then
3566 cpuflags
="-march=$cpu"
3570 # targets that do NOT support nopl and conditional mov (cmov)
3571 pentium-mmx|k6|k6-
[23]|winchip-c6|winchip2|c3
)
3572 cpuflags
="-march=$cpu"
3575 # targets that do support nopl and conditional mov (cmov)
3576 i686|pentiumpro|pentium
[23]|pentium-m|athlon|athlon-tbird|athlon-4|athlon-
[mx
]p|athlon64
*|k8
*|opteron
*|athlon-fx|core2|corei7
*|amdfam10|barcelona|atom|bdver
*)
3577 cpuflags
="-march=$cpu"
3581 # targets that do support conditional mov but on which it's slow
3582 pentium4|pentium4m|prescott|nocona
)
3583 cpuflags
="-march=$cpu"
3591 if [ "$cpu" != generic
]; then
3592 add_cflags
$cpuflags
3593 add_asflags
$cpuflags
3594 test "$cc_type" = "$ld_type" && add_ldflags
$cpuflags
3597 # compiler sanity check
3599 int main(void){ return 0; }
3601 if test "$?" != 0; then
3602 echo "$cc is unable to create an executable file."
3603 if test -z
"$cross_prefix" && ! enabled cross_compile
; then
3604 echo "If $cc is a cross-compiler, use the --enable-cross-compile option."
3605 echo "Only do this if you know what cross compiling means."
3607 die
"C compiler test failed."
3610 add_cppflags
-D_ISOC99_SOURCE
3611 check_cflags
-std
=c99
3612 check_cc
-D_FILE_OFFSET_BITS
=64 <<EOF && add_cppflags -D_FILE_OFFSET_BITS=64
3615 check_cc
-D_LARGEFILE_SOURCE
<<EOF && add_cppflags -D_LARGEFILE_SOURCE
3619 add_host_cppflags
-D_ISOC99_SOURCE
3620 check_host_cflags
-std
=c99
3621 check_host_cflags
-Wall
3622 check_host_cflags
-O3
3628 check_code cc
"" "int test[2*($expr) - 1]" &&
3629 subarch
=$arch64 || subarch
=$arch32
3637 check_64bit mips mips64
'_MIPS_SIM > 1'
3641 check_64bit parisc parisc64
'sizeof(void *) > 4'
3645 check_64bit ppc ppc64
'sizeof(void *) > 4'
3649 check_64bit s390 s390x
'sizeof(void *) > 4'
3653 check_64bit sparc sparc64
'sizeof(void *) > 4'
3657 check_64bit x86_32 x86_64
'sizeof(void *) > 4'
3658 if test "$subarch" = "x86_64"; then
3665 enabled spic
&& enable_weak pic
3671 add_cppflags
'-I\$(SRC_PATH)/compat/aix'
3672 enabled shared
&& add_ldflags
-Wl
,-brtl
3676 enable section_data_rel_ro
3677 SLIB_INSTALL_NAME
='$(SLIBNAME)'
3679 SHFLAGS
='-shared -Wl,-soname,$(SLIBNAME)'
3682 prefix_default
="/boot/common"
3683 network_extralibs
="-lnetwork"
3687 SHFLAGS
='-shared -Wl,-h,$$(@F)'
3688 enabled x86
&& SHFLAGS
="-mimpure-text $SHFLAGS"
3689 network_extralibs
="-lsocket -lnsl"
3690 # When using suncc to build, the Solaris linker will mark
3691 # an executable with each instruction set encountered by
3692 # the Solaris assembler. As our libraries contain their own
3693 # guards for processor-specific code, instead suppress
3694 # generation of the HWCAPS ELF section on Solaris x86 only.
3695 enabled_all suncc x86
&&
3696 echo "hwcap_1 = OVERRIDE;" > mapfile
&&
3697 add_ldflags
-Wl
,-M
,mapfile
3698 nm_default
='nm -P -g'
3699 SLIB_CREATE_DEF_CMD
='$(Q)perl $(SRC_PATH)/compat/solaris/make_sunver.pl $$(filter %.ver,$$^) $(OBJS) | grep -v @ > $(SUBDIR)lib$(NAME).ver-sol2'
3703 oss_indev_extralibs
="-lossaudio"
3704 oss_outdev_extralibs
="-lossaudio"
3709 SLIB_INSTALL_NAME
='$(SLIBNAME).$(LIBMAJOR).$(LIBMINOR)'
3711 oss_indev_extralibs
="-lossaudio"
3712 oss_outdev_extralibs
="-lossaudio"