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.

4472 lines
134KB

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