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.

7316 lines
239KB

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