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.

7410 lines
242KB

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