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.

3994 lines
120KB

  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. show_help(){
  51. cat <<EOF
  52. Usage: configure [options]
  53. Options: [defaults in brackets after descriptions]
  54. Help options:
  55. --help print this message
  56. --list-decoders show all available decoders
  57. --list-encoders show all available encoders
  58. --list-hwaccels show all available hardware accelerators
  59. --list-demuxers show all available demuxers
  60. --list-muxers show all available muxers
  61. --list-parsers show all available parsers
  62. --list-protocols show all available protocols
  63. --list-bsfs show all available bitstream filters
  64. --list-indevs show all available input devices
  65. --list-outdevs show all available output devices
  66. --list-filters show all available filters
  67. Standard options:
  68. --logfile=FILE log tests and output to FILE [config.log]
  69. --disable-logging do not log configure debug information
  70. --prefix=PREFIX install in PREFIX [$prefix]
  71. --bindir=DIR install binaries in DIR [PREFIX/bin]
  72. --datadir=DIR install data files in DIR [PREFIX/share/ffmpeg]
  73. --libdir=DIR install libs in DIR [PREFIX/lib]
  74. --shlibdir=DIR install shared libs in DIR [PREFIX/lib]
  75. --incdir=DIR install includes in DIR [PREFIX/include]
  76. --mandir=DIR install man page in DIR [PREFIX/share/man]
  77. Licensing options:
  78. --enable-gpl allow use of GPL code, the resulting libs
  79. and binaries will be under GPL [no]
  80. --enable-version3 upgrade (L)GPL to version 3 [no]
  81. --enable-nonfree allow use of nonfree code, the resulting libs
  82. and binaries will be unredistributable [no]
  83. Configuration options:
  84. --disable-static do not build static libraries [no]
  85. --enable-shared build shared libraries [no]
  86. --enable-small optimize for size instead of speed
  87. --enable-runtime-cpudetect detect cpu capabilities at runtime (bigger binary)
  88. --enable-gray enable full grayscale support (slower color)
  89. --disable-swscale-alpha disable alpha channel support in swscale
  90. Component options:
  91. --disable-doc do not build documentation
  92. --disable-ffmpeg disable ffmpeg build
  93. --disable-ffplay disable ffplay build
  94. --disable-ffprobe disable ffprobe build
  95. --disable-ffserver disable ffserver build
  96. --disable-avdevice disable libavdevice build
  97. --disable-avcodec disable libavcodec build
  98. --disable-avformat disable libavformat build
  99. --disable-swresample disable libswresample build
  100. --disable-swscale disable libswscale build
  101. --disable-postproc disable libpostproc build
  102. --disable-avfilter disable video filter support [no]
  103. --enable-avresample enable libavresample build [no]
  104. --disable-pthreads disable pthreads [auto]
  105. --disable-w32threads disable Win32 threads [auto]
  106. --disable-os2threads disable OS/2 threads [auto]
  107. --enable-x11grab enable X11 grabbing [no]
  108. --disable-network disable network support [no]
  109. --disable-dct disable DCT code
  110. --disable-mdct disable MDCT code
  111. --disable-rdft disable RDFT code
  112. --disable-fft disable FFT code
  113. --enable-dxva2 enable DXVA2 code
  114. --enable-vaapi enable VAAPI code [autodetect]
  115. --enable-vda enable VDA code [autodetect]
  116. --enable-vdpau enable VDPAU code [autodetect]
  117. Individual component options:
  118. --disable-everything disable all components listed below
  119. --disable-encoder=NAME disable encoder NAME
  120. --enable-encoder=NAME enable encoder NAME
  121. --disable-encoders disable all encoders
  122. --disable-decoder=NAME disable decoder NAME
  123. --enable-decoder=NAME enable decoder NAME
  124. --disable-decoders disable all decoders
  125. --disable-hwaccel=NAME disable hwaccel NAME
  126. --enable-hwaccel=NAME enable hwaccel NAME
  127. --disable-hwaccels disable all hwaccels
  128. --disable-muxer=NAME disable muxer NAME
  129. --enable-muxer=NAME enable muxer NAME
  130. --disable-muxers disable all muxers
  131. --disable-demuxer=NAME disable demuxer NAME
  132. --enable-demuxer=NAME enable demuxer NAME
  133. --disable-demuxers disable all demuxers
  134. --enable-parser=NAME enable parser NAME
  135. --disable-parser=NAME disable parser NAME
  136. --disable-parsers disable all parsers
  137. --enable-bsf=NAME enable bitstream filter NAME
  138. --disable-bsf=NAME disable bitstream filter NAME
  139. --disable-bsfs disable all bitstream filters
  140. --enable-protocol=NAME enable protocol NAME
  141. --disable-protocol=NAME disable protocol NAME
  142. --disable-protocols disable all protocols
  143. --enable-indev=NAME enable input device NAME
  144. --disable-indev=NAME disable input device NAME
  145. --disable-indevs disable input devices
  146. --enable-outdev=NAME enable output device NAME
  147. --disable-outdev=NAME disable output device NAME
  148. --disable-outdevs disable output devices
  149. --disable-devices disable all devices
  150. --enable-filter=NAME enable filter NAME
  151. --disable-filter=NAME disable filter NAME
  152. --disable-filters disable all filters
  153. External library support:
  154. --enable-avisynth enable reading of AVISynth script files [no]
  155. --enable-bzlib enable bzlib [autodetect]
  156. --enable-fontconfig enable fontconfig
  157. --enable-frei0r enable frei0r video filtering
  158. --enable-gnutls enable gnutls [no]
  159. --enable-libaacplus enable AAC+ encoding via libaacplus [no]
  160. --enable-libass enable libass subtitles rendering [no]
  161. --enable-libbluray enable BluRay reading using libbluray [no]
  162. --enable-libcelt enable CELT decoding via libcelt [no]
  163. --enable-libcdio enable audio CD grabbing with libcdio
  164. --enable-libdc1394 enable IIDC-1394 grabbing using libdc1394
  165. and libraw1394 [no]
  166. --enable-libfaac enable FAAC support via libfaac [no]
  167. --enable-libfreetype enable libfreetype [no]
  168. --enable-libgsm enable GSM support via libgsm [no]
  169. --enable-libiec61883 enable iec61883 via libiec61883 [no]
  170. --enable-libilbc enable iLBC de/encoding via libilbc [no]
  171. --enable-libmodplug enable ModPlug via libmodplug [no]
  172. --enable-libmp3lame enable MP3 encoding via libmp3lame [no]
  173. --enable-libnut enable NUT (de)muxing via libnut,
  174. native (de)muxer exists [no]
  175. --enable-libopencore-amrnb enable AMR-NB de/encoding via libopencore-amrnb [no]
  176. --enable-libopencore-amrwb enable AMR-WB decoding via libopencore-amrwb [no]
  177. --enable-libopencv enable video filtering via libopencv [no]
  178. --enable-libopenjpeg enable JPEG 2000 encoding/decoding via OpenJPEG [no]
  179. --enable-libpulse enable Pulseaudio input via libpulse [no]
  180. --enable-librtmp enable RTMP[E] support via librtmp [no]
  181. --enable-libschroedinger enable Dirac support via libschroedinger [no]
  182. --enable-libspeex enable Speex support via libspeex [no]
  183. --enable-libstagefright-h264 enable H.264 decoding via libstagefright [no]
  184. --enable-libtheora enable Theora encoding via libtheora [no]
  185. --enable-libutvideo enable Ut Video encoding and decoding via libutvideo [no]
  186. --enable-libv4l2 enable libv4l2/v4l-utils [no]
  187. --enable-libvo-aacenc enable AAC encoding via libvo-aacenc [no]
  188. --enable-libvo-amrwbenc enable AMR-WB encoding via libvo-amrwbenc [no]
  189. --enable-libvorbis enable Vorbis en/decoding via libvorbis,
  190. native implementation exists [no]
  191. --enable-libvpx enable VP8 support via libvpx [no]
  192. --enable-libx264 enable H.264 encoding via x264 [no]
  193. --enable-libxavs enable AVS encoding via xavs [no]
  194. --enable-libxvid enable Xvid encoding via xvidcore,
  195. native MPEG-4/Xvid encoder exists [no]
  196. --enable-openal enable OpenAL 1.1 capture support [no]
  197. --enable-openssl enable openssl [no]
  198. --enable-zlib enable zlib [autodetect]
  199. Advanced options (experts only):
  200. --cross-prefix=PREFIX use PREFIX for compilation tools [$cross_prefix]
  201. --enable-cross-compile assume a cross-compiler is used
  202. --sysroot=PATH root of cross-build tree
  203. --sysinclude=PATH location of cross-build system headers
  204. --target-os=OS compiler targets OS [$target_os]
  205. --target-exec=CMD command to run executables on target
  206. --target-path=DIR path to view of build directory on target
  207. --nm=NM use nm tool NM [$nm_default]
  208. --ar=AR use archive tool AR [$ar_default]
  209. --as=AS use assembler AS [$as_default]
  210. --yasmexe=EXE use yasm-compatible assembler EXE [$yasmexe_default]
  211. --cc=CC use C compiler CC [$cc_default]
  212. --cxx=CXX use C compiler CXX [$cxx_default]
  213. --ld=LD use linker LD [$ld_default]
  214. --host-cc=HOSTCC use host C compiler HOSTCC
  215. --host-cflags=HCFLAGS use HCFLAGS when compiling for host
  216. --host-ldflags=HLDFLAGS use HLDFLAGS when linking for host
  217. --host-libs=HLIBS use libs HLIBS when linking for host
  218. --extra-cflags=ECFLAGS add ECFLAGS to CFLAGS [$CFLAGS]
  219. --extra-cxxflags=ECFLAGS add ECFLAGS to CXXFLAGS [$CXXFLAGS]
  220. --extra-ldflags=ELDFLAGS add ELDFLAGS to LDFLAGS [$LDFLAGS]
  221. --extra-libs=ELIBS add ELIBS [$ELIBS]
  222. --extra-version=STRING version string suffix []
  223. --optflags override optimization-related compiler flags
  224. --build-suffix=SUFFIX library name suffix []
  225. --malloc-prefix=PREFIX prefix malloc and related names with PREFIX
  226. --progs-suffix=SUFFIX program name suffix []
  227. --arch=ARCH select architecture [$arch]
  228. --cpu=CPU select the minimum required CPU (affects
  229. instruction selection, may crash on older CPUs)
  230. --enable-pic build position-independent code
  231. --enable-sram allow use of on-chip SRAM
  232. --disable-symver disable symbol versioning
  233. --disable-fastdiv disable table-based division
  234. --enable-hardcoded-tables use hardcoded tables instead of runtime generation
  235. --disable-safe-bitstream-reader
  236. disable buffer boundary checking in bitreaders
  237. (faster, but may crash)
  238. --enable-memalign-hack emulate memalign, interferes with memory debuggers
  239. Optimization options (experts only):
  240. --disable-asm disable all assembler optimizations
  241. --disable-altivec disable AltiVec optimizations
  242. --disable-amd3dnow disable 3DNow! optimizations
  243. --disable-amd3dnowext disable 3DNow! extended optimizations
  244. --disable-mmx disable MMX optimizations
  245. --disable-mmx2 disable MMX2 optimizations
  246. --disable-sse disable SSE optimizations
  247. --disable-ssse3 disable SSSE3 optimizations
  248. --disable-avx disable AVX optimizations
  249. --disable-armv5te disable armv5te optimizations
  250. --disable-armv6 disable armv6 optimizations
  251. --disable-armv6t2 disable armv6t2 optimizations
  252. --disable-armvfp disable ARM VFP optimizations
  253. --disable-mmi disable MMI optimizations
  254. --disable-neon disable NEON optimizations
  255. --disable-vis disable VIS optimizations
  256. --disable-yasm disable use of yasm assembler
  257. --disable-mips32r2 disable MIPS32R2 optimizations
  258. --disable-mipsdspr1 disable MIPS DSP ASE R1 optimizations
  259. --disable-mipsdspr2 disable MIPS DSP ASE R2 optimizations
  260. --disable-mipsfpu disable floating point MIPS optimizations
  261. --disable-fast-unaligned consider unaligned accesses slow
  262. --postproc-version=V build libpostproc version V.
  263. Where V can be '$ALT_PP_VER_MAJOR.$ALT_PP_VER_MINOR.$ALT_PP_VER_MICRO' or 'current'. [$postproc_version_default]
  264. Developer options (useful when working on FFmpeg itself):
  265. --enable-coverage build with test coverage instrumentation
  266. --disable-debug disable debugging symbols
  267. --enable-debug=LEVEL set the debug level [$debuglevel]
  268. --disable-optimizations disable compiler optimizations
  269. --enable-extra-warnings enable more compiler warnings
  270. --disable-stripping disable stripping of executables and shared libraries
  271. --assert-level=level 0(default), 1 or 2, amount of assertion testing,
  272. 2 causes a slowdown at runtime.
  273. --enable-memory-poisoning fill heap uninitialized allocated space with arbitrary data
  274. --valgrind=VALGRIND run "make fate" tests through valgrind to detect memory
  275. leaks and errors, using the specified valgrind binary.
  276. Cannot be combined with --target-exec
  277. --samples=PATH location of test samples for FATE, if not set use
  278. \$FATE_SAMPLES at make invocation time.
  279. --enable-xmm-clobber-test check XMM registers for clobbering (Win64-only;
  280. should be used only for debugging purposes)
  281. --enable-random randomly enable/disable components
  282. --disable-random
  283. --enable-random=LIST randomly enable/disable specific components or
  284. --disable-random=LIST component groups. LIST is a comma-separated list
  285. of NAME[:PROB] entries where NAME is a component
  286. (group) and PROB the probability associated with
  287. NAME (default 0.5).
  288. --random-seed=VALUE seed value for --enable/disable-random
  289. NOTE: Object files are built at the place where configure is launched.
  290. EOF
  291. exit 0
  292. }
  293. quotes='""'
  294. log(){
  295. echo "$@" >> $logfile
  296. }
  297. log_file(){
  298. log BEGIN $1
  299. pr -n -t $1 >> $logfile
  300. log END $1
  301. }
  302. echolog(){
  303. log "$@"
  304. echo "$@"
  305. }
  306. warn(){
  307. log "WARNING: $*"
  308. WARNINGS="${WARNINGS}WARNING: $*\n"
  309. }
  310. die(){
  311. echolog "$@"
  312. cat <<EOF
  313. If you think configure made a mistake, make sure you are using the latest
  314. version from Git. If the latest version fails, report the problem to the
  315. ffmpeg-user@ffmpeg.org mailing list or IRC #ffmpeg on irc.freenode.net.
  316. EOF
  317. if disabled logging; then
  318. cat <<EOF
  319. Rerun configure with logging enabled (do not use --disable-logging), and
  320. include the log this produces with your report.
  321. EOF
  322. else
  323. cat <<EOF
  324. Include the log file "$logfile" produced by configure as this will help
  325. solving the problem.
  326. EOF
  327. fi
  328. exit 1
  329. }
  330. # Avoid locale weirdness, besides we really just want to translate ASCII.
  331. toupper(){
  332. echo "$@" | tr abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ
  333. }
  334. tolower(){
  335. echo "$@" | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz
  336. }
  337. c_escape(){
  338. echo "$*" | sed 's/["\\]/\\\0/g'
  339. }
  340. sh_quote(){
  341. v=$(echo "$1" | sed "s/'/'\\\\''/g")
  342. test "x$v" = "x${v#*[!A-Za-z0-9_/.+-]}" || v="'$v'"
  343. echo "$v"
  344. }
  345. cleanws(){
  346. echo "$@" | sed 's/^ *//;s/ */ /g;s/ *$//'
  347. }
  348. filter(){
  349. pat=$1
  350. shift
  351. for v; do
  352. eval "case $v in $pat) echo $v ;; esac"
  353. done
  354. }
  355. filter_out(){
  356. pat=$1
  357. shift
  358. for v; do
  359. eval "case $v in $pat) ;; *) echo $v ;; esac"
  360. done
  361. }
  362. map(){
  363. m=$1
  364. shift
  365. for v; do eval $m; done
  366. }
  367. set_all(){
  368. value=$1
  369. shift
  370. for var in $*; do
  371. eval $var=$value
  372. done
  373. }
  374. set_weak(){
  375. value=$1
  376. shift
  377. for var; do
  378. eval : \${$var:=$value}
  379. done
  380. }
  381. set_safe(){
  382. var=$1
  383. shift
  384. eval $(echo "$var" | sed 's/[^A-Za-z0-9_]/_/g')='$*'
  385. }
  386. get_safe(){
  387. eval echo \$$(echo "$1" | sed 's/[^A-Za-z0-9_]/_/g')
  388. }
  389. pushvar(){
  390. for var in $*; do
  391. eval level=\${${var}_level:=0}
  392. eval ${var}_${level}="\$$var"
  393. eval ${var}_level=$(($level+1))
  394. done
  395. }
  396. popvar(){
  397. for var in $*; do
  398. eval level=\${${var}_level:-0}
  399. test $level = 0 && continue
  400. eval level=$(($level-1))
  401. eval $var="\${${var}_${level}}"
  402. eval ${var}_level=$level
  403. eval unset ${var}_${level}
  404. done
  405. }
  406. enable(){
  407. set_all yes $*
  408. }
  409. disable(){
  410. set_all no $*
  411. }
  412. enable_weak(){
  413. set_weak yes $*
  414. }
  415. disable_weak(){
  416. set_weak no $*
  417. }
  418. enable_safe(){
  419. for var; do
  420. enable $(echo "$var" | sed 's/[^A-Za-z0-9_]/_/g')
  421. done
  422. }
  423. disable_safe(){
  424. for var; do
  425. disable $(echo "$var" | sed 's/[^A-Za-z0-9_]/_/g')
  426. done
  427. }
  428. do_enable_deep(){
  429. for var; do
  430. enabled $var && continue
  431. eval sel="\$${var}_select"
  432. eval sgs="\$${var}_suggest"
  433. pushvar var sgs
  434. enable_deep $sel
  435. popvar sgs
  436. enable_deep_weak $sgs
  437. popvar var
  438. done
  439. }
  440. enable_deep(){
  441. do_enable_deep $*
  442. enable $*
  443. }
  444. enable_deep_weak(){
  445. do_enable_deep $*
  446. enable_weak $*
  447. }
  448. enabled(){
  449. test "${1#!}" = "$1" && op== || op=!=
  450. eval test "x\$${1#!}" $op "xyes"
  451. }
  452. disabled(){
  453. test "${1#!}" = "$1" && op== || op=!=
  454. eval test "x\$${1#!}" $op "xno"
  455. }
  456. enabled_all(){
  457. for opt; do
  458. enabled $opt || return 1
  459. done
  460. }
  461. disabled_all(){
  462. for opt; do
  463. disabled $opt || return 1
  464. done
  465. }
  466. enabled_any(){
  467. for opt; do
  468. enabled $opt && return 0
  469. done
  470. }
  471. disabled_any(){
  472. for opt; do
  473. disabled $opt && return 0
  474. done
  475. return 1
  476. }
  477. set_default(){
  478. for opt; do
  479. eval : \${$opt:=\$${opt}_default}
  480. done
  481. }
  482. is_in(){
  483. value=$1
  484. shift
  485. for var in $*; do
  486. [ $var = $value ] && return 0
  487. done
  488. return 1
  489. }
  490. check_deps(){
  491. for cfg; do
  492. cfg="${cfg#!}"
  493. enabled ${cfg}_checking && die "Circular dependency for $cfg."
  494. disabled ${cfg}_checking && continue
  495. enable ${cfg}_checking
  496. eval dep_all="\$${cfg}_deps"
  497. eval dep_any="\$${cfg}_deps_any"
  498. eval dep_sel="\$${cfg}_select"
  499. eval dep_sgs="\$${cfg}_suggest"
  500. eval dep_ifa="\$${cfg}_if"
  501. eval dep_ifn="\$${cfg}_if_any"
  502. pushvar cfg dep_all dep_any dep_sel dep_sgs dep_ifa dep_ifn
  503. check_deps $dep_all $dep_any $dep_sel $dep_sgs $dep_ifa $dep_ifn
  504. popvar cfg dep_all dep_any dep_sel dep_sgs dep_ifa dep_ifn
  505. [ -n "$dep_ifa" ] && { enabled_all $dep_ifa && enable_weak $cfg; }
  506. [ -n "$dep_ifn" ] && { enabled_any $dep_ifn && enable_weak $cfg; }
  507. enabled_all $dep_all || disable $cfg
  508. enabled_any $dep_any || disable $cfg
  509. disabled_any $dep_sel && disable $cfg
  510. if enabled $cfg; then
  511. eval dep_extralibs="\$${cfg}_extralibs"
  512. test -n "$dep_extralibs" && add_extralibs $dep_extralibs
  513. enable_deep $dep_sel
  514. enable_deep_weak $dep_sgs
  515. fi
  516. disable ${cfg}_checking
  517. done
  518. }
  519. print_config_h(){
  520. enabled $1 && v=1 || v=0
  521. echo "#define $2 $v"
  522. }
  523. print_config_mak(){
  524. enabled $1 && v= || v=!
  525. echo "$v$2=yes"
  526. }
  527. print_config_asm(){
  528. enabled $1 && v=1 || v=0
  529. echo "%define $2 $v"
  530. }
  531. print_config(){
  532. pfx=$1
  533. files=$2
  534. shift 2
  535. for cfg; do
  536. ucname="$(toupper $cfg)"
  537. for f in $files; do
  538. "print_config_${f##*.}" $cfg ${pfx}${ucname} >>$f
  539. done
  540. done
  541. }
  542. print_enabled(){
  543. test "$1" = -n && end=" " && shift || end="\n"
  544. suf=$1
  545. shift
  546. for v; do
  547. enabled $v && printf "%s$end" ${v%$suf};
  548. done
  549. }
  550. append(){
  551. var=$1
  552. shift
  553. eval "$var=\"\$$var $*\""
  554. }
  555. prepend(){
  556. var=$1
  557. shift
  558. eval "$var=\"$* \$$var\""
  559. }
  560. add_cppflags(){
  561. append CPPFLAGS $($filter_cppflags "$@")
  562. }
  563. add_cflags(){
  564. append CFLAGS $($filter_cflags "$@")
  565. }
  566. add_cxxflags(){
  567. append CXXFLAGS $($filter_cflags "$@")
  568. }
  569. add_asflags(){
  570. append ASFLAGS $($filter_asflags "$@")
  571. }
  572. add_ldflags(){
  573. append LDFLAGS "$@"
  574. }
  575. add_extralibs(){
  576. prepend extralibs "$@"
  577. }
  578. check_cmd(){
  579. log "$@"
  580. "$@" >> $logfile 2>&1
  581. }
  582. check_cc(){
  583. log check_cc "$@"
  584. cat > $TMPC
  585. log_file $TMPC
  586. check_cmd $cc $CPPFLAGS $CFLAGS "$@" -c -o $TMPO $TMPC
  587. }
  588. check_cxx(){
  589. log check_cxx "$@"
  590. cat > $TMPCPP
  591. log_file $TMPCPP
  592. check_cmd $cxx $CPPFLAGS $CFLAGS $CXXFLAGS "$@" -c -o $TMPO $TMPCPP
  593. }
  594. check_cpp(){
  595. log check_cpp "$@"
  596. cat > $TMPC
  597. log_file $TMPC
  598. check_cmd $cc $CPPFLAGS $CFLAGS "$@" -E -o $TMPO $TMPC
  599. }
  600. check_as(){
  601. log check_as "$@"
  602. cat > $TMPC
  603. log_file $TMPC
  604. check_cmd $as $CPPFLAGS $ASFLAGS "$@" -c -o $TMPO $TMPC
  605. }
  606. check_asm(){
  607. log check_asm "$@"
  608. name="$1"
  609. code="$2"
  610. shift 2
  611. disable $name
  612. check_as "$@" <<EOF && enable $name
  613. void foo(void){ __asm__ volatile($code); }
  614. EOF
  615. }
  616. check_yasm(){
  617. log check_yasm "$@"
  618. echo "$1" > $TMPS
  619. log_file $TMPS
  620. shift 1
  621. check_cmd $yasmexe $YASMFLAGS "$@" -o $TMPO $TMPS
  622. }
  623. check_ld(){
  624. log check_ld "$@"
  625. type=$1
  626. shift 1
  627. flags=''
  628. libs=''
  629. for f; do
  630. test "${f}" = "${f#-l}" && flags="$flags $f" || libs="$libs $f"
  631. done
  632. check_$type $($filter_cflags $flags) || return
  633. check_cmd $ld $LDFLAGS $flags -o $TMPE $TMPO $libs $extralibs
  634. }
  635. check_code(){
  636. log check_code "$@"
  637. check=$1
  638. headers=$2
  639. code=$3
  640. shift 3
  641. {
  642. for hdr in $headers; do
  643. echo "#include <$hdr>"
  644. done
  645. echo "int main(void) { $code; return 0; }"
  646. } | check_$check "$@"
  647. }
  648. check_cppflags(){
  649. log check_cppflags "$@"
  650. set -- $($filter_cppflags "$@")
  651. check_cc "$@" <<EOF && append CPPFLAGS "$@"
  652. int x;
  653. EOF
  654. }
  655. check_cflags(){
  656. log check_cflags "$@"
  657. set -- $($filter_cflags "$@")
  658. check_cc "$@" <<EOF && append CFLAGS "$@"
  659. int x;
  660. EOF
  661. }
  662. check_cxxflags(){
  663. log check_cxxflags "$@"
  664. set -- $($filter_cflags "$@")
  665. check_cxx "$@" <<EOF && append CXXFLAGS "$@"
  666. int x;
  667. EOF
  668. }
  669. test_ldflags(){
  670. log test_ldflags "$@"
  671. check_ld "cc" "$@" <<EOF
  672. int main(void){ return 0; }
  673. EOF
  674. }
  675. check_ldflags(){
  676. log check_ldflags "$@"
  677. test_ldflags "$@" && add_ldflags "$@"
  678. }
  679. check_header(){
  680. log check_header "$@"
  681. header=$1
  682. shift
  683. disable_safe $header
  684. check_cpp "$@" <<EOF && enable_safe $header
  685. #include <$header>
  686. int x;
  687. EOF
  688. }
  689. check_func(){
  690. log check_func "$@"
  691. func=$1
  692. shift
  693. disable $func
  694. check_ld "cc" "$@" <<EOF && enable $func
  695. extern int $func();
  696. int main(void){ $func(); }
  697. EOF
  698. }
  699. check_mathfunc(){
  700. log check_mathfunc "$@"
  701. func=$1
  702. shift
  703. disable $func
  704. check_ld "cc" "$@" <<EOF && enable $func
  705. #include <math.h>
  706. float foo(float f) { return $func(f); }
  707. int main(void){ return (int) foo; }
  708. EOF
  709. }
  710. check_func_headers(){
  711. log check_func_headers "$@"
  712. headers=$1
  713. funcs=$2
  714. shift 2
  715. {
  716. for hdr in $headers; do
  717. echo "#include <$hdr>"
  718. done
  719. for func in $funcs; do
  720. echo "long check_$func(void) { return (long) $func; }"
  721. done
  722. echo "int main(void) { return 0; }"
  723. } | check_ld "cc" "$@" && enable $funcs && enable_safe $headers
  724. }
  725. check_class_headers_cpp(){
  726. log check_class_headers_cpp "$@"
  727. headers=$1
  728. classes=$2
  729. shift 2
  730. {
  731. for hdr in $headers; do
  732. echo "#include <$hdr>"
  733. done
  734. echo "int main(void) { "
  735. i=1
  736. for class in $classes; do
  737. echo "$class obj$i;"
  738. i=$(expr $i + 1)
  739. done
  740. echo "return 0; }"
  741. } | check_ld "cxx" "$@" && enable $funcs && enable_safe $headers
  742. }
  743. check_cpp_condition(){
  744. log check_cpp_condition "$@"
  745. header=$1
  746. condition=$2
  747. shift 2
  748. check_cpp $($filter_cppflags "$@") <<EOF
  749. #include <$header>
  750. #if !($condition)
  751. #error "unsatisfied condition: $condition"
  752. #endif
  753. EOF
  754. }
  755. check_lib(){
  756. log check_lib "$@"
  757. header="$1"
  758. func="$2"
  759. shift 2
  760. check_header $header && check_func $func "$@" && add_extralibs "$@"
  761. }
  762. check_lib2(){
  763. log check_lib2 "$@"
  764. headers="$1"
  765. funcs="$2"
  766. shift 2
  767. check_func_headers "$headers" "$funcs" "$@" && add_extralibs "$@"
  768. }
  769. check_lib_cpp(){
  770. log check_lib_cpp "$@"
  771. headers="$1"
  772. classes="$2"
  773. shift 2
  774. check_class_headers_cpp "$headers" "$classes" "$@" && add_extralibs "$@"
  775. }
  776. check_pkg_config(){
  777. log check_pkg_config "$@"
  778. pkg="$1"
  779. headers="$2"
  780. funcs="$3"
  781. shift 3
  782. $pkg_config --exists $pkg 2>/dev/null || return
  783. pkg_cflags=$($pkg_config --cflags $pkg)
  784. pkg_libs=$($pkg_config --libs $pkg)
  785. check_func_headers "$headers" "$funcs" $pkg_cflags $pkg_libs "$@" &&
  786. set_safe ${pkg}_cflags $pkg_cflags &&
  787. set_safe ${pkg}_libs $pkg_libs
  788. }
  789. check_exec(){
  790. check_ld "cc" "$@" && { enabled cross_compile || $TMPE >> $logfile 2>&1; }
  791. }
  792. check_exec_crash(){
  793. code=$(cat)
  794. # exit() is not async signal safe. _Exit (C99) and _exit (POSIX)
  795. # are safe but may not be available everywhere. Thus we use
  796. # raise(SIGTERM) instead. The check is run in a subshell so we
  797. # can redirect the "Terminated" message from the shell. SIGBUS
  798. # is not defined by standard C so it is used conditionally.
  799. (check_exec "$@") >> $logfile 2>&1 <<EOF
  800. #include <signal.h>
  801. static void sighandler(int sig){
  802. raise(SIGTERM);
  803. }
  804. int func(void){
  805. $code
  806. }
  807. int (*func_ptr)(void) = func;
  808. int main(void){
  809. signal(SIGILL, sighandler);
  810. signal(SIGFPE, sighandler);
  811. signal(SIGSEGV, sighandler);
  812. #ifdef SIGBUS
  813. signal(SIGBUS, sighandler);
  814. #endif
  815. return func_ptr();
  816. }
  817. EOF
  818. }
  819. check_type(){
  820. log check_type "$@"
  821. headers=$1
  822. type=$2
  823. shift 2
  824. disable_safe "$type"
  825. check_code cc "$headers" "$type v" "$@" && enable_safe "$type"
  826. }
  827. check_struct(){
  828. log check_type "$@"
  829. headers=$1
  830. struct=$2
  831. member=$3
  832. shift 3
  833. disable_safe "${struct}_${member}"
  834. check_code cc "$headers" "const void *p = &(($struct *)0)->$member" "$@" &&
  835. enable_safe "${struct}_${member}"
  836. }
  837. require(){
  838. name="$1"
  839. header="$2"
  840. func="$3"
  841. shift 3
  842. check_lib $header $func "$@" || die "ERROR: $name not found"
  843. }
  844. require2(){
  845. name="$1"
  846. headers="$2"
  847. func="$3"
  848. shift 3
  849. check_lib2 "$headers" $func "$@" || die "ERROR: $name not found"
  850. }
  851. require_cpp(){
  852. name="$1"
  853. headers="$2"
  854. classes="$3"
  855. shift 3
  856. check_lib_cpp "$headers" "$classes" "$@" || die "ERROR: $name not found"
  857. }
  858. require_pkg_config(){
  859. pkg="$1"
  860. check_pkg_config "$@" || die "ERROR: $pkg not found"
  861. add_cflags $(get_safe ${pkg}_cflags)
  862. add_extralibs $(get_safe ${pkg}_libs)
  863. }
  864. check_host_cc(){
  865. log check_host_cc "$@"
  866. cat > $TMPC
  867. log_file $TMPC
  868. check_cmd $host_cc $host_cflags "$@" -c -o $TMPO $TMPC
  869. }
  870. check_host_cflags(){
  871. log check_host_cflags "$@"
  872. check_host_cc "$@" <<EOF && append host_cflags "$@"
  873. int x;
  874. EOF
  875. }
  876. apply(){
  877. file=$1
  878. shift
  879. "$@" < "$file" > "$file.tmp" && mv "$file.tmp" "$file" || rm "$file.tmp"
  880. }
  881. cp_if_changed(){
  882. cmp -s "$1" "$2" && echo "$2 is unchanged" && return
  883. mkdir -p "$(dirname $2)"
  884. cp -f "$1" "$2"
  885. }
  886. # CONFIG_LIST contains configurable options, while HAVE_LIST is for
  887. # system-dependent things.
  888. COMPONENT_LIST="
  889. bsfs
  890. decoders
  891. demuxers
  892. encoders
  893. filters
  894. hwaccels
  895. indevs
  896. muxers
  897. outdevs
  898. parsers
  899. protocols
  900. "
  901. PROGRAM_LIST="
  902. ffplay
  903. ffprobe
  904. ffserver
  905. ffmpeg
  906. "
  907. CONFIG_LIST="
  908. $COMPONENT_LIST
  909. $PROGRAM_LIST
  910. ac3dsp
  911. avcodec
  912. avdevice
  913. avfilter
  914. avformat
  915. avresample
  916. avisynth
  917. bzlib
  918. crystalhd
  919. dct
  920. doc
  921. dwt
  922. dxva2
  923. fast_unaligned
  924. fastdiv
  925. fft
  926. fontconfig
  927. frei0r
  928. gnutls
  929. gpl
  930. gray
  931. hardcoded_tables
  932. libaacplus
  933. libass
  934. libbluray
  935. libcdio
  936. libcelt
  937. libdc1394
  938. libfaac
  939. libfreetype
  940. libgsm
  941. libiec61883
  942. libilbc
  943. libmodplug
  944. libmp3lame
  945. libnut
  946. libopencore_amrnb
  947. libopencore_amrwb
  948. libopencv
  949. libopenjpeg
  950. libpulse
  951. librtmp
  952. libschroedinger
  953. libspeex
  954. libstagefright_h264
  955. libtheora
  956. libutvideo
  957. libv4l2
  958. libvo_aacenc
  959. libvo_amrwbenc
  960. libvorbis
  961. libvpx
  962. libx264
  963. libxavs
  964. libxvid
  965. lsp
  966. mdct
  967. memalign_hack
  968. memory_poisoning
  969. mpegaudiodsp
  970. network
  971. nonfree
  972. openal
  973. openssl
  974. pic
  975. postproc
  976. rdft
  977. rtpdec
  978. runtime_cpudetect
  979. safe_bitstream_reader
  980. shared
  981. sinewin
  982. small
  983. sram
  984. static
  985. swresample
  986. swscale
  987. swscale_alpha
  988. thumb
  989. vaapi
  990. vda
  991. vdpau
  992. version3
  993. xmm_clobber_test
  994. x11grab
  995. zlib
  996. "
  997. THREADS_LIST='
  998. pthreads
  999. w32threads
  1000. os2threads
  1001. '
  1002. ARCH_LIST='
  1003. alpha
  1004. arm
  1005. avr32
  1006. avr32_ap
  1007. avr32_uc
  1008. bfin
  1009. ia64
  1010. m68k
  1011. mips
  1012. mips64
  1013. parisc
  1014. ppc
  1015. ppc64
  1016. s390
  1017. sh4
  1018. sparc
  1019. sparc64
  1020. tomi
  1021. x86
  1022. x86_32
  1023. x86_64
  1024. '
  1025. ARCH_EXT_LIST='
  1026. altivec
  1027. amd3dnow
  1028. amd3dnowext
  1029. armv5te
  1030. armv6
  1031. armv6t2
  1032. armvfp
  1033. avx
  1034. mmi
  1035. mmx
  1036. mmx2
  1037. neon
  1038. ppc4xx
  1039. sse
  1040. ssse3
  1041. vfpv3
  1042. vis
  1043. mipsfpu
  1044. mips32r2
  1045. mipsdspr1
  1046. mipsdspr2
  1047. '
  1048. HAVE_LIST_PUB='
  1049. bigendian
  1050. fast_unaligned
  1051. '
  1052. HAVE_LIST="
  1053. $ARCH_EXT_LIST
  1054. $HAVE_LIST_PUB
  1055. $THREADS_LIST
  1056. aligned_malloc
  1057. aligned_stack
  1058. alsa_asoundlib_h
  1059. altivec_h
  1060. arpa_inet_h
  1061. asm_mod_y
  1062. asm_types_h
  1063. attribute_may_alias
  1064. attribute_packed
  1065. cbrtf
  1066. clock_gettime
  1067. closesocket
  1068. cmov
  1069. cpuid
  1070. dcbzl
  1071. dev_bktr_ioctl_bt848_h
  1072. dev_bktr_ioctl_meteor_h
  1073. dev_ic_bt8xx_h
  1074. dev_video_bktr_ioctl_bt848_h
  1075. dev_video_meteor_ioctl_meteor_h
  1076. dlfcn_h
  1077. dlopen
  1078. dos_paths
  1079. dxva_h
  1080. ebp_available
  1081. ebx_available
  1082. exp2
  1083. exp2f
  1084. fast_64bit
  1085. fast_clz
  1086. fast_cmov
  1087. fcntl
  1088. fork
  1089. getaddrinfo
  1090. gethrtime
  1091. GetProcessAffinityMask
  1092. GetProcessMemoryInfo
  1093. GetProcessTimes
  1094. GetSystemTimeAsFileTime
  1095. getrusage
  1096. gettimeofday
  1097. glob
  1098. gnu_as
  1099. ibm_asm
  1100. inet_aton
  1101. inline_asm
  1102. isatty
  1103. isinf
  1104. isnan
  1105. jack_port_get_latency_range
  1106. kbhit
  1107. ldbrx
  1108. libdc1394_1
  1109. libdc1394_2
  1110. llrint
  1111. llrintf
  1112. local_aligned_16
  1113. local_aligned_8
  1114. localtime_r
  1115. log2
  1116. log2f
  1117. loongson
  1118. lrint
  1119. lrintf
  1120. lzo1x_999_compress
  1121. machine_ioctl_bt848_h
  1122. machine_ioctl_meteor_h
  1123. makeinfo
  1124. malloc_h
  1125. MapViewOfFile
  1126. memalign
  1127. mkstemp
  1128. mm_empty
  1129. mmap
  1130. nanosleep
  1131. netinet_sctp_h
  1132. PeekNamedPipe
  1133. poll_h
  1134. posix_memalign
  1135. pthread_cancel
  1136. rdtsc
  1137. round
  1138. roundf
  1139. rweflags
  1140. sched_getaffinity
  1141. sdl
  1142. sdl_video_size
  1143. setmode
  1144. setrlimit
  1145. Sleep
  1146. sndio_h
  1147. socklen_t
  1148. soundcard_h
  1149. strerror_r
  1150. strptime
  1151. struct_addrinfo
  1152. struct_group_source_req
  1153. struct_ip_mreq_source
  1154. struct_ipv6_mreq
  1155. struct_pollfd
  1156. struct_rusage_ru_maxrss
  1157. struct_sockaddr_in6
  1158. struct_sockaddr_sa_len
  1159. struct_sockaddr_storage
  1160. struct_v4l2_frmivalenum_discrete
  1161. symver
  1162. symver_asm_label
  1163. symver_gnu_asm
  1164. sysconf
  1165. sysctl
  1166. sys_mman_h
  1167. sys_param_h
  1168. sys_resource_h
  1169. sys_select_h
  1170. sys_soundcard_h
  1171. sys_time_h
  1172. sys_videoio_h
  1173. termios_h
  1174. threads
  1175. trunc
  1176. truncf
  1177. unistd_h
  1178. usleep
  1179. vfp_args
  1180. VirtualAlloc
  1181. windows_h
  1182. winsock2_h
  1183. xform_asm
  1184. xgetbv
  1185. xmm_clobbers
  1186. yasm
  1187. "
  1188. # options emitted with CONFIG_ prefix but not available on command line
  1189. CONFIG_EXTRA="
  1190. aandct
  1191. avutil
  1192. golomb
  1193. gplv3
  1194. h264chroma
  1195. h264dsp
  1196. h264pred
  1197. h264qpel
  1198. huffman
  1199. lgplv3
  1200. lpc
  1201. "
  1202. CMDLINE_SELECT="
  1203. $ARCH_EXT_LIST
  1204. $CONFIG_LIST
  1205. $THREADS_LIST
  1206. asm
  1207. coverage
  1208. cross_compile
  1209. debug
  1210. extra_warnings
  1211. logging
  1212. optimizations
  1213. stripping
  1214. symver
  1215. yasm
  1216. "
  1217. PATHS_LIST='
  1218. bindir
  1219. datadir
  1220. incdir
  1221. libdir
  1222. mandir
  1223. prefix
  1224. shlibdir
  1225. '
  1226. CMDLINE_SET="
  1227. $PATHS_LIST
  1228. ar
  1229. arch
  1230. as
  1231. assert_level
  1232. build_suffix
  1233. cc
  1234. cpu
  1235. cross_prefix
  1236. cxx
  1237. dep_cc
  1238. extra_version
  1239. host_cc
  1240. host_cflags
  1241. host_ldflags
  1242. host_libs
  1243. host_os
  1244. install
  1245. ld
  1246. logfile
  1247. malloc_prefix
  1248. nm
  1249. optflags
  1250. pkg_config
  1251. postproc_version
  1252. progs_suffix
  1253. random_seed
  1254. samples
  1255. strip
  1256. sysinclude
  1257. sysroot
  1258. target_exec
  1259. target_os
  1260. target_path
  1261. valgrind
  1262. yasmexe
  1263. "
  1264. CMDLINE_APPEND="
  1265. extra_cflags
  1266. extra_cxxflags
  1267. "
  1268. # code dependency declarations
  1269. # architecture extensions
  1270. armv5te_deps="arm"
  1271. armv6_deps="arm"
  1272. armv6t2_deps="arm"
  1273. armvfp_deps="arm"
  1274. neon_deps="arm"
  1275. vfpv3_deps="armvfp"
  1276. mipsfpu_deps="mips"
  1277. mips32r2_deps="mips"
  1278. mipsdspr1_deps="mips"
  1279. mipsdspr2_deps="mips"
  1280. mmi_deps="mips"
  1281. altivec_deps="ppc"
  1282. ppc4xx_deps="ppc"
  1283. vis_deps="sparc"
  1284. x86_64_suggest="cmov fast_cmov"
  1285. amd3dnow_deps="mmx"
  1286. amd3dnowext_deps="amd3dnow"
  1287. mmx_deps="x86"
  1288. mmx2_deps="mmx"
  1289. sse_deps="mmx"
  1290. ssse3_deps="sse"
  1291. avx_deps="ssse3"
  1292. aligned_stack_if_any="ppc x86"
  1293. fast_64bit_if_any="alpha ia64 mips64 parisc64 ppc64 sparc64 x86_64"
  1294. fast_clz_if_any="alpha armv5te avr32 mips ppc x86"
  1295. fast_unaligned_if_any="armv6 ppc x86"
  1296. inline_asm_deps="!tms470"
  1297. need_memalign="altivec neon sse"
  1298. symver_if_any="symver_asm_label symver_gnu_asm"
  1299. # subsystems
  1300. dct_select="rdft"
  1301. mdct_select="fft"
  1302. rdft_select="fft"
  1303. mpegaudiodsp_select="dct"
  1304. # decoders / encoders / hardware accelerators
  1305. aac_decoder_select="mdct sinewin"
  1306. aac_encoder_select="mdct sinewin"
  1307. aac_latm_decoder_select="aac_decoder aac_latm_parser"
  1308. ac3_decoder_select="mdct ac3dsp ac3_parser"
  1309. ac3_encoder_select="mdct ac3dsp"
  1310. ac3_fixed_encoder_select="mdct ac3dsp"
  1311. alac_encoder_select="lpc"
  1312. amrnb_decoder_select="lsp"
  1313. amrwb_decoder_select="lsp"
  1314. amv_encoder_select="aandct"
  1315. atrac1_decoder_select="mdct sinewin"
  1316. atrac3_decoder_select="mdct"
  1317. binkaudio_dct_decoder_select="mdct rdft dct sinewin"
  1318. binkaudio_rdft_decoder_select="mdct rdft sinewin"
  1319. cavs_decoder_select="golomb"
  1320. cook_decoder_select="mdct sinewin"
  1321. cscd_decoder_suggest="zlib"
  1322. dca_decoder_select="mdct"
  1323. dirac_decoder_select="dwt golomb"
  1324. dnxhd_encoder_select="aandct"
  1325. dxa_decoder_select="zlib"
  1326. eac3_decoder_select="ac3_decoder"
  1327. eac3_encoder_select="mdct ac3dsp"
  1328. eamad_decoder_select="aandct"
  1329. eatgq_decoder_select="aandct"
  1330. eatqi_decoder_select="aandct"
  1331. ffv1_decoder_select="golomb"
  1332. flac_decoder_select="golomb"
  1333. flac_encoder_select="golomb lpc"
  1334. flashsv_decoder_select="zlib"
  1335. flashsv_encoder_select="zlib"
  1336. flashsv2_encoder_select="zlib"
  1337. flashsv2_decoder_select="zlib"
  1338. flv_decoder_select="h263_decoder"
  1339. flv_encoder_select="h263_encoder"
  1340. fraps_decoder_select="huffman"
  1341. h261_encoder_select="aandct"
  1342. h263_decoder_select="h263_parser"
  1343. h263_encoder_select="aandct"
  1344. h263_vaapi_hwaccel_select="vaapi h263_decoder"
  1345. h263i_decoder_select="h263_decoder"
  1346. h263p_encoder_select="h263_encoder"
  1347. h264_crystalhd_decoder_select="crystalhd h264_mp4toannexb_bsf h264_parser"
  1348. h264_decoder_select="golomb h264chroma h264dsp h264pred h264qpel"
  1349. h264_dxva2_hwaccel_deps="dxva2api_h"
  1350. h264_dxva2_hwaccel_select="dxva2 h264_decoder"
  1351. h264_vaapi_hwaccel_select="vaapi h264_decoder"
  1352. h264_vda_hwaccel_deps="VideoDecodeAcceleration_VDADecoder_h pthreads"
  1353. h264_vda_hwaccel_select="vda h264_decoder"
  1354. h264_vdpau_decoder_select="vdpau h264_decoder"
  1355. iac_decoder_select="fft mdct sinewin"
  1356. imc_decoder_select="fft mdct sinewin"
  1357. jpegls_decoder_select="golomb"
  1358. jpegls_encoder_select="golomb"
  1359. ljpeg_encoder_select="aandct"
  1360. loco_decoder_select="golomb"
  1361. mjpeg_encoder_select="aandct"
  1362. mlp_decoder_select="mlp_parser"
  1363. mp1_decoder_select="mpegaudiodsp"
  1364. mp1float_decoder_select="mpegaudiodsp"
  1365. mp2_decoder_select="mpegaudiodsp"
  1366. mp2float_decoder_select="mpegaudiodsp"
  1367. mp3_decoder_select="mpegaudiodsp"
  1368. mp3adu_decoder_select="mpegaudiodsp"
  1369. mp3adufloat_decoder_select="mpegaudiodsp"
  1370. mp3float_decoder_select="mpegaudiodsp"
  1371. mp3on4_decoder_select="mpegaudiodsp"
  1372. mp3on4float_decoder_select="mpegaudiodsp"
  1373. mpc7_decoder_select="mpegaudiodsp"
  1374. mpc8_decoder_select="mpegaudiodsp"
  1375. mpeg_vdpau_decoder_select="vdpau mpegvideo_decoder"
  1376. mpeg_xvmc_decoder_deps="X11_extensions_XvMClib_h"
  1377. mpeg_xvmc_decoder_select="mpegvideo_decoder"
  1378. mpeg1_vdpau_decoder_select="vdpau mpeg1video_decoder"
  1379. mpeg1_vdpau_hwaccel_select="vdpau mpeg1video_decoder"
  1380. mpeg1video_encoder_select="aandct"
  1381. mpeg2_crystalhd_decoder_select="crystalhd"
  1382. mpeg2_dxva2_hwaccel_deps="dxva2api_h"
  1383. mpeg2_dxva2_hwaccel_select="dxva2 mpeg2video_decoder"
  1384. mpeg2_vdpau_hwaccel_select="vdpau mpeg2video_decoder"
  1385. mpeg2_vaapi_hwaccel_select="vaapi mpeg2video_decoder"
  1386. mpeg2video_encoder_select="aandct"
  1387. mpeg4_crystalhd_decoder_select="crystalhd"
  1388. mpeg4_decoder_select="h263_decoder mpeg4video_parser"
  1389. mpeg4_encoder_select="h263_encoder"
  1390. mpeg4_vaapi_hwaccel_select="vaapi mpeg4_decoder"
  1391. mpeg4_vdpau_decoder_select="vdpau mpeg4_decoder"
  1392. msmpeg4_crystalhd_decoder_select="crystalhd"
  1393. msmpeg4v1_decoder_select="h263_decoder"
  1394. msmpeg4v1_encoder_select="h263_encoder"
  1395. msmpeg4v2_decoder_select="h263_decoder"
  1396. msmpeg4v2_encoder_select="h263_encoder"
  1397. msmpeg4v3_decoder_select="h263_decoder"
  1398. msmpeg4v3_encoder_select="h263_encoder"
  1399. nellymoser_decoder_select="mdct sinewin"
  1400. nellymoser_encoder_select="mdct sinewin"
  1401. png_decoder_select="zlib"
  1402. png_encoder_select="zlib"
  1403. qcelp_decoder_select="lsp"
  1404. qdm2_decoder_select="mdct rdft mpegaudiodsp"
  1405. ra_144_encoder_select="lpc"
  1406. ralf_decoder_select="golomb"
  1407. rv10_decoder_select="h263_decoder"
  1408. rv10_encoder_select="h263_encoder"
  1409. rv20_decoder_select="h263_decoder"
  1410. rv20_encoder_select="h263_encoder"
  1411. rv30_decoder_select="golomb h264chroma h264pred h264qpel"
  1412. rv40_decoder_select="golomb h264chroma h264pred h264qpel"
  1413. shorten_decoder_select="golomb"
  1414. sipr_decoder_select="lsp"
  1415. snow_decoder_select="dwt"
  1416. snow_encoder_select="aandct dwt"
  1417. sonic_decoder_select="golomb"
  1418. sonic_encoder_select="golomb"
  1419. sonic_ls_encoder_select="golomb"
  1420. svq1_encoder_select="aandct"
  1421. svq3_decoder_select="golomb h264chroma h264dsp h264pred h264qpel"
  1422. svq3_decoder_suggest="zlib"
  1423. theora_decoder_select="vp3_decoder"
  1424. tiff_decoder_suggest="zlib"
  1425. tiff_encoder_suggest="zlib"
  1426. tscc_decoder_select="zlib"
  1427. twinvq_decoder_select="mdct lsp sinewin"
  1428. vc1_crystalhd_decoder_select="crystalhd"
  1429. vc1_decoder_select="h263_decoder h264chroma h264qpel"
  1430. vc1_dxva2_hwaccel_deps="dxva2api_h"
  1431. vc1_dxva2_hwaccel_select="dxva2 vc1_decoder"
  1432. vc1_vaapi_hwaccel_select="vaapi vc1_decoder"
  1433. vc1_vdpau_decoder_select="vdpau vc1_decoder"
  1434. vc1image_decoder_select="vc1_decoder"
  1435. vorbis_decoder_select="mdct"
  1436. vorbis_encoder_select="mdct"
  1437. vp6_decoder_select="huffman"
  1438. vp6a_decoder_select="vp6_decoder"
  1439. vp6f_decoder_select="vp6_decoder"
  1440. vp8_decoder_select="h264pred h264qpel"
  1441. wmapro_decoder_select="mdct sinewin"
  1442. wmav1_decoder_select="mdct sinewin"
  1443. wmav1_encoder_select="mdct sinewin"
  1444. wmav2_decoder_select="mdct sinewin"
  1445. wmav2_encoder_select="mdct sinewin"
  1446. wmavoice_decoder_select="lsp rdft dct mdct sinewin"
  1447. wmv1_decoder_select="h263_decoder"
  1448. wmv1_encoder_select="h263_encoder"
  1449. wmv2_decoder_select="h263_decoder"
  1450. wmv2_encoder_select="h263_encoder"
  1451. wmv3_decoder_select="vc1_decoder"
  1452. wmv3_crystalhd_decoder_select="crystalhd"
  1453. wmv3_dxva2_hwaccel_select="vc1_dxva2_hwaccel"
  1454. wmv3_vaapi_hwaccel_select="vc1_vaapi_hwaccel"
  1455. wmv3_vdpau_decoder_select="vc1_vdpau_decoder"
  1456. wmv3image_decoder_select="wmv3_decoder"
  1457. zerocodec_decoder_select="zlib"
  1458. zlib_decoder_select="zlib"
  1459. zlib_encoder_select="zlib"
  1460. zmbv_decoder_select="zlib"
  1461. zmbv_encoder_select="zlib"
  1462. crystalhd_deps="libcrystalhd_libcrystalhd_if_h"
  1463. vaapi_deps="va_va_h"
  1464. vda_deps="VideoDecodeAcceleration_VDADecoder_h pthreads"
  1465. vdpau_deps="vdpau_vdpau_h vdpau_vdpau_x11_h"
  1466. # parsers
  1467. h264_parser_select="golomb h264dsp h264pred"
  1468. # external libraries
  1469. libaacplus_encoder_deps="libaacplus"
  1470. libcelt_decoder_deps="libcelt"
  1471. libfaac_encoder_deps="libfaac"
  1472. libgsm_decoder_deps="libgsm"
  1473. libgsm_encoder_deps="libgsm"
  1474. libgsm_ms_decoder_deps="libgsm"
  1475. libgsm_ms_encoder_deps="libgsm"
  1476. libilbc_decoder_deps="libilbc"
  1477. libilbc_encoder_deps="libilbc"
  1478. libmodplug_demuxer_deps="libmodplug"
  1479. libmp3lame_encoder_deps="libmp3lame"
  1480. libopencore_amrnb_decoder_deps="libopencore_amrnb"
  1481. libopencore_amrnb_encoder_deps="libopencore_amrnb"
  1482. libopencore_amrwb_decoder_deps="libopencore_amrwb"
  1483. libopenjpeg_decoder_deps="libopenjpeg"
  1484. libopenjpeg_encoder_deps="libopenjpeg"
  1485. libschroedinger_decoder_deps="libschroedinger"
  1486. libschroedinger_encoder_deps="libschroedinger"
  1487. libspeex_decoder_deps="libspeex"
  1488. libspeex_encoder_deps="libspeex"
  1489. libstagefright_h264_decoder_deps="libstagefright_h264"
  1490. libtheora_encoder_deps="libtheora"
  1491. libvo_aacenc_encoder_deps="libvo_aacenc"
  1492. libvo_amrwbenc_encoder_deps="libvo_amrwbenc"
  1493. libvorbis_decoder_deps="libvorbis"
  1494. libvorbis_encoder_deps="libvorbis"
  1495. libvpx_decoder_deps="libvpx"
  1496. libvpx_encoder_deps="libvpx"
  1497. libx264_encoder_deps="libx264"
  1498. libx264rgb_encoder_deps="libx264"
  1499. libxavs_encoder_deps="libxavs"
  1500. libxvid_encoder_deps="libxvid"
  1501. libutvideo_decoder_deps="libutvideo"
  1502. libutvideo_encoder_deps="libutvideo"
  1503. # demuxers / muxers
  1504. ac3_demuxer_select="ac3_parser"
  1505. asf_stream_muxer_select="asf_muxer"
  1506. avisynth_demuxer_deps="avisynth"
  1507. dirac_demuxer_select="dirac_parser"
  1508. eac3_demuxer_select="ac3_parser"
  1509. flac_demuxer_select="flac_parser"
  1510. ipod_muxer_select="mov_muxer"
  1511. libnut_demuxer_deps="libnut"
  1512. libnut_muxer_deps="libnut"
  1513. matroska_audio_muxer_select="matroska_muxer"
  1514. matroska_demuxer_suggest="zlib bzlib"
  1515. mov_demuxer_suggest="zlib"
  1516. mp3_demuxer_select="mpegaudio_parser"
  1517. mp4_muxer_select="mov_muxer"
  1518. mpegts_muxer_select="adts_muxer latm_muxer"
  1519. mpegtsraw_demuxer_select="mpegts_demuxer"
  1520. mxf_d10_muxer_select="mxf_muxer"
  1521. ogg_demuxer_select="golomb"
  1522. psp_muxer_select="mov_muxer"
  1523. rtp_demuxer_select="sdp_demuxer"
  1524. rtpdec_select="asf_demuxer rm_demuxer rtp_protocol mpegts_demuxer mov_demuxer"
  1525. rtsp_demuxer_select="http_protocol rtpdec"
  1526. rtsp_muxer_select="rtp_muxer http_protocol rtp_protocol"
  1527. sap_demuxer_select="sdp_demuxer"
  1528. sap_muxer_select="rtp_muxer rtp_protocol"
  1529. sdp_demuxer_select="rtpdec"
  1530. spdif_muxer_select="aac_parser"
  1531. tg2_muxer_select="mov_muxer"
  1532. tgp_muxer_select="mov_muxer"
  1533. w64_demuxer_deps="wav_demuxer"
  1534. # indevs / outdevs
  1535. alsa_indev_deps="alsa_asoundlib_h snd_pcm_htimestamp"
  1536. alsa_outdev_deps="alsa_asoundlib_h"
  1537. bktr_indev_deps_any="dev_bktr_ioctl_bt848_h machine_ioctl_bt848_h dev_video_bktr_ioctl_bt848_h dev_ic_bt8xx_h"
  1538. dshow_indev_deps="IBaseFilter"
  1539. dshow_indev_extralibs="-lpsapi -lole32 -lstrmiids -luuid"
  1540. dv1394_indev_deps="dv1394 dv_demuxer"
  1541. fbdev_indev_deps="linux_fb_h"
  1542. iec61883_indev_deps="libiec61883"
  1543. jack_indev_deps="jack_jack_h sem_timedwait"
  1544. lavfi_indev_deps="avfilter"
  1545. libcdio_indev_deps="libcdio"
  1546. libdc1394_indev_deps="libdc1394"
  1547. libv4l2_indev_deps="libv4l2"
  1548. openal_indev_deps="openal"
  1549. oss_indev_deps_any="soundcard_h sys_soundcard_h"
  1550. oss_outdev_deps_any="soundcard_h sys_soundcard_h"
  1551. pulse_indev_deps="libpulse"
  1552. sdl_outdev_deps="sdl"
  1553. sndio_indev_deps="sndio_h"
  1554. sndio_outdev_deps="sndio_h"
  1555. v4l_indev_deps="linux_videodev_h"
  1556. v4l2_indev_deps_any="linux_videodev2_h sys_videoio_h"
  1557. vfwcap_indev_deps="capCreateCaptureWindow vfwcap_defines"
  1558. vfwcap_indev_extralibs="-lavicap32"
  1559. x11_grab_device_indev_deps="x11grab XShmCreateImage"
  1560. # protocols
  1561. bluray_protocol_deps="libbluray"
  1562. gopher_protocol_deps="network"
  1563. httpproxy_protocol_deps="network"
  1564. httpproxy_protocol_select="tcp_protocol"
  1565. http_protocol_deps="network"
  1566. http_protocol_select="tcp_protocol"
  1567. https_protocol_select="tls_protocol"
  1568. librtmp_protocol_deps="librtmp"
  1569. librtmpe_protocol_deps="librtmp"
  1570. librtmps_protocol_deps="librtmp"
  1571. librtmpt_protocol_deps="librtmp"
  1572. librtmpte_protocol_deps="librtmp"
  1573. mmsh_protocol_select="http_protocol"
  1574. mmst_protocol_deps="network"
  1575. rtmp_protocol_deps="!librtmp_protocol"
  1576. rtmp_protocol_select="tcp_protocol"
  1577. rtmphttp_protocol_deps="!librtmp_protocol"
  1578. rtmphttp_protocol_select="http_protocol"
  1579. rtmpt_protocol_deps="!librtmp_protocol"
  1580. rtmpt_protocol_select="rtmphttp_protocol"
  1581. rtp_protocol_select="udp_protocol"
  1582. sctp_protocol_deps="network netinet_sctp_h"
  1583. tcp_protocol_deps="network"
  1584. tls_protocol_deps_any="openssl gnutls"
  1585. tls_protocol_select="tcp_protocol"
  1586. udp_protocol_deps="network"
  1587. # filters
  1588. aconvert_filter_deps="swresample"
  1589. amovie_filter_deps="avcodec avformat"
  1590. aresample_filter_deps="swresample"
  1591. ass_filter_deps="libass"
  1592. asyncts_filter_deps="avresample"
  1593. atempo_filter_deps="avcodec rdft"
  1594. blackframe_filter_deps="gpl"
  1595. boxblur_filter_deps="gpl"
  1596. colormatrix_filter_deps="gpl"
  1597. cropdetect_filter_deps="gpl"
  1598. delogo_filter_deps="gpl"
  1599. deshake_filter_deps="avcodec"
  1600. drawtext_filter_deps="libfreetype"
  1601. frei0r_filter_deps="frei0r dlopen"
  1602. frei0r_filter_extralibs='$ldl'
  1603. frei0r_src_filter_deps="frei0r dlopen"
  1604. frei0r_src_filter_extralibs='$ldl'
  1605. hqdn3d_filter_deps="gpl"
  1606. movie_filter_deps="avcodec avformat"
  1607. mp_filter_deps="gpl avcodec swscale postproc"
  1608. mptestsrc_filter_deps="gpl"
  1609. negate_filter_deps="lut_filter"
  1610. resample_filter_deps="avresample"
  1611. ocv_filter_deps="libopencv"
  1612. pan_filter_deps="swresample"
  1613. removelogo_filter_deps="avcodec avformat swscale"
  1614. scale_filter_deps="swscale"
  1615. select_filter_deps="avcodec"
  1616. super2xsai_filter_deps="gpl"
  1617. tinterlace_filter_deps="gpl"
  1618. yadif_filter_deps="gpl"
  1619. # libraries
  1620. avdevice_deps="avcodec avformat"
  1621. avformat_deps="avcodec"
  1622. postproc_deps="gpl"
  1623. # programs
  1624. ffmpeg_deps="avcodec avfilter avformat swscale swresample"
  1625. ffmpeg_select="buffersink_filter format_filter aformat_filter
  1626. setpts_filter null_filter anull_filter abuffersink_filter"
  1627. ffplay_deps="avcodec avformat swscale swresample sdl"
  1628. ffplay_select="buffersink_filter rdft"
  1629. ffprobe_deps="avcodec avformat"
  1630. ffserver_deps="avformat ffm_muxer fork rtp_protocol rtsp_demuxer"
  1631. ffserver_extralibs='$ldl'
  1632. doc_deps="texi2html"
  1633. # tests
  1634. test_deps(){
  1635. suf1=$1
  1636. suf2=$2
  1637. shift 2
  1638. for v; do
  1639. dep=${v%=*}
  1640. tests=${v#*=}
  1641. for name in ${tests}; do
  1642. append ${name}_test_deps ${dep}$suf1 ${dep}$suf2
  1643. done
  1644. done
  1645. }
  1646. mxf_d10_test_deps="avfilter"
  1647. seek_lavf_mxf_d10_test_deps="mxf_d10_test"
  1648. test_deps _muxer _demuxer \
  1649. aiff \
  1650. pcm_alaw=alaw \
  1651. asf \
  1652. au \
  1653. avi \
  1654. dv=dv_fmt \
  1655. ffm \
  1656. flv=flv_fmt \
  1657. gxf \
  1658. matroska=mkv \
  1659. mmf \
  1660. mov="mov ismv" \
  1661. pcm_mulaw=mulaw \
  1662. mxf="mxf mxf_d10" \
  1663. nut \
  1664. ogg="ogg ogg_vp3" \
  1665. rawvideo=pixfmt \
  1666. rm \
  1667. swf \
  1668. mpegts=ts \
  1669. voc \
  1670. wav \
  1671. yuv4mpegpipe=yuv4mpeg \
  1672. colormatrix1_test_deps="colormatrix_filter"
  1673. colormatrix2_test_deps="colormatrix_filter"
  1674. flashsv2_test_deps="zlib"
  1675. mpg_test_deps="mpeg1system_muxer mpegps_demuxer"
  1676. mpng_test_deps="zlib"
  1677. pp_test_deps="mp_filter"
  1678. pp2_test_deps="mp_filter"
  1679. pp3_test_deps="mp_filter"
  1680. pp4_test_deps="mp_filter"
  1681. pp5_test_deps="mp_filter"
  1682. pp6_test_deps="mp_filter"
  1683. zlib_test_deps="zlib"
  1684. zmbv_test_deps="zlib"
  1685. # default parameters
  1686. logfile="config.log"
  1687. # installation paths
  1688. prefix_default="/usr/local"
  1689. bindir_default='${prefix}/bin'
  1690. datadir_default='${prefix}/share/ffmpeg'
  1691. incdir_default='${prefix}/include'
  1692. libdir_default='${prefix}/lib'
  1693. mandir_default='${prefix}/share/man'
  1694. shlibdir_default="$libdir_default"
  1695. postproc_version_default="current"
  1696. # toolchain
  1697. ar_default="ar"
  1698. cc_default="gcc"
  1699. cxx_default="g++"
  1700. cc_version=\"unknown\"
  1701. host_cc_default="gcc"
  1702. install="install"
  1703. ln_s="ln -sf"
  1704. nm_default="nm"
  1705. objformat="elf"
  1706. pkg_config_default=pkg-config
  1707. ranlib="ranlib"
  1708. strip_default="strip"
  1709. yasmexe_default="yasm"
  1710. nm_opts='-g'
  1711. nogas=":"
  1712. # machine
  1713. arch_default=$(uname -m)
  1714. cpu="generic"
  1715. # OS
  1716. target_os_default=$(tolower $(uname -s))
  1717. host_os=$target_os_default
  1718. # alternative libpostproc version
  1719. ALT_PP_VER_MAJOR=51
  1720. ALT_PP_VER_MINOR=2
  1721. ALT_PP_VER_MICRO=101
  1722. ALT_PP_VER=$ALT_PP_VER_MAJOR.$ALT_PP_VER_MINOR.$ALT_PP_VER_MICRO
  1723. # configurable options
  1724. enable $PROGRAM_LIST
  1725. enable avcodec
  1726. enable avdevice
  1727. enable avfilter
  1728. enable avformat
  1729. enable avutil
  1730. enable postproc
  1731. enable stripping
  1732. enable swresample
  1733. enable swscale
  1734. enable asm
  1735. enable debug
  1736. enable doc
  1737. enable fastdiv
  1738. enable network
  1739. enable optimizations
  1740. enable safe_bitstream_reader
  1741. enable static
  1742. enable swscale_alpha
  1743. # build settings
  1744. SHFLAGS='-shared -Wl,-soname,$$(@F)'
  1745. FFSERVERLDFLAGS=-Wl,-E
  1746. LIBPREF="lib"
  1747. LIBSUF=".a"
  1748. FULLNAME='$(NAME)$(BUILDSUF)'
  1749. LIBNAME='$(LIBPREF)$(FULLNAME)$(LIBSUF)'
  1750. SLIBPREF="lib"
  1751. SLIBSUF=".so"
  1752. SLIBNAME='$(SLIBPREF)$(FULLNAME)$(SLIBSUF)'
  1753. SLIBNAME_WITH_VERSION='$(SLIBNAME).$(LIBVERSION)'
  1754. SLIBNAME_WITH_MAJOR='$(SLIBNAME).$(LIBMAJOR)'
  1755. LIB_INSTALL_EXTRA_CMD='$$(RANLIB) "$(LIBDIR)/$(LIBNAME)"'
  1756. SLIB_INSTALL_NAME='$(SLIBNAME_WITH_VERSION)'
  1757. SLIB_INSTALL_LINKS='$(SLIBNAME_WITH_MAJOR) $(SLIBNAME)'
  1758. AS_O='-o $@'
  1759. CC_O='-o $@'
  1760. CXX_O='-o $@'
  1761. host_cflags='-D_ISOC99_SOURCE -D_XOPEN_SOURCE=600 -O3 -g'
  1762. host_libs='-lm'
  1763. target_path='$(CURDIR)'
  1764. # since the object filename is not given with the -MM flag, the compiler
  1765. # is only able to print the basename, and we must add the path ourselves
  1766. DEPEND_CMD='$(DEPCC) $(DEPFLAGS) $< | sed -e "/^\#.*/d" -e "s,^[[:space:]]*$(*F)\\.o,$(@D)/$(*F).o," > $(@:.o=.d)'
  1767. DEPFLAGS='$(CPPFLAGS) $(CFLAGS) -MM'
  1768. # find source path
  1769. if test -f configure; then
  1770. source_path=.
  1771. else
  1772. source_path=$(cd $(dirname "$0"); pwd)
  1773. echo "$source_path" | grep -q '[[:blank:]]' &&
  1774. die "Out of tree builds are impossible with whitespace in source path."
  1775. test -e "$source_path/config.h" &&
  1776. die "Out of tree builds are impossible with config.h in source dir."
  1777. fi
  1778. for v in "$@"; do
  1779. r=${v#*=}
  1780. l=${v%"$r"}
  1781. r=$(sh_quote "$r")
  1782. FFMPEG_CONFIGURATION="${FFMPEG_CONFIGURATION# } ${l}${r}"
  1783. done
  1784. find_things(){
  1785. thing=$1
  1786. pattern=$2
  1787. file=$source_path/$3
  1788. sed -n "s/^[^#]*$pattern.*([^,]*, *\([^,]*\)\(,.*\)*).*/\1_$thing/p" "$file"
  1789. }
  1790. ENCODER_LIST=$(find_things encoder ENC libavcodec/allcodecs.c)
  1791. DECODER_LIST=$(find_things decoder DEC libavcodec/allcodecs.c)
  1792. HWACCEL_LIST=$(find_things hwaccel HWACCEL libavcodec/allcodecs.c)
  1793. PARSER_LIST=$(find_things parser PARSER libavcodec/allcodecs.c)
  1794. BSF_LIST=$(find_things bsf BSF libavcodec/allcodecs.c)
  1795. MUXER_LIST=$(find_things muxer _MUX libavformat/allformats.c)
  1796. DEMUXER_LIST=$(find_things demuxer DEMUX libavformat/allformats.c)
  1797. OUTDEV_LIST=$(find_things outdev OUTDEV libavdevice/alldevices.c)
  1798. INDEV_LIST=$(find_things indev _IN libavdevice/alldevices.c)
  1799. PROTOCOL_LIST=$(find_things protocol PROTOCOL libavformat/allformats.c)
  1800. FILTER_LIST=$(find_things filter FILTER libavfilter/allfilters.c)
  1801. ALL_COMPONENTS="
  1802. $BSF_LIST
  1803. $DECODER_LIST
  1804. $DEMUXER_LIST
  1805. $ENCODER_LIST
  1806. $FILTER_LIST
  1807. $HWACCEL_LIST
  1808. $INDEV_LIST
  1809. $MUXER_LIST
  1810. $OUTDEV_LIST
  1811. $PARSER_LIST
  1812. $PROTOCOL_LIST
  1813. "
  1814. find_tests(){
  1815. map "echo ${2}\${v}_test" $(ls "$source_path"/tests/ref/$1 | grep -v '[^-a-z0-9_]')
  1816. }
  1817. LAVF_FATE_TESTS=$(find_tests lavf-fate)
  1818. LAVF_TESTS=$(find_tests lavf)
  1819. LAVFI_TESTS=$(find_tests lavfi)
  1820. SEEK_TESTS=$(find_tests seek seek_)
  1821. ALL_TESTS="$LAVF_FATE_TESTS $LAVF_TESTS $LAVFI_TESTS $SEEK_TESTS"
  1822. for n in $COMPONENT_LIST; do
  1823. v=$(toupper ${n%s})_LIST
  1824. eval enable \$$v
  1825. eval ${n}_if_any="\$$v"
  1826. done
  1827. enable $ARCH_EXT_LIST $ALL_TESTS
  1828. die_unknown(){
  1829. echo "Unknown option \"$1\"."
  1830. echo "See $0 --help for available options."
  1831. exit 1
  1832. }
  1833. show_list() {
  1834. suffix=_$1
  1835. shift
  1836. echo $* | sed s/$suffix//g | tr ' ' '\n' | sort | pr -3 -t
  1837. exit 0
  1838. }
  1839. rand_list(){
  1840. IFS=', '
  1841. set -- $*
  1842. unset IFS
  1843. for thing; do
  1844. comp=${thing%:*}
  1845. prob=${thing#$comp}
  1846. prob=${prob#:}
  1847. is_in ${comp} $COMPONENT_LIST && eval comp=\$$(toupper ${comp%s})_LIST
  1848. echo "prob ${prob:-0.5}"
  1849. printf '%s\n' $comp
  1850. done
  1851. }
  1852. do_random(){
  1853. action=$1
  1854. shift
  1855. random_seed=$(awk "BEGIN { srand($random_seed); print srand() }")
  1856. $action $(rand_list "$@" | awk "BEGIN { srand($random_seed) } \$1 == \"prob\" { prob = \$2; next } rand() < prob { print }")
  1857. }
  1858. for opt do
  1859. optval="${opt#*=}"
  1860. case "$opt" in
  1861. --extra-ldflags=*) add_ldflags $optval
  1862. ;;
  1863. --extra-libs=*) add_extralibs $optval
  1864. ;;
  1865. --disable-devices) disable $INDEV_LIST $OUTDEV_LIST
  1866. ;;
  1867. --enable-debug=*) debuglevel="$optval"
  1868. ;;
  1869. --disable-everything)
  1870. map 'eval unset \${$(toupper ${v%s})_LIST}' $COMPONENT_LIST
  1871. ;;
  1872. --enable-random|--disable-random)
  1873. action=${opt%%-random}
  1874. do_random ${action#--} $COMPONENT_LIST
  1875. ;;
  1876. --enable-random=*|--disable-random=*)
  1877. action=${opt%%-random=*}
  1878. do_random ${action#--} $optval
  1879. ;;
  1880. --enable-*=*|--disable-*=*)
  1881. eval $(echo "${opt%%=*}" | sed 's/--/action=/;s/-/ thing=/')
  1882. is_in "${thing}s" $COMPONENT_LIST || die_unknown "$opt"
  1883. eval list=\$$(toupper $thing)_LIST
  1884. name=$(echo "${optval}" | sed "s/,/_${thing}|/g")_${thing}
  1885. $action $(filter "$name" $list)
  1886. ;;
  1887. --enable-?*|--disable-?*)
  1888. eval $(echo "$opt" | sed 's/--/action=/;s/-/ option=/;s/-/_/g')
  1889. if is_in $option $COMPONENT_LIST; then
  1890. test $action = disable && action=unset
  1891. eval $action \$$(toupper ${option%s})_LIST
  1892. elif is_in $option $CMDLINE_SELECT; then
  1893. $action $option
  1894. else
  1895. die_unknown $opt
  1896. fi
  1897. ;;
  1898. --list-*)
  1899. NAME="${opt#--list-}"
  1900. is_in $NAME $COMPONENT_LIST || die_unknown $opt
  1901. NAME=${NAME%s}
  1902. eval show_list $NAME \$$(toupper $NAME)_LIST
  1903. ;;
  1904. --help|-h) show_help
  1905. ;;
  1906. *)
  1907. optname="${opt%%=*}"
  1908. optname="${optname#--}"
  1909. optname=$(echo "$optname" | sed 's/-/_/g')
  1910. if is_in $optname $CMDLINE_SET; then
  1911. eval $optname='$optval'
  1912. elif is_in $optname $CMDLINE_APPEND; then
  1913. append $optname "$optval"
  1914. else
  1915. die_unknown $opt
  1916. fi
  1917. ;;
  1918. esac
  1919. done
  1920. disabled logging && logfile=/dev/null
  1921. echo "# $0 $FFMPEG_CONFIGURATION" > $logfile
  1922. set >> $logfile
  1923. test -n "$cross_prefix" && enable cross_compile
  1924. if enabled cross_compile; then
  1925. test -n "$arch" && test -n "$target_os" ||
  1926. die "Must specify target arch and OS when cross-compiling"
  1927. fi
  1928. set_default arch target_os postproc_version
  1929. # Check if we should build alternative libpostproc version instead of current
  1930. if test "$postproc_version" = $ALT_PP_VER; then
  1931. LIBPOSTPROC_VERSION=$ALT_PP_VER
  1932. LIBPOSTPROC_VERSION_MAJOR=$ALT_PP_VER_MAJOR
  1933. LIBPOSTPROC_VERSION_MINOR=$ALT_PP_VER_MINOR
  1934. LIBPOSTPROC_VERSION_MICRO=$ALT_PP_VER_MICRO
  1935. elif test "$postproc_version" != current; then
  1936. die "Invalid argument to --postproc-version. See --help output."
  1937. fi
  1938. ar_default="${cross_prefix}${ar_default}"
  1939. cc_default="${cross_prefix}${cc_default}"
  1940. cxx_default="${cross_prefix}${cxx_default}"
  1941. nm_default="${cross_prefix}${nm_default}"
  1942. pkg_config_default="${cross_prefix}${pkg_config_default}"
  1943. ranlib="${cross_prefix}${ranlib}"
  1944. strip_default="${cross_prefix}${strip_default}"
  1945. sysinclude_default="${sysroot}/usr/include"
  1946. set_default cc cxx nm pkg_config strip sysinclude yasmexe
  1947. enabled cross_compile || host_cc_default=$cc
  1948. set_default host_cc
  1949. if ! $pkg_config --version >/dev/null 2>&1; then
  1950. warn "$pkg_config not found, library detection may fail."
  1951. pkg_config=false
  1952. fi
  1953. exesuf() {
  1954. case $1 in
  1955. mingw32*|cygwin*|*-dos|freedos|opendos|os/2*|symbian) echo .exe ;;
  1956. esac
  1957. }
  1958. EXESUF=$(exesuf $target_os)
  1959. HOSTEXESUF=$(exesuf $host_os)
  1960. # set temporary file name
  1961. : ${TMPDIR:=$TEMPDIR}
  1962. : ${TMPDIR:=$TMP}
  1963. : ${TMPDIR:=/tmp}
  1964. if ! check_cmd mktemp -u XXXXXX; then
  1965. # simple replacement for missing mktemp
  1966. # NOT SAFE FOR GENERAL USE
  1967. mktemp(){
  1968. echo "${2%%XXX*}.${HOSTNAME}.${UID}.$$"
  1969. }
  1970. fi
  1971. tmpfile(){
  1972. tmp=$(mktemp -u "${TMPDIR}/ffconf.XXXXXXXX")$2 &&
  1973. (set -C; exec > $tmp) 2>/dev/null ||
  1974. die "Unable to create temporary file in $TMPDIR."
  1975. append TMPFILES $tmp
  1976. eval $1=$tmp
  1977. }
  1978. trap 'rm -f -- $TMPFILES' EXIT
  1979. tmpfile TMPASM .asm
  1980. tmpfile TMPC .c
  1981. tmpfile TMPCPP .cpp
  1982. tmpfile TMPE $EXESUF
  1983. tmpfile TMPH .h
  1984. tmpfile TMPO .o
  1985. tmpfile TMPS .S
  1986. tmpfile TMPSH .sh
  1987. tmpfile TMPV .ver
  1988. unset -f mktemp
  1989. chmod +x $TMPE
  1990. # make sure we can execute files in $TMPDIR
  1991. cat > $TMPSH 2>> $logfile <<EOF
  1992. #! /bin/sh
  1993. EOF
  1994. chmod +x $TMPSH >> $logfile 2>&1
  1995. if ! $TMPSH >> $logfile 2>&1; then
  1996. cat <<EOF
  1997. Unable to create and execute files in $TMPDIR. Set the TMPDIR environment
  1998. variable to another directory and make sure that it is not mounted noexec.
  1999. EOF
  2000. die "Sanity test failed."
  2001. fi
  2002. filter_asflags=echo
  2003. filter_cflags=echo
  2004. filter_cppflags=echo
  2005. if $cc -v 2>&1 | grep -q '^gcc.*LLVM'; then
  2006. cc_type=llvm_gcc
  2007. cc_version=__VERSION__
  2008. gcc_extra_ver=$(expr "$($cc --version | head -n1)" : '.*\((.*)\)')
  2009. cc_ident="llvm-gcc $($cc -dumpversion) $gcc_extra_ver"
  2010. CC_DEPFLAGS='-MMD -MF $(@:.o=.d) -MT $@'
  2011. AS_DEPFLAGS='-MMD -MF $(@:.o=.d) -MT $@'
  2012. speed_cflags='-O3'
  2013. size_cflags='-Os'
  2014. elif $cc -v 2>&1 | grep -qi ^gcc; then
  2015. cc_type=gcc
  2016. cc_version=__VERSION__
  2017. gcc_version=$($cc --version | head -n1)
  2018. gcc_basever=$($cc -dumpversion)
  2019. gcc_pkg_ver=$(expr "$gcc_version" : '[^ ]* \(([^)]*)\)')
  2020. gcc_ext_ver=$(expr "$gcc_version" : ".*$gcc_pkg_ver $gcc_basever \\(.*\\)")
  2021. cc_ident=$(cleanws "gcc $gcc_basever $gcc_pkg_ver $gcc_ext_ver")
  2022. if ! $cc -dumpversion | grep -q '^2\.'; then
  2023. CC_DEPFLAGS='-MMD -MF $(@:.o=.d) -MT $@'
  2024. AS_DEPFLAGS='-MMD -MF $(@:.o=.d) -MT $@'
  2025. fi
  2026. speed_cflags='-O3'
  2027. size_cflags='-Os'
  2028. elif $cc --version 2>/dev/null | grep -q Intel; then
  2029. cc_type=icc
  2030. cc_version="AV_STRINGIFY(__INTEL_COMPILER)"
  2031. cc_ident=$($cc --version | head -n1)
  2032. icc_version=$($cc -dumpversion)
  2033. CC_DEPFLAGS='-MMD'
  2034. AS_DEPFLAGS='-MMD'
  2035. speed_cflags='-O3'
  2036. size_cflags='-Os'
  2037. noopt_cflags='-O1'
  2038. elif $cc -v 2>&1 | grep -q xlc; then
  2039. cc_type=xlc
  2040. cc_version="AV_STRINGIFY(__IBMC__)"
  2041. cc_ident=$($cc -qversion 2>/dev/null | head -n1)
  2042. speed_cflags='-O5'
  2043. size_cflags='-O5 -qcompact'
  2044. elif $cc -V 2>/dev/null | grep -q Compaq; then
  2045. cc_type=ccc
  2046. cc_version="AV_STRINGIFY(__DECC_VER)"
  2047. cc_ident=$($cc -V | head -n1 | cut -d' ' -f1-3)
  2048. DEPFLAGS='$(CPPFLAGS) $(CFLAGS) -M'
  2049. debuglevel=3
  2050. add_ldflags -Wl,-z,now # calls to libots crash without this
  2051. speed_cflags='-fast'
  2052. size_cflags='-O1'
  2053. elif $cc --vsn 2>/dev/null | grep -q "ARM C/C++ Compiler"; then
  2054. test -d "$sysroot" || die "No valid sysroot specified."
  2055. cc_type=armcc
  2056. cc_version="AV_STRINGIFY(__ARMCC_VERSION)"
  2057. cc_ident=$($cc --vsn | head -n1)
  2058. armcc_conf="$PWD/armcc.conf"
  2059. $cc --arm_linux_configure \
  2060. --arm_linux_config_file="$armcc_conf" \
  2061. --configure_sysroot="$sysroot" \
  2062. --configure_cpp_headers="$sysinclude" >>$logfile 2>&1 ||
  2063. die "Error creating armcc configuration file."
  2064. $cc --vsn | grep -q RVCT && armcc_opt=rvct || armcc_opt=armcc
  2065. cc="$cc --arm_linux_config_file=$armcc_conf --translate_gcc"
  2066. as_default="${cross_prefix}gcc"
  2067. CC_DEPFLAGS='-MMD'
  2068. AS_DEPFLAGS='-MMD'
  2069. speed_cflags='-O3'
  2070. size_cflags='-Os'
  2071. filter_asflags="filter_out -W${armcc_opt}*"
  2072. elif $cc -version 2>/dev/null | grep -q TMS470; then
  2073. cc_type=tms470
  2074. cc_version="AV_STRINGIFY(__TI_COMPILER_VERSION__)"
  2075. cc_ident=$($cc -version | head -n1 | tr -s ' ')
  2076. cc="$cc --gcc --abi=eabi -eo=.o -mc -me"
  2077. CC_O='-fr=$(@D)'
  2078. as_default="${cross_prefix}gcc"
  2079. ld_default="${cross_prefix}gcc"
  2080. TMPO=$(basename $TMPC .c).o
  2081. append TMPFILES $TMPO
  2082. add_cflags -D__gnuc_va_list=va_list -D__USER_LABEL_PREFIX__=
  2083. CC_DEPFLAGS='-ppa -ppd=$(@:.o=.d)'
  2084. AS_DEPFLAGS='-MMD'
  2085. speed_cflags='-O3 -mf=5'
  2086. size_cflags='-O3 -mf=2'
  2087. filter_cflags=tms470_flags
  2088. tms470_flags(){
  2089. for flag; do
  2090. case $flag in
  2091. -march=*|-mcpu=*)
  2092. case "${flag#*=}" in
  2093. armv7-a|cortex-a*) echo -mv=7a8 ;;
  2094. armv7-r|cortex-r*) echo -mv=7r4 ;;
  2095. armv7-m|cortex-m*) echo -mv=7m3 ;;
  2096. armv6*|arm11*) echo -mv=6 ;;
  2097. armv5*e|arm[79]*e*|arm9[24]6*|arm96*|arm102[26])
  2098. echo -mv=5e ;;
  2099. armv4*|arm7*|arm9[24]*) echo -mv=4 ;;
  2100. esac
  2101. ;;
  2102. -mfpu=neon) echo --float_support=vfpv3 --neon ;;
  2103. -mfpu=vfp) echo --float_support=vfpv2 ;;
  2104. -mfpu=vfpv3) echo --float_support=vfpv3 ;;
  2105. -msoft-float) echo --float_support=vfplib ;;
  2106. -O[0-3]|-mf=*) echo $flag ;;
  2107. -g) echo -g -mn ;;
  2108. -pds=*) echo $flag ;;
  2109. esac
  2110. done
  2111. }
  2112. elif $cc -v 2>&1 | grep -q clang; then
  2113. cc_type=clang
  2114. $cc -dM -E $TMPC | grep -q __clang_version__ &&
  2115. cc_version=__clang_version__ || cc_version=__VERSION__
  2116. cc_ident=$($cc --version | head -n1)
  2117. CC_DEPFLAGS='-MMD'
  2118. AS_DEPFLAGS='-MMD'
  2119. speed_cflags='-O3'
  2120. size_cflags='-Os'
  2121. elif $cc -V 2>&1 | grep -q Sun; then
  2122. cc_type=suncc
  2123. cc_version="AV_STRINGIFY(__SUNPRO_C)"
  2124. cc_ident=$($cc -V 2>&1 | head -n1 | cut -d' ' -f 2-)
  2125. DEPEND_CMD='$(DEPCC) $(DEPFLAGS) $< | sed -e "1s,^.*: ,$@: ," -e "\$$!s,\$$, \\\," -e "1!s,^.*: , ," > $(@:.o=.d)'
  2126. DEPFLAGS='$(CPPFLAGS) $(CFLAGS) -xM1'
  2127. add_ldflags -xc99
  2128. speed_cflags='-O5'
  2129. size_cflags='-O5 -xspace'
  2130. filter_cflags=suncc_flags
  2131. suncc_flags(){
  2132. for flag; do
  2133. case $flag in
  2134. -march=*|-mcpu=*)
  2135. case "${flag#*=}" in
  2136. native) echo -xtarget=native ;;
  2137. v9|niagara) echo -xarch=sparc ;;
  2138. ultrasparc) echo -xarch=sparcvis ;;
  2139. ultrasparc3|niagara2) echo -xarch=sparcvis2 ;;
  2140. i586|pentium) echo -xchip=pentium ;;
  2141. i686|pentiumpro|pentium2) echo -xtarget=pentium_pro ;;
  2142. pentium3*|c3-2) echo -xtarget=pentium3 ;;
  2143. pentium-m) echo -xarch=sse2 -xchip=pentium3 ;;
  2144. pentium4*) echo -xtarget=pentium4 ;;
  2145. prescott|nocona) echo -xarch=sse3 -xchip=pentium4 ;;
  2146. *-sse3) echo -xarch=sse3 ;;
  2147. core2) echo -xarch=ssse3 -xchip=core2 ;;
  2148. amdfam10|barcelona) echo -xarch=sse4_1 ;;
  2149. athlon-4|athlon-[mx]p) echo -xarch=ssea ;;
  2150. k8|opteron|athlon64|athlon-fx)
  2151. echo -xarch=sse2a ;;
  2152. athlon*) echo -xarch=pentium_proa ;;
  2153. esac
  2154. ;;
  2155. -std=c99) echo -xc99 ;;
  2156. -fomit-frame-pointer) echo -xregs=frameptr ;;
  2157. -fPIC) echo -KPIC -xcode=pic32 ;;
  2158. -W*,*) echo $flag ;;
  2159. -f*-*|-W*) ;;
  2160. *) echo $flag ;;
  2161. esac
  2162. done
  2163. }
  2164. elif $cc -v 2>&1 | grep -q 'PathScale\|Path64'; then
  2165. cc_type=pathscale
  2166. cc_version=__PATHSCALE__
  2167. cc_ident=$($cc -v 2>&1 | head -n1 | tr -d :)
  2168. CC_DEPFLAGS='-MMD -MF $(@:.o=.d) -MT $@'
  2169. AS_DEPFLAGS='-MMD -MF $(@:.o=.d) -MT $@'
  2170. speed_cflags='-O2'
  2171. size_cflags='-Os'
  2172. filter_cflags='filter_out -Wdisabled-optimization'
  2173. elif $cc -v 2>&1 | grep -q Open64; then
  2174. cc_type=open64
  2175. cc_version=__OPEN64__
  2176. cc_ident=$($cc -v 2>&1 | head -n1 | tr -d :)
  2177. CC_DEPFLAGS='-MMD -MF $(@:.o=.d) -MT $@'
  2178. AS_DEPFLAGS='-MMD -MF $(@:.o=.d) -MT $@'
  2179. speed_cflags='-O2'
  2180. size_cflags='-Os'
  2181. filter_cflags='filter_out -Wdisabled-optimization|-Wtype-limits|-fno-signed-zeros'
  2182. elif $cc -V 2>&1 | grep -q Portland; then
  2183. cc_type=pgi
  2184. cc_version='AV_STRINGIFY(__PGIC__.__PGIC_MINOR__.__PGIC_PATCHLEVEL__)'
  2185. cc_ident="PGI $($cc -V 2>&1 | awk '/^pgcc/ { print $2; exit }')"
  2186. opt_common='-alias=ansi -Mlre -Mpre'
  2187. speed_cflags="-O3 -Mautoinline -Munroll=c:4 $opt_common"
  2188. size_cflags="-O2 -Munroll=c:1 $opt_common"
  2189. noopt_cflags="-O1"
  2190. filter_cflags=pgi_flags
  2191. pgi_flags(){
  2192. for flag; do
  2193. case $flag in
  2194. -fomit-frame-pointer) echo -Mnoframe ;;
  2195. -g) echo -gopt ;;
  2196. *) echo $flag ;;
  2197. esac
  2198. done
  2199. }
  2200. fi
  2201. test -n "$cc_type" && enable $cc_type ||
  2202. warn "Unknown C compiler $cc, unable to select optimal CFLAGS"
  2203. : ${as_default:=$cc}
  2204. : ${dep_cc_default:=$cc}
  2205. : ${ld_default:=$cc}
  2206. set_default ar as dep_cc ld
  2207. test -n "$CC_DEPFLAGS" || CCDEP=$DEPEND_CMD
  2208. test -n "$CXX_DEPFLAGS" || CXXDEP=$DEPEND_CMD
  2209. test -n "$AS_DEPFLAGS" || ASDEP=$DEPEND_CMD
  2210. add_cflags $extra_cflags
  2211. add_cxxflags $extra_cxxflags
  2212. add_asflags $extra_cflags
  2213. if test -n "$sysroot"; then
  2214. case "$cc_type" in
  2215. gcc|llvm_gcc|clang)
  2216. add_cppflags --sysroot="$sysroot"
  2217. add_ldflags --sysroot="$sysroot"
  2218. ;;
  2219. tms470)
  2220. add_cppflags -I"$sysinclude"
  2221. add_ldflags --sysroot="$sysroot"
  2222. ;;
  2223. esac
  2224. fi
  2225. if test "$cpu" = host; then
  2226. enabled cross_compile && die "--cpu=host makes no sense when cross-compiling."
  2227. case "$cc_type" in
  2228. gcc|llvm_gcc)
  2229. check_native(){
  2230. $cc $1=native -v -c -o $TMPO $TMPC >$TMPE 2>&1 || return
  2231. sed -n "/cc1.*$1=/{
  2232. s/.*$1=\\([^ ]*\\).*/\\1/
  2233. p
  2234. q
  2235. }" $TMPE
  2236. }
  2237. cpu=$(check_native -march || check_native -mcpu)
  2238. ;;
  2239. esac
  2240. test "${cpu:-host}" = host && die "--cpu=host not supported with compiler $cc"
  2241. fi
  2242. # Deal with common $arch aliases
  2243. case "$arch" in
  2244. arm*|iPad*)
  2245. arch="arm"
  2246. ;;
  2247. mips|mipsel|IP*)
  2248. arch="mips"
  2249. ;;
  2250. mips64*)
  2251. arch="mips"
  2252. subarch="mips64"
  2253. ;;
  2254. parisc|hppa)
  2255. arch="parisc"
  2256. ;;
  2257. parisc64|hppa64)
  2258. arch="parisc"
  2259. subarch="parisc64"
  2260. ;;
  2261. "Power Macintosh"|ppc|powerpc|ppc64|powerpc64)
  2262. arch="ppc"
  2263. ;;
  2264. s390|s390x)
  2265. arch="s390"
  2266. ;;
  2267. sh4|sh)
  2268. arch="sh4"
  2269. ;;
  2270. sun4u|sparc64)
  2271. arch="sparc"
  2272. subarch="sparc64"
  2273. ;;
  2274. i[3-6]86|i86pc|BePC|x86pc|x86_64|x86_32|amd64)
  2275. arch="x86"
  2276. ;;
  2277. esac
  2278. is_in $arch $ARCH_LIST || warn "unknown architecture $arch"
  2279. enable $arch
  2280. # Add processor-specific flags
  2281. if test "$cpu" = generic; then
  2282. : do nothing
  2283. elif enabled ppc; then
  2284. case $(tolower $cpu) in
  2285. 601|ppc601|powerpc601)
  2286. cpuflags="-mcpu=601"
  2287. disable altivec
  2288. ;;
  2289. 603*|ppc603*|powerpc603*)
  2290. cpuflags="-mcpu=603"
  2291. disable altivec
  2292. ;;
  2293. 604*|ppc604*|powerpc604*)
  2294. cpuflags="-mcpu=604"
  2295. disable altivec
  2296. ;;
  2297. g3|75*|ppc75*|powerpc75*)
  2298. cpuflags="-mcpu=750 -mpowerpc-gfxopt"
  2299. disable altivec
  2300. ;;
  2301. g4|745*|ppc745*|powerpc745*)
  2302. cpuflags="-mcpu=7450 -mpowerpc-gfxopt"
  2303. ;;
  2304. 74*|ppc74*|powerpc74*)
  2305. cpuflags="-mcpu=7400 -mpowerpc-gfxopt"
  2306. ;;
  2307. g5|970|ppc970|powerpc970)
  2308. cpuflags="-mcpu=970 -mpowerpc-gfxopt -mpowerpc64"
  2309. ;;
  2310. power[3-7]*)
  2311. cpuflags="-mcpu=$cpu -mpowerpc-gfxopt -mpowerpc64"
  2312. ;;
  2313. cell)
  2314. cpuflags="-mcpu=cell"
  2315. enable ldbrx
  2316. ;;
  2317. e500v2)
  2318. cpuflags="-mcpu=8548 -mhard-float -mfloat-gprs=double"
  2319. disable altivec
  2320. ;;
  2321. e500)
  2322. cpuflags="-mcpu=8540 -mhard-float"
  2323. disable altivec
  2324. ;;
  2325. esac
  2326. elif enabled x86; then
  2327. case $cpu in
  2328. i[345]86|pentium)
  2329. cpuflags="-march=$cpu"
  2330. disable mmx
  2331. ;;
  2332. # targets that do NOT support conditional mov (cmov)
  2333. pentium-mmx|k6|k6-[23]|winchip-c6|winchip2|c3)
  2334. cpuflags="-march=$cpu"
  2335. disable cmov
  2336. ;;
  2337. # targets that do support conditional mov (cmov)
  2338. i686|pentiumpro|pentium[23]|pentium-m|athlon|athlon-tbird|athlon-4|athlon-[mx]p|athlon64*|k8*|opteron*|athlon-fx|core2|amdfam10|barcelona|atom)
  2339. cpuflags="-march=$cpu"
  2340. enable cmov
  2341. enable fast_cmov
  2342. ;;
  2343. # targets that do support conditional mov but on which it's slow
  2344. pentium4|pentium4m|prescott|nocona)
  2345. cpuflags="-march=$cpu"
  2346. enable cmov
  2347. disable fast_cmov
  2348. ;;
  2349. esac
  2350. elif enabled sparc; then
  2351. case $cpu in
  2352. niagara)
  2353. cpuflags="-mcpu=$cpu"
  2354. disable vis
  2355. ;;
  2356. sparc64)
  2357. cpuflags="-mcpu=v9"
  2358. ;;
  2359. esac
  2360. elif enabled arm; then
  2361. case $cpu in
  2362. armv*)
  2363. cpuflags="-march=$cpu"
  2364. subarch=$(echo $cpu | sed 's/[^a-z0-9]//g')
  2365. ;;
  2366. *)
  2367. cpuflags="-mcpu=$cpu"
  2368. case $cpu in
  2369. cortex-a*) subarch=armv7a ;;
  2370. cortex-r*) subarch=armv7r ;;
  2371. cortex-m*) enable thumb; subarch=armv7m ;;
  2372. arm11*) subarch=armv6 ;;
  2373. arm[79]*e*|arm9[24]6*|arm96*|arm102[26]) subarch=armv5te ;;
  2374. armv4*|arm7*|arm9[24]*) subarch=armv4 ;;
  2375. esac
  2376. ;;
  2377. esac
  2378. elif enabled alpha; then
  2379. enabled ccc && cpuflags="-arch $cpu" || cpuflags="-mcpu=$cpu"
  2380. elif enabled bfin; then
  2381. cpuflags="-mcpu=$cpu"
  2382. elif enabled mips; then
  2383. cpuflags="-march=$cpu"
  2384. case $cpu in
  2385. 24kc)
  2386. disable mipsfpu
  2387. disable mipsdspr1
  2388. disable mipsdspr2
  2389. ;;
  2390. 24kf*)
  2391. disable mipsdspr1
  2392. disable mipsdspr2
  2393. ;;
  2394. 24kec|34kc|1004kc)
  2395. disable mipsfpu
  2396. disable mipsdspr2
  2397. ;;
  2398. 24kef*|34kf*|1004kf*)
  2399. disable mipsdspr2
  2400. ;;
  2401. 74kc)
  2402. disable mipsfpu
  2403. ;;
  2404. esac
  2405. elif enabled avr32; then
  2406. case $cpu in
  2407. ap7[02]0[0-2])
  2408. subarch="avr32_ap"
  2409. cpuflags="-mpart=$cpu"
  2410. ;;
  2411. ap)
  2412. subarch="avr32_ap"
  2413. cpuflags="-march=$cpu"
  2414. ;;
  2415. uc3[ab]*)
  2416. subarch="avr32_uc"
  2417. cpuflags="-mcpu=$cpu"
  2418. ;;
  2419. uc)
  2420. subarch="avr32_uc"
  2421. cpuflags="-march=$cpu"
  2422. ;;
  2423. esac
  2424. fi
  2425. add_cflags $cpuflags
  2426. add_asflags $cpuflags
  2427. # compiler sanity check
  2428. check_exec <<EOF
  2429. int main(void){ return 0; }
  2430. EOF
  2431. if test "$?" != 0; then
  2432. echo "$cc is unable to create an executable file."
  2433. if test -z "$cross_prefix" && ! enabled cross_compile ; then
  2434. echo "If $cc is a cross-compiler, use the --enable-cross-compile option."
  2435. echo "Only do this if you know what cross compiling means."
  2436. fi
  2437. die "C compiler test failed."
  2438. fi
  2439. add_cppflags -D_ISOC99_SOURCE
  2440. add_cxxflags -D__STDC_CONSTANT_MACROS
  2441. check_cflags -std=c99
  2442. check_cc -D_FILE_OFFSET_BITS=64 <<EOF && add_cppflags -D_FILE_OFFSET_BITS=64
  2443. #include <stdlib.h>
  2444. EOF
  2445. check_cc -D_LARGEFILE_SOURCE <<EOF && add_cppflags -D_LARGEFILE_SOURCE
  2446. #include <stdlib.h>
  2447. EOF
  2448. check_host_cflags -std=c99
  2449. check_host_cflags -Wall
  2450. case "$arch" in
  2451. alpha|ia64|mips|parisc|sparc)
  2452. spic=$shared
  2453. ;;
  2454. x86)
  2455. subarch="x86_32"
  2456. check_code cc "" "int test[(int)sizeof(char*) - 7]" && subarch="x86_64"
  2457. if test "$subarch" = "x86_64"; then
  2458. spic=$shared
  2459. fi
  2460. ;;
  2461. ppc)
  2462. check_cc <<EOF && subarch="ppc64"
  2463. int test[(int)sizeof(char*) - 7];
  2464. EOF
  2465. ;;
  2466. esac
  2467. enable $subarch
  2468. enabled spic && enable pic
  2469. # OS specific
  2470. case $target_os in
  2471. haiku)
  2472. prefix_default="/boot/common"
  2473. network_extralibs="-lnetwork"
  2474. host_libs=
  2475. ;;
  2476. sunos)
  2477. FFSERVERLDFLAGS=""
  2478. SHFLAGS='-shared -Wl,-h,$$(@F)'
  2479. enabled x86 && SHFLAGS="-mimpure-text $SHFLAGS"
  2480. network_extralibs="-lsocket -lnsl"
  2481. add_cppflags -D__EXTENSIONS__ -D_XOPEN_SOURCE=600
  2482. # When using suncc to build, the Solaris linker will mark
  2483. # an executable with each instruction set encountered by
  2484. # the Solaris assembler. As our libraries contain their own
  2485. # guards for processor-specific code, instead suppress
  2486. # generation of the HWCAPS ELF section on Solaris x86 only.
  2487. enabled_all suncc x86 && echo "hwcap_1 = OVERRIDE;" > mapfile && add_ldflags -Wl,-M,mapfile
  2488. nm_opts='-P -g'
  2489. ;;
  2490. netbsd)
  2491. disable symver
  2492. oss_indev_extralibs="-lossaudio"
  2493. oss_outdev_extralibs="-lossaudio"
  2494. ;;
  2495. openbsd|bitrig)
  2496. # On OpenBSD 4.5. the compiler does not use PIC unless
  2497. # explicitly using -fPIC. FFmpeg builds fine without PIC,
  2498. # however the generated executable will not do anything
  2499. # (simply quits with exit-code 1, no crash, no output).
  2500. # Thus explicitly enable PIC here.
  2501. enable pic
  2502. disable symver
  2503. SHFLAGS='-shared'
  2504. SLIBNAME_WITH_MAJOR='$(SLIBNAME).$(LIBVERSION)'
  2505. oss_indev_extralibs="-lossaudio"
  2506. oss_outdev_extralibs="-lossaudio"
  2507. ;;
  2508. dragonfly)
  2509. disable symver
  2510. ;;
  2511. freebsd)
  2512. ;;
  2513. bsd/os)
  2514. add_extralibs -lpoll -lgnugetopt
  2515. strip="strip -d"
  2516. ;;
  2517. darwin)
  2518. gas="gas-preprocessor.pl $cc"
  2519. enabled ppc && add_asflags -force_cpusubtype_ALL
  2520. SHFLAGS='-dynamiclib -Wl,-single_module -Wl,-install_name,$(SHLIBDIR)/$(SLIBNAME_WITH_MAJOR),-current_version,$(LIBVERSION),-compatibility_version,$(LIBMAJOR)'
  2521. enabled x86_32 && append SHFLAGS -Wl,-read_only_relocs,suppress
  2522. strip="${strip} -x"
  2523. add_ldflags -Wl,-dynamic,-search_paths_first
  2524. SLIBSUF=".dylib"
  2525. SLIBNAME_WITH_VERSION='$(SLIBPREF)$(FULLNAME).$(LIBVERSION)$(SLIBSUF)'
  2526. SLIBNAME_WITH_MAJOR='$(SLIBPREF)$(FULLNAME).$(LIBMAJOR)$(SLIBSUF)'
  2527. FFSERVERLDFLAGS=-Wl,-bind_at_load
  2528. objformat="macho"
  2529. enabled x86_64 && objformat="macho64"
  2530. enabled_any pic shared ||
  2531. { check_cflags -mdynamic-no-pic && add_asflags -mdynamic-no-pic; }
  2532. ;;
  2533. mingw32*)
  2534. if test $target_os = "mingw32ce"; then
  2535. disable network
  2536. else
  2537. target_os=mingw32
  2538. fi
  2539. LIBTARGET=i386
  2540. if enabled x86_64; then
  2541. LIBTARGET=x64
  2542. elif enabled arm; then
  2543. LIBTARGET=arm-wince
  2544. fi
  2545. shlibdir_default="$bindir_default"
  2546. SLIBPREF=""
  2547. SLIBSUF=".dll"
  2548. SLIBNAME_WITH_VERSION='$(SLIBPREF)$(FULLNAME)-$(LIBVERSION)$(SLIBSUF)'
  2549. SLIBNAME_WITH_MAJOR='$(SLIBPREF)$(FULLNAME)-$(LIBMAJOR)$(SLIBSUF)'
  2550. SLIB_EXTRA_CMD='-lib.exe /machine:$(LIBTARGET) /def:$$(@:$(SLIBSUF)=.def) /out:$(SUBDIR)$(SLIBNAME:$(SLIBSUF)=.lib)'
  2551. SLIB_INSTALL_NAME='$(SLIBNAME_WITH_MAJOR)'
  2552. SLIB_INSTALL_LINKS=
  2553. SLIB_INSTALL_EXTRA_SHLIB='$(SLIBNAME:$(SLIBSUF)=.lib)'
  2554. SLIB_INSTALL_EXTRA_LIB='lib$(SLIBNAME:$(SLIBSUF)=.dll.a) $(SLIBNAME_WITH_MAJOR:$(SLIBSUF)=.def)'
  2555. SHFLAGS='-shared -Wl,--output-def,$$(@:$(SLIBSUF)=.def) -Wl,--out-implib,$(SUBDIR)lib$(SLIBNAME:$(SLIBSUF)=.dll.a) -Wl,--enable-runtime-pseudo-reloc -Wl,--enable-auto-image-base'
  2556. objformat="win32"
  2557. enable dos_paths
  2558. check_cflags -fno-common
  2559. check_cpp_condition _mingw.h "defined (__MINGW64_VERSION_MAJOR) || (__MINGW32_MAJOR_VERSION > 3) \
  2560. || (__MINGW32_MAJOR_VERSION == 3 && __MINGW32_MINOR_VERSION >= 15)" ||
  2561. die "ERROR: MinGW runtime version must be >= 3.15."
  2562. add_cppflags -U__STRICT_ANSI__
  2563. ;;
  2564. cygwin*)
  2565. target_os=cygwin
  2566. shlibdir_default="$bindir_default"
  2567. SLIBPREF="cyg"
  2568. SLIBSUF=".dll"
  2569. SLIBNAME_WITH_VERSION='$(SLIBPREF)$(FULLNAME)-$(LIBVERSION)$(SLIBSUF)'
  2570. SLIBNAME_WITH_MAJOR='$(SLIBPREF)$(FULLNAME)-$(LIBMAJOR)$(SLIBSUF)'
  2571. SHFLAGS='-shared -Wl,--enable-auto-image-base'
  2572. objformat="win32"
  2573. enable dos_paths
  2574. check_cflags -fno-common
  2575. add_cppflags -U__STRICT_ANSI__
  2576. ;;
  2577. *-dos|freedos|opendos)
  2578. network_extralibs="-lsocket"
  2579. objformat="coff"
  2580. enable dos_paths
  2581. add_cppflags -U__STRICT_ANSI__
  2582. ;;
  2583. linux)
  2584. add_cppflags -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600
  2585. enable dv1394
  2586. ;;
  2587. irix*)
  2588. target_os=irix
  2589. ranlib="echo ignoring ranlib"
  2590. ;;
  2591. os/2*)
  2592. strip="lxlite -CS"
  2593. ln_s="cp -f"
  2594. objformat="aout"
  2595. add_cppflags -D_GNU_SOURCE
  2596. add_ldflags -Zomf -Zbin-files -Zargs-wild -Zmap
  2597. SHFLAGS='$(SUBDIR)$(NAME).def -Zdll -Zomf'
  2598. FFSERVERLDFLAGS=""
  2599. LIBSUF="_s.a"
  2600. SLIBPREF=""
  2601. SLIBSUF=".dll"
  2602. SLIBNAME_WITH_VERSION='$(SLIBPREF)$(NAME)-$(LIBVERSION)$(SLIBSUF)'
  2603. SLIBNAME_WITH_MAJOR='$(SLIBPREF)$(shell echo $(NAME) | cut -c1-6)$(LIBMAJOR)$(SLIBSUF)'
  2604. SLIB_CREATE_DEF_CMD='echo LIBRARY $(SLIBNAME_WITH_MAJOR) INITINSTANCE TERMINSTANCE > $(SUBDIR)$(NAME).def; \
  2605. echo PROTMODE >> $(SUBDIR)$(NAME).def; \
  2606. echo CODE PRELOAD MOVEABLE DISCARDABLE >> $(SUBDIR)$(NAME).def; \
  2607. echo DATA PRELOAD MOVEABLE MULTIPLE NONSHARED >> $(SUBDIR)$(NAME).def; \
  2608. echo EXPORTS >> $(SUBDIR)$(NAME).def; \
  2609. emxexp -o $(OBJS) >> $(SUBDIR)$(NAME).def'
  2610. SLIB_EXTRA_CMD='emximp -o $(SUBDIR)$(LIBPREF)$(NAME)_dll.a $(SUBDIR)$(NAME).def; \
  2611. emximp -o $(SUBDIR)$(LIBPREF)$(NAME)_dll.lib $(SUBDIR)$(NAME).def;'
  2612. SLIB_INSTALL_EXTRA_LIB='$(LIBPREF)$(NAME)_dll.a $(LIBPREF)$(NAME)_dll.lib'
  2613. enable dos_paths
  2614. enable_weak os2threads
  2615. ;;
  2616. gnu/kfreebsd)
  2617. add_cppflags -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600 -D_BSD_SOURCE
  2618. ;;
  2619. gnu)
  2620. add_cppflags -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600
  2621. ;;
  2622. qnx)
  2623. add_cppflags -D_QNX_SOURCE
  2624. network_extralibs="-lsocket"
  2625. ;;
  2626. symbian)
  2627. SLIBSUF=".dll"
  2628. enable dos_paths
  2629. add_cflags --include=$sysinclude/gcce/gcce.h -fvisibility=default
  2630. add_cppflags -D__GCCE__ -D__SYMBIAN32__ -DSYMBIAN_OE_POSIX_SIGNALS
  2631. add_ldflags -Wl,--target1-abs,--no-undefined \
  2632. -Wl,-Ttext,0x80000,-Tdata,0x1000000 -shared \
  2633. -Wl,--entry=_E32Startup -Wl,-u,_E32Startup
  2634. add_extralibs -l:eexe.lib -l:usrt2_2.lib -l:dfpaeabi.dso \
  2635. -l:drtaeabi.dso -l:scppnwdl.dso -lsupc++ -lgcc \
  2636. -l:libc.dso -l:libm.dso -l:euser.dso -l:libcrt0.lib
  2637. ;;
  2638. none)
  2639. ;;
  2640. *)
  2641. die "Unknown OS '$target_os'."
  2642. ;;
  2643. esac
  2644. esc(){
  2645. echo "$*" | sed 's/%/%25/g;s/:/%3a/g'
  2646. }
  2647. echo "config:$arch:$subarch:$cpu:$target_os:$(esc $cc_ident):$(esc $FFMPEG_CONFIGURATION)" >config.fate
  2648. check_cpp_condition stdlib.h "defined(__PIC__) || defined(__pic__) || defined(PIC)" && enable pic
  2649. set_default $PATHS_LIST
  2650. # we need to build at least one lib type
  2651. if ! enabled_any static shared; then
  2652. cat <<EOF
  2653. At least one library type must be built.
  2654. Specify --enable-static to build the static libraries or --enable-shared to
  2655. build the shared libraries as well. To only build the shared libraries specify
  2656. --disable-static in addition to --enable-shared.
  2657. EOF
  2658. exit 1;
  2659. fi
  2660. die_license_disabled() {
  2661. enabled $1 || { enabled $2 && die "$2 is $1 and --enable-$1 is not specified."; }
  2662. }
  2663. die_license_disabled_gpl() {
  2664. enabled $1 || { enabled $2 && die "$2 is incompatible with the gpl and --enable-$1 is not specified."; }
  2665. }
  2666. die_license_disabled gpl libcdio
  2667. die_license_disabled gpl libutvideo
  2668. die_license_disabled gpl libx264
  2669. die_license_disabled gpl libxavs
  2670. die_license_disabled gpl libxvid
  2671. die_license_disabled gpl x11grab
  2672. die_license_disabled nonfree libaacplus
  2673. die_license_disabled nonfree libfaac
  2674. enabled gpl && die_license_disabled_gpl nonfree openssl
  2675. die_license_disabled version3 libopencore_amrnb
  2676. die_license_disabled version3 libopencore_amrwb
  2677. die_license_disabled version3 libvo_aacenc
  2678. die_license_disabled version3 libvo_amrwbenc
  2679. enabled version3 && { enabled gpl && enable gplv3 || enable lgplv3; }
  2680. disabled optimizations || check_cflags -fomit-frame-pointer
  2681. enable_pic() {
  2682. enable pic
  2683. add_cppflags -DPIC
  2684. add_cflags -fPIC
  2685. add_asflags -fPIC
  2686. }
  2687. enabled pic && enable_pic
  2688. check_cc <<EOF || die "Symbol mangling check failed."
  2689. int ff_extern;
  2690. EOF
  2691. sym=$($nm $nm_opts $TMPO | awk '/ff_extern/{ print substr($0, match($0, /[^ \t]*ff_extern/)) }')
  2692. extern_prefix=${sym%%ff_extern*}
  2693. check_cc <<EOF && enable inline_asm
  2694. void foo(void) { __asm__ volatile ("" ::); }
  2695. EOF
  2696. _restrict=
  2697. for restrict_keyword in restrict __restrict__ __restrict; do
  2698. check_cc <<EOF && _restrict=$restrict_keyword && break
  2699. void foo(char * $restrict_keyword p);
  2700. EOF
  2701. done
  2702. check_cc <<EOF && enable attribute_packed
  2703. struct { int x; } __attribute__((packed)) x;
  2704. EOF
  2705. check_cc <<EOF && enable attribute_may_alias
  2706. union { int x; } __attribute__((may_alias)) x;
  2707. EOF
  2708. check_cc <<EOF || die "endian test failed"
  2709. unsigned int endian = 'B' << 24 | 'I' << 16 | 'G' << 8 | 'E';
  2710. EOF
  2711. od -t x1 $TMPO | grep -q '42 *49 *47 *45' && enable bigendian
  2712. if enabled alpha; then
  2713. check_cflags -mieee
  2714. elif enabled arm; then
  2715. enabled thumb && check_cflags -mthumb || check_cflags -marm
  2716. nogas=die
  2717. if check_cpp_condition stddef.h "defined __ARM_PCS_VFP"; then
  2718. enable vfp_args
  2719. elif ! check_cpp_condition stddef.h "defined __ARM_PCS || defined __SOFTFP__"; then
  2720. case "${cross_prefix:-$cc}" in
  2721. *hardfloat*) enable vfp_args; fpabi=vfp ;;
  2722. *) check_ld "cc" <<EOF && enable vfp_args && fpabi=vfp || fpabi=soft ;;
  2723. __asm__ (".eabi_attribute 28, 1");
  2724. int main(void) { return 0; }
  2725. EOF
  2726. esac
  2727. warn "Compiler does not indicate floating-point ABI, guessing $fpabi."
  2728. fi
  2729. enabled armv5te && check_asm armv5te '"qadd r0, r0, r0"'
  2730. enabled armv6 && check_asm armv6 '"sadd16 r0, r0, r0"'
  2731. enabled armv6t2 && check_asm armv6t2 '"movt r0, #0"'
  2732. enabled armvfp && check_asm armvfp '"fadds s0, s0, s0"'
  2733. enabled neon && check_asm neon '"vadd.i16 q0, q0, q0"'
  2734. enabled vfpv3 && check_asm vfpv3 '"vmov.f32 s0, #1.0"'
  2735. check_asm asm_mod_y '"vmul.i32 d0, d0, %y0" :: "x"(0)'
  2736. enabled_all armv6t2 shared !pic && enable_pic
  2737. elif enabled mips; then
  2738. check_asm loongson '"dmult.g $1, $2, $3"'
  2739. enabled mmi && check_asm mmi '"lq $2, 0($2)"'
  2740. enabled mips32r2 && add_cflags "-mips32r2" &&
  2741. check_asm mips32r2 '"rotr $t0, $t1, 1"'
  2742. enabled mipsdspr1 && add_cflags "-mdsp" && add_asflags "-mdsp" &&
  2743. check_asm mipsdspr1 '"addu.qb $t0, $t1, $t2"'
  2744. enabled mipsdspr2 && add_cflags "-mdspr2" && add_asflags "-mdspr2" &&
  2745. check_asm mipsdspr2 '"absq_s.qb $t0, $t1"'
  2746. enabled mipsfpu && add_cflags "-mhard-float" &&
  2747. check_asm mipsfpu '"madd.d $f0, $f2, $f4, $f6"'
  2748. elif enabled ppc; then
  2749. enable local_aligned_8 local_aligned_16
  2750. check_asm dcbzl '"dcbzl 0, %0" :: "r"(0)'
  2751. check_asm ibm_asm '"add 0, 0, 0"'
  2752. check_asm ppc4xx '"maclhw r10, r11, r12"'
  2753. check_asm xform_asm '"lwzx %1, %y0" :: "Z"(*(int*)0), "r"(0)'
  2754. # AltiVec flags: The FSF version of GCC differs from the Apple version
  2755. if enabled altivec; then
  2756. nogas=warn
  2757. check_cflags -maltivec -mabi=altivec &&
  2758. { check_header altivec.h && inc_altivec_h="#include <altivec.h>" ; } ||
  2759. check_cflags -faltivec
  2760. # check if our compiler supports Motorola AltiVec C API
  2761. check_cc <<EOF || disable altivec
  2762. $inc_altivec_h
  2763. int main(void) {
  2764. vector signed int v1, v2, v3;
  2765. v1 = vec_add(v2,v3);
  2766. return 0;
  2767. }
  2768. EOF
  2769. # check if our compiler supports braces for vector declarations
  2770. check_cc <<EOF || die "You need a compiler that supports {} in AltiVec vector declarations."
  2771. $inc_altivec_h
  2772. int main (void) { (vector int) {1}; return 0; }
  2773. EOF
  2774. fi
  2775. elif enabled sparc; then
  2776. enabled vis && check_asm vis '"pdist %f0, %f0, %f0"' -mcpu=ultrasparc &&
  2777. add_cflags -mcpu=ultrasparc -mtune=ultrasparc
  2778. elif enabled x86; then
  2779. check_code ld immintrin.h "__xgetbv(0)" "cc" && enable xgetbv
  2780. check_code ld intrin.h "int info[4]; __cpuid(info, 0)" "cc" && enable cpuid
  2781. check_code ld intrin.h "__rdtsc()" "cc" && enable rdtsc
  2782. check_code ld intrin.h "unsigned int x = __readeflags()" "cc" && enable rweflags
  2783. check_code ld mmintrin.h "_mm_empty()" "cc" && enable mm_empty
  2784. enable local_aligned_8 local_aligned_16
  2785. # check whether EBP is available on x86
  2786. # As 'i' is stored on the stack, this program will crash
  2787. # if the base pointer is used to access it because the
  2788. # base pointer is cleared in the inline assembly code.
  2789. check_exec_crash <<EOF && enable ebp_available
  2790. volatile int i=0;
  2791. __asm__ volatile (
  2792. "xorl %%ebp, %%ebp"
  2793. ::: "%ebp");
  2794. return i;
  2795. EOF
  2796. # check whether EBX is available on x86
  2797. check_asm ebx_available '""::"b"(0)' &&
  2798. check_asm ebx_available '"":::"%ebx"'
  2799. # check whether xmm clobbers are supported
  2800. check_asm xmm_clobbers '"":::"%xmm0"'
  2801. # check whether binutils is new enough to compile SSSE3/MMX2
  2802. enabled ssse3 && check_asm ssse3 '"pabsw %xmm0, %xmm0"'
  2803. enabled mmx2 && check_asm mmx2 '"pmaxub %mm0, %mm1"'
  2804. if ! disabled_any asm mmx yasm; then
  2805. if check_cmd $yasmexe --version; then
  2806. enabled x86_64 && yasm_extra="-m amd64"
  2807. yasm_debug="-g dwarf2"
  2808. elif check_cmd nasm -v; then
  2809. yasmexe=nasm
  2810. yasm_debug="-g -F dwarf"
  2811. enabled x86_64 && test "$objformat" = elf && objformat=elf64
  2812. fi
  2813. YASMFLAGS="-f $objformat $yasm_extra"
  2814. enabled pic && append YASMFLAGS "-DPIC"
  2815. test -n "$extern_prefix" && append YASMFLAGS "-DPREFIX"
  2816. case "$objformat" in
  2817. elf*) enabled debug && append YASMFLAGS $yasm_debug ;;
  2818. esac
  2819. check_yasm "pextrd [eax], xmm0, 1" && enable yasm ||
  2820. die "yasm not found, use --disable-yasm for a crippled build"
  2821. check_yasm "vextractf128 xmm0, ymm0, 0" || disable avx
  2822. fi
  2823. case "$cpu" in
  2824. athlon*|opteron*|k8*|pentium|pentium-mmx|prescott|nocona|atom|geode)
  2825. disable fast_clz
  2826. ;;
  2827. esac
  2828. fi
  2829. if enabled asm; then
  2830. as=${gas:=$as}
  2831. check_asm gnu_as '".macro m n\n\\n:.int 0\n.endm\nm x"' ||
  2832. $nogas "GNU assembler not found, install gas-preprocessor"
  2833. fi
  2834. check_ldflags -Wl,--as-needed
  2835. if check_func dlopen; then
  2836. ldl=
  2837. elif check_func dlopen -ldl; then
  2838. ldl=-ldl
  2839. fi
  2840. if enabled network; then
  2841. check_type "sys/types.h sys/socket.h" socklen_t
  2842. check_type netdb.h "struct addrinfo"
  2843. check_type netinet/in.h "struct group_source_req" -D_BSD_SOURCE
  2844. check_type netinet/in.h "struct ip_mreq_source" -D_BSD_SOURCE
  2845. check_type netinet/in.h "struct ipv6_mreq" -D_DARWIN_C_SOURCE
  2846. check_type netinet/in.h "struct sockaddr_in6"
  2847. check_type poll.h "struct pollfd"
  2848. check_type "sys/types.h sys/socket.h" "struct sockaddr_storage"
  2849. check_struct "sys/types.h sys/socket.h" "struct sockaddr" sa_len
  2850. check_header netinet/sctp.h
  2851. # Prefer arpa/inet.h over winsock2
  2852. if check_header arpa/inet.h ; then
  2853. check_func closesocket
  2854. elif check_header winsock2.h ; then
  2855. check_func_headers winsock2.h closesocket -lws2 && \
  2856. network_extralibs="-lws2" || \
  2857. { check_func_headers winsock2.h closesocket -lws2_32 && \
  2858. network_extralibs="-lws2_32"; }
  2859. check_type ws2tcpip.h socklen_t
  2860. check_type ws2tcpip.h "struct addrinfo"
  2861. check_type ws2tcpip.h "struct group_source_req"
  2862. check_type ws2tcpip.h "struct ip_mreq_source"
  2863. check_type ws2tcpip.h "struct ipv6_mreq"
  2864. check_type winsock2.h "struct pollfd"
  2865. check_type ws2tcpip.h "struct sockaddr_in6"
  2866. check_type ws2tcpip.h "struct sockaddr_storage"
  2867. check_struct winsock2.h "struct sockaddr" sa_len
  2868. else
  2869. disable network
  2870. fi
  2871. fi
  2872. # Solaris has nanosleep in -lrt, OpenSolaris no longer needs that
  2873. check_func nanosleep || { check_func nanosleep -lrt && add_extralibs -lrt; }
  2874. check_func clock_gettime || { check_func clock_gettime -lrt && add_extralibs -lrt; }
  2875. check_func fcntl
  2876. check_func fork
  2877. check_func getaddrinfo $network_extralibs
  2878. check_func gethrtime
  2879. check_func getrusage
  2880. check_struct "sys/time.h sys/resource.h" "struct rusage" ru_maxrss
  2881. check_func gettimeofday
  2882. check_func inet_aton $network_extralibs
  2883. check_func isatty
  2884. check_func localtime_r
  2885. check_func ${malloc_prefix}memalign && enable memalign
  2886. check_func mkstemp
  2887. check_func mmap
  2888. check_func ${malloc_prefix}posix_memalign && enable posix_memalign
  2889. check_func_headers malloc.h _aligned_malloc && enable aligned_malloc
  2890. check_func setrlimit
  2891. check_func strerror_r
  2892. check_func strptime
  2893. check_func sched_getaffinity
  2894. check_func sysconf
  2895. check_func sysctl
  2896. check_func usleep
  2897. check_func_headers conio.h kbhit
  2898. check_func_headers windows.h PeekNamedPipe
  2899. check_func_headers io.h setmode
  2900. check_func_headers lzo/lzo1x.h lzo1x_999_compress
  2901. check_lib2 "windows.h psapi.h" GetProcessMemoryInfo -lpsapi
  2902. check_func_headers windows.h GetProcessAffinityMask
  2903. check_func_headers windows.h GetProcessTimes
  2904. check_func_headers windows.h GetSystemTimeAsFileTime
  2905. check_func_headers windows.h MapViewOfFile
  2906. check_func_headers windows.h Sleep
  2907. check_func_headers windows.h VirtualAlloc
  2908. check_func_headers glob.h glob
  2909. check_header dlfcn.h
  2910. check_header dxva.h
  2911. check_header dxva2api.h -D_WIN32_WINNT=0x0600
  2912. check_header libcrystalhd/libcrystalhd_if.h
  2913. check_header malloc.h
  2914. check_header poll.h
  2915. check_header sys/mman.h
  2916. check_header sys/param.h
  2917. check_header sys/resource.h
  2918. check_header sys/select.h
  2919. check_header sys/time.h
  2920. check_header termios.h
  2921. check_header unistd.h
  2922. check_header vdpau/vdpau.h
  2923. check_header vdpau/vdpau_x11.h
  2924. check_header windows.h
  2925. check_header X11/extensions/XvMClib.h
  2926. check_header asm/types.h
  2927. disabled zlib || check_lib zlib.h zlibVersion -lz || disable zlib
  2928. disabled bzlib || check_lib2 bzlib.h BZ2_bzlibVersion -lbz2 || disable bzlib
  2929. # check for VDA header
  2930. if ! disabled vda; then
  2931. if check_header VideoDecodeAcceleration/VDADecoder.h; then
  2932. enable vda
  2933. add_extralibs -framework CoreFoundation -framework VideoDecodeAcceleration -framework QuartzCore
  2934. fi
  2935. fi
  2936. if ! disabled w32threads && ! enabled pthreads; then
  2937. check_func _beginthreadex && enable w32threads
  2938. fi
  2939. # check for some common methods of building with pthread support
  2940. # do this before the optional library checks as some of them require pthreads
  2941. if ! disabled pthreads && ! enabled w32threads && ! enabled os2threads; then
  2942. enable pthreads
  2943. if check_func pthread_create; then
  2944. :
  2945. elif check_func pthread_create -pthread; then
  2946. add_cflags -pthread
  2947. add_extralibs -pthread
  2948. elif check_func pthread_create -pthreads; then
  2949. add_cflags -pthreads
  2950. add_extralibs -pthreads
  2951. elif check_func pthread_create -lpthreadGC2; then
  2952. add_extralibs -lpthreadGC2
  2953. elif ! check_lib pthread.h pthread_create -lpthread; then
  2954. disable pthreads
  2955. fi
  2956. fi
  2957. for thread in $THREADS_LIST; do
  2958. if enabled $thread; then
  2959. test -n "$thread_type" &&
  2960. die "ERROR: Only one thread type must be selected." ||
  2961. thread_type="$thread"
  2962. fi
  2963. done
  2964. if enabled pthreads; then
  2965. check_func pthread_cancel
  2966. fi
  2967. check_lib math.h sin -lm && LIBM="-lm"
  2968. disabled crystalhd || check_lib libcrystalhd/libcrystalhd_if.h DtsCrystalHDVersion -lcrystalhd || disable crystalhd
  2969. enabled vaapi && require vaapi va/va.h vaInitialize -lva
  2970. check_mathfunc cbrtf
  2971. check_mathfunc exp2
  2972. check_mathfunc exp2f
  2973. check_mathfunc isinf
  2974. check_mathfunc isnan
  2975. check_mathfunc llrint
  2976. check_mathfunc llrintf
  2977. check_mathfunc log2
  2978. check_mathfunc log2f
  2979. check_mathfunc lrint
  2980. check_mathfunc lrintf
  2981. check_mathfunc round
  2982. check_mathfunc roundf
  2983. check_mathfunc trunc
  2984. check_mathfunc truncf
  2985. # these are off by default, so fail if requested and not available
  2986. enabled avisynth && require2 vfw32 "windows.h vfw.h" AVIFileInit -lavifil32
  2987. enabled fontconfig && require_pkg_config fontconfig "fontconfig/fontconfig.h" FcInit
  2988. enabled frei0r && { check_header frei0r.h || die "ERROR: frei0r.h header not found"; }
  2989. enabled gnutls && require_pkg_config gnutls gnutls/gnutls.h gnutls_global_init
  2990. enabled libiec61883 && require libiec61883 libiec61883/iec61883.h iec61883_cmp_connect -lraw1394 -lavc1394 -lrom1394 -liec61883
  2991. enabled libaacplus && require "libaacplus >= 2.0.0" aacplus.h aacplusEncOpen -laacplus
  2992. enabled libass && require_pkg_config libass ass/ass.h ass_library_init
  2993. enabled libbluray && require libbluray libbluray/bluray.h bd_open -lbluray
  2994. enabled libcelt && require libcelt celt/celt.h celt_decode -lcelt0 &&
  2995. { check_lib celt/celt.h celt_decoder_create_custom -lcelt0 ||
  2996. die "ERROR: libcelt version must be >= 0.11.0."; }
  2997. enabled libfaac && require2 libfaac "stdint.h faac.h" faacEncGetVersion -lfaac
  2998. enabled libfreetype && require_pkg_config freetype2 "ft2build.h freetype/freetype.h" FT_Init_FreeType
  2999. enabled libgsm && require libgsm gsm/gsm.h gsm_create -lgsm
  3000. enabled libilbc && require libilbc ilbc.h WebRtcIlbcfix_InitDecode -lilbc
  3001. enabled libmodplug && require libmodplug libmodplug/modplug.h ModPlug_Load -lmodplug
  3002. enabled libmp3lame && require "libmp3lame >= 3.98.3" lame/lame.h lame_set_VBR_quality -lmp3lame
  3003. enabled libnut && require libnut libnut.h nut_demuxer_init -lnut
  3004. enabled libopencore_amrnb && require libopencore_amrnb opencore-amrnb/interf_dec.h Decoder_Interface_init -lopencore-amrnb
  3005. enabled libopencore_amrwb && require libopencore_amrwb opencore-amrwb/dec_if.h D_IF_init -lopencore-amrwb
  3006. enabled libopencv && require_pkg_config opencv opencv/cxcore.h cvCreateImageHeader
  3007. enabled libopenjpeg && require libopenjpeg openjpeg.h opj_version -lopenjpeg
  3008. enabled libpulse && require_pkg_config libpulse-simple pulse/simple.h pa_simple_new
  3009. enabled librtmp && require_pkg_config librtmp librtmp/rtmp.h RTMP_Socket
  3010. enabled libschroedinger && require_pkg_config schroedinger-1.0 schroedinger/schro.h schro_init
  3011. enabled libspeex && require libspeex speex/speex.h speex_decoder_init -lspeex
  3012. enabled libstagefright_h264 && require_cpp libstagefright_h264 "binder/ProcessState.h media/stagefright/MetaData.h
  3013. media/stagefright/MediaBufferGroup.h media/stagefright/MediaDebug.h media/stagefright/MediaDefs.h
  3014. media/stagefright/OMXClient.h media/stagefright/OMXCodec.h" android::OMXClient -lstagefright -lmedia -lutils -lbinder -lgnustl_static
  3015. enabled libtheora && require libtheora theora/theoraenc.h th_info_init -ltheoraenc -ltheoradec -logg
  3016. enabled libutvideo && require_cpp utvideo "stdint.h stdlib.h utvideo/utvideo.h utvideo/Codec.h" 'CCodec*' -lutvideo -lstdc++
  3017. enabled libv4l2 && require_pkg_config libv4l2 libv4l2.h v4l2_ioctl
  3018. enabled libvo_aacenc && require libvo_aacenc vo-aacenc/voAAC.h voGetAACEncAPI -lvo-aacenc
  3019. enabled libvo_amrwbenc && require libvo_amrwbenc vo-amrwbenc/enc_if.h E_IF_init -lvo-amrwbenc
  3020. enabled libvorbis && require libvorbis vorbis/vorbisenc.h vorbis_info_init -lvorbisenc -lvorbis -logg
  3021. enabled libvpx && {
  3022. enabled libvpx_decoder && { check_lib2 "vpx/vpx_decoder.h vpx/vp8dx.h" vpx_codec_dec_init_ver -lvpx ||
  3023. die "ERROR: libvpx decoder version must be >=0.9.1"; }
  3024. enabled libvpx_encoder && { check_lib2 "vpx/vpx_encoder.h vpx/vp8cx.h" "vpx_codec_enc_init_ver VP8E_SET_MAX_INTRA_BITRATE_PCT" -lvpx ||
  3025. die "ERROR: libvpx encoder version must be >=0.9.7"; } }
  3026. enabled libx264 && require libx264 x264.h x264_encoder_encode -lx264 &&
  3027. { check_cpp_condition x264.h "X264_BUILD >= 118" ||
  3028. die "ERROR: libx264 version must be >= 0.118."; }
  3029. enabled libxavs && require libxavs xavs.h xavs_encoder_encode -lxavs
  3030. enabled libxvid && require libxvid xvid.h xvid_global -lxvidcore
  3031. enabled openal && { { for al_libs in "${OPENAL_LIBS}" "-lopenal" "-lOpenAL32"; do
  3032. check_lib 'AL/al.h' alGetError "${al_libs}" && break; done } ||
  3033. die "ERROR: openal not found"; } &&
  3034. { check_cpp_condition "AL/al.h" "defined(AL_VERSION_1_1)" ||
  3035. die "ERROR: openal version must be 1.1 or compatible"; }
  3036. enabled openssl && { check_lib openssl/ssl.h SSL_library_init -lssl -lcrypto ||
  3037. check_lib openssl/ssl.h SSL_library_init -lssl32 -leay32 ||
  3038. check_lib openssl/ssl.h SSL_library_init -lssl -lcrypto -lws2_32 -lgdi32 ||
  3039. die "ERROR: openssl not found"; }
  3040. # libdc1394 check
  3041. if enabled libdc1394; then
  3042. { check_lib dc1394/dc1394.h dc1394_new -ldc1394 -lraw1394 &&
  3043. enable libdc1394_2; } ||
  3044. { check_lib libdc1394/dc1394_control.h dc1394_create_handle -ldc1394_control -lraw1394 &&
  3045. enable libdc1394_1; } ||
  3046. die "ERROR: No version of libdc1394 found "
  3047. fi
  3048. SDL_CONFIG="${cross_prefix}sdl-config"
  3049. if check_pkg_config sdl SDL_events.h SDL_PollEvent; then
  3050. check_cpp_condition SDL.h "(SDL_MAJOR_VERSION<<16 | SDL_MINOR_VERSION<<8 | SDL_PATCHLEVEL) >= 0x010201" $sdl_cflags &&
  3051. enable sdl &&
  3052. check_struct SDL.h SDL_VideoInfo current_w $sdl_cflags && enable sdl_video_size
  3053. else
  3054. if "${SDL_CONFIG}" --version > /dev/null 2>&1; then
  3055. sdl_cflags=$("${SDL_CONFIG}" --cflags)
  3056. sdl_libs=$("${SDL_CONFIG}" --libs)
  3057. check_func_headers SDL_version.h SDL_Linked_Version $sdl_cflags $sdl_libs &&
  3058. check_cpp_condition SDL.h "(SDL_MAJOR_VERSION<<16 | SDL_MINOR_VERSION<<8 | SDL_PATCHLEVEL) >= 0x010201" $sdl_cflags &&
  3059. enable sdl &&
  3060. check_struct SDL.h SDL_VideoInfo current_w $sdl_cflags && enable sdl_video_size
  3061. fi
  3062. fi
  3063. enabled sdl && add_cflags $sdl_cflags && add_extralibs $sdl_libs
  3064. texi2html -version > /dev/null 2>&1 && enable texi2html || disable texi2html
  3065. makeinfo --version > /dev/null 2>&1 && enable makeinfo || disable makeinfo
  3066. check_header linux/fb.h
  3067. check_header linux/videodev.h
  3068. check_header linux/videodev2.h
  3069. check_struct linux/videodev2.h "struct v4l2_frmivalenum" discrete
  3070. check_header sys/videoio.h
  3071. check_func_headers "windows.h vfw.h" capCreateCaptureWindow "$vfwcap_indev_extralibs"
  3072. # check that WM_CAP_DRIVER_CONNECT is defined to the proper value
  3073. # w32api 3.12 had it defined wrong
  3074. check_cpp_condition vfw.h "WM_CAP_DRIVER_CONNECT > WM_USER" && enable vfwcap_defines
  3075. check_type "dshow.h" IBaseFilter
  3076. # check for ioctl_meteor.h, ioctl_bt848.h and alternatives
  3077. { check_header dev/bktr/ioctl_meteor.h &&
  3078. check_header dev/bktr/ioctl_bt848.h; } ||
  3079. { check_header machine/ioctl_meteor.h &&
  3080. check_header machine/ioctl_bt848.h; } ||
  3081. { check_header dev/video/meteor/ioctl_meteor.h &&
  3082. check_header dev/video/bktr/ioctl_bt848.h; } ||
  3083. check_header dev/ic/bt8xx.h
  3084. check_header sndio.h
  3085. if check_struct sys/soundcard.h audio_buf_info bytes; then
  3086. enable_safe sys/soundcard.h
  3087. else
  3088. check_cc -D__BSD_VISIBLE -D__XSI_VISIBLE <<EOF && add_cppflags -D__BSD_VISIBLE -D__XSI_VISIBLE && enable_safe sys/soundcard.h
  3089. #include <sys/soundcard.h>
  3090. audio_buf_info abc;
  3091. EOF
  3092. fi
  3093. check_header soundcard.h
  3094. enabled_any alsa_indev alsa_outdev && check_lib2 alsa/asoundlib.h snd_pcm_htimestamp -lasound
  3095. enabled jack_indev && check_lib2 jack/jack.h jack_client_open -ljack && check_func sem_timedwait &&
  3096. check_func jack_port_get_latency_range -ljack
  3097. enabled_any sndio_indev sndio_outdev && check_lib2 sndio.h sio_open -lsndio
  3098. enabled libcdio &&
  3099. check_lib2 "cdio/cdda.h cdio/paranoia.h" cdio_cddap_open "-lcdio_paranoia -lcdio_cdda -lcdio"
  3100. enabled x11grab &&
  3101. require X11 X11/Xlib.h XOpenDisplay -lX11 &&
  3102. require Xext X11/extensions/XShm.h XShmCreateImage -lXext &&
  3103. require Xfixes X11/extensions/Xfixes.h XFixesGetCursorImage -lXfixes
  3104. if ! disabled vaapi; then
  3105. check_lib va/va.h vaInitialize -lva && {
  3106. check_cpp_condition va/va_version.h "VA_CHECK_VERSION(0,32,0)" ||
  3107. warn "Please upgrade to VA-API >= 0.32 if you would like full VA-API support.";
  3108. } || disable vaapi
  3109. fi
  3110. if ! disabled vdpau && enabled vdpau_vdpau_h; then
  3111. check_cpp_condition \
  3112. vdpau/vdpau.h "defined VDP_DECODER_PROFILE_MPEG4_PART2_ASP" ||
  3113. { echolog "Please upgrade to libvdpau >= 0.2 if you would like vdpau support." &&
  3114. disable vdpau; }
  3115. fi
  3116. enabled debug && add_cflags -g"$debuglevel" && add_asflags -g"$debuglevel"
  3117. enabled coverage && add_cflags "-fprofile-arcs -ftest-coverage" && add_ldflags "-fprofile-arcs -ftest-coverage"
  3118. test -n "$valgrind" && target_exec="$valgrind --error-exitcode=1 --malloc-fill=0x2a --track-origins=yes --leak-check=full --gen-suppressions=all --suppressions=$source_path/tests/fate-valgrind.supp"
  3119. # add some useful compiler flags if supported
  3120. check_cflags -Wdeclaration-after-statement
  3121. check_cflags -Wall
  3122. check_cflags -Wno-parentheses
  3123. check_cflags -Wno-switch
  3124. check_cflags -Wno-format-zero-length
  3125. check_cflags -Wdisabled-optimization
  3126. check_cflags -Wpointer-arith
  3127. check_cflags -Wredundant-decls
  3128. check_cflags -Wno-pointer-sign
  3129. check_cflags -Wwrite-strings
  3130. check_cflags -Wtype-limits
  3131. check_cflags -Wundef
  3132. check_cflags -Wmissing-prototypes
  3133. check_cflags -Wno-pointer-to-int-cast
  3134. check_cflags -Wstrict-prototypes
  3135. enabled extra_warnings && check_cflags -Winline
  3136. # add some linker flags
  3137. check_ldflags -Wl,--warn-common
  3138. check_ldflags -Wl,-rpath-link=libpostproc:libswresample:libswscale:libavfilter:libavdevice:libavformat:libavcodec:libavutil:libavresample
  3139. test_ldflags -Wl,-Bsymbolic && append SHFLAGS -Wl,-Bsymbolic
  3140. enabled xmm_clobber_test && \
  3141. check_ldflags -Wl,--wrap,avcodec_open2 \
  3142. -Wl,--wrap,avcodec_decode_audio4 \
  3143. -Wl,--wrap,avcodec_decode_video2 \
  3144. -Wl,--wrap,avcodec_decode_subtitle2 \
  3145. -Wl,--wrap,avcodec_encode_audio2 \
  3146. -Wl,--wrap,avcodec_encode_video \
  3147. -Wl,--wrap,avcodec_encode_subtitle \
  3148. -Wl,--wrap,sws_scale || \
  3149. disable xmm_clobber_test
  3150. echo "X{};" > $TMPV
  3151. if test_ldflags -Wl,--version-script,$TMPV; then
  3152. append SHFLAGS '-Wl,--version-script,\$(SUBDIR)lib\$(NAME).ver'
  3153. check_cc <<EOF && enable symver_asm_label
  3154. void ff_foo(void) __asm__ ("av_foo@VERSION");
  3155. void ff_foo(void) { ${inline_asm+__asm__($quotes);} }
  3156. EOF
  3157. check_cc <<EOF && enable symver_gnu_asm
  3158. __asm__(".symver ff_foo,av_foo@VERSION");
  3159. void ff_foo(void) {}
  3160. EOF
  3161. fi
  3162. if [ -n "$optflags" ]; then
  3163. add_cflags $optflags
  3164. elif enabled small; then
  3165. add_cflags $size_cflags
  3166. elif enabled optimizations; then
  3167. add_cflags $speed_cflags
  3168. else
  3169. add_cflags $noopt_cflags
  3170. fi
  3171. check_cflags -fno-math-errno
  3172. check_cflags -fno-signed-zeros
  3173. check_cc -mno-red-zone <<EOF && noredzone_flags="-mno-red-zone"
  3174. int x;
  3175. EOF
  3176. if enabled icc; then
  3177. # Just warnings, no remarks
  3178. check_cflags -w1
  3179. # -wd: Disable following warnings
  3180. # 144, 167, 556: -Wno-pointer-sign
  3181. # 1292: attribute "foo" ignored
  3182. # 1419: external declaration in primary source file
  3183. # 10006: ignoring unknown option -fno-signed-zeros
  3184. # 10148: ignoring unknown option -Wno-parentheses
  3185. # 10156: ignoring option '-W'; no argument required
  3186. check_cflags -wd144,167,556,1292,1419,10006,10148,10156
  3187. # 11030: Warning unknown option --as-needed
  3188. # 10156: ignoring option '-export'; no argument required
  3189. check_ldflags -wd10156,11030
  3190. # Allow to compile with optimizations
  3191. check_ldflags -march=$cpu
  3192. # icc 11.0 and 11.1 work with ebp_available, but don't pass the test
  3193. enable ebp_available
  3194. if enabled x86_32; then
  3195. test ${icc_version%%.*} -ge 11 && \
  3196. check_cflags -falign-stack=maintain-16-byte || \
  3197. disable aligned_stack
  3198. fi
  3199. elif enabled ccc; then
  3200. # disable some annoying warnings
  3201. add_cflags -msg_disable cvtu32to64
  3202. add_cflags -msg_disable embedcomment
  3203. add_cflags -msg_disable needconstext
  3204. add_cflags -msg_disable nomainieee
  3205. add_cflags -msg_disable ptrmismatch1
  3206. add_cflags -msg_disable unreachcode
  3207. elif enabled gcc; then
  3208. check_cflags -fno-tree-vectorize
  3209. check_cflags -Werror=implicit-function-declaration
  3210. check_cflags -Werror=missing-prototypes
  3211. elif enabled llvm_gcc; then
  3212. check_cflags -mllvm -stack-alignment=16
  3213. elif enabled clang; then
  3214. check_cflags -mllvm -stack-alignment=16
  3215. check_cflags -Qunused-arguments
  3216. elif enabled armcc; then
  3217. # 2523: use of inline assembler is deprecated
  3218. add_cflags -W${armcc_opt},--diag_suppress=2523
  3219. add_cflags -W${armcc_opt},--diag_suppress=1207
  3220. add_cflags -W${armcc_opt},--diag_suppress=1293 # assignment in condition
  3221. add_cflags -W${armcc_opt},--diag_suppress=3343 # hardfp compat
  3222. add_cflags -W${armcc_opt},--diag_suppress=167 # pointer sign
  3223. add_cflags -W${armcc_opt},--diag_suppress=513 # pointer sign
  3224. elif enabled tms470; then
  3225. add_cflags -pds=824 -pds=837
  3226. elif enabled pathscale; then
  3227. add_cflags -fstrict-overflow -OPT:wrap_around_unsafe_opt=OFF
  3228. fi
  3229. enabled_any $THREADS_LIST && enable threads
  3230. check_deps $CONFIG_LIST \
  3231. $CONFIG_EXTRA \
  3232. $HAVE_LIST \
  3233. $ALL_COMPONENTS \
  3234. $ALL_TESTS \
  3235. enabled asm || { arch=c; disable $ARCH_LIST $ARCH_EXT_LIST; }
  3236. if test $target_os = "haiku"; then
  3237. disable memalign
  3238. disable posix_memalign
  3239. fi
  3240. ! enabled_any memalign posix_memalign aligned_malloc &&
  3241. enabled_any $need_memalign && enable memalign_hack
  3242. # add_dep lib dep
  3243. # -> enable ${lib}_deps_${dep}
  3244. # -> add $dep to ${lib}_deps only once
  3245. add_dep() {
  3246. lib=$1
  3247. dep=$2
  3248. enabled "${lib}_deps_${dep}" && return 0
  3249. enable "${lib}_deps_${dep}"
  3250. prepend "${lib}_deps" $dep
  3251. }
  3252. # merge deps lib components
  3253. # merge all ${component}_deps into ${lib}_deps and ${lib}_deps_*
  3254. merge_deps() {
  3255. lib=$1
  3256. shift
  3257. for comp in $*; do
  3258. enabled $comp || continue
  3259. eval "dep=\"\$${comp}_deps\""
  3260. for d in $dep; do
  3261. add_dep $lib $d
  3262. done
  3263. done
  3264. }
  3265. merge_deps libavfilter $FILTER_LIST
  3266. echo "install prefix $prefix"
  3267. echo "source path $source_path"
  3268. echo "C compiler $cc"
  3269. echo "ARCH $arch ($cpu)"
  3270. if test "$build_suffix" != ""; then
  3271. echo "build suffix $build_suffix"
  3272. fi
  3273. if test "$progs_suffix" != ""; then
  3274. echo "progs suffix $progs_suffix"
  3275. fi
  3276. if test "$extra_version" != ""; then
  3277. echo "version string suffix $extra_version"
  3278. fi
  3279. echo "big-endian ${bigendian-no}"
  3280. echo "runtime cpu detection ${runtime_cpudetect-no}"
  3281. if enabled x86; then
  3282. echo "${yasmexe} ${yasm-no}"
  3283. echo "MMX enabled ${mmx-no}"
  3284. echo "MMX2 enabled ${mmx2-no}"
  3285. echo "3DNow! enabled ${amd3dnow-no}"
  3286. echo "3DNow! extended enabled ${amd3dnowext-no}"
  3287. echo "SSE enabled ${sse-no}"
  3288. echo "SSSE3 enabled ${ssse3-no}"
  3289. echo "AVX enabled ${avx-no}"
  3290. echo "CMOV enabled ${cmov-no}"
  3291. echo "CMOV is fast ${fast_cmov-no}"
  3292. echo "EBX available ${ebx_available-no}"
  3293. echo "EBP available ${ebp_available-no}"
  3294. fi
  3295. if enabled arm; then
  3296. echo "ARMv5TE enabled ${armv5te-no}"
  3297. echo "ARMv6 enabled ${armv6-no}"
  3298. echo "ARMv6T2 enabled ${armv6t2-no}"
  3299. echo "ARM VFP enabled ${armvfp-no}"
  3300. echo "NEON enabled ${neon-no}"
  3301. fi
  3302. if enabled mips; then
  3303. echo "MMI enabled ${mmi-no}"
  3304. echo "MIPS FPU enabled ${mipsfpu-no}"
  3305. echo "MIPS32R2 enabled ${mips32r2-no}"
  3306. echo "MIPS DSP R1 enabled ${mipsdspr1-no}"
  3307. echo "MIPS DSP R2 enabled ${mipsdspr2-no}"
  3308. fi
  3309. if enabled ppc; then
  3310. echo "AltiVec enabled ${altivec-no}"
  3311. echo "PPC 4xx optimizations ${ppc4xx-no}"
  3312. echo "dcbzl available ${dcbzl-no}"
  3313. fi
  3314. if enabled sparc; then
  3315. echo "VIS enabled ${vis-no}"
  3316. fi
  3317. echo "debug symbols ${debug-no}"
  3318. echo "strip symbols ${stripping-no}"
  3319. echo "optimize for size ${small-no}"
  3320. echo "optimizations ${optimizations-no}"
  3321. echo "static ${static-no}"
  3322. echo "shared ${shared-no}"
  3323. echo "postprocessing support ${postproc-no}"
  3324. echo "new filter support ${avfilter-no}"
  3325. echo "network support ${network-no}"
  3326. echo "threading support ${thread_type-no}"
  3327. echo "safe bitstream reader ${safe_bitstream_reader-no}"
  3328. echo "SDL support ${sdl-no}"
  3329. echo "libdxva2 enabled ${dxva2-no}"
  3330. echo "libva enabled ${vaapi-no}"
  3331. echo "libvdpau enabled ${vdpau-no}"
  3332. echo "AVISynth enabled ${avisynth-no}"
  3333. echo "frei0r enabled ${frei0r-no}"
  3334. echo "gnutls enabled ${gnutls-no}"
  3335. echo "libaacplus enabled ${libaacplus-no}"
  3336. echo "libass enabled ${libass-no}"
  3337. echo "libcdio support ${libcdio-no}"
  3338. echo "libcelt enabled ${libcelt-no}"
  3339. echo "libdc1394 support ${libdc1394-no}"
  3340. echo "libfaac enabled ${libfaac-no}"
  3341. echo "libgsm enabled ${libgsm-no}"
  3342. echo "libiec61883 support ${libiec61883-no}"
  3343. echo "libilbc enabled ${libilbc-no}"
  3344. echo "libmodplug enabled ${libmodplug-no}"
  3345. echo "libmp3lame enabled ${libmp3lame-no}"
  3346. echo "libnut enabled ${libnut-no}"
  3347. echo "libopencore-amrnb support ${libopencore_amrnb-no}"
  3348. echo "libopencore-amrwb support ${libopencore_amrwb-no}"
  3349. echo "libopencv support ${libopencv-no}"
  3350. echo "libopenjpeg enabled ${libopenjpeg-no}"
  3351. echo "libpulse enabled ${libpulse-no}"
  3352. echo "librtmp enabled ${librtmp-no}"
  3353. echo "libschroedinger enabled ${libschroedinger-no}"
  3354. echo "libspeex enabled ${libspeex-no}"
  3355. echo "libstagefright-h264 enabled ${libstagefright_h264-no}"
  3356. echo "libtheora enabled ${libtheora-no}"
  3357. echo "libutvideo enabled ${libutvideo-no}"
  3358. echo "libv4l2 enabled ${libv4l2-no}"
  3359. echo "libvo-aacenc support ${libvo_aacenc-no}"
  3360. echo "libvo-amrwbenc support ${libvo_amrwbenc-no}"
  3361. echo "libvorbis enabled ${libvorbis-no}"
  3362. echo "libvpx enabled ${libvpx-no}"
  3363. echo "libx264 enabled ${libx264-no}"
  3364. echo "libxavs enabled ${libxavs-no}"
  3365. echo "libxvid enabled ${libxvid-no}"
  3366. echo "openal enabled ${openal-no}"
  3367. echo "openssl enabled ${openssl-no}"
  3368. echo "zlib enabled ${zlib-no}"
  3369. echo "bzlib enabled ${bzlib-no}"
  3370. test -n "$random_seed" &&
  3371. echo "random seed ${random_seed}"
  3372. echo
  3373. for type in decoder encoder hwaccel parser demuxer muxer protocol filter bsf indev outdev; do
  3374. echo "Enabled ${type}s:"
  3375. eval list=\$$(toupper $type)_LIST
  3376. print_enabled '_*' $list | sort | pr -r -3 -t
  3377. echo
  3378. done
  3379. license="LGPL version 2.1 or later"
  3380. if enabled nonfree; then
  3381. license="nonfree and unredistributable"
  3382. elif enabled gplv3; then
  3383. license="GPL version 3 or later"
  3384. elif enabled lgplv3; then
  3385. license="LGPL version 3 or later"
  3386. elif enabled gpl; then
  3387. license="GPL version 2 or later"
  3388. fi
  3389. echo "License: $license"
  3390. echo "Creating config.mak and config.h..."
  3391. test -e Makefile || $ln_s "$source_path/Makefile" .
  3392. enabled stripping || strip="echo skipping strip"
  3393. config_files="$TMPH config.mak"
  3394. cat > config.mak <<EOF
  3395. # Automatically generated by configure - do not modify!
  3396. ifndef FFMPEG_CONFIG_MAK
  3397. FFMPEG_CONFIG_MAK=1
  3398. FFMPEG_CONFIGURATION=$FFMPEG_CONFIGURATION
  3399. prefix=$prefix
  3400. LIBDIR=\$(DESTDIR)$libdir
  3401. SHLIBDIR=\$(DESTDIR)$shlibdir
  3402. INCDIR=\$(DESTDIR)$incdir
  3403. BINDIR=\$(DESTDIR)$bindir
  3404. DATADIR=\$(DESTDIR)$datadir
  3405. MANDIR=\$(DESTDIR)$mandir
  3406. SRC_PATH=$source_path
  3407. ifndef MAIN_MAKEFILE
  3408. SRC_PATH:=\$(SRC_PATH:.%=..%)
  3409. endif
  3410. CC_IDENT=$cc_ident
  3411. ARCH=$arch
  3412. CC=$cc
  3413. CXX=$cxx
  3414. AS=$as
  3415. LD=$ld
  3416. DEPCC=$dep_cc
  3417. YASM=$yasmexe
  3418. YASMDEP=$yasmexe
  3419. AR=$ar
  3420. RANLIB=$ranlib
  3421. CP=cp -p
  3422. LN_S=$ln_s
  3423. STRIP=$strip
  3424. CPPFLAGS=$CPPFLAGS
  3425. CFLAGS=$CFLAGS
  3426. CXXFLAGS=$CXXFLAGS
  3427. ASFLAGS=$ASFLAGS
  3428. AS_O=$CC_O
  3429. CC_O=$CC_O
  3430. CXX_O=$CXX_O
  3431. LDFLAGS=$LDFLAGS
  3432. FFSERVERLDFLAGS=$FFSERVERLDFLAGS
  3433. SHFLAGS=$SHFLAGS
  3434. YASMFLAGS=$YASMFLAGS
  3435. BUILDSUF=$build_suffix
  3436. PROGSSUF=$progs_suffix
  3437. FULLNAME=$FULLNAME
  3438. LIBPREF=$LIBPREF
  3439. LIBSUF=$LIBSUF
  3440. LIBNAME=$LIBNAME
  3441. SLIBPREF=$SLIBPREF
  3442. SLIBSUF=$SLIBSUF
  3443. EXESUF=$EXESUF
  3444. EXTRA_VERSION=$extra_version
  3445. DEPFLAGS=$DEPFLAGS
  3446. CCDEP=$CCDEP
  3447. CXXDEP=$CXXDEP
  3448. ASDEP=$ASDEP
  3449. CC_DEPFLAGS=$CC_DEPFLAGS
  3450. AS_DEPFLAGS=$AS_DEPFLAGS
  3451. HOSTCC=$host_cc
  3452. HOSTCFLAGS=$host_cflags
  3453. HOSTEXESUF=$HOSTEXESUF
  3454. HOSTLDFLAGS=$host_ldflags
  3455. HOSTLIBS=$host_libs
  3456. TARGET_EXEC=$target_exec
  3457. TARGET_PATH=$target_path
  3458. SDL_LIBS=$sdl_libs
  3459. SDL_CFLAGS=$sdl_cflags
  3460. LIB_INSTALL_EXTRA_CMD=$LIB_INSTALL_EXTRA_CMD
  3461. EXTRALIBS=$extralibs
  3462. INSTALL=$install
  3463. LIBTARGET=${LIBTARGET}
  3464. SLIBNAME=${SLIBNAME}
  3465. SLIBNAME_WITH_VERSION=${SLIBNAME_WITH_VERSION}
  3466. SLIBNAME_WITH_MAJOR=${SLIBNAME_WITH_MAJOR}
  3467. SLIB_CREATE_DEF_CMD=${SLIB_CREATE_DEF_CMD}
  3468. SLIB_EXTRA_CMD=${SLIB_EXTRA_CMD}
  3469. SLIB_INSTALL_NAME=${SLIB_INSTALL_NAME}
  3470. SLIB_INSTALL_LINKS=${SLIB_INSTALL_LINKS}
  3471. SLIB_INSTALL_EXTRA_LIB=${SLIB_INSTALL_EXTRA_LIB}
  3472. SLIB_INSTALL_EXTRA_SHLIB=${SLIB_INSTALL_EXTRA_SHLIB}
  3473. SAMPLES:=${samples:-\$(FATE_SAMPLES)}
  3474. NOREDZONE_FLAGS=$noredzone_flags
  3475. EOF
  3476. get_version(){
  3477. lcname=$1
  3478. name=$(toupper $lcname)
  3479. file=$source_path/$lcname/version.h
  3480. eval $(grep "#define ${name}_VERSION_M" "$file" | awk '{ print $2"="$3 }')
  3481. eval ${name}_VERSION=\$${name}_VERSION_MAJOR.\$${name}_VERSION_MINOR.\$${name}_VERSION_MICRO
  3482. eval echo "${lcname}_VERSION=\$${name}_VERSION" >> config.mak
  3483. eval echo "${lcname}_VERSION_MAJOR=\$${name}_VERSION_MAJOR" >> config.mak
  3484. }
  3485. get_version_old(){
  3486. name=$1
  3487. file=$source_path/$2
  3488. # This condition will be removed when we stop supporting old libpostproc versions
  3489. if ! test "$name" = LIBPOSTPROC || test "$postproc_version" = current; then
  3490. eval $(grep "#define ${name}_VERSION_M" "$file" | awk '{ print $2"="$3 }')
  3491. eval ${name}_VERSION=\$${name}_VERSION_MAJOR.\$${name}_VERSION_MINOR.\$${name}_VERSION_MICRO
  3492. fi
  3493. lcname=$(tolower $name)
  3494. eval echo "${lcname}_VERSION=\$${name}_VERSION" >> config.mak
  3495. eval echo "${lcname}_VERSION_MAJOR=\$${name}_VERSION_MAJOR" >> config.mak
  3496. }
  3497. get_version_old LIBPOSTPROC libpostproc/postprocess.h
  3498. get_version_old LIBSWRESAMPLE libswresample/swresample.h
  3499. get_version libavcodec
  3500. get_version libavdevice
  3501. get_version libavfilter
  3502. get_version libavformat
  3503. get_version libavresample
  3504. get_version libavutil
  3505. get_version libswscale
  3506. cat > $TMPH <<EOF
  3507. /* Automatically generated by configure - do not modify! */
  3508. #ifndef FFMPEG_CONFIG_H
  3509. #define FFMPEG_CONFIG_H
  3510. #define FFMPEG_CONFIGURATION "$(c_escape $FFMPEG_CONFIGURATION)"
  3511. #define FFMPEG_LICENSE "$(c_escape $license)"
  3512. #define FFMPEG_DATADIR "$(eval c_escape $datadir)"
  3513. #define AVCONV_DATADIR "$(eval c_escape $datadir)"
  3514. #define CC_TYPE "$cc_type"
  3515. #define CC_VERSION $cc_version
  3516. #define av_restrict $_restrict
  3517. #define EXTERN_PREFIX "${extern_prefix}"
  3518. #define EXTERN_ASM ${extern_prefix}
  3519. #define SLIBSUF "$SLIBSUF"
  3520. EOF
  3521. test -n "$assert_level" &&
  3522. echo "#define ASSERT_LEVEL $assert_level" >>$TMPH
  3523. test -n "$malloc_prefix" &&
  3524. echo "#define MALLOC_PREFIX $malloc_prefix" >>$TMPH
  3525. if enabled yasm; then
  3526. append config_files $TMPASM
  3527. printf '' >$TMPASM
  3528. fi
  3529. print_config ARCH_ "$config_files" $ARCH_LIST
  3530. print_config HAVE_ "$config_files" $HAVE_LIST
  3531. print_config CONFIG_ "$config_files" $CONFIG_LIST \
  3532. $CONFIG_EXTRA \
  3533. $ALL_COMPONENTS \
  3534. cat >>config.mak <<EOF
  3535. LAVF_FATE_TESTS=$(print_enabled -n _test $LAVF_FATE_TESTS)
  3536. LAVF_TESTS=$(print_enabled -n _test $LAVF_TESTS)
  3537. LAVFI_TESTS=$(print_enabled -n _test $LAVFI_TESTS)
  3538. SEEK_TESTS=$(print_enabled -n _test $SEEK_TESTS)
  3539. EOF
  3540. echo "#endif /* FFMPEG_CONFIG_H */" >> $TMPH
  3541. echo "endif # FFMPEG_CONFIG_MAK" >> config.mak
  3542. # Do not overwrite an unchanged config.h to avoid superfluous rebuilds.
  3543. cp_if_changed $TMPH config.h
  3544. touch .config
  3545. enabled yasm && cp_if_changed $TMPASM config.asm
  3546. cat > $TMPH <<EOF
  3547. /* Generated by ffconf */
  3548. #ifndef AVUTIL_AVCONFIG_H
  3549. #define AVUTIL_AVCONFIG_H
  3550. EOF
  3551. test "$postproc_version" != current && cat >> $TMPH <<EOF
  3552. #define LIBPOSTPROC_VERSION_MAJOR $LIBPOSTPROC_VERSION_MAJOR
  3553. #define LIBPOSTPROC_VERSION_MINOR $LIBPOSTPROC_VERSION_MINOR
  3554. #define LIBPOSTPROC_VERSION_MICRO $LIBPOSTPROC_VERSION_MICRO
  3555. EOF
  3556. print_config AV_HAVE_ $TMPH $HAVE_LIST_PUB
  3557. echo "#endif /* AVUTIL_AVCONFIG_H */" >> $TMPH
  3558. cp_if_changed $TMPH libavutil/avconfig.h
  3559. test -n "$WARNINGS" && printf "\n$WARNINGS"
  3560. # build pkg-config files
  3561. pkgconfig_generate(){
  3562. name=$1
  3563. shortname=${name#lib}${build_suffix}
  3564. comment=$2
  3565. version=$3
  3566. libs=$4
  3567. requires=$5
  3568. enabled ${name#lib} || return 0
  3569. mkdir -p $name
  3570. cat <<EOF > $name/$name.pc
  3571. prefix=$prefix
  3572. exec_prefix=\${prefix}
  3573. libdir=$libdir
  3574. includedir=$incdir
  3575. Name: $name
  3576. Description: $comment
  3577. Version: $version
  3578. Requires: $(enabled shared || echo $requires)
  3579. Requires.private: $(enabled shared && echo $requires)
  3580. Conflicts:
  3581. Libs: -L\${libdir} -l${shortname} $(enabled shared || echo $libs)
  3582. Libs.private: $(enabled shared && echo $libs)
  3583. Cflags: -I\${includedir}
  3584. EOF
  3585. cat <<EOF > $name/$name-uninstalled.pc
  3586. prefix=
  3587. exec_prefix=
  3588. libdir=\${pcfiledir}
  3589. includedir=${source_path}
  3590. Name: $name
  3591. Description: $comment
  3592. Version: $version
  3593. Requires: $requires
  3594. Conflicts:
  3595. Libs: \${libdir}/${LIBPREF}${shortname}${LIBSUF} $libs
  3596. Cflags: -I\${includedir}
  3597. EOF
  3598. }
  3599. libavfilter_pc_deps=""
  3600. enabled libavfilter_deps_avcodec && prepend libavfilter_pc_deps "libavcodec = $LIBAVCODEC_VERSION,"
  3601. enabled libavfilter_deps_avformat && prepend libavfilter_pc_deps "libavformat = $LIBAVFORMAT_VERSION,"
  3602. enabled libavfilter_deps_swscale && prepend libavfilter_pc_deps "libswscale = $LIBSWSCALE_VERSION,"
  3603. enabled libavfilter_deps_swresample && prepend libavfilter_pc_deps "libswresample = $LIBSWRESAMPLE_VERSION,"
  3604. enabled libavfilter_deps_postproc && prepend libavfilter_pc_deps "libpostproc = $LIBPOSTPROC_VERSION,"
  3605. libavfilter_pc_deps=${libavfilter_pc_deps%, }
  3606. libavdevice_pc_deps="libavformat = $LIBAVFORMAT_VERSION"
  3607. enabled lavfi_indev && prepend libavdevice_pc_deps "libavfilter = $LIBAVFILTER_VERSION,"
  3608. pkgconfig_generate libavutil "FFmpeg utility library" "$LIBAVUTIL_VERSION" "$LIBM"
  3609. pkgconfig_generate libavcodec "FFmpeg codec library" "$LIBAVCODEC_VERSION" "$extralibs" "libavutil = $LIBAVUTIL_VERSION"
  3610. pkgconfig_generate libavformat "FFmpeg container format library" "$LIBAVFORMAT_VERSION" "$extralibs" "libavcodec = $LIBAVCODEC_VERSION"
  3611. pkgconfig_generate libavdevice "FFmpeg device handling library" "$LIBAVDEVICE_VERSION" "$extralibs" "$libavdevice_pc_deps"
  3612. pkgconfig_generate libavfilter "FFmpeg video filtering library" "$LIBAVFILTER_VERSION" "$extralibs" "$libavfilter_pc_deps"
  3613. pkgconfig_generate libpostproc "FFmpeg postprocessing library" "$LIBPOSTPROC_VERSION" "" "libavutil = $LIBAVUTIL_VERSION"
  3614. pkgconfig_generate libavresample "Libav audio resampling library" "$LIBAVRESAMPLE_VERSION" "$extralibs"
  3615. pkgconfig_generate libswscale "FFmpeg image rescaling library" "$LIBSWSCALE_VERSION" "$LIBM" "libavutil = $LIBAVUTIL_VERSION"
  3616. pkgconfig_generate libswresample "FFmpeg audio rescaling library" "$LIBSWRESAMPLE_VERSION" "$LIBM" "libavutil = $LIBAVUTIL_VERSION"