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.

3041 lines
85KB

  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. Standard options:
  55. --help print this message
  56. --logfile=FILE log tests and output to FILE [config.err]
  57. --disable-logging do not log configure debug information
  58. --prefix=PREFIX install in PREFIX [$prefix]
  59. --bindir=DIR install binaries in DIR [PREFIX/bin]
  60. --datadir=DIR install data files in DIR [PREFIX/share/ffmpeg]
  61. --libdir=DIR install libs in DIR [PREFIX/lib]
  62. --shlibdir=DIR install shared libs in DIR [PREFIX/lib]
  63. --incdir=DIR install includes in DIR [PREFIX/include]
  64. --mandir=DIR install man page in DIR [PREFIX/share/man]
  65. Configuration options:
  66. --disable-static do not build static libraries [no]
  67. --enable-shared build shared libraries [no]
  68. --enable-gpl allow use of GPL code, the resulting libs
  69. and binaries will be under GPL [no]
  70. --enable-version3 upgrade (L)GPL to version 3 [no]
  71. --enable-nonfree allow use of nonfree code, the resulting libs
  72. and binaries will be unredistributable [no]
  73. --disable-doc do not build documentation
  74. --disable-ffmpeg disable ffmpeg build
  75. --disable-ffplay disable ffplay build
  76. --disable-ffserver disable ffserver build
  77. --enable-postproc enable GPLed postprocessing support [no]
  78. --enable-avfilter video filter support [no]
  79. --enable-avfilter-lavf video filters dependent on avformat [no]
  80. --enable-beosthreads use BeOS threads [no]
  81. --enable-os2threads use OS/2 threads [no]
  82. --enable-pthreads use pthreads [no]
  83. --enable-w32threads use Win32 threads [no]
  84. --enable-x11grab enable X11 grabbing [no]
  85. --disable-network disable network support [no]
  86. --disable-ipv6 disable IPv6 support [no]
  87. --disable-mpegaudio-hp faster (but less accurate) MPEG audio decoding [no]
  88. --enable-gray enable full grayscale support (slower color)
  89. --disable-swscale-alpha disable alpha channel support in swscale
  90. --disable-fastdiv disable table-based division
  91. --enable-small optimize for size instead of speed
  92. --disable-aandct disable AAN DCT code
  93. --disable-dct disable DCT code
  94. --disable-fft disable FFT code
  95. --disable-golomb disable Golomb code
  96. --disable-lpc disable LPC code
  97. --disable-mdct disable MDCT code
  98. --disable-rdft disable RDFT code
  99. --disable-vaapi disable VAAPI code
  100. --disable-vdpau disable VDPAU code
  101. --disable-dxva2 disable DXVA2 code
  102. --enable-runtime-cpudetect detect cpu capabilities at runtime (bigger binary)
  103. --enable-hardcoded-tables use hardcoded tables instead of runtime generation
  104. --enable-memalign-hack emulate memalign, interferes with memory debuggers
  105. --enable-beos-netserver enable BeOS netserver
  106. --disable-encoder=NAME disable encoder NAME
  107. --enable-encoder=NAME enable encoder NAME
  108. --disable-encoders disable all encoders
  109. --disable-decoder=NAME disable decoder NAME
  110. --enable-decoder=NAME enable decoder NAME
  111. --disable-decoders disable all decoders
  112. --disable-hwaccel=NAME disable hwaccel NAME
  113. --enable-hwaccel=NAME enable hwaccel NAME
  114. --disable-hwaccels disable all hwaccels
  115. --disable-muxer=NAME disable muxer NAME
  116. --enable-muxer=NAME enable muxer NAME
  117. --disable-muxers disable all muxers
  118. --disable-demuxer=NAME disable demuxer NAME
  119. --enable-demuxer=NAME enable demuxer NAME
  120. --disable-demuxers disable all demuxers
  121. --enable-parser=NAME enable parser NAME
  122. --disable-parser=NAME disable parser NAME
  123. --disable-parsers disable all parsers
  124. --enable-bsf=NAME enable bitstream filter NAME
  125. --disable-bsf=NAME disable bitstream filter NAME
  126. --disable-bsfs disable all bitstream filters
  127. --enable-protocol=NAME enable protocol NAME
  128. --disable-protocol=NAME disable protocol NAME
  129. --disable-protocols disable all protocols
  130. --disable-indev=NAME disable input device NAME
  131. --disable-outdev=NAME disable output device NAME
  132. --disable-indevs disable input devices
  133. --disable-outdevs disable output devices
  134. --disable-devices disable all devices
  135. --enable-filter=NAME enable filter NAME
  136. --disable-filter=NAME disable filter NAME
  137. --disable-filters disable all filters
  138. --list-decoders show all available decoders
  139. --list-encoders show all available encoders
  140. --list-hwaccels show all available hardware accelerators
  141. --list-muxers show all available muxers
  142. --list-demuxers show all available demuxers
  143. --list-parsers show all available parsers
  144. --list-protocols show all available protocols
  145. --list-bsfs show all available bitstream filters
  146. --list-indevs show all available input devices
  147. --list-outdevs show all available output devices
  148. --list-filters show all available filters
  149. External library support:
  150. --enable-avisynth enable reading of AVISynth script files [no]
  151. --enable-bzlib enable bzlib [autodetect]
  152. --enable-libopencore-amrnb enable AMR-NB de/encoding via libopencore-amrnb [no]
  153. --enable-libopencore-amrwb enable AMR-WB decoding via libopencore-amrwb [no]
  154. --enable-libdc1394 enable IIDC-1394 grabbing using libdc1394
  155. and libraw1394 [no]
  156. --enable-libdirac enable Dirac support via libdirac [no]
  157. --enable-libfaac enable FAAC support via libfaac [no]
  158. --enable-libfaad enable FAAD support via libfaad [no]
  159. --enable-libfaadbin open libfaad.so.0 at runtime [no]
  160. --enable-libgsm enable GSM support via libgsm [no]
  161. --enable-libmp3lame enable MP3 encoding via libmp3lame [no]
  162. --enable-libnut enable NUT (de)muxing via libnut,
  163. native (de)muxer exists [no]
  164. --enable-libopenjpeg enable JPEG 2000 decoding via OpenJPEG [no]
  165. --enable-libschroedinger enable Dirac support via libschroedinger [no]
  166. --enable-libspeex enable Speex decoding via libspeex [no]
  167. --enable-libtheora enable Theora encoding via libtheora [no]
  168. --enable-libvorbis enable Vorbis encoding via libvorbis,
  169. native implementation exists [no]
  170. --enable-libx264 enable H.264 encoding via x264 [no]
  171. --enable-libxvid enable Xvid encoding via xvidcore,
  172. native MPEG-4/Xvid encoder exists [no]
  173. --enable-mlib enable Sun medialib [no]
  174. --enable-zlib enable zlib [autodetect]
  175. Advanced options (experts only):
  176. --source-path=PATH path to source code [$source_path]
  177. --cross-prefix=PREFIX use PREFIX for compilation tools [$cross_prefix]
  178. --enable-cross-compile assume a cross-compiler is used
  179. --sysroot=PATH root of cross-build tree
  180. --sysinclude=PATH location of cross-build system headers
  181. --target-os=OS compiler targets OS [$target_os]
  182. --target-exec=CMD command to run executables on target
  183. --target-path=DIR path to view of build directory on target
  184. --nm=NM use nm tool
  185. --as=AS use assembler AS [$as_default]
  186. --cc=CC use C compiler CC [$cc_default]
  187. --ld=LD use linker LD
  188. --host-cc=HOSTCC use host C compiler HOSTCC
  189. --host-cflags=HCFLAGS use HCFLAGS when compiling for host
  190. --host-ldflags=HLDFLAGS use HLDFLAGS when linking for host
  191. --host-libs=HLIBS use libs HLIBS when linking for host
  192. --extra-cflags=ECFLAGS add ECFLAGS to CFLAGS [$CFLAGS]
  193. --extra-ldflags=ELDFLAGS add ELDFLAGS to LDFLAGS [$LDFLAGS]
  194. --extra-libs=ELIBS add ELIBS [$ELIBS]
  195. --extra-version=STRING version string suffix []
  196. --build-suffix=SUFFIX library name suffix []
  197. --arch=ARCH select architecture [$arch]
  198. --cpu=CPU select the minimum required CPU (affects
  199. instruction selection, may crash on older CPUs)
  200. --enable-powerpc-perf enable performance report on PPC
  201. (requires enabling PMC)
  202. --disable-asm disable all assembler optimizations
  203. --disable-altivec disable AltiVec optimizations
  204. --disable-amd3dnow disable 3DNow! optimizations
  205. --disable-amd3dnowext disable 3DNow! extended optimizations
  206. --disable-mmx disable MMX optimizations
  207. --disable-mmx2 disable MMX2 optimizations
  208. --disable-sse disable SSE optimizations
  209. --disable-ssse3 disable SSSE3 optimizations
  210. --disable-armv5te disable armv5te optimizations
  211. --disable-armv6 disable armv6 optimizations
  212. --disable-armv6t2 disable armv6t2 optimizations
  213. --disable-armvfp disable ARM VFP optimizations
  214. --disable-iwmmxt disable iwmmxt optimizations
  215. --disable-mmi disable MMI optimizations
  216. --disable-neon disable neon optimizations
  217. --disable-vis disable VIS optimizations
  218. --disable-yasm disable use of yasm assembler
  219. --enable-pic build position-independent code
  220. Developer options (useful when working on FFmpeg itself):
  221. --disable-debug disable debugging symbols
  222. --enable-debug=LEVEL set the debug level [$debuglevel]
  223. --enable-gprof enable profiling with gprof [$gprof]
  224. --disable-optimizations disable compiler optimizations
  225. --enable-extra-warnings enable more compiler warnings
  226. --disable-stripping disable stripping of executables and shared libraries
  227. NOTE: Object files are built at the place where configure is launched.
  228. EOF
  229. exit 0
  230. }
  231. log(){
  232. echo "$@" >> $logfile
  233. }
  234. log_file(){
  235. log BEGIN $1
  236. pr -n -t $1 >> $logfile
  237. log END $1
  238. }
  239. echolog(){
  240. log "$@"
  241. echo "$@"
  242. }
  243. die(){
  244. echolog "$@"
  245. cat <<EOF
  246. If you think configure made a mistake, make sure you are using the latest
  247. version from SVN. If the latest version fails, report the problem to the
  248. ffmpeg-user@mplayerhq.hu mailing list or IRC #ffmpeg on irc.freenode.net.
  249. EOF
  250. if disabled logging; then
  251. cat <<EOF
  252. Rerun configure with logging enabled (do not use --disable-logging), and
  253. include the log this produces with your report.
  254. EOF
  255. else
  256. cat <<EOF
  257. Include the log file "$logfile" produced by configure as this will help
  258. solving the problem.
  259. EOF
  260. fi
  261. exit 1
  262. }
  263. # Avoid locale weirdness, besides we really just want to translate ASCII.
  264. toupper(){
  265. echo "$@" | tr abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ
  266. }
  267. tolower(){
  268. echo "$@" | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz
  269. }
  270. c_escape(){
  271. echo "$*" | sed 's/["\\]/\\\0/g'
  272. }
  273. sh_quote(){
  274. v=$(echo "$1" | sed "s/'/'\\\\''/g")
  275. test "$v" = "${v#*[ |&;<>()$\`\\\"\'*?\[\]#~=%]}" || v="'$v'"
  276. echo "$v"
  277. }
  278. filter(){
  279. pat=$1
  280. shift
  281. for v; do
  282. eval "case $v in $pat) echo $v ;; esac"
  283. done
  284. }
  285. set_all(){
  286. value=$1
  287. shift
  288. for var in $*; do
  289. eval $var=$value
  290. done
  291. }
  292. set_weak(){
  293. value=$1
  294. shift
  295. for var; do
  296. eval : \${$var:=$value}
  297. done
  298. }
  299. pushvar(){
  300. for var in $*; do
  301. eval level=\${${var}_level:=0}
  302. eval ${var}_${level}="\$$var"
  303. eval ${var}_level=$(($level+1))
  304. done
  305. }
  306. popvar(){
  307. for var in $*; do
  308. eval level=\${${var}_level:-0}
  309. test $level = 0 && continue
  310. eval level=$(($level-1))
  311. eval $var="\${${var}_${level}}"
  312. eval ${var}_level=$level
  313. eval unset ${var}_${level}
  314. done
  315. }
  316. enable(){
  317. set_all yes $*
  318. }
  319. disable(){
  320. set_all no $*
  321. }
  322. enable_weak(){
  323. set_weak yes $*
  324. }
  325. disable_weak(){
  326. set_weak no $*
  327. }
  328. enable_safe(){
  329. for var; do
  330. enable $(echo "$var" | sed 's/[^A-Za-z0-9_]/_/g')
  331. done
  332. }
  333. disable_safe(){
  334. for var; do
  335. disable $(echo "$var" | sed 's/[^A-Za-z0-9_]/_/g')
  336. done
  337. }
  338. do_enable_deep(){
  339. for var; do
  340. enabled $var && continue
  341. eval sel="\$${var}_select"
  342. eval sgs="\$${var}_suggest"
  343. pushvar var sgs
  344. enable_deep $sel
  345. popvar sgs
  346. enable_deep_weak $sgs
  347. popvar var
  348. done
  349. }
  350. enable_deep(){
  351. do_enable_deep $*
  352. enable $*
  353. }
  354. enable_deep_weak(){
  355. do_enable_deep $*
  356. enable_weak $*
  357. }
  358. enabled(){
  359. test "${1#!}" = "$1" && op== || op=!=
  360. eval test "x\$${1#!}" $op "xyes"
  361. }
  362. disabled(){
  363. test "${1#!}" = "$1" && op== || op=!=
  364. eval test "x\$${1#!}" $op "xno"
  365. }
  366. enabled_all(){
  367. for opt; do
  368. enabled $opt || return 1
  369. done
  370. }
  371. disabled_all(){
  372. for opt; do
  373. disabled $opt || return 1
  374. done
  375. }
  376. enabled_any(){
  377. for opt; do
  378. enabled $opt && return 0
  379. done
  380. }
  381. disabled_any(){
  382. for opt; do
  383. disabled $opt && return 0
  384. done
  385. return 1
  386. }
  387. set_default(){
  388. for opt; do
  389. eval : \${$opt:=\$${opt}_default}
  390. done
  391. }
  392. is_in(){
  393. value=$1
  394. shift
  395. for var in $*; do
  396. [ $var = $value ] && return 0
  397. done
  398. return 1
  399. }
  400. check_deps(){
  401. for cfg; do
  402. cfg="${cfg#!}"
  403. enabled ${cfg}_checking && die "Circular dependency for $cfg."
  404. disabled ${cfg}_checking && continue
  405. enable ${cfg}_checking
  406. eval dep_all="\$${cfg}_deps"
  407. eval dep_any="\$${cfg}_deps_any"
  408. eval dep_sel="\$${cfg}_select"
  409. eval dep_sgs="\$${cfg}_suggest"
  410. eval dep_ifa="\$${cfg}_if"
  411. eval dep_ifn="\$${cfg}_if_any"
  412. pushvar cfg dep_all dep_any dep_sel dep_sgs dep_ifa dep_ifn
  413. check_deps $dep_all $dep_any $dep_sel $dep_sgs $dep_ifa $dep_ifn
  414. popvar cfg dep_all dep_any dep_sel dep_sgs dep_ifa dep_ifn
  415. [ -n "$dep_ifa" ] && { enabled_all $dep_ifa && enable_weak $cfg; }
  416. [ -n "$dep_ifn" ] && { enabled_any $dep_ifn && enable_weak $cfg; }
  417. enabled_all $dep_all || disable $cfg
  418. enabled_any $dep_any || disable $cfg
  419. disabled_any $dep_sel && disable $cfg
  420. if enabled $cfg; then
  421. eval dep_extralibs="\$${cfg}_extralibs"
  422. test -n "$dep_extralibs" && add_extralibs $dep_extralibs
  423. enable_deep $dep_sel
  424. enable_deep_weak $dep_sgs
  425. fi
  426. disable ${cfg}_checking
  427. done
  428. }
  429. print_config(){
  430. pfx=$1
  431. header=$2
  432. makefile=$3
  433. shift 3
  434. for cfg; do
  435. ucname="$(toupper $cfg)"
  436. if enabled $cfg; then
  437. echo "#define ${pfx}${ucname} 1" >> $header
  438. echo "${pfx}${ucname}=yes" >> $makefile
  439. else
  440. echo "#define ${pfx}${ucname} 0" >> $header
  441. echo "!${pfx}${ucname}=yes" >> $makefile
  442. fi
  443. done
  444. }
  445. flags_saved(){
  446. (: ${SAVE_CFLAGS?}) 2> /dev/null
  447. }
  448. save_flags(){
  449. flags_saved && return
  450. SAVE_CFLAGS="$CFLAGS"
  451. SAVE_LDFLAGS="$LDFLAGS"
  452. SAVE_extralibs="$extralibs"
  453. }
  454. restore_flags(){
  455. flags_saved || return
  456. CFLAGS="$SAVE_CFLAGS"
  457. LDFLAGS="$SAVE_LDFLAGS"
  458. extralibs="$SAVE_extralibs"
  459. unset SAVE_CFLAGS
  460. unset SAVE_LDFLAGS
  461. unset SAVE_extralibs
  462. }
  463. temp_cflags(){
  464. save_flags
  465. CFLAGS="$CFLAGS $*"
  466. }
  467. temp_ldflags(){
  468. save_flags
  469. LDFLAGS="$LDFLAGS $*"
  470. }
  471. temp_extralibs(){
  472. save_flags
  473. extralibs="$extralibs $*"
  474. }
  475. append(){
  476. var=$1
  477. shift
  478. flags_saved && eval "SAVE_$var=\"\$SAVE_$var $*\""
  479. eval "$var=\"\$$var $*\""
  480. }
  481. add_cppflags(){
  482. append CPPFLAGS $($filter_cppflags "$@")
  483. }
  484. add_cflags(){
  485. append CFLAGS $($filter_cflags "$@")
  486. }
  487. add_asflags(){
  488. append ASFLAGS $($filter_asflags "$@")
  489. }
  490. add_ldflags(){
  491. append LDFLAGS "$@"
  492. }
  493. add_extralibs(){
  494. append extralibs "$@"
  495. }
  496. check_cmd(){
  497. log "$@"
  498. "$@" >> $logfile 2>&1
  499. }
  500. check_cc(){
  501. log check_cc "$@"
  502. cat > $TMPC
  503. log_file $TMPC
  504. check_cmd $cc $CPPFLAGS $CFLAGS "$@" -c -o $TMPO $TMPC
  505. }
  506. check_cpp(){
  507. log check_cpp "$@"
  508. cat > $TMPC
  509. log_file $TMPC
  510. check_cmd $cc $CPPFLAGS $CFLAGS "$@" -E -o $TMPO $TMPC
  511. }
  512. check_as(){
  513. log check_as "$@"
  514. cat > $TMPC
  515. log_file $TMPC
  516. check_cmd $as $CPPFLAGS $ASFLAGS "$@" -c -o $TMPO $TMPC
  517. }
  518. check_asm(){
  519. log check_asm "$@"
  520. name="$1"
  521. code="$2"
  522. shift 2
  523. disable $name
  524. check_as "$@" <<EOF && enable $name
  525. void foo(void){ __asm__ volatile($code); }
  526. EOF
  527. }
  528. check_yasm(){
  529. log check_yasm "$@"
  530. echo "$1" > $TMPS
  531. log_file $TMPS
  532. shift 1
  533. check_cmd $yasmexe $YASMFLAGS "$@" -o $TMPO $TMPS
  534. }
  535. check_ld(){
  536. log check_ld "$@"
  537. flags=''
  538. libs=''
  539. for f; do
  540. test "${f}" = "${f#-l}" && flags="$flags $f" || libs="$libs $f"
  541. done
  542. check_cc $($filter_cflags $flags) || return
  543. check_cmd $ld $LDFLAGS $flags -o $TMPE $TMPO $extralibs $libs
  544. }
  545. check_cppflags(){
  546. log check_cppflags "$@"
  547. set -- $($filter_cppflags "$@")
  548. check_cc "$@" <<EOF && append CPPFLAGS "$@"
  549. int x;
  550. EOF
  551. }
  552. check_cflags(){
  553. log check_cflags "$@"
  554. set -- $($filter_cflags "$@")
  555. check_cc "$@" <<EOF && append CFLAGS "$@"
  556. int x;
  557. EOF
  558. }
  559. test_ldflags(){
  560. log test_ldflags "$@"
  561. check_ld "$@" <<EOF
  562. int main(void){ return 0; }
  563. EOF
  564. }
  565. check_ldflags(){
  566. log check_ldflags "$@"
  567. test_ldflags "$@" && add_ldflags "$@"
  568. }
  569. check_header(){
  570. log check_header "$@"
  571. header=$1
  572. shift
  573. disable_safe $header
  574. check_cpp "$@" <<EOF && enable_safe $header
  575. #include <$header>
  576. int x;
  577. EOF
  578. }
  579. check_func(){
  580. log check_func "$@"
  581. func=$1
  582. shift
  583. disable $func
  584. check_ld "$@" <<EOF && enable $func
  585. extern int $func();
  586. int main(void){ $func(); }
  587. EOF
  588. }
  589. check_func_headers(){
  590. log check_func_headers "$@"
  591. headers=$1
  592. func=$2
  593. shift 2
  594. disable $func
  595. incs=""
  596. for hdr in $headers; do
  597. incs="$incs
  598. #include <$hdr>"
  599. done
  600. check_ld "$@" <<EOF && enable $func && enable_safe $headers
  601. $incs
  602. int main(int argc, char **argv){
  603. return (long) $func;
  604. }
  605. EOF
  606. }
  607. check_cpp_condition(){
  608. log check_cpp_condition "$@"
  609. header=$1
  610. condition=$2
  611. shift 2
  612. check_cpp $($filter_cppflags "$@") <<EOF
  613. #include <$header>
  614. #if !($condition)
  615. #error "unsatisfied condition: $condition"
  616. #endif
  617. EOF
  618. }
  619. check_lib(){
  620. log check_lib "$@"
  621. header="$1"
  622. func="$2"
  623. shift 2
  624. temp_extralibs "$@"
  625. check_header $header && check_func $func && add_extralibs "$@"
  626. err=$?
  627. restore_flags
  628. return $err
  629. }
  630. check_lib2(){
  631. log check_lib2 "$@"
  632. headers="$1"
  633. func="$2"
  634. shift 2
  635. check_func_headers "$headers" $func "$@" && add_extralibs "$@"
  636. }
  637. check_exec(){
  638. check_ld "$@" && { enabled cross_compile || $TMPE >> $logfile 2>&1; }
  639. }
  640. check_exec_crash(){
  641. code=$(cat)
  642. # exit() is not async signal safe. _Exit (C99) and _exit (POSIX)
  643. # are safe but may not be available everywhere. Thus we use
  644. # raise(SIGTERM) instead. The check is run in a subshell so we
  645. # can redirect the "Terminated" message from the shell. SIGBUS
  646. # is not defined by standard C so it is used conditionally.
  647. (check_exec "$@") >> $logfile 2>&1 <<EOF
  648. #include <signal.h>
  649. static void sighandler(int sig){
  650. raise(SIGTERM);
  651. }
  652. int main(void){
  653. signal(SIGILL, sighandler);
  654. signal(SIGFPE, sighandler);
  655. signal(SIGSEGV, sighandler);
  656. #ifdef SIGBUS
  657. signal(SIGBUS, sighandler);
  658. #endif
  659. { $code }
  660. }
  661. EOF
  662. }
  663. check_type(){
  664. log check_type "$@"
  665. headers=$1
  666. type=$2
  667. shift 2
  668. disable_safe "$type"
  669. incs=""
  670. for hdr in $headers; do
  671. incs="$incs
  672. #include <$hdr>"
  673. done
  674. check_cc "$@" <<EOF && enable_safe "$type"
  675. $incs
  676. $type v;
  677. EOF
  678. }
  679. check_struct(){
  680. log check_type "$@"
  681. headers=$1
  682. struct=$2
  683. member=$3
  684. shift 3
  685. disable_safe "${struct}_${member}"
  686. incs=""
  687. for hdr in $headers; do
  688. incs="$incs
  689. #include <$hdr>"
  690. done
  691. check_cc "$@" <<EOF && enable_safe "${struct}_${member}"
  692. $incs
  693. const void *p = &(($struct *)0)->$member;
  694. EOF
  695. }
  696. require(){
  697. name="$1"
  698. header="$2"
  699. func="$3"
  700. shift 3
  701. check_lib $header $func "$@" || die "ERROR: $name not found"
  702. }
  703. require2(){
  704. name="$1"
  705. headers="$2"
  706. func="$3"
  707. shift 3
  708. check_lib2 "$headers" $func "$@" || die "ERROR: $name not found"
  709. }
  710. check_foo_config(){
  711. cfg=$1
  712. pkg=$2
  713. header=$3
  714. func=$4
  715. shift 4
  716. disable $cfg
  717. check_cmd ${pkg}-config --version
  718. err=$?
  719. if test "$err" = 0; then
  720. temp_cflags $(${pkg}-config --cflags)
  721. temp_extralibs $(${pkg}-config --libs)
  722. check_lib "$@" $header $func && enable $cfg
  723. fi
  724. return $err
  725. }
  726. check_host_cc(){
  727. log check_host_cc "$@"
  728. cat > $TMPC
  729. log_file $TMPC
  730. check_cmd $host_cc $host_cflags "$@" -c -o $TMPO $TMPC
  731. }
  732. check_host_cflags(){
  733. log check_host_cflags "$@"
  734. check_host_cc "$@" <<EOF && append host_cflags "$@"
  735. int x;
  736. EOF
  737. }
  738. apply(){
  739. file=$1
  740. shift
  741. "$@" < "$file" > "$file.tmp" && mv "$file.tmp" "$file" || rm "$file.tmp"
  742. }
  743. cp_if_changed(){
  744. cmp -s "$1" "$2" &&
  745. echo "$2 is unchanged" ||
  746. cp -f "$1" "$2"
  747. }
  748. # CONFIG_LIST contains configurable options, while HAVE_LIST is for
  749. # system-dependent things.
  750. COMPONENT_LIST="
  751. bsfs
  752. decoders
  753. demuxers
  754. encoders
  755. filters
  756. hwaccels
  757. indevs
  758. muxers
  759. outdevs
  760. parsers
  761. protocols
  762. "
  763. CONFIG_LIST="
  764. $COMPONENT_LIST
  765. aandct
  766. avfilter
  767. avfilter_lavf
  768. avisynth
  769. beos_netserver
  770. bzlib
  771. dct
  772. doc
  773. dxva2
  774. fastdiv
  775. ffmpeg
  776. ffplay
  777. ffserver
  778. fft
  779. golomb
  780. gpl
  781. gprof
  782. gray
  783. hardcoded_tables
  784. ipv6
  785. libdc1394
  786. libdirac
  787. libfaac
  788. libfaad
  789. libfaadbin
  790. libgsm
  791. libmp3lame
  792. libnut
  793. libopencore_amrnb
  794. libopencore_amrwb
  795. libopenjpeg
  796. libschroedinger
  797. libspeex
  798. libtheora
  799. libvorbis
  800. libx264
  801. libxvid
  802. lpc
  803. mdct
  804. memalign_hack
  805. mlib
  806. mpegaudio_hp
  807. network
  808. nonfree
  809. pic
  810. postproc
  811. powerpc_perf
  812. rdft
  813. runtime_cpudetect
  814. shared
  815. small
  816. static
  817. swscale_alpha
  818. vaapi
  819. vdpau
  820. version3
  821. x11grab
  822. zlib
  823. "
  824. THREADS_LIST='
  825. beosthreads
  826. os2threads
  827. pthreads
  828. w32threads
  829. '
  830. ARCH_LIST='
  831. alpha
  832. arm
  833. avr32
  834. avr32_ap
  835. avr32_uc
  836. bfin
  837. ia64
  838. m68k
  839. mips
  840. mips64
  841. parisc
  842. ppc
  843. ppc64
  844. s390
  845. sh4
  846. sparc
  847. sparc64
  848. x86
  849. x86_32
  850. x86_64
  851. '
  852. ARCH_EXT_LIST='
  853. altivec
  854. amd3dnow
  855. amd3dnowext
  856. armv5te
  857. armv6
  858. armv6t2
  859. armvfp
  860. iwmmxt
  861. mmi
  862. mmx
  863. mmx2
  864. neon
  865. ppc4xx
  866. sse
  867. ssse3
  868. vis
  869. '
  870. HAVE_LIST_PUB='
  871. bigendian
  872. '
  873. HAVE_LIST="
  874. $ARCH_EXT_LIST
  875. $HAVE_LIST_PUB
  876. $THREADS_LIST
  877. alsa_asoundlib_h
  878. altivec_h
  879. arpa_inet_h
  880. attribute_packed
  881. bswap
  882. closesocket
  883. cmov
  884. conio_h
  885. dcbzl
  886. dev_bktr_ioctl_bt848_h
  887. dev_bktr_ioctl_meteor_h
  888. dev_ic_bt8xx_h
  889. dev_video_meteor_ioctl_meteor_h
  890. dev_video_bktr_ioctl_bt848_h
  891. dlfcn_h
  892. dlopen
  893. dos_paths
  894. ebp_available
  895. ebx_available
  896. exp2
  897. exp2f
  898. fast_64bit
  899. fast_clz
  900. fast_cmov
  901. fast_unaligned
  902. fork
  903. getaddrinfo
  904. gethrtime
  905. GetProcessTimes
  906. getrusage
  907. inet_aton
  908. inline_asm
  909. isatty
  910. ldbrx
  911. libdc1394_1
  912. libdc1394_2
  913. llrint
  914. log2
  915. log2f
  916. loongson
  917. lrint
  918. lrintf
  919. lzo1x_999_compress
  920. machine_ioctl_bt848_h
  921. machine_ioctl_meteor_h
  922. malloc_h
  923. memalign
  924. mkstemp
  925. pld
  926. posix_memalign
  927. round
  928. roundf
  929. sdl
  930. sdl_video_size
  931. setmode
  932. socklen_t
  933. soundcard_h
  934. poll_h
  935. struct_addrinfo
  936. struct_sockaddr_sa_len
  937. struct_sockaddr_storage
  938. sys_mman_h
  939. sys_resource_h
  940. sys_select_h
  941. sys_soundcard_h
  942. sys_videoio_h
  943. ten_operands
  944. termios_h
  945. threads
  946. truncf
  947. vfp_args
  948. VirtualAlloc
  949. winsock2_h
  950. xform_asm
  951. yasm
  952. "
  953. # options emitted with CONFIG_ prefix but not available on command line
  954. CONFIG_EXTRA="
  955. gplv3
  956. lgplv3
  957. "
  958. CMDLINE_SELECT="
  959. $ARCH_EXT_LIST
  960. $CONFIG_LIST
  961. $THREADS_LIST
  962. asm
  963. cross_compile
  964. debug
  965. extra_warnings
  966. logging
  967. optimizations
  968. stripping
  969. yasm
  970. "
  971. PATHS_LIST='
  972. bindir
  973. datadir
  974. incdir
  975. libdir
  976. mandir
  977. prefix
  978. shlibdir
  979. '
  980. CMDLINE_SET="
  981. $PATHS_LIST
  982. arch
  983. as
  984. build_suffix
  985. cc
  986. cpu
  987. cross_prefix
  988. dep_cc
  989. extra_version
  990. host_cc
  991. host_cflags
  992. host_ldflags
  993. host_libs
  994. host_os
  995. ld
  996. logfile
  997. nm
  998. source_path
  999. sysinclude
  1000. sysroot
  1001. target_exec
  1002. target_os
  1003. target_path
  1004. "
  1005. CMDLINE_APPEND="
  1006. extra_cflags
  1007. "
  1008. # code dependency declarations
  1009. # architecture extensions
  1010. armv5te_deps="arm"
  1011. armv6_deps="arm"
  1012. armv6t2_deps="arm"
  1013. armvfp_deps="arm"
  1014. iwmmxt_deps="arm"
  1015. neon_deps="arm"
  1016. mmi_deps="mips"
  1017. altivec_deps="ppc"
  1018. ppc4xx_deps="ppc"
  1019. vis_deps="sparc"
  1020. x86_64_select="cmov fast_cmov"
  1021. amd3dnow_deps="mmx"
  1022. amd3dnowext_deps="amd3dnow"
  1023. mmx_deps="x86"
  1024. mmx2_deps="mmx"
  1025. sse_deps="mmx"
  1026. ssse3_deps="sse"
  1027. fast_64bit_if_any="alpha ia64 mips64 parisc64 ppc64 sparc64 x86_64"
  1028. fast_clz_if_any="alpha armv5te avr32 mips ppc x86"
  1029. fast_unaligned_if_any="armv6 ppc x86"
  1030. need_memalign="altivec neon sse"
  1031. inline_asm_deps="!tms470"
  1032. # decoders / encoders / hardware accelerators
  1033. aac_decoder_select="fft mdct aac_parser"
  1034. aac_encoder_select="fft mdct"
  1035. ac3_decoder_select="fft mdct ac3_parser"
  1036. alac_encoder_select="lpc"
  1037. atrac3_decoder_select="fft mdct"
  1038. cavs_decoder_select="golomb"
  1039. cook_decoder_select="fft mdct"
  1040. cscd_decoder_suggest="zlib"
  1041. dca_decoder_select="fft mdct"
  1042. dnxhd_encoder_select="aandct"
  1043. dxa_decoder_select="zlib"
  1044. eac3_decoder_select="ac3_decoder"
  1045. eamad_decoder_select="aandct"
  1046. eatgq_decoder_select="aandct"
  1047. eatqi_decoder_select="aandct"
  1048. ffv1_decoder_select="golomb"
  1049. flac_decoder_select="golomb"
  1050. flac_encoder_select="golomb lpc"
  1051. flashsv_decoder_select="zlib"
  1052. flashsv_encoder_select="zlib"
  1053. flv_decoder_select="h263_decoder"
  1054. flv_encoder_select="h263_encoder"
  1055. h261_encoder_select="aandct"
  1056. h263_decoder_select="h263_parser"
  1057. h263_encoder_select="aandct"
  1058. h263_vaapi_hwaccel_deps="va_va_h"
  1059. h263_vaapi_hwaccel_select="vaapi h263_decoder"
  1060. h263i_decoder_select="h263_decoder"
  1061. h263p_encoder_select="h263_encoder"
  1062. h264_decoder_select="golomb"
  1063. h264_dxva2_hwaccel_deps="dxva2api_h"
  1064. h264_dxva2_hwaccel_select="dxva2 h264_decoder"
  1065. h264_vaapi_hwaccel_deps="va_va_h"
  1066. h264_vaapi_hwaccel_select="vaapi"
  1067. h264_vdpau_decoder_deps="vdpau_vdpau_h vdpau_vdpau_x11_h"
  1068. h264_vdpau_decoder_select="vdpau h264_decoder"
  1069. imc_decoder_select="fft mdct"
  1070. jpegls_decoder_select="golomb"
  1071. jpegls_encoder_select="golomb"
  1072. ljpeg_encoder_select="aandct"
  1073. loco_decoder_select="golomb"
  1074. mjpeg_encoder_select="aandct"
  1075. mlp_decoder_select="mlp_parser"
  1076. mpeg1video_encoder_select="aandct"
  1077. mpeg2video_encoder_select="aandct"
  1078. mpeg4_decoder_select="h263_decoder mpeg4video_parser"
  1079. mpeg4_encoder_select="h263_encoder"
  1080. mpeg_vdpau_decoder_deps="vdpau_vdpau_h vdpau_vdpau_x11_h"
  1081. mpeg_vdpau_decoder_select="vdpau mpegvideo_decoder"
  1082. mpeg1_vdpau_decoder_deps="vdpau_vdpau_h vdpau_vdpau_x11_h"
  1083. mpeg1_vdpau_decoder_select="vdpau mpeg1video_decoder"
  1084. mpeg2_vaapi_hwaccel_deps="va_va_h"
  1085. mpeg2_vaapi_hwaccel_select="vaapi mpeg2video_decoder"
  1086. mpeg4_vaapi_hwaccel_deps="va_va_h"
  1087. mpeg4_vaapi_hwaccel_select="vaapi mpeg4_decoder"
  1088. mpeg4_vdpau_decoder_deps="vdpau_vdpau_h vdpau_vdpau_x11_h"
  1089. mpeg4_vdpau_decoder_select="vdpau mpeg4_decoder"
  1090. mpeg_xvmc_decoder_deps="X11_extensions_XvMClib_h"
  1091. mpeg_xvmc_decoder_select="mpegvideo_decoder"
  1092. msmpeg4v1_decoder_select="h263_decoder"
  1093. msmpeg4v1_encoder_select="h263_encoder"
  1094. msmpeg4v2_decoder_select="h263_decoder"
  1095. msmpeg4v2_encoder_select="h263_encoder"
  1096. msmpeg4v3_decoder_select="h263_decoder"
  1097. msmpeg4v3_encoder_select="h263_encoder"
  1098. nellymoser_decoder_select="fft mdct"
  1099. nellymoser_encoder_select="fft mdct"
  1100. png_decoder_select="zlib"
  1101. png_encoder_select="zlib"
  1102. qdm2_decoder_select="fft mdct rdft"
  1103. rv10_decoder_select="h263_decoder"
  1104. rv10_encoder_select="h263_encoder"
  1105. rv20_decoder_select="h263_decoder"
  1106. rv20_encoder_select="h263_encoder"
  1107. rv30_decoder_select="golomb"
  1108. rv40_decoder_select="golomb"
  1109. shorten_decoder_select="golomb"
  1110. sonic_decoder_select="golomb"
  1111. sonic_encoder_select="golomb"
  1112. sonic_ls_encoder_select="golomb"
  1113. svq3_decoder_select="golomb"
  1114. svq3_decoder_suggest="zlib"
  1115. theora_decoder_select="vp3_decoder"
  1116. tiff_decoder_suggest="zlib"
  1117. tiff_encoder_suggest="zlib"
  1118. truehd_decoder_select="mlp_decoder"
  1119. tscc_decoder_select="zlib"
  1120. vc1_decoder_select="h263_decoder"
  1121. vc1_vaapi_hwaccel_deps="va_va_h"
  1122. vc1_vaapi_hwaccel_select="vaapi vc1_decoder"
  1123. vc1_vdpau_decoder_deps="vdpau_vdpau_h vdpau_vdpau_x11_h"
  1124. vc1_vdpau_decoder_select="vdpau vc1_decoder"
  1125. vorbis_decoder_select="fft mdct"
  1126. vorbis_encoder_select="fft mdct"
  1127. vp6a_decoder_select="vp6_decoder"
  1128. vp6f_decoder_select="vp6_decoder"
  1129. wmav1_decoder_select="fft mdct"
  1130. wmav1_encoder_select="fft mdct"
  1131. wmav2_decoder_select="fft mdct"
  1132. wmav2_encoder_select="fft mdct"
  1133. wmv1_decoder_select="h263_decoder"
  1134. wmv1_encoder_select="h263_encoder"
  1135. wmv2_decoder_select="h263_decoder"
  1136. wmv2_encoder_select="h263_encoder"
  1137. wmv3_decoder_select="vc1_decoder"
  1138. wmv3_vaapi_hwaccel_select="vc1_vaapi_hwaccel"
  1139. wmv3_vdpau_decoder_select="vc1_vdpau_decoder"
  1140. zlib_decoder_select="zlib"
  1141. zlib_encoder_select="zlib"
  1142. zmbv_decoder_select="zlib"
  1143. zmbv_encoder_select="zlib"
  1144. # parsers
  1145. h264_parser_select="golomb"
  1146. # bitstream_filters
  1147. aac_adtstoasc_bsf_select="aac_parser"
  1148. # external libraries
  1149. libdirac_decoder_deps="libdirac !libschroedinger"
  1150. libdirac_encoder_deps="libdirac"
  1151. libfaac_encoder_deps="libfaac"
  1152. libfaad_decoder_deps="libfaad"
  1153. libfaadbin_decoder_extralibs='$ldl'
  1154. libgsm_decoder_deps="libgsm"
  1155. libgsm_encoder_deps="libgsm"
  1156. libgsm_ms_decoder_deps="libgsm"
  1157. libgsm_ms_encoder_deps="libgsm"
  1158. libmp3lame_encoder_deps="libmp3lame"
  1159. libopencore_amrnb_decoder_deps="libopencore_amrnb"
  1160. libopencore_amrnb_encoder_deps="libopencore_amrnb"
  1161. libopencore_amrwb_decoder_deps="libopencore_amrwb"
  1162. libopenjpeg_decoder_deps="libopenjpeg"
  1163. libschroedinger_decoder_deps="libschroedinger"
  1164. libschroedinger_encoder_deps="libschroedinger"
  1165. libspeex_decoder_deps="libspeex"
  1166. libtheora_encoder_deps="libtheora"
  1167. libvorbis_encoder_deps="libvorbis"
  1168. libx264_encoder_deps="libx264"
  1169. libxvid_encoder_deps="libxvid"
  1170. # demuxers / muxers
  1171. ac3_demuxer_deps="ac3_parser"
  1172. asf_stream_muxer_select="asf_muxer"
  1173. avisynth_demuxer_deps="avisynth"
  1174. dirac_demuxer_deps="dirac_parser"
  1175. eac3_demuxer_select="ac3_parser"
  1176. ipod_muxer_select="mov_muxer"
  1177. libnut_demuxer_deps="libnut"
  1178. libnut_muxer_deps="libnut"
  1179. matroska_audio_muxer_select="matroska_muxer"
  1180. matroska_demuxer_suggest="zlib bzlib"
  1181. mov_demuxer_suggest="zlib"
  1182. mp3_demuxer_deps="mpegaudio_parser"
  1183. mp4_muxer_select="mov_muxer"
  1184. mpegtsraw_demuxer_select="mpegts_demuxer"
  1185. mxf_d10_muxer_select="mxf_muxer"
  1186. ogg_demuxer_select="golomb"
  1187. psp_muxer_select="mov_muxer"
  1188. rtsp_demuxer_deps="sdp_demuxer"
  1189. sdp_demuxer_deps="rtp_protocol mpegts_demuxer"
  1190. spdif_muxer_select="aac_parser"
  1191. tg2_muxer_select="mov_muxer"
  1192. tgp_muxer_select="mov_muxer"
  1193. w64_demuxer_deps="wav_demuxer"
  1194. # indevs / outdevs
  1195. alsa_indev_deps="alsa_asoundlib_h snd_pcm_htimestamp"
  1196. alsa_indev_extralibs="-lasound"
  1197. alsa_outdev_deps="alsa_asoundlib_h"
  1198. alsa_outdev_extralibs="-lasound"
  1199. audio_beos_indev_deps="audio_beos"
  1200. audio_beos_indev_extralibs="-lmedia -lbe"
  1201. audio_beos_outdev_deps="audio_beos"
  1202. audio_beos_outdev_extralibs="-lmedia -lbe"
  1203. bktr_indev_deps_any="dev_bktr_ioctl_bt848_h machine_ioctl_bt848_h dev_video_bktr_ioctl_bt848_h dev_ic_bt8xx_h"
  1204. dv1394_indev_deps="dv1394 dv_demuxer"
  1205. jack_indev_deps="jack_jack_h"
  1206. jack_indev_extralibs="-ljack"
  1207. libdc1394_indev_deps="libdc1394"
  1208. oss_indev_deps_any="soundcard_h sys_soundcard_h"
  1209. oss_outdev_deps_any="soundcard_h sys_soundcard_h"
  1210. v4l_indev_deps="linux_videodev_h"
  1211. v4l2_indev_deps_any="linux_videodev2_h sys_videoio_h"
  1212. vfwcap_indev_deps="capCreateCaptureWindow"
  1213. vfwcap_indev_extralibs="-lvfw32"
  1214. x11_grab_device_indev_deps="x11grab XShmCreateImage"
  1215. x11_grab_device_indev_extralibs="-lX11 -lXext -lXfixes"
  1216. # protocols
  1217. gopher_protocol_deps="network"
  1218. http_protocol_deps="network"
  1219. rtmp_protocol_deps="tcp_protocol"
  1220. rtp_protocol_deps="udp_protocol"
  1221. tcp_protocol_deps="network"
  1222. udp_protocol_deps="network"
  1223. # filters
  1224. movie_filter_deps="avfilter_lavf"
  1225. # programs
  1226. ffplay_deps="sdl"
  1227. ffserver_deps="ffm_muxer rtp_protocol rtsp_demuxer"
  1228. ffserver_extralibs='$ldl'
  1229. doc_deps="texi2html"
  1230. # default parameters
  1231. logfile="config.err"
  1232. # installation paths
  1233. prefix_default="/usr/local"
  1234. bindir_default='${prefix}/bin'
  1235. datadir_default='${prefix}/share/ffmpeg'
  1236. incdir_default='${prefix}/include'
  1237. libdir_default='${prefix}/lib'
  1238. mandir_default='${prefix}/share/man'
  1239. shlibdir_default="$libdir_default"
  1240. # toolchain
  1241. ar="ar"
  1242. cc_default="gcc"
  1243. cc_version=\"unknown\"
  1244. host_cc_default="gcc"
  1245. ln_s="ln -sf"
  1246. nm_default="nm"
  1247. objformat="elf"
  1248. ranlib="ranlib"
  1249. strip="strip"
  1250. yasmexe="yasm"
  1251. nm_opts='-g'
  1252. # machine
  1253. arch=$(uname -m)
  1254. cpu="generic"
  1255. # OS
  1256. target_os=$(tolower $(uname -s))
  1257. host_os=$target_os
  1258. # configurable options
  1259. enable asm
  1260. enable debug
  1261. enable doc
  1262. enable fastdiv
  1263. enable ffmpeg
  1264. enable ffplay
  1265. enable ffserver
  1266. enable ipv6
  1267. enable mpegaudio_hp
  1268. enable network
  1269. enable optimizations
  1270. enable protocols
  1271. enable static
  1272. enable stripping
  1273. enable swscale_alpha
  1274. # build settings
  1275. SHFLAGS='-shared -Wl,-soname,$$(@F)'
  1276. FFSERVERLDFLAGS=-Wl,-E
  1277. LIBPREF="lib"
  1278. LIBSUF=".a"
  1279. FULLNAME='$(NAME)$(BUILDSUF)'
  1280. LIBNAME='$(LIBPREF)$(FULLNAME)$(LIBSUF)'
  1281. SLIBPREF="lib"
  1282. SLIBSUF=".so"
  1283. SLIBNAME='$(SLIBPREF)$(FULLNAME)$(SLIBSUF)'
  1284. SLIBNAME_WITH_VERSION='$(SLIBNAME).$(LIBVERSION)'
  1285. SLIBNAME_WITH_MAJOR='$(SLIBNAME).$(LIBMAJOR)'
  1286. LIB_INSTALL_EXTRA_CMD='$(RANLIB) "$(LIBDIR)/$(LIBNAME)"'
  1287. CC_O='-o $@'
  1288. host_cflags='-D_ISOC99_SOURCE -D_POSIX_C_SOURCE=200112 -O3 -g -Wall'
  1289. host_libs='-lm'
  1290. target_path='.'
  1291. # gcc stupidly only outputs the basename of targets with -MM, but we need the
  1292. # full relative path for objects in subdirectories for non-recursive Make.
  1293. DEPEND_CMD='$(DEPCC) $(DEPFLAGS) $< | sed -e "/^\#.*/d" -e "s,^[[:space:]]*$(*F)\\.o,$(@D)/$(*F).o," > $(@:.o=.d)'
  1294. DEPFLAGS='$(CPPFLAGS) $(CFLAGS) -MM'
  1295. # find source path
  1296. source_path="$(dirname "$0")"
  1297. enable source_path_used
  1298. if test -f configure; then
  1299. source_path="$(pwd)"
  1300. disable source_path_used
  1301. else
  1302. source_path="$(cd "$source_path"; pwd)"
  1303. echo "$source_path" | grep -q '[[:blank:]]' &&
  1304. die "Out of tree builds are impossible with whitespace in source path."
  1305. test -e "$source_path/config.h" &&
  1306. die "Out of tree builds are impossible with config.h in source dir."
  1307. fi
  1308. for v in "$@"; do
  1309. r=${v#*=}
  1310. l=${v%"$r"}
  1311. r=$(sh_quote "$r")
  1312. FFMPEG_CONFIGURATION="${FFMPEG_CONFIGURATION# } ${l}${r}"
  1313. done
  1314. find_things(){
  1315. thing=$1
  1316. pattern=$2
  1317. file=$source_path/$3
  1318. sed -n "s/^[^#]*$pattern.*([^,]*, *\([^,]*\)\(,.*\)*).*/\1_$thing/p" "$file"
  1319. }
  1320. ENCODER_LIST=$(find_things encoder ENC libavcodec/allcodecs.c)
  1321. DECODER_LIST=$(find_things decoder DEC libavcodec/allcodecs.c)
  1322. HWACCEL_LIST=$(find_things hwaccel HWACCEL libavcodec/allcodecs.c)
  1323. PARSER_LIST=$(find_things parser PARSER libavcodec/allcodecs.c)
  1324. BSF_LIST=$(find_things bsf BSF libavcodec/allcodecs.c)
  1325. MUXER_LIST=$(find_things muxer _MUX libavformat/allformats.c)
  1326. DEMUXER_LIST=$(find_things demuxer DEMUX libavformat/allformats.c)
  1327. OUTDEV_LIST=$(find_things outdev OUTDEV libavdevice/alldevices.c)
  1328. INDEV_LIST=$(find_things indev _IN libavdevice/alldevices.c)
  1329. PROTOCOL_LIST=$(find_things protocol PROTOCOL libavformat/allformats.c)
  1330. FILTER_LIST=$(find_things filter FILTER libavfilter/allfilters.c)
  1331. enable $ARCH_EXT_LIST \
  1332. $DECODER_LIST \
  1333. $ENCODER_LIST \
  1334. $HWACCEL_LIST \
  1335. $PARSER_LIST \
  1336. $BSF_LIST \
  1337. $DEMUXER_LIST \
  1338. $MUXER_LIST \
  1339. $FILTER_LIST \
  1340. $PROTOCOL_LIST \
  1341. $INDEV_LIST \
  1342. $OUTDEV_LIST \
  1343. die_unknown(){
  1344. echo "Unknown option \"$1\"."
  1345. echo "See $0 --help for available options."
  1346. exit 1
  1347. }
  1348. show_list() {
  1349. suffix=_$1
  1350. shift
  1351. echo $* | sed s/$suffix//g | tr ' ' '\n' | sort | pr -3 -t
  1352. exit 0
  1353. }
  1354. for opt do
  1355. optval="${opt#*=}"
  1356. case "$opt" in
  1357. --extra-ldflags=*) add_ldflags $optval
  1358. ;;
  1359. --extra-libs=*) add_extralibs $optval
  1360. ;;
  1361. --disable-devices) disable $INDEV_LIST $OUTDEV_LIST
  1362. ;;
  1363. --enable-debug=*) debuglevel="$optval"
  1364. ;;
  1365. --enable-*=*|--disable-*=*)
  1366. eval $(echo "${opt%%=*}" | sed 's/--/action=/;s/-/ thing=/')
  1367. is_in "${thing}s" $COMPONENT_LIST || die_unknown "$opt"
  1368. eval list=\$$(toupper $thing)_LIST
  1369. name=$(echo "${optval}" | sed "s/,/_${thing}|/g")_${thing}
  1370. $action $(filter "$name" $list)
  1371. ;;
  1372. --enable-?*|--disable-?*)
  1373. eval $(echo "$opt" | sed 's/--/action=/;s/-/ option=/;s/-/_/g')
  1374. if is_in $option $COMPONENT_LIST; then
  1375. test $action = disable && action=unset
  1376. eval $action \$$(toupper ${option%s})_LIST
  1377. elif is_in $option $CMDLINE_SELECT; then
  1378. $action $option
  1379. else
  1380. die_unknown $opt
  1381. fi
  1382. ;;
  1383. --list-*)
  1384. NAME="${opt#--list-}"
  1385. is_in $NAME $COMPONENT_LIST || die_unknown $opt
  1386. NAME=${NAME%s}
  1387. eval show_list $NAME \$$(toupper $NAME)_LIST
  1388. ;;
  1389. --help|-h) show_help
  1390. ;;
  1391. *)
  1392. optname="${opt%%=*}"
  1393. optname="${optname#--}"
  1394. optname=$(echo "$optname" | sed 's/-/_/g')
  1395. if is_in $optname $CMDLINE_SET; then
  1396. eval $optname='$optval'
  1397. elif is_in $optname $CMDLINE_APPEND; then
  1398. append $optname "$optval"
  1399. else
  1400. die_unknown $opt
  1401. fi
  1402. ;;
  1403. esac
  1404. done
  1405. disabled logging && logfile=/dev/null
  1406. echo "# $0 $FFMPEG_CONFIGURATION" > $logfile
  1407. set >> $logfile
  1408. test -n "$cross_prefix" && enable cross_compile
  1409. ar="${cross_prefix}${ar}"
  1410. cc_default="${cross_prefix}${cc_default}"
  1411. nm_default="${cross_prefix}${nm_default}"
  1412. ranlib="${cross_prefix}${ranlib}"
  1413. strip="${cross_prefix}${strip}"
  1414. sysinclude_default="${sysroot}/usr/include"
  1415. set_default cc nm sysinclude
  1416. enabled cross_compile || host_cc_default=$cc
  1417. set_default host_cc
  1418. exesuf() {
  1419. case $1 in
  1420. mingw32*|cygwin*|*-dos|freedos|opendos|os/2*) echo .exe ;;
  1421. esac
  1422. }
  1423. EXESUF=$(exesuf $target_os)
  1424. HOSTEXESUF=$(exesuf $host_os)
  1425. # set temporary file name
  1426. : ${TMPDIR:=$TEMPDIR}
  1427. : ${TMPDIR:=$TMP}
  1428. : ${TMPDIR:=/tmp}
  1429. if ! check_cmd type mktemp; then
  1430. # simple replacement for missing mktemp
  1431. # NOT SAFE FOR GENERAL USE
  1432. mktemp(){
  1433. echo "${2%XXX*}.${HOSTNAME}.${UID}.$$"
  1434. }
  1435. fi
  1436. tmpfile(){
  1437. tmp=$(mktemp -u "${TMPDIR}/ffconf.XXXXXXXX")$2 &&
  1438. (set -C; exec > $tmp) 2>/dev/null ||
  1439. die "Unable to create temporary file in $TMPDIR."
  1440. append TMPFILES $tmp
  1441. eval $1=$tmp
  1442. }
  1443. trap 'rm -f -- $TMPFILES' EXIT
  1444. trap exit HUP INT TERM
  1445. tmpfile TMPC .c
  1446. tmpfile TMPE $EXESUF
  1447. tmpfile TMPH .h
  1448. tmpfile TMPO .o
  1449. tmpfile TMPS .S
  1450. tmpfile TMPV .ver
  1451. tmpfile TMPSH .sh
  1452. unset -f mktemp
  1453. # make sure we can execute files in $TMPDIR
  1454. cat > $TMPSH 2>> $logfile <<EOF
  1455. #! /bin/sh
  1456. EOF
  1457. chmod +x $TMPSH >> $logfile 2>&1
  1458. if ! $TMPSH >> $logfile 2>&1; then
  1459. cat <<EOF
  1460. Unable to create and execute files in $TMPDIR. Set the TMPDIR environment
  1461. variable to another directory and make sure that it is not mounted noexec.
  1462. EOF
  1463. die "Sanity test failed."
  1464. fi
  1465. filter_cflags=echo
  1466. filter_cppflags=echo
  1467. filter_asflags=echo
  1468. if $cc -v 2>&1 | grep -qi ^gcc; then
  1469. cc_type=gcc
  1470. cc_version=__VERSION__
  1471. if ! $cc -dumpversion | grep -q '^2\.'; then
  1472. CC_DEPFLAGS='-MMD -MF $(@:.o=.d) -MT $@'
  1473. AS_DEPFLAGS='-MMD -MF $(@:.o=.d) -MT $@'
  1474. fi
  1475. elif $cc --version 2>/dev/null | grep -q Intel; then
  1476. cc_type=icc
  1477. cc_version="AV_STRINGIFY(__INTEL_COMPILER)"
  1478. CC_DEPFLAGS='-MMD'
  1479. AS_DEPFLAGS='-MMD'
  1480. elif $cc -v 2>&1 | grep -q xlc; then
  1481. cc_type=xlc
  1482. cc_version="AV_STRINGIFY(__IBMC__)"
  1483. elif $cc -V 2>/dev/null | grep -q Compaq; then
  1484. cc_type=ccc
  1485. cc_version="AV_STRINGIFY(__DECC_VER)"
  1486. DEPFLAGS='$(CPPFLAGS) $(CFLAGS) -M'
  1487. debuglevel=3
  1488. add_ldflags -Wl,-z,now # calls to libots crash without this
  1489. elif $cc --vsn 2>/dev/null | grep -q "ARM C/C++ Compiler"; then
  1490. test -d "$sysroot" || die "No valid sysroot specified."
  1491. cc_type=armcc
  1492. cc_version="AV_STRINGIFY(__ARMCC_VERSION)"
  1493. armcc_conf="$PWD/armcc.conf"
  1494. $cc --arm_linux_configure \
  1495. --arm_linux_config_file="$armcc_conf" \
  1496. --configure_sysroot="$sysroot" \
  1497. --configure_cpp_headers="$sysinclude" >>$logfile 2>&1 ||
  1498. die "Error creating armcc configuration file."
  1499. cc="$cc --arm_linux_config_file=$armcc_conf --translate_gcc"
  1500. as_default="${cross_prefix}gcc"
  1501. CC_DEPFLAGS='-MMD'
  1502. AS_DEPFLAGS='-MMD'
  1503. elif $cc -version 2>/dev/null | grep -q TMS470; then
  1504. cc_type=tms470
  1505. cc_version="AV_STRINGIFY(__TI_COMPILER_VERSION__)"
  1506. cc="$cc --gcc --abi=eabi -eo=.o -mc -me"
  1507. CC_O='-fr=$(@D)'
  1508. as_default="${cross_prefix}gcc"
  1509. ld_default="${cross_prefix}gcc"
  1510. TMPO=$(basename $TMPC .c).o
  1511. append TMPFILES $TMPO
  1512. add_cflags -D__gnuc_va_list=va_list -D__USER_LABEL_PREFIX__=
  1513. CC_DEPFLAGS='-ppa -ppd=$(@:.o=.d)'
  1514. AS_DEPFLAGS='-MMD'
  1515. filter_cflags=tms470_flags
  1516. tms470_flags(){
  1517. for flag; do
  1518. case $flag in
  1519. -march=*|-mcpu=*)
  1520. case "${flag#*=}" in
  1521. armv7-a|cortex-a*) echo -mv=7a8 ;;
  1522. armv7-r|cortex-r*) echo -mv=7r4 ;;
  1523. armv7-m|cortex-m*) echo -mv=7m3 ;;
  1524. armv6*|arm11*) echo -mv=6 ;;
  1525. armv5*e|arm[79]*e*|arm9[24]6*|arm96*|arm102[26])
  1526. echo -mv=5e ;;
  1527. armv4*|arm7*|arm9[24]*) echo -mv=4 ;;
  1528. esac
  1529. ;;
  1530. -mfpu=neon) echo --float_support=vfpv3 --neon ;;
  1531. -mfpu=vfp) echo --float_support=vfpv2 ;;
  1532. -mfpu=vfpv3) echo --float_support=vfpv3 ;;
  1533. -msoft-float) echo --float_support=vfplib ;;
  1534. -Os) echo -O3 -mf=2 ;;
  1535. -O[0-3]) echo $flag -mf=5 ;;
  1536. -g) echo -g -mn ;;
  1537. esac
  1538. done
  1539. }
  1540. elif $cc -v 2>&1 | grep -q clang; then
  1541. cc_type=clang
  1542. cc_version=__VERSION__
  1543. CC_DEPFLAGS='-MMD'
  1544. AS_DEPFLAGS='-MMD'
  1545. elif $cc -V 2>&1 | grep -q Sun; then
  1546. cc_type=suncc
  1547. cc_version="AV_STRINGIFY(__SUNPRO_C)"
  1548. DEPEND_CMD='$(DEPCC) $(DEPFLAGS) $< | sed -e "1s,^.*: ,$@: ," -e "\$$!s,\$$, \\\," -e "1!s,^.*: , ," > $(@:.o=.d)'
  1549. DEPFLAGS='$(CPPFLAGS) $(CFLAGS) -xM1'
  1550. filter_cflags=suncc_flags
  1551. suncc_flags(){
  1552. for flag; do
  1553. case $flag in
  1554. -march=*|-mcpu=*)
  1555. case "${flag#*=}" in
  1556. native) echo -xtarget=native ;;
  1557. v9) echo -xarch=sparc ;;
  1558. ultrasparc) echo -xarch=sparcvis ;;
  1559. ultrasparc3|niagara*) echo -xarch=sparcvis2 ;;
  1560. i586|pentium) echo -xchip=pentium ;;
  1561. i686|pentiumpro|pentium2) echo -xtarget=pentium_pro ;;
  1562. pentium3*|c3-2) echo -xtarget=pentium3 ;;
  1563. pentium-m) echo -xarch=sse2 -xchip=pentium3 ;;
  1564. pentium4*) echo -xtarget=pentium4 ;;
  1565. prescott|nocona) echo -xarch=sse3 -xchip=pentium4 ;;
  1566. *-sse3) echo -xarch=sse3 ;;
  1567. core2) echo -xarch=ssse3 -xchip=core2 ;;
  1568. amdfam10|barcelona) echo -xarch=sse4_1 ;;
  1569. athlon-4|athlon-[mx]p) echo -xarch=ssea ;;
  1570. k8|opteron|athlon64|athlon-fx)
  1571. echo -xarch=sse2a ;;
  1572. athlon*) echo -xarch=pentium_proa ;;
  1573. esac
  1574. ;;
  1575. -std=c99) echo -xc99 ;;
  1576. -fomit-frame-pointer) echo -xregs=frameptr ;;
  1577. -fPIC) echo -KPIC -xcode=pic32 ;;
  1578. -Os) echo -O5 -xspace ;;
  1579. -W*,*) echo $flag ;;
  1580. -f*-*|-W*) ;;
  1581. *) echo $flag ;;
  1582. esac
  1583. done
  1584. }
  1585. fi
  1586. test -n "$cc_type" && enable $cc_type || echolog "Unknown C compiler $cc"
  1587. : ${as_default:=$cc}
  1588. : ${dep_cc_default:=$cc}
  1589. : ${ld_default:=$cc}
  1590. set_default as dep_cc ld
  1591. test -n "$CC_DEPFLAGS" || CCDEP=$DEPEND_CMD
  1592. test -n "$AS_DEPFLAGS" || ASDEP=$DEPEND_CMD
  1593. add_cflags $extra_cflags
  1594. add_asflags $extra_cflags
  1595. if test -n "$sysroot"; then
  1596. case "$cc_type" in
  1597. gcc)
  1598. add_cppflags --sysroot="$sysroot"
  1599. add_ldflags --sysroot="$sysroot"
  1600. ;;
  1601. tms470)
  1602. add_cppflags -I"$sysinclude"
  1603. add_ldflags --sysroot="$sysroot"
  1604. ;;
  1605. clang)
  1606. add_cppflags -isysroot="$sysroot"
  1607. add_ldflags -isysroot="$sysroot"
  1608. ;;
  1609. esac
  1610. fi
  1611. if test "$cpu" = host; then
  1612. enabled cross_compile && die "--cpu=host makes no sense when cross-compiling."
  1613. case "$cc_type" in
  1614. gcc)
  1615. check_native(){
  1616. $cc $1=native -v -c -o $TMPO $TMPC >$TMPE 2>&1 || return
  1617. awk "/$1=/{ match(\$0, /$1=(\\w+)/, a);print a[1];exit }" $TMPE
  1618. }
  1619. cpu=$(check_native -march || check_native -mcpu)
  1620. ;;
  1621. esac
  1622. test "${cpu:-host}" = host && die "--cpu=host not supported with compiler $cc"
  1623. fi
  1624. # Deal with common $arch aliases
  1625. case "$arch" in
  1626. arm*)
  1627. arch="arm"
  1628. ;;
  1629. mips|mipsel|IP*)
  1630. arch="mips"
  1631. ;;
  1632. mips64)
  1633. arch="mips"
  1634. subarch="mips64"
  1635. ;;
  1636. parisc|hppa)
  1637. arch="parisc"
  1638. ;;
  1639. parisc64|hppa64)
  1640. arch="parisc"
  1641. subarch="parisc64"
  1642. ;;
  1643. "Power Macintosh"|ppc|powerpc)
  1644. arch="ppc"
  1645. ;;
  1646. ppc64)
  1647. arch="ppc"
  1648. subarch="ppc64"
  1649. ;;
  1650. s390|s390x)
  1651. arch="s390"
  1652. ;;
  1653. sh4|sh)
  1654. arch="sh4"
  1655. ;;
  1656. sun4u|sparc64)
  1657. arch="sparc"
  1658. subarch="sparc64"
  1659. ;;
  1660. i[3-6]86|i86pc|BePC|x86_64|amd64)
  1661. arch="x86"
  1662. ;;
  1663. esac
  1664. is_in $arch $ARCH_LIST || echo "WARNING: unknown arch $arch"
  1665. enable $arch
  1666. # Add processor-specific flags
  1667. if test "$cpu" = generic; then
  1668. : do nothing
  1669. elif enabled ppc; then
  1670. case $cpu in
  1671. 601|ppc601|PowerPC601)
  1672. cpuflags="-mcpu=601"
  1673. ;;
  1674. 603*|ppc603*|PowerPC603*)
  1675. cpuflags="-mcpu=603"
  1676. ;;
  1677. 604*|ppc604*|PowerPC604*)
  1678. cpuflags="-mcpu=604"
  1679. ;;
  1680. G3|g3|75*|ppc75*|PowerPC75*)
  1681. cpuflags="-mcpu=750 -mpowerpc-gfxopt"
  1682. ;;
  1683. G4|g4|745*|ppc745*|PowerPC745*)
  1684. cpuflags="-mcpu=7450 -mpowerpc-gfxopt"
  1685. ;;
  1686. 74*|ppc74*|PowerPC74*)
  1687. cpuflags="-mcpu=7400 -mpowerpc-gfxopt"
  1688. ;;
  1689. G5|g5|970|ppc970|PowerPC970|power4*|Power4*)
  1690. cpuflags="-mcpu=970 -mpowerpc-gfxopt -mpowerpc64"
  1691. ;;
  1692. Cell|CELL|cell)
  1693. cpuflags="-mcpu=cell"
  1694. enable ldbrx
  1695. ;;
  1696. esac
  1697. elif enabled x86; then
  1698. case $cpu in
  1699. i[345]86|pentium)
  1700. cpuflags="-march=$cpu"
  1701. disable mmx
  1702. ;;
  1703. # targets that do NOT support conditional mov (cmov)
  1704. pentium-mmx|k6|k6-[23]|winchip-c6|winchip2|c3)
  1705. cpuflags="-march=$cpu"
  1706. disable cmov
  1707. ;;
  1708. # targets that do support conditional mov (cmov)
  1709. i686|pentiumpro|pentium[23]|pentium-m|athlon|athlon-tbird|athlon-4|athlon-[mx]p|athlon64|k8|opteron|athlon-fx|core2|amdfam10)
  1710. cpuflags="-march=$cpu"
  1711. enable cmov
  1712. enable fast_cmov
  1713. ;;
  1714. # targets that do support conditional mov but on which it's slow
  1715. pentium4|pentium4m|prescott|nocona)
  1716. cpuflags="-march=$cpu"
  1717. enable cmov
  1718. disable fast_cmov
  1719. ;;
  1720. esac
  1721. elif enabled sparc; then
  1722. case $cpu in
  1723. sparc64)
  1724. cpuflags="-mcpu=v9"
  1725. ;;
  1726. esac
  1727. elif enabled arm; then
  1728. case $cpu in
  1729. armv*)
  1730. cpuflags="-march=$cpu"
  1731. ;;
  1732. *)
  1733. cpuflags="-mcpu=$cpu"
  1734. ;;
  1735. esac
  1736. elif enabled alpha; then
  1737. enabled ccc && cpuflags="-arch $cpu" || cpuflags="-mcpu=$cpu"
  1738. elif enabled bfin; then
  1739. cpuflags="-mcpu=$cpu"
  1740. elif enabled mips; then
  1741. cpuflags="-march=$cpu"
  1742. elif enabled avr32; then
  1743. case $cpu in
  1744. ap7[02]0[0-2])
  1745. subarch="avr32_ap"
  1746. cpuflags="-mpart=$cpu"
  1747. ;;
  1748. ap)
  1749. subarch="avr32_ap"
  1750. cpuflags="-march=$cpu"
  1751. ;;
  1752. uc3[ab]*)
  1753. subarch="avr32_uc"
  1754. cpuflags="-mcpu=$cpu"
  1755. ;;
  1756. uc)
  1757. subarch="avr32_uc"
  1758. cpuflags="-march=$cpu"
  1759. ;;
  1760. esac
  1761. fi
  1762. add_cflags $cpuflags
  1763. add_asflags $cpuflags
  1764. # compiler sanity check
  1765. check_exec <<EOF
  1766. int main(void){ return 0; }
  1767. EOF
  1768. if test "$?" != 0; then
  1769. echo "$cc is unable to create an executable file."
  1770. if test -z "$cross_prefix" && ! enabled cross_compile ; then
  1771. echo "If $cc is a cross-compiler, use the --enable-cross-compile option."
  1772. echo "Only do this if you know what cross compiling means."
  1773. fi
  1774. die "C compiler test failed."
  1775. fi
  1776. add_cppflags -D_ISOC99_SOURCE -D_POSIX_C_SOURCE=200112
  1777. check_cflags -std=c99
  1778. check_cc -D_FILE_OFFSET_BITS=64 <<EOF && add_cppflags -D_FILE_OFFSET_BITS=64
  1779. #include <stdlib.h>
  1780. EOF
  1781. check_cc -D_LARGEFILE_SOURCE <<EOF && add_cppflags -D_LARGEFILE_SOURCE
  1782. #include <stdlib.h>
  1783. EOF
  1784. check_host_cflags -std=c99
  1785. case "$arch" in
  1786. alpha|ia64|mips|parisc|sparc)
  1787. spic=$shared
  1788. ;;
  1789. x86)
  1790. subarch="x86_32"
  1791. check_cc <<EOF && subarch="x86_64"
  1792. int test[(int)sizeof(char*) - 7];
  1793. EOF
  1794. if test "$subarch" = "x86_64"; then
  1795. spic=$shared
  1796. fi
  1797. ;;
  1798. esac
  1799. enable $subarch
  1800. enabled spic && enable pic
  1801. check_cpp_condition stdlib.h "defined(__PIC__) || defined(__pic__) || defined(PIC)" && enable pic
  1802. # OS specific
  1803. case $target_os in
  1804. beos|haiku|zeta)
  1805. prefix_default="$HOME/config"
  1806. # 3 gcc releases known for BeOS, each with ugly bugs
  1807. gcc_version="$($cc -v 2>&1 | grep version | cut -d ' ' -f3-)"
  1808. case "$gcc_version" in
  1809. 2.9-beos-991026*|2.9-beos-000224*) echo "R5/GG gcc"
  1810. disable mmx
  1811. ;;
  1812. *20010315*) echo "BeBits gcc"
  1813. add_cflags -fno-expensive-optimizations
  1814. ;;
  1815. esac
  1816. SHFLAGS=-nostart
  1817. # enable BeOS things
  1818. enable audio_beos
  1819. # no need for libm, but the inet stuff
  1820. # Check for BONE
  1821. # XXX: actually should check for NOT net_server
  1822. if echo $BEINCLUDES | grep -q 'headers/be/bone'; then
  1823. network_extralibs="-lbind -lsocket"
  1824. else
  1825. enable beos_netserver
  1826. network_extralibs="-lnet"
  1827. fi ;;
  1828. sunos)
  1829. FFSERVERLDFLAGS=""
  1830. SHFLAGS='-shared -Wl,-h,$$(@F)'
  1831. enabled x86 && SHFLAGS="-mimpure-text $SHFLAGS"
  1832. network_extralibs="-lsocket -lnsl"
  1833. add_cppflags -D__EXTENSIONS__
  1834. nm_opts='-P -g'
  1835. ;;
  1836. netbsd)
  1837. oss_indev_extralibs="-lossaudio"
  1838. oss_outdev_extralibs="-lossaudio"
  1839. ;;
  1840. openbsd)
  1841. enable malloc_aligned
  1842. # On OpenBSD 4.5. the compiler does not use PIC unless
  1843. # explicitly using -fPIC. FFmpeg builds fine without PIC,
  1844. # however the generated executable will not do anything
  1845. # (simply quits with exit-code 1, no crash, no output).
  1846. # Thus explicitly enable PIC here.
  1847. enable pic
  1848. SHFLAGS='-shared'
  1849. oss_indev_extralibs="-lossaudio"
  1850. oss_outdev_extralibs="-lossaudio"
  1851. ;;
  1852. freebsd|dragonfly)
  1853. enable malloc_aligned
  1854. ;;
  1855. bsd/os)
  1856. osextralibs="-lpoll -lgnugetopt"
  1857. strip="strip -d"
  1858. ;;
  1859. darwin)
  1860. enable malloc_aligned
  1861. SHFLAGS='-dynamiclib -Wl,-single_module -Wl,-install_name,$(SHLIBDIR)/$(SLIBNAME),-current_version,$(LIBVERSION),-compatibility_version,$(LIBMAJOR) -Wl,-read_only_relocs,suppress'
  1862. strip="strip -x"
  1863. FFLDFLAGS="-Wl,-dynamic,-search_paths_first"
  1864. SLIBSUF=".dylib"
  1865. SLIBNAME_WITH_VERSION='$(SLIBPREF)$(FULLNAME).$(LIBVERSION)$(SLIBSUF)'
  1866. SLIBNAME_WITH_MAJOR='$(SLIBPREF)$(FULLNAME).$(LIBMAJOR)$(SLIBSUF)'
  1867. FFSERVERLDFLAGS=-Wl,-bind_at_load
  1868. objformat="macho"
  1869. enabled x86_64 && objformat="macho64"
  1870. enabled_any pic shared ||
  1871. { check_cflags -mdynamic-no-pic && add_asflags -mdynamic-no-pic; }
  1872. ;;
  1873. mingw32*)
  1874. # Only WinXP or greater are supported
  1875. add_cflags -D_WIN32_WINNT=0x0501
  1876. if test $target_os = "mingw32ce"; then
  1877. disable network
  1878. else
  1879. target_os=mingw32
  1880. fi
  1881. LIBTARGET=i386
  1882. if enabled x86_64; then
  1883. enable malloc_aligned
  1884. LIBTARGET=x64
  1885. elif enabled arm; then
  1886. LIBTARGET=arm
  1887. fi
  1888. shlibdir_default="$bindir_default"
  1889. disable ffserver
  1890. SLIBPREF=""
  1891. SLIBSUF=".dll"
  1892. SLIBNAME_WITH_VERSION='$(SLIBPREF)$(FULLNAME)-$(LIBVERSION)$(SLIBSUF)'
  1893. SLIBNAME_WITH_MAJOR='$(SLIBPREF)$(FULLNAME)-$(LIBMAJOR)$(SLIBSUF)'
  1894. SLIB_EXTRA_CMD='-lib.exe /machine:$(LIBTARGET) /def:$$(@:$(SLIBSUF)=.def) /out:$(SUBDIR)$(SLIBNAME_WITH_MAJOR:$(SLIBSUF)=.lib)'
  1895. SLIB_INSTALL_EXTRA_CMD='-install -m 644 $(SUBDIR)$(SLIBNAME_WITH_MAJOR:$(SLIBSUF)=.lib) "$(SHLIBDIR)/$(SLIBNAME:$(SLIBSUF)=.lib)"; \
  1896. install -m 644 $(SUBDIR)$(SLIBNAME_WITH_MAJOR:$(SLIBSUF)=.lib) "$(SHLIBDIR)/$(SLIBNAME_WITH_MAJOR:$(SLIBSUF)=.lib)"; \
  1897. install -d "$(LIBDIR)"; \
  1898. install -m 644 $(SUBDIR)lib$(SLIBNAME:$(SLIBSUF)=.dll.a) "$(LIBDIR)/lib$(SLIBNAME:$(SLIBSUF)=.dll.a)"'
  1899. SLIB_UNINSTALL_EXTRA_CMD='rm -f "$(SHLIBDIR)/$(SLIBNAME:$(SLIBSUF)=.lib)"'
  1900. 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'
  1901. objformat="win32"
  1902. enable dos_paths
  1903. check_cflags -fno-common
  1904. if ! enabled x86_64; then
  1905. check_cpp_condition _mingw.h "(__MINGW32_MAJOR_VERSION > 3) || (__MINGW32_MAJOR_VERSION == 3 && __MINGW32_MINOR_VERSION >= 15)" ||
  1906. die "ERROR: MinGW runtime version must be >= 3.15."
  1907. enabled_any avisynth vfwcap_indev &&
  1908. { check_cpp_condition w32api.h "(__W32API_MAJOR_VERSION > 3) || (__W32API_MAJOR_VERSION == 3 && __W32API_MINOR_VERSION >= 13)" ||
  1909. die "ERROR: avisynth and vfwcap_indev require w32api version 3.13 or later."; }
  1910. fi
  1911. ;;
  1912. cygwin*)
  1913. target_os=cygwin
  1914. shlibdir_default="$bindir_default"
  1915. SLIBPREF="cyg"
  1916. SLIBSUF=".dll"
  1917. SLIBNAME_WITH_VERSION='$(SLIBPREF)$(FULLNAME)-$(LIBVERSION)$(SLIBSUF)'
  1918. SLIBNAME_WITH_MAJOR='$(SLIBPREF)$(FULLNAME)-$(LIBMAJOR)$(SLIBSUF)'
  1919. SHFLAGS='-shared -Wl,--enable-auto-image-base'
  1920. objformat="win32"
  1921. enable dos_paths
  1922. check_cflags -fno-common
  1923. ;;
  1924. *-dos|freedos|opendos)
  1925. disable ffplay ffserver
  1926. disable $INDEV_LIST $OUTDEV_LIST
  1927. network_extralibs="-lsocket"
  1928. objformat="coff"
  1929. enable dos_paths
  1930. ;;
  1931. linux)
  1932. enable dv1394
  1933. ;;
  1934. irix*)
  1935. target_os=irix
  1936. ranlib="echo ignoring ranlib"
  1937. ;;
  1938. os/2*)
  1939. strip="lxlite"
  1940. ln_s="cp -f"
  1941. FFLDFLAGS="-Zomf -Zbin-files -Zargs-wild -Zmap"
  1942. SHFLAGS='$(SUBDIR)$(NAME).def -Zdll -Zomf'
  1943. FFSERVERLDFLAGS=""
  1944. LIBSUF="_s.a"
  1945. SLIBPREF=""
  1946. SLIBSUF=".dll"
  1947. SLIBNAME_WITH_VERSION='$(SLIBPREF)$(NAME)-$(LIBVERSION)$(SLIBSUF)'
  1948. SLIBNAME_WITH_MAJOR='$(SLIBPREF)$(shell echo $(NAME) | cut -c1-6)$(LIBMAJOR)$(SLIBSUF)'
  1949. SLIB_CREATE_DEF_CMD='echo LIBRARY $(SLIBNAME_WITH_MAJOR) INITINSTANCE TERMINSTANCE > $(SUBDIR)$(NAME).def; \
  1950. echo PROTMODE >> $(SUBDIR)$(NAME).def; \
  1951. echo CODE PRELOAD MOVEABLE DISCARDABLE >> $(SUBDIR)$(NAME).def; \
  1952. echo DATA PRELOAD MOVEABLE MULTIPLE NONSHARED >> $(SUBDIR)$(NAME).def; \
  1953. echo EXPORTS >> $(SUBDIR)$(NAME).def; \
  1954. emxexp -o $(OBJS) >> $(SUBDIR)$(NAME).def'
  1955. SLIB_EXTRA_CMD='emximp -o $(SUBDIR)$(LIBPREF)$(NAME)_dll.a $(SUBDIR)$(NAME).def; \
  1956. emximp -o $(SUBDIR)$(LIBPREF)$(NAME)_dll.lib $(SUBDIR)$(NAME).def;'
  1957. SLIB_INSTALL_EXTRA_CMD='install -m 644 $(SUBDIR)$(LIBPREF)$(NAME)_dll.a $(SUBDIR)$(LIBPREF)$(NAME)_dll.lib "$(LIBDIR)"'
  1958. SLIB_UNINSTALL_EXTRA_CMD='rm -f "$(LIBDIR)"/$(LIBPREF)$(NAME)_dll.a "$(LIBDIR)"/$(LIBPREF)$(NAME)_dll.lib'
  1959. enable dos_paths
  1960. ;;
  1961. gnu/kfreebsd)
  1962. ;;
  1963. gnu)
  1964. ;;
  1965. *)
  1966. die "Unknown OS '$target_os'."
  1967. ;;
  1968. esac
  1969. set_default $PATHS_LIST
  1970. add_extralibs $osextralibs
  1971. # Combine FFLDFLAGS and the LDFLAGS environment variable.
  1972. LDFLAGS="$FFLDFLAGS $LDFLAGS"
  1973. # we need to build at least one lib type
  1974. if ! enabled_any static shared; then
  1975. cat <<EOF
  1976. At least one library type must be built.
  1977. Specify --enable-static to build the static libraries or --enable-shared to
  1978. build the shared libraries as well. To only build the shared libraries specify
  1979. --disable-static in addition to --enable-shared.
  1980. EOF
  1981. exit 1;
  1982. fi
  1983. disabled static && LIBNAME=""
  1984. if enabled_any libfaad libfaadbin ; then
  1985. if check_header faad.h; then
  1986. check_cc <<EOF
  1987. #include <faad.h>
  1988. #ifndef FAAD2_VERSION
  1989. ok faad1
  1990. #endif
  1991. int main(void) { return 0; }
  1992. EOF
  1993. test $? = 0 && enable libfaad2
  1994. else
  1995. die "FAAD test failed."
  1996. fi
  1997. fi
  1998. die_license_disabled() {
  1999. enabled $1 || { enabled $2 && die "$2 is $1 and --enable-$1 is not specified."; }
  2000. }
  2001. die_license_disabled gpl libfaad2
  2002. die_license_disabled gpl libx264
  2003. die_license_disabled gpl libxvid
  2004. die_license_disabled gpl postproc
  2005. die_license_disabled gpl x11grab
  2006. die_license_disabled nonfree libfaac
  2007. die_license_disabled version3 libopencore_amrnb
  2008. die_license_disabled version3 libopencore_amrwb
  2009. enabled version3 && { enabled gpl && enable gplv3 || enable lgplv3; }
  2010. check_deps $ARCH_EXT_LIST
  2011. disabled optimizations || check_cflags -fomit-frame-pointer
  2012. enable_pic() {
  2013. enable pic
  2014. add_cppflags -DPIC
  2015. add_cflags -fPIC
  2016. add_asflags -fPIC
  2017. }
  2018. enabled pic && enable_pic
  2019. check_cc <<EOF || die "Symbol mangling check failed."
  2020. int ff_extern;
  2021. EOF
  2022. sym=$($nm $nm_opts $TMPO | awk '/ff_extern/{ print substr($0, match($0, /[^ \t]*ff_extern/)) }')
  2023. extern_prefix=${sym%%ff_extern*}
  2024. check_cc <<EOF && enable inline_asm
  2025. void foo(void) { __asm__ volatile ("" ::); }
  2026. EOF
  2027. _restrict=
  2028. for restrict_keyword in restrict __restrict__ __restrict; do
  2029. check_cc <<EOF && _restrict=$restrict_keyword && break
  2030. void foo(char * $restrict_keyword p);
  2031. EOF
  2032. done
  2033. check_cc <<EOF && enable attribute_packed
  2034. struct { int x; } __attribute__((packed)) x;
  2035. EOF
  2036. check_cc <<EOF || die "endian test failed"
  2037. unsigned int endian = 'B' << 24 | 'I' << 16 | 'G' << 8 | 'E';
  2038. EOF
  2039. od -t x1 $TMPO | grep -q '42 *49 *47 *45' && enable bigendian
  2040. if enabled alpha; then
  2041. check_cflags -mieee
  2042. elif enabled arm; then
  2043. check_cflags -marm
  2044. check_ld <<EOF && enable vfp_args
  2045. __asm__ (".eabi_attribute 28, 1");
  2046. int main(void) { return 0; }
  2047. EOF
  2048. # We have to check if pld is a nop and disable it.
  2049. check_asm pld '"pld [r0]"'
  2050. enabled armv5te && check_asm armv5te '"qadd r0, r0, r0"'
  2051. enabled armv6 && check_asm armv6 '"sadd16 r0, r0, r0"'
  2052. enabled armv6t2 && check_asm armv6t2 '"movt r0, #0"'
  2053. enabled armvfp && check_asm armvfp '"fadds s0, s0, s0"'
  2054. enabled iwmmxt && check_asm iwmmxt '"wunpckelub wr6, wr4"'
  2055. enabled neon && check_asm neon '"vadd.i16 q0, q0, q0"'
  2056. enabled_all armv6t2 shared !pic && enable_pic
  2057. elif enabled ia64; then
  2058. # HACK: currently fails to build if .bss is > 4MB and shared libs are built
  2059. enabled shared && enable_weak hardcoded_tables
  2060. elif enabled mips; then
  2061. check_asm loongson '"dmult.g $1, $2, $3"'
  2062. enabled mmi && check_asm mmi '"lq $2, 0($2)"'
  2063. elif enabled ppc; then
  2064. check_asm dcbzl '"dcbzl 0, 1"'
  2065. check_asm ppc4xx '"maclhw r10, r11, r12"'
  2066. check_asm xform_asm '"lwzx %1, %y0" :: "Z"(*(int*)0), "r"(0)'
  2067. # AltiVec flags: The FSF version of GCC differs from the Apple version
  2068. if enabled altivec; then
  2069. check_cflags -maltivec -mabi=altivec &&
  2070. { check_header altivec.h && inc_altivec_h="#include <altivec.h>" ; } ||
  2071. check_cflags -faltivec
  2072. # check if our compiler supports Motorola AltiVec C API
  2073. check_cc <<EOF || disable altivec
  2074. $inc_altivec_h
  2075. int main(void) {
  2076. vector signed int v1, v2, v3;
  2077. v1 = vec_add(v2,v3);
  2078. return 0;
  2079. }
  2080. EOF
  2081. # check if our compiler supports braces for vector declarations
  2082. check_cc <<EOF || die "You need a compiler that supports {} in AltiVec vector declarations."
  2083. $inc_altivec_h
  2084. int main (void) { (vector int) {1}; return 0; }
  2085. EOF
  2086. fi
  2087. elif enabled sparc; then
  2088. enabled vis && check_asm vis '"pdist %f0, %f0, %f0"' -mcpu=ultrasparc &&
  2089. add_cflags -mcpu=ultrasparc -mtune=ultrasparc
  2090. elif enabled x86; then
  2091. # check whether EBP is available on x86
  2092. # As 'i' is stored on the stack, this program will crash
  2093. # if the base pointer is used to access it because the
  2094. # base pointer is cleared in the inline assembly code.
  2095. check_exec_crash <<EOF && enable ebp_available
  2096. volatile int i=0;
  2097. __asm__ volatile (
  2098. "xorl %%ebp, %%ebp"
  2099. ::: "%ebp");
  2100. return i;
  2101. EOF
  2102. # check whether EBX is available on x86
  2103. check_asm ebx_available '""::"b"(0)' &&
  2104. check_asm ebx_available '"":::"%ebx"'
  2105. # check whether more than 10 operands are supported
  2106. check_cc <<EOF && enable ten_operands
  2107. int main(void) {
  2108. int x=0;
  2109. __asm__ volatile(
  2110. ""
  2111. :"+&rm"(x), "+&rm"(x), "+&rm"(x), "+&rm"(x), "+&rm"(x), "+&rm"(x)
  2112. );
  2113. return 0;
  2114. }
  2115. EOF
  2116. # check whether binutils is new enough to compile SSSE3/MMX2
  2117. enabled ssse3 && check_asm ssse3 '"pabsw %xmm0, %xmm0"'
  2118. enabled mmx2 && check_asm mmx2 '"pmaxub %mm0, %mm1"'
  2119. check_asm bswap '"bswap %%eax" ::: "%eax"'
  2120. YASMFLAGS="-f $objformat -DARCH_$(toupper $subarch)"
  2121. enabled x86_64 && append YASMFLAGS "-m amd64"
  2122. enabled pic && append YASMFLAGS "-DPIC"
  2123. test -n "$extern_prefix" && append YASMFLAGS "-DPREFIX"
  2124. case "$objformat" in
  2125. elf) enabled debug && append YASMFLAGS "-g dwarf2" ;;
  2126. esac
  2127. disabled yasm || { check_yasm "pabsw xmm0, xmm0" && enable yasm; }
  2128. case "$cpu" in
  2129. athlon*|opteron*|k8*|pentium|pentium-mmx|prescott|nocona|atom|geode)
  2130. disable fast_clz
  2131. ;;
  2132. esac
  2133. fi
  2134. if check_func dlopen; then
  2135. ldl=
  2136. elif check_func dlopen -ldl; then
  2137. ldl=-ldl
  2138. fi
  2139. # Solaris has nanosleep in -lrt, OpenSolaris no longer needs that
  2140. check_func nanosleep || { check_func nanosleep -lrt && add_extralibs -lrt; }
  2141. check_func fork
  2142. check_func getaddrinfo $network_extralibs
  2143. check_func gethrtime
  2144. check_func getrusage
  2145. check_func inet_aton $network_extralibs
  2146. check_func isatty
  2147. check_func memalign
  2148. check_func mkstemp
  2149. check_func posix_memalign
  2150. check_func_headers io.h setmode
  2151. check_func_headers lzo/lzo1x.h lzo1x_999_compress
  2152. check_func_headers windows.h GetProcessTimes
  2153. check_func_headers windows.h VirtualAlloc
  2154. check_header conio.h
  2155. check_header dlfcn.h
  2156. check_header dxva2api.h
  2157. check_header malloc.h
  2158. check_header poll.h
  2159. check_header sys/mman.h
  2160. check_header sys/resource.h
  2161. check_header sys/select.h
  2162. check_header termios.h
  2163. check_header vdpau/vdpau.h
  2164. check_header vdpau/vdpau_x11.h
  2165. check_header X11/extensions/XvMClib.h
  2166. if ! enabled_any memalign memalign_hack posix_memalign malloc_aligned &&
  2167. enabled_any $need_memalign ; then
  2168. die "Error, no aligned memory allocator but SSE enabled, disable it or use --enable-memalign-hack."
  2169. fi
  2170. disabled zlib || check_lib zlib.h zlibVersion -lz || disable zlib
  2171. disabled bzlib || check_lib2 bzlib.h BZ2_bzlibVersion -lbz2 || disable bzlib
  2172. # check for some common methods of building with pthread support
  2173. # do this before the optional library checks as some of them require pthreads
  2174. if enabled pthreads; then
  2175. if check_func pthread_create; then
  2176. :
  2177. elif check_func pthread_create -pthread; then
  2178. add_cflags -pthread
  2179. add_extralibs -pthread
  2180. elif check_func pthread_create -pthreads; then
  2181. add_cflags -pthreads
  2182. add_extralibs -pthreads
  2183. elif check_func pthread_create -lpthreadGC2; then
  2184. add_extralibs -lpthreadGC2
  2185. elif ! check_lib pthread.h pthread_create -lpthread; then
  2186. die "ERROR: can't find pthreads library"
  2187. fi
  2188. fi
  2189. for thread in $THREADS_LIST; do
  2190. if enabled $thread; then
  2191. test -n "$thread_type" &&
  2192. die "ERROR: Only one thread type must be selected." ||
  2193. thread_type="$thread"
  2194. fi
  2195. done
  2196. check_lib math.h sin -lm
  2197. check_lib va/va.h vaInitialize -lva
  2198. check_func exp2
  2199. check_func exp2f
  2200. check_func llrint
  2201. check_func log2
  2202. check_func log2f
  2203. check_func lrint
  2204. check_func lrintf
  2205. check_func round
  2206. check_func roundf
  2207. check_func truncf
  2208. # these are off by default, so fail if requested and not available
  2209. enabled avisynth && require2 vfw32 "windows.h vfw.h" AVIFileInit -lvfw32
  2210. enabled libdirac && add_cflags $(pkg-config --cflags dirac) &&
  2211. require libdirac libdirac_decoder/dirac_parser.h dirac_decoder_init $(pkg-config --libs dirac) &&
  2212. require libdirac libdirac_encoder/dirac_encoder.h dirac_encoder_init $(pkg-config --libs dirac)
  2213. enabled libfaac && require2 libfaac "stdint.h faac.h" faacEncGetVersion -lfaac
  2214. enabled libfaad && require2 libfaad faad.h faacDecOpen -lfaad
  2215. enabled libgsm && require libgsm gsm.h gsm_create -lgsm
  2216. enabled libmp3lame && require libmp3lame lame/lame.h lame_init -lmp3lame -lm
  2217. enabled libnut && require libnut libnut.h nut_demuxer_init -lnut
  2218. enabled libopencore_amrnb && require libopencore_amrnb opencore-amrnb/interf_dec.h Decoder_Interface_init -lopencore-amrnb -lm
  2219. enabled libopencore_amrwb && require libopencore_amrwb opencore-amrwb/dec_if.h D_IF_init -lopencore-amrwb -lm
  2220. enabled libopenjpeg && require libopenjpeg openjpeg.h opj_version -lopenjpeg
  2221. enabled libschroedinger && add_cflags $(pkg-config --cflags schroedinger-1.0) &&
  2222. require libschroedinger schroedinger/schro.h schro_init $(pkg-config --libs schroedinger-1.0)
  2223. enabled libspeex && require libspeex speex/speex.h speex_decoder_init -lspeex
  2224. enabled libtheora && require libtheora theora/theoraenc.h th_info_init -ltheoraenc -ltheoradec -logg
  2225. enabled libvorbis && require libvorbis vorbis/vorbisenc.h vorbis_info_init -lvorbisenc -lvorbis -logg
  2226. enabled libx264 && require libx264 x264.h x264_encoder_encode -lx264 -lm &&
  2227. { check_cpp_condition x264.h "X264_BUILD >= 83" ||
  2228. die "ERROR: libx264 version must be >= 0.83."; }
  2229. enabled libxvid && require libxvid xvid.h xvid_global -lxvidcore
  2230. enabled mlib && require mediaLib mlib_types.h mlib_VectorSub_S16_U8_Mod -lmlib
  2231. # libdc1394 check
  2232. if enabled libdc1394; then
  2233. { check_lib dc1394/dc1394.h dc1394_new -ldc1394 -lraw1394 &&
  2234. enable libdc1394_2; } ||
  2235. { check_lib libdc1394/dc1394_control.h dc1394_create_handle -ldc1394_control -lraw1394 &&
  2236. enable libdc1394_1; } ||
  2237. die "ERROR: No version of libdc1394 found "
  2238. fi
  2239. SDL_CONFIG="${cross_prefix}sdl-config"
  2240. if "${SDL_CONFIG}" --version > /dev/null 2>&1; then
  2241. sdl_cflags=$("${SDL_CONFIG}" --cflags)
  2242. sdl_libs=$("${SDL_CONFIG}" --libs)
  2243. check_func_headers SDL.h SDL_Init $sdl_cflags $sdl_libs &&
  2244. check_cpp_condition SDL.h "(SDL_MAJOR_VERSION<<16 | SDL_MINOR_VERSION<<8 | SDL_PATCHLEVEL) >= 0x010201" $sdl_cflags &&
  2245. enable sdl &&
  2246. check_struct SDL.h SDL_VideoInfo current_w $sdl_cflags && enable sdl_video_size
  2247. fi
  2248. texi2html -version > /dev/null 2>&1 && enable texi2html || disable texi2html
  2249. if enabled network; then
  2250. check_type "sys/types.h sys/socket.h" socklen_t
  2251. check_type netdb.h "struct addrinfo"
  2252. check_type "sys/types.h sys/socket.h" "struct sockaddr_storage"
  2253. check_struct "sys/types.h sys/socket.h" "struct sockaddr" sa_len
  2254. # Prefer arpa/inet.h over winsock2
  2255. if check_header arpa/inet.h ; then
  2256. check_func closesocket
  2257. elif check_header winsock2.h ; then
  2258. check_func_headers winsock2.h closesocket -lws2 && \
  2259. network_extralibs="-lws2" || \
  2260. { check_func_headers winsock2.h closesocket -lws2_32 && \
  2261. network_extralibs="-lws2_32"; }
  2262. check_type ws2tcpip.h socklen_t
  2263. check_type ws2tcpip.h "struct addrinfo"
  2264. check_type ws2tcpip.h "struct sockaddr_storage"
  2265. check_struct winsock2.h "struct sockaddr" sa_len
  2266. else
  2267. disable network
  2268. fi
  2269. fi
  2270. enabled_all network ipv6 && check_ld <<EOF || disable ipv6
  2271. #include <sys/types.h>
  2272. #include <sys/socket.h>
  2273. #include <netinet/in.h>
  2274. #include <netdb.h>
  2275. int main(void) {
  2276. struct sockaddr_storage saddr;
  2277. struct ipv6_mreq mreq6;
  2278. getaddrinfo(0,0,0,0);
  2279. getnameinfo(0,0,0,0,0,0,0);
  2280. IN6_IS_ADDR_MULTICAST((const struct in6_addr *)0);
  2281. }
  2282. EOF
  2283. check_header linux/videodev.h
  2284. check_header linux/videodev2.h
  2285. check_header sys/videoio.h
  2286. check_func_headers "windows.h vfw.h" capCreateCaptureWindow -lvfw32
  2287. # check for ioctl_meteor.h, ioctl_bt848.h and alternatives
  2288. { check_header dev/bktr/ioctl_meteor.h &&
  2289. check_header dev/bktr/ioctl_bt848.h; } ||
  2290. { check_header machine/ioctl_meteor.h &&
  2291. check_header machine/ioctl_bt848.h; } ||
  2292. { check_header dev/video/meteor/ioctl_meteor.h &&
  2293. check_header dev/video/bktr/ioctl_bt848.h; } ||
  2294. check_header dev/ic/bt8xx.h
  2295. check_header sys/soundcard.h
  2296. check_header soundcard.h
  2297. enabled_any alsa_indev alsa_outdev && check_lib2 alsa/asoundlib.h snd_pcm_htimestamp -lasound
  2298. enabled jack_indev && check_lib2 jack/jack.h jack_client_open -ljack
  2299. enabled x11grab &&
  2300. check_header X11/Xlib.h &&
  2301. check_header X11/extensions/XShm.h &&
  2302. check_header X11/extensions/Xfixes.h &&
  2303. check_func XOpenDisplay -lX11 &&
  2304. check_func XShmCreateImage -lX11 -lXext &&
  2305. check_func XFixesGetCursorImage -lX11 -lXext -lXfixes
  2306. if ! disabled vdpau && enabled vdpau_vdpau_h; then
  2307. check_cpp_condition \
  2308. vdpau/vdpau.h "defined VDP_DECODER_PROFILE_MPEG4_PART2_ASP" ||
  2309. { echolog "Please upgrade to libvdpau >= 0.2 if you would like vdpau support." &&
  2310. disable vdpau; }
  2311. fi
  2312. enabled debug && add_cflags -g"$debuglevel" && add_asflags -g"$debuglevel"
  2313. # add some useful compiler flags if supported
  2314. check_cflags -Wdeclaration-after-statement
  2315. check_cflags -Wall
  2316. check_cflags -Wno-switch
  2317. check_cflags -Wdisabled-optimization
  2318. check_cflags -Wpointer-arith
  2319. check_cflags -Wredundant-decls
  2320. check_cflags -Wno-pointer-sign
  2321. check_cflags -Wcast-qual
  2322. check_cflags -Wwrite-strings
  2323. check_cflags -Wtype-limits
  2324. check_cflags -Wundef
  2325. enabled extra_warnings && check_cflags -Winline
  2326. # add some linker flags
  2327. check_ldflags -Wl,--warn-common
  2328. check_ldflags -Wl,--as-needed
  2329. check_ldflags '-Wl,-rpath-link,\$(BUILD_ROOT)/libpostproc -Wl,-rpath-link,\$(BUILD_ROOT)/libswscale -Wl,-rpath-link,\$(BUILD_ROOT)/libavfilter -Wl,-rpath-link,\$(BUILD_ROOT)/libavdevice -Wl,-rpath-link,\$(BUILD_ROOT)/libavformat -Wl,-rpath-link,\$(BUILD_ROOT)/libavcodec -Wl,-rpath-link,\$(BUILD_ROOT)/libavutil'
  2330. check_ldflags -Wl,-Bsymbolic
  2331. echo "X{};" > $TMPV
  2332. test_ldflags -Wl,--version-script,$TMPV &&
  2333. append SHFLAGS '-Wl,--version-script,\$(SUBDIR)lib\$(NAME).ver'
  2334. if enabled small; then
  2335. check_cflags -Os # not all compilers support -Os
  2336. optimizations="small"
  2337. elif enabled optimizations; then
  2338. if enabled xlc; then
  2339. add_cflags -O5
  2340. add_ldflags -O5
  2341. elif enabled suncc; then
  2342. add_cflags -O5
  2343. elif enabled ccc; then
  2344. add_cflags -fast
  2345. else
  2346. add_cflags -O3
  2347. fi
  2348. fi
  2349. check_cflags -fno-math-errno
  2350. check_cflags -fno-signed-zeros
  2351. if enabled icc; then
  2352. # Just warnings, no remarks
  2353. check_cflags -w1
  2354. # -wd: Disable following warnings
  2355. # 144, 167, 556: -Wno-pointer-sign
  2356. # 10006: ignoring unknown option -fno-signed-zeros
  2357. # 10156: ignoring option '-W'; no argument required
  2358. check_cflags -wd144,167,556,10006,10156
  2359. # 11030: Warning unknown option --as-needed
  2360. # 10156: ignoring option '-export'; no argument required
  2361. check_ldflags -wd10156,11030
  2362. # Allow to compile with optimizations
  2363. check_ldflags -march=$cpu
  2364. # icc 11.0 and 11.1 work with ebp_available, but don't pass the test
  2365. enable ebp_available
  2366. elif enabled ccc; then
  2367. # disable some annoying warnings
  2368. add_cflags -msg_disable cvtu32to64
  2369. add_cflags -msg_disable embedcomment
  2370. add_cflags -msg_disable needconstext
  2371. add_cflags -msg_disable nomainieee
  2372. add_cflags -msg_disable ptrmismatch1
  2373. add_cflags -msg_disable unreachcode
  2374. elif enabled gcc; then
  2375. check_cflags -fno-tree-vectorize
  2376. elif enabled clang; then
  2377. check_cflags -Qunused-arguments
  2378. elif enabled armcc; then
  2379. # 2523: use of inline assembler is deprecated
  2380. add_cflags -Wrvct,--diag_suppress=2523
  2381. fi
  2382. if enabled gprof; then
  2383. add_cflags -p
  2384. add_ldflags -p
  2385. fi
  2386. # Find out if the .align argument is a power of two or not.
  2387. check_asm asmalign_pot '".align 3"'
  2388. enabled_any $DECODER_LIST && enable decoders
  2389. enabled_any $ENCODER_LIST && enable encoders
  2390. enabled_any $HWACCEL_LIST && enable hwaccels
  2391. enabled_any $BSF_LIST && enable bsfs
  2392. enabled_any $DEMUXER_LIST && enable demuxers
  2393. enabled_any $MUXER_LIST && enable muxers
  2394. enabled_any $FILTER_LIST && enable filters
  2395. enabled_any $INDEV_LIST && enable indevs
  2396. enabled_any $OUTDEV_LIST && enable outdevs
  2397. enabled_any $PROTOCOL_LIST && enable protocols
  2398. enabled_any $THREADS_LIST && enable threads
  2399. check_deps $CONFIG_LIST \
  2400. $CONFIG_EXTRA \
  2401. $HAVE_LIST \
  2402. $DECODER_LIST \
  2403. $ENCODER_LIST \
  2404. $HWACCEL_LIST \
  2405. $PARSER_LIST \
  2406. $BSF_LIST \
  2407. $DEMUXER_LIST \
  2408. $MUXER_LIST \
  2409. $FILTER_LIST \
  2410. $INDEV_LIST \
  2411. $OUTDEV_LIST \
  2412. $PROTOCOL_LIST \
  2413. enabled asm || disable $ARCH_LIST $ARCH_EXT_LIST
  2414. echo "install prefix $prefix"
  2415. echo "source path $source_path"
  2416. echo "C compiler $cc"
  2417. echo ".align is power-of-two $asmalign_pot"
  2418. echo "ARCH $arch ($cpu)"
  2419. if test "$build_suffix" != ""; then
  2420. echo "build suffix $build_suffix"
  2421. fi
  2422. if test "$extra_version" != ""; then
  2423. echo "version string suffix $extra_version"
  2424. fi
  2425. echo "big-endian ${bigendian-no}"
  2426. echo "runtime cpu detection ${runtime_cpudetect-no}"
  2427. if enabled x86; then
  2428. echo "yasm ${yasm-no}"
  2429. echo "MMX enabled ${mmx-no}"
  2430. echo "MMX2 enabled ${mmx2-no}"
  2431. echo "3DNow! enabled ${amd3dnow-no}"
  2432. echo "3DNow! extended enabled ${amd3dnowext-no}"
  2433. echo "SSE enabled ${sse-no}"
  2434. echo "SSSE3 enabled ${ssse3-no}"
  2435. echo "CMOV enabled ${cmov-no}"
  2436. echo "CMOV is fast ${fast_cmov-no}"
  2437. echo "EBX available ${ebx_available-no}"
  2438. echo "EBP available ${ebp_available-no}"
  2439. echo "10 operands supported ${ten_operands-no}"
  2440. fi
  2441. if enabled arm; then
  2442. echo "ARMv5TE enabled ${armv5te-no}"
  2443. echo "ARMv6 enabled ${armv6-no}"
  2444. echo "ARMv6T2 enabled ${armv6t2-no}"
  2445. echo "ARM VFP enabled ${armvfp-no}"
  2446. echo "IWMMXT enabled ${iwmmxt-no}"
  2447. echo "NEON enabled ${neon-no}"
  2448. fi
  2449. if enabled mips; then
  2450. echo "MMI enabled ${mmi-no}"
  2451. fi
  2452. if enabled ppc; then
  2453. echo "AltiVec enabled ${altivec-no}"
  2454. echo "PPC 4xx optimizations ${ppc4xx-no}"
  2455. echo "dcbzl available ${dcbzl-no}"
  2456. echo "performance report ${powerpc_perf-no}"
  2457. fi
  2458. if enabled sparc; then
  2459. echo "VIS enabled ${vis-no}"
  2460. fi
  2461. echo "gprof enabled ${gprof-no}"
  2462. echo "debug symbols ${debug-no}"
  2463. echo "strip symbols ${stripping-no}"
  2464. echo "optimizations ${optimizations-no}"
  2465. echo "static ${static-no}"
  2466. echo "shared ${shared-no}"
  2467. echo "postprocessing support ${postproc-no}"
  2468. echo "new filter support ${avfilter-no}"
  2469. echo "filters using lavformat ${avfilter_lavf-no}"
  2470. echo "network support ${network-no}"
  2471. if enabled network; then
  2472. echo "IPv6 support ${ipv6-no}"
  2473. fi
  2474. echo "threading support ${thread_type-no}"
  2475. echo "SDL support ${sdl-no}"
  2476. echo "Sun medialib support ${mlib-no}"
  2477. echo "AVISynth enabled ${avisynth-no}"
  2478. echo "libdc1394 support ${libdc1394-no}"
  2479. echo "libdirac enabled ${libdirac-no}"
  2480. echo "libfaac enabled ${libfaac-no}"
  2481. echo "libfaad enabled ${libfaad-no}"
  2482. echo "libfaad dlopened ${libfaadbin-no}"
  2483. echo "libgsm enabled ${libgsm-no}"
  2484. echo "libmp3lame enabled ${libmp3lame-no}"
  2485. echo "libnut enabled ${libnut-no}"
  2486. echo "libopencore-amrnb support ${libopencore_amrnb-no}"
  2487. echo "libopencore-amrwb support ${libopencore_amrwb-no}"
  2488. echo "libopenjpeg enabled ${libopenjpeg-no}"
  2489. echo "libschroedinger enabled ${libschroedinger-no}"
  2490. echo "libspeex enabled ${libspeex-no}"
  2491. echo "libtheora enabled ${libtheora-no}"
  2492. echo "libvorbis enabled ${libvorbis-no}"
  2493. echo "libx264 enabled ${libx264-no}"
  2494. echo "libxvid enabled ${libxvid-no}"
  2495. echo "zlib enabled ${zlib-no}"
  2496. echo "bzlib enabled ${bzlib-no}"
  2497. echo
  2498. for type in decoder encoder hwaccel parser demuxer muxer protocol filter bsf indev outdev; do
  2499. echo "Enabled ${type}s:"
  2500. eval list=\$$(toupper $type)_LIST
  2501. for part in $list; do
  2502. enabled $part && echo ${part%_*}
  2503. done | sort | pr -3 -t
  2504. echo
  2505. done
  2506. license="LGPL version 2.1 or later"
  2507. if enabled nonfree; then
  2508. license="nonfree and unredistributable"
  2509. elif enabled gplv3; then
  2510. license="GPL version 3 or later"
  2511. elif enabled lgplv3; then
  2512. license="LGPL version 3 or later"
  2513. elif enabled gpl; then
  2514. license="GPL version 2 or later"
  2515. fi
  2516. echo "License: $license"
  2517. echo "Creating config.mak and config.h..."
  2518. # build tree in object directory if source path is different from current one
  2519. if enabled source_path_used; then
  2520. DIRS="
  2521. doc
  2522. libavcodec
  2523. libavcodec/$arch
  2524. libavdevice
  2525. libavfilter
  2526. libavformat
  2527. libavutil
  2528. libavutil/$arch
  2529. libpostproc
  2530. libswscale
  2531. libswscale/$arch
  2532. tests
  2533. tools
  2534. "
  2535. FILES="
  2536. Makefile
  2537. common.mak
  2538. subdir.mak
  2539. doc/texi2pod.pl
  2540. libavcodec/Makefile
  2541. libavdevice/Makefile
  2542. libavfilter/Makefile
  2543. libavformat/Makefile
  2544. libavutil/Makefile
  2545. libpostproc/Makefile
  2546. libswscale/Makefile
  2547. "
  2548. for dir in $DIRS ; do
  2549. mkdir -p $dir
  2550. done
  2551. for f in $FILES ; do
  2552. $ln_s "$source_path/$f" $f
  2553. done
  2554. fi
  2555. enabled stripping || strip="echo skipping strip"
  2556. cat > config.mak <<EOF
  2557. # Automatically generated by configure - do not modify!
  2558. ifndef FFMPEG_CONFIG_MAK
  2559. FFMPEG_CONFIG_MAK=1
  2560. FFMPEG_CONFIGURATION=$FFMPEG_CONFIGURATION
  2561. prefix=$prefix
  2562. LIBDIR=\$(DESTDIR)$libdir
  2563. SHLIBDIR=\$(DESTDIR)$shlibdir
  2564. INCDIR=\$(DESTDIR)$incdir
  2565. BINDIR=\$(DESTDIR)$bindir
  2566. DATADIR=\$(DESTDIR)$datadir
  2567. MANDIR=\$(DESTDIR)$mandir
  2568. SRC_PATH="$source_path"
  2569. SRC_PATH_BARE=$source_path
  2570. BUILD_ROOT="$PWD"
  2571. ARCH=$arch
  2572. CC=$cc
  2573. AS=$as
  2574. LD=$ld
  2575. DEPCC=$dep_cc
  2576. YASM=$yasmexe
  2577. AR=$ar
  2578. RANLIB=$ranlib
  2579. LN_S=$ln_s
  2580. STRIP=$strip
  2581. CPPFLAGS=$CPPFLAGS
  2582. CFLAGS=$CFLAGS
  2583. ASFLAGS=$ASFLAGS
  2584. CC_O=$CC_O
  2585. LDFLAGS=$LDFLAGS
  2586. FFSERVERLDFLAGS=$FFSERVERLDFLAGS
  2587. SHFLAGS=$SHFLAGS
  2588. YASMFLAGS=$YASMFLAGS
  2589. BUILDSUF=$build_suffix
  2590. FULLNAME=$FULLNAME
  2591. LIBPREF=$LIBPREF
  2592. LIBSUF=$LIBSUF
  2593. LIBNAME=$LIBNAME
  2594. SLIBPREF=$SLIBPREF
  2595. SLIBSUF=$SLIBSUF
  2596. EXESUF=$EXESUF
  2597. EXTRA_VERSION=$extra_version
  2598. DEPFLAGS=$DEPFLAGS
  2599. CCDEP=$CCDEP
  2600. ASDEP=$ASDEP
  2601. CC_DEPFLAGS=$CC_DEPFLAGS
  2602. AS_DEPFLAGS=$AS_DEPFLAGS
  2603. HOSTCC=$host_cc
  2604. HOSTCFLAGS=$host_cflags
  2605. HOSTEXESUF=$HOSTEXESUF
  2606. HOSTLDFLAGS=$host_ldflags
  2607. HOSTLIBS=$host_libs
  2608. TARGET_EXEC=$target_exec
  2609. TARGET_PATH=$target_path
  2610. SDL_LIBS=$sdl_libs
  2611. SDL_CFLAGS=$sdl_cflags
  2612. LIB_INSTALL_EXTRA_CMD=$LIB_INSTALL_EXTRA_CMD
  2613. EXTRALIBS=$extralibs
  2614. EOF
  2615. get_version(){
  2616. name=$1
  2617. file=$source_path/$2
  2618. eval $(grep "#define ${name}_VERSION_M" "$file" | awk '{ print $2"="$3 }')
  2619. eval ${name}_VERSION=\$${name}_VERSION_MAJOR.\$${name}_VERSION_MINOR.\$${name}_VERSION_MICRO
  2620. lcname=$(tolower $name)
  2621. eval echo "${lcname}_VERSION=\$${name}_VERSION" >> config.mak
  2622. eval echo "${lcname}_VERSION_MAJOR=\$${name}_VERSION_MAJOR" >> config.mak
  2623. }
  2624. get_version LIBSWSCALE libswscale/swscale.h
  2625. get_version LIBPOSTPROC libpostproc/postprocess.h
  2626. get_version LIBAVCODEC libavcodec/avcodec.h
  2627. get_version LIBAVDEVICE libavdevice/avdevice.h
  2628. get_version LIBAVFORMAT libavformat/avformat.h
  2629. get_version LIBAVUTIL libavutil/avutil.h
  2630. get_version LIBAVFILTER libavfilter/avfilter.h
  2631. enabled shared && cat >> config.mak <<EOF
  2632. LIBTARGET=${LIBTARGET}
  2633. SLIBNAME=${SLIBNAME}
  2634. SLIBNAME_WITH_VERSION=${SLIBNAME_WITH_VERSION}
  2635. SLIBNAME_WITH_MAJOR=${SLIBNAME_WITH_MAJOR}
  2636. SLIB_CREATE_DEF_CMD=${SLIB_CREATE_DEF_CMD}
  2637. SLIB_EXTRA_CMD=${SLIB_EXTRA_CMD}
  2638. SLIB_INSTALL_EXTRA_CMD=${SLIB_INSTALL_EXTRA_CMD}
  2639. SLIB_UNINSTALL_EXTRA_CMD=${SLIB_UNINSTALL_EXTRA_CMD}
  2640. EOF
  2641. enabled asmalign_pot || align_shift="1 <<"
  2642. cat > $TMPH <<EOF
  2643. /* Automatically generated by configure - do not modify! */
  2644. #ifndef FFMPEG_CONFIG_H
  2645. #define FFMPEG_CONFIG_H
  2646. #define FFMPEG_CONFIGURATION "$(c_escape $FFMPEG_CONFIGURATION)"
  2647. #define FFMPEG_LICENSE "$(c_escape $license)"
  2648. #define FFMPEG_DATADIR "$(eval c_escape $datadir)"
  2649. #define CC_TYPE "$cc_type"
  2650. #define CC_VERSION $cc_version
  2651. #define restrict $_restrict
  2652. #define ASMALIGN(ZEROBITS) ".align $align_shift " #ZEROBITS "\\n\\t"
  2653. #define EXTERN_PREFIX "${extern_prefix}"
  2654. #define EXTERN_ASM ${extern_prefix}
  2655. EOF
  2656. if enabled small || disabled optimizations; then
  2657. echo "#define av_always_inline" >> $TMPH
  2658. fi
  2659. print_config ARCH_ $TMPH config.mak $ARCH_LIST
  2660. print_config HAVE_ $TMPH config.mak $HAVE_LIST
  2661. print_config CONFIG_ $TMPH config.mak $CONFIG_LIST \
  2662. $CONFIG_EXTRA \
  2663. $DECODER_LIST \
  2664. $ENCODER_LIST \
  2665. $HWACCEL_LIST \
  2666. $PARSER_LIST \
  2667. $BSF_LIST \
  2668. $DEMUXER_LIST \
  2669. $MUXER_LIST \
  2670. $FILTER_LIST \
  2671. $PROTOCOL_LIST \
  2672. $INDEV_LIST \
  2673. $OUTDEV_LIST \
  2674. echo "#endif /* FFMPEG_CONFIG_H */" >> $TMPH
  2675. echo "endif # FFMPEG_CONFIG_MAK" >> config.mak
  2676. # Do not overwrite an unchanged config.h to avoid superfluous rebuilds.
  2677. cp_if_changed $TMPH config.h
  2678. cat > $TMPH <<EOF
  2679. /* Generated by ffconf */
  2680. #ifndef AVUTIL_AVCONFIG_H
  2681. #define AVUTIL_AVCONFIG_H
  2682. EOF
  2683. print_config AV_HAVE_ $TMPH /dev/null $HAVE_LIST_PUB
  2684. echo "#endif /* AVUTIL_AVCONFIG_H */" >> $TMPH
  2685. cp_if_changed $TMPH libavutil/avconfig.h
  2686. # build pkg-config files
  2687. pkgconfig_generate(){
  2688. name=$1
  2689. shortname=${name#lib}${build_suffix}
  2690. comment=$2
  2691. version=$3
  2692. libs=$4
  2693. requires=$5
  2694. cat <<EOF > $name/$name.pc
  2695. prefix=$prefix
  2696. exec_prefix=\${prefix}
  2697. libdir=$libdir
  2698. includedir=$incdir
  2699. Name: $name
  2700. Description: $comment
  2701. Version: $version
  2702. Requires: $(enabled shared || echo $requires)
  2703. Requires.private: $(enabled shared && echo $requires)
  2704. Conflicts:
  2705. Libs: -L\${libdir} -l${shortname} $(enabled shared || echo $libs)
  2706. Libs.private: $(enabled shared && echo $libs)
  2707. Cflags: -I\${includedir}
  2708. EOF
  2709. cat <<EOF > $name/$name-uninstalled.pc
  2710. prefix=
  2711. exec_prefix=
  2712. libdir=\${pcfiledir}
  2713. includedir=${source_path}
  2714. Name: $name
  2715. Description: $comment
  2716. Version: $version
  2717. Requires: $requires
  2718. Conflicts:
  2719. Libs: \${libdir}/${LIBPREF}${shortname}${LIBSUF} $libs
  2720. Cflags: -I\${includedir}
  2721. EOF
  2722. }
  2723. pkgconfig_generate libavutil "FFmpeg utility library" "$LIBAVUTIL_VERSION"
  2724. pkgconfig_generate libavcodec "FFmpeg codec library" "$LIBAVCODEC_VERSION" "$extralibs" "libavutil = $LIBAVUTIL_VERSION"
  2725. pkgconfig_generate libavformat "FFmpeg container format library" "$LIBAVFORMAT_VERSION" "$extralibs" "libavcodec = $LIBAVCODEC_VERSION"
  2726. pkgconfig_generate libavdevice "FFmpeg device handling library" "$LIBAVDEVICE_VERSION" "$extralibs" "libavformat = $LIBAVFORMAT_VERSION"
  2727. enabled avfilter &&
  2728. pkgconfig_generate libavfilter "FFmpeg video filtering library" "$LIBAVFILTER_VERSION" "$extralibs" "libavutil = $LIBAVUTIL_VERSION"
  2729. enabled postproc &&
  2730. pkgconfig_generate libpostproc "FFmpeg post processing library" "$LIBPOSTPROC_VERSION"
  2731. pkgconfig_generate libswscale "FFmpeg image rescaling library" "$LIBSWSCALE_VERSION" "" "libavutil = $LIBAVUTIL_VERSION"