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.

7640 lines
251KB

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