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.

6564 lines
208KB

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