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.

7496 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. vp4_decoder_select="vp3_decoder"
  2585. vp5_decoder_select="h264chroma hpeldsp videodsp vp3dsp vp56dsp"
  2586. vp6_decoder_select="h264chroma hpeldsp huffman videodsp vp3dsp vp56dsp"
  2587. vp6a_decoder_select="vp6_decoder"
  2588. vp6f_decoder_select="vp6_decoder"
  2589. vp7_decoder_select="h264pred videodsp vp8dsp"
  2590. vp8_decoder_select="h264pred videodsp vp8dsp"
  2591. vp9_decoder_select="videodsp vp9_parser vp9_superframe_split_bsf"
  2592. wcmv_decoder_deps="zlib"
  2593. webp_decoder_select="vp8_decoder exif"
  2594. wmalossless_decoder_select="llauddsp"
  2595. wmapro_decoder_select="mdct sinewin wma_freqs"
  2596. wmav1_decoder_select="mdct sinewin wma_freqs"
  2597. wmav1_encoder_select="mdct sinewin wma_freqs"
  2598. wmav2_decoder_select="mdct sinewin wma_freqs"
  2599. wmav2_encoder_select="mdct sinewin wma_freqs"
  2600. wmavoice_decoder_select="lsp rdft dct mdct sinewin"
  2601. wmv1_decoder_select="h263_decoder"
  2602. wmv1_encoder_select="h263_encoder"
  2603. wmv2_decoder_select="blockdsp error_resilience h263_decoder idctdsp intrax8 videodsp wmv2dsp"
  2604. wmv2_encoder_select="h263_encoder wmv2dsp"
  2605. wmv3_decoder_select="vc1_decoder"
  2606. wmv3image_decoder_select="wmv3_decoder"
  2607. xma1_decoder_select="wmapro_decoder"
  2608. xma2_decoder_select="wmapro_decoder"
  2609. zerocodec_decoder_deps="zlib"
  2610. zlib_decoder_deps="zlib"
  2611. zlib_encoder_deps="zlib"
  2612. zmbv_decoder_deps="zlib"
  2613. zmbv_encoder_deps="zlib"
  2614. # hardware accelerators
  2615. crystalhd_deps="libcrystalhd_libcrystalhd_if_h"
  2616. cuda_deps="ffnvcodec"
  2617. cuvid_deps="ffnvcodec"
  2618. d3d11va_deps="dxva_h ID3D11VideoDecoder ID3D11VideoContext"
  2619. dxva2_deps="dxva2api_h DXVA2_ConfigPictureDecode ole32 user32"
  2620. ffnvcodec_deps_any="libdl LoadLibrary"
  2621. nvdec_deps="ffnvcodec"
  2622. vaapi_x11_deps="xlib"
  2623. videotoolbox_hwaccel_deps="videotoolbox pthreads"
  2624. videotoolbox_hwaccel_extralibs="-framework QuartzCore"
  2625. xvmc_deps="X11_extensions_XvMClib_h"
  2626. h263_vaapi_hwaccel_deps="vaapi"
  2627. h263_vaapi_hwaccel_select="h263_decoder"
  2628. h263_videotoolbox_hwaccel_deps="videotoolbox"
  2629. h263_videotoolbox_hwaccel_select="h263_decoder"
  2630. h264_d3d11va_hwaccel_deps="d3d11va"
  2631. h264_d3d11va_hwaccel_select="h264_decoder"
  2632. h264_d3d11va2_hwaccel_deps="d3d11va"
  2633. h264_d3d11va2_hwaccel_select="h264_decoder"
  2634. h264_dxva2_hwaccel_deps="dxva2"
  2635. h264_dxva2_hwaccel_select="h264_decoder"
  2636. h264_nvdec_hwaccel_deps="nvdec"
  2637. h264_nvdec_hwaccel_select="h264_decoder"
  2638. h264_vaapi_hwaccel_deps="vaapi"
  2639. h264_vaapi_hwaccel_select="h264_decoder"
  2640. h264_vdpau_hwaccel_deps="vdpau"
  2641. h264_vdpau_hwaccel_select="h264_decoder"
  2642. h264_videotoolbox_hwaccel_deps="videotoolbox"
  2643. h264_videotoolbox_hwaccel_select="h264_decoder"
  2644. hevc_d3d11va_hwaccel_deps="d3d11va DXVA_PicParams_HEVC"
  2645. hevc_d3d11va_hwaccel_select="hevc_decoder"
  2646. hevc_d3d11va2_hwaccel_deps="d3d11va DXVA_PicParams_HEVC"
  2647. hevc_d3d11va2_hwaccel_select="hevc_decoder"
  2648. hevc_dxva2_hwaccel_deps="dxva2 DXVA_PicParams_HEVC"
  2649. hevc_dxva2_hwaccel_select="hevc_decoder"
  2650. hevc_nvdec_hwaccel_deps="nvdec"
  2651. hevc_nvdec_hwaccel_select="hevc_decoder"
  2652. hevc_vaapi_hwaccel_deps="vaapi VAPictureParameterBufferHEVC"
  2653. hevc_vaapi_hwaccel_select="hevc_decoder"
  2654. hevc_vdpau_hwaccel_deps="vdpau VdpPictureInfoHEVC"
  2655. hevc_vdpau_hwaccel_select="hevc_decoder"
  2656. hevc_videotoolbox_hwaccel_deps="videotoolbox"
  2657. hevc_videotoolbox_hwaccel_select="hevc_decoder"
  2658. mjpeg_nvdec_hwaccel_deps="nvdec"
  2659. mjpeg_nvdec_hwaccel_select="mjpeg_decoder"
  2660. mjpeg_vaapi_hwaccel_deps="vaapi"
  2661. mjpeg_vaapi_hwaccel_select="mjpeg_decoder"
  2662. mpeg_xvmc_hwaccel_deps="xvmc"
  2663. mpeg_xvmc_hwaccel_select="mpeg2video_decoder"
  2664. mpeg1_nvdec_hwaccel_deps="nvdec"
  2665. mpeg1_nvdec_hwaccel_select="mpeg1video_decoder"
  2666. mpeg1_vdpau_hwaccel_deps="vdpau"
  2667. mpeg1_vdpau_hwaccel_select="mpeg1video_decoder"
  2668. mpeg1_videotoolbox_hwaccel_deps="videotoolbox"
  2669. mpeg1_videotoolbox_hwaccel_select="mpeg1video_decoder"
  2670. mpeg1_xvmc_hwaccel_deps="xvmc"
  2671. mpeg1_xvmc_hwaccel_select="mpeg1video_decoder"
  2672. mpeg2_d3d11va_hwaccel_deps="d3d11va"
  2673. mpeg2_d3d11va_hwaccel_select="mpeg2video_decoder"
  2674. mpeg2_d3d11va2_hwaccel_deps="d3d11va"
  2675. mpeg2_d3d11va2_hwaccel_select="mpeg2video_decoder"
  2676. mpeg2_dxva2_hwaccel_deps="dxva2"
  2677. mpeg2_dxva2_hwaccel_select="mpeg2video_decoder"
  2678. mpeg2_nvdec_hwaccel_deps="nvdec"
  2679. mpeg2_nvdec_hwaccel_select="mpeg2video_decoder"
  2680. mpeg2_vaapi_hwaccel_deps="vaapi"
  2681. mpeg2_vaapi_hwaccel_select="mpeg2video_decoder"
  2682. mpeg2_vdpau_hwaccel_deps="vdpau"
  2683. mpeg2_vdpau_hwaccel_select="mpeg2video_decoder"
  2684. mpeg2_videotoolbox_hwaccel_deps="videotoolbox"
  2685. mpeg2_videotoolbox_hwaccel_select="mpeg2video_decoder"
  2686. mpeg2_xvmc_hwaccel_deps="xvmc"
  2687. mpeg2_xvmc_hwaccel_select="mpeg2video_decoder"
  2688. mpeg4_nvdec_hwaccel_deps="nvdec"
  2689. mpeg4_nvdec_hwaccel_select="mpeg4_decoder"
  2690. mpeg4_vaapi_hwaccel_deps="vaapi"
  2691. mpeg4_vaapi_hwaccel_select="mpeg4_decoder"
  2692. mpeg4_vdpau_hwaccel_deps="vdpau"
  2693. mpeg4_vdpau_hwaccel_select="mpeg4_decoder"
  2694. mpeg4_videotoolbox_hwaccel_deps="videotoolbox"
  2695. mpeg4_videotoolbox_hwaccel_select="mpeg4_decoder"
  2696. vc1_d3d11va_hwaccel_deps="d3d11va"
  2697. vc1_d3d11va_hwaccel_select="vc1_decoder"
  2698. vc1_d3d11va2_hwaccel_deps="d3d11va"
  2699. vc1_d3d11va2_hwaccel_select="vc1_decoder"
  2700. vc1_dxva2_hwaccel_deps="dxva2"
  2701. vc1_dxva2_hwaccel_select="vc1_decoder"
  2702. vc1_nvdec_hwaccel_deps="nvdec"
  2703. vc1_nvdec_hwaccel_select="vc1_decoder"
  2704. vc1_vaapi_hwaccel_deps="vaapi"
  2705. vc1_vaapi_hwaccel_select="vc1_decoder"
  2706. vc1_vdpau_hwaccel_deps="vdpau"
  2707. vc1_vdpau_hwaccel_select="vc1_decoder"
  2708. vp8_nvdec_hwaccel_deps="nvdec"
  2709. vp8_nvdec_hwaccel_select="vp8_decoder"
  2710. vp8_vaapi_hwaccel_deps="vaapi"
  2711. vp8_vaapi_hwaccel_select="vp8_decoder"
  2712. vp9_d3d11va_hwaccel_deps="d3d11va DXVA_PicParams_VP9"
  2713. vp9_d3d11va_hwaccel_select="vp9_decoder"
  2714. vp9_d3d11va2_hwaccel_deps="d3d11va DXVA_PicParams_VP9"
  2715. vp9_d3d11va2_hwaccel_select="vp9_decoder"
  2716. vp9_dxva2_hwaccel_deps="dxva2 DXVA_PicParams_VP9"
  2717. vp9_dxva2_hwaccel_select="vp9_decoder"
  2718. vp9_nvdec_hwaccel_deps="nvdec"
  2719. vp9_nvdec_hwaccel_select="vp9_decoder"
  2720. vp9_vaapi_hwaccel_deps="vaapi VADecPictureParameterBufferVP9_bit_depth"
  2721. vp9_vaapi_hwaccel_select="vp9_decoder"
  2722. wmv3_d3d11va_hwaccel_select="vc1_d3d11va_hwaccel"
  2723. wmv3_d3d11va2_hwaccel_select="vc1_d3d11va2_hwaccel"
  2724. wmv3_dxva2_hwaccel_select="vc1_dxva2_hwaccel"
  2725. wmv3_nvdec_hwaccel_select="vc1_nvdec_hwaccel"
  2726. wmv3_vaapi_hwaccel_select="vc1_vaapi_hwaccel"
  2727. wmv3_vdpau_hwaccel_select="vc1_vdpau_hwaccel"
  2728. # hardware-accelerated codecs
  2729. omx_deps="libdl pthreads"
  2730. omx_rpi_select="omx"
  2731. qsv_deps="libmfx"
  2732. qsvdec_select="qsv"
  2733. qsvenc_select="qsv"
  2734. qsvvpp_select="qsv"
  2735. vaapi_encode_deps="vaapi"
  2736. v4l2_m2m_deps="linux_videodev2_h sem_timedwait"
  2737. hwupload_cuda_filter_deps="ffnvcodec"
  2738. scale_npp_filter_deps="ffnvcodec libnpp"
  2739. scale_cuda_filter_deps="ffnvcodec cuda_nvcc"
  2740. thumbnail_cuda_filter_deps="ffnvcodec cuda_nvcc"
  2741. transpose_npp_filter_deps="ffnvcodec libnpp"
  2742. amf_deps_any="libdl LoadLibrary"
  2743. nvenc_deps="ffnvcodec"
  2744. nvenc_deps_any="libdl LoadLibrary"
  2745. nvenc_encoder_deps="nvenc"
  2746. h263_v4l2m2m_decoder_deps="v4l2_m2m h263_v4l2_m2m"
  2747. h263_v4l2m2m_encoder_deps="v4l2_m2m h263_v4l2_m2m"
  2748. h264_amf_encoder_deps="amf"
  2749. h264_crystalhd_decoder_select="crystalhd h264_mp4toannexb_bsf h264_parser"
  2750. h264_cuvid_decoder_deps="cuvid"
  2751. h264_cuvid_decoder_select="h264_mp4toannexb_bsf"
  2752. h264_mediacodec_decoder_deps="mediacodec"
  2753. h264_mediacodec_decoder_select="h264_mp4toannexb_bsf h264_parser"
  2754. h264_mmal_decoder_deps="mmal"
  2755. h264_nvenc_encoder_deps="nvenc"
  2756. h264_omx_encoder_deps="omx"
  2757. h264_qsv_decoder_select="h264_mp4toannexb_bsf h264_parser qsvdec"
  2758. h264_qsv_encoder_select="qsvenc"
  2759. h264_rkmpp_decoder_deps="rkmpp"
  2760. h264_rkmpp_decoder_select="h264_mp4toannexb_bsf"
  2761. h264_vaapi_encoder_select="cbs_h264 vaapi_encode"
  2762. h264_v4l2m2m_decoder_deps="v4l2_m2m h264_v4l2_m2m"
  2763. h264_v4l2m2m_decoder_select="h264_mp4toannexb_bsf"
  2764. h264_v4l2m2m_encoder_deps="v4l2_m2m h264_v4l2_m2m"
  2765. hevc_amf_encoder_deps="amf"
  2766. hevc_cuvid_decoder_deps="cuvid"
  2767. hevc_cuvid_decoder_select="hevc_mp4toannexb_bsf"
  2768. hevc_mediacodec_decoder_deps="mediacodec"
  2769. hevc_mediacodec_decoder_select="hevc_mp4toannexb_bsf hevc_parser"
  2770. hevc_nvenc_encoder_deps="nvenc"
  2771. hevc_qsv_decoder_select="hevc_mp4toannexb_bsf hevc_parser qsvdec"
  2772. hevc_qsv_encoder_select="hevcparse qsvenc"
  2773. hevc_rkmpp_decoder_deps="rkmpp"
  2774. hevc_rkmpp_decoder_select="hevc_mp4toannexb_bsf"
  2775. hevc_vaapi_encoder_deps="VAEncPictureParameterBufferHEVC"
  2776. hevc_vaapi_encoder_select="cbs_h265 vaapi_encode"
  2777. hevc_v4l2m2m_decoder_deps="v4l2_m2m hevc_v4l2_m2m"
  2778. hevc_v4l2m2m_decoder_select="hevc_mp4toannexb_bsf"
  2779. hevc_v4l2m2m_encoder_deps="v4l2_m2m hevc_v4l2_m2m"
  2780. mjpeg_cuvid_decoder_deps="cuvid"
  2781. mjpeg_qsv_encoder_deps="libmfx"
  2782. mjpeg_qsv_encoder_select="qsvenc"
  2783. mjpeg_vaapi_encoder_deps="VAEncPictureParameterBufferJPEG"
  2784. mjpeg_vaapi_encoder_select="cbs_jpeg jpegtables vaapi_encode"
  2785. mpeg1_cuvid_decoder_deps="cuvid"
  2786. mpeg1_v4l2m2m_decoder_deps="v4l2_m2m mpeg1_v4l2_m2m"
  2787. mpeg2_crystalhd_decoder_select="crystalhd"
  2788. mpeg2_cuvid_decoder_deps="cuvid"
  2789. mpeg2_mmal_decoder_deps="mmal"
  2790. mpeg2_mediacodec_decoder_deps="mediacodec"
  2791. mpeg2_qsv_decoder_select="qsvdec mpegvideo_parser"
  2792. mpeg2_qsv_encoder_select="qsvenc"
  2793. mpeg2_vaapi_encoder_select="cbs_mpeg2 vaapi_encode"
  2794. mpeg2_v4l2m2m_decoder_deps="v4l2_m2m mpeg2_v4l2_m2m"
  2795. mpeg4_crystalhd_decoder_select="crystalhd"
  2796. mpeg4_cuvid_decoder_deps="cuvid"
  2797. mpeg4_mediacodec_decoder_deps="mediacodec"
  2798. mpeg4_mmal_decoder_deps="mmal"
  2799. mpeg4_omx_encoder_deps="omx"
  2800. mpeg4_v4l2m2m_decoder_deps="v4l2_m2m mpeg4_v4l2_m2m"
  2801. mpeg4_v4l2m2m_encoder_deps="v4l2_m2m mpeg4_v4l2_m2m"
  2802. msmpeg4_crystalhd_decoder_select="crystalhd"
  2803. nvenc_h264_encoder_select="h264_nvenc_encoder"
  2804. nvenc_hevc_encoder_select="hevc_nvenc_encoder"
  2805. vc1_crystalhd_decoder_select="crystalhd"
  2806. vc1_cuvid_decoder_deps="cuvid"
  2807. vc1_mmal_decoder_deps="mmal"
  2808. vc1_qsv_decoder_select="qsvdec vc1_parser"
  2809. vc1_v4l2m2m_decoder_deps="v4l2_m2m vc1_v4l2_m2m"
  2810. vp8_cuvid_decoder_deps="cuvid"
  2811. vp8_mediacodec_decoder_deps="mediacodec"
  2812. vp8_qsv_decoder_select="qsvdec vp8_parser"
  2813. vp8_rkmpp_decoder_deps="rkmpp"
  2814. vp8_vaapi_encoder_deps="VAEncPictureParameterBufferVP8"
  2815. vp8_vaapi_encoder_select="vaapi_encode"
  2816. vp8_v4l2m2m_decoder_deps="v4l2_m2m vp8_v4l2_m2m"
  2817. vp8_v4l2m2m_encoder_deps="v4l2_m2m vp8_v4l2_m2m"
  2818. vp9_cuvid_decoder_deps="cuvid"
  2819. vp9_mediacodec_decoder_deps="mediacodec"
  2820. vp9_rkmpp_decoder_deps="rkmpp"
  2821. vp9_vaapi_encoder_deps="VAEncPictureParameterBufferVP9"
  2822. vp9_vaapi_encoder_select="vaapi_encode"
  2823. vp9_v4l2m2m_decoder_deps="v4l2_m2m vp9_v4l2_m2m"
  2824. wmv3_crystalhd_decoder_select="crystalhd"
  2825. # parsers
  2826. aac_parser_select="adts_header"
  2827. av1_parser_select="cbs_av1"
  2828. h264_parser_select="golomb h264dsp h264parse"
  2829. hevc_parser_select="hevcparse"
  2830. mpegaudio_parser_select="mpegaudioheader"
  2831. mpegvideo_parser_select="mpegvideo"
  2832. mpeg4video_parser_select="h263dsp mpegvideo qpeldsp"
  2833. vc1_parser_select="vc1dsp"
  2834. # bitstream_filters
  2835. aac_adtstoasc_bsf_select="adts_header"
  2836. av1_frame_split_bsf_select="cbs_av1"
  2837. av1_metadata_bsf_select="cbs_av1"
  2838. eac3_core_bsf_select="ac3_parser"
  2839. filter_units_bsf_select="cbs"
  2840. h264_metadata_bsf_deps="const_nan"
  2841. h264_metadata_bsf_select="cbs_h264"
  2842. h264_redundant_pps_bsf_select="cbs_h264"
  2843. hevc_metadata_bsf_select="cbs_h265"
  2844. mjpeg2jpeg_bsf_select="jpegtables"
  2845. mpeg2_metadata_bsf_select="cbs_mpeg2"
  2846. trace_headers_bsf_select="cbs"
  2847. vp9_metadata_bsf_select="cbs_vp9"
  2848. # external libraries
  2849. aac_at_decoder_deps="audiotoolbox"
  2850. aac_at_decoder_select="aac_adtstoasc_bsf"
  2851. ac3_at_decoder_deps="audiotoolbox"
  2852. ac3_at_decoder_select="ac3_parser"
  2853. adpcm_ima_qt_at_decoder_deps="audiotoolbox"
  2854. alac_at_decoder_deps="audiotoolbox"
  2855. amr_nb_at_decoder_deps="audiotoolbox"
  2856. avisynth_deps_any="libdl LoadLibrary"
  2857. avisynth_demuxer_deps="avisynth"
  2858. avisynth_demuxer_select="riffdec"
  2859. eac3_at_decoder_deps="audiotoolbox"
  2860. eac3_at_decoder_select="ac3_parser"
  2861. gsm_ms_at_decoder_deps="audiotoolbox"
  2862. ilbc_at_decoder_deps="audiotoolbox"
  2863. mp1_at_decoder_deps="audiotoolbox"
  2864. mp2_at_decoder_deps="audiotoolbox"
  2865. mp3_at_decoder_deps="audiotoolbox"
  2866. mp1_at_decoder_select="mpegaudioheader"
  2867. mp2_at_decoder_select="mpegaudioheader"
  2868. mp3_at_decoder_select="mpegaudioheader"
  2869. pcm_alaw_at_decoder_deps="audiotoolbox"
  2870. pcm_mulaw_at_decoder_deps="audiotoolbox"
  2871. qdmc_at_decoder_deps="audiotoolbox"
  2872. qdm2_at_decoder_deps="audiotoolbox"
  2873. aac_at_encoder_deps="audiotoolbox"
  2874. aac_at_encoder_select="audio_frame_queue"
  2875. alac_at_encoder_deps="audiotoolbox"
  2876. alac_at_encoder_select="audio_frame_queue"
  2877. ilbc_at_encoder_deps="audiotoolbox"
  2878. ilbc_at_encoder_select="audio_frame_queue"
  2879. pcm_alaw_at_encoder_deps="audiotoolbox"
  2880. pcm_alaw_at_encoder_select="audio_frame_queue"
  2881. pcm_mulaw_at_encoder_deps="audiotoolbox"
  2882. pcm_mulaw_at_encoder_select="audio_frame_queue"
  2883. chromaprint_muxer_deps="chromaprint"
  2884. h264_videotoolbox_encoder_deps="pthreads"
  2885. h264_videotoolbox_encoder_select="videotoolbox_encoder"
  2886. hevc_videotoolbox_encoder_deps="pthreads"
  2887. hevc_videotoolbox_encoder_select="videotoolbox_encoder"
  2888. libaom_av1_decoder_deps="libaom"
  2889. libaom_av1_encoder_deps="libaom"
  2890. libaom_av1_encoder_select="extract_extradata_bsf"
  2891. libaribb24_decoder_deps="libaribb24"
  2892. libcelt_decoder_deps="libcelt"
  2893. libcodec2_decoder_deps="libcodec2"
  2894. libcodec2_encoder_deps="libcodec2"
  2895. libdav1d_decoder_deps="libdav1d"
  2896. libdavs2_decoder_deps="libdavs2"
  2897. libfdk_aac_decoder_deps="libfdk_aac"
  2898. libfdk_aac_encoder_deps="libfdk_aac"
  2899. libfdk_aac_encoder_select="audio_frame_queue"
  2900. libgme_demuxer_deps="libgme"
  2901. libgsm_decoder_deps="libgsm"
  2902. libgsm_encoder_deps="libgsm"
  2903. libgsm_ms_decoder_deps="libgsm"
  2904. libgsm_ms_encoder_deps="libgsm"
  2905. libilbc_decoder_deps="libilbc"
  2906. libilbc_encoder_deps="libilbc"
  2907. libkvazaar_encoder_deps="libkvazaar"
  2908. libmodplug_demuxer_deps="libmodplug"
  2909. libmp3lame_encoder_deps="libmp3lame"
  2910. libmp3lame_encoder_select="audio_frame_queue mpegaudioheader"
  2911. libopencore_amrnb_decoder_deps="libopencore_amrnb"
  2912. libopencore_amrnb_encoder_deps="libopencore_amrnb"
  2913. libopencore_amrnb_encoder_select="audio_frame_queue"
  2914. libopencore_amrwb_decoder_deps="libopencore_amrwb"
  2915. libopenh264_decoder_deps="libopenh264"
  2916. libopenh264_decoder_select="h264_mp4toannexb_bsf"
  2917. libopenh264_encoder_deps="libopenh264"
  2918. libopenjpeg_decoder_deps="libopenjpeg"
  2919. libopenjpeg_encoder_deps="libopenjpeg"
  2920. libopenmpt_demuxer_deps="libopenmpt"
  2921. libopus_decoder_deps="libopus"
  2922. libopus_encoder_deps="libopus"
  2923. libopus_encoder_select="audio_frame_queue"
  2924. librsvg_decoder_deps="librsvg"
  2925. libshine_encoder_deps="libshine"
  2926. libshine_encoder_select="audio_frame_queue"
  2927. libspeex_decoder_deps="libspeex"
  2928. libspeex_encoder_deps="libspeex"
  2929. libspeex_encoder_select="audio_frame_queue"
  2930. libtheora_encoder_deps="libtheora"
  2931. libtwolame_encoder_deps="libtwolame"
  2932. libvo_amrwbenc_encoder_deps="libvo_amrwbenc"
  2933. libvorbis_decoder_deps="libvorbis"
  2934. libvorbis_encoder_deps="libvorbis libvorbisenc"
  2935. libvorbis_encoder_select="audio_frame_queue"
  2936. libvpx_vp8_decoder_deps="libvpx"
  2937. libvpx_vp8_encoder_deps="libvpx"
  2938. libvpx_vp9_decoder_deps="libvpx"
  2939. libvpx_vp9_encoder_deps="libvpx"
  2940. libwavpack_encoder_deps="libwavpack"
  2941. libwavpack_encoder_select="audio_frame_queue"
  2942. libwebp_encoder_deps="libwebp"
  2943. libwebp_anim_encoder_deps="libwebp"
  2944. libx262_encoder_deps="libx262"
  2945. libx264_encoder_deps="libx264"
  2946. libx264rgb_encoder_deps="libx264 x264_csp_bgr"
  2947. libx264rgb_encoder_select="libx264_encoder"
  2948. libx265_encoder_deps="libx265"
  2949. libxavs_encoder_deps="libxavs"
  2950. libxavs2_encoder_deps="libxavs2"
  2951. libxvid_encoder_deps="libxvid"
  2952. libzvbi_teletext_decoder_deps="libzvbi"
  2953. vapoursynth_demuxer_deps="vapoursynth"
  2954. videotoolbox_suggest="coreservices"
  2955. videotoolbox_deps="corefoundation coremedia corevideo"
  2956. videotoolbox_encoder_deps="videotoolbox VTCompressionSessionPrepareToEncodeFrames"
  2957. # demuxers / muxers
  2958. ac3_demuxer_select="ac3_parser"
  2959. aiff_muxer_select="iso_media"
  2960. asf_demuxer_select="riffdec"
  2961. asf_o_demuxer_select="riffdec"
  2962. asf_muxer_select="riffenc"
  2963. asf_stream_muxer_select="asf_muxer"
  2964. avi_demuxer_select="iso_media riffdec exif"
  2965. avi_muxer_select="riffenc"
  2966. caf_demuxer_select="iso_media riffdec"
  2967. caf_muxer_select="iso_media"
  2968. dash_muxer_select="mp4_muxer"
  2969. dash_demuxer_deps="libxml2"
  2970. dirac_demuxer_select="dirac_parser"
  2971. dts_demuxer_select="dca_parser"
  2972. dtshd_demuxer_select="dca_parser"
  2973. dv_demuxer_select="dvprofile"
  2974. dv_muxer_select="dvprofile"
  2975. dxa_demuxer_select="riffdec"
  2976. eac3_demuxer_select="ac3_parser"
  2977. f4v_muxer_select="mov_muxer"
  2978. fifo_muxer_deps="threads"
  2979. flac_demuxer_select="flac_parser"
  2980. hds_muxer_select="flv_muxer"
  2981. hls_muxer_select="mpegts_muxer"
  2982. hls_muxer_suggest="gcrypt openssl"
  2983. image2_alias_pix_demuxer_select="image2_demuxer"
  2984. image2_brender_pix_demuxer_select="image2_demuxer"
  2985. ipod_muxer_select="mov_muxer"
  2986. ismv_muxer_select="mov_muxer"
  2987. ivf_muxer_select="av1_metadata_bsf vp9_superframe_bsf"
  2988. matroska_audio_muxer_select="matroska_muxer"
  2989. matroska_demuxer_select="iso_media riffdec"
  2990. matroska_demuxer_suggest="bzlib lzo zlib"
  2991. matroska_muxer_select="iso_media riffenc"
  2992. mmf_muxer_select="riffenc"
  2993. mov_demuxer_select="iso_media riffdec"
  2994. mov_demuxer_suggest="zlib"
  2995. mov_muxer_select="iso_media riffenc rtpenc_chain"
  2996. mp3_demuxer_select="mpegaudio_parser"
  2997. mp3_muxer_select="mpegaudioheader"
  2998. mp4_muxer_select="mov_muxer"
  2999. mpegts_demuxer_select="iso_media"
  3000. mpegts_muxer_select="adts_muxer latm_muxer"
  3001. mpegtsraw_demuxer_select="mpegts_demuxer"
  3002. mxf_d10_muxer_select="mxf_muxer"
  3003. mxf_opatom_muxer_select="mxf_muxer"
  3004. nut_muxer_select="riffenc"
  3005. nuv_demuxer_select="riffdec"
  3006. oga_muxer_select="ogg_muxer"
  3007. ogg_demuxer_select="dirac_parse"
  3008. ogv_muxer_select="ogg_muxer"
  3009. opus_muxer_select="ogg_muxer"
  3010. psp_muxer_select="mov_muxer"
  3011. rtp_demuxer_select="sdp_demuxer"
  3012. rtp_muxer_select="golomb"
  3013. rtpdec_select="asf_demuxer jpegtables mov_demuxer mpegts_demuxer rm_demuxer rtp_protocol srtp"
  3014. rtsp_demuxer_select="http_protocol rtpdec"
  3015. rtsp_muxer_select="rtp_muxer http_protocol rtp_protocol rtpenc_chain"
  3016. sap_demuxer_select="sdp_demuxer"
  3017. sap_muxer_select="rtp_muxer rtp_protocol rtpenc_chain"
  3018. sdp_demuxer_select="rtpdec"
  3019. smoothstreaming_muxer_select="ismv_muxer"
  3020. spdif_demuxer_select="adts_header"
  3021. spdif_muxer_select="adts_header"
  3022. spx_muxer_select="ogg_muxer"
  3023. swf_demuxer_suggest="zlib"
  3024. tak_demuxer_select="tak_parser"
  3025. tg2_muxer_select="mov_muxer"
  3026. tgp_muxer_select="mov_muxer"
  3027. vobsub_demuxer_select="mpegps_demuxer"
  3028. w64_demuxer_select="wav_demuxer"
  3029. w64_muxer_select="wav_muxer"
  3030. wav_demuxer_select="riffdec"
  3031. wav_muxer_select="riffenc"
  3032. webm_muxer_select="iso_media riffenc"
  3033. webm_dash_manifest_demuxer_select="matroska_demuxer"
  3034. wtv_demuxer_select="mpegts_demuxer riffdec"
  3035. wtv_muxer_select="mpegts_muxer riffenc"
  3036. xmv_demuxer_select="riffdec"
  3037. xwma_demuxer_select="riffdec"
  3038. # indevs / outdevs
  3039. android_camera_indev_deps="android camera2ndk mediandk pthreads"
  3040. android_camera_indev_extralibs="-landroid -lcamera2ndk -lmediandk"
  3041. alsa_indev_deps="alsa"
  3042. alsa_outdev_deps="alsa"
  3043. avfoundation_indev_deps="avfoundation corevideo coremedia pthreads"
  3044. avfoundation_indev_suggest="coregraphics applicationservices"
  3045. avfoundation_indev_extralibs="-framework Foundation"
  3046. bktr_indev_deps_any="dev_bktr_ioctl_bt848_h machine_ioctl_bt848_h dev_video_bktr_ioctl_bt848_h dev_ic_bt8xx_h"
  3047. caca_outdev_deps="libcaca"
  3048. decklink_deps_any="libdl LoadLibrary"
  3049. decklink_indev_deps="decklink threads"
  3050. decklink_indev_extralibs="-lstdc++"
  3051. decklink_outdev_deps="decklink threads"
  3052. decklink_outdev_suggest="libklvanc"
  3053. decklink_outdev_extralibs="-lstdc++"
  3054. dshow_indev_deps="IBaseFilter"
  3055. dshow_indev_extralibs="-lpsapi -lole32 -lstrmiids -luuid -loleaut32 -lshlwapi"
  3056. fbdev_indev_deps="linux_fb_h"
  3057. fbdev_outdev_deps="linux_fb_h"
  3058. gdigrab_indev_deps="CreateDIBSection"
  3059. gdigrab_indev_extralibs="-lgdi32"
  3060. gdigrab_indev_select="bmp_decoder"
  3061. iec61883_indev_deps="libiec61883"
  3062. jack_indev_deps="libjack"
  3063. jack_indev_deps_any="sem_timedwait dispatch_dispatch_h"
  3064. kmsgrab_indev_deps="libdrm"
  3065. lavfi_indev_deps="avfilter"
  3066. libcdio_indev_deps="libcdio"
  3067. libdc1394_indev_deps="libdc1394"
  3068. openal_indev_deps="openal"
  3069. opengl_outdev_deps="opengl"
  3070. opengl_outdev_suggest="sdl2"
  3071. oss_indev_deps_any="sys_soundcard_h"
  3072. oss_outdev_deps_any="sys_soundcard_h"
  3073. pulse_indev_deps="libpulse"
  3074. pulse_outdev_deps="libpulse"
  3075. sdl2_outdev_deps="sdl2"
  3076. sndio_indev_deps="sndio"
  3077. sndio_outdev_deps="sndio"
  3078. v4l2_indev_deps_any="linux_videodev2_h sys_videoio_h"
  3079. v4l2_indev_suggest="libv4l2"
  3080. v4l2_outdev_deps_any="linux_videodev2_h sys_videoio_h"
  3081. v4l2_outdev_suggest="libv4l2"
  3082. vfwcap_indev_deps="vfw32 vfwcap_defines"
  3083. xcbgrab_indev_deps="libxcb"
  3084. xcbgrab_indev_suggest="libxcb_shm libxcb_shape libxcb_xfixes"
  3085. xv_outdev_deps="xlib"
  3086. # protocols
  3087. async_protocol_deps="threads"
  3088. bluray_protocol_deps="libbluray"
  3089. ffrtmpcrypt_protocol_conflict="librtmp_protocol"
  3090. ffrtmpcrypt_protocol_deps_any="gcrypt gmp openssl mbedtls"
  3091. ffrtmpcrypt_protocol_select="tcp_protocol"
  3092. ffrtmphttp_protocol_conflict="librtmp_protocol"
  3093. ffrtmphttp_protocol_select="http_protocol"
  3094. ftp_protocol_select="tcp_protocol"
  3095. gopher_protocol_select="network"
  3096. http_protocol_select="tcp_protocol"
  3097. http_protocol_suggest="zlib"
  3098. httpproxy_protocol_select="tcp_protocol"
  3099. httpproxy_protocol_suggest="zlib"
  3100. https_protocol_select="tls_protocol"
  3101. https_protocol_suggest="zlib"
  3102. icecast_protocol_select="http_protocol"
  3103. mmsh_protocol_select="http_protocol"
  3104. mmst_protocol_select="network"
  3105. rtmp_protocol_conflict="librtmp_protocol"
  3106. rtmp_protocol_select="tcp_protocol"
  3107. rtmp_protocol_suggest="zlib"
  3108. rtmpe_protocol_select="ffrtmpcrypt_protocol"
  3109. rtmpe_protocol_suggest="zlib"
  3110. rtmps_protocol_conflict="librtmp_protocol"
  3111. rtmps_protocol_select="tls_protocol"
  3112. rtmps_protocol_suggest="zlib"
  3113. rtmpt_protocol_select="ffrtmphttp_protocol"
  3114. rtmpt_protocol_suggest="zlib"
  3115. rtmpte_protocol_select="ffrtmpcrypt_protocol ffrtmphttp_protocol"
  3116. rtmpte_protocol_suggest="zlib"
  3117. rtmpts_protocol_select="ffrtmphttp_protocol https_protocol"
  3118. rtmpts_protocol_suggest="zlib"
  3119. rtp_protocol_select="udp_protocol"
  3120. schannel_conflict="openssl gnutls libtls mbedtls"
  3121. sctp_protocol_deps="struct_sctp_event_subscribe struct_msghdr_msg_flags"
  3122. sctp_protocol_select="network"
  3123. securetransport_conflict="openssl gnutls libtls mbedtls"
  3124. srtp_protocol_select="rtp_protocol srtp"
  3125. tcp_protocol_select="network"
  3126. tls_protocol_deps_any="gnutls openssl schannel securetransport libtls mbedtls"
  3127. tls_protocol_select="tcp_protocol"
  3128. udp_protocol_select="network"
  3129. udplite_protocol_select="network"
  3130. unix_protocol_deps="sys_un_h"
  3131. unix_protocol_select="network"
  3132. # external library protocols
  3133. librtmp_protocol_deps="librtmp"
  3134. librtmpe_protocol_deps="librtmp"
  3135. librtmps_protocol_deps="librtmp"
  3136. librtmpt_protocol_deps="librtmp"
  3137. librtmpte_protocol_deps="librtmp"
  3138. libsmbclient_protocol_deps="libsmbclient gplv3"
  3139. libsrt_protocol_deps="libsrt"
  3140. libsrt_protocol_select="network"
  3141. libssh_protocol_deps="libssh"
  3142. libtls_conflict="openssl gnutls mbedtls"
  3143. # filters
  3144. afftdn_filter_deps="avcodec"
  3145. afftdn_filter_select="fft"
  3146. afftfilt_filter_deps="avcodec"
  3147. afftfilt_filter_select="fft"
  3148. afir_filter_deps="avcodec"
  3149. afir_filter_select="fft"
  3150. amovie_filter_deps="avcodec avformat"
  3151. aresample_filter_deps="swresample"
  3152. asr_filter_deps="pocketsphinx"
  3153. ass_filter_deps="libass"
  3154. atempo_filter_deps="avcodec"
  3155. atempo_filter_select="rdft"
  3156. avgblur_opencl_filter_deps="opencl"
  3157. azmq_filter_deps="libzmq"
  3158. blackframe_filter_deps="gpl"
  3159. bm3d_filter_deps="avcodec"
  3160. bm3d_filter_select="dct"
  3161. boxblur_filter_deps="gpl"
  3162. boxblur_opencl_filter_deps="opencl gpl"
  3163. bs2b_filter_deps="libbs2b"
  3164. colorkey_opencl_filter_deps="opencl"
  3165. colormatrix_filter_deps="gpl"
  3166. convolution_opencl_filter_deps="opencl"
  3167. convolve_filter_deps="avcodec"
  3168. convolve_filter_select="fft"
  3169. coreimage_filter_deps="coreimage appkit"
  3170. coreimage_filter_extralibs="-framework OpenGL"
  3171. coreimagesrc_filter_deps="coreimage appkit"
  3172. coreimagesrc_filter_extralibs="-framework OpenGL"
  3173. cover_rect_filter_deps="avcodec avformat gpl"
  3174. cropdetect_filter_deps="gpl"
  3175. deconvolve_filter_deps="avcodec"
  3176. deconvolve_filter_select="fft"
  3177. deinterlace_qsv_filter_deps="libmfx"
  3178. deinterlace_vaapi_filter_deps="vaapi"
  3179. delogo_filter_deps="gpl"
  3180. denoise_vaapi_filter_deps="vaapi"
  3181. derain_filter_select="dnn"
  3182. deshake_filter_select="pixelutils"
  3183. dilation_opencl_filter_deps="opencl"
  3184. drawtext_filter_deps="libfreetype"
  3185. drawtext_filter_suggest="libfontconfig libfribidi"
  3186. elbg_filter_deps="avcodec"
  3187. eq_filter_deps="gpl"
  3188. erosion_opencl_filter_deps="opencl"
  3189. fftfilt_filter_deps="avcodec"
  3190. fftfilt_filter_select="rdft"
  3191. fftdnoiz_filter_deps="avcodec"
  3192. fftdnoiz_filter_select="fft"
  3193. find_rect_filter_deps="avcodec avformat gpl"
  3194. firequalizer_filter_deps="avcodec"
  3195. firequalizer_filter_select="rdft"
  3196. flite_filter_deps="libflite"
  3197. framerate_filter_select="scene_sad"
  3198. freezedetect_filter_select="scene_sad"
  3199. frei0r_filter_deps="frei0r libdl"
  3200. frei0r_src_filter_deps="frei0r libdl"
  3201. fspp_filter_deps="gpl"
  3202. geq_filter_deps="gpl"
  3203. histeq_filter_deps="gpl"
  3204. hqdn3d_filter_deps="gpl"
  3205. interlace_filter_deps="gpl"
  3206. kerndeint_filter_deps="gpl"
  3207. ladspa_filter_deps="ladspa libdl"
  3208. lensfun_filter_deps="liblensfun version3"
  3209. lv2_filter_deps="lv2"
  3210. mcdeint_filter_deps="avcodec gpl"
  3211. movie_filter_deps="avcodec avformat"
  3212. mpdecimate_filter_deps="gpl"
  3213. mpdecimate_filter_select="pixelutils"
  3214. minterpolate_filter_select="scene_sad"
  3215. mptestsrc_filter_deps="gpl"
  3216. negate_filter_deps="lut_filter"
  3217. nlmeans_opencl_filter_deps="opencl"
  3218. nnedi_filter_deps="gpl"
  3219. ocr_filter_deps="libtesseract"
  3220. ocv_filter_deps="libopencv"
  3221. openclsrc_filter_deps="opencl"
  3222. overlay_opencl_filter_deps="opencl"
  3223. overlay_qsv_filter_deps="libmfx"
  3224. overlay_qsv_filter_select="qsvvpp"
  3225. owdenoise_filter_deps="gpl"
  3226. pan_filter_deps="swresample"
  3227. perspective_filter_deps="gpl"
  3228. phase_filter_deps="gpl"
  3229. pp7_filter_deps="gpl"
  3230. pp_filter_deps="gpl postproc"
  3231. prewitt_opencl_filter_deps="opencl"
  3232. procamp_vaapi_filter_deps="vaapi"
  3233. program_opencl_filter_deps="opencl"
  3234. pullup_filter_deps="gpl"
  3235. removelogo_filter_deps="avcodec avformat swscale"
  3236. repeatfields_filter_deps="gpl"
  3237. resample_filter_deps="avresample"
  3238. roberts_opencl_filter_deps="opencl"
  3239. rubberband_filter_deps="librubberband"
  3240. sab_filter_deps="gpl swscale"
  3241. scale2ref_filter_deps="swscale"
  3242. scale_filter_deps="swscale"
  3243. scale_qsv_filter_deps="libmfx"
  3244. select_filter_select="scene_sad"
  3245. sharpness_vaapi_filter_deps="vaapi"
  3246. showcqt_filter_deps="avcodec avformat swscale"
  3247. showcqt_filter_suggest="libfontconfig libfreetype"
  3248. showcqt_filter_select="fft"
  3249. showfreqs_filter_deps="avcodec"
  3250. showfreqs_filter_select="fft"
  3251. showspectrum_filter_deps="avcodec"
  3252. showspectrum_filter_select="fft"
  3253. showspectrumpic_filter_deps="avcodec"
  3254. showspectrumpic_filter_select="fft"
  3255. signature_filter_deps="gpl avcodec avformat"
  3256. smartblur_filter_deps="gpl swscale"
  3257. sobel_opencl_filter_deps="opencl"
  3258. sofalizer_filter_deps="libmysofa avcodec"
  3259. sofalizer_filter_select="fft"
  3260. spectrumsynth_filter_deps="avcodec"
  3261. spectrumsynth_filter_select="fft"
  3262. spp_filter_deps="gpl avcodec"
  3263. spp_filter_select="fft idctdsp fdctdsp me_cmp pixblockdsp"
  3264. sr_filter_deps="avformat swscale"
  3265. sr_filter_select="dnn"
  3266. stereo3d_filter_deps="gpl"
  3267. subtitles_filter_deps="avformat avcodec libass"
  3268. super2xsai_filter_deps="gpl"
  3269. pixfmts_super2xsai_test_deps="super2xsai_filter"
  3270. tinterlace_filter_deps="gpl"
  3271. tinterlace_merge_test_deps="tinterlace_filter"
  3272. tinterlace_pad_test_deps="tinterlace_filter"
  3273. tonemap_filter_deps="const_nan"
  3274. tonemap_opencl_filter_deps="opencl const_nan"
  3275. transpose_opencl_filter_deps="opencl"
  3276. transpose_vaapi_filter_deps="vaapi VAProcPipelineCaps_rotation_flags"
  3277. unsharp_opencl_filter_deps="opencl"
  3278. uspp_filter_deps="gpl avcodec"
  3279. vaguedenoiser_filter_deps="gpl"
  3280. vidstabdetect_filter_deps="libvidstab"
  3281. vidstabtransform_filter_deps="libvidstab"
  3282. libvmaf_filter_deps="libvmaf pthreads"
  3283. zmq_filter_deps="libzmq"
  3284. zoompan_filter_deps="swscale"
  3285. zscale_filter_deps="libzimg const_nan"
  3286. scale_vaapi_filter_deps="vaapi"
  3287. vpp_qsv_filter_deps="libmfx"
  3288. vpp_qsv_filter_select="qsvvpp"
  3289. yadif_cuda_filter_deps="ffnvcodec cuda_nvcc"
  3290. # examples
  3291. avio_dir_cmd_deps="avformat avutil"
  3292. avio_reading_deps="avformat avcodec avutil"
  3293. decode_audio_example_deps="avcodec avutil"
  3294. decode_video_example_deps="avcodec avutil"
  3295. demuxing_decoding_example_deps="avcodec avformat avutil"
  3296. encode_audio_example_deps="avcodec avutil"
  3297. encode_video_example_deps="avcodec avutil"
  3298. extract_mvs_example_deps="avcodec avformat avutil"
  3299. filter_audio_example_deps="avfilter avutil"
  3300. filtering_audio_example_deps="avfilter avcodec avformat avutil"
  3301. filtering_video_example_deps="avfilter avcodec avformat avutil"
  3302. http_multiclient_example_deps="avformat avutil fork"
  3303. hw_decode_example_deps="avcodec avformat avutil"
  3304. metadata_example_deps="avformat avutil"
  3305. muxing_example_deps="avcodec avformat avutil swscale"
  3306. qsvdec_example_deps="avcodec avutil libmfx h264_qsv_decoder"
  3307. remuxing_example_deps="avcodec avformat avutil"
  3308. resampling_audio_example_deps="avutil swresample"
  3309. scaling_video_example_deps="avutil swscale"
  3310. transcode_aac_example_deps="avcodec avformat swresample"
  3311. transcoding_example_deps="avfilter avcodec avformat avutil"
  3312. vaapi_encode_example_deps="avcodec avutil h264_vaapi_encoder"
  3313. vaapi_transcode_example_deps="avcodec avformat avutil h264_vaapi_encoder"
  3314. # EXTRALIBS_LIST
  3315. cpu_init_extralibs="pthreads_extralibs"
  3316. cws2fws_extralibs="zlib_extralibs"
  3317. # libraries, in any order
  3318. avcodec_deps="avutil"
  3319. avcodec_suggest="libm"
  3320. avcodec_select="null_bsf"
  3321. avdevice_deps="avformat avcodec avutil"
  3322. avdevice_suggest="libm"
  3323. avfilter_deps="avutil"
  3324. avfilter_suggest="libm"
  3325. avformat_deps="avcodec avutil"
  3326. avformat_suggest="libm network zlib"
  3327. avresample_deps="avutil"
  3328. avresample_suggest="libm"
  3329. avutil_suggest="clock_gettime ffnvcodec libm libdrm libmfx opencl user32 vaapi videotoolbox corefoundation corevideo coremedia bcrypt"
  3330. postproc_deps="avutil gpl"
  3331. postproc_suggest="libm"
  3332. swresample_deps="avutil"
  3333. swresample_suggest="libm libsoxr"
  3334. swscale_deps="avutil"
  3335. swscale_suggest="libm"
  3336. avcodec_extralibs="pthreads_extralibs iconv_extralibs dxva2_extralibs"
  3337. avfilter_extralibs="pthreads_extralibs"
  3338. avutil_extralibs="d3d11va_extralibs nanosleep_extralibs pthreads_extralibs vaapi_drm_extralibs vaapi_x11_extralibs vdpau_x11_extralibs"
  3339. # programs
  3340. ffmpeg_deps="avcodec avfilter avformat"
  3341. ffmpeg_select="aformat_filter anull_filter atrim_filter format_filter
  3342. hflip_filter null_filter
  3343. transpose_filter trim_filter vflip_filter"
  3344. ffmpeg_suggest="ole32 psapi shell32"
  3345. ffplay_deps="avcodec avformat swscale swresample sdl2"
  3346. ffplay_select="rdft crop_filter transpose_filter hflip_filter vflip_filter rotate_filter"
  3347. ffplay_suggest="shell32"
  3348. ffprobe_deps="avcodec avformat"
  3349. ffprobe_suggest="shell32"
  3350. # documentation
  3351. podpages_deps="perl"
  3352. manpages_deps="perl pod2man"
  3353. htmlpages_deps="perl"
  3354. htmlpages_deps_any="makeinfo_html texi2html"
  3355. txtpages_deps="perl makeinfo"
  3356. doc_deps_any="manpages htmlpages podpages txtpages"
  3357. # default parameters
  3358. logfile="ffbuild/config.log"
  3359. # installation paths
  3360. prefix_default="/usr/local"
  3361. bindir_default='${prefix}/bin'
  3362. datadir_default='${prefix}/share/ffmpeg'
  3363. docdir_default='${prefix}/share/doc/ffmpeg'
  3364. incdir_default='${prefix}/include'
  3365. libdir_default='${prefix}/lib'
  3366. mandir_default='${prefix}/share/man'
  3367. # toolchain
  3368. ar_default="ar"
  3369. cc_default="gcc"
  3370. cxx_default="g++"
  3371. host_cc_default="gcc"
  3372. doxygen_default="doxygen"
  3373. install="install"
  3374. ln_s_default="ln -s -f"
  3375. nm_default="nm -g"
  3376. pkg_config_default=pkg-config
  3377. ranlib_default="ranlib"
  3378. strip_default="strip"
  3379. version_script='--version-script'
  3380. objformat="elf32"
  3381. x86asmexe_default="nasm"
  3382. windres_default="windres"
  3383. nvcc_default="nvcc"
  3384. nvccflags_default="-gencode arch=compute_30,code=sm_30 -O2"
  3385. striptype="direct"
  3386. # OS
  3387. target_os_default=$(tolower $(uname -s))
  3388. host_os=$target_os_default
  3389. # machine
  3390. if test "$target_os_default" = aix; then
  3391. arch_default=$(uname -p)
  3392. strip_default="strip -X32_64"
  3393. nm_default="nm -g -X32_64"
  3394. else
  3395. arch_default=$(uname -m)
  3396. fi
  3397. cpu="generic"
  3398. intrinsics="none"
  3399. # configurable options
  3400. enable $PROGRAM_LIST
  3401. enable $DOCUMENT_LIST
  3402. enable $EXAMPLE_LIST
  3403. enable $(filter_out avresample $LIBRARY_LIST)
  3404. enable stripping
  3405. enable asm
  3406. enable debug
  3407. enable doc
  3408. enable faan faandct faanidct
  3409. enable optimizations
  3410. enable runtime_cpudetect
  3411. enable safe_bitstream_reader
  3412. enable static
  3413. enable swscale_alpha
  3414. enable valgrind_backtrace
  3415. sws_max_filter_size_default=256
  3416. set_default sws_max_filter_size
  3417. # internal components are enabled by default
  3418. enable $EXTRALIBS_LIST
  3419. # Avoid external, non-system, libraries getting enabled by dependency resolution
  3420. disable $EXTERNAL_LIBRARY_LIST $HWACCEL_LIBRARY_LIST
  3421. # build settings
  3422. SHFLAGS='-shared -Wl,-soname,$$(@F)'
  3423. LIBPREF="lib"
  3424. LIBSUF=".a"
  3425. FULLNAME='$(NAME)$(BUILDSUF)'
  3426. LIBNAME='$(LIBPREF)$(FULLNAME)$(LIBSUF)'
  3427. SLIBPREF="lib"
  3428. SLIBSUF=".so"
  3429. SLIBNAME='$(SLIBPREF)$(FULLNAME)$(SLIBSUF)'
  3430. SLIBNAME_WITH_VERSION='$(SLIBNAME).$(LIBVERSION)'
  3431. SLIBNAME_WITH_MAJOR='$(SLIBNAME).$(LIBMAJOR)'
  3432. LIB_INSTALL_EXTRA_CMD='$$(RANLIB) "$(LIBDIR)/$(LIBNAME)"'
  3433. SLIB_INSTALL_NAME='$(SLIBNAME_WITH_VERSION)'
  3434. SLIB_INSTALL_LINKS='$(SLIBNAME_WITH_MAJOR) $(SLIBNAME)'
  3435. VERSION_SCRIPT_POSTPROCESS_CMD="cat"
  3436. asflags_filter=echo
  3437. cflags_filter=echo
  3438. ldflags_filter=echo
  3439. AS_C='-c'
  3440. AS_O='-o $@'
  3441. CC_C='-c'
  3442. CC_E='-E -o $@'
  3443. CC_O='-o $@'
  3444. CXX_C='-c'
  3445. CXX_O='-o $@'
  3446. OBJCC_C='-c'
  3447. OBJCC_E='-E -o $@'
  3448. OBJCC_O='-o $@'
  3449. X86ASM_O='-o $@'
  3450. LD_O='-o $@'
  3451. LD_LIB='-l%'
  3452. LD_PATH='-L'
  3453. HOSTCC_C='-c'
  3454. HOSTCC_E='-E -o $@'
  3455. HOSTCC_O='-o $@'
  3456. HOSTLD_O='-o $@'
  3457. NVCC_C='-c'
  3458. NVCC_O='-o $@'
  3459. host_extralibs='-lm'
  3460. host_cflags_filter=echo
  3461. host_ldflags_filter=echo
  3462. target_path='$(CURDIR)'
  3463. # since the object filename is not given with the -MM flag, the compiler
  3464. # is only able to print the basename, and we must add the path ourselves
  3465. DEPCMD='$(DEP$(1)) $(DEP$(1)FLAGS) $($(1)DEP_FLAGS) $< 2>/dev/null | sed -e "/^\#.*/d" -e "s,^[[:space:]]*$(@F),$(@D)/$(@F)," > $(@:.o=.d)'
  3466. DEPFLAGS='-MM'
  3467. mkdir -p ffbuild
  3468. # find source path
  3469. if test -f configure; then
  3470. source_path=.
  3471. elif test -f src/configure; then
  3472. source_path=src
  3473. else
  3474. source_path=$(cd $(dirname "$0"); pwd)
  3475. case "$source_path" in
  3476. *[[:blank:]]*) die "Out of tree builds are impossible with whitespace in source path." ;;
  3477. esac
  3478. test -e "$source_path/config.h" &&
  3479. die "Out of tree builds are impossible with config.h in source dir."
  3480. fi
  3481. for v in "$@"; do
  3482. r=${v#*=}
  3483. l=${v%"$r"}
  3484. r=$(sh_quote "$r")
  3485. FFMPEG_CONFIGURATION="${FFMPEG_CONFIGURATION# } ${l}${r}"
  3486. done
  3487. find_things_extern(){
  3488. thing=$1
  3489. pattern=$2
  3490. file=$source_path/$3
  3491. out=${4:-$thing}
  3492. sed -n "s/^[^#]*extern.*$pattern *ff_\([^ ]*\)_$thing;/\1_$out/p" "$file"
  3493. }
  3494. find_filters_extern(){
  3495. file=$source_path/$1
  3496. sed -n 's/^extern AVFilter ff_[avfsinkrc]\{2,5\}_\([[:alnum:]_]\{1,\}\);/\1_filter/p' $file
  3497. }
  3498. FILTER_LIST=$(find_filters_extern libavfilter/allfilters.c)
  3499. OUTDEV_LIST=$(find_things_extern muxer AVOutputFormat libavdevice/alldevices.c outdev)
  3500. INDEV_LIST=$(find_things_extern demuxer AVInputFormat libavdevice/alldevices.c indev)
  3501. MUXER_LIST=$(find_things_extern muxer AVOutputFormat libavformat/allformats.c)
  3502. DEMUXER_LIST=$(find_things_extern demuxer AVInputFormat libavformat/allformats.c)
  3503. ENCODER_LIST=$(find_things_extern encoder AVCodec libavcodec/allcodecs.c)
  3504. DECODER_LIST=$(find_things_extern decoder AVCodec libavcodec/allcodecs.c)
  3505. CODEC_LIST="
  3506. $ENCODER_LIST
  3507. $DECODER_LIST
  3508. "
  3509. PARSER_LIST=$(find_things_extern parser AVCodecParser libavcodec/parsers.c)
  3510. BSF_LIST=$(find_things_extern bsf AVBitStreamFilter libavcodec/bitstream_filters.c)
  3511. HWACCEL_LIST=$(find_things_extern hwaccel AVHWAccel libavcodec/hwaccels.h)
  3512. PROTOCOL_LIST=$(find_things_extern protocol URLProtocol libavformat/protocols.c)
  3513. AVCODEC_COMPONENTS_LIST="
  3514. $BSF_LIST
  3515. $DECODER_LIST
  3516. $ENCODER_LIST
  3517. $HWACCEL_LIST
  3518. $PARSER_LIST
  3519. "
  3520. AVDEVICE_COMPONENTS_LIST="
  3521. $INDEV_LIST
  3522. $OUTDEV_LIST
  3523. "
  3524. AVFILTER_COMPONENTS_LIST="
  3525. $FILTER_LIST
  3526. "
  3527. AVFORMAT_COMPONENTS_LIST="
  3528. $DEMUXER_LIST
  3529. $MUXER_LIST
  3530. $PROTOCOL_LIST
  3531. "
  3532. ALL_COMPONENTS="
  3533. $AVCODEC_COMPONENTS_LIST
  3534. $AVDEVICE_COMPONENTS_LIST
  3535. $AVFILTER_COMPONENTS_LIST
  3536. $AVFORMAT_COMPONENTS_LIST
  3537. "
  3538. for n in $COMPONENT_LIST; do
  3539. v=$(toupper ${n%s})_LIST
  3540. eval enable \$$v
  3541. eval ${n}_if_any="\$$v"
  3542. done
  3543. enable $ARCH_EXT_LIST
  3544. die_unknown(){
  3545. echo "Unknown option \"$1\"."
  3546. echo "See $0 --help for available options."
  3547. exit 1
  3548. }
  3549. print_in_columns() {
  3550. cols=$(expr $ncols / 24)
  3551. cat | tr ' ' '\n' | sort | pr -r "-$cols" -w $ncols -t
  3552. }
  3553. show_list() {
  3554. suffix=_$1
  3555. shift
  3556. echo $* | sed s/$suffix//g | print_in_columns
  3557. exit 0
  3558. }
  3559. rand_list(){
  3560. IFS=', '
  3561. set -- $*
  3562. unset IFS
  3563. for thing; do
  3564. comp=${thing%:*}
  3565. prob=${thing#$comp}
  3566. prob=${prob#:}
  3567. is_in ${comp} $COMPONENT_LIST && eval comp=\$$(toupper ${comp%s})_LIST
  3568. echo "prob ${prob:-0.5}"
  3569. printf '%s\n' $comp
  3570. done
  3571. }
  3572. do_random(){
  3573. action=$1
  3574. shift
  3575. random_seed=$(awk "BEGIN { srand($random_seed); print srand() }")
  3576. $action $(rand_list "$@" | awk "BEGIN { srand($random_seed) } \$1 == \"prob\" { prob = \$2; next } rand() < prob { print }")
  3577. }
  3578. for opt do
  3579. optval="${opt#*=}"
  3580. case "$opt" in
  3581. --extra-ldflags=*)
  3582. add_ldflags $optval
  3583. ;;
  3584. --extra-ldexeflags=*)
  3585. add_ldexeflags $optval
  3586. ;;
  3587. --extra-ldsoflags=*)
  3588. add_ldsoflags $optval
  3589. ;;
  3590. --extra-ldlibflags=*)
  3591. warn "The --extra-ldlibflags option is only provided for compatibility and will be\n"\
  3592. "removed in the future. Use --extra-ldsoflags instead."
  3593. add_ldsoflags $optval
  3594. ;;
  3595. --extra-libs=*)
  3596. add_extralibs $optval
  3597. ;;
  3598. --disable-devices)
  3599. disable $INDEV_LIST $OUTDEV_LIST
  3600. ;;
  3601. --enable-debug=*)
  3602. debuglevel="$optval"
  3603. ;;
  3604. --disable-programs)
  3605. disable $PROGRAM_LIST
  3606. ;;
  3607. --disable-everything)
  3608. map 'eval unset \${$(toupper ${v%s})_LIST}' $COMPONENT_LIST
  3609. ;;
  3610. --disable-all)
  3611. map 'eval unset \${$(toupper ${v%s})_LIST}' $COMPONENT_LIST
  3612. disable $LIBRARY_LIST $PROGRAM_LIST doc
  3613. enable avutil
  3614. ;;
  3615. --enable-random|--disable-random)
  3616. action=${opt%%-random}
  3617. do_random ${action#--} $COMPONENT_LIST
  3618. ;;
  3619. --enable-random=*|--disable-random=*)
  3620. action=${opt%%-random=*}
  3621. do_random ${action#--} $optval
  3622. ;;
  3623. --enable-sdl)
  3624. enable sdl2
  3625. ;;
  3626. --enable-*=*|--disable-*=*)
  3627. eval $(echo "${opt%%=*}" | sed 's/--/action=/;s/-/ thing=/')
  3628. is_in "${thing}s" $COMPONENT_LIST || die_unknown "$opt"
  3629. eval list=\$$(toupper $thing)_LIST
  3630. name=$(echo "${optval}" | sed "s/,/_${thing}|/g")_${thing}
  3631. list=$(filter "$name" $list)
  3632. [ "$list" = "" ] && warn "Option $opt did not match anything"
  3633. test $action = enable && warn_if_gets_disabled $list
  3634. $action $list
  3635. ;;
  3636. --enable-yasm|--disable-yasm)
  3637. warn "The ${opt} option is only provided for compatibility and will be\n"\
  3638. "removed in the future. Use --enable-x86asm / --disable-x86asm instead."
  3639. test $opt = --enable-yasm && x86asm=yes || x86asm=no
  3640. ;;
  3641. --yasmexe=*)
  3642. warn "The --yasmexe option is only provided for compatibility and will be\n"\
  3643. "removed in the future. Use --x86asmexe instead."
  3644. x86asmexe="$optval"
  3645. ;;
  3646. --enable-?*|--disable-?*)
  3647. eval $(echo "$opt" | sed 's/--/action=/;s/-/ option=/;s/-/_/g')
  3648. if is_in $option $COMPONENT_LIST; then
  3649. test $action = disable && action=unset
  3650. eval $action \$$(toupper ${option%s})_LIST
  3651. elif is_in $option $CMDLINE_SELECT; then
  3652. $action $option
  3653. else
  3654. die_unknown $opt
  3655. fi
  3656. ;;
  3657. --list-*)
  3658. NAME="${opt#--list-}"
  3659. is_in $NAME $COMPONENT_LIST || die_unknown $opt
  3660. NAME=${NAME%s}
  3661. eval show_list $NAME \$$(toupper $NAME)_LIST
  3662. ;;
  3663. --help|-h) show_help
  3664. ;;
  3665. --quiet|-q) quiet=yes
  3666. ;;
  3667. --fatal-warnings) enable fatal_warnings
  3668. ;;
  3669. --libfuzzer=*)
  3670. libfuzzer_path="$optval"
  3671. ;;
  3672. *)
  3673. optname="${opt%%=*}"
  3674. optname="${optname#--}"
  3675. optname=$(echo "$optname" | sed 's/-/_/g')
  3676. if is_in $optname $CMDLINE_SET; then
  3677. eval $optname='$optval'
  3678. elif is_in $optname $CMDLINE_APPEND; then
  3679. append $optname "$optval"
  3680. else
  3681. die_unknown $opt
  3682. fi
  3683. ;;
  3684. esac
  3685. done
  3686. for e in $env; do
  3687. eval "export $e"
  3688. done
  3689. if disabled autodetect; then
  3690. # Unless iconv is explicitely disabled by the user, we still want to probe
  3691. # for the iconv from the libc.
  3692. disabled iconv || enable libc_iconv
  3693. disable_weak $EXTERNAL_AUTODETECT_LIBRARY_LIST
  3694. disable_weak $HWACCEL_AUTODETECT_LIBRARY_LIST
  3695. fi
  3696. # Mark specifically enabled, but normally autodetected libraries as requested.
  3697. for lib in $AUTODETECT_LIBS; do
  3698. enabled $lib && request $lib
  3699. done
  3700. #TODO: switch to $AUTODETECT_LIBS when $THREADS_LIST is supported the same way
  3701. enable_weak $EXTERNAL_AUTODETECT_LIBRARY_LIST
  3702. enable_weak $HWACCEL_AUTODETECT_LIBRARY_LIST
  3703. disabled logging && logfile=/dev/null
  3704. # command line configuration sanity checks
  3705. # we need to build at least one lib type
  3706. if ! enabled_any static shared; then
  3707. cat <<EOF
  3708. At least one library type must be built.
  3709. Specify --enable-static to build the static libraries or --enable-shared to
  3710. build the shared libraries as well. To only build the shared libraries specify
  3711. --disable-static in addition to --enable-shared.
  3712. EOF
  3713. exit 1
  3714. fi
  3715. die_license_disabled() {
  3716. enabled $1 || { enabled $v && die "$v is $1 and --enable-$1 is not specified."; }
  3717. }
  3718. die_license_disabled_gpl() {
  3719. enabled $1 || { enabled $v && die "$v is incompatible with the gpl and --enable-$1 is not specified."; }
  3720. }
  3721. map "die_license_disabled gpl" $EXTERNAL_LIBRARY_GPL_LIST $EXTERNAL_LIBRARY_GPLV3_LIST
  3722. map "die_license_disabled version3" $EXTERNAL_LIBRARY_VERSION3_LIST $EXTERNAL_LIBRARY_GPLV3_LIST
  3723. enabled gpl && map "die_license_disabled_gpl nonfree" $EXTERNAL_LIBRARY_NONFREE_LIST
  3724. map "die_license_disabled nonfree" $HWACCEL_LIBRARY_NONFREE_LIST
  3725. enabled version3 && { enabled gpl && enable gplv3 || enable lgplv3; }
  3726. if enabled nonfree; then
  3727. license="nonfree and unredistributable"
  3728. elif enabled gplv3; then
  3729. license="GPL version 3 or later"
  3730. elif enabled lgplv3; then
  3731. license="LGPL version 3 or later"
  3732. elif enabled gpl; then
  3733. license="GPL version 2 or later"
  3734. else
  3735. license="LGPL version 2.1 or later"
  3736. fi
  3737. enabled_all gnutls openssl &&
  3738. die "GnuTLS and OpenSSL must not be enabled at the same time."
  3739. enabled_all gnutls mbedtls &&
  3740. die "GnuTLS and mbedTLS must not be enabled at the same time."
  3741. enabled_all openssl mbedtls &&
  3742. die "OpenSSL and mbedTLS must not be enabled at the same time."
  3743. # Disable all the library-specific components if the library itself
  3744. # is disabled, see AVCODEC_LIST and following _LIST variables.
  3745. disable_components(){
  3746. disabled ${1} && disable $(
  3747. eval components="\$$(toupper ${1})_COMPONENTS"
  3748. map 'eval echo \${$(toupper ${v%s})_LIST}' $components
  3749. )
  3750. }
  3751. map 'disable_components $v' $LIBRARY_LIST
  3752. echo "# $0 $FFMPEG_CONFIGURATION" > $logfile
  3753. set >> $logfile
  3754. test -n "$valgrind" && toolchain="valgrind-memcheck"
  3755. enabled ossfuzz && ! echo $CFLAGS | grep -q -- "-fsanitize=" && ! echo $CFLAGS | grep -q -- "-fcoverage-mapping" &&{
  3756. add_cflags -fsanitize=address,undefined -fsanitize-coverage=trace-pc-guard,trace-cmp -fno-omit-frame-pointer
  3757. add_ldflags -fsanitize=address,undefined -fsanitize-coverage=trace-pc-guard,trace-cmp
  3758. }
  3759. case "$toolchain" in
  3760. *-asan)
  3761. cc_default="${toolchain%-asan}"
  3762. add_cflags -fsanitize=address
  3763. add_ldflags -fsanitize=address
  3764. ;;
  3765. *-msan)
  3766. cc_default="${toolchain%-msan}"
  3767. add_cflags -fsanitize=memory -fsanitize-memory-track-origins
  3768. add_ldflags -fsanitize=memory
  3769. ;;
  3770. *-tsan)
  3771. cc_default="${toolchain%-tsan}"
  3772. add_cflags -fsanitize=thread
  3773. add_ldflags -fsanitize=thread
  3774. case "$toolchain" in
  3775. gcc-tsan)
  3776. add_cflags -fPIC
  3777. add_ldflags -fPIC
  3778. ;;
  3779. esac
  3780. ;;
  3781. *-usan)
  3782. cc_default="${toolchain%-usan}"
  3783. add_cflags -fsanitize=undefined
  3784. add_ldflags -fsanitize=undefined
  3785. ;;
  3786. valgrind-*)
  3787. target_exec_default="valgrind"
  3788. case "$toolchain" in
  3789. valgrind-massif)
  3790. 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"
  3791. ;;
  3792. valgrind-memcheck)
  3793. 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"
  3794. ;;
  3795. esac
  3796. ;;
  3797. msvc)
  3798. # Check whether the current MSVC version needs the C99 converter.
  3799. # From MSVC 2013 (compiler major version 18) onwards, it does actually
  3800. # support enough of C99 to build ffmpeg. Default to the new
  3801. # behaviour if the regexp was unable to match anything, since this
  3802. # successfully parses the version number of existing supported
  3803. # versions that require the converter (MSVC 2010 and 2012).
  3804. cl_major_ver=$(cl.exe 2>&1 | sed -n 's/.*Version \([[:digit:]]\{1,\}\)\..*/\1/p')
  3805. if [ -z "$cl_major_ver" ] || [ $cl_major_ver -ge 18 ]; then
  3806. cc_default="cl.exe"
  3807. cxx_default="cl.exe"
  3808. else
  3809. die "Unsupported MSVC version (2013 or newer required)"
  3810. fi
  3811. ld_default="$source_path/compat/windows/mslink"
  3812. nm_default="dumpbin.exe -symbols"
  3813. ar_default="lib.exe"
  3814. case "$arch" in
  3815. aarch64|arm64)
  3816. as_default="armasm64.exe"
  3817. ;;
  3818. arm*)
  3819. as_default="armasm.exe"
  3820. ;;
  3821. esac
  3822. target_os_default="win32"
  3823. # Use a relative path for TMPDIR. This makes sure all the
  3824. # ffconf temp files are written with a relative path, avoiding
  3825. # issues with msys/win32 path conversion for MSVC parameters
  3826. # such as -Fo<file> or -out:<file>.
  3827. TMPDIR=.
  3828. ;;
  3829. icl)
  3830. cc_default="icl"
  3831. ld_default="xilink"
  3832. nm_default="dumpbin -symbols"
  3833. ar_default="xilib"
  3834. target_os_default="win32"
  3835. TMPDIR=.
  3836. ;;
  3837. gcov)
  3838. add_cflags -fprofile-arcs -ftest-coverage
  3839. add_ldflags -fprofile-arcs -ftest-coverage
  3840. ;;
  3841. llvm-cov)
  3842. add_cflags -fprofile-arcs -ftest-coverage
  3843. add_ldflags --coverage
  3844. ;;
  3845. hardened)
  3846. add_cppflags -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2
  3847. add_cflags -fno-strict-overflow -fstack-protector-all
  3848. add_ldflags -Wl,-z,relro -Wl,-z,now
  3849. add_cflags -fPIE
  3850. add_ldexeflags -fPIE -pie
  3851. ;;
  3852. ?*)
  3853. die "Unknown toolchain $toolchain"
  3854. ;;
  3855. esac
  3856. if test -n "$cross_prefix"; then
  3857. test -n "$arch" && test -n "$target_os" ||
  3858. die "Must specify target arch (--arch) and OS (--target-os) when cross-compiling"
  3859. enable cross_compile
  3860. fi
  3861. set_default target_os
  3862. if test "$target_os" = android; then
  3863. cc_default="clang"
  3864. fi
  3865. ar_default="${cross_prefix}${ar_default}"
  3866. cc_default="${cross_prefix}${cc_default}"
  3867. cxx_default="${cross_prefix}${cxx_default}"
  3868. nm_default="${cross_prefix}${nm_default}"
  3869. pkg_config_default="${cross_prefix}${pkg_config_default}"
  3870. if ${cross_prefix}${ranlib_default} 2>&1 | grep -q "\-D "; then
  3871. ranlib_default="${cross_prefix}${ranlib_default} -D"
  3872. else
  3873. ranlib_default="${cross_prefix}${ranlib_default}"
  3874. fi
  3875. strip_default="${cross_prefix}${strip_default}"
  3876. windres_default="${cross_prefix}${windres_default}"
  3877. sysinclude_default="${sysroot}/usr/include"
  3878. set_default arch cc cxx doxygen pkg_config ranlib strip sysinclude \
  3879. target_exec x86asmexe nvcc
  3880. enabled cross_compile || host_cc_default=$cc
  3881. set_default host_cc
  3882. pkg_config_fail_message=""
  3883. if ! $pkg_config --version >/dev/null 2>&1; then
  3884. warn "$pkg_config not found, library detection may fail."
  3885. pkg_config=false
  3886. elif is_in -static $cc $LDFLAGS && ! is_in --static $pkg_config $pkg_config_flags; then
  3887. pkg_config_fail_message="
  3888. Note: When building a static binary, add --pkg-config-flags=\"--static\"."
  3889. fi
  3890. if test $doxygen != $doxygen_default && \
  3891. ! $doxygen --version >/dev/null 2>&1; then
  3892. warn "Specified doxygen \"$doxygen\" not found, API documentation will fail to build."
  3893. fi
  3894. exesuf() {
  3895. case $1 in
  3896. mingw32*|mingw64*|win32|win64|cygwin*|*-dos|freedos|opendos|os/2*|symbian) echo .exe ;;
  3897. esac
  3898. }
  3899. EXESUF=$(exesuf $target_os)
  3900. HOSTEXESUF=$(exesuf $host_os)
  3901. # set temporary file name
  3902. : ${TMPDIR:=$TEMPDIR}
  3903. : ${TMPDIR:=$TMP}
  3904. : ${TMPDIR:=/tmp}
  3905. if [ -n "$tempprefix" ] ; then
  3906. mktemp(){
  3907. tmpname="$tempprefix.${HOSTNAME}.${UID}"
  3908. echo "$tmpname"
  3909. mkdir "$tmpname"
  3910. }
  3911. elif ! test_cmd mktemp -u XXXXXX; then
  3912. # simple replacement for missing mktemp
  3913. # NOT SAFE FOR GENERAL USE
  3914. mktemp(){
  3915. tmpname="${2%%XXX*}.${HOSTNAME}.${UID}.$$"
  3916. echo "$tmpname"
  3917. mkdir "$tmpname"
  3918. }
  3919. fi
  3920. FFTMPDIR=$(mktemp -d "${TMPDIR}/ffconf.XXXXXXXX" 2> /dev/null) ||
  3921. die "Unable to create temporary directory in $TMPDIR."
  3922. tmpfile(){
  3923. tmp="${FFTMPDIR}/test"$2
  3924. (set -C; exec > $tmp) 2> /dev/null ||
  3925. die "Unable to create temporary file in $FFTMPDIR."
  3926. eval $1=$tmp
  3927. }
  3928. trap 'rm -rf -- "$FFTMPDIR"' EXIT
  3929. trap 'exit 2' INT
  3930. tmpfile TMPASM .asm
  3931. tmpfile TMPC .c
  3932. tmpfile TMPCPP .cpp
  3933. tmpfile TMPE $EXESUF
  3934. tmpfile TMPH .h
  3935. tmpfile TMPM .m
  3936. tmpfile TMPCU .cu
  3937. tmpfile TMPO .o
  3938. tmpfile TMPS .S
  3939. tmpfile TMPSH .sh
  3940. tmpfile TMPV .ver
  3941. unset -f mktemp
  3942. chmod +x $TMPE
  3943. # make sure we can execute files in $TMPDIR
  3944. cat > $TMPSH 2>> $logfile <<EOF
  3945. #! /bin/sh
  3946. EOF
  3947. chmod +x $TMPSH >> $logfile 2>&1
  3948. if ! $TMPSH >> $logfile 2>&1; then
  3949. cat <<EOF
  3950. Unable to create and execute files in $TMPDIR. Set the TMPDIR environment
  3951. variable to another directory and make sure that it is not mounted noexec.
  3952. EOF
  3953. die "Sanity test failed."
  3954. fi
  3955. armasm_flags(){
  3956. for flag; do
  3957. case $flag in
  3958. # Filter out MSVC cl.exe options from cflags that shouldn't
  3959. # be passed to gas-preprocessor
  3960. -M[TD]*) ;;
  3961. *) echo $flag ;;
  3962. esac
  3963. done
  3964. }
  3965. cparser_flags(){
  3966. for flag; do
  3967. case $flag in
  3968. -Wno-switch) echo -Wno-switch-enum ;;
  3969. -Wno-format-zero-length) ;;
  3970. -Wdisabled-optimization) ;;
  3971. -Wno-pointer-sign) echo -Wno-other ;;
  3972. *) echo $flag ;;
  3973. esac
  3974. done
  3975. }
  3976. msvc_common_flags(){
  3977. for flag; do
  3978. case $flag in
  3979. # In addition to specifying certain flags under the compiler
  3980. # specific filters, they must be specified here as well or else the
  3981. # generic catch all at the bottom will print the original flag.
  3982. -Wall) ;;
  3983. -Wextra) ;;
  3984. -std=c99) ;;
  3985. # Common flags
  3986. -fomit-frame-pointer) ;;
  3987. -g) echo -Z7 ;;
  3988. -fno-math-errno) ;;
  3989. -fno-common) ;;
  3990. -fno-signed-zeros) ;;
  3991. -fPIC) ;;
  3992. -mthumb) ;;
  3993. -march=*) ;;
  3994. -lz) echo zlib.lib ;;
  3995. -lx264) echo libx264.lib ;;
  3996. -lstdc++) ;;
  3997. -l*) echo ${flag#-l}.lib ;;
  3998. -LARGEADDRESSAWARE) echo $flag ;;
  3999. -L*) echo -libpath:${flag#-L} ;;
  4000. *) echo $flag ;;
  4001. esac
  4002. done
  4003. }
  4004. msvc_flags(){
  4005. msvc_common_flags "$@"
  4006. for flag; do
  4007. case $flag in
  4008. -Wall) echo -W3 -wd4018 -wd4146 -wd4244 -wd4305 \
  4009. -wd4554 ;;
  4010. -Wextra) echo -W4 -wd4244 -wd4127 -wd4018 -wd4389 \
  4011. -wd4146 -wd4057 -wd4204 -wd4706 -wd4305 \
  4012. -wd4152 -wd4324 -we4013 -wd4100 -wd4214 \
  4013. -wd4307 \
  4014. -wd4273 -wd4554 -wd4701 -wd4703 ;;
  4015. esac
  4016. done
  4017. }
  4018. icl_flags(){
  4019. msvc_common_flags "$@"
  4020. for flag; do
  4021. case $flag in
  4022. # Despite what Intel's documentation says -Wall, which is supported
  4023. # on Windows, does enable remarks so disable them here.
  4024. -Wall) echo $flag -Qdiag-disable:remark ;;
  4025. -std=c99) echo -Qstd=c99 ;;
  4026. -flto) echo -ipo ;;
  4027. esac
  4028. done
  4029. }
  4030. icc_flags(){
  4031. for flag; do
  4032. case $flag in
  4033. -flto) echo -ipo ;;
  4034. *) echo $flag ;;
  4035. esac
  4036. done
  4037. }
  4038. suncc_flags(){
  4039. for flag; do
  4040. case $flag in
  4041. -march=*|-mcpu=*)
  4042. case "${flag#*=}" in
  4043. native) echo -xtarget=native ;;
  4044. v9|niagara) echo -xarch=sparc ;;
  4045. ultrasparc) echo -xarch=sparcvis ;;
  4046. ultrasparc3|niagara2) echo -xarch=sparcvis2 ;;
  4047. i586|pentium) echo -xchip=pentium ;;
  4048. i686|pentiumpro|pentium2) echo -xtarget=pentium_pro ;;
  4049. pentium3*|c3-2) echo -xtarget=pentium3 ;;
  4050. pentium-m) echo -xarch=sse2 -xchip=pentium3 ;;
  4051. pentium4*) echo -xtarget=pentium4 ;;
  4052. prescott|nocona) echo -xarch=sse3 -xchip=pentium4 ;;
  4053. *-sse3) echo -xarch=sse3 ;;
  4054. core2) echo -xarch=ssse3 -xchip=core2 ;;
  4055. bonnell) echo -xarch=ssse3 ;;
  4056. corei7|nehalem) echo -xtarget=nehalem ;;
  4057. westmere) echo -xtarget=westmere ;;
  4058. silvermont) echo -xarch=sse4_2 ;;
  4059. corei7-avx|sandybridge) echo -xtarget=sandybridge ;;
  4060. core-avx*|ivybridge|haswell|broadwell|skylake*|knl)
  4061. echo -xarch=avx ;;
  4062. amdfam10|barcelona) echo -xtarget=barcelona ;;
  4063. btver1) echo -xarch=amdsse4a ;;
  4064. btver2|bdver*|znver*) echo -xarch=avx ;;
  4065. athlon-4|athlon-[mx]p) echo -xarch=ssea ;;
  4066. k8|opteron|athlon64|athlon-fx)
  4067. echo -xarch=sse2a ;;
  4068. athlon*) echo -xarch=pentium_proa ;;
  4069. esac
  4070. ;;
  4071. -std=c99) echo -xc99 ;;
  4072. -fomit-frame-pointer) echo -xregs=frameptr ;;
  4073. -fPIC) echo -KPIC -xcode=pic32 ;;
  4074. -W*,*) echo $flag ;;
  4075. -f*-*|-W*|-mimpure-text) ;;
  4076. -shared) echo -G ;;
  4077. *) echo $flag ;;
  4078. esac
  4079. done
  4080. }
  4081. probe_cc(){
  4082. pfx=$1
  4083. _cc=$2
  4084. first=$3
  4085. unset _type _ident _cc_c _cc_e _cc_o _flags _cflags
  4086. unset _ld_o _ldflags _ld_lib _ld_path
  4087. unset _depflags _DEPCMD _DEPFLAGS
  4088. _flags_filter=echo
  4089. if $_cc --version 2>&1 | grep -q '^GNU assembler'; then
  4090. true # no-op to avoid reading stdin in following checks
  4091. elif $_cc -v 2>&1 | grep -q '^gcc.*LLVM'; then
  4092. _type=llvm_gcc
  4093. gcc_extra_ver=$(expr "$($_cc --version 2>/dev/null | head -n1)" : '.*\((.*)\)')
  4094. _ident="llvm-gcc $($_cc -dumpversion 2>/dev/null) $gcc_extra_ver"
  4095. _depflags='-MMD -MF $(@:.o=.d) -MT $@'
  4096. _cflags_speed='-O3'
  4097. _cflags_size='-Os'
  4098. elif $_cc -v 2>&1 | grep -qi ^gcc; then
  4099. _type=gcc
  4100. gcc_version=$($_cc --version | head -n1)
  4101. gcc_basever=$($_cc -dumpversion)
  4102. gcc_pkg_ver=$(expr "$gcc_version" : '[^ ]* \(([^)]*)\)')
  4103. gcc_ext_ver=$(expr "$gcc_version" : ".*$gcc_pkg_ver $gcc_basever \\(.*\\)")
  4104. _ident=$(cleanws "gcc $gcc_basever $gcc_pkg_ver $gcc_ext_ver")
  4105. case $gcc_basever in
  4106. 2) ;;
  4107. 2.*) ;;
  4108. *) _depflags='-MMD -MF $(@:.o=.d) -MT $@' ;;
  4109. esac
  4110. if [ "$first" = true ]; then
  4111. case $gcc_basever in
  4112. 4.2*)
  4113. warn "gcc 4.2 is outdated and may miscompile FFmpeg. Please use a newer compiler." ;;
  4114. esac
  4115. fi
  4116. _cflags_speed='-O3'
  4117. _cflags_size='-Os'
  4118. elif $_cc --version 2>/dev/null | grep -q ^icc; then
  4119. _type=icc
  4120. _ident=$($_cc --version | head -n1)
  4121. _depflags='-MMD'
  4122. _cflags_speed='-O3'
  4123. _cflags_size='-Os'
  4124. _cflags_noopt='-O1'
  4125. _flags_filter=icc_flags
  4126. elif $_cc -v 2>&1 | grep -q xlc; then
  4127. _type=xlc
  4128. _ident=$($_cc -qversion 2>/dev/null | head -n1)
  4129. _cflags_speed='-O5'
  4130. _cflags_size='-O5 -qcompact'
  4131. elif $_cc --vsn 2>/dev/null | grep -Eq "ARM (C/C\+\+ )?Compiler"; then
  4132. test -d "$sysroot" || die "No valid sysroot specified."
  4133. _type=armcc
  4134. _ident=$($_cc --vsn | grep -i build | head -n1 | sed 's/.*: //')
  4135. armcc_conf="$PWD/armcc.conf"
  4136. $_cc --arm_linux_configure \
  4137. --arm_linux_config_file="$armcc_conf" \
  4138. --configure_sysroot="$sysroot" \
  4139. --configure_cpp_headers="$sysinclude" >>$logfile 2>&1 ||
  4140. die "Error creating armcc configuration file."
  4141. $_cc --vsn | grep -q RVCT && armcc_opt=rvct || armcc_opt=armcc
  4142. _flags="--arm_linux_config_file=$armcc_conf --translate_gcc"
  4143. as_default="${cross_prefix}gcc"
  4144. _depflags='-MMD'
  4145. _cflags_speed='-O3'
  4146. _cflags_size='-Os'
  4147. elif $_cc -v 2>&1 | grep -q clang && ! $_cc -? > /dev/null 2>&1; then
  4148. _type=clang
  4149. _ident=$($_cc --version 2>/dev/null | head -n1)
  4150. _depflags='-MMD -MF $(@:.o=.d) -MT $@'
  4151. _cflags_speed='-O3'
  4152. _cflags_size='-Oz'
  4153. elif $_cc -V 2>&1 | grep -q Sun; then
  4154. _type=suncc
  4155. _ident=$($_cc -V 2>&1 | head -n1 | cut -d' ' -f 2-)
  4156. _DEPCMD='$(DEP$(1)) $(DEP$(1)FLAGS) $($(1)DEP_FLAGS) $< | sed -e "1s,^.*: ,$@: ," -e "\$$!s,\$$, \\\," -e "1!s,^.*: , ," > $(@:.o=.d)'
  4157. _DEPFLAGS='-xM1 -xc99'
  4158. _ldflags='-std=c99'
  4159. _cflags_speed='-O5'
  4160. _cflags_size='-O5 -xspace'
  4161. _flags_filter=suncc_flags
  4162. elif $_cc -v 2>&1 | grep -q 'PathScale\|Path64'; then
  4163. _type=pathscale
  4164. _ident=$($_cc -v 2>&1 | head -n1 | tr -d :)
  4165. _depflags='-MMD -MF $(@:.o=.d) -MT $@'
  4166. _cflags_speed='-O2'
  4167. _cflags_size='-Os'
  4168. _flags_filter='filter_out -Wdisabled-optimization'
  4169. elif $_cc -v 2>&1 | grep -q Open64; then
  4170. _type=open64
  4171. _ident=$($_cc -v 2>&1 | head -n1 | tr -d :)
  4172. _depflags='-MMD -MF $(@:.o=.d) -MT $@'
  4173. _cflags_speed='-O2'
  4174. _cflags_size='-Os'
  4175. _flags_filter='filter_out -Wdisabled-optimization|-Wtype-limits|-fno-signed-zeros'
  4176. elif $_cc 2>&1 | grep -q 'Microsoft.*ARM.*Assembler'; then
  4177. _type=armasm
  4178. _ident=$($_cc | head -n1)
  4179. # 4509: "This form of conditional instruction is deprecated"
  4180. _flags="-nologo -ignore 4509"
  4181. _flags_filter=armasm_flags
  4182. elif $_cc 2>&1 | grep -q Intel; then
  4183. _type=icl
  4184. _ident=$($_cc 2>&1 | head -n1)
  4185. _depflags='-QMMD -QMF$(@:.o=.d) -QMT$@'
  4186. # Not only is O3 broken on 13.x+ but it is slower on all previous
  4187. # versions (tested) as well.
  4188. _cflags_speed="-O2"
  4189. _cflags_size="-O1 -Oi" # -O1 without -Oi miscompiles stuff
  4190. if $_cc 2>&1 | grep -q Linker; then
  4191. _ld_o='-out:$@'
  4192. else
  4193. _ld_o='-Fe$@'
  4194. fi
  4195. _cc_o='-Fo$@'
  4196. _cc_e='-P'
  4197. _flags_filter=icl_flags
  4198. _ld_lib='lib%.a'
  4199. _ld_path='-libpath:'
  4200. # -Qdiag-error to make icl error when seeing certain unknown arguments
  4201. _flags='-nologo -Qdiag-error:4044,10157'
  4202. # -Qvec- -Qsimd- to prevent miscompilation, -GS, fp:precise for consistency
  4203. # with MSVC which enables it by default.
  4204. _cflags='-Qms0 -Qvec- -Qsimd- -GS -fp:precise'
  4205. disable stripping
  4206. elif $_cc -? 2>/dev/null | grep -q 'LLVM.*Linker'; then
  4207. # lld can emulate multiple different linkers; in ms link.exe mode,
  4208. # the -? parameter gives the help output which contains an identifyable
  4209. # string, while it gives an error in other modes.
  4210. _type=lld-link
  4211. # The link.exe mode doesn't have a switch for getting the version,
  4212. # but we can force it back to gnu mode and get the version from there.
  4213. _ident=$($_cc -flavor gnu --version 2>/dev/null)
  4214. _ld_o='-out:$@'
  4215. _flags_filter=msvc_flags
  4216. _ld_lib='lib%.a'
  4217. _ld_path='-libpath:'
  4218. elif $_cc -nologo- 2>&1 | grep -q Microsoft || { $_cc -v 2>&1 | grep -q clang && $_cc -? > /dev/null 2>&1; }; then
  4219. _type=msvc
  4220. _ident=$($_cc 2>&1 | head -n1 | tr -d '\r')
  4221. _DEPCMD='$(DEP$(1)) $(DEP$(1)FLAGS) $($(1)DEP_FLAGS) $< 2>&1 | awk '\''/including/ { sub(/^.*file: */, ""); gsub(/\\/, "/"); if (!match($$0, / /)) print "$@:", $$0 }'\'' > $(@:.o=.d)'
  4222. _DEPFLAGS='$(CPPFLAGS) $(CFLAGS) -showIncludes -Zs'
  4223. _cflags_speed="-O2"
  4224. _cflags_size="-O1"
  4225. _cflags_noopt="-O1"
  4226. if $_cc -nologo- 2>&1 | grep -q Linker; then
  4227. _ld_o='-out:$@'
  4228. else
  4229. _ld_o='-Fe$@'
  4230. fi
  4231. _cc_o='-Fo$@'
  4232. _cc_e='-P -Fi$@'
  4233. _flags_filter=msvc_flags
  4234. _ld_lib='lib%.a'
  4235. _ld_path='-libpath:'
  4236. _flags='-nologo'
  4237. disable stripping
  4238. elif $_cc --version 2>/dev/null | grep -q ^cparser; then
  4239. _type=cparser
  4240. _ident=$($_cc --version | head -n1)
  4241. _depflags='-MMD'
  4242. _cflags_speed='-O4'
  4243. _cflags_size='-O2'
  4244. _flags_filter=cparser_flags
  4245. fi
  4246. eval ${pfx}_type=\$_type
  4247. eval ${pfx}_ident=\$_ident
  4248. }
  4249. set_ccvars(){
  4250. eval ${1}_C=\${_cc_c-\${${1}_C}}
  4251. eval ${1}_E=\${_cc_e-\${${1}_E}}
  4252. eval ${1}_O=\${_cc_o-\${${1}_O}}
  4253. if [ -n "$_depflags" ]; then
  4254. eval ${1}_DEPFLAGS=\$_depflags
  4255. else
  4256. eval ${1}DEP=\${_DEPCMD:-\$DEPCMD}
  4257. eval ${1}DEP_FLAGS=\${_DEPFLAGS:-\$DEPFLAGS}
  4258. eval DEP${1}FLAGS=\$_flags
  4259. fi
  4260. }
  4261. probe_cc cc "$cc" "true"
  4262. cflags_filter=$_flags_filter
  4263. cflags_speed=$_cflags_speed
  4264. cflags_size=$_cflags_size
  4265. cflags_noopt=$_cflags_noopt
  4266. add_cflags $_flags $_cflags
  4267. cc_ldflags=$_ldflags
  4268. set_ccvars CC
  4269. set_ccvars CXX
  4270. probe_cc hostcc "$host_cc"
  4271. host_cflags_filter=$_flags_filter
  4272. host_cflags_speed=$_cflags_speed
  4273. add_host_cflags $_flags $_cflags
  4274. set_ccvars HOSTCC
  4275. test -n "$cc_type" && enable $cc_type ||
  4276. warn "Unknown C compiler $cc, unable to select optimal CFLAGS"
  4277. : ${as_default:=$cc}
  4278. : ${objcc_default:=$cc}
  4279. : ${dep_cc_default:=$cc}
  4280. : ${ld_default:=$cc}
  4281. : ${host_ld_default:=$host_cc}
  4282. set_default ar as objcc dep_cc ld ln_s host_ld windres
  4283. probe_cc as "$as"
  4284. asflags_filter=$_flags_filter
  4285. add_asflags $_flags $_cflags
  4286. set_ccvars AS
  4287. probe_cc objcc "$objcc"
  4288. objcflags_filter=$_flags_filter
  4289. add_objcflags $_flags $_cflags
  4290. set_ccvars OBJC
  4291. probe_cc ld "$ld"
  4292. ldflags_filter=$_flags_filter
  4293. add_ldflags $_flags $_ldflags
  4294. test "$cc_type" != "$ld_type" && add_ldflags $cc_ldflags
  4295. LD_O=${_ld_o-$LD_O}
  4296. LD_LIB=${_ld_lib-$LD_LIB}
  4297. LD_PATH=${_ld_path-$LD_PATH}
  4298. probe_cc hostld "$host_ld"
  4299. host_ldflags_filter=$_flags_filter
  4300. add_host_ldflags $_flags $_ldflags
  4301. HOSTLD_O=${_ld_o-$HOSTLD_O}
  4302. if [ -z "$CC_DEPFLAGS" ] && [ "$dep_cc" != "$cc" ]; then
  4303. probe_cc depcc "$dep_cc"
  4304. CCDEP=${_DEPCMD:-$DEPCMD}
  4305. CCDEP_FLAGS=${_DEPFLAGS:=$DEPFLAGS}
  4306. DEPCCFLAGS=$_flags
  4307. fi
  4308. if $ar 2>&1 | grep -q Microsoft; then
  4309. arflags="-nologo"
  4310. ar_o='-out:$@'
  4311. elif $ar 2>&1 | grep -q "\[D\] "; then
  4312. arflags="rcD"
  4313. ar_o='$@'
  4314. else
  4315. arflags="rc"
  4316. ar_o='$@'
  4317. fi
  4318. add_cflags $extra_cflags
  4319. add_cxxflags $extra_cxxflags
  4320. add_objcflags $extra_objcflags
  4321. add_asflags $extra_cflags
  4322. if test -n "$sysroot"; then
  4323. case "$cc_type" in
  4324. gcc|llvm_gcc|clang)
  4325. add_cppflags --sysroot="$sysroot"
  4326. add_ldflags --sysroot="$sysroot"
  4327. ;;
  4328. esac
  4329. fi
  4330. if test "$cpu" = host; then
  4331. enabled cross_compile &&
  4332. die "--cpu=host makes no sense when cross-compiling."
  4333. case "$cc_type" in
  4334. gcc|llvm_gcc)
  4335. check_native(){
  4336. $cc $1=native -v -c -o $TMPO $TMPC >$TMPE 2>&1 || return
  4337. sed -n "/cc1.*$1=/{
  4338. s/.*$1=\\([^ ]*\\).*/\\1/
  4339. p
  4340. q
  4341. }" $TMPE
  4342. }
  4343. cpu=$(check_native -march || check_native -mcpu)
  4344. ;;
  4345. clang)
  4346. check_native(){
  4347. $cc $1=native -v -c -o $TMPO $TMPC >$TMPE 2>&1 || return
  4348. sed -n "/cc1.*-target-cpu /{
  4349. s/.*-target-cpu \\([^ ]*\\).*/\\1/
  4350. p
  4351. q
  4352. }" $TMPE
  4353. }
  4354. cpu=$(check_native -march)
  4355. ;;
  4356. esac
  4357. test "${cpu:-host}" = host &&
  4358. die "--cpu=host not supported with compiler $cc"
  4359. fi
  4360. # Deal with common $arch aliases
  4361. case "$arch" in
  4362. aarch64|arm64)
  4363. arch="aarch64"
  4364. ;;
  4365. arm*|iPad*|iPhone*)
  4366. arch="arm"
  4367. ;;
  4368. mips*|IP*)
  4369. case "$arch" in
  4370. *el)
  4371. add_cppflags -EL
  4372. add_ldflags -EL
  4373. ;;
  4374. *eb)
  4375. add_cppflags -EB
  4376. add_ldflags -EB
  4377. ;;
  4378. esac
  4379. arch="mips"
  4380. ;;
  4381. parisc*|hppa*)
  4382. arch="parisc"
  4383. ;;
  4384. "Power Macintosh"|ppc*|powerpc*)
  4385. arch="ppc"
  4386. ;;
  4387. s390|s390x)
  4388. arch="s390"
  4389. ;;
  4390. sh4|sh)
  4391. arch="sh4"
  4392. ;;
  4393. sun4*|sparc*)
  4394. arch="sparc"
  4395. ;;
  4396. tilegx|tile-gx)
  4397. arch="tilegx"
  4398. ;;
  4399. i[3-6]86*|i86pc|BePC|x86pc|x86_64|x86_32|amd64)
  4400. arch="x86"
  4401. ;;
  4402. esac
  4403. is_in $arch $ARCH_LIST || warn "unknown architecture $arch"
  4404. enable $arch
  4405. # Add processor-specific flags
  4406. if enabled aarch64; then
  4407. case $cpu in
  4408. armv*)
  4409. cpuflags="-march=$cpu"
  4410. ;;
  4411. *)
  4412. cpuflags="-mcpu=$cpu"
  4413. ;;
  4414. esac
  4415. elif enabled alpha; then
  4416. cpuflags="-mcpu=$cpu"
  4417. elif enabled arm; then
  4418. check_arm_arch() {
  4419. test_cpp_condition stddef.h \
  4420. "defined __ARM_ARCH_${1}__ || defined __TARGET_ARCH_${2:-$1}" \
  4421. $cpuflags
  4422. }
  4423. probe_arm_arch() {
  4424. if check_arm_arch 4; then echo armv4
  4425. elif check_arm_arch 4T; then echo armv4t
  4426. elif check_arm_arch 5; then echo armv5
  4427. elif check_arm_arch 5E; then echo armv5e
  4428. elif check_arm_arch 5T; then echo armv5t
  4429. elif check_arm_arch 5TE; then echo armv5te
  4430. elif check_arm_arch 5TEJ; then echo armv5te
  4431. elif check_arm_arch 6; then echo armv6
  4432. elif check_arm_arch 6J; then echo armv6j
  4433. elif check_arm_arch 6K; then echo armv6k
  4434. elif check_arm_arch 6Z; then echo armv6z
  4435. elif check_arm_arch 6KZ; then echo armv6zk
  4436. elif check_arm_arch 6ZK; then echo armv6zk
  4437. elif check_arm_arch 6T2; then echo armv6t2
  4438. elif check_arm_arch 7; then echo armv7
  4439. elif check_arm_arch 7A 7_A; then echo armv7-a
  4440. elif check_arm_arch 7S; then echo armv7-a
  4441. elif check_arm_arch 7R 7_R; then echo armv7-r
  4442. elif check_arm_arch 7M 7_M; then echo armv7-m
  4443. elif check_arm_arch 7EM 7E_M; then echo armv7-m
  4444. elif check_arm_arch 8A 8_A; then echo armv8-a
  4445. fi
  4446. }
  4447. [ "$cpu" = generic ] && cpu=$(probe_arm_arch)
  4448. case $cpu in
  4449. armv*)
  4450. cpuflags="-march=$cpu"
  4451. subarch=$(echo $cpu | sed 's/[^a-z0-9]//g')
  4452. ;;
  4453. *)
  4454. cpuflags="-mcpu=$cpu"
  4455. case $cpu in
  4456. cortex-a*) subarch=armv7a ;;
  4457. cortex-r*) subarch=armv7r ;;
  4458. cortex-m*) enable thumb; subarch=armv7m ;;
  4459. arm11*) subarch=armv6 ;;
  4460. arm[79]*e*|arm9[24]6*|arm96*|arm102[26]) subarch=armv5te ;;
  4461. armv4*|arm7*|arm9[24]*) subarch=armv4 ;;
  4462. *) subarch=$(probe_arm_arch) ;;
  4463. esac
  4464. ;;
  4465. esac
  4466. case "$subarch" in
  4467. armv5t*) enable fast_clz ;;
  4468. armv[6-8]*)
  4469. enable fast_clz
  4470. disabled fast_unaligned || enable fast_unaligned
  4471. ;;
  4472. esac
  4473. elif enabled avr32; then
  4474. case $cpu in
  4475. ap7[02]0[0-2])
  4476. subarch="avr32_ap"
  4477. cpuflags="-mpart=$cpu"
  4478. ;;
  4479. ap)
  4480. subarch="avr32_ap"
  4481. cpuflags="-march=$cpu"
  4482. ;;
  4483. uc3[ab]*)
  4484. subarch="avr32_uc"
  4485. cpuflags="-mcpu=$cpu"
  4486. ;;
  4487. uc)
  4488. subarch="avr32_uc"
  4489. cpuflags="-march=$cpu"
  4490. ;;
  4491. esac
  4492. elif enabled bfin; then
  4493. cpuflags="-mcpu=$cpu"
  4494. elif enabled mips; then
  4495. cpuflags="-march=$cpu"
  4496. if [ "$cpu" != "generic" ]; then
  4497. disable mips32r2
  4498. disable mips32r5
  4499. disable mips64r2
  4500. disable mips32r6
  4501. disable mips64r6
  4502. disable loongson2
  4503. disable loongson3
  4504. case $cpu in
  4505. 24kc|24kf*|24kec|34kc|1004kc|24kef*|34kf*|1004kf*|74kc|74kf)
  4506. enable mips32r2
  4507. disable msa
  4508. ;;
  4509. p5600|i6400|p6600)
  4510. disable mipsdsp
  4511. disable mipsdspr2
  4512. ;;
  4513. loongson*)
  4514. enable loongson2
  4515. enable loongson3
  4516. enable local_aligned
  4517. enable simd_align_16
  4518. enable fast_64bit
  4519. enable fast_clz
  4520. enable fast_cmov
  4521. enable fast_unaligned
  4522. disable aligned_stack
  4523. disable mipsdsp
  4524. disable mipsdspr2
  4525. # When gcc version less than 5.3.0, add -fno-expensive-optimizations flag.
  4526. if [ $cc == gcc ]; then
  4527. gcc_version=$(gcc -dumpversion)
  4528. if [ "$(echo "$gcc_version 5.3.0" | tr " " "\n" | sort -rV | head -n 1)" == "$gcc_version" ]; then
  4529. expensive_optimization_flag=""
  4530. else
  4531. expensive_optimization_flag="-fno-expensive-optimizations"
  4532. fi
  4533. fi
  4534. case $cpu in
  4535. loongson3*)
  4536. cpuflags="-march=loongson3a -mhard-float $expensive_optimization_flag"
  4537. ;;
  4538. loongson2e)
  4539. cpuflags="-march=loongson2e -mhard-float $expensive_optimization_flag"
  4540. ;;
  4541. loongson2f)
  4542. cpuflags="-march=loongson2f -mhard-float $expensive_optimization_flag"
  4543. ;;
  4544. esac
  4545. ;;
  4546. *)
  4547. # Unknown CPU. Disable everything.
  4548. warn "unknown CPU. Disabling all MIPS optimizations."
  4549. disable mipsfpu
  4550. disable mipsdsp
  4551. disable mipsdspr2
  4552. disable msa
  4553. disable mmi
  4554. ;;
  4555. esac
  4556. case $cpu in
  4557. 24kc)
  4558. disable mipsfpu
  4559. disable mipsdsp
  4560. disable mipsdspr2
  4561. ;;
  4562. 24kf*)
  4563. disable mipsdsp
  4564. disable mipsdspr2
  4565. ;;
  4566. 24kec|34kc|1004kc)
  4567. disable mipsfpu
  4568. disable mipsdspr2
  4569. ;;
  4570. 24kef*|34kf*|1004kf*)
  4571. disable mipsdspr2
  4572. ;;
  4573. 74kc)
  4574. disable mipsfpu
  4575. ;;
  4576. p5600)
  4577. enable mips32r5
  4578. check_cflags "-mtune=p5600" && check_cflags "-msched-weight -mload-store-pairs -funroll-loops"
  4579. ;;
  4580. i6400)
  4581. enable mips64r6
  4582. check_cflags "-mtune=i6400 -mabi=64" && check_cflags "-msched-weight -mload-store-pairs -funroll-loops" && check_ldflags "-mabi=64"
  4583. ;;
  4584. p6600)
  4585. enable mips64r6
  4586. check_cflags "-mtune=p6600 -mabi=64" && check_cflags "-msched-weight -mload-store-pairs -funroll-loops" && check_ldflags "-mabi=64"
  4587. ;;
  4588. esac
  4589. else
  4590. # We do not disable anything. Is up to the user to disable the unwanted features.
  4591. warn 'generic cpu selected'
  4592. fi
  4593. elif enabled ppc; then
  4594. disable ldbrx
  4595. case $(tolower $cpu) in
  4596. 601|ppc601|powerpc601)
  4597. cpuflags="-mcpu=601"
  4598. disable altivec
  4599. ;;
  4600. 603*|ppc603*|powerpc603*)
  4601. cpuflags="-mcpu=603"
  4602. disable altivec
  4603. ;;
  4604. 604*|ppc604*|powerpc604*)
  4605. cpuflags="-mcpu=604"
  4606. disable altivec
  4607. ;;
  4608. g3|75*|ppc75*|powerpc75*)
  4609. cpuflags="-mcpu=750"
  4610. disable altivec
  4611. ;;
  4612. g4|745*|ppc745*|powerpc745*)
  4613. cpuflags="-mcpu=7450"
  4614. disable vsx
  4615. ;;
  4616. 74*|ppc74*|powerpc74*)
  4617. cpuflags="-mcpu=7400"
  4618. disable vsx
  4619. ;;
  4620. g5|970|ppc970|powerpc970)
  4621. cpuflags="-mcpu=970"
  4622. disable vsx
  4623. ;;
  4624. power[3-6]*)
  4625. cpuflags="-mcpu=$cpu"
  4626. disable vsx
  4627. ;;
  4628. power[7-8]*)
  4629. cpuflags="-mcpu=$cpu"
  4630. ;;
  4631. cell)
  4632. cpuflags="-mcpu=cell"
  4633. enable ldbrx
  4634. disable vsx
  4635. ;;
  4636. e500mc)
  4637. cpuflags="-mcpu=e500mc"
  4638. disable altivec
  4639. ;;
  4640. e500v2)
  4641. cpuflags="-mcpu=8548 -mhard-float -mfloat-gprs=double"
  4642. disable altivec
  4643. disable dcbzl
  4644. ;;
  4645. e500)
  4646. cpuflags="-mcpu=8540 -mhard-float"
  4647. disable altivec
  4648. disable dcbzl
  4649. ;;
  4650. esac
  4651. elif enabled sparc; then
  4652. case $cpu in
  4653. cypress|f93[04]|tsc701|sparcl*|supersparc|hypersparc|niagara|v[789])
  4654. cpuflags="-mcpu=$cpu"
  4655. ;;
  4656. ultrasparc*|niagara[234])
  4657. cpuflags="-mcpu=$cpu"
  4658. ;;
  4659. esac
  4660. elif enabled x86; then
  4661. case $cpu in
  4662. i[345]86|pentium)
  4663. cpuflags="-march=$cpu"
  4664. disable i686
  4665. disable mmx
  4666. ;;
  4667. # targets that do NOT support nopl and conditional mov (cmov)
  4668. pentium-mmx|k6|k6-[23]|winchip-c6|winchip2|c3)
  4669. cpuflags="-march=$cpu"
  4670. disable i686
  4671. ;;
  4672. # targets that do support nopl and conditional mov (cmov)
  4673. i686|pentiumpro|pentium[23]|pentium-m|athlon|athlon-tbird|athlon-4|athlon-[mx]p|athlon64*|k8*|opteron*|athlon-fx\
  4674. |core*|atom|bonnell|nehalem|westmere|silvermont|sandybridge|ivybridge|haswell|broadwell|skylake*|knl\
  4675. |amdfam10|barcelona|b[dt]ver*|znver*)
  4676. cpuflags="-march=$cpu"
  4677. enable i686
  4678. enable fast_cmov
  4679. ;;
  4680. # targets that do support conditional mov but on which it's slow
  4681. pentium4|pentium4m|prescott|nocona)
  4682. cpuflags="-march=$cpu"
  4683. enable i686
  4684. disable fast_cmov
  4685. ;;
  4686. esac
  4687. fi
  4688. if [ "$cpu" != generic ]; then
  4689. add_cflags $cpuflags
  4690. add_asflags $cpuflags
  4691. test "$cc_type" = "$ld_type" && add_ldflags $cpuflags
  4692. fi
  4693. # compiler sanity check
  4694. test_exec <<EOF
  4695. int main(void){ return 0; }
  4696. EOF
  4697. if test "$?" != 0; then
  4698. echo "$cc is unable to create an executable file."
  4699. if test -z "$cross_prefix" && ! enabled cross_compile ; then
  4700. echo "If $cc is a cross-compiler, use the --enable-cross-compile option."
  4701. echo "Only do this if you know what cross compiling means."
  4702. fi
  4703. die "C compiler test failed."
  4704. fi
  4705. add_cppflags -D_ISOC99_SOURCE
  4706. add_cxxflags -D__STDC_CONSTANT_MACROS
  4707. check_cxxflags -std=c++11 || check_cxxflags -std=c++0x
  4708. # some compilers silently accept -std=c11, so we also need to check that the
  4709. # version macro is defined properly
  4710. test_cflags_cc -std=c11 ctype.h "__STDC_VERSION__ >= 201112L" &&
  4711. add_cflags -std=c11 ||
  4712. check_cflags -std=c99
  4713. check_cppflags -D_FILE_OFFSET_BITS=64
  4714. check_cppflags -D_LARGEFILE_SOURCE
  4715. add_host_cppflags -D_ISOC99_SOURCE
  4716. check_host_cflags -std=c99
  4717. check_host_cflags -Wall
  4718. check_host_cflags $host_cflags_speed
  4719. check_64bit(){
  4720. arch32=$1
  4721. arch64=$2
  4722. expr=${3:-'sizeof(void *) > 4'}
  4723. test_code cc "" "int test[2*($expr) - 1]" &&
  4724. subarch=$arch64 || subarch=$arch32
  4725. enable $subarch
  4726. }
  4727. case "$arch" in
  4728. aarch64|alpha|ia64)
  4729. enabled shared && enable_weak pic
  4730. ;;
  4731. mips)
  4732. check_64bit mips mips64 '_MIPS_SIM > 1'
  4733. enabled shared && enable_weak pic
  4734. ;;
  4735. parisc)
  4736. check_64bit parisc parisc64
  4737. enabled shared && enable_weak pic
  4738. ;;
  4739. ppc)
  4740. check_64bit ppc ppc64
  4741. enabled shared && enable_weak pic
  4742. ;;
  4743. s390)
  4744. check_64bit s390 s390x
  4745. enabled shared && enable_weak pic
  4746. ;;
  4747. sparc)
  4748. check_64bit sparc sparc64
  4749. enabled shared && enable_weak pic
  4750. ;;
  4751. x86)
  4752. check_64bit x86_32 x86_64
  4753. # Treat x32 as x64 for now. Note it also needs pic if shared
  4754. test "$subarch" = "x86_32" && test_cpp_condition stddef.h 'defined(__x86_64__)' &&
  4755. subarch=x86_64 && enable x86_64 && disable x86_32
  4756. if enabled x86_64; then
  4757. enabled shared && enable_weak pic
  4758. objformat=elf64
  4759. fi
  4760. ;;
  4761. esac
  4762. # OS specific
  4763. case $target_os in
  4764. aix)
  4765. SHFLAGS=-shared
  4766. add_cppflags '-I\$(SRC_PATH)/compat/aix'
  4767. enabled shared && add_ldflags -Wl,-brtl
  4768. arflags='-Xany -r -c'
  4769. striptype=""
  4770. ;;
  4771. android)
  4772. disable symver
  4773. enable section_data_rel_ro
  4774. add_cflags -fPIE
  4775. add_ldexeflags -fPIE -pie
  4776. SLIB_INSTALL_NAME='$(SLIBNAME)'
  4777. SLIB_INSTALL_LINKS=
  4778. SHFLAGS='-shared -Wl,-soname,$(SLIBNAME)'
  4779. ;;
  4780. haiku)
  4781. prefix_default="/boot/common"
  4782. network_extralibs="-lnetwork"
  4783. host_extralibs=
  4784. ;;
  4785. sunos)
  4786. SHFLAGS='-shared -Wl,-h,$$(@F)'
  4787. enabled x86 && append SHFLAGS -mimpure-text
  4788. network_extralibs="-lsocket -lnsl"
  4789. add_cppflags -D__EXTENSIONS__
  4790. # When using suncc to build, the Solaris linker will mark
  4791. # an executable with each instruction set encountered by
  4792. # the Solaris assembler. As our libraries contain their own
  4793. # guards for processor-specific code, instead suppress
  4794. # generation of the HWCAPS ELF section on Solaris x86 only.
  4795. enabled_all suncc x86 &&
  4796. echo "hwcap_1 = OVERRIDE;" > mapfile &&
  4797. add_ldflags -Wl,-M,mapfile
  4798. nm_default='nm -P -g'
  4799. striptype=""
  4800. version_script='-M'
  4801. VERSION_SCRIPT_POSTPROCESS_CMD='perl $(SRC_PATH)/compat/solaris/make_sunver.pl - $(OBJS)'
  4802. ;;
  4803. netbsd)
  4804. disable symver
  4805. oss_indev_extralibs="-lossaudio"
  4806. oss_outdev_extralibs="-lossaudio"
  4807. enabled gcc || check_ldflags -Wl,-zmuldefs
  4808. ;;
  4809. openbsd|bitrig)
  4810. disable symver
  4811. striptype=""
  4812. SHFLAGS='-shared'
  4813. SLIB_INSTALL_NAME='$(SLIBNAME).$(LIBMAJOR).$(LIBMINOR)'
  4814. SLIB_INSTALL_LINKS=
  4815. oss_indev_extralibs="-lossaudio"
  4816. oss_outdev_extralibs="-lossaudio"
  4817. ;;
  4818. dragonfly)
  4819. disable symver
  4820. ;;
  4821. freebsd)
  4822. ;;
  4823. bsd/os)
  4824. add_extralibs -lpoll -lgnugetopt
  4825. strip="strip -d"
  4826. ;;
  4827. darwin)
  4828. enabled ppc && add_asflags -force_cpusubtype_ALL
  4829. install_name_dir_default='$(SHLIBDIR)'
  4830. SHFLAGS='-dynamiclib -Wl,-single_module -Wl,-install_name,$(INSTALL_NAME_DIR)/$(SLIBNAME_WITH_MAJOR),-current_version,$(LIBVERSION),-compatibility_version,$(LIBMAJOR)'
  4831. enabled x86_32 && append SHFLAGS -Wl,-read_only_relocs,suppress
  4832. strip="${strip} -x"
  4833. add_ldflags -Wl,-dynamic,-search_paths_first
  4834. check_cflags -Werror=partial-availability
  4835. SLIBSUF=".dylib"
  4836. SLIBNAME_WITH_VERSION='$(SLIBPREF)$(FULLNAME).$(LIBVERSION)$(SLIBSUF)'
  4837. SLIBNAME_WITH_MAJOR='$(SLIBPREF)$(FULLNAME).$(LIBMAJOR)$(SLIBSUF)'
  4838. enabled x86_64 && objformat="macho64" || objformat="macho32"
  4839. enabled_any pic shared x86_64 ||
  4840. { check_cflags -mdynamic-no-pic && add_asflags -mdynamic-no-pic; }
  4841. check_headers dispatch/dispatch.h &&
  4842. add_cppflags '-I\$(SRC_PATH)/compat/dispatch_semaphore'
  4843. if test -n "$sysroot"; then
  4844. is_in -isysroot $cc $CPPFLAGS $CFLAGS || check_cppflags -isysroot $sysroot
  4845. is_in -isysroot $ld $LDFLAGS || check_ldflags -isysroot $sysroot
  4846. fi
  4847. version_script='-exported_symbols_list'
  4848. VERSION_SCRIPT_POSTPROCESS_CMD='tr " " "\n" | sed -n /global:/,/local:/p | grep ";" | tr ";" "\n" | sed -E "s/(.+)/_\1/g" | sed -E "s/(.+[^*])$$$$/\1*/"'
  4849. ;;
  4850. msys*)
  4851. die "Native MSYS builds are discouraged, please use the MINGW environment."
  4852. ;;
  4853. mingw32*|mingw64*)
  4854. target_os=mingw32
  4855. LIBTARGET=i386
  4856. if enabled x86_64; then
  4857. LIBTARGET="i386:x86-64"
  4858. elif enabled arm; then
  4859. LIBTARGET="arm"
  4860. elif enabled aarch64; then
  4861. LIBTARGET="arm64"
  4862. fi
  4863. if enabled shared; then
  4864. # Cannot build both shared and static libs when using dllimport.
  4865. disable static
  4866. fi
  4867. enabled shared && ! enabled small && test_cmd $windres --version && enable gnu_windres
  4868. enabled x86_32 && check_ldflags -Wl,--large-address-aware
  4869. shlibdir_default="$bindir_default"
  4870. SLIBPREF=""
  4871. SLIBSUF=".dll"
  4872. SLIBNAME_WITH_VERSION='$(SLIBPREF)$(FULLNAME)-$(LIBVERSION)$(SLIBSUF)'
  4873. SLIBNAME_WITH_MAJOR='$(SLIBPREF)$(FULLNAME)-$(LIBMAJOR)$(SLIBSUF)'
  4874. if test_cmd lib.exe -list; then
  4875. SLIB_EXTRA_CMD=-'lib.exe -nologo -machine:$(LIBTARGET) -def:$$(@:$(SLIBSUF)=.def) -out:$(SUBDIR)$(SLIBNAME:$(SLIBSUF)=.lib)'
  4876. if enabled x86_64; then
  4877. LIBTARGET=x64
  4878. fi
  4879. else
  4880. SLIB_EXTRA_CMD=-'$(DLLTOOL) -m $(LIBTARGET) -d $$(@:$(SLIBSUF)=.def) -l $(SUBDIR)$(SLIBNAME:$(SLIBSUF)=.lib) -D $(SLIBNAME_WITH_MAJOR)'
  4881. fi
  4882. SLIB_INSTALL_NAME='$(SLIBNAME_WITH_MAJOR)'
  4883. SLIB_INSTALL_LINKS=
  4884. SLIB_INSTALL_EXTRA_SHLIB='$(SLIBNAME:$(SLIBSUF)=.lib)'
  4885. SLIB_INSTALL_EXTRA_LIB='lib$(SLIBNAME:$(SLIBSUF)=.dll.a) $(SLIBNAME_WITH_MAJOR:$(SLIBSUF)=.def)'
  4886. 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)'
  4887. SHFLAGS='-shared -Wl,--out-implib,$(SUBDIR)lib$(SLIBNAME:$(SLIBSUF)=.dll.a) -Wl,--disable-auto-image-base $$(@:$(SLIBSUF)=.def)'
  4888. enabled x86_64 && objformat="win64" || objformat="win32"
  4889. dlltool="${cross_prefix}dlltool"
  4890. ranlib=:
  4891. enable dos_paths
  4892. check_ldflags -Wl,--nxcompat,--dynamicbase
  4893. # Lets work around some stupidity in binutils.
  4894. # ld will strip relocations from executables even though we need them
  4895. # for dynamicbase (ASLR). Using -pie does retain the reloc section
  4896. # however ld then forgets what the entry point should be (oops) so we
  4897. # have to manually (re)set it.
  4898. if enabled x86_32; then
  4899. disabled debug && add_ldexeflags -Wl,--pic-executable,-e,_mainCRTStartup
  4900. elif enabled x86_64; then
  4901. disabled debug && add_ldexeflags -Wl,--pic-executable,-e,mainCRTStartup
  4902. check_ldflags -Wl,--high-entropy-va # binutils 2.25
  4903. # Set image base >4GB for extra entropy with HEASLR
  4904. add_ldexeflags -Wl,--image-base,0x140000000
  4905. append SHFLAGS -Wl,--image-base,0x180000000
  4906. fi
  4907. ;;
  4908. win32|win64)
  4909. disable symver
  4910. if enabled shared; then
  4911. # Link to the import library instead of the normal static library
  4912. # for shared libs.
  4913. LD_LIB='%.lib'
  4914. # Cannot build both shared and static libs with MSVC or icl.
  4915. disable static
  4916. fi
  4917. enabled x86_32 && check_ldflags -LARGEADDRESSAWARE
  4918. shlibdir_default="$bindir_default"
  4919. SLIBPREF=""
  4920. SLIBSUF=".dll"
  4921. SLIBNAME_WITH_VERSION='$(SLIBPREF)$(FULLNAME)-$(LIBVERSION)$(SLIBSUF)'
  4922. SLIBNAME_WITH_MAJOR='$(SLIBPREF)$(FULLNAME)-$(LIBMAJOR)$(SLIBSUF)'
  4923. SLIB_CREATE_DEF_CMD='EXTERN_PREFIX="$(EXTERN_PREFIX)" $(SRC_PATH)/compat/windows/makedef $(SUBDIR)lib$(NAME).ver $(OBJS) > $$(@:$(SLIBSUF)=.def)'
  4924. SLIB_INSTALL_NAME='$(SLIBNAME_WITH_MAJOR)'
  4925. SLIB_INSTALL_LINKS=
  4926. SLIB_INSTALL_EXTRA_SHLIB='$(SLIBNAME:$(SLIBSUF)=.lib)'
  4927. SLIB_INSTALL_EXTRA_LIB='$(SLIBNAME_WITH_MAJOR:$(SLIBSUF)=.def)'
  4928. SHFLAGS='-dll -def:$$(@:$(SLIBSUF)=.def) -implib:$(SUBDIR)$(SLIBNAME:$(SLIBSUF)=.lib)'
  4929. enabled x86_64 && objformat="win64" || objformat="win32"
  4930. ranlib=:
  4931. enable dos_paths
  4932. ;;
  4933. cygwin*)
  4934. target_os=cygwin
  4935. shlibdir_default="$bindir_default"
  4936. SLIBPREF="cyg"
  4937. SLIBSUF=".dll"
  4938. SLIBNAME_WITH_VERSION='$(SLIBPREF)$(FULLNAME)-$(LIBVERSION)$(SLIBSUF)'
  4939. SLIBNAME_WITH_MAJOR='$(SLIBPREF)$(FULLNAME)-$(LIBMAJOR)$(SLIBSUF)'
  4940. SLIB_INSTALL_NAME='$(SLIBNAME_WITH_MAJOR)'
  4941. SLIB_INSTALL_LINKS=
  4942. SLIB_INSTALL_EXTRA_LIB='lib$(FULLNAME).dll.a'
  4943. SHFLAGS='-shared -Wl,--out-implib,$(SUBDIR)lib$(FULLNAME).dll.a'
  4944. enabled x86_64 && objformat="win64" || objformat="win32"
  4945. enable dos_paths
  4946. enabled shared && ! enabled small && test_cmd $windres --version && enable gnu_windres
  4947. add_cppflags -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600
  4948. ;;
  4949. *-dos|freedos|opendos)
  4950. network_extralibs="-lsocket"
  4951. objformat="coff"
  4952. enable dos_paths
  4953. ;;
  4954. linux)
  4955. enable section_data_rel_ro
  4956. enabled_any arm aarch64 && enable_weak linux_perf
  4957. ;;
  4958. irix*)
  4959. target_os=irix
  4960. ranlib="echo ignoring ranlib"
  4961. ;;
  4962. os/2*)
  4963. strip="lxlite -CS"
  4964. striptype=""
  4965. objformat="aout"
  4966. add_cppflags -D_GNU_SOURCE
  4967. add_ldflags -Zomf -Zbin-files -Zargs-wild -Zhigh-mem -Zmap
  4968. SHFLAGS='$(SUBDIR)$(NAME).def -Zdll -Zomf'
  4969. LIBSUF="_s.a"
  4970. SLIBPREF=""
  4971. SLIBSUF=".dll"
  4972. SLIBNAME_WITH_VERSION='$(SLIBPREF)$(FULLNAME)-$(LIBVERSION)$(SLIBSUF)'
  4973. SLIBNAME_WITH_MAJOR='$(SLIBPREF)$(shell echo $(FULLNAME) | cut -c1-6)$(LIBMAJOR)$(SLIBSUF)'
  4974. SLIB_CREATE_DEF_CMD='echo LIBRARY $(SLIBNAME_WITH_MAJOR:$(SLIBSUF)=) INITINSTANCE TERMINSTANCE > $(SUBDIR)$(FULLNAME).def; \
  4975. echo CODE PRELOAD MOVEABLE DISCARDABLE >> $(SUBDIR)$(FULLNAME).def; \
  4976. echo DATA PRELOAD MOVEABLE MULTIPLE NONSHARED >> $(SUBDIR)$(FULLNAME).def; \
  4977. echo EXPORTS >> $(SUBDIR)$(FULLNAME).def; \
  4978. emxexp $(OBJS) >> $(SUBDIR)$(FULLNAME).def'
  4979. SLIB_EXTRA_CMD='emximp -o $(SUBDIR)$(LIBPREF)$(FULLNAME)_dll.a $(SUBDIR)$(FULLNAME).def; \
  4980. emximp -o $(SUBDIR)$(LIBPREF)$(FULLNAME)_dll.lib $(SUBDIR)$(FULLNAME).def;'
  4981. SLIB_INSTALL_NAME='$(SLIBNAME_WITH_MAJOR)'
  4982. SLIB_INSTALL_LINKS=
  4983. SLIB_INSTALL_EXTRA_LIB='$(LIBPREF)$(FULLNAME)_dll.a $(LIBPREF)$(FULLNAME)_dll.lib'
  4984. enable dos_paths
  4985. enable_weak os2threads
  4986. ;;
  4987. gnu/kfreebsd)
  4988. add_cppflags -D_BSD_SOURCE
  4989. ;;
  4990. gnu)
  4991. ;;
  4992. qnx)
  4993. add_cppflags -D_QNX_SOURCE
  4994. network_extralibs="-lsocket"
  4995. ;;
  4996. symbian)
  4997. SLIBSUF=".dll"
  4998. enable dos_paths
  4999. add_cflags --include=$sysinclude/gcce/gcce.h -fvisibility=default
  5000. add_cppflags -D__GCCE__ -D__SYMBIAN32__ -DSYMBIAN_OE_POSIX_SIGNALS
  5001. add_ldflags -Wl,--target1-abs,--no-undefined \
  5002. -Wl,-Ttext,0x80000,-Tdata,0x1000000 -shared \
  5003. -Wl,--entry=_E32Startup -Wl,-u,_E32Startup
  5004. add_extralibs -l:eexe.lib -l:usrt2_2.lib -l:dfpaeabi.dso \
  5005. -l:drtaeabi.dso -l:scppnwdl.dso -lsupc++ -lgcc \
  5006. -l:libc.dso -l:libm.dso -l:euser.dso -l:libcrt0.lib
  5007. ;;
  5008. minix)
  5009. ;;
  5010. none)
  5011. ;;
  5012. *)
  5013. die "Unknown OS '$target_os'."
  5014. ;;
  5015. esac
  5016. # test if creating links works
  5017. link_dest=$(mktemp -u $TMPDIR/dest_XXXXXXXX)
  5018. link_name=$(mktemp -u $TMPDIR/name_XXXXXXXX)
  5019. mkdir "$link_dest"
  5020. $ln_s "$link_dest" "$link_name"
  5021. touch "$link_dest/test_file"
  5022. if [ "$source_path" != "." ] && [ "$source_path" != "src" ] && ([ ! -d src ] || [ -L src ]) && [ -e "$link_name/test_file" ]; then
  5023. # create link to source path
  5024. [ -e src ] && rm src
  5025. $ln_s "$source_path" src
  5026. source_link=src
  5027. else
  5028. # creating directory links doesn't work
  5029. # fall back to using the full source path
  5030. source_link="$source_path"
  5031. fi
  5032. # cleanup
  5033. rm -r "$link_dest"
  5034. rm -r "$link_name"
  5035. # determine libc flavour
  5036. probe_libc(){
  5037. pfx=$1
  5038. pfx_no_=${pfx%_}
  5039. # uclibc defines __GLIBC__, so it needs to be checked before glibc.
  5040. if test_${pfx}cpp_condition features.h "defined __UCLIBC__"; then
  5041. eval ${pfx}libc_type=uclibc
  5042. add_${pfx}cppflags -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600
  5043. elif test_${pfx}cpp_condition features.h "defined __GLIBC__"; then
  5044. eval ${pfx}libc_type=glibc
  5045. add_${pfx}cppflags -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600
  5046. # MinGW headers can be installed on Cygwin, so check for newlib first.
  5047. elif test_${pfx}cpp_condition newlib.h "defined _NEWLIB_VERSION"; then
  5048. eval ${pfx}libc_type=newlib
  5049. add_${pfx}cppflags -U__STRICT_ANSI__ -D_XOPEN_SOURCE=600
  5050. # MinGW64 is backwards compatible with MinGW32, so check for it first.
  5051. elif test_${pfx}cpp_condition _mingw.h "defined __MINGW64_VERSION_MAJOR"; then
  5052. eval ${pfx}libc_type=mingw64
  5053. if test_${pfx}cpp_condition _mingw.h "__MINGW64_VERSION_MAJOR < 3"; then
  5054. add_compat msvcrt/snprintf.o
  5055. add_cflags "-include $source_path/compat/msvcrt/snprintf.h"
  5056. fi
  5057. add_${pfx}cppflags -U__STRICT_ANSI__ -D__USE_MINGW_ANSI_STDIO=1
  5058. eval test \$${pfx_no_}cc_type = "gcc" &&
  5059. add_${pfx}cppflags -D__printf__=__gnu_printf__
  5060. test_${pfx}cpp_condition windows.h "!defined(_WIN32_WINNT) || _WIN32_WINNT < 0x0600" &&
  5061. add_${pfx}cppflags -D_WIN32_WINNT=0x0600
  5062. add_${pfx}cppflags -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600
  5063. elif test_${pfx}cpp_condition _mingw.h "defined __MINGW_VERSION" ||
  5064. test_${pfx}cpp_condition _mingw.h "defined __MINGW32_VERSION"; then
  5065. eval ${pfx}libc_type=mingw32
  5066. test_${pfx}cpp_condition _mingw.h "__MINGW32_MAJOR_VERSION > 3 || \
  5067. (__MINGW32_MAJOR_VERSION == 3 && __MINGW32_MINOR_VERSION >= 15)" ||
  5068. die "ERROR: MinGW32 runtime version must be >= 3.15."
  5069. add_${pfx}cppflags -U__STRICT_ANSI__ -D__USE_MINGW_ANSI_STDIO=1
  5070. test_${pfx}cpp_condition _mingw.h "__MSVCRT_VERSION__ < 0x0700" &&
  5071. add_${pfx}cppflags -D__MSVCRT_VERSION__=0x0700
  5072. test_${pfx}cpp_condition windows.h "!defined(_WIN32_WINNT) || _WIN32_WINNT < 0x0600" &&
  5073. add_${pfx}cppflags -D_WIN32_WINNT=0x0600
  5074. eval test \$${pfx_no_}cc_type = "gcc" &&
  5075. add_${pfx}cppflags -D__printf__=__gnu_printf__
  5076. add_${pfx}cppflags -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600
  5077. elif test_${pfx}cpp_condition crtversion.h "defined _VC_CRT_MAJOR_VERSION"; then
  5078. eval ${pfx}libc_type=msvcrt
  5079. if test_${pfx}cpp_condition crtversion.h "_VC_CRT_MAJOR_VERSION < 14"; then
  5080. if [ "$pfx" = host_ ]; then
  5081. add_host_cppflags -Dsnprintf=_snprintf
  5082. else
  5083. add_compat strtod.o strtod=avpriv_strtod
  5084. add_compat msvcrt/snprintf.o snprintf=avpriv_snprintf \
  5085. _snprintf=avpriv_snprintf \
  5086. vsnprintf=avpriv_vsnprintf
  5087. fi
  5088. fi
  5089. add_${pfx}cppflags -D_USE_MATH_DEFINES -D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_WARNINGS
  5090. # The MSVC 2010 headers (Win 7.0 SDK) set _WIN32_WINNT to
  5091. # 0x601 by default unless something else is set by the user.
  5092. # This can easily lead to us detecting functions only present
  5093. # in such new versions and producing binaries requiring windows 7.0.
  5094. # Therefore explicitly set the default to Vista unless the user has
  5095. # set something else on the command line.
  5096. # Don't do this if WINAPI_FAMILY is set and is set to a non-desktop
  5097. # family. For these cases, configure is free to use any functions
  5098. # found in the SDK headers by default. (Alternatively, we could force
  5099. # _WIN32_WINNT to 0x0602 in that case.)
  5100. test_${pfx}cpp_condition stdlib.h "defined(_WIN32_WINNT)" ||
  5101. { test_${pfx}cpp <<EOF && add_${pfx}cppflags -D_WIN32_WINNT=0x0600; }
  5102. #ifdef WINAPI_FAMILY
  5103. #include <winapifamily.h>
  5104. #if !WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
  5105. #error not desktop
  5106. #endif
  5107. #endif
  5108. EOF
  5109. if [ "$pfx" = "" ]; then
  5110. check_func strtoll || add_cflags -Dstrtoll=_strtoi64
  5111. check_func strtoull || add_cflags -Dstrtoull=_strtoui64
  5112. fi
  5113. elif test_${pfx}cpp_condition stddef.h "defined __KLIBC__"; then
  5114. eval ${pfx}libc_type=klibc
  5115. elif test_${pfx}cpp_condition sys/cdefs.h "defined __BIONIC__"; then
  5116. eval ${pfx}libc_type=bionic
  5117. elif test_${pfx}cpp_condition sys/brand.h "defined LABELED_BRAND_NAME"; then
  5118. eval ${pfx}libc_type=solaris
  5119. add_${pfx}cppflags -D__EXTENSIONS__ -D_XOPEN_SOURCE=600
  5120. elif test_${pfx}cpp_condition sys/version.h "defined __DJGPP__"; then
  5121. eval ${pfx}libc_type=djgpp
  5122. add_cppflags -U__STRICT_ANSI__
  5123. add_cflags "-include $source_path/compat/djgpp/math.h"
  5124. add_compat djgpp/math.o
  5125. fi
  5126. test_${pfx}cc <<EOF
  5127. #include <time.h>
  5128. void *v = localtime_r;
  5129. EOF
  5130. 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
  5131. #include <time.h>
  5132. void *v = localtime_r;
  5133. EOF
  5134. eval test -n "\${${pfx}libc_type}" && enable ${pfx}libc_${libc_type}
  5135. }
  5136. probe_libc
  5137. probe_libc host_
  5138. # hacks for compiler/libc/os combinations
  5139. case $libc_type in
  5140. bionic)
  5141. add_compat strtod.o strtod=avpriv_strtod
  5142. ;;
  5143. esac
  5144. check_compile_assert flt_lim "float.h limits.h" "DBL_MAX == (double)DBL_MAX" ||
  5145. add_cppflags '-I\$(SRC_PATH)/compat/float'
  5146. test_cpp_condition stdlib.h "defined(__PIC__) || defined(__pic__) || defined(PIC)" && enable_weak pic
  5147. set_default libdir
  5148. : ${shlibdir_default:="$libdir"}
  5149. : ${pkgconfigdir_default:="$libdir/pkgconfig"}
  5150. set_default $PATHS_LIST
  5151. set_default nm
  5152. disabled optimizations || enabled ossfuzz || check_cflags -fomit-frame-pointer
  5153. enable_weak_pic() {
  5154. disabled pic && return
  5155. enable pic
  5156. add_cppflags -DPIC
  5157. case "$target_os" in
  5158. mingw*|cygwin*|win*)
  5159. ;;
  5160. *)
  5161. add_cflags -fPIC
  5162. add_asflags -fPIC
  5163. ;;
  5164. esac
  5165. }
  5166. enabled pic && enable_weak_pic
  5167. test_cc <<EOF || die "Symbol mangling check failed."
  5168. int ff_extern;
  5169. EOF
  5170. sym=$($nm $TMPO | awk '/ff_extern/{ print substr($0, match($0, /[^ \t]*ff_extern/)) }')
  5171. extern_prefix=${sym%%ff_extern*}
  5172. ! disabled inline_asm && check_inline_asm inline_asm '"" ::'
  5173. for restrict_keyword in restrict __restrict__ __restrict ""; do
  5174. test_code cc "" "char * $restrict_keyword p" && break
  5175. done
  5176. check_cc pragma_deprecated "" '_Pragma("GCC diagnostic ignored \"-Wdeprecated-declarations\"")'
  5177. # The global variable ensures the bits appear unchanged in the object file.
  5178. test_cc <<EOF || die "endian test failed"
  5179. unsigned int endian = 'B' << 24 | 'I' << 16 | 'G' << 8 | 'E';
  5180. EOF
  5181. od -t x1 $TMPO | grep -q '42 *49 *47 *45' && enable bigendian
  5182. check_cc const_nan math.h "struct { double d; } static const bar[] = { { NAN } }"
  5183. if ! enabled ppc64 || enabled bigendian; then
  5184. disable vsx
  5185. fi
  5186. check_gas() {
  5187. log "check_gas using '$as' as AS"
  5188. # :vararg is used on aarch64, arm and ppc altivec
  5189. check_as vararg "
  5190. .macro m n, y:vararg=0
  5191. \n: .int \y
  5192. .endm
  5193. m x" || return 1
  5194. # .altmacro is only used in arm asm
  5195. ! enabled arm || check_as gnu_as ".altmacro"
  5196. }
  5197. if enabled_any arm aarch64 || enabled_all ppc altivec && enabled asm; then
  5198. nogas=:
  5199. enabled_any arm aarch64 && nogas=die
  5200. enabled_all ppc altivec && [ $target_os_default != aix ] && nogas=warn
  5201. as_noop=-v
  5202. case $as_type in
  5203. arm*) gaspp_as_type=armasm; as_noop=-h ;;
  5204. gcc) gaspp_as_type=gas ;;
  5205. *) gaspp_as_type=$as_type ;;
  5206. esac
  5207. [ $target_os = "darwin" ] && gaspp_as_type="apple-$gaspp_as_type"
  5208. test "${as#*gas-preprocessor.pl}" != "$as" ||
  5209. test_cmd gas-preprocessor.pl -arch $arch -as-type $gaspp_as_type -- ${as:=$cc} $as_noop &&
  5210. gas="${gas:=gas-preprocessor.pl} -arch $arch -as-type $gaspp_as_type -- ${as:=$cc}"
  5211. if ! check_gas ; then
  5212. as=${gas:=$as}
  5213. check_gas || \
  5214. $nogas "GNU assembler not found, install/update gas-preprocessor"
  5215. fi
  5216. check_as as_func ".func test
  5217. .endfunc"
  5218. fi
  5219. check_inline_asm inline_asm_labels '"1:\n"'
  5220. check_inline_asm inline_asm_nonlocal_labels '"Label:\n"'
  5221. if enabled aarch64; then
  5222. enabled armv8 && check_insn armv8 'prfm pldl1strm, [x0]'
  5223. # internal assembler in clang 3.3 does not support this instruction
  5224. enabled neon && check_insn neon 'ext v0.8B, v0.8B, v1.8B, #1'
  5225. enabled vfp && check_insn vfp 'fmadd d0, d0, d1, d2'
  5226. map 'enabled_any ${v}_external ${v}_inline || disable $v' $ARCH_EXT_LIST_ARM
  5227. elif enabled alpha; then
  5228. check_cflags -mieee
  5229. elif enabled arm; then
  5230. enabled msvc && check_cpp_condition thumb stddef.h "defined _M_ARMT"
  5231. test_cpp_condition stddef.h "defined __thumb__" && test_cc <<EOF && enable_weak thumb
  5232. float func(float a, float b){ return a+b; }
  5233. EOF
  5234. enabled thumb && check_cflags -mthumb || check_cflags -marm
  5235. if check_cpp_condition vfp_args stddef.h "defined __ARM_PCS_VFP"; then
  5236. :
  5237. elif check_cpp_condition vfp_args stddef.h "defined _M_ARM_FP && _M_ARM_FP >= 30"; then
  5238. :
  5239. elif ! test_cpp_condition stddef.h "defined __ARM_PCS || defined __SOFTFP__" && [ $target_os != darwin ]; then
  5240. case "${cross_prefix:-$cc}" in
  5241. *hardfloat*) enable vfp_args; fpabi=vfp ;;
  5242. *) check_ld "cc" vfp_args <<EOF && fpabi=vfp || fpabi=soft ;;
  5243. __asm__ (".eabi_attribute 28, 1");
  5244. int main(void) { return 0; }
  5245. EOF
  5246. esac
  5247. warn "Compiler does not indicate floating-point ABI, guessing $fpabi."
  5248. fi
  5249. enabled armv5te && check_insn armv5te 'qadd r0, r0, r0'
  5250. enabled armv6 && check_insn armv6 'sadd16 r0, r0, r0'
  5251. enabled armv6t2 && check_insn armv6t2 'movt r0, #0'
  5252. enabled neon && check_insn neon 'vadd.i16 q0, q0, q0'
  5253. enabled vfp && check_insn vfp 'fadds s0, s0, s0'
  5254. enabled vfpv3 && check_insn vfpv3 'vmov.f32 s0, #1.0'
  5255. enabled setend && check_insn setend 'setend be'
  5256. [ $target_os = linux ] || [ $target_os = android ] ||
  5257. map 'enabled_any ${v}_external ${v}_inline || disable $v' \
  5258. $ARCH_EXT_LIST_ARM
  5259. check_inline_asm asm_mod_q '"add r0, %Q0, %R0" :: "r"((long long)0)'
  5260. check_as as_arch_directive ".arch armv7-a"
  5261. check_as as_dn_directive "ra .dn d0.i16"
  5262. check_as as_fpu_directive ".fpu neon"
  5263. # llvm's integrated assembler supports .object_arch from llvm 3.5
  5264. [ "$objformat" = elf32 ] || [ "$objformat" = elf64 ] &&
  5265. check_as as_object_arch ".object_arch armv4"
  5266. # MS armasm fails to assemble our PIC constructs
  5267. [ $target_os != win32 ] && enabled_all armv6t2 shared !pic && enable_weak_pic
  5268. elif enabled mips; then
  5269. enabled loongson2 && check_inline_asm loongson2 '"dmult.g $8, $9, $10"'
  5270. enabled loongson3 && check_inline_asm loongson3 '"gsldxc1 $f0, 0($2, $3)"'
  5271. enabled mmi && check_inline_asm mmi '"punpcklhw $f0, $f0, $f0"'
  5272. # Enable minimum ISA based on selected options
  5273. if enabled mips64; then
  5274. enabled mips64r6 && check_inline_asm_flags mips64r6 '"dlsa $0, $0, $0, 1"' '-mips64r6'
  5275. enabled mips64r2 && check_inline_asm_flags mips64r2 '"dext $0, $0, 0, 1"' '-mips64r2'
  5276. disabled mips64r6 && disabled mips64r2 && check_inline_asm_flags mips64r1 '"daddi $0, $0, 0"' '-mips64'
  5277. else
  5278. enabled mips32r6 && check_inline_asm_flags mips32r6 '"aui $0, $0, 0"' '-mips32r6'
  5279. enabled mips32r5 && check_inline_asm_flags mips32r5 '"eretnc"' '-mips32r5'
  5280. enabled mips32r2 && check_inline_asm_flags mips32r2 '"ext $0, $0, 0, 1"' '-mips32r2'
  5281. disabled mips32r6 && disabled mips32r5 && disabled mips32r2 && check_inline_asm_flags mips32r1 '"addi $0, $0, 0"' '-mips32'
  5282. fi
  5283. enabled mipsfpu && check_inline_asm_flags mipsfpu '"cvt.d.l $f0, $f2"' '-mhard-float'
  5284. enabled mipsfpu && (enabled mips32r5 || enabled mips32r6 || enabled mips64r6) && check_inline_asm_flags mipsfpu '"cvt.d.l $f0, $f1"' '-mfp64'
  5285. enabled mipsfpu && enabled msa && check_inline_asm_flags msa '"addvi.b $w0, $w1, 1"' '-mmsa' && check_headers msa.h || disable msa
  5286. enabled mipsdsp && check_inline_asm_flags mipsdsp '"addu.qb $t0, $t1, $t2"' '-mdsp'
  5287. enabled mipsdspr2 && check_inline_asm_flags mipsdspr2 '"absq_s.qb $t0, $t1"' '-mdspr2'
  5288. if enabled bigendian && enabled msa; then
  5289. disable msa
  5290. fi
  5291. elif enabled parisc; then
  5292. if enabled gcc; then
  5293. case $($cc -dumpversion) in
  5294. 4.[3-9].*) check_cflags -fno-optimize-sibling-calls ;;
  5295. esac
  5296. fi
  5297. elif enabled ppc; then
  5298. enable local_aligned
  5299. check_inline_asm dcbzl '"dcbzl 0, %0" :: "r"(0)'
  5300. check_inline_asm ibm_asm '"add 0, 0, 0"'
  5301. check_inline_asm ppc4xx '"maclhw r10, r11, r12"'
  5302. check_inline_asm xform_asm '"lwzx %1, %y0" :: "Z"(*(int*)0), "r"(0)'
  5303. if enabled altivec; then
  5304. check_cflags -maltivec -mabi=altivec
  5305. # check if our compiler supports Motorola AltiVec C API
  5306. check_cc altivec altivec.h "vector signed int v1 = (vector signed int) { 0 };
  5307. vector signed int v2 = (vector signed int) { 1 };
  5308. v1 = vec_add(v1, v2);"
  5309. enabled altivec || warn "Altivec disabled, possibly missing --cpu flag"
  5310. fi
  5311. if enabled vsx; then
  5312. check_cflags -mvsx &&
  5313. check_cc vsx altivec.h "int v[4] = { 0 };
  5314. vector signed int v1 = vec_vsx_ld(0, v);"
  5315. fi
  5316. if enabled power8; then
  5317. check_cpp_condition power8 "altivec.h" "defined(_ARCH_PWR8)"
  5318. fi
  5319. elif enabled x86; then
  5320. check_builtin rdtsc intrin.h "__rdtsc()"
  5321. check_builtin mm_empty mmintrin.h "_mm_empty()"
  5322. enable local_aligned
  5323. # check whether EBP is available on x86
  5324. # As 'i' is stored on the stack, this program will crash
  5325. # if the base pointer is used to access it because the
  5326. # base pointer is cleared in the inline assembly code.
  5327. check_exec_crash <<EOF && enable ebp_available
  5328. volatile int i=0;
  5329. __asm__ volatile ("xorl %%ebp, %%ebp" ::: "%ebp");
  5330. return i;
  5331. EOF
  5332. # check whether EBX is available on x86
  5333. check_inline_asm ebx_available '""::"b"(0)' &&
  5334. check_inline_asm ebx_available '"":::"%ebx"'
  5335. # check whether xmm clobbers are supported
  5336. check_inline_asm xmm_clobbers '"":::"%xmm0"'
  5337. check_inline_asm inline_asm_direct_symbol_refs '"movl '$extern_prefix'test, %eax"' ||
  5338. check_inline_asm inline_asm_direct_symbol_refs '"movl '$extern_prefix'test(%rip), %eax"'
  5339. # check whether binutils is new enough to compile SSSE3/MMXEXT
  5340. enabled ssse3 && check_inline_asm ssse3_inline '"pabsw %xmm0, %xmm0"'
  5341. enabled mmxext && check_inline_asm mmxext_inline '"pmaxub %mm0, %mm1"'
  5342. probe_x86asm(){
  5343. x86asmexe_probe=$1
  5344. if test_cmd $x86asmexe_probe -v; then
  5345. x86asmexe=$x86asmexe_probe
  5346. x86asm_type=nasm
  5347. x86asm_debug="-g -F dwarf"
  5348. X86ASMDEP=
  5349. X86ASM_DEPFLAGS='-MD $(@:.o=.d)'
  5350. elif test_cmd $x86asmexe_probe --version; then
  5351. x86asmexe=$x86asmexe_probe
  5352. x86asm_type=yasm
  5353. x86asm_debug="-g dwarf2"
  5354. X86ASMDEP='$(DEPX86ASM) $(X86ASMFLAGS) -M $(X86ASM_O) $< > $(@:.o=.d)'
  5355. X86ASM_DEPFLAGS=
  5356. fi
  5357. check_x86asm x86asm "movbe ecx, [5]"
  5358. }
  5359. if ! disabled_any asm mmx x86asm; then
  5360. disable x86asm
  5361. for program in $x86asmexe nasm yasm; do
  5362. probe_x86asm $program && break
  5363. done
  5364. disabled x86asm && die "nasm/yasm not found or too old. Use --disable-x86asm for a crippled build."
  5365. X86ASMFLAGS="-f $objformat"
  5366. enabled pic && append X86ASMFLAGS "-DPIC"
  5367. test -n "$extern_prefix" && append X86ASMFLAGS "-DPREFIX"
  5368. case "$objformat" in
  5369. elf*) enabled debug && append X86ASMFLAGS $x86asm_debug ;;
  5370. esac
  5371. check_x86asm avx512_external "vmovdqa32 [eax]{k1}{z}, zmm0"
  5372. check_x86asm avx2_external "vextracti128 xmm0, ymm0, 0"
  5373. check_x86asm xop_external "vpmacsdd xmm0, xmm1, xmm2, xmm3"
  5374. check_x86asm fma4_external "vfmaddps ymm0, ymm1, ymm2, ymm3"
  5375. check_x86asm cpunop "CPU amdnop"
  5376. fi
  5377. case "$cpu" in
  5378. athlon*|opteron*|k8*|pentium|pentium-mmx|prescott|nocona|atom|geode)
  5379. disable fast_clz
  5380. ;;
  5381. esac
  5382. fi
  5383. check_cc intrinsics_neon arm_neon.h "int16x8_t test = vdupq_n_s16(0)"
  5384. check_ldflags -Wl,--as-needed
  5385. check_ldflags -Wl,-z,noexecstack
  5386. if ! disabled network; then
  5387. check_func getaddrinfo $network_extralibs
  5388. check_func inet_aton $network_extralibs
  5389. check_type netdb.h "struct addrinfo"
  5390. check_type netinet/in.h "struct group_source_req" -D_BSD_SOURCE
  5391. check_type netinet/in.h "struct ip_mreq_source" -D_BSD_SOURCE
  5392. check_type netinet/in.h "struct ipv6_mreq" -D_DARWIN_C_SOURCE
  5393. check_type poll.h "struct pollfd"
  5394. check_type netinet/sctp.h "struct sctp_event_subscribe"
  5395. check_struct "sys/socket.h" "struct msghdr" msg_flags
  5396. check_struct "sys/types.h sys/socket.h" "struct sockaddr" sa_len
  5397. check_type netinet/in.h "struct sockaddr_in6"
  5398. check_type "sys/types.h sys/socket.h" "struct sockaddr_storage"
  5399. check_type "sys/types.h sys/socket.h" socklen_t
  5400. # Prefer arpa/inet.h over winsock2
  5401. if check_headers arpa/inet.h ; then
  5402. check_func closesocket
  5403. elif check_headers winsock2.h ; then
  5404. check_func_headers winsock2.h closesocket -lws2 &&
  5405. network_extralibs="-lws2" ||
  5406. { check_func_headers winsock2.h closesocket -lws2_32 &&
  5407. network_extralibs="-lws2_32"; } || disable winsock2_h network
  5408. check_func_headers ws2tcpip.h getaddrinfo $network_extralibs
  5409. check_type ws2tcpip.h socklen_t
  5410. check_type ws2tcpip.h "struct addrinfo"
  5411. check_type ws2tcpip.h "struct group_source_req"
  5412. check_type ws2tcpip.h "struct ip_mreq_source"
  5413. check_type ws2tcpip.h "struct ipv6_mreq"
  5414. check_type winsock2.h "struct pollfd"
  5415. check_struct winsock2.h "struct sockaddr" sa_len
  5416. check_type ws2tcpip.h "struct sockaddr_in6"
  5417. check_type ws2tcpip.h "struct sockaddr_storage"
  5418. else
  5419. disable network
  5420. fi
  5421. fi
  5422. check_builtin atomic_cas_ptr atomic.h "void **ptr; void *oldval, *newval; atomic_cas_ptr(ptr, oldval, newval)"
  5423. check_builtin machine_rw_barrier mbarrier.h "__machine_rw_barrier()"
  5424. check_builtin MemoryBarrier windows.h "MemoryBarrier()"
  5425. check_builtin sync_val_compare_and_swap "" "int *ptr; int oldval, newval; __sync_val_compare_and_swap(ptr, oldval, newval)"
  5426. check_builtin gmtime_r time.h "time_t *time; struct tm *tm; gmtime_r(time, tm)"
  5427. check_builtin localtime_r time.h "time_t *time; struct tm *tm; localtime_r(time, tm)"
  5428. check_builtin x264_csp_bgr "stdint.h x264.h" "X264_CSP_BGR"
  5429. case "$custom_allocator" in
  5430. jemalloc)
  5431. # jemalloc by default does not use a prefix
  5432. require libjemalloc jemalloc/jemalloc.h malloc -ljemalloc
  5433. ;;
  5434. tcmalloc)
  5435. require_pkg_config libtcmalloc libtcmalloc gperftools/tcmalloc.h tc_malloc
  5436. malloc_prefix=tc_
  5437. ;;
  5438. esac
  5439. check_func_headers malloc.h _aligned_malloc && enable aligned_malloc
  5440. check_func ${malloc_prefix}memalign && enable memalign
  5441. check_func ${malloc_prefix}posix_memalign && enable posix_memalign
  5442. check_func access
  5443. check_func_headers stdlib.h arc4random
  5444. check_lib clock_gettime time.h clock_gettime || check_lib clock_gettime time.h clock_gettime -lrt
  5445. check_func fcntl
  5446. check_func fork
  5447. check_func gethrtime
  5448. check_func getopt
  5449. check_func getrusage
  5450. check_func gettimeofday
  5451. check_func isatty
  5452. check_func mkstemp
  5453. check_func mmap
  5454. check_func mprotect
  5455. # Solaris has nanosleep in -lrt, OpenSolaris no longer needs that
  5456. check_func_headers time.h nanosleep || check_lib nanosleep time.h nanosleep -lrt
  5457. check_func sched_getaffinity
  5458. check_func setrlimit
  5459. check_struct "sys/stat.h" "struct stat" st_mtim.tv_nsec -D_BSD_SOURCE
  5460. check_func strerror_r
  5461. check_func sysconf
  5462. check_func sysctl
  5463. check_func usleep
  5464. check_func_headers conio.h kbhit
  5465. check_func_headers io.h setmode
  5466. check_func_headers lzo/lzo1x.h lzo1x_999_compress
  5467. check_func_headers mach/mach_time.h mach_absolute_time
  5468. check_func_headers stdlib.h getenv
  5469. check_func_headers sys/stat.h lstat
  5470. check_func_headers windows.h GetProcessAffinityMask
  5471. check_func_headers windows.h GetProcessTimes
  5472. check_func_headers windows.h GetSystemTimeAsFileTime
  5473. check_func_headers windows.h LoadLibrary
  5474. check_func_headers windows.h MapViewOfFile
  5475. check_func_headers windows.h PeekNamedPipe
  5476. check_func_headers windows.h SetConsoleTextAttribute
  5477. check_func_headers windows.h SetConsoleCtrlHandler
  5478. check_func_headers windows.h Sleep
  5479. check_func_headers windows.h VirtualAlloc
  5480. check_func_headers glob.h glob
  5481. enabled xlib &&
  5482. check_lib xlib "X11/Xlib.h X11/extensions/Xvlib.h" XvGetPortAttribute -lXv -lX11 -lXext
  5483. check_headers direct.h
  5484. check_headers dirent.h
  5485. check_headers dxgidebug.h
  5486. check_headers dxva.h
  5487. check_headers dxva2api.h -D_WIN32_WINNT=0x0600
  5488. check_headers io.h
  5489. check_headers linux/perf_event.h
  5490. check_headers libcrystalhd/libcrystalhd_if.h
  5491. check_headers malloc.h
  5492. check_headers net/udplite.h
  5493. check_headers poll.h
  5494. check_headers sys/param.h
  5495. check_headers sys/resource.h
  5496. check_headers sys/select.h
  5497. check_headers sys/time.h
  5498. check_headers sys/un.h
  5499. check_headers termios.h
  5500. check_headers unistd.h
  5501. check_headers valgrind/valgrind.h
  5502. check_func_headers VideoToolbox/VTCompressionSession.h VTCompressionSessionPrepareToEncodeFrames -framework VideoToolbox
  5503. check_headers windows.h
  5504. check_headers X11/extensions/XvMClib.h
  5505. check_headers asm/types.h
  5506. # it seems there are versions of clang in some distros that try to use the
  5507. # gcc headers, which explodes for stdatomic
  5508. # so we also check that atomics actually work here
  5509. check_builtin stdatomic stdatomic.h "atomic_int foo, bar = ATOMIC_VAR_INIT(-1); atomic_store(&foo, 0); foo += bar"
  5510. check_lib advapi32 "windows.h" RegCloseKey -ladvapi32
  5511. check_lib bcrypt "windows.h bcrypt.h" BCryptGenRandom -lbcrypt &&
  5512. check_cpp_condition bcrypt bcrypt.h "defined BCRYPT_RNG_ALGORITHM"
  5513. check_lib ole32 "windows.h" CoTaskMemFree -lole32
  5514. check_lib shell32 "windows.h shellapi.h" CommandLineToArgvW -lshell32
  5515. check_lib psapi "windows.h psapi.h" GetProcessMemoryInfo -lpsapi
  5516. check_lib android android/native_window.h ANativeWindow_acquire -landroid
  5517. check_lib mediandk "stdint.h media/NdkImage.h" AImage_delete -lmediandk
  5518. check_lib camera2ndk "stdbool.h stdint.h camera/NdkCameraManager.h" ACameraManager_create -lcamera2ndk
  5519. enabled appkit && check_apple_framework AppKit
  5520. enabled audiotoolbox && check_apple_framework AudioToolbox
  5521. enabled avfoundation && check_apple_framework AVFoundation
  5522. enabled coreimage && check_apple_framework CoreImage
  5523. enabled videotoolbox && check_apple_framework VideoToolbox
  5524. check_apple_framework CoreFoundation
  5525. check_apple_framework CoreMedia
  5526. check_apple_framework CoreVideo
  5527. enabled avfoundation && {
  5528. disable coregraphics applicationservices
  5529. check_lib coregraphics CoreGraphics/CoreGraphics.h CGGetActiveDisplayList "-framework CoreGraphics" ||
  5530. check_lib applicationservices ApplicationServices/ApplicationServices.h CGGetActiveDisplayList "-framework ApplicationServices"; }
  5531. enabled videotoolbox && {
  5532. check_lib coreservices CoreServices/CoreServices.h UTGetOSTypeFromString "-framework CoreServices"
  5533. check_func_headers CoreMedia/CMFormatDescription.h kCMVideoCodecType_HEVC "-framework CoreMedia"
  5534. check_func_headers CoreVideo/CVPixelBuffer.h kCVPixelFormatType_420YpCbCr10BiPlanarVideoRange "-framework CoreVideo"
  5535. }
  5536. check_struct "sys/time.h sys/resource.h" "struct rusage" ru_maxrss
  5537. check_type "windows.h dxva.h" "DXVA_PicParams_HEVC" -DWINAPI_FAMILY=WINAPI_FAMILY_DESKTOP_APP -D_CRT_BUILD_DESKTOP_APP=0
  5538. check_type "windows.h dxva.h" "DXVA_PicParams_VP9" -DWINAPI_FAMILY=WINAPI_FAMILY_DESKTOP_APP -D_CRT_BUILD_DESKTOP_APP=0
  5539. check_type "windows.h d3d11.h" "ID3D11VideoDecoder"
  5540. check_type "windows.h d3d11.h" "ID3D11VideoContext"
  5541. check_type "d3d9.h dxva2api.h" DXVA2_ConfigPictureDecode -D_WIN32_WINNT=0x0602
  5542. check_type "vdpau/vdpau.h" "VdpPictureInfoHEVC"
  5543. if enabled cuda_sdk; then
  5544. warn "Option --enable-cuda-sdk is deprecated. Use --enable-cuda-nvcc instead."
  5545. enable cuda_nvcc
  5546. fi
  5547. if ! disabled ffnvcodec; then
  5548. ffnv_hdr_list="ffnvcodec/nvEncodeAPI.h ffnvcodec/dynlink_cuda.h ffnvcodec/dynlink_cuviddec.h ffnvcodec/dynlink_nvcuvid.h"
  5549. check_pkg_config ffnvcodec "ffnvcodec >= 9.0.18.0" "$ffnv_hdr_list" "" || \
  5550. check_pkg_config ffnvcodec "ffnvcodec >= 8.2.15.8 ffnvcodec < 8.3" "$ffnv_hdr_list" "" || \
  5551. check_pkg_config ffnvcodec "ffnvcodec >= 8.1.24.9 ffnvcodec < 8.2" "$ffnv_hdr_list" "" || \
  5552. check_pkg_config ffnvcodec "ffnvcodec >= 8.0.14.9 ffnvcodec < 8.1" "$ffnv_hdr_list" ""
  5553. fi
  5554. check_cpp_condition winrt windows.h "!WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)"
  5555. if ! disabled w32threads && ! enabled pthreads; then
  5556. check_func_headers "windows.h process.h" _beginthreadex &&
  5557. check_type "windows.h" CONDITION_VARIABLE &&
  5558. check_type "windows.h" INIT_ONCE &&
  5559. enable w32threads || disable w32threads
  5560. if ! enabled w32threads && enabled winrt; then
  5561. check_func_headers "windows.h" CreateThread &&
  5562. enable w32threads || disable w32threads
  5563. fi
  5564. fi
  5565. # check for some common methods of building with pthread support
  5566. # do this before the optional library checks as some of them require pthreads
  5567. if ! disabled pthreads && ! enabled w32threads && ! enabled os2threads; then
  5568. if check_lib pthreads pthread.h pthread_join -pthread &&
  5569. check_lib pthreads pthread.h pthread_create -pthread; then
  5570. add_cflags -pthread
  5571. elif check_lib pthreads pthread.h pthread_join -pthreads &&
  5572. check_lib pthreads pthread.h pthread_create -pthreads; then
  5573. add_cflags -pthreads
  5574. elif check_lib pthreads pthread.h pthread_join -ldl -pthread &&
  5575. check_lib pthreads pthread.h pthread_create -ldl -pthread; then
  5576. add_cflags -ldl -pthread
  5577. elif check_lib pthreads pthread.h pthread_join -lpthreadGC2 &&
  5578. check_lib pthreads pthread.h pthread_create -lpthreadGC2; then
  5579. :
  5580. elif check_lib pthreads pthread.h pthread_join -lpthread &&
  5581. check_lib pthreads pthread.h pthread_create -lpthread; then
  5582. :
  5583. elif check_func pthread_join && check_func pthread_create; then
  5584. enable pthreads
  5585. fi
  5586. check_cc pthreads "pthread.h" "static pthread_mutex_t atomic_lock = PTHREAD_MUTEX_INITIALIZER"
  5587. if enabled pthreads; then
  5588. check_builtin sem_timedwait semaphore.h "sem_t *s; sem_init(s,0,0); sem_timedwait(s,0); sem_destroy(s)" $pthreads_extralibs
  5589. check_func pthread_cancel $pthreads_extralibs
  5590. fi
  5591. fi
  5592. enabled zlib && { check_pkg_config zlib zlib "zlib.h" zlibVersion ||
  5593. check_lib zlib zlib.h zlibVersion -lz; }
  5594. enabled bzlib && check_lib bzlib bzlib.h BZ2_bzlibVersion -lbz2
  5595. enabled lzma && check_lib lzma lzma.h lzma_version_number -llzma
  5596. # On some systems dynamic loading requires no extra linker flags
  5597. check_lib libdl dlfcn.h "dlopen dlsym" || check_lib libdl dlfcn.h "dlopen dlsym" -ldl
  5598. check_lib libm math.h sin -lm
  5599. atan2f_args=2
  5600. copysign_args=2
  5601. hypot_args=2
  5602. ldexpf_args=2
  5603. powf_args=2
  5604. for func in $MATH_FUNCS; do
  5605. eval check_mathfunc $func \${${func}_args:-1} $libm_extralibs
  5606. done
  5607. for func in $COMPLEX_FUNCS; do
  5608. eval check_complexfunc $func \${${func}_args:-1}
  5609. done
  5610. # these are off by default, so fail if requested and not available
  5611. enabled cuda_nvcc && { check_nvcc || die "ERROR: failed checking for nvcc."; }
  5612. enabled chromaprint && require chromaprint chromaprint.h chromaprint_get_version -lchromaprint
  5613. enabled decklink && { require_headers DeckLinkAPI.h &&
  5614. { test_cpp_condition DeckLinkAPIVersion.h "BLACKMAGIC_DECKLINK_API_VERSION >= 0x0a090500" || die "ERROR: Decklink API version must be >= 10.9.5."; } }
  5615. enabled frei0r && require_headers "frei0r.h dlfcn.h"
  5616. enabled gmp && require gmp gmp.h mpz_export -lgmp
  5617. enabled gnutls && require_pkg_config gnutls gnutls gnutls/gnutls.h gnutls_global_init
  5618. enabled jni && { [ $target_os = "android" ] && check_headers jni.h && enabled pthreads || die "ERROR: jni not found"; }
  5619. enabled ladspa && require_headers "ladspa.h dlfcn.h"
  5620. enabled libaom && require_pkg_config libaom "aom >= 1.0.0" aom/aom_codec.h aom_codec_version
  5621. enabled libaribb24 && { check_pkg_config libaribb24 "aribb24 > 1.0.3" "aribb24/aribb24.h" arib_instance_new ||
  5622. { enabled gpl && require_pkg_config libaribb24 aribb24 "aribb24/aribb24.h" arib_instance_new; } ||
  5623. die "ERROR: libaribb24 requires version higher than 1.0.3 or --enable-gpl."; }
  5624. enabled lv2 && require_pkg_config lv2 lilv-0 "lilv/lilv.h" lilv_world_new
  5625. enabled libiec61883 && require libiec61883 libiec61883/iec61883.h iec61883_cmp_connect -lraw1394 -lavc1394 -lrom1394 -liec61883
  5626. enabled libass && require_pkg_config libass libass ass/ass.h ass_library_init
  5627. enabled libbluray && require_pkg_config libbluray libbluray libbluray/bluray.h bd_open
  5628. enabled libbs2b && require_pkg_config libbs2b libbs2b bs2b.h bs2b_open
  5629. enabled libcelt && require libcelt celt/celt.h celt_decode -lcelt0 &&
  5630. { check_lib libcelt celt/celt.h celt_decoder_create_custom -lcelt0 ||
  5631. die "ERROR: libcelt must be installed and version must be >= 0.11.0."; }
  5632. enabled libcaca && require_pkg_config libcaca caca caca.h caca_create_canvas
  5633. enabled libcodec2 && require libcodec2 codec2/codec2.h codec2_create -lcodec2
  5634. enabled libdav1d && require_pkg_config libdav1d "dav1d >= 0.2.1" "dav1d/dav1d.h" dav1d_version
  5635. enabled libdavs2 && require_pkg_config libdavs2 "davs2 >= 1.6.0" davs2.h davs2_decoder_open
  5636. enabled libdc1394 && require_pkg_config libdc1394 libdc1394-2 dc1394/dc1394.h dc1394_new
  5637. enabled libdrm && require_pkg_config libdrm libdrm xf86drm.h drmGetVersion
  5638. enabled libfdk_aac && { check_pkg_config libfdk_aac fdk-aac "fdk-aac/aacenc_lib.h" aacEncOpen ||
  5639. { require libfdk_aac fdk-aac/aacenc_lib.h aacEncOpen -lfdk-aac &&
  5640. warn "using libfdk without pkg-config"; } }
  5641. 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"
  5642. enabled libflite && require libflite "flite/flite.h" flite_init $flite_extralibs
  5643. enabled fontconfig && enable libfontconfig
  5644. enabled libfontconfig && require_pkg_config libfontconfig fontconfig "fontconfig/fontconfig.h" FcInit
  5645. enabled libfreetype && require_pkg_config libfreetype freetype2 "ft2build.h FT_FREETYPE_H" FT_Init_FreeType
  5646. enabled libfribidi && require_pkg_config libfribidi fribidi fribidi.h fribidi_version_info
  5647. enabled libgme && { check_pkg_config libgme libgme gme/gme.h gme_new_emu ||
  5648. require libgme gme/gme.h gme_new_emu -lgme -lstdc++; }
  5649. enabled libgsm && { for gsm_hdr in "gsm.h" "gsm/gsm.h"; do
  5650. check_lib libgsm "${gsm_hdr}" gsm_create -lgsm && break;
  5651. done || die "ERROR: libgsm not found"; }
  5652. enabled libilbc && require libilbc ilbc.h WebRtcIlbcfix_InitDecode -lilbc $pthreads_extralibs
  5653. enabled libklvanc && require libklvanc libklvanc/vanc.h klvanc_context_create -lklvanc
  5654. enabled libkvazaar && require_pkg_config libkvazaar "kvazaar >= 0.8.1" kvazaar.h kvz_api_get
  5655. enabled liblensfun && require_pkg_config liblensfun lensfun lensfun.h lf_db_new
  5656. # While it may appear that require is being used as a pkg-config
  5657. # fallback for libmfx, it is actually being used to detect a different
  5658. # installation route altogether. If libmfx is installed via the Intel
  5659. # Media SDK or Intel Media Server Studio, these don't come with
  5660. # pkg-config support. Instead, users should make sure that the build
  5661. # can find the libraries and headers through other means.
  5662. enabled libmfx && { check_pkg_config libmfx libmfx "mfx/mfxvideo.h" MFXInit ||
  5663. { require libmfx "mfx/mfxvideo.h" MFXInit "-llibmfx $advapi32_extralibs" && warn "using libmfx without pkg-config"; } }
  5664. enabled libmodplug && require_pkg_config libmodplug libmodplug libmodplug/modplug.h ModPlug_Load
  5665. enabled libmp3lame && require "libmp3lame >= 3.98.3" lame/lame.h lame_set_VBR_quality -lmp3lame $libm_extralibs
  5666. enabled libmysofa && { check_pkg_config libmysofa libmysofa mysofa.h mysofa_load ||
  5667. require libmysofa mysofa.h mysofa_load -lmysofa $zlib_extralibs; }
  5668. enabled libnpp && { check_lib libnpp npp.h nppGetLibVersion -lnppig -lnppicc -lnppc -lnppidei ||
  5669. check_lib libnpp npp.h nppGetLibVersion -lnppi -lnppc -lnppidei ||
  5670. die "ERROR: libnpp not found"; }
  5671. enabled libopencore_amrnb && require libopencore_amrnb opencore-amrnb/interf_dec.h Decoder_Interface_init -lopencore-amrnb
  5672. enabled libopencore_amrwb && require libopencore_amrwb opencore-amrwb/dec_if.h D_IF_init -lopencore-amrwb
  5673. enabled libopencv && { check_headers opencv2/core/core_c.h &&
  5674. { check_pkg_config libopencv opencv opencv2/core/core_c.h cvCreateImageHeader ||
  5675. require libopencv opencv2/core/core_c.h cvCreateImageHeader -lopencv_core -lopencv_imgproc; } ||
  5676. require_pkg_config libopencv opencv opencv/cxcore.h cvCreateImageHeader; }
  5677. enabled libopenh264 && require_pkg_config libopenh264 openh264 wels/codec_api.h WelsGetCodecVersion
  5678. enabled libopenjpeg && { check_pkg_config libopenjpeg "libopenjp2 >= 2.1.0" openjpeg.h opj_version ||
  5679. { require_pkg_config libopenjpeg "libopenjp2 >= 2.1.0" openjpeg.h opj_version -DOPJ_STATIC && add_cppflags -DOPJ_STATIC; } }
  5680. enabled libopenmpt && require_pkg_config libopenmpt "libopenmpt >= 0.2.6557" libopenmpt/libopenmpt.h openmpt_module_create -lstdc++ && append libopenmpt_extralibs "-lstdc++"
  5681. enabled libopus && {
  5682. enabled libopus_decoder && {
  5683. require_pkg_config libopus opus opus_multistream.h opus_multistream_decoder_create
  5684. }
  5685. enabled libopus_encoder && {
  5686. require_pkg_config libopus opus opus_multistream.h opus_multistream_surround_encoder_create
  5687. }
  5688. }
  5689. enabled libpulse && require_pkg_config libpulse libpulse pulse/pulseaudio.h pa_context_new
  5690. enabled librsvg && require_pkg_config librsvg librsvg-2.0 librsvg-2.0/librsvg/rsvg.h rsvg_handle_render_cairo
  5691. enabled librtmp && require_pkg_config librtmp librtmp librtmp/rtmp.h RTMP_Socket
  5692. enabled librubberband && require_pkg_config librubberband "rubberband >= 1.8.1" rubberband/rubberband-c.h rubberband_new -lstdc++ && append librubberband_extralibs "-lstdc++"
  5693. enabled libshine && require_pkg_config libshine shine shine/layer3.h shine_encode_buffer
  5694. enabled libsmbclient && { check_pkg_config libsmbclient smbclient libsmbclient.h smbc_init ||
  5695. require libsmbclient libsmbclient.h smbc_init -lsmbclient; }
  5696. enabled libsnappy && require libsnappy snappy-c.h snappy_compress -lsnappy -lstdc++
  5697. enabled libsoxr && require libsoxr soxr.h soxr_create -lsoxr
  5698. enabled libssh && require_pkg_config libssh libssh libssh/sftp.h sftp_init
  5699. enabled libspeex && require_pkg_config libspeex speex speex/speex.h speex_decoder_init
  5700. enabled libsrt && require_pkg_config libsrt "srt >= 1.3.0" srt/srt.h srt_socket
  5701. enabled libtensorflow && require libtensorflow tensorflow/c/c_api.h TF_Version -ltensorflow
  5702. enabled libtesseract && require_pkg_config libtesseract tesseract tesseract/capi.h TessBaseAPICreate
  5703. enabled libtheora && require libtheora theora/theoraenc.h th_info_init -ltheoraenc -ltheoradec -logg
  5704. enabled libtls && require_pkg_config libtls libtls tls.h tls_configure
  5705. enabled libtwolame && require libtwolame twolame.h twolame_init -ltwolame &&
  5706. { check_lib libtwolame twolame.h twolame_encode_buffer_float32_interleaved -ltwolame ||
  5707. die "ERROR: libtwolame must be installed and version must be >= 0.3.10"; }
  5708. enabled libv4l2 && require_pkg_config libv4l2 libv4l2 libv4l2.h v4l2_ioctl
  5709. enabled libvidstab && require_pkg_config libvidstab "vidstab >= 0.98" vid.stab/libvidstab.h vsMotionDetectInit
  5710. enabled libvmaf && require_pkg_config libvmaf "libvmaf >= 1.3.9" libvmaf.h compute_vmaf
  5711. enabled libvo_amrwbenc && require libvo_amrwbenc vo-amrwbenc/enc_if.h E_IF_init -lvo-amrwbenc
  5712. enabled libvorbis && require_pkg_config libvorbis vorbis vorbis/codec.h vorbis_info_init &&
  5713. require_pkg_config libvorbisenc vorbisenc vorbis/vorbisenc.h vorbis_encode_init
  5714. enabled libvpx && {
  5715. enabled libvpx_vp8_decoder && {
  5716. check_pkg_config libvpx_vp8_decoder "vpx >= 1.4.0" "vpx/vpx_decoder.h vpx/vp8dx.h" vpx_codec_vp8_dx ||
  5717. 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"
  5718. }
  5719. enabled libvpx_vp8_encoder && {
  5720. check_pkg_config libvpx_vp8_encoder "vpx >= 1.4.0" "vpx/vpx_encoder.h vpx/vp8cx.h" vpx_codec_vp8_cx ||
  5721. 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"
  5722. }
  5723. enabled libvpx_vp9_decoder && {
  5724. check_pkg_config libvpx_vp9_decoder "vpx >= 1.4.0" "vpx/vpx_decoder.h vpx/vp8dx.h" vpx_codec_vp9_dx ||
  5725. 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"
  5726. }
  5727. enabled libvpx_vp9_encoder && {
  5728. check_pkg_config libvpx_vp9_encoder "vpx >= 1.4.0" "vpx/vpx_encoder.h vpx/vp8cx.h" vpx_codec_vp9_cx ||
  5729. 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"
  5730. }
  5731. if disabled_all libvpx_vp8_decoder libvpx_vp9_decoder libvpx_vp8_encoder libvpx_vp9_encoder; then
  5732. die "libvpx enabled but no supported decoders found"
  5733. fi
  5734. }
  5735. enabled libwavpack && require libwavpack wavpack/wavpack.h WavpackOpenFileOutput -lwavpack
  5736. enabled libwebp && {
  5737. enabled libwebp_encoder && require_pkg_config libwebp "libwebp >= 0.2.0" webp/encode.h WebPGetEncoderVersion
  5738. enabled libwebp_anim_encoder && check_pkg_config libwebp_anim_encoder "libwebpmux >= 0.4.0" webp/mux.h WebPAnimEncoderOptionsInit; }
  5739. enabled libx264 && { check_pkg_config libx264 x264 "stdint.h x264.h" x264_encoder_encode ||
  5740. { require libx264 "stdint.h x264.h" x264_encoder_encode "-lx264 $pthreads_extralibs $libm_extralibs" &&
  5741. warn "using libx264 without pkg-config"; } } &&
  5742. require_cpp_condition libx264 x264.h "X264_BUILD >= 118" &&
  5743. check_cpp_condition libx262 x264.h "X264_MPEG2"
  5744. enabled libx265 && require_pkg_config libx265 x265 x265.h x265_api_get &&
  5745. require_cpp_condition libx265 x265.h "X265_BUILD >= 68"
  5746. enabled libxavs && require libxavs "stdint.h xavs.h" xavs_encoder_encode "-lxavs $pthreads_extralibs $libm_extralibs"
  5747. enabled libxavs2 && require_pkg_config libxavs2 "xavs2 >= 1.3.0" "stdint.h xavs2.h" xavs2_api_get
  5748. enabled libxvid && require libxvid xvid.h xvid_global -lxvidcore
  5749. enabled libzimg && require_pkg_config libzimg "zimg >= 2.7.0" zimg.h zimg_get_api_version
  5750. enabled libzmq && require_pkg_config libzmq libzmq zmq.h zmq_ctx_new
  5751. enabled libzvbi && require_pkg_config libzvbi zvbi-0.2 libzvbi.h vbi_decoder_new &&
  5752. { test_cpp_condition libzvbi.h "VBI_VERSION_MAJOR > 0 || VBI_VERSION_MINOR > 2 || VBI_VERSION_MINOR == 2 && VBI_VERSION_MICRO >= 28" ||
  5753. enabled gpl || die "ERROR: libzvbi requires version 0.2.28 or --enable-gpl."; }
  5754. enabled libxml2 && require_pkg_config libxml2 libxml-2.0 libxml2/libxml/xmlversion.h xmlCheckVersion
  5755. enabled mbedtls && { check_pkg_config mbedtls mbedtls mbedtls/x509_crt.h mbedtls_x509_crt_init ||
  5756. check_pkg_config mbedtls mbedtls mbedtls/ssl.h mbedtls_ssl_init ||
  5757. check_lib mbedtls mbedtls/ssl.h mbedtls_ssl_init -lmbedtls -lmbedx509 -lmbedcrypto ||
  5758. die "ERROR: mbedTLS not found"; }
  5759. enabled mediacodec && { enabled jni || die "ERROR: mediacodec requires --enable-jni"; }
  5760. enabled mmal && { check_lib mmal interface/mmal/mmal.h mmal_port_connect -lmmal_core -lmmal_util -lmmal_vc_client -lbcm_host ||
  5761. { ! enabled cross_compile &&
  5762. add_cflags -isystem/opt/vc/include/ -isystem/opt/vc/include/interface/vmcs_host/linux -isystem/opt/vc/include/interface/vcos/pthreads -fgnu89-inline &&
  5763. add_ldflags -L/opt/vc/lib/ &&
  5764. check_lib mmal interface/mmal/mmal.h mmal_port_connect -lmmal_core -lmmal_util -lmmal_vc_client -lbcm_host; } ||
  5765. die "ERROR: mmal not found" &&
  5766. check_func_headers interface/mmal/mmal.h "MMAL_PARAMETER_VIDEO_MAX_NUM_CALLBACKS"; }
  5767. enabled openal && { { for al_extralibs in "${OPENAL_LIBS}" "-lopenal" "-lOpenAL32"; do
  5768. check_lib openal 'AL/al.h' alGetError "${al_extralibs}" && break; done } ||
  5769. die "ERROR: openal not found"; } &&
  5770. { test_cpp_condition "AL/al.h" "defined(AL_VERSION_1_1)" ||
  5771. die "ERROR: openal must be installed and version must be 1.1 or compatible"; }
  5772. enabled opencl && { check_pkg_config opencl OpenCL CL/cl.h clEnqueueNDRangeKernel ||
  5773. check_lib opencl OpenCL/cl.h clEnqueueNDRangeKernel -Wl,-framework,OpenCL ||
  5774. check_lib opencl CL/cl.h clEnqueueNDRangeKernel -lOpenCL ||
  5775. die "ERROR: opencl not found"; } &&
  5776. { test_cpp_condition "OpenCL/cl.h" "defined(CL_VERSION_1_2)" ||
  5777. test_cpp_condition "CL/cl.h" "defined(CL_VERSION_1_2)" ||
  5778. die "ERROR: opencl must be installed and version must be 1.2 or compatible"; }
  5779. enabled opengl && { check_lib opengl GL/glx.h glXGetProcAddress "-lGL" ||
  5780. check_lib opengl windows.h wglGetProcAddress "-lopengl32 -lgdi32" ||
  5781. check_lib opengl OpenGL/gl3.h glGetError "-Wl,-framework,OpenGL" ||
  5782. check_lib opengl ES2/gl.h glGetError "-isysroot=${sysroot} -Wl,-framework,OpenGLES" ||
  5783. die "ERROR: opengl not found."
  5784. }
  5785. enabled omx && require_headers OMX_Core.h
  5786. enabled omx_rpi && { check_headers OMX_Core.h ||
  5787. { ! enabled cross_compile && add_cflags -isystem/opt/vc/include/IL && check_headers OMX_Core.h ; } ||
  5788. die "ERROR: OpenMAX IL headers not found"; } && enable omx
  5789. enabled openssl && { check_pkg_config openssl openssl openssl/ssl.h OPENSSL_init_ssl ||
  5790. check_pkg_config openssl openssl openssl/ssl.h SSL_library_init ||
  5791. check_lib openssl openssl/ssl.h SSL_library_init -lssl -lcrypto ||
  5792. check_lib openssl openssl/ssl.h SSL_library_init -lssl32 -leay32 ||
  5793. check_lib openssl openssl/ssl.h SSL_library_init -lssl -lcrypto -lws2_32 -lgdi32 ||
  5794. die "ERROR: openssl not found"; }
  5795. enabled pocketsphinx && require_pkg_config pocketsphinx pocketsphinx pocketsphinx/pocketsphinx.h ps_init
  5796. enabled rkmpp && { require_pkg_config rkmpp rockchip_mpp rockchip/rk_mpi.h mpp_create &&
  5797. require_pkg_config rockchip_mpp "rockchip_mpp >= 1.3.7" rockchip/rk_mpi.h mpp_create &&
  5798. { enabled libdrm ||
  5799. die "ERROR: rkmpp requires --enable-libdrm"; }
  5800. }
  5801. enabled vapoursynth && require_pkg_config vapoursynth "vapoursynth-script >= 42" VSScript.h vsscript_init
  5802. if enabled gcrypt; then
  5803. GCRYPT_CONFIG="${cross_prefix}libgcrypt-config"
  5804. if "${GCRYPT_CONFIG}" --version > /dev/null 2>&1; then
  5805. gcrypt_cflags=$("${GCRYPT_CONFIG}" --cflags)
  5806. gcrypt_extralibs=$("${GCRYPT_CONFIG}" --libs)
  5807. check_func_headers gcrypt.h gcry_mpi_new $gcrypt_cflags $gcrypt_extralibs ||
  5808. die "ERROR: gcrypt not found"
  5809. add_cflags $gcrypt_cflags
  5810. else
  5811. require gcrypt gcrypt.h gcry_mpi_new -lgcrypt
  5812. fi
  5813. fi
  5814. if enabled sdl2; then
  5815. SDL2_CONFIG="${cross_prefix}sdl2-config"
  5816. test_pkg_config sdl2 "sdl2 >= 2.0.1 sdl2 < 2.1.0" SDL_events.h SDL_PollEvent
  5817. if disabled sdl2 && "${SDL2_CONFIG}" --version > /dev/null 2>&1; then
  5818. sdl2_cflags=$("${SDL2_CONFIG}" --cflags)
  5819. sdl2_extralibs=$("${SDL2_CONFIG}" --libs)
  5820. test_cpp_condition SDL.h "(SDL_MAJOR_VERSION<<16 | SDL_MINOR_VERSION<<8 | SDL_PATCHLEVEL) >= 0x020001" $sdl2_cflags &&
  5821. test_cpp_condition SDL.h "(SDL_MAJOR_VERSION<<16 | SDL_MINOR_VERSION<<8 | SDL_PATCHLEVEL) < 0x020100" $sdl2_cflags &&
  5822. check_func_headers SDL_events.h SDL_PollEvent $sdl2_extralibs $sdl2_cflags &&
  5823. enable sdl2
  5824. fi
  5825. if test $target_os = "mingw32"; then
  5826. sdl2_extralibs=$(filter_out '-mwindows' $sdl2_extralibs)
  5827. fi
  5828. fi
  5829. if enabled decklink; then
  5830. case $target_os in
  5831. mingw32*|mingw64*|win32|win64)
  5832. decklink_outdev_extralibs="$decklink_outdev_extralibs -lole32 -loleaut32"
  5833. decklink_indev_extralibs="$decklink_indev_extralibs -lole32 -loleaut32"
  5834. ;;
  5835. esac
  5836. fi
  5837. enabled securetransport &&
  5838. check_func SecIdentityCreate "-Wl,-framework,CoreFoundation -Wl,-framework,Security" &&
  5839. check_lib securetransport "Security/SecureTransport.h Security/Security.h" "SSLCreateContext" "-Wl,-framework,CoreFoundation -Wl,-framework,Security" ||
  5840. disable securetransport
  5841. enabled securetransport &&
  5842. check_func SecItemImport "-Wl,-framework,CoreFoundation -Wl,-framework,Security"
  5843. enabled schannel &&
  5844. check_func_headers "windows.h security.h" InitializeSecurityContext -DSECURITY_WIN32 -lsecur32 &&
  5845. test_cpp_condition winerror.h "defined(SEC_I_CONTEXT_EXPIRED)" &&
  5846. schannel_extralibs="-lsecur32" ||
  5847. disable schannel
  5848. makeinfo --version > /dev/null 2>&1 && enable makeinfo || disable makeinfo
  5849. enabled makeinfo \
  5850. && [ 0$(makeinfo --version | grep "texinfo" | sed 's/.*texinfo[^0-9]*\([0-9]*\)\..*/\1/') -ge 5 ] \
  5851. && enable makeinfo_html || disable makeinfo_html
  5852. disabled makeinfo_html && texi2html --help 2> /dev/null | grep -q 'init-file' && enable texi2html || disable texi2html
  5853. perl -v > /dev/null 2>&1 && enable perl || disable perl
  5854. pod2man --help > /dev/null 2>&1 && enable pod2man || disable pod2man
  5855. rsync --help 2> /dev/null | grep -q 'contimeout' && enable rsync_contimeout || disable rsync_contimeout
  5856. # check V4L2 codecs available in the API
  5857. check_headers linux/fb.h
  5858. check_headers linux/videodev2.h
  5859. test_code cc linux/videodev2.h "struct v4l2_frmsizeenum vfse; vfse.discrete.width = 0;" && enable_sanitized struct_v4l2_frmivalenum_discrete
  5860. check_cc v4l2_m2m linux/videodev2.h "int i = V4L2_CAP_VIDEO_M2M_MPLANE | V4L2_CAP_VIDEO_M2M | V4L2_BUF_FLAG_LAST;"
  5861. check_cc vc1_v4l2_m2m linux/videodev2.h "int i = V4L2_PIX_FMT_VC1_ANNEX_G;"
  5862. check_cc mpeg1_v4l2_m2m linux/videodev2.h "int i = V4L2_PIX_FMT_MPEG1;"
  5863. check_cc mpeg2_v4l2_m2m linux/videodev2.h "int i = V4L2_PIX_FMT_MPEG2;"
  5864. check_cc mpeg4_v4l2_m2m linux/videodev2.h "int i = V4L2_PIX_FMT_MPEG4;"
  5865. check_cc hevc_v4l2_m2m linux/videodev2.h "int i = V4L2_PIX_FMT_HEVC;"
  5866. check_cc h263_v4l2_m2m linux/videodev2.h "int i = V4L2_PIX_FMT_H263;"
  5867. check_cc h264_v4l2_m2m linux/videodev2.h "int i = V4L2_PIX_FMT_H264;"
  5868. check_cc vp8_v4l2_m2m linux/videodev2.h "int i = V4L2_PIX_FMT_VP8;"
  5869. check_cc vp9_v4l2_m2m linux/videodev2.h "int i = V4L2_PIX_FMT_VP9;"
  5870. check_headers sys/videoio.h
  5871. test_code cc sys/videoio.h "struct v4l2_frmsizeenum vfse; vfse.discrete.width = 0;" && enable_sanitized struct_v4l2_frmivalenum_discrete
  5872. check_lib user32 "windows.h winuser.h" GetShellWindow -luser32
  5873. check_lib vfw32 "windows.h vfw.h" capCreateCaptureWindow -lvfw32
  5874. # check that WM_CAP_DRIVER_CONNECT is defined to the proper value
  5875. # w32api 3.12 had it defined wrong
  5876. check_cpp_condition vfwcap_defines vfw.h "WM_CAP_DRIVER_CONNECT > WM_USER"
  5877. check_type "dshow.h" IBaseFilter
  5878. # check for ioctl_meteor.h, ioctl_bt848.h and alternatives
  5879. check_headers "dev/bktr/ioctl_meteor.h dev/bktr/ioctl_bt848.h" ||
  5880. check_headers "machine/ioctl_meteor.h machine/ioctl_bt848.h" ||
  5881. check_headers "dev/video/meteor/ioctl_meteor.h dev/video/bktr/ioctl_bt848.h" ||
  5882. check_headers "dev/ic/bt8xx.h"
  5883. if check_struct sys/soundcard.h audio_buf_info bytes; then
  5884. enable_sanitized sys/soundcard.h
  5885. else
  5886. test_cc -D__BSD_VISIBLE -D__XSI_VISIBLE <<EOF && add_cppflags -D__BSD_VISIBLE -D__XSI_VISIBLE && enable_sanitized sys/soundcard.h
  5887. #include <sys/soundcard.h>
  5888. audio_buf_info abc;
  5889. EOF
  5890. fi
  5891. enabled alsa && check_pkg_config alsa alsa "alsa/asoundlib.h" snd_pcm_htimestamp ||
  5892. check_lib alsa alsa/asoundlib.h snd_pcm_htimestamp -lasound
  5893. enabled libjack &&
  5894. require_pkg_config libjack jack jack/jack.h jack_port_get_latency_range
  5895. enabled sndio && check_lib sndio sndio.h sio_open -lsndio
  5896. if enabled libcdio; then
  5897. check_pkg_config libcdio libcdio_paranoia "cdio/cdda.h cdio/paranoia.h" cdio_cddap_open ||
  5898. check_pkg_config libcdio libcdio_paranoia "cdio/paranoia/cdda.h cdio/paranoia/paranoia.h" cdio_cddap_open ||
  5899. check_lib libcdio "cdio/cdda.h cdio/paranoia.h" cdio_cddap_open -lcdio_paranoia -lcdio_cdda -lcdio ||
  5900. check_lib libcdio "cdio/paranoia/cdda.h cdio/paranoia/paranoia.h" cdio_cddap_open -lcdio_paranoia -lcdio_cdda -lcdio ||
  5901. die "ERROR: No usable libcdio/cdparanoia found"
  5902. fi
  5903. enabled libxcb && check_pkg_config libxcb "xcb >= 1.4" xcb/xcb.h xcb_connect ||
  5904. disable libxcb_shm libxcb_shape libxcb_xfixes
  5905. if enabled libxcb; then
  5906. enabled libxcb_shm && check_pkg_config libxcb_shm xcb-shm xcb/shm.h xcb_shm_attach
  5907. enabled libxcb_shape && check_pkg_config libxcb_shape xcb-shape xcb/shape.h xcb_shape_get_rectangles
  5908. enabled libxcb_xfixes && check_pkg_config libxcb_xfixes xcb-xfixes xcb/xfixes.h xcb_xfixes_get_cursor_image
  5909. fi
  5910. check_func_headers "windows.h" CreateDIBSection "$gdigrab_indev_extralibs"
  5911. # d3d11va requires linking directly to dxgi and d3d11 if not building for
  5912. # the desktop api partition
  5913. test_cpp <<EOF && enable uwp && d3d11va_extralibs="-ldxgi -ld3d11"
  5914. #ifdef WINAPI_FAMILY
  5915. #include <winapifamily.h>
  5916. #if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
  5917. #error desktop, not uwp
  5918. #else
  5919. // WINAPI_FAMILY_APP, WINAPI_FAMILY_PHONE_APP => UWP
  5920. #endif
  5921. #else
  5922. #error no family set
  5923. #endif
  5924. EOF
  5925. enabled vaapi &&
  5926. check_pkg_config vaapi "libva >= 0.35.0" "va/va.h" vaInitialize
  5927. if enabled vaapi; then
  5928. check_pkg_config vaapi_drm "libva-drm" "va/va_drm.h" vaGetDisplayDRM
  5929. if enabled xlib; then
  5930. check_pkg_config vaapi_x11 "libva-x11" "va/va_x11.h" vaGetDisplay
  5931. fi
  5932. check_cpp_condition vaapi_1 "va/va.h" "VA_CHECK_VERSION(1, 0, 0)"
  5933. check_type "va/va.h va/va_dec_hevc.h" "VAPictureParameterBufferHEVC"
  5934. check_struct "va/va.h" "VADecPictureParameterBufferVP9" bit_depth
  5935. check_struct "va/va.h va/va_vpp.h" "VAProcPipelineCaps" rotation_flags
  5936. check_type "va/va.h va/va_enc_hevc.h" "VAEncPictureParameterBufferHEVC"
  5937. check_type "va/va.h va/va_enc_jpeg.h" "VAEncPictureParameterBufferJPEG"
  5938. check_type "va/va.h va/va_enc_vp8.h" "VAEncPictureParameterBufferVP8"
  5939. check_type "va/va.h va/va_enc_vp9.h" "VAEncPictureParameterBufferVP9"
  5940. fi
  5941. if enabled_all opencl libdrm ; then
  5942. check_type "CL/cl_intel.h" "clCreateImageFromFdINTEL_fn" &&
  5943. enable opencl_drm_beignet
  5944. check_func_headers "CL/cl_ext.h" clImportMemoryARM &&
  5945. enable opencl_drm_arm
  5946. fi
  5947. if enabled_all opencl vaapi ; then
  5948. if enabled opencl_drm_beignet ; then
  5949. enable opencl_vaapi_beignet
  5950. else
  5951. check_type "CL/cl.h CL/cl_va_api_media_sharing_intel.h" "clCreateFromVA_APIMediaSurfaceINTEL_fn" &&
  5952. enable opencl_vaapi_intel_media
  5953. fi
  5954. fi
  5955. if enabled_all opencl dxva2 ; then
  5956. check_type "CL/cl_dx9_media_sharing.h" cl_dx9_surface_info_khr &&
  5957. enable opencl_dxva2
  5958. fi
  5959. if enabled_all opencl d3d11va ; then
  5960. check_type "CL/cl_d3d11.h" clGetDeviceIDsFromD3D11KHR_fn &&
  5961. enable opencl_d3d11
  5962. fi
  5963. enabled vdpau &&
  5964. check_cpp_condition vdpau vdpau/vdpau.h "defined VDP_DECODER_PROFILE_MPEG4_PART2_ASP"
  5965. enabled vdpau &&
  5966. check_lib vdpau_x11 "vdpau/vdpau.h vdpau/vdpau_x11.h" vdp_device_create_x11 -lvdpau -lX11
  5967. enabled crystalhd && check_lib crystalhd "stdint.h libcrystalhd/libcrystalhd_if.h" DtsCrystalHDVersion -lcrystalhd
  5968. if enabled x86; then
  5969. case $target_os in
  5970. mingw32*|mingw64*|win32|win64|linux|cygwin*)
  5971. ;;
  5972. *)
  5973. disable ffnvcodec cuvid nvdec nvenc
  5974. ;;
  5975. esac
  5976. elif enabled ppc64 && ! enabled bigendian; then
  5977. case $target_os in
  5978. linux)
  5979. ;;
  5980. *)
  5981. disable ffnvcodec cuvid nvdec nvenc
  5982. ;;
  5983. esac
  5984. else
  5985. disable ffnvcodec cuvid nvdec nvenc
  5986. fi
  5987. enabled ffnvcodec && enable cuda
  5988. enabled nvenc &&
  5989. test_cc -I$source_path <<EOF || disable nvenc
  5990. #include <ffnvcodec/nvEncodeAPI.h>
  5991. NV_ENCODE_API_FUNCTION_LIST flist;
  5992. void f(void) { struct { const GUID guid; } s[] = { { NV_ENC_PRESET_HQ_GUID } }; }
  5993. int main(void) { return 0; }
  5994. EOF
  5995. enabled amf &&
  5996. check_cpp_condition amf "AMF/core/Version.h" \
  5997. "(AMF_VERSION_MAJOR << 48 | AMF_VERSION_MINOR << 32 | AMF_VERSION_RELEASE << 16 | AMF_VERSION_BUILD_NUM) >= 0x0001000400040001"
  5998. # Funny iconv installations are not unusual, so check it after all flags have been set
  5999. if enabled libc_iconv; then
  6000. check_func_headers iconv.h iconv
  6001. elif enabled iconv; then
  6002. check_func_headers iconv.h iconv || check_lib iconv iconv.h iconv -liconv
  6003. fi
  6004. enabled debug && add_cflags -g"$debuglevel" && add_asflags -g"$debuglevel"
  6005. # add some useful compiler flags if supported
  6006. check_cflags -Wdeclaration-after-statement
  6007. check_cflags -Wall
  6008. check_cflags -Wdisabled-optimization
  6009. check_cflags -Wpointer-arith
  6010. check_cflags -Wredundant-decls
  6011. check_cflags -Wwrite-strings
  6012. check_cflags -Wtype-limits
  6013. check_cflags -Wundef
  6014. check_cflags -Wmissing-prototypes
  6015. check_cflags -Wno-pointer-to-int-cast
  6016. check_cflags -Wstrict-prototypes
  6017. check_cflags -Wempty-body
  6018. if enabled extra_warnings; then
  6019. check_cflags -Wcast-qual
  6020. check_cflags -Wextra
  6021. check_cflags -Wpedantic
  6022. fi
  6023. check_disable_warning(){
  6024. warning_flag=-W${1#-Wno-}
  6025. test_cflags $unknown_warning_flags $warning_flag && add_cflags $1
  6026. }
  6027. test_cflags -Werror=unused-command-line-argument &&
  6028. append unknown_warning_flags "-Werror=unused-command-line-argument"
  6029. test_cflags -Werror=unknown-warning-option &&
  6030. append unknown_warning_flags "-Werror=unknown-warning-option"
  6031. check_disable_warning -Wno-parentheses
  6032. check_disable_warning -Wno-switch
  6033. check_disable_warning -Wno-format-zero-length
  6034. check_disable_warning -Wno-pointer-sign
  6035. check_disable_warning -Wno-unused-const-variable
  6036. check_disable_warning -Wno-bool-operation
  6037. check_disable_warning -Wno-char-subscripts
  6038. check_disable_warning_headers(){
  6039. warning_flag=-W${1#-Wno-}
  6040. test_cflags $warning_flag && add_cflags_headers $1
  6041. }
  6042. check_disable_warning_headers -Wno-deprecated-declarations
  6043. check_disable_warning_headers -Wno-unused-variable
  6044. test_cc <<EOF && enable blocks_extension
  6045. void (^block)(void);
  6046. EOF
  6047. # add some linker flags
  6048. check_ldflags -Wl,--warn-common
  6049. check_ldflags -Wl,-rpath-link=:libpostproc:libswresample:libswscale:libavfilter:libavdevice:libavformat:libavcodec:libavutil:libavresample
  6050. enabled rpath && add_ldexeflags -Wl,-rpath,$libdir && add_ldsoflags -Wl,-rpath,$libdir
  6051. test_ldflags -Wl,-Bsymbolic && append SHFLAGS -Wl,-Bsymbolic
  6052. # add some strip flags
  6053. check_stripflags -x
  6054. enabled neon_clobber_test &&
  6055. check_ldflags -Wl,--wrap,avcodec_open2 \
  6056. -Wl,--wrap,avcodec_decode_audio4 \
  6057. -Wl,--wrap,avcodec_decode_video2 \
  6058. -Wl,--wrap,avcodec_decode_subtitle2 \
  6059. -Wl,--wrap,avcodec_encode_audio2 \
  6060. -Wl,--wrap,avcodec_encode_video2 \
  6061. -Wl,--wrap,avcodec_encode_subtitle \
  6062. -Wl,--wrap,avcodec_send_packet \
  6063. -Wl,--wrap,avcodec_receive_packet \
  6064. -Wl,--wrap,avcodec_send_frame \
  6065. -Wl,--wrap,avcodec_receive_frame \
  6066. -Wl,--wrap,swr_convert \
  6067. -Wl,--wrap,avresample_convert ||
  6068. disable neon_clobber_test
  6069. enabled xmm_clobber_test &&
  6070. check_ldflags -Wl,--wrap,avcodec_open2 \
  6071. -Wl,--wrap,avcodec_decode_audio4 \
  6072. -Wl,--wrap,avcodec_decode_video2 \
  6073. -Wl,--wrap,avcodec_decode_subtitle2 \
  6074. -Wl,--wrap,avcodec_encode_audio2 \
  6075. -Wl,--wrap,avcodec_encode_video2 \
  6076. -Wl,--wrap,avcodec_encode_subtitle \
  6077. -Wl,--wrap,avcodec_send_packet \
  6078. -Wl,--wrap,avcodec_receive_packet \
  6079. -Wl,--wrap,avcodec_send_frame \
  6080. -Wl,--wrap,avcodec_receive_frame \
  6081. -Wl,--wrap,swr_convert \
  6082. -Wl,--wrap,avresample_convert \
  6083. -Wl,--wrap,sws_scale ||
  6084. disable xmm_clobber_test
  6085. check_ld "cc" proper_dce <<EOF
  6086. extern const int array[512];
  6087. static inline int func(void) { return array[0]; }
  6088. int main(void) { return 0; }
  6089. EOF
  6090. if enabled proper_dce; then
  6091. echo "X { local: *; };" > $TMPV
  6092. if test_ldflags -Wl,${version_script},$TMPV; then
  6093. append SHFLAGS '-Wl,${version_script},\$(SUBDIR)lib\$(NAME).ver'
  6094. quotes='""'
  6095. test_cc <<EOF && enable symver_asm_label
  6096. void ff_foo(void) __asm__ ("av_foo@VERSION");
  6097. void ff_foo(void) { ${inline_asm+__asm__($quotes);} }
  6098. EOF
  6099. test_cc <<EOF && enable symver_gnu_asm
  6100. __asm__(".symver ff_foo,av_foo@VERSION");
  6101. void ff_foo(void) {}
  6102. EOF
  6103. fi
  6104. fi
  6105. if [ -z "$optflags" ]; then
  6106. if enabled small; then
  6107. optflags=$cflags_size
  6108. elif enabled optimizations; then
  6109. optflags=$cflags_speed
  6110. else
  6111. optflags=$cflags_noopt
  6112. fi
  6113. fi
  6114. if [ -z "$nvccflags" ]; then
  6115. nvccflags=$nvccflags_default
  6116. fi
  6117. if enabled x86_64 || enabled ppc64 || enabled aarch64; then
  6118. nvccflags="$nvccflags -m64"
  6119. else
  6120. nvccflags="$nvccflags -m32"
  6121. fi
  6122. check_optflags(){
  6123. check_cflags "$@"
  6124. enabled lto && check_ldflags "$@"
  6125. }
  6126. check_optflags $optflags
  6127. check_optflags -fno-math-errno
  6128. check_optflags -fno-signed-zeros
  6129. if enabled lto; then
  6130. test "$cc_type" != "$ld_type" && die "LTO requires same compiler and linker"
  6131. check_cflags -flto
  6132. check_ldflags -flto $cpuflags
  6133. disable inline_asm_direct_symbol_refs
  6134. fi
  6135. enabled ftrapv && check_cflags -ftrapv
  6136. test_cc -mno-red-zone <<EOF && noredzone_flags="-mno-red-zone"
  6137. int x;
  6138. EOF
  6139. if enabled icc; then
  6140. # Just warnings, no remarks
  6141. check_cflags -w1
  6142. # -wd: Disable following warnings
  6143. # 144, 167, 556: -Wno-pointer-sign
  6144. # 188: enumerated type mixed with another type
  6145. # 1292: attribute "foo" ignored
  6146. # 1419: external declaration in primary source file
  6147. # 10006: ignoring unknown option -fno-signed-zeros
  6148. # 10148: ignoring unknown option -Wno-parentheses
  6149. # 10156: ignoring option '-W'; no argument required
  6150. # 13200: No EMMS instruction before call to function
  6151. # 13203: No EMMS instruction before return from function
  6152. check_cflags -wd144,167,188,556,1292,1419,10006,10148,10156,13200,13203
  6153. # 11030: Warning unknown option --as-needed
  6154. # 10156: ignoring option '-export'; no argument required
  6155. check_ldflags -wd10156,11030
  6156. # icc 11.0 and 11.1 work with ebp_available, but don't pass the test
  6157. enable ebp_available
  6158. # The test above does not test linking
  6159. enabled lto && disable symver_asm_label
  6160. if enabled x86_32; then
  6161. icc_version=$($cc -dumpversion)
  6162. test ${icc_version%%.*} -ge 11 &&
  6163. check_cflags -falign-stack=maintain-16-byte ||
  6164. disable aligned_stack
  6165. fi
  6166. elif enabled gcc; then
  6167. check_optflags -fno-tree-vectorize
  6168. check_cflags -Werror=format-security
  6169. check_cflags -Werror=implicit-function-declaration
  6170. check_cflags -Werror=missing-prototypes
  6171. check_cflags -Werror=return-type
  6172. check_cflags -Werror=vla
  6173. check_cflags -Wformat
  6174. check_cflags -fdiagnostics-color=auto
  6175. enabled extra_warnings || check_disable_warning -Wno-maybe-uninitialized
  6176. if enabled x86_32; then
  6177. case $target_os in
  6178. *bsd*)
  6179. # BSDs don't guarantee a 16 byte aligned stack, but we can
  6180. # request GCC to try to maintain 16 byte alignment throughout
  6181. # function calls. Library entry points that might call assembly
  6182. # functions align the stack. (The parameter means 2^4 bytes.)
  6183. check_cflags -mpreferred-stack-boundary=4
  6184. ;;
  6185. esac
  6186. fi
  6187. elif enabled llvm_gcc; then
  6188. check_cflags -mllvm -stack-alignment=16
  6189. elif enabled clang; then
  6190. if enabled x86_32; then
  6191. # Clang doesn't support maintaining alignment without assuming the
  6192. # same alignment in every function. If 16 byte alignment would be
  6193. # enabled, one would also have to either add attribute_align_arg on
  6194. # every single entry point into the libraries or enable -mstackrealign
  6195. # (doing stack realignment in every single function).
  6196. case $target_os in
  6197. mingw32|win32|*bsd*)
  6198. disable aligned_stack
  6199. ;;
  6200. *)
  6201. check_cflags -mllvm -stack-alignment=16
  6202. check_cflags -mstack-alignment=16
  6203. ;;
  6204. esac
  6205. else
  6206. check_cflags -mllvm -stack-alignment=16
  6207. check_cflags -mstack-alignment=16
  6208. fi
  6209. check_cflags -Qunused-arguments
  6210. check_cflags -Werror=implicit-function-declaration
  6211. check_cflags -Werror=missing-prototypes
  6212. check_cflags -Werror=return-type
  6213. elif enabled cparser; then
  6214. add_cflags -Wno-missing-variable-declarations
  6215. add_cflags -Wno-empty-statement
  6216. elif enabled armcc; then
  6217. add_cflags -W${armcc_opt},--diag_suppress=4343 # hardfp compat
  6218. add_cflags -W${armcc_opt},--diag_suppress=3036 # using . as system include dir
  6219. # 2523: use of inline assembly is deprecated
  6220. add_cflags -W${armcc_opt},--diag_suppress=2523
  6221. add_cflags -W${armcc_opt},--diag_suppress=1207
  6222. add_cflags -W${armcc_opt},--diag_suppress=1293 # assignment in condition
  6223. add_cflags -W${armcc_opt},--diag_suppress=3343 # hardfp compat
  6224. add_cflags -W${armcc_opt},--diag_suppress=167 # pointer sign
  6225. add_cflags -W${armcc_opt},--diag_suppress=513 # pointer sign
  6226. elif enabled pathscale; then
  6227. add_cflags -fstrict-overflow -OPT:wrap_around_unsafe_opt=OFF
  6228. disable inline_asm
  6229. elif enabled_any msvc icl; then
  6230. enabled x86_32 && disable aligned_stack
  6231. enabled_all x86_32 debug && add_cflags -Oy-
  6232. enabled debug && add_ldflags -debug
  6233. enable pragma_deprecated
  6234. if enabled icl; then
  6235. # -Qansi-alias is basically -fstrict-aliasing, but does not work
  6236. # (correctly) on icl 13.x.
  6237. test_cpp_condition "windows.h" "__ICL < 1300 || __ICL >= 1400" &&
  6238. add_cflags -Qansi-alias
  6239. # Some inline asm is not compilable in debug
  6240. if enabled debug; then
  6241. disable ebp_available
  6242. disable ebx_available
  6243. fi
  6244. fi
  6245. # msvcrt10 x64 incorrectly enables log2, only msvcrt12 (MSVC 2013) onwards actually has log2.
  6246. check_cpp_condition log2 crtversion.h "_VC_CRT_MAJOR_VERSION >= 12"
  6247. # The CRT headers contain __declspec(restrict) in a few places, but if redefining
  6248. # restrict, this might break. MSVC 2010 and 2012 fail with __declspec(__restrict)
  6249. # (as it ends up if the restrict redefine is done before including stdlib.h), while
  6250. # MSVC 2013 and newer can handle it fine.
  6251. # If this declspec fails, force including stdlib.h before the restrict redefinition
  6252. # happens in config.h.
  6253. if [ $restrict_keyword != restrict ]; then
  6254. test_cc <<EOF || add_cflags -FIstdlib.h
  6255. __declspec($restrict_keyword) void *foo(int);
  6256. EOF
  6257. fi
  6258. # the new SSA optimzer in VS2015 U3 is mis-optimizing some parts of the code
  6259. # Issue has been fixed in MSVC v19.00.24218.
  6260. test_cpp_condition windows.h "_MSC_FULL_VER >= 190024218" ||
  6261. check_cflags -d2SSAOptimizer-
  6262. # enable utf-8 source processing on VS2015 U2 and newer
  6263. test_cpp_condition windows.h "_MSC_FULL_VER >= 190023918" &&
  6264. add_cflags -utf-8
  6265. fi
  6266. for pfx in "" host_; do
  6267. varname=${pfx%_}cc_type
  6268. eval "type=\$$varname"
  6269. if [ "$type" = "msvc" ]; then
  6270. test_${pfx}cc <<EOF || add_${pfx}cflags -Dinline=__inline
  6271. static inline int foo(int a) { return a; }
  6272. EOF
  6273. fi
  6274. done
  6275. case $as_type in
  6276. clang)
  6277. add_asflags -Qunused-arguments
  6278. ;;
  6279. esac
  6280. case $ld_type in
  6281. clang)
  6282. check_ldflags -Qunused-arguments
  6283. ;;
  6284. esac
  6285. enable frame_thread_encoder
  6286. enabled asm || { arch=c; disable $ARCH_LIST $ARCH_EXT_LIST; }
  6287. check_deps $CONFIG_LIST \
  6288. $CONFIG_EXTRA \
  6289. $HAVE_LIST \
  6290. $ALL_COMPONENTS \
  6291. 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"
  6292. enabled avresample && warn "Building with deprecated library libavresample"
  6293. case $target_os in
  6294. haiku)
  6295. disable memalign
  6296. disable posix_memalign
  6297. ;;
  6298. *-dos|freedos|opendos)
  6299. if test_cpp_condition sys/version.h "defined(__DJGPP__) && __DJGPP__ == 2 && __DJGPP_MINOR__ == 5"; then
  6300. disable memalign
  6301. fi
  6302. ;;
  6303. esac
  6304. flatten_extralibs(){
  6305. nested_entries=
  6306. list_name=$1
  6307. eval list=\$${1}
  6308. for entry in $list; do
  6309. entry_copy=$entry
  6310. resolve entry_copy
  6311. flat_entries=
  6312. for e in $entry_copy; do
  6313. case $e in
  6314. *_extralibs) nested_entries="$nested_entries$e ";;
  6315. *) flat_entries="$flat_entries$e ";;
  6316. esac
  6317. done
  6318. eval $entry="\$flat_entries"
  6319. done
  6320. append $list_name "$nested_entries"
  6321. resolve nested_entries
  6322. if test -n "$(filter '*_extralibs' $nested_entries)"; then
  6323. flatten_extralibs $list_name
  6324. fi
  6325. }
  6326. flatten_extralibs_wrapper(){
  6327. list_name=$1
  6328. flatten_extralibs $list_name
  6329. unique $list_name
  6330. resolve $list_name
  6331. eval $list_name=\$\(\$ldflags_filter \$$list_name\)
  6332. eval printf \''%s'\' \""\$$list_name"\"
  6333. }
  6334. for linkunit in $LIBRARY_LIST; do
  6335. unset current_extralibs
  6336. eval components=\$$(toupper ${linkunit})_COMPONENTS_LIST
  6337. for comp in ${components}; do
  6338. enabled $comp || continue
  6339. comp_extralibs="${comp}_extralibs"
  6340. append current_extralibs $comp_extralibs
  6341. done
  6342. eval prepend ${linkunit}_extralibs $current_extralibs
  6343. done
  6344. for linkunit in $LIBRARY_LIST $PROGRAM_LIST $EXTRALIBS_LIST; do
  6345. eval ${linkunit}_extralibs=\$\(flatten_extralibs_wrapper ${linkunit}_extralibs\)
  6346. done
  6347. map 'enabled $v && intrinsics=${v#intrinsics_}' $INTRINSICS_LIST
  6348. for thread in $THREADS_LIST; do
  6349. if enabled $thread; then
  6350. test -n "$thread_type" &&
  6351. die "ERROR: Only one thread type must be selected." ||
  6352. thread_type="$thread"
  6353. fi
  6354. done
  6355. if disabled stdatomic; then
  6356. if enabled atomics_gcc; then
  6357. add_cppflags '-I\$(SRC_PATH)/compat/atomics/gcc'
  6358. elif enabled atomics_win32; then
  6359. add_cppflags '-I\$(SRC_PATH)/compat/atomics/win32'
  6360. elif enabled atomics_suncc; then
  6361. add_cppflags '-I\$(SRC_PATH)/compat/atomics/suncc'
  6362. elif enabled pthreads; then
  6363. add_compat atomics/pthread/stdatomic.o
  6364. add_cppflags '-I\$(SRC_PATH)/compat/atomics/pthread'
  6365. else
  6366. enabled threads && die "Threading is enabled, but no atomics are available"
  6367. add_cppflags '-I\$(SRC_PATH)/compat/atomics/dummy'
  6368. fi
  6369. fi
  6370. # Check if requested libraries were found.
  6371. for lib in $AUTODETECT_LIBS; do
  6372. requested $lib && ! enabled $lib && die "ERROR: $lib requested but not found";
  6373. done
  6374. enabled zlib && add_cppflags -DZLIB_CONST
  6375. # conditional library dependencies, in any order
  6376. enabled afftdn_filter && prepend avfilter_deps "avcodec"
  6377. enabled afftfilt_filter && prepend avfilter_deps "avcodec"
  6378. enabled afir_filter && prepend avfilter_deps "avcodec"
  6379. enabled amovie_filter && prepend avfilter_deps "avformat avcodec"
  6380. enabled aresample_filter && prepend avfilter_deps "swresample"
  6381. enabled atempo_filter && prepend avfilter_deps "avcodec"
  6382. enabled bm3d_filter && prepend avfilter_deps "avcodec"
  6383. enabled cover_rect_filter && prepend avfilter_deps "avformat avcodec"
  6384. enabled convolve_filter && prepend avfilter_deps "avcodec"
  6385. enabled deconvolve_filter && prepend avfilter_deps "avcodec"
  6386. enabled ebur128_filter && enabled swresample && prepend avfilter_deps "swresample"
  6387. enabled elbg_filter && prepend avfilter_deps "avcodec"
  6388. enabled fftfilt_filter && prepend avfilter_deps "avcodec"
  6389. enabled find_rect_filter && prepend avfilter_deps "avformat avcodec"
  6390. enabled firequalizer_filter && prepend avfilter_deps "avcodec"
  6391. enabled mcdeint_filter && prepend avfilter_deps "avcodec"
  6392. enabled movie_filter && prepend avfilter_deps "avformat avcodec"
  6393. enabled pan_filter && prepend avfilter_deps "swresample"
  6394. enabled pp_filter && prepend avfilter_deps "postproc"
  6395. enabled removelogo_filter && prepend avfilter_deps "avformat avcodec swscale"
  6396. enabled resample_filter && prepend avfilter_deps "avresample"
  6397. enabled sab_filter && prepend avfilter_deps "swscale"
  6398. enabled scale_filter && prepend avfilter_deps "swscale"
  6399. enabled scale2ref_filter && prepend avfilter_deps "swscale"
  6400. enabled sofalizer_filter && prepend avfilter_deps "avcodec"
  6401. enabled showcqt_filter && prepend avfilter_deps "avformat avcodec swscale"
  6402. enabled showfreqs_filter && prepend avfilter_deps "avcodec"
  6403. enabled showspectrum_filter && prepend avfilter_deps "avcodec"
  6404. enabled signature_filter && prepend avfilter_deps "avcodec avformat"
  6405. enabled smartblur_filter && prepend avfilter_deps "swscale"
  6406. enabled spectrumsynth_filter && prepend avfilter_deps "avcodec"
  6407. enabled spp_filter && prepend avfilter_deps "avcodec"
  6408. enabled sr_filter && prepend avfilter_deps "avformat swscale"
  6409. enabled subtitles_filter && prepend avfilter_deps "avformat avcodec"
  6410. enabled uspp_filter && prepend avfilter_deps "avcodec"
  6411. enabled zoompan_filter && prepend avfilter_deps "swscale"
  6412. enabled lavfi_indev && prepend avdevice_deps "avfilter"
  6413. #FIXME
  6414. enabled_any sdl2_outdev opengl_outdev && enabled sdl2 &&
  6415. add_cflags $(filter_out '-Dmain=SDL_main' $sdl2_cflags)
  6416. enabled opus_decoder && prepend avcodec_deps "swresample"
  6417. # reorder the items at var $1 to align with the items order at var $2 .
  6418. # die if an item at $1 is not at $2 .
  6419. reorder_by(){
  6420. eval rb_in=\$$1
  6421. eval rb_ordered=\$$2
  6422. for rb in $rb_in; do
  6423. is_in $rb $rb_ordered || die "$rb at \$$1 is not at \$$2"
  6424. done
  6425. rb_out=
  6426. for rb in $rb_ordered; do
  6427. is_in $rb $rb_in && rb_out="$rb_out$rb "
  6428. done
  6429. eval $1=\$rb_out
  6430. }
  6431. # deps-expand fflib $1: N x {append all expanded deps; unique}
  6432. # within a set of N items, N expansions are enough to expose a cycle.
  6433. expand_deps(){
  6434. unique ${1}_deps # required for the early break test.
  6435. for dummy in $LIBRARY_LIST; do # N iteratios
  6436. eval deps=\$${1}_deps
  6437. append ${1}_deps $(map 'eval echo \$${v}_deps' $deps)
  6438. unique ${1}_deps
  6439. eval '[ ${#deps} = ${#'${1}_deps'} ]' && break # doesn't expand anymore
  6440. done
  6441. eval is_in $1 \$${1}_deps && die "Dependency cycle at ${1}_deps"
  6442. reorder_by ${1}_deps LIBRARY_LIST # linking order is expected later
  6443. }
  6444. #we have to remove gpl from the deps here as some code assumes all lib deps are libs
  6445. postproc_deps="$(filter_out 'gpl' $postproc_deps)"
  6446. map 'expand_deps $v' $LIBRARY_LIST
  6447. if test "$quiet" != "yes"; then
  6448. echo "install prefix $prefix"
  6449. echo "source path $source_path"
  6450. echo "C compiler $cc"
  6451. echo "C library $libc_type"
  6452. if test "$host_cc" != "$cc"; then
  6453. echo "host C compiler $host_cc"
  6454. echo "host C library $host_libc_type"
  6455. fi
  6456. echo "ARCH $arch ($cpu)"
  6457. if test "$build_suffix" != ""; then
  6458. echo "build suffix $build_suffix"
  6459. fi
  6460. if test "$progs_suffix" != ""; then
  6461. echo "progs suffix $progs_suffix"
  6462. fi
  6463. if test "$extra_version" != ""; then
  6464. echo "version string suffix $extra_version"
  6465. fi
  6466. echo "big-endian ${bigendian-no}"
  6467. echo "runtime cpu detection ${runtime_cpudetect-no}"
  6468. if enabled x86; then
  6469. echo "standalone assembly ${x86asm-no}"
  6470. echo "x86 assembler ${x86asmexe}"
  6471. echo "MMX enabled ${mmx-no}"
  6472. echo "MMXEXT enabled ${mmxext-no}"
  6473. echo "3DNow! enabled ${amd3dnow-no}"
  6474. echo "3DNow! extended enabled ${amd3dnowext-no}"
  6475. echo "SSE enabled ${sse-no}"
  6476. echo "SSSE3 enabled ${ssse3-no}"
  6477. echo "AESNI enabled ${aesni-no}"
  6478. echo "AVX enabled ${avx-no}"
  6479. echo "AVX2 enabled ${avx2-no}"
  6480. echo "AVX-512 enabled ${avx512-no}"
  6481. echo "XOP enabled ${xop-no}"
  6482. echo "FMA3 enabled ${fma3-no}"
  6483. echo "FMA4 enabled ${fma4-no}"
  6484. echo "i686 features enabled ${i686-no}"
  6485. echo "CMOV is fast ${fast_cmov-no}"
  6486. echo "EBX available ${ebx_available-no}"
  6487. echo "EBP available ${ebp_available-no}"
  6488. fi
  6489. if enabled aarch64; then
  6490. echo "NEON enabled ${neon-no}"
  6491. echo "VFP enabled ${vfp-no}"
  6492. fi
  6493. if enabled arm; then
  6494. echo "ARMv5TE enabled ${armv5te-no}"
  6495. echo "ARMv6 enabled ${armv6-no}"
  6496. echo "ARMv6T2 enabled ${armv6t2-no}"
  6497. echo "VFP enabled ${vfp-no}"
  6498. echo "NEON enabled ${neon-no}"
  6499. echo "THUMB enabled ${thumb-no}"
  6500. fi
  6501. if enabled mips; then
  6502. echo "MIPS FPU enabled ${mipsfpu-no}"
  6503. echo "MIPS DSP R1 enabled ${mipsdsp-no}"
  6504. echo "MIPS DSP R2 enabled ${mipsdspr2-no}"
  6505. echo "MIPS MSA enabled ${msa-no}"
  6506. echo "LOONGSON MMI enabled ${mmi-no}"
  6507. fi
  6508. if enabled ppc; then
  6509. echo "AltiVec enabled ${altivec-no}"
  6510. echo "VSX enabled ${vsx-no}"
  6511. echo "POWER8 enabled ${power8-no}"
  6512. echo "PPC 4xx optimizations ${ppc4xx-no}"
  6513. echo "dcbzl available ${dcbzl-no}"
  6514. fi
  6515. echo "debug symbols ${debug-no}"
  6516. echo "strip symbols ${stripping-no}"
  6517. echo "optimize for size ${small-no}"
  6518. echo "optimizations ${optimizations-no}"
  6519. echo "static ${static-no}"
  6520. echo "shared ${shared-no}"
  6521. echo "postprocessing support ${postproc-no}"
  6522. echo "network support ${network-no}"
  6523. echo "threading support ${thread_type-no}"
  6524. echo "safe bitstream reader ${safe_bitstream_reader-no}"
  6525. echo "texi2html enabled ${texi2html-no}"
  6526. echo "perl enabled ${perl-no}"
  6527. echo "pod2man enabled ${pod2man-no}"
  6528. echo "makeinfo enabled ${makeinfo-no}"
  6529. echo "makeinfo supports HTML ${makeinfo_html-no}"
  6530. test -n "$random_seed" &&
  6531. echo "random seed ${random_seed}"
  6532. echo
  6533. echo "External libraries:"
  6534. print_enabled '' $EXTERNAL_LIBRARY_LIST $EXTERNAL_AUTODETECT_LIBRARY_LIST | print_in_columns
  6535. echo
  6536. echo "External libraries providing hardware acceleration:"
  6537. print_enabled '' $HWACCEL_LIBRARY_LIST $HWACCEL_AUTODETECT_LIBRARY_LIST | print_in_columns
  6538. echo
  6539. echo "Libraries:"
  6540. print_enabled '' $LIBRARY_LIST | print_in_columns
  6541. echo
  6542. echo "Programs:"
  6543. print_enabled '' $PROGRAM_LIST | print_in_columns
  6544. echo
  6545. for type in decoder encoder hwaccel parser demuxer muxer protocol filter bsf indev outdev; do
  6546. echo "Enabled ${type}s:"
  6547. eval list=\$$(toupper $type)_LIST
  6548. print_enabled '_*' $list | print_in_columns
  6549. echo
  6550. done
  6551. if test -n "$ignore_tests"; then
  6552. ignore_tests=$(echo $ignore_tests | tr ',' ' ')
  6553. echo "Ignored FATE tests:"
  6554. echo $ignore_tests | print_in_columns
  6555. echo
  6556. fi
  6557. echo "License: $license"
  6558. fi # test "$quiet" != "yes"
  6559. if test -n "$WARN_IF_GETS_DISABLED_LIST"; then
  6560. for cfg in $WARN_IF_GETS_DISABLED_LIST; do
  6561. if disabled $cfg; then
  6562. varname=${cfg}_disable_reason
  6563. eval "warn \"Disabled $cfg because \$$varname\""
  6564. fi
  6565. done
  6566. fi
  6567. if test -n "$WARNINGS"; then
  6568. printf "\n%s%s$WARNINGS%s" "$warn_color" "$bold_color" "$reset_color"
  6569. enabled fatal_warnings && exit 1
  6570. fi
  6571. test -e Makefile || echo "include $source_path/Makefile" > Makefile
  6572. esc(){
  6573. echo "$*" | sed 's/%/%25/g;s/:/%3a/g'
  6574. }
  6575. echo "config:$arch:$subarch:$cpu:$target_os:$(esc $cc_ident):$(esc $FFMPEG_CONFIGURATION)" > ffbuild/config.fate
  6576. enabled stripping || strip="echo skipping strip"
  6577. enabled stripping || striptype=""
  6578. config_files="$TMPH ffbuild/config.mak doc/config.texi"
  6579. cat > ffbuild/config.mak <<EOF
  6580. # Automatically generated by configure - do not modify!
  6581. ifndef FFMPEG_CONFIG_MAK
  6582. FFMPEG_CONFIG_MAK=1
  6583. FFMPEG_CONFIGURATION=$FFMPEG_CONFIGURATION
  6584. prefix=$prefix
  6585. LIBDIR=\$(DESTDIR)$libdir
  6586. SHLIBDIR=\$(DESTDIR)$shlibdir
  6587. INCDIR=\$(DESTDIR)$incdir
  6588. BINDIR=\$(DESTDIR)$bindir
  6589. DATADIR=\$(DESTDIR)$datadir
  6590. DOCDIR=\$(DESTDIR)$docdir
  6591. MANDIR=\$(DESTDIR)$mandir
  6592. PKGCONFIGDIR=\$(DESTDIR)$pkgconfigdir
  6593. INSTALL_NAME_DIR=$install_name_dir
  6594. SRC_PATH=$source_path
  6595. SRC_LINK=$source_link
  6596. ifndef MAIN_MAKEFILE
  6597. SRC_PATH:=\$(SRC_PATH:.%=..%)
  6598. endif
  6599. CC_IDENT=$cc_ident
  6600. ARCH=$arch
  6601. INTRINSICS=$intrinsics
  6602. EXTERN_PREFIX=$extern_prefix
  6603. CC=$cc
  6604. CXX=$cxx
  6605. AS=$as
  6606. OBJCC=$objcc
  6607. LD=$ld
  6608. DEPCC=$dep_cc
  6609. DEPCCFLAGS=$DEPCCFLAGS \$(CPPFLAGS)
  6610. DEPAS=$as
  6611. DEPASFLAGS=$DEPASFLAGS \$(CPPFLAGS)
  6612. X86ASM=$x86asmexe
  6613. DEPX86ASM=$x86asmexe
  6614. DEPX86ASMFLAGS=\$(X86ASMFLAGS)
  6615. AR=$ar
  6616. ARFLAGS=$arflags
  6617. AR_O=$ar_o
  6618. AR_CMD=$ar
  6619. NM_CMD=$nm
  6620. RANLIB=$ranlib
  6621. STRIP=$strip
  6622. STRIPTYPE=$striptype
  6623. NVCC=$nvcc
  6624. CP=cp -p
  6625. LN_S=$ln_s
  6626. CPPFLAGS=$CPPFLAGS
  6627. CFLAGS=$CFLAGS
  6628. CXXFLAGS=$CXXFLAGS
  6629. OBJCFLAGS=$OBJCFLAGS
  6630. ASFLAGS=$ASFLAGS
  6631. NVCCFLAGS=$nvccflags
  6632. AS_C=$AS_C
  6633. AS_O=$AS_O
  6634. OBJCC_C=$OBJCC_C
  6635. OBJCC_E=$OBJCC_E
  6636. OBJCC_O=$OBJCC_O
  6637. CC_C=$CC_C
  6638. CC_E=$CC_E
  6639. CC_O=$CC_O
  6640. CXX_C=$CXX_C
  6641. CXX_O=$CXX_O
  6642. NVCC_C=$NVCC_C
  6643. NVCC_O=$NVCC_O
  6644. LD_O=$LD_O
  6645. X86ASM_O=$X86ASM_O
  6646. LD_LIB=$LD_LIB
  6647. LD_PATH=$LD_PATH
  6648. DLLTOOL=$dlltool
  6649. WINDRES=$windres
  6650. DEPWINDRES=$dep_cc
  6651. DOXYGEN=$doxygen
  6652. LDFLAGS=$LDFLAGS
  6653. LDEXEFLAGS=$LDEXEFLAGS
  6654. LDSOFLAGS=$LDSOFLAGS
  6655. SHFLAGS=$(echo $($ldflags_filter $SHFLAGS))
  6656. ASMSTRIPFLAGS=$ASMSTRIPFLAGS
  6657. X86ASMFLAGS=$X86ASMFLAGS
  6658. BUILDSUF=$build_suffix
  6659. PROGSSUF=$progs_suffix
  6660. FULLNAME=$FULLNAME
  6661. LIBPREF=$LIBPREF
  6662. LIBSUF=$LIBSUF
  6663. LIBNAME=$LIBNAME
  6664. SLIBPREF=$SLIBPREF
  6665. SLIBSUF=$SLIBSUF
  6666. EXESUF=$EXESUF
  6667. EXTRA_VERSION=$extra_version
  6668. CCDEP=$CCDEP
  6669. CXXDEP=$CXXDEP
  6670. CCDEP_FLAGS=$CCDEP_FLAGS
  6671. ASDEP=$ASDEP
  6672. ASDEP_FLAGS=$ASDEP_FLAGS
  6673. X86ASMDEP=$X86ASMDEP
  6674. X86ASMDEP_FLAGS=$X86ASMDEP_FLAGS
  6675. CC_DEPFLAGS=$CC_DEPFLAGS
  6676. AS_DEPFLAGS=$AS_DEPFLAGS
  6677. X86ASM_DEPFLAGS=$X86ASM_DEPFLAGS
  6678. HOSTCC=$host_cc
  6679. HOSTLD=$host_ld
  6680. HOSTCFLAGS=$host_cflags
  6681. HOSTCPPFLAGS=$host_cppflags
  6682. HOSTEXESUF=$HOSTEXESUF
  6683. HOSTLDFLAGS=$host_ldflags
  6684. HOSTEXTRALIBS=$host_extralibs
  6685. DEPHOSTCC=$host_cc
  6686. DEPHOSTCCFLAGS=$DEPHOSTCCFLAGS \$(HOSTCCFLAGS)
  6687. HOSTCCDEP=$HOSTCCDEP
  6688. HOSTCCDEP_FLAGS=$HOSTCCDEP_FLAGS
  6689. HOSTCC_DEPFLAGS=$HOSTCC_DEPFLAGS
  6690. HOSTCC_C=$HOSTCC_C
  6691. HOSTCC_O=$HOSTCC_O
  6692. HOSTLD_O=$HOSTLD_O
  6693. TARGET_EXEC=$target_exec $target_exec_args
  6694. TARGET_PATH=$target_path
  6695. TARGET_SAMPLES=${target_samples:-\$(SAMPLES)}
  6696. CFLAGS-ffplay=${sdl2_cflags}
  6697. CFLAGS_HEADERS=$CFLAGS_HEADERS
  6698. LIB_INSTALL_EXTRA_CMD=$LIB_INSTALL_EXTRA_CMD
  6699. EXTRALIBS=$extralibs
  6700. COMPAT_OBJS=$compat_objs
  6701. INSTALL=$install
  6702. LIBTARGET=${LIBTARGET}
  6703. SLIBNAME=${SLIBNAME}
  6704. SLIBNAME_WITH_VERSION=${SLIBNAME_WITH_VERSION}
  6705. SLIBNAME_WITH_MAJOR=${SLIBNAME_WITH_MAJOR}
  6706. SLIB_CREATE_DEF_CMD=${SLIB_CREATE_DEF_CMD}
  6707. SLIB_EXTRA_CMD=${SLIB_EXTRA_CMD}
  6708. SLIB_INSTALL_NAME=${SLIB_INSTALL_NAME}
  6709. SLIB_INSTALL_LINKS=${SLIB_INSTALL_LINKS}
  6710. SLIB_INSTALL_EXTRA_LIB=${SLIB_INSTALL_EXTRA_LIB}
  6711. SLIB_INSTALL_EXTRA_SHLIB=${SLIB_INSTALL_EXTRA_SHLIB}
  6712. VERSION_SCRIPT_POSTPROCESS_CMD=${VERSION_SCRIPT_POSTPROCESS_CMD}
  6713. SAMPLES:=${samples:-\$(FATE_SAMPLES)}
  6714. NOREDZONE_FLAGS=$noredzone_flags
  6715. LIBFUZZER_PATH=$libfuzzer_path
  6716. IGNORE_TESTS=$ignore_tests
  6717. EOF
  6718. map 'eval echo "${v}_FFLIBS=\$${v}_deps" >> ffbuild/config.mak' $LIBRARY_LIST
  6719. for entry in $LIBRARY_LIST $PROGRAM_LIST $EXTRALIBS_LIST; do
  6720. eval echo "EXTRALIBS-${entry}=\$${entry}_extralibs" >> ffbuild/config.mak
  6721. done
  6722. cat > $TMPH <<EOF
  6723. /* Automatically generated by configure - do not modify! */
  6724. #ifndef FFMPEG_CONFIG_H
  6725. #define FFMPEG_CONFIG_H
  6726. #define FFMPEG_CONFIGURATION "$(c_escape $FFMPEG_CONFIGURATION)"
  6727. #define FFMPEG_LICENSE "$(c_escape $license)"
  6728. #define CONFIG_THIS_YEAR 2019
  6729. #define FFMPEG_DATADIR "$(eval c_escape $datadir)"
  6730. #define AVCONV_DATADIR "$(eval c_escape $datadir)"
  6731. #define CC_IDENT "$(c_escape ${cc_ident:-Unknown compiler})"
  6732. #define av_restrict $restrict_keyword
  6733. #define EXTERN_PREFIX "${extern_prefix}"
  6734. #define EXTERN_ASM ${extern_prefix}
  6735. #define BUILDSUF "$build_suffix"
  6736. #define SLIBSUF "$SLIBSUF"
  6737. #define HAVE_MMX2 HAVE_MMXEXT
  6738. #define SWS_MAX_FILTER_SIZE $sws_max_filter_size
  6739. EOF
  6740. test -n "$assert_level" &&
  6741. echo "#define ASSERT_LEVEL $assert_level" >>$TMPH
  6742. test -n "$malloc_prefix" &&
  6743. echo "#define MALLOC_PREFIX $malloc_prefix" >>$TMPH
  6744. if enabled x86asm; then
  6745. append config_files $TMPASM
  6746. cat > $TMPASM <<EOF
  6747. ; Automatically generated by configure - do not modify!
  6748. EOF
  6749. fi
  6750. enabled getenv || echo "#define getenv(x) NULL" >> $TMPH
  6751. mkdir -p doc
  6752. mkdir -p tests
  6753. mkdir -p tests/api
  6754. echo "@c auto-generated by configure - do not modify! " > doc/config.texi
  6755. print_config ARCH_ "$config_files" $ARCH_LIST
  6756. print_config HAVE_ "$config_files" $HAVE_LIST
  6757. print_config CONFIG_ "$config_files" $CONFIG_LIST \
  6758. $CONFIG_EXTRA \
  6759. $ALL_COMPONENTS \
  6760. echo "#endif /* FFMPEG_CONFIG_H */" >> $TMPH
  6761. echo "endif # FFMPEG_CONFIG_MAK" >> ffbuild/config.mak
  6762. # Do not overwrite an unchanged config.h to avoid superfluous rebuilds.
  6763. cp_if_changed $TMPH config.h
  6764. touch ffbuild/.config
  6765. enabled x86asm && cp_if_changed $TMPASM config.asm
  6766. cat > $TMPH <<EOF
  6767. /* Generated by ffmpeg configure */
  6768. #ifndef AVUTIL_AVCONFIG_H
  6769. #define AVUTIL_AVCONFIG_H
  6770. EOF
  6771. print_config AV_HAVE_ $TMPH $HAVE_LIST_PUB
  6772. echo "#endif /* AVUTIL_AVCONFIG_H */" >> $TMPH
  6773. cp_if_changed $TMPH libavutil/avconfig.h
  6774. # full_filter_name_foo=vf_foo
  6775. # full_filter_name_bar=asrc_bar
  6776. # ...
  6777. eval "$(sed -n "s/^extern AVFilter ff_\([avfsinkrc]\{2,5\}\)_\(.*\);/full_filter_name_\2=\1_\2/p" $source_path/libavfilter/allfilters.c)"
  6778. # generate the lists of enabled components
  6779. print_enabled_components(){
  6780. file=$1
  6781. struct_name=$2
  6782. name=$3
  6783. shift 3
  6784. echo "static const $struct_name * const $name[] = {" > $TMPH
  6785. for c in $*; do
  6786. if enabled $c; then
  6787. case $name in
  6788. filter_list)
  6789. eval c=\$full_filter_name_${c%_filter}
  6790. ;;
  6791. indev_list)
  6792. c=${c%_indev}_demuxer
  6793. ;;
  6794. outdev_list)
  6795. c=${c%_outdev}_muxer
  6796. ;;
  6797. esac
  6798. printf " &ff_%s,\n" $c >> $TMPH
  6799. fi
  6800. done
  6801. if [ "$name" = "filter_list" ]; then
  6802. for c in asrc_abuffer vsrc_buffer asink_abuffer vsink_buffer; do
  6803. printf " &ff_%s,\n" $c >> $TMPH
  6804. done
  6805. fi
  6806. echo " NULL };" >> $TMPH
  6807. cp_if_changed $TMPH $file
  6808. }
  6809. print_enabled_components libavfilter/filter_list.c AVFilter filter_list $FILTER_LIST
  6810. print_enabled_components libavcodec/codec_list.c AVCodec codec_list $CODEC_LIST
  6811. print_enabled_components libavcodec/parser_list.c AVCodecParser parser_list $PARSER_LIST
  6812. print_enabled_components libavcodec/bsf_list.c AVBitStreamFilter bitstream_filters $BSF_LIST
  6813. print_enabled_components libavformat/demuxer_list.c AVInputFormat demuxer_list $DEMUXER_LIST
  6814. print_enabled_components libavformat/muxer_list.c AVOutputFormat muxer_list $MUXER_LIST
  6815. print_enabled_components libavdevice/indev_list.c AVInputFormat indev_list $INDEV_LIST
  6816. print_enabled_components libavdevice/outdev_list.c AVOutputFormat outdev_list $OUTDEV_LIST
  6817. print_enabled_components libavformat/protocol_list.c URLProtocol url_protocols $PROTOCOL_LIST
  6818. # Settings for pkg-config files
  6819. cat > $TMPH <<EOF
  6820. # Automatically generated by configure - do not modify!
  6821. shared=$shared
  6822. build_suffix=$build_suffix
  6823. prefix=$prefix
  6824. libdir=$libdir
  6825. incdir=$incdir
  6826. rpath=$(enabled rpath && echo "-Wl,-rpath,\${libdir}")
  6827. source_path=${source_path}
  6828. LIBPREF=${LIBPREF}
  6829. LIBSUF=${LIBSUF}
  6830. extralibs_avutil="$avutil_extralibs"
  6831. extralibs_avcodec="$avcodec_extralibs"
  6832. extralibs_avformat="$avformat_extralibs"
  6833. extralibs_avdevice="$avdevice_extralibs"
  6834. extralibs_avfilter="$avfilter_extralibs"
  6835. extralibs_avresample="$avresample_extralibs"
  6836. extralibs_postproc="$postproc_extralibs"
  6837. extralibs_swscale="$swscale_extralibs"
  6838. extralibs_swresample="$swresample_extralibs"
  6839. EOF
  6840. for lib in $LIBRARY_LIST; do
  6841. lib_deps="$(eval echo \$${lib}_deps)"
  6842. echo ${lib}_deps=\"$lib_deps\" >> $TMPH
  6843. done
  6844. cp_if_changed $TMPH ffbuild/config.sh