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.

7485 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. vp9_metadata_bsf_select="cbs_vp9"
  2841. # external libraries
  2842. aac_at_decoder_deps="audiotoolbox"
  2843. aac_at_decoder_select="aac_adtstoasc_bsf"
  2844. ac3_at_decoder_deps="audiotoolbox"
  2845. ac3_at_decoder_select="ac3_parser"
  2846. adpcm_ima_qt_at_decoder_deps="audiotoolbox"
  2847. alac_at_decoder_deps="audiotoolbox"
  2848. amr_nb_at_decoder_deps="audiotoolbox"
  2849. avisynth_deps_any="libdl LoadLibrary"
  2850. avisynth_demuxer_deps="avisynth"
  2851. avisynth_demuxer_select="riffdec"
  2852. eac3_at_decoder_deps="audiotoolbox"
  2853. eac3_at_decoder_select="ac3_parser"
  2854. gsm_ms_at_decoder_deps="audiotoolbox"
  2855. ilbc_at_decoder_deps="audiotoolbox"
  2856. mp1_at_decoder_deps="audiotoolbox"
  2857. mp2_at_decoder_deps="audiotoolbox"
  2858. mp3_at_decoder_deps="audiotoolbox"
  2859. mp1_at_decoder_select="mpegaudioheader"
  2860. mp2_at_decoder_select="mpegaudioheader"
  2861. mp3_at_decoder_select="mpegaudioheader"
  2862. pcm_alaw_at_decoder_deps="audiotoolbox"
  2863. pcm_mulaw_at_decoder_deps="audiotoolbox"
  2864. qdmc_at_decoder_deps="audiotoolbox"
  2865. qdm2_at_decoder_deps="audiotoolbox"
  2866. aac_at_encoder_deps="audiotoolbox"
  2867. aac_at_encoder_select="audio_frame_queue"
  2868. alac_at_encoder_deps="audiotoolbox"
  2869. alac_at_encoder_select="audio_frame_queue"
  2870. ilbc_at_encoder_deps="audiotoolbox"
  2871. ilbc_at_encoder_select="audio_frame_queue"
  2872. pcm_alaw_at_encoder_deps="audiotoolbox"
  2873. pcm_alaw_at_encoder_select="audio_frame_queue"
  2874. pcm_mulaw_at_encoder_deps="audiotoolbox"
  2875. pcm_mulaw_at_encoder_select="audio_frame_queue"
  2876. chromaprint_muxer_deps="chromaprint"
  2877. h264_videotoolbox_encoder_deps="pthreads"
  2878. h264_videotoolbox_encoder_select="videotoolbox_encoder"
  2879. hevc_videotoolbox_encoder_deps="pthreads"
  2880. hevc_videotoolbox_encoder_select="videotoolbox_encoder"
  2881. libaom_av1_decoder_deps="libaom"
  2882. libaom_av1_encoder_deps="libaom"
  2883. libaom_av1_encoder_select="extract_extradata_bsf"
  2884. libaribb24_decoder_deps="libaribb24"
  2885. libcelt_decoder_deps="libcelt"
  2886. libcodec2_decoder_deps="libcodec2"
  2887. libcodec2_encoder_deps="libcodec2"
  2888. libdav1d_decoder_deps="libdav1d"
  2889. libdavs2_decoder_deps="libdavs2"
  2890. libfdk_aac_decoder_deps="libfdk_aac"
  2891. libfdk_aac_encoder_deps="libfdk_aac"
  2892. libfdk_aac_encoder_select="audio_frame_queue"
  2893. libgme_demuxer_deps="libgme"
  2894. libgsm_decoder_deps="libgsm"
  2895. libgsm_encoder_deps="libgsm"
  2896. libgsm_ms_decoder_deps="libgsm"
  2897. libgsm_ms_encoder_deps="libgsm"
  2898. libilbc_decoder_deps="libilbc"
  2899. libilbc_encoder_deps="libilbc"
  2900. libkvazaar_encoder_deps="libkvazaar"
  2901. libmodplug_demuxer_deps="libmodplug"
  2902. libmp3lame_encoder_deps="libmp3lame"
  2903. libmp3lame_encoder_select="audio_frame_queue mpegaudioheader"
  2904. libopencore_amrnb_decoder_deps="libopencore_amrnb"
  2905. libopencore_amrnb_encoder_deps="libopencore_amrnb"
  2906. libopencore_amrnb_encoder_select="audio_frame_queue"
  2907. libopencore_amrwb_decoder_deps="libopencore_amrwb"
  2908. libopenh264_decoder_deps="libopenh264"
  2909. libopenh264_decoder_select="h264_mp4toannexb_bsf"
  2910. libopenh264_encoder_deps="libopenh264"
  2911. libopenjpeg_decoder_deps="libopenjpeg"
  2912. libopenjpeg_encoder_deps="libopenjpeg"
  2913. libopenmpt_demuxer_deps="libopenmpt"
  2914. libopus_decoder_deps="libopus"
  2915. libopus_encoder_deps="libopus"
  2916. libopus_encoder_select="audio_frame_queue"
  2917. librsvg_decoder_deps="librsvg"
  2918. libshine_encoder_deps="libshine"
  2919. libshine_encoder_select="audio_frame_queue"
  2920. libspeex_decoder_deps="libspeex"
  2921. libspeex_encoder_deps="libspeex"
  2922. libspeex_encoder_select="audio_frame_queue"
  2923. libtheora_encoder_deps="libtheora"
  2924. libtwolame_encoder_deps="libtwolame"
  2925. libvo_amrwbenc_encoder_deps="libvo_amrwbenc"
  2926. libvorbis_decoder_deps="libvorbis"
  2927. libvorbis_encoder_deps="libvorbis libvorbisenc"
  2928. libvorbis_encoder_select="audio_frame_queue"
  2929. libvpx_vp8_decoder_deps="libvpx"
  2930. libvpx_vp8_encoder_deps="libvpx"
  2931. libvpx_vp9_decoder_deps="libvpx"
  2932. libvpx_vp9_encoder_deps="libvpx"
  2933. libwavpack_encoder_deps="libwavpack"
  2934. libwavpack_encoder_select="audio_frame_queue"
  2935. libwebp_encoder_deps="libwebp"
  2936. libwebp_anim_encoder_deps="libwebp"
  2937. libx262_encoder_deps="libx262"
  2938. libx264_encoder_deps="libx264"
  2939. libx264rgb_encoder_deps="libx264 x264_csp_bgr"
  2940. libx264rgb_encoder_select="libx264_encoder"
  2941. libx265_encoder_deps="libx265"
  2942. libxavs_encoder_deps="libxavs"
  2943. libxavs2_encoder_deps="libxavs2"
  2944. libxvid_encoder_deps="libxvid"
  2945. libzvbi_teletext_decoder_deps="libzvbi"
  2946. vapoursynth_demuxer_deps="vapoursynth"
  2947. videotoolbox_suggest="coreservices"
  2948. videotoolbox_deps="corefoundation coremedia corevideo"
  2949. videotoolbox_encoder_deps="videotoolbox VTCompressionSessionPrepareToEncodeFrames"
  2950. # demuxers / muxers
  2951. ac3_demuxer_select="ac3_parser"
  2952. aiff_muxer_select="iso_media"
  2953. asf_demuxer_select="riffdec"
  2954. asf_o_demuxer_select="riffdec"
  2955. asf_muxer_select="riffenc"
  2956. asf_stream_muxer_select="asf_muxer"
  2957. avi_demuxer_select="iso_media riffdec exif"
  2958. avi_muxer_select="riffenc"
  2959. caf_demuxer_select="iso_media riffdec"
  2960. caf_muxer_select="iso_media"
  2961. dash_muxer_select="mp4_muxer"
  2962. dash_demuxer_deps="libxml2"
  2963. dirac_demuxer_select="dirac_parser"
  2964. dts_demuxer_select="dca_parser"
  2965. dtshd_demuxer_select="dca_parser"
  2966. dv_demuxer_select="dvprofile"
  2967. dv_muxer_select="dvprofile"
  2968. dxa_demuxer_select="riffdec"
  2969. eac3_demuxer_select="ac3_parser"
  2970. f4v_muxer_select="mov_muxer"
  2971. fifo_muxer_deps="threads"
  2972. flac_demuxer_select="flac_parser"
  2973. hds_muxer_select="flv_muxer"
  2974. hls_muxer_select="mpegts_muxer"
  2975. hls_muxer_suggest="gcrypt openssl"
  2976. image2_alias_pix_demuxer_select="image2_demuxer"
  2977. image2_brender_pix_demuxer_select="image2_demuxer"
  2978. ipod_muxer_select="mov_muxer"
  2979. ismv_muxer_select="mov_muxer"
  2980. ivf_muxer_select="av1_metadata_bsf vp9_superframe_bsf"
  2981. matroska_audio_muxer_select="matroska_muxer"
  2982. matroska_demuxer_select="iso_media riffdec"
  2983. matroska_demuxer_suggest="bzlib lzo zlib"
  2984. matroska_muxer_select="iso_media riffenc"
  2985. mmf_muxer_select="riffenc"
  2986. mov_demuxer_select="iso_media riffdec"
  2987. mov_demuxer_suggest="zlib"
  2988. mov_muxer_select="iso_media riffenc rtpenc_chain"
  2989. mp3_demuxer_select="mpegaudio_parser"
  2990. mp3_muxer_select="mpegaudioheader"
  2991. mp4_muxer_select="mov_muxer"
  2992. mpegts_demuxer_select="iso_media"
  2993. mpegts_muxer_select="adts_muxer latm_muxer"
  2994. mpegtsraw_demuxer_select="mpegts_demuxer"
  2995. mxf_d10_muxer_select="mxf_muxer"
  2996. mxf_opatom_muxer_select="mxf_muxer"
  2997. nut_muxer_select="riffenc"
  2998. nuv_demuxer_select="riffdec"
  2999. oga_muxer_select="ogg_muxer"
  3000. ogg_demuxer_select="dirac_parse"
  3001. ogv_muxer_select="ogg_muxer"
  3002. opus_muxer_select="ogg_muxer"
  3003. psp_muxer_select="mov_muxer"
  3004. rtp_demuxer_select="sdp_demuxer"
  3005. rtp_muxer_select="golomb"
  3006. rtpdec_select="asf_demuxer jpegtables mov_demuxer mpegts_demuxer rm_demuxer rtp_protocol srtp"
  3007. rtsp_demuxer_select="http_protocol rtpdec"
  3008. rtsp_muxer_select="rtp_muxer http_protocol rtp_protocol rtpenc_chain"
  3009. sap_demuxer_select="sdp_demuxer"
  3010. sap_muxer_select="rtp_muxer rtp_protocol rtpenc_chain"
  3011. sdp_demuxer_select="rtpdec"
  3012. smoothstreaming_muxer_select="ismv_muxer"
  3013. spdif_demuxer_select="adts_header"
  3014. spdif_muxer_select="adts_header"
  3015. spx_muxer_select="ogg_muxer"
  3016. swf_demuxer_suggest="zlib"
  3017. tak_demuxer_select="tak_parser"
  3018. tg2_muxer_select="mov_muxer"
  3019. tgp_muxer_select="mov_muxer"
  3020. vobsub_demuxer_select="mpegps_demuxer"
  3021. w64_demuxer_select="wav_demuxer"
  3022. w64_muxer_select="wav_muxer"
  3023. wav_demuxer_select="riffdec"
  3024. wav_muxer_select="riffenc"
  3025. webm_muxer_select="iso_media riffenc"
  3026. webm_dash_manifest_demuxer_select="matroska_demuxer"
  3027. wtv_demuxer_select="mpegts_demuxer riffdec"
  3028. wtv_muxer_select="mpegts_muxer riffenc"
  3029. xmv_demuxer_select="riffdec"
  3030. xwma_demuxer_select="riffdec"
  3031. # indevs / outdevs
  3032. android_camera_indev_deps="android camera2ndk mediandk pthreads"
  3033. android_camera_indev_extralibs="-landroid -lcamera2ndk -lmediandk"
  3034. alsa_indev_deps="alsa"
  3035. alsa_outdev_deps="alsa"
  3036. avfoundation_indev_deps="avfoundation corevideo coremedia pthreads"
  3037. avfoundation_indev_suggest="coregraphics applicationservices"
  3038. avfoundation_indev_extralibs="-framework Foundation"
  3039. bktr_indev_deps_any="dev_bktr_ioctl_bt848_h machine_ioctl_bt848_h dev_video_bktr_ioctl_bt848_h dev_ic_bt8xx_h"
  3040. caca_outdev_deps="libcaca"
  3041. decklink_deps_any="libdl LoadLibrary"
  3042. decklink_indev_deps="decklink threads"
  3043. decklink_indev_extralibs="-lstdc++"
  3044. decklink_outdev_deps="decklink threads"
  3045. decklink_outdev_suggest="libklvanc"
  3046. decklink_outdev_extralibs="-lstdc++"
  3047. dshow_indev_deps="IBaseFilter"
  3048. dshow_indev_extralibs="-lpsapi -lole32 -lstrmiids -luuid -loleaut32 -lshlwapi"
  3049. fbdev_indev_deps="linux_fb_h"
  3050. fbdev_outdev_deps="linux_fb_h"
  3051. gdigrab_indev_deps="CreateDIBSection"
  3052. gdigrab_indev_extralibs="-lgdi32"
  3053. gdigrab_indev_select="bmp_decoder"
  3054. iec61883_indev_deps="libiec61883"
  3055. jack_indev_deps="libjack"
  3056. jack_indev_deps_any="sem_timedwait dispatch_dispatch_h"
  3057. kmsgrab_indev_deps="libdrm"
  3058. lavfi_indev_deps="avfilter"
  3059. libcdio_indev_deps="libcdio"
  3060. libdc1394_indev_deps="libdc1394"
  3061. openal_indev_deps="openal"
  3062. opengl_outdev_deps="opengl"
  3063. opengl_outdev_suggest="sdl2"
  3064. oss_indev_deps_any="sys_soundcard_h"
  3065. oss_outdev_deps_any="sys_soundcard_h"
  3066. pulse_indev_deps="libpulse"
  3067. pulse_outdev_deps="libpulse"
  3068. sdl2_outdev_deps="sdl2"
  3069. sndio_indev_deps="sndio"
  3070. sndio_outdev_deps="sndio"
  3071. v4l2_indev_deps_any="linux_videodev2_h sys_videoio_h"
  3072. v4l2_indev_suggest="libv4l2"
  3073. v4l2_outdev_deps_any="linux_videodev2_h sys_videoio_h"
  3074. v4l2_outdev_suggest="libv4l2"
  3075. vfwcap_indev_deps="vfw32 vfwcap_defines"
  3076. xcbgrab_indev_deps="libxcb"
  3077. xcbgrab_indev_suggest="libxcb_shm libxcb_shape libxcb_xfixes"
  3078. xv_outdev_deps="xlib"
  3079. # protocols
  3080. async_protocol_deps="threads"
  3081. bluray_protocol_deps="libbluray"
  3082. ffrtmpcrypt_protocol_conflict="librtmp_protocol"
  3083. ffrtmpcrypt_protocol_deps_any="gcrypt gmp openssl mbedtls"
  3084. ffrtmpcrypt_protocol_select="tcp_protocol"
  3085. ffrtmphttp_protocol_conflict="librtmp_protocol"
  3086. ffrtmphttp_protocol_select="http_protocol"
  3087. ftp_protocol_select="tcp_protocol"
  3088. gopher_protocol_select="network"
  3089. http_protocol_select="tcp_protocol"
  3090. http_protocol_suggest="zlib"
  3091. httpproxy_protocol_select="tcp_protocol"
  3092. httpproxy_protocol_suggest="zlib"
  3093. https_protocol_select="tls_protocol"
  3094. https_protocol_suggest="zlib"
  3095. icecast_protocol_select="http_protocol"
  3096. mmsh_protocol_select="http_protocol"
  3097. mmst_protocol_select="network"
  3098. rtmp_protocol_conflict="librtmp_protocol"
  3099. rtmp_protocol_select="tcp_protocol"
  3100. rtmp_protocol_suggest="zlib"
  3101. rtmpe_protocol_select="ffrtmpcrypt_protocol"
  3102. rtmpe_protocol_suggest="zlib"
  3103. rtmps_protocol_conflict="librtmp_protocol"
  3104. rtmps_protocol_select="tls_protocol"
  3105. rtmps_protocol_suggest="zlib"
  3106. rtmpt_protocol_select="ffrtmphttp_protocol"
  3107. rtmpt_protocol_suggest="zlib"
  3108. rtmpte_protocol_select="ffrtmpcrypt_protocol ffrtmphttp_protocol"
  3109. rtmpte_protocol_suggest="zlib"
  3110. rtmpts_protocol_select="ffrtmphttp_protocol https_protocol"
  3111. rtmpts_protocol_suggest="zlib"
  3112. rtp_protocol_select="udp_protocol"
  3113. schannel_conflict="openssl gnutls libtls mbedtls"
  3114. sctp_protocol_deps="struct_sctp_event_subscribe struct_msghdr_msg_flags"
  3115. sctp_protocol_select="network"
  3116. securetransport_conflict="openssl gnutls libtls mbedtls"
  3117. srtp_protocol_select="rtp_protocol srtp"
  3118. tcp_protocol_select="network"
  3119. tls_protocol_deps_any="gnutls openssl schannel securetransport libtls mbedtls"
  3120. tls_protocol_select="tcp_protocol"
  3121. udp_protocol_select="network"
  3122. udplite_protocol_select="network"
  3123. unix_protocol_deps="sys_un_h"
  3124. unix_protocol_select="network"
  3125. # external library protocols
  3126. librtmp_protocol_deps="librtmp"
  3127. librtmpe_protocol_deps="librtmp"
  3128. librtmps_protocol_deps="librtmp"
  3129. librtmpt_protocol_deps="librtmp"
  3130. librtmpte_protocol_deps="librtmp"
  3131. libsmbclient_protocol_deps="libsmbclient gplv3"
  3132. libsrt_protocol_deps="libsrt"
  3133. libsrt_protocol_select="network"
  3134. libssh_protocol_deps="libssh"
  3135. libtls_conflict="openssl gnutls mbedtls"
  3136. # filters
  3137. afftdn_filter_deps="avcodec"
  3138. afftdn_filter_select="fft"
  3139. afftfilt_filter_deps="avcodec"
  3140. afftfilt_filter_select="fft"
  3141. afir_filter_deps="avcodec"
  3142. afir_filter_select="fft"
  3143. amovie_filter_deps="avcodec avformat"
  3144. aresample_filter_deps="swresample"
  3145. ass_filter_deps="libass"
  3146. atempo_filter_deps="avcodec"
  3147. atempo_filter_select="rdft"
  3148. avgblur_opencl_filter_deps="opencl"
  3149. azmq_filter_deps="libzmq"
  3150. blackframe_filter_deps="gpl"
  3151. bm3d_filter_deps="avcodec"
  3152. bm3d_filter_select="dct"
  3153. boxblur_filter_deps="gpl"
  3154. boxblur_opencl_filter_deps="opencl gpl"
  3155. bs2b_filter_deps="libbs2b"
  3156. colorkey_opencl_filter_deps="opencl"
  3157. colormatrix_filter_deps="gpl"
  3158. convolution_opencl_filter_deps="opencl"
  3159. convolve_filter_deps="avcodec"
  3160. convolve_filter_select="fft"
  3161. coreimage_filter_deps="coreimage appkit"
  3162. coreimage_filter_extralibs="-framework OpenGL"
  3163. coreimagesrc_filter_deps="coreimage appkit"
  3164. coreimagesrc_filter_extralibs="-framework OpenGL"
  3165. cover_rect_filter_deps="avcodec avformat gpl"
  3166. cropdetect_filter_deps="gpl"
  3167. deconvolve_filter_deps="avcodec"
  3168. deconvolve_filter_select="fft"
  3169. deinterlace_qsv_filter_deps="libmfx"
  3170. deinterlace_vaapi_filter_deps="vaapi"
  3171. delogo_filter_deps="gpl"
  3172. denoise_vaapi_filter_deps="vaapi"
  3173. deshake_filter_select="pixelutils"
  3174. dilation_opencl_filter_deps="opencl"
  3175. drawtext_filter_deps="libfreetype"
  3176. drawtext_filter_suggest="libfontconfig libfribidi"
  3177. elbg_filter_deps="avcodec"
  3178. eq_filter_deps="gpl"
  3179. erosion_opencl_filter_deps="opencl"
  3180. fftfilt_filter_deps="avcodec"
  3181. fftfilt_filter_select="rdft"
  3182. fftdnoiz_filter_deps="avcodec"
  3183. fftdnoiz_filter_select="fft"
  3184. find_rect_filter_deps="avcodec avformat gpl"
  3185. firequalizer_filter_deps="avcodec"
  3186. firequalizer_filter_select="rdft"
  3187. flite_filter_deps="libflite"
  3188. framerate_filter_select="scene_sad"
  3189. freezedetect_filter_select="scene_sad"
  3190. frei0r_filter_deps="frei0r libdl"
  3191. frei0r_src_filter_deps="frei0r libdl"
  3192. fspp_filter_deps="gpl"
  3193. geq_filter_deps="gpl"
  3194. histeq_filter_deps="gpl"
  3195. hqdn3d_filter_deps="gpl"
  3196. interlace_filter_deps="gpl"
  3197. kerndeint_filter_deps="gpl"
  3198. ladspa_filter_deps="ladspa libdl"
  3199. lensfun_filter_deps="liblensfun version3"
  3200. lv2_filter_deps="lv2"
  3201. mcdeint_filter_deps="avcodec gpl"
  3202. movie_filter_deps="avcodec avformat"
  3203. mpdecimate_filter_deps="gpl"
  3204. mpdecimate_filter_select="pixelutils"
  3205. minterpolate_filter_select="scene_sad"
  3206. mptestsrc_filter_deps="gpl"
  3207. negate_filter_deps="lut_filter"
  3208. nnedi_filter_deps="gpl"
  3209. ocr_filter_deps="libtesseract"
  3210. ocv_filter_deps="libopencv"
  3211. openclsrc_filter_deps="opencl"
  3212. overlay_opencl_filter_deps="opencl"
  3213. overlay_qsv_filter_deps="libmfx"
  3214. overlay_qsv_filter_select="qsvvpp"
  3215. owdenoise_filter_deps="gpl"
  3216. pan_filter_deps="swresample"
  3217. perspective_filter_deps="gpl"
  3218. phase_filter_deps="gpl"
  3219. pp7_filter_deps="gpl"
  3220. pp_filter_deps="gpl postproc"
  3221. prewitt_opencl_filter_deps="opencl"
  3222. procamp_vaapi_filter_deps="vaapi"
  3223. program_opencl_filter_deps="opencl"
  3224. pullup_filter_deps="gpl"
  3225. removelogo_filter_deps="avcodec avformat swscale"
  3226. repeatfields_filter_deps="gpl"
  3227. resample_filter_deps="avresample"
  3228. roberts_opencl_filter_deps="opencl"
  3229. rubberband_filter_deps="librubberband"
  3230. sab_filter_deps="gpl swscale"
  3231. scale2ref_filter_deps="swscale"
  3232. scale_filter_deps="swscale"
  3233. scale_qsv_filter_deps="libmfx"
  3234. select_filter_select="scene_sad"
  3235. sharpness_vaapi_filter_deps="vaapi"
  3236. showcqt_filter_deps="avcodec avformat swscale"
  3237. showcqt_filter_suggest="libfontconfig libfreetype"
  3238. showcqt_filter_select="fft"
  3239. showfreqs_filter_deps="avcodec"
  3240. showfreqs_filter_select="fft"
  3241. showspectrum_filter_deps="avcodec"
  3242. showspectrum_filter_select="fft"
  3243. showspectrumpic_filter_deps="avcodec"
  3244. showspectrumpic_filter_select="fft"
  3245. signature_filter_deps="gpl avcodec avformat"
  3246. smartblur_filter_deps="gpl swscale"
  3247. sobel_opencl_filter_deps="opencl"
  3248. sofalizer_filter_deps="libmysofa avcodec"
  3249. sofalizer_filter_select="fft"
  3250. spectrumsynth_filter_deps="avcodec"
  3251. spectrumsynth_filter_select="fft"
  3252. spp_filter_deps="gpl avcodec"
  3253. spp_filter_select="fft idctdsp fdctdsp me_cmp pixblockdsp"
  3254. sr_filter_deps="avformat swscale"
  3255. sr_filter_select="dnn"
  3256. stereo3d_filter_deps="gpl"
  3257. subtitles_filter_deps="avformat avcodec libass"
  3258. super2xsai_filter_deps="gpl"
  3259. pixfmts_super2xsai_test_deps="super2xsai_filter"
  3260. tinterlace_filter_deps="gpl"
  3261. tinterlace_merge_test_deps="tinterlace_filter"
  3262. tinterlace_pad_test_deps="tinterlace_filter"
  3263. tonemap_filter_deps="const_nan"
  3264. tonemap_opencl_filter_deps="opencl const_nan"
  3265. transpose_opencl_filter_deps="opencl"
  3266. transpose_vaapi_filter_deps="vaapi VAProcPipelineCaps_rotation_flags"
  3267. unsharp_opencl_filter_deps="opencl"
  3268. uspp_filter_deps="gpl avcodec"
  3269. vaguedenoiser_filter_deps="gpl"
  3270. vidstabdetect_filter_deps="libvidstab"
  3271. vidstabtransform_filter_deps="libvidstab"
  3272. libvmaf_filter_deps="libvmaf pthreads"
  3273. zmq_filter_deps="libzmq"
  3274. zoompan_filter_deps="swscale"
  3275. zscale_filter_deps="libzimg const_nan"
  3276. scale_vaapi_filter_deps="vaapi"
  3277. vpp_qsv_filter_deps="libmfx"
  3278. vpp_qsv_filter_select="qsvvpp"
  3279. yadif_cuda_filter_deps="ffnvcodec cuda_nvcc"
  3280. # examples
  3281. avio_dir_cmd_deps="avformat avutil"
  3282. avio_reading_deps="avformat avcodec avutil"
  3283. decode_audio_example_deps="avcodec avutil"
  3284. decode_video_example_deps="avcodec avutil"
  3285. demuxing_decoding_example_deps="avcodec avformat avutil"
  3286. encode_audio_example_deps="avcodec avutil"
  3287. encode_video_example_deps="avcodec avutil"
  3288. extract_mvs_example_deps="avcodec avformat avutil"
  3289. filter_audio_example_deps="avfilter avutil"
  3290. filtering_audio_example_deps="avfilter avcodec avformat avutil"
  3291. filtering_video_example_deps="avfilter avcodec avformat avutil"
  3292. http_multiclient_example_deps="avformat avutil fork"
  3293. hw_decode_example_deps="avcodec avformat avutil"
  3294. metadata_example_deps="avformat avutil"
  3295. muxing_example_deps="avcodec avformat avutil swscale"
  3296. qsvdec_example_deps="avcodec avutil libmfx h264_qsv_decoder"
  3297. remuxing_example_deps="avcodec avformat avutil"
  3298. resampling_audio_example_deps="avutil swresample"
  3299. scaling_video_example_deps="avutil swscale"
  3300. transcode_aac_example_deps="avcodec avformat swresample"
  3301. transcoding_example_deps="avfilter avcodec avformat avutil"
  3302. vaapi_encode_example_deps="avcodec avutil h264_vaapi_encoder"
  3303. vaapi_transcode_example_deps="avcodec avformat avutil h264_vaapi_encoder"
  3304. # EXTRALIBS_LIST
  3305. cpu_init_extralibs="pthreads_extralibs"
  3306. cws2fws_extralibs="zlib_extralibs"
  3307. # libraries, in any order
  3308. avcodec_deps="avutil"
  3309. avcodec_suggest="libm"
  3310. avcodec_select="null_bsf"
  3311. avdevice_deps="avformat avcodec avutil"
  3312. avdevice_suggest="libm"
  3313. avfilter_deps="avutil"
  3314. avfilter_suggest="libm"
  3315. avformat_deps="avcodec avutil"
  3316. avformat_suggest="libm network zlib"
  3317. avresample_deps="avutil"
  3318. avresample_suggest="libm"
  3319. avutil_suggest="clock_gettime ffnvcodec libm libdrm libmfx opencl user32 vaapi videotoolbox corefoundation corevideo coremedia bcrypt"
  3320. postproc_deps="avutil gpl"
  3321. postproc_suggest="libm"
  3322. swresample_deps="avutil"
  3323. swresample_suggest="libm libsoxr"
  3324. swscale_deps="avutil"
  3325. swscale_suggest="libm"
  3326. avcodec_extralibs="pthreads_extralibs iconv_extralibs dxva2_extralibs"
  3327. avfilter_extralibs="pthreads_extralibs"
  3328. avutil_extralibs="d3d11va_extralibs nanosleep_extralibs pthreads_extralibs vaapi_drm_extralibs vaapi_x11_extralibs vdpau_x11_extralibs"
  3329. # programs
  3330. ffmpeg_deps="avcodec avfilter avformat"
  3331. ffmpeg_select="aformat_filter anull_filter atrim_filter format_filter
  3332. hflip_filter null_filter
  3333. transpose_filter trim_filter vflip_filter"
  3334. ffmpeg_suggest="ole32 psapi shell32"
  3335. ffplay_deps="avcodec avformat swscale swresample sdl2"
  3336. ffplay_select="rdft crop_filter transpose_filter hflip_filter vflip_filter rotate_filter"
  3337. ffplay_suggest="shell32"
  3338. ffprobe_deps="avcodec avformat"
  3339. ffprobe_suggest="shell32"
  3340. # documentation
  3341. podpages_deps="perl"
  3342. manpages_deps="perl pod2man"
  3343. htmlpages_deps="perl"
  3344. htmlpages_deps_any="makeinfo_html texi2html"
  3345. txtpages_deps="perl makeinfo"
  3346. doc_deps_any="manpages htmlpages podpages txtpages"
  3347. # default parameters
  3348. logfile="ffbuild/config.log"
  3349. # installation paths
  3350. prefix_default="/usr/local"
  3351. bindir_default='${prefix}/bin'
  3352. datadir_default='${prefix}/share/ffmpeg'
  3353. docdir_default='${prefix}/share/doc/ffmpeg'
  3354. incdir_default='${prefix}/include'
  3355. libdir_default='${prefix}/lib'
  3356. mandir_default='${prefix}/share/man'
  3357. # toolchain
  3358. ar_default="ar"
  3359. cc_default="gcc"
  3360. cxx_default="g++"
  3361. host_cc_default="gcc"
  3362. doxygen_default="doxygen"
  3363. install="install"
  3364. ln_s_default="ln -s -f"
  3365. nm_default="nm -g"
  3366. pkg_config_default=pkg-config
  3367. ranlib_default="ranlib"
  3368. strip_default="strip"
  3369. version_script='--version-script'
  3370. objformat="elf32"
  3371. x86asmexe_default="nasm"
  3372. windres_default="windres"
  3373. nvcc_default="nvcc"
  3374. nvccflags_default="-gencode arch=compute_30,code=sm_30 -O2"
  3375. striptype="direct"
  3376. # OS
  3377. target_os_default=$(tolower $(uname -s))
  3378. host_os=$target_os_default
  3379. # machine
  3380. if test "$target_os_default" = aix; then
  3381. arch_default=$(uname -p)
  3382. strip_default="strip -X32_64"
  3383. nm_default="nm -g -X32_64"
  3384. else
  3385. arch_default=$(uname -m)
  3386. fi
  3387. cpu="generic"
  3388. intrinsics="none"
  3389. # configurable options
  3390. enable $PROGRAM_LIST
  3391. enable $DOCUMENT_LIST
  3392. enable $EXAMPLE_LIST
  3393. enable $(filter_out avresample $LIBRARY_LIST)
  3394. enable stripping
  3395. enable asm
  3396. enable debug
  3397. enable doc
  3398. enable faan faandct faanidct
  3399. enable optimizations
  3400. enable runtime_cpudetect
  3401. enable safe_bitstream_reader
  3402. enable static
  3403. enable swscale_alpha
  3404. enable valgrind_backtrace
  3405. sws_max_filter_size_default=256
  3406. set_default sws_max_filter_size
  3407. # internal components are enabled by default
  3408. enable $EXTRALIBS_LIST
  3409. # Avoid external, non-system, libraries getting enabled by dependency resolution
  3410. disable $EXTERNAL_LIBRARY_LIST $HWACCEL_LIBRARY_LIST
  3411. # build settings
  3412. SHFLAGS='-shared -Wl,-soname,$$(@F)'
  3413. LIBPREF="lib"
  3414. LIBSUF=".a"
  3415. FULLNAME='$(NAME)$(BUILDSUF)'
  3416. LIBNAME='$(LIBPREF)$(FULLNAME)$(LIBSUF)'
  3417. SLIBPREF="lib"
  3418. SLIBSUF=".so"
  3419. SLIBNAME='$(SLIBPREF)$(FULLNAME)$(SLIBSUF)'
  3420. SLIBNAME_WITH_VERSION='$(SLIBNAME).$(LIBVERSION)'
  3421. SLIBNAME_WITH_MAJOR='$(SLIBNAME).$(LIBMAJOR)'
  3422. LIB_INSTALL_EXTRA_CMD='$$(RANLIB) "$(LIBDIR)/$(LIBNAME)"'
  3423. SLIB_INSTALL_NAME='$(SLIBNAME_WITH_VERSION)'
  3424. SLIB_INSTALL_LINKS='$(SLIBNAME_WITH_MAJOR) $(SLIBNAME)'
  3425. VERSION_SCRIPT_POSTPROCESS_CMD="cat"
  3426. asflags_filter=echo
  3427. cflags_filter=echo
  3428. ldflags_filter=echo
  3429. AS_C='-c'
  3430. AS_O='-o $@'
  3431. CC_C='-c'
  3432. CC_E='-E -o $@'
  3433. CC_O='-o $@'
  3434. CXX_C='-c'
  3435. CXX_O='-o $@'
  3436. OBJCC_C='-c'
  3437. OBJCC_E='-E -o $@'
  3438. OBJCC_O='-o $@'
  3439. X86ASM_O='-o $@'
  3440. LD_O='-o $@'
  3441. LD_LIB='-l%'
  3442. LD_PATH='-L'
  3443. HOSTCC_C='-c'
  3444. HOSTCC_E='-E -o $@'
  3445. HOSTCC_O='-o $@'
  3446. HOSTLD_O='-o $@'
  3447. NVCC_C='-c'
  3448. NVCC_O='-o $@'
  3449. host_extralibs='-lm'
  3450. host_cflags_filter=echo
  3451. host_ldflags_filter=echo
  3452. target_path='$(CURDIR)'
  3453. # since the object filename is not given with the -MM flag, the compiler
  3454. # is only able to print the basename, and we must add the path ourselves
  3455. DEPCMD='$(DEP$(1)) $(DEP$(1)FLAGS) $($(1)DEP_FLAGS) $< 2>/dev/null | sed -e "/^\#.*/d" -e "s,^[[:space:]]*$(@F),$(@D)/$(@F)," > $(@:.o=.d)'
  3456. DEPFLAGS='-MM'
  3457. mkdir -p ffbuild
  3458. # find source path
  3459. if test -f configure; then
  3460. source_path=.
  3461. elif test -f src/configure; then
  3462. source_path=src
  3463. else
  3464. source_path=$(cd $(dirname "$0"); pwd)
  3465. case "$source_path" in
  3466. *[[:blank:]]*) die "Out of tree builds are impossible with whitespace in source path." ;;
  3467. esac
  3468. test -e "$source_path/config.h" &&
  3469. die "Out of tree builds are impossible with config.h in source dir."
  3470. fi
  3471. for v in "$@"; do
  3472. r=${v#*=}
  3473. l=${v%"$r"}
  3474. r=$(sh_quote "$r")
  3475. FFMPEG_CONFIGURATION="${FFMPEG_CONFIGURATION# } ${l}${r}"
  3476. done
  3477. find_things_extern(){
  3478. thing=$1
  3479. pattern=$2
  3480. file=$source_path/$3
  3481. out=${4:-$thing}
  3482. sed -n "s/^[^#]*extern.*$pattern *ff_\([^ ]*\)_$thing;/\1_$out/p" "$file"
  3483. }
  3484. find_filters_extern(){
  3485. file=$source_path/$1
  3486. sed -n 's/^extern AVFilter ff_[avfsinkrc]\{2,5\}_\([[:alnum:]_]\{1,\}\);/\1_filter/p' $file
  3487. }
  3488. FILTER_LIST=$(find_filters_extern libavfilter/allfilters.c)
  3489. OUTDEV_LIST=$(find_things_extern muxer AVOutputFormat libavdevice/alldevices.c outdev)
  3490. INDEV_LIST=$(find_things_extern demuxer AVInputFormat libavdevice/alldevices.c indev)
  3491. MUXER_LIST=$(find_things_extern muxer AVOutputFormat libavformat/allformats.c)
  3492. DEMUXER_LIST=$(find_things_extern demuxer AVInputFormat libavformat/allformats.c)
  3493. ENCODER_LIST=$(find_things_extern encoder AVCodec libavcodec/allcodecs.c)
  3494. DECODER_LIST=$(find_things_extern decoder AVCodec libavcodec/allcodecs.c)
  3495. CODEC_LIST="
  3496. $ENCODER_LIST
  3497. $DECODER_LIST
  3498. "
  3499. PARSER_LIST=$(find_things_extern parser AVCodecParser libavcodec/parsers.c)
  3500. BSF_LIST=$(find_things_extern bsf AVBitStreamFilter libavcodec/bitstream_filters.c)
  3501. HWACCEL_LIST=$(find_things_extern hwaccel AVHWAccel libavcodec/hwaccels.h)
  3502. PROTOCOL_LIST=$(find_things_extern protocol URLProtocol libavformat/protocols.c)
  3503. AVCODEC_COMPONENTS_LIST="
  3504. $BSF_LIST
  3505. $DECODER_LIST
  3506. $ENCODER_LIST
  3507. $HWACCEL_LIST
  3508. $PARSER_LIST
  3509. "
  3510. AVDEVICE_COMPONENTS_LIST="
  3511. $INDEV_LIST
  3512. $OUTDEV_LIST
  3513. "
  3514. AVFILTER_COMPONENTS_LIST="
  3515. $FILTER_LIST
  3516. "
  3517. AVFORMAT_COMPONENTS_LIST="
  3518. $DEMUXER_LIST
  3519. $MUXER_LIST
  3520. $PROTOCOL_LIST
  3521. "
  3522. ALL_COMPONENTS="
  3523. $AVCODEC_COMPONENTS_LIST
  3524. $AVDEVICE_COMPONENTS_LIST
  3525. $AVFILTER_COMPONENTS_LIST
  3526. $AVFORMAT_COMPONENTS_LIST
  3527. "
  3528. for n in $COMPONENT_LIST; do
  3529. v=$(toupper ${n%s})_LIST
  3530. eval enable \$$v
  3531. eval ${n}_if_any="\$$v"
  3532. done
  3533. enable $ARCH_EXT_LIST
  3534. die_unknown(){
  3535. echo "Unknown option \"$1\"."
  3536. echo "See $0 --help for available options."
  3537. exit 1
  3538. }
  3539. print_in_columns() {
  3540. cols=$(expr $ncols / 24)
  3541. cat | tr ' ' '\n' | sort | pr -r "-$cols" -w $ncols -t
  3542. }
  3543. show_list() {
  3544. suffix=_$1
  3545. shift
  3546. echo $* | sed s/$suffix//g | print_in_columns
  3547. exit 0
  3548. }
  3549. rand_list(){
  3550. IFS=', '
  3551. set -- $*
  3552. unset IFS
  3553. for thing; do
  3554. comp=${thing%:*}
  3555. prob=${thing#$comp}
  3556. prob=${prob#:}
  3557. is_in ${comp} $COMPONENT_LIST && eval comp=\$$(toupper ${comp%s})_LIST
  3558. echo "prob ${prob:-0.5}"
  3559. printf '%s\n' $comp
  3560. done
  3561. }
  3562. do_random(){
  3563. action=$1
  3564. shift
  3565. random_seed=$(awk "BEGIN { srand($random_seed); print srand() }")
  3566. $action $(rand_list "$@" | awk "BEGIN { srand($random_seed) } \$1 == \"prob\" { prob = \$2; next } rand() < prob { print }")
  3567. }
  3568. for opt do
  3569. optval="${opt#*=}"
  3570. case "$opt" in
  3571. --extra-ldflags=*)
  3572. add_ldflags $optval
  3573. ;;
  3574. --extra-ldexeflags=*)
  3575. add_ldexeflags $optval
  3576. ;;
  3577. --extra-ldsoflags=*)
  3578. add_ldsoflags $optval
  3579. ;;
  3580. --extra-ldlibflags=*)
  3581. warn "The --extra-ldlibflags option is only provided for compatibility and will be\n"\
  3582. "removed in the future. Use --extra-ldsoflags instead."
  3583. add_ldsoflags $optval
  3584. ;;
  3585. --extra-libs=*)
  3586. add_extralibs $optval
  3587. ;;
  3588. --disable-devices)
  3589. disable $INDEV_LIST $OUTDEV_LIST
  3590. ;;
  3591. --enable-debug=*)
  3592. debuglevel="$optval"
  3593. ;;
  3594. --disable-programs)
  3595. disable $PROGRAM_LIST
  3596. ;;
  3597. --disable-everything)
  3598. map 'eval unset \${$(toupper ${v%s})_LIST}' $COMPONENT_LIST
  3599. ;;
  3600. --disable-all)
  3601. map 'eval unset \${$(toupper ${v%s})_LIST}' $COMPONENT_LIST
  3602. disable $LIBRARY_LIST $PROGRAM_LIST doc
  3603. enable avutil
  3604. ;;
  3605. --enable-random|--disable-random)
  3606. action=${opt%%-random}
  3607. do_random ${action#--} $COMPONENT_LIST
  3608. ;;
  3609. --enable-random=*|--disable-random=*)
  3610. action=${opt%%-random=*}
  3611. do_random ${action#--} $optval
  3612. ;;
  3613. --enable-sdl)
  3614. enable sdl2
  3615. ;;
  3616. --enable-*=*|--disable-*=*)
  3617. eval $(echo "${opt%%=*}" | sed 's/--/action=/;s/-/ thing=/')
  3618. is_in "${thing}s" $COMPONENT_LIST || die_unknown "$opt"
  3619. eval list=\$$(toupper $thing)_LIST
  3620. name=$(echo "${optval}" | sed "s/,/_${thing}|/g")_${thing}
  3621. list=$(filter "$name" $list)
  3622. [ "$list" = "" ] && warn "Option $opt did not match anything"
  3623. test $action = enable && warn_if_gets_disabled $list
  3624. $action $list
  3625. ;;
  3626. --enable-yasm|--disable-yasm)
  3627. warn "The ${opt} option is only provided for compatibility and will be\n"\
  3628. "removed in the future. Use --enable-x86asm / --disable-x86asm instead."
  3629. test $opt = --enable-yasm && x86asm=yes || x86asm=no
  3630. ;;
  3631. --yasmexe=*)
  3632. warn "The --yasmexe option is only provided for compatibility and will be\n"\
  3633. "removed in the future. Use --x86asmexe instead."
  3634. x86asmexe="$optval"
  3635. ;;
  3636. --enable-?*|--disable-?*)
  3637. eval $(echo "$opt" | sed 's/--/action=/;s/-/ option=/;s/-/_/g')
  3638. if is_in $option $COMPONENT_LIST; then
  3639. test $action = disable && action=unset
  3640. eval $action \$$(toupper ${option%s})_LIST
  3641. elif is_in $option $CMDLINE_SELECT; then
  3642. $action $option
  3643. else
  3644. die_unknown $opt
  3645. fi
  3646. ;;
  3647. --list-*)
  3648. NAME="${opt#--list-}"
  3649. is_in $NAME $COMPONENT_LIST || die_unknown $opt
  3650. NAME=${NAME%s}
  3651. eval show_list $NAME \$$(toupper $NAME)_LIST
  3652. ;;
  3653. --help|-h) show_help
  3654. ;;
  3655. --quiet|-q) quiet=yes
  3656. ;;
  3657. --fatal-warnings) enable fatal_warnings
  3658. ;;
  3659. --libfuzzer=*)
  3660. libfuzzer_path="$optval"
  3661. ;;
  3662. *)
  3663. optname="${opt%%=*}"
  3664. optname="${optname#--}"
  3665. optname=$(echo "$optname" | sed 's/-/_/g')
  3666. if is_in $optname $CMDLINE_SET; then
  3667. eval $optname='$optval'
  3668. elif is_in $optname $CMDLINE_APPEND; then
  3669. append $optname "$optval"
  3670. else
  3671. die_unknown $opt
  3672. fi
  3673. ;;
  3674. esac
  3675. done
  3676. for e in $env; do
  3677. eval "export $e"
  3678. done
  3679. if disabled autodetect; then
  3680. # Unless iconv is explicitely disabled by the user, we still want to probe
  3681. # for the iconv from the libc.
  3682. disabled iconv || enable libc_iconv
  3683. disable_weak $EXTERNAL_AUTODETECT_LIBRARY_LIST
  3684. disable_weak $HWACCEL_AUTODETECT_LIBRARY_LIST
  3685. fi
  3686. # Mark specifically enabled, but normally autodetected libraries as requested.
  3687. for lib in $AUTODETECT_LIBS; do
  3688. enabled $lib && request $lib
  3689. done
  3690. #TODO: switch to $AUTODETECT_LIBS when $THREADS_LIST is supported the same way
  3691. enable_weak $EXTERNAL_AUTODETECT_LIBRARY_LIST
  3692. enable_weak $HWACCEL_AUTODETECT_LIBRARY_LIST
  3693. disabled logging && logfile=/dev/null
  3694. # command line configuration sanity checks
  3695. # we need to build at least one lib type
  3696. if ! enabled_any static shared; then
  3697. cat <<EOF
  3698. At least one library type must be built.
  3699. Specify --enable-static to build the static libraries or --enable-shared to
  3700. build the shared libraries as well. To only build the shared libraries specify
  3701. --disable-static in addition to --enable-shared.
  3702. EOF
  3703. exit 1
  3704. fi
  3705. die_license_disabled() {
  3706. enabled $1 || { enabled $v && die "$v is $1 and --enable-$1 is not specified."; }
  3707. }
  3708. die_license_disabled_gpl() {
  3709. enabled $1 || { enabled $v && die "$v is incompatible with the gpl and --enable-$1 is not specified."; }
  3710. }
  3711. map "die_license_disabled gpl" $EXTERNAL_LIBRARY_GPL_LIST $EXTERNAL_LIBRARY_GPLV3_LIST
  3712. map "die_license_disabled version3" $EXTERNAL_LIBRARY_VERSION3_LIST $EXTERNAL_LIBRARY_GPLV3_LIST
  3713. enabled gpl && map "die_license_disabled_gpl nonfree" $EXTERNAL_LIBRARY_NONFREE_LIST
  3714. map "die_license_disabled nonfree" $HWACCEL_LIBRARY_NONFREE_LIST
  3715. enabled version3 && { enabled gpl && enable gplv3 || enable lgplv3; }
  3716. if enabled nonfree; then
  3717. license="nonfree and unredistributable"
  3718. elif enabled gplv3; then
  3719. license="GPL version 3 or later"
  3720. elif enabled lgplv3; then
  3721. license="LGPL version 3 or later"
  3722. elif enabled gpl; then
  3723. license="GPL version 2 or later"
  3724. else
  3725. license="LGPL version 2.1 or later"
  3726. fi
  3727. enabled_all gnutls openssl &&
  3728. die "GnuTLS and OpenSSL must not be enabled at the same time."
  3729. enabled_all gnutls mbedtls &&
  3730. die "GnuTLS and mbedTLS must not be enabled at the same time."
  3731. enabled_all openssl mbedtls &&
  3732. die "OpenSSL and mbedTLS must not be enabled at the same time."
  3733. # Disable all the library-specific components if the library itself
  3734. # is disabled, see AVCODEC_LIST and following _LIST variables.
  3735. disable_components(){
  3736. disabled ${1} && disable $(
  3737. eval components="\$$(toupper ${1})_COMPONENTS"
  3738. map 'eval echo \${$(toupper ${v%s})_LIST}' $components
  3739. )
  3740. }
  3741. map 'disable_components $v' $LIBRARY_LIST
  3742. echo "# $0 $FFMPEG_CONFIGURATION" > $logfile
  3743. set >> $logfile
  3744. test -n "$valgrind" && toolchain="valgrind-memcheck"
  3745. enabled ossfuzz && ! echo $CFLAGS | grep -q -- "-fsanitize=" && ! echo $CFLAGS | grep -q -- "-fcoverage-mapping" &&{
  3746. add_cflags -fsanitize=address,undefined -fsanitize-coverage=trace-pc-guard,trace-cmp -fno-omit-frame-pointer
  3747. add_ldflags -fsanitize=address,undefined -fsanitize-coverage=trace-pc-guard,trace-cmp
  3748. }
  3749. case "$toolchain" in
  3750. *-asan)
  3751. cc_default="${toolchain%-asan}"
  3752. add_cflags -fsanitize=address
  3753. add_ldflags -fsanitize=address
  3754. ;;
  3755. *-msan)
  3756. cc_default="${toolchain%-msan}"
  3757. add_cflags -fsanitize=memory -fsanitize-memory-track-origins
  3758. add_ldflags -fsanitize=memory
  3759. ;;
  3760. *-tsan)
  3761. cc_default="${toolchain%-tsan}"
  3762. add_cflags -fsanitize=thread
  3763. add_ldflags -fsanitize=thread
  3764. case "$toolchain" in
  3765. gcc-tsan)
  3766. add_cflags -fPIC
  3767. add_ldflags -fPIC
  3768. ;;
  3769. esac
  3770. ;;
  3771. *-usan)
  3772. cc_default="${toolchain%-usan}"
  3773. add_cflags -fsanitize=undefined
  3774. add_ldflags -fsanitize=undefined
  3775. ;;
  3776. valgrind-*)
  3777. target_exec_default="valgrind"
  3778. case "$toolchain" in
  3779. valgrind-massif)
  3780. 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"
  3781. ;;
  3782. valgrind-memcheck)
  3783. 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"
  3784. ;;
  3785. esac
  3786. ;;
  3787. msvc)
  3788. # Check whether the current MSVC version needs the C99 converter.
  3789. # From MSVC 2013 (compiler major version 18) onwards, it does actually
  3790. # support enough of C99 to build ffmpeg. Default to the new
  3791. # behaviour if the regexp was unable to match anything, since this
  3792. # successfully parses the version number of existing supported
  3793. # versions that require the converter (MSVC 2010 and 2012).
  3794. cl_major_ver=$(cl.exe 2>&1 | sed -n 's/.*Version \([[:digit:]]\{1,\}\)\..*/\1/p')
  3795. if [ -z "$cl_major_ver" ] || [ $cl_major_ver -ge 18 ]; then
  3796. cc_default="cl.exe"
  3797. cxx_default="cl.exe"
  3798. else
  3799. die "Unsupported MSVC version (2013 or newer required)"
  3800. fi
  3801. ld_default="$source_path/compat/windows/mslink"
  3802. nm_default="dumpbin.exe -symbols"
  3803. ar_default="lib.exe"
  3804. case "$arch" in
  3805. aarch64|arm64)
  3806. as_default="armasm64.exe"
  3807. ;;
  3808. arm*)
  3809. as_default="armasm.exe"
  3810. ;;
  3811. esac
  3812. target_os_default="win32"
  3813. # Use a relative path for TMPDIR. This makes sure all the
  3814. # ffconf temp files are written with a relative path, avoiding
  3815. # issues with msys/win32 path conversion for MSVC parameters
  3816. # such as -Fo<file> or -out:<file>.
  3817. TMPDIR=.
  3818. ;;
  3819. icl)
  3820. cc_default="icl"
  3821. ld_default="xilink"
  3822. nm_default="dumpbin -symbols"
  3823. ar_default="xilib"
  3824. target_os_default="win32"
  3825. TMPDIR=.
  3826. ;;
  3827. gcov)
  3828. add_cflags -fprofile-arcs -ftest-coverage
  3829. add_ldflags -fprofile-arcs -ftest-coverage
  3830. ;;
  3831. llvm-cov)
  3832. add_cflags -fprofile-arcs -ftest-coverage
  3833. add_ldflags --coverage
  3834. ;;
  3835. hardened)
  3836. add_cppflags -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2
  3837. add_cflags -fno-strict-overflow -fstack-protector-all
  3838. add_ldflags -Wl,-z,relro -Wl,-z,now
  3839. add_cflags -fPIE
  3840. add_ldexeflags -fPIE -pie
  3841. ;;
  3842. ?*)
  3843. die "Unknown toolchain $toolchain"
  3844. ;;
  3845. esac
  3846. if test -n "$cross_prefix"; then
  3847. test -n "$arch" && test -n "$target_os" ||
  3848. die "Must specify target arch (--arch) and OS (--target-os) when cross-compiling"
  3849. enable cross_compile
  3850. fi
  3851. set_default target_os
  3852. if test "$target_os" = android; then
  3853. cc_default="clang"
  3854. fi
  3855. ar_default="${cross_prefix}${ar_default}"
  3856. cc_default="${cross_prefix}${cc_default}"
  3857. cxx_default="${cross_prefix}${cxx_default}"
  3858. nm_default="${cross_prefix}${nm_default}"
  3859. pkg_config_default="${cross_prefix}${pkg_config_default}"
  3860. if ${cross_prefix}${ranlib_default} 2>&1 | grep -q "\-D "; then
  3861. ranlib_default="${cross_prefix}${ranlib_default} -D"
  3862. else
  3863. ranlib_default="${cross_prefix}${ranlib_default}"
  3864. fi
  3865. strip_default="${cross_prefix}${strip_default}"
  3866. windres_default="${cross_prefix}${windres_default}"
  3867. sysinclude_default="${sysroot}/usr/include"
  3868. set_default arch cc cxx doxygen pkg_config ranlib strip sysinclude \
  3869. target_exec x86asmexe nvcc
  3870. enabled cross_compile || host_cc_default=$cc
  3871. set_default host_cc
  3872. pkg_config_fail_message=""
  3873. if ! $pkg_config --version >/dev/null 2>&1; then
  3874. warn "$pkg_config not found, library detection may fail."
  3875. pkg_config=false
  3876. elif is_in -static $cc $LDFLAGS && ! is_in --static $pkg_config $pkg_config_flags; then
  3877. pkg_config_fail_message="
  3878. Note: When building a static binary, add --pkg-config-flags=\"--static\"."
  3879. fi
  3880. if test $doxygen != $doxygen_default && \
  3881. ! $doxygen --version >/dev/null 2>&1; then
  3882. warn "Specified doxygen \"$doxygen\" not found, API documentation will fail to build."
  3883. fi
  3884. exesuf() {
  3885. case $1 in
  3886. mingw32*|mingw64*|win32|win64|cygwin*|*-dos|freedos|opendos|os/2*|symbian) echo .exe ;;
  3887. esac
  3888. }
  3889. EXESUF=$(exesuf $target_os)
  3890. HOSTEXESUF=$(exesuf $host_os)
  3891. # set temporary file name
  3892. : ${TMPDIR:=$TEMPDIR}
  3893. : ${TMPDIR:=$TMP}
  3894. : ${TMPDIR:=/tmp}
  3895. if [ -n "$tempprefix" ] ; then
  3896. mktemp(){
  3897. tmpname="$tempprefix.${HOSTNAME}.${UID}"
  3898. echo "$tmpname"
  3899. mkdir "$tmpname"
  3900. }
  3901. elif ! test_cmd mktemp -u XXXXXX; then
  3902. # simple replacement for missing mktemp
  3903. # NOT SAFE FOR GENERAL USE
  3904. mktemp(){
  3905. tmpname="${2%%XXX*}.${HOSTNAME}.${UID}.$$"
  3906. echo "$tmpname"
  3907. mkdir "$tmpname"
  3908. }
  3909. fi
  3910. FFTMPDIR=$(mktemp -d "${TMPDIR}/ffconf.XXXXXXXX" 2> /dev/null) ||
  3911. die "Unable to create temporary directory in $TMPDIR."
  3912. tmpfile(){
  3913. tmp="${FFTMPDIR}/test"$2
  3914. (set -C; exec > $tmp) 2> /dev/null ||
  3915. die "Unable to create temporary file in $FFTMPDIR."
  3916. eval $1=$tmp
  3917. }
  3918. trap 'rm -rf -- "$FFTMPDIR"' EXIT
  3919. trap 'exit 2' INT
  3920. tmpfile TMPASM .asm
  3921. tmpfile TMPC .c
  3922. tmpfile TMPCPP .cpp
  3923. tmpfile TMPE $EXESUF
  3924. tmpfile TMPH .h
  3925. tmpfile TMPM .m
  3926. tmpfile TMPCU .cu
  3927. tmpfile TMPO .o
  3928. tmpfile TMPS .S
  3929. tmpfile TMPSH .sh
  3930. tmpfile TMPV .ver
  3931. unset -f mktemp
  3932. chmod +x $TMPE
  3933. # make sure we can execute files in $TMPDIR
  3934. cat > $TMPSH 2>> $logfile <<EOF
  3935. #! /bin/sh
  3936. EOF
  3937. chmod +x $TMPSH >> $logfile 2>&1
  3938. if ! $TMPSH >> $logfile 2>&1; then
  3939. cat <<EOF
  3940. Unable to create and execute files in $TMPDIR. Set the TMPDIR environment
  3941. variable to another directory and make sure that it is not mounted noexec.
  3942. EOF
  3943. die "Sanity test failed."
  3944. fi
  3945. armasm_flags(){
  3946. for flag; do
  3947. case $flag in
  3948. # Filter out MSVC cl.exe options from cflags that shouldn't
  3949. # be passed to gas-preprocessor
  3950. -M[TD]*) ;;
  3951. *) echo $flag ;;
  3952. esac
  3953. done
  3954. }
  3955. cparser_flags(){
  3956. for flag; do
  3957. case $flag in
  3958. -Wno-switch) echo -Wno-switch-enum ;;
  3959. -Wno-format-zero-length) ;;
  3960. -Wdisabled-optimization) ;;
  3961. -Wno-pointer-sign) echo -Wno-other ;;
  3962. *) echo $flag ;;
  3963. esac
  3964. done
  3965. }
  3966. msvc_common_flags(){
  3967. for flag; do
  3968. case $flag in
  3969. # In addition to specifying certain flags under the compiler
  3970. # specific filters, they must be specified here as well or else the
  3971. # generic catch all at the bottom will print the original flag.
  3972. -Wall) ;;
  3973. -Wextra) ;;
  3974. -std=c99) ;;
  3975. # Common flags
  3976. -fomit-frame-pointer) ;;
  3977. -g) echo -Z7 ;;
  3978. -fno-math-errno) ;;
  3979. -fno-common) ;;
  3980. -fno-signed-zeros) ;;
  3981. -fPIC) ;;
  3982. -mthumb) ;;
  3983. -march=*) ;;
  3984. -lz) echo zlib.lib ;;
  3985. -lx264) echo libx264.lib ;;
  3986. -lstdc++) ;;
  3987. -l*) echo ${flag#-l}.lib ;;
  3988. -LARGEADDRESSAWARE) echo $flag ;;
  3989. -L*) echo -libpath:${flag#-L} ;;
  3990. *) echo $flag ;;
  3991. esac
  3992. done
  3993. }
  3994. msvc_flags(){
  3995. msvc_common_flags "$@"
  3996. for flag; do
  3997. case $flag in
  3998. -Wall) echo -W3 -wd4018 -wd4146 -wd4244 -wd4305 \
  3999. -wd4554 ;;
  4000. -Wextra) echo -W4 -wd4244 -wd4127 -wd4018 -wd4389 \
  4001. -wd4146 -wd4057 -wd4204 -wd4706 -wd4305 \
  4002. -wd4152 -wd4324 -we4013 -wd4100 -wd4214 \
  4003. -wd4307 \
  4004. -wd4273 -wd4554 -wd4701 -wd4703 ;;
  4005. esac
  4006. done
  4007. }
  4008. icl_flags(){
  4009. msvc_common_flags "$@"
  4010. for flag; do
  4011. case $flag in
  4012. # Despite what Intel's documentation says -Wall, which is supported
  4013. # on Windows, does enable remarks so disable them here.
  4014. -Wall) echo $flag -Qdiag-disable:remark ;;
  4015. -std=c99) echo -Qstd=c99 ;;
  4016. -flto) echo -ipo ;;
  4017. esac
  4018. done
  4019. }
  4020. icc_flags(){
  4021. for flag; do
  4022. case $flag in
  4023. -flto) echo -ipo ;;
  4024. *) echo $flag ;;
  4025. esac
  4026. done
  4027. }
  4028. suncc_flags(){
  4029. for flag; do
  4030. case $flag in
  4031. -march=*|-mcpu=*)
  4032. case "${flag#*=}" in
  4033. native) echo -xtarget=native ;;
  4034. v9|niagara) echo -xarch=sparc ;;
  4035. ultrasparc) echo -xarch=sparcvis ;;
  4036. ultrasparc3|niagara2) echo -xarch=sparcvis2 ;;
  4037. i586|pentium) echo -xchip=pentium ;;
  4038. i686|pentiumpro|pentium2) echo -xtarget=pentium_pro ;;
  4039. pentium3*|c3-2) echo -xtarget=pentium3 ;;
  4040. pentium-m) echo -xarch=sse2 -xchip=pentium3 ;;
  4041. pentium4*) echo -xtarget=pentium4 ;;
  4042. prescott|nocona) echo -xarch=sse3 -xchip=pentium4 ;;
  4043. *-sse3) echo -xarch=sse3 ;;
  4044. core2) echo -xarch=ssse3 -xchip=core2 ;;
  4045. bonnell) echo -xarch=ssse3 ;;
  4046. corei7|nehalem) echo -xtarget=nehalem ;;
  4047. westmere) echo -xtarget=westmere ;;
  4048. silvermont) echo -xarch=sse4_2 ;;
  4049. corei7-avx|sandybridge) echo -xtarget=sandybridge ;;
  4050. core-avx*|ivybridge|haswell|broadwell|skylake*|knl)
  4051. echo -xarch=avx ;;
  4052. amdfam10|barcelona) echo -xtarget=barcelona ;;
  4053. btver1) echo -xarch=amdsse4a ;;
  4054. btver2|bdver*|znver*) echo -xarch=avx ;;
  4055. athlon-4|athlon-[mx]p) echo -xarch=ssea ;;
  4056. k8|opteron|athlon64|athlon-fx)
  4057. echo -xarch=sse2a ;;
  4058. athlon*) echo -xarch=pentium_proa ;;
  4059. esac
  4060. ;;
  4061. -std=c99) echo -xc99 ;;
  4062. -fomit-frame-pointer) echo -xregs=frameptr ;;
  4063. -fPIC) echo -KPIC -xcode=pic32 ;;
  4064. -W*,*) echo $flag ;;
  4065. -f*-*|-W*|-mimpure-text) ;;
  4066. -shared) echo -G ;;
  4067. *) echo $flag ;;
  4068. esac
  4069. done
  4070. }
  4071. probe_cc(){
  4072. pfx=$1
  4073. _cc=$2
  4074. first=$3
  4075. unset _type _ident _cc_c _cc_e _cc_o _flags _cflags
  4076. unset _ld_o _ldflags _ld_lib _ld_path
  4077. unset _depflags _DEPCMD _DEPFLAGS
  4078. _flags_filter=echo
  4079. if $_cc --version 2>&1 | grep -q '^GNU assembler'; then
  4080. true # no-op to avoid reading stdin in following checks
  4081. elif $_cc -v 2>&1 | grep -q '^gcc.*LLVM'; then
  4082. _type=llvm_gcc
  4083. gcc_extra_ver=$(expr "$($_cc --version 2>/dev/null | head -n1)" : '.*\((.*)\)')
  4084. _ident="llvm-gcc $($_cc -dumpversion 2>/dev/null) $gcc_extra_ver"
  4085. _depflags='-MMD -MF $(@:.o=.d) -MT $@'
  4086. _cflags_speed='-O3'
  4087. _cflags_size='-Os'
  4088. elif $_cc -v 2>&1 | grep -qi ^gcc; then
  4089. _type=gcc
  4090. gcc_version=$($_cc --version | head -n1)
  4091. gcc_basever=$($_cc -dumpversion)
  4092. gcc_pkg_ver=$(expr "$gcc_version" : '[^ ]* \(([^)]*)\)')
  4093. gcc_ext_ver=$(expr "$gcc_version" : ".*$gcc_pkg_ver $gcc_basever \\(.*\\)")
  4094. _ident=$(cleanws "gcc $gcc_basever $gcc_pkg_ver $gcc_ext_ver")
  4095. case $gcc_basever in
  4096. 2) ;;
  4097. 2.*) ;;
  4098. *) _depflags='-MMD -MF $(@:.o=.d) -MT $@' ;;
  4099. esac
  4100. if [ "$first" = true ]; then
  4101. case $gcc_basever in
  4102. 4.2*)
  4103. warn "gcc 4.2 is outdated and may miscompile FFmpeg. Please use a newer compiler." ;;
  4104. esac
  4105. fi
  4106. _cflags_speed='-O3'
  4107. _cflags_size='-Os'
  4108. elif $_cc --version 2>/dev/null | grep -q ^icc; then
  4109. _type=icc
  4110. _ident=$($_cc --version | head -n1)
  4111. _depflags='-MMD'
  4112. _cflags_speed='-O3'
  4113. _cflags_size='-Os'
  4114. _cflags_noopt='-O1'
  4115. _flags_filter=icc_flags
  4116. elif $_cc -v 2>&1 | grep -q xlc; then
  4117. _type=xlc
  4118. _ident=$($_cc -qversion 2>/dev/null | head -n1)
  4119. _cflags_speed='-O5'
  4120. _cflags_size='-O5 -qcompact'
  4121. elif $_cc --vsn 2>/dev/null | grep -Eq "ARM (C/C\+\+ )?Compiler"; then
  4122. test -d "$sysroot" || die "No valid sysroot specified."
  4123. _type=armcc
  4124. _ident=$($_cc --vsn | grep -i build | head -n1 | sed 's/.*: //')
  4125. armcc_conf="$PWD/armcc.conf"
  4126. $_cc --arm_linux_configure \
  4127. --arm_linux_config_file="$armcc_conf" \
  4128. --configure_sysroot="$sysroot" \
  4129. --configure_cpp_headers="$sysinclude" >>$logfile 2>&1 ||
  4130. die "Error creating armcc configuration file."
  4131. $_cc --vsn | grep -q RVCT && armcc_opt=rvct || armcc_opt=armcc
  4132. _flags="--arm_linux_config_file=$armcc_conf --translate_gcc"
  4133. as_default="${cross_prefix}gcc"
  4134. _depflags='-MMD'
  4135. _cflags_speed='-O3'
  4136. _cflags_size='-Os'
  4137. elif $_cc -v 2>&1 | grep -q clang && ! $_cc -? > /dev/null 2>&1; then
  4138. _type=clang
  4139. _ident=$($_cc --version 2>/dev/null | head -n1)
  4140. _depflags='-MMD -MF $(@:.o=.d) -MT $@'
  4141. _cflags_speed='-O3'
  4142. _cflags_size='-Oz'
  4143. elif $_cc -V 2>&1 | grep -q Sun; then
  4144. _type=suncc
  4145. _ident=$($_cc -V 2>&1 | head -n1 | cut -d' ' -f 2-)
  4146. _DEPCMD='$(DEP$(1)) $(DEP$(1)FLAGS) $($(1)DEP_FLAGS) $< | sed -e "1s,^.*: ,$@: ," -e "\$$!s,\$$, \\\," -e "1!s,^.*: , ," > $(@:.o=.d)'
  4147. _DEPFLAGS='-xM1 -xc99'
  4148. _ldflags='-std=c99'
  4149. _cflags_speed='-O5'
  4150. _cflags_size='-O5 -xspace'
  4151. _flags_filter=suncc_flags
  4152. elif $_cc -v 2>&1 | grep -q 'PathScale\|Path64'; then
  4153. _type=pathscale
  4154. _ident=$($_cc -v 2>&1 | head -n1 | tr -d :)
  4155. _depflags='-MMD -MF $(@:.o=.d) -MT $@'
  4156. _cflags_speed='-O2'
  4157. _cflags_size='-Os'
  4158. _flags_filter='filter_out -Wdisabled-optimization'
  4159. elif $_cc -v 2>&1 | grep -q Open64; then
  4160. _type=open64
  4161. _ident=$($_cc -v 2>&1 | head -n1 | tr -d :)
  4162. _depflags='-MMD -MF $(@:.o=.d) -MT $@'
  4163. _cflags_speed='-O2'
  4164. _cflags_size='-Os'
  4165. _flags_filter='filter_out -Wdisabled-optimization|-Wtype-limits|-fno-signed-zeros'
  4166. elif $_cc 2>&1 | grep -q 'Microsoft.*ARM.*Assembler'; then
  4167. _type=armasm
  4168. _ident=$($_cc | head -n1)
  4169. # 4509: "This form of conditional instruction is deprecated"
  4170. _flags="-nologo -ignore 4509"
  4171. _flags_filter=armasm_flags
  4172. elif $_cc 2>&1 | grep -q Intel; then
  4173. _type=icl
  4174. _ident=$($_cc 2>&1 | head -n1)
  4175. _depflags='-QMMD -QMF$(@:.o=.d) -QMT$@'
  4176. # Not only is O3 broken on 13.x+ but it is slower on all previous
  4177. # versions (tested) as well.
  4178. _cflags_speed="-O2"
  4179. _cflags_size="-O1 -Oi" # -O1 without -Oi miscompiles stuff
  4180. if $_cc 2>&1 | grep -q Linker; then
  4181. _ld_o='-out:$@'
  4182. else
  4183. _ld_o='-Fe$@'
  4184. fi
  4185. _cc_o='-Fo$@'
  4186. _cc_e='-P'
  4187. _flags_filter=icl_flags
  4188. _ld_lib='lib%.a'
  4189. _ld_path='-libpath:'
  4190. # -Qdiag-error to make icl error when seeing certain unknown arguments
  4191. _flags='-nologo -Qdiag-error:4044,10157'
  4192. # -Qvec- -Qsimd- to prevent miscompilation, -GS, fp:precise for consistency
  4193. # with MSVC which enables it by default.
  4194. _cflags='-Qms0 -Qvec- -Qsimd- -GS -fp:precise'
  4195. disable stripping
  4196. elif $_cc -? 2>/dev/null | grep -q 'LLVM.*Linker'; then
  4197. # lld can emulate multiple different linkers; in ms link.exe mode,
  4198. # the -? parameter gives the help output which contains an identifyable
  4199. # string, while it gives an error in other modes.
  4200. _type=lld-link
  4201. # The link.exe mode doesn't have a switch for getting the version,
  4202. # but we can force it back to gnu mode and get the version from there.
  4203. _ident=$($_cc -flavor gnu --version 2>/dev/null)
  4204. _ld_o='-out:$@'
  4205. _flags_filter=msvc_flags
  4206. _ld_lib='lib%.a'
  4207. _ld_path='-libpath:'
  4208. elif $_cc -nologo- 2>&1 | grep -q Microsoft || { $_cc -v 2>&1 | grep -q clang && $_cc -? > /dev/null 2>&1; }; then
  4209. _type=msvc
  4210. _ident=$($_cc 2>&1 | head -n1 | tr -d '\r')
  4211. _DEPCMD='$(DEP$(1)) $(DEP$(1)FLAGS) $($(1)DEP_FLAGS) $< 2>&1 | awk '\''/including/ { sub(/^.*file: */, ""); gsub(/\\/, "/"); if (!match($$0, / /)) print "$@:", $$0 }'\'' > $(@:.o=.d)'
  4212. _DEPFLAGS='$(CPPFLAGS) $(CFLAGS) -showIncludes -Zs'
  4213. _cflags_speed="-O2"
  4214. _cflags_size="-O1"
  4215. _cflags_noopt="-O1"
  4216. if $_cc -nologo- 2>&1 | grep -q Linker; then
  4217. _ld_o='-out:$@'
  4218. else
  4219. _ld_o='-Fe$@'
  4220. fi
  4221. _cc_o='-Fo$@'
  4222. _cc_e='-P -Fi$@'
  4223. _flags_filter=msvc_flags
  4224. _ld_lib='lib%.a'
  4225. _ld_path='-libpath:'
  4226. _flags='-nologo'
  4227. disable stripping
  4228. elif $_cc --version 2>/dev/null | grep -q ^cparser; then
  4229. _type=cparser
  4230. _ident=$($_cc --version | head -n1)
  4231. _depflags='-MMD'
  4232. _cflags_speed='-O4'
  4233. _cflags_size='-O2'
  4234. _flags_filter=cparser_flags
  4235. fi
  4236. eval ${pfx}_type=\$_type
  4237. eval ${pfx}_ident=\$_ident
  4238. }
  4239. set_ccvars(){
  4240. eval ${1}_C=\${_cc_c-\${${1}_C}}
  4241. eval ${1}_E=\${_cc_e-\${${1}_E}}
  4242. eval ${1}_O=\${_cc_o-\${${1}_O}}
  4243. if [ -n "$_depflags" ]; then
  4244. eval ${1}_DEPFLAGS=\$_depflags
  4245. else
  4246. eval ${1}DEP=\${_DEPCMD:-\$DEPCMD}
  4247. eval ${1}DEP_FLAGS=\${_DEPFLAGS:-\$DEPFLAGS}
  4248. eval DEP${1}FLAGS=\$_flags
  4249. fi
  4250. }
  4251. probe_cc cc "$cc" "true"
  4252. cflags_filter=$_flags_filter
  4253. cflags_speed=$_cflags_speed
  4254. cflags_size=$_cflags_size
  4255. cflags_noopt=$_cflags_noopt
  4256. add_cflags $_flags $_cflags
  4257. cc_ldflags=$_ldflags
  4258. set_ccvars CC
  4259. set_ccvars CXX
  4260. probe_cc hostcc "$host_cc"
  4261. host_cflags_filter=$_flags_filter
  4262. host_cflags_speed=$_cflags_speed
  4263. add_host_cflags $_flags $_cflags
  4264. set_ccvars HOSTCC
  4265. test -n "$cc_type" && enable $cc_type ||
  4266. warn "Unknown C compiler $cc, unable to select optimal CFLAGS"
  4267. : ${as_default:=$cc}
  4268. : ${objcc_default:=$cc}
  4269. : ${dep_cc_default:=$cc}
  4270. : ${ld_default:=$cc}
  4271. : ${host_ld_default:=$host_cc}
  4272. set_default ar as objcc dep_cc ld ln_s host_ld windres
  4273. probe_cc as "$as"
  4274. asflags_filter=$_flags_filter
  4275. add_asflags $_flags $_cflags
  4276. set_ccvars AS
  4277. probe_cc objcc "$objcc"
  4278. objcflags_filter=$_flags_filter
  4279. add_objcflags $_flags $_cflags
  4280. set_ccvars OBJC
  4281. probe_cc ld "$ld"
  4282. ldflags_filter=$_flags_filter
  4283. add_ldflags $_flags $_ldflags
  4284. test "$cc_type" != "$ld_type" && add_ldflags $cc_ldflags
  4285. LD_O=${_ld_o-$LD_O}
  4286. LD_LIB=${_ld_lib-$LD_LIB}
  4287. LD_PATH=${_ld_path-$LD_PATH}
  4288. probe_cc hostld "$host_ld"
  4289. host_ldflags_filter=$_flags_filter
  4290. add_host_ldflags $_flags $_ldflags
  4291. HOSTLD_O=${_ld_o-$HOSTLD_O}
  4292. if [ -z "$CC_DEPFLAGS" ] && [ "$dep_cc" != "$cc" ]; then
  4293. probe_cc depcc "$dep_cc"
  4294. CCDEP=${_DEPCMD:-$DEPCMD}
  4295. CCDEP_FLAGS=${_DEPFLAGS:=$DEPFLAGS}
  4296. DEPCCFLAGS=$_flags
  4297. fi
  4298. if $ar 2>&1 | grep -q Microsoft; then
  4299. arflags="-nologo"
  4300. ar_o='-out:$@'
  4301. elif $ar 2>&1 | grep -q "\[D\] "; then
  4302. arflags="rcD"
  4303. ar_o='$@'
  4304. else
  4305. arflags="rc"
  4306. ar_o='$@'
  4307. fi
  4308. add_cflags $extra_cflags
  4309. add_cxxflags $extra_cxxflags
  4310. add_objcflags $extra_objcflags
  4311. add_asflags $extra_cflags
  4312. if test -n "$sysroot"; then
  4313. case "$cc_type" in
  4314. gcc|llvm_gcc|clang)
  4315. add_cppflags --sysroot="$sysroot"
  4316. add_ldflags --sysroot="$sysroot"
  4317. ;;
  4318. esac
  4319. fi
  4320. if test "$cpu" = host; then
  4321. enabled cross_compile &&
  4322. die "--cpu=host makes no sense when cross-compiling."
  4323. case "$cc_type" in
  4324. gcc|llvm_gcc)
  4325. check_native(){
  4326. $cc $1=native -v -c -o $TMPO $TMPC >$TMPE 2>&1 || return
  4327. sed -n "/cc1.*$1=/{
  4328. s/.*$1=\\([^ ]*\\).*/\\1/
  4329. p
  4330. q
  4331. }" $TMPE
  4332. }
  4333. cpu=$(check_native -march || check_native -mcpu)
  4334. ;;
  4335. clang)
  4336. check_native(){
  4337. $cc $1=native -v -c -o $TMPO $TMPC >$TMPE 2>&1 || return
  4338. sed -n "/cc1.*-target-cpu /{
  4339. s/.*-target-cpu \\([^ ]*\\).*/\\1/
  4340. p
  4341. q
  4342. }" $TMPE
  4343. }
  4344. cpu=$(check_native -march)
  4345. ;;
  4346. esac
  4347. test "${cpu:-host}" = host &&
  4348. die "--cpu=host not supported with compiler $cc"
  4349. fi
  4350. # Deal with common $arch aliases
  4351. case "$arch" in
  4352. aarch64|arm64)
  4353. arch="aarch64"
  4354. ;;
  4355. arm*|iPad*|iPhone*)
  4356. arch="arm"
  4357. ;;
  4358. mips*|IP*)
  4359. case "$arch" in
  4360. *el)
  4361. add_cppflags -EL
  4362. add_ldflags -EL
  4363. ;;
  4364. *eb)
  4365. add_cppflags -EB
  4366. add_ldflags -EB
  4367. ;;
  4368. esac
  4369. arch="mips"
  4370. ;;
  4371. parisc*|hppa*)
  4372. arch="parisc"
  4373. ;;
  4374. "Power Macintosh"|ppc*|powerpc*)
  4375. arch="ppc"
  4376. ;;
  4377. s390|s390x)
  4378. arch="s390"
  4379. ;;
  4380. sh4|sh)
  4381. arch="sh4"
  4382. ;;
  4383. sun4*|sparc*)
  4384. arch="sparc"
  4385. ;;
  4386. tilegx|tile-gx)
  4387. arch="tilegx"
  4388. ;;
  4389. i[3-6]86*|i86pc|BePC|x86pc|x86_64|x86_32|amd64)
  4390. arch="x86"
  4391. ;;
  4392. esac
  4393. is_in $arch $ARCH_LIST || warn "unknown architecture $arch"
  4394. enable $arch
  4395. # Add processor-specific flags
  4396. if enabled aarch64; then
  4397. case $cpu in
  4398. armv*)
  4399. cpuflags="-march=$cpu"
  4400. ;;
  4401. *)
  4402. cpuflags="-mcpu=$cpu"
  4403. ;;
  4404. esac
  4405. elif enabled alpha; then
  4406. cpuflags="-mcpu=$cpu"
  4407. elif enabled arm; then
  4408. check_arm_arch() {
  4409. test_cpp_condition stddef.h \
  4410. "defined __ARM_ARCH_${1}__ || defined __TARGET_ARCH_${2:-$1}" \
  4411. $cpuflags
  4412. }
  4413. probe_arm_arch() {
  4414. if check_arm_arch 4; then echo armv4
  4415. elif check_arm_arch 4T; then echo armv4t
  4416. elif check_arm_arch 5; then echo armv5
  4417. elif check_arm_arch 5E; then echo armv5e
  4418. elif check_arm_arch 5T; then echo armv5t
  4419. elif check_arm_arch 5TE; then echo armv5te
  4420. elif check_arm_arch 5TEJ; then echo armv5te
  4421. elif check_arm_arch 6; then echo armv6
  4422. elif check_arm_arch 6J; then echo armv6j
  4423. elif check_arm_arch 6K; then echo armv6k
  4424. elif check_arm_arch 6Z; then echo armv6z
  4425. elif check_arm_arch 6KZ; then echo armv6zk
  4426. elif check_arm_arch 6ZK; then echo armv6zk
  4427. elif check_arm_arch 6T2; then echo armv6t2
  4428. elif check_arm_arch 7; then echo armv7
  4429. elif check_arm_arch 7A 7_A; then echo armv7-a
  4430. elif check_arm_arch 7S; then echo armv7-a
  4431. elif check_arm_arch 7R 7_R; then echo armv7-r
  4432. elif check_arm_arch 7M 7_M; then echo armv7-m
  4433. elif check_arm_arch 7EM 7E_M; then echo armv7-m
  4434. elif check_arm_arch 8A 8_A; then echo armv8-a
  4435. fi
  4436. }
  4437. [ "$cpu" = generic ] && cpu=$(probe_arm_arch)
  4438. case $cpu in
  4439. armv*)
  4440. cpuflags="-march=$cpu"
  4441. subarch=$(echo $cpu | sed 's/[^a-z0-9]//g')
  4442. ;;
  4443. *)
  4444. cpuflags="-mcpu=$cpu"
  4445. case $cpu in
  4446. cortex-a*) subarch=armv7a ;;
  4447. cortex-r*) subarch=armv7r ;;
  4448. cortex-m*) enable thumb; subarch=armv7m ;;
  4449. arm11*) subarch=armv6 ;;
  4450. arm[79]*e*|arm9[24]6*|arm96*|arm102[26]) subarch=armv5te ;;
  4451. armv4*|arm7*|arm9[24]*) subarch=armv4 ;;
  4452. *) subarch=$(probe_arm_arch) ;;
  4453. esac
  4454. ;;
  4455. esac
  4456. case "$subarch" in
  4457. armv5t*) enable fast_clz ;;
  4458. armv[6-8]*)
  4459. enable fast_clz
  4460. disabled fast_unaligned || enable fast_unaligned
  4461. ;;
  4462. esac
  4463. elif enabled avr32; then
  4464. case $cpu in
  4465. ap7[02]0[0-2])
  4466. subarch="avr32_ap"
  4467. cpuflags="-mpart=$cpu"
  4468. ;;
  4469. ap)
  4470. subarch="avr32_ap"
  4471. cpuflags="-march=$cpu"
  4472. ;;
  4473. uc3[ab]*)
  4474. subarch="avr32_uc"
  4475. cpuflags="-mcpu=$cpu"
  4476. ;;
  4477. uc)
  4478. subarch="avr32_uc"
  4479. cpuflags="-march=$cpu"
  4480. ;;
  4481. esac
  4482. elif enabled bfin; then
  4483. cpuflags="-mcpu=$cpu"
  4484. elif enabled mips; then
  4485. cpuflags="-march=$cpu"
  4486. if [ "$cpu" != "generic" ]; then
  4487. disable mips32r2
  4488. disable mips32r5
  4489. disable mips64r2
  4490. disable mips32r6
  4491. disable mips64r6
  4492. disable loongson2
  4493. disable loongson3
  4494. case $cpu in
  4495. 24kc|24kf*|24kec|34kc|1004kc|24kef*|34kf*|1004kf*|74kc|74kf)
  4496. enable mips32r2
  4497. disable msa
  4498. ;;
  4499. p5600|i6400|p6600)
  4500. disable mipsdsp
  4501. disable mipsdspr2
  4502. ;;
  4503. loongson*)
  4504. enable loongson2
  4505. enable loongson3
  4506. enable local_aligned
  4507. enable simd_align_16
  4508. enable fast_64bit
  4509. enable fast_clz
  4510. enable fast_cmov
  4511. enable fast_unaligned
  4512. disable aligned_stack
  4513. disable mipsdsp
  4514. disable mipsdspr2
  4515. # When gcc version less than 5.3.0, add -fno-expensive-optimizations flag.
  4516. if [ $cc == gcc ]; then
  4517. gcc_version=$(gcc -dumpversion)
  4518. if [ "$(echo "$gcc_version 5.3.0" | tr " " "\n" | sort -rV | head -n 1)" == "$gcc_version" ]; then
  4519. expensive_optimization_flag=""
  4520. else
  4521. expensive_optimization_flag="-fno-expensive-optimizations"
  4522. fi
  4523. fi
  4524. case $cpu in
  4525. loongson3*)
  4526. cpuflags="-march=loongson3a -mhard-float $expensive_optimization_flag"
  4527. ;;
  4528. loongson2e)
  4529. cpuflags="-march=loongson2e -mhard-float $expensive_optimization_flag"
  4530. ;;
  4531. loongson2f)
  4532. cpuflags="-march=loongson2f -mhard-float $expensive_optimization_flag"
  4533. ;;
  4534. esac
  4535. ;;
  4536. *)
  4537. # Unknown CPU. Disable everything.
  4538. warn "unknown CPU. Disabling all MIPS optimizations."
  4539. disable mipsfpu
  4540. disable mipsdsp
  4541. disable mipsdspr2
  4542. disable msa
  4543. disable mmi
  4544. ;;
  4545. esac
  4546. case $cpu in
  4547. 24kc)
  4548. disable mipsfpu
  4549. disable mipsdsp
  4550. disable mipsdspr2
  4551. ;;
  4552. 24kf*)
  4553. disable mipsdsp
  4554. disable mipsdspr2
  4555. ;;
  4556. 24kec|34kc|1004kc)
  4557. disable mipsfpu
  4558. disable mipsdspr2
  4559. ;;
  4560. 24kef*|34kf*|1004kf*)
  4561. disable mipsdspr2
  4562. ;;
  4563. 74kc)
  4564. disable mipsfpu
  4565. ;;
  4566. p5600)
  4567. enable mips32r5
  4568. check_cflags "-mtune=p5600" && check_cflags "-msched-weight -mload-store-pairs -funroll-loops"
  4569. ;;
  4570. i6400)
  4571. enable mips64r6
  4572. check_cflags "-mtune=i6400 -mabi=64" && check_cflags "-msched-weight -mload-store-pairs -funroll-loops" && check_ldflags "-mabi=64"
  4573. ;;
  4574. p6600)
  4575. enable mips64r6
  4576. check_cflags "-mtune=p6600 -mabi=64" && check_cflags "-msched-weight -mload-store-pairs -funroll-loops" && check_ldflags "-mabi=64"
  4577. ;;
  4578. esac
  4579. else
  4580. # We do not disable anything. Is up to the user to disable the unwanted features.
  4581. warn 'generic cpu selected'
  4582. fi
  4583. elif enabled ppc; then
  4584. disable ldbrx
  4585. case $(tolower $cpu) in
  4586. 601|ppc601|powerpc601)
  4587. cpuflags="-mcpu=601"
  4588. disable altivec
  4589. ;;
  4590. 603*|ppc603*|powerpc603*)
  4591. cpuflags="-mcpu=603"
  4592. disable altivec
  4593. ;;
  4594. 604*|ppc604*|powerpc604*)
  4595. cpuflags="-mcpu=604"
  4596. disable altivec
  4597. ;;
  4598. g3|75*|ppc75*|powerpc75*)
  4599. cpuflags="-mcpu=750"
  4600. disable altivec
  4601. ;;
  4602. g4|745*|ppc745*|powerpc745*)
  4603. cpuflags="-mcpu=7450"
  4604. disable vsx
  4605. ;;
  4606. 74*|ppc74*|powerpc74*)
  4607. cpuflags="-mcpu=7400"
  4608. disable vsx
  4609. ;;
  4610. g5|970|ppc970|powerpc970)
  4611. cpuflags="-mcpu=970"
  4612. disable vsx
  4613. ;;
  4614. power[3-6]*)
  4615. cpuflags="-mcpu=$cpu"
  4616. disable vsx
  4617. ;;
  4618. power[7-8]*)
  4619. cpuflags="-mcpu=$cpu"
  4620. ;;
  4621. cell)
  4622. cpuflags="-mcpu=cell"
  4623. enable ldbrx
  4624. disable vsx
  4625. ;;
  4626. e500mc)
  4627. cpuflags="-mcpu=e500mc"
  4628. disable altivec
  4629. ;;
  4630. e500v2)
  4631. cpuflags="-mcpu=8548 -mhard-float -mfloat-gprs=double"
  4632. disable altivec
  4633. disable dcbzl
  4634. ;;
  4635. e500)
  4636. cpuflags="-mcpu=8540 -mhard-float"
  4637. disable altivec
  4638. disable dcbzl
  4639. ;;
  4640. esac
  4641. elif enabled sparc; then
  4642. case $cpu in
  4643. cypress|f93[04]|tsc701|sparcl*|supersparc|hypersparc|niagara|v[789])
  4644. cpuflags="-mcpu=$cpu"
  4645. ;;
  4646. ultrasparc*|niagara[234])
  4647. cpuflags="-mcpu=$cpu"
  4648. ;;
  4649. esac
  4650. elif enabled x86; then
  4651. case $cpu in
  4652. i[345]86|pentium)
  4653. cpuflags="-march=$cpu"
  4654. disable i686
  4655. disable mmx
  4656. ;;
  4657. # targets that do NOT support nopl and conditional mov (cmov)
  4658. pentium-mmx|k6|k6-[23]|winchip-c6|winchip2|c3)
  4659. cpuflags="-march=$cpu"
  4660. disable i686
  4661. ;;
  4662. # targets that do support nopl and conditional mov (cmov)
  4663. i686|pentiumpro|pentium[23]|pentium-m|athlon|athlon-tbird|athlon-4|athlon-[mx]p|athlon64*|k8*|opteron*|athlon-fx\
  4664. |core*|atom|bonnell|nehalem|westmere|silvermont|sandybridge|ivybridge|haswell|broadwell|skylake*|knl\
  4665. |amdfam10|barcelona|b[dt]ver*|znver*)
  4666. cpuflags="-march=$cpu"
  4667. enable i686
  4668. enable fast_cmov
  4669. ;;
  4670. # targets that do support conditional mov but on which it's slow
  4671. pentium4|pentium4m|prescott|nocona)
  4672. cpuflags="-march=$cpu"
  4673. enable i686
  4674. disable fast_cmov
  4675. ;;
  4676. esac
  4677. fi
  4678. if [ "$cpu" != generic ]; then
  4679. add_cflags $cpuflags
  4680. add_asflags $cpuflags
  4681. test "$cc_type" = "$ld_type" && add_ldflags $cpuflags
  4682. fi
  4683. # compiler sanity check
  4684. test_exec <<EOF
  4685. int main(void){ return 0; }
  4686. EOF
  4687. if test "$?" != 0; then
  4688. echo "$cc is unable to create an executable file."
  4689. if test -z "$cross_prefix" && ! enabled cross_compile ; then
  4690. echo "If $cc is a cross-compiler, use the --enable-cross-compile option."
  4691. echo "Only do this if you know what cross compiling means."
  4692. fi
  4693. die "C compiler test failed."
  4694. fi
  4695. add_cppflags -D_ISOC99_SOURCE
  4696. add_cxxflags -D__STDC_CONSTANT_MACROS
  4697. check_cxxflags -std=c++11 || check_cxxflags -std=c++0x
  4698. # some compilers silently accept -std=c11, so we also need to check that the
  4699. # version macro is defined properly
  4700. test_cflags_cc -std=c11 ctype.h "__STDC_VERSION__ >= 201112L" &&
  4701. add_cflags -std=c11 ||
  4702. check_cflags -std=c99
  4703. check_cppflags -D_FILE_OFFSET_BITS=64
  4704. check_cppflags -D_LARGEFILE_SOURCE
  4705. add_host_cppflags -D_ISOC99_SOURCE
  4706. check_host_cflags -std=c99
  4707. check_host_cflags -Wall
  4708. check_host_cflags $host_cflags_speed
  4709. check_64bit(){
  4710. arch32=$1
  4711. arch64=$2
  4712. expr=${3:-'sizeof(void *) > 4'}
  4713. test_code cc "" "int test[2*($expr) - 1]" &&
  4714. subarch=$arch64 || subarch=$arch32
  4715. enable $subarch
  4716. }
  4717. case "$arch" in
  4718. aarch64|alpha|ia64)
  4719. enabled shared && enable_weak pic
  4720. ;;
  4721. mips)
  4722. check_64bit mips mips64 '_MIPS_SIM > 1'
  4723. enabled shared && enable_weak pic
  4724. ;;
  4725. parisc)
  4726. check_64bit parisc parisc64
  4727. enabled shared && enable_weak pic
  4728. ;;
  4729. ppc)
  4730. check_64bit ppc ppc64
  4731. enabled shared && enable_weak pic
  4732. ;;
  4733. s390)
  4734. check_64bit s390 s390x
  4735. enabled shared && enable_weak pic
  4736. ;;
  4737. sparc)
  4738. check_64bit sparc sparc64
  4739. enabled shared && enable_weak pic
  4740. ;;
  4741. x86)
  4742. check_64bit x86_32 x86_64
  4743. # Treat x32 as x64 for now. Note it also needs pic if shared
  4744. test "$subarch" = "x86_32" && test_cpp_condition stddef.h 'defined(__x86_64__)' &&
  4745. subarch=x86_64 && enable x86_64 && disable x86_32
  4746. if enabled x86_64; then
  4747. enabled shared && enable_weak pic
  4748. objformat=elf64
  4749. fi
  4750. ;;
  4751. esac
  4752. # OS specific
  4753. case $target_os in
  4754. aix)
  4755. SHFLAGS=-shared
  4756. add_cppflags '-I\$(SRC_PATH)/compat/aix'
  4757. enabled shared && add_ldflags -Wl,-brtl
  4758. arflags='-Xany -r -c'
  4759. striptype=""
  4760. ;;
  4761. android)
  4762. disable symver
  4763. enable section_data_rel_ro
  4764. add_cflags -fPIE
  4765. add_ldexeflags -fPIE -pie
  4766. SLIB_INSTALL_NAME='$(SLIBNAME)'
  4767. SLIB_INSTALL_LINKS=
  4768. SHFLAGS='-shared -Wl,-soname,$(SLIBNAME)'
  4769. ;;
  4770. haiku)
  4771. prefix_default="/boot/common"
  4772. network_extralibs="-lnetwork"
  4773. host_extralibs=
  4774. ;;
  4775. sunos)
  4776. SHFLAGS='-shared -Wl,-h,$$(@F)'
  4777. enabled x86 && append SHFLAGS -mimpure-text
  4778. network_extralibs="-lsocket -lnsl"
  4779. add_cppflags -D__EXTENSIONS__
  4780. # When using suncc to build, the Solaris linker will mark
  4781. # an executable with each instruction set encountered by
  4782. # the Solaris assembler. As our libraries contain their own
  4783. # guards for processor-specific code, instead suppress
  4784. # generation of the HWCAPS ELF section on Solaris x86 only.
  4785. enabled_all suncc x86 &&
  4786. echo "hwcap_1 = OVERRIDE;" > mapfile &&
  4787. add_ldflags -Wl,-M,mapfile
  4788. nm_default='nm -P -g'
  4789. striptype=""
  4790. version_script='-M'
  4791. VERSION_SCRIPT_POSTPROCESS_CMD='perl $(SRC_PATH)/compat/solaris/make_sunver.pl - $(OBJS)'
  4792. ;;
  4793. netbsd)
  4794. disable symver
  4795. oss_indev_extralibs="-lossaudio"
  4796. oss_outdev_extralibs="-lossaudio"
  4797. enabled gcc || check_ldflags -Wl,-zmuldefs
  4798. ;;
  4799. openbsd|bitrig)
  4800. disable symver
  4801. striptype=""
  4802. SHFLAGS='-shared'
  4803. SLIB_INSTALL_NAME='$(SLIBNAME).$(LIBMAJOR).$(LIBMINOR)'
  4804. SLIB_INSTALL_LINKS=
  4805. oss_indev_extralibs="-lossaudio"
  4806. oss_outdev_extralibs="-lossaudio"
  4807. ;;
  4808. dragonfly)
  4809. disable symver
  4810. ;;
  4811. freebsd)
  4812. ;;
  4813. bsd/os)
  4814. add_extralibs -lpoll -lgnugetopt
  4815. strip="strip -d"
  4816. ;;
  4817. darwin)
  4818. enabled ppc && add_asflags -force_cpusubtype_ALL
  4819. install_name_dir_default='$(SHLIBDIR)'
  4820. SHFLAGS='-dynamiclib -Wl,-single_module -Wl,-install_name,$(INSTALL_NAME_DIR)/$(SLIBNAME_WITH_MAJOR),-current_version,$(LIBVERSION),-compatibility_version,$(LIBMAJOR)'
  4821. enabled x86_32 && append SHFLAGS -Wl,-read_only_relocs,suppress
  4822. strip="${strip} -x"
  4823. add_ldflags -Wl,-dynamic,-search_paths_first
  4824. check_cflags -Werror=partial-availability
  4825. SLIBSUF=".dylib"
  4826. SLIBNAME_WITH_VERSION='$(SLIBPREF)$(FULLNAME).$(LIBVERSION)$(SLIBSUF)'
  4827. SLIBNAME_WITH_MAJOR='$(SLIBPREF)$(FULLNAME).$(LIBMAJOR)$(SLIBSUF)'
  4828. enabled x86_64 && objformat="macho64" || objformat="macho32"
  4829. enabled_any pic shared x86_64 ||
  4830. { check_cflags -mdynamic-no-pic && add_asflags -mdynamic-no-pic; }
  4831. check_headers dispatch/dispatch.h &&
  4832. add_cppflags '-I\$(SRC_PATH)/compat/dispatch_semaphore'
  4833. if test -n "$sysroot"; then
  4834. is_in -isysroot $cc $CPPFLAGS $CFLAGS || check_cppflags -isysroot $sysroot
  4835. is_in -isysroot $ld $LDFLAGS || check_ldflags -isysroot $sysroot
  4836. fi
  4837. version_script='-exported_symbols_list'
  4838. VERSION_SCRIPT_POSTPROCESS_CMD='tr " " "\n" | sed -n /global:/,/local:/p | grep ";" | tr ";" "\n" | sed -E "s/(.+)/_\1/g" | sed -E "s/(.+[^*])$$$$/\1*/"'
  4839. ;;
  4840. msys*)
  4841. die "Native MSYS builds are discouraged, please use the MINGW environment."
  4842. ;;
  4843. mingw32*|mingw64*)
  4844. target_os=mingw32
  4845. LIBTARGET=i386
  4846. if enabled x86_64; then
  4847. LIBTARGET="i386:x86-64"
  4848. elif enabled arm; then
  4849. LIBTARGET="arm"
  4850. elif enabled aarch64; then
  4851. LIBTARGET="arm64"
  4852. fi
  4853. if enabled shared; then
  4854. # Cannot build both shared and static libs when using dllimport.
  4855. disable static
  4856. fi
  4857. enabled shared && ! enabled small && test_cmd $windres --version && enable gnu_windres
  4858. enabled x86_32 && check_ldflags -Wl,--large-address-aware
  4859. shlibdir_default="$bindir_default"
  4860. SLIBPREF=""
  4861. SLIBSUF=".dll"
  4862. SLIBNAME_WITH_VERSION='$(SLIBPREF)$(FULLNAME)-$(LIBVERSION)$(SLIBSUF)'
  4863. SLIBNAME_WITH_MAJOR='$(SLIBPREF)$(FULLNAME)-$(LIBMAJOR)$(SLIBSUF)'
  4864. if test_cmd lib.exe -list; then
  4865. SLIB_EXTRA_CMD=-'lib.exe -nologo -machine:$(LIBTARGET) -def:$$(@:$(SLIBSUF)=.def) -out:$(SUBDIR)$(SLIBNAME:$(SLIBSUF)=.lib)'
  4866. if enabled x86_64; then
  4867. LIBTARGET=x64
  4868. fi
  4869. else
  4870. SLIB_EXTRA_CMD=-'$(DLLTOOL) -m $(LIBTARGET) -d $$(@:$(SLIBSUF)=.def) -l $(SUBDIR)$(SLIBNAME:$(SLIBSUF)=.lib) -D $(SLIBNAME_WITH_MAJOR)'
  4871. fi
  4872. SLIB_INSTALL_NAME='$(SLIBNAME_WITH_MAJOR)'
  4873. SLIB_INSTALL_LINKS=
  4874. SLIB_INSTALL_EXTRA_SHLIB='$(SLIBNAME:$(SLIBSUF)=.lib)'
  4875. SLIB_INSTALL_EXTRA_LIB='lib$(SLIBNAME:$(SLIBSUF)=.dll.a) $(SLIBNAME_WITH_MAJOR:$(SLIBSUF)=.def)'
  4876. 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)'
  4877. SHFLAGS='-shared -Wl,--out-implib,$(SUBDIR)lib$(SLIBNAME:$(SLIBSUF)=.dll.a) -Wl,--disable-auto-image-base $$(@:$(SLIBSUF)=.def)'
  4878. enabled x86_64 && objformat="win64" || objformat="win32"
  4879. dlltool="${cross_prefix}dlltool"
  4880. ranlib=:
  4881. enable dos_paths
  4882. check_ldflags -Wl,--nxcompat,--dynamicbase
  4883. # Lets work around some stupidity in binutils.
  4884. # ld will strip relocations from executables even though we need them
  4885. # for dynamicbase (ASLR). Using -pie does retain the reloc section
  4886. # however ld then forgets what the entry point should be (oops) so we
  4887. # have to manually (re)set it.
  4888. if enabled x86_32; then
  4889. disabled debug && add_ldexeflags -Wl,--pic-executable,-e,_mainCRTStartup
  4890. elif enabled x86_64; then
  4891. disabled debug && add_ldexeflags -Wl,--pic-executable,-e,mainCRTStartup
  4892. check_ldflags -Wl,--high-entropy-va # binutils 2.25
  4893. # Set image base >4GB for extra entropy with HEASLR
  4894. add_ldexeflags -Wl,--image-base,0x140000000
  4895. append SHFLAGS -Wl,--image-base,0x180000000
  4896. fi
  4897. ;;
  4898. win32|win64)
  4899. disable symver
  4900. if enabled shared; then
  4901. # Link to the import library instead of the normal static library
  4902. # for shared libs.
  4903. LD_LIB='%.lib'
  4904. # Cannot build both shared and static libs with MSVC or icl.
  4905. disable static
  4906. fi
  4907. enabled x86_32 && check_ldflags -LARGEADDRESSAWARE
  4908. shlibdir_default="$bindir_default"
  4909. SLIBPREF=""
  4910. SLIBSUF=".dll"
  4911. SLIBNAME_WITH_VERSION='$(SLIBPREF)$(FULLNAME)-$(LIBVERSION)$(SLIBSUF)'
  4912. SLIBNAME_WITH_MAJOR='$(SLIBPREF)$(FULLNAME)-$(LIBMAJOR)$(SLIBSUF)'
  4913. SLIB_CREATE_DEF_CMD='EXTERN_PREFIX="$(EXTERN_PREFIX)" $(SRC_PATH)/compat/windows/makedef $(SUBDIR)lib$(NAME).ver $(OBJS) > $$(@:$(SLIBSUF)=.def)'
  4914. SLIB_INSTALL_NAME='$(SLIBNAME_WITH_MAJOR)'
  4915. SLIB_INSTALL_LINKS=
  4916. SLIB_INSTALL_EXTRA_SHLIB='$(SLIBNAME:$(SLIBSUF)=.lib)'
  4917. SLIB_INSTALL_EXTRA_LIB='$(SLIBNAME_WITH_MAJOR:$(SLIBSUF)=.def)'
  4918. SHFLAGS='-dll -def:$$(@:$(SLIBSUF)=.def) -implib:$(SUBDIR)$(SLIBNAME:$(SLIBSUF)=.lib)'
  4919. enabled x86_64 && objformat="win64" || objformat="win32"
  4920. ranlib=:
  4921. enable dos_paths
  4922. ;;
  4923. cygwin*)
  4924. target_os=cygwin
  4925. shlibdir_default="$bindir_default"
  4926. SLIBPREF="cyg"
  4927. SLIBSUF=".dll"
  4928. SLIBNAME_WITH_VERSION='$(SLIBPREF)$(FULLNAME)-$(LIBVERSION)$(SLIBSUF)'
  4929. SLIBNAME_WITH_MAJOR='$(SLIBPREF)$(FULLNAME)-$(LIBMAJOR)$(SLIBSUF)'
  4930. SLIB_INSTALL_NAME='$(SLIBNAME_WITH_MAJOR)'
  4931. SLIB_INSTALL_LINKS=
  4932. SLIB_INSTALL_EXTRA_LIB='lib$(FULLNAME).dll.a'
  4933. SHFLAGS='-shared -Wl,--out-implib,$(SUBDIR)lib$(FULLNAME).dll.a'
  4934. enabled x86_64 && objformat="win64" || objformat="win32"
  4935. enable dos_paths
  4936. enabled shared && ! enabled small && test_cmd $windres --version && enable gnu_windres
  4937. add_cppflags -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600
  4938. ;;
  4939. *-dos|freedos|opendos)
  4940. network_extralibs="-lsocket"
  4941. objformat="coff"
  4942. enable dos_paths
  4943. ;;
  4944. linux)
  4945. enable section_data_rel_ro
  4946. enabled_any arm aarch64 && enable_weak linux_perf
  4947. ;;
  4948. irix*)
  4949. target_os=irix
  4950. ranlib="echo ignoring ranlib"
  4951. ;;
  4952. os/2*)
  4953. strip="lxlite -CS"
  4954. striptype=""
  4955. objformat="aout"
  4956. add_cppflags -D_GNU_SOURCE
  4957. add_ldflags -Zomf -Zbin-files -Zargs-wild -Zhigh-mem -Zmap
  4958. SHFLAGS='$(SUBDIR)$(NAME).def -Zdll -Zomf'
  4959. LIBSUF="_s.a"
  4960. SLIBPREF=""
  4961. SLIBSUF=".dll"
  4962. SLIBNAME_WITH_VERSION='$(SLIBPREF)$(FULLNAME)-$(LIBVERSION)$(SLIBSUF)'
  4963. SLIBNAME_WITH_MAJOR='$(SLIBPREF)$(shell echo $(FULLNAME) | cut -c1-6)$(LIBMAJOR)$(SLIBSUF)'
  4964. SLIB_CREATE_DEF_CMD='echo LIBRARY $(SLIBNAME_WITH_MAJOR:$(SLIBSUF)=) INITINSTANCE TERMINSTANCE > $(SUBDIR)$(FULLNAME).def; \
  4965. echo CODE PRELOAD MOVEABLE DISCARDABLE >> $(SUBDIR)$(FULLNAME).def; \
  4966. echo DATA PRELOAD MOVEABLE MULTIPLE NONSHARED >> $(SUBDIR)$(FULLNAME).def; \
  4967. echo EXPORTS >> $(SUBDIR)$(FULLNAME).def; \
  4968. emxexp $(OBJS) >> $(SUBDIR)$(FULLNAME).def'
  4969. SLIB_EXTRA_CMD='emximp -o $(SUBDIR)$(LIBPREF)$(FULLNAME)_dll.a $(SUBDIR)$(FULLNAME).def; \
  4970. emximp -o $(SUBDIR)$(LIBPREF)$(FULLNAME)_dll.lib $(SUBDIR)$(FULLNAME).def;'
  4971. SLIB_INSTALL_NAME='$(SLIBNAME_WITH_MAJOR)'
  4972. SLIB_INSTALL_LINKS=
  4973. SLIB_INSTALL_EXTRA_LIB='$(LIBPREF)$(FULLNAME)_dll.a $(LIBPREF)$(FULLNAME)_dll.lib'
  4974. enable dos_paths
  4975. enable_weak os2threads
  4976. ;;
  4977. gnu/kfreebsd)
  4978. add_cppflags -D_BSD_SOURCE
  4979. ;;
  4980. gnu)
  4981. ;;
  4982. qnx)
  4983. add_cppflags -D_QNX_SOURCE
  4984. network_extralibs="-lsocket"
  4985. ;;
  4986. symbian)
  4987. SLIBSUF=".dll"
  4988. enable dos_paths
  4989. add_cflags --include=$sysinclude/gcce/gcce.h -fvisibility=default
  4990. add_cppflags -D__GCCE__ -D__SYMBIAN32__ -DSYMBIAN_OE_POSIX_SIGNALS
  4991. add_ldflags -Wl,--target1-abs,--no-undefined \
  4992. -Wl,-Ttext,0x80000,-Tdata,0x1000000 -shared \
  4993. -Wl,--entry=_E32Startup -Wl,-u,_E32Startup
  4994. add_extralibs -l:eexe.lib -l:usrt2_2.lib -l:dfpaeabi.dso \
  4995. -l:drtaeabi.dso -l:scppnwdl.dso -lsupc++ -lgcc \
  4996. -l:libc.dso -l:libm.dso -l:euser.dso -l:libcrt0.lib
  4997. ;;
  4998. minix)
  4999. ;;
  5000. none)
  5001. ;;
  5002. *)
  5003. die "Unknown OS '$target_os'."
  5004. ;;
  5005. esac
  5006. # test if creating links works
  5007. link_dest=$(mktemp -u $TMPDIR/dest_XXXXXXXX)
  5008. link_name=$(mktemp -u $TMPDIR/name_XXXXXXXX)
  5009. mkdir "$link_dest"
  5010. $ln_s "$link_dest" "$link_name"
  5011. touch "$link_dest/test_file"
  5012. if [ "$source_path" != "." ] && [ "$source_path" != "src" ] && ([ ! -d src ] || [ -L src ]) && [ -e "$link_name/test_file" ]; then
  5013. # create link to source path
  5014. [ -e src ] && rm src
  5015. $ln_s "$source_path" src
  5016. source_link=src
  5017. else
  5018. # creating directory links doesn't work
  5019. # fall back to using the full source path
  5020. source_link="$source_path"
  5021. fi
  5022. # cleanup
  5023. rm -r "$link_dest"
  5024. rm -r "$link_name"
  5025. # determine libc flavour
  5026. probe_libc(){
  5027. pfx=$1
  5028. pfx_no_=${pfx%_}
  5029. # uclibc defines __GLIBC__, so it needs to be checked before glibc.
  5030. if test_${pfx}cpp_condition features.h "defined __UCLIBC__"; then
  5031. eval ${pfx}libc_type=uclibc
  5032. add_${pfx}cppflags -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600
  5033. elif test_${pfx}cpp_condition features.h "defined __GLIBC__"; then
  5034. eval ${pfx}libc_type=glibc
  5035. add_${pfx}cppflags -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600
  5036. # MinGW headers can be installed on Cygwin, so check for newlib first.
  5037. elif test_${pfx}cpp_condition newlib.h "defined _NEWLIB_VERSION"; then
  5038. eval ${pfx}libc_type=newlib
  5039. add_${pfx}cppflags -U__STRICT_ANSI__ -D_XOPEN_SOURCE=600
  5040. # MinGW64 is backwards compatible with MinGW32, so check for it first.
  5041. elif test_${pfx}cpp_condition _mingw.h "defined __MINGW64_VERSION_MAJOR"; then
  5042. eval ${pfx}libc_type=mingw64
  5043. if test_${pfx}cpp_condition _mingw.h "__MINGW64_VERSION_MAJOR < 3"; then
  5044. add_compat msvcrt/snprintf.o
  5045. add_cflags "-include $source_path/compat/msvcrt/snprintf.h"
  5046. fi
  5047. add_${pfx}cppflags -U__STRICT_ANSI__ -D__USE_MINGW_ANSI_STDIO=1
  5048. eval test \$${pfx_no_}cc_type = "gcc" &&
  5049. add_${pfx}cppflags -D__printf__=__gnu_printf__
  5050. test_${pfx}cpp_condition windows.h "!defined(_WIN32_WINNT) || _WIN32_WINNT < 0x0600" &&
  5051. add_${pfx}cppflags -D_WIN32_WINNT=0x0600
  5052. add_${pfx}cppflags -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600
  5053. elif test_${pfx}cpp_condition _mingw.h "defined __MINGW_VERSION" ||
  5054. test_${pfx}cpp_condition _mingw.h "defined __MINGW32_VERSION"; then
  5055. eval ${pfx}libc_type=mingw32
  5056. test_${pfx}cpp_condition _mingw.h "__MINGW32_MAJOR_VERSION > 3 || \
  5057. (__MINGW32_MAJOR_VERSION == 3 && __MINGW32_MINOR_VERSION >= 15)" ||
  5058. die "ERROR: MinGW32 runtime version must be >= 3.15."
  5059. add_${pfx}cppflags -U__STRICT_ANSI__ -D__USE_MINGW_ANSI_STDIO=1
  5060. test_${pfx}cpp_condition _mingw.h "__MSVCRT_VERSION__ < 0x0700" &&
  5061. add_${pfx}cppflags -D__MSVCRT_VERSION__=0x0700
  5062. test_${pfx}cpp_condition windows.h "!defined(_WIN32_WINNT) || _WIN32_WINNT < 0x0600" &&
  5063. add_${pfx}cppflags -D_WIN32_WINNT=0x0600
  5064. eval test \$${pfx_no_}cc_type = "gcc" &&
  5065. add_${pfx}cppflags -D__printf__=__gnu_printf__
  5066. add_${pfx}cppflags -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600
  5067. elif test_${pfx}cpp_condition crtversion.h "defined _VC_CRT_MAJOR_VERSION"; then
  5068. eval ${pfx}libc_type=msvcrt
  5069. if test_${pfx}cpp_condition crtversion.h "_VC_CRT_MAJOR_VERSION < 14"; then
  5070. if [ "$pfx" = host_ ]; then
  5071. add_host_cppflags -Dsnprintf=_snprintf
  5072. else
  5073. add_compat strtod.o strtod=avpriv_strtod
  5074. add_compat msvcrt/snprintf.o snprintf=avpriv_snprintf \
  5075. _snprintf=avpriv_snprintf \
  5076. vsnprintf=avpriv_vsnprintf
  5077. fi
  5078. fi
  5079. add_${pfx}cppflags -D_USE_MATH_DEFINES -D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_WARNINGS
  5080. # The MSVC 2010 headers (Win 7.0 SDK) set _WIN32_WINNT to
  5081. # 0x601 by default unless something else is set by the user.
  5082. # This can easily lead to us detecting functions only present
  5083. # in such new versions and producing binaries requiring windows 7.0.
  5084. # Therefore explicitly set the default to Vista unless the user has
  5085. # set something else on the command line.
  5086. # Don't do this if WINAPI_FAMILY is set and is set to a non-desktop
  5087. # family. For these cases, configure is free to use any functions
  5088. # found in the SDK headers by default. (Alternatively, we could force
  5089. # _WIN32_WINNT to 0x0602 in that case.)
  5090. test_${pfx}cpp_condition stdlib.h "defined(_WIN32_WINNT)" ||
  5091. { test_${pfx}cpp <<EOF && add_${pfx}cppflags -D_WIN32_WINNT=0x0600; }
  5092. #ifdef WINAPI_FAMILY
  5093. #include <winapifamily.h>
  5094. #if !WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
  5095. #error not desktop
  5096. #endif
  5097. #endif
  5098. EOF
  5099. if [ "$pfx" = "" ]; then
  5100. check_func strtoll || add_cflags -Dstrtoll=_strtoi64
  5101. check_func strtoull || add_cflags -Dstrtoull=_strtoui64
  5102. fi
  5103. elif test_${pfx}cpp_condition stddef.h "defined __KLIBC__"; then
  5104. eval ${pfx}libc_type=klibc
  5105. elif test_${pfx}cpp_condition sys/cdefs.h "defined __BIONIC__"; then
  5106. eval ${pfx}libc_type=bionic
  5107. elif test_${pfx}cpp_condition sys/brand.h "defined LABELED_BRAND_NAME"; then
  5108. eval ${pfx}libc_type=solaris
  5109. add_${pfx}cppflags -D__EXTENSIONS__ -D_XOPEN_SOURCE=600
  5110. elif test_${pfx}cpp_condition sys/version.h "defined __DJGPP__"; then
  5111. eval ${pfx}libc_type=djgpp
  5112. add_cppflags -U__STRICT_ANSI__
  5113. add_cflags "-include $source_path/compat/djgpp/math.h"
  5114. add_compat djgpp/math.o
  5115. fi
  5116. test_${pfx}cc <<EOF
  5117. #include <time.h>
  5118. void *v = localtime_r;
  5119. EOF
  5120. 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
  5121. #include <time.h>
  5122. void *v = localtime_r;
  5123. EOF
  5124. eval test -n "\${${pfx}libc_type}" && enable ${pfx}libc_${libc_type}
  5125. }
  5126. probe_libc
  5127. probe_libc host_
  5128. # hacks for compiler/libc/os combinations
  5129. case $libc_type in
  5130. bionic)
  5131. add_compat strtod.o strtod=avpriv_strtod
  5132. ;;
  5133. esac
  5134. check_compile_assert flt_lim "float.h limits.h" "DBL_MAX == (double)DBL_MAX" ||
  5135. add_cppflags '-I\$(SRC_PATH)/compat/float'
  5136. test_cpp_condition stdlib.h "defined(__PIC__) || defined(__pic__) || defined(PIC)" && enable_weak pic
  5137. set_default libdir
  5138. : ${shlibdir_default:="$libdir"}
  5139. : ${pkgconfigdir_default:="$libdir/pkgconfig"}
  5140. set_default $PATHS_LIST
  5141. set_default nm
  5142. disabled optimizations || enabled ossfuzz || check_cflags -fomit-frame-pointer
  5143. enable_weak_pic() {
  5144. disabled pic && return
  5145. enable pic
  5146. add_cppflags -DPIC
  5147. case "$target_os" in
  5148. mingw*|cygwin*|win*)
  5149. ;;
  5150. *)
  5151. add_cflags -fPIC
  5152. add_asflags -fPIC
  5153. ;;
  5154. esac
  5155. }
  5156. enabled pic && enable_weak_pic
  5157. test_cc <<EOF || die "Symbol mangling check failed."
  5158. int ff_extern;
  5159. EOF
  5160. sym=$($nm $TMPO | awk '/ff_extern/{ print substr($0, match($0, /[^ \t]*ff_extern/)) }')
  5161. extern_prefix=${sym%%ff_extern*}
  5162. ! disabled inline_asm && check_inline_asm inline_asm '"" ::'
  5163. for restrict_keyword in restrict __restrict__ __restrict ""; do
  5164. test_code cc "" "char * $restrict_keyword p" && break
  5165. done
  5166. check_cc pragma_deprecated "" '_Pragma("GCC diagnostic ignored \"-Wdeprecated-declarations\"")'
  5167. # The global variable ensures the bits appear unchanged in the object file.
  5168. test_cc <<EOF || die "endian test failed"
  5169. unsigned int endian = 'B' << 24 | 'I' << 16 | 'G' << 8 | 'E';
  5170. EOF
  5171. od -t x1 $TMPO | grep -q '42 *49 *47 *45' && enable bigendian
  5172. check_cc const_nan math.h "struct { double d; } static const bar[] = { { NAN } }"
  5173. if ! enabled ppc64 || enabled bigendian; then
  5174. disable vsx
  5175. fi
  5176. check_gas() {
  5177. log "check_gas using '$as' as AS"
  5178. # :vararg is used on aarch64, arm and ppc altivec
  5179. check_as vararg "
  5180. .macro m n, y:vararg=0
  5181. \n: .int \y
  5182. .endm
  5183. m x" || return 1
  5184. # .altmacro is only used in arm asm
  5185. ! enabled arm || check_as gnu_as ".altmacro"
  5186. }
  5187. if enabled_any arm aarch64 || enabled_all ppc altivec && enabled asm; then
  5188. nogas=:
  5189. enabled_any arm aarch64 && nogas=die
  5190. enabled_all ppc altivec && [ $target_os_default != aix ] && nogas=warn
  5191. as_noop=-v
  5192. case $as_type in
  5193. arm*) gaspp_as_type=armasm; as_noop=-h ;;
  5194. gcc) gaspp_as_type=gas ;;
  5195. *) gaspp_as_type=$as_type ;;
  5196. esac
  5197. [ $target_os = "darwin" ] && gaspp_as_type="apple-$gaspp_as_type"
  5198. test "${as#*gas-preprocessor.pl}" != "$as" ||
  5199. test_cmd gas-preprocessor.pl -arch $arch -as-type $gaspp_as_type -- ${as:=$cc} $as_noop &&
  5200. gas="${gas:=gas-preprocessor.pl} -arch $arch -as-type $gaspp_as_type -- ${as:=$cc}"
  5201. if ! check_gas ; then
  5202. as=${gas:=$as}
  5203. check_gas || \
  5204. $nogas "GNU assembler not found, install/update gas-preprocessor"
  5205. fi
  5206. check_as as_func ".func test
  5207. .endfunc"
  5208. fi
  5209. check_inline_asm inline_asm_labels '"1:\n"'
  5210. check_inline_asm inline_asm_nonlocal_labels '"Label:\n"'
  5211. if enabled aarch64; then
  5212. enabled armv8 && check_insn armv8 'prfm pldl1strm, [x0]'
  5213. # internal assembler in clang 3.3 does not support this instruction
  5214. enabled neon && check_insn neon 'ext v0.8B, v0.8B, v1.8B, #1'
  5215. enabled vfp && check_insn vfp 'fmadd d0, d0, d1, d2'
  5216. map 'enabled_any ${v}_external ${v}_inline || disable $v' $ARCH_EXT_LIST_ARM
  5217. elif enabled alpha; then
  5218. check_cflags -mieee
  5219. elif enabled arm; then
  5220. enabled msvc && check_cpp_condition thumb stddef.h "defined _M_ARMT"
  5221. test_cpp_condition stddef.h "defined __thumb__" && test_cc <<EOF && enable_weak thumb
  5222. float func(float a, float b){ return a+b; }
  5223. EOF
  5224. enabled thumb && check_cflags -mthumb || check_cflags -marm
  5225. if check_cpp_condition vfp_args stddef.h "defined __ARM_PCS_VFP"; then
  5226. :
  5227. elif check_cpp_condition vfp_args stddef.h "defined _M_ARM_FP && _M_ARM_FP >= 30"; then
  5228. :
  5229. elif ! test_cpp_condition stddef.h "defined __ARM_PCS || defined __SOFTFP__" && [ $target_os != darwin ]; then
  5230. case "${cross_prefix:-$cc}" in
  5231. *hardfloat*) enable vfp_args; fpabi=vfp ;;
  5232. *) check_ld "cc" vfp_args <<EOF && fpabi=vfp || fpabi=soft ;;
  5233. __asm__ (".eabi_attribute 28, 1");
  5234. int main(void) { return 0; }
  5235. EOF
  5236. esac
  5237. warn "Compiler does not indicate floating-point ABI, guessing $fpabi."
  5238. fi
  5239. enabled armv5te && check_insn armv5te 'qadd r0, r0, r0'
  5240. enabled armv6 && check_insn armv6 'sadd16 r0, r0, r0'
  5241. enabled armv6t2 && check_insn armv6t2 'movt r0, #0'
  5242. enabled neon && check_insn neon 'vadd.i16 q0, q0, q0'
  5243. enabled vfp && check_insn vfp 'fadds s0, s0, s0'
  5244. enabled vfpv3 && check_insn vfpv3 'vmov.f32 s0, #1.0'
  5245. enabled setend && check_insn setend 'setend be'
  5246. [ $target_os = linux ] || [ $target_os = android ] ||
  5247. map 'enabled_any ${v}_external ${v}_inline || disable $v' \
  5248. $ARCH_EXT_LIST_ARM
  5249. check_inline_asm asm_mod_q '"add r0, %Q0, %R0" :: "r"((long long)0)'
  5250. check_as as_arch_directive ".arch armv7-a"
  5251. check_as as_dn_directive "ra .dn d0.i16"
  5252. check_as as_fpu_directive ".fpu neon"
  5253. # llvm's integrated assembler supports .object_arch from llvm 3.5
  5254. [ "$objformat" = elf32 ] || [ "$objformat" = elf64 ] &&
  5255. check_as as_object_arch ".object_arch armv4"
  5256. # MS armasm fails to assemble our PIC constructs
  5257. [ $target_os != win32 ] && enabled_all armv6t2 shared !pic && enable_weak_pic
  5258. elif enabled mips; then
  5259. enabled loongson2 && check_inline_asm loongson2 '"dmult.g $8, $9, $10"'
  5260. enabled loongson3 && check_inline_asm loongson3 '"gsldxc1 $f0, 0($2, $3)"'
  5261. enabled mmi && check_inline_asm mmi '"punpcklhw $f0, $f0, $f0"'
  5262. # Enable minimum ISA based on selected options
  5263. if enabled mips64; then
  5264. enabled mips64r6 && check_inline_asm_flags mips64r6 '"dlsa $0, $0, $0, 1"' '-mips64r6'
  5265. enabled mips64r2 && check_inline_asm_flags mips64r2 '"dext $0, $0, 0, 1"' '-mips64r2'
  5266. disabled mips64r6 && disabled mips64r2 && check_inline_asm_flags mips64r1 '"daddi $0, $0, 0"' '-mips64'
  5267. else
  5268. enabled mips32r6 && check_inline_asm_flags mips32r6 '"aui $0, $0, 0"' '-mips32r6'
  5269. enabled mips32r5 && check_inline_asm_flags mips32r5 '"eretnc"' '-mips32r5'
  5270. enabled mips32r2 && check_inline_asm_flags mips32r2 '"ext $0, $0, 0, 1"' '-mips32r2'
  5271. disabled mips32r6 && disabled mips32r5 && disabled mips32r2 && check_inline_asm_flags mips32r1 '"addi $0, $0, 0"' '-mips32'
  5272. fi
  5273. enabled mipsfpu && check_inline_asm_flags mipsfpu '"cvt.d.l $f0, $f2"' '-mhard-float'
  5274. enabled mipsfpu && (enabled mips32r5 || enabled mips32r6 || enabled mips64r6) && check_inline_asm_flags mipsfpu '"cvt.d.l $f0, $f1"' '-mfp64'
  5275. enabled mipsfpu && enabled msa && check_inline_asm_flags msa '"addvi.b $w0, $w1, 1"' '-mmsa' && check_headers msa.h || disable msa
  5276. enabled mipsdsp && check_inline_asm_flags mipsdsp '"addu.qb $t0, $t1, $t2"' '-mdsp'
  5277. enabled mipsdspr2 && check_inline_asm_flags mipsdspr2 '"absq_s.qb $t0, $t1"' '-mdspr2'
  5278. if enabled bigendian && enabled msa; then
  5279. disable msa
  5280. fi
  5281. elif enabled parisc; then
  5282. if enabled gcc; then
  5283. case $($cc -dumpversion) in
  5284. 4.[3-9].*) check_cflags -fno-optimize-sibling-calls ;;
  5285. esac
  5286. fi
  5287. elif enabled ppc; then
  5288. enable local_aligned
  5289. check_inline_asm dcbzl '"dcbzl 0, %0" :: "r"(0)'
  5290. check_inline_asm ibm_asm '"add 0, 0, 0"'
  5291. check_inline_asm ppc4xx '"maclhw r10, r11, r12"'
  5292. check_inline_asm xform_asm '"lwzx %1, %y0" :: "Z"(*(int*)0), "r"(0)'
  5293. if enabled altivec; then
  5294. check_cflags -maltivec -mabi=altivec
  5295. # check if our compiler supports Motorola AltiVec C API
  5296. check_cc altivec altivec.h "vector signed int v1 = (vector signed int) { 0 };
  5297. vector signed int v2 = (vector signed int) { 1 };
  5298. v1 = vec_add(v1, v2);"
  5299. enabled altivec || warn "Altivec disabled, possibly missing --cpu flag"
  5300. fi
  5301. if enabled vsx; then
  5302. check_cflags -mvsx &&
  5303. check_cc vsx altivec.h "int v[4] = { 0 };
  5304. vector signed int v1 = vec_vsx_ld(0, v);"
  5305. fi
  5306. if enabled power8; then
  5307. check_cpp_condition power8 "altivec.h" "defined(_ARCH_PWR8)"
  5308. fi
  5309. elif enabled x86; then
  5310. check_builtin rdtsc intrin.h "__rdtsc()"
  5311. check_builtin mm_empty mmintrin.h "_mm_empty()"
  5312. enable local_aligned
  5313. # check whether EBP is available on x86
  5314. # As 'i' is stored on the stack, this program will crash
  5315. # if the base pointer is used to access it because the
  5316. # base pointer is cleared in the inline assembly code.
  5317. check_exec_crash <<EOF && enable ebp_available
  5318. volatile int i=0;
  5319. __asm__ volatile ("xorl %%ebp, %%ebp" ::: "%ebp");
  5320. return i;
  5321. EOF
  5322. # check whether EBX is available on x86
  5323. check_inline_asm ebx_available '""::"b"(0)' &&
  5324. check_inline_asm ebx_available '"":::"%ebx"'
  5325. # check whether xmm clobbers are supported
  5326. check_inline_asm xmm_clobbers '"":::"%xmm0"'
  5327. check_inline_asm inline_asm_direct_symbol_refs '"movl '$extern_prefix'test, %eax"' ||
  5328. check_inline_asm inline_asm_direct_symbol_refs '"movl '$extern_prefix'test(%rip), %eax"'
  5329. # check whether binutils is new enough to compile SSSE3/MMXEXT
  5330. enabled ssse3 && check_inline_asm ssse3_inline '"pabsw %xmm0, %xmm0"'
  5331. enabled mmxext && check_inline_asm mmxext_inline '"pmaxub %mm0, %mm1"'
  5332. probe_x86asm(){
  5333. x86asmexe_probe=$1
  5334. if test_cmd $x86asmexe_probe -v; then
  5335. x86asmexe=$x86asmexe_probe
  5336. x86asm_type=nasm
  5337. x86asm_debug="-g -F dwarf"
  5338. X86ASMDEP=
  5339. X86ASM_DEPFLAGS='-MD $(@:.o=.d)'
  5340. elif test_cmd $x86asmexe_probe --version; then
  5341. x86asmexe=$x86asmexe_probe
  5342. x86asm_type=yasm
  5343. x86asm_debug="-g dwarf2"
  5344. X86ASMDEP='$(DEPX86ASM) $(X86ASMFLAGS) -M $(X86ASM_O) $< > $(@:.o=.d)'
  5345. X86ASM_DEPFLAGS=
  5346. fi
  5347. check_x86asm x86asm "movbe ecx, [5]"
  5348. }
  5349. if ! disabled_any asm mmx x86asm; then
  5350. disable x86asm
  5351. for program in $x86asmexe nasm yasm; do
  5352. probe_x86asm $program && break
  5353. done
  5354. disabled x86asm && die "nasm/yasm not found or too old. Use --disable-x86asm for a crippled build."
  5355. X86ASMFLAGS="-f $objformat"
  5356. enabled pic && append X86ASMFLAGS "-DPIC"
  5357. test -n "$extern_prefix" && append X86ASMFLAGS "-DPREFIX"
  5358. case "$objformat" in
  5359. elf*) enabled debug && append X86ASMFLAGS $x86asm_debug ;;
  5360. esac
  5361. check_x86asm avx512_external "vmovdqa32 [eax]{k1}{z}, zmm0"
  5362. check_x86asm avx2_external "vextracti128 xmm0, ymm0, 0"
  5363. check_x86asm xop_external "vpmacsdd xmm0, xmm1, xmm2, xmm3"
  5364. check_x86asm fma4_external "vfmaddps ymm0, ymm1, ymm2, ymm3"
  5365. check_x86asm cpunop "CPU amdnop"
  5366. fi
  5367. case "$cpu" in
  5368. athlon*|opteron*|k8*|pentium|pentium-mmx|prescott|nocona|atom|geode)
  5369. disable fast_clz
  5370. ;;
  5371. esac
  5372. fi
  5373. check_cc intrinsics_neon arm_neon.h "int16x8_t test = vdupq_n_s16(0)"
  5374. check_ldflags -Wl,--as-needed
  5375. check_ldflags -Wl,-z,noexecstack
  5376. if ! disabled network; then
  5377. check_func getaddrinfo $network_extralibs
  5378. check_func inet_aton $network_extralibs
  5379. check_type netdb.h "struct addrinfo"
  5380. check_type netinet/in.h "struct group_source_req" -D_BSD_SOURCE
  5381. check_type netinet/in.h "struct ip_mreq_source" -D_BSD_SOURCE
  5382. check_type netinet/in.h "struct ipv6_mreq" -D_DARWIN_C_SOURCE
  5383. check_type poll.h "struct pollfd"
  5384. check_type netinet/sctp.h "struct sctp_event_subscribe"
  5385. check_struct "sys/socket.h" "struct msghdr" msg_flags
  5386. check_struct "sys/types.h sys/socket.h" "struct sockaddr" sa_len
  5387. check_type netinet/in.h "struct sockaddr_in6"
  5388. check_type "sys/types.h sys/socket.h" "struct sockaddr_storage"
  5389. check_type "sys/types.h sys/socket.h" socklen_t
  5390. # Prefer arpa/inet.h over winsock2
  5391. if check_headers arpa/inet.h ; then
  5392. check_func closesocket
  5393. elif check_headers winsock2.h ; then
  5394. check_func_headers winsock2.h closesocket -lws2 &&
  5395. network_extralibs="-lws2" ||
  5396. { check_func_headers winsock2.h closesocket -lws2_32 &&
  5397. network_extralibs="-lws2_32"; } || disable winsock2_h network
  5398. check_func_headers ws2tcpip.h getaddrinfo $network_extralibs
  5399. check_type ws2tcpip.h socklen_t
  5400. check_type ws2tcpip.h "struct addrinfo"
  5401. check_type ws2tcpip.h "struct group_source_req"
  5402. check_type ws2tcpip.h "struct ip_mreq_source"
  5403. check_type ws2tcpip.h "struct ipv6_mreq"
  5404. check_type winsock2.h "struct pollfd"
  5405. check_struct winsock2.h "struct sockaddr" sa_len
  5406. check_type ws2tcpip.h "struct sockaddr_in6"
  5407. check_type ws2tcpip.h "struct sockaddr_storage"
  5408. else
  5409. disable network
  5410. fi
  5411. fi
  5412. check_builtin atomic_cas_ptr atomic.h "void **ptr; void *oldval, *newval; atomic_cas_ptr(ptr, oldval, newval)"
  5413. check_builtin machine_rw_barrier mbarrier.h "__machine_rw_barrier()"
  5414. check_builtin MemoryBarrier windows.h "MemoryBarrier()"
  5415. check_builtin sync_val_compare_and_swap "" "int *ptr; int oldval, newval; __sync_val_compare_and_swap(ptr, oldval, newval)"
  5416. check_builtin gmtime_r time.h "time_t *time; struct tm *tm; gmtime_r(time, tm)"
  5417. check_builtin localtime_r time.h "time_t *time; struct tm *tm; localtime_r(time, tm)"
  5418. check_builtin x264_csp_bgr "stdint.h x264.h" "X264_CSP_BGR"
  5419. case "$custom_allocator" in
  5420. jemalloc)
  5421. # jemalloc by default does not use a prefix
  5422. require libjemalloc jemalloc/jemalloc.h malloc -ljemalloc
  5423. ;;
  5424. tcmalloc)
  5425. require_pkg_config libtcmalloc libtcmalloc gperftools/tcmalloc.h tc_malloc
  5426. malloc_prefix=tc_
  5427. ;;
  5428. esac
  5429. check_func_headers malloc.h _aligned_malloc && enable aligned_malloc
  5430. check_func ${malloc_prefix}memalign && enable memalign
  5431. check_func ${malloc_prefix}posix_memalign && enable posix_memalign
  5432. check_func access
  5433. check_func_headers stdlib.h arc4random
  5434. check_lib clock_gettime time.h clock_gettime || check_lib clock_gettime time.h clock_gettime -lrt
  5435. check_func fcntl
  5436. check_func fork
  5437. check_func gethrtime
  5438. check_func getopt
  5439. check_func getrusage
  5440. check_func gettimeofday
  5441. check_func isatty
  5442. check_func mkstemp
  5443. check_func mmap
  5444. check_func mprotect
  5445. # Solaris has nanosleep in -lrt, OpenSolaris no longer needs that
  5446. check_func_headers time.h nanosleep || check_lib nanosleep time.h nanosleep -lrt
  5447. check_func sched_getaffinity
  5448. check_func setrlimit
  5449. check_struct "sys/stat.h" "struct stat" st_mtim.tv_nsec -D_BSD_SOURCE
  5450. check_func strerror_r
  5451. check_func sysconf
  5452. check_func sysctl
  5453. check_func usleep
  5454. check_func_headers conio.h kbhit
  5455. check_func_headers io.h setmode
  5456. check_func_headers lzo/lzo1x.h lzo1x_999_compress
  5457. check_func_headers mach/mach_time.h mach_absolute_time
  5458. check_func_headers stdlib.h getenv
  5459. check_func_headers sys/stat.h lstat
  5460. check_func_headers windows.h GetProcessAffinityMask
  5461. check_func_headers windows.h GetProcessTimes
  5462. check_func_headers windows.h GetSystemTimeAsFileTime
  5463. check_func_headers windows.h LoadLibrary
  5464. check_func_headers windows.h MapViewOfFile
  5465. check_func_headers windows.h PeekNamedPipe
  5466. check_func_headers windows.h SetConsoleTextAttribute
  5467. check_func_headers windows.h SetConsoleCtrlHandler
  5468. check_func_headers windows.h Sleep
  5469. check_func_headers windows.h VirtualAlloc
  5470. check_func_headers glob.h glob
  5471. enabled xlib &&
  5472. check_lib xlib "X11/Xlib.h X11/extensions/Xvlib.h" XvGetPortAttribute -lXv -lX11 -lXext
  5473. check_headers direct.h
  5474. check_headers dirent.h
  5475. check_headers dxgidebug.h
  5476. check_headers dxva.h
  5477. check_headers dxva2api.h -D_WIN32_WINNT=0x0600
  5478. check_headers io.h
  5479. check_headers linux/perf_event.h
  5480. check_headers libcrystalhd/libcrystalhd_if.h
  5481. check_headers malloc.h
  5482. check_headers net/udplite.h
  5483. check_headers poll.h
  5484. check_headers sys/param.h
  5485. check_headers sys/resource.h
  5486. check_headers sys/select.h
  5487. check_headers sys/time.h
  5488. check_headers sys/un.h
  5489. check_headers termios.h
  5490. check_headers unistd.h
  5491. check_headers valgrind/valgrind.h
  5492. check_func_headers VideoToolbox/VTCompressionSession.h VTCompressionSessionPrepareToEncodeFrames -framework VideoToolbox
  5493. check_headers windows.h
  5494. check_headers X11/extensions/XvMClib.h
  5495. check_headers asm/types.h
  5496. # it seems there are versions of clang in some distros that try to use the
  5497. # gcc headers, which explodes for stdatomic
  5498. # so we also check that atomics actually work here
  5499. check_builtin stdatomic stdatomic.h "atomic_int foo, bar = ATOMIC_VAR_INIT(-1); atomic_store(&foo, 0); foo += bar"
  5500. check_lib advapi32 "windows.h" RegCloseKey -ladvapi32
  5501. check_lib bcrypt "windows.h bcrypt.h" BCryptGenRandom -lbcrypt &&
  5502. check_cpp_condition bcrypt bcrypt.h "defined BCRYPT_RNG_ALGORITHM"
  5503. check_lib ole32 "windows.h" CoTaskMemFree -lole32
  5504. check_lib shell32 "windows.h shellapi.h" CommandLineToArgvW -lshell32
  5505. check_lib psapi "windows.h psapi.h" GetProcessMemoryInfo -lpsapi
  5506. check_lib android android/native_window.h ANativeWindow_acquire -landroid
  5507. check_lib mediandk "stdint.h media/NdkImage.h" AImage_delete -lmediandk
  5508. check_lib camera2ndk "stdbool.h stdint.h camera/NdkCameraManager.h" ACameraManager_create -lcamera2ndk
  5509. enabled appkit && check_apple_framework AppKit
  5510. enabled audiotoolbox && check_apple_framework AudioToolbox
  5511. enabled avfoundation && check_apple_framework AVFoundation
  5512. enabled coreimage && check_apple_framework CoreImage
  5513. enabled videotoolbox && check_apple_framework VideoToolbox
  5514. check_apple_framework CoreFoundation
  5515. check_apple_framework CoreMedia
  5516. check_apple_framework CoreVideo
  5517. enabled avfoundation && {
  5518. disable coregraphics applicationservices
  5519. check_lib coregraphics CoreGraphics/CoreGraphics.h CGGetActiveDisplayList "-framework CoreGraphics" ||
  5520. check_lib applicationservices ApplicationServices/ApplicationServices.h CGGetActiveDisplayList "-framework ApplicationServices"; }
  5521. enabled videotoolbox && {
  5522. check_lib coreservices CoreServices/CoreServices.h UTGetOSTypeFromString "-framework CoreServices"
  5523. check_func_headers CoreMedia/CMFormatDescription.h kCMVideoCodecType_HEVC "-framework CoreMedia"
  5524. check_func_headers CoreVideo/CVPixelBuffer.h kCVPixelFormatType_420YpCbCr10BiPlanarVideoRange "-framework CoreVideo"
  5525. }
  5526. check_struct "sys/time.h sys/resource.h" "struct rusage" ru_maxrss
  5527. check_type "windows.h dxva.h" "DXVA_PicParams_HEVC" -DWINAPI_FAMILY=WINAPI_FAMILY_DESKTOP_APP -D_CRT_BUILD_DESKTOP_APP=0
  5528. check_type "windows.h dxva.h" "DXVA_PicParams_VP9" -DWINAPI_FAMILY=WINAPI_FAMILY_DESKTOP_APP -D_CRT_BUILD_DESKTOP_APP=0
  5529. check_type "windows.h d3d11.h" "ID3D11VideoDecoder"
  5530. check_type "windows.h d3d11.h" "ID3D11VideoContext"
  5531. check_type "d3d9.h dxva2api.h" DXVA2_ConfigPictureDecode -D_WIN32_WINNT=0x0602
  5532. check_type "vdpau/vdpau.h" "VdpPictureInfoHEVC"
  5533. if enabled cuda_sdk; then
  5534. warn "Option --enable-cuda-sdk is deprecated. Use --enable-cuda-nvcc instead."
  5535. enable cuda_nvcc
  5536. fi
  5537. if ! disabled ffnvcodec; then
  5538. ffnv_hdr_list="ffnvcodec/nvEncodeAPI.h ffnvcodec/dynlink_cuda.h ffnvcodec/dynlink_cuviddec.h ffnvcodec/dynlink_nvcuvid.h"
  5539. check_pkg_config ffnvcodec "ffnvcodec >= 9.0.18.0" "$ffnv_hdr_list" "" || \
  5540. check_pkg_config ffnvcodec "ffnvcodec >= 8.2.15.8 ffnvcodec < 8.3" "$ffnv_hdr_list" "" || \
  5541. check_pkg_config ffnvcodec "ffnvcodec >= 8.1.24.9 ffnvcodec < 8.2" "$ffnv_hdr_list" "" || \
  5542. check_pkg_config ffnvcodec "ffnvcodec >= 8.0.14.9 ffnvcodec < 8.1" "$ffnv_hdr_list" ""
  5543. fi
  5544. check_cpp_condition winrt windows.h "!WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)"
  5545. if ! disabled w32threads && ! enabled pthreads; then
  5546. check_func_headers "windows.h process.h" _beginthreadex &&
  5547. check_type "windows.h" CONDITION_VARIABLE &&
  5548. check_type "windows.h" INIT_ONCE &&
  5549. enable w32threads || disable w32threads
  5550. if ! enabled w32threads && enabled winrt; then
  5551. check_func_headers "windows.h" CreateThread &&
  5552. enable w32threads || disable w32threads
  5553. fi
  5554. fi
  5555. # check for some common methods of building with pthread support
  5556. # do this before the optional library checks as some of them require pthreads
  5557. if ! disabled pthreads && ! enabled w32threads && ! enabled os2threads; then
  5558. if check_lib pthreads pthread.h pthread_join -pthread &&
  5559. check_lib pthreads pthread.h pthread_create -pthread; then
  5560. add_cflags -pthread
  5561. elif check_lib pthreads pthread.h pthread_join -pthreads &&
  5562. check_lib pthreads pthread.h pthread_create -pthreads; then
  5563. add_cflags -pthreads
  5564. elif check_lib pthreads pthread.h pthread_join -ldl -pthread &&
  5565. check_lib pthreads pthread.h pthread_create -ldl -pthread; then
  5566. add_cflags -ldl -pthread
  5567. elif check_lib pthreads pthread.h pthread_join -lpthreadGC2 &&
  5568. check_lib pthreads pthread.h pthread_create -lpthreadGC2; then
  5569. :
  5570. elif check_lib pthreads pthread.h pthread_join -lpthread &&
  5571. check_lib pthreads pthread.h pthread_create -lpthread; then
  5572. :
  5573. elif check_func pthread_join && check_func pthread_create; then
  5574. enable pthreads
  5575. fi
  5576. check_cc pthreads "pthread.h" "static pthread_mutex_t atomic_lock = PTHREAD_MUTEX_INITIALIZER"
  5577. if enabled pthreads; then
  5578. check_builtin sem_timedwait semaphore.h "sem_t *s; sem_init(s,0,0); sem_timedwait(s,0); sem_destroy(s)" $pthreads_extralibs
  5579. check_func pthread_cancel $pthreads_extralibs
  5580. fi
  5581. fi
  5582. enabled zlib && { check_pkg_config zlib zlib "zlib.h" zlibVersion ||
  5583. check_lib zlib zlib.h zlibVersion -lz; }
  5584. enabled bzlib && check_lib bzlib bzlib.h BZ2_bzlibVersion -lbz2
  5585. enabled lzma && check_lib lzma lzma.h lzma_version_number -llzma
  5586. # On some systems dynamic loading requires no extra linker flags
  5587. check_lib libdl dlfcn.h "dlopen dlsym" || check_lib libdl dlfcn.h "dlopen dlsym" -ldl
  5588. check_lib libm math.h sin -lm
  5589. atan2f_args=2
  5590. copysign_args=2
  5591. hypot_args=2
  5592. ldexpf_args=2
  5593. powf_args=2
  5594. for func in $MATH_FUNCS; do
  5595. eval check_mathfunc $func \${${func}_args:-1} $libm_extralibs
  5596. done
  5597. for func in $COMPLEX_FUNCS; do
  5598. eval check_complexfunc $func \${${func}_args:-1}
  5599. done
  5600. # these are off by default, so fail if requested and not available
  5601. enabled cuda_nvcc && { check_nvcc || die "ERROR: failed checking for nvcc."; }
  5602. enabled chromaprint && require chromaprint chromaprint.h chromaprint_get_version -lchromaprint
  5603. enabled decklink && { require_headers DeckLinkAPI.h &&
  5604. { test_cpp_condition DeckLinkAPIVersion.h "BLACKMAGIC_DECKLINK_API_VERSION >= 0x0a090500" || die "ERROR: Decklink API version must be >= 10.9.5."; } }
  5605. enabled frei0r && require_headers "frei0r.h dlfcn.h"
  5606. enabled gmp && require gmp gmp.h mpz_export -lgmp
  5607. enabled gnutls && require_pkg_config gnutls gnutls gnutls/gnutls.h gnutls_global_init
  5608. enabled jni && { [ $target_os = "android" ] && check_headers jni.h && enabled pthreads || die "ERROR: jni not found"; }
  5609. enabled ladspa && require_headers "ladspa.h dlfcn.h"
  5610. enabled libaom && require_pkg_config libaom "aom >= 1.0.0" aom/aom_codec.h aom_codec_version
  5611. enabled libaribb24 && { check_pkg_config libaribb24 "aribb24 > 1.0.3" "aribb24/aribb24.h" arib_instance_new ||
  5612. { enabled gpl && require_pkg_config libaribb24 aribb24 "aribb24/aribb24.h" arib_instance_new; } ||
  5613. die "ERROR: libaribb24 requires version higher than 1.0.3 or --enable-gpl."; }
  5614. enabled lv2 && require_pkg_config lv2 lilv-0 "lilv/lilv.h" lilv_world_new
  5615. enabled libiec61883 && require libiec61883 libiec61883/iec61883.h iec61883_cmp_connect -lraw1394 -lavc1394 -lrom1394 -liec61883
  5616. enabled libass && require_pkg_config libass libass ass/ass.h ass_library_init
  5617. enabled libbluray && require_pkg_config libbluray libbluray libbluray/bluray.h bd_open
  5618. enabled libbs2b && require_pkg_config libbs2b libbs2b bs2b.h bs2b_open
  5619. enabled libcelt && require libcelt celt/celt.h celt_decode -lcelt0 &&
  5620. { check_lib libcelt celt/celt.h celt_decoder_create_custom -lcelt0 ||
  5621. die "ERROR: libcelt must be installed and version must be >= 0.11.0."; }
  5622. enabled libcaca && require_pkg_config libcaca caca caca.h caca_create_canvas
  5623. enabled libcodec2 && require libcodec2 codec2/codec2.h codec2_create -lcodec2
  5624. enabled libdav1d && require_pkg_config libdav1d "dav1d >= 0.2.1" "dav1d/dav1d.h" dav1d_version
  5625. enabled libdavs2 && require_pkg_config libdavs2 "davs2 >= 1.6.0" davs2.h davs2_decoder_open
  5626. enabled libdc1394 && require_pkg_config libdc1394 libdc1394-2 dc1394/dc1394.h dc1394_new
  5627. enabled libdrm && require_pkg_config libdrm libdrm xf86drm.h drmGetVersion
  5628. enabled libfdk_aac && { check_pkg_config libfdk_aac fdk-aac "fdk-aac/aacenc_lib.h" aacEncOpen ||
  5629. { require libfdk_aac fdk-aac/aacenc_lib.h aacEncOpen -lfdk-aac &&
  5630. warn "using libfdk without pkg-config"; } }
  5631. 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"
  5632. enabled libflite && require libflite "flite/flite.h" flite_init $flite_extralibs
  5633. enabled fontconfig && enable libfontconfig
  5634. enabled libfontconfig && require_pkg_config libfontconfig fontconfig "fontconfig/fontconfig.h" FcInit
  5635. enabled libfreetype && require_pkg_config libfreetype freetype2 "ft2build.h FT_FREETYPE_H" FT_Init_FreeType
  5636. enabled libfribidi && require_pkg_config libfribidi fribidi fribidi.h fribidi_version_info
  5637. enabled libgme && { check_pkg_config libgme libgme gme/gme.h gme_new_emu ||
  5638. require libgme gme/gme.h gme_new_emu -lgme -lstdc++; }
  5639. enabled libgsm && { for gsm_hdr in "gsm.h" "gsm/gsm.h"; do
  5640. check_lib libgsm "${gsm_hdr}" gsm_create -lgsm && break;
  5641. done || die "ERROR: libgsm not found"; }
  5642. enabled libilbc && require libilbc ilbc.h WebRtcIlbcfix_InitDecode -lilbc $pthreads_extralibs
  5643. enabled libklvanc && require libklvanc libklvanc/vanc.h klvanc_context_create -lklvanc
  5644. enabled libkvazaar && require_pkg_config libkvazaar "kvazaar >= 0.8.1" kvazaar.h kvz_api_get
  5645. enabled liblensfun && require_pkg_config liblensfun lensfun lensfun.h lf_db_new
  5646. # While it may appear that require is being used as a pkg-config
  5647. # fallback for libmfx, it is actually being used to detect a different
  5648. # installation route altogether. If libmfx is installed via the Intel
  5649. # Media SDK or Intel Media Server Studio, these don't come with
  5650. # pkg-config support. Instead, users should make sure that the build
  5651. # can find the libraries and headers through other means.
  5652. enabled libmfx && { check_pkg_config libmfx libmfx "mfx/mfxvideo.h" MFXInit ||
  5653. { require libmfx "mfx/mfxvideo.h" MFXInit "-llibmfx $advapi32_extralibs" && warn "using libmfx without pkg-config"; } }
  5654. enabled libmodplug && require_pkg_config libmodplug libmodplug libmodplug/modplug.h ModPlug_Load
  5655. enabled libmp3lame && require "libmp3lame >= 3.98.3" lame/lame.h lame_set_VBR_quality -lmp3lame $libm_extralibs
  5656. enabled libmysofa && { check_pkg_config libmysofa libmysofa mysofa.h mysofa_load ||
  5657. require libmysofa mysofa.h mysofa_load -lmysofa $zlib_extralibs; }
  5658. enabled libnpp && { check_lib libnpp npp.h nppGetLibVersion -lnppig -lnppicc -lnppc -lnppidei ||
  5659. check_lib libnpp npp.h nppGetLibVersion -lnppi -lnppc -lnppidei ||
  5660. die "ERROR: libnpp not found"; }
  5661. enabled libopencore_amrnb && require libopencore_amrnb opencore-amrnb/interf_dec.h Decoder_Interface_init -lopencore-amrnb
  5662. enabled libopencore_amrwb && require libopencore_amrwb opencore-amrwb/dec_if.h D_IF_init -lopencore-amrwb
  5663. enabled libopencv && { check_headers opencv2/core/core_c.h &&
  5664. { check_pkg_config libopencv opencv opencv2/core/core_c.h cvCreateImageHeader ||
  5665. require libopencv opencv2/core/core_c.h cvCreateImageHeader -lopencv_core -lopencv_imgproc; } ||
  5666. require_pkg_config libopencv opencv opencv/cxcore.h cvCreateImageHeader; }
  5667. enabled libopenh264 && require_pkg_config libopenh264 openh264 wels/codec_api.h WelsGetCodecVersion
  5668. enabled libopenjpeg && { check_pkg_config libopenjpeg "libopenjp2 >= 2.1.0" openjpeg.h opj_version ||
  5669. { require_pkg_config libopenjpeg "libopenjp2 >= 2.1.0" openjpeg.h opj_version -DOPJ_STATIC && add_cppflags -DOPJ_STATIC; } }
  5670. enabled libopenmpt && require_pkg_config libopenmpt "libopenmpt >= 0.2.6557" libopenmpt/libopenmpt.h openmpt_module_create -lstdc++ && append libopenmpt_extralibs "-lstdc++"
  5671. enabled libopus && {
  5672. enabled libopus_decoder && {
  5673. require_pkg_config libopus opus opus_multistream.h opus_multistream_decoder_create
  5674. }
  5675. enabled libopus_encoder && {
  5676. require_pkg_config libopus opus opus_multistream.h opus_multistream_surround_encoder_create
  5677. }
  5678. }
  5679. enabled libpulse && require_pkg_config libpulse libpulse pulse/pulseaudio.h pa_context_new
  5680. enabled librsvg && require_pkg_config librsvg librsvg-2.0 librsvg-2.0/librsvg/rsvg.h rsvg_handle_render_cairo
  5681. enabled librtmp && require_pkg_config librtmp librtmp librtmp/rtmp.h RTMP_Socket
  5682. enabled librubberband && require_pkg_config librubberband "rubberband >= 1.8.1" rubberband/rubberband-c.h rubberband_new -lstdc++ && append librubberband_extralibs "-lstdc++"
  5683. enabled libshine && require_pkg_config libshine shine shine/layer3.h shine_encode_buffer
  5684. enabled libsmbclient && { check_pkg_config libsmbclient smbclient libsmbclient.h smbc_init ||
  5685. require libsmbclient libsmbclient.h smbc_init -lsmbclient; }
  5686. enabled libsnappy && require libsnappy snappy-c.h snappy_compress -lsnappy -lstdc++
  5687. enabled libsoxr && require libsoxr soxr.h soxr_create -lsoxr
  5688. enabled libssh && require_pkg_config libssh libssh libssh/sftp.h sftp_init
  5689. enabled libspeex && require_pkg_config libspeex speex speex/speex.h speex_decoder_init
  5690. enabled libsrt && require_pkg_config libsrt "srt >= 1.3.0" srt/srt.h srt_socket
  5691. enabled libtensorflow && require libtensorflow tensorflow/c/c_api.h TF_Version -ltensorflow
  5692. enabled libtesseract && require_pkg_config libtesseract tesseract tesseract/capi.h TessBaseAPICreate
  5693. enabled libtheora && require libtheora theora/theoraenc.h th_info_init -ltheoraenc -ltheoradec -logg
  5694. enabled libtls && require_pkg_config libtls libtls tls.h tls_configure
  5695. enabled libtwolame && require libtwolame twolame.h twolame_init -ltwolame &&
  5696. { check_lib libtwolame twolame.h twolame_encode_buffer_float32_interleaved -ltwolame ||
  5697. die "ERROR: libtwolame must be installed and version must be >= 0.3.10"; }
  5698. enabled libv4l2 && require_pkg_config libv4l2 libv4l2 libv4l2.h v4l2_ioctl
  5699. enabled libvidstab && require_pkg_config libvidstab "vidstab >= 0.98" vid.stab/libvidstab.h vsMotionDetectInit
  5700. enabled libvmaf && require_pkg_config libvmaf "libvmaf >= 1.3.9" libvmaf.h compute_vmaf
  5701. enabled libvo_amrwbenc && require libvo_amrwbenc vo-amrwbenc/enc_if.h E_IF_init -lvo-amrwbenc
  5702. enabled libvorbis && require_pkg_config libvorbis vorbis vorbis/codec.h vorbis_info_init &&
  5703. require_pkg_config libvorbisenc vorbisenc vorbis/vorbisenc.h vorbis_encode_init
  5704. enabled libvpx && {
  5705. enabled libvpx_vp8_decoder && {
  5706. check_pkg_config libvpx_vp8_decoder "vpx >= 1.4.0" "vpx/vpx_decoder.h vpx/vp8dx.h" vpx_codec_vp8_dx ||
  5707. 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"
  5708. }
  5709. enabled libvpx_vp8_encoder && {
  5710. check_pkg_config libvpx_vp8_encoder "vpx >= 1.4.0" "vpx/vpx_encoder.h vpx/vp8cx.h" vpx_codec_vp8_cx ||
  5711. 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"
  5712. }
  5713. enabled libvpx_vp9_decoder && {
  5714. check_pkg_config libvpx_vp9_decoder "vpx >= 1.4.0" "vpx/vpx_decoder.h vpx/vp8dx.h" vpx_codec_vp9_dx ||
  5715. 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"
  5716. }
  5717. enabled libvpx_vp9_encoder && {
  5718. check_pkg_config libvpx_vp9_encoder "vpx >= 1.4.0" "vpx/vpx_encoder.h vpx/vp8cx.h" vpx_codec_vp9_cx ||
  5719. 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"
  5720. }
  5721. if disabled_all libvpx_vp8_decoder libvpx_vp9_decoder libvpx_vp8_encoder libvpx_vp9_encoder; then
  5722. die "libvpx enabled but no supported decoders found"
  5723. fi
  5724. }
  5725. enabled libwavpack && require libwavpack wavpack/wavpack.h WavpackOpenFileOutput -lwavpack
  5726. enabled libwebp && {
  5727. enabled libwebp_encoder && require_pkg_config libwebp "libwebp >= 0.2.0" webp/encode.h WebPGetEncoderVersion
  5728. enabled libwebp_anim_encoder && check_pkg_config libwebp_anim_encoder "libwebpmux >= 0.4.0" webp/mux.h WebPAnimEncoderOptionsInit; }
  5729. enabled libx264 && { check_pkg_config libx264 x264 "stdint.h x264.h" x264_encoder_encode ||
  5730. { require libx264 "stdint.h x264.h" x264_encoder_encode "-lx264 $pthreads_extralibs $libm_extralibs" &&
  5731. warn "using libx264 without pkg-config"; } } &&
  5732. require_cpp_condition libx264 x264.h "X264_BUILD >= 118" &&
  5733. check_cpp_condition libx262 x264.h "X264_MPEG2"
  5734. enabled libx265 && require_pkg_config libx265 x265 x265.h x265_api_get &&
  5735. require_cpp_condition libx265 x265.h "X265_BUILD >= 68"
  5736. enabled libxavs && require libxavs "stdint.h xavs.h" xavs_encoder_encode "-lxavs $pthreads_extralibs $libm_extralibs"
  5737. enabled libxavs2 && require_pkg_config libxavs2 "xavs2 >= 1.3.0" "stdint.h xavs2.h" xavs2_api_get
  5738. enabled libxvid && require libxvid xvid.h xvid_global -lxvidcore
  5739. enabled libzimg && require_pkg_config libzimg "zimg >= 2.7.0" zimg.h zimg_get_api_version
  5740. enabled libzmq && require_pkg_config libzmq libzmq zmq.h zmq_ctx_new
  5741. enabled libzvbi && require_pkg_config libzvbi zvbi-0.2 libzvbi.h vbi_decoder_new &&
  5742. { test_cpp_condition libzvbi.h "VBI_VERSION_MAJOR > 0 || VBI_VERSION_MINOR > 2 || VBI_VERSION_MINOR == 2 && VBI_VERSION_MICRO >= 28" ||
  5743. enabled gpl || die "ERROR: libzvbi requires version 0.2.28 or --enable-gpl."; }
  5744. enabled libxml2 && require_pkg_config libxml2 libxml-2.0 libxml2/libxml/xmlversion.h xmlCheckVersion
  5745. enabled mbedtls && { check_pkg_config mbedtls mbedtls mbedtls/x509_crt.h mbedtls_x509_crt_init ||
  5746. check_pkg_config mbedtls mbedtls mbedtls/ssl.h mbedtls_ssl_init ||
  5747. check_lib mbedtls mbedtls/ssl.h mbedtls_ssl_init -lmbedtls -lmbedx509 -lmbedcrypto ||
  5748. die "ERROR: mbedTLS not found"; }
  5749. enabled mediacodec && { enabled jni || die "ERROR: mediacodec requires --enable-jni"; }
  5750. enabled mmal && { check_lib mmal interface/mmal/mmal.h mmal_port_connect -lmmal_core -lmmal_util -lmmal_vc_client -lbcm_host ||
  5751. { ! enabled cross_compile &&
  5752. add_cflags -isystem/opt/vc/include/ -isystem/opt/vc/include/interface/vmcs_host/linux -isystem/opt/vc/include/interface/vcos/pthreads -fgnu89-inline &&
  5753. add_ldflags -L/opt/vc/lib/ &&
  5754. check_lib mmal interface/mmal/mmal.h mmal_port_connect -lmmal_core -lmmal_util -lmmal_vc_client -lbcm_host; } ||
  5755. die "ERROR: mmal not found" &&
  5756. check_func_headers interface/mmal/mmal.h "MMAL_PARAMETER_VIDEO_MAX_NUM_CALLBACKS"; }
  5757. enabled openal && { { for al_extralibs in "${OPENAL_LIBS}" "-lopenal" "-lOpenAL32"; do
  5758. check_lib openal 'AL/al.h' alGetError "${al_extralibs}" && break; done } ||
  5759. die "ERROR: openal not found"; } &&
  5760. { test_cpp_condition "AL/al.h" "defined(AL_VERSION_1_1)" ||
  5761. die "ERROR: openal must be installed and version must be 1.1 or compatible"; }
  5762. enabled opencl && { check_pkg_config opencl OpenCL CL/cl.h clEnqueueNDRangeKernel ||
  5763. check_lib opencl OpenCL/cl.h clEnqueueNDRangeKernel -Wl,-framework,OpenCL ||
  5764. check_lib opencl CL/cl.h clEnqueueNDRangeKernel -lOpenCL ||
  5765. die "ERROR: opencl not found"; } &&
  5766. { test_cpp_condition "OpenCL/cl.h" "defined(CL_VERSION_1_2)" ||
  5767. test_cpp_condition "CL/cl.h" "defined(CL_VERSION_1_2)" ||
  5768. die "ERROR: opencl must be installed and version must be 1.2 or compatible"; }
  5769. enabled opengl && { check_lib opengl GL/glx.h glXGetProcAddress "-lGL" ||
  5770. check_lib opengl windows.h wglGetProcAddress "-lopengl32 -lgdi32" ||
  5771. check_lib opengl OpenGL/gl3.h glGetError "-Wl,-framework,OpenGL" ||
  5772. check_lib opengl ES2/gl.h glGetError "-isysroot=${sysroot} -Wl,-framework,OpenGLES" ||
  5773. die "ERROR: opengl not found."
  5774. }
  5775. enabled omx && require_headers OMX_Core.h
  5776. enabled omx_rpi && { check_headers OMX_Core.h ||
  5777. { ! enabled cross_compile && add_cflags -isystem/opt/vc/include/IL && check_headers OMX_Core.h ; } ||
  5778. die "ERROR: OpenMAX IL headers not found"; } && enable omx
  5779. enabled openssl && { check_pkg_config openssl openssl openssl/ssl.h OPENSSL_init_ssl ||
  5780. check_pkg_config openssl openssl openssl/ssl.h SSL_library_init ||
  5781. check_lib openssl openssl/ssl.h SSL_library_init -lssl -lcrypto ||
  5782. check_lib openssl openssl/ssl.h SSL_library_init -lssl32 -leay32 ||
  5783. check_lib openssl openssl/ssl.h SSL_library_init -lssl -lcrypto -lws2_32 -lgdi32 ||
  5784. die "ERROR: openssl not found"; }
  5785. enabled rkmpp && { require_pkg_config rkmpp rockchip_mpp rockchip/rk_mpi.h mpp_create &&
  5786. require_pkg_config rockchip_mpp "rockchip_mpp >= 1.3.7" rockchip/rk_mpi.h mpp_create &&
  5787. { enabled libdrm ||
  5788. die "ERROR: rkmpp requires --enable-libdrm"; }
  5789. }
  5790. enabled vapoursynth && require_pkg_config vapoursynth "vapoursynth-script >= 42" VSScript.h vsscript_init
  5791. if enabled gcrypt; then
  5792. GCRYPT_CONFIG="${cross_prefix}libgcrypt-config"
  5793. if "${GCRYPT_CONFIG}" --version > /dev/null 2>&1; then
  5794. gcrypt_cflags=$("${GCRYPT_CONFIG}" --cflags)
  5795. gcrypt_extralibs=$("${GCRYPT_CONFIG}" --libs)
  5796. check_func_headers gcrypt.h gcry_mpi_new $gcrypt_cflags $gcrypt_extralibs ||
  5797. die "ERROR: gcrypt not found"
  5798. add_cflags $gcrypt_cflags
  5799. else
  5800. require gcrypt gcrypt.h gcry_mpi_new -lgcrypt
  5801. fi
  5802. fi
  5803. if enabled sdl2; then
  5804. SDL2_CONFIG="${cross_prefix}sdl2-config"
  5805. test_pkg_config sdl2 "sdl2 >= 2.0.1 sdl2 < 2.1.0" SDL_events.h SDL_PollEvent
  5806. if disabled sdl2 && "${SDL2_CONFIG}" --version > /dev/null 2>&1; then
  5807. sdl2_cflags=$("${SDL2_CONFIG}" --cflags)
  5808. sdl2_extralibs=$("${SDL2_CONFIG}" --libs)
  5809. test_cpp_condition SDL.h "(SDL_MAJOR_VERSION<<16 | SDL_MINOR_VERSION<<8 | SDL_PATCHLEVEL) >= 0x020001" $sdl2_cflags &&
  5810. test_cpp_condition SDL.h "(SDL_MAJOR_VERSION<<16 | SDL_MINOR_VERSION<<8 | SDL_PATCHLEVEL) < 0x020100" $sdl2_cflags &&
  5811. check_func_headers SDL_events.h SDL_PollEvent $sdl2_extralibs $sdl2_cflags &&
  5812. enable sdl2
  5813. fi
  5814. if test $target_os = "mingw32"; then
  5815. sdl2_extralibs=$(filter_out '-mwindows' $sdl2_extralibs)
  5816. fi
  5817. fi
  5818. if enabled decklink; then
  5819. case $target_os in
  5820. mingw32*|mingw64*|win32|win64)
  5821. decklink_outdev_extralibs="$decklink_outdev_extralibs -lole32 -loleaut32"
  5822. decklink_indev_extralibs="$decklink_indev_extralibs -lole32 -loleaut32"
  5823. ;;
  5824. esac
  5825. fi
  5826. enabled securetransport &&
  5827. check_func SecIdentityCreate "-Wl,-framework,CoreFoundation -Wl,-framework,Security" &&
  5828. check_lib securetransport "Security/SecureTransport.h Security/Security.h" "SSLCreateContext" "-Wl,-framework,CoreFoundation -Wl,-framework,Security" ||
  5829. disable securetransport
  5830. enabled securetransport &&
  5831. check_func SecItemImport "-Wl,-framework,CoreFoundation -Wl,-framework,Security"
  5832. enabled schannel &&
  5833. check_func_headers "windows.h security.h" InitializeSecurityContext -DSECURITY_WIN32 -lsecur32 &&
  5834. test_cpp_condition winerror.h "defined(SEC_I_CONTEXT_EXPIRED)" &&
  5835. schannel_extralibs="-lsecur32" ||
  5836. disable schannel
  5837. makeinfo --version > /dev/null 2>&1 && enable makeinfo || disable makeinfo
  5838. enabled makeinfo \
  5839. && [ 0$(makeinfo --version | grep "texinfo" | sed 's/.*texinfo[^0-9]*\([0-9]*\)\..*/\1/') -ge 5 ] \
  5840. && enable makeinfo_html || disable makeinfo_html
  5841. disabled makeinfo_html && texi2html --help 2> /dev/null | grep -q 'init-file' && enable texi2html || disable texi2html
  5842. perl -v > /dev/null 2>&1 && enable perl || disable perl
  5843. pod2man --help > /dev/null 2>&1 && enable pod2man || disable pod2man
  5844. rsync --help 2> /dev/null | grep -q 'contimeout' && enable rsync_contimeout || disable rsync_contimeout
  5845. # check V4L2 codecs available in the API
  5846. check_headers linux/fb.h
  5847. check_headers linux/videodev2.h
  5848. test_code cc linux/videodev2.h "struct v4l2_frmsizeenum vfse; vfse.discrete.width = 0;" && enable_sanitized struct_v4l2_frmivalenum_discrete
  5849. check_cc v4l2_m2m linux/videodev2.h "int i = V4L2_CAP_VIDEO_M2M_MPLANE | V4L2_CAP_VIDEO_M2M | V4L2_BUF_FLAG_LAST;"
  5850. check_cc vc1_v4l2_m2m linux/videodev2.h "int i = V4L2_PIX_FMT_VC1_ANNEX_G;"
  5851. check_cc mpeg1_v4l2_m2m linux/videodev2.h "int i = V4L2_PIX_FMT_MPEG1;"
  5852. check_cc mpeg2_v4l2_m2m linux/videodev2.h "int i = V4L2_PIX_FMT_MPEG2;"
  5853. check_cc mpeg4_v4l2_m2m linux/videodev2.h "int i = V4L2_PIX_FMT_MPEG4;"
  5854. check_cc hevc_v4l2_m2m linux/videodev2.h "int i = V4L2_PIX_FMT_HEVC;"
  5855. check_cc h263_v4l2_m2m linux/videodev2.h "int i = V4L2_PIX_FMT_H263;"
  5856. check_cc h264_v4l2_m2m linux/videodev2.h "int i = V4L2_PIX_FMT_H264;"
  5857. check_cc vp8_v4l2_m2m linux/videodev2.h "int i = V4L2_PIX_FMT_VP8;"
  5858. check_cc vp9_v4l2_m2m linux/videodev2.h "int i = V4L2_PIX_FMT_VP9;"
  5859. check_headers sys/videoio.h
  5860. test_code cc sys/videoio.h "struct v4l2_frmsizeenum vfse; vfse.discrete.width = 0;" && enable_sanitized struct_v4l2_frmivalenum_discrete
  5861. check_lib user32 "windows.h winuser.h" GetShellWindow -luser32
  5862. check_lib vfw32 "windows.h vfw.h" capCreateCaptureWindow -lvfw32
  5863. # check that WM_CAP_DRIVER_CONNECT is defined to the proper value
  5864. # w32api 3.12 had it defined wrong
  5865. check_cpp_condition vfwcap_defines vfw.h "WM_CAP_DRIVER_CONNECT > WM_USER"
  5866. check_type "dshow.h" IBaseFilter
  5867. # check for ioctl_meteor.h, ioctl_bt848.h and alternatives
  5868. check_headers "dev/bktr/ioctl_meteor.h dev/bktr/ioctl_bt848.h" ||
  5869. check_headers "machine/ioctl_meteor.h machine/ioctl_bt848.h" ||
  5870. check_headers "dev/video/meteor/ioctl_meteor.h dev/video/bktr/ioctl_bt848.h" ||
  5871. check_headers "dev/ic/bt8xx.h"
  5872. if check_struct sys/soundcard.h audio_buf_info bytes; then
  5873. enable_sanitized sys/soundcard.h
  5874. else
  5875. test_cc -D__BSD_VISIBLE -D__XSI_VISIBLE <<EOF && add_cppflags -D__BSD_VISIBLE -D__XSI_VISIBLE && enable_sanitized sys/soundcard.h
  5876. #include <sys/soundcard.h>
  5877. audio_buf_info abc;
  5878. EOF
  5879. fi
  5880. enabled alsa && check_pkg_config alsa alsa "alsa/asoundlib.h" snd_pcm_htimestamp ||
  5881. check_lib alsa alsa/asoundlib.h snd_pcm_htimestamp -lasound
  5882. enabled libjack &&
  5883. require_pkg_config libjack jack jack/jack.h jack_port_get_latency_range
  5884. enabled sndio && check_lib sndio sndio.h sio_open -lsndio
  5885. if enabled libcdio; then
  5886. check_pkg_config libcdio libcdio_paranoia "cdio/cdda.h cdio/paranoia.h" cdio_cddap_open ||
  5887. check_pkg_config libcdio libcdio_paranoia "cdio/paranoia/cdda.h cdio/paranoia/paranoia.h" cdio_cddap_open ||
  5888. check_lib libcdio "cdio/cdda.h cdio/paranoia.h" cdio_cddap_open -lcdio_paranoia -lcdio_cdda -lcdio ||
  5889. check_lib libcdio "cdio/paranoia/cdda.h cdio/paranoia/paranoia.h" cdio_cddap_open -lcdio_paranoia -lcdio_cdda -lcdio ||
  5890. die "ERROR: No usable libcdio/cdparanoia found"
  5891. fi
  5892. enabled libxcb && check_pkg_config libxcb "xcb >= 1.4" xcb/xcb.h xcb_connect ||
  5893. disable libxcb_shm libxcb_shape libxcb_xfixes
  5894. if enabled libxcb; then
  5895. enabled libxcb_shm && check_pkg_config libxcb_shm xcb-shm xcb/shm.h xcb_shm_attach
  5896. enabled libxcb_shape && check_pkg_config libxcb_shape xcb-shape xcb/shape.h xcb_shape_get_rectangles
  5897. enabled libxcb_xfixes && check_pkg_config libxcb_xfixes xcb-xfixes xcb/xfixes.h xcb_xfixes_get_cursor_image
  5898. fi
  5899. check_func_headers "windows.h" CreateDIBSection "$gdigrab_indev_extralibs"
  5900. # d3d11va requires linking directly to dxgi and d3d11 if not building for
  5901. # the desktop api partition
  5902. test_cpp <<EOF && enable uwp && d3d11va_extralibs="-ldxgi -ld3d11"
  5903. #ifdef WINAPI_FAMILY
  5904. #include <winapifamily.h>
  5905. #if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
  5906. #error desktop, not uwp
  5907. #else
  5908. // WINAPI_FAMILY_APP, WINAPI_FAMILY_PHONE_APP => UWP
  5909. #endif
  5910. #else
  5911. #error no family set
  5912. #endif
  5913. EOF
  5914. enabled vaapi &&
  5915. check_pkg_config vaapi "libva >= 0.35.0" "va/va.h" vaInitialize
  5916. if enabled vaapi; then
  5917. check_pkg_config vaapi_drm "libva-drm" "va/va_drm.h" vaGetDisplayDRM
  5918. if enabled xlib; then
  5919. check_pkg_config vaapi_x11 "libva-x11" "va/va_x11.h" vaGetDisplay
  5920. fi
  5921. check_cpp_condition vaapi_1 "va/va.h" "VA_CHECK_VERSION(1, 0, 0)"
  5922. check_type "va/va.h va/va_dec_hevc.h" "VAPictureParameterBufferHEVC"
  5923. check_struct "va/va.h" "VADecPictureParameterBufferVP9" bit_depth
  5924. check_struct "va/va.h va/va_vpp.h" "VAProcPipelineCaps" rotation_flags
  5925. check_type "va/va.h va/va_enc_hevc.h" "VAEncPictureParameterBufferHEVC"
  5926. check_type "va/va.h va/va_enc_jpeg.h" "VAEncPictureParameterBufferJPEG"
  5927. check_type "va/va.h va/va_enc_vp8.h" "VAEncPictureParameterBufferVP8"
  5928. check_type "va/va.h va/va_enc_vp9.h" "VAEncPictureParameterBufferVP9"
  5929. fi
  5930. if enabled_all opencl libdrm ; then
  5931. check_type "CL/cl_intel.h" "clCreateImageFromFdINTEL_fn" &&
  5932. enable opencl_drm_beignet
  5933. check_func_headers "CL/cl_ext.h" clImportMemoryARM &&
  5934. enable opencl_drm_arm
  5935. fi
  5936. if enabled_all opencl vaapi ; then
  5937. if enabled opencl_drm_beignet ; then
  5938. enable opencl_vaapi_beignet
  5939. else
  5940. check_type "CL/cl.h CL/cl_va_api_media_sharing_intel.h" "clCreateFromVA_APIMediaSurfaceINTEL_fn" &&
  5941. enable opencl_vaapi_intel_media
  5942. fi
  5943. fi
  5944. if enabled_all opencl dxva2 ; then
  5945. check_type "CL/cl_dx9_media_sharing.h" cl_dx9_surface_info_khr &&
  5946. enable opencl_dxva2
  5947. fi
  5948. if enabled_all opencl d3d11va ; then
  5949. check_type "CL/cl_d3d11.h" clGetDeviceIDsFromD3D11KHR_fn &&
  5950. enable opencl_d3d11
  5951. fi
  5952. enabled vdpau &&
  5953. check_cpp_condition vdpau vdpau/vdpau.h "defined VDP_DECODER_PROFILE_MPEG4_PART2_ASP"
  5954. enabled vdpau &&
  5955. check_lib vdpau_x11 "vdpau/vdpau.h vdpau/vdpau_x11.h" vdp_device_create_x11 -lvdpau -lX11
  5956. enabled crystalhd && check_lib crystalhd "stdint.h libcrystalhd/libcrystalhd_if.h" DtsCrystalHDVersion -lcrystalhd
  5957. if enabled x86; then
  5958. case $target_os in
  5959. mingw32*|mingw64*|win32|win64|linux|cygwin*)
  5960. ;;
  5961. *)
  5962. disable ffnvcodec cuvid nvdec nvenc
  5963. ;;
  5964. esac
  5965. elif enabled ppc64 && ! enabled bigendian; then
  5966. case $target_os in
  5967. linux)
  5968. ;;
  5969. *)
  5970. disable ffnvcodec cuvid nvdec nvenc
  5971. ;;
  5972. esac
  5973. else
  5974. disable ffnvcodec cuvid nvdec nvenc
  5975. fi
  5976. enabled ffnvcodec && enable cuda
  5977. enabled nvenc &&
  5978. test_cc -I$source_path <<EOF || disable nvenc
  5979. #include <ffnvcodec/nvEncodeAPI.h>
  5980. NV_ENCODE_API_FUNCTION_LIST flist;
  5981. void f(void) { struct { const GUID guid; } s[] = { { NV_ENC_PRESET_HQ_GUID } }; }
  5982. int main(void) { return 0; }
  5983. EOF
  5984. enabled amf &&
  5985. check_cpp_condition amf "AMF/core/Version.h" \
  5986. "(AMF_VERSION_MAJOR << 48 | AMF_VERSION_MINOR << 32 | AMF_VERSION_RELEASE << 16 | AMF_VERSION_BUILD_NUM) >= 0x0001000400040001"
  5987. # Funny iconv installations are not unusual, so check it after all flags have been set
  5988. if enabled libc_iconv; then
  5989. check_func_headers iconv.h iconv
  5990. elif enabled iconv; then
  5991. check_func_headers iconv.h iconv || check_lib iconv iconv.h iconv -liconv
  5992. fi
  5993. enabled debug && add_cflags -g"$debuglevel" && add_asflags -g"$debuglevel"
  5994. # add some useful compiler flags if supported
  5995. check_cflags -Wdeclaration-after-statement
  5996. check_cflags -Wall
  5997. check_cflags -Wdisabled-optimization
  5998. check_cflags -Wpointer-arith
  5999. check_cflags -Wredundant-decls
  6000. check_cflags -Wwrite-strings
  6001. check_cflags -Wtype-limits
  6002. check_cflags -Wundef
  6003. check_cflags -Wmissing-prototypes
  6004. check_cflags -Wno-pointer-to-int-cast
  6005. check_cflags -Wstrict-prototypes
  6006. check_cflags -Wempty-body
  6007. if enabled extra_warnings; then
  6008. check_cflags -Wcast-qual
  6009. check_cflags -Wextra
  6010. check_cflags -Wpedantic
  6011. fi
  6012. check_disable_warning(){
  6013. warning_flag=-W${1#-Wno-}
  6014. test_cflags $unknown_warning_flags $warning_flag && add_cflags $1
  6015. }
  6016. test_cflags -Werror=unused-command-line-argument &&
  6017. append unknown_warning_flags "-Werror=unused-command-line-argument"
  6018. test_cflags -Werror=unknown-warning-option &&
  6019. append unknown_warning_flags "-Werror=unknown-warning-option"
  6020. check_disable_warning -Wno-parentheses
  6021. check_disable_warning -Wno-switch
  6022. check_disable_warning -Wno-format-zero-length
  6023. check_disable_warning -Wno-pointer-sign
  6024. check_disable_warning -Wno-unused-const-variable
  6025. check_disable_warning -Wno-bool-operation
  6026. check_disable_warning -Wno-char-subscripts
  6027. check_disable_warning_headers(){
  6028. warning_flag=-W${1#-Wno-}
  6029. test_cflags $warning_flag && add_cflags_headers $1
  6030. }
  6031. check_disable_warning_headers -Wno-deprecated-declarations
  6032. check_disable_warning_headers -Wno-unused-variable
  6033. test_cc <<EOF && enable blocks_extension
  6034. void (^block)(void);
  6035. EOF
  6036. # add some linker flags
  6037. check_ldflags -Wl,--warn-common
  6038. check_ldflags -Wl,-rpath-link=:libpostproc:libswresample:libswscale:libavfilter:libavdevice:libavformat:libavcodec:libavutil:libavresample
  6039. enabled rpath && add_ldexeflags -Wl,-rpath,$libdir && add_ldsoflags -Wl,-rpath,$libdir
  6040. test_ldflags -Wl,-Bsymbolic && append SHFLAGS -Wl,-Bsymbolic
  6041. # add some strip flags
  6042. check_stripflags -x
  6043. enabled neon_clobber_test &&
  6044. check_ldflags -Wl,--wrap,avcodec_open2 \
  6045. -Wl,--wrap,avcodec_decode_audio4 \
  6046. -Wl,--wrap,avcodec_decode_video2 \
  6047. -Wl,--wrap,avcodec_decode_subtitle2 \
  6048. -Wl,--wrap,avcodec_encode_audio2 \
  6049. -Wl,--wrap,avcodec_encode_video2 \
  6050. -Wl,--wrap,avcodec_encode_subtitle \
  6051. -Wl,--wrap,avcodec_send_packet \
  6052. -Wl,--wrap,avcodec_receive_packet \
  6053. -Wl,--wrap,avcodec_send_frame \
  6054. -Wl,--wrap,avcodec_receive_frame \
  6055. -Wl,--wrap,swr_convert \
  6056. -Wl,--wrap,avresample_convert ||
  6057. disable neon_clobber_test
  6058. enabled xmm_clobber_test &&
  6059. check_ldflags -Wl,--wrap,avcodec_open2 \
  6060. -Wl,--wrap,avcodec_decode_audio4 \
  6061. -Wl,--wrap,avcodec_decode_video2 \
  6062. -Wl,--wrap,avcodec_decode_subtitle2 \
  6063. -Wl,--wrap,avcodec_encode_audio2 \
  6064. -Wl,--wrap,avcodec_encode_video2 \
  6065. -Wl,--wrap,avcodec_encode_subtitle \
  6066. -Wl,--wrap,avcodec_send_packet \
  6067. -Wl,--wrap,avcodec_receive_packet \
  6068. -Wl,--wrap,avcodec_send_frame \
  6069. -Wl,--wrap,avcodec_receive_frame \
  6070. -Wl,--wrap,swr_convert \
  6071. -Wl,--wrap,avresample_convert \
  6072. -Wl,--wrap,sws_scale ||
  6073. disable xmm_clobber_test
  6074. check_ld "cc" proper_dce <<EOF
  6075. extern const int array[512];
  6076. static inline int func(void) { return array[0]; }
  6077. int main(void) { return 0; }
  6078. EOF
  6079. if enabled proper_dce; then
  6080. echo "X { local: *; };" > $TMPV
  6081. if test_ldflags -Wl,${version_script},$TMPV; then
  6082. append SHFLAGS '-Wl,${version_script},\$(SUBDIR)lib\$(NAME).ver'
  6083. quotes='""'
  6084. test_cc <<EOF && enable symver_asm_label
  6085. void ff_foo(void) __asm__ ("av_foo@VERSION");
  6086. void ff_foo(void) { ${inline_asm+__asm__($quotes);} }
  6087. EOF
  6088. test_cc <<EOF && enable symver_gnu_asm
  6089. __asm__(".symver ff_foo,av_foo@VERSION");
  6090. void ff_foo(void) {}
  6091. EOF
  6092. fi
  6093. fi
  6094. if [ -z "$optflags" ]; then
  6095. if enabled small; then
  6096. optflags=$cflags_size
  6097. elif enabled optimizations; then
  6098. optflags=$cflags_speed
  6099. else
  6100. optflags=$cflags_noopt
  6101. fi
  6102. fi
  6103. if [ -z "$nvccflags" ]; then
  6104. nvccflags=$nvccflags_default
  6105. fi
  6106. if enabled x86_64 || enabled ppc64 || enabled aarch64; then
  6107. nvccflags="$nvccflags -m64"
  6108. else
  6109. nvccflags="$nvccflags -m32"
  6110. fi
  6111. check_optflags(){
  6112. check_cflags "$@"
  6113. enabled lto && check_ldflags "$@"
  6114. }
  6115. check_optflags $optflags
  6116. check_optflags -fno-math-errno
  6117. check_optflags -fno-signed-zeros
  6118. if enabled lto; then
  6119. test "$cc_type" != "$ld_type" && die "LTO requires same compiler and linker"
  6120. check_cflags -flto
  6121. check_ldflags -flto $cpuflags
  6122. disable inline_asm_direct_symbol_refs
  6123. fi
  6124. enabled ftrapv && check_cflags -ftrapv
  6125. test_cc -mno-red-zone <<EOF && noredzone_flags="-mno-red-zone"
  6126. int x;
  6127. EOF
  6128. if enabled icc; then
  6129. # Just warnings, no remarks
  6130. check_cflags -w1
  6131. # -wd: Disable following warnings
  6132. # 144, 167, 556: -Wno-pointer-sign
  6133. # 188: enumerated type mixed with another type
  6134. # 1292: attribute "foo" ignored
  6135. # 1419: external declaration in primary source file
  6136. # 10006: ignoring unknown option -fno-signed-zeros
  6137. # 10148: ignoring unknown option -Wno-parentheses
  6138. # 10156: ignoring option '-W'; no argument required
  6139. # 13200: No EMMS instruction before call to function
  6140. # 13203: No EMMS instruction before return from function
  6141. check_cflags -wd144,167,188,556,1292,1419,10006,10148,10156,13200,13203
  6142. # 11030: Warning unknown option --as-needed
  6143. # 10156: ignoring option '-export'; no argument required
  6144. check_ldflags -wd10156,11030
  6145. # icc 11.0 and 11.1 work with ebp_available, but don't pass the test
  6146. enable ebp_available
  6147. # The test above does not test linking
  6148. enabled lto && disable symver_asm_label
  6149. if enabled x86_32; then
  6150. icc_version=$($cc -dumpversion)
  6151. test ${icc_version%%.*} -ge 11 &&
  6152. check_cflags -falign-stack=maintain-16-byte ||
  6153. disable aligned_stack
  6154. fi
  6155. elif enabled gcc; then
  6156. check_optflags -fno-tree-vectorize
  6157. check_cflags -Werror=format-security
  6158. check_cflags -Werror=implicit-function-declaration
  6159. check_cflags -Werror=missing-prototypes
  6160. check_cflags -Werror=return-type
  6161. check_cflags -Werror=vla
  6162. check_cflags -Wformat
  6163. check_cflags -fdiagnostics-color=auto
  6164. enabled extra_warnings || check_disable_warning -Wno-maybe-uninitialized
  6165. if enabled x86_32; then
  6166. case $target_os in
  6167. *bsd*)
  6168. # BSDs don't guarantee a 16 byte aligned stack, but we can
  6169. # request GCC to try to maintain 16 byte alignment throughout
  6170. # function calls. Library entry points that might call assembly
  6171. # functions align the stack. (The parameter means 2^4 bytes.)
  6172. check_cflags -mpreferred-stack-boundary=4
  6173. ;;
  6174. esac
  6175. fi
  6176. elif enabled llvm_gcc; then
  6177. check_cflags -mllvm -stack-alignment=16
  6178. elif enabled clang; then
  6179. if enabled x86_32; then
  6180. # Clang doesn't support maintaining alignment without assuming the
  6181. # same alignment in every function. If 16 byte alignment would be
  6182. # enabled, one would also have to either add attribute_align_arg on
  6183. # every single entry point into the libraries or enable -mstackrealign
  6184. # (doing stack realignment in every single function).
  6185. case $target_os in
  6186. mingw32|win32|*bsd*)
  6187. disable aligned_stack
  6188. ;;
  6189. *)
  6190. check_cflags -mllvm -stack-alignment=16
  6191. check_cflags -mstack-alignment=16
  6192. ;;
  6193. esac
  6194. else
  6195. check_cflags -mllvm -stack-alignment=16
  6196. check_cflags -mstack-alignment=16
  6197. fi
  6198. check_cflags -Qunused-arguments
  6199. check_cflags -Werror=implicit-function-declaration
  6200. check_cflags -Werror=missing-prototypes
  6201. check_cflags -Werror=return-type
  6202. elif enabled cparser; then
  6203. add_cflags -Wno-missing-variable-declarations
  6204. add_cflags -Wno-empty-statement
  6205. elif enabled armcc; then
  6206. add_cflags -W${armcc_opt},--diag_suppress=4343 # hardfp compat
  6207. add_cflags -W${armcc_opt},--diag_suppress=3036 # using . as system include dir
  6208. # 2523: use of inline assembly is deprecated
  6209. add_cflags -W${armcc_opt},--diag_suppress=2523
  6210. add_cflags -W${armcc_opt},--diag_suppress=1207
  6211. add_cflags -W${armcc_opt},--diag_suppress=1293 # assignment in condition
  6212. add_cflags -W${armcc_opt},--diag_suppress=3343 # hardfp compat
  6213. add_cflags -W${armcc_opt},--diag_suppress=167 # pointer sign
  6214. add_cflags -W${armcc_opt},--diag_suppress=513 # pointer sign
  6215. elif enabled pathscale; then
  6216. add_cflags -fstrict-overflow -OPT:wrap_around_unsafe_opt=OFF
  6217. disable inline_asm
  6218. elif enabled_any msvc icl; then
  6219. enabled x86_32 && disable aligned_stack
  6220. enabled_all x86_32 debug && add_cflags -Oy-
  6221. enabled debug && add_ldflags -debug
  6222. enable pragma_deprecated
  6223. if enabled icl; then
  6224. # -Qansi-alias is basically -fstrict-aliasing, but does not work
  6225. # (correctly) on icl 13.x.
  6226. test_cpp_condition "windows.h" "__ICL < 1300 || __ICL >= 1400" &&
  6227. add_cflags -Qansi-alias
  6228. # Some inline asm is not compilable in debug
  6229. if enabled debug; then
  6230. disable ebp_available
  6231. disable ebx_available
  6232. fi
  6233. fi
  6234. # msvcrt10 x64 incorrectly enables log2, only msvcrt12 (MSVC 2013) onwards actually has log2.
  6235. check_cpp_condition log2 crtversion.h "_VC_CRT_MAJOR_VERSION >= 12"
  6236. # The CRT headers contain __declspec(restrict) in a few places, but if redefining
  6237. # restrict, this might break. MSVC 2010 and 2012 fail with __declspec(__restrict)
  6238. # (as it ends up if the restrict redefine is done before including stdlib.h), while
  6239. # MSVC 2013 and newer can handle it fine.
  6240. # If this declspec fails, force including stdlib.h before the restrict redefinition
  6241. # happens in config.h.
  6242. if [ $restrict_keyword != restrict ]; then
  6243. test_cc <<EOF || add_cflags -FIstdlib.h
  6244. __declspec($restrict_keyword) void *foo(int);
  6245. EOF
  6246. fi
  6247. # the new SSA optimzer in VS2015 U3 is mis-optimizing some parts of the code
  6248. # Issue has been fixed in MSVC v19.00.24218.
  6249. test_cpp_condition windows.h "_MSC_FULL_VER >= 190024218" ||
  6250. check_cflags -d2SSAOptimizer-
  6251. # enable utf-8 source processing on VS2015 U2 and newer
  6252. test_cpp_condition windows.h "_MSC_FULL_VER >= 190023918" &&
  6253. add_cflags -utf-8
  6254. fi
  6255. for pfx in "" host_; do
  6256. varname=${pfx%_}cc_type
  6257. eval "type=\$$varname"
  6258. if [ "$type" = "msvc" ]; then
  6259. test_${pfx}cc <<EOF || add_${pfx}cflags -Dinline=__inline
  6260. static inline int foo(int a) { return a; }
  6261. EOF
  6262. fi
  6263. done
  6264. case $as_type in
  6265. clang)
  6266. add_asflags -Qunused-arguments
  6267. ;;
  6268. esac
  6269. case $ld_type in
  6270. clang)
  6271. check_ldflags -Qunused-arguments
  6272. ;;
  6273. esac
  6274. enable frame_thread_encoder
  6275. enabled asm || { arch=c; disable $ARCH_LIST $ARCH_EXT_LIST; }
  6276. check_deps $CONFIG_LIST \
  6277. $CONFIG_EXTRA \
  6278. $HAVE_LIST \
  6279. $ALL_COMPONENTS \
  6280. 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"
  6281. enabled avresample && warn "Building with deprecated library libavresample"
  6282. case $target_os in
  6283. haiku)
  6284. disable memalign
  6285. disable posix_memalign
  6286. ;;
  6287. *-dos|freedos|opendos)
  6288. if test_cpp_condition sys/version.h "defined(__DJGPP__) && __DJGPP__ == 2 && __DJGPP_MINOR__ == 5"; then
  6289. disable memalign
  6290. fi
  6291. ;;
  6292. esac
  6293. flatten_extralibs(){
  6294. nested_entries=
  6295. list_name=$1
  6296. eval list=\$${1}
  6297. for entry in $list; do
  6298. entry_copy=$entry
  6299. resolve entry_copy
  6300. flat_entries=
  6301. for e in $entry_copy; do
  6302. case $e in
  6303. *_extralibs) nested_entries="$nested_entries$e ";;
  6304. *) flat_entries="$flat_entries$e ";;
  6305. esac
  6306. done
  6307. eval $entry="\$flat_entries"
  6308. done
  6309. append $list_name "$nested_entries"
  6310. resolve nested_entries
  6311. if test -n "$(filter '*_extralibs' $nested_entries)"; then
  6312. flatten_extralibs $list_name
  6313. fi
  6314. }
  6315. flatten_extralibs_wrapper(){
  6316. list_name=$1
  6317. flatten_extralibs $list_name
  6318. unique $list_name
  6319. resolve $list_name
  6320. eval $list_name=\$\(\$ldflags_filter \$$list_name\)
  6321. eval printf \''%s'\' \""\$$list_name"\"
  6322. }
  6323. for linkunit in $LIBRARY_LIST; do
  6324. unset current_extralibs
  6325. eval components=\$$(toupper ${linkunit})_COMPONENTS_LIST
  6326. for comp in ${components}; do
  6327. enabled $comp || continue
  6328. comp_extralibs="${comp}_extralibs"
  6329. append current_extralibs $comp_extralibs
  6330. done
  6331. eval prepend ${linkunit}_extralibs $current_extralibs
  6332. done
  6333. for linkunit in $LIBRARY_LIST $PROGRAM_LIST $EXTRALIBS_LIST; do
  6334. eval ${linkunit}_extralibs=\$\(flatten_extralibs_wrapper ${linkunit}_extralibs\)
  6335. done
  6336. map 'enabled $v && intrinsics=${v#intrinsics_}' $INTRINSICS_LIST
  6337. for thread in $THREADS_LIST; do
  6338. if enabled $thread; then
  6339. test -n "$thread_type" &&
  6340. die "ERROR: Only one thread type must be selected." ||
  6341. thread_type="$thread"
  6342. fi
  6343. done
  6344. if disabled stdatomic; then
  6345. if enabled atomics_gcc; then
  6346. add_cppflags '-I\$(SRC_PATH)/compat/atomics/gcc'
  6347. elif enabled atomics_win32; then
  6348. add_cppflags '-I\$(SRC_PATH)/compat/atomics/win32'
  6349. elif enabled atomics_suncc; then
  6350. add_cppflags '-I\$(SRC_PATH)/compat/atomics/suncc'
  6351. elif enabled pthreads; then
  6352. add_compat atomics/pthread/stdatomic.o
  6353. add_cppflags '-I\$(SRC_PATH)/compat/atomics/pthread'
  6354. else
  6355. enabled threads && die "Threading is enabled, but no atomics are available"
  6356. add_cppflags '-I\$(SRC_PATH)/compat/atomics/dummy'
  6357. fi
  6358. fi
  6359. # Check if requested libraries were found.
  6360. for lib in $AUTODETECT_LIBS; do
  6361. requested $lib && ! enabled $lib && die "ERROR: $lib requested but not found";
  6362. done
  6363. enabled zlib && add_cppflags -DZLIB_CONST
  6364. # conditional library dependencies, in any order
  6365. enabled afftdn_filter && prepend avfilter_deps "avcodec"
  6366. enabled afftfilt_filter && prepend avfilter_deps "avcodec"
  6367. enabled afir_filter && prepend avfilter_deps "avcodec"
  6368. enabled amovie_filter && prepend avfilter_deps "avformat avcodec"
  6369. enabled aresample_filter && prepend avfilter_deps "swresample"
  6370. enabled atempo_filter && prepend avfilter_deps "avcodec"
  6371. enabled bm3d_filter && prepend avfilter_deps "avcodec"
  6372. enabled cover_rect_filter && prepend avfilter_deps "avformat avcodec"
  6373. enabled convolve_filter && prepend avfilter_deps "avcodec"
  6374. enabled deconvolve_filter && prepend avfilter_deps "avcodec"
  6375. enabled ebur128_filter && enabled swresample && prepend avfilter_deps "swresample"
  6376. enabled elbg_filter && prepend avfilter_deps "avcodec"
  6377. enabled fftfilt_filter && prepend avfilter_deps "avcodec"
  6378. enabled find_rect_filter && prepend avfilter_deps "avformat avcodec"
  6379. enabled firequalizer_filter && prepend avfilter_deps "avcodec"
  6380. enabled mcdeint_filter && prepend avfilter_deps "avcodec"
  6381. enabled movie_filter && prepend avfilter_deps "avformat avcodec"
  6382. enabled pan_filter && prepend avfilter_deps "swresample"
  6383. enabled pp_filter && prepend avfilter_deps "postproc"
  6384. enabled removelogo_filter && prepend avfilter_deps "avformat avcodec swscale"
  6385. enabled resample_filter && prepend avfilter_deps "avresample"
  6386. enabled sab_filter && prepend avfilter_deps "swscale"
  6387. enabled scale_filter && prepend avfilter_deps "swscale"
  6388. enabled scale2ref_filter && prepend avfilter_deps "swscale"
  6389. enabled sofalizer_filter && prepend avfilter_deps "avcodec"
  6390. enabled showcqt_filter && prepend avfilter_deps "avformat avcodec swscale"
  6391. enabled showfreqs_filter && prepend avfilter_deps "avcodec"
  6392. enabled showspectrum_filter && prepend avfilter_deps "avcodec"
  6393. enabled signature_filter && prepend avfilter_deps "avcodec avformat"
  6394. enabled smartblur_filter && prepend avfilter_deps "swscale"
  6395. enabled spectrumsynth_filter && prepend avfilter_deps "avcodec"
  6396. enabled spp_filter && prepend avfilter_deps "avcodec"
  6397. enabled sr_filter && prepend avfilter_deps "avformat swscale"
  6398. enabled subtitles_filter && prepend avfilter_deps "avformat avcodec"
  6399. enabled uspp_filter && prepend avfilter_deps "avcodec"
  6400. enabled zoompan_filter && prepend avfilter_deps "swscale"
  6401. enabled lavfi_indev && prepend avdevice_deps "avfilter"
  6402. #FIXME
  6403. enabled_any sdl2_outdev opengl_outdev && enabled sdl2 &&
  6404. add_cflags $(filter_out '-Dmain=SDL_main' $sdl2_cflags)
  6405. enabled opus_decoder && prepend avcodec_deps "swresample"
  6406. # reorder the items at var $1 to align with the items order at var $2 .
  6407. # die if an item at $1 is not at $2 .
  6408. reorder_by(){
  6409. eval rb_in=\$$1
  6410. eval rb_ordered=\$$2
  6411. for rb in $rb_in; do
  6412. is_in $rb $rb_ordered || die "$rb at \$$1 is not at \$$2"
  6413. done
  6414. rb_out=
  6415. for rb in $rb_ordered; do
  6416. is_in $rb $rb_in && rb_out="$rb_out$rb "
  6417. done
  6418. eval $1=\$rb_out
  6419. }
  6420. # deps-expand fflib $1: N x {append all expanded deps; unique}
  6421. # within a set of N items, N expansions are enough to expose a cycle.
  6422. expand_deps(){
  6423. unique ${1}_deps # required for the early break test.
  6424. for dummy in $LIBRARY_LIST; do # N iteratios
  6425. eval deps=\$${1}_deps
  6426. append ${1}_deps $(map 'eval echo \$${v}_deps' $deps)
  6427. unique ${1}_deps
  6428. eval '[ ${#deps} = ${#'${1}_deps'} ]' && break # doesn't expand anymore
  6429. done
  6430. eval is_in $1 \$${1}_deps && die "Dependency cycle at ${1}_deps"
  6431. reorder_by ${1}_deps LIBRARY_LIST # linking order is expected later
  6432. }
  6433. #we have to remove gpl from the deps here as some code assumes all lib deps are libs
  6434. postproc_deps="$(filter_out 'gpl' $postproc_deps)"
  6435. map 'expand_deps $v' $LIBRARY_LIST
  6436. if test "$quiet" != "yes"; then
  6437. echo "install prefix $prefix"
  6438. echo "source path $source_path"
  6439. echo "C compiler $cc"
  6440. echo "C library $libc_type"
  6441. if test "$host_cc" != "$cc"; then
  6442. echo "host C compiler $host_cc"
  6443. echo "host C library $host_libc_type"
  6444. fi
  6445. echo "ARCH $arch ($cpu)"
  6446. if test "$build_suffix" != ""; then
  6447. echo "build suffix $build_suffix"
  6448. fi
  6449. if test "$progs_suffix" != ""; then
  6450. echo "progs suffix $progs_suffix"
  6451. fi
  6452. if test "$extra_version" != ""; then
  6453. echo "version string suffix $extra_version"
  6454. fi
  6455. echo "big-endian ${bigendian-no}"
  6456. echo "runtime cpu detection ${runtime_cpudetect-no}"
  6457. if enabled x86; then
  6458. echo "standalone assembly ${x86asm-no}"
  6459. echo "x86 assembler ${x86asmexe}"
  6460. echo "MMX enabled ${mmx-no}"
  6461. echo "MMXEXT enabled ${mmxext-no}"
  6462. echo "3DNow! enabled ${amd3dnow-no}"
  6463. echo "3DNow! extended enabled ${amd3dnowext-no}"
  6464. echo "SSE enabled ${sse-no}"
  6465. echo "SSSE3 enabled ${ssse3-no}"
  6466. echo "AESNI enabled ${aesni-no}"
  6467. echo "AVX enabled ${avx-no}"
  6468. echo "AVX2 enabled ${avx2-no}"
  6469. echo "AVX-512 enabled ${avx512-no}"
  6470. echo "XOP enabled ${xop-no}"
  6471. echo "FMA3 enabled ${fma3-no}"
  6472. echo "FMA4 enabled ${fma4-no}"
  6473. echo "i686 features enabled ${i686-no}"
  6474. echo "CMOV is fast ${fast_cmov-no}"
  6475. echo "EBX available ${ebx_available-no}"
  6476. echo "EBP available ${ebp_available-no}"
  6477. fi
  6478. if enabled aarch64; then
  6479. echo "NEON enabled ${neon-no}"
  6480. echo "VFP enabled ${vfp-no}"
  6481. fi
  6482. if enabled arm; then
  6483. echo "ARMv5TE enabled ${armv5te-no}"
  6484. echo "ARMv6 enabled ${armv6-no}"
  6485. echo "ARMv6T2 enabled ${armv6t2-no}"
  6486. echo "VFP enabled ${vfp-no}"
  6487. echo "NEON enabled ${neon-no}"
  6488. echo "THUMB enabled ${thumb-no}"
  6489. fi
  6490. if enabled mips; then
  6491. echo "MIPS FPU enabled ${mipsfpu-no}"
  6492. echo "MIPS DSP R1 enabled ${mipsdsp-no}"
  6493. echo "MIPS DSP R2 enabled ${mipsdspr2-no}"
  6494. echo "MIPS MSA enabled ${msa-no}"
  6495. echo "LOONGSON MMI enabled ${mmi-no}"
  6496. fi
  6497. if enabled ppc; then
  6498. echo "AltiVec enabled ${altivec-no}"
  6499. echo "VSX enabled ${vsx-no}"
  6500. echo "POWER8 enabled ${power8-no}"
  6501. echo "PPC 4xx optimizations ${ppc4xx-no}"
  6502. echo "dcbzl available ${dcbzl-no}"
  6503. fi
  6504. echo "debug symbols ${debug-no}"
  6505. echo "strip symbols ${stripping-no}"
  6506. echo "optimize for size ${small-no}"
  6507. echo "optimizations ${optimizations-no}"
  6508. echo "static ${static-no}"
  6509. echo "shared ${shared-no}"
  6510. echo "postprocessing support ${postproc-no}"
  6511. echo "network support ${network-no}"
  6512. echo "threading support ${thread_type-no}"
  6513. echo "safe bitstream reader ${safe_bitstream_reader-no}"
  6514. echo "texi2html enabled ${texi2html-no}"
  6515. echo "perl enabled ${perl-no}"
  6516. echo "pod2man enabled ${pod2man-no}"
  6517. echo "makeinfo enabled ${makeinfo-no}"
  6518. echo "makeinfo supports HTML ${makeinfo_html-no}"
  6519. test -n "$random_seed" &&
  6520. echo "random seed ${random_seed}"
  6521. echo
  6522. echo "External libraries:"
  6523. print_enabled '' $EXTERNAL_LIBRARY_LIST $EXTERNAL_AUTODETECT_LIBRARY_LIST | print_in_columns
  6524. echo
  6525. echo "External libraries providing hardware acceleration:"
  6526. print_enabled '' $HWACCEL_LIBRARY_LIST $HWACCEL_AUTODETECT_LIBRARY_LIST | print_in_columns
  6527. echo
  6528. echo "Libraries:"
  6529. print_enabled '' $LIBRARY_LIST | print_in_columns
  6530. echo
  6531. echo "Programs:"
  6532. print_enabled '' $PROGRAM_LIST | print_in_columns
  6533. echo
  6534. for type in decoder encoder hwaccel parser demuxer muxer protocol filter bsf indev outdev; do
  6535. echo "Enabled ${type}s:"
  6536. eval list=\$$(toupper $type)_LIST
  6537. print_enabled '_*' $list | print_in_columns
  6538. echo
  6539. done
  6540. if test -n "$ignore_tests"; then
  6541. ignore_tests=$(echo $ignore_tests | tr ',' ' ')
  6542. echo "Ignored FATE tests:"
  6543. echo $ignore_tests | print_in_columns
  6544. echo
  6545. fi
  6546. echo "License: $license"
  6547. fi # test "$quiet" != "yes"
  6548. if test -n "$WARN_IF_GETS_DISABLED_LIST"; then
  6549. for cfg in $WARN_IF_GETS_DISABLED_LIST; do
  6550. if disabled $cfg; then
  6551. varname=${cfg}_disable_reason
  6552. eval "warn \"Disabled $cfg because \$$varname\""
  6553. fi
  6554. done
  6555. fi
  6556. if test -n "$WARNINGS"; then
  6557. printf "\n%s%s$WARNINGS%s" "$warn_color" "$bold_color" "$reset_color"
  6558. enabled fatal_warnings && exit 1
  6559. fi
  6560. test -e Makefile || echo "include $source_path/Makefile" > Makefile
  6561. esc(){
  6562. echo "$*" | sed 's/%/%25/g;s/:/%3a/g'
  6563. }
  6564. echo "config:$arch:$subarch:$cpu:$target_os:$(esc $cc_ident):$(esc $FFMPEG_CONFIGURATION)" > ffbuild/config.fate
  6565. enabled stripping || strip="echo skipping strip"
  6566. enabled stripping || striptype=""
  6567. config_files="$TMPH ffbuild/config.mak doc/config.texi"
  6568. cat > ffbuild/config.mak <<EOF
  6569. # Automatically generated by configure - do not modify!
  6570. ifndef FFMPEG_CONFIG_MAK
  6571. FFMPEG_CONFIG_MAK=1
  6572. FFMPEG_CONFIGURATION=$FFMPEG_CONFIGURATION
  6573. prefix=$prefix
  6574. LIBDIR=\$(DESTDIR)$libdir
  6575. SHLIBDIR=\$(DESTDIR)$shlibdir
  6576. INCDIR=\$(DESTDIR)$incdir
  6577. BINDIR=\$(DESTDIR)$bindir
  6578. DATADIR=\$(DESTDIR)$datadir
  6579. DOCDIR=\$(DESTDIR)$docdir
  6580. MANDIR=\$(DESTDIR)$mandir
  6581. PKGCONFIGDIR=\$(DESTDIR)$pkgconfigdir
  6582. INSTALL_NAME_DIR=$install_name_dir
  6583. SRC_PATH=$source_path
  6584. SRC_LINK=$source_link
  6585. ifndef MAIN_MAKEFILE
  6586. SRC_PATH:=\$(SRC_PATH:.%=..%)
  6587. endif
  6588. CC_IDENT=$cc_ident
  6589. ARCH=$arch
  6590. INTRINSICS=$intrinsics
  6591. EXTERN_PREFIX=$extern_prefix
  6592. CC=$cc
  6593. CXX=$cxx
  6594. AS=$as
  6595. OBJCC=$objcc
  6596. LD=$ld
  6597. DEPCC=$dep_cc
  6598. DEPCCFLAGS=$DEPCCFLAGS \$(CPPFLAGS)
  6599. DEPAS=$as
  6600. DEPASFLAGS=$DEPASFLAGS \$(CPPFLAGS)
  6601. X86ASM=$x86asmexe
  6602. DEPX86ASM=$x86asmexe
  6603. DEPX86ASMFLAGS=\$(X86ASMFLAGS)
  6604. AR=$ar
  6605. ARFLAGS=$arflags
  6606. AR_O=$ar_o
  6607. AR_CMD=$ar
  6608. NM_CMD=$nm
  6609. RANLIB=$ranlib
  6610. STRIP=$strip
  6611. STRIPTYPE=$striptype
  6612. NVCC=$nvcc
  6613. CP=cp -p
  6614. LN_S=$ln_s
  6615. CPPFLAGS=$CPPFLAGS
  6616. CFLAGS=$CFLAGS
  6617. CXXFLAGS=$CXXFLAGS
  6618. OBJCFLAGS=$OBJCFLAGS
  6619. ASFLAGS=$ASFLAGS
  6620. NVCCFLAGS=$nvccflags
  6621. AS_C=$AS_C
  6622. AS_O=$AS_O
  6623. OBJCC_C=$OBJCC_C
  6624. OBJCC_E=$OBJCC_E
  6625. OBJCC_O=$OBJCC_O
  6626. CC_C=$CC_C
  6627. CC_E=$CC_E
  6628. CC_O=$CC_O
  6629. CXX_C=$CXX_C
  6630. CXX_O=$CXX_O
  6631. NVCC_C=$NVCC_C
  6632. NVCC_O=$NVCC_O
  6633. LD_O=$LD_O
  6634. X86ASM_O=$X86ASM_O
  6635. LD_LIB=$LD_LIB
  6636. LD_PATH=$LD_PATH
  6637. DLLTOOL=$dlltool
  6638. WINDRES=$windres
  6639. DEPWINDRES=$dep_cc
  6640. DOXYGEN=$doxygen
  6641. LDFLAGS=$LDFLAGS
  6642. LDEXEFLAGS=$LDEXEFLAGS
  6643. LDSOFLAGS=$LDSOFLAGS
  6644. SHFLAGS=$(echo $($ldflags_filter $SHFLAGS))
  6645. ASMSTRIPFLAGS=$ASMSTRIPFLAGS
  6646. X86ASMFLAGS=$X86ASMFLAGS
  6647. BUILDSUF=$build_suffix
  6648. PROGSSUF=$progs_suffix
  6649. FULLNAME=$FULLNAME
  6650. LIBPREF=$LIBPREF
  6651. LIBSUF=$LIBSUF
  6652. LIBNAME=$LIBNAME
  6653. SLIBPREF=$SLIBPREF
  6654. SLIBSUF=$SLIBSUF
  6655. EXESUF=$EXESUF
  6656. EXTRA_VERSION=$extra_version
  6657. CCDEP=$CCDEP
  6658. CXXDEP=$CXXDEP
  6659. CCDEP_FLAGS=$CCDEP_FLAGS
  6660. ASDEP=$ASDEP
  6661. ASDEP_FLAGS=$ASDEP_FLAGS
  6662. X86ASMDEP=$X86ASMDEP
  6663. X86ASMDEP_FLAGS=$X86ASMDEP_FLAGS
  6664. CC_DEPFLAGS=$CC_DEPFLAGS
  6665. AS_DEPFLAGS=$AS_DEPFLAGS
  6666. X86ASM_DEPFLAGS=$X86ASM_DEPFLAGS
  6667. HOSTCC=$host_cc
  6668. HOSTLD=$host_ld
  6669. HOSTCFLAGS=$host_cflags
  6670. HOSTCPPFLAGS=$host_cppflags
  6671. HOSTEXESUF=$HOSTEXESUF
  6672. HOSTLDFLAGS=$host_ldflags
  6673. HOSTEXTRALIBS=$host_extralibs
  6674. DEPHOSTCC=$host_cc
  6675. DEPHOSTCCFLAGS=$DEPHOSTCCFLAGS \$(HOSTCCFLAGS)
  6676. HOSTCCDEP=$HOSTCCDEP
  6677. HOSTCCDEP_FLAGS=$HOSTCCDEP_FLAGS
  6678. HOSTCC_DEPFLAGS=$HOSTCC_DEPFLAGS
  6679. HOSTCC_C=$HOSTCC_C
  6680. HOSTCC_O=$HOSTCC_O
  6681. HOSTLD_O=$HOSTLD_O
  6682. TARGET_EXEC=$target_exec $target_exec_args
  6683. TARGET_PATH=$target_path
  6684. TARGET_SAMPLES=${target_samples:-\$(SAMPLES)}
  6685. CFLAGS-ffplay=${sdl2_cflags}
  6686. CFLAGS_HEADERS=$CFLAGS_HEADERS
  6687. LIB_INSTALL_EXTRA_CMD=$LIB_INSTALL_EXTRA_CMD
  6688. EXTRALIBS=$extralibs
  6689. COMPAT_OBJS=$compat_objs
  6690. INSTALL=$install
  6691. LIBTARGET=${LIBTARGET}
  6692. SLIBNAME=${SLIBNAME}
  6693. SLIBNAME_WITH_VERSION=${SLIBNAME_WITH_VERSION}
  6694. SLIBNAME_WITH_MAJOR=${SLIBNAME_WITH_MAJOR}
  6695. SLIB_CREATE_DEF_CMD=${SLIB_CREATE_DEF_CMD}
  6696. SLIB_EXTRA_CMD=${SLIB_EXTRA_CMD}
  6697. SLIB_INSTALL_NAME=${SLIB_INSTALL_NAME}
  6698. SLIB_INSTALL_LINKS=${SLIB_INSTALL_LINKS}
  6699. SLIB_INSTALL_EXTRA_LIB=${SLIB_INSTALL_EXTRA_LIB}
  6700. SLIB_INSTALL_EXTRA_SHLIB=${SLIB_INSTALL_EXTRA_SHLIB}
  6701. VERSION_SCRIPT_POSTPROCESS_CMD=${VERSION_SCRIPT_POSTPROCESS_CMD}
  6702. SAMPLES:=${samples:-\$(FATE_SAMPLES)}
  6703. NOREDZONE_FLAGS=$noredzone_flags
  6704. LIBFUZZER_PATH=$libfuzzer_path
  6705. IGNORE_TESTS=$ignore_tests
  6706. EOF
  6707. map 'eval echo "${v}_FFLIBS=\$${v}_deps" >> ffbuild/config.mak' $LIBRARY_LIST
  6708. for entry in $LIBRARY_LIST $PROGRAM_LIST $EXTRALIBS_LIST; do
  6709. eval echo "EXTRALIBS-${entry}=\$${entry}_extralibs" >> ffbuild/config.mak
  6710. done
  6711. cat > $TMPH <<EOF
  6712. /* Automatically generated by configure - do not modify! */
  6713. #ifndef FFMPEG_CONFIG_H
  6714. #define FFMPEG_CONFIG_H
  6715. #define FFMPEG_CONFIGURATION "$(c_escape $FFMPEG_CONFIGURATION)"
  6716. #define FFMPEG_LICENSE "$(c_escape $license)"
  6717. #define CONFIG_THIS_YEAR 2019
  6718. #define FFMPEG_DATADIR "$(eval c_escape $datadir)"
  6719. #define AVCONV_DATADIR "$(eval c_escape $datadir)"
  6720. #define CC_IDENT "$(c_escape ${cc_ident:-Unknown compiler})"
  6721. #define av_restrict $restrict_keyword
  6722. #define EXTERN_PREFIX "${extern_prefix}"
  6723. #define EXTERN_ASM ${extern_prefix}
  6724. #define BUILDSUF "$build_suffix"
  6725. #define SLIBSUF "$SLIBSUF"
  6726. #define HAVE_MMX2 HAVE_MMXEXT
  6727. #define SWS_MAX_FILTER_SIZE $sws_max_filter_size
  6728. EOF
  6729. test -n "$assert_level" &&
  6730. echo "#define ASSERT_LEVEL $assert_level" >>$TMPH
  6731. test -n "$malloc_prefix" &&
  6732. echo "#define MALLOC_PREFIX $malloc_prefix" >>$TMPH
  6733. if enabled x86asm; then
  6734. append config_files $TMPASM
  6735. cat > $TMPASM <<EOF
  6736. ; Automatically generated by configure - do not modify!
  6737. EOF
  6738. fi
  6739. enabled getenv || echo "#define getenv(x) NULL" >> $TMPH
  6740. mkdir -p doc
  6741. mkdir -p tests
  6742. mkdir -p tests/api
  6743. echo "@c auto-generated by configure - do not modify! " > doc/config.texi
  6744. print_config ARCH_ "$config_files" $ARCH_LIST
  6745. print_config HAVE_ "$config_files" $HAVE_LIST
  6746. print_config CONFIG_ "$config_files" $CONFIG_LIST \
  6747. $CONFIG_EXTRA \
  6748. $ALL_COMPONENTS \
  6749. echo "#endif /* FFMPEG_CONFIG_H */" >> $TMPH
  6750. echo "endif # FFMPEG_CONFIG_MAK" >> ffbuild/config.mak
  6751. # Do not overwrite an unchanged config.h to avoid superfluous rebuilds.
  6752. cp_if_changed $TMPH config.h
  6753. touch ffbuild/.config
  6754. enabled x86asm && cp_if_changed $TMPASM config.asm
  6755. cat > $TMPH <<EOF
  6756. /* Generated by ffmpeg configure */
  6757. #ifndef AVUTIL_AVCONFIG_H
  6758. #define AVUTIL_AVCONFIG_H
  6759. EOF
  6760. print_config AV_HAVE_ $TMPH $HAVE_LIST_PUB
  6761. echo "#endif /* AVUTIL_AVCONFIG_H */" >> $TMPH
  6762. cp_if_changed $TMPH libavutil/avconfig.h
  6763. # full_filter_name_foo=vf_foo
  6764. # full_filter_name_bar=asrc_bar
  6765. # ...
  6766. eval "$(sed -n "s/^extern AVFilter ff_\([avfsinkrc]\{2,5\}\)_\(.*\);/full_filter_name_\2=\1_\2/p" $source_path/libavfilter/allfilters.c)"
  6767. # generate the lists of enabled components
  6768. print_enabled_components(){
  6769. file=$1
  6770. struct_name=$2
  6771. name=$3
  6772. shift 3
  6773. echo "static const $struct_name * const $name[] = {" > $TMPH
  6774. for c in $*; do
  6775. if enabled $c; then
  6776. case $name in
  6777. filter_list)
  6778. eval c=\$full_filter_name_${c%_filter}
  6779. ;;
  6780. indev_list)
  6781. c=${c%_indev}_demuxer
  6782. ;;
  6783. outdev_list)
  6784. c=${c%_outdev}_muxer
  6785. ;;
  6786. esac
  6787. printf " &ff_%s,\n" $c >> $TMPH
  6788. fi
  6789. done
  6790. if [ "$name" = "filter_list" ]; then
  6791. for c in asrc_abuffer vsrc_buffer asink_abuffer vsink_buffer; do
  6792. printf " &ff_%s,\n" $c >> $TMPH
  6793. done
  6794. fi
  6795. echo " NULL };" >> $TMPH
  6796. cp_if_changed $TMPH $file
  6797. }
  6798. print_enabled_components libavfilter/filter_list.c AVFilter filter_list $FILTER_LIST
  6799. print_enabled_components libavcodec/codec_list.c AVCodec codec_list $CODEC_LIST
  6800. print_enabled_components libavcodec/parser_list.c AVCodecParser parser_list $PARSER_LIST
  6801. print_enabled_components libavcodec/bsf_list.c AVBitStreamFilter bitstream_filters $BSF_LIST
  6802. print_enabled_components libavformat/demuxer_list.c AVInputFormat demuxer_list $DEMUXER_LIST
  6803. print_enabled_components libavformat/muxer_list.c AVOutputFormat muxer_list $MUXER_LIST
  6804. print_enabled_components libavdevice/indev_list.c AVInputFormat indev_list $INDEV_LIST
  6805. print_enabled_components libavdevice/outdev_list.c AVOutputFormat outdev_list $OUTDEV_LIST
  6806. print_enabled_components libavformat/protocol_list.c URLProtocol url_protocols $PROTOCOL_LIST
  6807. # Settings for pkg-config files
  6808. cat > $TMPH <<EOF
  6809. # Automatically generated by configure - do not modify!
  6810. shared=$shared
  6811. build_suffix=$build_suffix
  6812. prefix=$prefix
  6813. libdir=$libdir
  6814. incdir=$incdir
  6815. rpath=$(enabled rpath && echo "-Wl,-rpath,\${libdir}")
  6816. source_path=${source_path}
  6817. LIBPREF=${LIBPREF}
  6818. LIBSUF=${LIBSUF}
  6819. extralibs_avutil="$avutil_extralibs"
  6820. extralibs_avcodec="$avcodec_extralibs"
  6821. extralibs_avformat="$avformat_extralibs"
  6822. extralibs_avdevice="$avdevice_extralibs"
  6823. extralibs_avfilter="$avfilter_extralibs"
  6824. extralibs_avresample="$avresample_extralibs"
  6825. extralibs_postproc="$postproc_extralibs"
  6826. extralibs_swscale="$swscale_extralibs"
  6827. extralibs_swresample="$swresample_extralibs"
  6828. EOF
  6829. for lib in $LIBRARY_LIST; do
  6830. lib_deps="$(eval echo \$${lib}_deps)"
  6831. echo ${lib}_deps=\"$lib_deps\" >> $TMPH
  6832. done
  6833. cp_if_changed $TMPH ffbuild/config.sh