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.

5986 lines
187KB

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