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.

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