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.

7478 lines
244KB

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