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.

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