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.

5429 lines
167KB

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