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.

7473 lines
244KB

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