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.

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