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.

7287 lines
238KB

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