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.

7420 lines
243KB

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