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.

5446 lines
168KB

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