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.

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