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.

4023 lines
121KB

  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. cc_version=\"unknown\"
  1715. host_cc_default="gcc"
  1716. install="install"
  1717. ln_s="ln -sf"
  1718. nm_default="nm"
  1719. objformat="elf"
  1720. pkg_config_default=pkg-config
  1721. ranlib="ranlib"
  1722. strip_default="strip"
  1723. yasmexe_default="yasm"
  1724. nm_opts='-g'
  1725. nogas=":"
  1726. # machine
  1727. arch_default=$(uname -m)
  1728. cpu="generic"
  1729. # OS
  1730. target_os_default=$(tolower $(uname -s))
  1731. host_os=$target_os_default
  1732. # alternative libpostproc version
  1733. ALT_PP_VER_MAJOR=51
  1734. ALT_PP_VER_MINOR=2
  1735. ALT_PP_VER_MICRO=101
  1736. ALT_PP_VER=$ALT_PP_VER_MAJOR.$ALT_PP_VER_MINOR.$ALT_PP_VER_MICRO
  1737. # configurable options
  1738. enable $PROGRAM_LIST
  1739. enable avcodec
  1740. enable avdevice
  1741. enable avfilter
  1742. enable avformat
  1743. enable avutil
  1744. enable postproc
  1745. enable stripping
  1746. enable swresample
  1747. enable swscale
  1748. enable asm
  1749. enable debug
  1750. enable doc
  1751. enable fastdiv
  1752. enable network
  1753. enable optimizations
  1754. enable safe_bitstream_reader
  1755. enable static
  1756. enable swscale_alpha
  1757. # build settings
  1758. SHFLAGS='-shared -Wl,-soname,$$(@F)'
  1759. FFSERVERLDFLAGS=-Wl,-E
  1760. LIBPREF="lib"
  1761. LIBSUF=".a"
  1762. FULLNAME='$(NAME)$(BUILDSUF)'
  1763. LIBNAME='$(LIBPREF)$(FULLNAME)$(LIBSUF)'
  1764. SLIBPREF="lib"
  1765. SLIBSUF=".so"
  1766. SLIBNAME='$(SLIBPREF)$(FULLNAME)$(SLIBSUF)'
  1767. SLIBNAME_WITH_VERSION='$(SLIBNAME).$(LIBVERSION)'
  1768. SLIBNAME_WITH_MAJOR='$(SLIBNAME).$(LIBMAJOR)'
  1769. LIB_INSTALL_EXTRA_CMD='$$(RANLIB) "$(LIBDIR)/$(LIBNAME)"'
  1770. SLIB_INSTALL_NAME='$(SLIBNAME_WITH_VERSION)'
  1771. SLIB_INSTALL_LINKS='$(SLIBNAME_WITH_MAJOR) $(SLIBNAME)'
  1772. AS_O='-o $@'
  1773. CC_O='-o $@'
  1774. CXX_O='-o $@'
  1775. host_cflags='-D_ISOC99_SOURCE -D_XOPEN_SOURCE=600 -O3 -g'
  1776. host_libs='-lm'
  1777. target_path='$(CURDIR)'
  1778. # since the object filename is not given with the -MM flag, the compiler
  1779. # is only able to print the basename, and we must add the path ourselves
  1780. DEPEND_CMD='$(DEPCC) $(DEPFLAGS) $< | sed -e "/^\#.*/d" -e "s,^[[:space:]]*$(*F)\\.o,$(@D)/$(*F).o," > $(@:.o=.d)'
  1781. DEPFLAGS='$(CPPFLAGS) $(CFLAGS) -MM'
  1782. # find source path
  1783. if test -f configure; then
  1784. source_path=.
  1785. else
  1786. source_path=$(cd $(dirname "$0"); pwd)
  1787. echo "$source_path" | grep -q '[[:blank:]]' &&
  1788. die "Out of tree builds are impossible with whitespace in source path."
  1789. test -e "$source_path/config.h" &&
  1790. die "Out of tree builds are impossible with config.h in source dir."
  1791. fi
  1792. for v in "$@"; do
  1793. r=${v#*=}
  1794. l=${v%"$r"}
  1795. r=$(sh_quote "$r")
  1796. FFMPEG_CONFIGURATION="${FFMPEG_CONFIGURATION# } ${l}${r}"
  1797. done
  1798. find_things(){
  1799. thing=$1
  1800. pattern=$2
  1801. file=$source_path/$3
  1802. sed -n "s/^[^#]*$pattern.*([^,]*, *\([^,]*\)\(,.*\)*).*/\1_$thing/p" "$file"
  1803. }
  1804. ENCODER_LIST=$(find_things encoder ENC libavcodec/allcodecs.c)
  1805. DECODER_LIST=$(find_things decoder DEC libavcodec/allcodecs.c)
  1806. HWACCEL_LIST=$(find_things hwaccel HWACCEL libavcodec/allcodecs.c)
  1807. PARSER_LIST=$(find_things parser PARSER libavcodec/allcodecs.c)
  1808. BSF_LIST=$(find_things bsf BSF libavcodec/allcodecs.c)
  1809. MUXER_LIST=$(find_things muxer _MUX libavformat/allformats.c)
  1810. DEMUXER_LIST=$(find_things demuxer DEMUX libavformat/allformats.c)
  1811. OUTDEV_LIST=$(find_things outdev OUTDEV libavdevice/alldevices.c)
  1812. INDEV_LIST=$(find_things indev _IN libavdevice/alldevices.c)
  1813. PROTOCOL_LIST=$(find_things protocol PROTOCOL libavformat/allformats.c)
  1814. FILTER_LIST=$(find_things filter FILTER libavfilter/allfilters.c)
  1815. ALL_COMPONENTS="
  1816. $BSF_LIST
  1817. $DECODER_LIST
  1818. $DEMUXER_LIST
  1819. $ENCODER_LIST
  1820. $FILTER_LIST
  1821. $HWACCEL_LIST
  1822. $INDEV_LIST
  1823. $MUXER_LIST
  1824. $OUTDEV_LIST
  1825. $PARSER_LIST
  1826. $PROTOCOL_LIST
  1827. "
  1828. find_tests(){
  1829. map "echo ${2}\${v}_test" $(ls "$source_path"/tests/ref/$1 | grep -v '[^-a-z0-9_]')
  1830. }
  1831. LAVF_FATE_TESTS=$(find_tests lavf-fate)
  1832. LAVF_TESTS=$(find_tests lavf)
  1833. LAVFI_TESTS=$(find_tests lavfi)
  1834. SEEK_TESTS=$(find_tests seek seek_)
  1835. ALL_TESTS="$LAVF_FATE_TESTS $LAVF_TESTS $LAVFI_TESTS $SEEK_TESTS"
  1836. for n in $COMPONENT_LIST; do
  1837. v=$(toupper ${n%s})_LIST
  1838. eval enable \$$v
  1839. eval ${n}_if_any="\$$v"
  1840. done
  1841. enable $ARCH_EXT_LIST $ALL_TESTS
  1842. die_unknown(){
  1843. echo "Unknown option \"$1\"."
  1844. echo "See $0 --help for available options."
  1845. exit 1
  1846. }
  1847. show_list() {
  1848. suffix=_$1
  1849. shift
  1850. echo $* | sed s/$suffix//g | tr ' ' '\n' | sort | pr -3 -t
  1851. exit 0
  1852. }
  1853. rand_list(){
  1854. IFS=', '
  1855. set -- $*
  1856. unset IFS
  1857. for thing; do
  1858. comp=${thing%:*}
  1859. prob=${thing#$comp}
  1860. prob=${prob#:}
  1861. is_in ${comp} $COMPONENT_LIST && eval comp=\$$(toupper ${comp%s})_LIST
  1862. echo "prob ${prob:-0.5}"
  1863. printf '%s\n' $comp
  1864. done
  1865. }
  1866. do_random(){
  1867. action=$1
  1868. shift
  1869. random_seed=$(awk "BEGIN { srand($random_seed); print srand() }")
  1870. $action $(rand_list "$@" | awk "BEGIN { srand($random_seed) } \$1 == \"prob\" { prob = \$2; next } rand() < prob { print }")
  1871. }
  1872. for opt do
  1873. optval="${opt#*=}"
  1874. case "$opt" in
  1875. --extra-ldflags=*) add_ldflags $optval
  1876. ;;
  1877. --extra-libs=*) add_extralibs $optval
  1878. ;;
  1879. --disable-devices) disable $INDEV_LIST $OUTDEV_LIST
  1880. ;;
  1881. --enable-debug=*) debuglevel="$optval"
  1882. ;;
  1883. --disable-everything)
  1884. map 'eval unset \${$(toupper ${v%s})_LIST}' $COMPONENT_LIST
  1885. ;;
  1886. --enable-random|--disable-random)
  1887. action=${opt%%-random}
  1888. do_random ${action#--} $COMPONENT_LIST
  1889. ;;
  1890. --enable-random=*|--disable-random=*)
  1891. action=${opt%%-random=*}
  1892. do_random ${action#--} $optval
  1893. ;;
  1894. --enable-*=*|--disable-*=*)
  1895. eval $(echo "${opt%%=*}" | sed 's/--/action=/;s/-/ thing=/')
  1896. is_in "${thing}s" $COMPONENT_LIST || die_unknown "$opt"
  1897. eval list=\$$(toupper $thing)_LIST
  1898. name=$(echo "${optval}" | sed "s/,/_${thing}|/g")_${thing}
  1899. $action $(filter "$name" $list)
  1900. ;;
  1901. --enable-?*|--disable-?*)
  1902. eval $(echo "$opt" | sed 's/--/action=/;s/-/ option=/;s/-/_/g')
  1903. if is_in $option $COMPONENT_LIST; then
  1904. test $action = disable && action=unset
  1905. eval $action \$$(toupper ${option%s})_LIST
  1906. elif is_in $option $CMDLINE_SELECT; then
  1907. $action $option
  1908. else
  1909. die_unknown $opt
  1910. fi
  1911. ;;
  1912. --list-*)
  1913. NAME="${opt#--list-}"
  1914. is_in $NAME $COMPONENT_LIST || die_unknown $opt
  1915. NAME=${NAME%s}
  1916. eval show_list $NAME \$$(toupper $NAME)_LIST
  1917. ;;
  1918. --help|-h) show_help
  1919. ;;
  1920. *)
  1921. optname="${opt%%=*}"
  1922. optname="${optname#--}"
  1923. optname=$(echo "$optname" | sed 's/-/_/g')
  1924. if is_in $optname $CMDLINE_SET; then
  1925. eval $optname='$optval'
  1926. elif is_in $optname $CMDLINE_APPEND; then
  1927. append $optname "$optval"
  1928. else
  1929. die_unknown $opt
  1930. fi
  1931. ;;
  1932. esac
  1933. done
  1934. disabled logging && logfile=/dev/null
  1935. echo "# $0 $FFMPEG_CONFIGURATION" > $logfile
  1936. set >> $logfile
  1937. test -n "$cross_prefix" && enable cross_compile
  1938. if enabled cross_compile; then
  1939. test -n "$arch" && test -n "$target_os" ||
  1940. die "Must specify target arch and OS when cross-compiling"
  1941. fi
  1942. set_default arch target_os postproc_version
  1943. # Check if we should build alternative libpostproc version instead of current
  1944. if test "$postproc_version" = $ALT_PP_VER; then
  1945. LIBPOSTPROC_VERSION=$ALT_PP_VER
  1946. LIBPOSTPROC_VERSION_MAJOR=$ALT_PP_VER_MAJOR
  1947. LIBPOSTPROC_VERSION_MINOR=$ALT_PP_VER_MINOR
  1948. LIBPOSTPROC_VERSION_MICRO=$ALT_PP_VER_MICRO
  1949. elif test "$postproc_version" != current; then
  1950. die "Invalid argument to --postproc-version. See --help output."
  1951. fi
  1952. ar_default="${cross_prefix}${ar_default}"
  1953. cc_default="${cross_prefix}${cc_default}"
  1954. cxx_default="${cross_prefix}${cxx_default}"
  1955. nm_default="${cross_prefix}${nm_default}"
  1956. pkg_config_default="${cross_prefix}${pkg_config_default}"
  1957. ranlib="${cross_prefix}${ranlib}"
  1958. strip_default="${cross_prefix}${strip_default}"
  1959. sysinclude_default="${sysroot}/usr/include"
  1960. set_default cc cxx nm pkg_config strip sysinclude yasmexe
  1961. enabled cross_compile || host_cc_default=$cc
  1962. set_default host_cc
  1963. if ! $pkg_config --version >/dev/null 2>&1; then
  1964. warn "$pkg_config not found, library detection may fail."
  1965. pkg_config=false
  1966. fi
  1967. exesuf() {
  1968. case $1 in
  1969. mingw32*|cygwin*|*-dos|freedos|opendos|os/2*|symbian) echo .exe ;;
  1970. esac
  1971. }
  1972. EXESUF=$(exesuf $target_os)
  1973. HOSTEXESUF=$(exesuf $host_os)
  1974. # set temporary file name
  1975. : ${TMPDIR:=$TEMPDIR}
  1976. : ${TMPDIR:=$TMP}
  1977. : ${TMPDIR:=/tmp}
  1978. if ! check_cmd mktemp -u XXXXXX; then
  1979. # simple replacement for missing mktemp
  1980. # NOT SAFE FOR GENERAL USE
  1981. mktemp(){
  1982. echo "${2%%XXX*}.${HOSTNAME}.${UID}.$$"
  1983. }
  1984. fi
  1985. tmpfile(){
  1986. tmp=$(mktemp -u "${TMPDIR}/ffconf.XXXXXXXX")$2 &&
  1987. (set -C; exec > $tmp) 2>/dev/null ||
  1988. die "Unable to create temporary file in $TMPDIR."
  1989. append TMPFILES $tmp
  1990. eval $1=$tmp
  1991. }
  1992. trap 'rm -f -- $TMPFILES' EXIT
  1993. tmpfile TMPASM .asm
  1994. tmpfile TMPC .c
  1995. tmpfile TMPCPP .cpp
  1996. tmpfile TMPE $EXESUF
  1997. tmpfile TMPH .h
  1998. tmpfile TMPO .o
  1999. tmpfile TMPS .S
  2000. tmpfile TMPSH .sh
  2001. tmpfile TMPV .ver
  2002. unset -f mktemp
  2003. chmod +x $TMPE
  2004. # make sure we can execute files in $TMPDIR
  2005. cat > $TMPSH 2>> $logfile <<EOF
  2006. #! /bin/sh
  2007. EOF
  2008. chmod +x $TMPSH >> $logfile 2>&1
  2009. if ! $TMPSH >> $logfile 2>&1; then
  2010. cat <<EOF
  2011. Unable to create and execute files in $TMPDIR. Set the TMPDIR environment
  2012. variable to another directory and make sure that it is not mounted noexec.
  2013. EOF
  2014. die "Sanity test failed."
  2015. fi
  2016. filter_asflags=echo
  2017. filter_cflags=echo
  2018. filter_cppflags=echo
  2019. if $cc -v 2>&1 | grep -q '^gcc.*LLVM'; then
  2020. cc_type=llvm_gcc
  2021. cc_version=__VERSION__
  2022. gcc_extra_ver=$(expr "$($cc --version | head -n1)" : '.*\((.*)\)')
  2023. cc_ident="llvm-gcc $($cc -dumpversion) $gcc_extra_ver"
  2024. CC_DEPFLAGS='-MMD -MF $(@:.o=.d) -MT $@'
  2025. AS_DEPFLAGS='-MMD -MF $(@:.o=.d) -MT $@'
  2026. speed_cflags='-O3'
  2027. size_cflags='-Os'
  2028. elif $cc -v 2>&1 | grep -qi ^gcc; then
  2029. cc_type=gcc
  2030. cc_version=__VERSION__
  2031. gcc_version=$($cc --version | head -n1)
  2032. gcc_basever=$($cc -dumpversion)
  2033. gcc_pkg_ver=$(expr "$gcc_version" : '[^ ]* \(([^)]*)\)')
  2034. gcc_ext_ver=$(expr "$gcc_version" : ".*$gcc_pkg_ver $gcc_basever \\(.*\\)")
  2035. cc_ident=$(cleanws "gcc $gcc_basever $gcc_pkg_ver $gcc_ext_ver")
  2036. if ! $cc -dumpversion | grep -q '^2\.'; then
  2037. CC_DEPFLAGS='-MMD -MF $(@:.o=.d) -MT $@'
  2038. AS_DEPFLAGS='-MMD -MF $(@:.o=.d) -MT $@'
  2039. fi
  2040. speed_cflags='-O3'
  2041. size_cflags='-Os'
  2042. elif $cc --version 2>/dev/null | grep -q Intel; then
  2043. cc_type=icc
  2044. cc_version="AV_STRINGIFY(__INTEL_COMPILER)"
  2045. cc_ident=$($cc --version | head -n1)
  2046. icc_version=$($cc -dumpversion)
  2047. CC_DEPFLAGS='-MMD'
  2048. AS_DEPFLAGS='-MMD'
  2049. speed_cflags='-O3'
  2050. size_cflags='-Os'
  2051. noopt_cflags='-O1'
  2052. elif $cc -v 2>&1 | grep -q xlc; then
  2053. cc_type=xlc
  2054. cc_version="AV_STRINGIFY(__IBMC__)"
  2055. cc_ident=$($cc -qversion 2>/dev/null | head -n1)
  2056. speed_cflags='-O5'
  2057. size_cflags='-O5 -qcompact'
  2058. elif $cc -V 2>/dev/null | grep -q Compaq; then
  2059. cc_type=ccc
  2060. cc_version="AV_STRINGIFY(__DECC_VER)"
  2061. cc_ident=$($cc -V | head -n1 | cut -d' ' -f1-3)
  2062. DEPFLAGS='$(CPPFLAGS) $(CFLAGS) -M'
  2063. debuglevel=3
  2064. add_ldflags -Wl,-z,now # calls to libots crash without this
  2065. speed_cflags='-fast'
  2066. size_cflags='-O1'
  2067. elif $cc --vsn 2>/dev/null | grep -q "ARM C/C++ Compiler"; then
  2068. test -d "$sysroot" || die "No valid sysroot specified."
  2069. cc_type=armcc
  2070. cc_version="AV_STRINGIFY(__ARMCC_VERSION)"
  2071. cc_ident=$($cc --vsn | head -n1)
  2072. armcc_conf="$PWD/armcc.conf"
  2073. $cc --arm_linux_configure \
  2074. --arm_linux_config_file="$armcc_conf" \
  2075. --configure_sysroot="$sysroot" \
  2076. --configure_cpp_headers="$sysinclude" >>$logfile 2>&1 ||
  2077. die "Error creating armcc configuration file."
  2078. $cc --vsn | grep -q RVCT && armcc_opt=rvct || armcc_opt=armcc
  2079. cc="$cc --arm_linux_config_file=$armcc_conf --translate_gcc"
  2080. as_default="${cross_prefix}gcc"
  2081. CC_DEPFLAGS='-MMD'
  2082. AS_DEPFLAGS='-MMD'
  2083. speed_cflags='-O3'
  2084. size_cflags='-Os'
  2085. filter_asflags="filter_out -W${armcc_opt}*"
  2086. elif $cc -version 2>/dev/null | grep -q TMS470; then
  2087. cc_type=tms470
  2088. cc_version="AV_STRINGIFY(__TI_COMPILER_VERSION__)"
  2089. cc_ident=$($cc -version | head -n1 | tr -s ' ')
  2090. cc="$cc --gcc --abi=eabi -eo=.o -mc -me"
  2091. CC_O='-fr=$(@D)'
  2092. as_default="${cross_prefix}gcc"
  2093. ld_default="${cross_prefix}gcc"
  2094. TMPO=$(basename $TMPC .c).o
  2095. append TMPFILES $TMPO
  2096. add_cflags -D__gnuc_va_list=va_list -D__USER_LABEL_PREFIX__=
  2097. CC_DEPFLAGS='-ppa -ppd=$(@:.o=.d)'
  2098. AS_DEPFLAGS='-MMD'
  2099. speed_cflags='-O3 -mf=5'
  2100. size_cflags='-O3 -mf=2'
  2101. filter_cflags=tms470_flags
  2102. tms470_flags(){
  2103. for flag; do
  2104. case $flag in
  2105. -march=*|-mcpu=*)
  2106. case "${flag#*=}" in
  2107. armv7-a|cortex-a*) echo -mv=7a8 ;;
  2108. armv7-r|cortex-r*) echo -mv=7r4 ;;
  2109. armv7-m|cortex-m*) echo -mv=7m3 ;;
  2110. armv6*|arm11*) echo -mv=6 ;;
  2111. armv5*e|arm[79]*e*|arm9[24]6*|arm96*|arm102[26])
  2112. echo -mv=5e ;;
  2113. armv4*|arm7*|arm9[24]*) echo -mv=4 ;;
  2114. esac
  2115. ;;
  2116. -mfpu=neon) echo --float_support=vfpv3 --neon ;;
  2117. -mfpu=vfp) echo --float_support=vfpv2 ;;
  2118. -mfpu=vfpv3) echo --float_support=vfpv3 ;;
  2119. -msoft-float) echo --float_support=vfplib ;;
  2120. -O[0-3]|-mf=*) echo $flag ;;
  2121. -g) echo -g -mn ;;
  2122. -pds=*) echo $flag ;;
  2123. esac
  2124. done
  2125. }
  2126. elif $cc -v 2>&1 | grep -q clang; then
  2127. cc_type=clang
  2128. $cc -dM -E $TMPC | grep -q __clang_version__ &&
  2129. cc_version=__clang_version__ || cc_version=__VERSION__
  2130. cc_ident=$($cc --version | head -n1)
  2131. CC_DEPFLAGS='-MMD'
  2132. AS_DEPFLAGS='-MMD'
  2133. speed_cflags='-O3'
  2134. size_cflags='-Os'
  2135. elif $cc -V 2>&1 | grep -q Sun; then
  2136. cc_type=suncc
  2137. cc_version="AV_STRINGIFY(__SUNPRO_C)"
  2138. cc_ident=$($cc -V 2>&1 | head -n1 | cut -d' ' -f 2-)
  2139. DEPEND_CMD='$(DEPCC) $(DEPFLAGS) $< | sed -e "1s,^.*: ,$@: ," -e "\$$!s,\$$, \\\," -e "1!s,^.*: , ," > $(@:.o=.d)'
  2140. DEPFLAGS='$(CPPFLAGS) $(CFLAGS) -xM1'
  2141. add_ldflags -xc99
  2142. speed_cflags='-O5'
  2143. size_cflags='-O5 -xspace'
  2144. filter_cflags=suncc_flags
  2145. suncc_flags(){
  2146. for flag; do
  2147. case $flag in
  2148. -march=*|-mcpu=*)
  2149. case "${flag#*=}" in
  2150. native) echo -xtarget=native ;;
  2151. v9|niagara) echo -xarch=sparc ;;
  2152. ultrasparc) echo -xarch=sparcvis ;;
  2153. ultrasparc3|niagara2) echo -xarch=sparcvis2 ;;
  2154. i586|pentium) echo -xchip=pentium ;;
  2155. i686|pentiumpro|pentium2) echo -xtarget=pentium_pro ;;
  2156. pentium3*|c3-2) echo -xtarget=pentium3 ;;
  2157. pentium-m) echo -xarch=sse2 -xchip=pentium3 ;;
  2158. pentium4*) echo -xtarget=pentium4 ;;
  2159. prescott|nocona) echo -xarch=sse3 -xchip=pentium4 ;;
  2160. *-sse3) echo -xarch=sse3 ;;
  2161. core2) echo -xarch=ssse3 -xchip=core2 ;;
  2162. amdfam10|barcelona) echo -xarch=sse4_1 ;;
  2163. athlon-4|athlon-[mx]p) echo -xarch=ssea ;;
  2164. k8|opteron|athlon64|athlon-fx)
  2165. echo -xarch=sse2a ;;
  2166. athlon*) echo -xarch=pentium_proa ;;
  2167. esac
  2168. ;;
  2169. -std=c99) echo -xc99 ;;
  2170. -fomit-frame-pointer) echo -xregs=frameptr ;;
  2171. -fPIC) echo -KPIC -xcode=pic32 ;;
  2172. -W*,*) echo $flag ;;
  2173. -f*-*|-W*) ;;
  2174. *) echo $flag ;;
  2175. esac
  2176. done
  2177. }
  2178. elif $cc -v 2>&1 | grep -q 'PathScale\|Path64'; then
  2179. cc_type=pathscale
  2180. cc_version=__PATHSCALE__
  2181. cc_ident=$($cc -v 2>&1 | head -n1 | tr -d :)
  2182. CC_DEPFLAGS='-MMD -MF $(@:.o=.d) -MT $@'
  2183. AS_DEPFLAGS='-MMD -MF $(@:.o=.d) -MT $@'
  2184. speed_cflags='-O2'
  2185. size_cflags='-Os'
  2186. filter_cflags='filter_out -Wdisabled-optimization'
  2187. elif $cc -v 2>&1 | grep -q Open64; then
  2188. cc_type=open64
  2189. cc_version=__OPEN64__
  2190. cc_ident=$($cc -v 2>&1 | head -n1 | tr -d :)
  2191. CC_DEPFLAGS='-MMD -MF $(@:.o=.d) -MT $@'
  2192. AS_DEPFLAGS='-MMD -MF $(@:.o=.d) -MT $@'
  2193. speed_cflags='-O2'
  2194. size_cflags='-Os'
  2195. filter_cflags='filter_out -Wdisabled-optimization|-Wtype-limits|-fno-signed-zeros'
  2196. elif $cc -V 2>&1 | grep -q Portland; then
  2197. cc_type=pgi
  2198. cc_version='AV_STRINGIFY(__PGIC__.__PGIC_MINOR__.__PGIC_PATCHLEVEL__)'
  2199. cc_ident="PGI $($cc -V 2>&1 | awk '/^pgcc/ { print $2; exit }')"
  2200. opt_common='-alias=ansi -Mlre -Mpre'
  2201. speed_cflags="-O3 -Mautoinline -Munroll=c:4 $opt_common"
  2202. size_cflags="-O2 -Munroll=c:1 $opt_common"
  2203. noopt_cflags="-O1"
  2204. filter_cflags=pgi_flags
  2205. pgi_flags(){
  2206. for flag; do
  2207. case $flag in
  2208. -fomit-frame-pointer) echo -Mnoframe ;;
  2209. -g) echo -gopt ;;
  2210. *) echo $flag ;;
  2211. esac
  2212. done
  2213. }
  2214. fi
  2215. test -n "$cc_type" && enable $cc_type ||
  2216. warn "Unknown C compiler $cc, unable to select optimal CFLAGS"
  2217. : ${as_default:=$cc}
  2218. : ${dep_cc_default:=$cc}
  2219. : ${ld_default:=$cc}
  2220. set_default ar as dep_cc ld
  2221. test -n "$CC_DEPFLAGS" || CCDEP=$DEPEND_CMD
  2222. test -n "$CXX_DEPFLAGS" || CXXDEP=$DEPEND_CMD
  2223. test -n "$AS_DEPFLAGS" || ASDEP=$DEPEND_CMD
  2224. add_cflags $extra_cflags
  2225. add_cxxflags $extra_cxxflags
  2226. add_asflags $extra_cflags
  2227. if test -n "$sysroot"; then
  2228. case "$cc_type" in
  2229. gcc|llvm_gcc|clang)
  2230. add_cppflags --sysroot="$sysroot"
  2231. add_ldflags --sysroot="$sysroot"
  2232. ;;
  2233. tms470)
  2234. add_cppflags -I"$sysinclude"
  2235. add_ldflags --sysroot="$sysroot"
  2236. ;;
  2237. esac
  2238. fi
  2239. if test "$cpu" = host; then
  2240. enabled cross_compile && die "--cpu=host makes no sense when cross-compiling."
  2241. case "$cc_type" in
  2242. gcc|llvm_gcc)
  2243. check_native(){
  2244. $cc $1=native -v -c -o $TMPO $TMPC >$TMPE 2>&1 || return
  2245. sed -n "/cc1.*$1=/{
  2246. s/.*$1=\\([^ ]*\\).*/\\1/
  2247. p
  2248. q
  2249. }" $TMPE
  2250. }
  2251. cpu=$(check_native -march || check_native -mcpu)
  2252. ;;
  2253. esac
  2254. test "${cpu:-host}" = host && die "--cpu=host not supported with compiler $cc"
  2255. fi
  2256. # Deal with common $arch aliases
  2257. case "$arch" in
  2258. arm*|iPad*)
  2259. arch="arm"
  2260. ;;
  2261. mips|mipsel|IP*)
  2262. arch="mips"
  2263. ;;
  2264. mips64*)
  2265. arch="mips"
  2266. subarch="mips64"
  2267. ;;
  2268. parisc|hppa)
  2269. arch="parisc"
  2270. ;;
  2271. parisc64|hppa64)
  2272. arch="parisc"
  2273. subarch="parisc64"
  2274. ;;
  2275. "Power Macintosh"|ppc|powerpc|ppc64|powerpc64)
  2276. arch="ppc"
  2277. ;;
  2278. s390|s390x)
  2279. arch="s390"
  2280. ;;
  2281. sh4|sh)
  2282. arch="sh4"
  2283. ;;
  2284. sun4u|sparc64)
  2285. arch="sparc"
  2286. subarch="sparc64"
  2287. ;;
  2288. i[3-6]86|i86pc|BePC|x86pc|x86_64|x86_32|amd64)
  2289. arch="x86"
  2290. ;;
  2291. esac
  2292. is_in $arch $ARCH_LIST || warn "unknown architecture $arch"
  2293. enable $arch
  2294. # Add processor-specific flags
  2295. if test "$cpu" = generic; then
  2296. : do nothing
  2297. elif enabled ppc; then
  2298. case $(tolower $cpu) in
  2299. 601|ppc601|powerpc601)
  2300. cpuflags="-mcpu=601"
  2301. disable altivec
  2302. ;;
  2303. 603*|ppc603*|powerpc603*)
  2304. cpuflags="-mcpu=603"
  2305. disable altivec
  2306. ;;
  2307. 604*|ppc604*|powerpc604*)
  2308. cpuflags="-mcpu=604"
  2309. disable altivec
  2310. ;;
  2311. g3|75*|ppc75*|powerpc75*)
  2312. cpuflags="-mcpu=750 -mpowerpc-gfxopt"
  2313. disable altivec
  2314. ;;
  2315. g4|745*|ppc745*|powerpc745*)
  2316. cpuflags="-mcpu=7450 -mpowerpc-gfxopt"
  2317. ;;
  2318. 74*|ppc74*|powerpc74*)
  2319. cpuflags="-mcpu=7400 -mpowerpc-gfxopt"
  2320. ;;
  2321. g5|970|ppc970|powerpc970)
  2322. cpuflags="-mcpu=970 -mpowerpc-gfxopt -mpowerpc64"
  2323. ;;
  2324. power[3-7]*)
  2325. cpuflags="-mcpu=$cpu -mpowerpc-gfxopt -mpowerpc64"
  2326. ;;
  2327. cell)
  2328. cpuflags="-mcpu=cell"
  2329. enable ldbrx
  2330. ;;
  2331. e500v2)
  2332. cpuflags="-mcpu=8548 -mhard-float -mfloat-gprs=double"
  2333. disable altivec
  2334. ;;
  2335. e500)
  2336. cpuflags="-mcpu=8540 -mhard-float"
  2337. disable altivec
  2338. ;;
  2339. esac
  2340. elif enabled x86; then
  2341. case $cpu in
  2342. i[345]86|pentium)
  2343. cpuflags="-march=$cpu"
  2344. disable mmx
  2345. ;;
  2346. # targets that do NOT support conditional mov (cmov)
  2347. pentium-mmx|k6|k6-[23]|winchip-c6|winchip2|c3)
  2348. cpuflags="-march=$cpu"
  2349. disable cmov
  2350. ;;
  2351. # targets that do support conditional mov (cmov)
  2352. i686|pentiumpro|pentium[23]|pentium-m|athlon|athlon-tbird|athlon-4|athlon-[mx]p|athlon64*|k8*|opteron*|athlon-fx|core2|amdfam10|barcelona|atom)
  2353. cpuflags="-march=$cpu"
  2354. enable cmov
  2355. enable fast_cmov
  2356. ;;
  2357. # targets that do support conditional mov but on which it's slow
  2358. pentium4|pentium4m|prescott|nocona)
  2359. cpuflags="-march=$cpu"
  2360. enable cmov
  2361. disable fast_cmov
  2362. ;;
  2363. esac
  2364. elif enabled sparc; then
  2365. case $cpu in
  2366. niagara)
  2367. cpuflags="-mcpu=$cpu"
  2368. disable vis
  2369. ;;
  2370. sparc64)
  2371. cpuflags="-mcpu=v9"
  2372. ;;
  2373. esac
  2374. elif enabled arm; then
  2375. case $cpu in
  2376. armv*)
  2377. cpuflags="-march=$cpu"
  2378. subarch=$(echo $cpu | sed 's/[^a-z0-9]//g')
  2379. ;;
  2380. *)
  2381. cpuflags="-mcpu=$cpu"
  2382. case $cpu in
  2383. cortex-a*) subarch=armv7a ;;
  2384. cortex-r*) subarch=armv7r ;;
  2385. cortex-m*) enable thumb; subarch=armv7m ;;
  2386. arm11*) subarch=armv6 ;;
  2387. arm[79]*e*|arm9[24]6*|arm96*|arm102[26]) subarch=armv5te ;;
  2388. armv4*|arm7*|arm9[24]*) subarch=armv4 ;;
  2389. esac
  2390. ;;
  2391. esac
  2392. elif enabled alpha; then
  2393. enabled ccc && cpuflags="-arch $cpu" || cpuflags="-mcpu=$cpu"
  2394. elif enabled bfin; then
  2395. cpuflags="-mcpu=$cpu"
  2396. elif enabled mips; then
  2397. cpuflags="-march=$cpu"
  2398. case $cpu in
  2399. 24kc)
  2400. disable mipsfpu
  2401. disable mipsdspr1
  2402. disable mipsdspr2
  2403. ;;
  2404. 24kf*)
  2405. disable mipsdspr1
  2406. disable mipsdspr2
  2407. ;;
  2408. 24kec|34kc|1004kc)
  2409. disable mipsfpu
  2410. disable mipsdspr2
  2411. ;;
  2412. 24kef*|34kf*|1004kf*)
  2413. disable mipsdspr2
  2414. ;;
  2415. 74kc)
  2416. disable mipsfpu
  2417. ;;
  2418. esac
  2419. elif enabled avr32; then
  2420. case $cpu in
  2421. ap7[02]0[0-2])
  2422. subarch="avr32_ap"
  2423. cpuflags="-mpart=$cpu"
  2424. ;;
  2425. ap)
  2426. subarch="avr32_ap"
  2427. cpuflags="-march=$cpu"
  2428. ;;
  2429. uc3[ab]*)
  2430. subarch="avr32_uc"
  2431. cpuflags="-mcpu=$cpu"
  2432. ;;
  2433. uc)
  2434. subarch="avr32_uc"
  2435. cpuflags="-march=$cpu"
  2436. ;;
  2437. esac
  2438. fi
  2439. add_cflags $cpuflags
  2440. add_asflags $cpuflags
  2441. # compiler sanity check
  2442. check_exec <<EOF
  2443. int main(void){ return 0; }
  2444. EOF
  2445. if test "$?" != 0; then
  2446. echo "$cc is unable to create an executable file."
  2447. if test -z "$cross_prefix" && ! enabled cross_compile ; then
  2448. echo "If $cc is a cross-compiler, use the --enable-cross-compile option."
  2449. echo "Only do this if you know what cross compiling means."
  2450. fi
  2451. die "C compiler test failed."
  2452. fi
  2453. add_cppflags -D_ISOC99_SOURCE
  2454. add_cxxflags -D__STDC_CONSTANT_MACROS
  2455. check_cflags -std=c99
  2456. check_cc -D_FILE_OFFSET_BITS=64 <<EOF && add_cppflags -D_FILE_OFFSET_BITS=64
  2457. #include <stdlib.h>
  2458. EOF
  2459. check_cc -D_LARGEFILE_SOURCE <<EOF && add_cppflags -D_LARGEFILE_SOURCE
  2460. #include <stdlib.h>
  2461. EOF
  2462. check_host_cflags -std=c99
  2463. check_host_cflags -Wall
  2464. case "$arch" in
  2465. alpha|ia64|mips|parisc|sparc)
  2466. spic=$shared
  2467. ;;
  2468. x86)
  2469. subarch="x86_32"
  2470. check_code cc "" "int test[(int)sizeof(char*) - 7]" && subarch="x86_64"
  2471. if test "$subarch" = "x86_64"; then
  2472. spic=$shared
  2473. fi
  2474. ;;
  2475. ppc)
  2476. check_cc <<EOF && subarch="ppc64"
  2477. int test[(int)sizeof(char*) - 7];
  2478. EOF
  2479. ;;
  2480. esac
  2481. enable $subarch
  2482. enabled spic && enable pic
  2483. # OS specific
  2484. case $target_os in
  2485. haiku)
  2486. prefix_default="/boot/common"
  2487. network_extralibs="-lnetwork"
  2488. host_libs=
  2489. ;;
  2490. sunos)
  2491. FFSERVERLDFLAGS=""
  2492. SHFLAGS='-shared -Wl,-h,$$(@F)'
  2493. enabled x86 && SHFLAGS="-mimpure-text $SHFLAGS"
  2494. network_extralibs="-lsocket -lnsl"
  2495. add_cppflags -D__EXTENSIONS__ -D_XOPEN_SOURCE=600
  2496. # When using suncc to build, the Solaris linker will mark
  2497. # an executable with each instruction set encountered by
  2498. # the Solaris assembler. As our libraries contain their own
  2499. # guards for processor-specific code, instead suppress
  2500. # generation of the HWCAPS ELF section on Solaris x86 only.
  2501. enabled_all suncc x86 && echo "hwcap_1 = OVERRIDE;" > mapfile && add_ldflags -Wl,-M,mapfile
  2502. nm_opts='-P -g'
  2503. ;;
  2504. netbsd)
  2505. disable symver
  2506. oss_indev_extralibs="-lossaudio"
  2507. oss_outdev_extralibs="-lossaudio"
  2508. ;;
  2509. openbsd|bitrig)
  2510. # On OpenBSD 4.5. the compiler does not use PIC unless
  2511. # explicitly using -fPIC. FFmpeg builds fine without PIC,
  2512. # however the generated executable will not do anything
  2513. # (simply quits with exit-code 1, no crash, no output).
  2514. # Thus explicitly enable PIC here.
  2515. enable pic
  2516. disable symver
  2517. SHFLAGS='-shared'
  2518. SLIBNAME_WITH_MAJOR='$(SLIBNAME).$(LIBVERSION)'
  2519. oss_indev_extralibs="-lossaudio"
  2520. oss_outdev_extralibs="-lossaudio"
  2521. ;;
  2522. dragonfly)
  2523. disable symver
  2524. ;;
  2525. freebsd)
  2526. ;;
  2527. bsd/os)
  2528. add_extralibs -lpoll -lgnugetopt
  2529. strip="strip -d"
  2530. ;;
  2531. darwin)
  2532. gas="gas-preprocessor.pl $cc"
  2533. enabled ppc && add_asflags -force_cpusubtype_ALL
  2534. SHFLAGS='-dynamiclib -Wl,-single_module -Wl,-install_name,$(SHLIBDIR)/$(SLIBNAME_WITH_MAJOR),-current_version,$(LIBVERSION),-compatibility_version,$(LIBMAJOR)'
  2535. enabled x86_32 && append SHFLAGS -Wl,-read_only_relocs,suppress
  2536. strip="${strip} -x"
  2537. add_ldflags -Wl,-dynamic,-search_paths_first
  2538. SLIBSUF=".dylib"
  2539. SLIBNAME_WITH_VERSION='$(SLIBPREF)$(FULLNAME).$(LIBVERSION)$(SLIBSUF)'
  2540. SLIBNAME_WITH_MAJOR='$(SLIBPREF)$(FULLNAME).$(LIBMAJOR)$(SLIBSUF)'
  2541. FFSERVERLDFLAGS=-Wl,-bind_at_load
  2542. objformat="macho"
  2543. enabled x86_64 && objformat="macho64"
  2544. enabled_any pic shared ||
  2545. { check_cflags -mdynamic-no-pic && add_asflags -mdynamic-no-pic; }
  2546. ;;
  2547. mingw32*)
  2548. if test $target_os = "mingw32ce"; then
  2549. disable network
  2550. else
  2551. target_os=mingw32
  2552. fi
  2553. LIBTARGET=i386
  2554. if enabled x86_64; then
  2555. LIBTARGET=x64
  2556. elif enabled arm; then
  2557. LIBTARGET=arm-wince
  2558. fi
  2559. shlibdir_default="$bindir_default"
  2560. SLIBPREF=""
  2561. SLIBSUF=".dll"
  2562. SLIBNAME_WITH_VERSION='$(SLIBPREF)$(FULLNAME)-$(LIBVERSION)$(SLIBSUF)'
  2563. SLIBNAME_WITH_MAJOR='$(SLIBPREF)$(FULLNAME)-$(LIBMAJOR)$(SLIBSUF)'
  2564. SLIB_EXTRA_CMD='-lib.exe /machine:$(LIBTARGET) /def:$$(@:$(SLIBSUF)=.def) /out:$(SUBDIR)$(SLIBNAME:$(SLIBSUF)=.lib)'
  2565. SLIB_INSTALL_NAME='$(SLIBNAME_WITH_MAJOR)'
  2566. SLIB_INSTALL_LINKS=
  2567. SLIB_INSTALL_EXTRA_SHLIB='$(SLIBNAME:$(SLIBSUF)=.lib)'
  2568. SLIB_INSTALL_EXTRA_LIB='lib$(SLIBNAME:$(SLIBSUF)=.dll.a) $(SLIBNAME_WITH_MAJOR:$(SLIBSUF)=.def)'
  2569. 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'
  2570. objformat="win32"
  2571. enable dos_paths
  2572. check_cflags -fno-common
  2573. check_cpp_condition _mingw.h "defined (__MINGW64_VERSION_MAJOR) || (__MINGW32_MAJOR_VERSION > 3) \
  2574. || (__MINGW32_MAJOR_VERSION == 3 && __MINGW32_MINOR_VERSION >= 15)" ||
  2575. die "ERROR: MinGW runtime version must be >= 3.15."
  2576. add_cppflags -U__STRICT_ANSI__
  2577. ;;
  2578. cygwin*)
  2579. target_os=cygwin
  2580. shlibdir_default="$bindir_default"
  2581. SLIBPREF="cyg"
  2582. SLIBSUF=".dll"
  2583. SLIBNAME_WITH_VERSION='$(SLIBPREF)$(FULLNAME)-$(LIBVERSION)$(SLIBSUF)'
  2584. SLIBNAME_WITH_MAJOR='$(SLIBPREF)$(FULLNAME)-$(LIBMAJOR)$(SLIBSUF)'
  2585. SHFLAGS='-shared -Wl,--enable-auto-image-base'
  2586. objformat="win32"
  2587. enable dos_paths
  2588. check_cflags -fno-common
  2589. add_cppflags -U__STRICT_ANSI__
  2590. ;;
  2591. *-dos|freedos|opendos)
  2592. network_extralibs="-lsocket"
  2593. objformat="coff"
  2594. enable dos_paths
  2595. add_cppflags -U__STRICT_ANSI__
  2596. ;;
  2597. linux)
  2598. add_cppflags -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600
  2599. enable dv1394
  2600. ;;
  2601. irix*)
  2602. target_os=irix
  2603. ranlib="echo ignoring ranlib"
  2604. ;;
  2605. os/2*)
  2606. strip="lxlite -CS"
  2607. ln_s="cp -f"
  2608. objformat="aout"
  2609. add_cppflags -D_GNU_SOURCE
  2610. add_ldflags -Zomf -Zbin-files -Zargs-wild -Zmap
  2611. SHFLAGS='$(SUBDIR)$(NAME).def -Zdll -Zomf'
  2612. FFSERVERLDFLAGS=""
  2613. LIBSUF="_s.a"
  2614. SLIBPREF=""
  2615. SLIBSUF=".dll"
  2616. SLIBNAME_WITH_VERSION='$(SLIBPREF)$(NAME)-$(LIBVERSION)$(SLIBSUF)'
  2617. SLIBNAME_WITH_MAJOR='$(SLIBPREF)$(shell echo $(NAME) | cut -c1-6)$(LIBMAJOR)$(SLIBSUF)'
  2618. SLIB_CREATE_DEF_CMD='echo LIBRARY $(SLIBNAME_WITH_MAJOR) INITINSTANCE TERMINSTANCE > $(SUBDIR)$(NAME).def; \
  2619. echo PROTMODE >> $(SUBDIR)$(NAME).def; \
  2620. echo CODE PRELOAD MOVEABLE DISCARDABLE >> $(SUBDIR)$(NAME).def; \
  2621. echo DATA PRELOAD MOVEABLE MULTIPLE NONSHARED >> $(SUBDIR)$(NAME).def; \
  2622. echo EXPORTS >> $(SUBDIR)$(NAME).def; \
  2623. emxexp -o $(OBJS) >> $(SUBDIR)$(NAME).def'
  2624. SLIB_EXTRA_CMD='emximp -o $(SUBDIR)$(LIBPREF)$(NAME)_dll.a $(SUBDIR)$(NAME).def; \
  2625. emximp -o $(SUBDIR)$(LIBPREF)$(NAME)_dll.lib $(SUBDIR)$(NAME).def;'
  2626. SLIB_INSTALL_EXTRA_LIB='$(LIBPREF)$(NAME)_dll.a $(LIBPREF)$(NAME)_dll.lib'
  2627. enable dos_paths
  2628. enable_weak os2threads
  2629. ;;
  2630. gnu/kfreebsd)
  2631. add_cppflags -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600 -D_BSD_SOURCE
  2632. ;;
  2633. gnu)
  2634. add_cppflags -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600
  2635. ;;
  2636. qnx)
  2637. add_cppflags -D_QNX_SOURCE
  2638. network_extralibs="-lsocket"
  2639. ;;
  2640. symbian)
  2641. SLIBSUF=".dll"
  2642. enable dos_paths
  2643. add_cflags --include=$sysinclude/gcce/gcce.h -fvisibility=default
  2644. add_cppflags -D__GCCE__ -D__SYMBIAN32__ -DSYMBIAN_OE_POSIX_SIGNALS
  2645. add_ldflags -Wl,--target1-abs,--no-undefined \
  2646. -Wl,-Ttext,0x80000,-Tdata,0x1000000 -shared \
  2647. -Wl,--entry=_E32Startup -Wl,-u,_E32Startup
  2648. add_extralibs -l:eexe.lib -l:usrt2_2.lib -l:dfpaeabi.dso \
  2649. -l:drtaeabi.dso -l:scppnwdl.dso -lsupc++ -lgcc \
  2650. -l:libc.dso -l:libm.dso -l:euser.dso -l:libcrt0.lib
  2651. ;;
  2652. none)
  2653. ;;
  2654. *)
  2655. die "Unknown OS '$target_os'."
  2656. ;;
  2657. esac
  2658. esc(){
  2659. echo "$*" | sed 's/%/%25/g;s/:/%3a/g'
  2660. }
  2661. echo "config:$arch:$subarch:$cpu:$target_os:$(esc $cc_ident):$(esc $FFMPEG_CONFIGURATION)" >config.fate
  2662. check_cpp_condition stdlib.h "defined(__PIC__) || defined(__pic__) || defined(PIC)" && enable pic
  2663. set_default $PATHS_LIST
  2664. # we need to build at least one lib type
  2665. if ! enabled_any static shared; then
  2666. cat <<EOF
  2667. At least one library type must be built.
  2668. Specify --enable-static to build the static libraries or --enable-shared to
  2669. build the shared libraries as well. To only build the shared libraries specify
  2670. --disable-static in addition to --enable-shared.
  2671. EOF
  2672. exit 1;
  2673. fi
  2674. die_license_disabled() {
  2675. enabled $1 || { enabled $2 && die "$2 is $1 and --enable-$1 is not specified."; }
  2676. }
  2677. die_license_disabled_gpl() {
  2678. enabled $1 || { enabled $2 && die "$2 is incompatible with the gpl and --enable-$1 is not specified."; }
  2679. }
  2680. die_license_disabled gpl libcdio
  2681. die_license_disabled gpl libutvideo
  2682. die_license_disabled gpl libx264
  2683. die_license_disabled gpl libxavs
  2684. die_license_disabled gpl libxvid
  2685. die_license_disabled gpl x11grab
  2686. die_license_disabled nonfree libaacplus
  2687. die_license_disabled nonfree libfaac
  2688. enabled gpl && die_license_disabled_gpl nonfree libfdk_aac
  2689. enabled gpl && die_license_disabled_gpl nonfree openssl
  2690. die_license_disabled version3 libopencore_amrnb
  2691. die_license_disabled version3 libopencore_amrwb
  2692. die_license_disabled version3 libvo_aacenc
  2693. die_license_disabled version3 libvo_amrwbenc
  2694. enabled version3 && { enabled gpl && enable gplv3 || enable lgplv3; }
  2695. disabled optimizations || check_cflags -fomit-frame-pointer
  2696. enable_pic() {
  2697. enable pic
  2698. add_cppflags -DPIC
  2699. add_cflags -fPIC
  2700. add_asflags -fPIC
  2701. }
  2702. enabled pic && enable_pic
  2703. check_cc <<EOF || die "Symbol mangling check failed."
  2704. int ff_extern;
  2705. EOF
  2706. sym=$($nm $nm_opts $TMPO | awk '/ff_extern/{ print substr($0, match($0, /[^ \t]*ff_extern/)) }')
  2707. extern_prefix=${sym%%ff_extern*}
  2708. check_cc <<EOF && enable inline_asm
  2709. void foo(void) { __asm__ volatile ("" ::); }
  2710. EOF
  2711. _restrict=
  2712. for restrict_keyword in restrict __restrict__ __restrict; do
  2713. check_cc <<EOF && _restrict=$restrict_keyword && break
  2714. void foo(char * $restrict_keyword p);
  2715. EOF
  2716. done
  2717. check_cc <<EOF && enable attribute_packed
  2718. struct { int x; } __attribute__((packed)) x;
  2719. EOF
  2720. check_cc <<EOF && enable attribute_may_alias
  2721. union { int x; } __attribute__((may_alias)) x;
  2722. EOF
  2723. check_cc <<EOF || die "endian test failed"
  2724. unsigned int endian = 'B' << 24 | 'I' << 16 | 'G' << 8 | 'E';
  2725. EOF
  2726. od -t x1 $TMPO | grep -q '42 *49 *47 *45' && enable bigendian
  2727. if enabled alpha; then
  2728. check_cflags -mieee
  2729. elif enabled arm; then
  2730. enabled thumb && check_cflags -mthumb || check_cflags -marm
  2731. nogas=die
  2732. if check_cpp_condition stddef.h "defined __ARM_PCS_VFP"; then
  2733. enable vfp_args
  2734. elif ! check_cpp_condition stddef.h "defined __ARM_PCS || defined __SOFTFP__"; then
  2735. case "${cross_prefix:-$cc}" in
  2736. *hardfloat*) enable vfp_args; fpabi=vfp ;;
  2737. *) check_ld "cc" <<EOF && enable vfp_args && fpabi=vfp || fpabi=soft ;;
  2738. __asm__ (".eabi_attribute 28, 1");
  2739. int main(void) { return 0; }
  2740. EOF
  2741. esac
  2742. warn "Compiler does not indicate floating-point ABI, guessing $fpabi."
  2743. fi
  2744. enabled armv5te && check_asm armv5te '"qadd r0, r0, r0"'
  2745. enabled armv6 && check_asm armv6 '"sadd16 r0, r0, r0"'
  2746. enabled armv6t2 && check_asm armv6t2 '"movt r0, #0"'
  2747. enabled armvfp && check_asm armvfp '"fadds s0, s0, s0"'
  2748. enabled neon && check_asm neon '"vadd.i16 q0, q0, q0"'
  2749. enabled vfpv3 && check_asm vfpv3 '"vmov.f32 s0, #1.0"'
  2750. check_asm asm_mod_y '"vmul.i32 d0, d0, %y0" :: "x"(0)'
  2751. enabled_all armv6t2 shared !pic && enable_pic
  2752. elif enabled mips; then
  2753. check_asm loongson '"dmult.g $1, $2, $3"'
  2754. enabled mmi && check_asm mmi '"lq $2, 0($2)"'
  2755. enabled mips32r2 && add_cflags "-mips32r2" &&
  2756. check_asm mips32r2 '"rotr $t0, $t1, 1"'
  2757. enabled mipsdspr1 && add_cflags "-mdsp" && add_asflags "-mdsp" &&
  2758. check_asm mipsdspr1 '"addu.qb $t0, $t1, $t2"'
  2759. enabled mipsdspr2 && add_cflags "-mdspr2" && add_asflags "-mdspr2" &&
  2760. check_asm mipsdspr2 '"absq_s.qb $t0, $t1"'
  2761. enabled mipsfpu && add_cflags "-mhard-float" &&
  2762. check_asm mipsfpu '"madd.d $f0, $f2, $f4, $f6"'
  2763. elif enabled ppc; then
  2764. enable local_aligned_8 local_aligned_16
  2765. check_asm dcbzl '"dcbzl 0, %0" :: "r"(0)'
  2766. check_asm ibm_asm '"add 0, 0, 0"'
  2767. check_asm ppc4xx '"maclhw r10, r11, r12"'
  2768. check_asm xform_asm '"lwzx %1, %y0" :: "Z"(*(int*)0), "r"(0)'
  2769. # AltiVec flags: The FSF version of GCC differs from the Apple version
  2770. if enabled altivec; then
  2771. nogas=warn
  2772. check_cflags -maltivec -mabi=altivec &&
  2773. { check_header altivec.h && inc_altivec_h="#include <altivec.h>" ; } ||
  2774. check_cflags -faltivec
  2775. # check if our compiler supports Motorola AltiVec C API
  2776. check_cc <<EOF || disable altivec
  2777. $inc_altivec_h
  2778. int main(void) {
  2779. vector signed int v1, v2, v3;
  2780. v1 = vec_add(v2,v3);
  2781. return 0;
  2782. }
  2783. EOF
  2784. # check if our compiler supports braces for vector declarations
  2785. check_cc <<EOF || die "You need a compiler that supports {} in AltiVec vector declarations."
  2786. $inc_altivec_h
  2787. int main (void) { (vector int) {1}; return 0; }
  2788. EOF
  2789. fi
  2790. elif enabled sparc; then
  2791. enabled vis && check_asm vis '"pdist %f0, %f0, %f0"' -mcpu=ultrasparc &&
  2792. add_cflags -mcpu=ultrasparc -mtune=ultrasparc
  2793. elif enabled x86; then
  2794. check_code ld immintrin.h "__xgetbv(0)" "cc" && enable xgetbv
  2795. check_code ld intrin.h "int info[4]; __cpuid(info, 0)" "cc" && enable cpuid
  2796. check_code ld intrin.h "__rdtsc()" "cc" && enable rdtsc
  2797. check_code ld intrin.h "unsigned int x = __readeflags()" "cc" && enable rweflags
  2798. check_code ld mmintrin.h "_mm_empty()" "cc" && enable mm_empty
  2799. enable local_aligned_8 local_aligned_16
  2800. # check whether EBP is available on x86
  2801. # As 'i' is stored on the stack, this program will crash
  2802. # if the base pointer is used to access it because the
  2803. # base pointer is cleared in the inline assembly code.
  2804. check_exec_crash <<EOF && enable ebp_available
  2805. volatile int i=0;
  2806. __asm__ volatile (
  2807. "xorl %%ebp, %%ebp"
  2808. ::: "%ebp");
  2809. return i;
  2810. EOF
  2811. # check whether EBX is available on x86
  2812. check_asm ebx_available '""::"b"(0)' &&
  2813. check_asm ebx_available '"":::"%ebx"'
  2814. # check whether xmm clobbers are supported
  2815. check_asm xmm_clobbers '"":::"%xmm0"'
  2816. # check whether binutils is new enough to compile SSSE3/MMX2
  2817. enabled ssse3 && check_asm ssse3 '"pabsw %xmm0, %xmm0"'
  2818. enabled mmx2 && check_asm mmx2 '"pmaxub %mm0, %mm1"'
  2819. if ! disabled_any asm mmx yasm; then
  2820. if check_cmd $yasmexe --version; then
  2821. enabled x86_64 && yasm_extra="-m amd64"
  2822. yasm_debug="-g dwarf2"
  2823. elif check_cmd nasm -v; then
  2824. yasmexe=nasm
  2825. yasm_debug="-g -F dwarf"
  2826. enabled x86_64 && test "$objformat" = elf && objformat=elf64
  2827. fi
  2828. YASMFLAGS="-f $objformat $yasm_extra"
  2829. enabled pic && append YASMFLAGS "-DPIC"
  2830. test -n "$extern_prefix" && append YASMFLAGS "-DPREFIX"
  2831. case "$objformat" in
  2832. elf*) enabled debug && append YASMFLAGS $yasm_debug ;;
  2833. esac
  2834. check_yasm "pextrd [eax], xmm0, 1" && enable yasm ||
  2835. die "yasm not found, use --disable-yasm for a crippled build"
  2836. check_yasm "vextractf128 xmm0, ymm0, 0" || disable avx
  2837. fi
  2838. case "$cpu" in
  2839. athlon*|opteron*|k8*|pentium|pentium-mmx|prescott|nocona|atom|geode)
  2840. disable fast_clz
  2841. ;;
  2842. esac
  2843. fi
  2844. if enabled asm; then
  2845. as=${gas:=$as}
  2846. check_asm gnu_as '".macro m n\n\\n:.int 0\n.endm\nm x"' ||
  2847. $nogas "GNU assembler not found, install gas-preprocessor"
  2848. fi
  2849. check_ldflags -Wl,--as-needed
  2850. if check_func dlopen; then
  2851. ldl=
  2852. elif check_func dlopen -ldl; then
  2853. ldl=-ldl
  2854. fi
  2855. if enabled network; then
  2856. check_type "sys/types.h sys/socket.h" socklen_t
  2857. check_type netdb.h "struct addrinfo"
  2858. check_type netinet/in.h "struct group_source_req" -D_BSD_SOURCE
  2859. check_type netinet/in.h "struct ip_mreq_source" -D_BSD_SOURCE
  2860. check_type netinet/in.h "struct ipv6_mreq" -D_DARWIN_C_SOURCE
  2861. check_type netinet/in.h "struct sockaddr_in6"
  2862. check_type poll.h "struct pollfd"
  2863. check_type "sys/types.h sys/socket.h" "struct sockaddr_storage"
  2864. check_struct "sys/types.h sys/socket.h" "struct sockaddr" sa_len
  2865. check_header netinet/sctp.h
  2866. check_func getaddrinfo $network_extralibs
  2867. # Prefer arpa/inet.h over winsock2
  2868. if check_header arpa/inet.h ; then
  2869. check_func closesocket
  2870. elif check_header winsock2.h ; then
  2871. check_func_headers winsock2.h closesocket -lws2 &&
  2872. network_extralibs="-lws2" ||
  2873. { check_func_headers winsock2.h closesocket -lws2_32 &&
  2874. network_extralibs="-lws2_32"; }
  2875. check_func_headers ws2tcpip.h getaddrinfo $network_extralibs
  2876. check_type ws2tcpip.h socklen_t
  2877. check_type ws2tcpip.h "struct addrinfo"
  2878. check_type ws2tcpip.h "struct group_source_req"
  2879. check_type ws2tcpip.h "struct ip_mreq_source"
  2880. check_type ws2tcpip.h "struct ipv6_mreq"
  2881. check_type winsock2.h "struct pollfd"
  2882. check_type ws2tcpip.h "struct sockaddr_in6"
  2883. check_type ws2tcpip.h "struct sockaddr_storage"
  2884. check_struct winsock2.h "struct sockaddr" sa_len
  2885. else
  2886. disable network
  2887. fi
  2888. fi
  2889. # Solaris has nanosleep in -lrt, OpenSolaris no longer needs that
  2890. check_func nanosleep || { check_func nanosleep -lrt && add_extralibs -lrt; }
  2891. check_func clock_gettime || { check_func clock_gettime -lrt && add_extralibs -lrt; }
  2892. check_func fcntl
  2893. check_func fork
  2894. check_func gethrtime
  2895. check_func getopt
  2896. check_func getrusage
  2897. check_struct "sys/time.h sys/resource.h" "struct rusage" ru_maxrss
  2898. check_func gettimeofday
  2899. check_func inet_aton $network_extralibs
  2900. check_func isatty
  2901. check_func localtime_r
  2902. check_func ${malloc_prefix}memalign && enable memalign
  2903. check_func mkstemp
  2904. check_func mmap
  2905. check_func ${malloc_prefix}posix_memalign && enable posix_memalign
  2906. check_func_headers malloc.h _aligned_malloc && enable aligned_malloc
  2907. check_func setrlimit
  2908. check_func strerror_r
  2909. check_func strptime
  2910. check_func sched_getaffinity
  2911. check_func sysconf
  2912. check_func sysctl
  2913. check_func usleep
  2914. check_func_headers conio.h kbhit
  2915. check_func_headers windows.h PeekNamedPipe
  2916. check_func_headers io.h setmode
  2917. check_func_headers lzo/lzo1x.h lzo1x_999_compress
  2918. check_lib2 "windows.h shellapi.h" CommandLineToArgvW -lshell32
  2919. check_lib2 "windows.h psapi.h" GetProcessMemoryInfo -lpsapi
  2920. check_func_headers windows.h GetProcessAffinityMask
  2921. check_func_headers windows.h GetProcessTimes
  2922. check_func_headers windows.h GetSystemTimeAsFileTime
  2923. check_func_headers windows.h MapViewOfFile
  2924. check_func_headers windows.h Sleep
  2925. check_func_headers windows.h VirtualAlloc
  2926. check_func_headers glob.h glob
  2927. check_header dlfcn.h
  2928. check_header dxva.h
  2929. check_header dxva2api.h -D_WIN32_WINNT=0x0600
  2930. check_header libcrystalhd/libcrystalhd_if.h
  2931. check_header malloc.h
  2932. check_header poll.h
  2933. check_header sys/mman.h
  2934. check_header sys/param.h
  2935. check_header sys/resource.h
  2936. check_header sys/select.h
  2937. check_header sys/time.h
  2938. check_header termios.h
  2939. check_header unistd.h
  2940. check_header vdpau/vdpau.h
  2941. check_header vdpau/vdpau_x11.h
  2942. check_header windows.h
  2943. check_header X11/extensions/XvMClib.h
  2944. check_header asm/types.h
  2945. disabled zlib || check_lib zlib.h zlibVersion -lz || disable zlib
  2946. disabled bzlib || check_lib2 bzlib.h BZ2_bzlibVersion -lbz2 || disable bzlib
  2947. # check for VDA header
  2948. if ! disabled vda; then
  2949. if check_header VideoDecodeAcceleration/VDADecoder.h; then
  2950. enable vda
  2951. add_extralibs -framework CoreFoundation -framework VideoDecodeAcceleration -framework QuartzCore
  2952. fi
  2953. fi
  2954. if ! disabled w32threads && ! enabled pthreads; then
  2955. check_func _beginthreadex && enable w32threads
  2956. fi
  2957. # check for some common methods of building with pthread support
  2958. # do this before the optional library checks as some of them require pthreads
  2959. if ! disabled pthreads && ! enabled w32threads && ! enabled os2threads; then
  2960. enable pthreads
  2961. if check_func pthread_create; then
  2962. :
  2963. elif check_func pthread_create -pthread; then
  2964. add_cflags -pthread
  2965. add_extralibs -pthread
  2966. elif check_func pthread_create -pthreads; then
  2967. add_cflags -pthreads
  2968. add_extralibs -pthreads
  2969. elif check_func pthread_create -lpthreadGC2; then
  2970. add_extralibs -lpthreadGC2
  2971. elif ! check_lib pthread.h pthread_create -lpthread; then
  2972. disable pthreads
  2973. fi
  2974. fi
  2975. for thread in $THREADS_LIST; do
  2976. if enabled $thread; then
  2977. test -n "$thread_type" &&
  2978. die "ERROR: Only one thread type must be selected." ||
  2979. thread_type="$thread"
  2980. fi
  2981. done
  2982. if enabled pthreads; then
  2983. check_func pthread_cancel
  2984. fi
  2985. check_lib math.h sin -lm && LIBM="-lm"
  2986. disabled crystalhd || check_lib libcrystalhd/libcrystalhd_if.h DtsCrystalHDVersion -lcrystalhd || disable crystalhd
  2987. enabled vaapi && require vaapi va/va.h vaInitialize -lva
  2988. check_mathfunc cbrtf
  2989. check_mathfunc exp2
  2990. check_mathfunc exp2f
  2991. check_mathfunc isinf
  2992. check_mathfunc isnan
  2993. check_mathfunc llrint
  2994. check_mathfunc llrintf
  2995. check_mathfunc log2
  2996. check_mathfunc log2f
  2997. check_mathfunc lrint
  2998. check_mathfunc lrintf
  2999. check_mathfunc rint
  3000. check_mathfunc round
  3001. check_mathfunc roundf
  3002. check_mathfunc trunc
  3003. check_mathfunc truncf
  3004. # these are off by default, so fail if requested and not available
  3005. enabled avisynth && require2 vfw32 "windows.h vfw.h" AVIFileInit -lavifil32
  3006. enabled fontconfig && require_pkg_config fontconfig "fontconfig/fontconfig.h" FcInit
  3007. enabled frei0r && { check_header frei0r.h || die "ERROR: frei0r.h header not found"; }
  3008. enabled gnutls && require_pkg_config gnutls gnutls/gnutls.h gnutls_global_init
  3009. enabled libiec61883 && require libiec61883 libiec61883/iec61883.h iec61883_cmp_connect -lraw1394 -lavc1394 -lrom1394 -liec61883
  3010. enabled libaacplus && require "libaacplus >= 2.0.0" aacplus.h aacplusEncOpen -laacplus
  3011. enabled libass && require_pkg_config libass ass/ass.h ass_library_init
  3012. enabled libbluray && require libbluray libbluray/bluray.h bd_open -lbluray
  3013. enabled libcelt && require libcelt celt/celt.h celt_decode -lcelt0 &&
  3014. { check_lib celt/celt.h celt_decoder_create_custom -lcelt0 ||
  3015. die "ERROR: libcelt version must be >= 0.11.0."; }
  3016. enabled libfaac && require2 libfaac "stdint.h faac.h" faacEncGetVersion -lfaac
  3017. enabled libfdk_aac && require libfdk_aac fdk-aac/aacenc_lib.h aacEncOpen -lfdk-aac
  3018. enabled libfreetype && require_pkg_config freetype2 "ft2build.h freetype/freetype.h" FT_Init_FreeType
  3019. enabled libgsm && require libgsm gsm/gsm.h gsm_create -lgsm
  3020. enabled libilbc && require libilbc ilbc.h WebRtcIlbcfix_InitDecode -lilbc
  3021. enabled libmodplug && require libmodplug libmodplug/modplug.h ModPlug_Load -lmodplug
  3022. enabled libmp3lame && require "libmp3lame >= 3.98.3" lame/lame.h lame_set_VBR_quality -lmp3lame
  3023. enabled libnut && require libnut libnut.h nut_demuxer_init -lnut
  3024. enabled libopencore_amrnb && require libopencore_amrnb opencore-amrnb/interf_dec.h Decoder_Interface_init -lopencore-amrnb
  3025. enabled libopencore_amrwb && require libopencore_amrwb opencore-amrwb/dec_if.h D_IF_init -lopencore-amrwb
  3026. enabled libopencv && require_pkg_config opencv opencv/cxcore.h cvCreateImageHeader
  3027. enabled libopenjpeg && require libopenjpeg openjpeg.h opj_version -lopenjpeg
  3028. enabled libpulse && require_pkg_config libpulse-simple pulse/simple.h pa_simple_new
  3029. enabled librtmp && require_pkg_config librtmp librtmp/rtmp.h RTMP_Socket
  3030. enabled libschroedinger && require_pkg_config schroedinger-1.0 schroedinger/schro.h schro_init
  3031. enabled libspeex && require libspeex speex/speex.h speex_decoder_init -lspeex
  3032. enabled libstagefright_h264 && require_cpp libstagefright_h264 "binder/ProcessState.h media/stagefright/MetaData.h
  3033. media/stagefright/MediaBufferGroup.h media/stagefright/MediaDebug.h media/stagefright/MediaDefs.h
  3034. media/stagefright/OMXClient.h media/stagefright/OMXCodec.h" android::OMXClient -lstagefright -lmedia -lutils -lbinder -lgnustl_static
  3035. enabled libtheora && require libtheora theora/theoraenc.h th_info_init -ltheoraenc -ltheoradec -logg
  3036. enabled libutvideo && require_cpp utvideo "stdint.h stdlib.h utvideo/utvideo.h utvideo/Codec.h" 'CCodec*' -lutvideo -lstdc++
  3037. enabled libv4l2 && require_pkg_config libv4l2 libv4l2.h v4l2_ioctl
  3038. enabled libvo_aacenc && require libvo_aacenc vo-aacenc/voAAC.h voGetAACEncAPI -lvo-aacenc
  3039. enabled libvo_amrwbenc && require libvo_amrwbenc vo-amrwbenc/enc_if.h E_IF_init -lvo-amrwbenc
  3040. enabled libvorbis && require libvorbis vorbis/vorbisenc.h vorbis_info_init -lvorbisenc -lvorbis -logg
  3041. enabled libvpx && {
  3042. enabled libvpx_decoder && { check_lib2 "vpx/vpx_decoder.h vpx/vp8dx.h" vpx_codec_dec_init_ver -lvpx ||
  3043. die "ERROR: libvpx decoder version must be >=0.9.1"; }
  3044. enabled libvpx_encoder && { check_lib2 "vpx/vpx_encoder.h vpx/vp8cx.h" "vpx_codec_enc_init_ver VP8E_SET_MAX_INTRA_BITRATE_PCT" -lvpx ||
  3045. die "ERROR: libvpx encoder version must be >=0.9.7"; } }
  3046. enabled libx264 && require libx264 x264.h x264_encoder_encode -lx264 &&
  3047. { check_cpp_condition x264.h "X264_BUILD >= 118" ||
  3048. die "ERROR: libx264 version must be >= 0.118."; }
  3049. enabled libxavs && require libxavs xavs.h xavs_encoder_encode -lxavs
  3050. enabled libxvid && require libxvid xvid.h xvid_global -lxvidcore
  3051. enabled openal && { { for al_libs in "${OPENAL_LIBS}" "-lopenal" "-lOpenAL32"; do
  3052. check_lib 'AL/al.h' alGetError "${al_libs}" && break; done } ||
  3053. die "ERROR: openal not found"; } &&
  3054. { check_cpp_condition "AL/al.h" "defined(AL_VERSION_1_1)" ||
  3055. die "ERROR: openal version must be 1.1 or compatible"; }
  3056. enabled openssl && { check_lib openssl/ssl.h SSL_library_init -lssl -lcrypto ||
  3057. check_lib openssl/ssl.h SSL_library_init -lssl32 -leay32 ||
  3058. check_lib openssl/ssl.h SSL_library_init -lssl -lcrypto -lws2_32 -lgdi32 ||
  3059. die "ERROR: openssl not found"; }
  3060. # libdc1394 check
  3061. if enabled libdc1394; then
  3062. { check_lib dc1394/dc1394.h dc1394_new -ldc1394 -lraw1394 &&
  3063. enable libdc1394_2; } ||
  3064. { check_lib libdc1394/dc1394_control.h dc1394_create_handle -ldc1394_control -lraw1394 &&
  3065. enable libdc1394_1; } ||
  3066. die "ERROR: No version of libdc1394 found "
  3067. fi
  3068. SDL_CONFIG="${cross_prefix}sdl-config"
  3069. if check_pkg_config sdl SDL_events.h SDL_PollEvent; then
  3070. check_cpp_condition SDL.h "(SDL_MAJOR_VERSION<<16 | SDL_MINOR_VERSION<<8 | SDL_PATCHLEVEL) >= 0x010201" $sdl_cflags &&
  3071. enable sdl &&
  3072. check_struct SDL.h SDL_VideoInfo current_w $sdl_cflags && enable sdl_video_size
  3073. else
  3074. if "${SDL_CONFIG}" --version > /dev/null 2>&1; then
  3075. sdl_cflags=$("${SDL_CONFIG}" --cflags)
  3076. sdl_libs=$("${SDL_CONFIG}" --libs)
  3077. check_func_headers SDL_version.h SDL_Linked_Version $sdl_cflags $sdl_libs &&
  3078. check_cpp_condition SDL.h "(SDL_MAJOR_VERSION<<16 | SDL_MINOR_VERSION<<8 | SDL_PATCHLEVEL) >= 0x010201" $sdl_cflags &&
  3079. enable sdl &&
  3080. check_struct SDL.h SDL_VideoInfo current_w $sdl_cflags && enable sdl_video_size
  3081. fi
  3082. fi
  3083. enabled sdl && add_cflags $sdl_cflags && add_extralibs $sdl_libs
  3084. texi2html --help 2> /dev/null | grep -q 'init-file' && enable texi2html || disable texi2html
  3085. makeinfo --version > /dev/null 2>&1 && enable makeinfo || disable makeinfo
  3086. pod2man --help > /dev/null 2>&1 && enable pod2man || disable pod2man
  3087. check_header linux/fb.h
  3088. check_header linux/videodev.h
  3089. check_header linux/videodev2.h
  3090. check_struct linux/videodev2.h "struct v4l2_frmivalenum" discrete
  3091. check_header sys/videoio.h
  3092. check_func_headers "windows.h vfw.h" capCreateCaptureWindow "$vfwcap_indev_extralibs"
  3093. # check that WM_CAP_DRIVER_CONNECT is defined to the proper value
  3094. # w32api 3.12 had it defined wrong
  3095. check_cpp_condition vfw.h "WM_CAP_DRIVER_CONNECT > WM_USER" && enable vfwcap_defines
  3096. check_type "dshow.h" IBaseFilter
  3097. # check for ioctl_meteor.h, ioctl_bt848.h and alternatives
  3098. { check_header dev/bktr/ioctl_meteor.h &&
  3099. check_header dev/bktr/ioctl_bt848.h; } ||
  3100. { check_header machine/ioctl_meteor.h &&
  3101. check_header machine/ioctl_bt848.h; } ||
  3102. { check_header dev/video/meteor/ioctl_meteor.h &&
  3103. check_header dev/video/bktr/ioctl_bt848.h; } ||
  3104. check_header dev/ic/bt8xx.h
  3105. check_header sndio.h
  3106. if check_struct sys/soundcard.h audio_buf_info bytes; then
  3107. enable_safe sys/soundcard.h
  3108. else
  3109. check_cc -D__BSD_VISIBLE -D__XSI_VISIBLE <<EOF && add_cppflags -D__BSD_VISIBLE -D__XSI_VISIBLE && enable_safe sys/soundcard.h
  3110. #include <sys/soundcard.h>
  3111. audio_buf_info abc;
  3112. EOF
  3113. fi
  3114. check_header soundcard.h
  3115. enabled_any alsa_indev alsa_outdev && check_lib2 alsa/asoundlib.h snd_pcm_htimestamp -lasound
  3116. enabled jack_indev && check_lib2 jack/jack.h jack_client_open -ljack && check_func sem_timedwait &&
  3117. check_func jack_port_get_latency_range -ljack
  3118. enabled_any sndio_indev sndio_outdev && check_lib2 sndio.h sio_open -lsndio
  3119. enabled libcdio &&
  3120. check_lib2 "cdio/cdda.h cdio/paranoia.h" cdio_cddap_open "-lcdio_paranoia -lcdio_cdda -lcdio"
  3121. enabled x11grab &&
  3122. require X11 X11/Xlib.h XOpenDisplay -lX11 &&
  3123. require Xext X11/extensions/XShm.h XShmCreateImage -lXext &&
  3124. require Xfixes X11/extensions/Xfixes.h XFixesGetCursorImage -lXfixes
  3125. if ! disabled vaapi; then
  3126. check_lib va/va.h vaInitialize -lva && {
  3127. check_cpp_condition va/va_version.h "VA_CHECK_VERSION(0,32,0)" ||
  3128. warn "Please upgrade to VA-API >= 0.32 if you would like full VA-API support.";
  3129. } || disable vaapi
  3130. fi
  3131. if ! disabled vdpau && enabled vdpau_vdpau_h; then
  3132. check_cpp_condition \
  3133. vdpau/vdpau.h "defined VDP_DECODER_PROFILE_MPEG4_PART2_ASP" ||
  3134. { echolog "Please upgrade to libvdpau >= 0.2 if you would like vdpau support." &&
  3135. disable vdpau; }
  3136. fi
  3137. enabled debug && add_cflags -g"$debuglevel" && add_asflags -g"$debuglevel"
  3138. enabled coverage && add_cflags "-fprofile-arcs -ftest-coverage" && add_ldflags "-fprofile-arcs -ftest-coverage"
  3139. 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"
  3140. # add some useful compiler flags if supported
  3141. check_cflags -Wdeclaration-after-statement
  3142. check_cflags -Wall
  3143. check_cflags -Wno-parentheses
  3144. check_cflags -Wno-switch
  3145. check_cflags -Wno-format-zero-length
  3146. check_cflags -Wdisabled-optimization
  3147. check_cflags -Wpointer-arith
  3148. check_cflags -Wredundant-decls
  3149. check_cflags -Wno-pointer-sign
  3150. check_cflags -Wwrite-strings
  3151. check_cflags -Wtype-limits
  3152. check_cflags -Wundef
  3153. check_cflags -Wmissing-prototypes
  3154. check_cflags -Wno-pointer-to-int-cast
  3155. check_cflags -Wstrict-prototypes
  3156. enabled extra_warnings && check_cflags -Winline
  3157. # add some linker flags
  3158. check_ldflags -Wl,--warn-common
  3159. check_ldflags -Wl,-rpath-link=libpostproc:libswresample:libswscale:libavfilter:libavdevice:libavformat:libavcodec:libavutil:libavresample
  3160. test_ldflags -Wl,-Bsymbolic && append SHFLAGS -Wl,-Bsymbolic
  3161. enabled xmm_clobber_test &&
  3162. check_ldflags -Wl,--wrap,avcodec_open2 \
  3163. -Wl,--wrap,avcodec_decode_audio4 \
  3164. -Wl,--wrap,avcodec_decode_video2 \
  3165. -Wl,--wrap,avcodec_decode_subtitle2 \
  3166. -Wl,--wrap,avcodec_encode_audio2 \
  3167. -Wl,--wrap,avcodec_encode_video \
  3168. -Wl,--wrap,avcodec_encode_subtitle \
  3169. -Wl,--wrap,sws_scale ||
  3170. disable xmm_clobber_test
  3171. echo "X{};" > $TMPV
  3172. if test_ldflags -Wl,--version-script,$TMPV; then
  3173. append SHFLAGS '-Wl,--version-script,\$(SUBDIR)lib\$(NAME).ver'
  3174. check_cc <<EOF && enable symver_asm_label
  3175. void ff_foo(void) __asm__ ("av_foo@VERSION");
  3176. void ff_foo(void) { ${inline_asm+__asm__($quotes);} }
  3177. EOF
  3178. check_cc <<EOF && enable symver_gnu_asm
  3179. __asm__(".symver ff_foo,av_foo@VERSION");
  3180. void ff_foo(void) {}
  3181. EOF
  3182. fi
  3183. if [ -n "$optflags" ]; then
  3184. add_cflags $optflags
  3185. elif enabled small; then
  3186. add_cflags $size_cflags
  3187. elif enabled optimizations; then
  3188. add_cflags $speed_cflags
  3189. else
  3190. add_cflags $noopt_cflags
  3191. fi
  3192. check_cflags -fno-math-errno
  3193. check_cflags -fno-signed-zeros
  3194. check_cc -mno-red-zone <<EOF && noredzone_flags="-mno-red-zone"
  3195. int x;
  3196. EOF
  3197. if enabled icc; then
  3198. # Just warnings, no remarks
  3199. check_cflags -w1
  3200. # -wd: Disable following warnings
  3201. # 144, 167, 556: -Wno-pointer-sign
  3202. # 1292: attribute "foo" ignored
  3203. # 1419: external declaration in primary source file
  3204. # 10006: ignoring unknown option -fno-signed-zeros
  3205. # 10148: ignoring unknown option -Wno-parentheses
  3206. # 10156: ignoring option '-W'; no argument required
  3207. check_cflags -wd144,167,556,1292,1419,10006,10148,10156
  3208. # 11030: Warning unknown option --as-needed
  3209. # 10156: ignoring option '-export'; no argument required
  3210. check_ldflags -wd10156,11030
  3211. # Allow to compile with optimizations
  3212. check_ldflags -march=$cpu
  3213. # icc 11.0 and 11.1 work with ebp_available, but don't pass the test
  3214. enable ebp_available
  3215. if enabled x86_32; then
  3216. test ${icc_version%%.*} -ge 11 &&
  3217. check_cflags -falign-stack=maintain-16-byte ||
  3218. disable aligned_stack
  3219. fi
  3220. elif enabled ccc; then
  3221. # disable some annoying warnings
  3222. add_cflags -msg_disable cvtu32to64
  3223. add_cflags -msg_disable embedcomment
  3224. add_cflags -msg_disable needconstext
  3225. add_cflags -msg_disable nomainieee
  3226. add_cflags -msg_disable ptrmismatch1
  3227. add_cflags -msg_disable unreachcode
  3228. elif enabled gcc; then
  3229. check_cflags -fno-tree-vectorize
  3230. check_cflags -Werror=implicit-function-declaration
  3231. check_cflags -Werror=missing-prototypes
  3232. elif enabled llvm_gcc; then
  3233. check_cflags -mllvm -stack-alignment=16
  3234. elif enabled clang; then
  3235. check_cflags -mllvm -stack-alignment=16
  3236. check_cflags -Qunused-arguments
  3237. elif enabled armcc; then
  3238. # 2523: use of inline assembler is deprecated
  3239. add_cflags -W${armcc_opt},--diag_suppress=2523
  3240. add_cflags -W${armcc_opt},--diag_suppress=1207
  3241. add_cflags -W${armcc_opt},--diag_suppress=1293 # assignment in condition
  3242. add_cflags -W${armcc_opt},--diag_suppress=3343 # hardfp compat
  3243. add_cflags -W${armcc_opt},--diag_suppress=167 # pointer sign
  3244. add_cflags -W${armcc_opt},--diag_suppress=513 # pointer sign
  3245. elif enabled tms470; then
  3246. add_cflags -pds=824 -pds=837
  3247. elif enabled pathscale; then
  3248. add_cflags -fstrict-overflow -OPT:wrap_around_unsafe_opt=OFF
  3249. fi
  3250. enabled_any $THREADS_LIST && enable threads
  3251. check_deps $CONFIG_LIST \
  3252. $CONFIG_EXTRA \
  3253. $HAVE_LIST \
  3254. $ALL_COMPONENTS \
  3255. $ALL_TESTS \
  3256. enabled asm || { arch=c; disable $ARCH_LIST $ARCH_EXT_LIST; }
  3257. if test $target_os = "haiku"; then
  3258. disable memalign
  3259. disable posix_memalign
  3260. fi
  3261. ! enabled_any memalign posix_memalign aligned_malloc &&
  3262. enabled_any $need_memalign && enable memalign_hack
  3263. # add_dep lib dep
  3264. # -> enable ${lib}_deps_${dep}
  3265. # -> add $dep to ${lib}_deps only once
  3266. add_dep() {
  3267. lib=$1
  3268. dep=$2
  3269. enabled "${lib}_deps_${dep}" && return 0
  3270. enable "${lib}_deps_${dep}"
  3271. prepend "${lib}_deps" $dep
  3272. }
  3273. # merge deps lib components
  3274. # merge all ${component}_deps into ${lib}_deps and ${lib}_deps_*
  3275. merge_deps() {
  3276. lib=$1
  3277. shift
  3278. for comp in $*; do
  3279. enabled $comp || continue
  3280. eval "dep=\"\$${comp}_deps\""
  3281. for d in $dep; do
  3282. add_dep $lib $d
  3283. done
  3284. done
  3285. }
  3286. merge_deps libavfilter $FILTER_LIST
  3287. echo "install prefix $prefix"
  3288. echo "source path $source_path"
  3289. echo "C compiler $cc"
  3290. echo "ARCH $arch ($cpu)"
  3291. if test "$build_suffix" != ""; then
  3292. echo "build suffix $build_suffix"
  3293. fi
  3294. if test "$progs_suffix" != ""; then
  3295. echo "progs suffix $progs_suffix"
  3296. fi
  3297. if test "$extra_version" != ""; then
  3298. echo "version string suffix $extra_version"
  3299. fi
  3300. echo "big-endian ${bigendian-no}"
  3301. echo "runtime cpu detection ${runtime_cpudetect-no}"
  3302. if enabled x86; then
  3303. echo "${yasmexe} ${yasm-no}"
  3304. echo "MMX enabled ${mmx-no}"
  3305. echo "MMX2 enabled ${mmx2-no}"
  3306. echo "3DNow! enabled ${amd3dnow-no}"
  3307. echo "3DNow! extended enabled ${amd3dnowext-no}"
  3308. echo "SSE enabled ${sse-no}"
  3309. echo "SSSE3 enabled ${ssse3-no}"
  3310. echo "AVX enabled ${avx-no}"
  3311. echo "CMOV enabled ${cmov-no}"
  3312. echo "CMOV is fast ${fast_cmov-no}"
  3313. echo "EBX available ${ebx_available-no}"
  3314. echo "EBP available ${ebp_available-no}"
  3315. fi
  3316. if enabled arm; then
  3317. echo "ARMv5TE enabled ${armv5te-no}"
  3318. echo "ARMv6 enabled ${armv6-no}"
  3319. echo "ARMv6T2 enabled ${armv6t2-no}"
  3320. echo "ARM VFP enabled ${armvfp-no}"
  3321. echo "NEON enabled ${neon-no}"
  3322. fi
  3323. if enabled mips; then
  3324. echo "MMI enabled ${mmi-no}"
  3325. echo "MIPS FPU enabled ${mipsfpu-no}"
  3326. echo "MIPS32R2 enabled ${mips32r2-no}"
  3327. echo "MIPS DSP R1 enabled ${mipsdspr1-no}"
  3328. echo "MIPS DSP R2 enabled ${mipsdspr2-no}"
  3329. fi
  3330. if enabled ppc; then
  3331. echo "AltiVec enabled ${altivec-no}"
  3332. echo "PPC 4xx optimizations ${ppc4xx-no}"
  3333. echo "dcbzl available ${dcbzl-no}"
  3334. fi
  3335. if enabled sparc; then
  3336. echo "VIS enabled ${vis-no}"
  3337. fi
  3338. echo "debug symbols ${debug-no}"
  3339. echo "strip symbols ${stripping-no}"
  3340. echo "optimize for size ${small-no}"
  3341. echo "optimizations ${optimizations-no}"
  3342. echo "static ${static-no}"
  3343. echo "shared ${shared-no}"
  3344. echo "postprocessing support ${postproc-no}"
  3345. echo "new filter support ${avfilter-no}"
  3346. echo "network support ${network-no}"
  3347. echo "threading support ${thread_type-no}"
  3348. echo "safe bitstream reader ${safe_bitstream_reader-no}"
  3349. echo "SDL support ${sdl-no}"
  3350. echo "libdxva2 enabled ${dxva2-no}"
  3351. echo "libva enabled ${vaapi-no}"
  3352. echo "libvdpau enabled ${vdpau-no}"
  3353. echo "AVISynth enabled ${avisynth-no}"
  3354. echo "frei0r enabled ${frei0r-no}"
  3355. echo "gnutls enabled ${gnutls-no}"
  3356. echo "libaacplus enabled ${libaacplus-no}"
  3357. echo "libass enabled ${libass-no}"
  3358. echo "libcdio support ${libcdio-no}"
  3359. echo "libcelt enabled ${libcelt-no}"
  3360. echo "libdc1394 support ${libdc1394-no}"
  3361. echo "libfaac enabled ${libfaac-no}"
  3362. echo "libfdk-aac enabled ${libfdk_aac-no}"
  3363. echo "libgsm enabled ${libgsm-no}"
  3364. echo "libiec61883 support ${libiec61883-no}"
  3365. echo "libilbc enabled ${libilbc-no}"
  3366. echo "libmodplug enabled ${libmodplug-no}"
  3367. echo "libmp3lame enabled ${libmp3lame-no}"
  3368. echo "libnut enabled ${libnut-no}"
  3369. echo "libopencore-amrnb support ${libopencore_amrnb-no}"
  3370. echo "libopencore-amrwb support ${libopencore_amrwb-no}"
  3371. echo "libopencv support ${libopencv-no}"
  3372. echo "libopenjpeg enabled ${libopenjpeg-no}"
  3373. echo "libpulse enabled ${libpulse-no}"
  3374. echo "librtmp enabled ${librtmp-no}"
  3375. echo "libschroedinger enabled ${libschroedinger-no}"
  3376. echo "libspeex enabled ${libspeex-no}"
  3377. echo "libstagefright-h264 enabled ${libstagefright_h264-no}"
  3378. echo "libtheora enabled ${libtheora-no}"
  3379. echo "libutvideo enabled ${libutvideo-no}"
  3380. echo "libv4l2 enabled ${libv4l2-no}"
  3381. echo "libvo-aacenc support ${libvo_aacenc-no}"
  3382. echo "libvo-amrwbenc support ${libvo_amrwbenc-no}"
  3383. echo "libvorbis enabled ${libvorbis-no}"
  3384. echo "libvpx enabled ${libvpx-no}"
  3385. echo "libx264 enabled ${libx264-no}"
  3386. echo "libxavs enabled ${libxavs-no}"
  3387. echo "libxvid enabled ${libxvid-no}"
  3388. echo "openal enabled ${openal-no}"
  3389. echo "openssl enabled ${openssl-no}"
  3390. echo "zlib enabled ${zlib-no}"
  3391. echo "bzlib enabled ${bzlib-no}"
  3392. echo "texi2html enabled ${texi2html-no}"
  3393. echo "pod2man enabled ${pod2man-no}"
  3394. echo "makeinfo enabled ${makeinfo-no}"
  3395. test -n "$random_seed" &&
  3396. echo "random seed ${random_seed}"
  3397. echo
  3398. for type in decoder encoder hwaccel parser demuxer muxer protocol filter bsf indev outdev; do
  3399. echo "Enabled ${type}s:"
  3400. eval list=\$$(toupper $type)_LIST
  3401. print_enabled '_*' $list | sort | pr -r -3 -t
  3402. echo
  3403. done
  3404. license="LGPL version 2.1 or later"
  3405. if enabled nonfree; then
  3406. license="nonfree and unredistributable"
  3407. elif enabled gplv3; then
  3408. license="GPL version 3 or later"
  3409. elif enabled lgplv3; then
  3410. license="LGPL version 3 or later"
  3411. elif enabled gpl; then
  3412. license="GPL version 2 or later"
  3413. fi
  3414. echo "License: $license"
  3415. echo "Creating config.mak and config.h..."
  3416. test -e Makefile || $ln_s "$source_path/Makefile" .
  3417. enabled stripping || strip="echo skipping strip"
  3418. config_files="$TMPH config.mak"
  3419. cat > config.mak <<EOF
  3420. # Automatically generated by configure - do not modify!
  3421. ifndef FFMPEG_CONFIG_MAK
  3422. FFMPEG_CONFIG_MAK=1
  3423. FFMPEG_CONFIGURATION=$FFMPEG_CONFIGURATION
  3424. prefix=$prefix
  3425. LIBDIR=\$(DESTDIR)$libdir
  3426. SHLIBDIR=\$(DESTDIR)$shlibdir
  3427. INCDIR=\$(DESTDIR)$incdir
  3428. BINDIR=\$(DESTDIR)$bindir
  3429. DATADIR=\$(DESTDIR)$datadir
  3430. MANDIR=\$(DESTDIR)$mandir
  3431. SRC_PATH=$source_path
  3432. ifndef MAIN_MAKEFILE
  3433. SRC_PATH:=\$(SRC_PATH:.%=..%)
  3434. endif
  3435. CC_IDENT=$cc_ident
  3436. ARCH=$arch
  3437. CC=$cc
  3438. CXX=$cxx
  3439. AS=$as
  3440. LD=$ld
  3441. DEPCC=$dep_cc
  3442. YASM=$yasmexe
  3443. YASMDEP=$yasmexe
  3444. AR=$ar
  3445. RANLIB=$ranlib
  3446. CP=cp -p
  3447. LN_S=$ln_s
  3448. STRIP=$strip
  3449. CPPFLAGS=$CPPFLAGS
  3450. CFLAGS=$CFLAGS
  3451. CXXFLAGS=$CXXFLAGS
  3452. ASFLAGS=$ASFLAGS
  3453. AS_O=$CC_O
  3454. CC_O=$CC_O
  3455. CXX_O=$CXX_O
  3456. LDFLAGS=$LDFLAGS
  3457. FFSERVERLDFLAGS=$FFSERVERLDFLAGS
  3458. SHFLAGS=$SHFLAGS
  3459. YASMFLAGS=$YASMFLAGS
  3460. BUILDSUF=$build_suffix
  3461. PROGSSUF=$progs_suffix
  3462. FULLNAME=$FULLNAME
  3463. LIBPREF=$LIBPREF
  3464. LIBSUF=$LIBSUF
  3465. LIBNAME=$LIBNAME
  3466. SLIBPREF=$SLIBPREF
  3467. SLIBSUF=$SLIBSUF
  3468. EXESUF=$EXESUF
  3469. EXTRA_VERSION=$extra_version
  3470. DEPFLAGS=$DEPFLAGS
  3471. CCDEP=$CCDEP
  3472. CXXDEP=$CXXDEP
  3473. ASDEP=$ASDEP
  3474. CC_DEPFLAGS=$CC_DEPFLAGS
  3475. AS_DEPFLAGS=$AS_DEPFLAGS
  3476. HOSTCC=$host_cc
  3477. HOSTCFLAGS=$host_cflags
  3478. HOSTEXESUF=$HOSTEXESUF
  3479. HOSTLDFLAGS=$host_ldflags
  3480. HOSTLIBS=$host_libs
  3481. TARGET_EXEC=$target_exec
  3482. TARGET_PATH=$target_path
  3483. SDL_LIBS=$sdl_libs
  3484. SDL_CFLAGS=$sdl_cflags
  3485. LIB_INSTALL_EXTRA_CMD=$LIB_INSTALL_EXTRA_CMD
  3486. EXTRALIBS=$extralibs
  3487. INSTALL=$install
  3488. LIBTARGET=${LIBTARGET}
  3489. SLIBNAME=${SLIBNAME}
  3490. SLIBNAME_WITH_VERSION=${SLIBNAME_WITH_VERSION}
  3491. SLIBNAME_WITH_MAJOR=${SLIBNAME_WITH_MAJOR}
  3492. SLIB_CREATE_DEF_CMD=${SLIB_CREATE_DEF_CMD}
  3493. SLIB_EXTRA_CMD=${SLIB_EXTRA_CMD}
  3494. SLIB_INSTALL_NAME=${SLIB_INSTALL_NAME}
  3495. SLIB_INSTALL_LINKS=${SLIB_INSTALL_LINKS}
  3496. SLIB_INSTALL_EXTRA_LIB=${SLIB_INSTALL_EXTRA_LIB}
  3497. SLIB_INSTALL_EXTRA_SHLIB=${SLIB_INSTALL_EXTRA_SHLIB}
  3498. SAMPLES:=${samples:-\$(FATE_SAMPLES)}
  3499. NOREDZONE_FLAGS=$noredzone_flags
  3500. EOF
  3501. get_version(){
  3502. lcname=$1
  3503. name=$(toupper $lcname)
  3504. file=$source_path/$lcname/version.h
  3505. eval $(grep "#define ${name}_VERSION_M" "$file" | awk '{ print $2"="$3 }')
  3506. eval ${name}_VERSION=\$${name}_VERSION_MAJOR.\$${name}_VERSION_MINOR.\$${name}_VERSION_MICRO
  3507. eval echo "${lcname}_VERSION=\$${name}_VERSION" >> config.mak
  3508. eval echo "${lcname}_VERSION_MAJOR=\$${name}_VERSION_MAJOR" >> config.mak
  3509. }
  3510. get_version_old(){
  3511. name=$1
  3512. file=$source_path/$2
  3513. # This condition will be removed when we stop supporting old libpostproc versions
  3514. if ! test "$name" = LIBPOSTPROC || test "$postproc_version" = current; then
  3515. eval $(grep "#define ${name}_VERSION_M" "$file" | awk '{ print $2"="$3 }')
  3516. eval ${name}_VERSION=\$${name}_VERSION_MAJOR.\$${name}_VERSION_MINOR.\$${name}_VERSION_MICRO
  3517. fi
  3518. lcname=$(tolower $name)
  3519. eval echo "${lcname}_VERSION=\$${name}_VERSION" >> config.mak
  3520. eval echo "${lcname}_VERSION_MAJOR=\$${name}_VERSION_MAJOR" >> config.mak
  3521. }
  3522. get_version_old LIBPOSTPROC libpostproc/postprocess.h
  3523. get_version_old LIBSWRESAMPLE libswresample/swresample.h
  3524. get_version libavcodec
  3525. get_version libavdevice
  3526. get_version libavfilter
  3527. get_version libavformat
  3528. get_version libavresample
  3529. get_version libavutil
  3530. get_version libswscale
  3531. cat > $TMPH <<EOF
  3532. /* Automatically generated by configure - do not modify! */
  3533. #ifndef FFMPEG_CONFIG_H
  3534. #define FFMPEG_CONFIG_H
  3535. #define FFMPEG_CONFIGURATION "$(c_escape $FFMPEG_CONFIGURATION)"
  3536. #define FFMPEG_LICENSE "$(c_escape $license)"
  3537. #define FFMPEG_DATADIR "$(eval c_escape $datadir)"
  3538. #define AVCONV_DATADIR "$(eval c_escape $datadir)"
  3539. #define CC_TYPE "$cc_type"
  3540. #define CC_VERSION $cc_version
  3541. #define av_restrict $_restrict
  3542. #define EXTERN_PREFIX "${extern_prefix}"
  3543. #define EXTERN_ASM ${extern_prefix}
  3544. #define SLIBSUF "$SLIBSUF"
  3545. EOF
  3546. test -n "$assert_level" &&
  3547. echo "#define ASSERT_LEVEL $assert_level" >>$TMPH
  3548. test -n "$malloc_prefix" &&
  3549. echo "#define MALLOC_PREFIX $malloc_prefix" >>$TMPH
  3550. if enabled yasm; then
  3551. append config_files $TMPASM
  3552. printf '' >$TMPASM
  3553. fi
  3554. print_config ARCH_ "$config_files" $ARCH_LIST
  3555. print_config HAVE_ "$config_files" $HAVE_LIST
  3556. print_config CONFIG_ "$config_files" $CONFIG_LIST \
  3557. $CONFIG_EXTRA \
  3558. $ALL_COMPONENTS \
  3559. cat >>config.mak <<EOF
  3560. LAVF_FATE_TESTS=$(print_enabled -n _test $LAVF_FATE_TESTS)
  3561. LAVF_TESTS=$(print_enabled -n _test $LAVF_TESTS)
  3562. LAVFI_TESTS=$(print_enabled -n _test $LAVFI_TESTS)
  3563. SEEK_TESTS=$(print_enabled -n _test $SEEK_TESTS)
  3564. EOF
  3565. echo "#endif /* FFMPEG_CONFIG_H */" >> $TMPH
  3566. echo "endif # FFMPEG_CONFIG_MAK" >> config.mak
  3567. # Do not overwrite an unchanged config.h to avoid superfluous rebuilds.
  3568. cp_if_changed $TMPH config.h
  3569. touch .config
  3570. enabled yasm && cp_if_changed $TMPASM config.asm
  3571. cat > $TMPH <<EOF
  3572. /* Generated by ffconf */
  3573. #ifndef AVUTIL_AVCONFIG_H
  3574. #define AVUTIL_AVCONFIG_H
  3575. EOF
  3576. test "$postproc_version" != current && cat >> $TMPH <<EOF
  3577. #define LIBPOSTPROC_VERSION_MAJOR $LIBPOSTPROC_VERSION_MAJOR
  3578. #define LIBPOSTPROC_VERSION_MINOR $LIBPOSTPROC_VERSION_MINOR
  3579. #define LIBPOSTPROC_VERSION_MICRO $LIBPOSTPROC_VERSION_MICRO
  3580. EOF
  3581. print_config AV_HAVE_ $TMPH $HAVE_LIST_PUB
  3582. echo "#endif /* AVUTIL_AVCONFIG_H */" >> $TMPH
  3583. cp_if_changed $TMPH libavutil/avconfig.h
  3584. test -n "$WARNINGS" && printf "\n$WARNINGS"
  3585. # build pkg-config files
  3586. pkgconfig_generate(){
  3587. name=$1
  3588. shortname=${name#lib}${build_suffix}
  3589. comment=$2
  3590. version=$3
  3591. libs=$4
  3592. requires=$5
  3593. enabled ${name#lib} || return 0
  3594. mkdir -p $name
  3595. cat <<EOF > $name/$name.pc
  3596. prefix=$prefix
  3597. exec_prefix=\${prefix}
  3598. libdir=$libdir
  3599. includedir=$incdir
  3600. Name: $name
  3601. Description: $comment
  3602. Version: $version
  3603. Requires: $(enabled shared || echo $requires)
  3604. Requires.private: $(enabled shared && echo $requires)
  3605. Conflicts:
  3606. Libs: -L\${libdir} -l${shortname} $(enabled shared || echo $libs)
  3607. Libs.private: $(enabled shared && echo $libs)
  3608. Cflags: -I\${includedir}
  3609. EOF
  3610. mkdir -p doc/examples/pc-uninstalled
  3611. includedir=${source_path}
  3612. [ "$includedir" = . ] && includedir="\${pcfiledir}/../../.."
  3613. cat <<EOF > doc/examples/pc-uninstalled/$name.pc
  3614. prefix=
  3615. exec_prefix=
  3616. libdir=\${pcfiledir}/../../../$name
  3617. includedir=${includedir}
  3618. Name: $name
  3619. Description: $comment
  3620. Version: $version
  3621. Requires: $requires
  3622. Conflicts:
  3623. Libs: -L\${libdir} -l${shortname} $(enabled shared || echo $libs)
  3624. Cflags: -I\${includedir}
  3625. EOF
  3626. }
  3627. libavfilter_pc_deps=""
  3628. enabled libavfilter_deps_avcodec && prepend libavfilter_pc_deps "libavcodec = $LIBAVCODEC_VERSION,"
  3629. enabled libavfilter_deps_avformat && prepend libavfilter_pc_deps "libavformat = $LIBAVFORMAT_VERSION,"
  3630. enabled libavfilter_deps_swscale && prepend libavfilter_pc_deps "libswscale = $LIBSWSCALE_VERSION,"
  3631. enabled libavfilter_deps_swresample && prepend libavfilter_pc_deps "libswresample = $LIBSWRESAMPLE_VERSION,"
  3632. enabled libavfilter_deps_postproc && prepend libavfilter_pc_deps "libpostproc = $LIBPOSTPROC_VERSION,"
  3633. libavfilter_pc_deps=${libavfilter_pc_deps%, }
  3634. libavdevice_pc_deps="libavformat = $LIBAVFORMAT_VERSION"
  3635. enabled lavfi_indev && prepend libavdevice_pc_deps "libavfilter = $LIBAVFILTER_VERSION,"
  3636. pkgconfig_generate libavutil "FFmpeg utility library" "$LIBAVUTIL_VERSION" "$LIBM"
  3637. pkgconfig_generate libavcodec "FFmpeg codec library" "$LIBAVCODEC_VERSION" "$extralibs" "libavutil = $LIBAVUTIL_VERSION"
  3638. pkgconfig_generate libavformat "FFmpeg container format library" "$LIBAVFORMAT_VERSION" "$extralibs" "libavcodec = $LIBAVCODEC_VERSION"
  3639. pkgconfig_generate libavdevice "FFmpeg device handling library" "$LIBAVDEVICE_VERSION" "$extralibs" "$libavdevice_pc_deps"
  3640. pkgconfig_generate libavfilter "FFmpeg video filtering library" "$LIBAVFILTER_VERSION" "$extralibs" "$libavfilter_pc_deps"
  3641. pkgconfig_generate libpostproc "FFmpeg postprocessing library" "$LIBPOSTPROC_VERSION" "" "libavutil = $LIBAVUTIL_VERSION"
  3642. pkgconfig_generate libavresample "Libav audio resampling library" "$LIBAVRESAMPLE_VERSION" "$extralibs"
  3643. pkgconfig_generate libswscale "FFmpeg image rescaling library" "$LIBSWSCALE_VERSION" "$LIBM" "libavutil = $LIBAVUTIL_VERSION"
  3644. pkgconfig_generate libswresample "FFmpeg audio rescaling library" "$LIBSWRESAMPLE_VERSION" "$LIBM" "libavutil = $LIBAVUTIL_VERSION"