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.

6277 lines
198KB

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