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.

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