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.

6079 lines
191KB

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