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.

7569 lines
248KB

  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. --quiet Suppress showing informative output
  58. --list-decoders show all available decoders
  59. --list-encoders show all available encoders
  60. --list-hwaccels show all available hardware accelerators
  61. --list-demuxers show all available demuxers
  62. --list-muxers show all available muxers
  63. --list-parsers show all available parsers
  64. --list-protocols show all available protocols
  65. --list-bsfs show all available bitstream filters
  66. --list-indevs show all available input devices
  67. --list-outdevs show all available output devices
  68. --list-filters show all available filters
  69. Standard options:
  70. --logfile=FILE log tests and output to FILE [ffbuild/config.log]
  71. --disable-logging do not log configure debug information
  72. --fatal-warnings fail if any configure warning is generated
  73. --prefix=PREFIX install in PREFIX [$prefix_default]
  74. --bindir=DIR install binaries in DIR [PREFIX/bin]
  75. --datadir=DIR install data files in DIR [PREFIX/share/ffmpeg]
  76. --docdir=DIR install documentation in DIR [PREFIX/share/doc/ffmpeg]
  77. --libdir=DIR install libs in DIR [PREFIX/lib]
  78. --shlibdir=DIR install shared libs in DIR [LIBDIR]
  79. --incdir=DIR install includes in DIR [PREFIX/include]
  80. --mandir=DIR install man page in DIR [PREFIX/share/man]
  81. --pkgconfigdir=DIR install pkg-config files in DIR [LIBDIR/pkgconfig]
  82. --enable-rpath use rpath to allow installing libraries in paths
  83. not part of the dynamic linker search path
  84. use rpath when linking programs (USE WITH CARE)
  85. --install-name-dir=DIR Darwin directory name for installed targets
  86. Licensing options:
  87. --enable-gpl allow use of GPL code, the resulting libs
  88. and binaries will be under GPL [no]
  89. --enable-version3 upgrade (L)GPL to version 3 [no]
  90. --enable-nonfree allow use of nonfree code, the resulting libs
  91. and binaries will be unredistributable [no]
  92. Configuration options:
  93. --disable-static do not build static libraries [no]
  94. --enable-shared build shared libraries [no]
  95. --enable-small optimize for size instead of speed
  96. --disable-runtime-cpudetect disable detecting CPU capabilities at runtime (smaller binary)
  97. --enable-gray enable full grayscale support (slower color)
  98. --disable-swscale-alpha disable alpha channel support in swscale
  99. --disable-all disable building components, libraries and programs
  100. --disable-autodetect disable automatically detected external libraries [no]
  101. Program options:
  102. --disable-programs do not build command line programs
  103. --disable-ffmpeg disable ffmpeg build
  104. --disable-ffplay disable ffplay build
  105. --disable-ffprobe disable ffprobe build
  106. Documentation options:
  107. --disable-doc do not build documentation
  108. --disable-htmlpages do not build HTML documentation pages
  109. --disable-manpages do not build man documentation pages
  110. --disable-podpages do not build POD documentation pages
  111. --disable-txtpages do not build text documentation pages
  112. Component options:
  113. --disable-avdevice disable libavdevice build
  114. --disable-avcodec disable libavcodec build
  115. --disable-avformat disable libavformat 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 (deprecated) [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. Individual component options:
  136. --disable-everything disable all components listed below
  137. --disable-encoder=NAME disable encoder NAME
  138. --enable-encoder=NAME enable encoder NAME
  139. --disable-encoders disable all encoders
  140. --disable-decoder=NAME disable decoder NAME
  141. --enable-decoder=NAME enable decoder NAME
  142. --disable-decoders disable all decoders
  143. --disable-hwaccel=NAME disable hwaccel NAME
  144. --enable-hwaccel=NAME enable hwaccel NAME
  145. --disable-hwaccels disable all hwaccels
  146. --disable-muxer=NAME disable muxer NAME
  147. --enable-muxer=NAME enable muxer NAME
  148. --disable-muxers disable all muxers
  149. --disable-demuxer=NAME disable demuxer NAME
  150. --enable-demuxer=NAME enable demuxer NAME
  151. --disable-demuxers disable all demuxers
  152. --enable-parser=NAME enable parser NAME
  153. --disable-parser=NAME disable parser NAME
  154. --disable-parsers disable all parsers
  155. --enable-bsf=NAME enable bitstream filter NAME
  156. --disable-bsf=NAME disable bitstream filter NAME
  157. --disable-bsfs disable all bitstream filters
  158. --enable-protocol=NAME enable protocol NAME
  159. --disable-protocol=NAME disable protocol NAME
  160. --disable-protocols disable all protocols
  161. --enable-indev=NAME enable input device NAME
  162. --disable-indev=NAME disable input device NAME
  163. --disable-indevs disable input devices
  164. --enable-outdev=NAME enable output device NAME
  165. --disable-outdev=NAME disable output device NAME
  166. --disable-outdevs disable output devices
  167. --disable-devices disable all devices
  168. --enable-filter=NAME enable filter NAME
  169. --disable-filter=NAME disable filter NAME
  170. --disable-filters disable all filters
  171. External library support:
  172. Using any of the following switches will allow FFmpeg to link to the
  173. corresponding external library. All the components depending on that library
  174. will become enabled, if all their other dependencies are met and they are not
  175. explicitly disabled. E.g. --enable-libwavpack will enable linking to
  176. libwavpack and allow the libwavpack encoder to be built, unless it is
  177. specifically disabled with --disable-encoder=libwavpack.
  178. Note that only the system libraries are auto-detected. All the other external
  179. libraries must be explicitly enabled.
  180. Also note that the following help text describes the purpose of the libraries
  181. themselves, not all their features will necessarily be usable by FFmpeg.
  182. --disable-alsa disable ALSA support [autodetect]
  183. --disable-appkit disable Apple AppKit framework [autodetect]
  184. --disable-avfoundation disable Apple AVFoundation framework [autodetect]
  185. --enable-avisynth enable reading of AviSynth script files [no]
  186. --disable-bzlib disable bzlib [autodetect]
  187. --disable-coreimage disable Apple CoreImage framework [autodetect]
  188. --enable-chromaprint enable audio fingerprinting with chromaprint [no]
  189. --enable-frei0r enable frei0r video filtering [no]
  190. --enable-gcrypt enable gcrypt, needed for rtmp(t)e support
  191. if openssl, librtmp or gmp is not used [no]
  192. --enable-gmp enable gmp, needed for rtmp(t)e support
  193. if openssl or librtmp is not used [no]
  194. --enable-gnutls enable gnutls, needed for https support
  195. if openssl, libtls or mbedtls is not used [no]
  196. --disable-iconv disable iconv [autodetect]
  197. --enable-jni enable JNI support [no]
  198. --enable-ladspa enable LADSPA audio filtering [no]
  199. --enable-libaom enable AV1 video encoding/decoding via libaom [no]
  200. --enable-libaribb24 enable ARIB text and caption decoding via libaribb24 [no]
  201. --enable-libass enable libass subtitles rendering,
  202. needed for subtitles and ass filter [no]
  203. --enable-libbluray enable BluRay reading using libbluray [no]
  204. --enable-libbs2b enable bs2b DSP library [no]
  205. --enable-libcaca enable textual display using libcaca [no]
  206. --enable-libcelt enable CELT decoding via libcelt [no]
  207. --enable-libcdio enable audio CD grabbing with libcdio [no]
  208. --enable-libcodec2 enable codec2 en/decoding using libcodec2 [no]
  209. --enable-libdav1d enable AV1 decoding via libdav1d [no]
  210. --enable-libdavs2 enable AVS2 decoding via libdavs2 [no]
  211. --enable-libdc1394 enable IIDC-1394 grabbing using libdc1394
  212. and libraw1394 [no]
  213. --enable-libfdk-aac enable AAC de/encoding via libfdk-aac [no]
  214. --enable-libflite enable flite (voice synthesis) support via libflite [no]
  215. --enable-libfontconfig enable libfontconfig, useful for drawtext filter [no]
  216. --enable-libfreetype enable libfreetype, needed for drawtext filter [no]
  217. --enable-libfribidi enable libfribidi, improves drawtext filter [no]
  218. --enable-libgme enable Game Music Emu via libgme [no]
  219. --enable-libgsm enable GSM de/encoding via libgsm [no]
  220. --enable-libiec61883 enable iec61883 via libiec61883 [no]
  221. --enable-libilbc enable iLBC de/encoding via libilbc [no]
  222. --enable-libjack enable JACK audio sound server [no]
  223. --enable-libklvanc enable Kernel Labs VANC processing [no]
  224. --enable-libkvazaar enable HEVC encoding via libkvazaar [no]
  225. --enable-liblensfun enable lensfun lens correction [no]
  226. --enable-libmodplug enable ModPlug via libmodplug [no]
  227. --enable-libmp3lame enable MP3 encoding via libmp3lame [no]
  228. --enable-libopencore-amrnb enable AMR-NB de/encoding via libopencore-amrnb [no]
  229. --enable-libopencore-amrwb enable AMR-WB decoding via libopencore-amrwb [no]
  230. --enable-libopencv enable video filtering via libopencv [no]
  231. --enable-libopenh264 enable H.264 encoding via OpenH264 [no]
  232. --enable-libopenjpeg enable JPEG 2000 de/encoding via OpenJPEG [no]
  233. --enable-libopenmpt enable decoding tracked files via libopenmpt [no]
  234. --enable-libopus enable Opus de/encoding via libopus [no]
  235. --enable-libpulse enable Pulseaudio input via libpulse [no]
  236. --enable-librsvg enable SVG rasterization via librsvg [no]
  237. --enable-librubberband enable rubberband needed for rubberband filter [no]
  238. --enable-librtmp enable RTMP[E] support via librtmp [no]
  239. --enable-libshine enable fixed-point MP3 encoding via libshine [no]
  240. --enable-libsmbclient enable Samba protocol via libsmbclient [no]
  241. --enable-libsnappy enable Snappy compression, needed for hap encoding [no]
  242. --enable-libsoxr enable Include libsoxr resampling [no]
  243. --enable-libspeex enable Speex de/encoding via libspeex [no]
  244. --enable-libsrt enable Haivision SRT protocol via libsrt [no]
  245. --enable-libssh enable SFTP protocol via libssh [no]
  246. --enable-libtensorflow enable TensorFlow as a DNN module backend
  247. for DNN based filters like sr [no]
  248. --enable-libtesseract enable Tesseract, needed for ocr filter [no]
  249. --enable-libtheora enable Theora encoding via libtheora [no]
  250. --enable-libtls enable LibreSSL (via libtls), needed for https support
  251. if openssl, gnutls or mbedtls is not used [no]
  252. --enable-libtwolame enable MP2 encoding via libtwolame [no]
  253. --enable-libv4l2 enable libv4l2/v4l-utils [no]
  254. --enable-libvidstab enable video stabilization using vid.stab [no]
  255. --enable-libvmaf enable vmaf filter via libvmaf [no]
  256. --enable-libvo-amrwbenc enable AMR-WB encoding via libvo-amrwbenc [no]
  257. --enable-libvorbis enable Vorbis en/decoding via libvorbis,
  258. native implementation exists [no]
  259. --enable-libvpx enable VP8 and VP9 de/encoding via libvpx [no]
  260. --enable-libwavpack enable wavpack encoding via libwavpack [no]
  261. --enable-libwebp enable WebP encoding via libwebp [no]
  262. --enable-libx264 enable H.264 encoding via x264 [no]
  263. --enable-libx265 enable HEVC encoding via x265 [no]
  264. --enable-libxavs enable AVS encoding via xavs [no]
  265. --enable-libxavs2 enable AVS2 encoding via xavs2 [no]
  266. --enable-libxcb enable X11 grabbing using XCB [autodetect]
  267. --enable-libxcb-shm enable X11 grabbing shm communication [autodetect]
  268. --enable-libxcb-xfixes enable X11 grabbing mouse rendering [autodetect]
  269. --enable-libxcb-shape enable X11 grabbing shape rendering [autodetect]
  270. --enable-libxvid enable Xvid encoding via xvidcore,
  271. native MPEG-4/Xvid encoder exists [no]
  272. --enable-libxml2 enable XML parsing using the C library libxml2, needed
  273. for dash demuxing support [no]
  274. --enable-libzimg enable z.lib, needed for zscale filter [no]
  275. --enable-libzmq enable message passing via libzmq [no]
  276. --enable-libzvbi enable teletext support via libzvbi [no]
  277. --enable-lv2 enable LV2 audio filtering [no]
  278. --disable-lzma disable lzma [autodetect]
  279. --enable-decklink enable Blackmagic DeckLink I/O support [no]
  280. --enable-mbedtls enable mbedTLS, needed for https support
  281. if openssl, gnutls or libtls is not used [no]
  282. --enable-mediacodec enable Android MediaCodec support [no]
  283. --enable-libmysofa enable libmysofa, needed for sofalizer filter [no]
  284. --enable-openal enable OpenAL 1.1 capture support [no]
  285. --enable-opencl enable OpenCL processing [no]
  286. --enable-opengl enable OpenGL rendering [no]
  287. --enable-openssl enable openssl, needed for https support
  288. if gnutls, libtls or mbedtls is not used [no]
  289. --enable-pocketsphinx enable PocketSphinx, needed for asr filter [no]
  290. --disable-sndio disable sndio support [autodetect]
  291. --disable-schannel disable SChannel SSP, needed for TLS support on
  292. Windows if openssl and gnutls are not used [autodetect]
  293. --disable-sdl2 disable sdl2 [autodetect]
  294. --disable-securetransport disable Secure Transport, needed for TLS support
  295. on OSX if openssl and gnutls are not used [autodetect]
  296. --enable-vapoursynth enable VapourSynth demuxer [no]
  297. --disable-xlib disable xlib [autodetect]
  298. --disable-zlib disable zlib [autodetect]
  299. The following libraries provide various hardware acceleration features:
  300. --disable-amf disable AMF video encoding code [autodetect]
  301. --disable-audiotoolbox disable Apple AudioToolbox code [autodetect]
  302. --enable-cuda-nvcc enable Nvidia CUDA compiler [no]
  303. --disable-cuda-llvm disable CUDA compilation using clang [autodetect]
  304. --disable-cuvid disable Nvidia CUVID support [autodetect]
  305. --disable-d3d11va disable Microsoft Direct3D 11 video acceleration code [autodetect]
  306. --disable-dxva2 disable Microsoft DirectX 9 video acceleration code [autodetect]
  307. --disable-ffnvcodec disable dynamically linked Nvidia code [autodetect]
  308. --enable-libdrm enable DRM code (Linux) [no]
  309. --enable-libmfx enable Intel MediaSDK (AKA Quick Sync Video) code via libmfx [no]
  310. --enable-libnpp enable Nvidia Performance Primitives-based code [no]
  311. --enable-mmal enable Broadcom Multi-Media Abstraction Layer (Raspberry Pi) via MMAL [no]
  312. --disable-nvdec disable Nvidia video decoding acceleration (via hwaccel) [autodetect]
  313. --disable-nvenc disable Nvidia video encoding code [autodetect]
  314. --enable-omx enable OpenMAX IL code [no]
  315. --enable-omx-rpi enable OpenMAX IL code for Raspberry Pi [no]
  316. --enable-rkmpp enable Rockchip Media Process Platform code [no]
  317. --disable-v4l2-m2m disable V4L2 mem2mem code [autodetect]
  318. --disable-vaapi disable Video Acceleration API (mainly Unix/Intel) code [autodetect]
  319. --disable-vdpau disable Nvidia Video Decode and Presentation API for Unix code [autodetect]
  320. --disable-videotoolbox disable VideoToolbox code [autodetect]
  321. Toolchain options:
  322. --arch=ARCH select architecture [$arch]
  323. --cpu=CPU select the minimum required CPU (affects
  324. instruction selection, may crash on older CPUs)
  325. --cross-prefix=PREFIX use PREFIX for compilation tools [$cross_prefix]
  326. --progs-suffix=SUFFIX program name suffix []
  327. --enable-cross-compile assume a cross-compiler is used
  328. --sysroot=PATH root of cross-build tree
  329. --sysinclude=PATH location of cross-build system headers
  330. --target-os=OS compiler targets OS [$target_os]
  331. --target-exec=CMD command to run executables on target
  332. --target-path=DIR path to view of build directory on target
  333. --target-samples=DIR path to samples directory on target
  334. --tempprefix=PATH force fixed dir/prefix instead of mktemp for checks
  335. --toolchain=NAME set tool defaults according to NAME
  336. (gcc-asan, clang-asan, gcc-msan, clang-msan,
  337. gcc-tsan, clang-tsan, gcc-usan, clang-usan,
  338. valgrind-massif, valgrind-memcheck,
  339. msvc, icl, gcov, llvm-cov, hardened)
  340. --nm=NM use nm tool NM [$nm_default]
  341. --ar=AR use archive tool AR [$ar_default]
  342. --as=AS use assembler AS [$as_default]
  343. --ln_s=LN_S use symbolic link tool LN_S [$ln_s_default]
  344. --strip=STRIP use strip tool STRIP [$strip_default]
  345. --windres=WINDRES use windows resource compiler WINDRES [$windres_default]
  346. --x86asmexe=EXE use nasm-compatible assembler EXE [$x86asmexe_default]
  347. --cc=CC use C compiler CC [$cc_default]
  348. --cxx=CXX use C compiler CXX [$cxx_default]
  349. --objcc=OCC use ObjC compiler OCC [$cc_default]
  350. --dep-cc=DEPCC use dependency generator DEPCC [$cc_default]
  351. --nvcc=NVCC use Nvidia CUDA compiler NVCC or clang [$nvcc_default]
  352. --ld=LD use linker LD [$ld_default]
  353. --pkg-config=PKGCONFIG use pkg-config tool PKGCONFIG [$pkg_config_default]
  354. --pkg-config-flags=FLAGS pass additional flags to pkgconf []
  355. --ranlib=RANLIB use ranlib RANLIB [$ranlib_default]
  356. --doxygen=DOXYGEN use DOXYGEN to generate API doc [$doxygen_default]
  357. --host-cc=HOSTCC use host C compiler HOSTCC
  358. --host-cflags=HCFLAGS use HCFLAGS when compiling for host
  359. --host-cppflags=HCPPFLAGS use HCPPFLAGS when compiling for host
  360. --host-ld=HOSTLD use host linker HOSTLD
  361. --host-ldflags=HLDFLAGS use HLDFLAGS when linking for host
  362. --host-extralibs=HLIBS use libs HLIBS when linking for host
  363. --host-os=OS compiler host OS [$target_os]
  364. --extra-cflags=ECFLAGS add ECFLAGS to CFLAGS [$CFLAGS]
  365. --extra-cxxflags=ECFLAGS add ECFLAGS to CXXFLAGS [$CXXFLAGS]
  366. --extra-objcflags=FLAGS add FLAGS to OBJCFLAGS [$CFLAGS]
  367. --extra-ldflags=ELDFLAGS add ELDFLAGS to LDFLAGS [$LDFLAGS]
  368. --extra-ldexeflags=ELDFLAGS add ELDFLAGS to LDEXEFLAGS [$LDEXEFLAGS]
  369. --extra-ldsoflags=ELDFLAGS add ELDFLAGS to LDSOFLAGS [$LDSOFLAGS]
  370. --extra-libs=ELIBS add ELIBS [$ELIBS]
  371. --extra-version=STRING version string suffix []
  372. --optflags=OPTFLAGS override optimization-related compiler flags
  373. --nvccflags=NVCCFLAGS override nvcc flags [$nvccflags_default]
  374. --build-suffix=SUFFIX library name suffix []
  375. --enable-pic build position-independent code
  376. --enable-thumb compile for Thumb instruction set
  377. --enable-lto use link-time optimization
  378. --env="ENV=override" override the environment variables
  379. Advanced options (experts only):
  380. --malloc-prefix=PREFIX prefix malloc and related names with PREFIX
  381. --custom-allocator=NAME use a supported custom allocator
  382. --disable-symver disable symbol versioning
  383. --enable-hardcoded-tables use hardcoded tables instead of runtime generation
  384. --disable-safe-bitstream-reader
  385. disable buffer boundary checking in bitreaders
  386. (faster, but may crash)
  387. --sws-max-filter-size=N the max filter size swscale uses [$sws_max_filter_size_default]
  388. Optimization options (experts only):
  389. --disable-asm disable all assembly optimizations
  390. --disable-altivec disable AltiVec optimizations
  391. --disable-vsx disable VSX optimizations
  392. --disable-power8 disable POWER8 optimizations
  393. --disable-amd3dnow disable 3DNow! optimizations
  394. --disable-amd3dnowext disable 3DNow! extended optimizations
  395. --disable-mmx disable MMX optimizations
  396. --disable-mmxext disable MMXEXT optimizations
  397. --disable-sse disable SSE optimizations
  398. --disable-sse2 disable SSE2 optimizations
  399. --disable-sse3 disable SSE3 optimizations
  400. --disable-ssse3 disable SSSE3 optimizations
  401. --disable-sse4 disable SSE4 optimizations
  402. --disable-sse42 disable SSE4.2 optimizations
  403. --disable-avx disable AVX optimizations
  404. --disable-xop disable XOP optimizations
  405. --disable-fma3 disable FMA3 optimizations
  406. --disable-fma4 disable FMA4 optimizations
  407. --disable-avx2 disable AVX2 optimizations
  408. --disable-avx512 disable AVX-512 optimizations
  409. --disable-aesni disable AESNI optimizations
  410. --disable-armv5te disable armv5te optimizations
  411. --disable-armv6 disable armv6 optimizations
  412. --disable-armv6t2 disable armv6t2 optimizations
  413. --disable-vfp disable VFP optimizations
  414. --disable-neon disable NEON optimizations
  415. --disable-inline-asm disable use of inline assembly
  416. --disable-x86asm disable use of standalone x86 assembly
  417. --disable-mipsdsp disable MIPS DSP ASE R1 optimizations
  418. --disable-mipsdspr2 disable MIPS DSP ASE R2 optimizations
  419. --disable-msa disable MSA optimizations
  420. --disable-msa2 disable MSA2 optimizations
  421. --disable-mipsfpu disable floating point MIPS optimizations
  422. --disable-mmi disable Loongson SIMD optimizations
  423. --disable-fast-unaligned consider unaligned accesses slow
  424. Developer options (useful when working on FFmpeg itself):
  425. --disable-debug disable debugging symbols
  426. --enable-debug=LEVEL set the debug level [$debuglevel]
  427. --disable-optimizations disable compiler optimizations
  428. --enable-extra-warnings enable more compiler warnings
  429. --disable-stripping disable stripping of executables and shared libraries
  430. --assert-level=level 0(default), 1 or 2, amount of assertion testing,
  431. 2 causes a slowdown at runtime.
  432. --enable-memory-poisoning fill heap uninitialized allocated space with arbitrary data
  433. --valgrind=VALGRIND run "make fate" tests through valgrind to detect memory
  434. leaks and errors, using the specified valgrind binary.
  435. Cannot be combined with --target-exec
  436. --enable-ftrapv Trap arithmetic overflows
  437. --samples=PATH location of test samples for FATE, if not set use
  438. \$FATE_SAMPLES at make invocation time.
  439. --enable-neon-clobber-test check NEON registers for clobbering (should be
  440. used only for debugging purposes)
  441. --enable-xmm-clobber-test check XMM registers for clobbering (Win64-only;
  442. should be used only for debugging purposes)
  443. --enable-random randomly enable/disable components
  444. --disable-random
  445. --enable-random=LIST randomly enable/disable specific components or
  446. --disable-random=LIST component groups. LIST is a comma-separated list
  447. of NAME[:PROB] entries where NAME is a component
  448. (group) and PROB the probability associated with
  449. NAME (default 0.5).
  450. --random-seed=VALUE seed value for --enable/disable-random
  451. --disable-valgrind-backtrace do not print a backtrace under Valgrind
  452. (only applies to --disable-optimizations builds)
  453. --enable-ossfuzz Enable building fuzzer tool
  454. --libfuzzer=PATH path to libfuzzer
  455. --ignore-tests=TESTS comma-separated list (without "fate-" prefix
  456. in the name) of tests whose result is ignored
  457. --enable-linux-perf enable Linux Performance Monitor API
  458. NOTE: Object files are built at the place where configure is launched.
  459. EOF
  460. exit 0
  461. }
  462. if test -t 1 && which tput >/dev/null 2>&1; then
  463. ncolors=$(tput colors)
  464. if test -n "$ncolors" && test $ncolors -ge 8; then
  465. bold_color=$(tput bold)
  466. warn_color=$(tput setaf 3)
  467. error_color=$(tput setaf 1)
  468. reset_color=$(tput sgr0)
  469. fi
  470. # 72 used instead of 80 since that's the default of pr
  471. ncols=$(tput cols)
  472. fi
  473. : ${ncols:=72}
  474. log(){
  475. echo "$@" >> $logfile
  476. }
  477. log_file(){
  478. log BEGIN "$1"
  479. log_file_i=1
  480. while IFS= read -r log_file_line; do
  481. printf '%5d\t%s\n' "$log_file_i" "$log_file_line"
  482. log_file_i=$(($log_file_i+1))
  483. done < "$1" >> "$logfile"
  484. log END "$1"
  485. }
  486. warn(){
  487. log "WARNING: $*"
  488. WARNINGS="${WARNINGS}WARNING: $*\n"
  489. }
  490. die(){
  491. log "$@"
  492. echo "$error_color$bold_color$@$reset_color"
  493. cat <<EOF
  494. If you think configure made a mistake, make sure you are using the latest
  495. version from Git. If the latest version fails, report the problem to the
  496. ffmpeg-user@ffmpeg.org mailing list or IRC #ffmpeg on irc.freenode.net.
  497. EOF
  498. if disabled logging; then
  499. cat <<EOF
  500. Rerun configure with logging enabled (do not use --disable-logging), and
  501. include the log this produces with your report.
  502. EOF
  503. else
  504. cat <<EOF
  505. Include the log file "$logfile" produced by configure as this will help
  506. solve the problem.
  507. EOF
  508. fi
  509. exit 1
  510. }
  511. # Avoid locale weirdness, besides we really just want to translate ASCII.
  512. toupper(){
  513. echo "$@" | tr abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ
  514. }
  515. tolower(){
  516. echo "$@" | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz
  517. }
  518. c_escape(){
  519. echo "$*" | sed 's/["\\]/\\\0/g'
  520. }
  521. sh_quote(){
  522. v=$(echo "$1" | sed "s/'/'\\\\''/g")
  523. test "x$v" = "x${v#*[!A-Za-z0-9_/.+-]}" || v="'$v'"
  524. echo "$v"
  525. }
  526. cleanws(){
  527. echo "$@" | sed 's/^ *//;s/[[:space:]][[:space:]]*/ /g;s/ *$//'
  528. }
  529. filter(){
  530. pat=$1
  531. shift
  532. for v; do
  533. eval "case '$v' in $pat) printf '%s ' '$v' ;; esac"
  534. done
  535. }
  536. filter_out(){
  537. pat=$1
  538. shift
  539. for v; do
  540. eval "case '$v' in $pat) ;; *) printf '%s ' '$v' ;; esac"
  541. done
  542. }
  543. map(){
  544. m=$1
  545. shift
  546. for v; do eval $m; done
  547. }
  548. add_suffix(){
  549. suffix=$1
  550. shift
  551. for v; do echo ${v}${suffix}; done
  552. }
  553. remove_suffix(){
  554. suffix=$1
  555. shift
  556. for v; do echo ${v%$suffix}; done
  557. }
  558. set_all(){
  559. value=$1
  560. shift
  561. for var in $*; do
  562. eval $var=$value
  563. done
  564. }
  565. set_weak(){
  566. value=$1
  567. shift
  568. for var; do
  569. eval : \${$var:=$value}
  570. done
  571. }
  572. sanitize_var_name(){
  573. echo $@ | sed 's/[^A-Za-z0-9_]/_/g'
  574. }
  575. set_sanitized(){
  576. var=$1
  577. shift
  578. eval $(sanitize_var_name "$var")='$*'
  579. }
  580. get_sanitized(){
  581. eval echo \$$(sanitize_var_name "$1")
  582. }
  583. pushvar(){
  584. for pvar in $*; do
  585. eval level=\${${pvar}_level:=0}
  586. eval ${pvar}_${level}="\$$pvar"
  587. eval ${pvar}_level=$(($level+1))
  588. done
  589. }
  590. popvar(){
  591. for pvar in $*; do
  592. eval level=\${${pvar}_level:-0}
  593. test $level = 0 && continue
  594. eval level=$(($level-1))
  595. eval $pvar="\${${pvar}_${level}}"
  596. eval ${pvar}_level=$level
  597. eval unset ${pvar}_${level}
  598. done
  599. }
  600. request(){
  601. for var in $*; do
  602. eval ${var}_requested=yes
  603. eval $var=
  604. done
  605. }
  606. warn_if_gets_disabled(){
  607. for var in $*; do
  608. WARN_IF_GETS_DISABLED_LIST="$WARN_IF_GETS_DISABLED_LIST $var"
  609. done
  610. }
  611. enable(){
  612. set_all yes $*
  613. }
  614. disable(){
  615. set_all no $*
  616. }
  617. disable_with_reason(){
  618. disable $1
  619. eval "${1}_disable_reason=\"$2\""
  620. if requested $1; then
  621. die "ERROR: $1 requested, but $2"
  622. fi
  623. }
  624. enable_weak(){
  625. set_weak yes $*
  626. }
  627. disable_weak(){
  628. set_weak no $*
  629. }
  630. enable_sanitized(){
  631. for var; do
  632. enable $(sanitize_var_name $var)
  633. done
  634. }
  635. disable_sanitized(){
  636. for var; do
  637. disable $(sanitize_var_name $var)
  638. done
  639. }
  640. do_enable_deep(){
  641. for var; do
  642. enabled $var && continue
  643. set -- $var
  644. eval enable_deep \$${var}_select
  645. var=$1
  646. eval enable_deep_weak \$${var}_suggest
  647. done
  648. }
  649. enable_deep(){
  650. do_enable_deep $*
  651. enable $*
  652. }
  653. enable_deep_weak(){
  654. for var; do
  655. disabled $var && continue
  656. set -- $var
  657. do_enable_deep $var
  658. var=$1
  659. enable_weak $var
  660. done
  661. }
  662. requested(){
  663. test "${1#!}" = "$1" && op="=" || op="!="
  664. eval test "x\$${1#!}_requested" $op "xyes"
  665. }
  666. enabled(){
  667. test "${1#!}" = "$1" && op="=" || op="!="
  668. eval test "x\$${1#!}" $op "xyes"
  669. }
  670. disabled(){
  671. test "${1#!}" = "$1" && op="=" || op="!="
  672. eval test "x\$${1#!}" $op "xno"
  673. }
  674. enabled_all(){
  675. for opt; do
  676. enabled $opt || return 1
  677. done
  678. }
  679. disabled_all(){
  680. for opt; do
  681. disabled $opt || return 1
  682. done
  683. }
  684. enabled_any(){
  685. for opt; do
  686. enabled $opt && return 0
  687. done
  688. }
  689. disabled_any(){
  690. for opt; do
  691. disabled $opt && return 0
  692. done
  693. return 1
  694. }
  695. set_default(){
  696. for opt; do
  697. eval : \${$opt:=\$${opt}_default}
  698. done
  699. }
  700. is_in(){
  701. value=$1
  702. shift
  703. for var in $*; do
  704. [ $var = $value ] && return 0
  705. done
  706. return 1
  707. }
  708. # The cfg loop is very hot (several thousands iterations), and in bash also
  709. # potentialy quite slow. Try to abort the iterations early, preferably without
  710. # calling functions. 70%+ of the time cfg is already done or without deps.
  711. check_deps(){
  712. for cfg; do
  713. eval [ x\$${cfg}_checking = xdone ] && continue
  714. eval [ x\$${cfg}_checking = xinprogress ] && die "Circular dependency for $cfg."
  715. eval "
  716. dep_all=\$${cfg}_deps
  717. dep_any=\$${cfg}_deps_any
  718. dep_con=\$${cfg}_conflict
  719. dep_sel=\$${cfg}_select
  720. dep_sgs=\$${cfg}_suggest
  721. dep_ifa=\$${cfg}_if
  722. dep_ifn=\$${cfg}_if_any
  723. "
  724. # most of the time here $cfg has no deps - avoid costly no-op work
  725. if [ "$dep_all$dep_any$dep_con$dep_sel$dep_sgs$dep_ifa$dep_ifn" ]; then
  726. eval ${cfg}_checking=inprogress
  727. set -- $cfg "$dep_all" "$dep_any" "$dep_con" "$dep_sel" "$dep_sgs" "$dep_ifa" "$dep_ifn"
  728. check_deps $dep_all $dep_any $dep_con $dep_sel $dep_sgs $dep_ifa $dep_ifn
  729. cfg=$1; dep_all=$2; dep_any=$3; dep_con=$4; dep_sel=$5 dep_sgs=$6; dep_ifa=$7; dep_ifn=$8
  730. [ -n "$dep_ifa" ] && { enabled_all $dep_ifa && enable_weak $cfg; }
  731. [ -n "$dep_ifn" ] && { enabled_any $dep_ifn && enable_weak $cfg; }
  732. enabled_all $dep_all || { disable_with_reason $cfg "not all dependencies are satisfied: $dep_all"; }
  733. enabled_any $dep_any || { disable_with_reason $cfg "not any dependency is satisfied: $dep_any"; }
  734. disabled_all $dep_con || { disable_with_reason $cfg "some conflicting dependencies are unsatisfied: $dep_con"; }
  735. disabled_any $dep_sel && { disable_with_reason $cfg "some selected dependency is unsatisfied: $dep_sel"; }
  736. enabled $cfg && enable_deep_weak $dep_sel $dep_sgs
  737. for dep in $dep_all $dep_any $dep_sel $dep_sgs; do
  738. # filter out library deps, these do not belong in extralibs
  739. is_in $dep $LIBRARY_LIST && continue
  740. enabled $dep && eval append ${cfg}_extralibs ${dep}_extralibs
  741. done
  742. fi
  743. eval ${cfg}_checking=done
  744. done
  745. }
  746. print_config(){
  747. pfx=$1
  748. files=$2
  749. shift 2
  750. map 'eval echo "$v \${$v:-no}"' "$@" |
  751. awk "BEGIN { split(\"$files\", files) }
  752. {
  753. c = \"$pfx\" toupper(\$1);
  754. v = \$2;
  755. sub(/yes/, 1, v);
  756. sub(/no/, 0, v);
  757. for (f in files) {
  758. file = files[f];
  759. if (file ~ /\\.h\$/) {
  760. printf(\"#define %s %d\\n\", c, v) >>file;
  761. } else if (file ~ /\\.asm\$/) {
  762. printf(\"%%define %s %d\\n\", c, v) >>file;
  763. } else if (file ~ /\\.mak\$/) {
  764. n = -v ? \"\" : \"!\";
  765. printf(\"%s%s=yes\\n\", n, c) >>file;
  766. } else if (file ~ /\\.texi\$/) {
  767. pre = -v ? \"\" : \"@c \";
  768. yesno = \$2;
  769. c2 = tolower(c);
  770. gsub(/_/, \"-\", c2);
  771. printf(\"%s@set %s %s\\n\", pre, c2, yesno) >>file;
  772. }
  773. }
  774. }"
  775. }
  776. print_enabled(){
  777. suf=$1
  778. shift
  779. for v; do
  780. enabled $v && printf "%s\n" ${v%$suf}
  781. done
  782. }
  783. append(){
  784. var=$1
  785. shift
  786. eval "$var=\"\$$var $*\""
  787. }
  788. prepend(){
  789. var=$1
  790. shift
  791. eval "$var=\"$* \$$var\""
  792. }
  793. reverse () {
  794. eval '
  795. reverse_out=
  796. for v in $'$1'; do
  797. reverse_out="$v $reverse_out"
  798. done
  799. '$1'=$reverse_out
  800. '
  801. }
  802. # keeps the last occurence of each non-unique item
  803. unique(){
  804. unique_out=
  805. eval unique_in=\$$1
  806. reverse unique_in
  807. for v in $unique_in; do
  808. # " $unique_out" +space such that every item is surrounded with spaces
  809. case " $unique_out" in *" $v "*) continue; esac # already in list
  810. unique_out="$unique_out$v "
  811. done
  812. reverse unique_out
  813. eval $1=\$unique_out
  814. }
  815. resolve(){
  816. resolve_out=
  817. eval resolve_in=\$$1
  818. for v in $resolve_in; do
  819. eval 'resolve_out="$resolve_out$'$v' "'
  820. done
  821. eval $1=\$resolve_out
  822. }
  823. add_cppflags(){
  824. append CPPFLAGS "$@"
  825. }
  826. add_cflags(){
  827. append CFLAGS $($cflags_filter "$@")
  828. }
  829. add_cflags_headers(){
  830. append CFLAGS_HEADERS $($cflags_filter "$@")
  831. }
  832. add_cxxflags(){
  833. append CXXFLAGS $($cflags_filter "$@")
  834. }
  835. add_objcflags(){
  836. append OBJCFLAGS $($objcflags_filter "$@")
  837. }
  838. add_asflags(){
  839. append ASFLAGS $($asflags_filter "$@")
  840. }
  841. add_ldflags(){
  842. append LDFLAGS $($ldflags_filter "$@")
  843. }
  844. add_ldexeflags(){
  845. append LDEXEFLAGS $($ldflags_filter "$@")
  846. }
  847. add_ldsoflags(){
  848. append LDSOFLAGS $($ldflags_filter "$@")
  849. }
  850. add_extralibs(){
  851. prepend extralibs $($ldflags_filter "$@")
  852. }
  853. add_stripflags(){
  854. append ASMSTRIPFLAGS "$@"
  855. }
  856. add_host_cppflags(){
  857. append host_cppflags "$@"
  858. }
  859. add_host_cflags(){
  860. append host_cflags $($host_cflags_filter "$@")
  861. }
  862. add_host_ldflags(){
  863. append host_ldflags $($host_ldflags_filter "$@")
  864. }
  865. add_compat(){
  866. append compat_objs $1
  867. shift
  868. map 'add_cppflags -D$v' "$@"
  869. }
  870. test_cmd(){
  871. log "$@"
  872. "$@" >> $logfile 2>&1
  873. }
  874. test_stat(){
  875. log test_stat "$@"
  876. stat "$1" >> $logfile 2>&1
  877. }
  878. cc_e(){
  879. eval printf '%s\\n' $CC_E
  880. }
  881. cc_o(){
  882. eval printf '%s\\n' $CC_O
  883. }
  884. as_o(){
  885. eval printf '%s\\n' $AS_O
  886. }
  887. x86asm_o(){
  888. eval printf '%s\\n' $X86ASM_O
  889. }
  890. ld_o(){
  891. eval printf '%s\\n' $LD_O
  892. }
  893. hostcc_e(){
  894. eval printf '%s\\n' $HOSTCC_E
  895. }
  896. hostcc_o(){
  897. eval printf '%s\\n' $HOSTCC_O
  898. }
  899. nvcc_o(){
  900. eval printf '%s\\n' $NVCC_O
  901. }
  902. test_cc(){
  903. log test_cc "$@"
  904. cat > $TMPC
  905. log_file $TMPC
  906. test_cmd $cc $CPPFLAGS $CFLAGS "$@" $CC_C $(cc_o $TMPO) $TMPC
  907. }
  908. test_cxx(){
  909. log test_cxx "$@"
  910. cat > $TMPCPP
  911. log_file $TMPCPP
  912. test_cmd $cxx $CPPFLAGS $CFLAGS $CXXFLAGS "$@" $CXX_C -o $TMPO $TMPCPP
  913. }
  914. test_objcc(){
  915. log test_objcc "$@"
  916. cat > $TMPM
  917. log_file $TMPM
  918. test_cmd $objcc -Werror=missing-prototypes $CPPFLAGS $CFLAGS $OBJCFLAGS "$@" $OBJCC_C $(cc_o $TMPO) $TMPM
  919. }
  920. test_nvcc(){
  921. log test_nvcc "$@"
  922. cat > $TMPCU
  923. log_file $TMPCU
  924. tmpcu_=$TMPCU
  925. tmpo_=$TMPO
  926. [ -x "$(command -v cygpath)" ] && tmpcu_=$(cygpath -m $tmpcu_) && tmpo_=$(cygpath -m $tmpo_)
  927. test_cmd $nvcc $nvccflags "$@" $NVCC_C $(nvcc_o $tmpo_) $tmpcu_
  928. }
  929. check_nvcc() {
  930. log check_nvcc "$@"
  931. name=$1
  932. shift 1
  933. disabled $name && return
  934. disable $name
  935. test_nvcc "$@" <<EOF && enable $name
  936. extern "C" {
  937. __global__ void hello(unsigned char *data) {}
  938. }
  939. EOF
  940. }
  941. test_cpp(){
  942. log test_cpp "$@"
  943. cat > $TMPC
  944. log_file $TMPC
  945. test_cmd $cc $CPPFLAGS $CFLAGS "$@" $(cc_e $TMPO) $TMPC
  946. }
  947. test_as(){
  948. log test_as "$@"
  949. cat > $TMPS
  950. log_file $TMPS
  951. test_cmd $as $CPPFLAGS $ASFLAGS "$@" $AS_C $(as_o $TMPO) $TMPS
  952. }
  953. test_x86asm(){
  954. log test_x86asm "$@"
  955. echo "$1" > $TMPASM
  956. log_file $TMPASM
  957. shift
  958. test_cmd $x86asmexe $X86ASMFLAGS -Werror "$@" $(x86asm_o $TMPO) $TMPASM
  959. }
  960. check_cmd(){
  961. log check_cmd "$@"
  962. cmd=$1
  963. disabled $cmd && return
  964. disable $cmd
  965. test_cmd $@ && enable $cmd
  966. }
  967. check_as(){
  968. log check_as "$@"
  969. name=$1
  970. code=$2
  971. shift 2
  972. disable $name
  973. test_as $@ <<EOF && enable $name
  974. $code
  975. EOF
  976. }
  977. check_inline_asm(){
  978. log check_inline_asm "$@"
  979. name="$1"
  980. code="$2"
  981. shift 2
  982. disable $name
  983. test_cc "$@" <<EOF && enable $name
  984. void foo(void){ __asm__ volatile($code); }
  985. EOF
  986. }
  987. check_inline_asm_flags(){
  988. log check_inline_asm_flags "$@"
  989. name="$1"
  990. code="$2"
  991. flags=''
  992. shift 2
  993. while [ "$1" != "" ]; do
  994. append flags $1
  995. shift
  996. done;
  997. disable $name
  998. cat > $TMPC <<EOF
  999. void foo(void){ __asm__ volatile($code); }
  1000. EOF
  1001. log_file $TMPC
  1002. test_cmd $cc $CPPFLAGS $CFLAGS $flags "$@" $CC_C $(cc_o $TMPO) $TMPC &&
  1003. enable $name && add_cflags $flags && add_asflags $flags && add_ldflags $flags
  1004. }
  1005. check_insn(){
  1006. log check_insn "$@"
  1007. check_inline_asm ${1}_inline "\"$2\""
  1008. check_as ${1}_external "$2"
  1009. }
  1010. check_x86asm(){
  1011. log check_x86asm "$@"
  1012. name=$1
  1013. shift
  1014. disable $name
  1015. test_x86asm "$@" && enable $name
  1016. }
  1017. test_ld(){
  1018. log test_ld "$@"
  1019. type=$1
  1020. shift 1
  1021. flags=$(filter_out '-l*|*.so' $@)
  1022. libs=$(filter '-l*|*.so' $@)
  1023. test_$type $($cflags_filter $flags) || return
  1024. flags=$($ldflags_filter $flags)
  1025. libs=$($ldflags_filter $libs)
  1026. test_cmd $ld $LDFLAGS $LDEXEFLAGS $flags $(ld_o $TMPE) $TMPO $libs $extralibs
  1027. }
  1028. check_ld(){
  1029. log check_ld "$@"
  1030. type=$1
  1031. name=$2
  1032. shift 2
  1033. disable $name
  1034. test_ld $type $@ && enable $name
  1035. }
  1036. print_include(){
  1037. hdr=$1
  1038. test "${hdr%.h}" = "${hdr}" &&
  1039. echo "#include $hdr" ||
  1040. echo "#include <$hdr>"
  1041. }
  1042. test_code(){
  1043. log test_code "$@"
  1044. check=$1
  1045. headers=$2
  1046. code=$3
  1047. shift 3
  1048. {
  1049. for hdr in $headers; do
  1050. print_include $hdr
  1051. done
  1052. echo "int main(void) { $code; return 0; }"
  1053. } | test_$check "$@"
  1054. }
  1055. check_cppflags(){
  1056. log check_cppflags "$@"
  1057. test_cpp "$@" <<EOF && append CPPFLAGS "$@"
  1058. #include <stdlib.h>
  1059. EOF
  1060. }
  1061. test_cflags(){
  1062. log test_cflags "$@"
  1063. set -- $($cflags_filter "$@")
  1064. test_cc "$@" <<EOF
  1065. int x;
  1066. EOF
  1067. }
  1068. check_cflags(){
  1069. log check_cflags "$@"
  1070. test_cflags "$@" && add_cflags "$@"
  1071. }
  1072. check_cxxflags(){
  1073. log check_cxxflags "$@"
  1074. set -- $($cflags_filter "$@")
  1075. test_cxx "$@" <<EOF && append CXXFLAGS "$@"
  1076. int x;
  1077. EOF
  1078. }
  1079. test_objcflags(){
  1080. log test_objcflags "$@"
  1081. set -- $($objcflags_filter "$@")
  1082. test_objcc "$@" <<EOF
  1083. int x;
  1084. EOF
  1085. }
  1086. check_objcflags(){
  1087. log check_objcflags "$@"
  1088. test_objcflags "$@" && add_objcflags "$@"
  1089. }
  1090. test_ldflags(){
  1091. log test_ldflags "$@"
  1092. set -- $($ldflags_filter "$@")
  1093. test_ld "cc" "$@" <<EOF
  1094. int main(void){ return 0; }
  1095. EOF
  1096. }
  1097. check_ldflags(){
  1098. log check_ldflags "$@"
  1099. test_ldflags "$@" && add_ldflags "$@"
  1100. }
  1101. test_stripflags(){
  1102. log test_stripflags "$@"
  1103. # call test_cc to get a fresh TMPO
  1104. test_cc <<EOF
  1105. int main(void) { return 0; }
  1106. EOF
  1107. test_cmd $strip $ASMSTRIPFLAGS "$@" $TMPO
  1108. }
  1109. check_stripflags(){
  1110. log check_stripflags "$@"
  1111. test_stripflags "$@" && add_stripflags "$@"
  1112. }
  1113. check_headers(){
  1114. log check_headers "$@"
  1115. headers=$1
  1116. shift
  1117. disable_sanitized $headers
  1118. {
  1119. for hdr in $headers; do
  1120. print_include $hdr
  1121. done
  1122. echo "int x;"
  1123. } | test_cpp "$@" && enable_sanitized $headers
  1124. }
  1125. check_header_objcc(){
  1126. log check_header_objcc "$@"
  1127. rm -f -- "$TMPO"
  1128. header=$1
  1129. shift
  1130. disable_sanitized $header
  1131. {
  1132. echo "#include <$header>"
  1133. echo "int main(void) { return 0; }"
  1134. } | test_objcc && test_stat "$TMPO" && enable_sanitized $header
  1135. }
  1136. check_apple_framework(){
  1137. log check_apple_framework "$@"
  1138. framework="$1"
  1139. name="$(tolower $framework)"
  1140. header="${framework}/${framework}.h"
  1141. disable $name
  1142. check_header_objcc $header &&
  1143. enable $name && eval ${name}_extralibs='"-framework $framework"'
  1144. }
  1145. check_func(){
  1146. log check_func "$@"
  1147. func=$1
  1148. shift
  1149. disable $func
  1150. test_ld "cc" "$@" <<EOF && enable $func
  1151. extern int $func();
  1152. int main(void){ $func(); }
  1153. EOF
  1154. }
  1155. check_complexfunc(){
  1156. log check_complexfunc "$@"
  1157. func=$1
  1158. narg=$2
  1159. shift 2
  1160. test $narg = 2 && args="f, g" || args="f * I"
  1161. disable $func
  1162. test_ld "cc" "$@" <<EOF && enable $func
  1163. #include <complex.h>
  1164. #include <math.h>
  1165. float foo(complex float f, complex float g) { return $func($args); }
  1166. int main(void){ return (int) foo; }
  1167. EOF
  1168. }
  1169. check_mathfunc(){
  1170. log check_mathfunc "$@"
  1171. func=$1
  1172. narg=$2
  1173. shift 2
  1174. test $narg = 2 && args="f, g" || args="f"
  1175. disable $func
  1176. test_ld "cc" "$@" <<EOF && enable $func
  1177. #include <math.h>
  1178. float foo(float f, float g) { return $func($args); }
  1179. int main(void){ return (int) foo; }
  1180. EOF
  1181. }
  1182. check_func_headers(){
  1183. log check_func_headers "$@"
  1184. headers=$1
  1185. funcs=$2
  1186. shift 2
  1187. {
  1188. for hdr in $headers; do
  1189. print_include $hdr
  1190. done
  1191. echo "#include <stdint.h>"
  1192. for func in $funcs; do
  1193. echo "long check_$func(void) { return (long) $func; }"
  1194. done
  1195. echo "int main(void) { int ret = 0;"
  1196. # LTO could optimize out the test functions without this
  1197. for func in $funcs; do
  1198. echo " ret |= ((intptr_t)check_$func) & 0xFFFF;"
  1199. done
  1200. echo "return ret; }"
  1201. } | test_ld "cc" "$@" && enable $funcs && enable_sanitized $headers
  1202. }
  1203. check_class_headers_cpp(){
  1204. log check_class_headers_cpp "$@"
  1205. headers=$1
  1206. classes=$2
  1207. shift 2
  1208. {
  1209. for hdr in $headers; do
  1210. echo "#include <$hdr>"
  1211. done
  1212. echo "int main(void) { "
  1213. i=1
  1214. for class in $classes; do
  1215. echo "$class obj$i;"
  1216. i=$(expr $i + 1)
  1217. done
  1218. echo "return 0; }"
  1219. } | test_ld "cxx" "$@" && enable $funcs && enable_sanitized $headers
  1220. }
  1221. test_cpp_condition(){
  1222. log test_cpp_condition "$@"
  1223. header=$1
  1224. condition=$2
  1225. shift 2
  1226. test_cpp "$@" <<EOF
  1227. #include <$header>
  1228. #if !($condition)
  1229. #error "unsatisfied condition: $condition"
  1230. #endif
  1231. EOF
  1232. }
  1233. check_cpp_condition(){
  1234. log check_cpp_condition "$@"
  1235. name=$1
  1236. shift 1
  1237. disable $name
  1238. test_cpp_condition "$@" && enable $name
  1239. }
  1240. test_cflags_cc(){
  1241. log test_cflags_cc "$@"
  1242. flags=$1
  1243. header=$2
  1244. condition=$3
  1245. shift 3
  1246. set -- $($cflags_filter "$flags")
  1247. test_cc "$@" <<EOF
  1248. #include <$header>
  1249. #if !($condition)
  1250. #error "unsatisfied condition: $condition"
  1251. #endif
  1252. EOF
  1253. }
  1254. check_lib(){
  1255. log check_lib "$@"
  1256. name="$1"
  1257. headers="$2"
  1258. funcs="$3"
  1259. shift 3
  1260. disable $name
  1261. check_func_headers "$headers" "$funcs" "$@" &&
  1262. enable $name && eval ${name}_extralibs="\$@"
  1263. }
  1264. check_lib_cpp(){
  1265. log check_lib_cpp "$@"
  1266. name="$1"
  1267. headers="$2"
  1268. classes="$3"
  1269. shift 3
  1270. disable $name
  1271. check_class_headers_cpp "$headers" "$classes" "$@" &&
  1272. enable $name && eval ${name}_extralibs="\$@"
  1273. }
  1274. test_pkg_config(){
  1275. log test_pkg_config "$@"
  1276. name="$1"
  1277. pkg_version="$2"
  1278. pkg="${2%% *}"
  1279. headers="$3"
  1280. funcs="$4"
  1281. shift 4
  1282. disable $name
  1283. test_cmd $pkg_config --exists --print-errors $pkg_version || return
  1284. pkg_cflags=$($pkg_config --cflags $pkg_config_flags $pkg)
  1285. pkg_libs=$($pkg_config --libs $pkg_config_flags $pkg)
  1286. check_func_headers "$headers" "$funcs" $pkg_cflags $pkg_libs "$@" &&
  1287. enable $name &&
  1288. set_sanitized "${name}_cflags" $pkg_cflags &&
  1289. set_sanitized "${name}_extralibs" $pkg_libs
  1290. }
  1291. check_pkg_config(){
  1292. log check_pkg_config "$@"
  1293. name="$1"
  1294. test_pkg_config "$@" &&
  1295. eval add_cflags \$${name}_cflags
  1296. }
  1297. test_exec(){
  1298. test_ld "cc" "$@" && { enabled cross_compile || $TMPE >> $logfile 2>&1; }
  1299. }
  1300. check_exec_crash(){
  1301. log check_exec_crash "$@"
  1302. code=$(cat)
  1303. # exit() is not async signal safe. _Exit (C99) and _exit (POSIX)
  1304. # are safe but may not be available everywhere. Thus we use
  1305. # raise(SIGTERM) instead. The check is run in a subshell so we
  1306. # can redirect the "Terminated" message from the shell. SIGBUS
  1307. # is not defined by standard C so it is used conditionally.
  1308. (test_exec "$@") >> $logfile 2>&1 <<EOF
  1309. #include <signal.h>
  1310. static void sighandler(int sig){
  1311. raise(SIGTERM);
  1312. }
  1313. int foo(void){
  1314. $code
  1315. }
  1316. int (*func_ptr)(void) = foo;
  1317. int main(void){
  1318. signal(SIGILL, sighandler);
  1319. signal(SIGFPE, sighandler);
  1320. signal(SIGSEGV, sighandler);
  1321. #ifdef SIGBUS
  1322. signal(SIGBUS, sighandler);
  1323. #endif
  1324. return func_ptr();
  1325. }
  1326. EOF
  1327. }
  1328. check_type(){
  1329. log check_type "$@"
  1330. headers=$1
  1331. type=$2
  1332. shift 2
  1333. disable_sanitized "$type"
  1334. test_code cc "$headers" "$type v" "$@" && enable_sanitized "$type"
  1335. }
  1336. check_struct(){
  1337. log check_struct "$@"
  1338. headers=$1
  1339. struct=$2
  1340. member=$3
  1341. shift 3
  1342. disable_sanitized "${struct}_${member}"
  1343. test_code cc "$headers" "const void *p = &(($struct *)0)->$member" "$@" &&
  1344. enable_sanitized "${struct}_${member}"
  1345. }
  1346. check_builtin(){
  1347. log check_builtin "$@"
  1348. name=$1
  1349. headers=$2
  1350. builtin=$3
  1351. shift 3
  1352. disable "$name"
  1353. test_code ld "$headers" "$builtin" "cc" "$@" && enable "$name"
  1354. }
  1355. check_compile_assert(){
  1356. log check_compile_assert "$@"
  1357. name=$1
  1358. headers=$2
  1359. condition=$3
  1360. shift 3
  1361. disable "$name"
  1362. test_code cc "$headers" "char c[2 * !!($condition) - 1]" "$@" && enable "$name"
  1363. }
  1364. check_cc(){
  1365. log check_cc "$@"
  1366. name=$1
  1367. shift
  1368. disable "$name"
  1369. test_code cc "$@" && enable "$name"
  1370. }
  1371. require(){
  1372. log require "$@"
  1373. name_version="$1"
  1374. name="${1%% *}"
  1375. shift
  1376. check_lib $name "$@" || die "ERROR: $name_version not found"
  1377. }
  1378. require_cc(){
  1379. log require_cc "$@"
  1380. name="$1"
  1381. check_cc "$@" || die "ERROR: $name failed"
  1382. }
  1383. require_cpp(){
  1384. name="$1"
  1385. headers="$2"
  1386. classes="$3"
  1387. shift 3
  1388. check_lib_cpp "$headers" "$classes" "$@" || die "ERROR: $name not found"
  1389. }
  1390. require_headers(){
  1391. log require_headers "$@"
  1392. headers="$1"
  1393. check_headers "$@" || die "ERROR: $headers not found"
  1394. }
  1395. require_cpp_condition(){
  1396. log require_cpp_condition "$@"
  1397. condition="$3"
  1398. check_cpp_condition "$@" || die "ERROR: $condition not satisfied"
  1399. }
  1400. require_pkg_config(){
  1401. log require_pkg_config "$@"
  1402. pkg_version="$2"
  1403. check_pkg_config "$@" || die "ERROR: $pkg_version not found using pkg-config$pkg_config_fail_message"
  1404. }
  1405. test_host_cc(){
  1406. log test_host_cc "$@"
  1407. cat > $TMPC
  1408. log_file $TMPC
  1409. test_cmd $host_cc $host_cflags "$@" $HOSTCC_C $(hostcc_o $TMPO) $TMPC
  1410. }
  1411. test_host_cpp(){
  1412. log test_host_cpp "$@"
  1413. cat > $TMPC
  1414. log_file $TMPC
  1415. test_cmd $host_cc $host_cppflags $host_cflags "$@" $(hostcc_e $TMPO) $TMPC
  1416. }
  1417. check_host_cppflags(){
  1418. log check_host_cppflags "$@"
  1419. test_host_cpp "$@" <<EOF && append host_cppflags "$@"
  1420. #include <stdlib.h>
  1421. EOF
  1422. }
  1423. check_host_cflags(){
  1424. log check_host_cflags "$@"
  1425. set -- $($host_cflags_filter "$@")
  1426. test_host_cc "$@" <<EOF && append host_cflags "$@"
  1427. int x;
  1428. EOF
  1429. }
  1430. test_host_cpp_condition(){
  1431. log test_host_cpp_condition "$@"
  1432. header=$1
  1433. condition=$2
  1434. shift 2
  1435. test_host_cpp "$@" <<EOF
  1436. #include <$header>
  1437. #if !($condition)
  1438. #error "unsatisfied condition: $condition"
  1439. #endif
  1440. EOF
  1441. }
  1442. check_host_cpp_condition(){
  1443. log check_host_cpp_condition "$@"
  1444. name=$1
  1445. shift 1
  1446. disable $name
  1447. test_host_cpp_condition "$@" && enable $name
  1448. }
  1449. cp_if_changed(){
  1450. cmp -s "$1" "$2" && { test "$quiet" != "yes" && echo "$2 is unchanged"; } && return
  1451. mkdir -p "$(dirname $2)"
  1452. cp -f "$1" "$2"
  1453. }
  1454. # CONFIG_LIST contains configurable options, while HAVE_LIST is for
  1455. # system-dependent things.
  1456. AVCODEC_COMPONENTS="
  1457. bsfs
  1458. decoders
  1459. encoders
  1460. hwaccels
  1461. parsers
  1462. "
  1463. AVDEVICE_COMPONENTS="
  1464. indevs
  1465. outdevs
  1466. "
  1467. AVFILTER_COMPONENTS="
  1468. filters
  1469. "
  1470. AVFORMAT_COMPONENTS="
  1471. demuxers
  1472. muxers
  1473. protocols
  1474. "
  1475. COMPONENT_LIST="
  1476. $AVCODEC_COMPONENTS
  1477. $AVDEVICE_COMPONENTS
  1478. $AVFILTER_COMPONENTS
  1479. $AVFORMAT_COMPONENTS
  1480. "
  1481. EXAMPLE_LIST="
  1482. avio_dir_cmd_example
  1483. avio_reading_example
  1484. decode_audio_example
  1485. decode_video_example
  1486. demuxing_decoding_example
  1487. encode_audio_example
  1488. encode_video_example
  1489. extract_mvs_example
  1490. filter_audio_example
  1491. filtering_audio_example
  1492. filtering_video_example
  1493. http_multiclient_example
  1494. hw_decode_example
  1495. metadata_example
  1496. muxing_example
  1497. qsvdec_example
  1498. remuxing_example
  1499. resampling_audio_example
  1500. scaling_video_example
  1501. transcode_aac_example
  1502. transcoding_example
  1503. vaapi_encode_example
  1504. vaapi_transcode_example
  1505. "
  1506. EXTERNAL_AUTODETECT_LIBRARY_LIST="
  1507. alsa
  1508. appkit
  1509. avfoundation
  1510. bzlib
  1511. coreimage
  1512. iconv
  1513. libxcb
  1514. libxcb_shm
  1515. libxcb_shape
  1516. libxcb_xfixes
  1517. lzma
  1518. schannel
  1519. sdl2
  1520. securetransport
  1521. sndio
  1522. xlib
  1523. zlib
  1524. "
  1525. EXTERNAL_LIBRARY_GPL_LIST="
  1526. avisynth
  1527. frei0r
  1528. libcdio
  1529. libdavs2
  1530. librubberband
  1531. libvidstab
  1532. libx264
  1533. libx265
  1534. libxavs
  1535. libxavs2
  1536. libxvid
  1537. "
  1538. EXTERNAL_LIBRARY_NONFREE_LIST="
  1539. decklink
  1540. libfdk_aac
  1541. openssl
  1542. libtls
  1543. "
  1544. EXTERNAL_LIBRARY_VERSION3_LIST="
  1545. gmp
  1546. libaribb24
  1547. liblensfun
  1548. libopencore_amrnb
  1549. libopencore_amrwb
  1550. libvmaf
  1551. libvo_amrwbenc
  1552. mbedtls
  1553. rkmpp
  1554. "
  1555. EXTERNAL_LIBRARY_GPLV3_LIST="
  1556. libsmbclient
  1557. "
  1558. EXTERNAL_LIBRARY_LIST="
  1559. $EXTERNAL_LIBRARY_GPL_LIST
  1560. $EXTERNAL_LIBRARY_NONFREE_LIST
  1561. $EXTERNAL_LIBRARY_VERSION3_LIST
  1562. $EXTERNAL_LIBRARY_GPLV3_LIST
  1563. chromaprint
  1564. gcrypt
  1565. gnutls
  1566. jni
  1567. ladspa
  1568. libaom
  1569. libass
  1570. libbluray
  1571. libbs2b
  1572. libcaca
  1573. libcelt
  1574. libcodec2
  1575. libdav1d
  1576. libdc1394
  1577. libdrm
  1578. libflite
  1579. libfontconfig
  1580. libfreetype
  1581. libfribidi
  1582. libgme
  1583. libgsm
  1584. libiec61883
  1585. libilbc
  1586. libjack
  1587. libklvanc
  1588. libkvazaar
  1589. libmodplug
  1590. libmp3lame
  1591. libmysofa
  1592. libopencv
  1593. libopenh264
  1594. libopenjpeg
  1595. libopenmpt
  1596. libopus
  1597. libpulse
  1598. librsvg
  1599. librtmp
  1600. libshine
  1601. libsmbclient
  1602. libsnappy
  1603. libsoxr
  1604. libspeex
  1605. libsrt
  1606. libssh
  1607. libtensorflow
  1608. libtesseract
  1609. libtheora
  1610. libtwolame
  1611. libv4l2
  1612. libvorbis
  1613. libvpx
  1614. libwavpack
  1615. libwebp
  1616. libxml2
  1617. libzimg
  1618. libzmq
  1619. libzvbi
  1620. lv2
  1621. mediacodec
  1622. openal
  1623. opengl
  1624. pocketsphinx
  1625. vapoursynth
  1626. "
  1627. HWACCEL_AUTODETECT_LIBRARY_LIST="
  1628. amf
  1629. audiotoolbox
  1630. crystalhd
  1631. cuda
  1632. cuda_llvm
  1633. cuvid
  1634. d3d11va
  1635. dxva2
  1636. ffnvcodec
  1637. nvdec
  1638. nvenc
  1639. vaapi
  1640. vdpau
  1641. videotoolbox
  1642. v4l2_m2m
  1643. xvmc
  1644. "
  1645. # catchall list of things that require external libs to link
  1646. EXTRALIBS_LIST="
  1647. cpu_init
  1648. cws2fws
  1649. "
  1650. HWACCEL_LIBRARY_NONFREE_LIST="
  1651. cuda_nvcc
  1652. cuda_sdk
  1653. libnpp
  1654. "
  1655. HWACCEL_LIBRARY_LIST="
  1656. $HWACCEL_LIBRARY_NONFREE_LIST
  1657. libmfx
  1658. mmal
  1659. omx
  1660. opencl
  1661. "
  1662. DOCUMENT_LIST="
  1663. doc
  1664. htmlpages
  1665. manpages
  1666. podpages
  1667. txtpages
  1668. "
  1669. FEATURE_LIST="
  1670. ftrapv
  1671. gray
  1672. hardcoded_tables
  1673. omx_rpi
  1674. runtime_cpudetect
  1675. safe_bitstream_reader
  1676. shared
  1677. small
  1678. static
  1679. swscale_alpha
  1680. "
  1681. # this list should be kept in linking order
  1682. LIBRARY_LIST="
  1683. avdevice
  1684. avfilter
  1685. swscale
  1686. postproc
  1687. avformat
  1688. avcodec
  1689. swresample
  1690. avresample
  1691. avutil
  1692. "
  1693. LICENSE_LIST="
  1694. gpl
  1695. nonfree
  1696. version3
  1697. "
  1698. PROGRAM_LIST="
  1699. ffplay
  1700. ffprobe
  1701. ffmpeg
  1702. "
  1703. SUBSYSTEM_LIST="
  1704. dct
  1705. dwt
  1706. error_resilience
  1707. faan
  1708. fast_unaligned
  1709. fft
  1710. lsp
  1711. lzo
  1712. mdct
  1713. pixelutils
  1714. network
  1715. rdft
  1716. "
  1717. # COMPONENT_LIST needs to come last to ensure correct dependency checking
  1718. CONFIG_LIST="
  1719. $DOCUMENT_LIST
  1720. $EXAMPLE_LIST
  1721. $EXTERNAL_LIBRARY_LIST
  1722. $EXTERNAL_AUTODETECT_LIBRARY_LIST
  1723. $HWACCEL_LIBRARY_LIST
  1724. $HWACCEL_AUTODETECT_LIBRARY_LIST
  1725. $FEATURE_LIST
  1726. $LICENSE_LIST
  1727. $LIBRARY_LIST
  1728. $PROGRAM_LIST
  1729. $SUBSYSTEM_LIST
  1730. autodetect
  1731. fontconfig
  1732. linux_perf
  1733. memory_poisoning
  1734. neon_clobber_test
  1735. ossfuzz
  1736. pic
  1737. thumb
  1738. valgrind_backtrace
  1739. xmm_clobber_test
  1740. $COMPONENT_LIST
  1741. "
  1742. THREADS_LIST="
  1743. pthreads
  1744. os2threads
  1745. w32threads
  1746. "
  1747. ATOMICS_LIST="
  1748. atomics_gcc
  1749. atomics_suncc
  1750. atomics_win32
  1751. "
  1752. AUTODETECT_LIBS="
  1753. $EXTERNAL_AUTODETECT_LIBRARY_LIST
  1754. $HWACCEL_AUTODETECT_LIBRARY_LIST
  1755. $THREADS_LIST
  1756. "
  1757. ARCH_LIST="
  1758. aarch64
  1759. alpha
  1760. arm
  1761. avr32
  1762. avr32_ap
  1763. avr32_uc
  1764. bfin
  1765. ia64
  1766. m68k
  1767. mips
  1768. mips64
  1769. parisc
  1770. ppc
  1771. ppc64
  1772. s390
  1773. sh4
  1774. sparc
  1775. sparc64
  1776. tilegx
  1777. tilepro
  1778. tomi
  1779. x86
  1780. x86_32
  1781. x86_64
  1782. "
  1783. ARCH_EXT_LIST_ARM="
  1784. armv5te
  1785. armv6
  1786. armv6t2
  1787. armv8
  1788. neon
  1789. vfp
  1790. vfpv3
  1791. setend
  1792. "
  1793. ARCH_EXT_LIST_MIPS="
  1794. mipsfpu
  1795. mips32r2
  1796. mips32r5
  1797. mips64r2
  1798. mips32r6
  1799. mips64r6
  1800. mipsdsp
  1801. mipsdspr2
  1802. msa
  1803. msa2
  1804. "
  1805. ARCH_EXT_LIST_LOONGSON="
  1806. loongson2
  1807. loongson3
  1808. mmi
  1809. "
  1810. ARCH_EXT_LIST_X86_SIMD="
  1811. aesni
  1812. amd3dnow
  1813. amd3dnowext
  1814. avx
  1815. avx2
  1816. avx512
  1817. fma3
  1818. fma4
  1819. mmx
  1820. mmxext
  1821. sse
  1822. sse2
  1823. sse3
  1824. sse4
  1825. sse42
  1826. ssse3
  1827. xop
  1828. "
  1829. ARCH_EXT_LIST_PPC="
  1830. altivec
  1831. dcbzl
  1832. ldbrx
  1833. power8
  1834. ppc4xx
  1835. vsx
  1836. "
  1837. ARCH_EXT_LIST_X86="
  1838. $ARCH_EXT_LIST_X86_SIMD
  1839. cpunop
  1840. i686
  1841. "
  1842. ARCH_EXT_LIST="
  1843. $ARCH_EXT_LIST_ARM
  1844. $ARCH_EXT_LIST_PPC
  1845. $ARCH_EXT_LIST_X86
  1846. $ARCH_EXT_LIST_MIPS
  1847. $ARCH_EXT_LIST_LOONGSON
  1848. "
  1849. ARCH_FEATURES="
  1850. aligned_stack
  1851. fast_64bit
  1852. fast_clz
  1853. fast_cmov
  1854. local_aligned
  1855. simd_align_16
  1856. simd_align_32
  1857. simd_align_64
  1858. "
  1859. BUILTIN_LIST="
  1860. atomic_cas_ptr
  1861. machine_rw_barrier
  1862. MemoryBarrier
  1863. mm_empty
  1864. rdtsc
  1865. sem_timedwait
  1866. sync_val_compare_and_swap
  1867. "
  1868. HAVE_LIST_CMDLINE="
  1869. inline_asm
  1870. symver
  1871. x86asm
  1872. "
  1873. HAVE_LIST_PUB="
  1874. bigendian
  1875. fast_unaligned
  1876. "
  1877. HEADERS_LIST="
  1878. arpa_inet_h
  1879. asm_types_h
  1880. cdio_paranoia_h
  1881. cdio_paranoia_paranoia_h
  1882. cuda_h
  1883. dispatch_dispatch_h
  1884. dev_bktr_ioctl_bt848_h
  1885. dev_bktr_ioctl_meteor_h
  1886. dev_ic_bt8xx_h
  1887. dev_video_bktr_ioctl_bt848_h
  1888. dev_video_meteor_ioctl_meteor_h
  1889. direct_h
  1890. dirent_h
  1891. dxgidebug_h
  1892. dxva_h
  1893. ES2_gl_h
  1894. gsm_h
  1895. io_h
  1896. linux_perf_event_h
  1897. machine_ioctl_bt848_h
  1898. machine_ioctl_meteor_h
  1899. malloc_h
  1900. opencv2_core_core_c_h
  1901. OpenGL_gl3_h
  1902. poll_h
  1903. sys_param_h
  1904. sys_resource_h
  1905. sys_select_h
  1906. sys_soundcard_h
  1907. sys_time_h
  1908. sys_un_h
  1909. sys_videoio_h
  1910. termios_h
  1911. udplite_h
  1912. unistd_h
  1913. valgrind_valgrind_h
  1914. windows_h
  1915. winsock2_h
  1916. "
  1917. INTRINSICS_LIST="
  1918. intrinsics_neon
  1919. "
  1920. COMPLEX_FUNCS="
  1921. cabs
  1922. cexp
  1923. "
  1924. MATH_FUNCS="
  1925. atanf
  1926. atan2f
  1927. cbrt
  1928. cbrtf
  1929. copysign
  1930. cosf
  1931. erf
  1932. exp2
  1933. exp2f
  1934. expf
  1935. hypot
  1936. isfinite
  1937. isinf
  1938. isnan
  1939. ldexpf
  1940. llrint
  1941. llrintf
  1942. log2
  1943. log2f
  1944. log10f
  1945. lrint
  1946. lrintf
  1947. powf
  1948. rint
  1949. round
  1950. roundf
  1951. sinf
  1952. trunc
  1953. truncf
  1954. "
  1955. SYSTEM_FEATURES="
  1956. dos_paths
  1957. libc_msvcrt
  1958. MMAL_PARAMETER_VIDEO_MAX_NUM_CALLBACKS
  1959. section_data_rel_ro
  1960. threads
  1961. uwp
  1962. winrt
  1963. "
  1964. SYSTEM_FUNCS="
  1965. access
  1966. aligned_malloc
  1967. arc4random
  1968. clock_gettime
  1969. closesocket
  1970. CommandLineToArgvW
  1971. fcntl
  1972. getaddrinfo
  1973. gethrtime
  1974. getopt
  1975. GetProcessAffinityMask
  1976. GetProcessMemoryInfo
  1977. GetProcessTimes
  1978. getrusage
  1979. GetSystemTimeAsFileTime
  1980. gettimeofday
  1981. glob
  1982. glXGetProcAddress
  1983. gmtime_r
  1984. inet_aton
  1985. isatty
  1986. kbhit
  1987. localtime_r
  1988. lstat
  1989. lzo1x_999_compress
  1990. mach_absolute_time
  1991. MapViewOfFile
  1992. memalign
  1993. mkstemp
  1994. mmap
  1995. mprotect
  1996. nanosleep
  1997. PeekNamedPipe
  1998. posix_memalign
  1999. pthread_cancel
  2000. sched_getaffinity
  2001. SecItemImport
  2002. SetConsoleTextAttribute
  2003. SetConsoleCtrlHandler
  2004. setmode
  2005. setrlimit
  2006. Sleep
  2007. strerror_r
  2008. sysconf
  2009. sysctl
  2010. usleep
  2011. UTGetOSTypeFromString
  2012. VirtualAlloc
  2013. wglGetProcAddress
  2014. "
  2015. SYSTEM_LIBRARIES="
  2016. bcrypt
  2017. vaapi_drm
  2018. vaapi_x11
  2019. vdpau_x11
  2020. "
  2021. TOOLCHAIN_FEATURES="
  2022. as_arch_directive
  2023. as_dn_directive
  2024. as_fpu_directive
  2025. as_func
  2026. as_object_arch
  2027. asm_mod_q
  2028. blocks_extension
  2029. ebp_available
  2030. ebx_available
  2031. gnu_as
  2032. gnu_windres
  2033. ibm_asm
  2034. inline_asm_direct_symbol_refs
  2035. inline_asm_labels
  2036. inline_asm_nonlocal_labels
  2037. pragma_deprecated
  2038. rsync_contimeout
  2039. symver_asm_label
  2040. symver_gnu_asm
  2041. vfp_args
  2042. xform_asm
  2043. xmm_clobbers
  2044. "
  2045. TYPES_LIST="
  2046. kCMVideoCodecType_HEVC
  2047. kCVPixelFormatType_420YpCbCr10BiPlanarVideoRange
  2048. kCVImageBufferTransferFunction_SMPTE_ST_2084_PQ
  2049. kCVImageBufferTransferFunction_ITU_R_2100_HLG
  2050. kCVImageBufferTransferFunction_Linear
  2051. socklen_t
  2052. struct_addrinfo
  2053. struct_group_source_req
  2054. struct_ip_mreq_source
  2055. struct_ipv6_mreq
  2056. struct_msghdr_msg_flags
  2057. struct_pollfd
  2058. struct_rusage_ru_maxrss
  2059. struct_sctp_event_subscribe
  2060. struct_sockaddr_in6
  2061. struct_sockaddr_sa_len
  2062. struct_sockaddr_storage
  2063. struct_stat_st_mtim_tv_nsec
  2064. struct_v4l2_frmivalenum_discrete
  2065. "
  2066. HAVE_LIST="
  2067. $ARCH_EXT_LIST
  2068. $(add_suffix _external $ARCH_EXT_LIST)
  2069. $(add_suffix _inline $ARCH_EXT_LIST)
  2070. $ARCH_FEATURES
  2071. $BUILTIN_LIST
  2072. $COMPLEX_FUNCS
  2073. $HAVE_LIST_CMDLINE
  2074. $HAVE_LIST_PUB
  2075. $HEADERS_LIST
  2076. $INTRINSICS_LIST
  2077. $MATH_FUNCS
  2078. $SYSTEM_FEATURES
  2079. $SYSTEM_FUNCS
  2080. $SYSTEM_LIBRARIES
  2081. $THREADS_LIST
  2082. $TOOLCHAIN_FEATURES
  2083. $TYPES_LIST
  2084. makeinfo
  2085. makeinfo_html
  2086. opencl_d3d11
  2087. opencl_drm_arm
  2088. opencl_drm_beignet
  2089. opencl_dxva2
  2090. opencl_vaapi_beignet
  2091. opencl_vaapi_intel_media
  2092. perl
  2093. pod2man
  2094. texi2html
  2095. "
  2096. # options emitted with CONFIG_ prefix but not available on the command line
  2097. CONFIG_EXTRA="
  2098. aandcttables
  2099. ac3dsp
  2100. adts_header
  2101. audio_frame_queue
  2102. audiodsp
  2103. blockdsp
  2104. bswapdsp
  2105. cabac
  2106. cbs
  2107. cbs_av1
  2108. cbs_h264
  2109. cbs_h265
  2110. cbs_jpeg
  2111. cbs_mpeg2
  2112. cbs_vp9
  2113. dirac_parse
  2114. dnn
  2115. dvprofile
  2116. exif
  2117. faandct
  2118. faanidct
  2119. fdctdsp
  2120. flacdsp
  2121. fmtconvert
  2122. frame_thread_encoder
  2123. g722dsp
  2124. golomb
  2125. gplv3
  2126. h263dsp
  2127. h264chroma
  2128. h264dsp
  2129. h264parse
  2130. h264pred
  2131. h264qpel
  2132. hevcparse
  2133. hpeldsp
  2134. huffman
  2135. huffyuvdsp
  2136. huffyuvencdsp
  2137. idctdsp
  2138. iirfilter
  2139. mdct15
  2140. intrax8
  2141. iso_media
  2142. ividsp
  2143. jpegtables
  2144. lgplv3
  2145. libx262
  2146. llauddsp
  2147. llviddsp
  2148. llvidencdsp
  2149. lpc
  2150. lzf
  2151. me_cmp
  2152. mpeg_er
  2153. mpegaudio
  2154. mpegaudiodsp
  2155. mpegaudioheader
  2156. mpegvideo
  2157. mpegvideoenc
  2158. mss34dsp
  2159. pixblockdsp
  2160. qpeldsp
  2161. qsv
  2162. qsvdec
  2163. qsvenc
  2164. qsvvpp
  2165. rangecoder
  2166. riffdec
  2167. riffenc
  2168. rtpdec
  2169. rtpenc_chain
  2170. rv34dsp
  2171. scene_sad
  2172. sinewin
  2173. snappy
  2174. srtp
  2175. startcode
  2176. texturedsp
  2177. texturedspenc
  2178. tpeldsp
  2179. vaapi_1
  2180. vaapi_encode
  2181. vc1dsp
  2182. videodsp
  2183. vp3dsp
  2184. vp56dsp
  2185. vp8dsp
  2186. wma_freqs
  2187. wmv2dsp
  2188. "
  2189. CMDLINE_SELECT="
  2190. $ARCH_EXT_LIST
  2191. $CONFIG_LIST
  2192. $HAVE_LIST_CMDLINE
  2193. $THREADS_LIST
  2194. asm
  2195. cross_compile
  2196. debug
  2197. extra_warnings
  2198. logging
  2199. lto
  2200. optimizations
  2201. rpath
  2202. stripping
  2203. "
  2204. PATHS_LIST="
  2205. bindir
  2206. datadir
  2207. docdir
  2208. incdir
  2209. libdir
  2210. mandir
  2211. pkgconfigdir
  2212. prefix
  2213. shlibdir
  2214. install_name_dir
  2215. "
  2216. CMDLINE_SET="
  2217. $PATHS_LIST
  2218. ar
  2219. arch
  2220. as
  2221. assert_level
  2222. build_suffix
  2223. cc
  2224. objcc
  2225. cpu
  2226. cross_prefix
  2227. custom_allocator
  2228. cxx
  2229. dep_cc
  2230. doxygen
  2231. env
  2232. extra_version
  2233. gas
  2234. host_cc
  2235. host_cflags
  2236. host_extralibs
  2237. host_ld
  2238. host_ldflags
  2239. host_os
  2240. ignore_tests
  2241. install
  2242. ld
  2243. ln_s
  2244. logfile
  2245. malloc_prefix
  2246. nm
  2247. optflags
  2248. nvcc
  2249. nvccflags
  2250. pkg_config
  2251. pkg_config_flags
  2252. progs_suffix
  2253. random_seed
  2254. ranlib
  2255. samples
  2256. strip
  2257. sws_max_filter_size
  2258. sysinclude
  2259. sysroot
  2260. target_exec
  2261. target_os
  2262. target_path
  2263. target_samples
  2264. tempprefix
  2265. toolchain
  2266. valgrind
  2267. windres
  2268. x86asmexe
  2269. "
  2270. CMDLINE_APPEND="
  2271. extra_cflags
  2272. extra_cxxflags
  2273. extra_objcflags
  2274. host_cppflags
  2275. "
  2276. # code dependency declarations
  2277. # architecture extensions
  2278. armv5te_deps="arm"
  2279. armv6_deps="arm"
  2280. armv6t2_deps="arm"
  2281. armv8_deps="aarch64"
  2282. neon_deps_any="aarch64 arm"
  2283. intrinsics_neon_deps="neon"
  2284. vfp_deps_any="aarch64 arm"
  2285. vfpv3_deps="vfp"
  2286. setend_deps="arm"
  2287. map 'eval ${v}_inline_deps=inline_asm' $ARCH_EXT_LIST_ARM
  2288. altivec_deps="ppc"
  2289. dcbzl_deps="ppc"
  2290. ldbrx_deps="ppc"
  2291. ppc4xx_deps="ppc"
  2292. vsx_deps="altivec"
  2293. power8_deps="vsx"
  2294. loongson2_deps="mips"
  2295. loongson3_deps="mips"
  2296. mips32r2_deps="mips"
  2297. mips32r5_deps="mips"
  2298. mips32r6_deps="mips"
  2299. mips64r2_deps="mips"
  2300. mips64r6_deps="mips"
  2301. mipsfpu_deps="mips"
  2302. mipsdsp_deps="mips"
  2303. mipsdspr2_deps="mips"
  2304. mmi_deps="mips"
  2305. msa_deps="mipsfpu"
  2306. msa2_deps="msa"
  2307. cpunop_deps="i686"
  2308. x86_64_select="i686"
  2309. x86_64_suggest="fast_cmov"
  2310. amd3dnow_deps="mmx"
  2311. amd3dnowext_deps="amd3dnow"
  2312. i686_deps="x86"
  2313. mmx_deps="x86"
  2314. mmxext_deps="mmx"
  2315. sse_deps="mmxext"
  2316. sse2_deps="sse"
  2317. sse3_deps="sse2"
  2318. ssse3_deps="sse3"
  2319. sse4_deps="ssse3"
  2320. sse42_deps="sse4"
  2321. aesni_deps="sse42"
  2322. avx_deps="sse42"
  2323. xop_deps="avx"
  2324. fma3_deps="avx"
  2325. fma4_deps="avx"
  2326. avx2_deps="avx"
  2327. avx512_deps="avx2"
  2328. mmx_external_deps="x86asm"
  2329. mmx_inline_deps="inline_asm x86"
  2330. mmx_suggest="mmx_external mmx_inline"
  2331. for ext in $(filter_out mmx $ARCH_EXT_LIST_X86_SIMD); do
  2332. eval dep=\$${ext}_deps
  2333. eval ${ext}_external_deps='"${dep}_external"'
  2334. eval ${ext}_inline_deps='"${dep}_inline"'
  2335. eval ${ext}_suggest='"${ext}_external ${ext}_inline"'
  2336. done
  2337. aligned_stack_if_any="aarch64 ppc x86"
  2338. fast_64bit_if_any="aarch64 alpha ia64 mips64 parisc64 ppc64 sparc64 x86_64"
  2339. fast_clz_if_any="aarch64 alpha avr32 mips ppc x86"
  2340. fast_unaligned_if_any="aarch64 ppc x86"
  2341. simd_align_16_if_any="altivec neon sse"
  2342. simd_align_32_if_any="avx"
  2343. simd_align_64_if_any="avx512"
  2344. # system capabilities
  2345. linux_perf_deps="linux_perf_event_h"
  2346. symver_if_any="symver_asm_label symver_gnu_asm"
  2347. valgrind_backtrace_conflict="optimizations"
  2348. valgrind_backtrace_deps="valgrind_valgrind_h"
  2349. # threading support
  2350. atomics_gcc_if="sync_val_compare_and_swap"
  2351. atomics_suncc_if="atomic_cas_ptr machine_rw_barrier"
  2352. atomics_win32_if="MemoryBarrier"
  2353. atomics_native_if_any="$ATOMICS_LIST"
  2354. w32threads_deps="atomics_native"
  2355. threads_if_any="$THREADS_LIST"
  2356. # subsystems
  2357. cbs_av1_select="cbs"
  2358. cbs_h264_select="cbs"
  2359. cbs_h265_select="cbs"
  2360. cbs_jpeg_select="cbs"
  2361. cbs_mpeg2_select="cbs"
  2362. cbs_vp9_select="cbs"
  2363. dct_select="rdft"
  2364. dirac_parse_select="golomb"
  2365. dnn_suggest="libtensorflow"
  2366. error_resilience_select="me_cmp"
  2367. faandct_deps="faan"
  2368. faandct_select="fdctdsp"
  2369. faanidct_deps="faan"
  2370. faanidct_select="idctdsp"
  2371. h264dsp_select="startcode"
  2372. hevcparse_select="golomb"
  2373. frame_thread_encoder_deps="encoders threads"
  2374. intrax8_select="blockdsp idctdsp"
  2375. mdct_select="fft"
  2376. mdct15_select="fft"
  2377. me_cmp_select="fdctdsp idctdsp pixblockdsp"
  2378. mpeg_er_select="error_resilience"
  2379. mpegaudio_select="mpegaudiodsp mpegaudioheader"
  2380. mpegaudiodsp_select="dct"
  2381. mpegvideo_select="blockdsp h264chroma hpeldsp idctdsp me_cmp mpeg_er videodsp"
  2382. mpegvideoenc_select="aandcttables me_cmp mpegvideo pixblockdsp qpeldsp"
  2383. vc1dsp_select="h264chroma qpeldsp startcode"
  2384. rdft_select="fft"
  2385. # decoders / encoders
  2386. aac_decoder_select="adts_header mdct15 mdct sinewin"
  2387. aac_fixed_decoder_select="adts_header mdct sinewin"
  2388. aac_encoder_select="audio_frame_queue iirfilter lpc mdct sinewin"
  2389. aac_latm_decoder_select="aac_decoder aac_latm_parser"
  2390. ac3_decoder_select="ac3_parser ac3dsp bswapdsp fmtconvert mdct"
  2391. ac3_fixed_decoder_select="ac3_parser ac3dsp bswapdsp mdct"
  2392. ac3_encoder_select="ac3dsp audiodsp mdct me_cmp"
  2393. ac3_fixed_encoder_select="ac3dsp audiodsp mdct me_cmp"
  2394. adpcm_g722_decoder_select="g722dsp"
  2395. adpcm_g722_encoder_select="g722dsp"
  2396. aic_decoder_select="golomb idctdsp"
  2397. alac_encoder_select="lpc"
  2398. als_decoder_select="bswapdsp"
  2399. amrnb_decoder_select="lsp"
  2400. amrwb_decoder_select="lsp"
  2401. amv_decoder_select="sp5x_decoder exif"
  2402. amv_encoder_select="jpegtables mpegvideoenc"
  2403. ape_decoder_select="bswapdsp llauddsp"
  2404. apng_decoder_deps="zlib"
  2405. apng_encoder_deps="zlib"
  2406. apng_encoder_select="llvidencdsp"
  2407. aptx_decoder_select="audio_frame_queue"
  2408. aptx_encoder_select="audio_frame_queue"
  2409. aptx_hd_decoder_select="audio_frame_queue"
  2410. aptx_hd_encoder_select="audio_frame_queue"
  2411. asv1_decoder_select="blockdsp bswapdsp idctdsp"
  2412. asv1_encoder_select="aandcttables bswapdsp fdctdsp pixblockdsp"
  2413. asv2_decoder_select="blockdsp bswapdsp idctdsp"
  2414. asv2_encoder_select="aandcttables bswapdsp fdctdsp pixblockdsp"
  2415. atrac1_decoder_select="mdct sinewin"
  2416. atrac3_decoder_select="mdct"
  2417. atrac3al_decoder_select="mdct"
  2418. atrac3p_decoder_select="mdct sinewin"
  2419. atrac3pal_decoder_select="mdct sinewin"
  2420. atrac9_decoder_select="mdct"
  2421. avrn_decoder_select="exif jpegtables"
  2422. bink_decoder_select="blockdsp hpeldsp"
  2423. binkaudio_dct_decoder_select="mdct rdft dct sinewin wma_freqs"
  2424. binkaudio_rdft_decoder_select="mdct rdft sinewin wma_freqs"
  2425. cavs_decoder_select="blockdsp golomb h264chroma idctdsp qpeldsp videodsp"
  2426. clearvideo_decoder_select="idctdsp"
  2427. cllc_decoder_select="bswapdsp"
  2428. comfortnoise_encoder_select="lpc"
  2429. cook_decoder_select="audiodsp mdct sinewin"
  2430. cscd_decoder_select="lzo"
  2431. cscd_decoder_suggest="zlib"
  2432. dca_decoder_select="mdct"
  2433. dds_decoder_select="texturedsp"
  2434. dirac_decoder_select="dirac_parse dwt golomb videodsp mpegvideoenc"
  2435. dnxhd_decoder_select="blockdsp idctdsp"
  2436. dnxhd_encoder_select="blockdsp fdctdsp idctdsp mpegvideoenc pixblockdsp"
  2437. dolby_e_decoder_select="mdct"
  2438. dvvideo_decoder_select="dvprofile idctdsp"
  2439. dvvideo_encoder_select="dvprofile fdctdsp me_cmp pixblockdsp"
  2440. dxa_decoder_deps="zlib"
  2441. dxv_decoder_select="lzf texturedsp"
  2442. eac3_decoder_select="ac3_decoder"
  2443. eac3_encoder_select="ac3_encoder"
  2444. eamad_decoder_select="aandcttables blockdsp bswapdsp idctdsp mpegvideo"
  2445. eatgq_decoder_select="aandcttables"
  2446. eatqi_decoder_select="aandcttables blockdsp bswapdsp idctdsp"
  2447. exr_decoder_deps="zlib"
  2448. ffv1_decoder_select="rangecoder"
  2449. ffv1_encoder_select="rangecoder"
  2450. ffvhuff_decoder_select="huffyuv_decoder"
  2451. ffvhuff_encoder_select="huffyuv_encoder"
  2452. fic_decoder_select="golomb"
  2453. flac_decoder_select="flacdsp"
  2454. flac_encoder_select="bswapdsp flacdsp lpc"
  2455. flashsv2_decoder_deps="zlib"
  2456. flashsv2_encoder_deps="zlib"
  2457. flashsv_decoder_deps="zlib"
  2458. flashsv_encoder_deps="zlib"
  2459. flv_decoder_select="h263_decoder"
  2460. flv_encoder_select="h263_encoder"
  2461. fourxm_decoder_select="blockdsp bswapdsp"
  2462. fraps_decoder_select="bswapdsp huffman"
  2463. g2m_decoder_deps="zlib"
  2464. g2m_decoder_select="blockdsp idctdsp jpegtables"
  2465. g729_decoder_select="audiodsp"
  2466. h261_decoder_select="mpegvideo"
  2467. h261_encoder_select="mpegvideoenc"
  2468. h263_decoder_select="h263_parser h263dsp mpegvideo qpeldsp"
  2469. h263_encoder_select="h263dsp mpegvideoenc"
  2470. h263i_decoder_select="h263_decoder"
  2471. h263p_decoder_select="h263_decoder"
  2472. h263p_encoder_select="h263_encoder"
  2473. h264_decoder_select="cabac golomb h264chroma h264dsp h264parse h264pred h264qpel videodsp"
  2474. h264_decoder_suggest="error_resilience"
  2475. hap_decoder_select="snappy texturedsp"
  2476. hap_encoder_deps="libsnappy"
  2477. hap_encoder_select="texturedspenc"
  2478. hevc_decoder_select="bswapdsp cabac golomb hevcparse videodsp"
  2479. huffyuv_decoder_select="bswapdsp huffyuvdsp llviddsp"
  2480. huffyuv_encoder_select="bswapdsp huffman huffyuvencdsp llvidencdsp"
  2481. hymt_decoder_select="huffyuv_decoder"
  2482. iac_decoder_select="imc_decoder"
  2483. imc_decoder_select="bswapdsp fft mdct sinewin"
  2484. imm5_decoder_select="h264_decoder hevc_decoder"
  2485. indeo3_decoder_select="hpeldsp"
  2486. indeo4_decoder_select="ividsp"
  2487. indeo5_decoder_select="ividsp"
  2488. interplay_video_decoder_select="hpeldsp"
  2489. jpegls_decoder_select="mjpeg_decoder"
  2490. jv_decoder_select="blockdsp"
  2491. lagarith_decoder_select="llviddsp"
  2492. ljpeg_encoder_select="idctdsp jpegtables mpegvideoenc"
  2493. lscr_decoder_deps="zlib"
  2494. magicyuv_decoder_select="llviddsp"
  2495. magicyuv_encoder_select="llvidencdsp"
  2496. mdec_decoder_select="blockdsp idctdsp mpegvideo"
  2497. metasound_decoder_select="lsp mdct sinewin"
  2498. mimic_decoder_select="blockdsp bswapdsp hpeldsp idctdsp"
  2499. mjpeg_decoder_select="blockdsp hpeldsp exif idctdsp jpegtables"
  2500. mjpeg_encoder_select="jpegtables mpegvideoenc"
  2501. mjpegb_decoder_select="mjpeg_decoder"
  2502. mlp_decoder_select="mlp_parser"
  2503. mlp_encoder_select="lpc audio_frame_queue"
  2504. motionpixels_decoder_select="bswapdsp"
  2505. mp1_decoder_select="mpegaudio"
  2506. mp1float_decoder_select="mpegaudio"
  2507. mp2_decoder_select="mpegaudio"
  2508. mp2float_decoder_select="mpegaudio"
  2509. mp3_decoder_select="mpegaudio"
  2510. mp3adu_decoder_select="mpegaudio"
  2511. mp3adufloat_decoder_select="mpegaudio"
  2512. mp3float_decoder_select="mpegaudio"
  2513. mp3on4_decoder_select="mpegaudio"
  2514. mp3on4float_decoder_select="mpegaudio"
  2515. mpc7_decoder_select="bswapdsp mpegaudiodsp"
  2516. mpc8_decoder_select="mpegaudiodsp"
  2517. mpegvideo_decoder_select="mpegvideo"
  2518. mpeg1video_decoder_select="mpegvideo"
  2519. mpeg1video_encoder_select="mpegvideoenc h263dsp"
  2520. mpeg2video_decoder_select="mpegvideo"
  2521. mpeg2video_encoder_select="mpegvideoenc h263dsp"
  2522. mpeg4_decoder_select="h263_decoder mpeg4video_parser"
  2523. mpeg4_encoder_select="h263_encoder"
  2524. msa1_decoder_select="mss34dsp"
  2525. mscc_decoder_deps="zlib"
  2526. msmpeg4v1_decoder_select="h263_decoder"
  2527. msmpeg4v2_decoder_select="h263_decoder"
  2528. msmpeg4v2_encoder_select="h263_encoder"
  2529. msmpeg4v3_decoder_select="h263_decoder"
  2530. msmpeg4v3_encoder_select="h263_encoder"
  2531. mss2_decoder_select="mpegvideo qpeldsp vc1_decoder"
  2532. mts2_decoder_select="mss34dsp"
  2533. mwsc_decoder_deps="zlib"
  2534. mxpeg_decoder_select="mjpeg_decoder"
  2535. nellymoser_decoder_select="mdct sinewin"
  2536. nellymoser_encoder_select="audio_frame_queue mdct sinewin"
  2537. nuv_decoder_select="idctdsp lzo"
  2538. on2avc_decoder_select="mdct"
  2539. opus_decoder_deps="swresample"
  2540. opus_decoder_select="mdct15"
  2541. opus_encoder_select="audio_frame_queue mdct15"
  2542. png_decoder_deps="zlib"
  2543. png_encoder_deps="zlib"
  2544. png_encoder_select="llvidencdsp"
  2545. prores_decoder_select="blockdsp idctdsp"
  2546. prores_encoder_select="fdctdsp"
  2547. qcelp_decoder_select="lsp"
  2548. qdm2_decoder_select="mdct rdft mpegaudiodsp"
  2549. ra_144_decoder_select="audiodsp"
  2550. ra_144_encoder_select="audio_frame_queue lpc audiodsp"
  2551. ralf_decoder_select="golomb"
  2552. rasc_decoder_deps="zlib"
  2553. rawvideo_decoder_select="bswapdsp"
  2554. rscc_decoder_deps="zlib"
  2555. rtjpeg_decoder_select="me_cmp"
  2556. rv10_decoder_select="h263_decoder"
  2557. rv10_encoder_select="h263_encoder"
  2558. rv20_decoder_select="h263_decoder"
  2559. rv20_encoder_select="h263_encoder"
  2560. rv30_decoder_select="golomb h264pred h264qpel mpegvideo rv34dsp"
  2561. rv40_decoder_select="golomb h264pred h264qpel mpegvideo rv34dsp"
  2562. screenpresso_decoder_deps="zlib"
  2563. shorten_decoder_select="bswapdsp"
  2564. sipr_decoder_select="lsp"
  2565. snow_decoder_select="dwt h264qpel hpeldsp me_cmp rangecoder videodsp"
  2566. snow_encoder_select="dwt h264qpel hpeldsp me_cmp mpegvideoenc rangecoder"
  2567. sonic_decoder_select="golomb rangecoder"
  2568. sonic_encoder_select="golomb rangecoder"
  2569. sonic_ls_encoder_select="golomb rangecoder"
  2570. sp5x_decoder_select="mjpeg_decoder"
  2571. speedhq_decoder_select="mpegvideo"
  2572. srgc_decoder_deps="zlib"
  2573. svq1_decoder_select="hpeldsp"
  2574. svq1_encoder_select="hpeldsp me_cmp mpegvideoenc"
  2575. svq3_decoder_select="golomb h264dsp h264parse h264pred hpeldsp tpeldsp videodsp"
  2576. svq3_decoder_suggest="zlib"
  2577. tak_decoder_select="audiodsp"
  2578. tdsc_decoder_deps="zlib"
  2579. tdsc_decoder_select="mjpeg_decoder"
  2580. theora_decoder_select="vp3_decoder"
  2581. thp_decoder_select="mjpeg_decoder"
  2582. tiff_decoder_select="mjpeg_decoder"
  2583. tiff_decoder_suggest="zlib lzma"
  2584. tiff_encoder_suggest="zlib"
  2585. truehd_decoder_select="mlp_parser"
  2586. truehd_encoder_select="lpc audio_frame_queue"
  2587. truemotion2_decoder_select="bswapdsp"
  2588. truespeech_decoder_select="bswapdsp"
  2589. tscc_decoder_deps="zlib"
  2590. twinvq_decoder_select="mdct lsp sinewin"
  2591. txd_decoder_select="texturedsp"
  2592. utvideo_decoder_select="bswapdsp llviddsp"
  2593. utvideo_encoder_select="bswapdsp huffman llvidencdsp"
  2594. vble_decoder_select="llviddsp"
  2595. vc1_decoder_select="blockdsp h263_decoder h264qpel intrax8 mpegvideo vc1dsp"
  2596. vc1image_decoder_select="vc1_decoder"
  2597. vorbis_decoder_select="mdct"
  2598. vorbis_encoder_select="audio_frame_queue mdct"
  2599. vp3_decoder_select="hpeldsp vp3dsp videodsp"
  2600. vp4_decoder_select="vp3_decoder"
  2601. vp5_decoder_select="h264chroma hpeldsp videodsp vp3dsp vp56dsp"
  2602. vp6_decoder_select="h264chroma hpeldsp huffman videodsp vp3dsp vp56dsp"
  2603. vp6a_decoder_select="vp6_decoder"
  2604. vp6f_decoder_select="vp6_decoder"
  2605. vp7_decoder_select="h264pred videodsp vp8dsp"
  2606. vp8_decoder_select="h264pred videodsp vp8dsp"
  2607. vp9_decoder_select="videodsp vp9_parser vp9_superframe_split_bsf"
  2608. wcmv_decoder_deps="zlib"
  2609. webp_decoder_select="vp8_decoder exif"
  2610. wmalossless_decoder_select="llauddsp"
  2611. wmapro_decoder_select="mdct sinewin wma_freqs"
  2612. wmav1_decoder_select="mdct sinewin wma_freqs"
  2613. wmav1_encoder_select="mdct sinewin wma_freqs"
  2614. wmav2_decoder_select="mdct sinewin wma_freqs"
  2615. wmav2_encoder_select="mdct sinewin wma_freqs"
  2616. wmavoice_decoder_select="lsp rdft dct mdct sinewin"
  2617. wmv1_decoder_select="h263_decoder"
  2618. wmv1_encoder_select="h263_encoder"
  2619. wmv2_decoder_select="blockdsp error_resilience h263_decoder idctdsp intrax8 videodsp wmv2dsp"
  2620. wmv2_encoder_select="h263_encoder wmv2dsp"
  2621. wmv3_decoder_select="vc1_decoder"
  2622. wmv3image_decoder_select="wmv3_decoder"
  2623. xma1_decoder_select="wmapro_decoder"
  2624. xma2_decoder_select="wmapro_decoder"
  2625. zerocodec_decoder_deps="zlib"
  2626. zlib_decoder_deps="zlib"
  2627. zlib_encoder_deps="zlib"
  2628. zmbv_decoder_deps="zlib"
  2629. zmbv_encoder_deps="zlib"
  2630. # hardware accelerators
  2631. crystalhd_deps="libcrystalhd_libcrystalhd_if_h"
  2632. cuda_deps="ffnvcodec"
  2633. cuvid_deps="ffnvcodec"
  2634. d3d11va_deps="dxva_h ID3D11VideoDecoder ID3D11VideoContext"
  2635. dxva2_deps="dxva2api_h DXVA2_ConfigPictureDecode ole32 user32"
  2636. ffnvcodec_deps_any="libdl LoadLibrary"
  2637. nvdec_deps="ffnvcodec"
  2638. vaapi_x11_deps="xlib"
  2639. videotoolbox_hwaccel_deps="videotoolbox pthreads"
  2640. videotoolbox_hwaccel_extralibs="-framework QuartzCore"
  2641. xvmc_deps="X11_extensions_XvMClib_h"
  2642. h263_vaapi_hwaccel_deps="vaapi"
  2643. h263_vaapi_hwaccel_select="h263_decoder"
  2644. h263_videotoolbox_hwaccel_deps="videotoolbox"
  2645. h263_videotoolbox_hwaccel_select="h263_decoder"
  2646. h264_d3d11va_hwaccel_deps="d3d11va"
  2647. h264_d3d11va_hwaccel_select="h264_decoder"
  2648. h264_d3d11va2_hwaccel_deps="d3d11va"
  2649. h264_d3d11va2_hwaccel_select="h264_decoder"
  2650. h264_dxva2_hwaccel_deps="dxva2"
  2651. h264_dxva2_hwaccel_select="h264_decoder"
  2652. h264_nvdec_hwaccel_deps="nvdec"
  2653. h264_nvdec_hwaccel_select="h264_decoder"
  2654. h264_vaapi_hwaccel_deps="vaapi"
  2655. h264_vaapi_hwaccel_select="h264_decoder"
  2656. h264_vdpau_hwaccel_deps="vdpau"
  2657. h264_vdpau_hwaccel_select="h264_decoder"
  2658. h264_videotoolbox_hwaccel_deps="videotoolbox"
  2659. h264_videotoolbox_hwaccel_select="h264_decoder"
  2660. hevc_d3d11va_hwaccel_deps="d3d11va DXVA_PicParams_HEVC"
  2661. hevc_d3d11va_hwaccel_select="hevc_decoder"
  2662. hevc_d3d11va2_hwaccel_deps="d3d11va DXVA_PicParams_HEVC"
  2663. hevc_d3d11va2_hwaccel_select="hevc_decoder"
  2664. hevc_dxva2_hwaccel_deps="dxva2 DXVA_PicParams_HEVC"
  2665. hevc_dxva2_hwaccel_select="hevc_decoder"
  2666. hevc_nvdec_hwaccel_deps="nvdec"
  2667. hevc_nvdec_hwaccel_select="hevc_decoder"
  2668. hevc_vaapi_hwaccel_deps="vaapi VAPictureParameterBufferHEVC"
  2669. hevc_vaapi_hwaccel_select="hevc_decoder"
  2670. hevc_vdpau_hwaccel_deps="vdpau VdpPictureInfoHEVC"
  2671. hevc_vdpau_hwaccel_select="hevc_decoder"
  2672. hevc_videotoolbox_hwaccel_deps="videotoolbox"
  2673. hevc_videotoolbox_hwaccel_select="hevc_decoder"
  2674. mjpeg_nvdec_hwaccel_deps="nvdec"
  2675. mjpeg_nvdec_hwaccel_select="mjpeg_decoder"
  2676. mjpeg_vaapi_hwaccel_deps="vaapi"
  2677. mjpeg_vaapi_hwaccel_select="mjpeg_decoder"
  2678. mpeg_xvmc_hwaccel_deps="xvmc"
  2679. mpeg_xvmc_hwaccel_select="mpeg2video_decoder"
  2680. mpeg1_nvdec_hwaccel_deps="nvdec"
  2681. mpeg1_nvdec_hwaccel_select="mpeg1video_decoder"
  2682. mpeg1_vdpau_hwaccel_deps="vdpau"
  2683. mpeg1_vdpau_hwaccel_select="mpeg1video_decoder"
  2684. mpeg1_videotoolbox_hwaccel_deps="videotoolbox"
  2685. mpeg1_videotoolbox_hwaccel_select="mpeg1video_decoder"
  2686. mpeg1_xvmc_hwaccel_deps="xvmc"
  2687. mpeg1_xvmc_hwaccel_select="mpeg1video_decoder"
  2688. mpeg2_d3d11va_hwaccel_deps="d3d11va"
  2689. mpeg2_d3d11va_hwaccel_select="mpeg2video_decoder"
  2690. mpeg2_d3d11va2_hwaccel_deps="d3d11va"
  2691. mpeg2_d3d11va2_hwaccel_select="mpeg2video_decoder"
  2692. mpeg2_dxva2_hwaccel_deps="dxva2"
  2693. mpeg2_dxva2_hwaccel_select="mpeg2video_decoder"
  2694. mpeg2_nvdec_hwaccel_deps="nvdec"
  2695. mpeg2_nvdec_hwaccel_select="mpeg2video_decoder"
  2696. mpeg2_vaapi_hwaccel_deps="vaapi"
  2697. mpeg2_vaapi_hwaccel_select="mpeg2video_decoder"
  2698. mpeg2_vdpau_hwaccel_deps="vdpau"
  2699. mpeg2_vdpau_hwaccel_select="mpeg2video_decoder"
  2700. mpeg2_videotoolbox_hwaccel_deps="videotoolbox"
  2701. mpeg2_videotoolbox_hwaccel_select="mpeg2video_decoder"
  2702. mpeg2_xvmc_hwaccel_deps="xvmc"
  2703. mpeg2_xvmc_hwaccel_select="mpeg2video_decoder"
  2704. mpeg4_nvdec_hwaccel_deps="nvdec"
  2705. mpeg4_nvdec_hwaccel_select="mpeg4_decoder"
  2706. mpeg4_vaapi_hwaccel_deps="vaapi"
  2707. mpeg4_vaapi_hwaccel_select="mpeg4_decoder"
  2708. mpeg4_vdpau_hwaccel_deps="vdpau"
  2709. mpeg4_vdpau_hwaccel_select="mpeg4_decoder"
  2710. mpeg4_videotoolbox_hwaccel_deps="videotoolbox"
  2711. mpeg4_videotoolbox_hwaccel_select="mpeg4_decoder"
  2712. vc1_d3d11va_hwaccel_deps="d3d11va"
  2713. vc1_d3d11va_hwaccel_select="vc1_decoder"
  2714. vc1_d3d11va2_hwaccel_deps="d3d11va"
  2715. vc1_d3d11va2_hwaccel_select="vc1_decoder"
  2716. vc1_dxva2_hwaccel_deps="dxva2"
  2717. vc1_dxva2_hwaccel_select="vc1_decoder"
  2718. vc1_nvdec_hwaccel_deps="nvdec"
  2719. vc1_nvdec_hwaccel_select="vc1_decoder"
  2720. vc1_vaapi_hwaccel_deps="vaapi"
  2721. vc1_vaapi_hwaccel_select="vc1_decoder"
  2722. vc1_vdpau_hwaccel_deps="vdpau"
  2723. vc1_vdpau_hwaccel_select="vc1_decoder"
  2724. vp8_nvdec_hwaccel_deps="nvdec"
  2725. vp8_nvdec_hwaccel_select="vp8_decoder"
  2726. vp8_vaapi_hwaccel_deps="vaapi"
  2727. vp8_vaapi_hwaccel_select="vp8_decoder"
  2728. vp9_d3d11va_hwaccel_deps="d3d11va DXVA_PicParams_VP9"
  2729. vp9_d3d11va_hwaccel_select="vp9_decoder"
  2730. vp9_d3d11va2_hwaccel_deps="d3d11va DXVA_PicParams_VP9"
  2731. vp9_d3d11va2_hwaccel_select="vp9_decoder"
  2732. vp9_dxva2_hwaccel_deps="dxva2 DXVA_PicParams_VP9"
  2733. vp9_dxva2_hwaccel_select="vp9_decoder"
  2734. vp9_nvdec_hwaccel_deps="nvdec"
  2735. vp9_nvdec_hwaccel_select="vp9_decoder"
  2736. vp9_vaapi_hwaccel_deps="vaapi VADecPictureParameterBufferVP9_bit_depth"
  2737. vp9_vaapi_hwaccel_select="vp9_decoder"
  2738. vp9_vdpau_hwaccel_deps="vdpau VdpPictureInfoVP9"
  2739. vp9_vdpau_hwaccel_select="vp9_decoder"
  2740. wmv3_d3d11va_hwaccel_select="vc1_d3d11va_hwaccel"
  2741. wmv3_d3d11va2_hwaccel_select="vc1_d3d11va2_hwaccel"
  2742. wmv3_dxva2_hwaccel_select="vc1_dxva2_hwaccel"
  2743. wmv3_nvdec_hwaccel_select="vc1_nvdec_hwaccel"
  2744. wmv3_vaapi_hwaccel_select="vc1_vaapi_hwaccel"
  2745. wmv3_vdpau_hwaccel_select="vc1_vdpau_hwaccel"
  2746. # hardware-accelerated codecs
  2747. omx_deps="libdl pthreads"
  2748. omx_rpi_select="omx"
  2749. qsv_deps="libmfx"
  2750. qsvdec_select="qsv"
  2751. qsvenc_select="qsv"
  2752. qsvvpp_select="qsv"
  2753. vaapi_encode_deps="vaapi"
  2754. v4l2_m2m_deps="linux_videodev2_h sem_timedwait"
  2755. hwupload_cuda_filter_deps="ffnvcodec"
  2756. scale_npp_filter_deps="ffnvcodec libnpp"
  2757. scale_cuda_filter_deps="ffnvcodec"
  2758. scale_cuda_filter_deps_any="cuda_nvcc cuda_llvm"
  2759. thumbnail_cuda_filter_deps="ffnvcodec"
  2760. thumbnail_cuda_filter_deps_any="cuda_nvcc cuda_llvm"
  2761. transpose_npp_filter_deps="ffnvcodec libnpp"
  2762. amf_deps_any="libdl LoadLibrary"
  2763. nvenc_deps="ffnvcodec"
  2764. nvenc_deps_any="libdl LoadLibrary"
  2765. nvenc_encoder_deps="nvenc"
  2766. h263_v4l2m2m_decoder_deps="v4l2_m2m h263_v4l2_m2m"
  2767. h263_v4l2m2m_encoder_deps="v4l2_m2m h263_v4l2_m2m"
  2768. h264_amf_encoder_deps="amf"
  2769. h264_crystalhd_decoder_select="crystalhd h264_mp4toannexb_bsf h264_parser"
  2770. h264_cuvid_decoder_deps="cuvid"
  2771. h264_cuvid_decoder_select="h264_mp4toannexb_bsf"
  2772. h264_mediacodec_decoder_deps="mediacodec"
  2773. h264_mediacodec_decoder_select="h264_mp4toannexb_bsf h264_parser"
  2774. h264_mmal_decoder_deps="mmal"
  2775. h264_nvenc_encoder_deps="nvenc"
  2776. h264_omx_encoder_deps="omx"
  2777. h264_qsv_decoder_select="h264_mp4toannexb_bsf qsvdec"
  2778. h264_qsv_encoder_select="qsvenc"
  2779. h264_rkmpp_decoder_deps="rkmpp"
  2780. h264_rkmpp_decoder_select="h264_mp4toannexb_bsf"
  2781. h264_vaapi_encoder_select="cbs_h264 vaapi_encode"
  2782. h264_v4l2m2m_decoder_deps="v4l2_m2m h264_v4l2_m2m"
  2783. h264_v4l2m2m_decoder_select="h264_mp4toannexb_bsf"
  2784. h264_v4l2m2m_encoder_deps="v4l2_m2m h264_v4l2_m2m"
  2785. hevc_amf_encoder_deps="amf"
  2786. hevc_cuvid_decoder_deps="cuvid"
  2787. hevc_cuvid_decoder_select="hevc_mp4toannexb_bsf"
  2788. hevc_mediacodec_decoder_deps="mediacodec"
  2789. hevc_mediacodec_decoder_select="hevc_mp4toannexb_bsf hevc_parser"
  2790. hevc_nvenc_encoder_deps="nvenc"
  2791. hevc_qsv_decoder_select="hevc_mp4toannexb_bsf qsvdec"
  2792. hevc_qsv_encoder_select="hevcparse qsvenc"
  2793. hevc_rkmpp_decoder_deps="rkmpp"
  2794. hevc_rkmpp_decoder_select="hevc_mp4toannexb_bsf"
  2795. hevc_vaapi_encoder_deps="VAEncPictureParameterBufferHEVC"
  2796. hevc_vaapi_encoder_select="cbs_h265 vaapi_encode"
  2797. hevc_v4l2m2m_decoder_deps="v4l2_m2m hevc_v4l2_m2m"
  2798. hevc_v4l2m2m_decoder_select="hevc_mp4toannexb_bsf"
  2799. hevc_v4l2m2m_encoder_deps="v4l2_m2m hevc_v4l2_m2m"
  2800. mjpeg_cuvid_decoder_deps="cuvid"
  2801. mjpeg_qsv_decoder_select="qsvdec"
  2802. mjpeg_qsv_encoder_deps="libmfx"
  2803. mjpeg_qsv_encoder_select="qsvenc"
  2804. mjpeg_vaapi_encoder_deps="VAEncPictureParameterBufferJPEG"
  2805. mjpeg_vaapi_encoder_select="cbs_jpeg jpegtables vaapi_encode"
  2806. mpeg1_cuvid_decoder_deps="cuvid"
  2807. mpeg1_v4l2m2m_decoder_deps="v4l2_m2m mpeg1_v4l2_m2m"
  2808. mpeg2_crystalhd_decoder_select="crystalhd"
  2809. mpeg2_cuvid_decoder_deps="cuvid"
  2810. mpeg2_mmal_decoder_deps="mmal"
  2811. mpeg2_mediacodec_decoder_deps="mediacodec"
  2812. mpeg2_qsv_decoder_select="qsvdec"
  2813. mpeg2_qsv_encoder_select="qsvenc"
  2814. mpeg2_vaapi_encoder_select="cbs_mpeg2 vaapi_encode"
  2815. mpeg2_v4l2m2m_decoder_deps="v4l2_m2m mpeg2_v4l2_m2m"
  2816. mpeg4_crystalhd_decoder_select="crystalhd"
  2817. mpeg4_cuvid_decoder_deps="cuvid"
  2818. mpeg4_mediacodec_decoder_deps="mediacodec"
  2819. mpeg4_mmal_decoder_deps="mmal"
  2820. mpeg4_omx_encoder_deps="omx"
  2821. mpeg4_v4l2m2m_decoder_deps="v4l2_m2m mpeg4_v4l2_m2m"
  2822. mpeg4_v4l2m2m_encoder_deps="v4l2_m2m mpeg4_v4l2_m2m"
  2823. msmpeg4_crystalhd_decoder_select="crystalhd"
  2824. nvenc_h264_encoder_select="h264_nvenc_encoder"
  2825. nvenc_hevc_encoder_select="hevc_nvenc_encoder"
  2826. vc1_crystalhd_decoder_select="crystalhd"
  2827. vc1_cuvid_decoder_deps="cuvid"
  2828. vc1_mmal_decoder_deps="mmal"
  2829. vc1_qsv_decoder_select="qsvdec"
  2830. vc1_v4l2m2m_decoder_deps="v4l2_m2m vc1_v4l2_m2m"
  2831. vp8_cuvid_decoder_deps="cuvid"
  2832. vp8_mediacodec_decoder_deps="mediacodec"
  2833. vp8_qsv_decoder_select="qsvdec"
  2834. vp8_rkmpp_decoder_deps="rkmpp"
  2835. vp8_vaapi_encoder_deps="VAEncPictureParameterBufferVP8"
  2836. vp8_vaapi_encoder_select="vaapi_encode"
  2837. vp8_v4l2m2m_decoder_deps="v4l2_m2m vp8_v4l2_m2m"
  2838. vp8_v4l2m2m_encoder_deps="v4l2_m2m vp8_v4l2_m2m"
  2839. vp9_cuvid_decoder_deps="cuvid"
  2840. vp9_mediacodec_decoder_deps="mediacodec"
  2841. vp9_qsv_decoder_select="qsvdec"
  2842. vp9_rkmpp_decoder_deps="rkmpp"
  2843. vp9_vaapi_encoder_deps="VAEncPictureParameterBufferVP9"
  2844. vp9_vaapi_encoder_select="vaapi_encode"
  2845. vp9_qsv_encoder_deps="libmfx MFX_CODEC_VP9"
  2846. vp9_qsv_encoder_select="qsvenc"
  2847. vp9_v4l2m2m_decoder_deps="v4l2_m2m vp9_v4l2_m2m"
  2848. wmv3_crystalhd_decoder_select="crystalhd"
  2849. # parsers
  2850. aac_parser_select="adts_header"
  2851. av1_parser_select="cbs_av1"
  2852. h264_parser_select="golomb h264dsp h264parse"
  2853. hevc_parser_select="hevcparse"
  2854. mpegaudio_parser_select="mpegaudioheader"
  2855. mpegvideo_parser_select="mpegvideo"
  2856. mpeg4video_parser_select="h263dsp mpegvideo qpeldsp"
  2857. vc1_parser_select="vc1dsp"
  2858. # bitstream_filters
  2859. aac_adtstoasc_bsf_select="adts_header"
  2860. av1_frame_split_bsf_select="cbs_av1"
  2861. av1_metadata_bsf_select="cbs_av1"
  2862. eac3_core_bsf_select="ac3_parser"
  2863. filter_units_bsf_select="cbs"
  2864. h264_metadata_bsf_deps="const_nan"
  2865. h264_metadata_bsf_select="cbs_h264"
  2866. h264_redundant_pps_bsf_select="cbs_h264"
  2867. hevc_metadata_bsf_select="cbs_h265"
  2868. mjpeg2jpeg_bsf_select="jpegtables"
  2869. mpeg2_metadata_bsf_select="cbs_mpeg2"
  2870. trace_headers_bsf_select="cbs"
  2871. vp9_metadata_bsf_select="cbs_vp9"
  2872. # external libraries
  2873. aac_at_decoder_deps="audiotoolbox"
  2874. aac_at_decoder_select="aac_adtstoasc_bsf"
  2875. ac3_at_decoder_deps="audiotoolbox"
  2876. ac3_at_decoder_select="ac3_parser"
  2877. adpcm_ima_qt_at_decoder_deps="audiotoolbox"
  2878. alac_at_decoder_deps="audiotoolbox"
  2879. amr_nb_at_decoder_deps="audiotoolbox"
  2880. avisynth_deps_any="libdl LoadLibrary"
  2881. avisynth_demuxer_deps="avisynth"
  2882. avisynth_demuxer_select="riffdec"
  2883. eac3_at_decoder_deps="audiotoolbox"
  2884. eac3_at_decoder_select="ac3_parser"
  2885. gsm_ms_at_decoder_deps="audiotoolbox"
  2886. ilbc_at_decoder_deps="audiotoolbox"
  2887. mp1_at_decoder_deps="audiotoolbox"
  2888. mp2_at_decoder_deps="audiotoolbox"
  2889. mp3_at_decoder_deps="audiotoolbox"
  2890. mp1_at_decoder_select="mpegaudioheader"
  2891. mp2_at_decoder_select="mpegaudioheader"
  2892. mp3_at_decoder_select="mpegaudioheader"
  2893. pcm_alaw_at_decoder_deps="audiotoolbox"
  2894. pcm_mulaw_at_decoder_deps="audiotoolbox"
  2895. qdmc_at_decoder_deps="audiotoolbox"
  2896. qdm2_at_decoder_deps="audiotoolbox"
  2897. aac_at_encoder_deps="audiotoolbox"
  2898. aac_at_encoder_select="audio_frame_queue"
  2899. alac_at_encoder_deps="audiotoolbox"
  2900. alac_at_encoder_select="audio_frame_queue"
  2901. ilbc_at_encoder_deps="audiotoolbox"
  2902. ilbc_at_encoder_select="audio_frame_queue"
  2903. pcm_alaw_at_encoder_deps="audiotoolbox"
  2904. pcm_alaw_at_encoder_select="audio_frame_queue"
  2905. pcm_mulaw_at_encoder_deps="audiotoolbox"
  2906. pcm_mulaw_at_encoder_select="audio_frame_queue"
  2907. chromaprint_muxer_deps="chromaprint"
  2908. h264_videotoolbox_encoder_deps="pthreads"
  2909. h264_videotoolbox_encoder_select="videotoolbox_encoder"
  2910. hevc_videotoolbox_encoder_deps="pthreads"
  2911. hevc_videotoolbox_encoder_select="videotoolbox_encoder"
  2912. libaom_av1_decoder_deps="libaom"
  2913. libaom_av1_encoder_deps="libaom"
  2914. libaom_av1_encoder_select="extract_extradata_bsf"
  2915. libaribb24_decoder_deps="libaribb24"
  2916. libcelt_decoder_deps="libcelt"
  2917. libcodec2_decoder_deps="libcodec2"
  2918. libcodec2_encoder_deps="libcodec2"
  2919. libdav1d_decoder_deps="libdav1d"
  2920. libdavs2_decoder_deps="libdavs2"
  2921. libfdk_aac_decoder_deps="libfdk_aac"
  2922. libfdk_aac_encoder_deps="libfdk_aac"
  2923. libfdk_aac_encoder_select="audio_frame_queue"
  2924. libgme_demuxer_deps="libgme"
  2925. libgsm_decoder_deps="libgsm"
  2926. libgsm_encoder_deps="libgsm"
  2927. libgsm_ms_decoder_deps="libgsm"
  2928. libgsm_ms_encoder_deps="libgsm"
  2929. libilbc_decoder_deps="libilbc"
  2930. libilbc_encoder_deps="libilbc"
  2931. libkvazaar_encoder_deps="libkvazaar"
  2932. libmodplug_demuxer_deps="libmodplug"
  2933. libmp3lame_encoder_deps="libmp3lame"
  2934. libmp3lame_encoder_select="audio_frame_queue mpegaudioheader"
  2935. libopencore_amrnb_decoder_deps="libopencore_amrnb"
  2936. libopencore_amrnb_encoder_deps="libopencore_amrnb"
  2937. libopencore_amrnb_encoder_select="audio_frame_queue"
  2938. libopencore_amrwb_decoder_deps="libopencore_amrwb"
  2939. libopenh264_decoder_deps="libopenh264"
  2940. libopenh264_decoder_select="h264_mp4toannexb_bsf"
  2941. libopenh264_encoder_deps="libopenh264"
  2942. libopenjpeg_decoder_deps="libopenjpeg"
  2943. libopenjpeg_encoder_deps="libopenjpeg"
  2944. libopenmpt_demuxer_deps="libopenmpt"
  2945. libopus_decoder_deps="libopus"
  2946. libopus_encoder_deps="libopus"
  2947. libopus_encoder_select="audio_frame_queue"
  2948. librsvg_decoder_deps="librsvg"
  2949. libshine_encoder_deps="libshine"
  2950. libshine_encoder_select="audio_frame_queue"
  2951. libspeex_decoder_deps="libspeex"
  2952. libspeex_encoder_deps="libspeex"
  2953. libspeex_encoder_select="audio_frame_queue"
  2954. libtheora_encoder_deps="libtheora"
  2955. libtwolame_encoder_deps="libtwolame"
  2956. libvo_amrwbenc_encoder_deps="libvo_amrwbenc"
  2957. libvorbis_decoder_deps="libvorbis"
  2958. libvorbis_encoder_deps="libvorbis libvorbisenc"
  2959. libvorbis_encoder_select="audio_frame_queue"
  2960. libvpx_vp8_decoder_deps="libvpx"
  2961. libvpx_vp8_encoder_deps="libvpx"
  2962. libvpx_vp9_decoder_deps="libvpx"
  2963. libvpx_vp9_encoder_deps="libvpx"
  2964. libwavpack_encoder_deps="libwavpack"
  2965. libwavpack_encoder_select="audio_frame_queue"
  2966. libwebp_encoder_deps="libwebp"
  2967. libwebp_anim_encoder_deps="libwebp"
  2968. libx262_encoder_deps="libx262"
  2969. libx264_encoder_deps="libx264"
  2970. libx264rgb_encoder_deps="libx264 x264_csp_bgr"
  2971. libx264rgb_encoder_select="libx264_encoder"
  2972. libx265_encoder_deps="libx265"
  2973. libxavs_encoder_deps="libxavs"
  2974. libxavs2_encoder_deps="libxavs2"
  2975. libxvid_encoder_deps="libxvid"
  2976. libzvbi_teletext_decoder_deps="libzvbi"
  2977. vapoursynth_demuxer_deps="vapoursynth"
  2978. videotoolbox_suggest="coreservices"
  2979. videotoolbox_deps="corefoundation coremedia corevideo"
  2980. videotoolbox_encoder_deps="videotoolbox VTCompressionSessionPrepareToEncodeFrames"
  2981. # demuxers / muxers
  2982. ac3_demuxer_select="ac3_parser"
  2983. act_demuxer_select="riffdec"
  2984. aiff_muxer_select="iso_media"
  2985. asf_demuxer_select="riffdec"
  2986. asf_o_demuxer_select="riffdec"
  2987. asf_muxer_select="riffenc"
  2988. asf_stream_muxer_select="asf_muxer"
  2989. avi_demuxer_select="iso_media riffdec exif"
  2990. avi_muxer_select="riffenc"
  2991. caf_demuxer_select="iso_media riffdec"
  2992. caf_muxer_select="iso_media"
  2993. dash_muxer_select="mp4_muxer"
  2994. dash_demuxer_deps="libxml2"
  2995. dirac_demuxer_select="dirac_parser"
  2996. dts_demuxer_select="dca_parser"
  2997. dtshd_demuxer_select="dca_parser"
  2998. dv_demuxer_select="dvprofile"
  2999. dv_muxer_select="dvprofile"
  3000. dxa_demuxer_select="riffdec"
  3001. eac3_demuxer_select="ac3_parser"
  3002. f4v_muxer_select="mov_muxer"
  3003. fifo_muxer_deps="threads"
  3004. flac_demuxer_select="flac_parser"
  3005. hds_muxer_select="flv_muxer"
  3006. hls_muxer_select="mpegts_muxer"
  3007. hls_muxer_suggest="gcrypt openssl"
  3008. image2_alias_pix_demuxer_select="image2_demuxer"
  3009. image2_brender_pix_demuxer_select="image2_demuxer"
  3010. ipod_muxer_select="mov_muxer"
  3011. ismv_muxer_select="mov_muxer"
  3012. ivf_muxer_select="av1_metadata_bsf vp9_superframe_bsf"
  3013. matroska_audio_muxer_select="matroska_muxer"
  3014. matroska_demuxer_select="iso_media riffdec"
  3015. matroska_demuxer_suggest="bzlib lzo zlib"
  3016. matroska_muxer_select="iso_media riffenc"
  3017. mmf_muxer_select="riffenc"
  3018. mov_demuxer_select="iso_media riffdec"
  3019. mov_demuxer_suggest="zlib"
  3020. mov_muxer_select="iso_media riffenc rtpenc_chain"
  3021. mp3_demuxer_select="mpegaudio_parser"
  3022. mp3_muxer_select="mpegaudioheader"
  3023. mp4_muxer_select="mov_muxer"
  3024. mpegts_demuxer_select="iso_media"
  3025. mpegts_muxer_select="adts_muxer latm_muxer"
  3026. mpegtsraw_demuxer_select="mpegts_demuxer"
  3027. mxf_muxer_select="golomb"
  3028. mxf_d10_muxer_select="mxf_muxer"
  3029. mxf_opatom_muxer_select="mxf_muxer"
  3030. nut_muxer_select="riffenc"
  3031. nuv_demuxer_select="riffdec"
  3032. oga_muxer_select="ogg_muxer"
  3033. ogg_demuxer_select="dirac_parse"
  3034. ogv_muxer_select="ogg_muxer"
  3035. opus_muxer_select="ogg_muxer"
  3036. psp_muxer_select="mov_muxer"
  3037. rtp_demuxer_select="sdp_demuxer"
  3038. rtp_muxer_select="golomb jpegtables"
  3039. rtpdec_select="asf_demuxer jpegtables mov_demuxer mpegts_demuxer rm_demuxer rtp_protocol srtp"
  3040. rtsp_demuxer_select="http_protocol rtpdec"
  3041. rtsp_muxer_select="rtp_muxer http_protocol rtp_protocol rtpenc_chain"
  3042. sap_demuxer_select="sdp_demuxer"
  3043. sap_muxer_select="rtp_muxer rtp_protocol rtpenc_chain"
  3044. sdp_demuxer_select="rtpdec"
  3045. smoothstreaming_muxer_select="ismv_muxer"
  3046. spdif_demuxer_select="adts_header"
  3047. spdif_muxer_select="adts_header"
  3048. spx_muxer_select="ogg_muxer"
  3049. swf_demuxer_suggest="zlib"
  3050. tak_demuxer_select="tak_parser"
  3051. tg2_muxer_select="mov_muxer"
  3052. tgp_muxer_select="mov_muxer"
  3053. vobsub_demuxer_select="mpegps_demuxer"
  3054. w64_demuxer_select="wav_demuxer"
  3055. w64_muxer_select="wav_muxer"
  3056. wav_demuxer_select="riffdec"
  3057. wav_muxer_select="riffenc"
  3058. webm_muxer_select="iso_media riffenc"
  3059. webm_dash_manifest_demuxer_select="matroska_demuxer"
  3060. wtv_demuxer_select="mpegts_demuxer riffdec"
  3061. wtv_muxer_select="mpegts_muxer riffenc"
  3062. xmv_demuxer_select="riffdec"
  3063. xwma_demuxer_select="riffdec"
  3064. # indevs / outdevs
  3065. android_camera_indev_deps="android camera2ndk mediandk pthreads"
  3066. android_camera_indev_extralibs="-landroid -lcamera2ndk -lmediandk"
  3067. alsa_indev_deps="alsa"
  3068. alsa_outdev_deps="alsa"
  3069. avfoundation_indev_deps="avfoundation corevideo coremedia pthreads"
  3070. avfoundation_indev_suggest="coregraphics applicationservices"
  3071. avfoundation_indev_extralibs="-framework Foundation"
  3072. bktr_indev_deps_any="dev_bktr_ioctl_bt848_h machine_ioctl_bt848_h dev_video_bktr_ioctl_bt848_h dev_ic_bt8xx_h"
  3073. caca_outdev_deps="libcaca"
  3074. decklink_deps_any="libdl LoadLibrary"
  3075. decklink_indev_deps="decklink threads"
  3076. decklink_indev_extralibs="-lstdc++"
  3077. decklink_outdev_deps="decklink threads"
  3078. decklink_outdev_suggest="libklvanc"
  3079. decklink_outdev_extralibs="-lstdc++"
  3080. dshow_indev_deps="IBaseFilter"
  3081. dshow_indev_extralibs="-lpsapi -lole32 -lstrmiids -luuid -loleaut32 -lshlwapi"
  3082. fbdev_indev_deps="linux_fb_h"
  3083. fbdev_outdev_deps="linux_fb_h"
  3084. gdigrab_indev_deps="CreateDIBSection"
  3085. gdigrab_indev_extralibs="-lgdi32"
  3086. gdigrab_indev_select="bmp_decoder"
  3087. iec61883_indev_deps="libiec61883"
  3088. jack_indev_deps="libjack"
  3089. jack_indev_deps_any="sem_timedwait dispatch_dispatch_h"
  3090. kmsgrab_indev_deps="libdrm"
  3091. lavfi_indev_deps="avfilter"
  3092. libcdio_indev_deps="libcdio"
  3093. libdc1394_indev_deps="libdc1394"
  3094. openal_indev_deps="openal"
  3095. opengl_outdev_deps="opengl"
  3096. opengl_outdev_suggest="sdl2"
  3097. oss_indev_deps_any="sys_soundcard_h"
  3098. oss_outdev_deps_any="sys_soundcard_h"
  3099. pulse_indev_deps="libpulse"
  3100. pulse_outdev_deps="libpulse"
  3101. sdl2_outdev_deps="sdl2"
  3102. sndio_indev_deps="sndio"
  3103. sndio_outdev_deps="sndio"
  3104. v4l2_indev_deps_any="linux_videodev2_h sys_videoio_h"
  3105. v4l2_indev_suggest="libv4l2"
  3106. v4l2_outdev_deps_any="linux_videodev2_h sys_videoio_h"
  3107. v4l2_outdev_suggest="libv4l2"
  3108. vfwcap_indev_deps="vfw32 vfwcap_defines"
  3109. xcbgrab_indev_deps="libxcb"
  3110. xcbgrab_indev_suggest="libxcb_shm libxcb_shape libxcb_xfixes"
  3111. xv_outdev_deps="xlib"
  3112. # protocols
  3113. async_protocol_deps="threads"
  3114. bluray_protocol_deps="libbluray"
  3115. ffrtmpcrypt_protocol_conflict="librtmp_protocol"
  3116. ffrtmpcrypt_protocol_deps_any="gcrypt gmp openssl mbedtls"
  3117. ffrtmpcrypt_protocol_select="tcp_protocol"
  3118. ffrtmphttp_protocol_conflict="librtmp_protocol"
  3119. ffrtmphttp_protocol_select="http_protocol"
  3120. ftp_protocol_select="tcp_protocol"
  3121. gopher_protocol_select="network"
  3122. http_protocol_select="tcp_protocol"
  3123. http_protocol_suggest="zlib"
  3124. httpproxy_protocol_select="tcp_protocol"
  3125. httpproxy_protocol_suggest="zlib"
  3126. https_protocol_select="tls_protocol"
  3127. https_protocol_suggest="zlib"
  3128. icecast_protocol_select="http_protocol"
  3129. mmsh_protocol_select="http_protocol"
  3130. mmst_protocol_select="network"
  3131. rtmp_protocol_conflict="librtmp_protocol"
  3132. rtmp_protocol_select="tcp_protocol"
  3133. rtmp_protocol_suggest="zlib"
  3134. rtmpe_protocol_select="ffrtmpcrypt_protocol"
  3135. rtmpe_protocol_suggest="zlib"
  3136. rtmps_protocol_conflict="librtmp_protocol"
  3137. rtmps_protocol_select="tls_protocol"
  3138. rtmps_protocol_suggest="zlib"
  3139. rtmpt_protocol_select="ffrtmphttp_protocol"
  3140. rtmpt_protocol_suggest="zlib"
  3141. rtmpte_protocol_select="ffrtmpcrypt_protocol ffrtmphttp_protocol"
  3142. rtmpte_protocol_suggest="zlib"
  3143. rtmpts_protocol_select="ffrtmphttp_protocol https_protocol"
  3144. rtmpts_protocol_suggest="zlib"
  3145. rtp_protocol_select="udp_protocol"
  3146. schannel_conflict="openssl gnutls libtls mbedtls"
  3147. sctp_protocol_deps="struct_sctp_event_subscribe struct_msghdr_msg_flags"
  3148. sctp_protocol_select="network"
  3149. securetransport_conflict="openssl gnutls libtls mbedtls"
  3150. srtp_protocol_select="rtp_protocol srtp"
  3151. tcp_protocol_select="network"
  3152. tls_protocol_deps_any="gnutls openssl schannel securetransport libtls mbedtls"
  3153. tls_protocol_select="tcp_protocol"
  3154. udp_protocol_select="network"
  3155. udplite_protocol_select="network"
  3156. unix_protocol_deps="sys_un_h"
  3157. unix_protocol_select="network"
  3158. # external library protocols
  3159. librtmp_protocol_deps="librtmp"
  3160. librtmpe_protocol_deps="librtmp"
  3161. librtmps_protocol_deps="librtmp"
  3162. librtmpt_protocol_deps="librtmp"
  3163. librtmpte_protocol_deps="librtmp"
  3164. libsmbclient_protocol_deps="libsmbclient gplv3"
  3165. libsrt_protocol_deps="libsrt"
  3166. libsrt_protocol_select="network"
  3167. libssh_protocol_deps="libssh"
  3168. libtls_conflict="openssl gnutls mbedtls"
  3169. libzmq_protocol_deps="libzmq"
  3170. libzmq_protocol_select="network"
  3171. # filters
  3172. afftdn_filter_deps="avcodec"
  3173. afftdn_filter_select="fft"
  3174. afftfilt_filter_deps="avcodec"
  3175. afftfilt_filter_select="fft"
  3176. afir_filter_deps="avcodec"
  3177. afir_filter_select="fft"
  3178. amovie_filter_deps="avcodec avformat"
  3179. aresample_filter_deps="swresample"
  3180. asr_filter_deps="pocketsphinx"
  3181. ass_filter_deps="libass"
  3182. atempo_filter_deps="avcodec"
  3183. atempo_filter_select="rdft"
  3184. avgblur_opencl_filter_deps="opencl"
  3185. azmq_filter_deps="libzmq"
  3186. blackframe_filter_deps="gpl"
  3187. bm3d_filter_deps="avcodec"
  3188. bm3d_filter_select="dct"
  3189. boxblur_filter_deps="gpl"
  3190. boxblur_opencl_filter_deps="opencl gpl"
  3191. bs2b_filter_deps="libbs2b"
  3192. colorkey_opencl_filter_deps="opencl"
  3193. colormatrix_filter_deps="gpl"
  3194. convolution_opencl_filter_deps="opencl"
  3195. convolve_filter_deps="avcodec"
  3196. convolve_filter_select="fft"
  3197. coreimage_filter_deps="coreimage appkit"
  3198. coreimage_filter_extralibs="-framework OpenGL"
  3199. coreimagesrc_filter_deps="coreimage appkit"
  3200. coreimagesrc_filter_extralibs="-framework OpenGL"
  3201. cover_rect_filter_deps="avcodec avformat gpl"
  3202. cropdetect_filter_deps="gpl"
  3203. deconvolve_filter_deps="avcodec"
  3204. deconvolve_filter_select="fft"
  3205. deinterlace_qsv_filter_deps="libmfx"
  3206. deinterlace_vaapi_filter_deps="vaapi"
  3207. delogo_filter_deps="gpl"
  3208. denoise_vaapi_filter_deps="vaapi"
  3209. derain_filter_select="dnn"
  3210. deshake_filter_select="pixelutils"
  3211. deshake_opencl_filter_deps="opencl"
  3212. dilation_opencl_filter_deps="opencl"
  3213. drawtext_filter_deps="libfreetype"
  3214. drawtext_filter_suggest="libfontconfig libfribidi"
  3215. elbg_filter_deps="avcodec"
  3216. eq_filter_deps="gpl"
  3217. erosion_opencl_filter_deps="opencl"
  3218. fftfilt_filter_deps="avcodec"
  3219. fftfilt_filter_select="rdft"
  3220. fftdnoiz_filter_deps="avcodec"
  3221. fftdnoiz_filter_select="fft"
  3222. find_rect_filter_deps="avcodec avformat gpl"
  3223. firequalizer_filter_deps="avcodec"
  3224. firequalizer_filter_select="rdft"
  3225. flite_filter_deps="libflite"
  3226. framerate_filter_select="scene_sad"
  3227. freezedetect_filter_select="scene_sad"
  3228. frei0r_filter_deps="frei0r libdl"
  3229. frei0r_src_filter_deps="frei0r libdl"
  3230. fspp_filter_deps="gpl"
  3231. geq_filter_deps="gpl"
  3232. histeq_filter_deps="gpl"
  3233. hqdn3d_filter_deps="gpl"
  3234. interlace_filter_deps="gpl"
  3235. kerndeint_filter_deps="gpl"
  3236. ladspa_filter_deps="ladspa libdl"
  3237. lensfun_filter_deps="liblensfun version3"
  3238. lv2_filter_deps="lv2"
  3239. mcdeint_filter_deps="avcodec gpl"
  3240. movie_filter_deps="avcodec avformat"
  3241. mpdecimate_filter_deps="gpl"
  3242. mpdecimate_filter_select="pixelutils"
  3243. minterpolate_filter_select="scene_sad"
  3244. mptestsrc_filter_deps="gpl"
  3245. negate_filter_deps="lut_filter"
  3246. nlmeans_opencl_filter_deps="opencl"
  3247. nnedi_filter_deps="gpl"
  3248. ocr_filter_deps="libtesseract"
  3249. ocv_filter_deps="libopencv"
  3250. openclsrc_filter_deps="opencl"
  3251. overlay_opencl_filter_deps="opencl"
  3252. overlay_qsv_filter_deps="libmfx"
  3253. overlay_qsv_filter_select="qsvvpp"
  3254. owdenoise_filter_deps="gpl"
  3255. pan_filter_deps="swresample"
  3256. perspective_filter_deps="gpl"
  3257. phase_filter_deps="gpl"
  3258. pp7_filter_deps="gpl"
  3259. pp_filter_deps="gpl postproc"
  3260. prewitt_opencl_filter_deps="opencl"
  3261. procamp_vaapi_filter_deps="vaapi"
  3262. program_opencl_filter_deps="opencl"
  3263. pullup_filter_deps="gpl"
  3264. removelogo_filter_deps="avcodec avformat swscale"
  3265. repeatfields_filter_deps="gpl"
  3266. resample_filter_deps="avresample"
  3267. roberts_opencl_filter_deps="opencl"
  3268. rubberband_filter_deps="librubberband"
  3269. sab_filter_deps="gpl swscale"
  3270. scale2ref_filter_deps="swscale"
  3271. scale_filter_deps="swscale"
  3272. scale_qsv_filter_deps="libmfx"
  3273. select_filter_select="scene_sad"
  3274. sharpness_vaapi_filter_deps="vaapi"
  3275. showcqt_filter_deps="avcodec avformat swscale"
  3276. showcqt_filter_suggest="libfontconfig libfreetype"
  3277. showcqt_filter_select="fft"
  3278. showfreqs_filter_deps="avcodec"
  3279. showfreqs_filter_select="fft"
  3280. showspectrum_filter_deps="avcodec"
  3281. showspectrum_filter_select="fft"
  3282. showspectrumpic_filter_deps="avcodec"
  3283. showspectrumpic_filter_select="fft"
  3284. signature_filter_deps="gpl avcodec avformat"
  3285. smartblur_filter_deps="gpl swscale"
  3286. sobel_opencl_filter_deps="opencl"
  3287. sofalizer_filter_deps="libmysofa avcodec"
  3288. sofalizer_filter_select="fft"
  3289. spectrumsynth_filter_deps="avcodec"
  3290. spectrumsynth_filter_select="fft"
  3291. spp_filter_deps="gpl avcodec"
  3292. spp_filter_select="fft idctdsp fdctdsp me_cmp pixblockdsp"
  3293. sr_filter_deps="avformat swscale"
  3294. sr_filter_select="dnn"
  3295. stereo3d_filter_deps="gpl"
  3296. subtitles_filter_deps="avformat avcodec libass"
  3297. super2xsai_filter_deps="gpl"
  3298. pixfmts_super2xsai_test_deps="super2xsai_filter"
  3299. tinterlace_filter_deps="gpl"
  3300. tinterlace_merge_test_deps="tinterlace_filter"
  3301. tinterlace_pad_test_deps="tinterlace_filter"
  3302. tonemap_filter_deps="const_nan"
  3303. tonemap_opencl_filter_deps="opencl const_nan"
  3304. transpose_opencl_filter_deps="opencl"
  3305. transpose_vaapi_filter_deps="vaapi VAProcPipelineCaps_rotation_flags"
  3306. unsharp_opencl_filter_deps="opencl"
  3307. uspp_filter_deps="gpl avcodec"
  3308. vaguedenoiser_filter_deps="gpl"
  3309. vidstabdetect_filter_deps="libvidstab"
  3310. vidstabtransform_filter_deps="libvidstab"
  3311. libvmaf_filter_deps="libvmaf pthreads"
  3312. zmq_filter_deps="libzmq"
  3313. zoompan_filter_deps="swscale"
  3314. zscale_filter_deps="libzimg const_nan"
  3315. scale_vaapi_filter_deps="vaapi"
  3316. vpp_qsv_filter_deps="libmfx"
  3317. vpp_qsv_filter_select="qsvvpp"
  3318. yadif_cuda_filter_deps="ffnvcodec"
  3319. yadif_cuda_filter_deps_any="cuda_nvcc cuda_llvm"
  3320. # examples
  3321. avio_dir_cmd_deps="avformat avutil"
  3322. avio_reading_deps="avformat avcodec avutil"
  3323. decode_audio_example_deps="avcodec avutil"
  3324. decode_video_example_deps="avcodec avutil"
  3325. demuxing_decoding_example_deps="avcodec avformat avutil"
  3326. encode_audio_example_deps="avcodec avutil"
  3327. encode_video_example_deps="avcodec avutil"
  3328. extract_mvs_example_deps="avcodec avformat avutil"
  3329. filter_audio_example_deps="avfilter avutil"
  3330. filtering_audio_example_deps="avfilter avcodec avformat avutil"
  3331. filtering_video_example_deps="avfilter avcodec avformat avutil"
  3332. http_multiclient_example_deps="avformat avutil fork"
  3333. hw_decode_example_deps="avcodec avformat avutil"
  3334. metadata_example_deps="avformat avutil"
  3335. muxing_example_deps="avcodec avformat avutil swscale"
  3336. qsvdec_example_deps="avcodec avutil libmfx h264_qsv_decoder"
  3337. remuxing_example_deps="avcodec avformat avutil"
  3338. resampling_audio_example_deps="avutil swresample"
  3339. scaling_video_example_deps="avutil swscale"
  3340. transcode_aac_example_deps="avcodec avformat swresample"
  3341. transcoding_example_deps="avfilter avcodec avformat avutil"
  3342. vaapi_encode_example_deps="avcodec avutil h264_vaapi_encoder"
  3343. vaapi_transcode_example_deps="avcodec avformat avutil h264_vaapi_encoder"
  3344. # EXTRALIBS_LIST
  3345. cpu_init_extralibs="pthreads_extralibs"
  3346. cws2fws_extralibs="zlib_extralibs"
  3347. # libraries, in any order
  3348. avcodec_deps="avutil"
  3349. avcodec_suggest="libm"
  3350. avcodec_select="null_bsf"
  3351. avdevice_deps="avformat avcodec avutil"
  3352. avdevice_suggest="libm"
  3353. avfilter_deps="avutil"
  3354. avfilter_suggest="libm"
  3355. avformat_deps="avcodec avutil"
  3356. avformat_suggest="libm network zlib"
  3357. avresample_deps="avutil"
  3358. avresample_suggest="libm"
  3359. avutil_suggest="clock_gettime ffnvcodec libm libdrm libmfx opencl user32 vaapi videotoolbox corefoundation corevideo coremedia bcrypt"
  3360. postproc_deps="avutil gpl"
  3361. postproc_suggest="libm"
  3362. swresample_deps="avutil"
  3363. swresample_suggest="libm libsoxr"
  3364. swscale_deps="avutil"
  3365. swscale_suggest="libm"
  3366. avcodec_extralibs="pthreads_extralibs iconv_extralibs dxva2_extralibs"
  3367. avfilter_extralibs="pthreads_extralibs"
  3368. avutil_extralibs="d3d11va_extralibs nanosleep_extralibs pthreads_extralibs vaapi_drm_extralibs vaapi_x11_extralibs vdpau_x11_extralibs"
  3369. # programs
  3370. ffmpeg_deps="avcodec avfilter avformat"
  3371. ffmpeg_select="aformat_filter anull_filter atrim_filter format_filter
  3372. hflip_filter null_filter
  3373. transpose_filter trim_filter vflip_filter"
  3374. ffmpeg_suggest="ole32 psapi shell32"
  3375. ffplay_deps="avcodec avformat swscale swresample sdl2"
  3376. ffplay_select="rdft crop_filter transpose_filter hflip_filter vflip_filter rotate_filter"
  3377. ffplay_suggest="shell32"
  3378. ffprobe_deps="avcodec avformat"
  3379. ffprobe_suggest="shell32"
  3380. # documentation
  3381. podpages_deps="perl"
  3382. manpages_deps="perl pod2man"
  3383. htmlpages_deps="perl"
  3384. htmlpages_deps_any="makeinfo_html texi2html"
  3385. txtpages_deps="perl makeinfo"
  3386. doc_deps_any="manpages htmlpages podpages txtpages"
  3387. # default parameters
  3388. logfile="ffbuild/config.log"
  3389. # installation paths
  3390. prefix_default="/usr/local"
  3391. bindir_default='${prefix}/bin'
  3392. datadir_default='${prefix}/share/ffmpeg'
  3393. docdir_default='${prefix}/share/doc/ffmpeg'
  3394. incdir_default='${prefix}/include'
  3395. libdir_default='${prefix}/lib'
  3396. mandir_default='${prefix}/share/man'
  3397. # toolchain
  3398. ar_default="ar"
  3399. cc_default="gcc"
  3400. cxx_default="g++"
  3401. host_cc_default="gcc"
  3402. doxygen_default="doxygen"
  3403. install="install"
  3404. ln_s_default="ln -s -f"
  3405. nm_default="nm -g"
  3406. pkg_config_default=pkg-config
  3407. ranlib_default="ranlib"
  3408. strip_default="strip"
  3409. version_script='--version-script'
  3410. objformat="elf32"
  3411. x86asmexe_default="nasm"
  3412. windres_default="windres"
  3413. striptype="direct"
  3414. # OS
  3415. target_os_default=$(tolower $(uname -s))
  3416. host_os=$target_os_default
  3417. # machine
  3418. if test "$target_os_default" = aix; then
  3419. arch_default=$(uname -p)
  3420. strip_default="strip -X32_64"
  3421. nm_default="nm -g -X32_64"
  3422. else
  3423. arch_default=$(uname -m)
  3424. fi
  3425. cpu="generic"
  3426. intrinsics="none"
  3427. # configurable options
  3428. enable $PROGRAM_LIST
  3429. enable $DOCUMENT_LIST
  3430. enable $EXAMPLE_LIST
  3431. enable $(filter_out avresample $LIBRARY_LIST)
  3432. enable stripping
  3433. enable asm
  3434. enable debug
  3435. enable doc
  3436. enable faan faandct faanidct
  3437. enable optimizations
  3438. enable runtime_cpudetect
  3439. enable safe_bitstream_reader
  3440. enable static
  3441. enable swscale_alpha
  3442. enable valgrind_backtrace
  3443. sws_max_filter_size_default=256
  3444. set_default sws_max_filter_size
  3445. # internal components are enabled by default
  3446. enable $EXTRALIBS_LIST
  3447. # Avoid external, non-system, libraries getting enabled by dependency resolution
  3448. disable $EXTERNAL_LIBRARY_LIST $HWACCEL_LIBRARY_LIST
  3449. # build settings
  3450. SHFLAGS='-shared -Wl,-soname,$$(@F)'
  3451. LIBPREF="lib"
  3452. LIBSUF=".a"
  3453. FULLNAME='$(NAME)$(BUILDSUF)'
  3454. LIBNAME='$(LIBPREF)$(FULLNAME)$(LIBSUF)'
  3455. SLIBPREF="lib"
  3456. SLIBSUF=".so"
  3457. SLIBNAME='$(SLIBPREF)$(FULLNAME)$(SLIBSUF)'
  3458. SLIBNAME_WITH_VERSION='$(SLIBNAME).$(LIBVERSION)'
  3459. SLIBNAME_WITH_MAJOR='$(SLIBNAME).$(LIBMAJOR)'
  3460. LIB_INSTALL_EXTRA_CMD='$$(RANLIB) "$(LIBDIR)/$(LIBNAME)"'
  3461. SLIB_INSTALL_NAME='$(SLIBNAME_WITH_VERSION)'
  3462. SLIB_INSTALL_LINKS='$(SLIBNAME_WITH_MAJOR) $(SLIBNAME)'
  3463. VERSION_SCRIPT_POSTPROCESS_CMD="cat"
  3464. asflags_filter=echo
  3465. cflags_filter=echo
  3466. ldflags_filter=echo
  3467. AS_C='-c'
  3468. AS_O='-o $@'
  3469. CC_C='-c'
  3470. CC_E='-E -o $@'
  3471. CC_O='-o $@'
  3472. CXX_C='-c'
  3473. CXX_O='-o $@'
  3474. OBJCC_C='-c'
  3475. OBJCC_E='-E -o $@'
  3476. OBJCC_O='-o $@'
  3477. X86ASM_O='-o $@'
  3478. LD_O='-o $@'
  3479. LD_LIB='-l%'
  3480. LD_PATH='-L'
  3481. HOSTCC_C='-c'
  3482. HOSTCC_E='-E -o $@'
  3483. HOSTCC_O='-o $@'
  3484. HOSTLD_O='-o $@'
  3485. NVCC_C='-c'
  3486. NVCC_O='-o $@'
  3487. host_extralibs='-lm'
  3488. host_cflags_filter=echo
  3489. host_ldflags_filter=echo
  3490. target_path='$(CURDIR)'
  3491. # since the object filename is not given with the -MM flag, the compiler
  3492. # is only able to print the basename, and we must add the path ourselves
  3493. DEPCMD='$(DEP$(1)) $(DEP$(1)FLAGS) $($(1)DEP_FLAGS) $< 2>/dev/null | sed -e "/^\#.*/d" -e "s,^[[:space:]]*$(@F),$(@D)/$(@F)," > $(@:.o=.d)'
  3494. DEPFLAGS='-MM'
  3495. mkdir -p ffbuild
  3496. # find source path
  3497. if test -f configure; then
  3498. source_path=.
  3499. elif test -f src/configure; then
  3500. source_path=src
  3501. else
  3502. source_path=$(cd $(dirname "$0"); pwd)
  3503. case "$source_path" in
  3504. *[[:blank:]]*) die "Out of tree builds are impossible with whitespace in source path." ;;
  3505. esac
  3506. test -e "$source_path/config.h" &&
  3507. die "Out of tree builds are impossible with config.h in source dir."
  3508. fi
  3509. for v in "$@"; do
  3510. r=${v#*=}
  3511. l=${v%"$r"}
  3512. r=$(sh_quote "$r")
  3513. FFMPEG_CONFIGURATION="${FFMPEG_CONFIGURATION# } ${l}${r}"
  3514. done
  3515. find_things_extern(){
  3516. thing=$1
  3517. pattern=$2
  3518. file=$source_path/$3
  3519. out=${4:-$thing}
  3520. sed -n "s/^[^#]*extern.*$pattern *ff_\([^ ]*\)_$thing;/\1_$out/p" "$file"
  3521. }
  3522. find_filters_extern(){
  3523. file=$source_path/$1
  3524. sed -n 's/^extern AVFilter ff_[avfsinkrc]\{2,5\}_\([[:alnum:]_]\{1,\}\);/\1_filter/p' $file
  3525. }
  3526. FILTER_LIST=$(find_filters_extern libavfilter/allfilters.c)
  3527. OUTDEV_LIST=$(find_things_extern muxer AVOutputFormat libavdevice/alldevices.c outdev)
  3528. INDEV_LIST=$(find_things_extern demuxer AVInputFormat libavdevice/alldevices.c indev)
  3529. MUXER_LIST=$(find_things_extern muxer AVOutputFormat libavformat/allformats.c)
  3530. DEMUXER_LIST=$(find_things_extern demuxer AVInputFormat libavformat/allformats.c)
  3531. ENCODER_LIST=$(find_things_extern encoder AVCodec libavcodec/allcodecs.c)
  3532. DECODER_LIST=$(find_things_extern decoder AVCodec libavcodec/allcodecs.c)
  3533. CODEC_LIST="
  3534. $ENCODER_LIST
  3535. $DECODER_LIST
  3536. "
  3537. PARSER_LIST=$(find_things_extern parser AVCodecParser libavcodec/parsers.c)
  3538. BSF_LIST=$(find_things_extern bsf AVBitStreamFilter libavcodec/bitstream_filters.c)
  3539. HWACCEL_LIST=$(find_things_extern hwaccel AVHWAccel libavcodec/hwaccels.h)
  3540. PROTOCOL_LIST=$(find_things_extern protocol URLProtocol libavformat/protocols.c)
  3541. AVCODEC_COMPONENTS_LIST="
  3542. $BSF_LIST
  3543. $DECODER_LIST
  3544. $ENCODER_LIST
  3545. $HWACCEL_LIST
  3546. $PARSER_LIST
  3547. "
  3548. AVDEVICE_COMPONENTS_LIST="
  3549. $INDEV_LIST
  3550. $OUTDEV_LIST
  3551. "
  3552. AVFILTER_COMPONENTS_LIST="
  3553. $FILTER_LIST
  3554. "
  3555. AVFORMAT_COMPONENTS_LIST="
  3556. $DEMUXER_LIST
  3557. $MUXER_LIST
  3558. $PROTOCOL_LIST
  3559. "
  3560. ALL_COMPONENTS="
  3561. $AVCODEC_COMPONENTS_LIST
  3562. $AVDEVICE_COMPONENTS_LIST
  3563. $AVFILTER_COMPONENTS_LIST
  3564. $AVFORMAT_COMPONENTS_LIST
  3565. "
  3566. for n in $COMPONENT_LIST; do
  3567. v=$(toupper ${n%s})_LIST
  3568. eval enable \$$v
  3569. eval ${n}_if_any="\$$v"
  3570. done
  3571. enable $ARCH_EXT_LIST
  3572. die_unknown(){
  3573. echo "Unknown option \"$1\"."
  3574. echo "See $0 --help for available options."
  3575. exit 1
  3576. }
  3577. print_in_columns() {
  3578. tr ' ' '\n' | sort | tr '\r\n' ' ' | awk -v col_width=24 -v width="$ncols" '
  3579. {
  3580. num_cols = width > col_width ? int(width / col_width) : 1;
  3581. num_rows = int((NF + num_cols-1) / num_cols);
  3582. y = x = 1;
  3583. for (y = 1; y <= num_rows; y++) {
  3584. i = y;
  3585. for (x = 1; x <= num_cols; x++) {
  3586. if (i <= NF) {
  3587. line = sprintf("%s%-" col_width "s", line, $i);
  3588. }
  3589. i = i + num_rows;
  3590. }
  3591. print line; line = "";
  3592. }
  3593. }' | sed 's/ *$//'
  3594. }
  3595. show_list() {
  3596. suffix=_$1
  3597. shift
  3598. echo $* | sed s/$suffix//g | print_in_columns
  3599. exit 0
  3600. }
  3601. rand_list(){
  3602. IFS=', '
  3603. set -- $*
  3604. unset IFS
  3605. for thing; do
  3606. comp=${thing%:*}
  3607. prob=${thing#$comp}
  3608. prob=${prob#:}
  3609. is_in ${comp} $COMPONENT_LIST && eval comp=\$$(toupper ${comp%s})_LIST
  3610. echo "prob ${prob:-0.5}"
  3611. printf '%s\n' $comp
  3612. done
  3613. }
  3614. do_random(){
  3615. action=$1
  3616. shift
  3617. random_seed=$(awk "BEGIN { srand($random_seed); print srand() }")
  3618. $action $(rand_list "$@" | awk "BEGIN { srand($random_seed) } \$1 == \"prob\" { prob = \$2; next } rand() < prob { print }")
  3619. }
  3620. for opt do
  3621. optval="${opt#*=}"
  3622. case "$opt" in
  3623. --extra-ldflags=*)
  3624. add_ldflags $optval
  3625. ;;
  3626. --extra-ldexeflags=*)
  3627. add_ldexeflags $optval
  3628. ;;
  3629. --extra-ldsoflags=*)
  3630. add_ldsoflags $optval
  3631. ;;
  3632. --extra-ldlibflags=*)
  3633. warn "The --extra-ldlibflags option is only provided for compatibility and will be\n"\
  3634. "removed in the future. Use --extra-ldsoflags instead."
  3635. add_ldsoflags $optval
  3636. ;;
  3637. --extra-libs=*)
  3638. add_extralibs $optval
  3639. ;;
  3640. --disable-devices)
  3641. disable $INDEV_LIST $OUTDEV_LIST
  3642. ;;
  3643. --enable-debug=*)
  3644. debuglevel="$optval"
  3645. ;;
  3646. --disable-programs)
  3647. disable $PROGRAM_LIST
  3648. ;;
  3649. --disable-everything)
  3650. map 'eval unset \${$(toupper ${v%s})_LIST}' $COMPONENT_LIST
  3651. ;;
  3652. --disable-all)
  3653. map 'eval unset \${$(toupper ${v%s})_LIST}' $COMPONENT_LIST
  3654. disable $LIBRARY_LIST $PROGRAM_LIST doc
  3655. enable avutil
  3656. ;;
  3657. --enable-random|--disable-random)
  3658. action=${opt%%-random}
  3659. do_random ${action#--} $COMPONENT_LIST
  3660. ;;
  3661. --enable-random=*|--disable-random=*)
  3662. action=${opt%%-random=*}
  3663. do_random ${action#--} $optval
  3664. ;;
  3665. --enable-sdl)
  3666. enable sdl2
  3667. ;;
  3668. --enable-*=*|--disable-*=*)
  3669. eval $(echo "${opt%%=*}" | sed 's/--/action=/;s/-/ thing=/')
  3670. is_in "${thing}s" $COMPONENT_LIST || die_unknown "$opt"
  3671. eval list=\$$(toupper $thing)_LIST
  3672. name=$(echo "${optval}" | sed "s/,/_${thing}|/g")_${thing}
  3673. list=$(filter "$name" $list)
  3674. [ "$list" = "" ] && warn "Option $opt did not match anything"
  3675. test $action = enable && warn_if_gets_disabled $list
  3676. $action $list
  3677. ;;
  3678. --enable-yasm|--disable-yasm)
  3679. warn "The ${opt} option is only provided for compatibility and will be\n"\
  3680. "removed in the future. Use --enable-x86asm / --disable-x86asm instead."
  3681. test $opt = --enable-yasm && x86asm=yes || x86asm=no
  3682. ;;
  3683. --yasmexe=*)
  3684. warn "The --yasmexe option is only provided for compatibility and will be\n"\
  3685. "removed in the future. Use --x86asmexe instead."
  3686. x86asmexe="$optval"
  3687. ;;
  3688. --enable-?*|--disable-?*)
  3689. eval $(echo "$opt" | sed 's/--/action=/;s/-/ option=/;s/-/_/g')
  3690. if is_in $option $COMPONENT_LIST; then
  3691. test $action = disable && action=unset
  3692. eval $action \$$(toupper ${option%s})_LIST
  3693. elif is_in $option $CMDLINE_SELECT; then
  3694. $action $option
  3695. else
  3696. die_unknown $opt
  3697. fi
  3698. ;;
  3699. --list-*)
  3700. NAME="${opt#--list-}"
  3701. is_in $NAME $COMPONENT_LIST || die_unknown $opt
  3702. NAME=${NAME%s}
  3703. eval show_list $NAME \$$(toupper $NAME)_LIST
  3704. ;;
  3705. --help|-h) show_help
  3706. ;;
  3707. --quiet|-q) quiet=yes
  3708. ;;
  3709. --fatal-warnings) enable fatal_warnings
  3710. ;;
  3711. --libfuzzer=*)
  3712. libfuzzer_path="$optval"
  3713. ;;
  3714. *)
  3715. optname="${opt%%=*}"
  3716. optname="${optname#--}"
  3717. optname=$(echo "$optname" | sed 's/-/_/g')
  3718. if is_in $optname $CMDLINE_SET; then
  3719. eval $optname='$optval'
  3720. elif is_in $optname $CMDLINE_APPEND; then
  3721. append $optname "$optval"
  3722. else
  3723. die_unknown $opt
  3724. fi
  3725. ;;
  3726. esac
  3727. done
  3728. for e in $env; do
  3729. eval "export $e"
  3730. done
  3731. if disabled autodetect; then
  3732. # Unless iconv is explicitely disabled by the user, we still want to probe
  3733. # for the iconv from the libc.
  3734. disabled iconv || enable libc_iconv
  3735. disable_weak $EXTERNAL_AUTODETECT_LIBRARY_LIST
  3736. disable_weak $HWACCEL_AUTODETECT_LIBRARY_LIST
  3737. fi
  3738. # Mark specifically enabled, but normally autodetected libraries as requested.
  3739. for lib in $AUTODETECT_LIBS; do
  3740. enabled $lib && request $lib
  3741. done
  3742. #TODO: switch to $AUTODETECT_LIBS when $THREADS_LIST is supported the same way
  3743. enable_weak $EXTERNAL_AUTODETECT_LIBRARY_LIST
  3744. enable_weak $HWACCEL_AUTODETECT_LIBRARY_LIST
  3745. disabled logging && logfile=/dev/null
  3746. # command line configuration sanity checks
  3747. # we need to build at least one lib type
  3748. if ! enabled_any static shared; then
  3749. cat <<EOF
  3750. At least one library type must be built.
  3751. Specify --enable-static to build the static libraries or --enable-shared to
  3752. build the shared libraries as well. To only build the shared libraries specify
  3753. --disable-static in addition to --enable-shared.
  3754. EOF
  3755. exit 1
  3756. fi
  3757. die_license_disabled() {
  3758. enabled $1 || { enabled $v && die "$v is $1 and --enable-$1 is not specified."; }
  3759. }
  3760. die_license_disabled_gpl() {
  3761. enabled $1 || { enabled $v && die "$v is incompatible with the gpl and --enable-$1 is not specified."; }
  3762. }
  3763. map "die_license_disabled gpl" $EXTERNAL_LIBRARY_GPL_LIST $EXTERNAL_LIBRARY_GPLV3_LIST
  3764. map "die_license_disabled version3" $EXTERNAL_LIBRARY_VERSION3_LIST $EXTERNAL_LIBRARY_GPLV3_LIST
  3765. enabled gpl && map "die_license_disabled_gpl nonfree" $EXTERNAL_LIBRARY_NONFREE_LIST
  3766. map "die_license_disabled nonfree" $HWACCEL_LIBRARY_NONFREE_LIST
  3767. enabled version3 && { enabled gpl && enable gplv3 || enable lgplv3; }
  3768. if enabled nonfree; then
  3769. license="nonfree and unredistributable"
  3770. elif enabled gplv3; then
  3771. license="GPL version 3 or later"
  3772. elif enabled lgplv3; then
  3773. license="LGPL version 3 or later"
  3774. elif enabled gpl; then
  3775. license="GPL version 2 or later"
  3776. else
  3777. license="LGPL version 2.1 or later"
  3778. fi
  3779. enabled_all gnutls openssl &&
  3780. die "GnuTLS and OpenSSL must not be enabled at the same time."
  3781. enabled_all gnutls mbedtls &&
  3782. die "GnuTLS and mbedTLS must not be enabled at the same time."
  3783. enabled_all openssl mbedtls &&
  3784. die "OpenSSL and mbedTLS must not be enabled at the same time."
  3785. # Disable all the library-specific components if the library itself
  3786. # is disabled, see AVCODEC_LIST and following _LIST variables.
  3787. disable_components(){
  3788. disabled ${1} && disable $(
  3789. eval components="\$$(toupper ${1})_COMPONENTS"
  3790. map 'eval echo \${$(toupper ${v%s})_LIST}' $components
  3791. )
  3792. }
  3793. map 'disable_components $v' $LIBRARY_LIST
  3794. echo "# $0 $FFMPEG_CONFIGURATION" > $logfile
  3795. set >> $logfile
  3796. test -n "$valgrind" && toolchain="valgrind-memcheck"
  3797. enabled ossfuzz && ! echo $CFLAGS | grep -q -- "-fsanitize=" && ! echo $CFLAGS | grep -q -- "-fcoverage-mapping" &&{
  3798. add_cflags -fsanitize=address,undefined -fsanitize-coverage=trace-pc-guard,trace-cmp -fno-omit-frame-pointer
  3799. add_ldflags -fsanitize=address,undefined -fsanitize-coverage=trace-pc-guard,trace-cmp
  3800. }
  3801. case "$toolchain" in
  3802. *-asan)
  3803. cc_default="${toolchain%-asan}"
  3804. add_cflags -fsanitize=address
  3805. add_ldflags -fsanitize=address
  3806. ;;
  3807. *-msan)
  3808. cc_default="${toolchain%-msan}"
  3809. add_cflags -fsanitize=memory -fsanitize-memory-track-origins
  3810. add_ldflags -fsanitize=memory
  3811. ;;
  3812. *-tsan)
  3813. cc_default="${toolchain%-tsan}"
  3814. add_cflags -fsanitize=thread
  3815. add_ldflags -fsanitize=thread
  3816. case "$toolchain" in
  3817. gcc-tsan)
  3818. add_cflags -fPIC
  3819. add_ldflags -fPIC
  3820. ;;
  3821. esac
  3822. ;;
  3823. *-usan)
  3824. cc_default="${toolchain%-usan}"
  3825. add_cflags -fsanitize=undefined
  3826. add_ldflags -fsanitize=undefined
  3827. ;;
  3828. valgrind-*)
  3829. target_exec_default="valgrind"
  3830. case "$toolchain" in
  3831. valgrind-massif)
  3832. 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"
  3833. ;;
  3834. valgrind-memcheck)
  3835. 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"
  3836. ;;
  3837. esac
  3838. ;;
  3839. msvc)
  3840. # Check whether the current MSVC version needs the C99 converter.
  3841. # From MSVC 2013 (compiler major version 18) onwards, it does actually
  3842. # support enough of C99 to build ffmpeg. Default to the new
  3843. # behaviour if the regexp was unable to match anything, since this
  3844. # successfully parses the version number of existing supported
  3845. # versions that require the converter (MSVC 2010 and 2012).
  3846. cl_major_ver=$(cl.exe 2>&1 | sed -n 's/.*Version \([[:digit:]]\{1,\}\)\..*/\1/p')
  3847. if [ -z "$cl_major_ver" ] || [ $cl_major_ver -ge 18 ]; then
  3848. cc_default="cl.exe"
  3849. cxx_default="cl.exe"
  3850. else
  3851. die "Unsupported MSVC version (2013 or newer required)"
  3852. fi
  3853. ld_default="$source_path/compat/windows/mslink"
  3854. nm_default="dumpbin.exe -symbols"
  3855. ar_default="lib.exe"
  3856. case "$arch" in
  3857. aarch64|arm64)
  3858. as_default="armasm64.exe"
  3859. ;;
  3860. arm*)
  3861. as_default="armasm.exe"
  3862. ;;
  3863. esac
  3864. target_os_default="win32"
  3865. # Use a relative path for TMPDIR. This makes sure all the
  3866. # ffconf temp files are written with a relative path, avoiding
  3867. # issues with msys/win32 path conversion for MSVC parameters
  3868. # such as -Fo<file> or -out:<file>.
  3869. TMPDIR=.
  3870. ;;
  3871. icl)
  3872. cc_default="icl"
  3873. ld_default="xilink"
  3874. nm_default="dumpbin -symbols"
  3875. ar_default="xilib"
  3876. target_os_default="win32"
  3877. TMPDIR=.
  3878. ;;
  3879. gcov)
  3880. add_cflags -fprofile-arcs -ftest-coverage
  3881. add_ldflags -fprofile-arcs -ftest-coverage
  3882. ;;
  3883. llvm-cov)
  3884. add_cflags -fprofile-arcs -ftest-coverage
  3885. add_ldflags --coverage
  3886. ;;
  3887. hardened)
  3888. add_cppflags -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2
  3889. add_cflags -fno-strict-overflow -fstack-protector-all
  3890. add_ldflags -Wl,-z,relro -Wl,-z,now
  3891. add_cflags -fPIE
  3892. add_ldexeflags -fPIE -pie
  3893. ;;
  3894. ?*)
  3895. die "Unknown toolchain $toolchain"
  3896. ;;
  3897. esac
  3898. if test -n "$cross_prefix"; then
  3899. test -n "$arch" && test -n "$target_os" ||
  3900. die "Must specify target arch (--arch) and OS (--target-os) when cross-compiling"
  3901. enable cross_compile
  3902. fi
  3903. set_default target_os
  3904. if test "$target_os" = android; then
  3905. cc_default="clang"
  3906. fi
  3907. ar_default="${cross_prefix}${ar_default}"
  3908. cc_default="${cross_prefix}${cc_default}"
  3909. cxx_default="${cross_prefix}${cxx_default}"
  3910. nm_default="${cross_prefix}${nm_default}"
  3911. pkg_config_default="${cross_prefix}${pkg_config_default}"
  3912. if ${cross_prefix}${ranlib_default} 2>&1 | grep -q "\-D "; then
  3913. ranlib_default="${cross_prefix}${ranlib_default} -D"
  3914. else
  3915. ranlib_default="${cross_prefix}${ranlib_default}"
  3916. fi
  3917. strip_default="${cross_prefix}${strip_default}"
  3918. windres_default="${cross_prefix}${windres_default}"
  3919. sysinclude_default="${sysroot}/usr/include"
  3920. if enabled cuda_sdk; then
  3921. warn "Option --enable-cuda-sdk is deprecated. Use --enable-cuda-nvcc instead."
  3922. enable cuda_nvcc
  3923. fi
  3924. if enabled cuda_nvcc; then
  3925. nvcc_default="nvcc"
  3926. nvccflags_default="-gencode arch=compute_30,code=sm_30 -O2"
  3927. else
  3928. nvcc_default="clang"
  3929. nvccflags_default="--cuda-gpu-arch=sm_30 -O2"
  3930. NVCC_C=""
  3931. fi
  3932. set_default arch cc cxx doxygen pkg_config ranlib strip sysinclude \
  3933. target_exec x86asmexe nvcc
  3934. enabled cross_compile || host_cc_default=$cc
  3935. set_default host_cc
  3936. pkg_config_fail_message=""
  3937. if ! $pkg_config --version >/dev/null 2>&1; then
  3938. warn "$pkg_config not found, library detection may fail."
  3939. pkg_config=false
  3940. elif is_in -static $cc $LDFLAGS && ! is_in --static $pkg_config $pkg_config_flags; then
  3941. pkg_config_fail_message="
  3942. Note: When building a static binary, add --pkg-config-flags=\"--static\"."
  3943. fi
  3944. if test $doxygen != $doxygen_default && \
  3945. ! $doxygen --version >/dev/null 2>&1; then
  3946. warn "Specified doxygen \"$doxygen\" not found, API documentation will fail to build."
  3947. fi
  3948. exesuf() {
  3949. case $1 in
  3950. mingw32*|mingw64*|win32|win64|cygwin*|*-dos|freedos|opendos|os/2*|symbian) echo .exe ;;
  3951. esac
  3952. }
  3953. EXESUF=$(exesuf $target_os)
  3954. HOSTEXESUF=$(exesuf $host_os)
  3955. # set temporary file name
  3956. : ${TMPDIR:=$TEMPDIR}
  3957. : ${TMPDIR:=$TMP}
  3958. : ${TMPDIR:=/tmp}
  3959. if [ -n "$tempprefix" ] ; then
  3960. mktemp(){
  3961. tmpname="$tempprefix.${HOSTNAME}.${UID}"
  3962. echo "$tmpname"
  3963. mkdir "$tmpname"
  3964. }
  3965. elif ! test_cmd mktemp -u XXXXXX; then
  3966. # simple replacement for missing mktemp
  3967. # NOT SAFE FOR GENERAL USE
  3968. mktemp(){
  3969. tmpname="${2%%XXX*}.${HOSTNAME}.${UID}.$$"
  3970. echo "$tmpname"
  3971. mkdir "$tmpname"
  3972. }
  3973. fi
  3974. FFTMPDIR=$(mktemp -d "${TMPDIR}/ffconf.XXXXXXXX" 2> /dev/null) ||
  3975. die "Unable to create temporary directory in $TMPDIR."
  3976. tmpfile(){
  3977. tmp="${FFTMPDIR}/test"$2
  3978. (set -C; exec > $tmp) 2> /dev/null ||
  3979. die "Unable to create temporary file in $FFTMPDIR."
  3980. eval $1=$tmp
  3981. }
  3982. trap 'rm -rf -- "$FFTMPDIR"' EXIT
  3983. trap 'exit 2' INT
  3984. tmpfile TMPASM .asm
  3985. tmpfile TMPC .c
  3986. tmpfile TMPCPP .cpp
  3987. tmpfile TMPE $EXESUF
  3988. tmpfile TMPH .h
  3989. tmpfile TMPM .m
  3990. tmpfile TMPCU .cu
  3991. tmpfile TMPO .o
  3992. tmpfile TMPS .S
  3993. tmpfile TMPSH .sh
  3994. tmpfile TMPV .ver
  3995. unset -f mktemp
  3996. chmod +x $TMPE
  3997. # make sure we can execute files in $TMPDIR
  3998. cat > $TMPSH 2>> $logfile <<EOF
  3999. #! /bin/sh
  4000. EOF
  4001. chmod +x $TMPSH >> $logfile 2>&1
  4002. if ! $TMPSH >> $logfile 2>&1; then
  4003. cat <<EOF
  4004. Unable to create and execute files in $TMPDIR. Set the TMPDIR environment
  4005. variable to another directory and make sure that it is not mounted noexec.
  4006. EOF
  4007. die "Sanity test failed."
  4008. fi
  4009. armasm_flags(){
  4010. for flag; do
  4011. case $flag in
  4012. # Filter out MSVC cl.exe options from cflags that shouldn't
  4013. # be passed to gas-preprocessor
  4014. -M[TD]*) ;;
  4015. *) echo $flag ;;
  4016. esac
  4017. done
  4018. }
  4019. cparser_flags(){
  4020. for flag; do
  4021. case $flag in
  4022. -Wno-switch) echo -Wno-switch-enum ;;
  4023. -Wno-format-zero-length) ;;
  4024. -Wdisabled-optimization) ;;
  4025. -Wno-pointer-sign) echo -Wno-other ;;
  4026. *) echo $flag ;;
  4027. esac
  4028. done
  4029. }
  4030. msvc_common_flags(){
  4031. for flag; do
  4032. case $flag in
  4033. # In addition to specifying certain flags under the compiler
  4034. # specific filters, they must be specified here as well or else the
  4035. # generic catch all at the bottom will print the original flag.
  4036. -Wall) ;;
  4037. -Wextra) ;;
  4038. -std=c99) ;;
  4039. # Common flags
  4040. -fomit-frame-pointer) ;;
  4041. -g) echo -Z7 ;;
  4042. -fno-math-errno) ;;
  4043. -fno-common) ;;
  4044. -fno-signed-zeros) ;;
  4045. -fPIC) ;;
  4046. -mthumb) ;;
  4047. -march=*) ;;
  4048. -lz) echo zlib.lib ;;
  4049. -lx264) echo libx264.lib ;;
  4050. -lstdc++) ;;
  4051. -l*) echo ${flag#-l}.lib ;;
  4052. -LARGEADDRESSAWARE) echo $flag ;;
  4053. -L*) echo -libpath:${flag#-L} ;;
  4054. *) echo $flag ;;
  4055. esac
  4056. done
  4057. }
  4058. msvc_flags(){
  4059. msvc_common_flags "$@"
  4060. for flag; do
  4061. case $flag in
  4062. -Wall) echo -W3 -wd4018 -wd4146 -wd4244 -wd4305 \
  4063. -wd4554 ;;
  4064. -Wextra) echo -W4 -wd4244 -wd4127 -wd4018 -wd4389 \
  4065. -wd4146 -wd4057 -wd4204 -wd4706 -wd4305 \
  4066. -wd4152 -wd4324 -we4013 -wd4100 -wd4214 \
  4067. -wd4307 \
  4068. -wd4273 -wd4554 -wd4701 -wd4703 ;;
  4069. esac
  4070. done
  4071. }
  4072. icl_flags(){
  4073. msvc_common_flags "$@"
  4074. for flag; do
  4075. case $flag in
  4076. # Despite what Intel's documentation says -Wall, which is supported
  4077. # on Windows, does enable remarks so disable them here.
  4078. -Wall) echo $flag -Qdiag-disable:remark ;;
  4079. -std=c99) echo -Qstd=c99 ;;
  4080. -flto) echo -ipo ;;
  4081. esac
  4082. done
  4083. }
  4084. icc_flags(){
  4085. for flag; do
  4086. case $flag in
  4087. -flto) echo -ipo ;;
  4088. *) echo $flag ;;
  4089. esac
  4090. done
  4091. }
  4092. suncc_flags(){
  4093. for flag; do
  4094. case $flag in
  4095. -march=*|-mcpu=*)
  4096. case "${flag#*=}" in
  4097. native) echo -xtarget=native ;;
  4098. v9|niagara) echo -xarch=sparc ;;
  4099. ultrasparc) echo -xarch=sparcvis ;;
  4100. ultrasparc3|niagara2) echo -xarch=sparcvis2 ;;
  4101. i586|pentium) echo -xchip=pentium ;;
  4102. i686|pentiumpro|pentium2) echo -xtarget=pentium_pro ;;
  4103. pentium3*|c3-2) echo -xtarget=pentium3 ;;
  4104. pentium-m) echo -xarch=sse2 -xchip=pentium3 ;;
  4105. pentium4*) echo -xtarget=pentium4 ;;
  4106. prescott|nocona) echo -xarch=sse3 -xchip=pentium4 ;;
  4107. *-sse3) echo -xarch=sse3 ;;
  4108. core2) echo -xarch=ssse3 -xchip=core2 ;;
  4109. bonnell) echo -xarch=ssse3 ;;
  4110. corei7|nehalem) echo -xtarget=nehalem ;;
  4111. westmere) echo -xtarget=westmere ;;
  4112. silvermont) echo -xarch=sse4_2 ;;
  4113. corei7-avx|sandybridge) echo -xtarget=sandybridge ;;
  4114. core-avx*|ivybridge|haswell|broadwell|skylake*|knl)
  4115. echo -xarch=avx ;;
  4116. amdfam10|barcelona) echo -xtarget=barcelona ;;
  4117. btver1) echo -xarch=amdsse4a ;;
  4118. btver2|bdver*|znver*) echo -xarch=avx ;;
  4119. athlon-4|athlon-[mx]p) echo -xarch=ssea ;;
  4120. k8|opteron|athlon64|athlon-fx)
  4121. echo -xarch=sse2a ;;
  4122. athlon*) echo -xarch=pentium_proa ;;
  4123. esac
  4124. ;;
  4125. -std=c99) echo -xc99 ;;
  4126. -fomit-frame-pointer) echo -xregs=frameptr ;;
  4127. -fPIC) echo -KPIC -xcode=pic32 ;;
  4128. -W*,*) echo $flag ;;
  4129. -f*-*|-W*|-mimpure-text) ;;
  4130. -shared) echo -G ;;
  4131. *) echo $flag ;;
  4132. esac
  4133. done
  4134. }
  4135. probe_cc(){
  4136. pfx=$1
  4137. _cc=$2
  4138. first=$3
  4139. unset _type _ident _cc_c _cc_e _cc_o _flags _cflags
  4140. unset _ld_o _ldflags _ld_lib _ld_path
  4141. unset _depflags _DEPCMD _DEPFLAGS
  4142. _flags_filter=echo
  4143. if $_cc --version 2>&1 | grep -q '^GNU assembler'; then
  4144. true # no-op to avoid reading stdin in following checks
  4145. elif $_cc -v 2>&1 | grep -q '^gcc.*LLVM'; then
  4146. _type=llvm_gcc
  4147. gcc_extra_ver=$(expr "$($_cc --version 2>/dev/null | head -n1)" : '.*\((.*)\)')
  4148. _ident="llvm-gcc $($_cc -dumpversion 2>/dev/null) $gcc_extra_ver"
  4149. _depflags='-MMD -MF $(@:.o=.d) -MT $@'
  4150. _cflags_speed='-O3'
  4151. _cflags_size='-Os'
  4152. elif $_cc -v 2>&1 | grep -qi ^gcc; then
  4153. _type=gcc
  4154. gcc_version=$($_cc --version | head -n1)
  4155. gcc_basever=$($_cc -dumpversion)
  4156. gcc_pkg_ver=$(expr "$gcc_version" : '[^ ]* \(([^)]*)\)')
  4157. gcc_ext_ver=$(expr "$gcc_version" : ".*$gcc_pkg_ver $gcc_basever \\(.*\\)")
  4158. _ident=$(cleanws "gcc $gcc_basever $gcc_pkg_ver $gcc_ext_ver")
  4159. case $gcc_basever in
  4160. 2) ;;
  4161. 2.*) ;;
  4162. *) _depflags='-MMD -MF $(@:.o=.d) -MT $@' ;;
  4163. esac
  4164. if [ "$first" = true ]; then
  4165. case $gcc_basever in
  4166. 4.2*)
  4167. warn "gcc 4.2 is outdated and may miscompile FFmpeg. Please use a newer compiler." ;;
  4168. esac
  4169. fi
  4170. _cflags_speed='-O3'
  4171. _cflags_size='-Os'
  4172. elif $_cc --version 2>/dev/null | grep -q ^icc; then
  4173. _type=icc
  4174. _ident=$($_cc --version | head -n1)
  4175. _depflags='-MMD'
  4176. _cflags_speed='-O3'
  4177. _cflags_size='-Os'
  4178. _cflags_noopt='-O1'
  4179. _flags_filter=icc_flags
  4180. elif $_cc -v 2>&1 | grep -q xlc; then
  4181. _type=xlc
  4182. _ident=$($_cc -qversion 2>/dev/null | head -n1)
  4183. _cflags_speed='-O5'
  4184. _cflags_size='-O5 -qcompact'
  4185. elif $_cc --vsn 2>/dev/null | grep -Eq "ARM (C/C\+\+ )?Compiler"; then
  4186. test -d "$sysroot" || die "No valid sysroot specified."
  4187. _type=armcc
  4188. _ident=$($_cc --vsn | grep -i build | head -n1 | sed 's/.*: //')
  4189. armcc_conf="$PWD/armcc.conf"
  4190. $_cc --arm_linux_configure \
  4191. --arm_linux_config_file="$armcc_conf" \
  4192. --configure_sysroot="$sysroot" \
  4193. --configure_cpp_headers="$sysinclude" >>$logfile 2>&1 ||
  4194. die "Error creating armcc configuration file."
  4195. $_cc --vsn | grep -q RVCT && armcc_opt=rvct || armcc_opt=armcc
  4196. _flags="--arm_linux_config_file=$armcc_conf --translate_gcc"
  4197. as_default="${cross_prefix}gcc"
  4198. _depflags='-MMD'
  4199. _cflags_speed='-O3'
  4200. _cflags_size='-Os'
  4201. elif $_cc -v 2>&1 | grep -q clang && ! $_cc -? > /dev/null 2>&1; then
  4202. _type=clang
  4203. _ident=$($_cc --version 2>/dev/null | head -n1)
  4204. _depflags='-MMD -MF $(@:.o=.d) -MT $@'
  4205. _cflags_speed='-O3'
  4206. _cflags_size='-Oz'
  4207. elif $_cc -V 2>&1 | grep -q Sun; then
  4208. _type=suncc
  4209. _ident=$($_cc -V 2>&1 | head -n1 | cut -d' ' -f 2-)
  4210. _DEPCMD='$(DEP$(1)) $(DEP$(1)FLAGS) $($(1)DEP_FLAGS) $< | sed -e "1s,^.*: ,$@: ," -e "\$$!s,\$$, \\\," -e "1!s,^.*: , ," > $(@:.o=.d)'
  4211. _DEPFLAGS='-xM1 -xc99'
  4212. _ldflags='-std=c99'
  4213. _cflags_speed='-O5'
  4214. _cflags_size='-O5 -xspace'
  4215. _flags_filter=suncc_flags
  4216. elif $_cc -v 2>&1 | grep -q 'PathScale\|Path64'; then
  4217. _type=pathscale
  4218. _ident=$($_cc -v 2>&1 | head -n1 | tr -d :)
  4219. _depflags='-MMD -MF $(@:.o=.d) -MT $@'
  4220. _cflags_speed='-O2'
  4221. _cflags_size='-Os'
  4222. _flags_filter='filter_out -Wdisabled-optimization'
  4223. elif $_cc -v 2>&1 | grep -q Open64; then
  4224. _type=open64
  4225. _ident=$($_cc -v 2>&1 | head -n1 | tr -d :)
  4226. _depflags='-MMD -MF $(@:.o=.d) -MT $@'
  4227. _cflags_speed='-O2'
  4228. _cflags_size='-Os'
  4229. _flags_filter='filter_out -Wdisabled-optimization|-Wtype-limits|-fno-signed-zeros'
  4230. elif $_cc 2>&1 | grep -q 'Microsoft.*ARM.*Assembler'; then
  4231. _type=armasm
  4232. _ident=$($_cc | head -n1)
  4233. # 4509: "This form of conditional instruction is deprecated"
  4234. _flags="-nologo -ignore 4509"
  4235. _flags_filter=armasm_flags
  4236. elif $_cc 2>&1 | grep -q Intel; then
  4237. _type=icl
  4238. _ident=$($_cc 2>&1 | head -n1)
  4239. _depflags='-QMMD -QMF$(@:.o=.d) -QMT$@'
  4240. # Not only is O3 broken on 13.x+ but it is slower on all previous
  4241. # versions (tested) as well.
  4242. _cflags_speed="-O2"
  4243. _cflags_size="-O1 -Oi" # -O1 without -Oi miscompiles stuff
  4244. if $_cc 2>&1 | grep -q Linker; then
  4245. _ld_o='-out:$@'
  4246. else
  4247. _ld_o='-Fe$@'
  4248. fi
  4249. _cc_o='-Fo$@'
  4250. _cc_e='-P'
  4251. _flags_filter=icl_flags
  4252. _ld_lib='lib%.a'
  4253. _ld_path='-libpath:'
  4254. # -Qdiag-error to make icl error when seeing certain unknown arguments
  4255. _flags='-nologo -Qdiag-error:4044,10157'
  4256. # -Qvec- -Qsimd- to prevent miscompilation, -GS, fp:precise for consistency
  4257. # with MSVC which enables it by default.
  4258. _cflags='-Qms0 -Qvec- -Qsimd- -GS -fp:precise'
  4259. disable stripping
  4260. elif $_cc -? 2>/dev/null | grep -q 'LLVM.*Linker'; then
  4261. # lld can emulate multiple different linkers; in ms link.exe mode,
  4262. # the -? parameter gives the help output which contains an identifyable
  4263. # string, while it gives an error in other modes.
  4264. _type=lld-link
  4265. # The link.exe mode doesn't have a switch for getting the version,
  4266. # but we can force it back to gnu mode and get the version from there.
  4267. _ident=$($_cc -flavor gnu --version 2>/dev/null)
  4268. _ld_o='-out:$@'
  4269. _flags_filter=msvc_flags
  4270. _ld_lib='lib%.a'
  4271. _ld_path='-libpath:'
  4272. elif $_cc -nologo- 2>&1 | grep -q Microsoft || { $_cc -v 2>&1 | grep -q clang && $_cc -? > /dev/null 2>&1; }; then
  4273. _type=msvc
  4274. _ident=$($_cc 2>&1 | head -n1 | tr -d '\r')
  4275. _DEPCMD='$(DEP$(1)) $(DEP$(1)FLAGS) $($(1)DEP_FLAGS) $< 2>&1 | awk '\''/including/ { sub(/^.*file: */, ""); gsub(/\\/, "/"); if (!match($$0, / /)) print "$@:", $$0 }'\'' > $(@:.o=.d)'
  4276. _DEPFLAGS='$(CPPFLAGS) $(CFLAGS) -showIncludes -Zs'
  4277. _cflags_speed="-O2"
  4278. _cflags_size="-O1"
  4279. _cflags_noopt="-O1"
  4280. if $_cc -nologo- 2>&1 | grep -q Linker; then
  4281. _ld_o='-out:$@'
  4282. else
  4283. _ld_o='-Fe$@'
  4284. fi
  4285. _cc_o='-Fo$@'
  4286. _cc_e='-P -Fi$@'
  4287. _flags_filter=msvc_flags
  4288. _ld_lib='lib%.a'
  4289. _ld_path='-libpath:'
  4290. _flags='-nologo'
  4291. disable stripping
  4292. elif $_cc --version 2>/dev/null | grep -q ^cparser; then
  4293. _type=cparser
  4294. _ident=$($_cc --version | head -n1)
  4295. _depflags='-MMD'
  4296. _cflags_speed='-O4'
  4297. _cflags_size='-O2'
  4298. _flags_filter=cparser_flags
  4299. fi
  4300. eval ${pfx}_type=\$_type
  4301. eval ${pfx}_ident=\$_ident
  4302. }
  4303. set_ccvars(){
  4304. eval ${1}_C=\${_cc_c-\${${1}_C}}
  4305. eval ${1}_E=\${_cc_e-\${${1}_E}}
  4306. eval ${1}_O=\${_cc_o-\${${1}_O}}
  4307. if [ -n "$_depflags" ]; then
  4308. eval ${1}_DEPFLAGS=\$_depflags
  4309. else
  4310. eval ${1}DEP=\${_DEPCMD:-\$DEPCMD}
  4311. eval ${1}DEP_FLAGS=\${_DEPFLAGS:-\$DEPFLAGS}
  4312. eval DEP${1}FLAGS=\$_flags
  4313. fi
  4314. }
  4315. probe_cc cc "$cc" "true"
  4316. cflags_filter=$_flags_filter
  4317. cflags_speed=$_cflags_speed
  4318. cflags_size=$_cflags_size
  4319. cflags_noopt=$_cflags_noopt
  4320. add_cflags $_flags $_cflags
  4321. cc_ldflags=$_ldflags
  4322. set_ccvars CC
  4323. set_ccvars CXX
  4324. probe_cc hostcc "$host_cc"
  4325. host_cflags_filter=$_flags_filter
  4326. host_cflags_speed=$_cflags_speed
  4327. add_host_cflags $_flags $_cflags
  4328. set_ccvars HOSTCC
  4329. test -n "$cc_type" && enable $cc_type ||
  4330. warn "Unknown C compiler $cc, unable to select optimal CFLAGS"
  4331. : ${as_default:=$cc}
  4332. : ${objcc_default:=$cc}
  4333. : ${dep_cc_default:=$cc}
  4334. : ${ld_default:=$cc}
  4335. : ${host_ld_default:=$host_cc}
  4336. set_default ar as objcc dep_cc ld ln_s host_ld windres
  4337. probe_cc as "$as"
  4338. asflags_filter=$_flags_filter
  4339. add_asflags $_flags $_cflags
  4340. set_ccvars AS
  4341. probe_cc objcc "$objcc"
  4342. objcflags_filter=$_flags_filter
  4343. add_objcflags $_flags $_cflags
  4344. set_ccvars OBJC
  4345. probe_cc ld "$ld"
  4346. ldflags_filter=$_flags_filter
  4347. add_ldflags $_flags $_ldflags
  4348. test "$cc_type" != "$ld_type" && add_ldflags $cc_ldflags
  4349. LD_O=${_ld_o-$LD_O}
  4350. LD_LIB=${_ld_lib-$LD_LIB}
  4351. LD_PATH=${_ld_path-$LD_PATH}
  4352. probe_cc hostld "$host_ld"
  4353. host_ldflags_filter=$_flags_filter
  4354. add_host_ldflags $_flags $_ldflags
  4355. HOSTLD_O=${_ld_o-$HOSTLD_O}
  4356. if [ -z "$CC_DEPFLAGS" ] && [ "$dep_cc" != "$cc" ]; then
  4357. probe_cc depcc "$dep_cc"
  4358. CCDEP=${_DEPCMD:-$DEPCMD}
  4359. CCDEP_FLAGS=${_DEPFLAGS:=$DEPFLAGS}
  4360. DEPCCFLAGS=$_flags
  4361. fi
  4362. if $ar 2>&1 | grep -q Microsoft; then
  4363. arflags="-nologo"
  4364. ar_o='-out:$@'
  4365. elif $ar 2>&1 | grep -q "\[D\] "; then
  4366. arflags="rcD"
  4367. ar_o='$@'
  4368. else
  4369. arflags="rc"
  4370. ar_o='$@'
  4371. fi
  4372. add_cflags $extra_cflags
  4373. add_cxxflags $extra_cxxflags
  4374. add_objcflags $extra_objcflags
  4375. add_asflags $extra_cflags
  4376. if test -n "$sysroot"; then
  4377. case "$cc_type" in
  4378. gcc|llvm_gcc|clang)
  4379. add_cppflags --sysroot="$sysroot"
  4380. add_ldflags --sysroot="$sysroot"
  4381. ;;
  4382. esac
  4383. fi
  4384. if test "$cpu" = host; then
  4385. enabled cross_compile &&
  4386. die "--cpu=host makes no sense when cross-compiling."
  4387. case "$cc_type" in
  4388. gcc|llvm_gcc)
  4389. check_native(){
  4390. $cc $1=native -v -c -o $TMPO $TMPC >$TMPE 2>&1 || return
  4391. sed -n "/cc1.*$1=/{
  4392. s/.*$1=\\([^ ]*\\).*/\\1/
  4393. p
  4394. q
  4395. }" $TMPE
  4396. }
  4397. cpu=$(check_native -march || check_native -mcpu)
  4398. ;;
  4399. clang)
  4400. check_native(){
  4401. $cc $1=native -v -c -o $TMPO $TMPC >$TMPE 2>&1 || return
  4402. sed -n "/cc1.*-target-cpu /{
  4403. s/.*-target-cpu \\([^ ]*\\).*/\\1/
  4404. p
  4405. q
  4406. }" $TMPE
  4407. }
  4408. cpu=$(check_native -march)
  4409. ;;
  4410. esac
  4411. test "${cpu:-host}" = host &&
  4412. die "--cpu=host not supported with compiler $cc"
  4413. fi
  4414. # Deal with common $arch aliases
  4415. case "$arch" in
  4416. aarch64|arm64)
  4417. arch="aarch64"
  4418. ;;
  4419. arm*|iPad*|iPhone*)
  4420. arch="arm"
  4421. ;;
  4422. mips*|IP*)
  4423. case "$arch" in
  4424. *el)
  4425. add_cppflags -EL
  4426. add_ldflags -EL
  4427. ;;
  4428. *eb)
  4429. add_cppflags -EB
  4430. add_ldflags -EB
  4431. ;;
  4432. esac
  4433. arch="mips"
  4434. ;;
  4435. parisc*|hppa*)
  4436. arch="parisc"
  4437. ;;
  4438. "Power Macintosh"|ppc*|powerpc*)
  4439. arch="ppc"
  4440. ;;
  4441. s390|s390x)
  4442. arch="s390"
  4443. ;;
  4444. sh4|sh)
  4445. arch="sh4"
  4446. ;;
  4447. sun4*|sparc*)
  4448. arch="sparc"
  4449. ;;
  4450. tilegx|tile-gx)
  4451. arch="tilegx"
  4452. ;;
  4453. i[3-6]86*|i86pc|BePC|x86pc|x86_64|x86_32|amd64)
  4454. arch="x86"
  4455. ;;
  4456. esac
  4457. is_in $arch $ARCH_LIST || warn "unknown architecture $arch"
  4458. enable $arch
  4459. # Add processor-specific flags
  4460. if enabled aarch64; then
  4461. case $cpu in
  4462. armv*)
  4463. cpuflags="-march=$cpu"
  4464. ;;
  4465. *)
  4466. cpuflags="-mcpu=$cpu"
  4467. ;;
  4468. esac
  4469. elif enabled alpha; then
  4470. cpuflags="-mcpu=$cpu"
  4471. elif enabled arm; then
  4472. check_arm_arch() {
  4473. test_cpp_condition stddef.h \
  4474. "defined __ARM_ARCH_${1}__ || defined __TARGET_ARCH_${2:-$1}" \
  4475. $cpuflags
  4476. }
  4477. probe_arm_arch() {
  4478. if check_arm_arch 4; then echo armv4
  4479. elif check_arm_arch 4T; then echo armv4t
  4480. elif check_arm_arch 5; then echo armv5
  4481. elif check_arm_arch 5E; then echo armv5e
  4482. elif check_arm_arch 5T; then echo armv5t
  4483. elif check_arm_arch 5TE; then echo armv5te
  4484. elif check_arm_arch 5TEJ; then echo armv5te
  4485. elif check_arm_arch 6; then echo armv6
  4486. elif check_arm_arch 6J; then echo armv6j
  4487. elif check_arm_arch 6K; then echo armv6k
  4488. elif check_arm_arch 6Z; then echo armv6z
  4489. elif check_arm_arch 6KZ; then echo armv6zk
  4490. elif check_arm_arch 6ZK; then echo armv6zk
  4491. elif check_arm_arch 6T2; then echo armv6t2
  4492. elif check_arm_arch 7; then echo armv7
  4493. elif check_arm_arch 7A 7_A; then echo armv7-a
  4494. elif check_arm_arch 7S; then echo armv7-a
  4495. elif check_arm_arch 7R 7_R; then echo armv7-r
  4496. elif check_arm_arch 7M 7_M; then echo armv7-m
  4497. elif check_arm_arch 7EM 7E_M; then echo armv7-m
  4498. elif check_arm_arch 8A 8_A; then echo armv8-a
  4499. fi
  4500. }
  4501. [ "$cpu" = generic ] && cpu=$(probe_arm_arch)
  4502. case $cpu in
  4503. armv*)
  4504. cpuflags="-march=$cpu"
  4505. subarch=$(echo $cpu | sed 's/[^a-z0-9]//g')
  4506. ;;
  4507. *)
  4508. cpuflags="-mcpu=$cpu"
  4509. case $cpu in
  4510. cortex-a*) subarch=armv7a ;;
  4511. cortex-r*) subarch=armv7r ;;
  4512. cortex-m*) enable thumb; subarch=armv7m ;;
  4513. arm11*) subarch=armv6 ;;
  4514. arm[79]*e*|arm9[24]6*|arm96*|arm102[26]) subarch=armv5te ;;
  4515. armv4*|arm7*|arm9[24]*) subarch=armv4 ;;
  4516. *) subarch=$(probe_arm_arch) ;;
  4517. esac
  4518. ;;
  4519. esac
  4520. case "$subarch" in
  4521. armv5t*) enable fast_clz ;;
  4522. armv[6-8]*)
  4523. enable fast_clz
  4524. disabled fast_unaligned || enable fast_unaligned
  4525. ;;
  4526. esac
  4527. elif enabled avr32; then
  4528. case $cpu in
  4529. ap7[02]0[0-2])
  4530. subarch="avr32_ap"
  4531. cpuflags="-mpart=$cpu"
  4532. ;;
  4533. ap)
  4534. subarch="avr32_ap"
  4535. cpuflags="-march=$cpu"
  4536. ;;
  4537. uc3[ab]*)
  4538. subarch="avr32_uc"
  4539. cpuflags="-mcpu=$cpu"
  4540. ;;
  4541. uc)
  4542. subarch="avr32_uc"
  4543. cpuflags="-march=$cpu"
  4544. ;;
  4545. esac
  4546. elif enabled bfin; then
  4547. cpuflags="-mcpu=$cpu"
  4548. elif enabled mips; then
  4549. cpuflags="-march=$cpu"
  4550. if [ "$cpu" != "generic" ]; then
  4551. disable mips32r2
  4552. disable mips32r5
  4553. disable mips64r2
  4554. disable mips32r6
  4555. disable mips64r6
  4556. disable loongson2
  4557. disable loongson3
  4558. case $cpu in
  4559. 24kc|24kf*|24kec|34kc|1004kc|24kef*|34kf*|1004kf*|74kc|74kf)
  4560. enable mips32r2
  4561. disable msa
  4562. ;;
  4563. p5600|i6400|p6600)
  4564. disable mipsdsp
  4565. disable mipsdspr2
  4566. ;;
  4567. loongson*)
  4568. enable loongson2
  4569. enable loongson3
  4570. enable local_aligned
  4571. enable simd_align_16
  4572. enable fast_64bit
  4573. enable fast_clz
  4574. enable fast_cmov
  4575. enable fast_unaligned
  4576. disable aligned_stack
  4577. disable mipsdsp
  4578. disable mipsdspr2
  4579. # When gcc version less than 5.3.0, add -fno-expensive-optimizations flag.
  4580. if [ $cc == gcc ]; then
  4581. gcc_version=$(gcc -dumpversion)
  4582. if [ "$(echo "$gcc_version 5.3.0" | tr " " "\n" | sort -rV | head -n 1)" == "$gcc_version" ]; then
  4583. expensive_optimization_flag=""
  4584. else
  4585. expensive_optimization_flag="-fno-expensive-optimizations"
  4586. fi
  4587. fi
  4588. case $cpu in
  4589. loongson3*)
  4590. cpuflags="-march=loongson3a -mhard-float $expensive_optimization_flag"
  4591. ;;
  4592. loongson2e)
  4593. cpuflags="-march=loongson2e -mhard-float $expensive_optimization_flag"
  4594. ;;
  4595. loongson2f)
  4596. cpuflags="-march=loongson2f -mhard-float $expensive_optimization_flag"
  4597. ;;
  4598. esac
  4599. ;;
  4600. *)
  4601. # Unknown CPU. Disable everything.
  4602. warn "unknown CPU. Disabling all MIPS optimizations."
  4603. disable mipsfpu
  4604. disable mipsdsp
  4605. disable mipsdspr2
  4606. disable msa
  4607. disable mmi
  4608. ;;
  4609. esac
  4610. case $cpu in
  4611. 24kc)
  4612. disable mipsfpu
  4613. disable mipsdsp
  4614. disable mipsdspr2
  4615. ;;
  4616. 24kf*)
  4617. disable mipsdsp
  4618. disable mipsdspr2
  4619. ;;
  4620. 24kec|34kc|1004kc)
  4621. disable mipsfpu
  4622. disable mipsdspr2
  4623. ;;
  4624. 24kef*|34kf*|1004kf*)
  4625. disable mipsdspr2
  4626. ;;
  4627. 74kc)
  4628. disable mipsfpu
  4629. ;;
  4630. p5600)
  4631. enable mips32r5
  4632. check_cflags "-mtune=p5600" && check_cflags "-msched-weight -mload-store-pairs -funroll-loops"
  4633. ;;
  4634. i6400)
  4635. enable mips64r6
  4636. check_cflags "-mtune=i6400 -mabi=64" && check_cflags "-msched-weight -mload-store-pairs -funroll-loops" && check_ldflags "-mabi=64"
  4637. ;;
  4638. p6600)
  4639. enable mips64r6
  4640. check_cflags "-mtune=p6600 -mabi=64" && check_cflags "-msched-weight -mload-store-pairs -funroll-loops" && check_ldflags "-mabi=64"
  4641. ;;
  4642. esac
  4643. else
  4644. # We do not disable anything. Is up to the user to disable the unwanted features.
  4645. warn 'generic cpu selected'
  4646. fi
  4647. elif enabled ppc; then
  4648. disable ldbrx
  4649. case $(tolower $cpu) in
  4650. 601|ppc601|powerpc601)
  4651. cpuflags="-mcpu=601"
  4652. disable altivec
  4653. ;;
  4654. 603*|ppc603*|powerpc603*)
  4655. cpuflags="-mcpu=603"
  4656. disable altivec
  4657. ;;
  4658. 604*|ppc604*|powerpc604*)
  4659. cpuflags="-mcpu=604"
  4660. disable altivec
  4661. ;;
  4662. g3|75*|ppc75*|powerpc75*)
  4663. cpuflags="-mcpu=750"
  4664. disable altivec
  4665. ;;
  4666. g4|745*|ppc745*|powerpc745*)
  4667. cpuflags="-mcpu=7450"
  4668. disable vsx
  4669. ;;
  4670. 74*|ppc74*|powerpc74*)
  4671. cpuflags="-mcpu=7400"
  4672. disable vsx
  4673. ;;
  4674. g5|970|ppc970|powerpc970)
  4675. cpuflags="-mcpu=970"
  4676. disable vsx
  4677. ;;
  4678. power[3-6]*)
  4679. cpuflags="-mcpu=$cpu"
  4680. disable vsx
  4681. ;;
  4682. power[7-8]*)
  4683. cpuflags="-mcpu=$cpu"
  4684. ;;
  4685. cell)
  4686. cpuflags="-mcpu=cell"
  4687. enable ldbrx
  4688. disable vsx
  4689. ;;
  4690. e500mc)
  4691. cpuflags="-mcpu=e500mc"
  4692. disable altivec
  4693. ;;
  4694. e500v2)
  4695. cpuflags="-mcpu=8548 -mhard-float -mfloat-gprs=double"
  4696. disable altivec
  4697. disable dcbzl
  4698. ;;
  4699. e500)
  4700. cpuflags="-mcpu=8540 -mhard-float"
  4701. disable altivec
  4702. disable dcbzl
  4703. ;;
  4704. esac
  4705. elif enabled sparc; then
  4706. case $cpu in
  4707. cypress|f93[04]|tsc701|sparcl*|supersparc|hypersparc|niagara|v[789])
  4708. cpuflags="-mcpu=$cpu"
  4709. ;;
  4710. ultrasparc*|niagara[234])
  4711. cpuflags="-mcpu=$cpu"
  4712. ;;
  4713. esac
  4714. elif enabled x86; then
  4715. case $cpu in
  4716. i[345]86|pentium)
  4717. cpuflags="-march=$cpu"
  4718. disable i686
  4719. disable mmx
  4720. ;;
  4721. # targets that do NOT support nopl and conditional mov (cmov)
  4722. pentium-mmx|k6|k6-[23]|winchip-c6|winchip2|c3)
  4723. cpuflags="-march=$cpu"
  4724. disable i686
  4725. ;;
  4726. # targets that do support nopl and conditional mov (cmov)
  4727. i686|pentiumpro|pentium[23]|pentium-m|athlon|athlon-tbird|athlon-4|athlon-[mx]p|athlon64*|k8*|opteron*|athlon-fx\
  4728. |core*|atom|bonnell|nehalem|westmere|silvermont|sandybridge|ivybridge|haswell|broadwell|skylake*|knl\
  4729. |amdfam10|barcelona|b[dt]ver*|znver*)
  4730. cpuflags="-march=$cpu"
  4731. enable i686
  4732. enable fast_cmov
  4733. ;;
  4734. # targets that do support conditional mov but on which it's slow
  4735. pentium4|pentium4m|prescott|nocona)
  4736. cpuflags="-march=$cpu"
  4737. enable i686
  4738. disable fast_cmov
  4739. ;;
  4740. esac
  4741. fi
  4742. if [ "$cpu" != generic ]; then
  4743. add_cflags $cpuflags
  4744. add_asflags $cpuflags
  4745. test "$cc_type" = "$ld_type" && add_ldflags $cpuflags
  4746. fi
  4747. # compiler sanity check
  4748. test_exec <<EOF
  4749. int main(void){ return 0; }
  4750. EOF
  4751. if test "$?" != 0; then
  4752. echo "$cc is unable to create an executable file."
  4753. if test -z "$cross_prefix" && ! enabled cross_compile ; then
  4754. echo "If $cc is a cross-compiler, use the --enable-cross-compile option."
  4755. echo "Only do this if you know what cross compiling means."
  4756. fi
  4757. die "C compiler test failed."
  4758. fi
  4759. add_cppflags -D_ISOC99_SOURCE
  4760. add_cxxflags -D__STDC_CONSTANT_MACROS
  4761. check_cxxflags -std=c++11 || check_cxxflags -std=c++0x
  4762. # some compilers silently accept -std=c11, so we also need to check that the
  4763. # version macro is defined properly
  4764. test_cflags_cc -std=c11 ctype.h "__STDC_VERSION__ >= 201112L" &&
  4765. add_cflags -std=c11 ||
  4766. check_cflags -std=c99
  4767. check_cppflags -D_FILE_OFFSET_BITS=64
  4768. check_cppflags -D_LARGEFILE_SOURCE
  4769. add_host_cppflags -D_ISOC99_SOURCE
  4770. check_host_cflags -std=c99
  4771. check_host_cflags -Wall
  4772. check_host_cflags $host_cflags_speed
  4773. check_64bit(){
  4774. arch32=$1
  4775. arch64=$2
  4776. expr=${3:-'sizeof(void *) > 4'}
  4777. test_code cc "" "int test[2*($expr) - 1]" &&
  4778. subarch=$arch64 || subarch=$arch32
  4779. enable $subarch
  4780. }
  4781. case "$arch" in
  4782. aarch64|alpha|ia64)
  4783. enabled shared && enable_weak pic
  4784. ;;
  4785. mips)
  4786. check_64bit mips mips64 '_MIPS_SIM > 1'
  4787. enabled shared && enable_weak pic
  4788. ;;
  4789. parisc)
  4790. check_64bit parisc parisc64
  4791. enabled shared && enable_weak pic
  4792. ;;
  4793. ppc)
  4794. check_64bit ppc ppc64
  4795. enabled shared && enable_weak pic
  4796. ;;
  4797. s390)
  4798. check_64bit s390 s390x
  4799. enabled shared && enable_weak pic
  4800. ;;
  4801. sparc)
  4802. check_64bit sparc sparc64
  4803. enabled shared && enable_weak pic
  4804. ;;
  4805. x86)
  4806. check_64bit x86_32 x86_64
  4807. # Treat x32 as x64 for now. Note it also needs pic if shared
  4808. test "$subarch" = "x86_32" && test_cpp_condition stddef.h 'defined(__x86_64__)' &&
  4809. subarch=x86_64 && enable x86_64 && disable x86_32
  4810. if enabled x86_64; then
  4811. enabled shared && enable_weak pic
  4812. objformat=elf64
  4813. fi
  4814. ;;
  4815. esac
  4816. # OS specific
  4817. case $target_os in
  4818. aix)
  4819. SHFLAGS=-shared
  4820. add_cppflags '-I\$(SRC_PATH)/compat/aix'
  4821. enabled shared && add_ldflags -Wl,-brtl
  4822. arflags='-Xany -r -c'
  4823. striptype=""
  4824. ;;
  4825. android)
  4826. disable symver
  4827. enable section_data_rel_ro
  4828. add_cflags -fPIE
  4829. add_ldexeflags -fPIE -pie
  4830. SLIB_INSTALL_NAME='$(SLIBNAME)'
  4831. SLIB_INSTALL_LINKS=
  4832. SHFLAGS='-shared -Wl,-soname,$(SLIBNAME)'
  4833. ;;
  4834. haiku)
  4835. prefix_default="/boot/common"
  4836. network_extralibs="-lnetwork"
  4837. host_extralibs=
  4838. ;;
  4839. sunos)
  4840. SHFLAGS='-shared -Wl,-h,$$(@F)'
  4841. enabled x86 && append SHFLAGS -mimpure-text
  4842. network_extralibs="-lsocket -lnsl"
  4843. add_cppflags -D__EXTENSIONS__
  4844. # When using suncc to build, the Solaris linker will mark
  4845. # an executable with each instruction set encountered by
  4846. # the Solaris assembler. As our libraries contain their own
  4847. # guards for processor-specific code, instead suppress
  4848. # generation of the HWCAPS ELF section on Solaris x86 only.
  4849. enabled_all suncc x86 &&
  4850. echo "hwcap_1 = OVERRIDE;" > mapfile &&
  4851. add_ldflags -Wl,-M,mapfile
  4852. nm_default='nm -P -g'
  4853. striptype=""
  4854. version_script='-M'
  4855. VERSION_SCRIPT_POSTPROCESS_CMD='perl $(SRC_PATH)/compat/solaris/make_sunver.pl - $(OBJS)'
  4856. ;;
  4857. netbsd)
  4858. disable symver
  4859. oss_indev_extralibs="-lossaudio"
  4860. oss_outdev_extralibs="-lossaudio"
  4861. enabled gcc || check_ldflags -Wl,-zmuldefs
  4862. ;;
  4863. openbsd|bitrig)
  4864. disable symver
  4865. striptype=""
  4866. SHFLAGS='-shared'
  4867. SLIB_INSTALL_NAME='$(SLIBNAME).$(LIBMAJOR).$(LIBMINOR)'
  4868. SLIB_INSTALL_LINKS=
  4869. oss_indev_extralibs="-lossaudio"
  4870. oss_outdev_extralibs="-lossaudio"
  4871. ;;
  4872. dragonfly)
  4873. disable symver
  4874. ;;
  4875. freebsd)
  4876. ;;
  4877. bsd/os)
  4878. add_extralibs -lpoll -lgnugetopt
  4879. strip="strip -d"
  4880. ;;
  4881. darwin)
  4882. enabled ppc && add_asflags -force_cpusubtype_ALL
  4883. install_name_dir_default='$(SHLIBDIR)'
  4884. SHFLAGS='-dynamiclib -Wl,-single_module -Wl,-install_name,$(INSTALL_NAME_DIR)/$(SLIBNAME_WITH_MAJOR),-current_version,$(LIBVERSION),-compatibility_version,$(LIBMAJOR)'
  4885. enabled x86_32 && append SHFLAGS -Wl,-read_only_relocs,suppress
  4886. strip="${strip} -x"
  4887. add_ldflags -Wl,-dynamic,-search_paths_first
  4888. check_cflags -Werror=partial-availability
  4889. SLIBSUF=".dylib"
  4890. SLIBNAME_WITH_VERSION='$(SLIBPREF)$(FULLNAME).$(LIBVERSION)$(SLIBSUF)'
  4891. SLIBNAME_WITH_MAJOR='$(SLIBPREF)$(FULLNAME).$(LIBMAJOR)$(SLIBSUF)'
  4892. enabled x86_64 && objformat="macho64" || objformat="macho32"
  4893. enabled_any pic shared x86_64 ||
  4894. { check_cflags -mdynamic-no-pic && add_asflags -mdynamic-no-pic; }
  4895. check_headers dispatch/dispatch.h &&
  4896. add_cppflags '-I\$(SRC_PATH)/compat/dispatch_semaphore'
  4897. if test -n "$sysroot"; then
  4898. is_in -isysroot $cc $CPPFLAGS $CFLAGS || check_cppflags -isysroot $sysroot
  4899. is_in -isysroot $ld $LDFLAGS || check_ldflags -isysroot $sysroot
  4900. fi
  4901. version_script='-exported_symbols_list'
  4902. VERSION_SCRIPT_POSTPROCESS_CMD='tr " " "\n" | sed -n /global:/,/local:/p | grep ";" | tr ";" "\n" | sed -E "s/(.+)/_\1/g" | sed -E "s/(.+[^*])$$$$/\1*/"'
  4903. ;;
  4904. msys*)
  4905. die "Native MSYS builds are discouraged, please use the MINGW environment."
  4906. ;;
  4907. mingw32*|mingw64*)
  4908. target_os=mingw32
  4909. LIBTARGET=i386
  4910. if enabled x86_64; then
  4911. LIBTARGET="i386:x86-64"
  4912. elif enabled arm; then
  4913. LIBTARGET="arm"
  4914. elif enabled aarch64; then
  4915. LIBTARGET="arm64"
  4916. fi
  4917. if enabled shared; then
  4918. # Cannot build both shared and static libs when using dllimport.
  4919. disable static
  4920. fi
  4921. enabled shared && ! enabled small && test_cmd $windres --version && enable gnu_windres
  4922. enabled x86_32 && check_ldflags -Wl,--large-address-aware
  4923. shlibdir_default="$bindir_default"
  4924. SLIBPREF=""
  4925. SLIBSUF=".dll"
  4926. SLIBNAME_WITH_VERSION='$(SLIBPREF)$(FULLNAME)-$(LIBVERSION)$(SLIBSUF)'
  4927. SLIBNAME_WITH_MAJOR='$(SLIBPREF)$(FULLNAME)-$(LIBMAJOR)$(SLIBSUF)'
  4928. if test_cmd lib.exe -list; then
  4929. SLIB_EXTRA_CMD=-'lib.exe -nologo -machine:$(LIBTARGET) -def:$$(@:$(SLIBSUF)=.def) -out:$(SUBDIR)$(SLIBNAME:$(SLIBSUF)=.lib)'
  4930. if enabled x86_64; then
  4931. LIBTARGET=x64
  4932. fi
  4933. else
  4934. SLIB_EXTRA_CMD=-'$(DLLTOOL) -m $(LIBTARGET) -d $$(@:$(SLIBSUF)=.def) -l $(SUBDIR)$(SLIBNAME:$(SLIBSUF)=.lib) -D $(SLIBNAME_WITH_MAJOR)'
  4935. fi
  4936. SLIB_INSTALL_NAME='$(SLIBNAME_WITH_MAJOR)'
  4937. SLIB_INSTALL_LINKS=
  4938. SLIB_INSTALL_EXTRA_SHLIB='$(SLIBNAME:$(SLIBSUF)=.lib)'
  4939. SLIB_INSTALL_EXTRA_LIB='lib$(SLIBNAME:$(SLIBSUF)=.dll.a) $(SLIBNAME_WITH_MAJOR:$(SLIBSUF)=.def)'
  4940. SLIB_CREATE_DEF_CMD='EXTERN_PREFIX="$(EXTERN_PREFIX)" AR="$(AR_CMD)" NM="$(NM_CMD)" $(SRC_PATH)/compat/windows/makedef $(SUBDIR)lib$(NAME).ver $(OBJS) > $$(@:$(SLIBSUF)=.def)'
  4941. SHFLAGS='-shared -Wl,--out-implib,$(SUBDIR)lib$(SLIBNAME:$(SLIBSUF)=.dll.a) -Wl,--disable-auto-image-base $$(@:$(SLIBSUF)=.def)'
  4942. enabled x86_64 && objformat="win64" || objformat="win32"
  4943. dlltool="${cross_prefix}dlltool"
  4944. ranlib=:
  4945. enable dos_paths
  4946. check_ldflags -Wl,--nxcompat,--dynamicbase
  4947. # Lets work around some stupidity in binutils.
  4948. # ld will strip relocations from executables even though we need them
  4949. # for dynamicbase (ASLR). Using -pie does retain the reloc section
  4950. # however ld then forgets what the entry point should be (oops) so we
  4951. # have to manually (re)set it.
  4952. if enabled x86_32; then
  4953. disabled debug && add_ldexeflags -Wl,--pic-executable,-e,_mainCRTStartup
  4954. elif enabled x86_64; then
  4955. disabled debug && add_ldexeflags -Wl,--pic-executable,-e,mainCRTStartup
  4956. check_ldflags -Wl,--high-entropy-va # binutils 2.25
  4957. # Set image base >4GB for extra entropy with HEASLR
  4958. add_ldexeflags -Wl,--image-base,0x140000000
  4959. append SHFLAGS -Wl,--image-base,0x180000000
  4960. fi
  4961. ;;
  4962. win32|win64)
  4963. disable symver
  4964. if enabled shared; then
  4965. # Link to the import library instead of the normal static library
  4966. # for shared libs.
  4967. LD_LIB='%.lib'
  4968. # Cannot build both shared and static libs with MSVC or icl.
  4969. disable static
  4970. fi
  4971. enabled x86_32 && check_ldflags -LARGEADDRESSAWARE
  4972. shlibdir_default="$bindir_default"
  4973. SLIBPREF=""
  4974. SLIBSUF=".dll"
  4975. SLIBNAME_WITH_VERSION='$(SLIBPREF)$(FULLNAME)-$(LIBVERSION)$(SLIBSUF)'
  4976. SLIBNAME_WITH_MAJOR='$(SLIBPREF)$(FULLNAME)-$(LIBMAJOR)$(SLIBSUF)'
  4977. SLIB_CREATE_DEF_CMD='EXTERN_PREFIX="$(EXTERN_PREFIX)" $(SRC_PATH)/compat/windows/makedef $(SUBDIR)lib$(NAME).ver $(OBJS) > $$(@:$(SLIBSUF)=.def)'
  4978. SLIB_INSTALL_NAME='$(SLIBNAME_WITH_MAJOR)'
  4979. SLIB_INSTALL_LINKS=
  4980. SLIB_INSTALL_EXTRA_SHLIB='$(SLIBNAME:$(SLIBSUF)=.lib)'
  4981. SLIB_INSTALL_EXTRA_LIB='$(SLIBNAME_WITH_MAJOR:$(SLIBSUF)=.def)'
  4982. SHFLAGS='-dll -def:$$(@:$(SLIBSUF)=.def) -implib:$(SUBDIR)$(SLIBNAME:$(SLIBSUF)=.lib)'
  4983. enabled x86_64 && objformat="win64" || objformat="win32"
  4984. ranlib=:
  4985. enable dos_paths
  4986. ;;
  4987. cygwin*)
  4988. target_os=cygwin
  4989. shlibdir_default="$bindir_default"
  4990. SLIBPREF="cyg"
  4991. SLIBSUF=".dll"
  4992. SLIBNAME_WITH_VERSION='$(SLIBPREF)$(FULLNAME)-$(LIBVERSION)$(SLIBSUF)'
  4993. SLIBNAME_WITH_MAJOR='$(SLIBPREF)$(FULLNAME)-$(LIBMAJOR)$(SLIBSUF)'
  4994. SLIB_INSTALL_NAME='$(SLIBNAME_WITH_MAJOR)'
  4995. SLIB_INSTALL_LINKS=
  4996. SLIB_INSTALL_EXTRA_LIB='lib$(FULLNAME).dll.a'
  4997. SHFLAGS='-shared -Wl,--out-implib,$(SUBDIR)lib$(FULLNAME).dll.a'
  4998. enabled x86_64 && objformat="win64" || objformat="win32"
  4999. enable dos_paths
  5000. enabled shared && ! enabled small && test_cmd $windres --version && enable gnu_windres
  5001. add_cppflags -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600
  5002. ;;
  5003. *-dos|freedos|opendos)
  5004. network_extralibs="-lsocket"
  5005. objformat="coff"
  5006. enable dos_paths
  5007. ;;
  5008. linux)
  5009. enable section_data_rel_ro
  5010. enabled_any arm aarch64 && enable_weak linux_perf
  5011. ;;
  5012. irix*)
  5013. target_os=irix
  5014. ranlib="echo ignoring ranlib"
  5015. ;;
  5016. os/2*)
  5017. strip="lxlite -CS"
  5018. striptype=""
  5019. objformat="aout"
  5020. add_cppflags -D_GNU_SOURCE
  5021. add_ldflags -Zomf -Zbin-files -Zargs-wild -Zhigh-mem -Zmap
  5022. SHFLAGS='$(SUBDIR)$(NAME).def -Zdll -Zomf'
  5023. LIBSUF="_s.a"
  5024. SLIBPREF=""
  5025. SLIBSUF=".dll"
  5026. SLIBNAME_WITH_VERSION='$(SLIBPREF)$(FULLNAME)-$(LIBVERSION)$(SLIBSUF)'
  5027. SLIBNAME_WITH_MAJOR='$(SLIBPREF)$(shell echo $(FULLNAME) | cut -c1-6)$(LIBMAJOR)$(SLIBSUF)'
  5028. SLIB_CREATE_DEF_CMD='echo LIBRARY $(SLIBNAME_WITH_MAJOR:$(SLIBSUF)=) INITINSTANCE TERMINSTANCE > $(SUBDIR)$(FULLNAME).def; \
  5029. echo CODE PRELOAD MOVEABLE DISCARDABLE >> $(SUBDIR)$(FULLNAME).def; \
  5030. echo DATA PRELOAD MOVEABLE MULTIPLE NONSHARED >> $(SUBDIR)$(FULLNAME).def; \
  5031. echo EXPORTS >> $(SUBDIR)$(FULLNAME).def; \
  5032. emxexp $(OBJS) >> $(SUBDIR)$(FULLNAME).def'
  5033. SLIB_EXTRA_CMD='emximp -o $(SUBDIR)$(LIBPREF)$(FULLNAME)_dll.a $(SUBDIR)$(FULLNAME).def; \
  5034. emximp -o $(SUBDIR)$(LIBPREF)$(FULLNAME)_dll.lib $(SUBDIR)$(FULLNAME).def;'
  5035. SLIB_INSTALL_NAME='$(SLIBNAME_WITH_MAJOR)'
  5036. SLIB_INSTALL_LINKS=
  5037. SLIB_INSTALL_EXTRA_LIB='$(LIBPREF)$(FULLNAME)_dll.a $(LIBPREF)$(FULLNAME)_dll.lib'
  5038. enable dos_paths
  5039. enable_weak os2threads
  5040. ;;
  5041. gnu/kfreebsd)
  5042. add_cppflags -D_BSD_SOURCE
  5043. ;;
  5044. gnu)
  5045. ;;
  5046. qnx)
  5047. add_cppflags -D_QNX_SOURCE
  5048. network_extralibs="-lsocket"
  5049. ;;
  5050. symbian)
  5051. SLIBSUF=".dll"
  5052. enable dos_paths
  5053. add_cflags --include=$sysinclude/gcce/gcce.h -fvisibility=default
  5054. add_cppflags -D__GCCE__ -D__SYMBIAN32__ -DSYMBIAN_OE_POSIX_SIGNALS
  5055. add_ldflags -Wl,--target1-abs,--no-undefined \
  5056. -Wl,-Ttext,0x80000,-Tdata,0x1000000 -shared \
  5057. -Wl,--entry=_E32Startup -Wl,-u,_E32Startup
  5058. add_extralibs -l:eexe.lib -l:usrt2_2.lib -l:dfpaeabi.dso \
  5059. -l:drtaeabi.dso -l:scppnwdl.dso -lsupc++ -lgcc \
  5060. -l:libc.dso -l:libm.dso -l:euser.dso -l:libcrt0.lib
  5061. ;;
  5062. minix)
  5063. ;;
  5064. none)
  5065. ;;
  5066. *)
  5067. die "Unknown OS '$target_os'."
  5068. ;;
  5069. esac
  5070. # test if creating links works
  5071. link_dest=$(mktemp -u $TMPDIR/dest_XXXXXXXX)
  5072. link_name=$(mktemp -u $TMPDIR/name_XXXXXXXX)
  5073. mkdir "$link_dest"
  5074. $ln_s "$link_dest" "$link_name"
  5075. touch "$link_dest/test_file"
  5076. if [ "$source_path" != "." ] && [ "$source_path" != "src" ] && ([ ! -d src ] || [ -L src ]) && [ -e "$link_name/test_file" ]; then
  5077. # create link to source path
  5078. [ -e src ] && rm src
  5079. $ln_s "$source_path" src
  5080. source_link=src
  5081. else
  5082. # creating directory links doesn't work
  5083. # fall back to using the full source path
  5084. source_link="$source_path"
  5085. fi
  5086. # cleanup
  5087. rm -r "$link_dest"
  5088. rm -r "$link_name"
  5089. # determine libc flavour
  5090. probe_libc(){
  5091. pfx=$1
  5092. pfx_no_=${pfx%_}
  5093. # uclibc defines __GLIBC__, so it needs to be checked before glibc.
  5094. if test_${pfx}cpp_condition features.h "defined __UCLIBC__"; then
  5095. eval ${pfx}libc_type=uclibc
  5096. add_${pfx}cppflags -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600
  5097. elif test_${pfx}cpp_condition features.h "defined __GLIBC__"; then
  5098. eval ${pfx}libc_type=glibc
  5099. add_${pfx}cppflags -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600
  5100. # MinGW headers can be installed on Cygwin, so check for newlib first.
  5101. elif test_${pfx}cpp_condition newlib.h "defined _NEWLIB_VERSION"; then
  5102. eval ${pfx}libc_type=newlib
  5103. add_${pfx}cppflags -U__STRICT_ANSI__ -D_XOPEN_SOURCE=600
  5104. # MinGW64 is backwards compatible with MinGW32, so check for it first.
  5105. elif test_${pfx}cpp_condition _mingw.h "defined __MINGW64_VERSION_MAJOR"; then
  5106. eval ${pfx}libc_type=mingw64
  5107. if test_${pfx}cpp_condition _mingw.h "__MINGW64_VERSION_MAJOR < 3"; then
  5108. add_compat msvcrt/snprintf.o
  5109. add_cflags "-include $source_path/compat/msvcrt/snprintf.h"
  5110. fi
  5111. add_${pfx}cppflags -U__STRICT_ANSI__ -D__USE_MINGW_ANSI_STDIO=1
  5112. eval test \$${pfx_no_}cc_type = "gcc" &&
  5113. add_${pfx}cppflags -D__printf__=__gnu_printf__
  5114. test_${pfx}cpp_condition windows.h "!defined(_WIN32_WINNT) || _WIN32_WINNT < 0x0600" &&
  5115. add_${pfx}cppflags -D_WIN32_WINNT=0x0600
  5116. add_${pfx}cppflags -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600
  5117. elif test_${pfx}cpp_condition _mingw.h "defined __MINGW_VERSION" ||
  5118. test_${pfx}cpp_condition _mingw.h "defined __MINGW32_VERSION"; then
  5119. eval ${pfx}libc_type=mingw32
  5120. test_${pfx}cpp_condition _mingw.h "__MINGW32_MAJOR_VERSION > 3 || \
  5121. (__MINGW32_MAJOR_VERSION == 3 && __MINGW32_MINOR_VERSION >= 15)" ||
  5122. die "ERROR: MinGW32 runtime version must be >= 3.15."
  5123. add_${pfx}cppflags -U__STRICT_ANSI__ -D__USE_MINGW_ANSI_STDIO=1
  5124. test_${pfx}cpp_condition _mingw.h "__MSVCRT_VERSION__ < 0x0700" &&
  5125. add_${pfx}cppflags -D__MSVCRT_VERSION__=0x0700
  5126. test_${pfx}cpp_condition windows.h "!defined(_WIN32_WINNT) || _WIN32_WINNT < 0x0600" &&
  5127. add_${pfx}cppflags -D_WIN32_WINNT=0x0600
  5128. eval test \$${pfx_no_}cc_type = "gcc" &&
  5129. add_${pfx}cppflags -D__printf__=__gnu_printf__
  5130. add_${pfx}cppflags -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600
  5131. elif test_${pfx}cpp_condition crtversion.h "defined _VC_CRT_MAJOR_VERSION"; then
  5132. eval ${pfx}libc_type=msvcrt
  5133. if test_${pfx}cpp_condition crtversion.h "_VC_CRT_MAJOR_VERSION < 14"; then
  5134. if [ "$pfx" = host_ ]; then
  5135. add_host_cppflags -Dsnprintf=_snprintf
  5136. else
  5137. add_compat strtod.o strtod=avpriv_strtod
  5138. add_compat msvcrt/snprintf.o snprintf=avpriv_snprintf \
  5139. _snprintf=avpriv_snprintf \
  5140. vsnprintf=avpriv_vsnprintf
  5141. fi
  5142. fi
  5143. add_${pfx}cppflags -D_USE_MATH_DEFINES -D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_WARNINGS
  5144. # The MSVC 2010 headers (Win 7.0 SDK) set _WIN32_WINNT to
  5145. # 0x601 by default unless something else is set by the user.
  5146. # This can easily lead to us detecting functions only present
  5147. # in such new versions and producing binaries requiring windows 7.0.
  5148. # Therefore explicitly set the default to Vista unless the user has
  5149. # set something else on the command line.
  5150. # Don't do this if WINAPI_FAMILY is set and is set to a non-desktop
  5151. # family. For these cases, configure is free to use any functions
  5152. # found in the SDK headers by default. (Alternatively, we could force
  5153. # _WIN32_WINNT to 0x0602 in that case.)
  5154. test_${pfx}cpp_condition stdlib.h "defined(_WIN32_WINNT)" ||
  5155. { test_${pfx}cpp <<EOF && add_${pfx}cppflags -D_WIN32_WINNT=0x0600; }
  5156. #ifdef WINAPI_FAMILY
  5157. #include <winapifamily.h>
  5158. #if !WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
  5159. #error not desktop
  5160. #endif
  5161. #endif
  5162. EOF
  5163. if [ "$pfx" = "" ]; then
  5164. check_func strtoll || add_cflags -Dstrtoll=_strtoi64
  5165. check_func strtoull || add_cflags -Dstrtoull=_strtoui64
  5166. fi
  5167. elif test_${pfx}cpp_condition stddef.h "defined __KLIBC__"; then
  5168. eval ${pfx}libc_type=klibc
  5169. elif test_${pfx}cpp_condition sys/cdefs.h "defined __BIONIC__"; then
  5170. eval ${pfx}libc_type=bionic
  5171. elif test_${pfx}cpp_condition sys/brand.h "defined LABELED_BRAND_NAME"; then
  5172. eval ${pfx}libc_type=solaris
  5173. add_${pfx}cppflags -D__EXTENSIONS__ -D_XOPEN_SOURCE=600
  5174. elif test_${pfx}cpp_condition sys/version.h "defined __DJGPP__"; then
  5175. eval ${pfx}libc_type=djgpp
  5176. add_cppflags -U__STRICT_ANSI__
  5177. add_cflags "-include $source_path/compat/djgpp/math.h"
  5178. add_compat djgpp/math.o
  5179. fi
  5180. test_${pfx}cc <<EOF
  5181. #include <time.h>
  5182. void *v = localtime_r;
  5183. EOF
  5184. test "$?" != 0 && test_${pfx}cc -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600 <<EOF && add_${pfx}cppflags -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600
  5185. #include <time.h>
  5186. void *v = localtime_r;
  5187. EOF
  5188. eval test -n "\${${pfx}libc_type}" && enable ${pfx}libc_${libc_type}
  5189. }
  5190. probe_libc
  5191. probe_libc host_
  5192. # hacks for compiler/libc/os combinations
  5193. case $libc_type in
  5194. bionic)
  5195. add_compat strtod.o strtod=avpriv_strtod
  5196. ;;
  5197. esac
  5198. check_compile_assert flt_lim "float.h limits.h" "DBL_MAX == (double)DBL_MAX" ||
  5199. add_cppflags '-I\$(SRC_PATH)/compat/float'
  5200. test_cpp_condition stdlib.h "defined(__PIC__) || defined(__pic__) || defined(PIC)" && enable_weak pic
  5201. set_default libdir
  5202. : ${shlibdir_default:="$libdir"}
  5203. : ${pkgconfigdir_default:="$libdir/pkgconfig"}
  5204. set_default $PATHS_LIST
  5205. set_default nm
  5206. disabled optimizations || enabled ossfuzz || check_cflags -fomit-frame-pointer
  5207. enable_weak_pic() {
  5208. disabled pic && return
  5209. enable pic
  5210. add_cppflags -DPIC
  5211. case "$target_os" in
  5212. mingw*|cygwin*|win*)
  5213. ;;
  5214. *)
  5215. add_cflags -fPIC
  5216. add_asflags -fPIC
  5217. ;;
  5218. esac
  5219. }
  5220. enabled pic && enable_weak_pic
  5221. test_cc <<EOF || die "Symbol mangling check failed."
  5222. int ff_extern;
  5223. EOF
  5224. sym=$($nm $TMPO | awk '/ff_extern/{ print substr($0, match($0, /[^ \t]*ff_extern/)) }')
  5225. extern_prefix=${sym%%ff_extern*}
  5226. ! disabled inline_asm && check_inline_asm inline_asm '"" ::'
  5227. for restrict_keyword in restrict __restrict__ __restrict ""; do
  5228. test_code cc "" "char * $restrict_keyword p" && break
  5229. done
  5230. check_cc pragma_deprecated "" '_Pragma("GCC diagnostic ignored \"-Wdeprecated-declarations\"")'
  5231. # The global variable ensures the bits appear unchanged in the object file.
  5232. test_cc <<EOF || die "endian test failed"
  5233. unsigned int endian = 'B' << 24 | 'I' << 16 | 'G' << 8 | 'E';
  5234. EOF
  5235. od -t x1 $TMPO | grep -q '42 *49 *47 *45' && enable bigendian
  5236. check_cc const_nan math.h "struct { double d; } static const bar[] = { { NAN } }"
  5237. if ! enabled ppc64 || enabled bigendian; then
  5238. disable vsx
  5239. fi
  5240. check_gas() {
  5241. log "check_gas using '$as' as AS"
  5242. # :vararg is used on aarch64, arm and ppc altivec
  5243. check_as vararg "
  5244. .macro m n, y:vararg=0
  5245. \n: .int \y
  5246. .endm
  5247. m x" || return 1
  5248. # .altmacro is only used in arm asm
  5249. ! enabled arm || check_as gnu_as ".altmacro"
  5250. }
  5251. if enabled_any arm aarch64 || enabled_all ppc altivec && enabled asm; then
  5252. nogas=:
  5253. enabled_any arm aarch64 && nogas=die
  5254. enabled_all ppc altivec && [ $target_os_default != aix ] && nogas=warn
  5255. as_noop=-v
  5256. case $as_type in
  5257. arm*) gaspp_as_type=armasm; as_noop=-h ;;
  5258. gcc) gaspp_as_type=gas ;;
  5259. *) gaspp_as_type=$as_type ;;
  5260. esac
  5261. [ $target_os = "darwin" ] && gaspp_as_type="apple-$gaspp_as_type"
  5262. test "${as#*gas-preprocessor.pl}" != "$as" ||
  5263. test_cmd gas-preprocessor.pl -arch $arch -as-type $gaspp_as_type -- ${as:=$cc} $as_noop &&
  5264. gas="${gas:=gas-preprocessor.pl} -arch $arch -as-type $gaspp_as_type -- ${as:=$cc}"
  5265. if ! check_gas ; then
  5266. as=${gas:=$as}
  5267. check_gas || \
  5268. $nogas "GNU assembler not found, install/update gas-preprocessor"
  5269. fi
  5270. check_as as_func ".func test
  5271. .endfunc"
  5272. fi
  5273. check_inline_asm inline_asm_labels '"1:\n"'
  5274. check_inline_asm inline_asm_nonlocal_labels '"Label:\n"'
  5275. if enabled aarch64; then
  5276. enabled armv8 && check_insn armv8 'prfm pldl1strm, [x0]'
  5277. # internal assembler in clang 3.3 does not support this instruction
  5278. enabled neon && check_insn neon 'ext v0.8B, v0.8B, v1.8B, #1'
  5279. enabled vfp && check_insn vfp 'fmadd d0, d0, d1, d2'
  5280. map 'enabled_any ${v}_external ${v}_inline || disable $v' $ARCH_EXT_LIST_ARM
  5281. elif enabled alpha; then
  5282. check_cflags -mieee
  5283. elif enabled arm; then
  5284. enabled msvc && check_cpp_condition thumb stddef.h "defined _M_ARMT"
  5285. test_cpp_condition stddef.h "defined __thumb__" && test_cc <<EOF && enable_weak thumb
  5286. float func(float a, float b){ return a+b; }
  5287. EOF
  5288. enabled thumb && check_cflags -mthumb || check_cflags -marm
  5289. if check_cpp_condition vfp_args stddef.h "defined __ARM_PCS_VFP"; then
  5290. :
  5291. elif check_cpp_condition vfp_args stddef.h "defined _M_ARM_FP && _M_ARM_FP >= 30"; then
  5292. :
  5293. elif ! test_cpp_condition stddef.h "defined __ARM_PCS || defined __SOFTFP__" && [ $target_os != darwin ]; then
  5294. case "${cross_prefix:-$cc}" in
  5295. *hardfloat*) enable vfp_args; fpabi=vfp ;;
  5296. *) check_ld "cc" vfp_args <<EOF && fpabi=vfp || fpabi=soft ;;
  5297. __asm__ (".eabi_attribute 28, 1");
  5298. int main(void) { return 0; }
  5299. EOF
  5300. esac
  5301. warn "Compiler does not indicate floating-point ABI, guessing $fpabi."
  5302. fi
  5303. enabled armv5te && check_insn armv5te 'qadd r0, r0, r0'
  5304. enabled armv6 && check_insn armv6 'sadd16 r0, r0, r0'
  5305. enabled armv6t2 && check_insn armv6t2 'movt r0, #0'
  5306. enabled neon && check_insn neon 'vadd.i16 q0, q0, q0'
  5307. enabled vfp && check_insn vfp 'fadds s0, s0, s0'
  5308. enabled vfpv3 && check_insn vfpv3 'vmov.f32 s0, #1.0'
  5309. enabled setend && check_insn setend 'setend be'
  5310. [ $target_os = linux ] || [ $target_os = android ] ||
  5311. map 'enabled_any ${v}_external ${v}_inline || disable $v' \
  5312. $ARCH_EXT_LIST_ARM
  5313. check_inline_asm asm_mod_q '"add r0, %Q0, %R0" :: "r"((long long)0)'
  5314. check_as as_arch_directive ".arch armv7-a"
  5315. check_as as_dn_directive "ra .dn d0.i16"
  5316. check_as as_fpu_directive ".fpu neon"
  5317. # llvm's integrated assembler supports .object_arch from llvm 3.5
  5318. [ "$objformat" = elf32 ] || [ "$objformat" = elf64 ] &&
  5319. check_as as_object_arch ".object_arch armv4"
  5320. # MS armasm fails to assemble our PIC constructs
  5321. [ $target_os != win32 ] && enabled_all armv6t2 shared !pic && enable_weak_pic
  5322. elif enabled mips; then
  5323. enabled loongson2 && check_inline_asm loongson2 '"dmult.g $8, $9, $10"'
  5324. enabled loongson3 && check_inline_asm loongson3 '"gsldxc1 $f0, 0($2, $3)"'
  5325. enabled mmi && check_inline_asm mmi '"punpcklhw $f0, $f0, $f0"'
  5326. # Enable minimum ISA based on selected options
  5327. if enabled mips64; then
  5328. enabled mips64r6 && check_inline_asm_flags mips64r6 '"dlsa $0, $0, $0, 1"' '-mips64r6'
  5329. enabled mips64r2 && check_inline_asm_flags mips64r2 '"dext $0, $0, 0, 1"' '-mips64r2'
  5330. disabled mips64r6 && disabled mips64r2 && check_inline_asm_flags mips64r1 '"daddi $0, $0, 0"' '-mips64'
  5331. else
  5332. enabled mips32r6 && check_inline_asm_flags mips32r6 '"aui $0, $0, 0"' '-mips32r6'
  5333. enabled mips32r5 && check_inline_asm_flags mips32r5 '"eretnc"' '-mips32r5'
  5334. enabled mips32r2 && check_inline_asm_flags mips32r2 '"ext $0, $0, 0, 1"' '-mips32r2'
  5335. disabled mips32r6 && disabled mips32r5 && disabled mips32r2 && check_inline_asm_flags mips32r1 '"addi $0, $0, 0"' '-mips32'
  5336. fi
  5337. enabled mipsfpu && check_inline_asm_flags mipsfpu '"cvt.d.l $f0, $f2"' '-mhard-float'
  5338. enabled mipsfpu && (enabled mips32r5 || enabled mips32r6 || enabled mips64r6) && check_inline_asm_flags mipsfpu '"cvt.d.l $f0, $f1"' '-mfp64'
  5339. enabled mipsfpu && enabled msa && check_inline_asm_flags msa '"addvi.b $w0, $w1, 1"' '-mmsa' && check_headers msa.h || disable msa
  5340. enabled mipsdsp && check_inline_asm_flags mipsdsp '"addu.qb $t0, $t1, $t2"' '-mdsp'
  5341. enabled mipsdspr2 && check_inline_asm_flags mipsdspr2 '"absq_s.qb $t0, $t1"' '-mdspr2'
  5342. enabled msa && enabled msa2 && check_inline_asm_flags msa2 '"nxbits.any.b $w0, $w0"' '-mmsa2' && check_headers msa2.h || disable msa2
  5343. if enabled bigendian && enabled msa; then
  5344. disable msa
  5345. fi
  5346. elif enabled parisc; then
  5347. if enabled gcc; then
  5348. case $($cc -dumpversion) in
  5349. 4.[3-9].*) check_cflags -fno-optimize-sibling-calls ;;
  5350. esac
  5351. fi
  5352. elif enabled ppc; then
  5353. enable local_aligned
  5354. check_inline_asm dcbzl '"dcbzl 0, %0" :: "r"(0)'
  5355. check_inline_asm ibm_asm '"add 0, 0, 0"'
  5356. check_inline_asm ppc4xx '"maclhw r10, r11, r12"'
  5357. check_inline_asm xform_asm '"lwzx %1, %y0" :: "Z"(*(int*)0), "r"(0)'
  5358. if enabled altivec; then
  5359. check_cflags -maltivec -mabi=altivec
  5360. # check if our compiler supports Motorola AltiVec C API
  5361. check_cc altivec altivec.h "vector signed int v1 = (vector signed int) { 0 };
  5362. vector signed int v2 = (vector signed int) { 1 };
  5363. v1 = vec_add(v1, v2);"
  5364. enabled altivec || warn "Altivec disabled, possibly missing --cpu flag"
  5365. fi
  5366. if enabled vsx; then
  5367. check_cflags -mvsx &&
  5368. check_cc vsx altivec.h "int v[4] = { 0 };
  5369. vector signed int v1 = vec_vsx_ld(0, v);"
  5370. fi
  5371. if enabled power8; then
  5372. check_cpp_condition power8 "altivec.h" "defined(_ARCH_PWR8)"
  5373. fi
  5374. elif enabled x86; then
  5375. check_builtin rdtsc intrin.h "__rdtsc()"
  5376. check_builtin mm_empty mmintrin.h "_mm_empty()"
  5377. enable local_aligned
  5378. # check whether EBP is available on x86
  5379. # As 'i' is stored on the stack, this program will crash
  5380. # if the base pointer is used to access it because the
  5381. # base pointer is cleared in the inline assembly code.
  5382. check_exec_crash <<EOF && enable ebp_available
  5383. volatile int i=0;
  5384. __asm__ volatile ("xorl %%ebp, %%ebp" ::: "%ebp");
  5385. return i;
  5386. EOF
  5387. # check whether EBX is available on x86
  5388. check_inline_asm ebx_available '""::"b"(0)' &&
  5389. check_inline_asm ebx_available '"":::"%ebx"'
  5390. # check whether xmm clobbers are supported
  5391. check_inline_asm xmm_clobbers '"":::"%xmm0"'
  5392. check_inline_asm inline_asm_direct_symbol_refs '"movl '$extern_prefix'test, %eax"' ||
  5393. check_inline_asm inline_asm_direct_symbol_refs '"movl '$extern_prefix'test(%rip), %eax"'
  5394. # check whether binutils is new enough to compile SSSE3/MMXEXT
  5395. enabled ssse3 && check_inline_asm ssse3_inline '"pabsw %xmm0, %xmm0"'
  5396. enabled mmxext && check_inline_asm mmxext_inline '"pmaxub %mm0, %mm1"'
  5397. probe_x86asm(){
  5398. x86asmexe_probe=$1
  5399. if test_cmd $x86asmexe_probe -v; then
  5400. x86asmexe=$x86asmexe_probe
  5401. x86asm_type=nasm
  5402. x86asm_debug="-g -F dwarf"
  5403. X86ASMDEP=
  5404. X86ASM_DEPFLAGS='-MD $(@:.o=.d)'
  5405. elif test_cmd $x86asmexe_probe --version; then
  5406. x86asmexe=$x86asmexe_probe
  5407. x86asm_type=yasm
  5408. x86asm_debug="-g dwarf2"
  5409. X86ASMDEP='$(DEPX86ASM) $(X86ASMFLAGS) -M $(X86ASM_O) $< > $(@:.o=.d)'
  5410. X86ASM_DEPFLAGS=
  5411. fi
  5412. check_x86asm x86asm "movbe ecx, [5]"
  5413. }
  5414. if ! disabled_any asm mmx x86asm; then
  5415. disable x86asm
  5416. for program in $x86asmexe nasm yasm; do
  5417. probe_x86asm $program && break
  5418. done
  5419. disabled x86asm && die "nasm/yasm not found or too old. Use --disable-x86asm for a crippled build."
  5420. X86ASMFLAGS="-f $objformat"
  5421. enabled pic && append X86ASMFLAGS "-DPIC"
  5422. test -n "$extern_prefix" && append X86ASMFLAGS "-DPREFIX"
  5423. case "$objformat" in
  5424. elf*) enabled debug && append X86ASMFLAGS $x86asm_debug ;;
  5425. esac
  5426. check_x86asm avx512_external "vmovdqa32 [eax]{k1}{z}, zmm0"
  5427. check_x86asm avx2_external "vextracti128 xmm0, ymm0, 0"
  5428. check_x86asm xop_external "vpmacsdd xmm0, xmm1, xmm2, xmm3"
  5429. check_x86asm fma4_external "vfmaddps ymm0, ymm1, ymm2, ymm3"
  5430. check_x86asm cpunop "CPU amdnop"
  5431. fi
  5432. case "$cpu" in
  5433. athlon*|opteron*|k8*|pentium|pentium-mmx|prescott|nocona|atom|geode)
  5434. disable fast_clz
  5435. ;;
  5436. esac
  5437. fi
  5438. check_cc intrinsics_neon arm_neon.h "int16x8_t test = vdupq_n_s16(0)"
  5439. check_ldflags -Wl,--as-needed
  5440. check_ldflags -Wl,-z,noexecstack
  5441. if ! disabled network; then
  5442. check_func getaddrinfo $network_extralibs
  5443. check_func inet_aton $network_extralibs
  5444. check_type netdb.h "struct addrinfo"
  5445. check_type netinet/in.h "struct group_source_req" -D_BSD_SOURCE
  5446. check_type netinet/in.h "struct ip_mreq_source" -D_BSD_SOURCE
  5447. check_type netinet/in.h "struct ipv6_mreq" -D_DARWIN_C_SOURCE
  5448. check_type poll.h "struct pollfd"
  5449. check_type netinet/sctp.h "struct sctp_event_subscribe"
  5450. check_struct "sys/socket.h" "struct msghdr" msg_flags
  5451. check_struct "sys/types.h sys/socket.h" "struct sockaddr" sa_len
  5452. check_type netinet/in.h "struct sockaddr_in6"
  5453. check_type "sys/types.h sys/socket.h" "struct sockaddr_storage"
  5454. check_type "sys/types.h sys/socket.h" socklen_t
  5455. # Prefer arpa/inet.h over winsock2
  5456. if check_headers arpa/inet.h ; then
  5457. check_func closesocket
  5458. elif check_headers winsock2.h ; then
  5459. check_func_headers winsock2.h closesocket -lws2 &&
  5460. network_extralibs="-lws2" ||
  5461. { check_func_headers winsock2.h closesocket -lws2_32 &&
  5462. network_extralibs="-lws2_32"; } || disable winsock2_h network
  5463. check_func_headers ws2tcpip.h getaddrinfo $network_extralibs
  5464. check_type ws2tcpip.h socklen_t
  5465. check_type ws2tcpip.h "struct addrinfo"
  5466. check_type ws2tcpip.h "struct group_source_req"
  5467. check_type ws2tcpip.h "struct ip_mreq_source"
  5468. check_type ws2tcpip.h "struct ipv6_mreq"
  5469. check_type winsock2.h "struct pollfd"
  5470. check_struct winsock2.h "struct sockaddr" sa_len
  5471. check_type ws2tcpip.h "struct sockaddr_in6"
  5472. check_type ws2tcpip.h "struct sockaddr_storage"
  5473. else
  5474. disable network
  5475. fi
  5476. fi
  5477. check_builtin atomic_cas_ptr atomic.h "void **ptr; void *oldval, *newval; atomic_cas_ptr(ptr, oldval, newval)"
  5478. check_builtin machine_rw_barrier mbarrier.h "__machine_rw_barrier()"
  5479. check_builtin MemoryBarrier windows.h "MemoryBarrier()"
  5480. check_builtin sync_val_compare_and_swap "" "int *ptr; int oldval, newval; __sync_val_compare_and_swap(ptr, oldval, newval)"
  5481. check_builtin gmtime_r time.h "time_t *time; struct tm *tm; gmtime_r(time, tm)"
  5482. check_builtin localtime_r time.h "time_t *time; struct tm *tm; localtime_r(time, tm)"
  5483. check_builtin x264_csp_bgr "stdint.h x264.h" "X264_CSP_BGR"
  5484. case "$custom_allocator" in
  5485. jemalloc)
  5486. # jemalloc by default does not use a prefix
  5487. require libjemalloc jemalloc/jemalloc.h malloc -ljemalloc
  5488. ;;
  5489. tcmalloc)
  5490. require_pkg_config libtcmalloc libtcmalloc gperftools/tcmalloc.h tc_malloc
  5491. malloc_prefix=tc_
  5492. ;;
  5493. esac
  5494. check_func_headers malloc.h _aligned_malloc && enable aligned_malloc
  5495. check_func ${malloc_prefix}memalign && enable memalign
  5496. check_func ${malloc_prefix}posix_memalign && enable posix_memalign
  5497. check_func access
  5498. check_func_headers stdlib.h arc4random
  5499. check_lib clock_gettime time.h clock_gettime || check_lib clock_gettime time.h clock_gettime -lrt
  5500. check_func fcntl
  5501. check_func fork
  5502. check_func gethrtime
  5503. check_func getopt
  5504. check_func getrusage
  5505. check_func gettimeofday
  5506. check_func isatty
  5507. check_func mkstemp
  5508. check_func mmap
  5509. check_func mprotect
  5510. # Solaris has nanosleep in -lrt, OpenSolaris no longer needs that
  5511. check_func_headers time.h nanosleep || check_lib nanosleep time.h nanosleep -lrt
  5512. check_func sched_getaffinity
  5513. check_func setrlimit
  5514. check_struct "sys/stat.h" "struct stat" st_mtim.tv_nsec -D_BSD_SOURCE
  5515. check_func strerror_r
  5516. check_func sysconf
  5517. check_func sysctl
  5518. check_func usleep
  5519. check_func_headers conio.h kbhit
  5520. check_func_headers io.h setmode
  5521. check_func_headers lzo/lzo1x.h lzo1x_999_compress
  5522. check_func_headers mach/mach_time.h mach_absolute_time
  5523. check_func_headers stdlib.h getenv
  5524. check_func_headers sys/stat.h lstat
  5525. check_func_headers windows.h GetProcessAffinityMask
  5526. check_func_headers windows.h GetProcessTimes
  5527. check_func_headers windows.h GetSystemTimeAsFileTime
  5528. check_func_headers windows.h LoadLibrary
  5529. check_func_headers windows.h MapViewOfFile
  5530. check_func_headers windows.h PeekNamedPipe
  5531. check_func_headers windows.h SetConsoleTextAttribute
  5532. check_func_headers windows.h SetConsoleCtrlHandler
  5533. check_func_headers windows.h Sleep
  5534. check_func_headers windows.h VirtualAlloc
  5535. check_func_headers glob.h glob
  5536. enabled xlib &&
  5537. check_lib xlib "X11/Xlib.h X11/extensions/Xvlib.h" XvGetPortAttribute -lXv -lX11 -lXext
  5538. check_headers direct.h
  5539. check_headers dirent.h
  5540. check_headers dxgidebug.h
  5541. check_headers dxva.h
  5542. check_headers dxva2api.h -D_WIN32_WINNT=0x0600
  5543. check_headers io.h
  5544. check_headers linux/perf_event.h
  5545. check_headers libcrystalhd/libcrystalhd_if.h
  5546. check_headers malloc.h
  5547. check_headers net/udplite.h
  5548. check_headers poll.h
  5549. check_headers sys/param.h
  5550. check_headers sys/resource.h
  5551. check_headers sys/select.h
  5552. check_headers sys/time.h
  5553. check_headers sys/un.h
  5554. check_headers termios.h
  5555. check_headers unistd.h
  5556. check_headers valgrind/valgrind.h
  5557. check_func_headers VideoToolbox/VTCompressionSession.h VTCompressionSessionPrepareToEncodeFrames -framework VideoToolbox
  5558. check_headers windows.h
  5559. check_headers X11/extensions/XvMClib.h
  5560. check_headers asm/types.h
  5561. # it seems there are versions of clang in some distros that try to use the
  5562. # gcc headers, which explodes for stdatomic
  5563. # so we also check that atomics actually work here
  5564. check_builtin stdatomic stdatomic.h "atomic_int foo, bar = ATOMIC_VAR_INIT(-1); atomic_store(&foo, 0); foo += bar"
  5565. check_lib advapi32 "windows.h" RegCloseKey -ladvapi32
  5566. check_lib bcrypt "windows.h bcrypt.h" BCryptGenRandom -lbcrypt &&
  5567. check_cpp_condition bcrypt bcrypt.h "defined BCRYPT_RNG_ALGORITHM"
  5568. check_lib ole32 "windows.h" CoTaskMemFree -lole32
  5569. check_lib shell32 "windows.h shellapi.h" CommandLineToArgvW -lshell32
  5570. check_lib psapi "windows.h psapi.h" GetProcessMemoryInfo -lpsapi
  5571. check_lib android android/native_window.h ANativeWindow_acquire -landroid
  5572. check_lib mediandk "stdint.h media/NdkImage.h" AImage_delete -lmediandk
  5573. check_lib camera2ndk "stdbool.h stdint.h camera/NdkCameraManager.h" ACameraManager_create -lcamera2ndk
  5574. enabled appkit && check_apple_framework AppKit
  5575. enabled audiotoolbox && check_apple_framework AudioToolbox
  5576. enabled avfoundation && check_apple_framework AVFoundation
  5577. enabled coreimage && check_apple_framework CoreImage
  5578. enabled videotoolbox && check_apple_framework VideoToolbox
  5579. check_apple_framework CoreFoundation
  5580. check_apple_framework CoreMedia
  5581. check_apple_framework CoreVideo
  5582. enabled avfoundation && {
  5583. disable coregraphics applicationservices
  5584. check_lib coregraphics CoreGraphics/CoreGraphics.h CGGetActiveDisplayList "-framework CoreGraphics" ||
  5585. check_lib applicationservices ApplicationServices/ApplicationServices.h CGGetActiveDisplayList "-framework ApplicationServices"; }
  5586. enabled videotoolbox && {
  5587. check_lib coreservices CoreServices/CoreServices.h UTGetOSTypeFromString "-framework CoreServices"
  5588. check_func_headers CoreMedia/CMFormatDescription.h kCMVideoCodecType_HEVC "-framework CoreMedia"
  5589. check_func_headers CoreVideo/CVPixelBuffer.h kCVPixelFormatType_420YpCbCr10BiPlanarVideoRange "-framework CoreVideo"
  5590. check_func_headers CoreVideo/CVImageBuffer.h kCVImageBufferTransferFunction_SMPTE_ST_2084_PQ "-framework CoreVideo"
  5591. check_func_headers CoreVideo/CVImageBuffer.h kCVImageBufferTransferFunction_ITU_R_2100_HLG "-framework CoreVideo"
  5592. check_func_headers CoreVideo/CVImageBuffer.h kCVImageBufferTransferFunction_Linear "-framework CoreVideo"
  5593. }
  5594. check_struct "sys/time.h sys/resource.h" "struct rusage" ru_maxrss
  5595. check_type "windows.h dxva.h" "DXVA_PicParams_HEVC" -DWINAPI_FAMILY=WINAPI_FAMILY_DESKTOP_APP -D_CRT_BUILD_DESKTOP_APP=0
  5596. check_type "windows.h dxva.h" "DXVA_PicParams_VP9" -DWINAPI_FAMILY=WINAPI_FAMILY_DESKTOP_APP -D_CRT_BUILD_DESKTOP_APP=0
  5597. check_type "windows.h d3d11.h" "ID3D11VideoDecoder"
  5598. check_type "windows.h d3d11.h" "ID3D11VideoContext"
  5599. check_type "d3d9.h dxva2api.h" DXVA2_ConfigPictureDecode -D_WIN32_WINNT=0x0602
  5600. check_type "vdpau/vdpau.h" "VdpPictureInfoHEVC"
  5601. check_type "vdpau/vdpau.h" "VdpPictureInfoVP9"
  5602. if [ -z "$nvccflags" ]; then
  5603. nvccflags=$nvccflags_default
  5604. fi
  5605. if enabled x86_64 || enabled ppc64 || enabled aarch64; then
  5606. nvccflags="$nvccflags -m64"
  5607. else
  5608. nvccflags="$nvccflags -m32"
  5609. fi
  5610. if enabled cuda_nvcc; then
  5611. nvccflags="$nvccflags -ptx"
  5612. else
  5613. nvccflags="$nvccflags -S -nocudalib -nocudainc --cuda-device-only -include ${source_link}/compat/cuda/cuda_runtime.h"
  5614. check_nvcc cuda_llvm
  5615. fi
  5616. if ! disabled ffnvcodec; then
  5617. ffnv_hdr_list="ffnvcodec/nvEncodeAPI.h ffnvcodec/dynlink_cuda.h ffnvcodec/dynlink_cuviddec.h ffnvcodec/dynlink_nvcuvid.h"
  5618. check_pkg_config ffnvcodec "ffnvcodec >= 9.0.18.0" "$ffnv_hdr_list" "" || \
  5619. check_pkg_config ffnvcodec "ffnvcodec >= 8.2.15.8 ffnvcodec < 8.3" "$ffnv_hdr_list" "" || \
  5620. check_pkg_config ffnvcodec "ffnvcodec >= 8.1.24.9 ffnvcodec < 8.2" "$ffnv_hdr_list" "" || \
  5621. check_pkg_config ffnvcodec "ffnvcodec >= 8.0.14.9 ffnvcodec < 8.1" "$ffnv_hdr_list" ""
  5622. fi
  5623. check_cpp_condition winrt windows.h "!WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)"
  5624. if ! disabled w32threads && ! enabled pthreads; then
  5625. check_func_headers "windows.h process.h" _beginthreadex &&
  5626. check_type "windows.h" CONDITION_VARIABLE &&
  5627. check_type "windows.h" INIT_ONCE &&
  5628. enable w32threads || disable w32threads
  5629. if ! enabled w32threads && enabled winrt; then
  5630. check_func_headers "windows.h" CreateThread &&
  5631. enable w32threads || disable w32threads
  5632. fi
  5633. fi
  5634. # check for some common methods of building with pthread support
  5635. # do this before the optional library checks as some of them require pthreads
  5636. if ! disabled pthreads && ! enabled w32threads && ! enabled os2threads; then
  5637. if check_lib pthreads pthread.h pthread_join -pthread &&
  5638. check_lib pthreads pthread.h pthread_create -pthread; then
  5639. add_cflags -pthread
  5640. elif check_lib pthreads pthread.h pthread_join -pthreads &&
  5641. check_lib pthreads pthread.h pthread_create -pthreads; then
  5642. add_cflags -pthreads
  5643. elif check_lib pthreads pthread.h pthread_join -ldl -pthread &&
  5644. check_lib pthreads pthread.h pthread_create -ldl -pthread; then
  5645. add_cflags -ldl -pthread
  5646. elif check_lib pthreads pthread.h pthread_join -lpthreadGC2 &&
  5647. check_lib pthreads pthread.h pthread_create -lpthreadGC2; then
  5648. :
  5649. elif check_lib pthreads pthread.h pthread_join -lpthread &&
  5650. check_lib pthreads pthread.h pthread_create -lpthread; then
  5651. :
  5652. elif check_func pthread_join && check_func pthread_create; then
  5653. enable pthreads
  5654. fi
  5655. check_cc pthreads "pthread.h" "static pthread_mutex_t atomic_lock = PTHREAD_MUTEX_INITIALIZER"
  5656. if enabled pthreads; then
  5657. check_builtin sem_timedwait semaphore.h "sem_t *s; sem_init(s,0,0); sem_timedwait(s,0); sem_destroy(s)" $pthreads_extralibs
  5658. check_func pthread_cancel $pthreads_extralibs
  5659. fi
  5660. fi
  5661. enabled zlib && { check_pkg_config zlib zlib "zlib.h" zlibVersion ||
  5662. check_lib zlib zlib.h zlibVersion -lz; }
  5663. enabled bzlib && check_lib bzlib bzlib.h BZ2_bzlibVersion -lbz2
  5664. enabled lzma && check_lib lzma lzma.h lzma_version_number -llzma
  5665. # On some systems dynamic loading requires no extra linker flags
  5666. check_lib libdl dlfcn.h "dlopen dlsym" || check_lib libdl dlfcn.h "dlopen dlsym" -ldl
  5667. check_lib libm math.h sin -lm
  5668. atan2f_args=2
  5669. copysign_args=2
  5670. hypot_args=2
  5671. ldexpf_args=2
  5672. powf_args=2
  5673. for func in $MATH_FUNCS; do
  5674. eval check_mathfunc $func \${${func}_args:-1} $libm_extralibs
  5675. done
  5676. for func in $COMPLEX_FUNCS; do
  5677. eval check_complexfunc $func \${${func}_args:-1}
  5678. done
  5679. # these are off by default, so fail if requested and not available
  5680. enabled cuda_nvcc && { check_nvcc cuda_nvcc || die "ERROR: failed checking for nvcc."; }
  5681. enabled chromaprint && require chromaprint chromaprint.h chromaprint_get_version -lchromaprint
  5682. enabled decklink && { require_headers DeckLinkAPI.h &&
  5683. { test_cpp_condition DeckLinkAPIVersion.h "BLACKMAGIC_DECKLINK_API_VERSION >= 0x0a090500" || die "ERROR: Decklink API version must be >= 10.9.5."; } }
  5684. enabled frei0r && require_headers "frei0r.h dlfcn.h"
  5685. enabled gmp && require gmp gmp.h mpz_export -lgmp
  5686. enabled gnutls && require_pkg_config gnutls gnutls gnutls/gnutls.h gnutls_global_init
  5687. enabled jni && { [ $target_os = "android" ] && check_headers jni.h && enabled pthreads || die "ERROR: jni not found"; }
  5688. enabled ladspa && require_headers "ladspa.h dlfcn.h"
  5689. enabled libaom && require_pkg_config libaom "aom >= 1.0.0" aom/aom_codec.h aom_codec_version
  5690. enabled libaribb24 && { check_pkg_config libaribb24 "aribb24 > 1.0.3" "aribb24/aribb24.h" arib_instance_new ||
  5691. { enabled gpl && require_pkg_config libaribb24 aribb24 "aribb24/aribb24.h" arib_instance_new; } ||
  5692. die "ERROR: libaribb24 requires version higher than 1.0.3 or --enable-gpl."; }
  5693. enabled lv2 && require_pkg_config lv2 lilv-0 "lilv/lilv.h" lilv_world_new
  5694. enabled libiec61883 && require libiec61883 libiec61883/iec61883.h iec61883_cmp_connect -lraw1394 -lavc1394 -lrom1394 -liec61883
  5695. enabled libass && require_pkg_config libass libass ass/ass.h ass_library_init
  5696. enabled libbluray && require_pkg_config libbluray libbluray libbluray/bluray.h bd_open
  5697. enabled libbs2b && require_pkg_config libbs2b libbs2b bs2b.h bs2b_open
  5698. enabled libcelt && require libcelt celt/celt.h celt_decode -lcelt0 &&
  5699. { check_lib libcelt celt/celt.h celt_decoder_create_custom -lcelt0 ||
  5700. die "ERROR: libcelt must be installed and version must be >= 0.11.0."; }
  5701. enabled libcaca && require_pkg_config libcaca caca caca.h caca_create_canvas
  5702. enabled libcodec2 && require libcodec2 codec2/codec2.h codec2_create -lcodec2
  5703. enabled libdav1d && require_pkg_config libdav1d "dav1d >= 0.4.0" "dav1d/dav1d.h" dav1d_version
  5704. enabled libdavs2 && require_pkg_config libdavs2 "davs2 >= 1.6.0" davs2.h davs2_decoder_open
  5705. enabled libdc1394 && require_pkg_config libdc1394 libdc1394-2 dc1394/dc1394.h dc1394_new
  5706. enabled libdrm && require_pkg_config libdrm libdrm xf86drm.h drmGetVersion
  5707. enabled libfdk_aac && { check_pkg_config libfdk_aac fdk-aac "fdk-aac/aacenc_lib.h" aacEncOpen ||
  5708. { require libfdk_aac fdk-aac/aacenc_lib.h aacEncOpen -lfdk-aac &&
  5709. warn "using libfdk without pkg-config"; } }
  5710. flite_extralibs="-lflite_cmu_time_awb -lflite_cmu_us_awb -lflite_cmu_us_kal -lflite_cmu_us_kal16 -lflite_cmu_us_rms -lflite_cmu_us_slt -lflite_usenglish -lflite_cmulex -lflite"
  5711. enabled libflite && require libflite "flite/flite.h" flite_init $flite_extralibs
  5712. enabled fontconfig && enable libfontconfig
  5713. enabled libfontconfig && require_pkg_config libfontconfig fontconfig "fontconfig/fontconfig.h" FcInit
  5714. enabled libfreetype && require_pkg_config libfreetype freetype2 "ft2build.h FT_FREETYPE_H" FT_Init_FreeType
  5715. enabled libfribidi && require_pkg_config libfribidi fribidi fribidi.h fribidi_version_info
  5716. enabled libgme && { check_pkg_config libgme libgme gme/gme.h gme_new_emu ||
  5717. require libgme gme/gme.h gme_new_emu -lgme -lstdc++; }
  5718. enabled libgsm && { for gsm_hdr in "gsm.h" "gsm/gsm.h"; do
  5719. check_lib libgsm "${gsm_hdr}" gsm_create -lgsm && break;
  5720. done || die "ERROR: libgsm not found"; }
  5721. enabled libilbc && require libilbc ilbc.h WebRtcIlbcfix_InitDecode -lilbc $pthreads_extralibs
  5722. enabled libklvanc && require libklvanc libklvanc/vanc.h klvanc_context_create -lklvanc
  5723. enabled libkvazaar && require_pkg_config libkvazaar "kvazaar >= 0.8.1" kvazaar.h kvz_api_get
  5724. enabled liblensfun && require_pkg_config liblensfun lensfun lensfun.h lf_db_new
  5725. # While it may appear that require is being used as a pkg-config
  5726. # fallback for libmfx, it is actually being used to detect a different
  5727. # installation route altogether. If libmfx is installed via the Intel
  5728. # Media SDK or Intel Media Server Studio, these don't come with
  5729. # pkg-config support. Instead, users should make sure that the build
  5730. # can find the libraries and headers through other means.
  5731. enabled libmfx && { check_pkg_config libmfx libmfx "mfx/mfxvideo.h" MFXInit ||
  5732. { require libmfx "mfx/mfxvideo.h" MFXInit "-llibmfx $advapi32_extralibs" && warn "using libmfx without pkg-config"; } }
  5733. if enabled libmfx; then
  5734. check_cc MFX_CODEC_VP9 "mfx/mfxvp9.h mfx/mfxstructures.h" "MFX_CODEC_VP9"
  5735. fi
  5736. enabled libmodplug && require_pkg_config libmodplug libmodplug libmodplug/modplug.h ModPlug_Load
  5737. enabled libmp3lame && require "libmp3lame >= 3.98.3" lame/lame.h lame_set_VBR_quality -lmp3lame $libm_extralibs
  5738. enabled libmysofa && { check_pkg_config libmysofa libmysofa mysofa.h mysofa_neighborhood_init_withstepdefine ||
  5739. require libmysofa mysofa.h mysofa_neighborhood_init_withstepdefine -lmysofa $zlib_extralibs; }
  5740. enabled libnpp && { check_lib libnpp npp.h nppGetLibVersion -lnppig -lnppicc -lnppc -lnppidei ||
  5741. check_lib libnpp npp.h nppGetLibVersion -lnppi -lnppc -lnppidei ||
  5742. die "ERROR: libnpp not found"; }
  5743. enabled libopencore_amrnb && require libopencore_amrnb opencore-amrnb/interf_dec.h Decoder_Interface_init -lopencore-amrnb
  5744. enabled libopencore_amrwb && require libopencore_amrwb opencore-amrwb/dec_if.h D_IF_init -lopencore-amrwb
  5745. enabled libopencv && { check_headers opencv2/core/core_c.h &&
  5746. { check_pkg_config libopencv opencv opencv2/core/core_c.h cvCreateImageHeader ||
  5747. require libopencv opencv2/core/core_c.h cvCreateImageHeader -lopencv_core -lopencv_imgproc; } ||
  5748. require_pkg_config libopencv opencv opencv/cxcore.h cvCreateImageHeader; }
  5749. enabled libopenh264 && require_pkg_config libopenh264 openh264 wels/codec_api.h WelsGetCodecVersion
  5750. enabled libopenjpeg && { check_pkg_config libopenjpeg "libopenjp2 >= 2.1.0" openjpeg.h opj_version ||
  5751. { require_pkg_config libopenjpeg "libopenjp2 >= 2.1.0" openjpeg.h opj_version -DOPJ_STATIC && add_cppflags -DOPJ_STATIC; } }
  5752. enabled libopenmpt && require_pkg_config libopenmpt "libopenmpt >= 0.2.6557" libopenmpt/libopenmpt.h openmpt_module_create -lstdc++ && append libopenmpt_extralibs "-lstdc++"
  5753. enabled libopus && {
  5754. enabled libopus_decoder && {
  5755. require_pkg_config libopus opus opus_multistream.h opus_multistream_decoder_create
  5756. }
  5757. enabled libopus_encoder && {
  5758. require_pkg_config libopus opus opus_multistream.h opus_multistream_surround_encoder_create
  5759. }
  5760. }
  5761. enabled libpulse && require_pkg_config libpulse libpulse pulse/pulseaudio.h pa_context_new
  5762. enabled librsvg && require_pkg_config librsvg librsvg-2.0 librsvg-2.0/librsvg/rsvg.h rsvg_handle_render_cairo
  5763. enabled librtmp && require_pkg_config librtmp librtmp librtmp/rtmp.h RTMP_Socket
  5764. enabled librubberband && require_pkg_config librubberband "rubberband >= 1.8.1" rubberband/rubberband-c.h rubberband_new -lstdc++ && append librubberband_extralibs "-lstdc++"
  5765. enabled libshine && require_pkg_config libshine shine shine/layer3.h shine_encode_buffer
  5766. enabled libsmbclient && { check_pkg_config libsmbclient smbclient libsmbclient.h smbc_init ||
  5767. require libsmbclient libsmbclient.h smbc_init -lsmbclient; }
  5768. enabled libsnappy && require libsnappy snappy-c.h snappy_compress -lsnappy -lstdc++
  5769. enabled libsoxr && require libsoxr soxr.h soxr_create -lsoxr
  5770. enabled libssh && require_pkg_config libssh libssh libssh/sftp.h sftp_init
  5771. enabled libspeex && require_pkg_config libspeex speex speex/speex.h speex_decoder_init
  5772. enabled libsrt && require_pkg_config libsrt "srt >= 1.3.0" srt/srt.h srt_socket
  5773. enabled libtensorflow && require libtensorflow tensorflow/c/c_api.h TF_Version -ltensorflow
  5774. enabled libtesseract && require_pkg_config libtesseract tesseract tesseract/capi.h TessBaseAPICreate
  5775. enabled libtheora && require libtheora theora/theoraenc.h th_info_init -ltheoraenc -ltheoradec -logg
  5776. enabled libtls && require_pkg_config libtls libtls tls.h tls_configure
  5777. enabled libtwolame && require libtwolame twolame.h twolame_init -ltwolame &&
  5778. { check_lib libtwolame twolame.h twolame_encode_buffer_float32_interleaved -ltwolame ||
  5779. die "ERROR: libtwolame must be installed and version must be >= 0.3.10"; }
  5780. enabled libv4l2 && require_pkg_config libv4l2 libv4l2 libv4l2.h v4l2_ioctl
  5781. enabled libvidstab && require_pkg_config libvidstab "vidstab >= 0.98" vid.stab/libvidstab.h vsMotionDetectInit
  5782. enabled libvmaf && require_pkg_config libvmaf "libvmaf >= 1.3.9" libvmaf.h compute_vmaf
  5783. enabled libvo_amrwbenc && require libvo_amrwbenc vo-amrwbenc/enc_if.h E_IF_init -lvo-amrwbenc
  5784. enabled libvorbis && require_pkg_config libvorbis vorbis vorbis/codec.h vorbis_info_init &&
  5785. require_pkg_config libvorbisenc vorbisenc vorbis/vorbisenc.h vorbis_encode_init
  5786. enabled libvpx && {
  5787. enabled libvpx_vp8_decoder && {
  5788. check_pkg_config libvpx_vp8_decoder "vpx >= 1.4.0" "vpx/vpx_decoder.h vpx/vp8dx.h" vpx_codec_vp8_dx ||
  5789. check_lib libvpx_vp8_decoder "vpx/vpx_decoder.h vpx/vp8dx.h" "vpx_codec_vp8_dx VPX_IMG_FMT_HIGHBITDEPTH" "-lvpx $libm_extralibs $pthreads_extralibs"
  5790. }
  5791. enabled libvpx_vp8_encoder && {
  5792. check_pkg_config libvpx_vp8_encoder "vpx >= 1.4.0" "vpx/vpx_encoder.h vpx/vp8cx.h" vpx_codec_vp8_cx ||
  5793. check_lib libvpx_vp8_encoder "vpx/vpx_encoder.h vpx/vp8cx.h" "vpx_codec_vp8_cx VPX_IMG_FMT_HIGHBITDEPTH" "-lvpx $libm_extralibs $pthreads_extralibs"
  5794. }
  5795. enabled libvpx_vp9_decoder && {
  5796. check_pkg_config libvpx_vp9_decoder "vpx >= 1.4.0" "vpx/vpx_decoder.h vpx/vp8dx.h" vpx_codec_vp9_dx ||
  5797. check_lib libvpx_vp9_decoder "vpx/vpx_decoder.h vpx/vp8dx.h" "vpx_codec_vp9_dx VPX_IMG_FMT_HIGHBITDEPTH" "-lvpx $libm_extralibs $pthreads_extralibs"
  5798. }
  5799. enabled libvpx_vp9_encoder && {
  5800. check_pkg_config libvpx_vp9_encoder "vpx >= 1.4.0" "vpx/vpx_encoder.h vpx/vp8cx.h" vpx_codec_vp9_cx ||
  5801. check_lib libvpx_vp9_encoder "vpx/vpx_encoder.h vpx/vp8cx.h" "vpx_codec_vp9_cx VPX_IMG_FMT_HIGHBITDEPTH" "-lvpx $libm_extralibs $pthreads_extralibs"
  5802. }
  5803. if disabled_all libvpx_vp8_decoder libvpx_vp9_decoder libvpx_vp8_encoder libvpx_vp9_encoder; then
  5804. die "libvpx enabled but no supported decoders found"
  5805. fi
  5806. }
  5807. enabled libwavpack && require libwavpack wavpack/wavpack.h WavpackOpenFileOutput -lwavpack
  5808. enabled libwebp && {
  5809. enabled libwebp_encoder && require_pkg_config libwebp "libwebp >= 0.2.0" webp/encode.h WebPGetEncoderVersion
  5810. enabled libwebp_anim_encoder && check_pkg_config libwebp_anim_encoder "libwebpmux >= 0.4.0" webp/mux.h WebPAnimEncoderOptionsInit; }
  5811. enabled libx264 && { check_pkg_config libx264 x264 "stdint.h x264.h" x264_encoder_encode ||
  5812. { require libx264 "stdint.h x264.h" x264_encoder_encode "-lx264 $pthreads_extralibs $libm_extralibs" &&
  5813. warn "using libx264 without pkg-config"; } } &&
  5814. require_cpp_condition libx264 x264.h "X264_BUILD >= 118" &&
  5815. check_cpp_condition libx262 x264.h "X264_MPEG2"
  5816. enabled libx265 && require_pkg_config libx265 x265 x265.h x265_api_get &&
  5817. require_cpp_condition libx265 x265.h "X265_BUILD >= 68"
  5818. enabled libxavs && require libxavs "stdint.h xavs.h" xavs_encoder_encode "-lxavs $pthreads_extralibs $libm_extralibs"
  5819. enabled libxavs2 && require_pkg_config libxavs2 "xavs2 >= 1.3.0" "stdint.h xavs2.h" xavs2_api_get
  5820. enabled libxvid && require libxvid xvid.h xvid_global -lxvidcore
  5821. enabled libzimg && require_pkg_config libzimg "zimg >= 2.7.0" zimg.h zimg_get_api_version
  5822. enabled libzmq && require_pkg_config libzmq "libzmq >= 4.2.1" zmq.h zmq_ctx_new
  5823. enabled libzvbi && require_pkg_config libzvbi zvbi-0.2 libzvbi.h vbi_decoder_new &&
  5824. { test_cpp_condition libzvbi.h "VBI_VERSION_MAJOR > 0 || VBI_VERSION_MINOR > 2 || VBI_VERSION_MINOR == 2 && VBI_VERSION_MICRO >= 28" ||
  5825. enabled gpl || die "ERROR: libzvbi requires version 0.2.28 or --enable-gpl."; }
  5826. enabled libxml2 && require_pkg_config libxml2 libxml-2.0 libxml2/libxml/xmlversion.h xmlCheckVersion
  5827. enabled mbedtls && { check_pkg_config mbedtls mbedtls mbedtls/x509_crt.h mbedtls_x509_crt_init ||
  5828. check_pkg_config mbedtls mbedtls mbedtls/ssl.h mbedtls_ssl_init ||
  5829. check_lib mbedtls mbedtls/ssl.h mbedtls_ssl_init -lmbedtls -lmbedx509 -lmbedcrypto ||
  5830. die "ERROR: mbedTLS not found"; }
  5831. enabled mediacodec && { enabled jni || die "ERROR: mediacodec requires --enable-jni"; }
  5832. enabled mmal && { check_lib mmal interface/mmal/mmal.h mmal_port_connect -lmmal_core -lmmal_util -lmmal_vc_client -lbcm_host ||
  5833. { ! enabled cross_compile &&
  5834. add_cflags -isystem/opt/vc/include/ -isystem/opt/vc/include/interface/vmcs_host/linux -isystem/opt/vc/include/interface/vcos/pthreads -fgnu89-inline &&
  5835. add_ldflags -L/opt/vc/lib/ &&
  5836. check_lib mmal interface/mmal/mmal.h mmal_port_connect -lmmal_core -lmmal_util -lmmal_vc_client -lbcm_host; } ||
  5837. die "ERROR: mmal not found" &&
  5838. check_func_headers interface/mmal/mmal.h "MMAL_PARAMETER_VIDEO_MAX_NUM_CALLBACKS"; }
  5839. enabled openal && { { for al_extralibs in "${OPENAL_LIBS}" "-lopenal" "-lOpenAL32"; do
  5840. check_lib openal 'AL/al.h' alGetError "${al_extralibs}" && break; done } ||
  5841. die "ERROR: openal not found"; } &&
  5842. { test_cpp_condition "AL/al.h" "defined(AL_VERSION_1_1)" ||
  5843. die "ERROR: openal must be installed and version must be 1.1 or compatible"; }
  5844. enabled opencl && { check_pkg_config opencl OpenCL CL/cl.h clEnqueueNDRangeKernel ||
  5845. check_lib opencl OpenCL/cl.h clEnqueueNDRangeKernel -Wl,-framework,OpenCL ||
  5846. check_lib opencl CL/cl.h clEnqueueNDRangeKernel -lOpenCL ||
  5847. die "ERROR: opencl not found"; } &&
  5848. { test_cpp_condition "OpenCL/cl.h" "defined(CL_VERSION_1_2)" ||
  5849. test_cpp_condition "CL/cl.h" "defined(CL_VERSION_1_2)" ||
  5850. die "ERROR: opencl must be installed and version must be 1.2 or compatible"; }
  5851. enabled opengl && { check_lib opengl GL/glx.h glXGetProcAddress "-lGL" ||
  5852. check_lib opengl windows.h wglGetProcAddress "-lopengl32 -lgdi32" ||
  5853. check_lib opengl OpenGL/gl3.h glGetError "-Wl,-framework,OpenGL" ||
  5854. check_lib opengl ES2/gl.h glGetError "-isysroot=${sysroot} -Wl,-framework,OpenGLES" ||
  5855. die "ERROR: opengl not found."
  5856. }
  5857. enabled omx_rpi && { test_code cc OMX_Core.h OMX_IndexConfigBrcmVideoRequestIFrame ||
  5858. { ! enabled cross_compile &&
  5859. add_cflags -isystem/opt/vc/include/IL &&
  5860. test_code cc OMX_Core.h OMX_IndexConfigBrcmVideoRequestIFrame; } ||
  5861. die "ERROR: OpenMAX IL headers from raspberrypi/firmware not found"; } &&
  5862. enable omx
  5863. enabled omx && require_headers OMX_Core.h
  5864. enabled openssl && { check_pkg_config openssl openssl openssl/ssl.h OPENSSL_init_ssl ||
  5865. check_pkg_config openssl openssl openssl/ssl.h SSL_library_init ||
  5866. check_lib openssl openssl/ssl.h SSL_library_init -lssl -lcrypto ||
  5867. check_lib openssl openssl/ssl.h SSL_library_init -lssl32 -leay32 ||
  5868. check_lib openssl openssl/ssl.h SSL_library_init -lssl -lcrypto -lws2_32 -lgdi32 ||
  5869. die "ERROR: openssl not found"; }
  5870. enabled pocketsphinx && require_pkg_config pocketsphinx pocketsphinx pocketsphinx/pocketsphinx.h ps_init
  5871. enabled rkmpp && { require_pkg_config rkmpp rockchip_mpp rockchip/rk_mpi.h mpp_create &&
  5872. require_pkg_config rockchip_mpp "rockchip_mpp >= 1.3.7" rockchip/rk_mpi.h mpp_create &&
  5873. { enabled libdrm ||
  5874. die "ERROR: rkmpp requires --enable-libdrm"; }
  5875. }
  5876. enabled vapoursynth && require_pkg_config vapoursynth "vapoursynth-script >= 42" VSScript.h vsscript_init
  5877. if enabled gcrypt; then
  5878. GCRYPT_CONFIG="${cross_prefix}libgcrypt-config"
  5879. if "${GCRYPT_CONFIG}" --version > /dev/null 2>&1; then
  5880. gcrypt_cflags=$("${GCRYPT_CONFIG}" --cflags)
  5881. gcrypt_extralibs=$("${GCRYPT_CONFIG}" --libs)
  5882. check_func_headers gcrypt.h gcry_mpi_new $gcrypt_cflags $gcrypt_extralibs ||
  5883. die "ERROR: gcrypt not found"
  5884. add_cflags $gcrypt_cflags
  5885. else
  5886. require gcrypt gcrypt.h gcry_mpi_new -lgcrypt
  5887. fi
  5888. fi
  5889. if enabled sdl2; then
  5890. SDL2_CONFIG="${cross_prefix}sdl2-config"
  5891. test_pkg_config sdl2 "sdl2 >= 2.0.1 sdl2 < 2.1.0" SDL_events.h SDL_PollEvent
  5892. if disabled sdl2 && "${SDL2_CONFIG}" --version > /dev/null 2>&1; then
  5893. sdl2_cflags=$("${SDL2_CONFIG}" --cflags)
  5894. sdl2_extralibs=$("${SDL2_CONFIG}" --libs)
  5895. test_cpp_condition SDL.h "(SDL_MAJOR_VERSION<<16 | SDL_MINOR_VERSION<<8 | SDL_PATCHLEVEL) >= 0x020001" $sdl2_cflags &&
  5896. test_cpp_condition SDL.h "(SDL_MAJOR_VERSION<<16 | SDL_MINOR_VERSION<<8 | SDL_PATCHLEVEL) < 0x020100" $sdl2_cflags &&
  5897. check_func_headers SDL_events.h SDL_PollEvent $sdl2_extralibs $sdl2_cflags &&
  5898. enable sdl2
  5899. fi
  5900. if test $target_os = "mingw32"; then
  5901. sdl2_extralibs=$(filter_out '-mwindows' $sdl2_extralibs)
  5902. fi
  5903. fi
  5904. if enabled decklink; then
  5905. case $target_os in
  5906. mingw32*|mingw64*|win32|win64)
  5907. decklink_outdev_extralibs="$decklink_outdev_extralibs -lole32 -loleaut32"
  5908. decklink_indev_extralibs="$decklink_indev_extralibs -lole32 -loleaut32"
  5909. ;;
  5910. esac
  5911. fi
  5912. enabled securetransport &&
  5913. check_func SecIdentityCreate "-Wl,-framework,CoreFoundation -Wl,-framework,Security" &&
  5914. check_lib securetransport "Security/SecureTransport.h Security/Security.h" "SSLCreateContext" "-Wl,-framework,CoreFoundation -Wl,-framework,Security" ||
  5915. disable securetransport
  5916. enabled securetransport &&
  5917. check_func SecItemImport "-Wl,-framework,CoreFoundation -Wl,-framework,Security"
  5918. enabled schannel &&
  5919. check_func_headers "windows.h security.h" InitializeSecurityContext -DSECURITY_WIN32 -lsecur32 &&
  5920. test_cpp_condition winerror.h "defined(SEC_I_CONTEXT_EXPIRED)" &&
  5921. schannel_extralibs="-lsecur32" ||
  5922. disable schannel
  5923. makeinfo --version > /dev/null 2>&1 && enable makeinfo || disable makeinfo
  5924. enabled makeinfo \
  5925. && [ 0$(makeinfo --version | grep "texinfo" | sed 's/.*texinfo[^0-9]*\([0-9]*\)\..*/\1/') -ge 5 ] \
  5926. && enable makeinfo_html || disable makeinfo_html
  5927. disabled makeinfo_html && texi2html --help 2> /dev/null | grep -q 'init-file' && enable texi2html || disable texi2html
  5928. perl -v > /dev/null 2>&1 && enable perl || disable perl
  5929. pod2man --help > /dev/null 2>&1 && enable pod2man || disable pod2man
  5930. rsync --help 2> /dev/null | grep -q 'contimeout' && enable rsync_contimeout || disable rsync_contimeout
  5931. # check V4L2 codecs available in the API
  5932. if enabled v4l2_m2m; then
  5933. check_headers linux/fb.h
  5934. check_headers linux/videodev2.h
  5935. test_code cc linux/videodev2.h "struct v4l2_frmsizeenum vfse; vfse.discrete.width = 0;" && enable_sanitized struct_v4l2_frmivalenum_discrete
  5936. check_cc v4l2_m2m linux/videodev2.h "int i = V4L2_CAP_VIDEO_M2M_MPLANE | V4L2_CAP_VIDEO_M2M | V4L2_BUF_FLAG_LAST;"
  5937. check_cc vc1_v4l2_m2m linux/videodev2.h "int i = V4L2_PIX_FMT_VC1_ANNEX_G;"
  5938. check_cc mpeg1_v4l2_m2m linux/videodev2.h "int i = V4L2_PIX_FMT_MPEG1;"
  5939. check_cc mpeg2_v4l2_m2m linux/videodev2.h "int i = V4L2_PIX_FMT_MPEG2;"
  5940. check_cc mpeg4_v4l2_m2m linux/videodev2.h "int i = V4L2_PIX_FMT_MPEG4;"
  5941. check_cc hevc_v4l2_m2m linux/videodev2.h "int i = V4L2_PIX_FMT_HEVC;"
  5942. check_cc h263_v4l2_m2m linux/videodev2.h "int i = V4L2_PIX_FMT_H263;"
  5943. check_cc h264_v4l2_m2m linux/videodev2.h "int i = V4L2_PIX_FMT_H264;"
  5944. check_cc vp8_v4l2_m2m linux/videodev2.h "int i = V4L2_PIX_FMT_VP8;"
  5945. check_cc vp9_v4l2_m2m linux/videodev2.h "int i = V4L2_PIX_FMT_VP9;"
  5946. fi
  5947. check_headers sys/videoio.h
  5948. test_code cc sys/videoio.h "struct v4l2_frmsizeenum vfse; vfse.discrete.width = 0;" && enable_sanitized struct_v4l2_frmivalenum_discrete
  5949. check_lib user32 "windows.h winuser.h" GetShellWindow -luser32
  5950. check_lib vfw32 "windows.h vfw.h" capCreateCaptureWindow -lvfw32
  5951. # check that WM_CAP_DRIVER_CONNECT is defined to the proper value
  5952. # w32api 3.12 had it defined wrong
  5953. check_cpp_condition vfwcap_defines vfw.h "WM_CAP_DRIVER_CONNECT > WM_USER"
  5954. check_type "dshow.h" IBaseFilter
  5955. # check for ioctl_meteor.h, ioctl_bt848.h and alternatives
  5956. check_headers "dev/bktr/ioctl_meteor.h dev/bktr/ioctl_bt848.h" ||
  5957. check_headers "machine/ioctl_meteor.h machine/ioctl_bt848.h" ||
  5958. check_headers "dev/video/meteor/ioctl_meteor.h dev/video/bktr/ioctl_bt848.h" ||
  5959. check_headers "dev/ic/bt8xx.h"
  5960. if check_struct sys/soundcard.h audio_buf_info bytes; then
  5961. enable_sanitized sys/soundcard.h
  5962. else
  5963. test_cc -D__BSD_VISIBLE -D__XSI_VISIBLE <<EOF && add_cppflags -D__BSD_VISIBLE -D__XSI_VISIBLE && enable_sanitized sys/soundcard.h
  5964. #include <sys/soundcard.h>
  5965. audio_buf_info abc;
  5966. EOF
  5967. fi
  5968. enabled alsa && { check_pkg_config alsa alsa "alsa/asoundlib.h" snd_pcm_htimestamp ||
  5969. check_lib alsa alsa/asoundlib.h snd_pcm_htimestamp -lasound; }
  5970. enabled libjack &&
  5971. require_pkg_config libjack jack jack/jack.h jack_port_get_latency_range
  5972. enabled sndio && check_lib sndio sndio.h sio_open -lsndio
  5973. if enabled libcdio; then
  5974. check_pkg_config libcdio libcdio_paranoia "cdio/cdda.h cdio/paranoia.h" cdio_cddap_open ||
  5975. check_pkg_config libcdio libcdio_paranoia "cdio/paranoia/cdda.h cdio/paranoia/paranoia.h" cdio_cddap_open ||
  5976. check_lib libcdio "cdio/cdda.h cdio/paranoia.h" cdio_cddap_open -lcdio_paranoia -lcdio_cdda -lcdio ||
  5977. check_lib libcdio "cdio/paranoia/cdda.h cdio/paranoia/paranoia.h" cdio_cddap_open -lcdio_paranoia -lcdio_cdda -lcdio ||
  5978. die "ERROR: No usable libcdio/cdparanoia found"
  5979. fi
  5980. enabled libxcb && check_pkg_config libxcb "xcb >= 1.4" xcb/xcb.h xcb_connect ||
  5981. disable libxcb_shm libxcb_shape libxcb_xfixes
  5982. if enabled libxcb; then
  5983. enabled libxcb_shm && check_pkg_config libxcb_shm xcb-shm xcb/shm.h xcb_shm_attach
  5984. enabled libxcb_shape && check_pkg_config libxcb_shape xcb-shape xcb/shape.h xcb_shape_get_rectangles
  5985. enabled libxcb_xfixes && check_pkg_config libxcb_xfixes xcb-xfixes xcb/xfixes.h xcb_xfixes_get_cursor_image
  5986. fi
  5987. check_func_headers "windows.h" CreateDIBSection "$gdigrab_indev_extralibs"
  5988. # d3d11va requires linking directly to dxgi and d3d11 if not building for
  5989. # the desktop api partition
  5990. test_cpp <<EOF && enable uwp && d3d11va_extralibs="-ldxgi -ld3d11"
  5991. #ifdef WINAPI_FAMILY
  5992. #include <winapifamily.h>
  5993. #if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
  5994. #error desktop, not uwp
  5995. #else
  5996. // WINAPI_FAMILY_APP, WINAPI_FAMILY_PHONE_APP => UWP
  5997. #endif
  5998. #else
  5999. #error no family set
  6000. #endif
  6001. EOF
  6002. enabled vaapi &&
  6003. check_pkg_config vaapi "libva >= 0.35.0" "va/va.h" vaInitialize
  6004. if enabled vaapi; then
  6005. check_pkg_config vaapi_drm "libva-drm" "va/va_drm.h" vaGetDisplayDRM
  6006. if enabled xlib; then
  6007. check_pkg_config vaapi_x11 "libva-x11" "va/va_x11.h" vaGetDisplay
  6008. fi
  6009. check_cpp_condition vaapi_1 "va/va.h" "VA_CHECK_VERSION(1, 0, 0)"
  6010. check_type "va/va.h va/va_dec_hevc.h" "VAPictureParameterBufferHEVC"
  6011. check_struct "va/va.h" "VADecPictureParameterBufferVP9" bit_depth
  6012. check_struct "va/va.h va/va_vpp.h" "VAProcPipelineCaps" rotation_flags
  6013. check_type "va/va.h va/va_enc_hevc.h" "VAEncPictureParameterBufferHEVC"
  6014. check_type "va/va.h va/va_enc_jpeg.h" "VAEncPictureParameterBufferJPEG"
  6015. check_type "va/va.h va/va_enc_vp8.h" "VAEncPictureParameterBufferVP8"
  6016. check_type "va/va.h va/va_enc_vp9.h" "VAEncPictureParameterBufferVP9"
  6017. fi
  6018. if enabled_all opencl libdrm ; then
  6019. check_type "CL/cl_intel.h" "clCreateImageFromFdINTEL_fn" &&
  6020. enable opencl_drm_beignet
  6021. check_func_headers "CL/cl_ext.h" clImportMemoryARM &&
  6022. enable opencl_drm_arm
  6023. fi
  6024. if enabled_all opencl vaapi ; then
  6025. if enabled opencl_drm_beignet ; then
  6026. enable opencl_vaapi_beignet
  6027. else
  6028. check_type "CL/cl.h CL/cl_va_api_media_sharing_intel.h" "clCreateFromVA_APIMediaSurfaceINTEL_fn" &&
  6029. enable opencl_vaapi_intel_media
  6030. fi
  6031. fi
  6032. if enabled_all opencl dxva2 ; then
  6033. check_type "CL/cl_dx9_media_sharing.h" cl_dx9_surface_info_khr &&
  6034. enable opencl_dxva2
  6035. fi
  6036. if enabled_all opencl d3d11va ; then
  6037. check_type "CL/cl_d3d11.h" clGetDeviceIDsFromD3D11KHR_fn &&
  6038. enable opencl_d3d11
  6039. fi
  6040. enabled vdpau &&
  6041. check_cpp_condition vdpau vdpau/vdpau.h "defined VDP_DECODER_PROFILE_MPEG4_PART2_ASP"
  6042. enabled vdpau &&
  6043. check_lib vdpau_x11 "vdpau/vdpau.h vdpau/vdpau_x11.h" vdp_device_create_x11 -lvdpau -lX11
  6044. enabled crystalhd && check_lib crystalhd "stdint.h libcrystalhd/libcrystalhd_if.h" DtsCrystalHDVersion -lcrystalhd
  6045. if enabled x86; then
  6046. case $target_os in
  6047. mingw32*|mingw64*|win32|win64|linux|cygwin*)
  6048. ;;
  6049. *)
  6050. disable ffnvcodec cuvid nvdec nvenc
  6051. ;;
  6052. esac
  6053. elif enabled ppc64 && ! enabled bigendian; then
  6054. case $target_os in
  6055. linux)
  6056. ;;
  6057. *)
  6058. disable ffnvcodec cuvid nvdec nvenc
  6059. ;;
  6060. esac
  6061. else
  6062. disable ffnvcodec cuvid nvdec nvenc
  6063. fi
  6064. enabled ffnvcodec && enable cuda
  6065. enabled nvenc &&
  6066. test_cc -I$source_path <<EOF || disable nvenc
  6067. #include <ffnvcodec/nvEncodeAPI.h>
  6068. NV_ENCODE_API_FUNCTION_LIST flist;
  6069. void f(void) { struct { const GUID guid; } s[] = { { NV_ENC_PRESET_HQ_GUID } }; }
  6070. int main(void) { return 0; }
  6071. EOF
  6072. enabled amf &&
  6073. check_cpp_condition amf "AMF/core/Version.h" \
  6074. "(AMF_VERSION_MAJOR << 48 | AMF_VERSION_MINOR << 32 | AMF_VERSION_RELEASE << 16 | AMF_VERSION_BUILD_NUM) >= 0x0001000400090000"
  6075. # Funny iconv installations are not unusual, so check it after all flags have been set
  6076. if enabled libc_iconv; then
  6077. check_func_headers iconv.h iconv
  6078. elif enabled iconv; then
  6079. check_func_headers iconv.h iconv || check_lib iconv iconv.h iconv -liconv
  6080. fi
  6081. enabled debug && add_cflags -g"$debuglevel" && add_asflags -g"$debuglevel"
  6082. # add some useful compiler flags if supported
  6083. check_cflags -Wdeclaration-after-statement
  6084. check_cflags -Wall
  6085. check_cflags -Wdisabled-optimization
  6086. check_cflags -Wpointer-arith
  6087. check_cflags -Wredundant-decls
  6088. check_cflags -Wwrite-strings
  6089. check_cflags -Wtype-limits
  6090. check_cflags -Wundef
  6091. check_cflags -Wmissing-prototypes
  6092. check_cflags -Wno-pointer-to-int-cast
  6093. check_cflags -Wstrict-prototypes
  6094. check_cflags -Wempty-body
  6095. if enabled extra_warnings; then
  6096. check_cflags -Wcast-qual
  6097. check_cflags -Wextra
  6098. check_cflags -Wpedantic
  6099. fi
  6100. check_disable_warning(){
  6101. warning_flag=-W${1#-Wno-}
  6102. test_cflags $unknown_warning_flags $warning_flag && add_cflags $1
  6103. }
  6104. test_cflags -Werror=unused-command-line-argument &&
  6105. append unknown_warning_flags "-Werror=unused-command-line-argument"
  6106. test_cflags -Werror=unknown-warning-option &&
  6107. append unknown_warning_flags "-Werror=unknown-warning-option"
  6108. check_disable_warning -Wno-parentheses
  6109. check_disable_warning -Wno-switch
  6110. check_disable_warning -Wno-format-zero-length
  6111. check_disable_warning -Wno-pointer-sign
  6112. check_disable_warning -Wno-unused-const-variable
  6113. check_disable_warning -Wno-bool-operation
  6114. check_disable_warning -Wno-char-subscripts
  6115. check_disable_warning_headers(){
  6116. warning_flag=-W${1#-Wno-}
  6117. test_cflags $warning_flag && add_cflags_headers $1
  6118. }
  6119. check_disable_warning_headers -Wno-deprecated-declarations
  6120. check_disable_warning_headers -Wno-unused-variable
  6121. test_cc <<EOF && enable blocks_extension
  6122. void (^block)(void);
  6123. EOF
  6124. # add some linker flags
  6125. check_ldflags -Wl,--warn-common
  6126. check_ldflags -Wl,-rpath-link=:libpostproc:libswresample:libswscale:libavfilter:libavdevice:libavformat:libavcodec:libavutil:libavresample
  6127. enabled rpath && add_ldexeflags -Wl,-rpath,$libdir && add_ldsoflags -Wl,-rpath,$libdir
  6128. test_ldflags -Wl,-Bsymbolic && append SHFLAGS -Wl,-Bsymbolic
  6129. # add some strip flags
  6130. check_stripflags -x
  6131. enabled neon_clobber_test &&
  6132. check_ldflags -Wl,--wrap,avcodec_open2 \
  6133. -Wl,--wrap,avcodec_decode_audio4 \
  6134. -Wl,--wrap,avcodec_decode_video2 \
  6135. -Wl,--wrap,avcodec_decode_subtitle2 \
  6136. -Wl,--wrap,avcodec_encode_audio2 \
  6137. -Wl,--wrap,avcodec_encode_video2 \
  6138. -Wl,--wrap,avcodec_encode_subtitle \
  6139. -Wl,--wrap,avcodec_send_packet \
  6140. -Wl,--wrap,avcodec_receive_packet \
  6141. -Wl,--wrap,avcodec_send_frame \
  6142. -Wl,--wrap,avcodec_receive_frame \
  6143. -Wl,--wrap,swr_convert \
  6144. -Wl,--wrap,avresample_convert ||
  6145. disable neon_clobber_test
  6146. enabled xmm_clobber_test &&
  6147. check_ldflags -Wl,--wrap,avcodec_open2 \
  6148. -Wl,--wrap,avcodec_decode_audio4 \
  6149. -Wl,--wrap,avcodec_decode_video2 \
  6150. -Wl,--wrap,avcodec_decode_subtitle2 \
  6151. -Wl,--wrap,avcodec_encode_audio2 \
  6152. -Wl,--wrap,avcodec_encode_video2 \
  6153. -Wl,--wrap,avcodec_encode_subtitle \
  6154. -Wl,--wrap,avcodec_send_packet \
  6155. -Wl,--wrap,avcodec_receive_packet \
  6156. -Wl,--wrap,avcodec_send_frame \
  6157. -Wl,--wrap,avcodec_receive_frame \
  6158. -Wl,--wrap,swr_convert \
  6159. -Wl,--wrap,avresample_convert \
  6160. -Wl,--wrap,sws_scale ||
  6161. disable xmm_clobber_test
  6162. check_ld "cc" proper_dce <<EOF
  6163. extern const int array[512];
  6164. static inline int func(void) { return array[0]; }
  6165. int main(void) { return 0; }
  6166. EOF
  6167. if enabled proper_dce; then
  6168. echo "X { local: *; };" > $TMPV
  6169. if test_ldflags -Wl,${version_script},$TMPV; then
  6170. append SHFLAGS '-Wl,${version_script},\$(SUBDIR)lib\$(NAME).ver'
  6171. quotes='""'
  6172. test_cc <<EOF && enable symver_asm_label
  6173. void ff_foo(void) __asm__ ("av_foo@VERSION");
  6174. void ff_foo(void) { ${inline_asm+__asm__($quotes);} }
  6175. EOF
  6176. test_cc <<EOF && enable symver_gnu_asm
  6177. __asm__(".symver ff_foo,av_foo@VERSION");
  6178. void ff_foo(void) {}
  6179. EOF
  6180. fi
  6181. fi
  6182. if [ -z "$optflags" ]; then
  6183. if enabled small; then
  6184. optflags=$cflags_size
  6185. elif enabled optimizations; then
  6186. optflags=$cflags_speed
  6187. else
  6188. optflags=$cflags_noopt
  6189. fi
  6190. fi
  6191. check_optflags(){
  6192. check_cflags "$@"
  6193. enabled lto && check_ldflags "$@"
  6194. }
  6195. check_optflags $optflags
  6196. check_optflags -fno-math-errno
  6197. check_optflags -fno-signed-zeros
  6198. if enabled lto; then
  6199. test "$cc_type" != "$ld_type" && die "LTO requires same compiler and linker"
  6200. check_cflags -flto
  6201. check_ldflags -flto $cpuflags
  6202. disable inline_asm_direct_symbol_refs
  6203. fi
  6204. enabled ftrapv && check_cflags -ftrapv
  6205. test_cc -mno-red-zone <<EOF && noredzone_flags="-mno-red-zone"
  6206. int x;
  6207. EOF
  6208. if enabled icc; then
  6209. # Just warnings, no remarks
  6210. check_cflags -w1
  6211. # -wd: Disable following warnings
  6212. # 144, 167, 556: -Wno-pointer-sign
  6213. # 188: enumerated type mixed with another type
  6214. # 1292: attribute "foo" ignored
  6215. # 1419: external declaration in primary source file
  6216. # 10006: ignoring unknown option -fno-signed-zeros
  6217. # 10148: ignoring unknown option -Wno-parentheses
  6218. # 10156: ignoring option '-W'; no argument required
  6219. # 13200: No EMMS instruction before call to function
  6220. # 13203: No EMMS instruction before return from function
  6221. check_cflags -wd144,167,188,556,1292,1419,10006,10148,10156,13200,13203
  6222. # 11030: Warning unknown option --as-needed
  6223. # 10156: ignoring option '-export'; no argument required
  6224. check_ldflags -wd10156,11030
  6225. # icc 11.0 and 11.1 work with ebp_available, but don't pass the test
  6226. enable ebp_available
  6227. # The test above does not test linking
  6228. enabled lto && disable symver_asm_label
  6229. if enabled x86_32; then
  6230. icc_version=$($cc -dumpversion)
  6231. test ${icc_version%%.*} -ge 11 &&
  6232. check_cflags -falign-stack=maintain-16-byte ||
  6233. disable aligned_stack
  6234. fi
  6235. elif enabled gcc; then
  6236. check_optflags -fno-tree-vectorize
  6237. check_cflags -Werror=format-security
  6238. check_cflags -Werror=implicit-function-declaration
  6239. check_cflags -Werror=missing-prototypes
  6240. check_cflags -Werror=return-type
  6241. check_cflags -Werror=vla
  6242. check_cflags -Wformat
  6243. check_cflags -fdiagnostics-color=auto
  6244. enabled extra_warnings || check_disable_warning -Wno-maybe-uninitialized
  6245. if enabled x86_32; then
  6246. case $target_os in
  6247. *bsd*)
  6248. # BSDs don't guarantee a 16 byte aligned stack, but we can
  6249. # request GCC to try to maintain 16 byte alignment throughout
  6250. # function calls. Library entry points that might call assembly
  6251. # functions align the stack. (The parameter means 2^4 bytes.)
  6252. check_cflags -mpreferred-stack-boundary=4
  6253. ;;
  6254. esac
  6255. fi
  6256. elif enabled llvm_gcc; then
  6257. check_cflags -mllvm -stack-alignment=16
  6258. elif enabled clang; then
  6259. if enabled x86_32; then
  6260. # Clang doesn't support maintaining alignment without assuming the
  6261. # same alignment in every function. If 16 byte alignment would be
  6262. # enabled, one would also have to either add attribute_align_arg on
  6263. # every single entry point into the libraries or enable -mstackrealign
  6264. # (doing stack realignment in every single function).
  6265. case $target_os in
  6266. mingw32|win32|*bsd*)
  6267. disable aligned_stack
  6268. ;;
  6269. *)
  6270. check_cflags -mllvm -stack-alignment=16
  6271. check_cflags -mstack-alignment=16
  6272. ;;
  6273. esac
  6274. else
  6275. check_cflags -mllvm -stack-alignment=16
  6276. check_cflags -mstack-alignment=16
  6277. fi
  6278. check_cflags -Qunused-arguments
  6279. check_cflags -Werror=implicit-function-declaration
  6280. check_cflags -Werror=missing-prototypes
  6281. check_cflags -Werror=return-type
  6282. elif enabled cparser; then
  6283. add_cflags -Wno-missing-variable-declarations
  6284. add_cflags -Wno-empty-statement
  6285. elif enabled armcc; then
  6286. add_cflags -W${armcc_opt},--diag_suppress=4343 # hardfp compat
  6287. add_cflags -W${armcc_opt},--diag_suppress=3036 # using . as system include dir
  6288. # 2523: use of inline assembly is deprecated
  6289. add_cflags -W${armcc_opt},--diag_suppress=2523
  6290. add_cflags -W${armcc_opt},--diag_suppress=1207
  6291. add_cflags -W${armcc_opt},--diag_suppress=1293 # assignment in condition
  6292. add_cflags -W${armcc_opt},--diag_suppress=3343 # hardfp compat
  6293. add_cflags -W${armcc_opt},--diag_suppress=167 # pointer sign
  6294. add_cflags -W${armcc_opt},--diag_suppress=513 # pointer sign
  6295. elif enabled pathscale; then
  6296. add_cflags -fstrict-overflow -OPT:wrap_around_unsafe_opt=OFF
  6297. disable inline_asm
  6298. elif enabled_any msvc icl; then
  6299. enabled x86_32 && disable aligned_stack
  6300. enabled_all x86_32 debug && add_cflags -Oy-
  6301. enabled debug && add_ldflags -debug
  6302. enable pragma_deprecated
  6303. if enabled icl; then
  6304. # -Qansi-alias is basically -fstrict-aliasing, but does not work
  6305. # (correctly) on icl 13.x.
  6306. test_cpp_condition "windows.h" "__ICL < 1300 || __ICL >= 1400" &&
  6307. add_cflags -Qansi-alias
  6308. # Some inline asm is not compilable in debug
  6309. if enabled debug; then
  6310. disable ebp_available
  6311. disable ebx_available
  6312. fi
  6313. fi
  6314. # msvcrt10 x64 incorrectly enables log2, only msvcrt12 (MSVC 2013) onwards actually has log2.
  6315. check_cpp_condition log2 crtversion.h "_VC_CRT_MAJOR_VERSION >= 12"
  6316. # The CRT headers contain __declspec(restrict) in a few places, but if redefining
  6317. # restrict, this might break. MSVC 2010 and 2012 fail with __declspec(__restrict)
  6318. # (as it ends up if the restrict redefine is done before including stdlib.h), while
  6319. # MSVC 2013 and newer can handle it fine.
  6320. # If this declspec fails, force including stdlib.h before the restrict redefinition
  6321. # happens in config.h.
  6322. if [ $restrict_keyword != restrict ]; then
  6323. test_cc <<EOF || add_cflags -FIstdlib.h
  6324. __declspec($restrict_keyword) void *foo(int);
  6325. EOF
  6326. fi
  6327. # the new SSA optimzer in VS2015 U3 is mis-optimizing some parts of the code
  6328. # Issue has been fixed in MSVC v19.00.24218.
  6329. test_cpp_condition windows.h "_MSC_FULL_VER >= 190024218" ||
  6330. check_cflags -d2SSAOptimizer-
  6331. # enable utf-8 source processing on VS2015 U2 and newer
  6332. test_cpp_condition windows.h "_MSC_FULL_VER >= 190023918" &&
  6333. add_cflags -utf-8
  6334. fi
  6335. for pfx in "" host_; do
  6336. varname=${pfx%_}cc_type
  6337. eval "type=\$$varname"
  6338. if [ "$type" = "msvc" ]; then
  6339. test_${pfx}cc <<EOF || add_${pfx}cflags -Dinline=__inline
  6340. static inline int foo(int a) { return a; }
  6341. EOF
  6342. fi
  6343. done
  6344. case $as_type in
  6345. clang)
  6346. add_asflags -Qunused-arguments
  6347. ;;
  6348. esac
  6349. case $ld_type in
  6350. clang)
  6351. check_ldflags -Qunused-arguments
  6352. ;;
  6353. esac
  6354. enable frame_thread_encoder
  6355. enabled asm || { arch=c; disable $ARCH_LIST $ARCH_EXT_LIST; }
  6356. check_deps $CONFIG_LIST \
  6357. $CONFIG_EXTRA \
  6358. $HAVE_LIST \
  6359. $ALL_COMPONENTS \
  6360. 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"
  6361. enabled avresample && warn "Building with deprecated library libavresample"
  6362. case $target_os in
  6363. haiku)
  6364. disable memalign
  6365. disable posix_memalign
  6366. ;;
  6367. *-dos|freedos|opendos)
  6368. if test_cpp_condition sys/version.h "defined(__DJGPP__) && __DJGPP__ == 2 && __DJGPP_MINOR__ == 5"; then
  6369. disable memalign
  6370. fi
  6371. ;;
  6372. esac
  6373. flatten_extralibs(){
  6374. nested_entries=
  6375. list_name=$1
  6376. eval list=\$${1}
  6377. for entry in $list; do
  6378. entry_copy=$entry
  6379. resolve entry_copy
  6380. flat_entries=
  6381. for e in $entry_copy; do
  6382. case $e in
  6383. *_extralibs) nested_entries="$nested_entries$e ";;
  6384. *) flat_entries="$flat_entries$e ";;
  6385. esac
  6386. done
  6387. eval $entry="\$flat_entries"
  6388. done
  6389. append $list_name "$nested_entries"
  6390. resolve nested_entries
  6391. if test -n "$(filter '*_extralibs' $nested_entries)"; then
  6392. flatten_extralibs $list_name
  6393. fi
  6394. }
  6395. flatten_extralibs_wrapper(){
  6396. list_name=$1
  6397. flatten_extralibs $list_name
  6398. unique $list_name
  6399. resolve $list_name
  6400. eval $list_name=\$\(\$ldflags_filter \$$list_name\)
  6401. eval printf \''%s'\' \""\$$list_name"\"
  6402. }
  6403. for linkunit in $LIBRARY_LIST; do
  6404. unset current_extralibs
  6405. eval components=\$$(toupper ${linkunit})_COMPONENTS_LIST
  6406. for comp in ${components}; do
  6407. enabled $comp || continue
  6408. comp_extralibs="${comp}_extralibs"
  6409. append current_extralibs $comp_extralibs
  6410. done
  6411. eval prepend ${linkunit}_extralibs $current_extralibs
  6412. done
  6413. for linkunit in $LIBRARY_LIST $PROGRAM_LIST $EXTRALIBS_LIST; do
  6414. eval ${linkunit}_extralibs=\$\(flatten_extralibs_wrapper ${linkunit}_extralibs\)
  6415. done
  6416. map 'enabled $v && intrinsics=${v#intrinsics_}' $INTRINSICS_LIST
  6417. for thread in $THREADS_LIST; do
  6418. if enabled $thread; then
  6419. test -n "$thread_type" &&
  6420. die "ERROR: Only one thread type must be selected." ||
  6421. thread_type="$thread"
  6422. fi
  6423. done
  6424. if disabled stdatomic; then
  6425. if enabled atomics_gcc; then
  6426. add_cppflags '-I\$(SRC_PATH)/compat/atomics/gcc'
  6427. elif enabled atomics_win32; then
  6428. add_cppflags '-I\$(SRC_PATH)/compat/atomics/win32'
  6429. elif enabled atomics_suncc; then
  6430. add_cppflags '-I\$(SRC_PATH)/compat/atomics/suncc'
  6431. elif enabled pthreads; then
  6432. add_compat atomics/pthread/stdatomic.o
  6433. add_cppflags '-I\$(SRC_PATH)/compat/atomics/pthread'
  6434. else
  6435. enabled threads && die "Threading is enabled, but no atomics are available"
  6436. add_cppflags '-I\$(SRC_PATH)/compat/atomics/dummy'
  6437. fi
  6438. fi
  6439. # Check if requested libraries were found.
  6440. for lib in $AUTODETECT_LIBS; do
  6441. requested $lib && ! enabled $lib && die "ERROR: $lib requested but not found";
  6442. done
  6443. enabled zlib && add_cppflags -DZLIB_CONST
  6444. # conditional library dependencies, in any order
  6445. enabled afftdn_filter && prepend avfilter_deps "avcodec"
  6446. enabled afftfilt_filter && prepend avfilter_deps "avcodec"
  6447. enabled afir_filter && prepend avfilter_deps "avcodec"
  6448. enabled amovie_filter && prepend avfilter_deps "avformat avcodec"
  6449. enabled aresample_filter && prepend avfilter_deps "swresample"
  6450. enabled atempo_filter && prepend avfilter_deps "avcodec"
  6451. enabled bm3d_filter && prepend avfilter_deps "avcodec"
  6452. enabled cover_rect_filter && prepend avfilter_deps "avformat avcodec"
  6453. enabled convolve_filter && prepend avfilter_deps "avcodec"
  6454. enabled deconvolve_filter && prepend avfilter_deps "avcodec"
  6455. enabled ebur128_filter && enabled swresample && prepend avfilter_deps "swresample"
  6456. enabled elbg_filter && prepend avfilter_deps "avcodec"
  6457. enabled fftfilt_filter && prepend avfilter_deps "avcodec"
  6458. enabled find_rect_filter && prepend avfilter_deps "avformat avcodec"
  6459. enabled firequalizer_filter && prepend avfilter_deps "avcodec"
  6460. enabled mcdeint_filter && prepend avfilter_deps "avcodec"
  6461. enabled movie_filter && prepend avfilter_deps "avformat avcodec"
  6462. enabled pan_filter && prepend avfilter_deps "swresample"
  6463. enabled pp_filter && prepend avfilter_deps "postproc"
  6464. enabled removelogo_filter && prepend avfilter_deps "avformat avcodec swscale"
  6465. enabled resample_filter && prepend avfilter_deps "avresample"
  6466. enabled sab_filter && prepend avfilter_deps "swscale"
  6467. enabled scale_filter && prepend avfilter_deps "swscale"
  6468. enabled scale2ref_filter && prepend avfilter_deps "swscale"
  6469. enabled sofalizer_filter && prepend avfilter_deps "avcodec"
  6470. enabled showcqt_filter && prepend avfilter_deps "avformat avcodec swscale"
  6471. enabled showfreqs_filter && prepend avfilter_deps "avcodec"
  6472. enabled showspectrum_filter && prepend avfilter_deps "avcodec"
  6473. enabled signature_filter && prepend avfilter_deps "avcodec avformat"
  6474. enabled smartblur_filter && prepend avfilter_deps "swscale"
  6475. enabled spectrumsynth_filter && prepend avfilter_deps "avcodec"
  6476. enabled spp_filter && prepend avfilter_deps "avcodec"
  6477. enabled sr_filter && prepend avfilter_deps "avformat swscale"
  6478. enabled subtitles_filter && prepend avfilter_deps "avformat avcodec"
  6479. enabled uspp_filter && prepend avfilter_deps "avcodec"
  6480. enabled zoompan_filter && prepend avfilter_deps "swscale"
  6481. enabled lavfi_indev && prepend avdevice_deps "avfilter"
  6482. #FIXME
  6483. enabled_any sdl2_outdev opengl_outdev && enabled sdl2 &&
  6484. add_cflags $(filter_out '-Dmain=SDL_main' $sdl2_cflags)
  6485. enabled opus_decoder && prepend avcodec_deps "swresample"
  6486. # reorder the items at var $1 to align with the items order at var $2 .
  6487. # die if an item at $1 is not at $2 .
  6488. reorder_by(){
  6489. eval rb_in=\$$1
  6490. eval rb_ordered=\$$2
  6491. for rb in $rb_in; do
  6492. is_in $rb $rb_ordered || die "$rb at \$$1 is not at \$$2"
  6493. done
  6494. rb_out=
  6495. for rb in $rb_ordered; do
  6496. is_in $rb $rb_in && rb_out="$rb_out$rb "
  6497. done
  6498. eval $1=\$rb_out
  6499. }
  6500. # deps-expand fflib $1: N x {append all expanded deps; unique}
  6501. # within a set of N items, N expansions are enough to expose a cycle.
  6502. expand_deps(){
  6503. unique ${1}_deps # required for the early break test.
  6504. for dummy in $LIBRARY_LIST; do # N iteratios
  6505. eval deps=\$${1}_deps
  6506. append ${1}_deps $(map 'eval echo \$${v}_deps' $deps)
  6507. unique ${1}_deps
  6508. eval '[ ${#deps} = ${#'${1}_deps'} ]' && break # doesn't expand anymore
  6509. done
  6510. eval is_in $1 \$${1}_deps && die "Dependency cycle at ${1}_deps"
  6511. reorder_by ${1}_deps LIBRARY_LIST # linking order is expected later
  6512. }
  6513. #we have to remove gpl from the deps here as some code assumes all lib deps are libs
  6514. postproc_deps="$(filter_out 'gpl' $postproc_deps)"
  6515. map 'expand_deps $v' $LIBRARY_LIST
  6516. if test "$quiet" != "yes"; then
  6517. echo "install prefix $prefix"
  6518. echo "source path $source_path"
  6519. echo "C compiler $cc"
  6520. echo "C library $libc_type"
  6521. if test "$host_cc" != "$cc"; then
  6522. echo "host C compiler $host_cc"
  6523. echo "host C library $host_libc_type"
  6524. fi
  6525. echo "ARCH $arch ($cpu)"
  6526. if test "$build_suffix" != ""; then
  6527. echo "build suffix $build_suffix"
  6528. fi
  6529. if test "$progs_suffix" != ""; then
  6530. echo "progs suffix $progs_suffix"
  6531. fi
  6532. if test "$extra_version" != ""; then
  6533. echo "version string suffix $extra_version"
  6534. fi
  6535. echo "big-endian ${bigendian-no}"
  6536. echo "runtime cpu detection ${runtime_cpudetect-no}"
  6537. if enabled x86; then
  6538. echo "standalone assembly ${x86asm-no}"
  6539. echo "x86 assembler ${x86asmexe}"
  6540. echo "MMX enabled ${mmx-no}"
  6541. echo "MMXEXT enabled ${mmxext-no}"
  6542. echo "3DNow! enabled ${amd3dnow-no}"
  6543. echo "3DNow! extended enabled ${amd3dnowext-no}"
  6544. echo "SSE enabled ${sse-no}"
  6545. echo "SSSE3 enabled ${ssse3-no}"
  6546. echo "AESNI enabled ${aesni-no}"
  6547. echo "AVX enabled ${avx-no}"
  6548. echo "AVX2 enabled ${avx2-no}"
  6549. echo "AVX-512 enabled ${avx512-no}"
  6550. echo "XOP enabled ${xop-no}"
  6551. echo "FMA3 enabled ${fma3-no}"
  6552. echo "FMA4 enabled ${fma4-no}"
  6553. echo "i686 features enabled ${i686-no}"
  6554. echo "CMOV is fast ${fast_cmov-no}"
  6555. echo "EBX available ${ebx_available-no}"
  6556. echo "EBP available ${ebp_available-no}"
  6557. fi
  6558. if enabled aarch64; then
  6559. echo "NEON enabled ${neon-no}"
  6560. echo "VFP enabled ${vfp-no}"
  6561. fi
  6562. if enabled arm; then
  6563. echo "ARMv5TE enabled ${armv5te-no}"
  6564. echo "ARMv6 enabled ${armv6-no}"
  6565. echo "ARMv6T2 enabled ${armv6t2-no}"
  6566. echo "VFP enabled ${vfp-no}"
  6567. echo "NEON enabled ${neon-no}"
  6568. echo "THUMB enabled ${thumb-no}"
  6569. fi
  6570. if enabled mips; then
  6571. echo "MIPS FPU enabled ${mipsfpu-no}"
  6572. echo "MIPS DSP R1 enabled ${mipsdsp-no}"
  6573. echo "MIPS DSP R2 enabled ${mipsdspr2-no}"
  6574. echo "MIPS MSA enabled ${msa-no}"
  6575. echo "MIPS MSA2 enabled ${msa2-no}"
  6576. echo "LOONGSON MMI enabled ${mmi-no}"
  6577. fi
  6578. if enabled ppc; then
  6579. echo "AltiVec enabled ${altivec-no}"
  6580. echo "VSX enabled ${vsx-no}"
  6581. echo "POWER8 enabled ${power8-no}"
  6582. echo "PPC 4xx optimizations ${ppc4xx-no}"
  6583. echo "dcbzl available ${dcbzl-no}"
  6584. fi
  6585. echo "debug symbols ${debug-no}"
  6586. echo "strip symbols ${stripping-no}"
  6587. echo "optimize for size ${small-no}"
  6588. echo "optimizations ${optimizations-no}"
  6589. echo "static ${static-no}"
  6590. echo "shared ${shared-no}"
  6591. echo "postprocessing support ${postproc-no}"
  6592. echo "network support ${network-no}"
  6593. echo "threading support ${thread_type-no}"
  6594. echo "safe bitstream reader ${safe_bitstream_reader-no}"
  6595. echo "texi2html enabled ${texi2html-no}"
  6596. echo "perl enabled ${perl-no}"
  6597. echo "pod2man enabled ${pod2man-no}"
  6598. echo "makeinfo enabled ${makeinfo-no}"
  6599. echo "makeinfo supports HTML ${makeinfo_html-no}"
  6600. test -n "$random_seed" &&
  6601. echo "random seed ${random_seed}"
  6602. echo
  6603. echo "External libraries:"
  6604. print_enabled '' $EXTERNAL_LIBRARY_LIST $EXTERNAL_AUTODETECT_LIBRARY_LIST | print_in_columns
  6605. echo
  6606. echo "External libraries providing hardware acceleration:"
  6607. print_enabled '' $HWACCEL_LIBRARY_LIST $HWACCEL_AUTODETECT_LIBRARY_LIST | print_in_columns
  6608. echo
  6609. echo "Libraries:"
  6610. print_enabled '' $LIBRARY_LIST | print_in_columns
  6611. echo
  6612. echo "Programs:"
  6613. print_enabled '' $PROGRAM_LIST | print_in_columns
  6614. echo
  6615. for type in decoder encoder hwaccel parser demuxer muxer protocol filter bsf indev outdev; do
  6616. echo "Enabled ${type}s:"
  6617. eval list=\$$(toupper $type)_LIST
  6618. print_enabled '_*' $list | print_in_columns
  6619. echo
  6620. done
  6621. if test -n "$ignore_tests"; then
  6622. ignore_tests=$(echo $ignore_tests | tr ',' ' ')
  6623. echo "Ignored FATE tests:"
  6624. echo $ignore_tests | print_in_columns
  6625. echo
  6626. fi
  6627. echo "License: $license"
  6628. fi # test "$quiet" != "yes"
  6629. if test -n "$WARN_IF_GETS_DISABLED_LIST"; then
  6630. for cfg in $WARN_IF_GETS_DISABLED_LIST; do
  6631. if disabled $cfg; then
  6632. varname=${cfg}_disable_reason
  6633. eval "warn \"Disabled $cfg because \$$varname\""
  6634. fi
  6635. done
  6636. fi
  6637. if test -n "$WARNINGS"; then
  6638. printf "\n%s%s$WARNINGS%s" "$warn_color" "$bold_color" "$reset_color"
  6639. enabled fatal_warnings && exit 1
  6640. fi
  6641. test -e Makefile || echo "include $source_path/Makefile" > Makefile
  6642. esc(){
  6643. echo "$*" | sed 's/%/%25/g;s/:/%3a/g'
  6644. }
  6645. echo "config:$arch:$subarch:$cpu:$target_os:$(esc $cc_ident):$(esc $FFMPEG_CONFIGURATION)" > ffbuild/config.fate
  6646. enabled stripping || strip="echo skipping strip"
  6647. enabled stripping || striptype=""
  6648. config_files="$TMPH ffbuild/config.mak doc/config.texi"
  6649. cat > ffbuild/config.mak <<EOF
  6650. # Automatically generated by configure - do not modify!
  6651. ifndef FFMPEG_CONFIG_MAK
  6652. FFMPEG_CONFIG_MAK=1
  6653. FFMPEG_CONFIGURATION=$FFMPEG_CONFIGURATION
  6654. prefix=$prefix
  6655. LIBDIR=\$(DESTDIR)$libdir
  6656. SHLIBDIR=\$(DESTDIR)$shlibdir
  6657. INCDIR=\$(DESTDIR)$incdir
  6658. BINDIR=\$(DESTDIR)$bindir
  6659. DATADIR=\$(DESTDIR)$datadir
  6660. DOCDIR=\$(DESTDIR)$docdir
  6661. MANDIR=\$(DESTDIR)$mandir
  6662. PKGCONFIGDIR=\$(DESTDIR)$pkgconfigdir
  6663. INSTALL_NAME_DIR=$install_name_dir
  6664. SRC_PATH=$source_path
  6665. SRC_LINK=$source_link
  6666. ifndef MAIN_MAKEFILE
  6667. SRC_PATH:=\$(SRC_PATH:.%=..%)
  6668. endif
  6669. CC_IDENT=$cc_ident
  6670. ARCH=$arch
  6671. INTRINSICS=$intrinsics
  6672. EXTERN_PREFIX=$extern_prefix
  6673. CC=$cc
  6674. CXX=$cxx
  6675. AS=$as
  6676. OBJCC=$objcc
  6677. LD=$ld
  6678. DEPCC=$dep_cc
  6679. DEPCCFLAGS=$DEPCCFLAGS \$(CPPFLAGS)
  6680. DEPAS=$as
  6681. DEPASFLAGS=$DEPASFLAGS \$(CPPFLAGS)
  6682. X86ASM=$x86asmexe
  6683. DEPX86ASM=$x86asmexe
  6684. DEPX86ASMFLAGS=\$(X86ASMFLAGS)
  6685. AR=$ar
  6686. ARFLAGS=$arflags
  6687. AR_O=$ar_o
  6688. AR_CMD=$ar
  6689. NM_CMD=$nm
  6690. RANLIB=$ranlib
  6691. STRIP=$strip
  6692. STRIPTYPE=$striptype
  6693. NVCC=$nvcc
  6694. CP=cp -p
  6695. LN_S=$ln_s
  6696. CPPFLAGS=$CPPFLAGS
  6697. CFLAGS=$CFLAGS
  6698. CXXFLAGS=$CXXFLAGS
  6699. OBJCFLAGS=$OBJCFLAGS
  6700. ASFLAGS=$ASFLAGS
  6701. NVCCFLAGS=$nvccflags
  6702. AS_C=$AS_C
  6703. AS_O=$AS_O
  6704. OBJCC_C=$OBJCC_C
  6705. OBJCC_E=$OBJCC_E
  6706. OBJCC_O=$OBJCC_O
  6707. CC_C=$CC_C
  6708. CC_E=$CC_E
  6709. CC_O=$CC_O
  6710. CXX_C=$CXX_C
  6711. CXX_O=$CXX_O
  6712. NVCC_C=$NVCC_C
  6713. NVCC_O=$NVCC_O
  6714. LD_O=$LD_O
  6715. X86ASM_O=$X86ASM_O
  6716. LD_LIB=$LD_LIB
  6717. LD_PATH=$LD_PATH
  6718. DLLTOOL=$dlltool
  6719. WINDRES=$windres
  6720. DEPWINDRES=$dep_cc
  6721. DOXYGEN=$doxygen
  6722. LDFLAGS=$LDFLAGS
  6723. LDEXEFLAGS=$LDEXEFLAGS
  6724. LDSOFLAGS=$LDSOFLAGS
  6725. SHFLAGS=$(echo $($ldflags_filter $SHFLAGS))
  6726. ASMSTRIPFLAGS=$ASMSTRIPFLAGS
  6727. X86ASMFLAGS=$X86ASMFLAGS
  6728. BUILDSUF=$build_suffix
  6729. PROGSSUF=$progs_suffix
  6730. FULLNAME=$FULLNAME
  6731. LIBPREF=$LIBPREF
  6732. LIBSUF=$LIBSUF
  6733. LIBNAME=$LIBNAME
  6734. SLIBPREF=$SLIBPREF
  6735. SLIBSUF=$SLIBSUF
  6736. EXESUF=$EXESUF
  6737. EXTRA_VERSION=$extra_version
  6738. CCDEP=$CCDEP
  6739. CXXDEP=$CXXDEP
  6740. CCDEP_FLAGS=$CCDEP_FLAGS
  6741. ASDEP=$ASDEP
  6742. ASDEP_FLAGS=$ASDEP_FLAGS
  6743. X86ASMDEP=$X86ASMDEP
  6744. X86ASMDEP_FLAGS=$X86ASMDEP_FLAGS
  6745. CC_DEPFLAGS=$CC_DEPFLAGS
  6746. AS_DEPFLAGS=$AS_DEPFLAGS
  6747. X86ASM_DEPFLAGS=$X86ASM_DEPFLAGS
  6748. HOSTCC=$host_cc
  6749. HOSTLD=$host_ld
  6750. HOSTCFLAGS=$host_cflags
  6751. HOSTCPPFLAGS=$host_cppflags
  6752. HOSTEXESUF=$HOSTEXESUF
  6753. HOSTLDFLAGS=$host_ldflags
  6754. HOSTEXTRALIBS=$host_extralibs
  6755. DEPHOSTCC=$host_cc
  6756. DEPHOSTCCFLAGS=$DEPHOSTCCFLAGS \$(HOSTCCFLAGS)
  6757. HOSTCCDEP=$HOSTCCDEP
  6758. HOSTCCDEP_FLAGS=$HOSTCCDEP_FLAGS
  6759. HOSTCC_DEPFLAGS=$HOSTCC_DEPFLAGS
  6760. HOSTCC_C=$HOSTCC_C
  6761. HOSTCC_O=$HOSTCC_O
  6762. HOSTLD_O=$HOSTLD_O
  6763. TARGET_EXEC=$target_exec $target_exec_args
  6764. TARGET_PATH=$target_path
  6765. TARGET_SAMPLES=${target_samples:-\$(SAMPLES)}
  6766. CFLAGS-ffplay=${sdl2_cflags}
  6767. CFLAGS_HEADERS=$CFLAGS_HEADERS
  6768. LIB_INSTALL_EXTRA_CMD=$LIB_INSTALL_EXTRA_CMD
  6769. EXTRALIBS=$extralibs
  6770. COMPAT_OBJS=$compat_objs
  6771. INSTALL=$install
  6772. LIBTARGET=${LIBTARGET}
  6773. SLIBNAME=${SLIBNAME}
  6774. SLIBNAME_WITH_VERSION=${SLIBNAME_WITH_VERSION}
  6775. SLIBNAME_WITH_MAJOR=${SLIBNAME_WITH_MAJOR}
  6776. SLIB_CREATE_DEF_CMD=${SLIB_CREATE_DEF_CMD}
  6777. SLIB_EXTRA_CMD=${SLIB_EXTRA_CMD}
  6778. SLIB_INSTALL_NAME=${SLIB_INSTALL_NAME}
  6779. SLIB_INSTALL_LINKS=${SLIB_INSTALL_LINKS}
  6780. SLIB_INSTALL_EXTRA_LIB=${SLIB_INSTALL_EXTRA_LIB}
  6781. SLIB_INSTALL_EXTRA_SHLIB=${SLIB_INSTALL_EXTRA_SHLIB}
  6782. VERSION_SCRIPT_POSTPROCESS_CMD=${VERSION_SCRIPT_POSTPROCESS_CMD}
  6783. SAMPLES:=${samples:-\$(FATE_SAMPLES)}
  6784. NOREDZONE_FLAGS=$noredzone_flags
  6785. LIBFUZZER_PATH=$libfuzzer_path
  6786. IGNORE_TESTS=$ignore_tests
  6787. EOF
  6788. map 'eval echo "${v}_FFLIBS=\$${v}_deps" >> ffbuild/config.mak' $LIBRARY_LIST
  6789. for entry in $LIBRARY_LIST $PROGRAM_LIST $EXTRALIBS_LIST; do
  6790. eval echo "EXTRALIBS-${entry}=\$${entry}_extralibs" >> ffbuild/config.mak
  6791. done
  6792. cat > $TMPH <<EOF
  6793. /* Automatically generated by configure - do not modify! */
  6794. #ifndef FFMPEG_CONFIG_H
  6795. #define FFMPEG_CONFIG_H
  6796. #define FFMPEG_CONFIGURATION "$(c_escape $FFMPEG_CONFIGURATION)"
  6797. #define FFMPEG_LICENSE "$(c_escape $license)"
  6798. #define CONFIG_THIS_YEAR 2019
  6799. #define FFMPEG_DATADIR "$(eval c_escape $datadir)"
  6800. #define AVCONV_DATADIR "$(eval c_escape $datadir)"
  6801. #define CC_IDENT "$(c_escape ${cc_ident:-Unknown compiler})"
  6802. #define av_restrict $restrict_keyword
  6803. #define EXTERN_PREFIX "${extern_prefix}"
  6804. #define EXTERN_ASM ${extern_prefix}
  6805. #define BUILDSUF "$build_suffix"
  6806. #define SLIBSUF "$SLIBSUF"
  6807. #define HAVE_MMX2 HAVE_MMXEXT
  6808. #define SWS_MAX_FILTER_SIZE $sws_max_filter_size
  6809. EOF
  6810. test -n "$assert_level" &&
  6811. echo "#define ASSERT_LEVEL $assert_level" >>$TMPH
  6812. test -n "$malloc_prefix" &&
  6813. echo "#define MALLOC_PREFIX $malloc_prefix" >>$TMPH
  6814. if enabled x86asm; then
  6815. append config_files $TMPASM
  6816. cat > $TMPASM <<EOF
  6817. ; Automatically generated by configure - do not modify!
  6818. EOF
  6819. fi
  6820. enabled getenv || echo "#define getenv(x) NULL" >> $TMPH
  6821. mkdir -p doc
  6822. mkdir -p tests
  6823. mkdir -p tests/api
  6824. echo "@c auto-generated by configure - do not modify! " > doc/config.texi
  6825. print_config ARCH_ "$config_files" $ARCH_LIST
  6826. print_config HAVE_ "$config_files" $HAVE_LIST
  6827. print_config CONFIG_ "$config_files" $CONFIG_LIST \
  6828. $CONFIG_EXTRA \
  6829. $ALL_COMPONENTS \
  6830. echo "#endif /* FFMPEG_CONFIG_H */" >> $TMPH
  6831. echo "endif # FFMPEG_CONFIG_MAK" >> ffbuild/config.mak
  6832. # Do not overwrite an unchanged config.h to avoid superfluous rebuilds.
  6833. cp_if_changed $TMPH config.h
  6834. touch ffbuild/.config
  6835. enabled x86asm && cp_if_changed $TMPASM config.asm
  6836. cat > $TMPH <<EOF
  6837. /* Generated by ffmpeg configure */
  6838. #ifndef AVUTIL_AVCONFIG_H
  6839. #define AVUTIL_AVCONFIG_H
  6840. EOF
  6841. print_config AV_HAVE_ $TMPH $HAVE_LIST_PUB
  6842. echo "#endif /* AVUTIL_AVCONFIG_H */" >> $TMPH
  6843. cp_if_changed $TMPH libavutil/avconfig.h
  6844. # full_filter_name_foo=vf_foo
  6845. # full_filter_name_bar=asrc_bar
  6846. # ...
  6847. eval "$(sed -n "s/^extern AVFilter ff_\([avfsinkrc]\{2,5\}\)_\(.*\);/full_filter_name_\2=\1_\2/p" $source_path/libavfilter/allfilters.c)"
  6848. # generate the lists of enabled components
  6849. print_enabled_components(){
  6850. file=$1
  6851. struct_name=$2
  6852. name=$3
  6853. shift 3
  6854. echo "static const $struct_name * const $name[] = {" > $TMPH
  6855. for c in $*; do
  6856. if enabled $c; then
  6857. case $name in
  6858. filter_list)
  6859. eval c=\$full_filter_name_${c%_filter}
  6860. ;;
  6861. indev_list)
  6862. c=${c%_indev}_demuxer
  6863. ;;
  6864. outdev_list)
  6865. c=${c%_outdev}_muxer
  6866. ;;
  6867. esac
  6868. printf " &ff_%s,\n" $c >> $TMPH
  6869. fi
  6870. done
  6871. if [ "$name" = "filter_list" ]; then
  6872. for c in asrc_abuffer vsrc_buffer asink_abuffer vsink_buffer; do
  6873. printf " &ff_%s,\n" $c >> $TMPH
  6874. done
  6875. fi
  6876. echo " NULL };" >> $TMPH
  6877. cp_if_changed $TMPH $file
  6878. }
  6879. print_enabled_components libavfilter/filter_list.c AVFilter filter_list $FILTER_LIST
  6880. print_enabled_components libavcodec/codec_list.c AVCodec codec_list $CODEC_LIST
  6881. print_enabled_components libavcodec/parser_list.c AVCodecParser parser_list $PARSER_LIST
  6882. print_enabled_components libavcodec/bsf_list.c AVBitStreamFilter bitstream_filters $BSF_LIST
  6883. print_enabled_components libavformat/demuxer_list.c AVInputFormat demuxer_list $DEMUXER_LIST
  6884. print_enabled_components libavformat/muxer_list.c AVOutputFormat muxer_list $MUXER_LIST
  6885. print_enabled_components libavdevice/indev_list.c AVInputFormat indev_list $INDEV_LIST
  6886. print_enabled_components libavdevice/outdev_list.c AVOutputFormat outdev_list $OUTDEV_LIST
  6887. print_enabled_components libavformat/protocol_list.c URLProtocol url_protocols $PROTOCOL_LIST
  6888. # Settings for pkg-config files
  6889. cat > $TMPH <<EOF
  6890. # Automatically generated by configure - do not modify!
  6891. shared=$shared
  6892. build_suffix=$build_suffix
  6893. prefix=$prefix
  6894. libdir=$libdir
  6895. incdir=$incdir
  6896. rpath=$(enabled rpath && echo "-Wl,-rpath,\${libdir}")
  6897. source_path=${source_path}
  6898. LIBPREF=${LIBPREF}
  6899. LIBSUF=${LIBSUF}
  6900. extralibs_avutil="$avutil_extralibs"
  6901. extralibs_avcodec="$avcodec_extralibs"
  6902. extralibs_avformat="$avformat_extralibs"
  6903. extralibs_avdevice="$avdevice_extralibs"
  6904. extralibs_avfilter="$avfilter_extralibs"
  6905. extralibs_avresample="$avresample_extralibs"
  6906. extralibs_postproc="$postproc_extralibs"
  6907. extralibs_swscale="$swscale_extralibs"
  6908. extralibs_swresample="$swresample_extralibs"
  6909. EOF
  6910. for lib in $LIBRARY_LIST; do
  6911. lib_deps="$(eval echo \$${lib}_deps)"
  6912. echo ${lib}_deps=\"$lib_deps\" >> $TMPH
  6913. done
  6914. cp_if_changed $TMPH ffbuild/config.sh