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.

6105 lines
191KB

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