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.

7642 lines
251KB

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