You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

7473 lines
244KB

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