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.

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