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.

5720 lines
176KB

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