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.

4013 lines
120KB

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