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.

7494 lines
245KB

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