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.

3997 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. rint
  1138. round
  1139. roundf
  1140. rweflags
  1141. sched_getaffinity
  1142. sdl
  1143. sdl_video_size
  1144. setmode
  1145. setrlimit
  1146. Sleep
  1147. sndio_h
  1148. socklen_t
  1149. soundcard_h
  1150. strerror_r
  1151. strptime
  1152. struct_addrinfo
  1153. struct_group_source_req
  1154. struct_ip_mreq_source
  1155. struct_ipv6_mreq
  1156. struct_pollfd
  1157. struct_rusage_ru_maxrss
  1158. struct_sockaddr_in6
  1159. struct_sockaddr_sa_len
  1160. struct_sockaddr_storage
  1161. struct_v4l2_frmivalenum_discrete
  1162. symver
  1163. symver_asm_label
  1164. symver_gnu_asm
  1165. sysconf
  1166. sysctl
  1167. sys_mman_h
  1168. sys_param_h
  1169. sys_resource_h
  1170. sys_select_h
  1171. sys_soundcard_h
  1172. sys_time_h
  1173. sys_videoio_h
  1174. termios_h
  1175. threads
  1176. trunc
  1177. truncf
  1178. unistd_h
  1179. usleep
  1180. vfp_args
  1181. VirtualAlloc
  1182. windows_h
  1183. winsock2_h
  1184. xform_asm
  1185. xgetbv
  1186. xmm_clobbers
  1187. yasm
  1188. "
  1189. # options emitted with CONFIG_ prefix but not available on command line
  1190. CONFIG_EXTRA="
  1191. aandct
  1192. avutil
  1193. golomb
  1194. gplv3
  1195. h264chroma
  1196. h264dsp
  1197. h264pred
  1198. h264qpel
  1199. huffman
  1200. lgplv3
  1201. lpc
  1202. "
  1203. CMDLINE_SELECT="
  1204. $ARCH_EXT_LIST
  1205. $CONFIG_LIST
  1206. $THREADS_LIST
  1207. asm
  1208. coverage
  1209. cross_compile
  1210. debug
  1211. extra_warnings
  1212. logging
  1213. optimizations
  1214. stripping
  1215. symver
  1216. yasm
  1217. "
  1218. PATHS_LIST='
  1219. bindir
  1220. datadir
  1221. incdir
  1222. libdir
  1223. mandir
  1224. prefix
  1225. shlibdir
  1226. '
  1227. CMDLINE_SET="
  1228. $PATHS_LIST
  1229. ar
  1230. arch
  1231. as
  1232. assert_level
  1233. build_suffix
  1234. cc
  1235. cpu
  1236. cross_prefix
  1237. cxx
  1238. dep_cc
  1239. extra_version
  1240. host_cc
  1241. host_cflags
  1242. host_ldflags
  1243. host_libs
  1244. host_os
  1245. install
  1246. ld
  1247. logfile
  1248. malloc_prefix
  1249. nm
  1250. optflags
  1251. pkg_config
  1252. postproc_version
  1253. progs_suffix
  1254. random_seed
  1255. samples
  1256. strip
  1257. sysinclude
  1258. sysroot
  1259. target_exec
  1260. target_os
  1261. target_path
  1262. valgrind
  1263. yasmexe
  1264. "
  1265. CMDLINE_APPEND="
  1266. extra_cflags
  1267. extra_cxxflags
  1268. "
  1269. # code dependency declarations
  1270. # architecture extensions
  1271. armv5te_deps="arm"
  1272. armv6_deps="arm"
  1273. armv6t2_deps="arm"
  1274. armvfp_deps="arm"
  1275. neon_deps="arm"
  1276. vfpv3_deps="armvfp"
  1277. mipsfpu_deps="mips"
  1278. mips32r2_deps="mips"
  1279. mipsdspr1_deps="mips"
  1280. mipsdspr2_deps="mips"
  1281. mmi_deps="mips"
  1282. altivec_deps="ppc"
  1283. ppc4xx_deps="ppc"
  1284. vis_deps="sparc"
  1285. x86_64_suggest="cmov fast_cmov"
  1286. amd3dnow_deps="mmx"
  1287. amd3dnowext_deps="amd3dnow"
  1288. mmx_deps="x86"
  1289. mmx2_deps="mmx"
  1290. sse_deps="mmx"
  1291. ssse3_deps="sse"
  1292. avx_deps="ssse3"
  1293. aligned_stack_if_any="ppc x86"
  1294. fast_64bit_if_any="alpha ia64 mips64 parisc64 ppc64 sparc64 x86_64"
  1295. fast_clz_if_any="alpha armv5te avr32 mips ppc x86"
  1296. fast_unaligned_if_any="armv6 ppc x86"
  1297. inline_asm_deps="!tms470"
  1298. need_memalign="altivec neon sse"
  1299. symver_if_any="symver_asm_label symver_gnu_asm"
  1300. # subsystems
  1301. dct_select="rdft"
  1302. mdct_select="fft"
  1303. rdft_select="fft"
  1304. mpegaudiodsp_select="dct"
  1305. # decoders / encoders / hardware accelerators
  1306. aac_decoder_select="mdct sinewin"
  1307. aac_encoder_select="mdct sinewin"
  1308. aac_latm_decoder_select="aac_decoder aac_latm_parser"
  1309. ac3_decoder_select="mdct ac3dsp ac3_parser"
  1310. ac3_encoder_select="mdct ac3dsp"
  1311. ac3_fixed_encoder_select="mdct ac3dsp"
  1312. alac_encoder_select="lpc"
  1313. amrnb_decoder_select="lsp"
  1314. amrwb_decoder_select="lsp"
  1315. amv_encoder_select="aandct"
  1316. atrac1_decoder_select="mdct sinewin"
  1317. atrac3_decoder_select="mdct"
  1318. binkaudio_dct_decoder_select="mdct rdft dct sinewin"
  1319. binkaudio_rdft_decoder_select="mdct rdft sinewin"
  1320. cavs_decoder_select="golomb"
  1321. cook_decoder_select="mdct sinewin"
  1322. cscd_decoder_suggest="zlib"
  1323. dca_decoder_select="mdct"
  1324. dirac_decoder_select="dwt golomb"
  1325. dnxhd_encoder_select="aandct"
  1326. dxa_decoder_select="zlib"
  1327. eac3_decoder_select="ac3_decoder"
  1328. eac3_encoder_select="mdct ac3dsp"
  1329. eamad_decoder_select="aandct"
  1330. eatgq_decoder_select="aandct"
  1331. eatqi_decoder_select="aandct"
  1332. exr_decoder_select="zlib"
  1333. ffv1_decoder_select="golomb"
  1334. flac_decoder_select="golomb"
  1335. flac_encoder_select="golomb lpc"
  1336. flashsv_decoder_select="zlib"
  1337. flashsv_encoder_select="zlib"
  1338. flashsv2_encoder_select="zlib"
  1339. flashsv2_decoder_select="zlib"
  1340. flv_decoder_select="h263_decoder"
  1341. flv_encoder_select="h263_encoder"
  1342. fraps_decoder_select="huffman"
  1343. h261_encoder_select="aandct"
  1344. h263_decoder_select="h263_parser"
  1345. h263_encoder_select="aandct"
  1346. h263_vaapi_hwaccel_select="vaapi h263_decoder"
  1347. h263i_decoder_select="h263_decoder"
  1348. h263p_encoder_select="h263_encoder"
  1349. h264_crystalhd_decoder_select="crystalhd h264_mp4toannexb_bsf h264_parser"
  1350. h264_decoder_select="golomb h264chroma h264dsp h264pred h264qpel"
  1351. h264_dxva2_hwaccel_deps="dxva2api_h"
  1352. h264_dxva2_hwaccel_select="dxva2 h264_decoder"
  1353. h264_vaapi_hwaccel_select="vaapi h264_decoder"
  1354. h264_vda_hwaccel_deps="VideoDecodeAcceleration_VDADecoder_h pthreads"
  1355. h264_vda_hwaccel_select="vda h264_decoder"
  1356. h264_vdpau_decoder_select="vdpau h264_decoder"
  1357. iac_decoder_select="fft mdct sinewin"
  1358. imc_decoder_select="fft mdct sinewin"
  1359. jpegls_decoder_select="golomb"
  1360. jpegls_encoder_select="golomb"
  1361. ljpeg_encoder_select="aandct"
  1362. loco_decoder_select="golomb"
  1363. mjpeg_encoder_select="aandct"
  1364. mlp_decoder_select="mlp_parser"
  1365. mp1_decoder_select="mpegaudiodsp"
  1366. mp1float_decoder_select="mpegaudiodsp"
  1367. mp2_decoder_select="mpegaudiodsp"
  1368. mp2float_decoder_select="mpegaudiodsp"
  1369. mp3_decoder_select="mpegaudiodsp"
  1370. mp3adu_decoder_select="mpegaudiodsp"
  1371. mp3adufloat_decoder_select="mpegaudiodsp"
  1372. mp3float_decoder_select="mpegaudiodsp"
  1373. mp3on4_decoder_select="mpegaudiodsp"
  1374. mp3on4float_decoder_select="mpegaudiodsp"
  1375. mpc7_decoder_select="mpegaudiodsp"
  1376. mpc8_decoder_select="mpegaudiodsp"
  1377. mpeg_vdpau_decoder_select="vdpau mpegvideo_decoder"
  1378. mpeg_xvmc_decoder_deps="X11_extensions_XvMClib_h"
  1379. mpeg_xvmc_decoder_select="mpegvideo_decoder"
  1380. mpeg1_vdpau_decoder_select="vdpau mpeg1video_decoder"
  1381. mpeg1_vdpau_hwaccel_select="vdpau mpeg1video_decoder"
  1382. mpeg1video_encoder_select="aandct"
  1383. mpeg2_crystalhd_decoder_select="crystalhd"
  1384. mpeg2_dxva2_hwaccel_deps="dxva2api_h"
  1385. mpeg2_dxva2_hwaccel_select="dxva2 mpeg2video_decoder"
  1386. mpeg2_vdpau_hwaccel_select="vdpau mpeg2video_decoder"
  1387. mpeg2_vaapi_hwaccel_select="vaapi mpeg2video_decoder"
  1388. mpeg2video_encoder_select="aandct"
  1389. mpeg4_crystalhd_decoder_select="crystalhd"
  1390. mpeg4_decoder_select="h263_decoder mpeg4video_parser"
  1391. mpeg4_encoder_select="h263_encoder"
  1392. mpeg4_vaapi_hwaccel_select="vaapi mpeg4_decoder"
  1393. mpeg4_vdpau_decoder_select="vdpau mpeg4_decoder"
  1394. msmpeg4_crystalhd_decoder_select="crystalhd"
  1395. msmpeg4v1_decoder_select="h263_decoder"
  1396. msmpeg4v1_encoder_select="h263_encoder"
  1397. msmpeg4v2_decoder_select="h263_decoder"
  1398. msmpeg4v2_encoder_select="h263_encoder"
  1399. msmpeg4v3_decoder_select="h263_decoder"
  1400. msmpeg4v3_encoder_select="h263_encoder"
  1401. nellymoser_decoder_select="mdct sinewin"
  1402. nellymoser_encoder_select="mdct sinewin"
  1403. png_decoder_select="zlib"
  1404. png_encoder_select="zlib"
  1405. qcelp_decoder_select="lsp"
  1406. qdm2_decoder_select="mdct rdft mpegaudiodsp"
  1407. ra_144_encoder_select="lpc"
  1408. ralf_decoder_select="golomb"
  1409. rv10_decoder_select="h263_decoder"
  1410. rv10_encoder_select="h263_encoder"
  1411. rv20_decoder_select="h263_decoder"
  1412. rv20_encoder_select="h263_encoder"
  1413. rv30_decoder_select="golomb h264chroma h264pred h264qpel"
  1414. rv40_decoder_select="golomb h264chroma h264pred h264qpel"
  1415. shorten_decoder_select="golomb"
  1416. sipr_decoder_select="lsp"
  1417. snow_decoder_select="dwt"
  1418. snow_encoder_select="aandct dwt"
  1419. sonic_decoder_select="golomb"
  1420. sonic_encoder_select="golomb"
  1421. sonic_ls_encoder_select="golomb"
  1422. svq1_encoder_select="aandct"
  1423. svq3_decoder_select="golomb h264chroma h264dsp h264pred h264qpel"
  1424. svq3_decoder_suggest="zlib"
  1425. theora_decoder_select="vp3_decoder"
  1426. tiff_decoder_suggest="zlib"
  1427. tiff_encoder_suggest="zlib"
  1428. tscc_decoder_select="zlib"
  1429. twinvq_decoder_select="mdct lsp sinewin"
  1430. vc1_crystalhd_decoder_select="crystalhd"
  1431. vc1_decoder_select="h263_decoder h264chroma h264qpel"
  1432. vc1_dxva2_hwaccel_deps="dxva2api_h"
  1433. vc1_dxva2_hwaccel_select="dxva2 vc1_decoder"
  1434. vc1_vaapi_hwaccel_select="vaapi vc1_decoder"
  1435. vc1_vdpau_decoder_select="vdpau vc1_decoder"
  1436. vc1image_decoder_select="vc1_decoder"
  1437. vorbis_decoder_select="mdct"
  1438. vorbis_encoder_select="mdct"
  1439. vp6_decoder_select="huffman"
  1440. vp6a_decoder_select="vp6_decoder"
  1441. vp6f_decoder_select="vp6_decoder"
  1442. vp8_decoder_select="h264pred h264qpel"
  1443. wmapro_decoder_select="mdct sinewin"
  1444. wmav1_decoder_select="mdct sinewin"
  1445. wmav1_encoder_select="mdct sinewin"
  1446. wmav2_decoder_select="mdct sinewin"
  1447. wmav2_encoder_select="mdct sinewin"
  1448. wmavoice_decoder_select="lsp rdft dct mdct sinewin"
  1449. wmv1_decoder_select="h263_decoder"
  1450. wmv1_encoder_select="h263_encoder"
  1451. wmv2_decoder_select="h263_decoder"
  1452. wmv2_encoder_select="h263_encoder"
  1453. wmv3_decoder_select="vc1_decoder"
  1454. wmv3_crystalhd_decoder_select="crystalhd"
  1455. wmv3_dxva2_hwaccel_select="vc1_dxva2_hwaccel"
  1456. wmv3_vaapi_hwaccel_select="vc1_vaapi_hwaccel"
  1457. wmv3_vdpau_decoder_select="vc1_vdpau_decoder"
  1458. wmv3image_decoder_select="wmv3_decoder"
  1459. zerocodec_decoder_select="zlib"
  1460. zlib_decoder_select="zlib"
  1461. zlib_encoder_select="zlib"
  1462. zmbv_decoder_select="zlib"
  1463. zmbv_encoder_select="zlib"
  1464. crystalhd_deps="libcrystalhd_libcrystalhd_if_h"
  1465. vaapi_deps="va_va_h"
  1466. vda_deps="VideoDecodeAcceleration_VDADecoder_h pthreads"
  1467. vdpau_deps="vdpau_vdpau_h vdpau_vdpau_x11_h"
  1468. # parsers
  1469. h264_parser_select="golomb h264dsp h264pred"
  1470. # external libraries
  1471. libaacplus_encoder_deps="libaacplus"
  1472. libcelt_decoder_deps="libcelt"
  1473. libfaac_encoder_deps="libfaac"
  1474. libgsm_decoder_deps="libgsm"
  1475. libgsm_encoder_deps="libgsm"
  1476. libgsm_ms_decoder_deps="libgsm"
  1477. libgsm_ms_encoder_deps="libgsm"
  1478. libilbc_decoder_deps="libilbc"
  1479. libilbc_encoder_deps="libilbc"
  1480. libmodplug_demuxer_deps="libmodplug"
  1481. libmp3lame_encoder_deps="libmp3lame"
  1482. libopencore_amrnb_decoder_deps="libopencore_amrnb"
  1483. libopencore_amrnb_encoder_deps="libopencore_amrnb"
  1484. libopencore_amrwb_decoder_deps="libopencore_amrwb"
  1485. libopenjpeg_decoder_deps="libopenjpeg"
  1486. libopenjpeg_encoder_deps="libopenjpeg"
  1487. libschroedinger_decoder_deps="libschroedinger"
  1488. libschroedinger_encoder_deps="libschroedinger"
  1489. libspeex_decoder_deps="libspeex"
  1490. libspeex_encoder_deps="libspeex"
  1491. libstagefright_h264_decoder_deps="libstagefright_h264"
  1492. libtheora_encoder_deps="libtheora"
  1493. libvo_aacenc_encoder_deps="libvo_aacenc"
  1494. libvo_amrwbenc_encoder_deps="libvo_amrwbenc"
  1495. libvorbis_decoder_deps="libvorbis"
  1496. libvorbis_encoder_deps="libvorbis"
  1497. libvpx_decoder_deps="libvpx"
  1498. libvpx_encoder_deps="libvpx"
  1499. libx264_encoder_deps="libx264"
  1500. libx264rgb_encoder_deps="libx264"
  1501. libxavs_encoder_deps="libxavs"
  1502. libxvid_encoder_deps="libxvid"
  1503. libutvideo_decoder_deps="libutvideo"
  1504. libutvideo_encoder_deps="libutvideo"
  1505. # demuxers / muxers
  1506. ac3_demuxer_select="ac3_parser"
  1507. asf_stream_muxer_select="asf_muxer"
  1508. avisynth_demuxer_deps="avisynth"
  1509. dirac_demuxer_select="dirac_parser"
  1510. eac3_demuxer_select="ac3_parser"
  1511. flac_demuxer_select="flac_parser"
  1512. ipod_muxer_select="mov_muxer"
  1513. libnut_demuxer_deps="libnut"
  1514. libnut_muxer_deps="libnut"
  1515. matroska_audio_muxer_select="matroska_muxer"
  1516. matroska_demuxer_suggest="zlib bzlib"
  1517. mov_demuxer_suggest="zlib"
  1518. mp3_demuxer_select="mpegaudio_parser"
  1519. mp4_muxer_select="mov_muxer"
  1520. mpegts_muxer_select="adts_muxer latm_muxer"
  1521. mpegtsraw_demuxer_select="mpegts_demuxer"
  1522. mxf_d10_muxer_select="mxf_muxer"
  1523. ogg_demuxer_select="golomb"
  1524. psp_muxer_select="mov_muxer"
  1525. rtp_demuxer_select="sdp_demuxer"
  1526. rtpdec_select="asf_demuxer rm_demuxer rtp_protocol mpegts_demuxer mov_demuxer"
  1527. rtsp_demuxer_select="http_protocol rtpdec"
  1528. rtsp_muxer_select="rtp_muxer http_protocol rtp_protocol"
  1529. sap_demuxer_select="sdp_demuxer"
  1530. sap_muxer_select="rtp_muxer rtp_protocol"
  1531. sdp_demuxer_select="rtpdec"
  1532. spdif_muxer_select="aac_parser"
  1533. tg2_muxer_select="mov_muxer"
  1534. tgp_muxer_select="mov_muxer"
  1535. w64_demuxer_deps="wav_demuxer"
  1536. # indevs / outdevs
  1537. alsa_indev_deps="alsa_asoundlib_h snd_pcm_htimestamp"
  1538. alsa_outdev_deps="alsa_asoundlib_h"
  1539. bktr_indev_deps_any="dev_bktr_ioctl_bt848_h machine_ioctl_bt848_h dev_video_bktr_ioctl_bt848_h dev_ic_bt8xx_h"
  1540. dshow_indev_deps="IBaseFilter"
  1541. dshow_indev_extralibs="-lpsapi -lole32 -lstrmiids -luuid"
  1542. dv1394_indev_deps="dv1394 dv_demuxer"
  1543. fbdev_indev_deps="linux_fb_h"
  1544. iec61883_indev_deps="libiec61883"
  1545. jack_indev_deps="jack_jack_h sem_timedwait"
  1546. lavfi_indev_deps="avfilter"
  1547. libcdio_indev_deps="libcdio"
  1548. libdc1394_indev_deps="libdc1394"
  1549. libv4l2_indev_deps="libv4l2"
  1550. openal_indev_deps="openal"
  1551. oss_indev_deps_any="soundcard_h sys_soundcard_h"
  1552. oss_outdev_deps_any="soundcard_h sys_soundcard_h"
  1553. pulse_indev_deps="libpulse"
  1554. sdl_outdev_deps="sdl"
  1555. sndio_indev_deps="sndio_h"
  1556. sndio_outdev_deps="sndio_h"
  1557. v4l_indev_deps="linux_videodev_h"
  1558. v4l2_indev_deps_any="linux_videodev2_h sys_videoio_h"
  1559. vfwcap_indev_deps="capCreateCaptureWindow vfwcap_defines"
  1560. vfwcap_indev_extralibs="-lavicap32"
  1561. x11_grab_device_indev_deps="x11grab XShmCreateImage"
  1562. # protocols
  1563. bluray_protocol_deps="libbluray"
  1564. gopher_protocol_deps="network"
  1565. httpproxy_protocol_deps="network"
  1566. httpproxy_protocol_select="tcp_protocol"
  1567. http_protocol_deps="network"
  1568. http_protocol_select="tcp_protocol"
  1569. https_protocol_select="tls_protocol"
  1570. librtmp_protocol_deps="librtmp"
  1571. librtmpe_protocol_deps="librtmp"
  1572. librtmps_protocol_deps="librtmp"
  1573. librtmpt_protocol_deps="librtmp"
  1574. librtmpte_protocol_deps="librtmp"
  1575. mmsh_protocol_select="http_protocol"
  1576. mmst_protocol_deps="network"
  1577. rtmp_protocol_deps="!librtmp_protocol"
  1578. rtmp_protocol_select="tcp_protocol"
  1579. rtmphttp_protocol_deps="!librtmp_protocol"
  1580. rtmphttp_protocol_select="http_protocol"
  1581. rtmpt_protocol_deps="!librtmp_protocol"
  1582. rtmpt_protocol_select="rtmphttp_protocol"
  1583. rtp_protocol_select="udp_protocol"
  1584. sctp_protocol_deps="network netinet_sctp_h"
  1585. tcp_protocol_deps="network"
  1586. tls_protocol_deps_any="openssl gnutls"
  1587. tls_protocol_select="tcp_protocol"
  1588. udp_protocol_deps="network"
  1589. # filters
  1590. aconvert_filter_deps="swresample"
  1591. amovie_filter_deps="avcodec avformat"
  1592. aresample_filter_deps="swresample"
  1593. ass_filter_deps="libass"
  1594. asyncts_filter_deps="avresample"
  1595. atempo_filter_deps="avcodec rdft"
  1596. blackframe_filter_deps="gpl"
  1597. boxblur_filter_deps="gpl"
  1598. colormatrix_filter_deps="gpl"
  1599. cropdetect_filter_deps="gpl"
  1600. delogo_filter_deps="gpl"
  1601. deshake_filter_deps="avcodec"
  1602. drawtext_filter_deps="libfreetype"
  1603. frei0r_filter_deps="frei0r dlopen"
  1604. frei0r_filter_extralibs='$ldl'
  1605. frei0r_src_filter_deps="frei0r dlopen"
  1606. frei0r_src_filter_extralibs='$ldl'
  1607. hqdn3d_filter_deps="gpl"
  1608. movie_filter_deps="avcodec avformat"
  1609. mp_filter_deps="gpl avcodec swscale postproc"
  1610. mptestsrc_filter_deps="gpl"
  1611. negate_filter_deps="lut_filter"
  1612. resample_filter_deps="avresample"
  1613. ocv_filter_deps="libopencv"
  1614. pan_filter_deps="swresample"
  1615. removelogo_filter_deps="avcodec avformat swscale"
  1616. scale_filter_deps="swscale"
  1617. select_filter_deps="avcodec"
  1618. super2xsai_filter_deps="gpl"
  1619. tinterlace_filter_deps="gpl"
  1620. yadif_filter_deps="gpl"
  1621. # libraries
  1622. avdevice_deps="avcodec avformat"
  1623. avformat_deps="avcodec"
  1624. postproc_deps="gpl"
  1625. # programs
  1626. ffmpeg_deps="avcodec avfilter avformat swscale swresample"
  1627. ffmpeg_select="buffersink_filter format_filter aformat_filter
  1628. setpts_filter null_filter anull_filter abuffersink_filter"
  1629. ffplay_deps="avcodec avformat swscale swresample sdl"
  1630. ffplay_select="buffersink_filter rdft"
  1631. ffprobe_deps="avcodec avformat"
  1632. ffserver_deps="avformat ffm_muxer fork rtp_protocol rtsp_demuxer"
  1633. ffserver_extralibs='$ldl'
  1634. doc_deps="texi2html"
  1635. # tests
  1636. test_deps(){
  1637. suf1=$1
  1638. suf2=$2
  1639. shift 2
  1640. for v; do
  1641. dep=${v%=*}
  1642. tests=${v#*=}
  1643. for name in ${tests}; do
  1644. append ${name}_test_deps ${dep}$suf1 ${dep}$suf2
  1645. done
  1646. done
  1647. }
  1648. mxf_d10_test_deps="avfilter"
  1649. seek_lavf_mxf_d10_test_deps="mxf_d10_test"
  1650. test_deps _muxer _demuxer \
  1651. aiff \
  1652. pcm_alaw=alaw \
  1653. asf \
  1654. au \
  1655. avi \
  1656. dv=dv_fmt \
  1657. ffm \
  1658. flv=flv_fmt \
  1659. gxf \
  1660. matroska=mkv \
  1661. mmf \
  1662. mov="mov ismv" \
  1663. pcm_mulaw=mulaw \
  1664. mxf="mxf mxf_d10" \
  1665. nut \
  1666. ogg="ogg ogg_vp3" \
  1667. rawvideo=pixfmt \
  1668. rm \
  1669. swf \
  1670. mpegts=ts \
  1671. voc \
  1672. wav \
  1673. yuv4mpegpipe=yuv4mpeg \
  1674. colormatrix1_test_deps="colormatrix_filter"
  1675. colormatrix2_test_deps="colormatrix_filter"
  1676. flashsv2_test_deps="zlib"
  1677. mpg_test_deps="mpeg1system_muxer mpegps_demuxer"
  1678. mpng_test_deps="zlib"
  1679. pp_test_deps="mp_filter"
  1680. pp2_test_deps="mp_filter"
  1681. pp3_test_deps="mp_filter"
  1682. pp4_test_deps="mp_filter"
  1683. pp5_test_deps="mp_filter"
  1684. pp6_test_deps="mp_filter"
  1685. zlib_test_deps="zlib"
  1686. zmbv_test_deps="zlib"
  1687. # default parameters
  1688. logfile="config.log"
  1689. # installation paths
  1690. prefix_default="/usr/local"
  1691. bindir_default='${prefix}/bin'
  1692. datadir_default='${prefix}/share/ffmpeg'
  1693. incdir_default='${prefix}/include'
  1694. libdir_default='${prefix}/lib'
  1695. mandir_default='${prefix}/share/man'
  1696. shlibdir_default="$libdir_default"
  1697. postproc_version_default="current"
  1698. # toolchain
  1699. ar_default="ar"
  1700. cc_default="gcc"
  1701. cxx_default="g++"
  1702. cc_version=\"unknown\"
  1703. host_cc_default="gcc"
  1704. install="install"
  1705. ln_s="ln -sf"
  1706. nm_default="nm"
  1707. objformat="elf"
  1708. pkg_config_default=pkg-config
  1709. ranlib="ranlib"
  1710. strip_default="strip"
  1711. yasmexe_default="yasm"
  1712. nm_opts='-g'
  1713. nogas=":"
  1714. # machine
  1715. arch_default=$(uname -m)
  1716. cpu="generic"
  1717. # OS
  1718. target_os_default=$(tolower $(uname -s))
  1719. host_os=$target_os_default
  1720. # alternative libpostproc version
  1721. ALT_PP_VER_MAJOR=51
  1722. ALT_PP_VER_MINOR=2
  1723. ALT_PP_VER_MICRO=101
  1724. ALT_PP_VER=$ALT_PP_VER_MAJOR.$ALT_PP_VER_MINOR.$ALT_PP_VER_MICRO
  1725. # configurable options
  1726. enable $PROGRAM_LIST
  1727. enable avcodec
  1728. enable avdevice
  1729. enable avfilter
  1730. enable avformat
  1731. enable avutil
  1732. enable postproc
  1733. enable stripping
  1734. enable swresample
  1735. enable swscale
  1736. enable asm
  1737. enable debug
  1738. enable doc
  1739. enable fastdiv
  1740. enable network
  1741. enable optimizations
  1742. enable safe_bitstream_reader
  1743. enable static
  1744. enable swscale_alpha
  1745. # build settings
  1746. SHFLAGS='-shared -Wl,-soname,$$(@F)'
  1747. FFSERVERLDFLAGS=-Wl,-E
  1748. LIBPREF="lib"
  1749. LIBSUF=".a"
  1750. FULLNAME='$(NAME)$(BUILDSUF)'
  1751. LIBNAME='$(LIBPREF)$(FULLNAME)$(LIBSUF)'
  1752. SLIBPREF="lib"
  1753. SLIBSUF=".so"
  1754. SLIBNAME='$(SLIBPREF)$(FULLNAME)$(SLIBSUF)'
  1755. SLIBNAME_WITH_VERSION='$(SLIBNAME).$(LIBVERSION)'
  1756. SLIBNAME_WITH_MAJOR='$(SLIBNAME).$(LIBMAJOR)'
  1757. LIB_INSTALL_EXTRA_CMD='$$(RANLIB) "$(LIBDIR)/$(LIBNAME)"'
  1758. SLIB_INSTALL_NAME='$(SLIBNAME_WITH_VERSION)'
  1759. SLIB_INSTALL_LINKS='$(SLIBNAME_WITH_MAJOR) $(SLIBNAME)'
  1760. AS_O='-o $@'
  1761. CC_O='-o $@'
  1762. CXX_O='-o $@'
  1763. host_cflags='-D_ISOC99_SOURCE -D_XOPEN_SOURCE=600 -O3 -g'
  1764. host_libs='-lm'
  1765. target_path='$(CURDIR)'
  1766. # since the object filename is not given with the -MM flag, the compiler
  1767. # is only able to print the basename, and we must add the path ourselves
  1768. DEPEND_CMD='$(DEPCC) $(DEPFLAGS) $< | sed -e "/^\#.*/d" -e "s,^[[:space:]]*$(*F)\\.o,$(@D)/$(*F).o," > $(@:.o=.d)'
  1769. DEPFLAGS='$(CPPFLAGS) $(CFLAGS) -MM'
  1770. # find source path
  1771. if test -f configure; then
  1772. source_path=.
  1773. else
  1774. source_path=$(cd $(dirname "$0"); pwd)
  1775. echo "$source_path" | grep -q '[[:blank:]]' &&
  1776. die "Out of tree builds are impossible with whitespace in source path."
  1777. test -e "$source_path/config.h" &&
  1778. die "Out of tree builds are impossible with config.h in source dir."
  1779. fi
  1780. for v in "$@"; do
  1781. r=${v#*=}
  1782. l=${v%"$r"}
  1783. r=$(sh_quote "$r")
  1784. FFMPEG_CONFIGURATION="${FFMPEG_CONFIGURATION# } ${l}${r}"
  1785. done
  1786. find_things(){
  1787. thing=$1
  1788. pattern=$2
  1789. file=$source_path/$3
  1790. sed -n "s/^[^#]*$pattern.*([^,]*, *\([^,]*\)\(,.*\)*).*/\1_$thing/p" "$file"
  1791. }
  1792. ENCODER_LIST=$(find_things encoder ENC libavcodec/allcodecs.c)
  1793. DECODER_LIST=$(find_things decoder DEC libavcodec/allcodecs.c)
  1794. HWACCEL_LIST=$(find_things hwaccel HWACCEL libavcodec/allcodecs.c)
  1795. PARSER_LIST=$(find_things parser PARSER libavcodec/allcodecs.c)
  1796. BSF_LIST=$(find_things bsf BSF libavcodec/allcodecs.c)
  1797. MUXER_LIST=$(find_things muxer _MUX libavformat/allformats.c)
  1798. DEMUXER_LIST=$(find_things demuxer DEMUX libavformat/allformats.c)
  1799. OUTDEV_LIST=$(find_things outdev OUTDEV libavdevice/alldevices.c)
  1800. INDEV_LIST=$(find_things indev _IN libavdevice/alldevices.c)
  1801. PROTOCOL_LIST=$(find_things protocol PROTOCOL libavformat/allformats.c)
  1802. FILTER_LIST=$(find_things filter FILTER libavfilter/allfilters.c)
  1803. ALL_COMPONENTS="
  1804. $BSF_LIST
  1805. $DECODER_LIST
  1806. $DEMUXER_LIST
  1807. $ENCODER_LIST
  1808. $FILTER_LIST
  1809. $HWACCEL_LIST
  1810. $INDEV_LIST
  1811. $MUXER_LIST
  1812. $OUTDEV_LIST
  1813. $PARSER_LIST
  1814. $PROTOCOL_LIST
  1815. "
  1816. find_tests(){
  1817. map "echo ${2}\${v}_test" $(ls "$source_path"/tests/ref/$1 | grep -v '[^-a-z0-9_]')
  1818. }
  1819. LAVF_FATE_TESTS=$(find_tests lavf-fate)
  1820. LAVF_TESTS=$(find_tests lavf)
  1821. LAVFI_TESTS=$(find_tests lavfi)
  1822. SEEK_TESTS=$(find_tests seek seek_)
  1823. ALL_TESTS="$LAVF_FATE_TESTS $LAVF_TESTS $LAVFI_TESTS $SEEK_TESTS"
  1824. for n in $COMPONENT_LIST; do
  1825. v=$(toupper ${n%s})_LIST
  1826. eval enable \$$v
  1827. eval ${n}_if_any="\$$v"
  1828. done
  1829. enable $ARCH_EXT_LIST $ALL_TESTS
  1830. die_unknown(){
  1831. echo "Unknown option \"$1\"."
  1832. echo "See $0 --help for available options."
  1833. exit 1
  1834. }
  1835. show_list() {
  1836. suffix=_$1
  1837. shift
  1838. echo $* | sed s/$suffix//g | tr ' ' '\n' | sort | pr -3 -t
  1839. exit 0
  1840. }
  1841. rand_list(){
  1842. IFS=', '
  1843. set -- $*
  1844. unset IFS
  1845. for thing; do
  1846. comp=${thing%:*}
  1847. prob=${thing#$comp}
  1848. prob=${prob#:}
  1849. is_in ${comp} $COMPONENT_LIST && eval comp=\$$(toupper ${comp%s})_LIST
  1850. echo "prob ${prob:-0.5}"
  1851. printf '%s\n' $comp
  1852. done
  1853. }
  1854. do_random(){
  1855. action=$1
  1856. shift
  1857. random_seed=$(awk "BEGIN { srand($random_seed); print srand() }")
  1858. $action $(rand_list "$@" | awk "BEGIN { srand($random_seed) } \$1 == \"prob\" { prob = \$2; next } rand() < prob { print }")
  1859. }
  1860. for opt do
  1861. optval="${opt#*=}"
  1862. case "$opt" in
  1863. --extra-ldflags=*) add_ldflags $optval
  1864. ;;
  1865. --extra-libs=*) add_extralibs $optval
  1866. ;;
  1867. --disable-devices) disable $INDEV_LIST $OUTDEV_LIST
  1868. ;;
  1869. --enable-debug=*) debuglevel="$optval"
  1870. ;;
  1871. --disable-everything)
  1872. map 'eval unset \${$(toupper ${v%s})_LIST}' $COMPONENT_LIST
  1873. ;;
  1874. --enable-random|--disable-random)
  1875. action=${opt%%-random}
  1876. do_random ${action#--} $COMPONENT_LIST
  1877. ;;
  1878. --enable-random=*|--disable-random=*)
  1879. action=${opt%%-random=*}
  1880. do_random ${action#--} $optval
  1881. ;;
  1882. --enable-*=*|--disable-*=*)
  1883. eval $(echo "${opt%%=*}" | sed 's/--/action=/;s/-/ thing=/')
  1884. is_in "${thing}s" $COMPONENT_LIST || die_unknown "$opt"
  1885. eval list=\$$(toupper $thing)_LIST
  1886. name=$(echo "${optval}" | sed "s/,/_${thing}|/g")_${thing}
  1887. $action $(filter "$name" $list)
  1888. ;;
  1889. --enable-?*|--disable-?*)
  1890. eval $(echo "$opt" | sed 's/--/action=/;s/-/ option=/;s/-/_/g')
  1891. if is_in $option $COMPONENT_LIST; then
  1892. test $action = disable && action=unset
  1893. eval $action \$$(toupper ${option%s})_LIST
  1894. elif is_in $option $CMDLINE_SELECT; then
  1895. $action $option
  1896. else
  1897. die_unknown $opt
  1898. fi
  1899. ;;
  1900. --list-*)
  1901. NAME="${opt#--list-}"
  1902. is_in $NAME $COMPONENT_LIST || die_unknown $opt
  1903. NAME=${NAME%s}
  1904. eval show_list $NAME \$$(toupper $NAME)_LIST
  1905. ;;
  1906. --help|-h) show_help
  1907. ;;
  1908. *)
  1909. optname="${opt%%=*}"
  1910. optname="${optname#--}"
  1911. optname=$(echo "$optname" | sed 's/-/_/g')
  1912. if is_in $optname $CMDLINE_SET; then
  1913. eval $optname='$optval'
  1914. elif is_in $optname $CMDLINE_APPEND; then
  1915. append $optname "$optval"
  1916. else
  1917. die_unknown $opt
  1918. fi
  1919. ;;
  1920. esac
  1921. done
  1922. disabled logging && logfile=/dev/null
  1923. echo "# $0 $FFMPEG_CONFIGURATION" > $logfile
  1924. set >> $logfile
  1925. test -n "$cross_prefix" && enable cross_compile
  1926. if enabled cross_compile; then
  1927. test -n "$arch" && test -n "$target_os" ||
  1928. die "Must specify target arch and OS when cross-compiling"
  1929. fi
  1930. set_default arch target_os postproc_version
  1931. # Check if we should build alternative libpostproc version instead of current
  1932. if test "$postproc_version" = $ALT_PP_VER; then
  1933. LIBPOSTPROC_VERSION=$ALT_PP_VER
  1934. LIBPOSTPROC_VERSION_MAJOR=$ALT_PP_VER_MAJOR
  1935. LIBPOSTPROC_VERSION_MINOR=$ALT_PP_VER_MINOR
  1936. LIBPOSTPROC_VERSION_MICRO=$ALT_PP_VER_MICRO
  1937. elif test "$postproc_version" != current; then
  1938. die "Invalid argument to --postproc-version. See --help output."
  1939. fi
  1940. ar_default="${cross_prefix}${ar_default}"
  1941. cc_default="${cross_prefix}${cc_default}"
  1942. cxx_default="${cross_prefix}${cxx_default}"
  1943. nm_default="${cross_prefix}${nm_default}"
  1944. pkg_config_default="${cross_prefix}${pkg_config_default}"
  1945. ranlib="${cross_prefix}${ranlib}"
  1946. strip_default="${cross_prefix}${strip_default}"
  1947. sysinclude_default="${sysroot}/usr/include"
  1948. set_default cc cxx nm pkg_config strip sysinclude yasmexe
  1949. enabled cross_compile || host_cc_default=$cc
  1950. set_default host_cc
  1951. if ! $pkg_config --version >/dev/null 2>&1; then
  1952. warn "$pkg_config not found, library detection may fail."
  1953. pkg_config=false
  1954. fi
  1955. exesuf() {
  1956. case $1 in
  1957. mingw32*|cygwin*|*-dos|freedos|opendos|os/2*|symbian) echo .exe ;;
  1958. esac
  1959. }
  1960. EXESUF=$(exesuf $target_os)
  1961. HOSTEXESUF=$(exesuf $host_os)
  1962. # set temporary file name
  1963. : ${TMPDIR:=$TEMPDIR}
  1964. : ${TMPDIR:=$TMP}
  1965. : ${TMPDIR:=/tmp}
  1966. if ! check_cmd mktemp -u XXXXXX; then
  1967. # simple replacement for missing mktemp
  1968. # NOT SAFE FOR GENERAL USE
  1969. mktemp(){
  1970. echo "${2%%XXX*}.${HOSTNAME}.${UID}.$$"
  1971. }
  1972. fi
  1973. tmpfile(){
  1974. tmp=$(mktemp -u "${TMPDIR}/ffconf.XXXXXXXX")$2 &&
  1975. (set -C; exec > $tmp) 2>/dev/null ||
  1976. die "Unable to create temporary file in $TMPDIR."
  1977. append TMPFILES $tmp
  1978. eval $1=$tmp
  1979. }
  1980. trap 'rm -f -- $TMPFILES' EXIT
  1981. tmpfile TMPASM .asm
  1982. tmpfile TMPC .c
  1983. tmpfile TMPCPP .cpp
  1984. tmpfile TMPE $EXESUF
  1985. tmpfile TMPH .h
  1986. tmpfile TMPO .o
  1987. tmpfile TMPS .S
  1988. tmpfile TMPSH .sh
  1989. tmpfile TMPV .ver
  1990. unset -f mktemp
  1991. chmod +x $TMPE
  1992. # make sure we can execute files in $TMPDIR
  1993. cat > $TMPSH 2>> $logfile <<EOF
  1994. #! /bin/sh
  1995. EOF
  1996. chmod +x $TMPSH >> $logfile 2>&1
  1997. if ! $TMPSH >> $logfile 2>&1; then
  1998. cat <<EOF
  1999. Unable to create and execute files in $TMPDIR. Set the TMPDIR environment
  2000. variable to another directory and make sure that it is not mounted noexec.
  2001. EOF
  2002. die "Sanity test failed."
  2003. fi
  2004. filter_asflags=echo
  2005. filter_cflags=echo
  2006. filter_cppflags=echo
  2007. if $cc -v 2>&1 | grep -q '^gcc.*LLVM'; then
  2008. cc_type=llvm_gcc
  2009. cc_version=__VERSION__
  2010. gcc_extra_ver=$(expr "$($cc --version | head -n1)" : '.*\((.*)\)')
  2011. cc_ident="llvm-gcc $($cc -dumpversion) $gcc_extra_ver"
  2012. CC_DEPFLAGS='-MMD -MF $(@:.o=.d) -MT $@'
  2013. AS_DEPFLAGS='-MMD -MF $(@:.o=.d) -MT $@'
  2014. speed_cflags='-O3'
  2015. size_cflags='-Os'
  2016. elif $cc -v 2>&1 | grep -qi ^gcc; then
  2017. cc_type=gcc
  2018. cc_version=__VERSION__
  2019. gcc_version=$($cc --version | head -n1)
  2020. gcc_basever=$($cc -dumpversion)
  2021. gcc_pkg_ver=$(expr "$gcc_version" : '[^ ]* \(([^)]*)\)')
  2022. gcc_ext_ver=$(expr "$gcc_version" : ".*$gcc_pkg_ver $gcc_basever \\(.*\\)")
  2023. cc_ident=$(cleanws "gcc $gcc_basever $gcc_pkg_ver $gcc_ext_ver")
  2024. if ! $cc -dumpversion | grep -q '^2\.'; then
  2025. CC_DEPFLAGS='-MMD -MF $(@:.o=.d) -MT $@'
  2026. AS_DEPFLAGS='-MMD -MF $(@:.o=.d) -MT $@'
  2027. fi
  2028. speed_cflags='-O3'
  2029. size_cflags='-Os'
  2030. elif $cc --version 2>/dev/null | grep -q Intel; then
  2031. cc_type=icc
  2032. cc_version="AV_STRINGIFY(__INTEL_COMPILER)"
  2033. cc_ident=$($cc --version | head -n1)
  2034. icc_version=$($cc -dumpversion)
  2035. CC_DEPFLAGS='-MMD'
  2036. AS_DEPFLAGS='-MMD'
  2037. speed_cflags='-O3'
  2038. size_cflags='-Os'
  2039. noopt_cflags='-O1'
  2040. elif $cc -v 2>&1 | grep -q xlc; then
  2041. cc_type=xlc
  2042. cc_version="AV_STRINGIFY(__IBMC__)"
  2043. cc_ident=$($cc -qversion 2>/dev/null | head -n1)
  2044. speed_cflags='-O5'
  2045. size_cflags='-O5 -qcompact'
  2046. elif $cc -V 2>/dev/null | grep -q Compaq; then
  2047. cc_type=ccc
  2048. cc_version="AV_STRINGIFY(__DECC_VER)"
  2049. cc_ident=$($cc -V | head -n1 | cut -d' ' -f1-3)
  2050. DEPFLAGS='$(CPPFLAGS) $(CFLAGS) -M'
  2051. debuglevel=3
  2052. add_ldflags -Wl,-z,now # calls to libots crash without this
  2053. speed_cflags='-fast'
  2054. size_cflags='-O1'
  2055. elif $cc --vsn 2>/dev/null | grep -q "ARM C/C++ Compiler"; then
  2056. test -d "$sysroot" || die "No valid sysroot specified."
  2057. cc_type=armcc
  2058. cc_version="AV_STRINGIFY(__ARMCC_VERSION)"
  2059. cc_ident=$($cc --vsn | head -n1)
  2060. armcc_conf="$PWD/armcc.conf"
  2061. $cc --arm_linux_configure \
  2062. --arm_linux_config_file="$armcc_conf" \
  2063. --configure_sysroot="$sysroot" \
  2064. --configure_cpp_headers="$sysinclude" >>$logfile 2>&1 ||
  2065. die "Error creating armcc configuration file."
  2066. $cc --vsn | grep -q RVCT && armcc_opt=rvct || armcc_opt=armcc
  2067. cc="$cc --arm_linux_config_file=$armcc_conf --translate_gcc"
  2068. as_default="${cross_prefix}gcc"
  2069. CC_DEPFLAGS='-MMD'
  2070. AS_DEPFLAGS='-MMD'
  2071. speed_cflags='-O3'
  2072. size_cflags='-Os'
  2073. filter_asflags="filter_out -W${armcc_opt}*"
  2074. elif $cc -version 2>/dev/null | grep -q TMS470; then
  2075. cc_type=tms470
  2076. cc_version="AV_STRINGIFY(__TI_COMPILER_VERSION__)"
  2077. cc_ident=$($cc -version | head -n1 | tr -s ' ')
  2078. cc="$cc --gcc --abi=eabi -eo=.o -mc -me"
  2079. CC_O='-fr=$(@D)'
  2080. as_default="${cross_prefix}gcc"
  2081. ld_default="${cross_prefix}gcc"
  2082. TMPO=$(basename $TMPC .c).o
  2083. append TMPFILES $TMPO
  2084. add_cflags -D__gnuc_va_list=va_list -D__USER_LABEL_PREFIX__=
  2085. CC_DEPFLAGS='-ppa -ppd=$(@:.o=.d)'
  2086. AS_DEPFLAGS='-MMD'
  2087. speed_cflags='-O3 -mf=5'
  2088. size_cflags='-O3 -mf=2'
  2089. filter_cflags=tms470_flags
  2090. tms470_flags(){
  2091. for flag; do
  2092. case $flag in
  2093. -march=*|-mcpu=*)
  2094. case "${flag#*=}" in
  2095. armv7-a|cortex-a*) echo -mv=7a8 ;;
  2096. armv7-r|cortex-r*) echo -mv=7r4 ;;
  2097. armv7-m|cortex-m*) echo -mv=7m3 ;;
  2098. armv6*|arm11*) echo -mv=6 ;;
  2099. armv5*e|arm[79]*e*|arm9[24]6*|arm96*|arm102[26])
  2100. echo -mv=5e ;;
  2101. armv4*|arm7*|arm9[24]*) echo -mv=4 ;;
  2102. esac
  2103. ;;
  2104. -mfpu=neon) echo --float_support=vfpv3 --neon ;;
  2105. -mfpu=vfp) echo --float_support=vfpv2 ;;
  2106. -mfpu=vfpv3) echo --float_support=vfpv3 ;;
  2107. -msoft-float) echo --float_support=vfplib ;;
  2108. -O[0-3]|-mf=*) echo $flag ;;
  2109. -g) echo -g -mn ;;
  2110. -pds=*) echo $flag ;;
  2111. esac
  2112. done
  2113. }
  2114. elif $cc -v 2>&1 | grep -q clang; then
  2115. cc_type=clang
  2116. $cc -dM -E $TMPC | grep -q __clang_version__ &&
  2117. cc_version=__clang_version__ || cc_version=__VERSION__
  2118. cc_ident=$($cc --version | head -n1)
  2119. CC_DEPFLAGS='-MMD'
  2120. AS_DEPFLAGS='-MMD'
  2121. speed_cflags='-O3'
  2122. size_cflags='-Os'
  2123. elif $cc -V 2>&1 | grep -q Sun; then
  2124. cc_type=suncc
  2125. cc_version="AV_STRINGIFY(__SUNPRO_C)"
  2126. cc_ident=$($cc -V 2>&1 | head -n1 | cut -d' ' -f 2-)
  2127. DEPEND_CMD='$(DEPCC) $(DEPFLAGS) $< | sed -e "1s,^.*: ,$@: ," -e "\$$!s,\$$, \\\," -e "1!s,^.*: , ," > $(@:.o=.d)'
  2128. DEPFLAGS='$(CPPFLAGS) $(CFLAGS) -xM1'
  2129. add_ldflags -xc99
  2130. speed_cflags='-O5'
  2131. size_cflags='-O5 -xspace'
  2132. filter_cflags=suncc_flags
  2133. suncc_flags(){
  2134. for flag; do
  2135. case $flag in
  2136. -march=*|-mcpu=*)
  2137. case "${flag#*=}" in
  2138. native) echo -xtarget=native ;;
  2139. v9|niagara) echo -xarch=sparc ;;
  2140. ultrasparc) echo -xarch=sparcvis ;;
  2141. ultrasparc3|niagara2) echo -xarch=sparcvis2 ;;
  2142. i586|pentium) echo -xchip=pentium ;;
  2143. i686|pentiumpro|pentium2) echo -xtarget=pentium_pro ;;
  2144. pentium3*|c3-2) echo -xtarget=pentium3 ;;
  2145. pentium-m) echo -xarch=sse2 -xchip=pentium3 ;;
  2146. pentium4*) echo -xtarget=pentium4 ;;
  2147. prescott|nocona) echo -xarch=sse3 -xchip=pentium4 ;;
  2148. *-sse3) echo -xarch=sse3 ;;
  2149. core2) echo -xarch=ssse3 -xchip=core2 ;;
  2150. amdfam10|barcelona) echo -xarch=sse4_1 ;;
  2151. athlon-4|athlon-[mx]p) echo -xarch=ssea ;;
  2152. k8|opteron|athlon64|athlon-fx)
  2153. echo -xarch=sse2a ;;
  2154. athlon*) echo -xarch=pentium_proa ;;
  2155. esac
  2156. ;;
  2157. -std=c99) echo -xc99 ;;
  2158. -fomit-frame-pointer) echo -xregs=frameptr ;;
  2159. -fPIC) echo -KPIC -xcode=pic32 ;;
  2160. -W*,*) echo $flag ;;
  2161. -f*-*|-W*) ;;
  2162. *) echo $flag ;;
  2163. esac
  2164. done
  2165. }
  2166. elif $cc -v 2>&1 | grep -q 'PathScale\|Path64'; then
  2167. cc_type=pathscale
  2168. cc_version=__PATHSCALE__
  2169. cc_ident=$($cc -v 2>&1 | head -n1 | tr -d :)
  2170. CC_DEPFLAGS='-MMD -MF $(@:.o=.d) -MT $@'
  2171. AS_DEPFLAGS='-MMD -MF $(@:.o=.d) -MT $@'
  2172. speed_cflags='-O2'
  2173. size_cflags='-Os'
  2174. filter_cflags='filter_out -Wdisabled-optimization'
  2175. elif $cc -v 2>&1 | grep -q Open64; then
  2176. cc_type=open64
  2177. cc_version=__OPEN64__
  2178. cc_ident=$($cc -v 2>&1 | head -n1 | tr -d :)
  2179. CC_DEPFLAGS='-MMD -MF $(@:.o=.d) -MT $@'
  2180. AS_DEPFLAGS='-MMD -MF $(@:.o=.d) -MT $@'
  2181. speed_cflags='-O2'
  2182. size_cflags='-Os'
  2183. filter_cflags='filter_out -Wdisabled-optimization|-Wtype-limits|-fno-signed-zeros'
  2184. elif $cc -V 2>&1 | grep -q Portland; then
  2185. cc_type=pgi
  2186. cc_version='AV_STRINGIFY(__PGIC__.__PGIC_MINOR__.__PGIC_PATCHLEVEL__)'
  2187. cc_ident="PGI $($cc -V 2>&1 | awk '/^pgcc/ { print $2; exit }')"
  2188. opt_common='-alias=ansi -Mlre -Mpre'
  2189. speed_cflags="-O3 -Mautoinline -Munroll=c:4 $opt_common"
  2190. size_cflags="-O2 -Munroll=c:1 $opt_common"
  2191. noopt_cflags="-O1"
  2192. filter_cflags=pgi_flags
  2193. pgi_flags(){
  2194. for flag; do
  2195. case $flag in
  2196. -fomit-frame-pointer) echo -Mnoframe ;;
  2197. -g) echo -gopt ;;
  2198. *) echo $flag ;;
  2199. esac
  2200. done
  2201. }
  2202. fi
  2203. test -n "$cc_type" && enable $cc_type ||
  2204. warn "Unknown C compiler $cc, unable to select optimal CFLAGS"
  2205. : ${as_default:=$cc}
  2206. : ${dep_cc_default:=$cc}
  2207. : ${ld_default:=$cc}
  2208. set_default ar as dep_cc ld
  2209. test -n "$CC_DEPFLAGS" || CCDEP=$DEPEND_CMD
  2210. test -n "$CXX_DEPFLAGS" || CXXDEP=$DEPEND_CMD
  2211. test -n "$AS_DEPFLAGS" || ASDEP=$DEPEND_CMD
  2212. add_cflags $extra_cflags
  2213. add_cxxflags $extra_cxxflags
  2214. add_asflags $extra_cflags
  2215. if test -n "$sysroot"; then
  2216. case "$cc_type" in
  2217. gcc|llvm_gcc|clang)
  2218. add_cppflags --sysroot="$sysroot"
  2219. add_ldflags --sysroot="$sysroot"
  2220. ;;
  2221. tms470)
  2222. add_cppflags -I"$sysinclude"
  2223. add_ldflags --sysroot="$sysroot"
  2224. ;;
  2225. esac
  2226. fi
  2227. if test "$cpu" = host; then
  2228. enabled cross_compile && die "--cpu=host makes no sense when cross-compiling."
  2229. case "$cc_type" in
  2230. gcc|llvm_gcc)
  2231. check_native(){
  2232. $cc $1=native -v -c -o $TMPO $TMPC >$TMPE 2>&1 || return
  2233. sed -n "/cc1.*$1=/{
  2234. s/.*$1=\\([^ ]*\\).*/\\1/
  2235. p
  2236. q
  2237. }" $TMPE
  2238. }
  2239. cpu=$(check_native -march || check_native -mcpu)
  2240. ;;
  2241. esac
  2242. test "${cpu:-host}" = host && die "--cpu=host not supported with compiler $cc"
  2243. fi
  2244. # Deal with common $arch aliases
  2245. case "$arch" in
  2246. arm*|iPad*)
  2247. arch="arm"
  2248. ;;
  2249. mips|mipsel|IP*)
  2250. arch="mips"
  2251. ;;
  2252. mips64*)
  2253. arch="mips"
  2254. subarch="mips64"
  2255. ;;
  2256. parisc|hppa)
  2257. arch="parisc"
  2258. ;;
  2259. parisc64|hppa64)
  2260. arch="parisc"
  2261. subarch="parisc64"
  2262. ;;
  2263. "Power Macintosh"|ppc|powerpc|ppc64|powerpc64)
  2264. arch="ppc"
  2265. ;;
  2266. s390|s390x)
  2267. arch="s390"
  2268. ;;
  2269. sh4|sh)
  2270. arch="sh4"
  2271. ;;
  2272. sun4u|sparc64)
  2273. arch="sparc"
  2274. subarch="sparc64"
  2275. ;;
  2276. i[3-6]86|i86pc|BePC|x86pc|x86_64|x86_32|amd64)
  2277. arch="x86"
  2278. ;;
  2279. esac
  2280. is_in $arch $ARCH_LIST || warn "unknown architecture $arch"
  2281. enable $arch
  2282. # Add processor-specific flags
  2283. if test "$cpu" = generic; then
  2284. : do nothing
  2285. elif enabled ppc; then
  2286. case $(tolower $cpu) in
  2287. 601|ppc601|powerpc601)
  2288. cpuflags="-mcpu=601"
  2289. disable altivec
  2290. ;;
  2291. 603*|ppc603*|powerpc603*)
  2292. cpuflags="-mcpu=603"
  2293. disable altivec
  2294. ;;
  2295. 604*|ppc604*|powerpc604*)
  2296. cpuflags="-mcpu=604"
  2297. disable altivec
  2298. ;;
  2299. g3|75*|ppc75*|powerpc75*)
  2300. cpuflags="-mcpu=750 -mpowerpc-gfxopt"
  2301. disable altivec
  2302. ;;
  2303. g4|745*|ppc745*|powerpc745*)
  2304. cpuflags="-mcpu=7450 -mpowerpc-gfxopt"
  2305. ;;
  2306. 74*|ppc74*|powerpc74*)
  2307. cpuflags="-mcpu=7400 -mpowerpc-gfxopt"
  2308. ;;
  2309. g5|970|ppc970|powerpc970)
  2310. cpuflags="-mcpu=970 -mpowerpc-gfxopt -mpowerpc64"
  2311. ;;
  2312. power[3-7]*)
  2313. cpuflags="-mcpu=$cpu -mpowerpc-gfxopt -mpowerpc64"
  2314. ;;
  2315. cell)
  2316. cpuflags="-mcpu=cell"
  2317. enable ldbrx
  2318. ;;
  2319. e500v2)
  2320. cpuflags="-mcpu=8548 -mhard-float -mfloat-gprs=double"
  2321. disable altivec
  2322. ;;
  2323. e500)
  2324. cpuflags="-mcpu=8540 -mhard-float"
  2325. disable altivec
  2326. ;;
  2327. esac
  2328. elif enabled x86; then
  2329. case $cpu in
  2330. i[345]86|pentium)
  2331. cpuflags="-march=$cpu"
  2332. disable mmx
  2333. ;;
  2334. # targets that do NOT support conditional mov (cmov)
  2335. pentium-mmx|k6|k6-[23]|winchip-c6|winchip2|c3)
  2336. cpuflags="-march=$cpu"
  2337. disable cmov
  2338. ;;
  2339. # targets that do support conditional mov (cmov)
  2340. i686|pentiumpro|pentium[23]|pentium-m|athlon|athlon-tbird|athlon-4|athlon-[mx]p|athlon64*|k8*|opteron*|athlon-fx|core2|amdfam10|barcelona|atom)
  2341. cpuflags="-march=$cpu"
  2342. enable cmov
  2343. enable fast_cmov
  2344. ;;
  2345. # targets that do support conditional mov but on which it's slow
  2346. pentium4|pentium4m|prescott|nocona)
  2347. cpuflags="-march=$cpu"
  2348. enable cmov
  2349. disable fast_cmov
  2350. ;;
  2351. esac
  2352. elif enabled sparc; then
  2353. case $cpu in
  2354. niagara)
  2355. cpuflags="-mcpu=$cpu"
  2356. disable vis
  2357. ;;
  2358. sparc64)
  2359. cpuflags="-mcpu=v9"
  2360. ;;
  2361. esac
  2362. elif enabled arm; then
  2363. case $cpu in
  2364. armv*)
  2365. cpuflags="-march=$cpu"
  2366. subarch=$(echo $cpu | sed 's/[^a-z0-9]//g')
  2367. ;;
  2368. *)
  2369. cpuflags="-mcpu=$cpu"
  2370. case $cpu in
  2371. cortex-a*) subarch=armv7a ;;
  2372. cortex-r*) subarch=armv7r ;;
  2373. cortex-m*) enable thumb; subarch=armv7m ;;
  2374. arm11*) subarch=armv6 ;;
  2375. arm[79]*e*|arm9[24]6*|arm96*|arm102[26]) subarch=armv5te ;;
  2376. armv4*|arm7*|arm9[24]*) subarch=armv4 ;;
  2377. esac
  2378. ;;
  2379. esac
  2380. elif enabled alpha; then
  2381. enabled ccc && cpuflags="-arch $cpu" || cpuflags="-mcpu=$cpu"
  2382. elif enabled bfin; then
  2383. cpuflags="-mcpu=$cpu"
  2384. elif enabled mips; then
  2385. cpuflags="-march=$cpu"
  2386. case $cpu in
  2387. 24kc)
  2388. disable mipsfpu
  2389. disable mipsdspr1
  2390. disable mipsdspr2
  2391. ;;
  2392. 24kf*)
  2393. disable mipsdspr1
  2394. disable mipsdspr2
  2395. ;;
  2396. 24kec|34kc|1004kc)
  2397. disable mipsfpu
  2398. disable mipsdspr2
  2399. ;;
  2400. 24kef*|34kf*|1004kf*)
  2401. disable mipsdspr2
  2402. ;;
  2403. 74kc)
  2404. disable mipsfpu
  2405. ;;
  2406. esac
  2407. elif enabled avr32; then
  2408. case $cpu in
  2409. ap7[02]0[0-2])
  2410. subarch="avr32_ap"
  2411. cpuflags="-mpart=$cpu"
  2412. ;;
  2413. ap)
  2414. subarch="avr32_ap"
  2415. cpuflags="-march=$cpu"
  2416. ;;
  2417. uc3[ab]*)
  2418. subarch="avr32_uc"
  2419. cpuflags="-mcpu=$cpu"
  2420. ;;
  2421. uc)
  2422. subarch="avr32_uc"
  2423. cpuflags="-march=$cpu"
  2424. ;;
  2425. esac
  2426. fi
  2427. add_cflags $cpuflags
  2428. add_asflags $cpuflags
  2429. # compiler sanity check
  2430. check_exec <<EOF
  2431. int main(void){ return 0; }
  2432. EOF
  2433. if test "$?" != 0; then
  2434. echo "$cc is unable to create an executable file."
  2435. if test -z "$cross_prefix" && ! enabled cross_compile ; then
  2436. echo "If $cc is a cross-compiler, use the --enable-cross-compile option."
  2437. echo "Only do this if you know what cross compiling means."
  2438. fi
  2439. die "C compiler test failed."
  2440. fi
  2441. add_cppflags -D_ISOC99_SOURCE
  2442. add_cxxflags -D__STDC_CONSTANT_MACROS
  2443. check_cflags -std=c99
  2444. check_cc -D_FILE_OFFSET_BITS=64 <<EOF && add_cppflags -D_FILE_OFFSET_BITS=64
  2445. #include <stdlib.h>
  2446. EOF
  2447. check_cc -D_LARGEFILE_SOURCE <<EOF && add_cppflags -D_LARGEFILE_SOURCE
  2448. #include <stdlib.h>
  2449. EOF
  2450. check_host_cflags -std=c99
  2451. check_host_cflags -Wall
  2452. case "$arch" in
  2453. alpha|ia64|mips|parisc|sparc)
  2454. spic=$shared
  2455. ;;
  2456. x86)
  2457. subarch="x86_32"
  2458. check_code cc "" "int test[(int)sizeof(char*) - 7]" && subarch="x86_64"
  2459. if test "$subarch" = "x86_64"; then
  2460. spic=$shared
  2461. fi
  2462. ;;
  2463. ppc)
  2464. check_cc <<EOF && subarch="ppc64"
  2465. int test[(int)sizeof(char*) - 7];
  2466. EOF
  2467. ;;
  2468. esac
  2469. enable $subarch
  2470. enabled spic && enable pic
  2471. # OS specific
  2472. case $target_os in
  2473. haiku)
  2474. prefix_default="/boot/common"
  2475. network_extralibs="-lnetwork"
  2476. host_libs=
  2477. ;;
  2478. sunos)
  2479. FFSERVERLDFLAGS=""
  2480. SHFLAGS='-shared -Wl,-h,$$(@F)'
  2481. enabled x86 && SHFLAGS="-mimpure-text $SHFLAGS"
  2482. network_extralibs="-lsocket -lnsl"
  2483. add_cppflags -D__EXTENSIONS__ -D_XOPEN_SOURCE=600
  2484. # When using suncc to build, the Solaris linker will mark
  2485. # an executable with each instruction set encountered by
  2486. # the Solaris assembler. As our libraries contain their own
  2487. # guards for processor-specific code, instead suppress
  2488. # generation of the HWCAPS ELF section on Solaris x86 only.
  2489. enabled_all suncc x86 && echo "hwcap_1 = OVERRIDE;" > mapfile && add_ldflags -Wl,-M,mapfile
  2490. nm_opts='-P -g'
  2491. ;;
  2492. netbsd)
  2493. disable symver
  2494. oss_indev_extralibs="-lossaudio"
  2495. oss_outdev_extralibs="-lossaudio"
  2496. ;;
  2497. openbsd|bitrig)
  2498. # On OpenBSD 4.5. the compiler does not use PIC unless
  2499. # explicitly using -fPIC. FFmpeg builds fine without PIC,
  2500. # however the generated executable will not do anything
  2501. # (simply quits with exit-code 1, no crash, no output).
  2502. # Thus explicitly enable PIC here.
  2503. enable pic
  2504. disable symver
  2505. SHFLAGS='-shared'
  2506. SLIBNAME_WITH_MAJOR='$(SLIBNAME).$(LIBVERSION)'
  2507. oss_indev_extralibs="-lossaudio"
  2508. oss_outdev_extralibs="-lossaudio"
  2509. ;;
  2510. dragonfly)
  2511. disable symver
  2512. ;;
  2513. freebsd)
  2514. ;;
  2515. bsd/os)
  2516. add_extralibs -lpoll -lgnugetopt
  2517. strip="strip -d"
  2518. ;;
  2519. darwin)
  2520. gas="gas-preprocessor.pl $cc"
  2521. enabled ppc && add_asflags -force_cpusubtype_ALL
  2522. SHFLAGS='-dynamiclib -Wl,-single_module -Wl,-install_name,$(SHLIBDIR)/$(SLIBNAME_WITH_MAJOR),-current_version,$(LIBVERSION),-compatibility_version,$(LIBMAJOR)'
  2523. enabled x86_32 && append SHFLAGS -Wl,-read_only_relocs,suppress
  2524. strip="${strip} -x"
  2525. add_ldflags -Wl,-dynamic,-search_paths_first
  2526. SLIBSUF=".dylib"
  2527. SLIBNAME_WITH_VERSION='$(SLIBPREF)$(FULLNAME).$(LIBVERSION)$(SLIBSUF)'
  2528. SLIBNAME_WITH_MAJOR='$(SLIBPREF)$(FULLNAME).$(LIBMAJOR)$(SLIBSUF)'
  2529. FFSERVERLDFLAGS=-Wl,-bind_at_load
  2530. objformat="macho"
  2531. enabled x86_64 && objformat="macho64"
  2532. enabled_any pic shared ||
  2533. { check_cflags -mdynamic-no-pic && add_asflags -mdynamic-no-pic; }
  2534. ;;
  2535. mingw32*)
  2536. if test $target_os = "mingw32ce"; then
  2537. disable network
  2538. else
  2539. target_os=mingw32
  2540. fi
  2541. LIBTARGET=i386
  2542. if enabled x86_64; then
  2543. LIBTARGET=x64
  2544. elif enabled arm; then
  2545. LIBTARGET=arm-wince
  2546. fi
  2547. shlibdir_default="$bindir_default"
  2548. SLIBPREF=""
  2549. SLIBSUF=".dll"
  2550. SLIBNAME_WITH_VERSION='$(SLIBPREF)$(FULLNAME)-$(LIBVERSION)$(SLIBSUF)'
  2551. SLIBNAME_WITH_MAJOR='$(SLIBPREF)$(FULLNAME)-$(LIBMAJOR)$(SLIBSUF)'
  2552. SLIB_EXTRA_CMD='-lib.exe /machine:$(LIBTARGET) /def:$$(@:$(SLIBSUF)=.def) /out:$(SUBDIR)$(SLIBNAME:$(SLIBSUF)=.lib)'
  2553. SLIB_INSTALL_NAME='$(SLIBNAME_WITH_MAJOR)'
  2554. SLIB_INSTALL_LINKS=
  2555. SLIB_INSTALL_EXTRA_SHLIB='$(SLIBNAME:$(SLIBSUF)=.lib)'
  2556. SLIB_INSTALL_EXTRA_LIB='lib$(SLIBNAME:$(SLIBSUF)=.dll.a) $(SLIBNAME_WITH_MAJOR:$(SLIBSUF)=.def)'
  2557. 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'
  2558. objformat="win32"
  2559. enable dos_paths
  2560. check_cflags -fno-common
  2561. check_cpp_condition _mingw.h "defined (__MINGW64_VERSION_MAJOR) || (__MINGW32_MAJOR_VERSION > 3) \
  2562. || (__MINGW32_MAJOR_VERSION == 3 && __MINGW32_MINOR_VERSION >= 15)" ||
  2563. die "ERROR: MinGW runtime version must be >= 3.15."
  2564. add_cppflags -U__STRICT_ANSI__
  2565. ;;
  2566. cygwin*)
  2567. target_os=cygwin
  2568. shlibdir_default="$bindir_default"
  2569. SLIBPREF="cyg"
  2570. SLIBSUF=".dll"
  2571. SLIBNAME_WITH_VERSION='$(SLIBPREF)$(FULLNAME)-$(LIBVERSION)$(SLIBSUF)'
  2572. SLIBNAME_WITH_MAJOR='$(SLIBPREF)$(FULLNAME)-$(LIBMAJOR)$(SLIBSUF)'
  2573. SHFLAGS='-shared -Wl,--enable-auto-image-base'
  2574. objformat="win32"
  2575. enable dos_paths
  2576. check_cflags -fno-common
  2577. add_cppflags -U__STRICT_ANSI__
  2578. ;;
  2579. *-dos|freedos|opendos)
  2580. network_extralibs="-lsocket"
  2581. objformat="coff"
  2582. enable dos_paths
  2583. add_cppflags -U__STRICT_ANSI__
  2584. ;;
  2585. linux)
  2586. add_cppflags -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600
  2587. enable dv1394
  2588. ;;
  2589. irix*)
  2590. target_os=irix
  2591. ranlib="echo ignoring ranlib"
  2592. ;;
  2593. os/2*)
  2594. strip="lxlite -CS"
  2595. ln_s="cp -f"
  2596. objformat="aout"
  2597. add_cppflags -D_GNU_SOURCE
  2598. add_ldflags -Zomf -Zbin-files -Zargs-wild -Zmap
  2599. SHFLAGS='$(SUBDIR)$(NAME).def -Zdll -Zomf'
  2600. FFSERVERLDFLAGS=""
  2601. LIBSUF="_s.a"
  2602. SLIBPREF=""
  2603. SLIBSUF=".dll"
  2604. SLIBNAME_WITH_VERSION='$(SLIBPREF)$(NAME)-$(LIBVERSION)$(SLIBSUF)'
  2605. SLIBNAME_WITH_MAJOR='$(SLIBPREF)$(shell echo $(NAME) | cut -c1-6)$(LIBMAJOR)$(SLIBSUF)'
  2606. SLIB_CREATE_DEF_CMD='echo LIBRARY $(SLIBNAME_WITH_MAJOR) INITINSTANCE TERMINSTANCE > $(SUBDIR)$(NAME).def; \
  2607. echo PROTMODE >> $(SUBDIR)$(NAME).def; \
  2608. echo CODE PRELOAD MOVEABLE DISCARDABLE >> $(SUBDIR)$(NAME).def; \
  2609. echo DATA PRELOAD MOVEABLE MULTIPLE NONSHARED >> $(SUBDIR)$(NAME).def; \
  2610. echo EXPORTS >> $(SUBDIR)$(NAME).def; \
  2611. emxexp -o $(OBJS) >> $(SUBDIR)$(NAME).def'
  2612. SLIB_EXTRA_CMD='emximp -o $(SUBDIR)$(LIBPREF)$(NAME)_dll.a $(SUBDIR)$(NAME).def; \
  2613. emximp -o $(SUBDIR)$(LIBPREF)$(NAME)_dll.lib $(SUBDIR)$(NAME).def;'
  2614. SLIB_INSTALL_EXTRA_LIB='$(LIBPREF)$(NAME)_dll.a $(LIBPREF)$(NAME)_dll.lib'
  2615. enable dos_paths
  2616. enable_weak os2threads
  2617. ;;
  2618. gnu/kfreebsd)
  2619. add_cppflags -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600 -D_BSD_SOURCE
  2620. ;;
  2621. gnu)
  2622. add_cppflags -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600
  2623. ;;
  2624. qnx)
  2625. add_cppflags -D_QNX_SOURCE
  2626. network_extralibs="-lsocket"
  2627. ;;
  2628. symbian)
  2629. SLIBSUF=".dll"
  2630. enable dos_paths
  2631. add_cflags --include=$sysinclude/gcce/gcce.h -fvisibility=default
  2632. add_cppflags -D__GCCE__ -D__SYMBIAN32__ -DSYMBIAN_OE_POSIX_SIGNALS
  2633. add_ldflags -Wl,--target1-abs,--no-undefined \
  2634. -Wl,-Ttext,0x80000,-Tdata,0x1000000 -shared \
  2635. -Wl,--entry=_E32Startup -Wl,-u,_E32Startup
  2636. add_extralibs -l:eexe.lib -l:usrt2_2.lib -l:dfpaeabi.dso \
  2637. -l:drtaeabi.dso -l:scppnwdl.dso -lsupc++ -lgcc \
  2638. -l:libc.dso -l:libm.dso -l:euser.dso -l:libcrt0.lib
  2639. ;;
  2640. none)
  2641. ;;
  2642. *)
  2643. die "Unknown OS '$target_os'."
  2644. ;;
  2645. esac
  2646. esc(){
  2647. echo "$*" | sed 's/%/%25/g;s/:/%3a/g'
  2648. }
  2649. echo "config:$arch:$subarch:$cpu:$target_os:$(esc $cc_ident):$(esc $FFMPEG_CONFIGURATION)" >config.fate
  2650. check_cpp_condition stdlib.h "defined(__PIC__) || defined(__pic__) || defined(PIC)" && enable pic
  2651. set_default $PATHS_LIST
  2652. # we need to build at least one lib type
  2653. if ! enabled_any static shared; then
  2654. cat <<EOF
  2655. At least one library type must be built.
  2656. Specify --enable-static to build the static libraries or --enable-shared to
  2657. build the shared libraries as well. To only build the shared libraries specify
  2658. --disable-static in addition to --enable-shared.
  2659. EOF
  2660. exit 1;
  2661. fi
  2662. die_license_disabled() {
  2663. enabled $1 || { enabled $2 && die "$2 is $1 and --enable-$1 is not specified."; }
  2664. }
  2665. die_license_disabled_gpl() {
  2666. enabled $1 || { enabled $2 && die "$2 is incompatible with the gpl and --enable-$1 is not specified."; }
  2667. }
  2668. die_license_disabled gpl libcdio
  2669. die_license_disabled gpl libutvideo
  2670. die_license_disabled gpl libx264
  2671. die_license_disabled gpl libxavs
  2672. die_license_disabled gpl libxvid
  2673. die_license_disabled gpl x11grab
  2674. die_license_disabled nonfree libaacplus
  2675. die_license_disabled nonfree libfaac
  2676. enabled gpl && die_license_disabled_gpl nonfree openssl
  2677. die_license_disabled version3 libopencore_amrnb
  2678. die_license_disabled version3 libopencore_amrwb
  2679. die_license_disabled version3 libvo_aacenc
  2680. die_license_disabled version3 libvo_amrwbenc
  2681. enabled version3 && { enabled gpl && enable gplv3 || enable lgplv3; }
  2682. disabled optimizations || check_cflags -fomit-frame-pointer
  2683. enable_pic() {
  2684. enable pic
  2685. add_cppflags -DPIC
  2686. add_cflags -fPIC
  2687. add_asflags -fPIC
  2688. }
  2689. enabled pic && enable_pic
  2690. check_cc <<EOF || die "Symbol mangling check failed."
  2691. int ff_extern;
  2692. EOF
  2693. sym=$($nm $nm_opts $TMPO | awk '/ff_extern/{ print substr($0, match($0, /[^ \t]*ff_extern/)) }')
  2694. extern_prefix=${sym%%ff_extern*}
  2695. check_cc <<EOF && enable inline_asm
  2696. void foo(void) { __asm__ volatile ("" ::); }
  2697. EOF
  2698. _restrict=
  2699. for restrict_keyword in restrict __restrict__ __restrict; do
  2700. check_cc <<EOF && _restrict=$restrict_keyword && break
  2701. void foo(char * $restrict_keyword p);
  2702. EOF
  2703. done
  2704. check_cc <<EOF && enable attribute_packed
  2705. struct { int x; } __attribute__((packed)) x;
  2706. EOF
  2707. check_cc <<EOF && enable attribute_may_alias
  2708. union { int x; } __attribute__((may_alias)) x;
  2709. EOF
  2710. check_cc <<EOF || die "endian test failed"
  2711. unsigned int endian = 'B' << 24 | 'I' << 16 | 'G' << 8 | 'E';
  2712. EOF
  2713. od -t x1 $TMPO | grep -q '42 *49 *47 *45' && enable bigendian
  2714. if enabled alpha; then
  2715. check_cflags -mieee
  2716. elif enabled arm; then
  2717. enabled thumb && check_cflags -mthumb || check_cflags -marm
  2718. nogas=die
  2719. if check_cpp_condition stddef.h "defined __ARM_PCS_VFP"; then
  2720. enable vfp_args
  2721. elif ! check_cpp_condition stddef.h "defined __ARM_PCS || defined __SOFTFP__"; then
  2722. case "${cross_prefix:-$cc}" in
  2723. *hardfloat*) enable vfp_args; fpabi=vfp ;;
  2724. *) check_ld "cc" <<EOF && enable vfp_args && fpabi=vfp || fpabi=soft ;;
  2725. __asm__ (".eabi_attribute 28, 1");
  2726. int main(void) { return 0; }
  2727. EOF
  2728. esac
  2729. warn "Compiler does not indicate floating-point ABI, guessing $fpabi."
  2730. fi
  2731. enabled armv5te && check_asm armv5te '"qadd r0, r0, r0"'
  2732. enabled armv6 && check_asm armv6 '"sadd16 r0, r0, r0"'
  2733. enabled armv6t2 && check_asm armv6t2 '"movt r0, #0"'
  2734. enabled armvfp && check_asm armvfp '"fadds s0, s0, s0"'
  2735. enabled neon && check_asm neon '"vadd.i16 q0, q0, q0"'
  2736. enabled vfpv3 && check_asm vfpv3 '"vmov.f32 s0, #1.0"'
  2737. check_asm asm_mod_y '"vmul.i32 d0, d0, %y0" :: "x"(0)'
  2738. enabled_all armv6t2 shared !pic && enable_pic
  2739. elif enabled mips; then
  2740. check_asm loongson '"dmult.g $1, $2, $3"'
  2741. enabled mmi && check_asm mmi '"lq $2, 0($2)"'
  2742. enabled mips32r2 && add_cflags "-mips32r2" &&
  2743. check_asm mips32r2 '"rotr $t0, $t1, 1"'
  2744. enabled mipsdspr1 && add_cflags "-mdsp" && add_asflags "-mdsp" &&
  2745. check_asm mipsdspr1 '"addu.qb $t0, $t1, $t2"'
  2746. enabled mipsdspr2 && add_cflags "-mdspr2" && add_asflags "-mdspr2" &&
  2747. check_asm mipsdspr2 '"absq_s.qb $t0, $t1"'
  2748. enabled mipsfpu && add_cflags "-mhard-float" &&
  2749. check_asm mipsfpu '"madd.d $f0, $f2, $f4, $f6"'
  2750. elif enabled ppc; then
  2751. enable local_aligned_8 local_aligned_16
  2752. check_asm dcbzl '"dcbzl 0, %0" :: "r"(0)'
  2753. check_asm ibm_asm '"add 0, 0, 0"'
  2754. check_asm ppc4xx '"maclhw r10, r11, r12"'
  2755. check_asm xform_asm '"lwzx %1, %y0" :: "Z"(*(int*)0), "r"(0)'
  2756. # AltiVec flags: The FSF version of GCC differs from the Apple version
  2757. if enabled altivec; then
  2758. nogas=warn
  2759. check_cflags -maltivec -mabi=altivec &&
  2760. { check_header altivec.h && inc_altivec_h="#include <altivec.h>" ; } ||
  2761. check_cflags -faltivec
  2762. # check if our compiler supports Motorola AltiVec C API
  2763. check_cc <<EOF || disable altivec
  2764. $inc_altivec_h
  2765. int main(void) {
  2766. vector signed int v1, v2, v3;
  2767. v1 = vec_add(v2,v3);
  2768. return 0;
  2769. }
  2770. EOF
  2771. # check if our compiler supports braces for vector declarations
  2772. check_cc <<EOF || die "You need a compiler that supports {} in AltiVec vector declarations."
  2773. $inc_altivec_h
  2774. int main (void) { (vector int) {1}; return 0; }
  2775. EOF
  2776. fi
  2777. elif enabled sparc; then
  2778. enabled vis && check_asm vis '"pdist %f0, %f0, %f0"' -mcpu=ultrasparc &&
  2779. add_cflags -mcpu=ultrasparc -mtune=ultrasparc
  2780. elif enabled x86; then
  2781. check_code ld immintrin.h "__xgetbv(0)" "cc" && enable xgetbv
  2782. check_code ld intrin.h "int info[4]; __cpuid(info, 0)" "cc" && enable cpuid
  2783. check_code ld intrin.h "__rdtsc()" "cc" && enable rdtsc
  2784. check_code ld intrin.h "unsigned int x = __readeflags()" "cc" && enable rweflags
  2785. check_code ld mmintrin.h "_mm_empty()" "cc" && enable mm_empty
  2786. enable local_aligned_8 local_aligned_16
  2787. # check whether EBP is available on x86
  2788. # As 'i' is stored on the stack, this program will crash
  2789. # if the base pointer is used to access it because the
  2790. # base pointer is cleared in the inline assembly code.
  2791. check_exec_crash <<EOF && enable ebp_available
  2792. volatile int i=0;
  2793. __asm__ volatile (
  2794. "xorl %%ebp, %%ebp"
  2795. ::: "%ebp");
  2796. return i;
  2797. EOF
  2798. # check whether EBX is available on x86
  2799. check_asm ebx_available '""::"b"(0)' &&
  2800. check_asm ebx_available '"":::"%ebx"'
  2801. # check whether xmm clobbers are supported
  2802. check_asm xmm_clobbers '"":::"%xmm0"'
  2803. # check whether binutils is new enough to compile SSSE3/MMX2
  2804. enabled ssse3 && check_asm ssse3 '"pabsw %xmm0, %xmm0"'
  2805. enabled mmx2 && check_asm mmx2 '"pmaxub %mm0, %mm1"'
  2806. if ! disabled_any asm mmx yasm; then
  2807. if check_cmd $yasmexe --version; then
  2808. enabled x86_64 && yasm_extra="-m amd64"
  2809. yasm_debug="-g dwarf2"
  2810. elif check_cmd nasm -v; then
  2811. yasmexe=nasm
  2812. yasm_debug="-g -F dwarf"
  2813. enabled x86_64 && test "$objformat" = elf && objformat=elf64
  2814. fi
  2815. YASMFLAGS="-f $objformat $yasm_extra"
  2816. enabled pic && append YASMFLAGS "-DPIC"
  2817. test -n "$extern_prefix" && append YASMFLAGS "-DPREFIX"
  2818. case "$objformat" in
  2819. elf*) enabled debug && append YASMFLAGS $yasm_debug ;;
  2820. esac
  2821. check_yasm "pextrd [eax], xmm0, 1" && enable yasm ||
  2822. die "yasm not found, use --disable-yasm for a crippled build"
  2823. check_yasm "vextractf128 xmm0, ymm0, 0" || disable avx
  2824. fi
  2825. case "$cpu" in
  2826. athlon*|opteron*|k8*|pentium|pentium-mmx|prescott|nocona|atom|geode)
  2827. disable fast_clz
  2828. ;;
  2829. esac
  2830. fi
  2831. if enabled asm; then
  2832. as=${gas:=$as}
  2833. check_asm gnu_as '".macro m n\n\\n:.int 0\n.endm\nm x"' ||
  2834. $nogas "GNU assembler not found, install gas-preprocessor"
  2835. fi
  2836. check_ldflags -Wl,--as-needed
  2837. if check_func dlopen; then
  2838. ldl=
  2839. elif check_func dlopen -ldl; then
  2840. ldl=-ldl
  2841. fi
  2842. if enabled network; then
  2843. check_type "sys/types.h sys/socket.h" socklen_t
  2844. check_type netdb.h "struct addrinfo"
  2845. check_type netinet/in.h "struct group_source_req" -D_BSD_SOURCE
  2846. check_type netinet/in.h "struct ip_mreq_source" -D_BSD_SOURCE
  2847. check_type netinet/in.h "struct ipv6_mreq" -D_DARWIN_C_SOURCE
  2848. check_type netinet/in.h "struct sockaddr_in6"
  2849. check_type poll.h "struct pollfd"
  2850. check_type "sys/types.h sys/socket.h" "struct sockaddr_storage"
  2851. check_struct "sys/types.h sys/socket.h" "struct sockaddr" sa_len
  2852. check_header netinet/sctp.h
  2853. # Prefer arpa/inet.h over winsock2
  2854. if check_header arpa/inet.h ; then
  2855. check_func closesocket
  2856. elif check_header winsock2.h ; then
  2857. check_func_headers winsock2.h closesocket -lws2 && \
  2858. network_extralibs="-lws2" || \
  2859. { check_func_headers winsock2.h closesocket -lws2_32 && \
  2860. network_extralibs="-lws2_32"; }
  2861. check_type ws2tcpip.h socklen_t
  2862. check_type ws2tcpip.h "struct addrinfo"
  2863. check_type ws2tcpip.h "struct group_source_req"
  2864. check_type ws2tcpip.h "struct ip_mreq_source"
  2865. check_type ws2tcpip.h "struct ipv6_mreq"
  2866. check_type winsock2.h "struct pollfd"
  2867. check_type ws2tcpip.h "struct sockaddr_in6"
  2868. check_type ws2tcpip.h "struct sockaddr_storage"
  2869. check_struct winsock2.h "struct sockaddr" sa_len
  2870. else
  2871. disable network
  2872. fi
  2873. fi
  2874. # Solaris has nanosleep in -lrt, OpenSolaris no longer needs that
  2875. check_func nanosleep || { check_func nanosleep -lrt && add_extralibs -lrt; }
  2876. check_func clock_gettime || { check_func clock_gettime -lrt && add_extralibs -lrt; }
  2877. check_func fcntl
  2878. check_func fork
  2879. check_func getaddrinfo $network_extralibs
  2880. check_func gethrtime
  2881. check_func getrusage
  2882. check_struct "sys/time.h sys/resource.h" "struct rusage" ru_maxrss
  2883. check_func gettimeofday
  2884. check_func inet_aton $network_extralibs
  2885. check_func isatty
  2886. check_func localtime_r
  2887. check_func ${malloc_prefix}memalign && enable memalign
  2888. check_func mkstemp
  2889. check_func mmap
  2890. check_func ${malloc_prefix}posix_memalign && enable posix_memalign
  2891. check_func_headers malloc.h _aligned_malloc && enable aligned_malloc
  2892. check_func setrlimit
  2893. check_func strerror_r
  2894. check_func strptime
  2895. check_func sched_getaffinity
  2896. check_func sysconf
  2897. check_func sysctl
  2898. check_func usleep
  2899. check_func_headers conio.h kbhit
  2900. check_func_headers windows.h PeekNamedPipe
  2901. check_func_headers io.h setmode
  2902. check_func_headers lzo/lzo1x.h lzo1x_999_compress
  2903. check_lib2 "windows.h psapi.h" GetProcessMemoryInfo -lpsapi
  2904. check_func_headers windows.h GetProcessAffinityMask
  2905. check_func_headers windows.h GetProcessTimes
  2906. check_func_headers windows.h GetSystemTimeAsFileTime
  2907. check_func_headers windows.h MapViewOfFile
  2908. check_func_headers windows.h Sleep
  2909. check_func_headers windows.h VirtualAlloc
  2910. check_func_headers glob.h glob
  2911. check_header dlfcn.h
  2912. check_header dxva.h
  2913. check_header dxva2api.h -D_WIN32_WINNT=0x0600
  2914. check_header libcrystalhd/libcrystalhd_if.h
  2915. check_header malloc.h
  2916. check_header poll.h
  2917. check_header sys/mman.h
  2918. check_header sys/param.h
  2919. check_header sys/resource.h
  2920. check_header sys/select.h
  2921. check_header sys/time.h
  2922. check_header termios.h
  2923. check_header unistd.h
  2924. check_header vdpau/vdpau.h
  2925. check_header vdpau/vdpau_x11.h
  2926. check_header windows.h
  2927. check_header X11/extensions/XvMClib.h
  2928. check_header asm/types.h
  2929. disabled zlib || check_lib zlib.h zlibVersion -lz || disable zlib
  2930. disabled bzlib || check_lib2 bzlib.h BZ2_bzlibVersion -lbz2 || disable bzlib
  2931. # check for VDA header
  2932. if ! disabled vda; then
  2933. if check_header VideoDecodeAcceleration/VDADecoder.h; then
  2934. enable vda
  2935. add_extralibs -framework CoreFoundation -framework VideoDecodeAcceleration -framework QuartzCore
  2936. fi
  2937. fi
  2938. if ! disabled w32threads && ! enabled pthreads; then
  2939. check_func _beginthreadex && enable w32threads
  2940. fi
  2941. # check for some common methods of building with pthread support
  2942. # do this before the optional library checks as some of them require pthreads
  2943. if ! disabled pthreads && ! enabled w32threads && ! enabled os2threads; then
  2944. enable pthreads
  2945. if check_func pthread_create; then
  2946. :
  2947. elif check_func pthread_create -pthread; then
  2948. add_cflags -pthread
  2949. add_extralibs -pthread
  2950. elif check_func pthread_create -pthreads; then
  2951. add_cflags -pthreads
  2952. add_extralibs -pthreads
  2953. elif check_func pthread_create -lpthreadGC2; then
  2954. add_extralibs -lpthreadGC2
  2955. elif ! check_lib pthread.h pthread_create -lpthread; then
  2956. disable pthreads
  2957. fi
  2958. fi
  2959. for thread in $THREADS_LIST; do
  2960. if enabled $thread; then
  2961. test -n "$thread_type" &&
  2962. die "ERROR: Only one thread type must be selected." ||
  2963. thread_type="$thread"
  2964. fi
  2965. done
  2966. if enabled pthreads; then
  2967. check_func pthread_cancel
  2968. fi
  2969. check_lib math.h sin -lm && LIBM="-lm"
  2970. disabled crystalhd || check_lib libcrystalhd/libcrystalhd_if.h DtsCrystalHDVersion -lcrystalhd || disable crystalhd
  2971. enabled vaapi && require vaapi va/va.h vaInitialize -lva
  2972. check_mathfunc cbrtf
  2973. check_mathfunc exp2
  2974. check_mathfunc exp2f
  2975. check_mathfunc isinf
  2976. check_mathfunc isnan
  2977. check_mathfunc llrint
  2978. check_mathfunc llrintf
  2979. check_mathfunc log2
  2980. check_mathfunc log2f
  2981. check_mathfunc lrint
  2982. check_mathfunc lrintf
  2983. check_mathfunc rint
  2984. check_mathfunc round
  2985. check_mathfunc roundf
  2986. check_mathfunc trunc
  2987. check_mathfunc truncf
  2988. # these are off by default, so fail if requested and not available
  2989. enabled avisynth && require2 vfw32 "windows.h vfw.h" AVIFileInit -lavifil32
  2990. enabled fontconfig && require_pkg_config fontconfig "fontconfig/fontconfig.h" FcInit
  2991. enabled frei0r && { check_header frei0r.h || die "ERROR: frei0r.h header not found"; }
  2992. enabled gnutls && require_pkg_config gnutls gnutls/gnutls.h gnutls_global_init
  2993. enabled libiec61883 && require libiec61883 libiec61883/iec61883.h iec61883_cmp_connect -lraw1394 -lavc1394 -lrom1394 -liec61883
  2994. enabled libaacplus && require "libaacplus >= 2.0.0" aacplus.h aacplusEncOpen -laacplus
  2995. enabled libass && require_pkg_config libass ass/ass.h ass_library_init
  2996. enabled libbluray && require libbluray libbluray/bluray.h bd_open -lbluray
  2997. enabled libcelt && require libcelt celt/celt.h celt_decode -lcelt0 &&
  2998. { check_lib celt/celt.h celt_decoder_create_custom -lcelt0 ||
  2999. die "ERROR: libcelt version must be >= 0.11.0."; }
  3000. enabled libfaac && require2 libfaac "stdint.h faac.h" faacEncGetVersion -lfaac
  3001. enabled libfreetype && require_pkg_config freetype2 "ft2build.h freetype/freetype.h" FT_Init_FreeType
  3002. enabled libgsm && require libgsm gsm/gsm.h gsm_create -lgsm
  3003. enabled libilbc && require libilbc ilbc.h WebRtcIlbcfix_InitDecode -lilbc
  3004. enabled libmodplug && require libmodplug libmodplug/modplug.h ModPlug_Load -lmodplug
  3005. enabled libmp3lame && require "libmp3lame >= 3.98.3" lame/lame.h lame_set_VBR_quality -lmp3lame
  3006. enabled libnut && require libnut libnut.h nut_demuxer_init -lnut
  3007. enabled libopencore_amrnb && require libopencore_amrnb opencore-amrnb/interf_dec.h Decoder_Interface_init -lopencore-amrnb
  3008. enabled libopencore_amrwb && require libopencore_amrwb opencore-amrwb/dec_if.h D_IF_init -lopencore-amrwb
  3009. enabled libopencv && require_pkg_config opencv opencv/cxcore.h cvCreateImageHeader
  3010. enabled libopenjpeg && require libopenjpeg openjpeg.h opj_version -lopenjpeg
  3011. enabled libpulse && require_pkg_config libpulse-simple pulse/simple.h pa_simple_new
  3012. enabled librtmp && require_pkg_config librtmp librtmp/rtmp.h RTMP_Socket
  3013. enabled libschroedinger && require_pkg_config schroedinger-1.0 schroedinger/schro.h schro_init
  3014. enabled libspeex && require libspeex speex/speex.h speex_decoder_init -lspeex
  3015. enabled libstagefright_h264 && require_cpp libstagefright_h264 "binder/ProcessState.h media/stagefright/MetaData.h
  3016. media/stagefright/MediaBufferGroup.h media/stagefright/MediaDebug.h media/stagefright/MediaDefs.h
  3017. media/stagefright/OMXClient.h media/stagefright/OMXCodec.h" android::OMXClient -lstagefright -lmedia -lutils -lbinder -lgnustl_static
  3018. enabled libtheora && require libtheora theora/theoraenc.h th_info_init -ltheoraenc -ltheoradec -logg
  3019. enabled libutvideo && require_cpp utvideo "stdint.h stdlib.h utvideo/utvideo.h utvideo/Codec.h" 'CCodec*' -lutvideo -lstdc++
  3020. enabled libv4l2 && require_pkg_config libv4l2 libv4l2.h v4l2_ioctl
  3021. enabled libvo_aacenc && require libvo_aacenc vo-aacenc/voAAC.h voGetAACEncAPI -lvo-aacenc
  3022. enabled libvo_amrwbenc && require libvo_amrwbenc vo-amrwbenc/enc_if.h E_IF_init -lvo-amrwbenc
  3023. enabled libvorbis && require libvorbis vorbis/vorbisenc.h vorbis_info_init -lvorbisenc -lvorbis -logg
  3024. enabled libvpx && {
  3025. enabled libvpx_decoder && { check_lib2 "vpx/vpx_decoder.h vpx/vp8dx.h" vpx_codec_dec_init_ver -lvpx ||
  3026. die "ERROR: libvpx decoder version must be >=0.9.1"; }
  3027. enabled libvpx_encoder && { check_lib2 "vpx/vpx_encoder.h vpx/vp8cx.h" "vpx_codec_enc_init_ver VP8E_SET_MAX_INTRA_BITRATE_PCT" -lvpx ||
  3028. die "ERROR: libvpx encoder version must be >=0.9.7"; } }
  3029. enabled libx264 && require libx264 x264.h x264_encoder_encode -lx264 &&
  3030. { check_cpp_condition x264.h "X264_BUILD >= 118" ||
  3031. die "ERROR: libx264 version must be >= 0.118."; }
  3032. enabled libxavs && require libxavs xavs.h xavs_encoder_encode -lxavs
  3033. enabled libxvid && require libxvid xvid.h xvid_global -lxvidcore
  3034. enabled openal && { { for al_libs in "${OPENAL_LIBS}" "-lopenal" "-lOpenAL32"; do
  3035. check_lib 'AL/al.h' alGetError "${al_libs}" && break; done } ||
  3036. die "ERROR: openal not found"; } &&
  3037. { check_cpp_condition "AL/al.h" "defined(AL_VERSION_1_1)" ||
  3038. die "ERROR: openal version must be 1.1 or compatible"; }
  3039. enabled openssl && { check_lib openssl/ssl.h SSL_library_init -lssl -lcrypto ||
  3040. check_lib openssl/ssl.h SSL_library_init -lssl32 -leay32 ||
  3041. check_lib openssl/ssl.h SSL_library_init -lssl -lcrypto -lws2_32 -lgdi32 ||
  3042. die "ERROR: openssl not found"; }
  3043. # libdc1394 check
  3044. if enabled libdc1394; then
  3045. { check_lib dc1394/dc1394.h dc1394_new -ldc1394 -lraw1394 &&
  3046. enable libdc1394_2; } ||
  3047. { check_lib libdc1394/dc1394_control.h dc1394_create_handle -ldc1394_control -lraw1394 &&
  3048. enable libdc1394_1; } ||
  3049. die "ERROR: No version of libdc1394 found "
  3050. fi
  3051. SDL_CONFIG="${cross_prefix}sdl-config"
  3052. if check_pkg_config sdl SDL_events.h SDL_PollEvent; then
  3053. check_cpp_condition SDL.h "(SDL_MAJOR_VERSION<<16 | SDL_MINOR_VERSION<<8 | SDL_PATCHLEVEL) >= 0x010201" $sdl_cflags &&
  3054. enable sdl &&
  3055. check_struct SDL.h SDL_VideoInfo current_w $sdl_cflags && enable sdl_video_size
  3056. else
  3057. if "${SDL_CONFIG}" --version > /dev/null 2>&1; then
  3058. sdl_cflags=$("${SDL_CONFIG}" --cflags)
  3059. sdl_libs=$("${SDL_CONFIG}" --libs)
  3060. check_func_headers SDL_version.h SDL_Linked_Version $sdl_cflags $sdl_libs &&
  3061. check_cpp_condition SDL.h "(SDL_MAJOR_VERSION<<16 | SDL_MINOR_VERSION<<8 | SDL_PATCHLEVEL) >= 0x010201" $sdl_cflags &&
  3062. enable sdl &&
  3063. check_struct SDL.h SDL_VideoInfo current_w $sdl_cflags && enable sdl_video_size
  3064. fi
  3065. fi
  3066. enabled sdl && add_cflags $sdl_cflags && add_extralibs $sdl_libs
  3067. texi2html -version > /dev/null 2>&1 && enable texi2html || disable texi2html
  3068. makeinfo --version > /dev/null 2>&1 && enable makeinfo || disable makeinfo
  3069. check_header linux/fb.h
  3070. check_header linux/videodev.h
  3071. check_header linux/videodev2.h
  3072. check_struct linux/videodev2.h "struct v4l2_frmivalenum" discrete
  3073. check_header sys/videoio.h
  3074. check_func_headers "windows.h vfw.h" capCreateCaptureWindow "$vfwcap_indev_extralibs"
  3075. # check that WM_CAP_DRIVER_CONNECT is defined to the proper value
  3076. # w32api 3.12 had it defined wrong
  3077. check_cpp_condition vfw.h "WM_CAP_DRIVER_CONNECT > WM_USER" && enable vfwcap_defines
  3078. check_type "dshow.h" IBaseFilter
  3079. # check for ioctl_meteor.h, ioctl_bt848.h and alternatives
  3080. { check_header dev/bktr/ioctl_meteor.h &&
  3081. check_header dev/bktr/ioctl_bt848.h; } ||
  3082. { check_header machine/ioctl_meteor.h &&
  3083. check_header machine/ioctl_bt848.h; } ||
  3084. { check_header dev/video/meteor/ioctl_meteor.h &&
  3085. check_header dev/video/bktr/ioctl_bt848.h; } ||
  3086. check_header dev/ic/bt8xx.h
  3087. check_header sndio.h
  3088. if check_struct sys/soundcard.h audio_buf_info bytes; then
  3089. enable_safe sys/soundcard.h
  3090. else
  3091. check_cc -D__BSD_VISIBLE -D__XSI_VISIBLE <<EOF && add_cppflags -D__BSD_VISIBLE -D__XSI_VISIBLE && enable_safe sys/soundcard.h
  3092. #include <sys/soundcard.h>
  3093. audio_buf_info abc;
  3094. EOF
  3095. fi
  3096. check_header soundcard.h
  3097. enabled_any alsa_indev alsa_outdev && check_lib2 alsa/asoundlib.h snd_pcm_htimestamp -lasound
  3098. enabled jack_indev && check_lib2 jack/jack.h jack_client_open -ljack && check_func sem_timedwait &&
  3099. check_func jack_port_get_latency_range -ljack
  3100. enabled_any sndio_indev sndio_outdev && check_lib2 sndio.h sio_open -lsndio
  3101. enabled libcdio &&
  3102. check_lib2 "cdio/cdda.h cdio/paranoia.h" cdio_cddap_open "-lcdio_paranoia -lcdio_cdda -lcdio"
  3103. enabled x11grab &&
  3104. require X11 X11/Xlib.h XOpenDisplay -lX11 &&
  3105. require Xext X11/extensions/XShm.h XShmCreateImage -lXext &&
  3106. require Xfixes X11/extensions/Xfixes.h XFixesGetCursorImage -lXfixes
  3107. if ! disabled vaapi; then
  3108. check_lib va/va.h vaInitialize -lva && {
  3109. check_cpp_condition va/va_version.h "VA_CHECK_VERSION(0,32,0)" ||
  3110. warn "Please upgrade to VA-API >= 0.32 if you would like full VA-API support.";
  3111. } || disable vaapi
  3112. fi
  3113. if ! disabled vdpau && enabled vdpau_vdpau_h; then
  3114. check_cpp_condition \
  3115. vdpau/vdpau.h "defined VDP_DECODER_PROFILE_MPEG4_PART2_ASP" ||
  3116. { echolog "Please upgrade to libvdpau >= 0.2 if you would like vdpau support." &&
  3117. disable vdpau; }
  3118. fi
  3119. enabled debug && add_cflags -g"$debuglevel" && add_asflags -g"$debuglevel"
  3120. enabled coverage && add_cflags "-fprofile-arcs -ftest-coverage" && add_ldflags "-fprofile-arcs -ftest-coverage"
  3121. 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"
  3122. # add some useful compiler flags if supported
  3123. check_cflags -Wdeclaration-after-statement
  3124. check_cflags -Wall
  3125. check_cflags -Wno-parentheses
  3126. check_cflags -Wno-switch
  3127. check_cflags -Wno-format-zero-length
  3128. check_cflags -Wdisabled-optimization
  3129. check_cflags -Wpointer-arith
  3130. check_cflags -Wredundant-decls
  3131. check_cflags -Wno-pointer-sign
  3132. check_cflags -Wwrite-strings
  3133. check_cflags -Wtype-limits
  3134. check_cflags -Wundef
  3135. check_cflags -Wmissing-prototypes
  3136. check_cflags -Wno-pointer-to-int-cast
  3137. check_cflags -Wstrict-prototypes
  3138. enabled extra_warnings && check_cflags -Winline
  3139. # add some linker flags
  3140. check_ldflags -Wl,--warn-common
  3141. check_ldflags -Wl,-rpath-link=libpostproc:libswresample:libswscale:libavfilter:libavdevice:libavformat:libavcodec:libavutil:libavresample
  3142. test_ldflags -Wl,-Bsymbolic && append SHFLAGS -Wl,-Bsymbolic
  3143. enabled xmm_clobber_test && \
  3144. check_ldflags -Wl,--wrap,avcodec_open2 \
  3145. -Wl,--wrap,avcodec_decode_audio4 \
  3146. -Wl,--wrap,avcodec_decode_video2 \
  3147. -Wl,--wrap,avcodec_decode_subtitle2 \
  3148. -Wl,--wrap,avcodec_encode_audio2 \
  3149. -Wl,--wrap,avcodec_encode_video \
  3150. -Wl,--wrap,avcodec_encode_subtitle \
  3151. -Wl,--wrap,sws_scale || \
  3152. disable xmm_clobber_test
  3153. echo "X{};" > $TMPV
  3154. if test_ldflags -Wl,--version-script,$TMPV; then
  3155. append SHFLAGS '-Wl,--version-script,\$(SUBDIR)lib\$(NAME).ver'
  3156. check_cc <<EOF && enable symver_asm_label
  3157. void ff_foo(void) __asm__ ("av_foo@VERSION");
  3158. void ff_foo(void) { ${inline_asm+__asm__($quotes);} }
  3159. EOF
  3160. check_cc <<EOF && enable symver_gnu_asm
  3161. __asm__(".symver ff_foo,av_foo@VERSION");
  3162. void ff_foo(void) {}
  3163. EOF
  3164. fi
  3165. if [ -n "$optflags" ]; then
  3166. add_cflags $optflags
  3167. elif enabled small; then
  3168. add_cflags $size_cflags
  3169. elif enabled optimizations; then
  3170. add_cflags $speed_cflags
  3171. else
  3172. add_cflags $noopt_cflags
  3173. fi
  3174. check_cflags -fno-math-errno
  3175. check_cflags -fno-signed-zeros
  3176. check_cc -mno-red-zone <<EOF && noredzone_flags="-mno-red-zone"
  3177. int x;
  3178. EOF
  3179. if enabled icc; then
  3180. # Just warnings, no remarks
  3181. check_cflags -w1
  3182. # -wd: Disable following warnings
  3183. # 144, 167, 556: -Wno-pointer-sign
  3184. # 1292: attribute "foo" ignored
  3185. # 1419: external declaration in primary source file
  3186. # 10006: ignoring unknown option -fno-signed-zeros
  3187. # 10148: ignoring unknown option -Wno-parentheses
  3188. # 10156: ignoring option '-W'; no argument required
  3189. check_cflags -wd144,167,556,1292,1419,10006,10148,10156
  3190. # 11030: Warning unknown option --as-needed
  3191. # 10156: ignoring option '-export'; no argument required
  3192. check_ldflags -wd10156,11030
  3193. # Allow to compile with optimizations
  3194. check_ldflags -march=$cpu
  3195. # icc 11.0 and 11.1 work with ebp_available, but don't pass the test
  3196. enable ebp_available
  3197. if enabled x86_32; then
  3198. test ${icc_version%%.*} -ge 11 && \
  3199. check_cflags -falign-stack=maintain-16-byte || \
  3200. disable aligned_stack
  3201. fi
  3202. elif enabled ccc; then
  3203. # disable some annoying warnings
  3204. add_cflags -msg_disable cvtu32to64
  3205. add_cflags -msg_disable embedcomment
  3206. add_cflags -msg_disable needconstext
  3207. add_cflags -msg_disable nomainieee
  3208. add_cflags -msg_disable ptrmismatch1
  3209. add_cflags -msg_disable unreachcode
  3210. elif enabled gcc; then
  3211. check_cflags -fno-tree-vectorize
  3212. check_cflags -Werror=implicit-function-declaration
  3213. check_cflags -Werror=missing-prototypes
  3214. elif enabled llvm_gcc; then
  3215. check_cflags -mllvm -stack-alignment=16
  3216. elif enabled clang; then
  3217. check_cflags -mllvm -stack-alignment=16
  3218. check_cflags -Qunused-arguments
  3219. elif enabled armcc; then
  3220. # 2523: use of inline assembler is deprecated
  3221. add_cflags -W${armcc_opt},--diag_suppress=2523
  3222. add_cflags -W${armcc_opt},--diag_suppress=1207
  3223. add_cflags -W${armcc_opt},--diag_suppress=1293 # assignment in condition
  3224. add_cflags -W${armcc_opt},--diag_suppress=3343 # hardfp compat
  3225. add_cflags -W${armcc_opt},--diag_suppress=167 # pointer sign
  3226. add_cflags -W${armcc_opt},--diag_suppress=513 # pointer sign
  3227. elif enabled tms470; then
  3228. add_cflags -pds=824 -pds=837
  3229. elif enabled pathscale; then
  3230. add_cflags -fstrict-overflow -OPT:wrap_around_unsafe_opt=OFF
  3231. fi
  3232. enabled_any $THREADS_LIST && enable threads
  3233. check_deps $CONFIG_LIST \
  3234. $CONFIG_EXTRA \
  3235. $HAVE_LIST \
  3236. $ALL_COMPONENTS \
  3237. $ALL_TESTS \
  3238. enabled asm || { arch=c; disable $ARCH_LIST $ARCH_EXT_LIST; }
  3239. if test $target_os = "haiku"; then
  3240. disable memalign
  3241. disable posix_memalign
  3242. fi
  3243. ! enabled_any memalign posix_memalign aligned_malloc &&
  3244. enabled_any $need_memalign && enable memalign_hack
  3245. # add_dep lib dep
  3246. # -> enable ${lib}_deps_${dep}
  3247. # -> add $dep to ${lib}_deps only once
  3248. add_dep() {
  3249. lib=$1
  3250. dep=$2
  3251. enabled "${lib}_deps_${dep}" && return 0
  3252. enable "${lib}_deps_${dep}"
  3253. prepend "${lib}_deps" $dep
  3254. }
  3255. # merge deps lib components
  3256. # merge all ${component}_deps into ${lib}_deps and ${lib}_deps_*
  3257. merge_deps() {
  3258. lib=$1
  3259. shift
  3260. for comp in $*; do
  3261. enabled $comp || continue
  3262. eval "dep=\"\$${comp}_deps\""
  3263. for d in $dep; do
  3264. add_dep $lib $d
  3265. done
  3266. done
  3267. }
  3268. merge_deps libavfilter $FILTER_LIST
  3269. echo "install prefix $prefix"
  3270. echo "source path $source_path"
  3271. echo "C compiler $cc"
  3272. echo "ARCH $arch ($cpu)"
  3273. if test "$build_suffix" != ""; then
  3274. echo "build suffix $build_suffix"
  3275. fi
  3276. if test "$progs_suffix" != ""; then
  3277. echo "progs suffix $progs_suffix"
  3278. fi
  3279. if test "$extra_version" != ""; then
  3280. echo "version string suffix $extra_version"
  3281. fi
  3282. echo "big-endian ${bigendian-no}"
  3283. echo "runtime cpu detection ${runtime_cpudetect-no}"
  3284. if enabled x86; then
  3285. echo "${yasmexe} ${yasm-no}"
  3286. echo "MMX enabled ${mmx-no}"
  3287. echo "MMX2 enabled ${mmx2-no}"
  3288. echo "3DNow! enabled ${amd3dnow-no}"
  3289. echo "3DNow! extended enabled ${amd3dnowext-no}"
  3290. echo "SSE enabled ${sse-no}"
  3291. echo "SSSE3 enabled ${ssse3-no}"
  3292. echo "AVX enabled ${avx-no}"
  3293. echo "CMOV enabled ${cmov-no}"
  3294. echo "CMOV is fast ${fast_cmov-no}"
  3295. echo "EBX available ${ebx_available-no}"
  3296. echo "EBP available ${ebp_available-no}"
  3297. fi
  3298. if enabled arm; then
  3299. echo "ARMv5TE enabled ${armv5te-no}"
  3300. echo "ARMv6 enabled ${armv6-no}"
  3301. echo "ARMv6T2 enabled ${armv6t2-no}"
  3302. echo "ARM VFP enabled ${armvfp-no}"
  3303. echo "NEON enabled ${neon-no}"
  3304. fi
  3305. if enabled mips; then
  3306. echo "MMI enabled ${mmi-no}"
  3307. echo "MIPS FPU enabled ${mipsfpu-no}"
  3308. echo "MIPS32R2 enabled ${mips32r2-no}"
  3309. echo "MIPS DSP R1 enabled ${mipsdspr1-no}"
  3310. echo "MIPS DSP R2 enabled ${mipsdspr2-no}"
  3311. fi
  3312. if enabled ppc; then
  3313. echo "AltiVec enabled ${altivec-no}"
  3314. echo "PPC 4xx optimizations ${ppc4xx-no}"
  3315. echo "dcbzl available ${dcbzl-no}"
  3316. fi
  3317. if enabled sparc; then
  3318. echo "VIS enabled ${vis-no}"
  3319. fi
  3320. echo "debug symbols ${debug-no}"
  3321. echo "strip symbols ${stripping-no}"
  3322. echo "optimize for size ${small-no}"
  3323. echo "optimizations ${optimizations-no}"
  3324. echo "static ${static-no}"
  3325. echo "shared ${shared-no}"
  3326. echo "postprocessing support ${postproc-no}"
  3327. echo "new filter support ${avfilter-no}"
  3328. echo "network support ${network-no}"
  3329. echo "threading support ${thread_type-no}"
  3330. echo "safe bitstream reader ${safe_bitstream_reader-no}"
  3331. echo "SDL support ${sdl-no}"
  3332. echo "libdxva2 enabled ${dxva2-no}"
  3333. echo "libva enabled ${vaapi-no}"
  3334. echo "libvdpau enabled ${vdpau-no}"
  3335. echo "AVISynth enabled ${avisynth-no}"
  3336. echo "frei0r enabled ${frei0r-no}"
  3337. echo "gnutls enabled ${gnutls-no}"
  3338. echo "libaacplus enabled ${libaacplus-no}"
  3339. echo "libass enabled ${libass-no}"
  3340. echo "libcdio support ${libcdio-no}"
  3341. echo "libcelt enabled ${libcelt-no}"
  3342. echo "libdc1394 support ${libdc1394-no}"
  3343. echo "libfaac enabled ${libfaac-no}"
  3344. echo "libgsm enabled ${libgsm-no}"
  3345. echo "libiec61883 support ${libiec61883-no}"
  3346. echo "libilbc enabled ${libilbc-no}"
  3347. echo "libmodplug enabled ${libmodplug-no}"
  3348. echo "libmp3lame enabled ${libmp3lame-no}"
  3349. echo "libnut enabled ${libnut-no}"
  3350. echo "libopencore-amrnb support ${libopencore_amrnb-no}"
  3351. echo "libopencore-amrwb support ${libopencore_amrwb-no}"
  3352. echo "libopencv support ${libopencv-no}"
  3353. echo "libopenjpeg enabled ${libopenjpeg-no}"
  3354. echo "libpulse enabled ${libpulse-no}"
  3355. echo "librtmp enabled ${librtmp-no}"
  3356. echo "libschroedinger enabled ${libschroedinger-no}"
  3357. echo "libspeex enabled ${libspeex-no}"
  3358. echo "libstagefright-h264 enabled ${libstagefright_h264-no}"
  3359. echo "libtheora enabled ${libtheora-no}"
  3360. echo "libutvideo enabled ${libutvideo-no}"
  3361. echo "libv4l2 enabled ${libv4l2-no}"
  3362. echo "libvo-aacenc support ${libvo_aacenc-no}"
  3363. echo "libvo-amrwbenc support ${libvo_amrwbenc-no}"
  3364. echo "libvorbis enabled ${libvorbis-no}"
  3365. echo "libvpx enabled ${libvpx-no}"
  3366. echo "libx264 enabled ${libx264-no}"
  3367. echo "libxavs enabled ${libxavs-no}"
  3368. echo "libxvid enabled ${libxvid-no}"
  3369. echo "openal enabled ${openal-no}"
  3370. echo "openssl enabled ${openssl-no}"
  3371. echo "zlib enabled ${zlib-no}"
  3372. echo "bzlib enabled ${bzlib-no}"
  3373. test -n "$random_seed" &&
  3374. echo "random seed ${random_seed}"
  3375. echo
  3376. for type in decoder encoder hwaccel parser demuxer muxer protocol filter bsf indev outdev; do
  3377. echo "Enabled ${type}s:"
  3378. eval list=\$$(toupper $type)_LIST
  3379. print_enabled '_*' $list | sort | pr -r -3 -t
  3380. echo
  3381. done
  3382. license="LGPL version 2.1 or later"
  3383. if enabled nonfree; then
  3384. license="nonfree and unredistributable"
  3385. elif enabled gplv3; then
  3386. license="GPL version 3 or later"
  3387. elif enabled lgplv3; then
  3388. license="LGPL version 3 or later"
  3389. elif enabled gpl; then
  3390. license="GPL version 2 or later"
  3391. fi
  3392. echo "License: $license"
  3393. echo "Creating config.mak and config.h..."
  3394. test -e Makefile || $ln_s "$source_path/Makefile" .
  3395. enabled stripping || strip="echo skipping strip"
  3396. config_files="$TMPH config.mak"
  3397. cat > config.mak <<EOF
  3398. # Automatically generated by configure - do not modify!
  3399. ifndef FFMPEG_CONFIG_MAK
  3400. FFMPEG_CONFIG_MAK=1
  3401. FFMPEG_CONFIGURATION=$FFMPEG_CONFIGURATION
  3402. prefix=$prefix
  3403. LIBDIR=\$(DESTDIR)$libdir
  3404. SHLIBDIR=\$(DESTDIR)$shlibdir
  3405. INCDIR=\$(DESTDIR)$incdir
  3406. BINDIR=\$(DESTDIR)$bindir
  3407. DATADIR=\$(DESTDIR)$datadir
  3408. MANDIR=\$(DESTDIR)$mandir
  3409. SRC_PATH=$source_path
  3410. ifndef MAIN_MAKEFILE
  3411. SRC_PATH:=\$(SRC_PATH:.%=..%)
  3412. endif
  3413. CC_IDENT=$cc_ident
  3414. ARCH=$arch
  3415. CC=$cc
  3416. CXX=$cxx
  3417. AS=$as
  3418. LD=$ld
  3419. DEPCC=$dep_cc
  3420. YASM=$yasmexe
  3421. YASMDEP=$yasmexe
  3422. AR=$ar
  3423. RANLIB=$ranlib
  3424. CP=cp -p
  3425. LN_S=$ln_s
  3426. STRIP=$strip
  3427. CPPFLAGS=$CPPFLAGS
  3428. CFLAGS=$CFLAGS
  3429. CXXFLAGS=$CXXFLAGS
  3430. ASFLAGS=$ASFLAGS
  3431. AS_O=$CC_O
  3432. CC_O=$CC_O
  3433. CXX_O=$CXX_O
  3434. LDFLAGS=$LDFLAGS
  3435. FFSERVERLDFLAGS=$FFSERVERLDFLAGS
  3436. SHFLAGS=$SHFLAGS
  3437. YASMFLAGS=$YASMFLAGS
  3438. BUILDSUF=$build_suffix
  3439. PROGSSUF=$progs_suffix
  3440. FULLNAME=$FULLNAME
  3441. LIBPREF=$LIBPREF
  3442. LIBSUF=$LIBSUF
  3443. LIBNAME=$LIBNAME
  3444. SLIBPREF=$SLIBPREF
  3445. SLIBSUF=$SLIBSUF
  3446. EXESUF=$EXESUF
  3447. EXTRA_VERSION=$extra_version
  3448. DEPFLAGS=$DEPFLAGS
  3449. CCDEP=$CCDEP
  3450. CXXDEP=$CXXDEP
  3451. ASDEP=$ASDEP
  3452. CC_DEPFLAGS=$CC_DEPFLAGS
  3453. AS_DEPFLAGS=$AS_DEPFLAGS
  3454. HOSTCC=$host_cc
  3455. HOSTCFLAGS=$host_cflags
  3456. HOSTEXESUF=$HOSTEXESUF
  3457. HOSTLDFLAGS=$host_ldflags
  3458. HOSTLIBS=$host_libs
  3459. TARGET_EXEC=$target_exec
  3460. TARGET_PATH=$target_path
  3461. SDL_LIBS=$sdl_libs
  3462. SDL_CFLAGS=$sdl_cflags
  3463. LIB_INSTALL_EXTRA_CMD=$LIB_INSTALL_EXTRA_CMD
  3464. EXTRALIBS=$extralibs
  3465. INSTALL=$install
  3466. LIBTARGET=${LIBTARGET}
  3467. SLIBNAME=${SLIBNAME}
  3468. SLIBNAME_WITH_VERSION=${SLIBNAME_WITH_VERSION}
  3469. SLIBNAME_WITH_MAJOR=${SLIBNAME_WITH_MAJOR}
  3470. SLIB_CREATE_DEF_CMD=${SLIB_CREATE_DEF_CMD}
  3471. SLIB_EXTRA_CMD=${SLIB_EXTRA_CMD}
  3472. SLIB_INSTALL_NAME=${SLIB_INSTALL_NAME}
  3473. SLIB_INSTALL_LINKS=${SLIB_INSTALL_LINKS}
  3474. SLIB_INSTALL_EXTRA_LIB=${SLIB_INSTALL_EXTRA_LIB}
  3475. SLIB_INSTALL_EXTRA_SHLIB=${SLIB_INSTALL_EXTRA_SHLIB}
  3476. SAMPLES:=${samples:-\$(FATE_SAMPLES)}
  3477. NOREDZONE_FLAGS=$noredzone_flags
  3478. EOF
  3479. get_version(){
  3480. lcname=$1
  3481. name=$(toupper $lcname)
  3482. file=$source_path/$lcname/version.h
  3483. eval $(grep "#define ${name}_VERSION_M" "$file" | awk '{ print $2"="$3 }')
  3484. eval ${name}_VERSION=\$${name}_VERSION_MAJOR.\$${name}_VERSION_MINOR.\$${name}_VERSION_MICRO
  3485. eval echo "${lcname}_VERSION=\$${name}_VERSION" >> config.mak
  3486. eval echo "${lcname}_VERSION_MAJOR=\$${name}_VERSION_MAJOR" >> config.mak
  3487. }
  3488. get_version_old(){
  3489. name=$1
  3490. file=$source_path/$2
  3491. # This condition will be removed when we stop supporting old libpostproc versions
  3492. if ! test "$name" = LIBPOSTPROC || test "$postproc_version" = current; then
  3493. eval $(grep "#define ${name}_VERSION_M" "$file" | awk '{ print $2"="$3 }')
  3494. eval ${name}_VERSION=\$${name}_VERSION_MAJOR.\$${name}_VERSION_MINOR.\$${name}_VERSION_MICRO
  3495. fi
  3496. lcname=$(tolower $name)
  3497. eval echo "${lcname}_VERSION=\$${name}_VERSION" >> config.mak
  3498. eval echo "${lcname}_VERSION_MAJOR=\$${name}_VERSION_MAJOR" >> config.mak
  3499. }
  3500. get_version_old LIBPOSTPROC libpostproc/postprocess.h
  3501. get_version_old LIBSWRESAMPLE libswresample/swresample.h
  3502. get_version libavcodec
  3503. get_version libavdevice
  3504. get_version libavfilter
  3505. get_version libavformat
  3506. get_version libavresample
  3507. get_version libavutil
  3508. get_version libswscale
  3509. cat > $TMPH <<EOF
  3510. /* Automatically generated by configure - do not modify! */
  3511. #ifndef FFMPEG_CONFIG_H
  3512. #define FFMPEG_CONFIG_H
  3513. #define FFMPEG_CONFIGURATION "$(c_escape $FFMPEG_CONFIGURATION)"
  3514. #define FFMPEG_LICENSE "$(c_escape $license)"
  3515. #define FFMPEG_DATADIR "$(eval c_escape $datadir)"
  3516. #define AVCONV_DATADIR "$(eval c_escape $datadir)"
  3517. #define CC_TYPE "$cc_type"
  3518. #define CC_VERSION $cc_version
  3519. #define av_restrict $_restrict
  3520. #define EXTERN_PREFIX "${extern_prefix}"
  3521. #define EXTERN_ASM ${extern_prefix}
  3522. #define SLIBSUF "$SLIBSUF"
  3523. EOF
  3524. test -n "$assert_level" &&
  3525. echo "#define ASSERT_LEVEL $assert_level" >>$TMPH
  3526. test -n "$malloc_prefix" &&
  3527. echo "#define MALLOC_PREFIX $malloc_prefix" >>$TMPH
  3528. if enabled yasm; then
  3529. append config_files $TMPASM
  3530. printf '' >$TMPASM
  3531. fi
  3532. print_config ARCH_ "$config_files" $ARCH_LIST
  3533. print_config HAVE_ "$config_files" $HAVE_LIST
  3534. print_config CONFIG_ "$config_files" $CONFIG_LIST \
  3535. $CONFIG_EXTRA \
  3536. $ALL_COMPONENTS \
  3537. cat >>config.mak <<EOF
  3538. LAVF_FATE_TESTS=$(print_enabled -n _test $LAVF_FATE_TESTS)
  3539. LAVF_TESTS=$(print_enabled -n _test $LAVF_TESTS)
  3540. LAVFI_TESTS=$(print_enabled -n _test $LAVFI_TESTS)
  3541. SEEK_TESTS=$(print_enabled -n _test $SEEK_TESTS)
  3542. EOF
  3543. echo "#endif /* FFMPEG_CONFIG_H */" >> $TMPH
  3544. echo "endif # FFMPEG_CONFIG_MAK" >> config.mak
  3545. # Do not overwrite an unchanged config.h to avoid superfluous rebuilds.
  3546. cp_if_changed $TMPH config.h
  3547. touch .config
  3548. enabled yasm && cp_if_changed $TMPASM config.asm
  3549. cat > $TMPH <<EOF
  3550. /* Generated by ffconf */
  3551. #ifndef AVUTIL_AVCONFIG_H
  3552. #define AVUTIL_AVCONFIG_H
  3553. EOF
  3554. test "$postproc_version" != current && cat >> $TMPH <<EOF
  3555. #define LIBPOSTPROC_VERSION_MAJOR $LIBPOSTPROC_VERSION_MAJOR
  3556. #define LIBPOSTPROC_VERSION_MINOR $LIBPOSTPROC_VERSION_MINOR
  3557. #define LIBPOSTPROC_VERSION_MICRO $LIBPOSTPROC_VERSION_MICRO
  3558. EOF
  3559. print_config AV_HAVE_ $TMPH $HAVE_LIST_PUB
  3560. echo "#endif /* AVUTIL_AVCONFIG_H */" >> $TMPH
  3561. cp_if_changed $TMPH libavutil/avconfig.h
  3562. test -n "$WARNINGS" && printf "\n$WARNINGS"
  3563. # build pkg-config files
  3564. pkgconfig_generate(){
  3565. name=$1
  3566. shortname=${name#lib}${build_suffix}
  3567. comment=$2
  3568. version=$3
  3569. libs=$4
  3570. requires=$5
  3571. enabled ${name#lib} || return 0
  3572. mkdir -p $name
  3573. cat <<EOF > $name/$name.pc
  3574. prefix=$prefix
  3575. exec_prefix=\${prefix}
  3576. libdir=$libdir
  3577. includedir=$incdir
  3578. Name: $name
  3579. Description: $comment
  3580. Version: $version
  3581. Requires: $(enabled shared || echo $requires)
  3582. Requires.private: $(enabled shared && echo $requires)
  3583. Conflicts:
  3584. Libs: -L\${libdir} -l${shortname} $(enabled shared || echo $libs)
  3585. Libs.private: $(enabled shared && echo $libs)
  3586. Cflags: -I\${includedir}
  3587. EOF
  3588. cat <<EOF > $name/$name-uninstalled.pc
  3589. prefix=
  3590. exec_prefix=
  3591. libdir=\${pcfiledir}
  3592. includedir=${source_path}
  3593. Name: $name
  3594. Description: $comment
  3595. Version: $version
  3596. Requires: $requires
  3597. Conflicts:
  3598. Libs: \${libdir}/${LIBPREF}${shortname}${LIBSUF} $libs
  3599. Cflags: -I\${includedir}
  3600. EOF
  3601. }
  3602. libavfilter_pc_deps=""
  3603. enabled libavfilter_deps_avcodec && prepend libavfilter_pc_deps "libavcodec = $LIBAVCODEC_VERSION,"
  3604. enabled libavfilter_deps_avformat && prepend libavfilter_pc_deps "libavformat = $LIBAVFORMAT_VERSION,"
  3605. enabled libavfilter_deps_swscale && prepend libavfilter_pc_deps "libswscale = $LIBSWSCALE_VERSION,"
  3606. enabled libavfilter_deps_swresample && prepend libavfilter_pc_deps "libswresample = $LIBSWRESAMPLE_VERSION,"
  3607. enabled libavfilter_deps_postproc && prepend libavfilter_pc_deps "libpostproc = $LIBPOSTPROC_VERSION,"
  3608. libavfilter_pc_deps=${libavfilter_pc_deps%, }
  3609. libavdevice_pc_deps="libavformat = $LIBAVFORMAT_VERSION"
  3610. enabled lavfi_indev && prepend libavdevice_pc_deps "libavfilter = $LIBAVFILTER_VERSION,"
  3611. pkgconfig_generate libavutil "FFmpeg utility library" "$LIBAVUTIL_VERSION" "$LIBM"
  3612. pkgconfig_generate libavcodec "FFmpeg codec library" "$LIBAVCODEC_VERSION" "$extralibs" "libavutil = $LIBAVUTIL_VERSION"
  3613. pkgconfig_generate libavformat "FFmpeg container format library" "$LIBAVFORMAT_VERSION" "$extralibs" "libavcodec = $LIBAVCODEC_VERSION"
  3614. pkgconfig_generate libavdevice "FFmpeg device handling library" "$LIBAVDEVICE_VERSION" "$extralibs" "$libavdevice_pc_deps"
  3615. pkgconfig_generate libavfilter "FFmpeg video filtering library" "$LIBAVFILTER_VERSION" "$extralibs" "$libavfilter_pc_deps"
  3616. pkgconfig_generate libpostproc "FFmpeg postprocessing library" "$LIBPOSTPROC_VERSION" "" "libavutil = $LIBAVUTIL_VERSION"
  3617. pkgconfig_generate libavresample "Libav audio resampling library" "$LIBAVRESAMPLE_VERSION" "$extralibs"
  3618. pkgconfig_generate libswscale "FFmpeg image rescaling library" "$LIBSWSCALE_VERSION" "$LIBM" "libavutil = $LIBAVUTIL_VERSION"
  3619. pkgconfig_generate libswresample "FFmpeg audio rescaling library" "$LIBSWRESAMPLE_VERSION" "$LIBM" "libavutil = $LIBAVUTIL_VERSION"