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.

7688 lines
252KB

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