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.

6054 lines
190KB

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