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.

4020 lines
121KB

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