You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

6058 lines
190KB

  1. #!/bin/sh
  2. #
  3. # FFmpeg configure script
  4. #
  5. # Copyright (c) 2000-2002 Fabrice Bellard
  6. # Copyright (c) 2005-2008 Diego Biurrun
  7. # Copyright (c) 2005-2008 Mans Rullgard
  8. #
  9. # Prevent locale nonsense from breaking basic text processing.
  10. LC_ALL=C
  11. export LC_ALL
  12. # make sure we are running under a compatible shell
  13. # try to make this part work with most shells
  14. try_exec(){
  15. echo "Trying shell $1"
  16. type "$1" > /dev/null 2>&1 && exec "$@"
  17. }
  18. unset foo
  19. (: ${foo%%bar}) 2> /dev/null
  20. E1="$?"
  21. (: ${foo?}) 2> /dev/null
  22. E2="$?"
  23. if test "$E1" != 0 || test "$E2" = 0; then
  24. echo "Broken shell detected. Trying alternatives."
  25. export FF_CONF_EXEC
  26. if test "0$FF_CONF_EXEC" -lt 1; then
  27. FF_CONF_EXEC=1
  28. try_exec bash "$0" "$@"
  29. fi
  30. if test "0$FF_CONF_EXEC" -lt 2; then
  31. FF_CONF_EXEC=2
  32. try_exec ksh "$0" "$@"
  33. fi
  34. if test "0$FF_CONF_EXEC" -lt 3; then
  35. FF_CONF_EXEC=3
  36. try_exec /usr/xpg4/bin/sh "$0" "$@"
  37. fi
  38. echo "No compatible shell script interpreter found."
  39. echo "This configure script requires a POSIX-compatible shell"
  40. echo "such as bash or ksh."
  41. echo "THIS IS NOT A BUG IN FFMPEG, DO NOT REPORT IT AS SUCH."
  42. echo "Instead, install a working POSIX-compatible shell."
  43. echo "Disabling this configure test will create a broken FFmpeg."
  44. if test "$BASH_VERSION" = '2.04.0(1)-release'; then
  45. echo "This bash version ($BASH_VERSION) is broken on your platform."
  46. echo "Upgrade to a later version if available."
  47. fi
  48. exit 1
  49. fi
  50. test -d /usr/xpg4/bin && PATH=/usr/xpg4/bin:$PATH
  51. show_help(){
  52. cat <<EOF
  53. Usage: configure [options]
  54. Options: [defaults in brackets after descriptions]
  55. Help options:
  56. --help print this message
  57. --list-decoders show all available decoders
  58. --list-encoders show all available encoders
  59. --list-hwaccels show all available hardware accelerators
  60. --list-demuxers show all available demuxers
  61. --list-muxers show all available muxers
  62. --list-parsers show all available parsers
  63. --list-protocols show all available protocols
  64. --list-bsfs show all available bitstream filters
  65. --list-indevs show all available input devices
  66. --list-outdevs show all available output devices
  67. --list-filters show all available filters
  68. Standard options:
  69. --logfile=FILE log tests and output to FILE [config.log]
  70. --disable-logging do not log configure debug information
  71. --fatal-warnings fail if any configure warning is generated
  72. --prefix=PREFIX install in PREFIX [$prefix]
  73. --bindir=DIR install binaries in DIR [PREFIX/bin]
  74. --datadir=DIR install data files in DIR [PREFIX/share/ffmpeg]
  75. --docdir=DIR install documentation in DIR [PREFIX/share/doc/ffmpeg]
  76. --libdir=DIR install libs in DIR [PREFIX/lib]
  77. --shlibdir=DIR install shared libs in DIR [LIBDIR]
  78. --incdir=DIR install includes in DIR [PREFIX/include]
  79. --mandir=DIR install man page in DIR [PREFIX/share/man]
  80. --enable-rpath use rpath to allow installing libraries in paths
  81. not part of the dynamic linker search path
  82. use rpath when linking programs [USE WITH CARE]
  83. Licensing options:
  84. --enable-gpl allow use of GPL code, the resulting libs
  85. and binaries will be under GPL [no]
  86. --enable-version3 upgrade (L)GPL to version 3 [no]
  87. --enable-nonfree allow use of nonfree code, the resulting libs
  88. and binaries will be unredistributable [no]
  89. Configuration options:
  90. --disable-static do not build static libraries [no]
  91. --enable-shared build shared libraries [no]
  92. --enable-small optimize for size instead of speed
  93. --disable-runtime-cpudetect disable detecting cpu capabilities at runtime (smaller binary)
  94. --enable-gray enable full grayscale support (slower color)
  95. --disable-swscale-alpha disable alpha channel support in swscale
  96. --disable-all disable building components, libraries and programs
  97. --enable-incompatible-libav-abi enable incompatible Libav fork ABI [no]
  98. --enable-raise-major increase major version numbers in sonames [no]
  99. Program options:
  100. --disable-programs do not build command line programs
  101. --disable-ffmpeg disable ffmpeg build
  102. --disable-ffplay disable ffplay build
  103. --disable-ffprobe disable ffprobe build
  104. --disable-ffserver disable ffserver build
  105. Documentation options:
  106. --disable-doc do not build documentation
  107. --disable-htmlpages do not build HTML documentation pages
  108. --disable-manpages do not build man documentation pages
  109. --disable-podpages do not build POD documentation pages
  110. --disable-txtpages do not build text documentation pages
  111. Component options:
  112. --disable-avdevice disable libavdevice build
  113. --disable-avcodec disable libavcodec build
  114. --disable-avformat disable libavformat build
  115. --disable-avutil disable libavutil build
  116. --disable-swresample disable libswresample build
  117. --disable-swscale disable libswscale build
  118. --disable-postproc disable libpostproc build
  119. --disable-avfilter disable libavfilter build
  120. --enable-avresample enable libavresample build [no]
  121. --disable-pthreads disable pthreads [autodetect]
  122. --disable-w32threads disable Win32 threads [autodetect]
  123. --disable-os2threads disable OS/2 threads [autodetect]
  124. --disable-network disable network support [no]
  125. --disable-dct disable DCT code
  126. --disable-dwt disable DWT 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
  134. --disable-pixelutils disable pixel utils in libavutil
  135. Hardware accelerators:
  136. --disable-d3d11va disable D3D11VA code [autodetect]
  137. --disable-dxva2 disable DXVA2 code [autodetect]
  138. --disable-vaapi disable VAAPI code [autodetect]
  139. --disable-vda disable VDA code [autodetect]
  140. --disable-vdpau disable VDPAU code [autodetect]
  141. Individual component options:
  142. --disable-everything disable all components listed below
  143. --disable-encoder=NAME disable encoder NAME
  144. --enable-encoder=NAME enable encoder NAME
  145. --disable-encoders disable all encoders
  146. --disable-decoder=NAME disable decoder NAME
  147. --enable-decoder=NAME enable decoder NAME
  148. --disable-decoders disable all decoders
  149. --disable-hwaccel=NAME disable hwaccel NAME
  150. --enable-hwaccel=NAME enable hwaccel NAME
  151. --disable-hwaccels disable all hwaccels
  152. --disable-muxer=NAME disable muxer NAME
  153. --enable-muxer=NAME enable muxer NAME
  154. --disable-muxers disable all muxers
  155. --disable-demuxer=NAME disable demuxer NAME
  156. --enable-demuxer=NAME enable demuxer NAME
  157. --disable-demuxers disable all demuxers
  158. --enable-parser=NAME enable parser NAME
  159. --disable-parser=NAME disable parser NAME
  160. --disable-parsers disable all parsers
  161. --enable-bsf=NAME enable bitstream filter NAME
  162. --disable-bsf=NAME disable bitstream filter NAME
  163. --disable-bsfs disable all bitstream filters
  164. --enable-protocol=NAME enable protocol NAME
  165. --disable-protocol=NAME disable protocol NAME
  166. --disable-protocols disable all protocols
  167. --enable-indev=NAME enable input device NAME
  168. --disable-indev=NAME disable input device NAME
  169. --disable-indevs disable input devices
  170. --enable-outdev=NAME enable output device NAME
  171. --disable-outdev=NAME disable output device NAME
  172. --disable-outdevs disable output devices
  173. --disable-devices disable all devices
  174. --enable-filter=NAME enable filter NAME
  175. --disable-filter=NAME disable filter NAME
  176. --disable-filters disable all filters
  177. External library support:
  178. --enable-avisynth enable reading of AviSynth script files [no]
  179. --disable-bzlib disable bzlib [autodetect]
  180. --enable-fontconfig enable fontconfig, useful for drawtext filter [no]
  181. --enable-frei0r enable frei0r video filtering [no]
  182. --enable-gnutls enable gnutls, needed for https support
  183. if openssl is not used [no]
  184. --disable-iconv disable iconv [autodetect]
  185. --enable-ladspa enable LADSPA audio filtering [no]
  186. --enable-libaacplus enable AAC+ encoding via libaacplus [no]
  187. --enable-libass enable libass subtitles rendering,
  188. needed for subtitles and ass filter [no]
  189. --enable-libbluray enable BluRay reading using libbluray [no]
  190. --enable-libbs2b enable bs2b DSP library [no]
  191. --enable-libcaca enable textual display using libcaca [no]
  192. --enable-libcelt enable CELT decoding via libcelt [no]
  193. --enable-libcdio enable audio CD grabbing with libcdio [no]
  194. --enable-libdc1394 enable IIDC-1394 grabbing using libdc1394
  195. and libraw1394 [no]
  196. --enable-libdcadec enable DCA decoding via libdcadec [no]
  197. --enable-libfaac enable AAC encoding via libfaac [no]
  198. --enable-libfdk-aac enable AAC de/encoding via libfdk-aac [no]
  199. --enable-libflite enable flite (voice synthesis) support via libflite [no]
  200. --enable-libfreetype enable libfreetype, needed for drawtext filter [no]
  201. --enable-libfribidi enable libfribidi, improves drawtext filter [no]
  202. --enable-libgme enable Game Music Emu via libgme [no]
  203. --enable-libgsm enable GSM de/encoding via libgsm [no]
  204. --enable-libiec61883 enable iec61883 via libiec61883 [no]
  205. --enable-libilbc enable iLBC de/encoding via libilbc [no]
  206. --enable-libmfx enable HW acceleration through libmfx
  207. --enable-libmodplug enable ModPlug via libmodplug [no]
  208. --enable-libmp3lame enable MP3 encoding via libmp3lame [no]
  209. --enable-libnut enable NUT (de)muxing via libnut,
  210. native (de)muxer exists [no]
  211. --enable-libopencore-amrnb enable AMR-NB de/encoding via libopencore-amrnb [no]
  212. --enable-libopencore-amrwb enable AMR-WB decoding via libopencore-amrwb [no]
  213. --enable-libopencv enable video filtering via libopencv [no]
  214. --enable-libopenh264 enable H.264 encoding via OpenH264 [no]
  215. --enable-libopenjpeg enable JPEG 2000 de/encoding via OpenJPEG [no]
  216. --enable-libopus enable Opus de/encoding via libopus [no]
  217. --enable-libpulse enable Pulseaudio input via libpulse [no]
  218. --enable-libquvi enable quvi input via libquvi [no]
  219. --enable-librtmp enable RTMP[E] support via librtmp [no]
  220. --enable-libschroedinger enable Dirac de/encoding via libschroedinger [no]
  221. --enable-libshine enable fixed-point MP3 encoding via libshine [no]
  222. --enable-libsmbclient enable Samba protocol via libsmbclient [no]
  223. --enable-libsoxr enable Include libsoxr resampling [no]
  224. --enable-libspeex enable Speex de/encoding via libspeex [no]
  225. --enable-libssh enable SFTP protocol via libssh [no]
  226. --enable-libstagefright-h264 enable H.264 decoding via libstagefright [no]
  227. --enable-libtheora enable Theora encoding via libtheora [no]
  228. --enable-libtwolame enable MP2 encoding via libtwolame [no]
  229. --enable-libutvideo enable Ut Video encoding and decoding via libutvideo [no]
  230. --enable-libv4l2 enable libv4l2/v4l-utils [no]
  231. --enable-libvidstab enable video stabilization using vid.stab [no]
  232. --enable-libvo-aacenc enable AAC encoding via libvo-aacenc [no]
  233. --enable-libvo-amrwbenc enable AMR-WB encoding via libvo-amrwbenc [no]
  234. --enable-libvorbis enable Vorbis en/decoding via libvorbis,
  235. native implementation exists [no]
  236. --enable-libvpx enable VP8 and VP9 de/encoding via libvpx [no]
  237. --enable-libwavpack enable wavpack encoding via libwavpack [no]
  238. --enable-libwebp enable WebP encoding via libwebp [no]
  239. --enable-libx264 enable H.264 encoding via x264 [no]
  240. --enable-libx265 enable HEVC encoding via x265 [no]
  241. --enable-libxavs enable AVS encoding via xavs [no]
  242. --enable-libxcb enable X11 grabbing using XCB [autodetect]
  243. --enable-libxcb-shm enable X11 grabbing shm communication [autodetect]
  244. --enable-libxcb-xfixes enable X11 grabbing mouse rendering [autodetect]
  245. --enable-libxcb-shape enable X11 grabbing shape rendering [autodetect]
  246. --enable-libxvid enable Xvid encoding via xvidcore,
  247. native MPEG-4/Xvid encoder exists [no]
  248. --enable-libzmq enable message passing via libzmq [no]
  249. --enable-libzvbi enable teletext support via libzvbi [no]
  250. --disable-lzma disable lzma [autodetect]
  251. --enable-decklink enable Blackmagick DeckLink I/O support [no]
  252. --enable-mmal enable decoding via MMAL [no]
  253. --enable-nvenc enable NVIDIA NVENC support [no]
  254. --enable-openal enable OpenAL 1.1 capture support [no]
  255. --enable-opencl enable OpenCL code
  256. --enable-opengl enable OpenGL rendering [no]
  257. --enable-openssl enable openssl, needed for https support
  258. if gnutls is not used [no]
  259. --disable-sdl disable sdl [autodetect]
  260. --enable-x11grab enable X11 grabbing (legacy) [no]
  261. --disable-xlib disable xlib [autodetect]
  262. --disable-zlib disable zlib [autodetect]
  263. Toolchain options:
  264. --arch=ARCH select architecture [$arch]
  265. --cpu=CPU select the minimum required CPU (affects
  266. instruction selection, may crash on older CPUs)
  267. --cross-prefix=PREFIX use PREFIX for compilation tools [$cross_prefix]
  268. --progs-suffix=SUFFIX program name suffix []
  269. --enable-cross-compile assume a cross-compiler is used
  270. --sysroot=PATH root of cross-build tree
  271. --sysinclude=PATH location of cross-build system headers
  272. --target-os=OS compiler targets OS [$target_os]
  273. --target-exec=CMD command to run executables on target
  274. --target-path=DIR path to view of build directory on target
  275. --target-samples=DIR path to samples directory on target
  276. --tempprefix=PATH force fixed dir/prefix instead of mktemp for checks
  277. --toolchain=NAME set tool defaults according to NAME
  278. --nm=NM use nm tool NM [$nm_default]
  279. --ar=AR use archive tool AR [$ar_default]
  280. --as=AS use assembler AS [$as_default]
  281. --windres=WINDRES use windows resource compiler WINDRES [$windres_default]
  282. --yasmexe=EXE use yasm-compatible assembler EXE [$yasmexe_default]
  283. --cc=CC use C compiler CC [$cc_default]
  284. --cxx=CXX use C compiler CXX [$cxx_default]
  285. --dep-cc=DEPCC use dependency generator DEPCC [$cc_default]
  286. --ld=LD use linker LD [$ld_default]
  287. --pkg-config=PKGCONFIG use pkg-config tool PKGCONFIG [$pkg_config_default]
  288. --pkg-config-flags=FLAGS pass additional flags to pkgconf []
  289. --ranlib=RANLIB use ranlib RANLIB [$ranlib_default]
  290. --doxygen=DOXYGEN use DOXYGEN to generate API doc [$doxygen_default]
  291. --host-cc=HOSTCC use host C compiler HOSTCC
  292. --host-cflags=HCFLAGS use HCFLAGS when compiling for host
  293. --host-cppflags=HCPPFLAGS use HCPPFLAGS when compiling for host
  294. --host-ld=HOSTLD use host linker HOSTLD
  295. --host-ldflags=HLDFLAGS use HLDFLAGS when linking for host
  296. --host-libs=HLIBS use libs HLIBS when linking for host
  297. --host-os=OS compiler host OS [$target_os]
  298. --extra-cflags=ECFLAGS add ECFLAGS to CFLAGS [$CFLAGS]
  299. --extra-cxxflags=ECFLAGS add ECFLAGS to CXXFLAGS [$CXXFLAGS]
  300. --extra-ldflags=ELDFLAGS add ELDFLAGS to LDFLAGS [$LDFLAGS]
  301. --extra-ldexeflags=ELDFLAGS add ELDFLAGS to LDEXEFLAGS [$LDEXEFLAGS]
  302. --extra-libs=ELIBS add ELIBS [$ELIBS]
  303. --extra-version=STRING version string suffix []
  304. --optflags=OPTFLAGS override optimization-related compiler flags
  305. --build-suffix=SUFFIX library name suffix []
  306. --enable-pic build position-independent code
  307. --enable-thumb compile for Thumb instruction set
  308. --enable-lto use link-time optimization
  309. Advanced options (experts only):
  310. --malloc-prefix=PREFIX prefix malloc and related names with PREFIX
  311. --disable-symver disable symbol versioning
  312. --enable-hardcoded-tables use hardcoded tables instead of runtime generation
  313. --disable-safe-bitstream-reader
  314. disable buffer boundary checking in bitreaders
  315. (faster, but may crash)
  316. --enable-memalign-hack emulate memalign, interferes with memory debuggers
  317. --sws-max-filter-size=N the max filter size swscale uses [$sws_max_filter_size_default]
  318. Optimization options (experts only):
  319. --disable-asm disable all assembly optimizations
  320. --disable-altivec disable AltiVec optimizations
  321. --disable-amd3dnow disable 3DNow! optimizations
  322. --disable-amd3dnowext disable 3DNow! extended optimizations
  323. --disable-mmx disable MMX optimizations
  324. --disable-mmxext disable MMXEXT optimizations
  325. --disable-sse disable SSE optimizations
  326. --disable-sse2 disable SSE2 optimizations
  327. --disable-sse3 disable SSE3 optimizations
  328. --disable-ssse3 disable SSSE3 optimizations
  329. --disable-sse4 disable SSE4 optimizations
  330. --disable-sse42 disable SSE4.2 optimizations
  331. --disable-avx disable AVX optimizations
  332. --disable-xop disable XOP optimizations
  333. --disable-fma3 disable FMA3 optimizations
  334. --disable-fma4 disable FMA4 optimizations
  335. --disable-avx2 disable AVX2 optimizations
  336. --disable-armv5te disable armv5te optimizations
  337. --disable-armv6 disable armv6 optimizations
  338. --disable-armv6t2 disable armv6t2 optimizations
  339. --disable-vfp disable VFP optimizations
  340. --disable-neon disable NEON optimizations
  341. --disable-inline-asm disable use of inline assembly
  342. --disable-yasm disable use of nasm/yasm assembly
  343. --disable-mips32r5 disable MIPS32R5 optimizations
  344. --disable-mips64r6 disable MIPS64R6 optimizations
  345. --disable-mipsdspr1 disable MIPS DSP ASE R1 optimizations
  346. --disable-mipsdspr2 disable MIPS DSP ASE R2 optimizations
  347. --disable-msa disable MSA optimizations
  348. --disable-mipsfpu disable floating point MIPS optimizations
  349. --disable-loongson3 disable Loongson-3 SIMD optimizations
  350. --disable-fast-unaligned consider unaligned accesses slow
  351. Developer options (useful when working on FFmpeg itself):
  352. --disable-debug disable debugging symbols
  353. --enable-debug=LEVEL set the debug level [$debuglevel]
  354. --disable-optimizations disable compiler optimizations
  355. --enable-extra-warnings enable more compiler warnings
  356. --disable-stripping disable stripping of executables and shared libraries
  357. --assert-level=level 0(default), 1 or 2, amount of assertion testing,
  358. 2 causes a slowdown at runtime.
  359. --enable-memory-poisoning fill heap uninitialized allocated space with arbitrary data
  360. --valgrind=VALGRIND run "make fate" tests through valgrind to detect memory
  361. leaks and errors, using the specified valgrind binary.
  362. Cannot be combined with --target-exec
  363. --enable-ftrapv Trap arithmetic overflows
  364. --samples=PATH location of test samples for FATE, if not set use
  365. \$FATE_SAMPLES at make invocation time.
  366. --enable-neon-clobber-test check NEON registers for clobbering (should be
  367. used only for debugging purposes)
  368. --enable-xmm-clobber-test check XMM registers for clobbering (Win64-only;
  369. should be used only for debugging purposes)
  370. --enable-random randomly enable/disable components
  371. --disable-random
  372. --enable-random=LIST randomly enable/disable specific components or
  373. --disable-random=LIST component groups. LIST is a comma-separated list
  374. of NAME[:PROB] entries where NAME is a component
  375. (group) and PROB the probability associated with
  376. NAME (default 0.5).
  377. --random-seed=VALUE seed value for --enable/disable-random
  378. --disable-valgrind-backtrace do not print a backtrace under Valgrind
  379. (only applies to --disable-optimizations builds)
  380. NOTE: Object files are built at the place where configure is launched.
  381. EOF
  382. exit 0
  383. }
  384. quotes='""'
  385. log(){
  386. echo "$@" >> $logfile
  387. }
  388. log_file(){
  389. log BEGIN $1
  390. pr -n -t $1 >> $logfile
  391. log END $1
  392. }
  393. echolog(){
  394. log "$@"
  395. echo "$@"
  396. }
  397. warn(){
  398. log "WARNING: $*"
  399. WARNINGS="${WARNINGS}WARNING: $*\n"
  400. }
  401. die(){
  402. echolog "$@"
  403. cat <<EOF
  404. If you think configure made a mistake, make sure you are using the latest
  405. version from Git. If the latest version fails, report the problem to the
  406. ffmpeg-user@ffmpeg.org mailing list or IRC #ffmpeg on irc.freenode.net.
  407. EOF
  408. if disabled logging; then
  409. cat <<EOF
  410. Rerun configure with logging enabled (do not use --disable-logging), and
  411. include the log this produces with your report.
  412. EOF
  413. else
  414. cat <<EOF
  415. Include the log file "$logfile" produced by configure as this will help
  416. solve the problem.
  417. EOF
  418. fi
  419. exit 1
  420. }
  421. # Avoid locale weirdness, besides we really just want to translate ASCII.
  422. toupper(){
  423. echo "$@" | tr abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ
  424. }
  425. tolower(){
  426. echo "$@" | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz
  427. }
  428. c_escape(){
  429. echo "$*" | sed 's/["\\]/\\\0/g'
  430. }
  431. sh_quote(){
  432. v=$(echo "$1" | sed "s/'/'\\\\''/g")
  433. test "x$v" = "x${v#*[!A-Za-z0-9_/.+-]}" || v="'$v'"
  434. echo "$v"
  435. }
  436. cleanws(){
  437. echo "$@" | sed 's/^ *//;s/ */ /g;s/ *$//;s/\\r//g'
  438. }
  439. filter(){
  440. pat=$1
  441. shift
  442. for v; do
  443. eval "case $v in $pat) echo $v ;; esac"
  444. done
  445. }
  446. filter_out(){
  447. pat=$1
  448. shift
  449. for v; do
  450. eval "case $v in $pat) ;; *) echo $v ;; esac"
  451. done
  452. }
  453. map(){
  454. m=$1
  455. shift
  456. for v; do eval $m; done
  457. }
  458. add_suffix(){
  459. suffix=$1
  460. shift
  461. for v; do echo ${v}${suffix}; done
  462. }
  463. set_all(){
  464. value=$1
  465. shift
  466. for var in $*; do
  467. eval $var=$value
  468. done
  469. }
  470. set_weak(){
  471. value=$1
  472. shift
  473. for var; do
  474. eval : \${$var:=$value}
  475. done
  476. }
  477. sanitize_var_name(){
  478. echo $@ | sed 's/[^A-Za-z0-9_]/_/g'
  479. }
  480. set_safe(){
  481. var=$1
  482. shift
  483. eval $(sanitize_var_name "$var")='$*'
  484. }
  485. get_safe(){
  486. eval echo \$$(sanitize_var_name "$1")
  487. }
  488. pushvar(){
  489. for pvar in $*; do
  490. eval level=\${${pvar}_level:=0}
  491. eval ${pvar}_${level}="\$$pvar"
  492. eval ${pvar}_level=$(($level+1))
  493. done
  494. }
  495. popvar(){
  496. for pvar in $*; do
  497. eval level=\${${pvar}_level:-0}
  498. test $level = 0 && continue
  499. eval level=$(($level-1))
  500. eval $pvar="\${${pvar}_${level}}"
  501. eval ${pvar}_level=$level
  502. eval unset ${pvar}_${level}
  503. done
  504. }
  505. enable(){
  506. set_all yes $*
  507. }
  508. disable(){
  509. set_all no $*
  510. }
  511. enable_weak(){
  512. set_weak yes $*
  513. }
  514. disable_weak(){
  515. set_weak no $*
  516. }
  517. enable_safe(){
  518. for var; do
  519. enable $(echo "$var" | sed 's/[^A-Za-z0-9_]/_/g')
  520. done
  521. }
  522. disable_safe(){
  523. for var; do
  524. disable $(echo "$var" | sed 's/[^A-Za-z0-9_]/_/g')
  525. done
  526. }
  527. do_enable_deep(){
  528. for var; do
  529. enabled $var && continue
  530. eval sel="\$${var}_select"
  531. eval sgs="\$${var}_suggest"
  532. pushvar var sgs
  533. enable_deep $sel
  534. popvar sgs
  535. enable_deep_weak $sgs
  536. popvar var
  537. done
  538. }
  539. enable_deep(){
  540. do_enable_deep $*
  541. enable $*
  542. }
  543. enable_deep_weak(){
  544. for var; do
  545. disabled $var && continue
  546. pushvar var
  547. do_enable_deep $var
  548. popvar var
  549. enable_weak $var
  550. done
  551. }
  552. enabled(){
  553. test "${1#!}" = "$1" && op== || op=!=
  554. eval test "x\$${1#!}" $op "xyes"
  555. }
  556. disabled(){
  557. test "${1#!}" = "$1" && op== || op=!=
  558. eval test "x\$${1#!}" $op "xno"
  559. }
  560. enabled_all(){
  561. for opt; do
  562. enabled $opt || return 1
  563. done
  564. }
  565. disabled_all(){
  566. for opt; do
  567. disabled $opt || return 1
  568. done
  569. }
  570. enabled_any(){
  571. for opt; do
  572. enabled $opt && return 0
  573. done
  574. }
  575. disabled_any(){
  576. for opt; do
  577. disabled $opt && return 0
  578. done
  579. return 1
  580. }
  581. set_default(){
  582. for opt; do
  583. eval : \${$opt:=\$${opt}_default}
  584. done
  585. }
  586. is_in(){
  587. value=$1
  588. shift
  589. for var in $*; do
  590. [ $var = $value ] && return 0
  591. done
  592. return 1
  593. }
  594. do_check_deps(){
  595. for cfg; do
  596. cfg="${cfg#!}"
  597. enabled ${cfg}_checking && die "Circular dependency for $cfg."
  598. disabled ${cfg}_checking && continue
  599. enable ${cfg}_checking
  600. append allopts $cfg
  601. eval dep_all="\$${cfg}_deps"
  602. eval dep_any="\$${cfg}_deps_any"
  603. eval dep_sel="\$${cfg}_select"
  604. eval dep_sgs="\$${cfg}_suggest"
  605. eval dep_ifa="\$${cfg}_if"
  606. eval dep_ifn="\$${cfg}_if_any"
  607. pushvar cfg dep_all dep_any dep_sel dep_sgs dep_ifa dep_ifn
  608. do_check_deps $dep_all $dep_any $dep_sel $dep_sgs $dep_ifa $dep_ifn
  609. popvar cfg dep_all dep_any dep_sel dep_sgs dep_ifa dep_ifn
  610. [ -n "$dep_ifa" ] && { enabled_all $dep_ifa && enable_weak $cfg; }
  611. [ -n "$dep_ifn" ] && { enabled_any $dep_ifn && enable_weak $cfg; }
  612. enabled_all $dep_all || disable $cfg
  613. enabled_any $dep_any || disable $cfg
  614. disabled_any $dep_sel && disable $cfg
  615. if enabled $cfg; then
  616. enable_deep $dep_sel
  617. enable_deep_weak $dep_sgs
  618. fi
  619. disable ${cfg}_checking
  620. done
  621. }
  622. check_deps(){
  623. unset allopts
  624. do_check_deps "$@"
  625. for cfg in $allopts; do
  626. enabled $cfg || continue
  627. eval dep_extralibs="\$${cfg}_extralibs"
  628. test -n "$dep_extralibs" && add_extralibs $dep_extralibs
  629. done
  630. }
  631. print_config(){
  632. pfx=$1
  633. files=$2
  634. shift 2
  635. map 'eval echo "$v \${$v:-no}"' "$@" |
  636. awk "BEGIN { split(\"$files\", files) }
  637. {
  638. c = \"$pfx\" toupper(\$1);
  639. v = \$2;
  640. sub(/yes/, 1, v);
  641. sub(/no/, 0, v);
  642. for (f in files) {
  643. file = files[f];
  644. if (file ~ /\\.h\$/) {
  645. printf(\"#define %s %d\\n\", c, v) >>file;
  646. } else if (file ~ /\\.asm\$/) {
  647. printf(\"%%define %s %d\\n\", c, v) >>file;
  648. } else if (file ~ /\\.mak\$/) {
  649. n = -v ? \"\" : \"!\";
  650. printf(\"%s%s=yes\\n\", n, c) >>file;
  651. } else if (file ~ /\\.texi\$/) {
  652. pre = -v ? \"\" : \"@c \";
  653. yesno = \$2;
  654. c2 = tolower(c);
  655. gsub(/_/, \"-\", c2);
  656. printf(\"%s@set %s %s\\n\", pre, c2, yesno) >>file;
  657. }
  658. }
  659. }"
  660. }
  661. print_enabled(){
  662. suf=$1
  663. shift
  664. for v; do
  665. enabled $v && printf "%s\n" ${v%$suf};
  666. done
  667. }
  668. append(){
  669. var=$1
  670. shift
  671. eval "$var=\"\$$var $*\""
  672. }
  673. prepend(){
  674. var=$1
  675. shift
  676. eval "$var=\"$* \$$var\""
  677. }
  678. unique(){
  679. var=$1
  680. uniq_list=""
  681. for tok in $(eval echo \$$var); do
  682. uniq_list="$(filter_out $tok $uniq_list) $tok"
  683. done
  684. eval "$var=\"${uniq_list}\""
  685. }
  686. add_cppflags(){
  687. append CPPFLAGS "$@"
  688. }
  689. add_cflags(){
  690. append CFLAGS $($cflags_filter "$@")
  691. }
  692. add_cxxflags(){
  693. append CXXFLAGS $($cflags_filter "$@")
  694. }
  695. add_asflags(){
  696. append ASFLAGS $($asflags_filter "$@")
  697. }
  698. add_ldflags(){
  699. append LDFLAGS $($ldflags_filter "$@")
  700. }
  701. add_ldexeflags(){
  702. append LDEXEFLAGS $($ldflags_filter "$@")
  703. }
  704. add_stripflags(){
  705. append ASMSTRIPFLAGS "$@"
  706. }
  707. add_extralibs(){
  708. prepend extralibs $($ldflags_filter "$@")
  709. }
  710. add_host_cppflags(){
  711. append host_cppflags "$@"
  712. }
  713. add_host_cflags(){
  714. append host_cflags $($host_cflags_filter "$@")
  715. }
  716. add_host_ldflags(){
  717. append host_ldflags $($host_ldflags_filter "$@")
  718. }
  719. add_compat(){
  720. append compat_objs $1
  721. shift
  722. map 'add_cppflags -D$v' "$@"
  723. }
  724. check_cmd(){
  725. log "$@"
  726. "$@" >> $logfile 2>&1
  727. }
  728. check_stat(){
  729. log check_stat "$@"
  730. stat "$1" >> $logfile 2>&1
  731. }
  732. cc_o(){
  733. eval printf '%s\\n' $CC_O
  734. }
  735. cc_e(){
  736. eval printf '%s\\n' $CC_E
  737. }
  738. check_cc(){
  739. log check_cc "$@"
  740. cat > $TMPC
  741. log_file $TMPC
  742. check_cmd $cc $CPPFLAGS $CFLAGS "$@" $CC_C $(cc_o $TMPO) $TMPC
  743. }
  744. check_cxx(){
  745. log check_cxx "$@"
  746. cat > $TMPCPP
  747. log_file $TMPCPP
  748. check_cmd $cxx $CPPFLAGS $CFLAGS $CXXFLAGS "$@" $CXX_C -o $TMPO $TMPCPP
  749. }
  750. check_oc(){
  751. log check_oc "$@"
  752. cat > $TMPM
  753. log_file $TMPM
  754. check_cmd $cc -Werror=missing-prototypes $CPPFLAGS $CFLAGS "$@" $CC_C $(cc_o $TMPO) $TMPM
  755. }
  756. check_cpp(){
  757. log check_cpp "$@"
  758. cat > $TMPC
  759. log_file $TMPC
  760. check_cmd $cc $CPPFLAGS $CFLAGS "$@" $(cc_e $TMPO) $TMPC
  761. }
  762. as_o(){
  763. eval printf '%s\\n' $AS_O
  764. }
  765. check_as(){
  766. log check_as "$@"
  767. cat > $TMPS
  768. log_file $TMPS
  769. check_cmd $as $CPPFLAGS $ASFLAGS "$@" $AS_C $(as_o $TMPO) $TMPS
  770. }
  771. check_inline_asm(){
  772. log check_inline_asm "$@"
  773. name="$1"
  774. code="$2"
  775. shift 2
  776. disable $name
  777. check_cc "$@" <<EOF && enable $name
  778. void foo(void){ __asm__ volatile($code); }
  779. EOF
  780. }
  781. check_insn(){
  782. log check_insn "$@"
  783. check_inline_asm ${1}_inline "\"$2\""
  784. echo "$2" | check_as && enable ${1}_external || disable ${1}_external
  785. }
  786. check_yasm(){
  787. log check_yasm "$@"
  788. echo "$1" > $TMPS
  789. log_file $TMPS
  790. shift 1
  791. check_cmd $yasmexe $YASMFLAGS -Werror "$@" -o $TMPO $TMPS
  792. }
  793. ld_o(){
  794. eval printf '%s\\n' $LD_O
  795. }
  796. check_ld(){
  797. log check_ld "$@"
  798. type=$1
  799. shift 1
  800. flags=$(filter_out '-l*|*.so' $@)
  801. libs=$(filter '-l*|*.so' $@)
  802. check_$type $($cflags_filter $flags) || return
  803. flags=$($ldflags_filter $flags)
  804. libs=$($ldflags_filter $libs)
  805. check_cmd $ld $LDFLAGS $flags $(ld_o $TMPE) $TMPO $libs $extralibs
  806. }
  807. print_include(){
  808. hdr=$1
  809. test "${hdr%.h}" = "${hdr}" &&
  810. echo "#include $hdr" ||
  811. echo "#include <$hdr>"
  812. }
  813. check_code(){
  814. log check_code "$@"
  815. check=$1
  816. headers=$2
  817. code=$3
  818. shift 3
  819. {
  820. for hdr in $headers; do
  821. print_include $hdr
  822. done
  823. echo "int main(void) { $code; return 0; }"
  824. } | check_$check "$@"
  825. }
  826. check_cppflags(){
  827. log check_cppflags "$@"
  828. check_cc "$@" <<EOF && append CPPFLAGS "$@"
  829. int x;
  830. EOF
  831. }
  832. test_cflags(){
  833. log test_cflags "$@"
  834. set -- $($cflags_filter "$@")
  835. check_cc "$@" <<EOF
  836. int x;
  837. EOF
  838. }
  839. check_cflags(){
  840. log check_cflags "$@"
  841. test_cflags "$@" && add_cflags "$@"
  842. }
  843. check_cxxflags(){
  844. log check_cxxflags "$@"
  845. set -- $($cflags_filter "$@")
  846. check_cxx "$@" <<EOF && append CXXFLAGS "$@"
  847. int x;
  848. EOF
  849. }
  850. test_ldflags(){
  851. log test_ldflags "$@"
  852. check_ld "cc" "$@" <<EOF
  853. int main(void){ return 0; }
  854. EOF
  855. }
  856. check_ldflags(){
  857. log check_ldflags "$@"
  858. test_ldflags "$@" && add_ldflags "$@"
  859. }
  860. test_stripflags(){
  861. log test_stripflags "$@"
  862. # call check_cc to get a fresh TMPO
  863. check_cc <<EOF
  864. int main(void) { return 0; }
  865. EOF
  866. check_cmd $strip $ASMSTRIPFLAGS "$@" $TMPO
  867. }
  868. check_stripflags(){
  869. log check_stripflags "$@"
  870. test_stripflags "$@" && add_stripflags "$@"
  871. }
  872. check_header(){
  873. log check_header "$@"
  874. header=$1
  875. shift
  876. disable_safe $header
  877. check_cpp "$@" <<EOF && enable_safe $header
  878. #include <$header>
  879. int x;
  880. EOF
  881. }
  882. check_header_oc(){
  883. log check_header_oc "$@"
  884. rm -f -- "$TMPO"
  885. header=$1
  886. shift
  887. disable_safe $header
  888. {
  889. echo "#include <$header>"
  890. echo "int main(void) { return 0; }"
  891. } | check_oc && check_stat "$TMPO" && enable_safe $headers
  892. }
  893. check_func(){
  894. log check_func "$@"
  895. func=$1
  896. shift
  897. disable $func
  898. check_ld "cc" "$@" <<EOF && enable $func
  899. extern int $func();
  900. int main(void){ $func(); }
  901. EOF
  902. }
  903. check_mathfunc(){
  904. log check_mathfunc "$@"
  905. func=$1
  906. narg=$2
  907. shift 2
  908. test $narg = 2 && args="f, g" || args="f"
  909. disable $func
  910. check_ld "cc" "$@" <<EOF && enable $func
  911. #include <math.h>
  912. float foo(float f, float g) { return $func($args); }
  913. int main(void){ return (int) foo; }
  914. EOF
  915. }
  916. check_func_headers(){
  917. log check_func_headers "$@"
  918. headers=$1
  919. funcs=$2
  920. shift 2
  921. {
  922. for hdr in $headers; do
  923. print_include $hdr
  924. done
  925. for func in $funcs; do
  926. echo "long check_$func(void) { return (long) $func; }"
  927. done
  928. echo "int main(void) { return 0; }"
  929. } | check_ld "cc" "$@" && enable $funcs && enable_safe $headers
  930. }
  931. check_class_headers_cpp(){
  932. log check_class_headers_cpp "$@"
  933. headers=$1
  934. classes=$2
  935. shift 2
  936. {
  937. for hdr in $headers; do
  938. echo "#include <$hdr>"
  939. done
  940. echo "int main(void) { "
  941. i=1
  942. for class in $classes; do
  943. echo "$class obj$i;"
  944. i=$(expr $i + 1)
  945. done
  946. echo "return 0; }"
  947. } | check_ld "cxx" "$@" && enable $funcs && enable_safe $headers
  948. }
  949. check_cpp_condition(){
  950. log check_cpp_condition "$@"
  951. header=$1
  952. condition=$2
  953. shift 2
  954. check_cpp "$@" <<EOF
  955. #include <$header>
  956. #if !($condition)
  957. #error "unsatisfied condition: $condition"
  958. #endif
  959. EOF
  960. }
  961. check_lib(){
  962. log check_lib "$@"
  963. header="$1"
  964. func="$2"
  965. shift 2
  966. check_header $header && check_func $func "$@" && add_extralibs "$@"
  967. }
  968. check_lib2(){
  969. log check_lib2 "$@"
  970. headers="$1"
  971. funcs="$2"
  972. shift 2
  973. check_func_headers "$headers" "$funcs" "$@" && add_extralibs "$@"
  974. }
  975. check_lib_cpp(){
  976. log check_lib_cpp "$@"
  977. headers="$1"
  978. classes="$2"
  979. shift 2
  980. check_class_headers_cpp "$headers" "$classes" "$@" && add_extralibs "$@"
  981. }
  982. check_pkg_config(){
  983. log check_pkg_config "$@"
  984. pkgandversion="$1"
  985. pkg="${1%% *}"
  986. headers="$2"
  987. funcs="$3"
  988. shift 3
  989. check_cmd $pkg_config --exists --print-errors $pkgandversion || return
  990. pkg_cflags=$($pkg_config --cflags $pkg_config_flags $pkg)
  991. pkg_libs=$($pkg_config --libs $pkg_config_flags $pkg)
  992. check_func_headers "$headers" "$funcs" $pkg_cflags $pkg_libs "$@" &&
  993. set_safe ${pkg}_cflags $pkg_cflags &&
  994. set_safe ${pkg}_libs $pkg_libs
  995. }
  996. check_exec(){
  997. check_ld "cc" "$@" && { enabled cross_compile || $TMPE >> $logfile 2>&1; }
  998. }
  999. check_exec_crash(){
  1000. code=$(cat)
  1001. # exit() is not async signal safe. _Exit (C99) and _exit (POSIX)
  1002. # are safe but may not be available everywhere. Thus we use
  1003. # raise(SIGTERM) instead. The check is run in a subshell so we
  1004. # can redirect the "Terminated" message from the shell. SIGBUS
  1005. # is not defined by standard C so it is used conditionally.
  1006. (check_exec "$@") >> $logfile 2>&1 <<EOF
  1007. #include <signal.h>
  1008. static void sighandler(int sig){
  1009. raise(SIGTERM);
  1010. }
  1011. int foo(void){
  1012. $code
  1013. }
  1014. int (*func_ptr)(void) = foo;
  1015. int main(void){
  1016. signal(SIGILL, sighandler);
  1017. signal(SIGFPE, sighandler);
  1018. signal(SIGSEGV, sighandler);
  1019. #ifdef SIGBUS
  1020. signal(SIGBUS, sighandler);
  1021. #endif
  1022. return func_ptr();
  1023. }
  1024. EOF
  1025. }
  1026. check_type(){
  1027. log check_type "$@"
  1028. headers=$1
  1029. type=$2
  1030. shift 2
  1031. disable_safe "$type"
  1032. check_code cc "$headers" "$type v" "$@" && enable_safe "$type"
  1033. }
  1034. check_struct(){
  1035. log check_struct "$@"
  1036. headers=$1
  1037. struct=$2
  1038. member=$3
  1039. shift 3
  1040. disable_safe "${struct}_${member}"
  1041. check_code cc "$headers" "const void *p = &(($struct *)0)->$member" "$@" &&
  1042. enable_safe "${struct}_${member}"
  1043. }
  1044. check_builtin(){
  1045. log check_builtin "$@"
  1046. name=$1
  1047. headers=$2
  1048. builtin=$3
  1049. shift 3
  1050. disable "$name"
  1051. check_code ld "$headers" "$builtin" "cc" "$@" && enable "$name"
  1052. }
  1053. check_compile_assert(){
  1054. log check_compile_assert "$@"
  1055. name=$1
  1056. headers=$2
  1057. condition=$3
  1058. shift 3
  1059. disable "$name"
  1060. check_code cc "$headers" "char c[2 * !!($condition) - 1]" "$@" && enable "$name"
  1061. }
  1062. require(){
  1063. name="$1"
  1064. header="$2"
  1065. func="$3"
  1066. shift 3
  1067. check_lib $header $func "$@" || die "ERROR: $name not found"
  1068. }
  1069. require2(){
  1070. name="$1"
  1071. headers="$2"
  1072. func="$3"
  1073. shift 3
  1074. check_lib2 "$headers" $func "$@" || die "ERROR: $name not found"
  1075. }
  1076. require_cpp(){
  1077. name="$1"
  1078. headers="$2"
  1079. classes="$3"
  1080. shift 3
  1081. check_lib_cpp "$headers" "$classes" "$@" || die "ERROR: $name not found"
  1082. }
  1083. use_pkg_config(){
  1084. pkg="$1"
  1085. check_pkg_config "$@" || return 1
  1086. add_cflags $(get_safe ${pkg}_cflags)
  1087. add_extralibs $(get_safe ${pkg}_libs)
  1088. }
  1089. require_pkg_config(){
  1090. use_pkg_config "$@" || die "ERROR: $pkg not found using pkg-config$pkg_config_fail_message"
  1091. }
  1092. require_libfreetype(){
  1093. log require_libfreetype "$@"
  1094. pkg="freetype2"
  1095. check_cmd $pkg_config --exists --print-errors $pkg \
  1096. || die "ERROR: $pkg not found"
  1097. pkg_cflags=$($pkg_config --cflags $pkg_config_flags $pkg)
  1098. pkg_libs=$($pkg_config --libs $pkg_config_flags $pkg)
  1099. {
  1100. echo "#include <ft2build.h>"
  1101. echo "#include FT_FREETYPE_H"
  1102. echo "long check_func(void) { return (long) FT_Init_FreeType; }"
  1103. echo "int main(void) { return 0; }"
  1104. } | check_ld "cc" $pkg_cflags $pkg_libs \
  1105. && set_safe ${pkg}_cflags $pkg_cflags \
  1106. && set_safe ${pkg}_libs $pkg_libs \
  1107. || die "ERROR: $pkg not found"
  1108. add_cflags $(get_safe ${pkg}_cflags)
  1109. add_extralibs $(get_safe ${pkg}_libs)
  1110. }
  1111. hostcc_e(){
  1112. eval printf '%s\\n' $HOSTCC_E
  1113. }
  1114. hostcc_o(){
  1115. eval printf '%s\\n' $HOSTCC_O
  1116. }
  1117. check_host_cc(){
  1118. log check_host_cc "$@"
  1119. cat > $TMPC
  1120. log_file $TMPC
  1121. check_cmd $host_cc $host_cflags "$@" $HOSTCC_C $(hostcc_o $TMPO) $TMPC
  1122. }
  1123. check_host_cpp(){
  1124. log check_host_cpp "$@"
  1125. cat > $TMPC
  1126. log_file $TMPC
  1127. check_cmd $host_cc $host_cppflags $host_cflags "$@" $(hostcc_e $TMPO) $TMPC
  1128. }
  1129. check_host_cppflags(){
  1130. log check_host_cppflags "$@"
  1131. check_host_cc "$@" <<EOF && append host_cppflags "$@"
  1132. int x;
  1133. EOF
  1134. }
  1135. check_host_cflags(){
  1136. log check_host_cflags "$@"
  1137. set -- $($host_cflags_filter "$@")
  1138. check_host_cc "$@" <<EOF && append host_cflags "$@"
  1139. int x;
  1140. EOF
  1141. }
  1142. check_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
  1152. EOF
  1153. }
  1154. apply(){
  1155. file=$1
  1156. shift
  1157. "$@" < "$file" > "$file.tmp" && mv "$file.tmp" "$file" || rm "$file.tmp"
  1158. }
  1159. cp_if_changed(){
  1160. cmp -s "$1" "$2" && echo "$2 is unchanged" && return
  1161. mkdir -p "$(dirname $2)"
  1162. $cp_f "$1" "$2"
  1163. }
  1164. # CONFIG_LIST contains configurable options, while HAVE_LIST is for
  1165. # system-dependent things.
  1166. COMPONENT_LIST="
  1167. bsfs
  1168. decoders
  1169. demuxers
  1170. encoders
  1171. filters
  1172. hwaccels
  1173. indevs
  1174. muxers
  1175. outdevs
  1176. parsers
  1177. protocols
  1178. "
  1179. EXAMPLE_LIST="
  1180. avio_reading_example
  1181. avio_list_dir_example
  1182. decoding_encoding_example
  1183. demuxing_decoding_example
  1184. extract_mvs_example
  1185. filter_audio_example
  1186. filtering_audio_example
  1187. filtering_video_example
  1188. metadata_example
  1189. muxing_example
  1190. qsvdec_example
  1191. remuxing_example
  1192. resampling_audio_example
  1193. scaling_video_example
  1194. transcode_aac_example
  1195. transcoding_example
  1196. "
  1197. EXTERNAL_LIBRARY_LIST="
  1198. avisynth
  1199. bzlib
  1200. crystalhd
  1201. decklink
  1202. frei0r
  1203. gnutls
  1204. iconv
  1205. ladspa
  1206. libaacplus
  1207. libass
  1208. libbluray
  1209. libbs2b
  1210. libcaca
  1211. libcdio
  1212. libcelt
  1213. libdc1394
  1214. libdcadec
  1215. libfaac
  1216. libfdk_aac
  1217. libflite
  1218. libfontconfig
  1219. libfreetype
  1220. libfribidi
  1221. libgme
  1222. libgsm
  1223. libiec61883
  1224. libilbc
  1225. libmfx
  1226. libmodplug
  1227. libmp3lame
  1228. libnut
  1229. libopencore_amrnb
  1230. libopencore_amrwb
  1231. libopencv
  1232. libopenh264
  1233. libopenjpeg
  1234. libopus
  1235. libpulse
  1236. libquvi
  1237. librtmp
  1238. libschroedinger
  1239. libshine
  1240. libsmbclient
  1241. libsoxr
  1242. libspeex
  1243. libssh
  1244. libstagefright_h264
  1245. libtheora
  1246. libtwolame
  1247. libutvideo
  1248. libv4l2
  1249. libvidstab
  1250. libvo_aacenc
  1251. libvo_amrwbenc
  1252. libvorbis
  1253. libvpx
  1254. libwavpack
  1255. libwebp
  1256. libx264
  1257. libx265
  1258. libxavs
  1259. libxcb
  1260. libxcb_shm
  1261. libxcb_shape
  1262. libxcb_xfixes
  1263. libxvid
  1264. libzmq
  1265. libzvbi
  1266. lzma
  1267. mmal
  1268. nvenc
  1269. openal
  1270. opencl
  1271. opengl
  1272. openssl
  1273. sdl
  1274. x11grab
  1275. xlib
  1276. zlib
  1277. "
  1278. DOCUMENT_LIST="
  1279. doc
  1280. htmlpages
  1281. manpages
  1282. podpages
  1283. txtpages
  1284. "
  1285. FEATURE_LIST="
  1286. ftrapv
  1287. gray
  1288. hardcoded_tables
  1289. runtime_cpudetect
  1290. safe_bitstream_reader
  1291. shared
  1292. small
  1293. static
  1294. swscale_alpha
  1295. "
  1296. HWACCEL_LIST="
  1297. d3d11va
  1298. dxva2
  1299. vaapi
  1300. vda
  1301. vdpau
  1302. xvmc
  1303. "
  1304. LIBRARY_LIST="
  1305. avcodec
  1306. avdevice
  1307. avfilter
  1308. avformat
  1309. avresample
  1310. avutil
  1311. postproc
  1312. swresample
  1313. swscale
  1314. "
  1315. LICENSE_LIST="
  1316. gpl
  1317. nonfree
  1318. version3
  1319. "
  1320. PROGRAM_LIST="
  1321. ffplay
  1322. ffprobe
  1323. ffserver
  1324. ffmpeg
  1325. "
  1326. SUBSYSTEM_LIST="
  1327. dct
  1328. dwt
  1329. error_resilience
  1330. faan
  1331. fast_unaligned
  1332. fft
  1333. lsp
  1334. lzo
  1335. mdct
  1336. pixelutils
  1337. network
  1338. rdft
  1339. "
  1340. CONFIG_LIST="
  1341. $COMPONENT_LIST
  1342. $DOCUMENT_LIST
  1343. $EXAMPLE_LIST
  1344. $EXTERNAL_LIBRARY_LIST
  1345. $FEATURE_LIST
  1346. $HWACCEL_LIST
  1347. $LICENSE_LIST
  1348. $LIBRARY_LIST
  1349. $PROGRAM_LIST
  1350. $SUBSYSTEM_LIST
  1351. fontconfig
  1352. incompatible_libav_abi
  1353. memalign_hack
  1354. memory_poisoning
  1355. neon_clobber_test
  1356. pic
  1357. pod2man
  1358. raise_major
  1359. thumb
  1360. valgrind_backtrace
  1361. xmm_clobber_test
  1362. "
  1363. THREADS_LIST="
  1364. pthreads
  1365. os2threads
  1366. w32threads
  1367. "
  1368. ATOMICS_LIST="
  1369. atomics_gcc
  1370. atomics_suncc
  1371. atomics_win32
  1372. "
  1373. ARCH_LIST="
  1374. aarch64
  1375. alpha
  1376. arm
  1377. avr32
  1378. avr32_ap
  1379. avr32_uc
  1380. bfin
  1381. ia64
  1382. m68k
  1383. mips
  1384. mips64
  1385. parisc
  1386. ppc
  1387. ppc64
  1388. s390
  1389. sh4
  1390. sparc
  1391. sparc64
  1392. tilegx
  1393. tilepro
  1394. tomi
  1395. x86
  1396. x86_32
  1397. x86_64
  1398. "
  1399. ARCH_EXT_LIST_ARM="
  1400. armv5te
  1401. armv6
  1402. armv6t2
  1403. armv8
  1404. neon
  1405. vfp
  1406. vfpv3
  1407. setend
  1408. "
  1409. ARCH_EXT_LIST_MIPS="
  1410. mipsfpu
  1411. mips32r2
  1412. mips32r5
  1413. mips64r6
  1414. mipsdspr1
  1415. mipsdspr2
  1416. msa
  1417. "
  1418. ARCH_EXT_LIST_LOONGSON="
  1419. loongson3
  1420. "
  1421. ARCH_EXT_LIST_X86_SIMD="
  1422. amd3dnow
  1423. amd3dnowext
  1424. avx
  1425. avx2
  1426. fma3
  1427. fma4
  1428. mmx
  1429. mmxext
  1430. sse
  1431. sse2
  1432. sse3
  1433. sse4
  1434. sse42
  1435. ssse3
  1436. xop
  1437. "
  1438. ARCH_EXT_LIST_PPC="
  1439. altivec
  1440. dcbzl
  1441. ldbrx
  1442. ppc4xx
  1443. vsx
  1444. "
  1445. ARCH_EXT_LIST_X86="
  1446. $ARCH_EXT_LIST_X86_SIMD
  1447. cpunop
  1448. i686
  1449. "
  1450. ARCH_EXT_LIST="
  1451. $ARCH_EXT_LIST_ARM
  1452. $ARCH_EXT_LIST_PPC
  1453. $ARCH_EXT_LIST_X86
  1454. $ARCH_EXT_LIST_MIPS
  1455. $ARCH_EXT_LIST_LOONGSON
  1456. "
  1457. ARCH_FEATURES="
  1458. aligned_stack
  1459. fast_64bit
  1460. fast_clz
  1461. fast_cmov
  1462. local_aligned_8
  1463. local_aligned_16
  1464. local_aligned_32
  1465. simd_align_16
  1466. "
  1467. BUILTIN_LIST="
  1468. atomic_cas_ptr
  1469. atomic_compare_exchange
  1470. machine_rw_barrier
  1471. MemoryBarrier
  1472. mm_empty
  1473. rdtsc
  1474. sarestart
  1475. sync_val_compare_and_swap
  1476. "
  1477. HAVE_LIST_CMDLINE="
  1478. inline_asm
  1479. symver
  1480. yasm
  1481. "
  1482. HAVE_LIST_PUB="
  1483. bigendian
  1484. fast_unaligned
  1485. incompatible_libav_abi
  1486. "
  1487. HEADERS_LIST="
  1488. alsa_asoundlib_h
  1489. altivec_h
  1490. arpa_inet_h
  1491. asm_types_h
  1492. cdio_paranoia_h
  1493. cdio_paranoia_paranoia_h
  1494. dev_bktr_ioctl_bt848_h
  1495. dev_bktr_ioctl_meteor_h
  1496. dev_ic_bt8xx_h
  1497. dev_video_bktr_ioctl_bt848_h
  1498. dev_video_meteor_ioctl_meteor_h
  1499. direct_h
  1500. dlfcn_h
  1501. d3d11_h
  1502. dxva_h
  1503. ES2_gl_h
  1504. gsm_h
  1505. io_h
  1506. mach_mach_time_h
  1507. machine_ioctl_bt848_h
  1508. machine_ioctl_meteor_h
  1509. malloc_h
  1510. openjpeg_1_5_openjpeg_h
  1511. OpenGL_gl3_h
  1512. poll_h
  1513. sndio_h
  1514. soundcard_h
  1515. sys_mman_h
  1516. sys_param_h
  1517. sys_resource_h
  1518. sys_select_h
  1519. sys_soundcard_h
  1520. sys_time_h
  1521. sys_un_h
  1522. sys_videoio_h
  1523. termios_h
  1524. udplite_h
  1525. unistd_h
  1526. valgrind_valgrind_h
  1527. windows_h
  1528. winsock2_h
  1529. "
  1530. INTRINSICS_LIST="
  1531. intrinsics_neon
  1532. "
  1533. MATH_FUNCS="
  1534. atanf
  1535. atan2f
  1536. cbrt
  1537. cbrtf
  1538. cosf
  1539. exp2
  1540. exp2f
  1541. expf
  1542. isinf
  1543. isnan
  1544. ldexpf
  1545. llrint
  1546. llrintf
  1547. log2
  1548. log2f
  1549. log10f
  1550. lrint
  1551. lrintf
  1552. powf
  1553. rint
  1554. round
  1555. roundf
  1556. sinf
  1557. trunc
  1558. truncf
  1559. "
  1560. SYSTEM_FUNCS="
  1561. access
  1562. aligned_malloc
  1563. clock_gettime
  1564. closesocket
  1565. CommandLineToArgvW
  1566. CoTaskMemFree
  1567. CryptGenRandom
  1568. dlopen
  1569. fcntl
  1570. flt_lim
  1571. fork
  1572. getaddrinfo
  1573. gethrtime
  1574. getopt
  1575. GetProcessAffinityMask
  1576. GetProcessMemoryInfo
  1577. GetProcessTimes
  1578. getrusage
  1579. getservbyport
  1580. GetSystemTimeAsFileTime
  1581. gettimeofday
  1582. glob
  1583. glXGetProcAddress
  1584. gmtime_r
  1585. inet_aton
  1586. isatty
  1587. jack_port_get_latency_range
  1588. kbhit
  1589. localtime_r
  1590. lzo1x_999_compress
  1591. mach_absolute_time
  1592. MapViewOfFile
  1593. memalign
  1594. mkstemp
  1595. mmap
  1596. mprotect
  1597. nanosleep
  1598. PeekNamedPipe
  1599. posix_memalign
  1600. pthread_cancel
  1601. sched_getaffinity
  1602. SetConsoleTextAttribute
  1603. setmode
  1604. setrlimit
  1605. Sleep
  1606. strerror_r
  1607. sysconf
  1608. sysctl
  1609. usleep
  1610. VirtualAlloc
  1611. wglGetProcAddress
  1612. "
  1613. TOOLCHAIN_FEATURES="
  1614. as_dn_directive
  1615. as_func
  1616. as_object_arch
  1617. asm_mod_q
  1618. attribute_may_alias
  1619. attribute_packed
  1620. ebp_available
  1621. ebx_available
  1622. gnu_as
  1623. gnu_windres
  1624. ibm_asm
  1625. inline_asm_labels
  1626. inline_asm_nonlocal_labels
  1627. inline_asm_direct_symbol_refs
  1628. pragma_deprecated
  1629. rsync_contimeout
  1630. symver_asm_label
  1631. symver_gnu_asm
  1632. vfp_args
  1633. xform_asm
  1634. xmm_clobbers
  1635. "
  1636. TYPES_LIST="
  1637. CONDITION_VARIABLE_Ptr
  1638. DXVA_PicParams_HEVC
  1639. ID3D11VideoDecoder
  1640. socklen_t
  1641. struct_addrinfo
  1642. struct_group_source_req
  1643. struct_ip_mreq_source
  1644. struct_ipv6_mreq
  1645. struct_pollfd
  1646. struct_rusage_ru_maxrss
  1647. struct_sctp_event_subscribe
  1648. struct_sockaddr_in6
  1649. struct_sockaddr_sa_len
  1650. struct_sockaddr_storage
  1651. struct_stat_st_mtim_tv_nsec
  1652. struct_v4l2_frmivalenum_discrete
  1653. "
  1654. HAVE_LIST="
  1655. $ARCH_EXT_LIST
  1656. $(add_suffix _external $ARCH_EXT_LIST)
  1657. $(add_suffix _inline $ARCH_EXT_LIST)
  1658. $ARCH_FEATURES
  1659. $ATOMICS_LIST
  1660. $BUILTIN_LIST
  1661. $HAVE_LIST_CMDLINE
  1662. $HAVE_LIST_PUB
  1663. $HEADERS_LIST
  1664. $INTRINSICS_LIST
  1665. $MATH_FUNCS
  1666. $SYSTEM_FUNCS
  1667. $THREADS_LIST
  1668. $TOOLCHAIN_FEATURES
  1669. $TYPES_LIST
  1670. atomics_native
  1671. dos_paths
  1672. d3d11_cobj
  1673. d3d11va_lib
  1674. dxva2api_cobj
  1675. dxva2_lib
  1676. libc_msvcrt
  1677. libdc1394_1
  1678. libdc1394_2
  1679. makeinfo
  1680. makeinfo_html
  1681. perl
  1682. pod2man
  1683. sdl
  1684. section_data_rel_ro
  1685. texi2html
  1686. threads
  1687. vaapi_x11
  1688. vdpau_x11
  1689. xlib
  1690. "
  1691. # options emitted with CONFIG_ prefix but not available on the command line
  1692. CONFIG_EXTRA="
  1693. aandcttables
  1694. ac3dsp
  1695. audio_frame_queue
  1696. audiodsp
  1697. blockdsp
  1698. bswapdsp
  1699. cabac
  1700. dvprofile
  1701. exif
  1702. faandct
  1703. faanidct
  1704. fdctdsp
  1705. fmtconvert
  1706. frame_thread_encoder
  1707. gcrypt
  1708. golomb
  1709. gplv3
  1710. h263dsp
  1711. h264chroma
  1712. h264dsp
  1713. h264pred
  1714. h264qpel
  1715. hpeldsp
  1716. huffman
  1717. huffyuvdsp
  1718. huffyuvencdsp
  1719. idctdsp
  1720. iirfilter
  1721. imdct15
  1722. intrax8
  1723. jpegtables
  1724. lgplv3
  1725. llauddsp
  1726. llviddsp
  1727. lpc
  1728. me_cmp
  1729. mpeg_er
  1730. mpegaudio
  1731. mpegaudiodsp
  1732. mpegvideo
  1733. mpegvideoenc
  1734. nettle
  1735. pixblockdsp
  1736. qpeldsp
  1737. qsv
  1738. qsvdec
  1739. qsvenc
  1740. rangecoder
  1741. riffdec
  1742. riffenc
  1743. rtpdec
  1744. rtpenc_chain
  1745. sinewin
  1746. startcode
  1747. tpeldsp
  1748. videodsp
  1749. vp3dsp
  1750. wma_freqs
  1751. "
  1752. CMDLINE_SELECT="
  1753. $ARCH_EXT_LIST
  1754. $CONFIG_LIST
  1755. $HAVE_LIST_CMDLINE
  1756. $THREADS_LIST
  1757. asm
  1758. cross_compile
  1759. debug
  1760. extra_warnings
  1761. logging
  1762. lto
  1763. optimizations
  1764. rpath
  1765. stripping
  1766. "
  1767. PATHS_LIST="
  1768. bindir
  1769. datadir
  1770. docdir
  1771. incdir
  1772. libdir
  1773. mandir
  1774. prefix
  1775. shlibdir
  1776. "
  1777. CMDLINE_SET="
  1778. $PATHS_LIST
  1779. ar
  1780. arch
  1781. as
  1782. assert_level
  1783. build_suffix
  1784. cc
  1785. cpu
  1786. cross_prefix
  1787. cxx
  1788. dep_cc
  1789. doxygen
  1790. extra_version
  1791. gas
  1792. host_cc
  1793. host_cflags
  1794. host_ld
  1795. host_ldflags
  1796. host_libs
  1797. host_os
  1798. install
  1799. ld
  1800. logfile
  1801. malloc_prefix
  1802. nm
  1803. optflags
  1804. pkg_config
  1805. pkg_config_flags
  1806. progs_suffix
  1807. random_seed
  1808. ranlib
  1809. samples
  1810. strip
  1811. sws_max_filter_size
  1812. sysinclude
  1813. sysroot
  1814. target_exec
  1815. target_os
  1816. target_path
  1817. target_samples
  1818. tempprefix
  1819. toolchain
  1820. valgrind
  1821. yasmexe
  1822. "
  1823. CMDLINE_APPEND="
  1824. extra_cflags
  1825. extra_cxxflags
  1826. host_cppflags
  1827. "
  1828. # code dependency declarations
  1829. # architecture extensions
  1830. armv5te_deps="arm"
  1831. armv6_deps="arm"
  1832. armv6t2_deps="arm"
  1833. armv8_deps="aarch64"
  1834. neon_deps_any="aarch64 arm"
  1835. intrinsics_neon_deps="neon"
  1836. vfp_deps_any="aarch64 arm"
  1837. vfpv3_deps="vfp"
  1838. setend_deps="arm"
  1839. map 'eval ${v}_inline_deps=inline_asm' $ARCH_EXT_LIST_ARM
  1840. mipsfpu_deps="mips"
  1841. mipsdspr1_deps="mips"
  1842. mipsdspr2_deps="mips"
  1843. mips32r2_deps="mips"
  1844. mips32r5_deps="mips"
  1845. mips64r6_deps="mips"
  1846. msa_deps="mips"
  1847. loongson3_deps="mips"
  1848. altivec_deps="ppc"
  1849. dcbzl_deps="ppc"
  1850. ldbrx_deps="ppc"
  1851. ppc4xx_deps="ppc"
  1852. vsx_deps="ppc"
  1853. cpunop_deps="i686"
  1854. x86_64_select="i686"
  1855. x86_64_suggest="fast_cmov"
  1856. amd3dnow_deps="mmx"
  1857. amd3dnowext_deps="amd3dnow"
  1858. i686_deps="x86"
  1859. mmx_deps="x86"
  1860. mmxext_deps="mmx"
  1861. sse_deps="mmxext"
  1862. sse2_deps="sse"
  1863. sse3_deps="sse2"
  1864. ssse3_deps="sse3"
  1865. sse4_deps="ssse3"
  1866. sse42_deps="sse4"
  1867. avx_deps="sse42"
  1868. xop_deps="avx"
  1869. fma3_deps="avx"
  1870. fma4_deps="avx"
  1871. avx2_deps="avx"
  1872. mmx_external_deps="yasm"
  1873. mmx_inline_deps="inline_asm"
  1874. mmx_suggest="mmx_external mmx_inline"
  1875. for ext in $(filter_out mmx $ARCH_EXT_LIST_X86_SIMD); do
  1876. eval dep=\$${ext}_deps
  1877. eval ${ext}_external_deps='"${dep}_external"'
  1878. eval ${ext}_inline_deps='"${dep}_inline"'
  1879. eval ${ext}_suggest='"${ext}_external ${ext}_inline"'
  1880. done
  1881. aligned_stack_if_any="aarch64 ppc x86"
  1882. fast_64bit_if_any="aarch64 alpha ia64 mips64 parisc64 ppc64 sparc64 x86_64"
  1883. fast_clz_if_any="aarch64 alpha avr32 mips ppc x86"
  1884. fast_unaligned_if_any="aarch64 ppc x86"
  1885. simd_align_16_if_any="altivec neon sse"
  1886. # system capabilities
  1887. symver_if_any="symver_asm_label symver_gnu_asm"
  1888. valgrind_backtrace_deps="!optimizations valgrind_valgrind_h"
  1889. # threading support
  1890. atomics_gcc_if_any="sync_val_compare_and_swap atomic_compare_exchange"
  1891. atomics_suncc_if="atomic_cas_ptr machine_rw_barrier"
  1892. atomics_win32_if="MemoryBarrier"
  1893. atomics_native_if_any="$ATOMICS_LIST"
  1894. w32threads_deps="atomics_native"
  1895. threads_if_any="$THREADS_LIST"
  1896. # subsystems
  1897. dct_select="rdft"
  1898. error_resilience_select="me_cmp"
  1899. faandct_deps="faan fdctdsp"
  1900. faanidct_deps="faan idctdsp"
  1901. frame_thread_encoder_deps="encoders threads"
  1902. intrax8_select="error_resilience"
  1903. mdct_select="fft"
  1904. rdft_select="fft"
  1905. me_cmp_select="fdctdsp idctdsp pixblockdsp"
  1906. mpeg_er_select="error_resilience"
  1907. mpegaudio_select="mpegaudiodsp"
  1908. mpegaudiodsp_select="dct"
  1909. mpegvideo_select="blockdsp h264chroma hpeldsp idctdsp me_cmp videodsp"
  1910. mpegvideoenc_select="me_cmp mpegvideo pixblockdsp qpeldsp"
  1911. qsvdec_select="qsv"
  1912. qsvenc_select="qsv"
  1913. # decoders / encoders
  1914. aac_decoder_select="imdct15 mdct sinewin"
  1915. aac_encoder_select="audio_frame_queue iirfilter mdct sinewin"
  1916. aac_latm_decoder_select="aac_decoder aac_latm_parser"
  1917. ac3_decoder_select="ac3_parser ac3dsp bswapdsp fmtconvert mdct"
  1918. ac3_fixed_decoder_select="ac3_parser ac3dsp bswapdsp mdct"
  1919. ac3_encoder_select="ac3dsp audiodsp mdct me_cmp"
  1920. ac3_fixed_encoder_select="ac3dsp audiodsp mdct me_cmp"
  1921. aic_decoder_select="golomb idctdsp"
  1922. alac_encoder_select="lpc"
  1923. als_decoder_select="bswapdsp"
  1924. amrnb_decoder_select="lsp"
  1925. amrwb_decoder_select="lsp"
  1926. amv_decoder_select="sp5x_decoder exif"
  1927. amv_encoder_select="aandcttables jpegtables mpegvideoenc"
  1928. ape_decoder_select="bswapdsp llauddsp"
  1929. apng_decoder_select="zlib"
  1930. apng_encoder_select="huffyuvencdsp zlib"
  1931. asv1_decoder_select="blockdsp bswapdsp idctdsp"
  1932. asv1_encoder_select="bswapdsp fdctdsp pixblockdsp"
  1933. asv2_decoder_select="blockdsp bswapdsp idctdsp"
  1934. asv2_encoder_select="bswapdsp fdctdsp pixblockdsp"
  1935. atrac1_decoder_select="mdct sinewin"
  1936. atrac3_decoder_select="mdct"
  1937. atrac3p_decoder_select="mdct sinewin"
  1938. avrn_decoder_select="exif jpegtables"
  1939. bink_decoder_select="blockdsp hpeldsp"
  1940. binkaudio_dct_decoder_select="mdct rdft dct sinewin wma_freqs"
  1941. binkaudio_rdft_decoder_select="mdct rdft sinewin wma_freqs"
  1942. cavs_decoder_select="blockdsp golomb h264chroma idctdsp qpeldsp videodsp"
  1943. cllc_decoder_select="bswapdsp"
  1944. comfortnoise_encoder_select="lpc"
  1945. cook_decoder_select="audiodsp mdct sinewin"
  1946. cscd_decoder_select="lzo"
  1947. cscd_decoder_suggest="zlib"
  1948. dca_decoder_select="fmtconvert mdct"
  1949. dirac_decoder_select="dwt golomb videodsp mpegvideoenc"
  1950. dnxhd_decoder_select="blockdsp idctdsp"
  1951. dnxhd_encoder_select="aandcttables blockdsp fdctdsp idctdsp mpegvideoenc pixblockdsp"
  1952. dvvideo_decoder_select="dvprofile idctdsp"
  1953. dvvideo_encoder_select="dvprofile fdctdsp me_cmp pixblockdsp"
  1954. dxa_decoder_select="zlib"
  1955. eac3_decoder_select="ac3_decoder"
  1956. eac3_encoder_select="ac3_encoder"
  1957. eamad_decoder_select="aandcttables blockdsp bswapdsp idctdsp mpegvideo"
  1958. eatgq_decoder_select="aandcttables"
  1959. eatqi_decoder_select="aandcttables blockdsp bswapdsp idctdsp mpeg1video_decoder"
  1960. exr_decoder_select="zlib"
  1961. ffv1_decoder_select="golomb rangecoder"
  1962. ffv1_encoder_select="rangecoder"
  1963. ffvhuff_decoder_select="huffyuv_decoder"
  1964. ffvhuff_encoder_select="huffyuv_encoder"
  1965. fic_decoder_select="golomb"
  1966. flac_decoder_select="golomb"
  1967. flac_encoder_select="bswapdsp golomb lpc"
  1968. flashsv_decoder_select="zlib"
  1969. flashsv_encoder_select="zlib"
  1970. flashsv2_encoder_select="zlib"
  1971. flashsv2_decoder_select="zlib"
  1972. flv_decoder_select="h263_decoder"
  1973. flv_encoder_select="h263_encoder"
  1974. fourxm_decoder_select="blockdsp bswapdsp"
  1975. fraps_decoder_select="bswapdsp huffman"
  1976. g2m_decoder_select="blockdsp idctdsp jpegtables zlib"
  1977. g729_decoder_select="audiodsp"
  1978. h261_decoder_select="mpeg_er mpegvideo"
  1979. h261_encoder_select="aandcttables mpegvideoenc"
  1980. h263_decoder_select="error_resilience h263_parser h263dsp mpeg_er mpegvideo qpeldsp"
  1981. h263_encoder_select="aandcttables h263dsp mpegvideoenc"
  1982. h263i_decoder_select="h263_decoder"
  1983. h263p_decoder_select="h263_decoder"
  1984. h263p_encoder_select="h263_encoder"
  1985. h264_decoder_select="cabac golomb h264chroma h264dsp h264pred h264qpel startcode videodsp"
  1986. h264_decoder_suggest="error_resilience"
  1987. h264_qsv_decoder_deps="libmfx"
  1988. h264_qsv_decoder_select="h264_mp4toannexb_bsf h264_parser qsvdec h264_qsv_hwaccel"
  1989. h264_qsv_encoder_deps="libmfx"
  1990. h264_qsv_encoder_select="qsvenc"
  1991. hevc_decoder_select="bswapdsp cabac golomb videodsp"
  1992. huffyuv_decoder_select="bswapdsp huffyuvdsp llviddsp"
  1993. huffyuv_encoder_select="bswapdsp huffman huffyuvencdsp llviddsp"
  1994. iac_decoder_select="imc_decoder"
  1995. imc_decoder_select="bswapdsp fft mdct sinewin"
  1996. indeo3_decoder_select="hpeldsp"
  1997. interplay_video_decoder_select="hpeldsp"
  1998. jpegls_decoder_select="golomb mjpeg_decoder"
  1999. jpegls_encoder_select="golomb"
  2000. jv_decoder_select="blockdsp"
  2001. lagarith_decoder_select="huffyuvdsp"
  2002. ljpeg_encoder_select="aandcttables idctdsp jpegtables"
  2003. loco_decoder_select="golomb"
  2004. mdec_decoder_select="blockdsp idctdsp mpegvideo"
  2005. metasound_decoder_select="lsp mdct sinewin"
  2006. mimic_decoder_select="blockdsp bswapdsp hpeldsp idctdsp"
  2007. mjpeg_decoder_select="blockdsp hpeldsp exif idctdsp jpegtables"
  2008. mjpeg_encoder_select="aandcttables jpegtables mpegvideoenc"
  2009. mjpegb_decoder_select="mjpeg_decoder"
  2010. mlp_decoder_select="mlp_parser"
  2011. motionpixels_decoder_select="bswapdsp"
  2012. mp1_decoder_select="mpegaudio"
  2013. mp1float_decoder_select="mpegaudio"
  2014. mp2_decoder_select="mpegaudio"
  2015. mp2float_decoder_select="mpegaudio"
  2016. mp3_decoder_select="mpegaudio"
  2017. mp3adu_decoder_select="mpegaudio"
  2018. mp3adufloat_decoder_select="mpegaudio"
  2019. mp3float_decoder_select="mpegaudio"
  2020. mp3on4_decoder_select="mpegaudio"
  2021. mp3on4float_decoder_select="mpegaudio"
  2022. mpc7_decoder_select="bswapdsp mpegaudiodsp"
  2023. mpc8_decoder_select="mpegaudiodsp"
  2024. mpeg_xvmc_decoder_deps="X11_extensions_XvMClib_h"
  2025. mpeg_xvmc_decoder_select="mpeg2video_decoder"
  2026. mpegvideo_decoder_select="error_resilience mpeg_er mpegvideo"
  2027. mpeg1video_decoder_select="error_resilience mpeg_er mpegvideo"
  2028. mpeg1video_encoder_select="aandcttables mpegvideoenc h263dsp"
  2029. mpeg2video_decoder_select="error_resilience mpeg_er mpegvideo"
  2030. mpeg2video_encoder_select="aandcttables mpegvideoenc h263dsp"
  2031. mpeg4_decoder_select="h263_decoder mpeg4video_parser"
  2032. mpeg4_encoder_select="h263_encoder"
  2033. msmpeg4v1_decoder_select="h263_decoder"
  2034. msmpeg4v2_decoder_select="h263_decoder"
  2035. msmpeg4v2_encoder_select="h263_encoder"
  2036. msmpeg4v3_decoder_select="h263_decoder"
  2037. msmpeg4v3_encoder_select="h263_encoder"
  2038. mss2_decoder_select="error_resilience mpeg_er qpeldsp vc1_decoder"
  2039. mxpeg_decoder_select="mjpeg_decoder"
  2040. nellymoser_decoder_select="mdct sinewin"
  2041. nellymoser_encoder_select="audio_frame_queue mdct sinewin"
  2042. nuv_decoder_select="idctdsp lzo"
  2043. on2avc_decoder_select="mdct"
  2044. opus_decoder_deps="swresample"
  2045. opus_decoder_select="imdct15"
  2046. png_decoder_select="zlib"
  2047. png_encoder_select="huffyuvencdsp zlib"
  2048. prores_decoder_select="blockdsp idctdsp"
  2049. prores_encoder_select="fdctdsp"
  2050. qcelp_decoder_select="lsp"
  2051. qdm2_decoder_select="mdct rdft mpegaudiodsp"
  2052. ra_144_encoder_select="audio_frame_queue lpc audiodsp"
  2053. ra_144_decoder_select="audiodsp"
  2054. ralf_decoder_select="golomb"
  2055. rawvideo_decoder_select="bswapdsp"
  2056. rtjpeg_decoder_select="me_cmp"
  2057. rv10_decoder_select="error_resilience h263_decoder h263dsp mpeg_er"
  2058. rv10_encoder_select="h263_encoder"
  2059. rv20_decoder_select="error_resilience h263_decoder h263dsp mpeg_er"
  2060. rv20_encoder_select="h263_encoder"
  2061. rv30_decoder_select="error_resilience golomb h264chroma h264pred h264qpel mpeg_er mpegvideo videodsp"
  2062. rv40_decoder_select="error_resilience golomb h264chroma h264pred h264qpel mpeg_er mpegvideo videodsp"
  2063. shorten_decoder_select="golomb"
  2064. sipr_decoder_select="lsp"
  2065. snow_decoder_select="dwt h264qpel hpeldsp me_cmp rangecoder videodsp"
  2066. snow_encoder_select="aandcttables dwt h264qpel hpeldsp me_cmp mpegvideoenc rangecoder"
  2067. sonic_decoder_select="golomb rangecoder"
  2068. sonic_encoder_select="golomb rangecoder"
  2069. sonic_ls_encoder_select="golomb rangecoder"
  2070. sp5x_decoder_select="mjpeg_decoder"
  2071. svq1_decoder_select="hpeldsp"
  2072. svq1_encoder_select="aandcttables hpeldsp me_cmp mpegvideoenc"
  2073. svq3_decoder_select="h264_decoder hpeldsp tpeldsp"
  2074. svq3_decoder_suggest="zlib"
  2075. tak_decoder_select="audiodsp"
  2076. tdsc_decoder_select="zlib mjpeg_decoder"
  2077. theora_decoder_select="vp3_decoder"
  2078. thp_decoder_select="mjpeg_decoder"
  2079. tiff_decoder_suggest="zlib lzma"
  2080. tiff_encoder_suggest="zlib"
  2081. truehd_decoder_select="mlp_parser"
  2082. truemotion2_decoder_select="bswapdsp"
  2083. truespeech_decoder_select="bswapdsp"
  2084. tscc_decoder_select="zlib"
  2085. twinvq_decoder_select="mdct lsp sinewin"
  2086. utvideo_decoder_select="bswapdsp"
  2087. utvideo_encoder_select="bswapdsp huffman huffyuvencdsp"
  2088. vble_decoder_select="huffyuvdsp"
  2089. vc1_decoder_select="blockdsp error_resilience h263_decoder h264chroma h264qpel intrax8 mpeg_er qpeldsp startcode"
  2090. vc1image_decoder_select="vc1_decoder"
  2091. vorbis_decoder_select="mdct"
  2092. vorbis_encoder_select="mdct"
  2093. vp3_decoder_select="hpeldsp vp3dsp videodsp"
  2094. vp5_decoder_select="h264chroma hpeldsp videodsp vp3dsp"
  2095. vp6_decoder_select="h264chroma hpeldsp huffman videodsp vp3dsp"
  2096. vp6a_decoder_select="vp6_decoder"
  2097. vp6f_decoder_select="vp6_decoder"
  2098. vp7_decoder_select="h264pred videodsp"
  2099. vp8_decoder_select="h264pred videodsp"
  2100. vp9_decoder_select="videodsp vp9_parser"
  2101. webp_decoder_select="vp8_decoder"
  2102. wmalossless_decoder_select="llauddsp"
  2103. wmapro_decoder_select="mdct sinewin wma_freqs"
  2104. wmav1_decoder_select="mdct sinewin wma_freqs"
  2105. wmav1_encoder_select="mdct sinewin wma_freqs"
  2106. wmav2_decoder_select="mdct sinewin wma_freqs"
  2107. wmav2_encoder_select="mdct sinewin wma_freqs"
  2108. wmavoice_decoder_select="lsp rdft dct mdct sinewin"
  2109. wmv1_decoder_select="h263_decoder"
  2110. wmv1_encoder_select="h263_encoder"
  2111. wmv2_decoder_select="blockdsp h263_decoder idctdsp intrax8 videodsp"
  2112. wmv2_encoder_select="h263_encoder"
  2113. wmv3_decoder_select="vc1_decoder"
  2114. wmv3image_decoder_select="wmv3_decoder"
  2115. zerocodec_decoder_select="zlib"
  2116. zlib_decoder_select="zlib"
  2117. zlib_encoder_select="zlib"
  2118. zmbv_decoder_select="zlib"
  2119. zmbv_encoder_select="zlib"
  2120. # hardware accelerators
  2121. crystalhd_deps="libcrystalhd_libcrystalhd_if_h"
  2122. d3d11va_deps="d3d11_h dxva_h ID3D11VideoDecoder"
  2123. dxva2_deps="dxva2api_h"
  2124. vaapi_deps="va_va_h"
  2125. vda_deps="VideoDecodeAcceleration_VDADecoder_h pthreads"
  2126. vda_extralibs="-framework CoreFoundation -framework VideoDecodeAcceleration -framework QuartzCore"
  2127. vdpau_deps="vdpau_vdpau_h vdpau_vdpau_x11_h"
  2128. xvmc_deps="X11_extensions_XvMClib_h"
  2129. h263_vaapi_hwaccel_deps="vaapi"
  2130. h263_vaapi_hwaccel_select="h263_decoder"
  2131. h263_vdpau_hwaccel_deps="vdpau"
  2132. h263_vdpau_hwaccel_select="h263_decoder"
  2133. h264_crystalhd_decoder_select="crystalhd h264_mp4toannexb_bsf h264_parser"
  2134. h264_d3d11va_hwaccel_deps="d3d11va"
  2135. h264_d3d11va_hwaccel_select="h264_decoder"
  2136. h264_dxva2_hwaccel_deps="dxva2"
  2137. h264_dxva2_hwaccel_select="h264_decoder"
  2138. h264_mmal_decoder_deps="mmal"
  2139. h264_mmal_hwaccel_deps="mmal"
  2140. h264_mmal_decoder_select="h264_decoder"
  2141. h264_mmal_encoder_deps="mmal"
  2142. h264_qsv_hwaccel_deps="libmfx"
  2143. h264_vaapi_hwaccel_deps="vaapi"
  2144. h264_vaapi_hwaccel_select="h264_decoder"
  2145. h264_vda_decoder_deps="vda"
  2146. h264_vda_decoder_select="h264_decoder"
  2147. h264_vda_hwaccel_deps="vda"
  2148. h264_vda_hwaccel_select="h264_decoder"
  2149. h264_vda_old_hwaccel_deps="vda"
  2150. h264_vda_old_hwaccel_select="h264_decoder"
  2151. h264_vdpau_decoder_deps="vdpau"
  2152. h264_vdpau_decoder_select="h264_decoder"
  2153. h264_vdpau_hwaccel_deps="vdpau"
  2154. h264_vdpau_hwaccel_select="h264_decoder"
  2155. hevc_d3d11va_hwaccel_deps="d3d11va DXVA_PicParams_HEVC"
  2156. hevc_d3d11va_hwaccel_select="hevc_decoder"
  2157. hevc_dxva2_hwaccel_deps="dxva2 DXVA_PicParams_HEVC"
  2158. hevc_dxva2_hwaccel_select="hevc_decoder"
  2159. mpeg_vdpau_decoder_deps="vdpau"
  2160. mpeg_vdpau_decoder_select="mpeg2video_decoder"
  2161. mpeg_xvmc_hwaccel_deps="xvmc"
  2162. mpeg_xvmc_hwaccel_select="mpeg2video_decoder"
  2163. mpeg1_vdpau_decoder_deps="vdpau"
  2164. mpeg1_vdpau_decoder_select="mpeg1video_decoder"
  2165. mpeg1_vdpau_hwaccel_deps="vdpau"
  2166. mpeg1_vdpau_hwaccel_select="mpeg1video_decoder"
  2167. mpeg1_xvmc_hwaccel_deps="xvmc"
  2168. mpeg1_xvmc_hwaccel_select="mpeg1video_decoder"
  2169. mpeg2_crystalhd_decoder_select="crystalhd"
  2170. mpeg2_d3d11va_hwaccel_deps="d3d11va"
  2171. mpeg2_d3d11va_hwaccel_select="mpeg2video_decoder"
  2172. mpeg2_dxva2_hwaccel_deps="dxva2"
  2173. mpeg2_dxva2_hwaccel_select="mpeg2video_decoder"
  2174. mpeg2_vaapi_hwaccel_deps="vaapi"
  2175. mpeg2_vaapi_hwaccel_select="mpeg2video_decoder"
  2176. mpeg2_vdpau_hwaccel_deps="vdpau"
  2177. mpeg2_vdpau_hwaccel_select="mpeg2video_decoder"
  2178. mpeg2_xvmc_hwaccel_deps="xvmc"
  2179. mpeg2_xvmc_hwaccel_select="mpeg2video_decoder"
  2180. mpeg4_crystalhd_decoder_select="crystalhd"
  2181. mpeg4_vaapi_hwaccel_deps="vaapi"
  2182. mpeg4_vaapi_hwaccel_select="mpeg4_decoder"
  2183. mpeg4_vdpau_decoder_deps="vdpau"
  2184. mpeg4_vdpau_decoder_select="mpeg4_decoder"
  2185. mpeg4_vdpau_hwaccel_deps="vdpau"
  2186. mpeg4_vdpau_hwaccel_select="mpeg4_decoder"
  2187. msmpeg4_crystalhd_decoder_select="crystalhd"
  2188. vc1_crystalhd_decoder_select="crystalhd"
  2189. vc1_d3d11va_hwaccel_deps="d3d11va"
  2190. vc1_d3d11va_hwaccel_select="vc1_decoder"
  2191. vc1_dxva2_hwaccel_deps="dxva2"
  2192. vc1_dxva2_hwaccel_select="vc1_decoder"
  2193. vc1_vaapi_hwaccel_deps="vaapi"
  2194. vc1_vaapi_hwaccel_select="vc1_decoder"
  2195. vc1_vdpau_decoder_deps="vdpau"
  2196. vc1_vdpau_decoder_select="vc1_decoder"
  2197. vc1_vdpau_hwaccel_deps="vdpau"
  2198. vc1_vdpau_hwaccel_select="vc1_decoder"
  2199. wmv3_crystalhd_decoder_select="crystalhd"
  2200. wmv3_d3d11va_hwaccel_select="vc1_d3d11va_hwaccel"
  2201. wmv3_dxva2_hwaccel_select="vc1_dxva2_hwaccel"
  2202. wmv3_vaapi_hwaccel_select="vc1_vaapi_hwaccel"
  2203. wmv3_vdpau_decoder_select="vc1_vdpau_decoder"
  2204. wmv3_vdpau_hwaccel_select="vc1_vdpau_hwaccel"
  2205. # parsers
  2206. h264_parser_select="h264_decoder"
  2207. hevc_parser_select="hevc_decoder"
  2208. mpegvideo_parser_select="mpegvideo"
  2209. mpeg4video_parser_select="error_resilience h263dsp mpeg_er mpegvideo qpeldsp"
  2210. vc1_parser_select="mpegvideo startcode vc1_decoder"
  2211. # bitstream_filters
  2212. mjpeg2jpeg_bsf_select="jpegtables"
  2213. # external libraries
  2214. libaacplus_encoder_deps="libaacplus"
  2215. libcelt_decoder_deps="libcelt"
  2216. libdcadec_decoder_deps="libdcadec"
  2217. libfaac_encoder_deps="libfaac"
  2218. libfaac_encoder_select="audio_frame_queue"
  2219. libfdk_aac_decoder_deps="libfdk_aac"
  2220. libfdk_aac_encoder_deps="libfdk_aac"
  2221. libfdk_aac_encoder_select="audio_frame_queue"
  2222. libgme_demuxer_deps="libgme"
  2223. libgsm_decoder_deps="libgsm"
  2224. libgsm_encoder_deps="libgsm"
  2225. libgsm_ms_decoder_deps="libgsm"
  2226. libgsm_ms_encoder_deps="libgsm"
  2227. libilbc_decoder_deps="libilbc"
  2228. libilbc_encoder_deps="libilbc"
  2229. libmodplug_demuxer_deps="libmodplug"
  2230. libmp3lame_encoder_deps="libmp3lame"
  2231. libmp3lame_encoder_select="audio_frame_queue"
  2232. libopencore_amrnb_decoder_deps="libopencore_amrnb"
  2233. libopencore_amrnb_encoder_deps="libopencore_amrnb"
  2234. libopencore_amrnb_encoder_select="audio_frame_queue"
  2235. libopencore_amrwb_decoder_deps="libopencore_amrwb"
  2236. libopenh264_encoder_deps="libopenh264"
  2237. libopenjpeg_decoder_deps="libopenjpeg"
  2238. libopenjpeg_encoder_deps="libopenjpeg"
  2239. libopus_decoder_deps="libopus"
  2240. libopus_encoder_deps="libopus"
  2241. libopus_encoder_select="audio_frame_queue"
  2242. libquvi_demuxer_deps="libquvi"
  2243. libschroedinger_decoder_deps="libschroedinger"
  2244. libschroedinger_encoder_deps="libschroedinger"
  2245. libshine_encoder_deps="libshine"
  2246. libshine_encoder_select="audio_frame_queue"
  2247. libspeex_decoder_deps="libspeex"
  2248. libspeex_encoder_deps="libspeex"
  2249. libspeex_encoder_select="audio_frame_queue"
  2250. libstagefright_h264_decoder_deps="libstagefright_h264"
  2251. libtheora_encoder_deps="libtheora"
  2252. libtwolame_encoder_deps="libtwolame"
  2253. libvo_aacenc_encoder_deps="libvo_aacenc"
  2254. libvo_aacenc_encoder_select="audio_frame_queue"
  2255. libvo_amrwbenc_encoder_deps="libvo_amrwbenc"
  2256. libvorbis_decoder_deps="libvorbis"
  2257. libvorbis_encoder_deps="libvorbis"
  2258. libvorbis_encoder_select="audio_frame_queue"
  2259. libvpx_vp8_decoder_deps="libvpx"
  2260. libvpx_vp8_encoder_deps="libvpx"
  2261. libvpx_vp9_decoder_deps="libvpx"
  2262. libvpx_vp9_encoder_deps="libvpx"
  2263. libwavpack_encoder_deps="libwavpack"
  2264. libwebp_encoder_deps="libwebp"
  2265. libwebp_anim_encoder_deps="libwebp"
  2266. libx264_encoder_deps="libx264"
  2267. libx264rgb_encoder_deps="libx264"
  2268. libx264rgb_encoder_select="libx264_encoder"
  2269. libx265_encoder_deps="libx265"
  2270. libxavs_encoder_deps="libxavs"
  2271. libxvid_encoder_deps="libxvid"
  2272. libutvideo_decoder_deps="libutvideo"
  2273. libutvideo_encoder_deps="libutvideo"
  2274. libzvbi_teletext_decoder_deps="libzvbi"
  2275. nvenc_encoder_deps="nvenc"
  2276. nvenc_h265_encoder_deps="nvenc"
  2277. # demuxers / muxers
  2278. ac3_demuxer_select="ac3_parser"
  2279. asf_demuxer_select="riffdec"
  2280. asf_muxer_select="riffenc"
  2281. asf_stream_muxer_select="asf_muxer"
  2282. avi_demuxer_select="riffdec exif"
  2283. avi_muxer_select="riffenc"
  2284. avisynth_demuxer_deps="avisynth"
  2285. avisynth_demuxer_select="riffdec"
  2286. caf_demuxer_select="riffdec"
  2287. dash_muxer_select="mp4_muxer"
  2288. dirac_demuxer_select="dirac_parser"
  2289. dts_demuxer_select="dca_parser"
  2290. dtshd_demuxer_select="dca_parser"
  2291. dv_demuxer_select="dvprofile"
  2292. dv_muxer_select="dvprofile"
  2293. dxa_demuxer_select="riffdec"
  2294. eac3_demuxer_select="ac3_parser"
  2295. f4v_muxer_select="mov_muxer"
  2296. flac_demuxer_select="flac_parser"
  2297. hds_muxer_select="flv_muxer"
  2298. hls_muxer_select="mpegts_muxer"
  2299. image2_alias_pix_demuxer_select="image2_demuxer"
  2300. image2_brender_pix_demuxer_select="image2_demuxer"
  2301. ipod_muxer_select="mov_muxer"
  2302. ismv_muxer_select="mov_muxer"
  2303. libnut_demuxer_deps="libnut"
  2304. libnut_muxer_deps="libnut"
  2305. matroska_audio_muxer_select="matroska_muxer"
  2306. matroska_demuxer_select="riffdec"
  2307. matroska_demuxer_suggest="bzlib lzo zlib"
  2308. matroska_muxer_select="riffenc"
  2309. mmf_muxer_select="riffenc"
  2310. mov_demuxer_select="riffdec"
  2311. mov_demuxer_suggest="zlib"
  2312. mov_muxer_select="riffenc rtpenc_chain"
  2313. mp3_demuxer_select="mpegaudio_parser"
  2314. mp4_muxer_select="mov_muxer"
  2315. mpegts_muxer_select="adts_muxer latm_muxer"
  2316. mpegtsraw_demuxer_select="mpegts_demuxer"
  2317. mxf_d10_muxer_select="mxf_muxer"
  2318. mxf_opatom_muxer_select="mxf_muxer"
  2319. nut_muxer_select="riffenc"
  2320. nuv_demuxer_select="riffdec"
  2321. oga_muxer_select="ogg_muxer"
  2322. ogg_demuxer_select="golomb"
  2323. opus_muxer_select="ogg_muxer"
  2324. psp_muxer_select="mov_muxer"
  2325. rtp_demuxer_select="sdp_demuxer"
  2326. rtpdec_select="asf_demuxer jpegtables mov_demuxer mpegts_demuxer rm_demuxer rtp_protocol"
  2327. rtsp_demuxer_select="http_protocol rtpdec"
  2328. rtsp_muxer_select="rtp_muxer http_protocol rtp_protocol rtpenc_chain"
  2329. sap_demuxer_select="sdp_demuxer"
  2330. sap_muxer_select="rtp_muxer rtp_protocol rtpenc_chain"
  2331. sdp_demuxer_select="rtpdec"
  2332. smoothstreaming_muxer_select="ismv_muxer"
  2333. spdif_muxer_select="aac_parser"
  2334. spx_muxer_select="ogg_muxer"
  2335. tak_demuxer_select="tak_parser"
  2336. tg2_muxer_select="mov_muxer"
  2337. tgp_muxer_select="mov_muxer"
  2338. vobsub_demuxer_select="mpegps_demuxer"
  2339. w64_demuxer_select="wav_demuxer"
  2340. w64_muxer_select="wav_muxer"
  2341. wav_demuxer_select="riffdec"
  2342. wav_muxer_select="riffenc"
  2343. webm_muxer_select="riffenc"
  2344. wtv_demuxer_select="riffdec"
  2345. wtv_muxer_select="riffenc"
  2346. xmv_demuxer_select="riffdec"
  2347. xwma_demuxer_select="riffdec"
  2348. # indevs / outdevs
  2349. alsa_indev_deps="alsa_asoundlib_h snd_pcm_htimestamp"
  2350. alsa_outdev_deps="alsa_asoundlib_h"
  2351. avfoundation_indev_extralibs="-framework CoreVideo -framework Foundation -framework AVFoundation -framework CoreMedia"
  2352. avfoundation_indev_select="avfoundation"
  2353. bktr_indev_deps_any="dev_bktr_ioctl_bt848_h machine_ioctl_bt848_h dev_video_bktr_ioctl_bt848_h dev_ic_bt8xx_h"
  2354. caca_outdev_deps="libcaca"
  2355. decklink_outdev_deps="decklink pthreads"
  2356. decklink_outdev_extralibs="-lstdc++"
  2357. decklink_indev_deps="decklink pthreads"
  2358. decklink_indev_extralibs="-lstdc++"
  2359. dshow_indev_deps="IBaseFilter"
  2360. dshow_indev_extralibs="-lpsapi -lole32 -lstrmiids -luuid -loleaut32 -lshlwapi"
  2361. dv1394_indev_deps="dv1394"
  2362. dv1394_indev_select="dv_demuxer"
  2363. fbdev_indev_deps="linux_fb_h"
  2364. fbdev_outdev_deps="linux_fb_h"
  2365. gdigrab_indev_deps="CreateDIBSection"
  2366. gdigrab_indev_extralibs="-lgdi32"
  2367. gdigrab_indev_select="bmp_decoder"
  2368. iec61883_indev_deps="libiec61883"
  2369. jack_indev_deps="jack_jack_h sem_timedwait"
  2370. lavfi_indev_deps="avfilter"
  2371. libcdio_indev_deps="libcdio"
  2372. libdc1394_indev_deps="libdc1394"
  2373. libv4l2_indev_deps="libv4l2"
  2374. openal_indev_deps="openal"
  2375. opengl_outdev_deps="opengl"
  2376. oss_indev_deps_any="soundcard_h sys_soundcard_h"
  2377. oss_outdev_deps_any="soundcard_h sys_soundcard_h"
  2378. pulse_indev_deps="libpulse"
  2379. pulse_outdev_deps="libpulse"
  2380. qtkit_indev_extralibs="-framework QTKit -framework Foundation -framework QuartzCore"
  2381. qtkit_indev_select="qtkit"
  2382. sdl_outdev_deps="sdl"
  2383. sndio_indev_deps="sndio_h"
  2384. sndio_outdev_deps="sndio_h"
  2385. v4l_indev_deps="linux_videodev_h"
  2386. v4l2_indev_deps_any="linux_videodev2_h sys_videoio_h"
  2387. v4l2_outdev_deps_any="linux_videodev2_h sys_videoio_h"
  2388. vfwcap_indev_deps="capCreateCaptureWindow vfwcap_defines"
  2389. vfwcap_indev_extralibs="-lavicap32"
  2390. xv_outdev_deps="X11_extensions_Xvlib_h XvGetPortAttribute"
  2391. xv_outdev_extralibs="-lXv -lX11 -lXext"
  2392. x11grab_indev_deps="x11grab"
  2393. x11grab_xcb_indev_deps="libxcb"
  2394. # protocols
  2395. bluray_protocol_deps="libbluray"
  2396. ffrtmpcrypt_protocol_deps="!librtmp_protocol"
  2397. ffrtmpcrypt_protocol_deps_any="gcrypt nettle openssl"
  2398. ffrtmpcrypt_protocol_select="tcp_protocol"
  2399. ffrtmphttp_protocol_deps="!librtmp_protocol"
  2400. ffrtmphttp_protocol_select="http_protocol"
  2401. ftp_protocol_select="tcp_protocol"
  2402. gopher_protocol_select="network"
  2403. http_protocol_select="tcp_protocol"
  2404. httpproxy_protocol_select="tcp_protocol"
  2405. https_protocol_select="tls_protocol"
  2406. icecast_protocol_select="http_protocol"
  2407. librtmp_protocol_deps="librtmp"
  2408. librtmpe_protocol_deps="librtmp"
  2409. librtmps_protocol_deps="librtmp"
  2410. librtmpt_protocol_deps="librtmp"
  2411. librtmpte_protocol_deps="librtmp"
  2412. libsmbclient_protocol_deps="libsmbclient gplv3"
  2413. libssh_protocol_deps="libssh"
  2414. mmsh_protocol_select="http_protocol"
  2415. mmst_protocol_select="network"
  2416. rtmp_protocol_deps="!librtmp_protocol"
  2417. rtmp_protocol_select="tcp_protocol"
  2418. rtmpe_protocol_select="ffrtmpcrypt_protocol"
  2419. rtmps_protocol_deps="!librtmp_protocol"
  2420. rtmps_protocol_select="tls_protocol"
  2421. rtmpt_protocol_select="ffrtmphttp_protocol"
  2422. rtmpte_protocol_select="ffrtmpcrypt_protocol ffrtmphttp_protocol"
  2423. rtmpts_protocol_select="ffrtmphttp_protocol https_protocol"
  2424. rtp_protocol_select="udp_protocol"
  2425. sctp_protocol_deps="struct_sctp_event_subscribe"
  2426. sctp_protocol_select="network"
  2427. srtp_protocol_select="rtp_protocol"
  2428. tcp_protocol_select="network"
  2429. tls_gnutls_protocol_deps="gnutls"
  2430. tls_openssl_protocol_deps="openssl !tls_gnutls_protocol"
  2431. tls_protocol_deps_any="tls_gnutls_protocol tls_openssl_protocol"
  2432. tls_protocol_select="tcp_protocol"
  2433. udp_protocol_select="network"
  2434. udplite_protocol_select="network"
  2435. unix_protocol_deps="sys_un_h"
  2436. unix_protocol_select="network"
  2437. # filters
  2438. amovie_filter_deps="avcodec avformat"
  2439. aresample_filter_deps="swresample"
  2440. ass_filter_deps="libass"
  2441. asyncts_filter_deps="avresample"
  2442. atempo_filter_deps="avcodec"
  2443. atempo_filter_select="rdft"
  2444. azmq_filter_deps="libzmq"
  2445. blackframe_filter_deps="gpl"
  2446. boxblur_filter_deps="gpl"
  2447. bs2b_filter_deps="libbs2b"
  2448. colormatrix_filter_deps="gpl"
  2449. cover_rect_filter_deps="avcodec avformat gpl"
  2450. cropdetect_filter_deps="gpl"
  2451. delogo_filter_deps="gpl"
  2452. deshake_filter_select="pixelutils"
  2453. drawtext_filter_deps="libfreetype"
  2454. ebur128_filter_deps="gpl"
  2455. eq_filter_deps="gpl"
  2456. fftfilt_filter_deps="avcodec"
  2457. fftfilt_filter_select="rdft"
  2458. flite_filter_deps="libflite"
  2459. find_rect_filter_deps="avcodec avformat gpl"
  2460. frei0r_filter_deps="frei0r dlopen"
  2461. frei0r_src_filter_deps="frei0r dlopen"
  2462. fspp_filter_deps="gpl"
  2463. geq_filter_deps="gpl"
  2464. histeq_filter_deps="gpl"
  2465. hqdn3d_filter_deps="gpl"
  2466. interlace_filter_deps="gpl"
  2467. kerndeint_filter_deps="gpl"
  2468. ladspa_filter_deps="ladspa dlopen"
  2469. mcdeint_filter_deps="avcodec gpl"
  2470. movie_filter_deps="avcodec avformat"
  2471. mpdecimate_filter_deps="gpl"
  2472. mpdecimate_filter_select="pixelutils"
  2473. mptestsrc_filter_deps="gpl"
  2474. negate_filter_deps="lut_filter"
  2475. perspective_filter_deps="gpl"
  2476. pp7_filter_deps="gpl"
  2477. ocv_filter_deps="libopencv"
  2478. owdenoise_filter_deps="gpl"
  2479. pan_filter_deps="swresample"
  2480. phase_filter_deps="gpl"
  2481. pp_filter_deps="gpl postproc"
  2482. pullup_filter_deps="gpl"
  2483. removelogo_filter_deps="avcodec avformat swscale"
  2484. repeatfields_filter_deps="gpl"
  2485. resample_filter_deps="avresample"
  2486. sab_filter_deps="gpl swscale"
  2487. scale_filter_deps="swscale"
  2488. select_filter_select="pixelutils"
  2489. smartblur_filter_deps="gpl swscale"
  2490. showspectrum_filter_deps="avcodec"
  2491. showspectrum_filter_select="rdft"
  2492. spp_filter_deps="gpl avcodec"
  2493. spp_filter_select="fft idctdsp fdctdsp me_cmp pixblockdsp"
  2494. stereo3d_filter_deps="gpl"
  2495. subtitles_filter_deps="avformat avcodec libass"
  2496. super2xsai_filter_deps="gpl"
  2497. tinterlace_filter_deps="gpl"
  2498. vidstabdetect_filter_deps="libvidstab"
  2499. vidstabtransform_filter_deps="libvidstab"
  2500. pixfmts_super2xsai_test_deps="super2xsai_filter"
  2501. tinterlace_merge_test_deps="tinterlace_filter"
  2502. tinterlace_pad_test_deps="tinterlace_filter"
  2503. uspp_filter_deps="gpl avcodec"
  2504. zmq_filter_deps="libzmq"
  2505. zoompan_filter_deps="swscale"
  2506. # examples
  2507. avio_reading="avformat avcodec avutil"
  2508. avio_list_dir="avformat avutil"
  2509. avcodec_example_deps="avcodec avutil"
  2510. decoding_encoding_example_deps="avcodec avformat avutil"
  2511. demuxing_decoding_example_deps="avcodec avformat avutil"
  2512. extract_mvs_example_deps="avcodec avformat avutil"
  2513. filter_audio_example_deps="avfilter avutil"
  2514. filtering_audio_example_deps="avfilter avcodec avformat avutil"
  2515. filtering_video_example_deps="avfilter avcodec avformat avutil"
  2516. metadata_example_deps="avformat avutil"
  2517. muxing_example_deps="avcodec avformat avutil swscale"
  2518. qsvdec_example_deps="avcodec avutil libmfx h264_qsv_decoder vaapi_x11"
  2519. remuxing_example_deps="avcodec avformat avutil"
  2520. resampling_audio_example_deps="avutil swresample"
  2521. scaling_video_example_deps="avutil swscale"
  2522. transcode_aac_example_deps="avcodec avformat swresample"
  2523. transcoding_example_deps="avfilter avcodec avformat avutil"
  2524. # libraries, in linking order
  2525. avcodec_deps="avutil"
  2526. avdevice_deps="avformat avcodec avutil"
  2527. avfilter_deps="avutil"
  2528. avformat_deps="avcodec avutil"
  2529. avresample_deps="avutil"
  2530. postproc_deps="avutil gpl"
  2531. swresample_deps="avutil"
  2532. swscale_deps="avutil"
  2533. # programs
  2534. ffmpeg_deps="avcodec avfilter avformat swresample"
  2535. ffmpeg_select="aformat_filter anull_filter atrim_filter format_filter
  2536. null_filter
  2537. setpts_filter trim_filter"
  2538. ffplay_deps="avcodec avformat swscale swresample sdl"
  2539. ffplay_libs='$sdl_libs'
  2540. ffplay_select="rdft crop_filter transpose_filter hflip_filter vflip_filter rotate_filter"
  2541. ffprobe_deps="avcodec avformat"
  2542. ffserver_deps="avformat fork sarestart"
  2543. ffserver_select="ffm_muxer rtp_protocol rtsp_demuxer"
  2544. # documentation
  2545. podpages_deps="perl"
  2546. manpages_deps="perl pod2man"
  2547. htmlpages_deps="perl"
  2548. htmlpages_deps_any="makeinfo_html texi2html"
  2549. txtpages_deps="perl makeinfo"
  2550. doc_deps_any="manpages htmlpages podpages txtpages"
  2551. # default parameters
  2552. logfile="config.log"
  2553. # installation paths
  2554. prefix_default="/usr/local"
  2555. bindir_default='${prefix}/bin'
  2556. datadir_default='${prefix}/share/ffmpeg'
  2557. docdir_default='${prefix}/share/doc/ffmpeg'
  2558. incdir_default='${prefix}/include'
  2559. libdir_default='${prefix}/lib'
  2560. mandir_default='${prefix}/share/man'
  2561. # toolchain
  2562. ar_default="ar"
  2563. cc_default="gcc"
  2564. cxx_default="g++"
  2565. host_cc_default="gcc"
  2566. cp_f="cp -f"
  2567. doxygen_default="doxygen"
  2568. install="install"
  2569. ln_s="ln -s -f"
  2570. nm_default="nm -g"
  2571. objformat="elf"
  2572. pkg_config_default=pkg-config
  2573. if ranlib 2>&1 | grep -q "\-D "; then
  2574. ranlib_default="ranlib -D"
  2575. else
  2576. ranlib_default="ranlib"
  2577. fi
  2578. strip_default="strip"
  2579. yasmexe_default="yasm"
  2580. windres_default="windres"
  2581. # OS
  2582. target_os_default=$(tolower $(uname -s))
  2583. host_os=$target_os_default
  2584. # machine
  2585. if test "$target_os_default" = aix; then
  2586. arch_default=$(uname -p)
  2587. strip_default="strip -X32_64"
  2588. else
  2589. arch_default=$(uname -m)
  2590. fi
  2591. cpu="generic"
  2592. intrinsics="none"
  2593. # configurable options
  2594. enable $PROGRAM_LIST
  2595. enable $DOCUMENT_LIST
  2596. enable $EXAMPLE_LIST
  2597. enable $(filter_out avresample $LIBRARY_LIST)
  2598. enable stripping
  2599. enable asm
  2600. enable debug
  2601. enable doc
  2602. enable faan faandct faanidct
  2603. enable optimizations
  2604. enable runtime_cpudetect
  2605. enable safe_bitstream_reader
  2606. enable static
  2607. enable swscale_alpha
  2608. enable valgrind_backtrace
  2609. sws_max_filter_size_default=256
  2610. set_default sws_max_filter_size
  2611. # Enable hwaccels by default.
  2612. enable d3d11va dxva2 vaapi vda vdpau xvmc
  2613. enable xlib
  2614. # build settings
  2615. SHFLAGS='-shared -Wl,-soname,$$(@F)'
  2616. LIBPREF="lib"
  2617. LIBSUF=".a"
  2618. FULLNAME='$(NAME)$(BUILDSUF)'
  2619. LIBNAME='$(LIBPREF)$(FULLNAME)$(LIBSUF)'
  2620. SLIBPREF="lib"
  2621. SLIBSUF=".so"
  2622. SLIBNAME='$(SLIBPREF)$(FULLNAME)$(SLIBSUF)'
  2623. SLIBNAME_WITH_VERSION='$(SLIBNAME).$(LIBVERSION)'
  2624. SLIBNAME_WITH_MAJOR='$(SLIBNAME).$(LIBMAJOR)'
  2625. LIB_INSTALL_EXTRA_CMD='$$(RANLIB) "$(LIBDIR)/$(LIBNAME)"'
  2626. SLIB_INSTALL_NAME='$(SLIBNAME_WITH_VERSION)'
  2627. SLIB_INSTALL_LINKS='$(SLIBNAME_WITH_MAJOR) $(SLIBNAME)'
  2628. asflags_filter=echo
  2629. cflags_filter=echo
  2630. ldflags_filter=echo
  2631. AS_C='-c'
  2632. AS_O='-o $@'
  2633. CC_C='-c'
  2634. CC_E='-E -o $@'
  2635. CC_O='-o $@'
  2636. CXX_C='-c'
  2637. CXX_O='-o $@'
  2638. LD_O='-o $@'
  2639. LD_LIB='-l%'
  2640. LD_PATH='-L'
  2641. HOSTCC_C='-c'
  2642. HOSTCC_E='-E -o $@'
  2643. HOSTCC_O='-o $@'
  2644. HOSTLD_O='-o $@'
  2645. host_libs='-lm'
  2646. host_cflags_filter=echo
  2647. host_ldflags_filter=echo
  2648. target_path='$(CURDIR)'
  2649. # since the object filename is not given with the -MM flag, the compiler
  2650. # is only able to print the basename, and we must add the path ourselves
  2651. DEPCMD='$(DEP$(1)) $(DEP$(1)FLAGS) $($(1)DEP_FLAGS) $< | sed -e "/^\#.*/d" -e "s,^[[:space:]]*$(*F)\\.o,$(@D)/$(*F).o," > $(@:.o=.d)'
  2652. DEPFLAGS='-MM'
  2653. # find source path
  2654. if test -f configure; then
  2655. source_path=.
  2656. else
  2657. source_path=$(cd $(dirname "$0"); pwd)
  2658. echo "$source_path" | grep -q '[[:blank:]]' &&
  2659. die "Out of tree builds are impossible with whitespace in source path."
  2660. test -e "$source_path/config.h" &&
  2661. die "Out of tree builds are impossible with config.h in source dir."
  2662. fi
  2663. for v in "$@"; do
  2664. r=${v#*=}
  2665. l=${v%"$r"}
  2666. r=$(sh_quote "$r")
  2667. FFMPEG_CONFIGURATION="${FFMPEG_CONFIGURATION# } ${l}${r}"
  2668. done
  2669. find_things(){
  2670. thing=$1
  2671. pattern=$2
  2672. file=$source_path/$3
  2673. sed -n "s/^[^#]*$pattern.*([^,]*, *\([^,]*\)\(,.*\)*).*/\1_$thing/p" "$file"
  2674. }
  2675. ENCODER_LIST=$(find_things encoder ENC libavcodec/allcodecs.c)
  2676. DECODER_LIST=$(find_things decoder DEC libavcodec/allcodecs.c)
  2677. HWACCEL_LIST=$(find_things hwaccel HWACCEL libavcodec/allcodecs.c)
  2678. PARSER_LIST=$(find_things parser PARSER libavcodec/allcodecs.c)
  2679. BSF_LIST=$(find_things bsf BSF libavcodec/allcodecs.c)
  2680. MUXER_LIST=$(find_things muxer _MUX libavformat/allformats.c)
  2681. DEMUXER_LIST=$(find_things demuxer DEMUX libavformat/allformats.c)
  2682. OUTDEV_LIST=$(find_things outdev OUTDEV libavdevice/alldevices.c)
  2683. INDEV_LIST=$(find_things indev _IN libavdevice/alldevices.c)
  2684. PROTOCOL_LIST=$(find_things protocol PROTOCOL libavformat/allformats.c)
  2685. FILTER_LIST=$(find_things filter FILTER libavfilter/allfilters.c)
  2686. ALL_COMPONENTS="
  2687. $BSF_LIST
  2688. $DECODER_LIST
  2689. $DEMUXER_LIST
  2690. $ENCODER_LIST
  2691. $FILTER_LIST
  2692. $HWACCEL_LIST
  2693. $INDEV_LIST
  2694. $MUXER_LIST
  2695. $OUTDEV_LIST
  2696. $PARSER_LIST
  2697. $PROTOCOL_LIST
  2698. "
  2699. for n in $COMPONENT_LIST; do
  2700. v=$(toupper ${n%s})_LIST
  2701. eval enable \$$v
  2702. eval ${n}_if_any="\$$v"
  2703. done
  2704. enable $ARCH_EXT_LIST
  2705. die_unknown(){
  2706. echo "Unknown option \"$1\"."
  2707. echo "See $0 --help for available options."
  2708. exit 1
  2709. }
  2710. print_3_columns() {
  2711. cat | tr ' ' '\n' | sort | pr -r -3 -t
  2712. }
  2713. show_list() {
  2714. suffix=_$1
  2715. shift
  2716. echo $* | sed s/$suffix//g | print_3_columns
  2717. exit 0
  2718. }
  2719. rand_list(){
  2720. IFS=', '
  2721. set -- $*
  2722. unset IFS
  2723. for thing; do
  2724. comp=${thing%:*}
  2725. prob=${thing#$comp}
  2726. prob=${prob#:}
  2727. is_in ${comp} $COMPONENT_LIST && eval comp=\$$(toupper ${comp%s})_LIST
  2728. echo "prob ${prob:-0.5}"
  2729. printf '%s\n' $comp
  2730. done
  2731. }
  2732. do_random(){
  2733. action=$1
  2734. shift
  2735. random_seed=$(awk "BEGIN { srand($random_seed); print srand() }")
  2736. $action $(rand_list "$@" | awk "BEGIN { srand($random_seed) } \$1 == \"prob\" { prob = \$2; next } rand() < prob { print }")
  2737. }
  2738. for opt do
  2739. optval="${opt#*=}"
  2740. case "$opt" in
  2741. --extra-ldflags=*)
  2742. add_ldflags $optval
  2743. ;;
  2744. --extra-ldexeflags=*)
  2745. add_ldexeflags $optval
  2746. ;;
  2747. --extra-libs=*)
  2748. add_extralibs $optval
  2749. ;;
  2750. --disable-devices)
  2751. disable $INDEV_LIST $OUTDEV_LIST
  2752. ;;
  2753. --enable-debug=*)
  2754. debuglevel="$optval"
  2755. ;;
  2756. --disable-programs)
  2757. disable $PROGRAM_LIST
  2758. ;;
  2759. --disable-everything)
  2760. map 'eval unset \${$(toupper ${v%s})_LIST}' $COMPONENT_LIST
  2761. ;;
  2762. --disable-all)
  2763. map 'eval unset \${$(toupper ${v%s})_LIST}' $COMPONENT_LIST
  2764. disable $LIBRARY_LIST $PROGRAM_LIST doc
  2765. ;;
  2766. --enable-random|--disable-random)
  2767. action=${opt%%-random}
  2768. do_random ${action#--} $COMPONENT_LIST
  2769. ;;
  2770. --enable-random=*|--disable-random=*)
  2771. action=${opt%%-random=*}
  2772. do_random ${action#--} $optval
  2773. ;;
  2774. --enable-*=*|--disable-*=*)
  2775. eval $(echo "${opt%%=*}" | sed 's/--/action=/;s/-/ thing=/')
  2776. is_in "${thing}s" $COMPONENT_LIST || die_unknown "$opt"
  2777. eval list=\$$(toupper $thing)_LIST
  2778. name=$(echo "${optval}" | sed "s/,/_${thing}|/g")_${thing}
  2779. list=$(filter "$name" $list)
  2780. [ "$list" = "" ] && warn "Option $opt did not match anything"
  2781. $action $list
  2782. ;;
  2783. --enable-?*|--disable-?*)
  2784. eval $(echo "$opt" | sed 's/--/action=/;s/-/ option=/;s/-/_/g')
  2785. if is_in $option $COMPONENT_LIST; then
  2786. test $action = disable && action=unset
  2787. eval $action \$$(toupper ${option%s})_LIST
  2788. elif is_in $option $CMDLINE_SELECT; then
  2789. $action $option
  2790. else
  2791. die_unknown $opt
  2792. fi
  2793. ;;
  2794. --list-*)
  2795. NAME="${opt#--list-}"
  2796. is_in $NAME $COMPONENT_LIST || die_unknown $opt
  2797. NAME=${NAME%s}
  2798. eval show_list $NAME \$$(toupper $NAME)_LIST
  2799. ;;
  2800. --help|-h) show_help
  2801. ;;
  2802. --fatal-warnings) enable fatal_warnings
  2803. ;;
  2804. *)
  2805. optname="${opt%%=*}"
  2806. optname="${optname#--}"
  2807. optname=$(echo "$optname" | sed 's/-/_/g')
  2808. if is_in $optname $CMDLINE_SET; then
  2809. eval $optname='$optval'
  2810. elif is_in $optname $CMDLINE_APPEND; then
  2811. append $optname "$optval"
  2812. else
  2813. die_unknown $opt
  2814. fi
  2815. ;;
  2816. esac
  2817. done
  2818. disabled logging && logfile=/dev/null
  2819. echo "# $0 $FFMPEG_CONFIGURATION" > $logfile
  2820. set >> $logfile
  2821. test -n "$valgrind" && toolchain="valgrind-memcheck"
  2822. case "$toolchain" in
  2823. clang-asan)
  2824. cc_default="clang"
  2825. add_cflags -fsanitize=address
  2826. add_ldflags -fsanitize=address
  2827. ;;
  2828. clang-tsan)
  2829. cc_default="clang"
  2830. add_cflags -fsanitize=thread -pie
  2831. add_ldflags -fsanitize=thread -pie
  2832. ;;
  2833. clang-usan)
  2834. cc_default="clang"
  2835. add_cflags -fsanitize=undefined
  2836. add_ldflags -fsanitize=undefined
  2837. ;;
  2838. gcc-asan)
  2839. cc_default="gcc"
  2840. add_cflags -fsanitize=address
  2841. add_ldflags -fsanitize=address
  2842. ;;
  2843. gcc-tsan)
  2844. cc_default="gcc"
  2845. add_cflags -fsanitize=thread -pie -fPIC
  2846. add_ldflags -fsanitize=thread -pie -fPIC
  2847. ;;
  2848. gcc-usan)
  2849. cc_default="gcc"
  2850. add_cflags -fsanitize=undefined
  2851. add_ldflags -fsanitize=undefined
  2852. ;;
  2853. valgrind-massif)
  2854. target_exec_default=${valgrind:-"valgrind"}
  2855. target_exec_args="--tool=massif --alloc-fn=av_malloc --alloc-fn=av_mallocz --alloc-fn=av_calloc --alloc-fn=av_fast_padded_malloc --alloc-fn=av_fast_malloc --alloc-fn=av_realloc_f --alloc-fn=av_fast_realloc --alloc-fn=av_realloc"
  2856. ;;
  2857. valgrind-memcheck)
  2858. target_exec_default=${valgrind:-"valgrind"}
  2859. target_exec_args="--error-exitcode=1 --malloc-fill=0x2a --track-origins=yes --leak-check=full --gen-suppressions=all --suppressions=$source_path/tests/fate-valgrind.supp"
  2860. ;;
  2861. msvc)
  2862. # Check whether the current MSVC version needs the C99 converter.
  2863. # From MSVC 2013 (compiler major version 18) onwards, it does actually
  2864. # support enough of C99 to build ffmpeg. Default to the new
  2865. # behaviour if the regexp was unable to match anything, since this
  2866. # successfully parses the version number of existing supported
  2867. # versions that require the converter (MSVC 2010 and 2012).
  2868. cl_major_ver=$(cl 2>&1 | sed -n 's/.*Version \([[:digit:]]\{1,\}\)\..*/\1/p')
  2869. if [ -z "$cl_major_ver" ] || [ $cl_major_ver -ge 18 ]; then
  2870. cc_default="cl"
  2871. else
  2872. cc_default="c99wrap cl"
  2873. fi
  2874. ld_default="link"
  2875. nm_default="dumpbin -symbols"
  2876. ar_default="lib"
  2877. target_os_default="win32"
  2878. # Use a relative path for TMPDIR. This makes sure all the
  2879. # ffconf temp files are written with a relative path, avoiding
  2880. # issues with msys/win32 path conversion for MSVC parameters
  2881. # such as -Fo<file> or -out:<file>.
  2882. TMPDIR=.
  2883. ;;
  2884. icl)
  2885. cc_default="icl"
  2886. ld_default="xilink"
  2887. nm_default="dumpbin -symbols"
  2888. ar_default="xilib"
  2889. target_os_default="win32"
  2890. TMPDIR=.
  2891. ;;
  2892. gcov)
  2893. add_cflags -fprofile-arcs -ftest-coverage
  2894. add_ldflags -fprofile-arcs -ftest-coverage
  2895. ;;
  2896. hardened)
  2897. add_cppflags -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2
  2898. add_cflags -fno-strict-overflow -fstack-protector-all
  2899. add_ldflags -Wl,-z,relro -Wl,-z,now
  2900. ;;
  2901. ?*)
  2902. die "Unknown toolchain $toolchain"
  2903. ;;
  2904. esac
  2905. test -n "$cross_prefix" && enable cross_compile
  2906. if enabled cross_compile; then
  2907. test -n "$arch" && test -n "$target_os" ||
  2908. die "Must specify target arch and OS when cross-compiling"
  2909. fi
  2910. ar_default="${cross_prefix}${ar_default}"
  2911. cc_default="${cross_prefix}${cc_default}"
  2912. cxx_default="${cross_prefix}${cxx_default}"
  2913. nm_default="${cross_prefix}${nm_default}"
  2914. pkg_config_default="${cross_prefix}${pkg_config_default}"
  2915. ranlib_default="${cross_prefix}${ranlib_default}"
  2916. strip_default="${cross_prefix}${strip_default}"
  2917. windres_default="${cross_prefix}${windres_default}"
  2918. sysinclude_default="${sysroot}/usr/include"
  2919. set_default arch cc cxx doxygen pkg_config ranlib strip sysinclude \
  2920. target_exec target_os yasmexe
  2921. enabled cross_compile || host_cc_default=$cc
  2922. set_default host_cc
  2923. pkg_config_fail_message=""
  2924. if ! $pkg_config --version >/dev/null 2>&1; then
  2925. warn "$pkg_config not found, library detection may fail."
  2926. pkg_config=false
  2927. elif is_in -static $cc $LDFLAGS && ! is_in --static $pkg_config $pkg_config_flags; then
  2928. pkg_config_fail_message="
  2929. Note: When building a static binary, add --pkg-config-flags=\"--static\"."
  2930. fi
  2931. if test $doxygen != $doxygen_default && \
  2932. ! $doxygen --version >/dev/null 2>&1; then
  2933. warn "Specified doxygen \"$doxygen\" not found, API documentation will fail to build."
  2934. fi
  2935. exesuf() {
  2936. case $1 in
  2937. mingw32*|win32|win64|cygwin*|*-dos|freedos|opendos|os/2*|symbian) echo .exe ;;
  2938. esac
  2939. }
  2940. EXESUF=$(exesuf $target_os)
  2941. HOSTEXESUF=$(exesuf $host_os)
  2942. # set temporary file name
  2943. : ${TMPDIR:=$TEMPDIR}
  2944. : ${TMPDIR:=$TMP}
  2945. : ${TMPDIR:=/tmp}
  2946. if [ -n "$tempprefix" ] ; then
  2947. mktemp(){
  2948. echo $tempprefix.${HOSTNAME}.${UID}
  2949. }
  2950. elif ! check_cmd mktemp -u XXXXXX; then
  2951. # simple replacement for missing mktemp
  2952. # NOT SAFE FOR GENERAL USE
  2953. mktemp(){
  2954. echo "${2%%XXX*}.${HOSTNAME}.${UID}.$$"
  2955. }
  2956. fi
  2957. tmpfile(){
  2958. tmp=$(mktemp -u "${TMPDIR}/ffconf.XXXXXXXX")$2 &&
  2959. (set -C; exec > $tmp) 2>/dev/null ||
  2960. die "Unable to create temporary file in $TMPDIR."
  2961. append TMPFILES $tmp
  2962. eval $1=$tmp
  2963. }
  2964. trap 'rm -f -- $TMPFILES' EXIT
  2965. tmpfile TMPASM .asm
  2966. tmpfile TMPC .c
  2967. tmpfile TMPCPP .cpp
  2968. tmpfile TMPE $EXESUF
  2969. tmpfile TMPH .h
  2970. tmpfile TMPM .m
  2971. tmpfile TMPO .o
  2972. tmpfile TMPS .S
  2973. tmpfile TMPSH .sh
  2974. tmpfile TMPV .ver
  2975. unset -f mktemp
  2976. chmod +x $TMPE
  2977. # make sure we can execute files in $TMPDIR
  2978. cat > $TMPSH 2>> $logfile <<EOF
  2979. #! /bin/sh
  2980. EOF
  2981. chmod +x $TMPSH >> $logfile 2>&1
  2982. if ! $TMPSH >> $logfile 2>&1; then
  2983. cat <<EOF
  2984. Unable to create and execute files in $TMPDIR. Set the TMPDIR environment
  2985. variable to another directory and make sure that it is not mounted noexec.
  2986. EOF
  2987. die "Sanity test failed."
  2988. fi
  2989. armasm_flags(){
  2990. for flag; do
  2991. case $flag in
  2992. # Filter out MSVC cl.exe options from cflags that shouldn't
  2993. # be passed to gas-preprocessor
  2994. -M[TD]*) ;;
  2995. *) echo $flag ;;
  2996. esac
  2997. done
  2998. }
  2999. ccc_flags(){
  3000. for flag; do
  3001. case $flag in
  3002. -std=c99) echo -c99 ;;
  3003. -mcpu=*) echo -arch ${flag#*=} ;;
  3004. -mieee) echo -ieee ;;
  3005. -O*|-fast) echo $flag ;;
  3006. -fno-math-errno) echo -assume nomath_errno ;;
  3007. -g) echo -g3 ;;
  3008. -Wall) echo -msg_enable level2 ;;
  3009. -Wno-pointer-sign) echo -msg_disable ptrmismatch1 ;;
  3010. -Wl,*) echo $flag ;;
  3011. -f*|-W*) ;;
  3012. *) echo $flag ;;
  3013. esac
  3014. done
  3015. }
  3016. cparser_flags(){
  3017. for flag; do
  3018. case $flag in
  3019. -Wno-switch) echo -Wno-switch-enum ;;
  3020. -Wno-format-zero-length) ;;
  3021. -Wdisabled-optimization) ;;
  3022. -Wno-pointer-sign) echo -Wno-other ;;
  3023. *) echo $flag ;;
  3024. esac
  3025. done
  3026. }
  3027. msvc_common_flags(){
  3028. for flag; do
  3029. case $flag in
  3030. # In addition to specifying certain flags under the compiler
  3031. # specific filters, they must be specified here as well or else the
  3032. # generic catch all at the bottom will print the original flag.
  3033. -Wall) ;;
  3034. -std=c99) ;;
  3035. # Common flags
  3036. -fomit-frame-pointer) ;;
  3037. -g) echo -Z7 ;;
  3038. -fno-math-errno) ;;
  3039. -fno-common) ;;
  3040. -fno-signed-zeros) ;;
  3041. -fPIC) ;;
  3042. -mthumb) ;;
  3043. -march=*) ;;
  3044. -lz) echo zlib.lib ;;
  3045. -lavifil32) echo vfw32.lib ;;
  3046. -lavicap32) echo vfw32.lib user32.lib ;;
  3047. -l*) echo ${flag#-l}.lib ;;
  3048. -L*) echo -libpath:${flag#-L} ;;
  3049. *) echo $flag ;;
  3050. esac
  3051. done
  3052. }
  3053. msvc_flags(){
  3054. msvc_common_flags "$@"
  3055. for flag; do
  3056. case $flag in
  3057. -Wall) echo -W4 -wd4244 -wd4127 -wd4018 -wd4389 \
  3058. -wd4146 -wd4057 -wd4204 -wd4706 -wd4305 \
  3059. -wd4152 -wd4324 -we4013 -wd4100 -wd4214 \
  3060. -wd4307 \
  3061. -wd4273 -wd4554 -wd4701 ;;
  3062. esac
  3063. done
  3064. }
  3065. icl_flags(){
  3066. msvc_common_flags "$@"
  3067. for flag; do
  3068. case $flag in
  3069. # Despite what Intel's documentation says -Wall, which is supported
  3070. # on Windows, does enable remarks so disable them here.
  3071. -Wall) echo $flag -Qdiag-disable:remark ;;
  3072. -std=c99) echo -Qstd=c99 ;;
  3073. -flto) echo -ipo ;;
  3074. esac
  3075. done
  3076. }
  3077. icc_flags(){
  3078. for flag; do
  3079. case $flag in
  3080. -flto) echo -ipo ;;
  3081. *) echo $flag ;;
  3082. esac
  3083. done
  3084. }
  3085. pgi_flags(){
  3086. for flag; do
  3087. case $flag in
  3088. -flto) echo -Mipa=fast,libopt,libinline,vestigial ;;
  3089. -fomit-frame-pointer) echo -Mnoframe ;;
  3090. -g) echo -gopt ;;
  3091. *) echo $flag ;;
  3092. esac
  3093. done
  3094. }
  3095. suncc_flags(){
  3096. for flag; do
  3097. case $flag in
  3098. -march=*|-mcpu=*)
  3099. case "${flag#*=}" in
  3100. native) echo -xtarget=native ;;
  3101. v9|niagara) echo -xarch=sparc ;;
  3102. ultrasparc) echo -xarch=sparcvis ;;
  3103. ultrasparc3|niagara2) echo -xarch=sparcvis2 ;;
  3104. i586|pentium) echo -xchip=pentium ;;
  3105. i686|pentiumpro|pentium2) echo -xtarget=pentium_pro ;;
  3106. pentium3*|c3-2) echo -xtarget=pentium3 ;;
  3107. pentium-m) echo -xarch=sse2 -xchip=pentium3 ;;
  3108. pentium4*) echo -xtarget=pentium4 ;;
  3109. prescott|nocona) echo -xarch=sse3 -xchip=pentium4 ;;
  3110. *-sse3) echo -xarch=sse3 ;;
  3111. core2) echo -xarch=ssse3 -xchip=core2 ;;
  3112. bonnell) echo -xarch=ssse3 ;;
  3113. corei7|nehalem) echo -xtarget=nehalem ;;
  3114. westmere) echo -xtarget=westmere ;;
  3115. silvermont) echo -xarch=sse4_2 ;;
  3116. corei7-avx|sandybridge) echo -xtarget=sandybridge ;;
  3117. core-avx*|ivybridge|haswell|broadwell)
  3118. echo -xarch=avx ;;
  3119. amdfam10|barcelona) echo -xtarget=barcelona ;;
  3120. btver1) echo -xarch=amdsse4a ;;
  3121. btver2|bdver*) echo -xarch=avx ;;
  3122. athlon-4|athlon-[mx]p) echo -xarch=ssea ;;
  3123. k8|opteron|athlon64|athlon-fx)
  3124. echo -xarch=sse2a ;;
  3125. athlon*) echo -xarch=pentium_proa ;;
  3126. esac
  3127. ;;
  3128. -std=c99) echo -xc99 ;;
  3129. -fomit-frame-pointer) echo -xregs=frameptr ;;
  3130. -fPIC) echo -KPIC -xcode=pic32 ;;
  3131. -W*,*) echo $flag ;;
  3132. -f*-*|-W*|-mimpure-text) ;;
  3133. -shared) echo -G ;;
  3134. *) echo $flag ;;
  3135. esac
  3136. done
  3137. }
  3138. tms470_flags(){
  3139. for flag; do
  3140. case $flag in
  3141. -march=*|-mcpu=*)
  3142. case "${flag#*=}" in
  3143. armv7-a|cortex-a*) echo -mv=7a8 ;;
  3144. armv7-r|cortex-r*) echo -mv=7r4 ;;
  3145. armv7-m|cortex-m*) echo -mv=7m3 ;;
  3146. armv6*|arm11*) echo -mv=6 ;;
  3147. armv5*e|arm[79]*e*|arm9[24]6*|arm96*|arm102[26])
  3148. echo -mv=5e ;;
  3149. armv4*|arm7*|arm9[24]*) echo -mv=4 ;;
  3150. esac
  3151. ;;
  3152. -mfpu=neon) echo --float_support=vfpv3 --neon ;;
  3153. -mfpu=vfp) echo --float_support=vfpv2 ;;
  3154. -mfpu=vfpv3) echo --float_support=vfpv3 ;;
  3155. -mfpu=vfpv3-d16) echo --float_support=vfpv3d16 ;;
  3156. -msoft-float) echo --float_support=vfplib ;;
  3157. -O[0-3]|-mf=*) echo $flag ;;
  3158. -g) echo -g -mn ;;
  3159. -pds=*) echo $flag ;;
  3160. -D*|-I*) echo $flag ;;
  3161. --gcc|--abi=*) echo $flag ;;
  3162. -me) echo $flag ;;
  3163. esac
  3164. done
  3165. }
  3166. probe_cc(){
  3167. pfx=$1
  3168. _cc=$2
  3169. unset _type _ident _cc_c _cc_e _cc_o _flags _cflags
  3170. unset _ld_o _ldflags _ld_lib _ld_path
  3171. unset _depflags _DEPCMD _DEPFLAGS
  3172. _flags_filter=echo
  3173. if $_cc --version 2>&1 | grep -q '^GNU assembler'; then
  3174. true # no-op to avoid reading stdin in following checks
  3175. elif $_cc -v 2>&1 | grep -q '^gcc.*LLVM'; then
  3176. _type=llvm_gcc
  3177. gcc_extra_ver=$(expr "$($_cc --version | head -n1)" : '.*\((.*)\)')
  3178. _ident="llvm-gcc $($_cc -dumpversion) $gcc_extra_ver"
  3179. _depflags='-MMD -MF $(@:.o=.d) -MT $@'
  3180. _cflags_speed='-O3'
  3181. _cflags_size='-Os'
  3182. elif $_cc -v 2>&1 | grep -qi ^gcc; then
  3183. _type=gcc
  3184. gcc_version=$($_cc --version | head -n1)
  3185. gcc_basever=$($_cc -dumpversion)
  3186. gcc_pkg_ver=$(expr "$gcc_version" : '[^ ]* \(([^)]*)\)')
  3187. gcc_ext_ver=$(expr "$gcc_version" : ".*$gcc_pkg_ver $gcc_basever \\(.*\\)")
  3188. _ident=$(cleanws "gcc $gcc_basever $gcc_pkg_ver $gcc_ext_ver")
  3189. if ! $_cc -dumpversion | grep -q '^2\.'; then
  3190. _depflags='-MMD -MF $(@:.o=.d) -MT $@'
  3191. fi
  3192. _cflags_speed='-O3'
  3193. _cflags_size='-Os'
  3194. elif $_cc --version 2>/dev/null | grep -q ^icc; then
  3195. _type=icc
  3196. _ident=$($_cc --version | head -n1)
  3197. _depflags='-MMD'
  3198. _cflags_speed='-O3'
  3199. _cflags_size='-Os'
  3200. _cflags_noopt='-O1'
  3201. _flags_filter=icc_flags
  3202. elif $_cc -v 2>&1 | grep -q xlc; then
  3203. _type=xlc
  3204. _ident=$($_cc -qversion 2>/dev/null | head -n1)
  3205. _cflags_speed='-O5'
  3206. _cflags_size='-O5 -qcompact'
  3207. elif $_cc -V 2>/dev/null | grep -q Compaq; then
  3208. _type=ccc
  3209. _ident=$($_cc -V | head -n1 | cut -d' ' -f1-3)
  3210. _DEPFLAGS='-M'
  3211. _cflags_speed='-fast'
  3212. _cflags_size='-O1'
  3213. _flags_filter=ccc_flags
  3214. elif $_cc --vsn 2>/dev/null | grep -Eq "ARM (C/C\+\+ )?Compiler"; then
  3215. test -d "$sysroot" || die "No valid sysroot specified."
  3216. _type=armcc
  3217. _ident=$($_cc --vsn | grep -i build | head -n1 | sed 's/.*: //')
  3218. armcc_conf="$PWD/armcc.conf"
  3219. $_cc --arm_linux_configure \
  3220. --arm_linux_config_file="$armcc_conf" \
  3221. --configure_sysroot="$sysroot" \
  3222. --configure_cpp_headers="$sysinclude" >>$logfile 2>&1 ||
  3223. die "Error creating armcc configuration file."
  3224. $_cc --vsn | grep -q RVCT && armcc_opt=rvct || armcc_opt=armcc
  3225. _flags="--arm_linux_config_file=$armcc_conf --translate_gcc"
  3226. as_default="${cross_prefix}gcc"
  3227. _depflags='-MMD'
  3228. _cflags_speed='-O3'
  3229. _cflags_size='-Os'
  3230. elif $_cc -version 2>/dev/null | grep -Eq 'TMS470|TI ARM'; then
  3231. _type=tms470
  3232. _ident=$($_cc -version | head -n1 | tr -s ' ')
  3233. _flags='--gcc --abi=eabi -me'
  3234. _cc_e='-ppl -fe=$@'
  3235. _cc_o='-fe=$@'
  3236. _depflags='-ppa -ppd=$(@:.o=.d)'
  3237. _cflags_speed='-O3 -mf=5'
  3238. _cflags_size='-O3 -mf=2'
  3239. _flags_filter=tms470_flags
  3240. elif $_cc -v 2>&1 | grep -q clang; then
  3241. _type=clang
  3242. _ident=$($_cc --version | head -n1)
  3243. _depflags='-MMD -MF $(@:.o=.d) -MT $@'
  3244. _cflags_speed='-O3'
  3245. _cflags_size='-Os'
  3246. elif $_cc -V 2>&1 | grep -q Sun; then
  3247. _type=suncc
  3248. _ident=$($_cc -V 2>&1 | head -n1 | cut -d' ' -f 2-)
  3249. _DEPCMD='$(DEP$(1)) $(DEP$(1)FLAGS) $($(1)DEP_FLAGS) $< | sed -e "1s,^.*: ,$@: ," -e "\$$!s,\$$, \\\," -e "1!s,^.*: , ," > $(@:.o=.d)'
  3250. _DEPFLAGS='-xM1 -xc99'
  3251. _ldflags='-std=c99'
  3252. _cflags_speed='-O5'
  3253. _cflags_size='-O5 -xspace'
  3254. _flags_filter=suncc_flags
  3255. elif $_cc -v 2>&1 | grep -q 'PathScale\|Path64'; then
  3256. _type=pathscale
  3257. _ident=$($_cc -v 2>&1 | head -n1 | tr -d :)
  3258. _depflags='-MMD -MF $(@:.o=.d) -MT $@'
  3259. _cflags_speed='-O2'
  3260. _cflags_size='-Os'
  3261. _flags_filter='filter_out -Wdisabled-optimization'
  3262. elif $_cc -v 2>&1 | grep -q Open64; then
  3263. _type=open64
  3264. _ident=$($_cc -v 2>&1 | head -n1 | tr -d :)
  3265. _depflags='-MMD -MF $(@:.o=.d) -MT $@'
  3266. _cflags_speed='-O2'
  3267. _cflags_size='-Os'
  3268. _flags_filter='filter_out -Wdisabled-optimization|-Wtype-limits|-fno-signed-zeros'
  3269. elif $_cc -V 2>&1 | grep -q Portland; then
  3270. _type=pgi
  3271. _ident="PGI $($_cc -V 2>&1 | awk '/^pgcc/ { print $2; exit }')"
  3272. opt_common='-alias=ansi -Mdse -Mlre -Mpre'
  3273. _cflags_speed="-O3 -Mautoinline -Munroll=c:4 $opt_common"
  3274. _cflags_size="-O2 -Munroll=c:1 $opt_common"
  3275. _cflags_noopt="-O"
  3276. _flags_filter=pgi_flags
  3277. elif $_cc 2>&1 | grep -q 'Microsoft.*ARM.*Assembler'; then
  3278. _type=armasm
  3279. _ident=$($_cc | head -n1)
  3280. # 4509: "This form of conditional instruction is deprecated"
  3281. _flags="-nologo -ignore 4509"
  3282. _flags_filter=armasm_flags
  3283. elif $_cc 2>&1 | grep -q Intel; then
  3284. _type=icl
  3285. _ident=$($_cc 2>&1 | head -n1)
  3286. _depflags='-QMMD -QMF$(@:.o=.d) -QMT$@'
  3287. # Not only is O3 broken on 13.x+ but it is slower on all previous
  3288. # versions (tested) as well.
  3289. _cflags_speed="-O2"
  3290. _cflags_size="-O1 -Oi" # -O1 without -Oi miscompiles stuff
  3291. if $_cc 2>&1 | grep -q Linker; then
  3292. _ld_o='-out:$@'
  3293. else
  3294. _ld_o='-Fe$@'
  3295. fi
  3296. _cc_o='-Fo$@'
  3297. _cc_e='-P'
  3298. _flags_filter=icl_flags
  3299. _ld_lib='lib%.a'
  3300. _ld_path='-libpath:'
  3301. # -Qdiag-error to make icl error when seeing certain unknown arguments
  3302. _flags='-nologo -Qdiag-error:4044,10157'
  3303. # -Qvec- -Qsimd- to prevent miscompilation, -GS, fp:precise for consistency
  3304. # with MSVC which enables it by default.
  3305. _cflags='-D_USE_MATH_DEFINES -FIstdlib.h -Dstrtoll=_strtoi64 -Qms0 -Qvec- -Qsimd- -GS -fp:precise'
  3306. if [ $pfx = hostcc ]; then
  3307. append _cflags -Dsnprintf=_snprintf
  3308. fi
  3309. disable stripping
  3310. elif $_cc 2>&1 | grep -q Microsoft; then
  3311. _type=msvc
  3312. _ident=$($_cc 2>&1 | head -n1)
  3313. _DEPCMD='$(DEP$(1)) $(DEP$(1)FLAGS) $($(1)DEP_FLAGS) $< 2>&1 | awk '\''/including/ { sub(/^.*file: */, ""); gsub(/\\/, "/"); if (!match($$0, / /)) print "$@:", $$0 }'\'' > $(@:.o=.d)'
  3314. _DEPFLAGS='$(CPPFLAGS) $(CFLAGS) -showIncludes -Zs'
  3315. _cflags_speed="-O2"
  3316. _cflags_size="-O1"
  3317. if $_cc 2>&1 | grep -q Linker; then
  3318. _ld_o='-out:$@'
  3319. else
  3320. _ld_o='-Fe$@'
  3321. fi
  3322. _cc_o='-Fo$@'
  3323. _cc_e='-P -Fi$@'
  3324. _flags_filter=msvc_flags
  3325. _ld_lib='lib%.a'
  3326. _ld_path='-libpath:'
  3327. _flags='-nologo'
  3328. _cflags='-D_USE_MATH_DEFINES -D_CRT_SECURE_NO_WARNINGS -Dinline=__inline -FIstdlib.h -Dstrtoll=_strtoi64'
  3329. if [ $pfx = hostcc ]; then
  3330. if [ -z "$cl_major_ver" ] || [ $cl_major_ver -le 18 ]; then
  3331. append _cflags -Dsnprintf=_snprintf
  3332. fi
  3333. fi
  3334. disable stripping
  3335. elif $_cc --version 2>/dev/null | grep -q ^cparser; then
  3336. _type=cparser
  3337. _ident=$($_cc --version | head -n1)
  3338. _depflags='-MMD'
  3339. _cflags_speed='-O4'
  3340. _cflags_size='-O2'
  3341. _flags_filter=cparser_flags
  3342. fi
  3343. eval ${pfx}_type=\$_type
  3344. eval ${pfx}_ident=\$_ident
  3345. }
  3346. set_ccvars(){
  3347. eval ${1}_C=\${_cc_c-\${${1}_C}}
  3348. eval ${1}_E=\${_cc_e-\${${1}_E}}
  3349. eval ${1}_O=\${_cc_o-\${${1}_O}}
  3350. if [ -n "$_depflags" ]; then
  3351. eval ${1}_DEPFLAGS=\$_depflags
  3352. else
  3353. eval ${1}DEP=\${_DEPCMD:-\$DEPCMD}
  3354. eval ${1}DEP_FLAGS=\${_DEPFLAGS:-\$DEPFLAGS}
  3355. eval DEP${1}FLAGS=\$_flags
  3356. fi
  3357. }
  3358. probe_cc cc "$cc"
  3359. cflags_filter=$_flags_filter
  3360. cflags_speed=$_cflags_speed
  3361. cflags_size=$_cflags_size
  3362. cflags_noopt=$_cflags_noopt
  3363. add_cflags $_flags $_cflags
  3364. cc_ldflags=$_ldflags
  3365. set_ccvars CC
  3366. probe_cc hostcc "$host_cc"
  3367. host_cflags_filter=$_flags_filter
  3368. add_host_cflags $_flags $_cflags
  3369. set_ccvars HOSTCC
  3370. test -n "$cc_type" && enable $cc_type ||
  3371. warn "Unknown C compiler $cc, unable to select optimal CFLAGS"
  3372. : ${as_default:=$cc}
  3373. : ${dep_cc_default:=$cc}
  3374. : ${ld_default:=$cc}
  3375. : ${host_ld_default:=$host_cc}
  3376. set_default ar as dep_cc ld host_ld windres
  3377. probe_cc as "$as"
  3378. asflags_filter=$_flags_filter
  3379. add_asflags $_flags $_cflags
  3380. set_ccvars AS
  3381. probe_cc ld "$ld"
  3382. ldflags_filter=$_flags_filter
  3383. add_ldflags $_flags $_ldflags
  3384. test "$cc_type" != "$ld_type" && add_ldflags $cc_ldflags
  3385. LD_O=${_ld_o-$LD_O}
  3386. LD_LIB=${_ld_lib-$LD_LIB}
  3387. LD_PATH=${_ld_path-$LD_PATH}
  3388. probe_cc hostld "$host_ld"
  3389. host_ldflags_filter=$_flags_filter
  3390. add_host_ldflags $_flags $_ldflags
  3391. HOSTLD_O=${_ld_o-$HOSTLD_O}
  3392. if [ -z "$CC_DEPFLAGS" ] && [ "$dep_cc" != "$cc" ]; then
  3393. probe_cc depcc "$dep_cc"
  3394. CCDEP=${_DEPCMD:-$DEPCMD}
  3395. CCDEP_FLAGS=${_DEPFLAGS:=$DEPFLAGS}
  3396. DEPCCFLAGS=$_flags
  3397. fi
  3398. if $ar 2>&1 | grep -q Microsoft; then
  3399. arflags="-nologo"
  3400. ar_o='-out:$@'
  3401. elif $ar 2>&1 | grep -q 'Texas Instruments'; then
  3402. arflags="rq"
  3403. ar_o='$@'
  3404. elif $ar 2>&1 | grep -q 'Usage: ar.*-X.*any'; then
  3405. arflags='-Xany -r -c'
  3406. ar_o='$@'
  3407. elif $ar 2>&1 | grep -q "\[D\] "; then
  3408. arflags="rcD"
  3409. ar_o='$@'
  3410. else
  3411. arflags="rc"
  3412. ar_o='$@'
  3413. fi
  3414. add_cflags $extra_cflags
  3415. add_cxxflags $extra_cxxflags
  3416. add_asflags $extra_cflags
  3417. if test -n "$sysroot"; then
  3418. case "$cc_type" in
  3419. gcc|llvm_gcc|clang)
  3420. add_cppflags --sysroot="$sysroot"
  3421. add_ldflags --sysroot="$sysroot"
  3422. # On Darwin --sysroot may be ignored, -isysroot always affects headers and linking
  3423. add_cppflags -isysroot "$sysroot"
  3424. add_ldflags -isysroot "$sysroot"
  3425. ;;
  3426. tms470)
  3427. add_cppflags -I"$sysinclude"
  3428. add_ldflags --sysroot="$sysroot"
  3429. ;;
  3430. esac
  3431. fi
  3432. if test "$cpu" = host; then
  3433. enabled cross_compile &&
  3434. die "--cpu=host makes no sense when cross-compiling."
  3435. case "$cc_type" in
  3436. gcc|llvm_gcc)
  3437. check_native(){
  3438. $cc $1=native -v -c -o $TMPO $TMPC >$TMPE 2>&1 || return
  3439. sed -n "/cc1.*$1=/{
  3440. s/.*$1=\\([^ ]*\\).*/\\1/
  3441. p
  3442. q
  3443. }" $TMPE
  3444. }
  3445. cpu=$(check_native -march || check_native -mcpu)
  3446. ;;
  3447. esac
  3448. test "${cpu:-host}" = host &&
  3449. die "--cpu=host not supported with compiler $cc"
  3450. fi
  3451. # Deal with common $arch aliases
  3452. case "$arch" in
  3453. aarch64|arm64)
  3454. arch="aarch64"
  3455. ;;
  3456. arm*|iPad*|iPhone*)
  3457. arch="arm"
  3458. ;;
  3459. mips*|IP*)
  3460. arch="mips"
  3461. ;;
  3462. parisc*|hppa*)
  3463. arch="parisc"
  3464. ;;
  3465. "Power Macintosh"|ppc*|powerpc*)
  3466. arch="ppc"
  3467. ;;
  3468. s390|s390x)
  3469. arch="s390"
  3470. ;;
  3471. sh4|sh)
  3472. arch="sh4"
  3473. ;;
  3474. sun4u|sparc*)
  3475. arch="sparc"
  3476. ;;
  3477. tilegx|tile-gx)
  3478. arch="tilegx"
  3479. ;;
  3480. i[3-6]86*|i86pc|BePC|x86pc|x86_64|x86_32|amd64)
  3481. arch="x86"
  3482. ;;
  3483. esac
  3484. is_in $arch $ARCH_LIST || warn "unknown architecture $arch"
  3485. enable $arch
  3486. # Add processor-specific flags
  3487. if enabled aarch64; then
  3488. case $cpu in
  3489. armv*)
  3490. cpuflags="-march=$cpu"
  3491. ;;
  3492. *)
  3493. cpuflags="-mcpu=$cpu"
  3494. ;;
  3495. esac
  3496. elif enabled alpha; then
  3497. cpuflags="-mcpu=$cpu"
  3498. elif enabled arm; then
  3499. check_arm_arch() {
  3500. check_cpp_condition stddef.h \
  3501. "defined __ARM_ARCH_${1}__ || defined __TARGET_ARCH_${2:-$1}" \
  3502. $cpuflags
  3503. }
  3504. probe_arm_arch() {
  3505. if check_arm_arch 4; then echo armv4;
  3506. elif check_arm_arch 4T; then echo armv4t;
  3507. elif check_arm_arch 5; then echo armv5;
  3508. elif check_arm_arch 5E; then echo armv5e;
  3509. elif check_arm_arch 5T; then echo armv5t;
  3510. elif check_arm_arch 5TE; then echo armv5te;
  3511. elif check_arm_arch 5TEJ; then echo armv5te;
  3512. elif check_arm_arch 6; then echo armv6;
  3513. elif check_arm_arch 6J; then echo armv6j;
  3514. elif check_arm_arch 6K; then echo armv6k;
  3515. elif check_arm_arch 6Z; then echo armv6z;
  3516. elif check_arm_arch 6ZK; then echo armv6zk;
  3517. elif check_arm_arch 6T2; then echo armv6t2;
  3518. elif check_arm_arch 7; then echo armv7;
  3519. elif check_arm_arch 7A 7_A; then echo armv7-a;
  3520. elif check_arm_arch 7S; then echo armv7-a;
  3521. elif check_arm_arch 7R 7_R; then echo armv7-r;
  3522. elif check_arm_arch 7M 7_M; then echo armv7-m;
  3523. elif check_arm_arch 7EM 7E_M; then echo armv7-m;
  3524. elif check_arm_arch 8A 8_A; then echo armv8-a;
  3525. fi
  3526. }
  3527. [ "$cpu" = generic ] && cpu=$(probe_arm_arch)
  3528. case $cpu in
  3529. armv*)
  3530. cpuflags="-march=$cpu"
  3531. subarch=$(echo $cpu | sed 's/[^a-z0-9]//g')
  3532. ;;
  3533. *)
  3534. cpuflags="-mcpu=$cpu"
  3535. case $cpu in
  3536. cortex-a*) subarch=armv7a ;;
  3537. cortex-r*) subarch=armv7r ;;
  3538. cortex-m*) enable thumb; subarch=armv7m ;;
  3539. arm11*) subarch=armv6 ;;
  3540. arm[79]*e*|arm9[24]6*|arm96*|arm102[26]) subarch=armv5te ;;
  3541. armv4*|arm7*|arm9[24]*) subarch=armv4 ;;
  3542. *) subarch=$(probe_arm_arch) ;;
  3543. esac
  3544. ;;
  3545. esac
  3546. case "$subarch" in
  3547. armv5t*) enable fast_clz ;;
  3548. armv[6-8]*)
  3549. enable fast_clz
  3550. disabled fast_unaligned || enable fast_unaligned
  3551. ;;
  3552. esac
  3553. elif enabled avr32; then
  3554. case $cpu in
  3555. ap7[02]0[0-2])
  3556. subarch="avr32_ap"
  3557. cpuflags="-mpart=$cpu"
  3558. ;;
  3559. ap)
  3560. subarch="avr32_ap"
  3561. cpuflags="-march=$cpu"
  3562. ;;
  3563. uc3[ab]*)
  3564. subarch="avr32_uc"
  3565. cpuflags="-mcpu=$cpu"
  3566. ;;
  3567. uc)
  3568. subarch="avr32_uc"
  3569. cpuflags="-march=$cpu"
  3570. ;;
  3571. esac
  3572. elif enabled bfin; then
  3573. cpuflags="-mcpu=$cpu"
  3574. elif enabled mips; then
  3575. cpuflags="-march=$cpu"
  3576. case $cpu in
  3577. 24kc)
  3578. disable mips32r5
  3579. disable mips64r6
  3580. disable mipsfpu
  3581. disable mipsdspr1
  3582. disable mipsdspr2
  3583. disable msa
  3584. ;;
  3585. 24kf*)
  3586. disable mips32r5
  3587. disable mips64r6
  3588. disable mipsdspr1
  3589. disable mipsdspr2
  3590. disable msa
  3591. ;;
  3592. 24kec|34kc|1004kc)
  3593. disable mips32r5
  3594. disable mips64r6
  3595. disable mipsfpu
  3596. disable mipsdspr2
  3597. disable msa
  3598. ;;
  3599. 24kef*|34kf*|1004kf*)
  3600. disable mips32r5
  3601. disable mips64r6
  3602. disable mipsdspr2
  3603. disable msa
  3604. ;;
  3605. 74kc)
  3606. disable mips32r5
  3607. disable mips64r6
  3608. disable mipsfpu
  3609. disable msa
  3610. ;;
  3611. 74kf)
  3612. disable mips32r5
  3613. disable mips64r6
  3614. disable msa
  3615. ;;
  3616. p5600)
  3617. disable mips64r6
  3618. disable mipsdspr1
  3619. disable mipsdspr2
  3620. check_cflags "-mtune=p5600"
  3621. ;;
  3622. i6400)
  3623. disable mips32r5
  3624. disable mipsdspr1
  3625. disable mipsdspr2
  3626. disable mipsfpu
  3627. check_cflags "-mtune=i6400 -mabi=64"
  3628. check_ldflags "-mabi=64"
  3629. ;;
  3630. loongson3*)
  3631. disable mipsfpu
  3632. disable mips32r2
  3633. disable mips32r5
  3634. disable mips64r6
  3635. disable mipsdspr1
  3636. disable mipsdspr2
  3637. disable msa
  3638. enable local_aligned_8 local_aligned_16
  3639. enable simd_align_16
  3640. enable fast_64bit
  3641. enable fast_clz
  3642. enable fast_cmov
  3643. enable fast_unaligned
  3644. disable aligned_stack
  3645. cpuflags="-march=loongson3a -mhard-float"
  3646. ;;
  3647. generic)
  3648. disable mips32r5
  3649. disable mips64r6
  3650. disable msa
  3651. ;;
  3652. esac
  3653. elif enabled ppc; then
  3654. disable ldbrx
  3655. disable vsx
  3656. case $(tolower $cpu) in
  3657. 601|ppc601|powerpc601)
  3658. cpuflags="-mcpu=601"
  3659. disable altivec
  3660. ;;
  3661. 603*|ppc603*|powerpc603*)
  3662. cpuflags="-mcpu=603"
  3663. disable altivec
  3664. ;;
  3665. 604*|ppc604*|powerpc604*)
  3666. cpuflags="-mcpu=604"
  3667. disable altivec
  3668. ;;
  3669. g3|75*|ppc75*|powerpc75*)
  3670. cpuflags="-mcpu=750"
  3671. disable altivec
  3672. ;;
  3673. g4|745*|ppc745*|powerpc745*)
  3674. cpuflags="-mcpu=7450"
  3675. ;;
  3676. 74*|ppc74*|powerpc74*)
  3677. cpuflags="-mcpu=7400"
  3678. ;;
  3679. g5|970|ppc970|powerpc970)
  3680. cpuflags="-mcpu=970"
  3681. ;;
  3682. power[3-8]*)
  3683. cpuflags="-mcpu=$cpu"
  3684. ;;
  3685. cell)
  3686. cpuflags="-mcpu=cell"
  3687. enable ldbrx
  3688. ;;
  3689. e500mc)
  3690. cpuflags="-mcpu=e500mc"
  3691. disable altivec
  3692. ;;
  3693. e500v2)
  3694. cpuflags="-mcpu=8548 -mhard-float -mfloat-gprs=double"
  3695. disable altivec
  3696. disable dcbzl
  3697. ;;
  3698. e500)
  3699. cpuflags="-mcpu=8540 -mhard-float"
  3700. disable altivec
  3701. disable dcbzl
  3702. ;;
  3703. esac
  3704. elif enabled sparc; then
  3705. case $cpu in
  3706. cypress|f93[04]|tsc701|sparcl*|supersparc|hypersparc|niagara|v[789])
  3707. cpuflags="-mcpu=$cpu"
  3708. ;;
  3709. ultrasparc*|niagara[234])
  3710. cpuflags="-mcpu=$cpu"
  3711. ;;
  3712. esac
  3713. elif enabled x86; then
  3714. case $cpu in
  3715. i[345]86|pentium)
  3716. cpuflags="-march=$cpu"
  3717. disable i686
  3718. disable mmx
  3719. ;;
  3720. # targets that do NOT support nopl and conditional mov (cmov)
  3721. pentium-mmx|k6|k6-[23]|winchip-c6|winchip2|c3)
  3722. cpuflags="-march=$cpu"
  3723. disable i686
  3724. ;;
  3725. # targets that do support nopl and conditional mov (cmov)
  3726. i686|pentiumpro|pentium[23]|pentium-m|athlon|athlon-tbird|athlon-4|athlon-[mx]p|athlon64*|k8*|opteron*|athlon-fx\
  3727. |core*|atom|bonnell|nehalem|westmere|silvermont|sandybridge|ivybridge|haswell|broadwell|amdfam10|barcelona|b[dt]ver*)
  3728. cpuflags="-march=$cpu"
  3729. enable i686
  3730. enable fast_cmov
  3731. ;;
  3732. # targets that do support conditional mov but on which it's slow
  3733. pentium4|pentium4m|prescott|nocona)
  3734. cpuflags="-march=$cpu"
  3735. enable i686
  3736. disable fast_cmov
  3737. ;;
  3738. esac
  3739. fi
  3740. if [ "$cpu" != generic ]; then
  3741. add_cflags $cpuflags
  3742. add_asflags $cpuflags
  3743. fi
  3744. # compiler sanity check
  3745. check_exec <<EOF
  3746. int main(void){ return 0; }
  3747. EOF
  3748. if test "$?" != 0; then
  3749. echo "$cc is unable to create an executable file."
  3750. if test -z "$cross_prefix" && ! enabled cross_compile ; then
  3751. echo "If $cc is a cross-compiler, use the --enable-cross-compile option."
  3752. echo "Only do this if you know what cross compiling means."
  3753. fi
  3754. die "C compiler test failed."
  3755. fi
  3756. add_cppflags -D_ISOC99_SOURCE
  3757. add_cxxflags -D__STDC_CONSTANT_MACROS
  3758. check_cflags -std=c99
  3759. check_cc -D_FILE_OFFSET_BITS=64 <<EOF && add_cppflags -D_FILE_OFFSET_BITS=64
  3760. #include <stdlib.h>
  3761. EOF
  3762. check_cc -D_LARGEFILE_SOURCE <<EOF && add_cppflags -D_LARGEFILE_SOURCE
  3763. #include <stdlib.h>
  3764. EOF
  3765. add_host_cppflags -D_ISOC99_SOURCE
  3766. check_host_cflags -std=c99
  3767. check_host_cflags -Wall
  3768. check_host_cflags -O3
  3769. check_64bit(){
  3770. arch32=$1
  3771. arch64=$2
  3772. expr=$3
  3773. check_code cc "" "int test[2*($expr) - 1]" &&
  3774. subarch=$arch64 || subarch=$arch32
  3775. }
  3776. case "$arch" in
  3777. aarch64|alpha|ia64)
  3778. spic=$shared
  3779. ;;
  3780. mips)
  3781. check_64bit mips mips64 '_MIPS_SIM > 1'
  3782. spic=$shared
  3783. ;;
  3784. parisc)
  3785. check_64bit parisc parisc64 'sizeof(void *) > 4'
  3786. spic=$shared
  3787. ;;
  3788. ppc)
  3789. check_64bit ppc ppc64 'sizeof(void *) > 4'
  3790. spic=$shared
  3791. ;;
  3792. s390)
  3793. check_64bit s390 s390x 'sizeof(void *) > 4'
  3794. spic=$shared
  3795. ;;
  3796. sparc)
  3797. check_64bit sparc sparc64 'sizeof(void *) > 4'
  3798. spic=$shared
  3799. ;;
  3800. x86)
  3801. check_64bit x86_32 x86_64 'sizeof(void *) > 4'
  3802. # Treat x32 as x64 for now. Note it also needs spic=$shared
  3803. test "$subarch" = "x86_32" && check_cpp_condition stddef.h 'defined(__x86_64__)' &&
  3804. subarch=x86_64
  3805. if test "$subarch" = "x86_64"; then
  3806. spic=$shared
  3807. fi
  3808. ;;
  3809. ppc)
  3810. check_cc <<EOF && subarch="ppc64"
  3811. int test[(int)sizeof(char*) - 7];
  3812. EOF
  3813. ;;
  3814. esac
  3815. enable $subarch
  3816. enabled spic && enable_weak pic
  3817. # OS specific
  3818. case $target_os in
  3819. aix)
  3820. SHFLAGS=-shared
  3821. add_cppflags '-I\$(SRC_PATH)/compat/aix'
  3822. enabled shared && add_ldflags -Wl,-brtl
  3823. ;;
  3824. android)
  3825. disable symver
  3826. enable section_data_rel_ro
  3827. SLIB_INSTALL_NAME='$(SLIBNAME)'
  3828. SLIB_INSTALL_LINKS=
  3829. # soname not set on purpose
  3830. SHFLAGS=-shared
  3831. ;;
  3832. haiku)
  3833. prefix_default="/boot/common"
  3834. network_extralibs="-lnetwork"
  3835. host_libs=
  3836. ;;
  3837. sunos)
  3838. SHFLAGS='-shared -Wl,-h,$$(@F)'
  3839. enabled x86 && SHFLAGS="-mimpure-text $SHFLAGS"
  3840. network_extralibs="-lsocket -lnsl"
  3841. add_cppflags -D__EXTENSIONS__
  3842. # When using suncc to build, the Solaris linker will mark
  3843. # an executable with each instruction set encountered by
  3844. # the Solaris assembler. As our libraries contain their own
  3845. # guards for processor-specific code, instead suppress
  3846. # generation of the HWCAPS ELF section on Solaris x86 only.
  3847. enabled_all suncc x86 &&
  3848. echo "hwcap_1 = OVERRIDE;" > mapfile &&
  3849. add_ldflags -Wl,-M,mapfile
  3850. nm_default='nm -P -g'
  3851. ;;
  3852. netbsd)
  3853. disable symver
  3854. oss_indev_extralibs="-lossaudio"
  3855. oss_outdev_extralibs="-lossaudio"
  3856. enabled gcc || check_ldflags -Wl,-zmuldefs
  3857. ;;
  3858. openbsd|bitrig)
  3859. disable symver
  3860. SHFLAGS='-shared'
  3861. SLIB_INSTALL_NAME='$(SLIBNAME).$(LIBMAJOR).$(LIBMINOR)'
  3862. SLIB_INSTALL_LINKS=
  3863. oss_indev_extralibs="-lossaudio"
  3864. oss_outdev_extralibs="-lossaudio"
  3865. ;;
  3866. dragonfly)
  3867. disable symver
  3868. ;;
  3869. freebsd)
  3870. ;;
  3871. bsd/os)
  3872. add_extralibs -lpoll -lgnugetopt
  3873. strip="strip -d"
  3874. ;;
  3875. darwin)
  3876. enabled ppc && add_asflags -force_cpusubtype_ALL
  3877. SHFLAGS='-dynamiclib -Wl,-single_module -Wl,-install_name,$(SHLIBDIR)/$(SLIBNAME_WITH_MAJOR),-current_version,$(LIBVERSION),-compatibility_version,$(LIBMAJOR)'
  3878. enabled x86_32 && append SHFLAGS -Wl,-read_only_relocs,suppress
  3879. strip="${strip} -x"
  3880. add_ldflags -Wl,-dynamic,-search_paths_first
  3881. SLIBSUF=".dylib"
  3882. SLIBNAME_WITH_VERSION='$(SLIBPREF)$(FULLNAME).$(LIBVERSION)$(SLIBSUF)'
  3883. SLIBNAME_WITH_MAJOR='$(SLIBPREF)$(FULLNAME).$(LIBMAJOR)$(SLIBSUF)'
  3884. objformat="macho"
  3885. enabled x86_64 && objformat="macho64"
  3886. enabled_any pic shared x86_64 ||
  3887. { check_cflags -mdynamic-no-pic && add_asflags -mdynamic-no-pic; }
  3888. ;;
  3889. mingw32*)
  3890. if test $target_os = "mingw32ce"; then
  3891. disable network
  3892. else
  3893. target_os=mingw32
  3894. fi
  3895. LIBTARGET=i386
  3896. if enabled x86_64; then
  3897. LIBTARGET="i386:x86-64"
  3898. elif enabled arm; then
  3899. LIBTARGET=arm-wince
  3900. fi
  3901. enabled shared && ! enabled small && check_cmd $windres --version && enable gnu_windres
  3902. check_ldflags -Wl,--nxcompat
  3903. check_ldflags -Wl,--dynamicbase
  3904. enabled x86_32 && check_ldflags -Wl,--large-address-aware
  3905. shlibdir_default="$bindir_default"
  3906. SLIBPREF=""
  3907. SLIBSUF=".dll"
  3908. SLIBNAME_WITH_VERSION='$(SLIBPREF)$(FULLNAME)-$(LIBVERSION)$(SLIBSUF)'
  3909. SLIBNAME_WITH_MAJOR='$(SLIBPREF)$(FULLNAME)-$(LIBMAJOR)$(SLIBSUF)'
  3910. dlltool="${cross_prefix}dlltool"
  3911. if check_cmd lib.exe -list; then
  3912. SLIB_EXTRA_CMD=-'sed -e "s/ @[^ ]*//" $$(@:$(SLIBSUF)=.orig.def) > $$(@:$(SLIBSUF)=.def); lib.exe /machine:$(LIBTARGET) /def:$$(@:$(SLIBSUF)=.def) /out:$(SUBDIR)$(SLIBNAME:$(SLIBSUF)=.lib)'
  3913. if enabled x86_64; then
  3914. LIBTARGET=x64
  3915. fi
  3916. elif check_cmd $dlltool --version; then
  3917. SLIB_EXTRA_CMD=-'sed -e "s/ @[^ ]*//" $$(@:$(SLIBSUF)=.orig.def) > $$(@:$(SLIBSUF)=.def); $(DLLTOOL) -m $(LIBTARGET) -d $$(@:$(SLIBSUF)=.def) -l $(SUBDIR)$(SLIBNAME:$(SLIBSUF)=.lib) -D $(SLIBNAME_WITH_MAJOR)'
  3918. fi
  3919. SLIB_INSTALL_NAME='$(SLIBNAME_WITH_MAJOR)'
  3920. SLIB_INSTALL_LINKS=
  3921. SLIB_INSTALL_EXTRA_SHLIB='$(SLIBNAME:$(SLIBSUF)=.lib)'
  3922. SLIB_INSTALL_EXTRA_LIB='lib$(SLIBNAME:$(SLIBSUF)=.dll.a) $(SLIBNAME_WITH_MAJOR:$(SLIBSUF)=.def)'
  3923. SHFLAGS='-shared -Wl,--output-def,$$(@:$(SLIBSUF)=.orig.def) -Wl,--out-implib,$(SUBDIR)lib$(SLIBNAME:$(SLIBSUF)=.dll.a) -Wl,--enable-runtime-pseudo-reloc -Wl,--enable-auto-image-base'
  3924. objformat="win32"
  3925. ranlib=:
  3926. enable dos_paths
  3927. ;;
  3928. win32|win64)
  3929. disable symver
  3930. if enabled shared; then
  3931. # Link to the import library instead of the normal static library
  3932. # for shared libs.
  3933. LD_LIB='%.lib'
  3934. # Cannot build both shared and static libs with MSVC or icl.
  3935. disable static
  3936. fi
  3937. enabled x86_32 && check_ldflags -LARGEADDRESSAWARE
  3938. shlibdir_default="$bindir_default"
  3939. SLIBPREF=""
  3940. SLIBSUF=".dll"
  3941. SLIBNAME_WITH_VERSION='$(SLIBPREF)$(FULLNAME)-$(LIBVERSION)$(SLIBSUF)'
  3942. SLIBNAME_WITH_MAJOR='$(SLIBPREF)$(FULLNAME)-$(LIBMAJOR)$(SLIBSUF)'
  3943. SLIB_CREATE_DEF_CMD='$(SRC_PATH)/compat/windows/makedef $(SUBDIR)lib$(NAME).ver $(OBJS) > $$(@:$(SLIBSUF)=.def)'
  3944. SLIB_INSTALL_NAME='$(SLIBNAME_WITH_MAJOR)'
  3945. SLIB_INSTALL_LINKS=
  3946. SLIB_INSTALL_EXTRA_SHLIB='$(SLIBNAME:$(SLIBSUF)=.lib)'
  3947. SLIB_INSTALL_EXTRA_LIB='$(SLIBNAME_WITH_MAJOR:$(SLIBSUF)=.def)'
  3948. SHFLAGS='-dll -def:$$(@:$(SLIBSUF)=.def) -implib:$(SUBDIR)$(SLIBNAME:$(SLIBSUF)=.lib)'
  3949. objformat="win32"
  3950. ranlib=:
  3951. enable dos_paths
  3952. ;;
  3953. cygwin*)
  3954. target_os=cygwin
  3955. shlibdir_default="$bindir_default"
  3956. SLIBPREF="cyg"
  3957. SLIBSUF=".dll"
  3958. SLIBNAME_WITH_VERSION='$(SLIBPREF)$(FULLNAME)-$(LIBVERSION)$(SLIBSUF)'
  3959. SLIBNAME_WITH_MAJOR='$(SLIBPREF)$(FULLNAME)-$(LIBMAJOR)$(SLIBSUF)'
  3960. SLIB_INSTALL_NAME='$(SLIBNAME_WITH_MAJOR)'
  3961. SLIB_INSTALL_LINKS=
  3962. SLIB_INSTALL_EXTRA_LIB='lib$(FULLNAME).dll.a'
  3963. SHFLAGS='-shared -Wl,--out-implib,$(SUBDIR)lib$(FULLNAME).dll.a'
  3964. objformat="win32"
  3965. enable dos_paths
  3966. enabled shared && ! enabled small && check_cmd $windres --version && enable gnu_windres
  3967. ;;
  3968. *-dos|freedos|opendos)
  3969. network_extralibs="-lsocket"
  3970. objformat="coff"
  3971. enable dos_paths
  3972. add_cppflags -U__STRICT_ANSI__
  3973. ;;
  3974. linux)
  3975. enable dv1394
  3976. enable section_data_rel_ro
  3977. ;;
  3978. irix*)
  3979. target_os=irix
  3980. ranlib="echo ignoring ranlib"
  3981. ;;
  3982. os/2*)
  3983. strip="lxlite -CS"
  3984. ln_s="cp -f"
  3985. objformat="aout"
  3986. add_cppflags -D_GNU_SOURCE
  3987. add_ldflags -Zomf -Zbin-files -Zargs-wild -Zmap
  3988. SHFLAGS='$(SUBDIR)$(NAME).def -Zdll -Zomf'
  3989. LIBSUF="_s.a"
  3990. SLIBPREF=""
  3991. SLIBSUF=".dll"
  3992. SLIBNAME_WITH_VERSION='$(SLIBPREF)$(NAME)-$(LIBVERSION)$(SLIBSUF)'
  3993. SLIBNAME_WITH_MAJOR='$(SLIBPREF)$(shell echo $(NAME) | cut -c1-6)$(LIBMAJOR)$(SLIBSUF)'
  3994. SLIB_CREATE_DEF_CMD='echo LIBRARY $(SLIBNAME_WITH_MAJOR) INITINSTANCE TERMINSTANCE > $(SUBDIR)$(NAME).def; \
  3995. echo CODE PRELOAD MOVEABLE DISCARDABLE >> $(SUBDIR)$(NAME).def; \
  3996. echo DATA PRELOAD MOVEABLE MULTIPLE NONSHARED >> $(SUBDIR)$(NAME).def; \
  3997. echo EXPORTS >> $(SUBDIR)$(NAME).def; \
  3998. emxexp $(OBJS) >> $(SUBDIR)$(NAME).def'
  3999. SLIB_EXTRA_CMD='emximp -o $(SUBDIR)$(LIBPREF)$(NAME)_dll.a $(SUBDIR)$(NAME).def; \
  4000. emximp -o $(SUBDIR)$(LIBPREF)$(NAME)_dll.lib $(SUBDIR)$(NAME).def;'
  4001. SLIB_INSTALL_EXTRA_LIB='$(LIBPREF)$(NAME)_dll.a $(LIBPREF)$(NAME)_dll.lib'
  4002. enable dos_paths
  4003. enable_weak os2threads
  4004. ;;
  4005. gnu/kfreebsd)
  4006. add_cppflags -D_BSD_SOURCE
  4007. ;;
  4008. gnu)
  4009. ;;
  4010. qnx)
  4011. add_cppflags -D_QNX_SOURCE
  4012. network_extralibs="-lsocket"
  4013. ;;
  4014. symbian)
  4015. SLIBSUF=".dll"
  4016. enable dos_paths
  4017. add_cflags --include=$sysinclude/gcce/gcce.h -fvisibility=default
  4018. add_cppflags -D__GCCE__ -D__SYMBIAN32__ -DSYMBIAN_OE_POSIX_SIGNALS
  4019. add_ldflags -Wl,--target1-abs,--no-undefined \
  4020. -Wl,-Ttext,0x80000,-Tdata,0x1000000 -shared \
  4021. -Wl,--entry=_E32Startup -Wl,-u,_E32Startup
  4022. add_extralibs -l:eexe.lib -l:usrt2_2.lib -l:dfpaeabi.dso \
  4023. -l:drtaeabi.dso -l:scppnwdl.dso -lsupc++ -lgcc \
  4024. -l:libc.dso -l:libm.dso -l:euser.dso -l:libcrt0.lib
  4025. ;;
  4026. osf1)
  4027. add_cppflags -D_OSF_SOURCE -D_POSIX_PII -D_REENTRANT
  4028. ;;
  4029. minix)
  4030. ;;
  4031. plan9)
  4032. add_cppflags -D_C99_SNPRINTF_EXTENSION \
  4033. -D_REENTRANT_SOURCE \
  4034. -D_RESEARCH_SOURCE \
  4035. -DFD_SETSIZE=96 \
  4036. -DHAVE_SOCK_OPTS
  4037. add_compat strtod.o strtod=avpriv_strtod
  4038. network_extralibs='-lbsd'
  4039. exeobjs=compat/plan9/main.o
  4040. disable ffserver
  4041. cp_f='cp'
  4042. ;;
  4043. none)
  4044. ;;
  4045. *)
  4046. die "Unknown OS '$target_os'."
  4047. ;;
  4048. esac
  4049. # determine libc flavour
  4050. probe_libc(){
  4051. pfx=$1
  4052. pfx_no_=${pfx%_}
  4053. # uclibc defines __GLIBC__, so it needs to be checked before glibc.
  4054. if check_${pfx}cpp_condition features.h "defined __UCLIBC__"; then
  4055. eval ${pfx}libc_type=uclibc
  4056. add_${pfx}cppflags -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600
  4057. elif check_${pfx}cpp_condition features.h "defined __GLIBC__"; then
  4058. eval ${pfx}libc_type=glibc
  4059. add_${pfx}cppflags -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600
  4060. # MinGW headers can be installed on Cygwin, so check for newlib first.
  4061. elif check_${pfx}cpp_condition newlib.h "defined _NEWLIB_VERSION"; then
  4062. eval ${pfx}libc_type=newlib
  4063. add_${pfx}cppflags -U__STRICT_ANSI__
  4064. # MinGW64 is backwards compatible with MinGW32, so check for it first.
  4065. elif check_${pfx}cpp_condition _mingw.h "defined __MINGW64_VERSION_MAJOR"; then
  4066. eval ${pfx}libc_type=mingw64
  4067. if check_${pfx}cpp_condition _mingw.h "__MINGW64_VERSION_MAJOR < 3"; then
  4068. add_compat msvcrt/snprintf.o
  4069. add_cflags "-include $source_path/compat/msvcrt/snprintf.h"
  4070. fi
  4071. add_${pfx}cppflags -U__STRICT_ANSI__ -D__USE_MINGW_ANSI_STDIO=1
  4072. eval test \$${pfx_no_}cc_type = "gcc" &&
  4073. add_${pfx}cppflags -D__printf__=__gnu_printf__
  4074. elif check_${pfx}cpp_condition _mingw.h "defined __MINGW_VERSION" ||
  4075. check_${pfx}cpp_condition _mingw.h "defined __MINGW32_VERSION"; then
  4076. eval ${pfx}libc_type=mingw32
  4077. check_${pfx}cpp_condition _mingw.h "__MINGW32_MAJOR_VERSION > 3 || \
  4078. (__MINGW32_MAJOR_VERSION == 3 && __MINGW32_MINOR_VERSION >= 15)" ||
  4079. die "ERROR: MinGW32 runtime version must be >= 3.15."
  4080. add_${pfx}cppflags -U__STRICT_ANSI__ -D__USE_MINGW_ANSI_STDIO=1
  4081. eval test \$${pfx_no_}cc_type = "gcc" &&
  4082. add_${pfx}cppflags -D__printf__=__gnu_printf__
  4083. elif check_${pfx}cpp_condition crtversion.h "defined _VC_CRT_MAJOR_VERSION"; then
  4084. eval ${pfx}libc_type=msvcrt
  4085. # The MSVC 2010 headers (Win 7.0 SDK) set _WIN32_WINNT to
  4086. # 0x601 by default unless something else is set by the user.
  4087. # This can easily lead to us detecting functions only present
  4088. # in such new versions and producing binaries requiring windows 7.0.
  4089. # Therefore explicitly set the default to XP unless the user has
  4090. # set something else on the command line.
  4091. check_${pfx}cpp_condition stdlib.h "defined(_WIN32_WINNT)" ||
  4092. add_${pfx}cppflags -D_WIN32_WINNT=0x0502
  4093. elif check_${pfx}cpp_condition stddef.h "defined __KLIBC__"; then
  4094. eval ${pfx}libc_type=klibc
  4095. elif check_${pfx}cpp_condition sys/cdefs.h "defined __BIONIC__"; then
  4096. eval ${pfx}libc_type=bionic
  4097. elif check_${pfx}cpp_condition sys/brand.h "defined LABELED_BRAND_NAME"; then
  4098. eval ${pfx}libc_type=solaris
  4099. add_${pfx}cppflags -D__EXTENSIONS__ -D_XOPEN_SOURCE=600
  4100. fi
  4101. check_${pfx}cc <<EOF
  4102. #include <time.h>
  4103. void *v = localtime_r;
  4104. EOF
  4105. test "$?" != 0 && check_${pfx}cc -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600 <<EOF && add_${pfx}cppflags -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600
  4106. #include <time.h>
  4107. void *v = localtime_r;
  4108. EOF
  4109. }
  4110. probe_libc
  4111. test -n "$libc_type" && enable libc_$libc_type
  4112. probe_libc host_
  4113. test -n "$host_libc_type" && enable host_libc_$host_libc_type
  4114. case $libc_type in
  4115. bionic)
  4116. add_compat strtod.o strtod=avpriv_strtod
  4117. ;;
  4118. msvcrt)
  4119. if [ -z "$cl_major_ver" ] || [ $cl_major_ver -le 18 ]; then
  4120. add_compat strtod.o strtod=avpriv_strtod
  4121. add_compat msvcrt/snprintf.o snprintf=avpriv_snprintf \
  4122. _snprintf=avpriv_snprintf \
  4123. vsnprintf=avpriv_vsnprintf
  4124. fi
  4125. ;;
  4126. esac
  4127. # hacks for compiler/libc/os combinations
  4128. if enabled_all tms470 libc_glibc; then
  4129. CPPFLAGS="-I${source_path}/compat/tms470 ${CPPFLAGS}"
  4130. add_cppflags -D__USER_LABEL_PREFIX__=
  4131. add_cppflags -D__builtin_memset=memset
  4132. add_cppflags -D__gnuc_va_list=va_list -D_VA_LIST_DEFINED
  4133. add_cflags -pds=48 # incompatible redefinition of macro
  4134. fi
  4135. if enabled_all ccc libc_glibc; then
  4136. add_ldflags -Wl,-z,now # calls to libots crash without this
  4137. fi
  4138. check_compile_assert flt_lim "float.h limits.h" "DBL_MAX == (double)DBL_MAX" ||
  4139. add_cppflags '-I\$(SRC_PATH)/compat/float'
  4140. esc(){
  4141. echo "$*" | sed 's/%/%25/g;s/:/%3a/g'
  4142. }
  4143. echo "config:$arch:$subarch:$cpu:$target_os:$(esc $cc_ident):$(esc $FFMPEG_CONFIGURATION)" >config.fate
  4144. check_cpp_condition stdlib.h "defined(__PIC__) || defined(__pic__) || defined(PIC)" && enable_weak pic
  4145. set_default libdir
  4146. : ${shlibdir_default:="$libdir"}
  4147. set_default $PATHS_LIST
  4148. set_default nm
  4149. # we need to build at least one lib type
  4150. if ! enabled_any static shared; then
  4151. cat <<EOF
  4152. At least one library type must be built.
  4153. Specify --enable-static to build the static libraries or --enable-shared to
  4154. build the shared libraries as well. To only build the shared libraries specify
  4155. --disable-static in addition to --enable-shared.
  4156. EOF
  4157. exit 1;
  4158. fi
  4159. die_license_disabled() {
  4160. enabled $1 || { enabled $2 && die "$2 is $1 and --enable-$1 is not specified."; }
  4161. }
  4162. die_license_disabled_gpl() {
  4163. enabled $1 || { enabled $2 && die "$2 is incompatible with the gpl and --enable-$1 is not specified."; }
  4164. }
  4165. die_license_disabled gpl frei0r
  4166. die_license_disabled gpl libcdio
  4167. die_license_disabled gpl libsmbclient
  4168. die_license_disabled gpl libutvideo
  4169. die_license_disabled gpl libvidstab
  4170. die_license_disabled gpl libx264
  4171. die_license_disabled gpl libx265
  4172. die_license_disabled gpl libxavs
  4173. die_license_disabled gpl libxvid
  4174. die_license_disabled gpl libzvbi
  4175. die_license_disabled gpl x11grab
  4176. die_license_disabled nonfree libaacplus
  4177. die_license_disabled nonfree libfaac
  4178. die_license_disabled nonfree nvenc
  4179. enabled gpl && die_license_disabled_gpl nonfree libfdk_aac
  4180. enabled gpl && die_license_disabled_gpl nonfree openssl
  4181. die_license_disabled version3 libopencore_amrnb
  4182. die_license_disabled version3 libopencore_amrwb
  4183. die_license_disabled version3 libsmbclient
  4184. die_license_disabled version3 libvo_aacenc
  4185. die_license_disabled version3 libvo_amrwbenc
  4186. enabled version3 && { enabled gpl && enable gplv3 || enable lgplv3; }
  4187. disabled optimizations || check_cflags -fomit-frame-pointer
  4188. enable_weak_pic() {
  4189. disabled pic && return
  4190. enable pic
  4191. add_cppflags -DPIC
  4192. case "$target_os" in
  4193. mingw*|cygwin*)
  4194. ;;
  4195. *)
  4196. add_cflags -fPIC
  4197. ;;
  4198. esac
  4199. add_asflags -fPIC
  4200. }
  4201. enabled pic && enable_weak_pic
  4202. check_cc <<EOF || die "Symbol mangling check failed."
  4203. int ff_extern;
  4204. EOF
  4205. sym=$($nm $TMPO | awk '/ff_extern/{ print substr($0, match($0, /[^ \t]*ff_extern/)) }')
  4206. extern_prefix=${sym%%ff_extern*}
  4207. check_cc <<EOF && enable_weak inline_asm
  4208. void foo(void) { __asm__ volatile ("" ::); }
  4209. EOF
  4210. _restrict=
  4211. for restrict_keyword in restrict __restrict__ __restrict; do
  4212. check_cc <<EOF && _restrict=$restrict_keyword && break
  4213. void foo(char * $restrict_keyword p);
  4214. EOF
  4215. done
  4216. check_cc <<EOF && enable pragma_deprecated
  4217. void foo(void) { _Pragma("GCC diagnostic ignored \"-Wdeprecated-declarations\"") }
  4218. EOF
  4219. check_cc <<EOF && enable attribute_packed
  4220. struct { int x; } __attribute__((packed)) x;
  4221. EOF
  4222. check_cc <<EOF && enable attribute_may_alias
  4223. union { int x; } __attribute__((may_alias)) x;
  4224. EOF
  4225. check_cc <<EOF || die "endian test failed"
  4226. unsigned int endian = 'B' << 24 | 'I' << 16 | 'G' << 8 | 'E';
  4227. EOF
  4228. od -t x1 $TMPO | grep -q '42 *49 *47 *45' && enable bigendian
  4229. if [ "$cpu" = "power7" ] || [ "$cpu" = "power8" ] || enabled ppc64; then
  4230. if ! enabled bigendian && enabled altivec ;then
  4231. enable vsx
  4232. fi
  4233. fi
  4234. check_gas() {
  4235. log "check_gas using '$as' as AS"
  4236. # :vararg is used on aarch64, arm and ppc altivec
  4237. check_as <<EOF || return 1
  4238. .macro m n, y:vararg=0
  4239. \n: .int \y
  4240. .endm
  4241. m x
  4242. EOF
  4243. # .altmacro is only used in arm asm
  4244. ! enabled arm || check_as <<EOF || return 1
  4245. .altmacro
  4246. EOF
  4247. enable gnu_as
  4248. return 0
  4249. }
  4250. if enabled_any arm aarch64 || enabled_all ppc altivec && enabled asm; then
  4251. nogas=:
  4252. enabled_any arm aarch64 && nogas=die
  4253. enabled_all ppc altivec && [ $target_os_default != aix ] && nogas=warn
  4254. as_noop=-v
  4255. case $as_type in
  4256. arm*) gaspp_as_type=armasm; as_noop=-h ;;
  4257. gcc) gaspp_as_type=gas ;;
  4258. *) gaspp_as_type=$as_type ;;
  4259. esac
  4260. [ $target_os = "darwin" ] && gaspp_as_type="apple-$gaspp_as_type"
  4261. test "${as#*gas-preprocessor.pl}" != "$as" ||
  4262. check_cmd gas-preprocessor.pl -arch $arch -as-type $gaspp_as_type -- ${as:=$cc} $as_noop &&
  4263. gas="${gas:=gas-preprocessor.pl} -arch $arch -as-type $gaspp_as_type -- ${as:=$cc}"
  4264. if ! check_gas ; then
  4265. as=${gas:=$as}
  4266. check_gas || \
  4267. $nogas "GNU assembler not found, install/update gas-preprocessor"
  4268. fi
  4269. check_as <<EOF && enable as_func
  4270. .func test
  4271. .endfunc
  4272. EOF
  4273. fi
  4274. check_inline_asm inline_asm_labels '"1:\n"'
  4275. check_inline_asm inline_asm_nonlocal_labels '"Label:\n"'
  4276. if enabled aarch64; then
  4277. enabled armv8 && check_insn armv8 'prfm pldl1strm, [x0]'
  4278. # internal assembler in clang 3.3 does not support this instruction
  4279. enabled neon && check_insn neon 'ext v0.8B, v0.8B, v1.8B, #1'
  4280. enabled vfp && check_insn vfp 'fmadd d0, d0, d1, d2'
  4281. map 'enabled_any ${v}_external ${v}_inline || disable $v' $ARCH_EXT_LIST_ARM
  4282. elif enabled alpha; then
  4283. check_cflags -mieee
  4284. elif enabled arm; then
  4285. check_cpp_condition stddef.h "defined __thumb__" && check_cc <<EOF && enable_weak thumb
  4286. float func(float a, float b){ return a+b; }
  4287. EOF
  4288. enabled thumb && check_cflags -mthumb || check_cflags -marm
  4289. if check_cpp_condition stddef.h "defined __ARM_PCS_VFP"; then
  4290. enable vfp_args
  4291. elif ! check_cpp_condition stddef.h "defined __ARM_PCS || defined __SOFTFP__"; then
  4292. case "${cross_prefix:-$cc}" in
  4293. *hardfloat*) enable vfp_args; fpabi=vfp ;;
  4294. *) check_ld "cc" <<EOF && enable vfp_args && fpabi=vfp || fpabi=soft ;;
  4295. __asm__ (".eabi_attribute 28, 1");
  4296. int main(void) { return 0; }
  4297. EOF
  4298. esac
  4299. warn "Compiler does not indicate floating-point ABI, guessing $fpabi."
  4300. fi
  4301. enabled armv5te && check_insn armv5te 'qadd r0, r0, r0'
  4302. enabled armv6 && check_insn armv6 'sadd16 r0, r0, r0'
  4303. enabled armv6t2 && check_insn armv6t2 'movt r0, #0'
  4304. enabled neon && check_insn neon 'vadd.i16 q0, q0, q0'
  4305. enabled vfp && check_insn vfp 'fadds s0, s0, s0'
  4306. enabled vfpv3 && check_insn vfpv3 'vmov.f32 s0, #1.0'
  4307. enabled setend && check_insn setend 'setend be'
  4308. [ $target_os = linux ] || [ $target_os = android ] ||
  4309. map 'enabled_any ${v}_external ${v}_inline || disable $v' \
  4310. $ARCH_EXT_LIST_ARM
  4311. check_inline_asm asm_mod_q '"add r0, %Q0, %R0" :: "r"((long long)0)'
  4312. check_as <<EOF && enable as_dn_directive
  4313. ra .dn d0.i16
  4314. .unreq ra
  4315. EOF
  4316. # llvm's integrated assembler supports .object_arch from llvm 3.5
  4317. [ "$objformat" = elf ] && check_as <<EOF && enable as_object_arch
  4318. .object_arch armv4
  4319. EOF
  4320. [ $target_os != win32 ] && enabled_all armv6t2 shared !pic && enable_weak_pic
  4321. elif enabled mips; then
  4322. # Enable minimum ISA based on selected options
  4323. if enabled mips64 && (enabled mipsdspr1 || enabled mipsdspr2); then
  4324. add_cflags "-mips64r2"
  4325. add_asflags "-mips64r2"
  4326. elif enabled mips64 && enabled mipsfpu && disabled loongson3; then
  4327. add_cflags "-mips64"
  4328. add_asflags "-mips64"
  4329. elif enabled mipsdspr1 || enabled mipsdspr2; then
  4330. add_cflags "-mips32r2 -mfp32"
  4331. add_asflags "-mips32r2 -mfp32"
  4332. elif enabled mips32r5 || enabled mips64r6; then
  4333. check_cflags "-mfp64"
  4334. check_ldflags "-mfp64"
  4335. fi
  4336. enabled mips32r5 && check_cflags "-mips32r5 -msched-weight -mload-store-pairs -funroll-loops" &&
  4337. check_ldflags "-mips32r5" &&
  4338. check_inline_asm mips32r5 '"ulw $t0, ($t1)"'
  4339. enabled mips64r6 && check_cflags "-mips64r6 -msched-weight -mload-store-pairs -funroll-loops" &&
  4340. check_ldflags "-mips64r6" &&
  4341. check_inline_asm mips64r6 '"aui $t0, $t1, 1"'
  4342. enabled mipsdspr1 && add_cflags "-mdsp" && add_asflags "-mdsp" &&
  4343. check_inline_asm mipsdspr1 '"addu.qb $t0, $t1, $t2"'
  4344. enabled mipsdspr2 && add_cflags "-mdspr2" && add_asflags "-mdspr2" &&
  4345. check_inline_asm mipsdspr2 '"absq_s.qb $t0, $t1"'
  4346. enabled mipsfpu && add_cflags "-mhard-float" && add_asflags "-mhard-float" &&
  4347. check_inline_asm mipsfpu '"madd.d $f0, $f2, $f4, $f6"'
  4348. enabled msa && check_cflags "-mmsa" && check_ldflags "-mmsa" &&
  4349. check_inline_asm msa '"addvi.b $w0, $w1, 1"'
  4350. enabled loongson3 && check_inline_asm loongson3 '"gsldxc1 $f0, 0($2, $3)"'
  4351. enabled mips32r5 && add_asflags "-mips32r5 -mfp64"
  4352. enabled mips64r6 && add_asflags "-mips64r6 -mfp64"
  4353. enabled msa && add_asflags "-mmsa"
  4354. elif enabled parisc; then
  4355. if enabled gcc; then
  4356. case $($cc -dumpversion) in
  4357. 4.[3-9].*) check_cflags -fno-optimize-sibling-calls ;;
  4358. esac
  4359. fi
  4360. elif enabled ppc; then
  4361. enable local_aligned_8 local_aligned_16 local_aligned_32
  4362. check_inline_asm dcbzl '"dcbzl 0, %0" :: "r"(0)'
  4363. check_inline_asm ibm_asm '"add 0, 0, 0"'
  4364. check_inline_asm ppc4xx '"maclhw r10, r11, r12"'
  4365. check_inline_asm xform_asm '"lwzx %1, %y0" :: "Z"(*(int*)0), "r"(0)'
  4366. # AltiVec flags: The FSF version of GCC differs from the Apple version
  4367. if enabled altivec; then
  4368. check_cflags -maltivec -mabi=altivec &&
  4369. { check_header altivec.h && inc_altivec_h="#include <altivec.h>" ; } ||
  4370. check_cflags -faltivec
  4371. # check if our compiler supports Motorola AltiVec C API
  4372. check_cc <<EOF || disable altivec
  4373. $inc_altivec_h
  4374. int main(void) {
  4375. vector signed int v1 = (vector signed int) { 0 };
  4376. vector signed int v2 = (vector signed int) { 1 };
  4377. v1 = vec_add(v1, v2);
  4378. return 0;
  4379. }
  4380. EOF
  4381. enabled altivec || warn "Altivec disabled, possibly missing --cpu flag"
  4382. fi
  4383. if enabled vsx; then
  4384. check_cflags -mvsx
  4385. fi
  4386. elif enabled x86; then
  4387. check_builtin rdtsc intrin.h "__rdtsc()"
  4388. check_builtin mm_empty mmintrin.h "_mm_empty()"
  4389. enable local_aligned_8 local_aligned_16 local_aligned_32
  4390. # check whether EBP is available on x86
  4391. # As 'i' is stored on the stack, this program will crash
  4392. # if the base pointer is used to access it because the
  4393. # base pointer is cleared in the inline assembly code.
  4394. check_exec_crash <<EOF && enable ebp_available
  4395. volatile int i=0;
  4396. __asm__ volatile ("xorl %%ebp, %%ebp" ::: "%ebp");
  4397. return i;
  4398. EOF
  4399. # check whether EBX is available on x86
  4400. check_inline_asm ebx_available '""::"b"(0)' &&
  4401. check_inline_asm ebx_available '"":::"%ebx"'
  4402. # check whether xmm clobbers are supported
  4403. check_inline_asm xmm_clobbers '"":::"%xmm0"'
  4404. check_inline_asm inline_asm_direct_symbol_refs '"movl '$extern_prefix'test, %eax"' ||
  4405. check_inline_asm inline_asm_direct_symbol_refs '"movl '$extern_prefix'test(%rip), %eax"'
  4406. # check whether binutils is new enough to compile SSSE3/MMXEXT
  4407. enabled ssse3 && check_inline_asm ssse3_inline '"pabsw %xmm0, %xmm0"'
  4408. enabled mmxext && check_inline_asm mmxext_inline '"pmaxub %mm0, %mm1"'
  4409. if ! disabled_any asm mmx yasm; then
  4410. if check_cmd $yasmexe --version; then
  4411. enabled x86_64 && yasm_extra="-m amd64"
  4412. yasm_debug="-g dwarf2"
  4413. elif check_cmd nasm -v; then
  4414. yasmexe=nasm
  4415. yasm_debug="-g -F dwarf"
  4416. if enabled x86_64; then
  4417. case "$objformat" in
  4418. elf) objformat=elf64 ;;
  4419. win32) objformat=win64 ;;
  4420. esac
  4421. fi
  4422. fi
  4423. YASMFLAGS="-f $objformat $yasm_extra"
  4424. enabled pic && append YASMFLAGS "-DPIC"
  4425. test -n "$extern_prefix" && append YASMFLAGS "-DPREFIX"
  4426. case "$objformat" in
  4427. elf*) enabled debug && append YASMFLAGS $yasm_debug ;;
  4428. esac
  4429. check_yasm "movbe ecx, [5]" && enable yasm ||
  4430. die "yasm/nasm not found or too old. Use --disable-yasm for a crippled build."
  4431. check_yasm "vextracti128 xmm0, ymm0, 0" || disable avx2_external
  4432. check_yasm "vpmacsdd xmm0, xmm1, xmm2, xmm3" || disable xop_external
  4433. check_yasm "vfmaddps ymm0, ymm1, ymm2, ymm3" || disable fma4_external
  4434. check_yasm "CPU amdnop" || disable cpunop
  4435. fi
  4436. case "$cpu" in
  4437. athlon*|opteron*|k8*|pentium|pentium-mmx|prescott|nocona|atom|geode)
  4438. disable fast_clz
  4439. ;;
  4440. esac
  4441. fi
  4442. check_code cc arm_neon.h "int16x8_t test = vdupq_n_s16(0)" && enable intrinsics_neon
  4443. check_ldflags -Wl,--as-needed
  4444. check_ldflags -Wl,-z,noexecstack
  4445. if check_func dlopen; then
  4446. ldl=
  4447. elif check_func dlopen -ldl; then
  4448. ldl=-ldl
  4449. fi
  4450. frei0r_filter_extralibs='$ldl'
  4451. frei0r_src_filter_extralibs='$ldl'
  4452. ladspa_filter_extralibs='$ldl'
  4453. nvenc_encoder_extralibs='$ldl'
  4454. if ! disabled network; then
  4455. check_func getaddrinfo $network_extralibs
  4456. check_func getservbyport $network_extralibs
  4457. check_func inet_aton $network_extralibs
  4458. check_type netdb.h "struct addrinfo"
  4459. check_type netinet/in.h "struct group_source_req" -D_BSD_SOURCE
  4460. check_type netinet/in.h "struct ip_mreq_source" -D_BSD_SOURCE
  4461. check_type netinet/in.h "struct ipv6_mreq" -D_DARWIN_C_SOURCE
  4462. check_type poll.h "struct pollfd"
  4463. check_type netinet/sctp.h "struct sctp_event_subscribe"
  4464. check_struct "sys/types.h sys/socket.h" "struct sockaddr" sa_len
  4465. check_type netinet/in.h "struct sockaddr_in6"
  4466. check_type "sys/types.h sys/socket.h" "struct sockaddr_storage"
  4467. check_type "sys/types.h sys/socket.h" socklen_t
  4468. # Prefer arpa/inet.h over winsock2
  4469. if check_header arpa/inet.h ; then
  4470. check_func closesocket
  4471. elif check_header winsock2.h ; then
  4472. check_func_headers winsock2.h closesocket -lws2 &&
  4473. network_extralibs="-lws2" ||
  4474. { check_func_headers winsock2.h closesocket -lws2_32 &&
  4475. network_extralibs="-lws2_32"; } || disable winsock2_h network
  4476. check_func_headers ws2tcpip.h getaddrinfo $network_extralibs
  4477. check_type ws2tcpip.h socklen_t
  4478. check_type ws2tcpip.h "struct addrinfo"
  4479. check_type ws2tcpip.h "struct group_source_req"
  4480. check_type ws2tcpip.h "struct ip_mreq_source"
  4481. check_type ws2tcpip.h "struct ipv6_mreq"
  4482. check_type winsock2.h "struct pollfd"
  4483. check_struct winsock2.h "struct sockaddr" sa_len
  4484. check_type ws2tcpip.h "struct sockaddr_in6"
  4485. check_type ws2tcpip.h "struct sockaddr_storage"
  4486. else
  4487. disable network
  4488. fi
  4489. fi
  4490. check_builtin atomic_cas_ptr atomic.h "void **ptr; void *oldval, *newval; atomic_cas_ptr(ptr, oldval, newval)"
  4491. check_builtin atomic_compare_exchange "" "int *ptr, *oldval; int newval; __atomic_compare_exchange_n(ptr, oldval, newval, 0, __ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST)"
  4492. check_builtin machine_rw_barrier mbarrier.h "__machine_rw_barrier()"
  4493. check_builtin MemoryBarrier windows.h "MemoryBarrier()"
  4494. check_builtin sarestart signal.h "SA_RESTART"
  4495. check_builtin sync_val_compare_and_swap "" "int *ptr; int oldval, newval; __sync_val_compare_and_swap(ptr, oldval, newval)"
  4496. check_func_headers malloc.h _aligned_malloc && enable aligned_malloc
  4497. check_func ${malloc_prefix}memalign && enable memalign
  4498. check_func ${malloc_prefix}posix_memalign && enable posix_memalign
  4499. check_func access
  4500. check_func_headers time.h clock_gettime || { check_func_headers time.h clock_gettime -lrt && add_extralibs -lrt && LIBRT="-lrt"; }
  4501. check_func fcntl
  4502. check_func fork
  4503. check_func gethrtime
  4504. check_func getopt
  4505. check_func getrusage
  4506. check_func gettimeofday
  4507. check_func gmtime_r
  4508. check_func isatty
  4509. check_func localtime_r
  4510. check_func mach_absolute_time
  4511. check_func mkstemp
  4512. check_func mmap
  4513. check_func mprotect
  4514. # Solaris has nanosleep in -lrt, OpenSolaris no longer needs that
  4515. check_func_headers time.h nanosleep || { check_func_headers time.h nanosleep -lrt && add_extralibs -lrt && LIBRT="-lrt"; }
  4516. check_func sched_getaffinity
  4517. check_func setrlimit
  4518. check_struct "sys/stat.h" "struct stat" st_mtim.tv_nsec -D_BSD_SOURCE
  4519. check_func strerror_r
  4520. check_func sysconf
  4521. check_func sysctl
  4522. check_func usleep
  4523. check_func_headers conio.h kbhit
  4524. check_func_headers io.h setmode
  4525. check_func_headers lzo/lzo1x.h lzo1x_999_compress
  4526. check_func_headers stdlib.h getenv
  4527. check_func_headers windows.h CoTaskMemFree -lole32
  4528. check_func_headers windows.h GetProcessAffinityMask
  4529. check_func_headers windows.h GetProcessTimes
  4530. check_func_headers windows.h GetSystemTimeAsFileTime
  4531. check_func_headers windows.h MapViewOfFile
  4532. check_func_headers windows.h PeekNamedPipe
  4533. check_func_headers windows.h SetConsoleTextAttribute
  4534. check_func_headers windows.h Sleep
  4535. check_func_headers windows.h VirtualAlloc
  4536. check_struct windows.h "CONDITION_VARIABLE" Ptr
  4537. check_func_headers glob.h glob
  4538. enabled xlib &&
  4539. check_func_headers "X11/Xlib.h X11/extensions/Xvlib.h" XvGetPortAttribute -lXv -lX11 -lXext
  4540. check_header direct.h
  4541. check_header dlfcn.h
  4542. check_header d3d11.h
  4543. check_header dxva.h
  4544. check_header dxva2api.h -D_WIN32_WINNT=0x0600
  4545. check_header io.h
  4546. check_header libcrystalhd/libcrystalhd_if.h
  4547. check_header mach/mach_time.h
  4548. check_header malloc.h
  4549. check_header net/udplite.h
  4550. check_header poll.h
  4551. check_header sys/mman.h
  4552. check_header sys/param.h
  4553. check_header sys/resource.h
  4554. check_header sys/select.h
  4555. check_header sys/time.h
  4556. check_header sys/un.h
  4557. check_header termios.h
  4558. check_header unistd.h
  4559. check_header valgrind/valgrind.h
  4560. check_header vdpau/vdpau.h
  4561. check_header vdpau/vdpau_x11.h
  4562. check_header VideoDecodeAcceleration/VDADecoder.h
  4563. check_header windows.h
  4564. check_header X11/extensions/XvMClib.h
  4565. check_header asm/types.h
  4566. check_lib2 "windows.h shellapi.h" CommandLineToArgvW -lshell32
  4567. check_lib2 "windows.h wincrypt.h" CryptGenRandom -ladvapi32
  4568. check_lib2 "windows.h psapi.h" GetProcessMemoryInfo -lpsapi
  4569. check_struct "sys/time.h sys/resource.h" "struct rusage" ru_maxrss
  4570. check_type "windows.h dxva.h" "DXVA_PicParams_HEVC"
  4571. check_type "windows.h d3d11.h" "ID3D11VideoDecoder"
  4572. if ! disabled w32threads && ! enabled pthreads; then
  4573. check_func_headers "windows.h process.h" _beginthreadex &&
  4574. enable w32threads || disable w32threads
  4575. fi
  4576. # check for some common methods of building with pthread support
  4577. # do this before the optional library checks as some of them require pthreads
  4578. if ! disabled pthreads && ! enabled w32threads && ! enabled os2threads; then
  4579. enable pthreads
  4580. if check_func pthread_join -pthread && check_func pthread_create -pthread; then
  4581. add_cflags -pthread
  4582. add_extralibs -pthread
  4583. elif check_func pthread_join -pthreads && check_func pthread_create -pthreads; then
  4584. add_cflags -pthreads
  4585. add_extralibs -pthreads
  4586. elif check_func pthread_join -ldl -pthread && check_func pthread_create -ldl -pthread; then
  4587. add_cflags -ldl -pthread
  4588. add_extralibs -ldl -pthread
  4589. elif check_func pthread_join -lpthreadGC2 && check_func pthread_create -lpthreadGC2; then
  4590. add_extralibs -lpthreadGC2
  4591. elif check_lib pthread.h pthread_join -lpthread && check_lib pthread.h pthread_create -lpthread; then
  4592. :
  4593. elif ! check_func pthread_join && ! check_func pthread_create; then
  4594. disable pthreads
  4595. fi
  4596. check_code cc "pthread.h" "static pthread_mutex_t atomic_lock = PTHREAD_MUTEX_INITIALIZER" || disable pthreads
  4597. fi
  4598. if enabled pthreads; then
  4599. check_func pthread_cancel
  4600. fi
  4601. disabled zlib || check_lib zlib.h zlibVersion -lz || disable zlib
  4602. disabled bzlib || check_lib2 bzlib.h BZ2_bzlibVersion -lbz2 || disable bzlib
  4603. disabled lzma || check_lib2 lzma.h lzma_version_number -llzma || disable lzma
  4604. check_lib math.h sin -lm && LIBM="-lm"
  4605. disabled crystalhd || check_lib libcrystalhd/libcrystalhd_if.h DtsCrystalHDVersion -lcrystalhd || disable crystalhd
  4606. atan2f_args=2
  4607. ldexpf_args=2
  4608. powf_args=2
  4609. for func in $MATH_FUNCS; do
  4610. eval check_mathfunc $func \${${func}_args:-1}
  4611. done
  4612. # these are off by default, so fail if requested and not available
  4613. enabled avfoundation_indev && { check_header_oc AVFoundation/AVFoundation.h || disable avfoundation_indev; }
  4614. enabled avfoundation_indev && { check_lib2 CoreGraphics/CoreGraphics.h CGGetActiveDisplayList -framework CoreGraphics ||
  4615. check_lib2 ApplicationServices/ApplicationServices.h CGGetActiveDisplayList -framework ApplicationServices; }
  4616. enabled avisynth && { { check_lib2 "windows.h" LoadLibrary; } ||
  4617. { check_lib2 "dlfcn.h" dlopen -ldl; } ||
  4618. die "ERROR: LoadLibrary/dlopen not found for avisynth"; }
  4619. enabled decklink && { check_header DeckLinkAPI.h || die "ERROR: DeckLinkAPI.h header not found"; }
  4620. enabled frei0r && { check_header frei0r.h || die "ERROR: frei0r.h header not found"; }
  4621. enabled gnutls && require_pkg_config gnutls gnutls/gnutls.h gnutls_global_init
  4622. enabled ladspa && { check_header ladspa.h || die "ERROR: ladspa.h header not found"; }
  4623. enabled libiec61883 && require libiec61883 libiec61883/iec61883.h iec61883_cmp_connect -lraw1394 -lavc1394 -lrom1394 -liec61883
  4624. enabled libaacplus && require "libaacplus >= 2.0.0" aacplus.h aacplusEncOpen -laacplus
  4625. enabled libass && require_pkg_config libass ass/ass.h ass_library_init
  4626. enabled libbluray && require_pkg_config libbluray libbluray/bluray.h bd_open
  4627. enabled libbs2b && require_pkg_config libbs2b bs2b.h bs2b_open
  4628. enabled libcelt && require libcelt celt/celt.h celt_decode -lcelt0 &&
  4629. { check_lib celt/celt.h celt_decoder_create_custom -lcelt0 ||
  4630. die "ERROR: libcelt must be installed and version must be >= 0.11.0."; }
  4631. enabled libcaca && require_pkg_config caca caca.h caca_create_canvas
  4632. enabled libdcadec && require_pkg_config dcadec libdcadec/dca_context.h dcadec_context_create
  4633. enabled libfaac && require2 libfaac "stdint.h faac.h" faacEncGetVersion -lfaac
  4634. enabled libfdk_aac && require libfdk_aac fdk-aac/aacenc_lib.h aacEncOpen -lfdk-aac
  4635. flite_libs="-lflite_cmu_time_awb -lflite_cmu_us_awb -lflite_cmu_us_kal -lflite_cmu_us_kal16 -lflite_cmu_us_rms -lflite_cmu_us_slt -lflite_usenglish -lflite_cmulex -lflite"
  4636. enabled libflite && require2 libflite "flite/flite.h" flite_init $flite_libs
  4637. enabled fontconfig && enable libfontconfig
  4638. enabled libfontconfig && require_pkg_config fontconfig "fontconfig/fontconfig.h" FcInit
  4639. enabled libfreetype && require_libfreetype
  4640. enabled libfribidi && require_pkg_config fribidi fribidi.h fribidi_version_info
  4641. enabled libgme && require libgme gme/gme.h gme_new_emu -lgme -lstdc++
  4642. enabled libgsm && { for gsm_hdr in "gsm.h" "gsm/gsm.h"; do
  4643. check_lib "${gsm_hdr}" gsm_create -lgsm && break;
  4644. done || die "ERROR: libgsm not found"; }
  4645. enabled libilbc && require libilbc ilbc.h WebRtcIlbcfix_InitDecode -lilbc
  4646. enabled libmfx && require_pkg_config libmfx "mfx/mfxvideo.h" MFXInit
  4647. enabled libmodplug && require_pkg_config libmodplug libmodplug/modplug.h ModPlug_Load
  4648. enabled libmp3lame && require "libmp3lame >= 3.98.3" lame/lame.h lame_set_VBR_quality -lmp3lame
  4649. enabled libnut && require libnut libnut.h nut_demuxer_init -lnut
  4650. enabled libopencore_amrnb && require libopencore_amrnb opencore-amrnb/interf_dec.h Decoder_Interface_init -lopencore-amrnb
  4651. enabled libopencore_amrwb && require libopencore_amrwb opencore-amrwb/dec_if.h D_IF_init -lopencore-amrwb
  4652. enabled libopencv && require_pkg_config opencv opencv/cxcore.h cvCreateImageHeader
  4653. enabled libopenh264 && require_pkg_config openh264 wels/codec_api.h WelsGetCodecVersion
  4654. enabled libopenjpeg && { check_lib openjpeg.h opj_version -lopenmj2 -DOPJ_STATIC ||
  4655. check_lib openjpeg-1.5/openjpeg.h opj_version -lopenjpeg -DOPJ_STATIC ||
  4656. check_lib openjpeg.h opj_version -lopenjpeg -DOPJ_STATIC ||
  4657. die "ERROR: libopenjpeg not found"; }
  4658. enabled libopus && require_pkg_config opus opus_multistream.h opus_multistream_decoder_create
  4659. enabled libpulse && require_pkg_config libpulse pulse/pulseaudio.h pa_context_new
  4660. enabled libquvi && require_pkg_config libquvi quvi/quvi.h quvi_init
  4661. enabled librtmp && require_pkg_config librtmp librtmp/rtmp.h RTMP_Socket
  4662. enabled libschroedinger && require_pkg_config schroedinger-1.0 schroedinger/schro.h schro_init
  4663. enabled libshine && require_pkg_config shine shine/layer3.h shine_encode_buffer
  4664. enabled libsmbclient && { use_pkg_config smbclient libsmbclient.h smbc_init ||
  4665. require smbclient libsmbclient.h smbc_init -lsmbclient; }
  4666. enabled libsoxr && require libsoxr soxr.h soxr_create -lsoxr
  4667. enabled libssh && require_pkg_config libssh libssh/sftp.h sftp_init
  4668. enabled libspeex && require_pkg_config speex speex/speex.h speex_decoder_init -lspeex
  4669. enabled libstagefright_h264 && require_cpp libstagefright_h264 "binder/ProcessState.h media/stagefright/MetaData.h
  4670. media/stagefright/MediaBufferGroup.h media/stagefright/MediaDebug.h media/stagefright/MediaDefs.h
  4671. media/stagefright/OMXClient.h media/stagefright/OMXCodec.h" android::OMXClient -lstagefright -lmedia -lutils -lbinder -lgnustl_static
  4672. enabled libtheora && require libtheora theora/theoraenc.h th_info_init -ltheoraenc -ltheoradec -logg
  4673. enabled libtwolame && require libtwolame twolame.h twolame_init -ltwolame &&
  4674. { check_lib twolame.h twolame_encode_buffer_float32_interleaved -ltwolame ||
  4675. die "ERROR: libtwolame must be installed and version must be >= 0.3.10"; }
  4676. enabled libutvideo && require_cpp utvideo "stdint.h stdlib.h utvideo/utvideo.h utvideo/Codec.h" 'CCodec*' -lutvideo -lstdc++
  4677. enabled libv4l2 && require_pkg_config libv4l2 libv4l2.h v4l2_ioctl
  4678. enabled libvidstab && require_pkg_config "vidstab >= 0.98" vid.stab/libvidstab.h vsMotionDetectInit
  4679. enabled libvo_aacenc && require libvo_aacenc vo-aacenc/voAAC.h voGetAACEncAPI -lvo-aacenc
  4680. enabled libvo_amrwbenc && require libvo_amrwbenc vo-amrwbenc/enc_if.h E_IF_init -lvo-amrwbenc
  4681. enabled libvorbis && require libvorbis vorbis/vorbisenc.h vorbis_info_init -lvorbisenc -lvorbis -logg
  4682. enabled libvpx && {
  4683. enabled libvpx_vp8_decoder && { check_lib2 "vpx/vpx_decoder.h vpx/vp8dx.h" vpx_codec_dec_init_ver -lvpx ||
  4684. die "ERROR: libvpx decoder version must be >=0.9.1"; }
  4685. enabled libvpx_vp8_encoder && { check_lib2 "vpx/vpx_encoder.h vpx/vp8cx.h" "vpx_codec_enc_init_ver VP8E_SET_MAX_INTRA_BITRATE_PCT" -lvpx ||
  4686. die "ERROR: libvpx encoder version must be >=0.9.7"; }
  4687. enabled libvpx_vp9_decoder && { check_lib2 "vpx/vpx_decoder.h vpx/vp8dx.h" "vpx_codec_vp9_dx" -lvpx || disable libvpx_vp9_decoder; }
  4688. enabled libvpx_vp9_encoder && { check_lib2 "vpx/vpx_encoder.h vpx/vp8cx.h" "vpx_codec_vp9_cx VP9E_SET_AQ_MODE" -lvpx || disable libvpx_vp9_encoder; } }
  4689. enabled libwavpack && require libwavpack wavpack/wavpack.h WavpackOpenFileOutput -lwavpack
  4690. enabled libwebp && {
  4691. enabled libwebp_encoder && require_pkg_config "libwebp >= 0.2.0" webp/encode.h WebPGetEncoderVersion
  4692. enabled libwebp_anim_encoder && { use_pkg_config "libwebpmux >= 0.4.0" webp/mux.h WebPAnimEncoderOptionsInit || disable libwebp_anim_encoder; } }
  4693. enabled libx264 && { use_pkg_config x264 "stdint.h x264.h" x264_encoder_encode ||
  4694. { require libx264 x264.h x264_encoder_encode -lx264 &&
  4695. warn "using libx264 without pkg-config"; } } &&
  4696. { check_cpp_condition x264.h "X264_BUILD >= 118" ||
  4697. die "ERROR: libx264 must be installed and version must be >= 0.118."; }
  4698. enabled libx265 && require_pkg_config x265 x265.h x265_encoder_encode &&
  4699. { check_cpp_condition x265.h "X265_BUILD >= 57" ||
  4700. die "ERROR: libx265 version must be >= 57."; }
  4701. enabled libxavs && require libxavs xavs.h xavs_encoder_encode -lxavs
  4702. enabled libxvid && require libxvid xvid.h xvid_global -lxvidcore
  4703. enabled libzmq && require_pkg_config libzmq zmq.h zmq_ctx_new
  4704. enabled libzvbi && require libzvbi libzvbi.h vbi_decoder_new -lzvbi
  4705. enabled mmal && { check_lib interface/mmal/mmal.h mmal_port_connect -lmmal_core -lmmal_util -lmmal_vc_client -lbcm_host ||
  4706. { ! enabled cross_compile && {
  4707. add_cflags -isystem/opt/vc/include/ -isystem/opt/vc/include/interface/vmcs_host/linux -isystem/opt/vc/include/interface/vcos/pthreads -fgnu89-inline ;
  4708. add_extralibs -L/opt/vc/lib/ -lmmal_core -lmmal_util -lmmal_vc_client -lbcm_host ;
  4709. check_lib interface/mmal/mmal.h mmal_port_connect ; }
  4710. check_lib interface/mmal/mmal.h mmal_port_connect ; } ||
  4711. die "ERROR: mmal not found"; }
  4712. enabled nvenc && { check_header nvEncodeAPI.h || die "ERROR: nvEncodeAPI.h not found."; } &&
  4713. { check_cpp_condition nvEncodeAPI.h "NVENCAPI_MAJOR_VERSION >= 5" ||
  4714. die "ERROR: NVENC API version 4 or older is not supported"; } &&
  4715. { [ $target_os != cygwin ] || die "ERROR: NVENC is not supported on Cygwin currently."; }
  4716. enabled openal && { { for al_libs in "${OPENAL_LIBS}" "-lopenal" "-lOpenAL32"; do
  4717. check_lib 'AL/al.h' alGetError "${al_libs}" && break; done } ||
  4718. die "ERROR: openal not found"; } &&
  4719. { check_cpp_condition "AL/al.h" "defined(AL_VERSION_1_1)" ||
  4720. die "ERROR: openal must be installed and version must be 1.1 or compatible"; }
  4721. enabled opencl && { check_lib2 OpenCL/cl.h clEnqueueNDRangeKernel -Wl,-framework,OpenCL ||
  4722. check_lib2 CL/cl.h clEnqueueNDRangeKernel -lOpenCL ||
  4723. die "ERROR: opencl not found"; } &&
  4724. { check_cpp_condition "OpenCL/cl.h" "defined(CL_VERSION_1_2)" ||
  4725. check_cpp_condition "CL/cl.h" "defined(CL_VERSION_1_2)" ||
  4726. die "ERROR: opencl must be installed and version must be 1.2 or compatible"; }
  4727. enabled opengl && { check_lib GL/glx.h glXGetProcAddress "-lGL" ||
  4728. check_lib2 windows.h wglGetProcAddress "-lopengl32 -lgdi32" ||
  4729. check_lib2 OpenGL/gl3.h glGetError "-Wl,-framework,OpenGL" ||
  4730. check_lib2 ES2/gl.h glGetError "-isysroot=${sysroot} -Wl,-framework,OpenGLES" ||
  4731. die "ERROR: opengl not found."
  4732. }
  4733. enabled openssl && { check_lib openssl/ssl.h SSL_library_init -lssl -lcrypto ||
  4734. check_lib openssl/ssl.h SSL_library_init -lssl32 -leay32 ||
  4735. check_lib openssl/ssl.h SSL_library_init -lssl -lcrypto -lws2_32 -lgdi32 ||
  4736. die "ERROR: openssl not found"; }
  4737. enabled qtkit_indev && { check_header_oc QTKit/QTKit.h || disable qtkit_indev; }
  4738. if enabled gnutls; then
  4739. { check_lib nettle/bignum.h nettle_mpz_get_str_256 -lnettle -lhogweed -lgmp && enable nettle; } ||
  4740. { check_lib gcrypt.h gcry_mpi_new -lgcrypt && enable gcrypt; }
  4741. fi
  4742. # libdc1394 check
  4743. if enabled libdc1394; then
  4744. { require_pkg_config libdc1394-2 dc1394/dc1394.h dc1394_new &&
  4745. enable libdc1394_2; } ||
  4746. { check_lib libdc1394/dc1394_control.h dc1394_create_handle -ldc1394_control -lraw1394 &&
  4747. enable libdc1394_1; } ||
  4748. die "ERROR: No version of libdc1394 found "
  4749. fi
  4750. if ! disabled sdl; then
  4751. SDL_CONFIG="${cross_prefix}sdl-config"
  4752. if check_pkg_config sdl SDL_events.h SDL_PollEvent; then
  4753. check_cpp_condition SDL.h "(SDL_MAJOR_VERSION<<16 | SDL_MINOR_VERSION<<8 | SDL_PATCHLEVEL) >= 0x010201" $sdl_cflags &&
  4754. check_cpp_condition SDL.h "(SDL_MAJOR_VERSION<<16 | SDL_MINOR_VERSION<<8 | SDL_PATCHLEVEL) < 0x010300" $sdl_cflags &&
  4755. enable sdl
  4756. else
  4757. if "${SDL_CONFIG}" --version > /dev/null 2>&1; then
  4758. sdl_cflags=$("${SDL_CONFIG}" --cflags)
  4759. sdl_libs=$("${SDL_CONFIG}" --libs)
  4760. check_func_headers SDL_version.h SDL_Linked_Version $sdl_cflags $sdl_libs &&
  4761. check_cpp_condition SDL.h "(SDL_MAJOR_VERSION<<16 | SDL_MINOR_VERSION<<8 | SDL_PATCHLEVEL) >= 0x010201" $sdl_cflags &&
  4762. check_cpp_condition SDL.h "(SDL_MAJOR_VERSION<<16 | SDL_MINOR_VERSION<<8 | SDL_PATCHLEVEL) < 0x010300" $sdl_cflags &&
  4763. enable sdl
  4764. elif enabled sdl ; then
  4765. die "ERROR: SDL not found"
  4766. else
  4767. disable sdl
  4768. fi
  4769. fi
  4770. fi
  4771. enabled sdl && add_cflags $sdl_cflags && add_extralibs $sdl_libs
  4772. makeinfo --version > /dev/null 2>&1 && enable makeinfo || disable makeinfo
  4773. enabled makeinfo && (makeinfo --version | \
  4774. grep -q 'makeinfo (GNU texinfo) 5' > /dev/null 2>&1) \
  4775. && enable makeinfo_html || disable makeinfo_html
  4776. disabled makeinfo_html && texi2html --help 2> /dev/null | grep -q 'init-file' && enable texi2html || disable texi2html
  4777. perl -v > /dev/null 2>&1 && enable perl || disable perl
  4778. pod2man --help > /dev/null 2>&1 && enable pod2man || disable pod2man
  4779. rsync --help 2> /dev/null | grep -q 'contimeout' && enable rsync_contimeout || disable rsync_contimeout
  4780. check_header linux/fb.h
  4781. check_header linux/videodev.h
  4782. check_header linux/videodev2.h
  4783. check_code cc linux/videodev2.h "struct v4l2_frmsizeenum vfse; vfse.discrete.width = 0;" && enable_safe struct_v4l2_frmivalenum_discrete
  4784. check_header sys/videoio.h
  4785. check_code cc sys/videoio.h "struct v4l2_frmsizeenum vfse; vfse.discrete.width = 0;" && enable_safe struct_v4l2_frmivalenum_discrete
  4786. check_func_headers "windows.h vfw.h" capCreateCaptureWindow "$vfwcap_indev_extralibs"
  4787. # check that WM_CAP_DRIVER_CONNECT is defined to the proper value
  4788. # w32api 3.12 had it defined wrong
  4789. check_cpp_condition vfw.h "WM_CAP_DRIVER_CONNECT > WM_USER" && enable vfwcap_defines
  4790. check_type "dshow.h" IBaseFilter
  4791. # check for ioctl_meteor.h, ioctl_bt848.h and alternatives
  4792. { check_header dev/bktr/ioctl_meteor.h &&
  4793. check_header dev/bktr/ioctl_bt848.h; } ||
  4794. { check_header machine/ioctl_meteor.h &&
  4795. check_header machine/ioctl_bt848.h; } ||
  4796. { check_header dev/video/meteor/ioctl_meteor.h &&
  4797. check_header dev/video/bktr/ioctl_bt848.h; } ||
  4798. check_header dev/ic/bt8xx.h
  4799. check_header sndio.h
  4800. if check_struct sys/soundcard.h audio_buf_info bytes; then
  4801. enable_safe sys/soundcard.h
  4802. else
  4803. check_cc -D__BSD_VISIBLE -D__XSI_VISIBLE <<EOF && add_cppflags -D__BSD_VISIBLE -D__XSI_VISIBLE && enable_safe sys/soundcard.h
  4804. #include <sys/soundcard.h>
  4805. audio_buf_info abc;
  4806. EOF
  4807. fi
  4808. check_header soundcard.h
  4809. enabled_any alsa_indev alsa_outdev &&
  4810. check_lib2 alsa/asoundlib.h snd_pcm_htimestamp -lasound
  4811. enabled jack_indev && check_lib2 jack/jack.h jack_client_open -ljack && check_func sem_timedwait &&
  4812. check_func jack_port_get_latency_range -ljack
  4813. enabled_any sndio_indev sndio_outdev && check_lib2 sndio.h sio_open -lsndio
  4814. if enabled libcdio; then
  4815. check_lib2 "cdio/cdda.h cdio/paranoia.h" cdio_cddap_open -lcdio_paranoia -lcdio_cdda -lcdio ||
  4816. check_lib2 "cdio/paranoia/cdda.h cdio/paranoia/paranoia.h" cdio_cddap_open -lcdio_paranoia -lcdio_cdda -lcdio ||
  4817. die "ERROR: No usable libcdio/cdparanoia found"
  4818. fi
  4819. enabled xlib &&
  4820. check_lib X11/Xlib.h XOpenDisplay -lX11 || disable xlib
  4821. if ! disabled libxcb; then
  4822. check_pkg_config "xcb >= 1.4" xcb/xcb.h xcb_connect || {
  4823. enabled libxcb && die "ERROR: libxcb >= 1.4 not found";
  4824. } && disable x11grab && enable libxcb
  4825. if enabled libxcb; then
  4826. disabled libxcb_shm || {
  4827. check_pkg_config xcb-shm xcb/shm.h xcb_shm_attach || {
  4828. enabled libxcb_shm && die "ERROR: libxcb_shm not found";
  4829. } && check_header sys/shm.h && enable libxcb_shm; }
  4830. disabled libxcb_xfixes || {
  4831. check_pkg_config xcb-xfixes xcb/xfixes.h xcb_xfixes_get_cursor_image || {
  4832. enabled libxcb_xfixes && die "ERROR: libxcb_xfixes not found";
  4833. } && enable libxcb_xfixes; }
  4834. disabled libxcb_shape || {
  4835. check_pkg_config xcb-shape xcb/shape.h xcb_shape_get_rectangles || {
  4836. enabled libxcb_shape && die "ERROR: libxcb_shape not found";
  4837. } && enable libxcb_shape; }
  4838. add_cflags $xcb_cflags $xcb_shm_cflags $xcb_xfixes_cflags $xcb_shape_cflags
  4839. add_extralibs $xcb_libs $xcb_shm_libs $xcb_xfixes_libs $xcb_shape_libs
  4840. fi
  4841. fi
  4842. if enabled x11grab; then
  4843. enabled xlib || die "ERROR: Xlib not found"
  4844. require Xext X11/extensions/XShm.h XShmCreateImage -lXext
  4845. require Xfixes X11/extensions/Xfixes.h XFixesGetCursorImage -lXfixes
  4846. fi
  4847. check_func_headers "windows.h" CreateDIBSection "$gdigrab_indev_extralibs"
  4848. enabled dxva2api_h &&
  4849. check_cc <<EOF && enable dxva2api_cobj
  4850. #define _WIN32_WINNT 0x0600
  4851. #define COBJMACROS
  4852. #include <windows.h>
  4853. #include <d3d9.h>
  4854. #include <dxva2api.h>
  4855. int main(void) { IDirectXVideoDecoder *o = NULL; IDirectXVideoDecoder_Release(o); return 0; }
  4856. EOF
  4857. enabled d3d11_h &&
  4858. check_cc <<EOF && enable d3d11_cobj
  4859. #define _WIN32_WINNT 0x0600
  4860. #define COBJMACROS
  4861. #include <windows.h>
  4862. #include <d3d11.h>
  4863. int main(void) { ID3D11VideoDecoder *o = NULL; ID3D11VideoDecoder_Release(o); return 0; }
  4864. EOF
  4865. enabled vaapi &&
  4866. check_lib va/va.h vaInitialize -lva ||
  4867. disable vaapi
  4868. enabled vaapi && enabled xlib &&
  4869. check_lib2 "va/va.h va/va_x11.h" vaGetDisplay -lva -lva-x11 &&
  4870. enable vaapi_x11
  4871. enabled vdpau &&
  4872. check_cpp_condition vdpau/vdpau.h "defined VDP_DECODER_PROFILE_MPEG4_PART2_ASP" ||
  4873. disable vdpau
  4874. enabled vdpau && enabled xlib &&
  4875. check_func_headers "vdpau/vdpau.h vdpau/vdpau_x11.h" vdp_device_create_x11 -lvdpau &&
  4876. prepend ffmpeg_libs $($ldflags_filter "-lvdpau") &&
  4877. enable vdpau_x11
  4878. # Funny iconv installations are not unusual, so check it after all flags have been set
  4879. disabled iconv || check_func_headers iconv.h iconv || check_lib2 iconv.h iconv -liconv || disable iconv
  4880. enabled debug && add_cflags -g"$debuglevel" && add_asflags -g"$debuglevel"
  4881. # add some useful compiler flags if supported
  4882. check_cflags -Wdeclaration-after-statement
  4883. check_cflags -Wall
  4884. check_cflags -Wdisabled-optimization
  4885. check_cflags -Wpointer-arith
  4886. check_cflags -Wredundant-decls
  4887. check_cflags -Wwrite-strings
  4888. check_cflags -Wtype-limits
  4889. check_cflags -Wundef
  4890. check_cflags -Wmissing-prototypes
  4891. check_cflags -Wno-pointer-to-int-cast
  4892. check_cflags -Wstrict-prototypes
  4893. check_cflags -Wempty-body
  4894. enabled extra_warnings && check_cflags -Winline
  4895. check_disable_warning(){
  4896. warning_flag=-W${1#-Wno-}
  4897. test_cflags $warning_flag && add_cflags $1
  4898. }
  4899. check_disable_warning -Wno-parentheses
  4900. check_disable_warning -Wno-switch
  4901. check_disable_warning -Wno-format-zero-length
  4902. check_disable_warning -Wno-pointer-sign
  4903. # add some linker flags
  4904. check_ldflags -Wl,--warn-common
  4905. check_ldflags -Wl,-rpath-link=libpostproc:libswresample:libswscale:libavfilter:libavdevice:libavformat:libavcodec:libavutil:libavresample
  4906. enabled rpath && add_ldexeflags -Wl,-rpath,$libdir
  4907. test_ldflags -Wl,-Bsymbolic && append SHFLAGS -Wl,-Bsymbolic
  4908. # add some strip flags
  4909. # -wN '..@*' is more selective than -x, but not available everywhere.
  4910. check_stripflags -wN \'..@*\' || check_stripflags -x
  4911. enabled neon_clobber_test &&
  4912. check_ldflags -Wl,--wrap,avcodec_open2 \
  4913. -Wl,--wrap,avcodec_decode_audio4 \
  4914. -Wl,--wrap,avcodec_decode_video2 \
  4915. -Wl,--wrap,avcodec_decode_subtitle2 \
  4916. -Wl,--wrap,avcodec_encode_audio2 \
  4917. -Wl,--wrap,avcodec_encode_video2 \
  4918. -Wl,--wrap,avcodec_encode_subtitle \
  4919. -Wl,--wrap,swr_convert \
  4920. -Wl,--wrap,avresample_convert ||
  4921. disable neon_clobber_test
  4922. enabled xmm_clobber_test &&
  4923. check_ldflags -Wl,--wrap,avcodec_open2 \
  4924. -Wl,--wrap,avcodec_decode_audio4 \
  4925. -Wl,--wrap,avcodec_decode_video2 \
  4926. -Wl,--wrap,avcodec_decode_subtitle2 \
  4927. -Wl,--wrap,avcodec_encode_audio2 \
  4928. -Wl,--wrap,avcodec_encode_video \
  4929. -Wl,--wrap,avcodec_encode_video2 \
  4930. -Wl,--wrap,avcodec_encode_subtitle \
  4931. -Wl,--wrap,swr_convert \
  4932. -Wl,--wrap,avresample_convert \
  4933. -Wl,--wrap,sws_scale ||
  4934. disable xmm_clobber_test
  4935. echo "X{};" > $TMPV
  4936. if test_ldflags -Wl,--version-script,$TMPV; then
  4937. append SHFLAGS '-Wl,--version-script,\$(SUBDIR)lib\$(NAME).ver'
  4938. check_cc <<EOF && enable symver_asm_label
  4939. void ff_foo(void) __asm__ ("av_foo@VERSION");
  4940. void ff_foo(void) { ${inline_asm+__asm__($quotes);} }
  4941. EOF
  4942. check_cc <<EOF && enable symver_gnu_asm
  4943. __asm__(".symver ff_foo,av_foo@VERSION");
  4944. void ff_foo(void) {}
  4945. EOF
  4946. fi
  4947. if [ -z "$optflags" ]; then
  4948. if enabled small; then
  4949. optflags=$cflags_size
  4950. elif enabled optimizations; then
  4951. optflags=$cflags_speed
  4952. else
  4953. optflags=$cflags_noopt
  4954. fi
  4955. fi
  4956. check_optflags(){
  4957. check_cflags "$@"
  4958. enabled lto && check_ldflags "$@"
  4959. }
  4960. if enabled lto; then
  4961. test "$cc_type" != "$ld_type" && die "LTO requires same compiler and linker"
  4962. check_cflags -flto
  4963. check_ldflags -flto $cpuflags
  4964. disable inline_asm_direct_symbol_refs
  4965. fi
  4966. check_optflags $optflags
  4967. check_optflags -fno-math-errno
  4968. check_optflags -fno-signed-zeros
  4969. enabled ftrapv && check_cflags -ftrapv
  4970. check_cc -mno-red-zone <<EOF && noredzone_flags="-mno-red-zone"
  4971. int x;
  4972. EOF
  4973. if enabled icc; then
  4974. # Just warnings, no remarks
  4975. check_cflags -w1
  4976. # -wd: Disable following warnings
  4977. # 144, 167, 556: -Wno-pointer-sign
  4978. # 188: enumerated type mixed with another type
  4979. # 1292: attribute "foo" ignored
  4980. # 1419: external declaration in primary source file
  4981. # 10006: ignoring unknown option -fno-signed-zeros
  4982. # 10148: ignoring unknown option -Wno-parentheses
  4983. # 10156: ignoring option '-W'; no argument required
  4984. # 13200: No EMMS instruction before call to function
  4985. # 13203: No EMMS instruction before return from function
  4986. check_cflags -wd144,167,188,556,1292,1419,10006,10148,10156,13200,13203
  4987. # 11030: Warning unknown option --as-needed
  4988. # 10156: ignoring option '-export'; no argument required
  4989. check_ldflags -wd10156,11030
  4990. # icc 11.0 and 11.1 work with ebp_available, but don't pass the test
  4991. enable ebp_available
  4992. # The test above does not test linking
  4993. enabled lto && disable symver_asm_label
  4994. if enabled x86_32; then
  4995. icc_version=$($cc -dumpversion)
  4996. test ${icc_version%%.*} -ge 11 &&
  4997. check_cflags -falign-stack=maintain-16-byte ||
  4998. disable aligned_stack
  4999. fi
  5000. elif enabled ccc; then
  5001. # disable some annoying warnings
  5002. add_cflags -msg_disable bitnotint
  5003. add_cflags -msg_disable mixfuncvoid
  5004. add_cflags -msg_disable nonstandcast
  5005. add_cflags -msg_disable unsupieee
  5006. elif enabled gcc; then
  5007. check_optflags -fno-tree-vectorize
  5008. check_cflags -Werror=format-security
  5009. check_cflags -Werror=implicit-function-declaration
  5010. check_cflags -Werror=missing-prototypes
  5011. check_cflags -Werror=return-type
  5012. check_cflags -Werror=vla
  5013. check_cflags -Wformat
  5014. check_cflags -fdiagnostics-color=auto
  5015. enabled extra_warnings || check_disable_warning -Wno-maybe-uninitialized
  5016. elif enabled llvm_gcc; then
  5017. check_cflags -mllvm -stack-alignment=16
  5018. elif enabled clang; then
  5019. check_cflags -mllvm -stack-alignment=16
  5020. check_cflags -Qunused-arguments
  5021. check_cflags -Werror=implicit-function-declaration
  5022. check_cflags -Werror=missing-prototypes
  5023. check_cflags -Werror=return-type
  5024. elif enabled cparser; then
  5025. add_cflags -Wno-missing-variable-declarations
  5026. add_cflags -Wno-empty-statement
  5027. elif enabled armcc; then
  5028. add_cflags -W${armcc_opt},--diag_suppress=4343 # hardfp compat
  5029. add_cflags -W${armcc_opt},--diag_suppress=3036 # using . as system include dir
  5030. # 2523: use of inline assembly is deprecated
  5031. add_cflags -W${armcc_opt},--diag_suppress=2523
  5032. add_cflags -W${armcc_opt},--diag_suppress=1207
  5033. add_cflags -W${armcc_opt},--diag_suppress=1293 # assignment in condition
  5034. add_cflags -W${armcc_opt},--diag_suppress=3343 # hardfp compat
  5035. add_cflags -W${armcc_opt},--diag_suppress=167 # pointer sign
  5036. add_cflags -W${armcc_opt},--diag_suppress=513 # pointer sign
  5037. elif enabled tms470; then
  5038. add_cflags -pds=824 -pds=837
  5039. disable inline_asm
  5040. elif enabled pathscale; then
  5041. add_cflags -fstrict-overflow -OPT:wrap_around_unsafe_opt=OFF
  5042. elif enabled_any msvc icl; then
  5043. enabled x86_32 && disable aligned_stack
  5044. enabled_all x86_32 debug && add_cflags -Oy-
  5045. enabled debug && add_ldflags -debug
  5046. enable pragma_deprecated
  5047. if enabled icl; then
  5048. # -Qansi-alias is basically -fstrict-aliasing, but does not work
  5049. # (correctly) on icl 13.x.
  5050. check_cpp_condition "windows.h" "__ICL < 1300 || __ICL >= 1400" &&
  5051. add_cflags -Qansi-alias
  5052. # Some inline asm is not compilable in debug
  5053. if enabled debug; then
  5054. disable ebp_available
  5055. disable ebx_available
  5056. fi
  5057. fi
  5058. # msvcrt10 x64 incorrectly enables log2, only msvcrt12 (MSVC 2013) onwards actually has log2.
  5059. check_cpp_condition crtversion.h "_VC_CRT_MAJOR_VERSION >= 12" || disable log2
  5060. fi
  5061. case $as_type in
  5062. clang)
  5063. add_asflags -Qunused-arguments
  5064. ;;
  5065. esac
  5066. case $ld_type in
  5067. clang)
  5068. check_ldflags -Qunused-arguments
  5069. ;;
  5070. esac
  5071. case $target_os in
  5072. osf1)
  5073. enabled ccc && add_ldflags '-Wl,-expect_unresolved,*'
  5074. ;;
  5075. plan9)
  5076. add_cppflags -Dmain=plan9_main
  5077. ;;
  5078. esac
  5079. enable frame_thread_encoder
  5080. enabled asm || { arch=c; disable $ARCH_LIST $ARCH_EXT_LIST; }
  5081. check_deps $CONFIG_LIST \
  5082. $CONFIG_EXTRA \
  5083. $HAVE_LIST \
  5084. $ALL_COMPONENTS \
  5085. enabled threads && ! enabled pthreads && ! enabled atomics_native && die "non pthread threading without atomics not supported, try adding --enable-pthreads or --cpu=i486 or higher if you are on x86"
  5086. if test $target_os = "haiku"; then
  5087. disable memalign
  5088. disable posix_memalign
  5089. fi
  5090. enabled_all d3d11va d3d11_cobj CoTaskMemFree &&
  5091. prepend ffmpeg_libs $($ldflags_filter "-lole32") &&
  5092. enable d3d11va_lib
  5093. enabled_all dxva2 dxva2api_cobj CoTaskMemFree &&
  5094. prepend ffmpeg_libs $($ldflags_filter "-lole32" "-luser32") &&
  5095. enable dxva2_lib
  5096. ! enabled_any memalign posix_memalign aligned_malloc &&
  5097. enabled simd_align_16 && enable memalign_hack
  5098. # add_dep lib dep
  5099. # -> enable ${lib}_deps_${dep}
  5100. # -> add $dep to ${lib}_deps only once
  5101. add_dep() {
  5102. lib=$1
  5103. dep=$2
  5104. enabled "${lib}_deps_${dep}" && return 0
  5105. enable "${lib}_deps_${dep}"
  5106. prepend "${lib}_deps" $dep
  5107. }
  5108. # merge deps lib components
  5109. # merge all ${component}_deps into ${lib}_deps and ${lib}_deps_*
  5110. merge_deps() {
  5111. lib=$1
  5112. shift
  5113. for comp in $*; do
  5114. enabled $comp || continue
  5115. eval "dep=\"\$${comp}_deps\""
  5116. for d in $dep; do
  5117. add_dep $lib $d
  5118. done
  5119. done
  5120. }
  5121. merge_deps libavfilter $FILTER_LIST
  5122. map 'enabled $v && intrinsics=${v#intrinsics_}' $INTRINSICS_LIST
  5123. for thread in $THREADS_LIST; do
  5124. if enabled $thread; then
  5125. test -n "$thread_type" &&
  5126. die "ERROR: Only one thread type must be selected." ||
  5127. thread_type="$thread"
  5128. fi
  5129. done
  5130. enabled zlib && add_cppflags -DZLIB_CONST
  5131. # conditional library dependencies, in linking order
  5132. enabled amovie_filter && prepend avfilter_deps "avformat avcodec"
  5133. enabled aresample_filter && prepend avfilter_deps "swresample"
  5134. enabled asyncts_filter && prepend avfilter_deps "avresample"
  5135. enabled atempo_filter && prepend avfilter_deps "avcodec"
  5136. enabled cover_rect_filter && prepend avfilter_deps "avformat avcodec"
  5137. enabled ebur128_filter && enabled swresample && prepend avfilter_deps "swresample"
  5138. enabled elbg_filter && prepend avfilter_deps "avcodec"
  5139. enabled fftfilt_filter && prepend avfilter_deps "avcodec"
  5140. enabled find_rect_filter && prepend avfilter_deps "avformat avcodec"
  5141. enabled mcdeint_filter && prepend avfilter_deps "avcodec"
  5142. enabled movie_filter && prepend avfilter_deps "avformat avcodec"
  5143. enabled pan_filter && prepend avfilter_deps "swresample"
  5144. enabled pp_filter && prepend avfilter_deps "postproc"
  5145. enabled removelogo_filter && prepend avfilter_deps "avformat avcodec swscale"
  5146. enabled resample_filter && prepend avfilter_deps "avresample"
  5147. enabled sab_filter && prepend avfilter_deps "swscale"
  5148. enabled scale_filter && prepend avfilter_deps "swscale"
  5149. enabled showspectrum_filter && prepend avfilter_deps "avcodec"
  5150. enabled smartblur_filter && prepend avfilter_deps "swscale"
  5151. enabled subtitles_filter && prepend avfilter_deps "avformat avcodec"
  5152. enabled uspp_filter && prepend avfilter_deps "avcodec"
  5153. enabled lavfi_indev && prepend avdevice_deps "avfilter"
  5154. enabled opus_decoder && prepend avcodec_deps "swresample"
  5155. expand_deps(){
  5156. lib_deps=${1}_deps
  5157. eval "deps=\$$lib_deps"
  5158. append $lib_deps $(map 'eval echo \$${v}_deps' $deps)
  5159. unique $lib_deps
  5160. }
  5161. #we have to remove gpl from the deps here as some code assumes all lib deps are libs
  5162. postproc_deps="$(filter_out 'gpl' $postproc_deps)"
  5163. map 'expand_deps $v' $LIBRARY_LIST
  5164. echo "install prefix $prefix"
  5165. echo "source path $source_path"
  5166. echo "C compiler $cc"
  5167. echo "C library $libc_type"
  5168. if test "$host_cc" != "$cc"; then
  5169. echo "host C compiler $host_cc"
  5170. echo "host C library $host_libc_type"
  5171. fi
  5172. echo "ARCH $arch ($cpu)"
  5173. if test "$build_suffix" != ""; then
  5174. echo "build suffix $build_suffix"
  5175. fi
  5176. if test "$progs_suffix" != ""; then
  5177. echo "progs suffix $progs_suffix"
  5178. fi
  5179. if test "$extra_version" != ""; then
  5180. echo "version string suffix $extra_version"
  5181. fi
  5182. echo "big-endian ${bigendian-no}"
  5183. echo "runtime cpu detection ${runtime_cpudetect-no}"
  5184. if enabled x86; then
  5185. echo "${yasmexe} ${yasm-no}"
  5186. echo "MMX enabled ${mmx-no}"
  5187. echo "MMXEXT enabled ${mmxext-no}"
  5188. echo "3DNow! enabled ${amd3dnow-no}"
  5189. echo "3DNow! extended enabled ${amd3dnowext-no}"
  5190. echo "SSE enabled ${sse-no}"
  5191. echo "SSSE3 enabled ${ssse3-no}"
  5192. echo "AVX enabled ${avx-no}"
  5193. echo "XOP enabled ${xop-no}"
  5194. echo "FMA3 enabled ${fma3-no}"
  5195. echo "FMA4 enabled ${fma4-no}"
  5196. echo "i686 features enabled ${i686-no}"
  5197. echo "CMOV is fast ${fast_cmov-no}"
  5198. echo "EBX available ${ebx_available-no}"
  5199. echo "EBP available ${ebp_available-no}"
  5200. fi
  5201. if enabled aarch64; then
  5202. echo "NEON enabled ${neon-no}"
  5203. echo "VFP enabled ${vfp-no}"
  5204. fi
  5205. if enabled arm; then
  5206. echo "ARMv5TE enabled ${armv5te-no}"
  5207. echo "ARMv6 enabled ${armv6-no}"
  5208. echo "ARMv6T2 enabled ${armv6t2-no}"
  5209. echo "VFP enabled ${vfp-no}"
  5210. echo "NEON enabled ${neon-no}"
  5211. echo "THUMB enabled ${thumb-no}"
  5212. fi
  5213. if enabled mips; then
  5214. echo "MIPS FPU enabled ${mipsfpu-no}"
  5215. echo "MIPS32R5 enabled ${mips32r5-no}"
  5216. echo "MIPS64R6 enabled ${mips64r6-no}"
  5217. echo "MIPS DSP R1 enabled ${mipsdspr1-no}"
  5218. echo "MIPS DSP R2 enabled ${mipsdspr2-no}"
  5219. echo "MIPS MSA enabled ${msa-no}"
  5220. echo "LOONGSON3 enabled ${loongson3-no}"
  5221. fi
  5222. if enabled ppc; then
  5223. echo "AltiVec enabled ${altivec-no}"
  5224. echo "PPC 4xx optimizations ${ppc4xx-no}"
  5225. echo "PPC VSX optimizations ${vsx-no}"
  5226. echo "dcbzl available ${dcbzl-no}"
  5227. fi
  5228. echo "debug symbols ${debug-no}"
  5229. echo "strip symbols ${stripping-no}"
  5230. echo "optimize for size ${small-no}"
  5231. echo "optimizations ${optimizations-no}"
  5232. echo "static ${static-no}"
  5233. echo "shared ${shared-no}"
  5234. echo "postprocessing support ${postproc-no}"
  5235. echo "new filter support ${avfilter-no}"
  5236. echo "network support ${network-no}"
  5237. echo "threading support ${thread_type-no}"
  5238. echo "safe bitstream reader ${safe_bitstream_reader-no}"
  5239. echo "SDL support ${sdl-no}"
  5240. echo "opencl enabled ${opencl-no}"
  5241. echo "texi2html enabled ${texi2html-no}"
  5242. echo "perl enabled ${perl-no}"
  5243. echo "pod2man enabled ${pod2man-no}"
  5244. echo "makeinfo enabled ${makeinfo-no}"
  5245. echo "makeinfo supports HTML ${makeinfo_html-no}"
  5246. test -n "$random_seed" &&
  5247. echo "random seed ${random_seed}"
  5248. echo
  5249. echo "External libraries:"
  5250. print_enabled '' $EXTERNAL_LIBRARY_LIST | print_3_columns
  5251. echo
  5252. for type in decoder encoder hwaccel parser demuxer muxer protocol filter bsf indev outdev; do
  5253. echo "Enabled ${type}s:"
  5254. eval list=\$$(toupper $type)_LIST
  5255. print_enabled '_*' $list | print_3_columns
  5256. echo
  5257. done
  5258. license="LGPL version 2.1 or later"
  5259. if enabled nonfree; then
  5260. license="nonfree and unredistributable"
  5261. elif enabled gplv3; then
  5262. license="GPL version 3 or later"
  5263. elif enabled lgplv3; then
  5264. license="LGPL version 3 or later"
  5265. elif enabled gpl; then
  5266. license="GPL version 2 or later"
  5267. fi
  5268. echo "License: $license"
  5269. echo "Creating config.mak, config.h, and doc/config.texi..."
  5270. test -e Makefile || echo "include $source_path/Makefile" > Makefile
  5271. enabled stripping || strip="echo skipping strip"
  5272. config_files="$TMPH config.mak doc/config.texi"
  5273. cat > config.mak <<EOF
  5274. # Automatically generated by configure - do not modify!
  5275. ifndef FFMPEG_CONFIG_MAK
  5276. FFMPEG_CONFIG_MAK=1
  5277. FFMPEG_CONFIGURATION=$FFMPEG_CONFIGURATION
  5278. prefix=$prefix
  5279. LIBDIR=\$(DESTDIR)$libdir
  5280. SHLIBDIR=\$(DESTDIR)$shlibdir
  5281. INCDIR=\$(DESTDIR)$incdir
  5282. BINDIR=\$(DESTDIR)$bindir
  5283. DATADIR=\$(DESTDIR)$datadir
  5284. DOCDIR=\$(DESTDIR)$docdir
  5285. MANDIR=\$(DESTDIR)$mandir
  5286. SRC_PATH=$source_path
  5287. ifndef MAIN_MAKEFILE
  5288. SRC_PATH:=\$(SRC_PATH:.%=..%)
  5289. endif
  5290. CC_IDENT=$cc_ident
  5291. ARCH=$arch
  5292. INTRINSICS=$intrinsics
  5293. CC=$cc
  5294. CXX=$cxx
  5295. AS=$as
  5296. LD=$ld
  5297. DEPCC=$dep_cc
  5298. DEPCCFLAGS=$DEPCCFLAGS \$(CPPFLAGS)
  5299. DEPAS=$as
  5300. DEPASFLAGS=$DEPASFLAGS \$(CPPFLAGS)
  5301. YASM=$yasmexe
  5302. DEPYASM=$yasmexe
  5303. AR=$ar
  5304. ARFLAGS=$arflags
  5305. AR_O=$ar_o
  5306. RANLIB=$ranlib
  5307. STRIP=$strip
  5308. CP=cp -p
  5309. LN_S=$ln_s
  5310. CPPFLAGS=$CPPFLAGS
  5311. CFLAGS=$CFLAGS
  5312. CXXFLAGS=$CXXFLAGS
  5313. ASFLAGS=$ASFLAGS
  5314. AS_C=$AS_C
  5315. AS_O=$AS_O
  5316. CC_C=$CC_C
  5317. CC_E=$CC_E
  5318. CC_O=$CC_O
  5319. CXX_C=$CXX_C
  5320. CXX_O=$CXX_O
  5321. LD_O=$LD_O
  5322. LD_LIB=$LD_LIB
  5323. LD_PATH=$LD_PATH
  5324. DLLTOOL=$dlltool
  5325. WINDRES=$windres
  5326. DEPWINDRES=$dep_cc
  5327. DOXYGEN=$doxygen
  5328. LDFLAGS=$LDFLAGS
  5329. LDEXEFLAGS=$LDEXEFLAGS
  5330. SHFLAGS=$(echo $($ldflags_filter $SHFLAGS))
  5331. ASMSTRIPFLAGS=$ASMSTRIPFLAGS
  5332. YASMFLAGS=$YASMFLAGS
  5333. BUILDSUF=$build_suffix
  5334. PROGSSUF=$progs_suffix
  5335. FULLNAME=$FULLNAME
  5336. LIBPREF=$LIBPREF
  5337. LIBSUF=$LIBSUF
  5338. LIBNAME=$LIBNAME
  5339. SLIBPREF=$SLIBPREF
  5340. SLIBSUF=$SLIBSUF
  5341. EXESUF=$EXESUF
  5342. EXTRA_VERSION=$extra_version
  5343. CCDEP=$CCDEP
  5344. CXXDEP=$CXXDEP
  5345. CCDEP_FLAGS=$CCDEP_FLAGS
  5346. ASDEP=$ASDEP
  5347. ASDEP_FLAGS=$ASDEP_FLAGS
  5348. CC_DEPFLAGS=$CC_DEPFLAGS
  5349. AS_DEPFLAGS=$AS_DEPFLAGS
  5350. HOSTCC=$host_cc
  5351. HOSTLD=$host_ld
  5352. HOSTCFLAGS=$host_cflags
  5353. HOSTCPPFLAGS=$host_cppflags
  5354. HOSTEXESUF=$HOSTEXESUF
  5355. HOSTLDFLAGS=$host_ldflags
  5356. HOSTLIBS=$host_libs
  5357. DEPHOSTCC=$host_cc
  5358. DEPHOSTCCFLAGS=$DEPHOSTCCFLAGS \$(HOSTCCFLAGS)
  5359. HOSTCCDEP=$HOSTCCDEP
  5360. HOSTCCDEP_FLAGS=$HOSTCCDEP_FLAGS
  5361. HOSTCC_DEPFLAGS=$HOSTCC_DEPFLAGS
  5362. HOSTCC_C=$HOSTCC_C
  5363. HOSTCC_O=$HOSTCC_O
  5364. HOSTLD_O=$HOSTLD_O
  5365. TARGET_EXEC=$target_exec $target_exec_args
  5366. TARGET_PATH=$target_path
  5367. TARGET_SAMPLES=${target_samples:-\$(SAMPLES)}
  5368. CFLAGS-ffplay=$sdl_cflags
  5369. ZLIB=$($ldflags_filter -lz)
  5370. LIB_INSTALL_EXTRA_CMD=$LIB_INSTALL_EXTRA_CMD
  5371. EXTRALIBS=$extralibs
  5372. COMPAT_OBJS=$compat_objs
  5373. EXEOBJS=$exeobjs
  5374. INSTALL=$install
  5375. LIBTARGET=${LIBTARGET}
  5376. SLIBNAME=${SLIBNAME}
  5377. SLIBNAME_WITH_VERSION=${SLIBNAME_WITH_VERSION}
  5378. SLIBNAME_WITH_MAJOR=${SLIBNAME_WITH_MAJOR}
  5379. SLIB_CREATE_DEF_CMD=${SLIB_CREATE_DEF_CMD}
  5380. SLIB_EXTRA_CMD=${SLIB_EXTRA_CMD}
  5381. SLIB_INSTALL_NAME=${SLIB_INSTALL_NAME}
  5382. SLIB_INSTALL_LINKS=${SLIB_INSTALL_LINKS}
  5383. SLIB_INSTALL_EXTRA_LIB=${SLIB_INSTALL_EXTRA_LIB}
  5384. SLIB_INSTALL_EXTRA_SHLIB=${SLIB_INSTALL_EXTRA_SHLIB}
  5385. SAMPLES:=${samples:-\$(FATE_SAMPLES)}
  5386. NOREDZONE_FLAGS=$noredzone_flags
  5387. EOF
  5388. get_version(){
  5389. lcname=lib${1}
  5390. name=$(toupper $lcname)
  5391. file=$source_path/$lcname/version.h
  5392. eval $(awk "/#define ${name}_VERSION_M/ { print \$2 \"=\" \$3 }" "$file")
  5393. enabled raise_major && eval ${name}_VERSION_MAJOR=$((${name}_VERSION_MAJOR+100))
  5394. eval ${name}_VERSION=\$${name}_VERSION_MAJOR.\$${name}_VERSION_MINOR.\$${name}_VERSION_MICRO
  5395. eval echo "${lcname}_VERSION=\$${name}_VERSION" >> config.mak
  5396. eval echo "${lcname}_VERSION_MAJOR=\$${name}_VERSION_MAJOR" >> config.mak
  5397. eval echo "${lcname}_VERSION_MINOR=\$${name}_VERSION_MINOR" >> config.mak
  5398. }
  5399. map 'get_version $v' $LIBRARY_LIST
  5400. map 'eval echo "${v}_FFLIBS=\$${v}_deps" >> config.mak' $LIBRARY_LIST
  5401. print_program_libs(){
  5402. eval "program_libs=\$${1}_libs"
  5403. eval echo "LIBS-${1}=${program_libs}" >> config.mak
  5404. }
  5405. map 'print_program_libs $v' $PROGRAM_LIST
  5406. cat > $TMPH <<EOF
  5407. /* Automatically generated by configure - do not modify! */
  5408. #ifndef FFMPEG_CONFIG_H
  5409. #define FFMPEG_CONFIG_H
  5410. #define FFMPEG_CONFIGURATION "$(c_escape $FFMPEG_CONFIGURATION)"
  5411. #define FFMPEG_LICENSE "$(c_escape $license)"
  5412. #define CONFIG_THIS_YEAR 2015
  5413. #define FFMPEG_DATADIR "$(eval c_escape $datadir)"
  5414. #define AVCONV_DATADIR "$(eval c_escape $datadir)"
  5415. #define CC_IDENT "$(c_escape ${cc_ident:-Unknown compiler})"
  5416. #define av_restrict $_restrict
  5417. #define EXTERN_PREFIX "${extern_prefix}"
  5418. #define EXTERN_ASM ${extern_prefix}
  5419. #define BUILDSUF "$build_suffix"
  5420. #define SLIBSUF "$SLIBSUF"
  5421. #define HAVE_MMX2 HAVE_MMXEXT
  5422. #define SWS_MAX_FILTER_SIZE $sws_max_filter_size
  5423. EOF
  5424. test -n "$assert_level" &&
  5425. echo "#define ASSERT_LEVEL $assert_level" >>$TMPH
  5426. test -n "$malloc_prefix" &&
  5427. echo "#define MALLOC_PREFIX $malloc_prefix" >>$TMPH
  5428. if enabled yasm; then
  5429. append config_files $TMPASM
  5430. printf '' >$TMPASM
  5431. fi
  5432. enabled getenv || echo "#define getenv(x) NULL" >> $TMPH
  5433. mkdir -p doc
  5434. mkdir -p tests
  5435. echo "@c auto-generated by configure" > doc/config.texi
  5436. print_config ARCH_ "$config_files" $ARCH_LIST
  5437. print_config HAVE_ "$config_files" $HAVE_LIST
  5438. print_config CONFIG_ "$config_files" $CONFIG_LIST \
  5439. $CONFIG_EXTRA \
  5440. $ALL_COMPONENTS \
  5441. echo "#endif /* FFMPEG_CONFIG_H */" >> $TMPH
  5442. echo "endif # FFMPEG_CONFIG_MAK" >> config.mak
  5443. # Do not overwrite an unchanged config.h to avoid superfluous rebuilds.
  5444. cp_if_changed $TMPH config.h
  5445. touch .config
  5446. enabled yasm && cp_if_changed $TMPASM config.asm
  5447. cat > $TMPH <<EOF
  5448. /* Generated by ffconf */
  5449. #ifndef AVUTIL_AVCONFIG_H
  5450. #define AVUTIL_AVCONFIG_H
  5451. EOF
  5452. print_config AV_HAVE_ $TMPH $HAVE_LIST_PUB
  5453. echo "#endif /* AVUTIL_AVCONFIG_H */" >> $TMPH
  5454. cp_if_changed $TMPH libavutil/avconfig.h
  5455. if test -n "$WARNINGS"; then
  5456. printf "\n$WARNINGS"
  5457. enabled fatal_warnings && exit 1
  5458. fi
  5459. # build pkg-config files
  5460. lib_version(){
  5461. eval printf "\"lib${1}${build_suffix} >= \$LIB$(toupper ${1})_VERSION, \""
  5462. }
  5463. pkgconfig_generate(){
  5464. name=$1
  5465. shortname=${name#lib}${build_suffix}
  5466. comment=$2
  5467. version=$3
  5468. libs=$4
  5469. requires=$(map 'lib_version $v' $(eval echo \$${name#lib}_deps))
  5470. requires=${requires%, }
  5471. enabled ${name#lib} || return 0
  5472. mkdir -p $name
  5473. cat <<EOF > $name/$name${build_suffix}.pc
  5474. prefix=$prefix
  5475. exec_prefix=\${prefix}
  5476. libdir=$libdir
  5477. includedir=$incdir
  5478. Name: $name
  5479. Description: $comment
  5480. Version: $version
  5481. Requires: $(enabled shared || echo $requires)
  5482. Requires.private: $(enabled shared && echo $requires)
  5483. Conflicts:
  5484. Libs: -L\${libdir} $(enabled rpath && echo "-Wl,-rpath,\${libdir}") -l${shortname} $(enabled shared || echo $libs)
  5485. Libs.private: $(enabled shared && echo $libs)
  5486. Cflags: -I\${includedir}
  5487. EOF
  5488. mkdir -p doc/examples/pc-uninstalled
  5489. includedir=${source_path}
  5490. [ "$includedir" = . ] && includedir="\${pcfiledir}/../../.."
  5491. cat <<EOF > doc/examples/pc-uninstalled/$name.pc
  5492. prefix=
  5493. exec_prefix=
  5494. libdir=\${pcfiledir}/../../../$name
  5495. includedir=${includedir}
  5496. Name: $name
  5497. Description: $comment
  5498. Version: $version
  5499. Requires: $requires
  5500. Conflicts:
  5501. Libs: -L\${libdir} -Wl,-rpath,\${libdir} -l${shortname} $(enabled shared || echo $libs)
  5502. Cflags: -I\${includedir}
  5503. EOF
  5504. }
  5505. pkgconfig_generate libavutil "FFmpeg utility library" "$LIBAVUTIL_VERSION" "$LIBRT $LIBM"
  5506. pkgconfig_generate libavcodec "FFmpeg codec library" "$LIBAVCODEC_VERSION" "$extralibs"
  5507. pkgconfig_generate libavformat "FFmpeg container format library" "$LIBAVFORMAT_VERSION" "$extralibs"
  5508. pkgconfig_generate libavdevice "FFmpeg device handling library" "$LIBAVDEVICE_VERSION" "$extralibs"
  5509. pkgconfig_generate libavfilter "FFmpeg audio/video filtering library" "$LIBAVFILTER_VERSION" "$extralibs"
  5510. pkgconfig_generate libpostproc "FFmpeg postprocessing library" "$LIBPOSTPROC_VERSION" ""
  5511. pkgconfig_generate libavresample "Libav audio resampling library" "$LIBAVRESAMPLE_VERSION" "$LIBM"
  5512. pkgconfig_generate libswscale "FFmpeg image rescaling library" "$LIBSWSCALE_VERSION" "$LIBM"
  5513. pkgconfig_generate libswresample "FFmpeg audio resampling library" "$LIBSWRESAMPLE_VERSION" "$LIBM"