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.

4616 lines
139KB

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