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.

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