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.

7444 lines
243KB

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