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.

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