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.

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