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.

3064 lines
86KB

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