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.

5987 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_decoder_select="h263_decoder"
  1965. h263p_encoder_select="h263_encoder"
  1966. h264_decoder_select="cabac golomb h264chroma h264dsp h264pred h264qpel startcode videodsp"
  1967. h264_decoder_suggest="error_resilience"
  1968. h264_qsv_decoder_deps="libmfx"
  1969. h264_qsv_decoder_select="h264_mp4toannexb_bsf h264_parser qsvdec h264_qsv_hwaccel"
  1970. h264_qsv_encoder_deps="libmfx"
  1971. h264_qsv_encoder_select="qsvenc"
  1972. hevc_decoder_select="bswapdsp cabac golomb videodsp"
  1973. huffyuv_decoder_select="bswapdsp huffyuvdsp llviddsp"
  1974. huffyuv_encoder_select="bswapdsp huffman huffyuvencdsp llviddsp"
  1975. iac_decoder_select="imc_decoder"
  1976. imc_decoder_select="bswapdsp fft mdct sinewin"
  1977. indeo3_decoder_select="hpeldsp"
  1978. interplay_video_decoder_select="hpeldsp"
  1979. jpegls_decoder_select="golomb mjpeg_decoder"
  1980. jpegls_encoder_select="golomb"
  1981. jv_decoder_select="blockdsp"
  1982. lagarith_decoder_select="huffyuvdsp"
  1983. ljpeg_encoder_select="aandcttables idctdsp jpegtables"
  1984. loco_decoder_select="golomb"
  1985. mdec_decoder_select="blockdsp idctdsp mpegvideo"
  1986. metasound_decoder_select="lsp mdct sinewin"
  1987. mimic_decoder_select="blockdsp bswapdsp hpeldsp idctdsp"
  1988. mjpeg_decoder_select="blockdsp hpeldsp exif idctdsp jpegtables"
  1989. mjpeg_encoder_select="aandcttables jpegtables mpegvideoenc"
  1990. mjpegb_decoder_select="mjpeg_decoder"
  1991. mlp_decoder_select="mlp_parser"
  1992. motionpixels_decoder_select="bswapdsp"
  1993. mp1_decoder_select="mpegaudio"
  1994. mp1float_decoder_select="mpegaudio"
  1995. mp2_decoder_select="mpegaudio"
  1996. mp2float_decoder_select="mpegaudio"
  1997. mp3_decoder_select="mpegaudio"
  1998. mp3adu_decoder_select="mpegaudio"
  1999. mp3adufloat_decoder_select="mpegaudio"
  2000. mp3float_decoder_select="mpegaudio"
  2001. mp3on4_decoder_select="mpegaudio"
  2002. mp3on4float_decoder_select="mpegaudio"
  2003. mpc7_decoder_select="bswapdsp mpegaudiodsp"
  2004. mpc8_decoder_select="mpegaudiodsp"
  2005. mpeg_xvmc_decoder_deps="X11_extensions_XvMClib_h"
  2006. mpeg_xvmc_decoder_select="mpeg2video_decoder"
  2007. mpegvideo_decoder_select="error_resilience mpeg_er mpegvideo"
  2008. mpeg1video_decoder_select="error_resilience mpeg_er mpegvideo"
  2009. mpeg1video_encoder_select="aandcttables mpegvideoenc h263dsp"
  2010. mpeg2video_decoder_select="error_resilience mpeg_er mpegvideo"
  2011. mpeg2video_encoder_select="aandcttables mpegvideoenc h263dsp"
  2012. mpeg4_decoder_select="h263_decoder mpeg4video_parser"
  2013. mpeg4_encoder_select="h263_encoder"
  2014. msmpeg4v1_decoder_select="h263_decoder"
  2015. msmpeg4v2_decoder_select="h263_decoder"
  2016. msmpeg4v2_encoder_select="h263_encoder"
  2017. msmpeg4v3_decoder_select="h263_decoder"
  2018. msmpeg4v3_encoder_select="h263_encoder"
  2019. mss2_decoder_select="error_resilience mpeg_er qpeldsp vc1_decoder"
  2020. mxpeg_decoder_select="mjpeg_decoder"
  2021. nellymoser_decoder_select="mdct sinewin"
  2022. nellymoser_encoder_select="audio_frame_queue mdct sinewin"
  2023. nuv_decoder_select="idctdsp lzo"
  2024. on2avc_decoder_select="mdct"
  2025. opus_decoder_deps="swresample"
  2026. opus_decoder_select="imdct15"
  2027. png_decoder_select="zlib"
  2028. png_encoder_select="huffyuvencdsp zlib"
  2029. prores_decoder_select="blockdsp idctdsp"
  2030. prores_encoder_select="fdctdsp"
  2031. qcelp_decoder_select="lsp"
  2032. qdm2_decoder_select="mdct rdft mpegaudiodsp"
  2033. ra_144_encoder_select="audio_frame_queue lpc audiodsp"
  2034. ra_144_decoder_select="audiodsp"
  2035. ralf_decoder_select="golomb"
  2036. rawvideo_decoder_select="bswapdsp"
  2037. rtjpeg_decoder_select="me_cmp"
  2038. rv10_decoder_select="error_resilience h263_decoder h263dsp mpeg_er"
  2039. rv10_encoder_select="h263_encoder"
  2040. rv20_decoder_select="error_resilience h263_decoder h263dsp mpeg_er"
  2041. rv20_encoder_select="h263_encoder"
  2042. rv30_decoder_select="error_resilience golomb h264chroma h264pred h264qpel mpeg_er mpegvideo videodsp"
  2043. rv40_decoder_select="error_resilience golomb h264chroma h264pred h264qpel mpeg_er mpegvideo videodsp"
  2044. shorten_decoder_select="golomb"
  2045. sipr_decoder_select="lsp"
  2046. snow_decoder_select="dwt h264qpel hpeldsp me_cmp rangecoder videodsp"
  2047. snow_encoder_select="aandcttables dwt h264qpel hpeldsp me_cmp mpegvideoenc rangecoder"
  2048. sonic_decoder_select="golomb rangecoder"
  2049. sonic_encoder_select="golomb rangecoder"
  2050. sonic_ls_encoder_select="golomb rangecoder"
  2051. sp5x_decoder_select="mjpeg_decoder"
  2052. svq1_decoder_select="hpeldsp"
  2053. svq1_encoder_select="aandcttables hpeldsp me_cmp mpegvideoenc"
  2054. svq3_decoder_select="h264_decoder hpeldsp tpeldsp"
  2055. svq3_decoder_suggest="zlib"
  2056. tak_decoder_select="audiodsp"
  2057. tdsc_decoder_select="zlib mjpeg_decoder"
  2058. theora_decoder_select="vp3_decoder"
  2059. thp_decoder_select="mjpeg_decoder"
  2060. tiff_decoder_suggest="zlib lzma"
  2061. tiff_encoder_suggest="zlib"
  2062. truehd_decoder_select="mlp_parser"
  2063. truemotion2_decoder_select="bswapdsp"
  2064. truespeech_decoder_select="bswapdsp"
  2065. tscc_decoder_select="zlib"
  2066. twinvq_decoder_select="mdct lsp sinewin"
  2067. utvideo_decoder_select="bswapdsp"
  2068. utvideo_encoder_select="bswapdsp huffman huffyuvencdsp"
  2069. vble_decoder_select="huffyuvdsp"
  2070. vc1_decoder_select="blockdsp error_resilience h263_decoder h264chroma h264qpel intrax8 mpeg_er qpeldsp startcode"
  2071. vc1image_decoder_select="vc1_decoder"
  2072. vorbis_decoder_select="mdct"
  2073. vorbis_encoder_select="mdct"
  2074. vp3_decoder_select="hpeldsp vp3dsp videodsp"
  2075. vp5_decoder_select="h264chroma hpeldsp videodsp vp3dsp"
  2076. vp6_decoder_select="h264chroma hpeldsp huffman videodsp vp3dsp"
  2077. vp6a_decoder_select="vp6_decoder"
  2078. vp6f_decoder_select="vp6_decoder"
  2079. vp7_decoder_select="h264pred videodsp"
  2080. vp8_decoder_select="h264pred videodsp"
  2081. vp9_decoder_select="videodsp vp9_parser"
  2082. webp_decoder_select="vp8_decoder"
  2083. wmalossless_decoder_select="llauddsp"
  2084. wmapro_decoder_select="mdct sinewin wma_freqs"
  2085. wmav1_decoder_select="mdct sinewin wma_freqs"
  2086. wmav1_encoder_select="mdct sinewin wma_freqs"
  2087. wmav2_decoder_select="mdct sinewin wma_freqs"
  2088. wmav2_encoder_select="mdct sinewin wma_freqs"
  2089. wmavoice_decoder_select="lsp rdft dct mdct sinewin"
  2090. wmv1_decoder_select="h263_decoder"
  2091. wmv1_encoder_select="h263_encoder"
  2092. wmv2_decoder_select="blockdsp h263_decoder idctdsp intrax8 videodsp"
  2093. wmv2_encoder_select="h263_encoder"
  2094. wmv3_decoder_select="vc1_decoder"
  2095. wmv3image_decoder_select="wmv3_decoder"
  2096. zerocodec_decoder_select="zlib"
  2097. zlib_decoder_select="zlib"
  2098. zlib_encoder_select="zlib"
  2099. zmbv_decoder_select="zlib"
  2100. zmbv_encoder_select="zlib"
  2101. # hardware accelerators
  2102. crystalhd_deps="libcrystalhd_libcrystalhd_if_h"
  2103. dxva2_deps="dxva2api_h"
  2104. vaapi_deps="va_va_h"
  2105. vda_deps="VideoDecodeAcceleration_VDADecoder_h pthreads"
  2106. vda_extralibs="-framework CoreFoundation -framework VideoDecodeAcceleration -framework QuartzCore"
  2107. vdpau_deps="vdpau_vdpau_h vdpau_vdpau_x11_h"
  2108. xvmc_deps="X11_extensions_XvMClib_h"
  2109. h263_vaapi_hwaccel_deps="vaapi"
  2110. h263_vaapi_hwaccel_select="h263_decoder"
  2111. h263_vdpau_hwaccel_deps="vdpau"
  2112. h263_vdpau_hwaccel_select="h263_decoder"
  2113. h264_crystalhd_decoder_select="crystalhd h264_mp4toannexb_bsf h264_parser"
  2114. h264_dxva2_hwaccel_deps="dxva2"
  2115. h264_dxva2_hwaccel_select="h264_decoder"
  2116. h264_mmal_decoder_deps="mmal"
  2117. h264_mmal_hwaccel_deps="mmal"
  2118. h264_mmal_decoder_select="h264_decoder"
  2119. h264_mmal_encoder_deps="mmal"
  2120. h264_qsv_hwaccel_deps="libmfx"
  2121. h264_vaapi_hwaccel_deps="vaapi"
  2122. h264_vaapi_hwaccel_select="h264_decoder"
  2123. h264_vda_decoder_deps="vda"
  2124. h264_vda_decoder_select="h264_decoder"
  2125. h264_vda_hwaccel_deps="vda"
  2126. h264_vda_hwaccel_select="h264_decoder"
  2127. h264_vda_old_hwaccel_deps="vda"
  2128. h264_vda_old_hwaccel_select="h264_decoder"
  2129. h264_vdpau_decoder_deps="vdpau"
  2130. h264_vdpau_decoder_select="h264_decoder"
  2131. h264_vdpau_hwaccel_deps="vdpau"
  2132. h264_vdpau_hwaccel_select="h264_decoder"
  2133. hevc_dxva2_hwaccel_deps="dxva2 DXVA_PicParams_HEVC"
  2134. hevc_dxva2_hwaccel_select="hevc_decoder"
  2135. mpeg_vdpau_decoder_deps="vdpau"
  2136. mpeg_vdpau_decoder_select="mpeg2video_decoder"
  2137. mpeg_xvmc_hwaccel_deps="xvmc"
  2138. mpeg_xvmc_hwaccel_select="mpeg2video_decoder"
  2139. mpeg1_vdpau_decoder_deps="vdpau"
  2140. mpeg1_vdpau_decoder_select="mpeg1video_decoder"
  2141. mpeg1_vdpau_hwaccel_deps="vdpau"
  2142. mpeg1_vdpau_hwaccel_select="mpeg1video_decoder"
  2143. mpeg1_xvmc_hwaccel_deps="xvmc"
  2144. mpeg1_xvmc_hwaccel_select="mpeg1video_decoder"
  2145. mpeg2_crystalhd_decoder_select="crystalhd"
  2146. mpeg2_dxva2_hwaccel_deps="dxva2"
  2147. mpeg2_dxva2_hwaccel_select="mpeg2video_decoder"
  2148. mpeg2_vaapi_hwaccel_deps="vaapi"
  2149. mpeg2_vaapi_hwaccel_select="mpeg2video_decoder"
  2150. mpeg2_vdpau_hwaccel_deps="vdpau"
  2151. mpeg2_vdpau_hwaccel_select="mpeg2video_decoder"
  2152. mpeg2_xvmc_hwaccel_deps="xvmc"
  2153. mpeg2_xvmc_hwaccel_select="mpeg2video_decoder"
  2154. mpeg4_crystalhd_decoder_select="crystalhd"
  2155. mpeg4_vaapi_hwaccel_deps="vaapi"
  2156. mpeg4_vaapi_hwaccel_select="mpeg4_decoder"
  2157. mpeg4_vdpau_decoder_deps="vdpau"
  2158. mpeg4_vdpau_decoder_select="mpeg4_decoder"
  2159. mpeg4_vdpau_hwaccel_deps="vdpau"
  2160. mpeg4_vdpau_hwaccel_select="mpeg4_decoder"
  2161. msmpeg4_crystalhd_decoder_select="crystalhd"
  2162. vc1_crystalhd_decoder_select="crystalhd"
  2163. vc1_dxva2_hwaccel_deps="dxva2"
  2164. vc1_dxva2_hwaccel_select="vc1_decoder"
  2165. vc1_vaapi_hwaccel_deps="vaapi"
  2166. vc1_vaapi_hwaccel_select="vc1_decoder"
  2167. vc1_vdpau_decoder_deps="vdpau"
  2168. vc1_vdpau_decoder_select="vc1_decoder"
  2169. vc1_vdpau_hwaccel_deps="vdpau"
  2170. vc1_vdpau_hwaccel_select="vc1_decoder"
  2171. wmv3_crystalhd_decoder_select="crystalhd"
  2172. wmv3_dxva2_hwaccel_select="vc1_dxva2_hwaccel"
  2173. wmv3_vaapi_hwaccel_select="vc1_vaapi_hwaccel"
  2174. wmv3_vdpau_decoder_select="vc1_vdpau_decoder"
  2175. wmv3_vdpau_hwaccel_select="vc1_vdpau_hwaccel"
  2176. # parsers
  2177. h264_parser_select="h264_decoder"
  2178. hevc_parser_select="hevc_decoder"
  2179. mpegvideo_parser_select="mpegvideo"
  2180. mpeg4video_parser_select="error_resilience h263dsp mpeg_er mpegvideo qpeldsp"
  2181. vc1_parser_select="mpegvideo startcode vc1_decoder"
  2182. # bitstream_filters
  2183. mjpeg2jpeg_bsf_select="jpegtables"
  2184. # external libraries
  2185. libaacplus_encoder_deps="libaacplus"
  2186. libcelt_decoder_deps="libcelt"
  2187. libdcadec_decoder_deps="libdcadec"
  2188. libfaac_encoder_deps="libfaac"
  2189. libfaac_encoder_select="audio_frame_queue"
  2190. libfdk_aac_decoder_deps="libfdk_aac"
  2191. libfdk_aac_encoder_deps="libfdk_aac"
  2192. libfdk_aac_encoder_select="audio_frame_queue"
  2193. libgme_demuxer_deps="libgme"
  2194. libgsm_decoder_deps="libgsm"
  2195. libgsm_encoder_deps="libgsm"
  2196. libgsm_ms_decoder_deps="libgsm"
  2197. libgsm_ms_encoder_deps="libgsm"
  2198. libilbc_decoder_deps="libilbc"
  2199. libilbc_encoder_deps="libilbc"
  2200. libmodplug_demuxer_deps="libmodplug"
  2201. libmp3lame_encoder_deps="libmp3lame"
  2202. libmp3lame_encoder_select="audio_frame_queue"
  2203. libopencore_amrnb_decoder_deps="libopencore_amrnb"
  2204. libopencore_amrnb_encoder_deps="libopencore_amrnb"
  2205. libopencore_amrnb_encoder_select="audio_frame_queue"
  2206. libopencore_amrwb_decoder_deps="libopencore_amrwb"
  2207. libopenh264_encoder_deps="libopenh264"
  2208. libopenjpeg_decoder_deps="libopenjpeg"
  2209. libopenjpeg_encoder_deps="libopenjpeg"
  2210. libopus_decoder_deps="libopus"
  2211. libopus_encoder_deps="libopus"
  2212. libopus_encoder_select="audio_frame_queue"
  2213. libquvi_demuxer_deps="libquvi"
  2214. libschroedinger_decoder_deps="libschroedinger"
  2215. libschroedinger_encoder_deps="libschroedinger"
  2216. libshine_encoder_deps="libshine"
  2217. libshine_encoder_select="audio_frame_queue"
  2218. libspeex_decoder_deps="libspeex"
  2219. libspeex_encoder_deps="libspeex"
  2220. libspeex_encoder_select="audio_frame_queue"
  2221. libstagefright_h264_decoder_deps="libstagefright_h264"
  2222. libtheora_encoder_deps="libtheora"
  2223. libtwolame_encoder_deps="libtwolame"
  2224. libvo_aacenc_encoder_deps="libvo_aacenc"
  2225. libvo_aacenc_encoder_select="audio_frame_queue"
  2226. libvo_amrwbenc_encoder_deps="libvo_amrwbenc"
  2227. libvorbis_decoder_deps="libvorbis"
  2228. libvorbis_encoder_deps="libvorbis"
  2229. libvorbis_encoder_select="audio_frame_queue"
  2230. libvpx_vp8_decoder_deps="libvpx"
  2231. libvpx_vp8_encoder_deps="libvpx"
  2232. libvpx_vp9_decoder_deps="libvpx"
  2233. libvpx_vp9_encoder_deps="libvpx"
  2234. libwavpack_encoder_deps="libwavpack"
  2235. libwebp_encoder_deps="libwebp"
  2236. libx264_encoder_deps="libx264"
  2237. libx264rgb_encoder_deps="libx264"
  2238. libx264rgb_encoder_select="libx264_encoder"
  2239. libx265_encoder_deps="libx265"
  2240. libxavs_encoder_deps="libxavs"
  2241. libxvid_encoder_deps="libxvid"
  2242. libutvideo_decoder_deps="libutvideo"
  2243. libutvideo_encoder_deps="libutvideo"
  2244. libzvbi_teletext_decoder_deps="libzvbi"
  2245. nvenc_encoder_deps="nvenc"
  2246. nvenc_h265_encoder_deps="nvenc"
  2247. # demuxers / muxers
  2248. ac3_demuxer_select="ac3_parser"
  2249. asf_demuxer_select="riffdec"
  2250. asf_muxer_select="riffenc"
  2251. asf_stream_muxer_select="asf_muxer"
  2252. avi_demuxer_select="riffdec exif"
  2253. avi_muxer_select="riffenc"
  2254. avisynth_demuxer_deps="avisynth"
  2255. avisynth_demuxer_select="riffdec"
  2256. caf_demuxer_select="riffdec"
  2257. dash_muxer_select="mp4_muxer"
  2258. dirac_demuxer_select="dirac_parser"
  2259. dts_demuxer_select="dca_parser"
  2260. dtshd_demuxer_select="dca_parser"
  2261. dv_demuxer_select="dvprofile"
  2262. dv_muxer_select="dvprofile"
  2263. dxa_demuxer_select="riffdec"
  2264. eac3_demuxer_select="ac3_parser"
  2265. f4v_muxer_select="mov_muxer"
  2266. flac_demuxer_select="flac_parser"
  2267. hds_muxer_select="flv_muxer"
  2268. hls_muxer_select="mpegts_muxer"
  2269. image2_alias_pix_demuxer_select="image2_demuxer"
  2270. image2_brender_pix_demuxer_select="image2_demuxer"
  2271. ipod_muxer_select="mov_muxer"
  2272. ismv_muxer_select="mov_muxer"
  2273. libnut_demuxer_deps="libnut"
  2274. libnut_muxer_deps="libnut"
  2275. matroska_audio_muxer_select="matroska_muxer"
  2276. matroska_demuxer_select="riffdec"
  2277. matroska_demuxer_suggest="bzlib lzo zlib"
  2278. matroska_muxer_select="riffenc"
  2279. mmf_muxer_select="riffenc"
  2280. mov_demuxer_select="riffdec"
  2281. mov_demuxer_suggest="zlib"
  2282. mov_muxer_select="riffenc rtpenc_chain"
  2283. mp3_demuxer_select="mpegaudio_parser"
  2284. mp4_muxer_select="mov_muxer"
  2285. mpegts_muxer_select="adts_muxer latm_muxer"
  2286. mpegtsraw_demuxer_select="mpegts_demuxer"
  2287. mxf_d10_muxer_select="mxf_muxer"
  2288. mxf_opatom_muxer_select="mxf_muxer"
  2289. nut_muxer_select="riffenc"
  2290. nuv_demuxer_select="riffdec"
  2291. oga_muxer_select="ogg_muxer"
  2292. ogg_demuxer_select="golomb"
  2293. opus_muxer_select="ogg_muxer"
  2294. psp_muxer_select="mov_muxer"
  2295. rtp_demuxer_select="sdp_demuxer"
  2296. rtpdec_select="asf_demuxer jpegtables mov_demuxer mpegts_demuxer rm_demuxer rtp_protocol"
  2297. rtsp_demuxer_select="http_protocol rtpdec"
  2298. rtsp_muxer_select="rtp_muxer http_protocol rtp_protocol rtpenc_chain"
  2299. sap_demuxer_select="sdp_demuxer"
  2300. sap_muxer_select="rtp_muxer rtp_protocol rtpenc_chain"
  2301. sdp_demuxer_select="rtpdec"
  2302. smoothstreaming_muxer_select="ismv_muxer"
  2303. spdif_muxer_select="aac_parser"
  2304. spx_muxer_select="ogg_muxer"
  2305. tak_demuxer_select="tak_parser"
  2306. tg2_muxer_select="mov_muxer"
  2307. tgp_muxer_select="mov_muxer"
  2308. vobsub_demuxer_select="mpegps_demuxer"
  2309. w64_demuxer_select="wav_demuxer"
  2310. w64_muxer_select="wav_muxer"
  2311. wav_demuxer_select="riffdec"
  2312. wav_muxer_select="riffenc"
  2313. webm_muxer_select="riffenc"
  2314. wtv_demuxer_select="riffdec"
  2315. wtv_muxer_select="riffenc"
  2316. xmv_demuxer_select="riffdec"
  2317. xwma_demuxer_select="riffdec"
  2318. # indevs / outdevs
  2319. alsa_indev_deps="alsa_asoundlib_h snd_pcm_htimestamp"
  2320. alsa_outdev_deps="alsa_asoundlib_h"
  2321. avfoundation_indev_extralibs="-framework CoreVideo -framework Foundation -framework AVFoundation -framework CoreMedia"
  2322. avfoundation_indev_select="avfoundation"
  2323. bktr_indev_deps_any="dev_bktr_ioctl_bt848_h machine_ioctl_bt848_h dev_video_bktr_ioctl_bt848_h dev_ic_bt8xx_h"
  2324. caca_outdev_deps="libcaca"
  2325. decklink_outdev_deps="decklink pthreads"
  2326. decklink_outdev_extralibs="-lstdc++"
  2327. decklink_indev_deps="decklink pthreads"
  2328. decklink_indev_extralibs="-lstdc++"
  2329. dshow_indev_deps="IBaseFilter"
  2330. dshow_indev_extralibs="-lpsapi -lole32 -lstrmiids -luuid -loleaut32"
  2331. dv1394_indev_deps="dv1394"
  2332. dv1394_indev_select="dv_demuxer"
  2333. fbdev_indev_deps="linux_fb_h"
  2334. fbdev_outdev_deps="linux_fb_h"
  2335. gdigrab_indev_deps="CreateDIBSection"
  2336. gdigrab_indev_extralibs="-lgdi32"
  2337. gdigrab_indev_select="bmp_decoder"
  2338. iec61883_indev_deps="libiec61883"
  2339. jack_indev_deps="jack_jack_h sem_timedwait"
  2340. lavfi_indev_deps="avfilter"
  2341. libcdio_indev_deps="libcdio"
  2342. libdc1394_indev_deps="libdc1394"
  2343. libv4l2_indev_deps="libv4l2"
  2344. openal_indev_deps="openal"
  2345. opengl_outdev_deps="opengl"
  2346. oss_indev_deps_any="soundcard_h sys_soundcard_h"
  2347. oss_outdev_deps_any="soundcard_h sys_soundcard_h"
  2348. pulse_indev_deps="libpulse"
  2349. pulse_outdev_deps="libpulse"
  2350. qtkit_indev_extralibs="-framework QTKit -framework Foundation -framework QuartzCore"
  2351. qtkit_indev_select="qtkit"
  2352. sdl_outdev_deps="sdl"
  2353. sndio_indev_deps="sndio_h"
  2354. sndio_outdev_deps="sndio_h"
  2355. v4l_indev_deps="linux_videodev_h"
  2356. v4l2_indev_deps_any="linux_videodev2_h sys_videoio_h"
  2357. v4l2_outdev_deps_any="linux_videodev2_h sys_videoio_h"
  2358. vfwcap_indev_deps="capCreateCaptureWindow vfwcap_defines"
  2359. vfwcap_indev_extralibs="-lavicap32"
  2360. xv_outdev_deps="X11_extensions_Xvlib_h XvGetPortAttribute"
  2361. xv_outdev_extralibs="-lXv -lX11 -lXext"
  2362. x11grab_indev_deps="x11grab"
  2363. x11grab_xcb_indev_deps="libxcb"
  2364. # protocols
  2365. bluray_protocol_deps="libbluray"
  2366. ffrtmpcrypt_protocol_deps="!librtmp_protocol"
  2367. ffrtmpcrypt_protocol_deps_any="gcrypt nettle openssl"
  2368. ffrtmpcrypt_protocol_select="tcp_protocol"
  2369. ffrtmphttp_protocol_deps="!librtmp_protocol"
  2370. ffrtmphttp_protocol_select="http_protocol"
  2371. ftp_protocol_select="tcp_protocol"
  2372. gopher_protocol_select="network"
  2373. http_protocol_select="tcp_protocol"
  2374. httpproxy_protocol_select="tcp_protocol"
  2375. https_protocol_select="tls_protocol"
  2376. icecast_protocol_select="http_protocol"
  2377. librtmp_protocol_deps="librtmp"
  2378. librtmpe_protocol_deps="librtmp"
  2379. librtmps_protocol_deps="librtmp"
  2380. librtmpt_protocol_deps="librtmp"
  2381. librtmpte_protocol_deps="librtmp"
  2382. libsmbclient_protocol_deps="libsmbclient gplv3"
  2383. libssh_protocol_deps="libssh"
  2384. mmsh_protocol_select="http_protocol"
  2385. mmst_protocol_select="network"
  2386. rtmp_protocol_deps="!librtmp_protocol"
  2387. rtmp_protocol_select="tcp_protocol"
  2388. rtmpe_protocol_select="ffrtmpcrypt_protocol"
  2389. rtmps_protocol_deps="!librtmp_protocol"
  2390. rtmps_protocol_select="tls_protocol"
  2391. rtmpt_protocol_select="ffrtmphttp_protocol"
  2392. rtmpte_protocol_select="ffrtmpcrypt_protocol ffrtmphttp_protocol"
  2393. rtmpts_protocol_select="ffrtmphttp_protocol https_protocol"
  2394. rtp_protocol_select="udp_protocol"
  2395. sctp_protocol_deps="struct_sctp_event_subscribe"
  2396. sctp_protocol_select="network"
  2397. srtp_protocol_select="rtp_protocol"
  2398. tcp_protocol_select="network"
  2399. tls_protocol_deps_any="openssl gnutls"
  2400. tls_protocol_select="tcp_protocol"
  2401. udp_protocol_select="network"
  2402. udplite_protocol_select="network"
  2403. unix_protocol_deps="sys_un_h"
  2404. unix_protocol_select="network"
  2405. # filters
  2406. amovie_filter_deps="avcodec avformat"
  2407. aresample_filter_deps="swresample"
  2408. ass_filter_deps="libass"
  2409. asyncts_filter_deps="avresample"
  2410. atempo_filter_deps="avcodec"
  2411. atempo_filter_select="rdft"
  2412. azmq_filter_deps="libzmq"
  2413. blackframe_filter_deps="gpl"
  2414. boxblur_filter_deps="gpl"
  2415. bs2b_filter_deps="libbs2b"
  2416. colormatrix_filter_deps="gpl"
  2417. cropdetect_filter_deps="gpl"
  2418. delogo_filter_deps="gpl"
  2419. deshake_filter_select="pixelutils"
  2420. drawtext_filter_deps="libfreetype"
  2421. ebur128_filter_deps="gpl"
  2422. eq_filter_deps="gpl"
  2423. fftfilt_filter_deps="avcodec"
  2424. fftfilt_filter_select="rdft"
  2425. flite_filter_deps="libflite"
  2426. frei0r_filter_deps="frei0r dlopen"
  2427. frei0r_src_filter_deps="frei0r dlopen"
  2428. fspp_filter_deps="gpl"
  2429. geq_filter_deps="gpl"
  2430. histeq_filter_deps="gpl"
  2431. hqdn3d_filter_deps="gpl"
  2432. interlace_filter_deps="gpl"
  2433. kerndeint_filter_deps="gpl"
  2434. ladspa_filter_deps="ladspa dlopen"
  2435. mcdeint_filter_deps="avcodec gpl"
  2436. movie_filter_deps="avcodec avformat"
  2437. mpdecimate_filter_deps="gpl"
  2438. mpdecimate_filter_select="pixelutils"
  2439. mptestsrc_filter_deps="gpl"
  2440. negate_filter_deps="lut_filter"
  2441. perspective_filter_deps="gpl"
  2442. pp7_filter_deps="gpl"
  2443. ocv_filter_deps="libopencv"
  2444. owdenoise_filter_deps="gpl"
  2445. pan_filter_deps="swresample"
  2446. phase_filter_deps="gpl"
  2447. pp_filter_deps="gpl postproc"
  2448. pullup_filter_deps="gpl"
  2449. removelogo_filter_deps="avcodec avformat swscale"
  2450. repeatfields_filter_deps="gpl"
  2451. resample_filter_deps="avresample"
  2452. sab_filter_deps="gpl swscale"
  2453. scale_filter_deps="swscale"
  2454. select_filter_select="pixelutils"
  2455. smartblur_filter_deps="gpl swscale"
  2456. showspectrum_filter_deps="avcodec"
  2457. showspectrum_filter_select="rdft"
  2458. spp_filter_deps="gpl avcodec"
  2459. spp_filter_select="fft idctdsp fdctdsp me_cmp pixblockdsp"
  2460. stereo3d_filter_deps="gpl"
  2461. subtitles_filter_deps="avformat avcodec libass"
  2462. super2xsai_filter_deps="gpl"
  2463. tinterlace_filter_deps="gpl"
  2464. vidstabdetect_filter_deps="libvidstab"
  2465. vidstabtransform_filter_deps="libvidstab"
  2466. pixfmts_super2xsai_test_deps="super2xsai_filter"
  2467. tinterlace_merge_test_deps="tinterlace_filter"
  2468. tinterlace_pad_test_deps="tinterlace_filter"
  2469. uspp_filter_deps="gpl avcodec"
  2470. zmq_filter_deps="libzmq"
  2471. zoompan_filter_deps="swscale"
  2472. # examples
  2473. avio_reading="avformat avcodec avutil"
  2474. avio_list_dir="avformat avutil"
  2475. avcodec_example_deps="avcodec avutil"
  2476. decoding_encoding_example_deps="avcodec avformat avutil"
  2477. demuxing_decoding_example_deps="avcodec avformat avutil"
  2478. extract_mvs_example_deps="avcodec avformat avutil"
  2479. filter_audio_example_deps="avfilter avutil"
  2480. filtering_audio_example_deps="avfilter avcodec avformat avutil"
  2481. filtering_video_example_deps="avfilter avcodec avformat avutil"
  2482. metadata_example_deps="avformat avutil"
  2483. muxing_example_deps="avcodec avformat avutil swscale"
  2484. qsvdec_example_deps="avcodec avutil libmfx h264_qsv_decoder vaapi_x11"
  2485. remuxing_example_deps="avcodec avformat avutil"
  2486. resampling_audio_example_deps="avutil swresample"
  2487. scaling_video_example_deps="avutil swscale"
  2488. transcode_aac_example_deps="avcodec avformat swresample"
  2489. transcoding_example_deps="avfilter avcodec avformat avutil"
  2490. # libraries, in linking order
  2491. avcodec_deps="avutil"
  2492. avdevice_deps="avformat avcodec avutil"
  2493. avfilter_deps="avutil"
  2494. avformat_deps="avcodec avutil"
  2495. avresample_deps="avutil"
  2496. postproc_deps="avutil gpl"
  2497. swresample_deps="avutil"
  2498. swscale_deps="avutil"
  2499. # programs
  2500. ffmpeg_deps="avcodec avfilter avformat swresample"
  2501. ffmpeg_select="aformat_filter anull_filter atrim_filter format_filter
  2502. null_filter
  2503. setpts_filter trim_filter"
  2504. ffplay_deps="avcodec avformat swscale swresample sdl"
  2505. ffplay_libs='$sdl_libs'
  2506. ffplay_select="rdft crop_filter transpose_filter hflip_filter vflip_filter rotate_filter"
  2507. ffprobe_deps="avcodec avformat"
  2508. ffserver_deps="avformat fork sarestart"
  2509. ffserver_select="ffm_muxer rtp_protocol rtsp_demuxer"
  2510. # documentation
  2511. podpages_deps="perl"
  2512. manpages_deps="perl pod2man"
  2513. htmlpages_deps="perl"
  2514. htmlpages_deps_any="makeinfo_html texi2html"
  2515. txtpages_deps="perl makeinfo"
  2516. doc_deps_any="manpages htmlpages podpages txtpages"
  2517. # default parameters
  2518. logfile="config.log"
  2519. # installation paths
  2520. prefix_default="/usr/local"
  2521. bindir_default='${prefix}/bin'
  2522. datadir_default='${prefix}/share/ffmpeg'
  2523. docdir_default='${prefix}/share/doc/ffmpeg'
  2524. incdir_default='${prefix}/include'
  2525. libdir_default='${prefix}/lib'
  2526. mandir_default='${prefix}/share/man'
  2527. # toolchain
  2528. ar_default="ar"
  2529. cc_default="gcc"
  2530. cxx_default="g++"
  2531. host_cc_default="gcc"
  2532. cp_f="cp -f"
  2533. doxygen_default="doxygen"
  2534. install="install"
  2535. ln_s="ln -s -f"
  2536. nm_default="nm -g"
  2537. objformat="elf"
  2538. pkg_config_default=pkg-config
  2539. if ranlib 2>&1 | grep -q "\-D "; then
  2540. ranlib_default="ranlib -D"
  2541. else
  2542. ranlib_default="ranlib"
  2543. fi
  2544. strip_default="strip"
  2545. yasmexe_default="yasm"
  2546. windres_default="windres"
  2547. # OS
  2548. target_os_default=$(tolower $(uname -s))
  2549. host_os=$target_os_default
  2550. # machine
  2551. if test "$target_os_default" = aix; then
  2552. arch_default=$(uname -p)
  2553. strip_default="strip -X32_64"
  2554. else
  2555. arch_default=$(uname -m)
  2556. fi
  2557. cpu="generic"
  2558. intrinsics="none"
  2559. # configurable options
  2560. enable $PROGRAM_LIST
  2561. enable $DOCUMENT_LIST
  2562. enable $EXAMPLE_LIST
  2563. enable $(filter_out avresample $LIBRARY_LIST)
  2564. enable stripping
  2565. enable asm
  2566. enable debug
  2567. enable doc
  2568. enable faan faandct faanidct
  2569. enable optimizations
  2570. enable runtime_cpudetect
  2571. enable safe_bitstream_reader
  2572. enable static
  2573. enable swscale_alpha
  2574. sws_max_filter_size_default=256
  2575. set_default sws_max_filter_size
  2576. # Enable hwaccels by default.
  2577. enable dxva2 vaapi vda vdpau xvmc
  2578. enable xlib
  2579. # build settings
  2580. SHFLAGS='-shared -Wl,-soname,$$(@F)'
  2581. LIBPREF="lib"
  2582. LIBSUF=".a"
  2583. FULLNAME='$(NAME)$(BUILDSUF)'
  2584. LIBNAME='$(LIBPREF)$(FULLNAME)$(LIBSUF)'
  2585. SLIBPREF="lib"
  2586. SLIBSUF=".so"
  2587. SLIBNAME='$(SLIBPREF)$(FULLNAME)$(SLIBSUF)'
  2588. SLIBNAME_WITH_VERSION='$(SLIBNAME).$(LIBVERSION)'
  2589. SLIBNAME_WITH_MAJOR='$(SLIBNAME).$(LIBMAJOR)'
  2590. LIB_INSTALL_EXTRA_CMD='$$(RANLIB) "$(LIBDIR)/$(LIBNAME)"'
  2591. SLIB_INSTALL_NAME='$(SLIBNAME_WITH_VERSION)'
  2592. SLIB_INSTALL_LINKS='$(SLIBNAME_WITH_MAJOR) $(SLIBNAME)'
  2593. asflags_filter=echo
  2594. cflags_filter=echo
  2595. ldflags_filter=echo
  2596. AS_C='-c'
  2597. AS_O='-o $@'
  2598. CC_C='-c'
  2599. CC_E='-E -o $@'
  2600. CC_O='-o $@'
  2601. CXX_C='-c'
  2602. CXX_O='-o $@'
  2603. LD_O='-o $@'
  2604. LD_LIB='-l%'
  2605. LD_PATH='-L'
  2606. HOSTCC_C='-c'
  2607. HOSTCC_E='-E -o $@'
  2608. HOSTCC_O='-o $@'
  2609. HOSTLD_O='-o $@'
  2610. host_libs='-lm'
  2611. host_cflags_filter=echo
  2612. host_ldflags_filter=echo
  2613. target_path='$(CURDIR)'
  2614. # since the object filename is not given with the -MM flag, the compiler
  2615. # is only able to print the basename, and we must add the path ourselves
  2616. DEPCMD='$(DEP$(1)) $(DEP$(1)FLAGS) $($(1)DEP_FLAGS) $< | sed -e "/^\#.*/d" -e "s,^[[:space:]]*$(*F)\\.o,$(@D)/$(*F).o," > $(@:.o=.d)'
  2617. DEPFLAGS='-MM'
  2618. # find source path
  2619. if test -f configure; then
  2620. source_path=.
  2621. else
  2622. source_path=$(cd $(dirname "$0"); pwd)
  2623. echo "$source_path" | grep -q '[[:blank:]]' &&
  2624. die "Out of tree builds are impossible with whitespace in source path."
  2625. test -e "$source_path/config.h" &&
  2626. die "Out of tree builds are impossible with config.h in source dir."
  2627. fi
  2628. for v in "$@"; do
  2629. r=${v#*=}
  2630. l=${v%"$r"}
  2631. r=$(sh_quote "$r")
  2632. FFMPEG_CONFIGURATION="${FFMPEG_CONFIGURATION# } ${l}${r}"
  2633. done
  2634. find_things(){
  2635. thing=$1
  2636. pattern=$2
  2637. file=$source_path/$3
  2638. sed -n "s/^[^#]*$pattern.*([^,]*, *\([^,]*\)\(,.*\)*).*/\1_$thing/p" "$file"
  2639. }
  2640. ENCODER_LIST=$(find_things encoder ENC libavcodec/allcodecs.c)
  2641. DECODER_LIST=$(find_things decoder DEC libavcodec/allcodecs.c)
  2642. HWACCEL_LIST=$(find_things hwaccel HWACCEL libavcodec/allcodecs.c)
  2643. PARSER_LIST=$(find_things parser PARSER libavcodec/allcodecs.c)
  2644. BSF_LIST=$(find_things bsf BSF libavcodec/allcodecs.c)
  2645. MUXER_LIST=$(find_things muxer _MUX libavformat/allformats.c)
  2646. DEMUXER_LIST=$(find_things demuxer DEMUX libavformat/allformats.c)
  2647. OUTDEV_LIST=$(find_things outdev OUTDEV libavdevice/alldevices.c)
  2648. INDEV_LIST=$(find_things indev _IN libavdevice/alldevices.c)
  2649. PROTOCOL_LIST=$(find_things protocol PROTOCOL libavformat/allformats.c)
  2650. FILTER_LIST=$(find_things filter FILTER libavfilter/allfilters.c)
  2651. ALL_COMPONENTS="
  2652. $BSF_LIST
  2653. $DECODER_LIST
  2654. $DEMUXER_LIST
  2655. $ENCODER_LIST
  2656. $FILTER_LIST
  2657. $HWACCEL_LIST
  2658. $INDEV_LIST
  2659. $MUXER_LIST
  2660. $OUTDEV_LIST
  2661. $PARSER_LIST
  2662. $PROTOCOL_LIST
  2663. "
  2664. for n in $COMPONENT_LIST; do
  2665. v=$(toupper ${n%s})_LIST
  2666. eval enable \$$v
  2667. eval ${n}_if_any="\$$v"
  2668. done
  2669. enable $ARCH_EXT_LIST
  2670. die_unknown(){
  2671. echo "Unknown option \"$1\"."
  2672. echo "See $0 --help for available options."
  2673. exit 1
  2674. }
  2675. print_3_columns() {
  2676. cat | tr ' ' '\n' | sort | pr -r -3 -t
  2677. }
  2678. show_list() {
  2679. suffix=_$1
  2680. shift
  2681. echo $* | sed s/$suffix//g | print_3_columns
  2682. exit 0
  2683. }
  2684. rand_list(){
  2685. IFS=', '
  2686. set -- $*
  2687. unset IFS
  2688. for thing; do
  2689. comp=${thing%:*}
  2690. prob=${thing#$comp}
  2691. prob=${prob#:}
  2692. is_in ${comp} $COMPONENT_LIST && eval comp=\$$(toupper ${comp%s})_LIST
  2693. echo "prob ${prob:-0.5}"
  2694. printf '%s\n' $comp
  2695. done
  2696. }
  2697. do_random(){
  2698. action=$1
  2699. shift
  2700. random_seed=$(awk "BEGIN { srand($random_seed); print srand() }")
  2701. $action $(rand_list "$@" | awk "BEGIN { srand($random_seed) } \$1 == \"prob\" { prob = \$2; next } rand() < prob { print }")
  2702. }
  2703. for opt do
  2704. optval="${opt#*=}"
  2705. case "$opt" in
  2706. --extra-ldflags=*)
  2707. add_ldflags $optval
  2708. ;;
  2709. --extra-ldexeflags=*)
  2710. add_ldexeflags $optval
  2711. ;;
  2712. --extra-libs=*)
  2713. add_extralibs $optval
  2714. ;;
  2715. --disable-devices)
  2716. disable $INDEV_LIST $OUTDEV_LIST
  2717. ;;
  2718. --enable-debug=*)
  2719. debuglevel="$optval"
  2720. ;;
  2721. --disable-programs)
  2722. disable $PROGRAM_LIST
  2723. ;;
  2724. --disable-everything)
  2725. map 'eval unset \${$(toupper ${v%s})_LIST}' $COMPONENT_LIST
  2726. ;;
  2727. --disable-all)
  2728. map 'eval unset \${$(toupper ${v%s})_LIST}' $COMPONENT_LIST
  2729. disable $LIBRARY_LIST $PROGRAM_LIST doc
  2730. ;;
  2731. --enable-random|--disable-random)
  2732. action=${opt%%-random}
  2733. do_random ${action#--} $COMPONENT_LIST
  2734. ;;
  2735. --enable-random=*|--disable-random=*)
  2736. action=${opt%%-random=*}
  2737. do_random ${action#--} $optval
  2738. ;;
  2739. --enable-*=*|--disable-*=*)
  2740. eval $(echo "${opt%%=*}" | sed 's/--/action=/;s/-/ thing=/')
  2741. is_in "${thing}s" $COMPONENT_LIST || die_unknown "$opt"
  2742. eval list=\$$(toupper $thing)_LIST
  2743. name=$(echo "${optval}" | sed "s/,/_${thing}|/g")_${thing}
  2744. list=$(filter "$name" $list)
  2745. [ "$list" = "" ] && warn "Option $opt did not match anything"
  2746. $action $list
  2747. ;;
  2748. --enable-?*|--disable-?*)
  2749. eval $(echo "$opt" | sed 's/--/action=/;s/-/ option=/;s/-/_/g')
  2750. if is_in $option $COMPONENT_LIST; then
  2751. test $action = disable && action=unset
  2752. eval $action \$$(toupper ${option%s})_LIST
  2753. elif is_in $option $CMDLINE_SELECT; then
  2754. $action $option
  2755. else
  2756. die_unknown $opt
  2757. fi
  2758. ;;
  2759. --list-*)
  2760. NAME="${opt#--list-}"
  2761. is_in $NAME $COMPONENT_LIST || die_unknown $opt
  2762. NAME=${NAME%s}
  2763. eval show_list $NAME \$$(toupper $NAME)_LIST
  2764. ;;
  2765. --help|-h) show_help
  2766. ;;
  2767. --fatal-warnings) enable fatal_warnings
  2768. ;;
  2769. *)
  2770. optname="${opt%%=*}"
  2771. optname="${optname#--}"
  2772. optname=$(echo "$optname" | sed 's/-/_/g')
  2773. if is_in $optname $CMDLINE_SET; then
  2774. eval $optname='$optval'
  2775. elif is_in $optname $CMDLINE_APPEND; then
  2776. append $optname "$optval"
  2777. else
  2778. die_unknown $opt
  2779. fi
  2780. ;;
  2781. esac
  2782. done
  2783. disabled logging && logfile=/dev/null
  2784. echo "# $0 $FFMPEG_CONFIGURATION" > $logfile
  2785. set >> $logfile
  2786. test -n "$valgrind" && toolchain="valgrind-memcheck"
  2787. case "$toolchain" in
  2788. clang-asan)
  2789. cc_default="clang"
  2790. add_cflags -fsanitize=address
  2791. add_ldflags -fsanitize=address
  2792. ;;
  2793. clang-tsan)
  2794. cc_default="clang"
  2795. add_cflags -fsanitize=thread -pie
  2796. add_ldflags -fsanitize=thread -pie
  2797. ;;
  2798. clang-usan)
  2799. cc_default="clang"
  2800. add_cflags -fsanitize=undefined
  2801. add_ldflags -fsanitize=undefined
  2802. ;;
  2803. gcc-asan)
  2804. cc_default="gcc"
  2805. add_cflags -fsanitize=address
  2806. add_ldflags -fsanitize=address
  2807. ;;
  2808. gcc-tsan)
  2809. cc_default="gcc"
  2810. add_cflags -fsanitize=thread -pie -fPIC
  2811. add_ldflags -fsanitize=thread -pie -fPIC
  2812. ;;
  2813. gcc-usan)
  2814. cc_default="gcc"
  2815. add_cflags -fsanitize=undefined
  2816. add_ldflags -fsanitize=undefined
  2817. ;;
  2818. valgrind-massif)
  2819. target_exec_default=${valgrind:-"valgrind"}
  2820. 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"
  2821. ;;
  2822. valgrind-memcheck)
  2823. target_exec_default=${valgrind:-"valgrind"}
  2824. 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"
  2825. ;;
  2826. msvc)
  2827. # Check whether the current MSVC version needs the C99 converter.
  2828. # From MSVC 2013 (compiler major version 18) onwards, it does actually
  2829. # support enough of C99 to build ffmpeg. Default to the new
  2830. # behaviour if the regexp was unable to match anything, since this
  2831. # successfully parses the version number of existing supported
  2832. # versions that require the converter (MSVC 2010 and 2012).
  2833. cl_major_ver=$(cl 2>&1 | sed -n 's/.*Version \([[:digit:]]\{1,\}\)\..*/\1/p')
  2834. if [ -z "$cl_major_ver" ] || [ $cl_major_ver -ge 18 ]; then
  2835. cc_default="cl"
  2836. else
  2837. cc_default="c99wrap cl"
  2838. fi
  2839. ld_default="link"
  2840. nm_default="dumpbin -symbols"
  2841. ar_default="lib"
  2842. target_os_default="win32"
  2843. # Use a relative path for TMPDIR. This makes sure all the
  2844. # ffconf temp files are written with a relative path, avoiding
  2845. # issues with msys/win32 path conversion for MSVC parameters
  2846. # such as -Fo<file> or -out:<file>.
  2847. TMPDIR=.
  2848. ;;
  2849. icl)
  2850. cc_default="icl"
  2851. ld_default="xilink"
  2852. nm_default="dumpbin -symbols"
  2853. ar_default="xilib"
  2854. target_os_default="win32"
  2855. TMPDIR=.
  2856. ;;
  2857. gcov)
  2858. add_cflags -fprofile-arcs -ftest-coverage
  2859. add_ldflags -fprofile-arcs -ftest-coverage
  2860. ;;
  2861. hardened)
  2862. add_cppflags -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2
  2863. add_cflags -fno-strict-overflow -fstack-protector-all
  2864. add_ldflags -Wl,-z,relro -Wl,-z,now
  2865. ;;
  2866. ?*)
  2867. die "Unknown toolchain $toolchain"
  2868. ;;
  2869. esac
  2870. test -n "$cross_prefix" && enable cross_compile
  2871. if enabled cross_compile; then
  2872. test -n "$arch" && test -n "$target_os" ||
  2873. die "Must specify target arch and OS when cross-compiling"
  2874. fi
  2875. ar_default="${cross_prefix}${ar_default}"
  2876. cc_default="${cross_prefix}${cc_default}"
  2877. cxx_default="${cross_prefix}${cxx_default}"
  2878. nm_default="${cross_prefix}${nm_default}"
  2879. pkg_config_default="${cross_prefix}${pkg_config_default}"
  2880. ranlib_default="${cross_prefix}${ranlib_default}"
  2881. strip_default="${cross_prefix}${strip_default}"
  2882. windres_default="${cross_prefix}${windres_default}"
  2883. sysinclude_default="${sysroot}/usr/include"
  2884. set_default arch cc cxx doxygen pkg_config ranlib strip sysinclude \
  2885. target_exec target_os yasmexe
  2886. enabled cross_compile || host_cc_default=$cc
  2887. set_default host_cc
  2888. pkg_config_fail_message=""
  2889. if ! $pkg_config --version >/dev/null 2>&1; then
  2890. warn "$pkg_config not found, library detection may fail."
  2891. pkg_config=false
  2892. elif is_in -static $cc $LDFLAGS && ! is_in --static $pkg_config $pkg_config_flags; then
  2893. pkg_config_fail_message="
  2894. Note: When building a static binary, add --pkg-config-flags=\"--static\"."
  2895. fi
  2896. if test $doxygen != $doxygen_default && \
  2897. ! $doxygen --version >/dev/null 2>&1; then
  2898. warn "Specified doxygen \"$doxygen\" not found, API documentation will fail to build."
  2899. fi
  2900. exesuf() {
  2901. case $1 in
  2902. mingw32*|win32|win64|cygwin*|*-dos|freedos|opendos|os/2*|symbian) echo .exe ;;
  2903. esac
  2904. }
  2905. EXESUF=$(exesuf $target_os)
  2906. HOSTEXESUF=$(exesuf $host_os)
  2907. # set temporary file name
  2908. : ${TMPDIR:=$TEMPDIR}
  2909. : ${TMPDIR:=$TMP}
  2910. : ${TMPDIR:=/tmp}
  2911. if [ -n "$tempprefix" ] ; then
  2912. mktemp(){
  2913. echo $tempprefix.${HOSTNAME}.${UID}
  2914. }
  2915. elif ! check_cmd mktemp -u XXXXXX; then
  2916. # simple replacement for missing mktemp
  2917. # NOT SAFE FOR GENERAL USE
  2918. mktemp(){
  2919. echo "${2%%XXX*}.${HOSTNAME}.${UID}.$$"
  2920. }
  2921. fi
  2922. tmpfile(){
  2923. tmp=$(mktemp -u "${TMPDIR}/ffconf.XXXXXXXX")$2 &&
  2924. (set -C; exec > $tmp) 2>/dev/null ||
  2925. die "Unable to create temporary file in $TMPDIR."
  2926. append TMPFILES $tmp
  2927. eval $1=$tmp
  2928. }
  2929. trap 'rm -f -- $TMPFILES' EXIT
  2930. tmpfile TMPASM .asm
  2931. tmpfile TMPC .c
  2932. tmpfile TMPCPP .cpp
  2933. tmpfile TMPE $EXESUF
  2934. tmpfile TMPH .h
  2935. tmpfile TMPM .m
  2936. tmpfile TMPO .o
  2937. tmpfile TMPS .S
  2938. tmpfile TMPSH .sh
  2939. tmpfile TMPV .ver
  2940. unset -f mktemp
  2941. chmod +x $TMPE
  2942. # make sure we can execute files in $TMPDIR
  2943. cat > $TMPSH 2>> $logfile <<EOF
  2944. #! /bin/sh
  2945. EOF
  2946. chmod +x $TMPSH >> $logfile 2>&1
  2947. if ! $TMPSH >> $logfile 2>&1; then
  2948. cat <<EOF
  2949. Unable to create and execute files in $TMPDIR. Set the TMPDIR environment
  2950. variable to another directory and make sure that it is not mounted noexec.
  2951. EOF
  2952. die "Sanity test failed."
  2953. fi
  2954. armasm_flags(){
  2955. for flag; do
  2956. case $flag in
  2957. # Filter out MSVC cl.exe options from cflags that shouldn't
  2958. # be passed to gas-preprocessor
  2959. -M[TD]*) ;;
  2960. *) echo $flag ;;
  2961. esac
  2962. done
  2963. }
  2964. ccc_flags(){
  2965. for flag; do
  2966. case $flag in
  2967. -std=c99) echo -c99 ;;
  2968. -mcpu=*) echo -arch ${flag#*=} ;;
  2969. -mieee) echo -ieee ;;
  2970. -O*|-fast) echo $flag ;;
  2971. -fno-math-errno) echo -assume nomath_errno ;;
  2972. -g) echo -g3 ;;
  2973. -Wall) echo -msg_enable level2 ;;
  2974. -Wno-pointer-sign) echo -msg_disable ptrmismatch1 ;;
  2975. -Wl,*) echo $flag ;;
  2976. -f*|-W*) ;;
  2977. *) echo $flag ;;
  2978. esac
  2979. done
  2980. }
  2981. cparser_flags(){
  2982. for flag; do
  2983. case $flag in
  2984. -Wno-switch) echo -Wno-switch-enum ;;
  2985. -Wno-format-zero-length) ;;
  2986. -Wdisabled-optimization) ;;
  2987. -Wno-pointer-sign) echo -Wno-other ;;
  2988. *) echo $flag ;;
  2989. esac
  2990. done
  2991. }
  2992. msvc_common_flags(){
  2993. for flag; do
  2994. case $flag in
  2995. # In addition to specifying certain flags under the compiler
  2996. # specific filters, they must be specified here as well or else the
  2997. # generic catch all at the bottom will print the original flag.
  2998. -Wall) ;;
  2999. -std=c99) ;;
  3000. # Common flags
  3001. -fomit-frame-pointer) ;;
  3002. -g) echo -Z7 ;;
  3003. -fno-math-errno) ;;
  3004. -fno-common) ;;
  3005. -fno-signed-zeros) ;;
  3006. -fPIC) ;;
  3007. -mthumb) ;;
  3008. -march=*) ;;
  3009. -lz) echo zlib.lib ;;
  3010. -lavifil32) echo vfw32.lib ;;
  3011. -lavicap32) echo vfw32.lib user32.lib ;;
  3012. -l*) echo ${flag#-l}.lib ;;
  3013. -L*) echo -libpath:${flag#-L} ;;
  3014. *) echo $flag ;;
  3015. esac
  3016. done
  3017. }
  3018. msvc_flags(){
  3019. msvc_common_flags "$@"
  3020. for flag; do
  3021. case $flag in
  3022. -Wall) echo -W4 -wd4244 -wd4127 -wd4018 -wd4389 \
  3023. -wd4146 -wd4057 -wd4204 -wd4706 -wd4305 \
  3024. -wd4152 -wd4324 -we4013 -wd4100 -wd4214 \
  3025. -wd4307 \
  3026. -wd4273 -wd4554 -wd4701 ;;
  3027. esac
  3028. done
  3029. }
  3030. icl_flags(){
  3031. msvc_common_flags "$@"
  3032. for flag; do
  3033. case $flag in
  3034. # Despite what Intel's documentation says -Wall, which is supported
  3035. # on Windows, does enable remarks so disable them here.
  3036. -Wall) echo $flag -Qdiag-disable:remark ;;
  3037. -std=c99) echo -Qstd=c99 ;;
  3038. -flto) echo -ipo ;;
  3039. esac
  3040. done
  3041. }
  3042. icc_flags(){
  3043. for flag; do
  3044. case $flag in
  3045. -flto) echo -ipo ;;
  3046. *) echo $flag ;;
  3047. esac
  3048. done
  3049. }
  3050. pgi_flags(){
  3051. for flag; do
  3052. case $flag in
  3053. -flto) echo -Mipa=fast,libopt,libinline,vestigial ;;
  3054. -fomit-frame-pointer) echo -Mnoframe ;;
  3055. -g) echo -gopt ;;
  3056. *) echo $flag ;;
  3057. esac
  3058. done
  3059. }
  3060. suncc_flags(){
  3061. for flag; do
  3062. case $flag in
  3063. -march=*|-mcpu=*)
  3064. case "${flag#*=}" in
  3065. native) echo -xtarget=native ;;
  3066. v9|niagara) echo -xarch=sparc ;;
  3067. ultrasparc) echo -xarch=sparcvis ;;
  3068. ultrasparc3|niagara2) echo -xarch=sparcvis2 ;;
  3069. i586|pentium) echo -xchip=pentium ;;
  3070. i686|pentiumpro|pentium2) echo -xtarget=pentium_pro ;;
  3071. pentium3*|c3-2) echo -xtarget=pentium3 ;;
  3072. pentium-m) echo -xarch=sse2 -xchip=pentium3 ;;
  3073. pentium4*) echo -xtarget=pentium4 ;;
  3074. prescott|nocona) echo -xarch=sse3 -xchip=pentium4 ;;
  3075. *-sse3) echo -xarch=sse3 ;;
  3076. core2) echo -xarch=ssse3 -xchip=core2 ;;
  3077. bonnell) echo -xarch=ssse3 ;;
  3078. corei7|nehalem) echo -xtarget=nehalem ;;
  3079. westmere) echo -xtarget=westmere ;;
  3080. silvermont) echo -xarch=sse4_2 ;;
  3081. corei7-avx|sandybridge) echo -xtarget=sandybridge ;;
  3082. core-avx*|ivybridge|haswell|broadwell)
  3083. echo -xarch=avx ;;
  3084. amdfam10|barcelona) echo -xtarget=barcelona ;;
  3085. btver1) echo -xarch=amdsse4a ;;
  3086. btver2|bdver*) echo -xarch=avx ;;
  3087. athlon-4|athlon-[mx]p) echo -xarch=ssea ;;
  3088. k8|opteron|athlon64|athlon-fx)
  3089. echo -xarch=sse2a ;;
  3090. athlon*) echo -xarch=pentium_proa ;;
  3091. esac
  3092. ;;
  3093. -std=c99) echo -xc99 ;;
  3094. -fomit-frame-pointer) echo -xregs=frameptr ;;
  3095. -fPIC) echo -KPIC -xcode=pic32 ;;
  3096. -W*,*) echo $flag ;;
  3097. -f*-*|-W*|-mimpure-text) ;;
  3098. -shared) echo -G ;;
  3099. *) echo $flag ;;
  3100. esac
  3101. done
  3102. }
  3103. tms470_flags(){
  3104. for flag; do
  3105. case $flag in
  3106. -march=*|-mcpu=*)
  3107. case "${flag#*=}" in
  3108. armv7-a|cortex-a*) echo -mv=7a8 ;;
  3109. armv7-r|cortex-r*) echo -mv=7r4 ;;
  3110. armv7-m|cortex-m*) echo -mv=7m3 ;;
  3111. armv6*|arm11*) echo -mv=6 ;;
  3112. armv5*e|arm[79]*e*|arm9[24]6*|arm96*|arm102[26])
  3113. echo -mv=5e ;;
  3114. armv4*|arm7*|arm9[24]*) echo -mv=4 ;;
  3115. esac
  3116. ;;
  3117. -mfpu=neon) echo --float_support=vfpv3 --neon ;;
  3118. -mfpu=vfp) echo --float_support=vfpv2 ;;
  3119. -mfpu=vfpv3) echo --float_support=vfpv3 ;;
  3120. -mfpu=vfpv3-d16) echo --float_support=vfpv3d16 ;;
  3121. -msoft-float) echo --float_support=vfplib ;;
  3122. -O[0-3]|-mf=*) echo $flag ;;
  3123. -g) echo -g -mn ;;
  3124. -pds=*) echo $flag ;;
  3125. -D*|-I*) echo $flag ;;
  3126. --gcc|--abi=*) echo $flag ;;
  3127. -me) echo $flag ;;
  3128. esac
  3129. done
  3130. }
  3131. probe_cc(){
  3132. pfx=$1
  3133. _cc=$2
  3134. unset _type _ident _cc_c _cc_e _cc_o _flags _cflags
  3135. unset _ld_o _ldflags _ld_lib _ld_path
  3136. unset _depflags _DEPCMD _DEPFLAGS
  3137. _flags_filter=echo
  3138. if $_cc --version 2>&1 | grep -q '^GNU assembler'; then
  3139. true # no-op to avoid reading stdin in following checks
  3140. elif $_cc -v 2>&1 | grep -q '^gcc.*LLVM'; then
  3141. _type=llvm_gcc
  3142. gcc_extra_ver=$(expr "$($_cc --version | head -n1)" : '.*\((.*)\)')
  3143. _ident="llvm-gcc $($_cc -dumpversion) $gcc_extra_ver"
  3144. _depflags='-MMD -MF $(@:.o=.d) -MT $@'
  3145. _cflags_speed='-O3'
  3146. _cflags_size='-Os'
  3147. elif $_cc -v 2>&1 | grep -qi ^gcc; then
  3148. _type=gcc
  3149. gcc_version=$($_cc --version | head -n1)
  3150. gcc_basever=$($_cc -dumpversion)
  3151. gcc_pkg_ver=$(expr "$gcc_version" : '[^ ]* \(([^)]*)\)')
  3152. gcc_ext_ver=$(expr "$gcc_version" : ".*$gcc_pkg_ver $gcc_basever \\(.*\\)")
  3153. _ident=$(cleanws "gcc $gcc_basever $gcc_pkg_ver $gcc_ext_ver")
  3154. if ! $_cc -dumpversion | grep -q '^2\.'; then
  3155. _depflags='-MMD -MF $(@:.o=.d) -MT $@'
  3156. fi
  3157. _cflags_speed='-O3'
  3158. _cflags_size='-Os'
  3159. elif $_cc --version 2>/dev/null | grep -q ^icc; then
  3160. _type=icc
  3161. _ident=$($_cc --version | head -n1)
  3162. _depflags='-MMD'
  3163. _cflags_speed='-O3'
  3164. _cflags_size='-Os'
  3165. _cflags_noopt='-O1'
  3166. _flags_filter=icc_flags
  3167. elif $_cc -v 2>&1 | grep -q xlc; then
  3168. _type=xlc
  3169. _ident=$($_cc -qversion 2>/dev/null | head -n1)
  3170. _cflags_speed='-O5'
  3171. _cflags_size='-O5 -qcompact'
  3172. elif $_cc -V 2>/dev/null | grep -q Compaq; then
  3173. _type=ccc
  3174. _ident=$($_cc -V | head -n1 | cut -d' ' -f1-3)
  3175. _DEPFLAGS='-M'
  3176. _cflags_speed='-fast'
  3177. _cflags_size='-O1'
  3178. _flags_filter=ccc_flags
  3179. elif $_cc --vsn 2>/dev/null | grep -Eq "ARM (C/C\+\+ )?Compiler"; then
  3180. test -d "$sysroot" || die "No valid sysroot specified."
  3181. _type=armcc
  3182. _ident=$($_cc --vsn | grep -i build | head -n1 | sed 's/.*: //')
  3183. armcc_conf="$PWD/armcc.conf"
  3184. $_cc --arm_linux_configure \
  3185. --arm_linux_config_file="$armcc_conf" \
  3186. --configure_sysroot="$sysroot" \
  3187. --configure_cpp_headers="$sysinclude" >>$logfile 2>&1 ||
  3188. die "Error creating armcc configuration file."
  3189. $_cc --vsn | grep -q RVCT && armcc_opt=rvct || armcc_opt=armcc
  3190. _flags="--arm_linux_config_file=$armcc_conf --translate_gcc"
  3191. as_default="${cross_prefix}gcc"
  3192. _depflags='-MMD'
  3193. _cflags_speed='-O3'
  3194. _cflags_size='-Os'
  3195. elif $_cc -version 2>/dev/null | grep -Eq 'TMS470|TI ARM'; then
  3196. _type=tms470
  3197. _ident=$($_cc -version | head -n1 | tr -s ' ')
  3198. _flags='--gcc --abi=eabi -me'
  3199. _cc_e='-ppl -fe=$@'
  3200. _cc_o='-fe=$@'
  3201. _depflags='-ppa -ppd=$(@:.o=.d)'
  3202. _cflags_speed='-O3 -mf=5'
  3203. _cflags_size='-O3 -mf=2'
  3204. _flags_filter=tms470_flags
  3205. elif $_cc -v 2>&1 | grep -q clang; then
  3206. _type=clang
  3207. _ident=$($_cc --version | head -n1)
  3208. _depflags='-MMD -MF $(@:.o=.d) -MT $@'
  3209. _cflags_speed='-O3'
  3210. _cflags_size='-Os'
  3211. elif $_cc -V 2>&1 | grep -q Sun; then
  3212. _type=suncc
  3213. _ident=$($_cc -V 2>&1 | head -n1 | cut -d' ' -f 2-)
  3214. _DEPCMD='$(DEP$(1)) $(DEP$(1)FLAGS) $($(1)DEP_FLAGS) $< | sed -e "1s,^.*: ,$@: ," -e "\$$!s,\$$, \\\," -e "1!s,^.*: , ," > $(@:.o=.d)'
  3215. _DEPFLAGS='-xM1 -xc99'
  3216. _ldflags='-std=c99'
  3217. _cflags_speed='-O5'
  3218. _cflags_size='-O5 -xspace'
  3219. _flags_filter=suncc_flags
  3220. elif $_cc -v 2>&1 | grep -q 'PathScale\|Path64'; then
  3221. _type=pathscale
  3222. _ident=$($_cc -v 2>&1 | head -n1 | tr -d :)
  3223. _depflags='-MMD -MF $(@:.o=.d) -MT $@'
  3224. _cflags_speed='-O2'
  3225. _cflags_size='-Os'
  3226. _flags_filter='filter_out -Wdisabled-optimization'
  3227. elif $_cc -v 2>&1 | grep -q Open64; then
  3228. _type=open64
  3229. _ident=$($_cc -v 2>&1 | head -n1 | tr -d :)
  3230. _depflags='-MMD -MF $(@:.o=.d) -MT $@'
  3231. _cflags_speed='-O2'
  3232. _cflags_size='-Os'
  3233. _flags_filter='filter_out -Wdisabled-optimization|-Wtype-limits|-fno-signed-zeros'
  3234. elif $_cc -V 2>&1 | grep -q Portland; then
  3235. _type=pgi
  3236. _ident="PGI $($_cc -V 2>&1 | awk '/^pgcc/ { print $2; exit }')"
  3237. opt_common='-alias=ansi -Mdse -Mlre -Mpre'
  3238. _cflags_speed="-O3 -Mautoinline -Munroll=c:4 $opt_common"
  3239. _cflags_size="-O2 -Munroll=c:1 $opt_common"
  3240. _cflags_noopt="-O"
  3241. _flags_filter=pgi_flags
  3242. elif $_cc 2>&1 | grep -q 'Microsoft.*ARM.*Assembler'; then
  3243. _type=armasm
  3244. _ident=$($_cc | head -n1)
  3245. # 4509: "This form of conditional instruction is deprecated"
  3246. _flags="-nologo -ignore 4509"
  3247. _flags_filter=armasm_flags
  3248. elif $_cc 2>&1 | grep -q Intel; then
  3249. _type=icl
  3250. _ident=$($cc 2>&1 | head -n1)
  3251. _depflags='-QMMD -QMF$(@:.o=.d) -QMT$@'
  3252. # Not only is O3 broken on 13.x+ but it is slower on all previous
  3253. # versions (tested) as well.
  3254. _cflags_speed="-O2"
  3255. _cflags_size="-O1 -Oi" # -O1 without -Oi miscompiles stuff
  3256. if $_cc 2>&1 | grep -q Linker; then
  3257. _ld_o='-out:$@'
  3258. else
  3259. _ld_o='-Fe$@'
  3260. fi
  3261. _cc_o='-Fo$@'
  3262. _cc_e='-P'
  3263. _flags_filter=icl_flags
  3264. _ld_lib='lib%.a'
  3265. _ld_path='-libpath:'
  3266. # -Qdiag-error to make icl error when seeing certain unknown arguments
  3267. _flags='-nologo -Qdiag-error:4044,10157'
  3268. # -Qvec- -Qsimd- to prevent miscompilation, -GS, fp:precise for consistency
  3269. # with MSVC which enables it by default.
  3270. _cflags='-D_USE_MATH_DEFINES -FIstdlib.h -Dstrtoll=_strtoi64 -Qms0 -Qvec- -Qsimd- -GS -fp:precise'
  3271. if [ $pfx = hostcc ]; then
  3272. append _cflags -Dsnprintf=_snprintf
  3273. fi
  3274. disable stripping
  3275. elif $_cc 2>&1 | grep -q Microsoft; then
  3276. _type=msvc
  3277. _ident=$($cc 2>&1 | head -n1)
  3278. _DEPCMD='$(DEP$(1)) $(DEP$(1)FLAGS) $($(1)DEP_FLAGS) $< 2>&1 | awk '\''/including/ { sub(/^.*file: */, ""); gsub(/\\/, "/"); if (!match($$0, / /)) print "$@:", $$0 }'\'' > $(@:.o=.d)'
  3279. _DEPFLAGS='$(CPPFLAGS) $(CFLAGS) -showIncludes -Zs'
  3280. _cflags_speed="-O2"
  3281. _cflags_size="-O1"
  3282. if $_cc 2>&1 | grep -q Linker; then
  3283. _ld_o='-out:$@'
  3284. else
  3285. _ld_o='-Fe$@'
  3286. fi
  3287. _cc_o='-Fo$@'
  3288. _cc_e='-P -Fi$@'
  3289. _flags_filter=msvc_flags
  3290. _ld_lib='lib%.a'
  3291. _ld_path='-libpath:'
  3292. _flags='-nologo'
  3293. _cflags='-D_USE_MATH_DEFINES -D_CRT_SECURE_NO_WARNINGS -Dinline=__inline -FIstdlib.h -Dstrtoll=_strtoi64'
  3294. if [ $pfx = hostcc ]; then
  3295. if [ -z "$cl_major_ver" ] || [ $cl_major_ver -le 18 ]; then
  3296. append _cflags -Dsnprintf=_snprintf
  3297. fi
  3298. fi
  3299. disable stripping
  3300. elif $_cc --version 2>/dev/null | grep -q ^cparser; then
  3301. _type=cparser
  3302. _ident=$($_cc --version | head -n1)
  3303. _depflags='-MMD'
  3304. _cflags_speed='-O4'
  3305. _cflags_size='-O2'
  3306. _flags_filter=cparser_flags
  3307. fi
  3308. eval ${pfx}_type=\$_type
  3309. eval ${pfx}_ident=\$_ident
  3310. }
  3311. set_ccvars(){
  3312. eval ${1}_C=\${_cc_c-\${${1}_C}}
  3313. eval ${1}_E=\${_cc_e-\${${1}_E}}
  3314. eval ${1}_O=\${_cc_o-\${${1}_O}}
  3315. if [ -n "$_depflags" ]; then
  3316. eval ${1}_DEPFLAGS=\$_depflags
  3317. else
  3318. eval ${1}DEP=\${_DEPCMD:-\$DEPCMD}
  3319. eval ${1}DEP_FLAGS=\${_DEPFLAGS:-\$DEPFLAGS}
  3320. eval DEP${1}FLAGS=\$_flags
  3321. fi
  3322. }
  3323. probe_cc cc "$cc"
  3324. cflags_filter=$_flags_filter
  3325. cflags_speed=$_cflags_speed
  3326. cflags_size=$_cflags_size
  3327. cflags_noopt=$_cflags_noopt
  3328. add_cflags $_flags $_cflags
  3329. cc_ldflags=$_ldflags
  3330. set_ccvars CC
  3331. probe_cc hostcc "$host_cc"
  3332. host_cflags_filter=$_flags_filter
  3333. add_host_cflags $_flags $_cflags
  3334. set_ccvars HOSTCC
  3335. test -n "$cc_type" && enable $cc_type ||
  3336. warn "Unknown C compiler $cc, unable to select optimal CFLAGS"
  3337. : ${as_default:=$cc}
  3338. : ${dep_cc_default:=$cc}
  3339. : ${ld_default:=$cc}
  3340. : ${host_ld_default:=$host_cc}
  3341. set_default ar as dep_cc ld host_ld windres
  3342. probe_cc as "$as"
  3343. asflags_filter=$_flags_filter
  3344. add_asflags $_flags $_cflags
  3345. set_ccvars AS
  3346. probe_cc ld "$ld"
  3347. ldflags_filter=$_flags_filter
  3348. add_ldflags $_flags $_ldflags
  3349. test "$cc_type" != "$ld_type" && add_ldflags $cc_ldflags
  3350. LD_O=${_ld_o-$LD_O}
  3351. LD_LIB=${_ld_lib-$LD_LIB}
  3352. LD_PATH=${_ld_path-$LD_PATH}
  3353. probe_cc hostld "$host_ld"
  3354. host_ldflags_filter=$_flags_filter
  3355. add_host_ldflags $_flags $_ldflags
  3356. HOSTLD_O=${_ld_o-$HOSTLD_O}
  3357. if [ -z "$CC_DEPFLAGS" ] && [ "$dep_cc" != "$cc" ]; then
  3358. probe_cc depcc "$dep_cc"
  3359. CCDEP=${_DEPCMD:-$DEPCMD}
  3360. CCDEP_FLAGS=${_DEPFLAGS:=$DEPFLAGS}
  3361. DEPCCFLAGS=$_flags
  3362. fi
  3363. if $ar 2>&1 | grep -q Microsoft; then
  3364. arflags="-nologo"
  3365. ar_o='-out:$@'
  3366. elif $ar 2>&1 | grep -q 'Texas Instruments'; then
  3367. arflags="rq"
  3368. ar_o='$@'
  3369. elif $ar 2>&1 | grep -q 'Usage: ar.*-X.*any'; then
  3370. arflags='-Xany -r -c'
  3371. ar_o='$@'
  3372. elif $ar 2>&1 | grep -q "\[D\] "; then
  3373. arflags="rcD"
  3374. ar_o='$@'
  3375. else
  3376. arflags="rc"
  3377. ar_o='$@'
  3378. fi
  3379. add_cflags $extra_cflags
  3380. add_cxxflags $extra_cxxflags
  3381. add_asflags $extra_cflags
  3382. if test -n "$sysroot"; then
  3383. case "$cc_type" in
  3384. gcc|llvm_gcc|clang)
  3385. add_cppflags --sysroot="$sysroot"
  3386. add_ldflags --sysroot="$sysroot"
  3387. # On Darwin --sysroot may be ignored, -isysroot always affects headers and linking
  3388. add_cppflags -isysroot "$sysroot"
  3389. add_ldflags -isysroot "$sysroot"
  3390. ;;
  3391. tms470)
  3392. add_cppflags -I"$sysinclude"
  3393. add_ldflags --sysroot="$sysroot"
  3394. ;;
  3395. esac
  3396. fi
  3397. if test "$cpu" = host; then
  3398. enabled cross_compile &&
  3399. die "--cpu=host makes no sense when cross-compiling."
  3400. case "$cc_type" in
  3401. gcc|llvm_gcc)
  3402. check_native(){
  3403. $cc $1=native -v -c -o $TMPO $TMPC >$TMPE 2>&1 || return
  3404. sed -n "/cc1.*$1=/{
  3405. s/.*$1=\\([^ ]*\\).*/\\1/
  3406. p
  3407. q
  3408. }" $TMPE
  3409. }
  3410. cpu=$(check_native -march || check_native -mcpu)
  3411. ;;
  3412. esac
  3413. test "${cpu:-host}" = host &&
  3414. die "--cpu=host not supported with compiler $cc"
  3415. fi
  3416. # Deal with common $arch aliases
  3417. case "$arch" in
  3418. aarch64|arm64)
  3419. arch="aarch64"
  3420. ;;
  3421. arm*|iPad*|iPhone*)
  3422. arch="arm"
  3423. ;;
  3424. mips*|IP*)
  3425. arch="mips"
  3426. ;;
  3427. parisc*|hppa*)
  3428. arch="parisc"
  3429. ;;
  3430. "Power Macintosh"|ppc*|powerpc*)
  3431. arch="ppc"
  3432. ;;
  3433. s390|s390x)
  3434. arch="s390"
  3435. ;;
  3436. sh4|sh)
  3437. arch="sh4"
  3438. ;;
  3439. sun4u|sparc*)
  3440. arch="sparc"
  3441. ;;
  3442. tilegx|tile-gx)
  3443. arch="tilegx"
  3444. ;;
  3445. i[3-6]86*|i86pc|BePC|x86pc|x86_64|x86_32|amd64)
  3446. arch="x86"
  3447. ;;
  3448. esac
  3449. is_in $arch $ARCH_LIST || warn "unknown architecture $arch"
  3450. enable $arch
  3451. # Add processor-specific flags
  3452. if enabled aarch64; then
  3453. case $cpu in
  3454. armv*)
  3455. cpuflags="-march=$cpu"
  3456. ;;
  3457. *)
  3458. cpuflags="-mcpu=$cpu"
  3459. ;;
  3460. esac
  3461. elif enabled alpha; then
  3462. cpuflags="-mcpu=$cpu"
  3463. elif enabled arm; then
  3464. check_arm_arch() {
  3465. check_cpp_condition stddef.h \
  3466. "defined __ARM_ARCH_${1}__ || defined __TARGET_ARCH_${2:-$1}" \
  3467. $cpuflags
  3468. }
  3469. probe_arm_arch() {
  3470. if check_arm_arch 4; then echo armv4;
  3471. elif check_arm_arch 4T; then echo armv4t;
  3472. elif check_arm_arch 5; then echo armv5;
  3473. elif check_arm_arch 5E; then echo armv5e;
  3474. elif check_arm_arch 5T; then echo armv5t;
  3475. elif check_arm_arch 5TE; then echo armv5te;
  3476. elif check_arm_arch 5TEJ; then echo armv5te;
  3477. elif check_arm_arch 6; then echo armv6;
  3478. elif check_arm_arch 6J; then echo armv6j;
  3479. elif check_arm_arch 6K; then echo armv6k;
  3480. elif check_arm_arch 6Z; then echo armv6z;
  3481. elif check_arm_arch 6ZK; then echo armv6zk;
  3482. elif check_arm_arch 6T2; then echo armv6t2;
  3483. elif check_arm_arch 7; then echo armv7;
  3484. elif check_arm_arch 7A 7_A; then echo armv7-a;
  3485. elif check_arm_arch 7S; then echo armv7-a;
  3486. elif check_arm_arch 7R 7_R; then echo armv7-r;
  3487. elif check_arm_arch 7M 7_M; then echo armv7-m;
  3488. elif check_arm_arch 7EM 7E_M; then echo armv7-m;
  3489. elif check_arm_arch 8A 8_A; then echo armv8-a;
  3490. fi
  3491. }
  3492. [ "$cpu" = generic ] && cpu=$(probe_arm_arch)
  3493. case $cpu in
  3494. armv*)
  3495. cpuflags="-march=$cpu"
  3496. subarch=$(echo $cpu | sed 's/[^a-z0-9]//g')
  3497. ;;
  3498. *)
  3499. cpuflags="-mcpu=$cpu"
  3500. case $cpu in
  3501. cortex-a*) subarch=armv7a ;;
  3502. cortex-r*) subarch=armv7r ;;
  3503. cortex-m*) enable thumb; subarch=armv7m ;;
  3504. arm11*) subarch=armv6 ;;
  3505. arm[79]*e*|arm9[24]6*|arm96*|arm102[26]) subarch=armv5te ;;
  3506. armv4*|arm7*|arm9[24]*) subarch=armv4 ;;
  3507. *) subarch=$(probe_arm_arch) ;;
  3508. esac
  3509. ;;
  3510. esac
  3511. case "$subarch" in
  3512. armv5t*) enable fast_clz ;;
  3513. armv[6-8]*)
  3514. enable fast_clz
  3515. disabled fast_unaligned || enable fast_unaligned
  3516. ;;
  3517. esac
  3518. elif enabled avr32; then
  3519. case $cpu in
  3520. ap7[02]0[0-2])
  3521. subarch="avr32_ap"
  3522. cpuflags="-mpart=$cpu"
  3523. ;;
  3524. ap)
  3525. subarch="avr32_ap"
  3526. cpuflags="-march=$cpu"
  3527. ;;
  3528. uc3[ab]*)
  3529. subarch="avr32_uc"
  3530. cpuflags="-mcpu=$cpu"
  3531. ;;
  3532. uc)
  3533. subarch="avr32_uc"
  3534. cpuflags="-march=$cpu"
  3535. ;;
  3536. esac
  3537. elif enabled bfin; then
  3538. cpuflags="-mcpu=$cpu"
  3539. elif enabled mips; then
  3540. cpuflags="-march=$cpu"
  3541. case $cpu in
  3542. 24kc)
  3543. disable mips32r5
  3544. disable mips64r6
  3545. disable mipsfpu
  3546. disable mipsdspr1
  3547. disable mipsdspr2
  3548. disable msa
  3549. ;;
  3550. 24kf*)
  3551. disable mips32r5
  3552. disable mips64r6
  3553. disable mipsdspr1
  3554. disable mipsdspr2
  3555. disable msa
  3556. ;;
  3557. 24kec|34kc|1004kc)
  3558. disable mips32r5
  3559. disable mips64r6
  3560. disable mipsfpu
  3561. disable mipsdspr2
  3562. disable msa
  3563. ;;
  3564. 24kef*|34kf*|1004kf*)
  3565. disable mips32r5
  3566. disable mips64r6
  3567. disable mipsdspr2
  3568. disable msa
  3569. ;;
  3570. 74kc)
  3571. disable mips32r5
  3572. disable mips64r6
  3573. disable mipsfpu
  3574. disable msa
  3575. ;;
  3576. 74kf)
  3577. disable mips32r5
  3578. disable mips64r6
  3579. disable msa
  3580. ;;
  3581. p5600)
  3582. disable mips64r6
  3583. disable mipsdspr1
  3584. disable mipsdspr2
  3585. check_cflags "-mtune=p5600"
  3586. ;;
  3587. i6400)
  3588. disable mips32r5
  3589. disable mipsdspr1
  3590. disable mipsdspr2
  3591. disable mipsfpu
  3592. check_cflags "-mtune=i6400 -mabi=64"
  3593. check_ldflags "-mabi=64"
  3594. ;;
  3595. generic)
  3596. disable mips32r5
  3597. disable mips64r6
  3598. disable msa
  3599. ;;
  3600. esac
  3601. elif enabled ppc; then
  3602. disable ldbrx
  3603. disable vsx
  3604. case $(tolower $cpu) in
  3605. 601|ppc601|powerpc601)
  3606. cpuflags="-mcpu=601"
  3607. disable altivec
  3608. ;;
  3609. 603*|ppc603*|powerpc603*)
  3610. cpuflags="-mcpu=603"
  3611. disable altivec
  3612. ;;
  3613. 604*|ppc604*|powerpc604*)
  3614. cpuflags="-mcpu=604"
  3615. disable altivec
  3616. ;;
  3617. g3|75*|ppc75*|powerpc75*)
  3618. cpuflags="-mcpu=750"
  3619. disable altivec
  3620. ;;
  3621. g4|745*|ppc745*|powerpc745*)
  3622. cpuflags="-mcpu=7450"
  3623. ;;
  3624. 74*|ppc74*|powerpc74*)
  3625. cpuflags="-mcpu=7400"
  3626. ;;
  3627. g5|970|ppc970|powerpc970)
  3628. cpuflags="-mcpu=970"
  3629. ;;
  3630. power[3-8]*)
  3631. cpuflags="-mcpu=$cpu"
  3632. ;;
  3633. cell)
  3634. cpuflags="-mcpu=cell"
  3635. enable ldbrx
  3636. ;;
  3637. e500mc)
  3638. cpuflags="-mcpu=e500mc"
  3639. disable altivec
  3640. ;;
  3641. e500v2)
  3642. cpuflags="-mcpu=8548 -mhard-float -mfloat-gprs=double"
  3643. disable altivec
  3644. disable dcbzl
  3645. ;;
  3646. e500)
  3647. cpuflags="-mcpu=8540 -mhard-float"
  3648. disable altivec
  3649. disable dcbzl
  3650. ;;
  3651. esac
  3652. elif enabled sparc; then
  3653. case $cpu in
  3654. cypress|f93[04]|tsc701|sparcl*|supersparc|hypersparc|niagara|v[789])
  3655. cpuflags="-mcpu=$cpu"
  3656. ;;
  3657. ultrasparc*|niagara[234])
  3658. cpuflags="-mcpu=$cpu"
  3659. ;;
  3660. esac
  3661. elif enabled x86; then
  3662. case $cpu in
  3663. i[345]86|pentium)
  3664. cpuflags="-march=$cpu"
  3665. disable i686
  3666. disable mmx
  3667. ;;
  3668. # targets that do NOT support nopl and conditional mov (cmov)
  3669. pentium-mmx|k6|k6-[23]|winchip-c6|winchip2|c3)
  3670. cpuflags="-march=$cpu"
  3671. disable i686
  3672. ;;
  3673. # targets that do support nopl and conditional mov (cmov)
  3674. i686|pentiumpro|pentium[23]|pentium-m|athlon|athlon-tbird|athlon-4|athlon-[mx]p|athlon64*|k8*|opteron*|athlon-fx\
  3675. |core*|atom|bonnell|nehalem|westmere|silvermont|sandybridge|ivybridge|haswell|broadwell|amdfam10|barcelona|b[dt]ver*)
  3676. cpuflags="-march=$cpu"
  3677. enable i686
  3678. enable fast_cmov
  3679. ;;
  3680. # targets that do support conditional mov but on which it's slow
  3681. pentium4|pentium4m|prescott|nocona)
  3682. cpuflags="-march=$cpu"
  3683. enable i686
  3684. disable fast_cmov
  3685. ;;
  3686. esac
  3687. fi
  3688. if [ "$cpu" != generic ]; then
  3689. add_cflags $cpuflags
  3690. add_asflags $cpuflags
  3691. fi
  3692. # compiler sanity check
  3693. check_exec <<EOF
  3694. int main(void){ return 0; }
  3695. EOF
  3696. if test "$?" != 0; then
  3697. echo "$cc is unable to create an executable file."
  3698. if test -z "$cross_prefix" && ! enabled cross_compile ; then
  3699. echo "If $cc is a cross-compiler, use the --enable-cross-compile option."
  3700. echo "Only do this if you know what cross compiling means."
  3701. fi
  3702. die "C compiler test failed."
  3703. fi
  3704. add_cppflags -D_ISOC99_SOURCE
  3705. add_cxxflags -D__STDC_CONSTANT_MACROS
  3706. check_cflags -std=c99
  3707. check_cc -D_FILE_OFFSET_BITS=64 <<EOF && add_cppflags -D_FILE_OFFSET_BITS=64
  3708. #include <stdlib.h>
  3709. EOF
  3710. check_cc -D_LARGEFILE_SOURCE <<EOF && add_cppflags -D_LARGEFILE_SOURCE
  3711. #include <stdlib.h>
  3712. EOF
  3713. add_host_cppflags -D_ISOC99_SOURCE
  3714. check_host_cflags -std=c99
  3715. check_host_cflags -Wall
  3716. check_host_cflags -O3
  3717. check_64bit(){
  3718. arch32=$1
  3719. arch64=$2
  3720. expr=$3
  3721. check_code cc "" "int test[2*($expr) - 1]" &&
  3722. subarch=$arch64 || subarch=$arch32
  3723. }
  3724. case "$arch" in
  3725. aarch64|alpha|ia64)
  3726. spic=$shared
  3727. ;;
  3728. mips)
  3729. check_64bit mips mips64 '_MIPS_SIM > 1'
  3730. spic=$shared
  3731. ;;
  3732. parisc)
  3733. check_64bit parisc parisc64 'sizeof(void *) > 4'
  3734. spic=$shared
  3735. ;;
  3736. ppc)
  3737. check_64bit ppc ppc64 'sizeof(void *) > 4'
  3738. spic=$shared
  3739. ;;
  3740. s390)
  3741. check_64bit s390 s390x 'sizeof(void *) > 4'
  3742. spic=$shared
  3743. ;;
  3744. sparc)
  3745. check_64bit sparc sparc64 'sizeof(void *) > 4'
  3746. spic=$shared
  3747. ;;
  3748. x86)
  3749. check_64bit x86_32 x86_64 'sizeof(void *) > 4'
  3750. # Treat x32 as x64 for now. Note it also needs spic=$shared
  3751. test "$subarch" = "x86_32" && check_cpp_condition stddef.h 'defined(__x86_64__)' &&
  3752. subarch=x86_64
  3753. if test "$subarch" = "x86_64"; then
  3754. spic=$shared
  3755. fi
  3756. ;;
  3757. ppc)
  3758. check_cc <<EOF && subarch="ppc64"
  3759. int test[(int)sizeof(char*) - 7];
  3760. EOF
  3761. ;;
  3762. esac
  3763. enable $subarch
  3764. enabled spic && enable_weak pic
  3765. # OS specific
  3766. case $target_os in
  3767. aix)
  3768. SHFLAGS=-shared
  3769. add_cppflags '-I\$(SRC_PATH)/compat/aix'
  3770. enabled shared && add_ldflags -Wl,-brtl
  3771. ;;
  3772. android)
  3773. disable symver
  3774. enable section_data_rel_ro
  3775. SLIB_INSTALL_NAME='$(SLIBNAME)'
  3776. SLIB_INSTALL_LINKS=
  3777. # soname not set on purpose
  3778. SHFLAGS=-shared
  3779. ;;
  3780. haiku)
  3781. prefix_default="/boot/common"
  3782. network_extralibs="-lnetwork"
  3783. host_libs=
  3784. ;;
  3785. sunos)
  3786. SHFLAGS='-shared -Wl,-h,$$(@F)'
  3787. enabled x86 && SHFLAGS="-mimpure-text $SHFLAGS"
  3788. network_extralibs="-lsocket -lnsl"
  3789. add_cppflags -D__EXTENSIONS__
  3790. # When using suncc to build, the Solaris linker will mark
  3791. # an executable with each instruction set encountered by
  3792. # the Solaris assembler. As our libraries contain their own
  3793. # guards for processor-specific code, instead suppress
  3794. # generation of the HWCAPS ELF section on Solaris x86 only.
  3795. enabled_all suncc x86 &&
  3796. echo "hwcap_1 = OVERRIDE;" > mapfile &&
  3797. add_ldflags -Wl,-M,mapfile
  3798. nm_default='nm -P -g'
  3799. ;;
  3800. netbsd)
  3801. disable symver
  3802. oss_indev_extralibs="-lossaudio"
  3803. oss_outdev_extralibs="-lossaudio"
  3804. enabled gcc || check_ldflags -Wl,-zmuldefs
  3805. ;;
  3806. openbsd|bitrig)
  3807. disable symver
  3808. SHFLAGS='-shared'
  3809. SLIB_INSTALL_NAME='$(SLIBNAME).$(LIBMAJOR).$(LIBMINOR)'
  3810. SLIB_INSTALL_LINKS=
  3811. oss_indev_extralibs="-lossaudio"
  3812. oss_outdev_extralibs="-lossaudio"
  3813. ;;
  3814. dragonfly)
  3815. disable symver
  3816. ;;
  3817. freebsd)
  3818. ;;
  3819. bsd/os)
  3820. add_extralibs -lpoll -lgnugetopt
  3821. strip="strip -d"
  3822. ;;
  3823. darwin)
  3824. enabled ppc && add_asflags -force_cpusubtype_ALL
  3825. SHFLAGS='-dynamiclib -Wl,-single_module -Wl,-install_name,$(SHLIBDIR)/$(SLIBNAME_WITH_MAJOR),-current_version,$(LIBVERSION),-compatibility_version,$(LIBMAJOR)'
  3826. enabled x86_32 && append SHFLAGS -Wl,-read_only_relocs,suppress
  3827. strip="${strip} -x"
  3828. add_ldflags -Wl,-dynamic,-search_paths_first
  3829. SLIBSUF=".dylib"
  3830. SLIBNAME_WITH_VERSION='$(SLIBPREF)$(FULLNAME).$(LIBVERSION)$(SLIBSUF)'
  3831. SLIBNAME_WITH_MAJOR='$(SLIBPREF)$(FULLNAME).$(LIBMAJOR)$(SLIBSUF)'
  3832. objformat="macho"
  3833. enabled x86_64 && objformat="macho64"
  3834. enabled_any pic shared x86_64 ||
  3835. { check_cflags -mdynamic-no-pic && add_asflags -mdynamic-no-pic; }
  3836. ;;
  3837. mingw32*)
  3838. if test $target_os = "mingw32ce"; then
  3839. disable network
  3840. else
  3841. target_os=mingw32
  3842. fi
  3843. LIBTARGET=i386
  3844. if enabled x86_64; then
  3845. LIBTARGET="i386:x86-64"
  3846. elif enabled arm; then
  3847. LIBTARGET=arm-wince
  3848. fi
  3849. enabled shared && ! enabled small && check_cmd $windres --version && enable gnu_windres
  3850. check_ldflags -Wl,--nxcompat
  3851. check_ldflags -Wl,--dynamicbase
  3852. enabled x86_32 && check_ldflags -Wl,--large-address-aware
  3853. shlibdir_default="$bindir_default"
  3854. SLIBPREF=""
  3855. SLIBSUF=".dll"
  3856. SLIBNAME_WITH_VERSION='$(SLIBPREF)$(FULLNAME)-$(LIBVERSION)$(SLIBSUF)'
  3857. SLIBNAME_WITH_MAJOR='$(SLIBPREF)$(FULLNAME)-$(LIBMAJOR)$(SLIBSUF)'
  3858. dlltool="${cross_prefix}dlltool"
  3859. if check_cmd lib.exe -list; then
  3860. SLIB_EXTRA_CMD=-'sed -e "s/ @[^ ]*//" $$(@:$(SLIBSUF)=.orig.def) > $$(@:$(SLIBSUF)=.def); lib.exe /machine:$(LIBTARGET) /def:$$(@:$(SLIBSUF)=.def) /out:$(SUBDIR)$(SLIBNAME:$(SLIBSUF)=.lib)'
  3861. if enabled x86_64; then
  3862. LIBTARGET=x64
  3863. fi
  3864. elif check_cmd $dlltool --version; then
  3865. 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)'
  3866. fi
  3867. SLIB_INSTALL_NAME='$(SLIBNAME_WITH_MAJOR)'
  3868. SLIB_INSTALL_LINKS=
  3869. SLIB_INSTALL_EXTRA_SHLIB='$(SLIBNAME:$(SLIBSUF)=.lib)'
  3870. SLIB_INSTALL_EXTRA_LIB='lib$(SLIBNAME:$(SLIBSUF)=.dll.a) $(SLIBNAME_WITH_MAJOR:$(SLIBSUF)=.def)'
  3871. 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'
  3872. objformat="win32"
  3873. ranlib=:
  3874. enable dos_paths
  3875. ;;
  3876. win32|win64)
  3877. disable symver
  3878. if enabled shared; then
  3879. # Link to the import library instead of the normal static library
  3880. # for shared libs.
  3881. LD_LIB='%.lib'
  3882. # Cannot build both shared and static libs with MSVC or icl.
  3883. disable static
  3884. fi
  3885. enabled x86_32 && check_ldflags -LARGEADDRESSAWARE
  3886. shlibdir_default="$bindir_default"
  3887. SLIBPREF=""
  3888. SLIBSUF=".dll"
  3889. SLIBNAME_WITH_VERSION='$(SLIBPREF)$(FULLNAME)-$(LIBVERSION)$(SLIBSUF)'
  3890. SLIBNAME_WITH_MAJOR='$(SLIBPREF)$(FULLNAME)-$(LIBMAJOR)$(SLIBSUF)'
  3891. SLIB_CREATE_DEF_CMD='$(SRC_PATH)/compat/windows/makedef $(SUBDIR)lib$(NAME).ver $(OBJS) > $$(@:$(SLIBSUF)=.def)'
  3892. SLIB_INSTALL_NAME='$(SLIBNAME_WITH_MAJOR)'
  3893. SLIB_INSTALL_LINKS=
  3894. SLIB_INSTALL_EXTRA_SHLIB='$(SLIBNAME:$(SLIBSUF)=.lib)'
  3895. SLIB_INSTALL_EXTRA_LIB='$(SLIBNAME_WITH_MAJOR:$(SLIBSUF)=.def)'
  3896. SHFLAGS='-dll -def:$$(@:$(SLIBSUF)=.def) -implib:$(SUBDIR)$(SLIBNAME:$(SLIBSUF)=.lib)'
  3897. objformat="win32"
  3898. ranlib=:
  3899. enable dos_paths
  3900. ;;
  3901. cygwin*)
  3902. target_os=cygwin
  3903. shlibdir_default="$bindir_default"
  3904. SLIBPREF="cyg"
  3905. SLIBSUF=".dll"
  3906. SLIBNAME_WITH_VERSION='$(SLIBPREF)$(FULLNAME)-$(LIBVERSION)$(SLIBSUF)'
  3907. SLIBNAME_WITH_MAJOR='$(SLIBPREF)$(FULLNAME)-$(LIBMAJOR)$(SLIBSUF)'
  3908. SLIB_INSTALL_NAME='$(SLIBNAME_WITH_MAJOR)'
  3909. SLIB_INSTALL_LINKS=
  3910. SLIB_INSTALL_EXTRA_LIB='lib$(FULLNAME).dll.a'
  3911. SHFLAGS='-shared -Wl,--out-implib,$(SUBDIR)lib$(FULLNAME).dll.a'
  3912. objformat="win32"
  3913. enable dos_paths
  3914. enabled shared && ! enabled small && check_cmd $windres --version && enable gnu_windres
  3915. ;;
  3916. *-dos|freedos|opendos)
  3917. network_extralibs="-lsocket"
  3918. objformat="coff"
  3919. enable dos_paths
  3920. add_cppflags -U__STRICT_ANSI__
  3921. ;;
  3922. linux)
  3923. enable dv1394
  3924. enable section_data_rel_ro
  3925. ;;
  3926. irix*)
  3927. target_os=irix
  3928. ranlib="echo ignoring ranlib"
  3929. ;;
  3930. os/2*)
  3931. strip="lxlite -CS"
  3932. ln_s="cp -f"
  3933. objformat="aout"
  3934. add_cppflags -D_GNU_SOURCE
  3935. add_ldflags -Zomf -Zbin-files -Zargs-wild -Zmap
  3936. SHFLAGS='$(SUBDIR)$(NAME).def -Zdll -Zomf'
  3937. LIBSUF="_s.a"
  3938. SLIBPREF=""
  3939. SLIBSUF=".dll"
  3940. SLIBNAME_WITH_VERSION='$(SLIBPREF)$(NAME)-$(LIBVERSION)$(SLIBSUF)'
  3941. SLIBNAME_WITH_MAJOR='$(SLIBPREF)$(shell echo $(NAME) | cut -c1-6)$(LIBMAJOR)$(SLIBSUF)'
  3942. SLIB_CREATE_DEF_CMD='echo LIBRARY $(SLIBNAME_WITH_MAJOR) INITINSTANCE TERMINSTANCE > $(SUBDIR)$(NAME).def; \
  3943. echo PROTMODE >> $(SUBDIR)$(NAME).def; \
  3944. echo CODE PRELOAD MOVEABLE DISCARDABLE >> $(SUBDIR)$(NAME).def; \
  3945. echo DATA PRELOAD MOVEABLE MULTIPLE NONSHARED >> $(SUBDIR)$(NAME).def; \
  3946. echo EXPORTS >> $(SUBDIR)$(NAME).def; \
  3947. emxexp -o $(OBJS) >> $(SUBDIR)$(NAME).def'
  3948. SLIB_EXTRA_CMD='emximp -o $(SUBDIR)$(LIBPREF)$(NAME)_dll.a $(SUBDIR)$(NAME).def; \
  3949. emximp -o $(SUBDIR)$(LIBPREF)$(NAME)_dll.lib $(SUBDIR)$(NAME).def;'
  3950. SLIB_INSTALL_EXTRA_LIB='$(LIBPREF)$(NAME)_dll.a $(LIBPREF)$(NAME)_dll.lib'
  3951. enable dos_paths
  3952. enable_weak os2threads
  3953. ;;
  3954. gnu/kfreebsd)
  3955. add_cppflags -D_BSD_SOURCE
  3956. ;;
  3957. gnu)
  3958. ;;
  3959. qnx)
  3960. add_cppflags -D_QNX_SOURCE
  3961. network_extralibs="-lsocket"
  3962. ;;
  3963. symbian)
  3964. SLIBSUF=".dll"
  3965. enable dos_paths
  3966. add_cflags --include=$sysinclude/gcce/gcce.h -fvisibility=default
  3967. add_cppflags -D__GCCE__ -D__SYMBIAN32__ -DSYMBIAN_OE_POSIX_SIGNALS
  3968. add_ldflags -Wl,--target1-abs,--no-undefined \
  3969. -Wl,-Ttext,0x80000,-Tdata,0x1000000 -shared \
  3970. -Wl,--entry=_E32Startup -Wl,-u,_E32Startup
  3971. add_extralibs -l:eexe.lib -l:usrt2_2.lib -l:dfpaeabi.dso \
  3972. -l:drtaeabi.dso -l:scppnwdl.dso -lsupc++ -lgcc \
  3973. -l:libc.dso -l:libm.dso -l:euser.dso -l:libcrt0.lib
  3974. ;;
  3975. osf1)
  3976. add_cppflags -D_OSF_SOURCE -D_POSIX_PII -D_REENTRANT
  3977. ;;
  3978. minix)
  3979. ;;
  3980. plan9)
  3981. add_cppflags -D_C99_SNPRINTF_EXTENSION \
  3982. -D_REENTRANT_SOURCE \
  3983. -D_RESEARCH_SOURCE \
  3984. -DFD_SETSIZE=96 \
  3985. -DHAVE_SOCK_OPTS
  3986. add_compat strtod.o strtod=avpriv_strtod
  3987. network_extralibs='-lbsd'
  3988. exeobjs=compat/plan9/main.o
  3989. disable ffserver
  3990. cp_f='cp'
  3991. ;;
  3992. none)
  3993. ;;
  3994. *)
  3995. die "Unknown OS '$target_os'."
  3996. ;;
  3997. esac
  3998. # determine libc flavour
  3999. probe_libc(){
  4000. pfx=$1
  4001. pfx_no_=${pfx%_}
  4002. # uclibc defines __GLIBC__, so it needs to be checked before glibc.
  4003. if check_${pfx}cpp_condition features.h "defined __UCLIBC__"; then
  4004. eval ${pfx}libc_type=uclibc
  4005. add_${pfx}cppflags -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600
  4006. elif check_${pfx}cpp_condition features.h "defined __GLIBC__"; then
  4007. eval ${pfx}libc_type=glibc
  4008. add_${pfx}cppflags -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600
  4009. # MinGW headers can be installed on Cygwin, so check for newlib first.
  4010. elif check_${pfx}cpp_condition newlib.h "defined _NEWLIB_VERSION"; then
  4011. eval ${pfx}libc_type=newlib
  4012. add_${pfx}cppflags -U__STRICT_ANSI__
  4013. # MinGW64 is backwards compatible with MinGW32, so check for it first.
  4014. elif check_${pfx}cpp_condition _mingw.h "defined __MINGW64_VERSION_MAJOR"; then
  4015. eval ${pfx}libc_type=mingw64
  4016. if check_${pfx}cpp_condition _mingw.h "__MINGW64_VERSION_MAJOR < 3"; then
  4017. add_compat msvcrt/snprintf.o
  4018. add_cflags "-include $source_path/compat/msvcrt/snprintf.h"
  4019. fi
  4020. add_${pfx}cppflags -U__STRICT_ANSI__ -D__USE_MINGW_ANSI_STDIO=1
  4021. eval test \$${pfx_no_}cc_type = "gcc" &&
  4022. add_${pfx}cppflags -D__printf__=__gnu_printf__
  4023. elif check_${pfx}cpp_condition _mingw.h "defined __MINGW_VERSION" ||
  4024. check_${pfx}cpp_condition _mingw.h "defined __MINGW32_VERSION"; then
  4025. eval ${pfx}libc_type=mingw32
  4026. check_${pfx}cpp_condition _mingw.h "__MINGW32_MAJOR_VERSION > 3 || \
  4027. (__MINGW32_MAJOR_VERSION == 3 && __MINGW32_MINOR_VERSION >= 15)" ||
  4028. die "ERROR: MinGW32 runtime version must be >= 3.15."
  4029. add_${pfx}cppflags -U__STRICT_ANSI__ -D__USE_MINGW_ANSI_STDIO=1
  4030. eval test \$${pfx_no_}cc_type = "gcc" &&
  4031. add_${pfx}cppflags -D__printf__=__gnu_printf__
  4032. elif check_${pfx}cpp_condition crtversion.h "defined _VC_CRT_MAJOR_VERSION"; then
  4033. eval ${pfx}libc_type=msvcrt
  4034. # The MSVC 2010 headers (Win 7.0 SDK) set _WIN32_WINNT to
  4035. # 0x601 by default unless something else is set by the user.
  4036. # This can easily lead to us detecting functions only present
  4037. # in such new versions and producing binaries requiring windows 7.0.
  4038. # Therefore explicitly set the default to XP unless the user has
  4039. # set something else on the command line.
  4040. check_${pfx}cpp_condition stdlib.h "defined(_WIN32_WINNT)" ||
  4041. add_${pfx}cppflags -D_WIN32_WINNT=0x0502
  4042. elif check_${pfx}cpp_condition stddef.h "defined __KLIBC__"; then
  4043. eval ${pfx}libc_type=klibc
  4044. elif check_${pfx}cpp_condition sys/cdefs.h "defined __BIONIC__"; then
  4045. eval ${pfx}libc_type=bionic
  4046. elif check_${pfx}cpp_condition sys/brand.h "defined LABELED_BRAND_NAME"; then
  4047. eval ${pfx}libc_type=solaris
  4048. add_${pfx}cppflags -D__EXTENSIONS__ -D_XOPEN_SOURCE=600
  4049. fi
  4050. check_${pfx}cc <<EOF
  4051. #include <time.h>
  4052. void *v = localtime_r;
  4053. EOF
  4054. 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
  4055. #include <time.h>
  4056. void *v = localtime_r;
  4057. EOF
  4058. }
  4059. probe_libc
  4060. test -n "$libc_type" && enable libc_$libc_type
  4061. probe_libc host_
  4062. test -n "$host_libc_type" && enable host_libc_$host_libc_type
  4063. case $libc_type in
  4064. bionic)
  4065. add_compat strtod.o strtod=avpriv_strtod
  4066. ;;
  4067. msvcrt)
  4068. if [ -z "$cl_major_ver" ] || [ $cl_major_ver -le 18 ]; then
  4069. add_compat strtod.o strtod=avpriv_strtod
  4070. add_compat msvcrt/snprintf.o snprintf=avpriv_snprintf \
  4071. _snprintf=avpriv_snprintf \
  4072. vsnprintf=avpriv_vsnprintf
  4073. fi
  4074. ;;
  4075. esac
  4076. # hacks for compiler/libc/os combinations
  4077. if enabled_all tms470 libc_glibc; then
  4078. CPPFLAGS="-I${source_path}/compat/tms470 ${CPPFLAGS}"
  4079. add_cppflags -D__USER_LABEL_PREFIX__=
  4080. add_cppflags -D__builtin_memset=memset
  4081. add_cppflags -D__gnuc_va_list=va_list -D_VA_LIST_DEFINED
  4082. add_cflags -pds=48 # incompatible redefinition of macro
  4083. fi
  4084. if enabled_all ccc libc_glibc; then
  4085. add_ldflags -Wl,-z,now # calls to libots crash without this
  4086. fi
  4087. check_compile_assert flt_lim "float.h limits.h" "DBL_MAX == (double)DBL_MAX" ||
  4088. add_cppflags '-I\$(SRC_PATH)/compat/float'
  4089. esc(){
  4090. echo "$*" | sed 's/%/%25/g;s/:/%3a/g'
  4091. }
  4092. echo "config:$arch:$subarch:$cpu:$target_os:$(esc $cc_ident):$(esc $FFMPEG_CONFIGURATION)" >config.fate
  4093. check_cpp_condition stdlib.h "defined(__PIC__) || defined(__pic__) || defined(PIC)" && enable_weak pic
  4094. set_default libdir
  4095. : ${shlibdir_default:="$libdir"}
  4096. set_default $PATHS_LIST
  4097. set_default nm
  4098. # we need to build at least one lib type
  4099. if ! enabled_any static shared; then
  4100. cat <<EOF
  4101. At least one library type must be built.
  4102. Specify --enable-static to build the static libraries or --enable-shared to
  4103. build the shared libraries as well. To only build the shared libraries specify
  4104. --disable-static in addition to --enable-shared.
  4105. EOF
  4106. exit 1;
  4107. fi
  4108. die_license_disabled() {
  4109. enabled $1 || { enabled $2 && die "$2 is $1 and --enable-$1 is not specified."; }
  4110. }
  4111. die_license_disabled_gpl() {
  4112. enabled $1 || { enabled $2 && die "$2 is incompatible with the gpl and --enable-$1 is not specified."; }
  4113. }
  4114. die_license_disabled gpl frei0r
  4115. die_license_disabled gpl libcdio
  4116. die_license_disabled gpl libsmbclient
  4117. die_license_disabled gpl libutvideo
  4118. die_license_disabled gpl libvidstab
  4119. die_license_disabled gpl libx264
  4120. die_license_disabled gpl libx265
  4121. die_license_disabled gpl libxavs
  4122. die_license_disabled gpl libxvid
  4123. die_license_disabled gpl libzvbi
  4124. die_license_disabled gpl x11grab
  4125. die_license_disabled nonfree libaacplus
  4126. die_license_disabled nonfree libfaac
  4127. die_license_disabled nonfree nvenc
  4128. enabled gpl && die_license_disabled_gpl nonfree libfdk_aac
  4129. enabled gpl && die_license_disabled_gpl nonfree openssl
  4130. die_license_disabled version3 libopencore_amrnb
  4131. die_license_disabled version3 libopencore_amrwb
  4132. die_license_disabled version3 libsmbclient
  4133. die_license_disabled version3 libvo_aacenc
  4134. die_license_disabled version3 libvo_amrwbenc
  4135. enabled version3 && { enabled gpl && enable gplv3 || enable lgplv3; }
  4136. disabled optimizations || check_cflags -fomit-frame-pointer
  4137. enable_weak_pic() {
  4138. disabled pic && return
  4139. enable pic
  4140. add_cppflags -DPIC
  4141. case "$target_os" in
  4142. mingw*|cygwin*)
  4143. ;;
  4144. *)
  4145. add_cflags -fPIC
  4146. ;;
  4147. esac
  4148. add_asflags -fPIC
  4149. }
  4150. enabled pic && enable_weak_pic
  4151. check_cc <<EOF || die "Symbol mangling check failed."
  4152. int ff_extern;
  4153. EOF
  4154. sym=$($nm $TMPO | awk '/ff_extern/{ print substr($0, match($0, /[^ \t]*ff_extern/)) }')
  4155. extern_prefix=${sym%%ff_extern*}
  4156. check_cc <<EOF && enable_weak inline_asm
  4157. void foo(void) { __asm__ volatile ("" ::); }
  4158. EOF
  4159. _restrict=
  4160. for restrict_keyword in restrict __restrict__ __restrict; do
  4161. check_cc <<EOF && _restrict=$restrict_keyword && break
  4162. void foo(char * $restrict_keyword p);
  4163. EOF
  4164. done
  4165. check_cc <<EOF && enable pragma_deprecated
  4166. void foo(void) { _Pragma("GCC diagnostic ignored \"-Wdeprecated-declarations\"") }
  4167. EOF
  4168. check_cc <<EOF && enable attribute_packed
  4169. struct { int x; } __attribute__((packed)) x;
  4170. EOF
  4171. check_cc <<EOF && enable attribute_may_alias
  4172. union { int x; } __attribute__((may_alias)) x;
  4173. EOF
  4174. check_cc <<EOF || die "endian test failed"
  4175. unsigned int endian = 'B' << 24 | 'I' << 16 | 'G' << 8 | 'E';
  4176. EOF
  4177. od -t x1 $TMPO | grep -q '42 *49 *47 *45' && enable bigendian
  4178. if [ "$cpu" = "power7" ] || [ "$cpu" = "power8" ] || enabled ppc64; then
  4179. if ! enabled bigendian && enabled altivec ;then
  4180. enable vsx
  4181. fi
  4182. fi
  4183. check_gas() {
  4184. log "check_gas using '$as' as AS"
  4185. # :vararg is used on aarch64, arm and ppc altivec
  4186. check_as <<EOF || return 1
  4187. .macro m n, y:vararg=0
  4188. \n: .int \y
  4189. .endm
  4190. m x
  4191. EOF
  4192. # .altmacro is only used in arm asm
  4193. ! enabled arm || check_as <<EOF || return 1
  4194. .altmacro
  4195. EOF
  4196. enable gnu_as
  4197. return 0
  4198. }
  4199. if enabled_any arm aarch64 || enabled_all ppc altivec && enabled asm; then
  4200. nogas=:
  4201. enabled_any arm aarch64 && nogas=die
  4202. enabled_all ppc altivec && [ $target_os_default != aix ] && nogas=warn
  4203. as_noop=-v
  4204. case $as_type in
  4205. arm*) gaspp_as_type=armasm; as_noop=-h ;;
  4206. gcc) gaspp_as_type=gas ;;
  4207. *) gaspp_as_type=$as_type ;;
  4208. esac
  4209. [ $target_os = "darwin" ] && gaspp_as_type="apple-$gaspp_as_type"
  4210. test "${as#*gas-preprocessor.pl}" != "$as" ||
  4211. check_cmd gas-preprocessor.pl -arch $arch -as-type $gaspp_as_type -- ${as:=$cc} $as_noop &&
  4212. gas="${gas:=gas-preprocessor.pl} -arch $arch -as-type $gaspp_as_type -- ${as:=$cc}"
  4213. if ! check_gas ; then
  4214. as=${gas:=$as}
  4215. check_gas || \
  4216. $nogas "GNU assembler not found, install/update gas-preprocessor"
  4217. fi
  4218. check_as <<EOF && enable as_func
  4219. .func test
  4220. .endfunc
  4221. EOF
  4222. fi
  4223. check_inline_asm inline_asm_labels '"1:\n"'
  4224. check_inline_asm inline_asm_nonlocal_labels '"Label:\n"'
  4225. if enabled aarch64; then
  4226. enabled armv8 && check_insn armv8 'prfm pldl1strm, [x0]'
  4227. # internal assembler in clang 3.3 does not support this instruction
  4228. enabled neon && check_insn neon 'ext v0.8B, v0.8B, v1.8B, #1'
  4229. enabled vfp && check_insn vfp 'fmadd d0, d0, d1, d2'
  4230. map 'enabled_any ${v}_external ${v}_inline || disable $v' $ARCH_EXT_LIST_ARM
  4231. elif enabled alpha; then
  4232. check_cflags -mieee
  4233. elif enabled arm; then
  4234. check_cpp_condition stddef.h "defined __thumb__" && check_cc <<EOF && enable_weak thumb
  4235. float func(float a, float b){ return a+b; }
  4236. EOF
  4237. enabled thumb && check_cflags -mthumb || check_cflags -marm
  4238. if check_cpp_condition stddef.h "defined __ARM_PCS_VFP"; then
  4239. enable vfp_args
  4240. elif ! check_cpp_condition stddef.h "defined __ARM_PCS || defined __SOFTFP__"; then
  4241. case "${cross_prefix:-$cc}" in
  4242. *hardfloat*) enable vfp_args; fpabi=vfp ;;
  4243. *) check_ld "cc" <<EOF && enable vfp_args && fpabi=vfp || fpabi=soft ;;
  4244. __asm__ (".eabi_attribute 28, 1");
  4245. int main(void) { return 0; }
  4246. EOF
  4247. esac
  4248. warn "Compiler does not indicate floating-point ABI, guessing $fpabi."
  4249. fi
  4250. enabled armv5te && check_insn armv5te 'qadd r0, r0, r0'
  4251. enabled armv6 && check_insn armv6 'sadd16 r0, r0, r0'
  4252. enabled armv6t2 && check_insn armv6t2 'movt r0, #0'
  4253. enabled neon && check_insn neon 'vadd.i16 q0, q0, q0'
  4254. enabled vfp && check_insn vfp 'fadds s0, s0, s0'
  4255. enabled vfpv3 && check_insn vfpv3 'vmov.f32 s0, #1.0'
  4256. enabled setend && check_insn setend 'setend be'
  4257. [ $target_os = linux ] || [ $target_os = android ] ||
  4258. map 'enabled_any ${v}_external ${v}_inline || disable $v' \
  4259. $ARCH_EXT_LIST_ARM
  4260. check_inline_asm asm_mod_q '"add r0, %Q0, %R0" :: "r"((long long)0)'
  4261. check_as <<EOF && enable as_dn_directive
  4262. ra .dn d0.i16
  4263. .unreq ra
  4264. EOF
  4265. # llvm's integrated assembler supports .object_arch from llvm 3.5
  4266. [ "$objformat" = elf ] && check_as <<EOF && enable as_object_arch
  4267. .object_arch armv4
  4268. EOF
  4269. [ $target_os != win32 ] && enabled_all armv6t2 shared !pic && enable_weak_pic
  4270. elif enabled mips; then
  4271. check_inline_asm loongson '"dmult.g $1, $2, $3"'
  4272. # Enable minimum ISA based on selected options
  4273. if enabled mips64 && (enabled mipsdspr1 || enabled mipsdspr2); then
  4274. add_cflags "-mips64r2"
  4275. add_asflags "-mips64r2"
  4276. elif enabled mips64 && enabled mipsfpu; then
  4277. add_cflags "-mips64"
  4278. add_asflags "-mips64"
  4279. elif enabled mipsdspr1 || enabled mipsdspr2; then
  4280. add_cflags "-mips32r2 -mfp32"
  4281. add_asflags "-mips32r2 -mfp32"
  4282. elif enabled mips32r5 || enabled mips64r6; then
  4283. check_cflags "-mfp64"
  4284. check_ldflags "-mfp64"
  4285. fi
  4286. enabled mips32r5 && check_cflags "-mips32r5 -msched-weight -mload-store-pairs -funroll-loops" &&
  4287. check_ldflags "-mips32r5" &&
  4288. check_inline_asm mips32r5 '"ulw $t0, ($t1)"'
  4289. enabled mips64r6 && check_cflags "-mips64r6 -msched-weight -mload-store-pairs -funroll-loops" &&
  4290. check_ldflags "-mips64r6" &&
  4291. check_inline_asm mips64r6 '"aui $t0, $t1, 1"'
  4292. enabled mipsdspr1 && add_cflags "-mdsp" && add_asflags "-mdsp" &&
  4293. check_inline_asm mipsdspr1 '"addu.qb $t0, $t1, $t2"'
  4294. enabled mipsdspr2 && add_cflags "-mdspr2" && add_asflags "-mdspr2" &&
  4295. check_inline_asm mipsdspr2 '"absq_s.qb $t0, $t1"'
  4296. enabled mipsfpu && add_cflags "-mhard-float" && add_asflags "-mhard-float" &&
  4297. check_inline_asm mipsfpu '"madd.d $f0, $f2, $f4, $f6"'
  4298. enabled msa && check_cflags "-mmsa" && check_ldflags "-mmsa" &&
  4299. check_inline_asm msa '"addvi.b $w0, $w1, 1"'
  4300. enabled mips32r5 && add_asflags "-mips32r5 -mfp64"
  4301. enabled mips64r6 && add_asflags "-mips64r6 -mfp64"
  4302. enabled msa && add_asflags "-mmsa"
  4303. elif enabled parisc; then
  4304. if enabled gcc; then
  4305. case $($cc -dumpversion) in
  4306. 4.[3-9].*) check_cflags -fno-optimize-sibling-calls ;;
  4307. esac
  4308. fi
  4309. elif enabled ppc; then
  4310. enable local_aligned_8 local_aligned_16 local_aligned_32
  4311. check_inline_asm dcbzl '"dcbzl 0, %0" :: "r"(0)'
  4312. check_inline_asm ibm_asm '"add 0, 0, 0"'
  4313. check_inline_asm ppc4xx '"maclhw r10, r11, r12"'
  4314. check_inline_asm xform_asm '"lwzx %1, %y0" :: "Z"(*(int*)0), "r"(0)'
  4315. # AltiVec flags: The FSF version of GCC differs from the Apple version
  4316. if enabled altivec; then
  4317. check_cflags -maltivec -mabi=altivec &&
  4318. { check_header altivec.h && inc_altivec_h="#include <altivec.h>" ; } ||
  4319. check_cflags -faltivec
  4320. # check if our compiler supports Motorola AltiVec C API
  4321. check_cc <<EOF || disable altivec
  4322. $inc_altivec_h
  4323. int main(void) {
  4324. vector signed int v1 = (vector signed int) { 0 };
  4325. vector signed int v2 = (vector signed int) { 1 };
  4326. v1 = vec_add(v1, v2);
  4327. return 0;
  4328. }
  4329. EOF
  4330. enabled altivec || warn "Altivec disabled, possibly missing --cpu flag"
  4331. fi
  4332. if enabled vsx; then
  4333. check_cflags -mvsx
  4334. fi
  4335. elif enabled x86; then
  4336. check_builtin rdtsc intrin.h "__rdtsc()"
  4337. check_builtin mm_empty mmintrin.h "_mm_empty()"
  4338. enable local_aligned_8 local_aligned_16 local_aligned_32
  4339. # check whether EBP is available on x86
  4340. # As 'i' is stored on the stack, this program will crash
  4341. # if the base pointer is used to access it because the
  4342. # base pointer is cleared in the inline assembly code.
  4343. check_exec_crash <<EOF && enable ebp_available
  4344. volatile int i=0;
  4345. __asm__ volatile ("xorl %%ebp, %%ebp" ::: "%ebp");
  4346. return i;
  4347. EOF
  4348. # check whether EBX is available on x86
  4349. check_inline_asm ebx_available '""::"b"(0)' &&
  4350. check_inline_asm ebx_available '"":::"%ebx"'
  4351. # check whether xmm clobbers are supported
  4352. check_inline_asm xmm_clobbers '"":::"%xmm0"'
  4353. check_inline_asm inline_asm_direct_symbol_refs '"movl '$extern_prefix'test, %eax"' ||
  4354. check_inline_asm inline_asm_direct_symbol_refs '"movl '$extern_prefix'test(%rip), %eax"'
  4355. # check whether binutils is new enough to compile SSSE3/MMXEXT
  4356. enabled ssse3 && check_inline_asm ssse3_inline '"pabsw %xmm0, %xmm0"'
  4357. enabled mmxext && check_inline_asm mmxext_inline '"pmaxub %mm0, %mm1"'
  4358. if ! disabled_any asm mmx yasm; then
  4359. if check_cmd $yasmexe --version; then
  4360. enabled x86_64 && yasm_extra="-m amd64"
  4361. yasm_debug="-g dwarf2"
  4362. elif check_cmd nasm -v; then
  4363. yasmexe=nasm
  4364. yasm_debug="-g -F dwarf"
  4365. if enabled x86_64; then
  4366. case "$objformat" in
  4367. elf) objformat=elf64 ;;
  4368. win32) objformat=win64 ;;
  4369. esac
  4370. fi
  4371. fi
  4372. YASMFLAGS="-f $objformat $yasm_extra"
  4373. enabled pic && append YASMFLAGS "-DPIC"
  4374. test -n "$extern_prefix" && append YASMFLAGS "-DPREFIX"
  4375. case "$objformat" in
  4376. elf*) enabled debug && append YASMFLAGS $yasm_debug ;;
  4377. esac
  4378. check_yasm "movbe ecx, [5]" && enable yasm ||
  4379. die "yasm/nasm not found or too old. Use --disable-yasm for a crippled build."
  4380. check_yasm "vextracti128 xmm0, ymm0, 0" || disable avx2_external
  4381. check_yasm "vpmacsdd xmm0, xmm1, xmm2, xmm3" || disable xop_external
  4382. check_yasm "vfmaddps ymm0, ymm1, ymm2, ymm3" || disable fma4_external
  4383. check_yasm "CPU amdnop" || disable cpunop
  4384. fi
  4385. case "$cpu" in
  4386. athlon*|opteron*|k8*|pentium|pentium-mmx|prescott|nocona|atom|geode)
  4387. disable fast_clz
  4388. ;;
  4389. esac
  4390. fi
  4391. check_code cc arm_neon.h "int16x8_t test = vdupq_n_s16(0)" && enable intrinsics_neon
  4392. check_ldflags -Wl,--as-needed
  4393. check_ldflags -Wl,-z,noexecstack
  4394. if check_func dlopen; then
  4395. ldl=
  4396. elif check_func dlopen -ldl; then
  4397. ldl=-ldl
  4398. fi
  4399. frei0r_filter_extralibs='$ldl'
  4400. frei0r_src_filter_extralibs='$ldl'
  4401. ladspa_filter_extralibs='$ldl'
  4402. nvenc_encoder_extralibs='$ldl'
  4403. if ! disabled network; then
  4404. check_func getaddrinfo $network_extralibs
  4405. check_func getservbyport $network_extralibs
  4406. check_func inet_aton $network_extralibs
  4407. check_type netdb.h "struct addrinfo"
  4408. check_type netinet/in.h "struct group_source_req" -D_BSD_SOURCE
  4409. check_type netinet/in.h "struct ip_mreq_source" -D_BSD_SOURCE
  4410. check_type netinet/in.h "struct ipv6_mreq" -D_DARWIN_C_SOURCE
  4411. check_type poll.h "struct pollfd"
  4412. check_type netinet/sctp.h "struct sctp_event_subscribe"
  4413. check_struct "sys/types.h sys/socket.h" "struct sockaddr" sa_len
  4414. check_type netinet/in.h "struct sockaddr_in6"
  4415. check_type "sys/types.h sys/socket.h" "struct sockaddr_storage"
  4416. check_type "sys/types.h sys/socket.h" socklen_t
  4417. # Prefer arpa/inet.h over winsock2
  4418. if check_header arpa/inet.h ; then
  4419. check_func closesocket
  4420. elif check_header winsock2.h ; then
  4421. check_func_headers winsock2.h closesocket -lws2 &&
  4422. network_extralibs="-lws2" ||
  4423. { check_func_headers winsock2.h closesocket -lws2_32 &&
  4424. network_extralibs="-lws2_32"; } || disable winsock2_h network
  4425. check_func_headers ws2tcpip.h getaddrinfo $network_extralibs
  4426. check_type ws2tcpip.h socklen_t
  4427. check_type ws2tcpip.h "struct addrinfo"
  4428. check_type ws2tcpip.h "struct group_source_req"
  4429. check_type ws2tcpip.h "struct ip_mreq_source"
  4430. check_type ws2tcpip.h "struct ipv6_mreq"
  4431. check_type winsock2.h "struct pollfd"
  4432. check_struct winsock2.h "struct sockaddr" sa_len
  4433. check_type ws2tcpip.h "struct sockaddr_in6"
  4434. check_type ws2tcpip.h "struct sockaddr_storage"
  4435. else
  4436. disable network
  4437. fi
  4438. fi
  4439. check_builtin atomic_cas_ptr atomic.h "void **ptr; void *oldval, *newval; atomic_cas_ptr(ptr, oldval, newval)"
  4440. check_builtin atomic_compare_exchange "" "int *ptr, *oldval; int newval; __atomic_compare_exchange_n(ptr, oldval, newval, 0, __ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST)"
  4441. check_builtin machine_rw_barrier mbarrier.h "__machine_rw_barrier()"
  4442. check_builtin MemoryBarrier windows.h "MemoryBarrier()"
  4443. check_builtin sarestart signal.h "SA_RESTART"
  4444. check_builtin sync_val_compare_and_swap "" "int *ptr; int oldval, newval; __sync_val_compare_and_swap(ptr, oldval, newval)"
  4445. check_func_headers malloc.h _aligned_malloc && enable aligned_malloc
  4446. check_func ${malloc_prefix}memalign && enable memalign
  4447. check_func ${malloc_prefix}posix_memalign && enable posix_memalign
  4448. check_func access
  4449. check_func_headers time.h clock_gettime || { check_func_headers time.h clock_gettime -lrt && add_extralibs -lrt && LIBRT="-lrt"; }
  4450. check_func fcntl
  4451. check_func fork
  4452. check_func gethrtime
  4453. check_func getopt
  4454. check_func getrusage
  4455. check_func gettimeofday
  4456. check_func gmtime_r
  4457. check_func isatty
  4458. check_func localtime_r
  4459. check_func mach_absolute_time
  4460. check_func mkstemp
  4461. check_func mmap
  4462. check_func mprotect
  4463. # Solaris has nanosleep in -lrt, OpenSolaris no longer needs that
  4464. check_func_headers time.h nanosleep || { check_func_headers time.h nanosleep -lrt && add_extralibs -lrt && LIBRT="-lrt"; }
  4465. check_func sched_getaffinity
  4466. check_func setrlimit
  4467. check_struct "sys/stat.h" "struct stat" st_mtim.tv_nsec -D_BSD_SOURCE
  4468. check_func strerror_r
  4469. check_func sysconf
  4470. check_func sysctl
  4471. check_func usleep
  4472. check_func_headers conio.h kbhit
  4473. check_func_headers io.h setmode
  4474. check_func_headers lzo/lzo1x.h lzo1x_999_compress
  4475. check_func_headers stdlib.h getenv
  4476. check_func_headers windows.h CoTaskMemFree -lole32
  4477. check_func_headers windows.h GetProcessAffinityMask
  4478. check_func_headers windows.h GetProcessTimes
  4479. check_func_headers windows.h GetSystemTimeAsFileTime
  4480. check_func_headers windows.h MapViewOfFile
  4481. check_func_headers windows.h PeekNamedPipe
  4482. check_func_headers windows.h SetConsoleTextAttribute
  4483. check_func_headers windows.h Sleep
  4484. check_func_headers windows.h VirtualAlloc
  4485. check_struct windows.h "CONDITION_VARIABLE" Ptr
  4486. check_func_headers glob.h glob
  4487. enabled xlib &&
  4488. check_func_headers "X11/Xlib.h X11/extensions/Xvlib.h" XvGetPortAttribute -lXv -lX11 -lXext
  4489. check_header direct.h
  4490. check_header dlfcn.h
  4491. check_header dxva.h
  4492. check_header dxva2api.h -D_WIN32_WINNT=0x0600
  4493. check_header io.h
  4494. check_header libcrystalhd/libcrystalhd_if.h
  4495. check_header mach/mach_time.h
  4496. check_header malloc.h
  4497. check_header net/udplite.h
  4498. check_header poll.h
  4499. check_header sys/mman.h
  4500. check_header sys/param.h
  4501. check_header sys/resource.h
  4502. check_header sys/select.h
  4503. check_header sys/time.h
  4504. check_header sys/un.h
  4505. check_header termios.h
  4506. check_header unistd.h
  4507. check_header vdpau/vdpau.h
  4508. check_header vdpau/vdpau_x11.h
  4509. check_header VideoDecodeAcceleration/VDADecoder.h
  4510. check_header windows.h
  4511. check_header X11/extensions/XvMClib.h
  4512. check_header asm/types.h
  4513. check_lib2 "windows.h shellapi.h" CommandLineToArgvW -lshell32
  4514. check_lib2 "windows.h wincrypt.h" CryptGenRandom -ladvapi32
  4515. check_lib2 "windows.h psapi.h" GetProcessMemoryInfo -lpsapi
  4516. check_struct "sys/time.h sys/resource.h" "struct rusage" ru_maxrss
  4517. check_type "windows.h dxva.h" "DXVA_PicParams_HEVC"
  4518. if ! disabled w32threads && ! enabled pthreads; then
  4519. check_func_headers "windows.h process.h" _beginthreadex &&
  4520. enable w32threads || disable w32threads
  4521. fi
  4522. # check for some common methods of building with pthread support
  4523. # do this before the optional library checks as some of them require pthreads
  4524. if ! disabled pthreads && ! enabled w32threads && ! enabled os2threads; then
  4525. enable pthreads
  4526. if check_func pthread_join -pthread && check_func pthread_create -pthread; then
  4527. add_cflags -pthread
  4528. add_extralibs -pthread
  4529. elif check_func pthread_join -pthreads && check_func pthread_create -pthreads; then
  4530. add_cflags -pthreads
  4531. add_extralibs -pthreads
  4532. elif check_func pthread_join -ldl -pthread && check_func pthread_create -ldl -pthread; then
  4533. add_cflags -ldl -pthread
  4534. add_extralibs -ldl -pthread
  4535. elif check_func pthread_join -lpthreadGC2 && check_func pthread_create -lpthreadGC2; then
  4536. add_extralibs -lpthreadGC2
  4537. elif check_lib pthread.h pthread_join -lpthread && check_lib pthread.h pthread_create -lpthread; then
  4538. :
  4539. elif ! check_func pthread_join && ! check_func pthread_create; then
  4540. disable pthreads
  4541. fi
  4542. check_code cc "pthread.h" "static pthread_mutex_t atomic_lock = PTHREAD_MUTEX_INITIALIZER" || disable pthreads
  4543. fi
  4544. if enabled pthreads; then
  4545. check_func pthread_cancel
  4546. fi
  4547. disabled zlib || check_lib zlib.h zlibVersion -lz || disable zlib
  4548. disabled bzlib || check_lib2 bzlib.h BZ2_bzlibVersion -lbz2 || disable bzlib
  4549. disabled lzma || check_lib2 lzma.h lzma_version_number -llzma || disable lzma
  4550. check_lib math.h sin -lm && LIBM="-lm"
  4551. disabled crystalhd || check_lib libcrystalhd/libcrystalhd_if.h DtsCrystalHDVersion -lcrystalhd || disable crystalhd
  4552. atan2f_args=2
  4553. ldexpf_args=2
  4554. powf_args=2
  4555. for func in $MATH_FUNCS; do
  4556. eval check_mathfunc $func \${${func}_args:-1}
  4557. done
  4558. # these are off by default, so fail if requested and not available
  4559. enabled avfoundation_indev && { check_header_oc AVFoundation/AVFoundation.h || disable avfoundation_indev; }
  4560. enabled avfoundation_indev && { check_lib2 CoreGraphics/CoreGraphics.h CGGetActiveDisplayList -framework CoreGraphics ||
  4561. check_lib2 ApplicationServices/ApplicationServices.h CGGetActiveDisplayList -framework ApplicationServices; }
  4562. enabled avisynth && { { check_lib2 "windows.h" LoadLibrary; } ||
  4563. { check_lib2 "dlfcn.h" dlopen -ldl; } ||
  4564. die "ERROR: LoadLibrary/dlopen not found for avisynth"; }
  4565. enabled decklink && { check_header DeckLinkAPI.h || die "ERROR: DeckLinkAPI.h header not found"; }
  4566. enabled frei0r && { check_header frei0r.h || die "ERROR: frei0r.h header not found"; }
  4567. enabled gnutls && require_pkg_config gnutls gnutls/gnutls.h gnutls_global_init
  4568. enabled ladspa && { check_header ladspa.h || die "ERROR: ladspa.h header not found"; }
  4569. enabled libiec61883 && require libiec61883 libiec61883/iec61883.h iec61883_cmp_connect -lraw1394 -lavc1394 -lrom1394 -liec61883
  4570. enabled libaacplus && require "libaacplus >= 2.0.0" aacplus.h aacplusEncOpen -laacplus
  4571. enabled libass && require_pkg_config libass ass/ass.h ass_library_init
  4572. enabled libbluray && require_pkg_config libbluray libbluray/bluray.h bd_open
  4573. enabled libbs2b && require_pkg_config libbs2b bs2b.h bs2b_open
  4574. enabled libcelt && require libcelt celt/celt.h celt_decode -lcelt0 &&
  4575. { check_lib celt/celt.h celt_decoder_create_custom -lcelt0 ||
  4576. die "ERROR: libcelt must be installed and version must be >= 0.11.0."; }
  4577. enabled libcaca && require_pkg_config caca caca.h caca_create_canvas
  4578. enabled libdcadec && require libdcadec libdcadec/dca_context.h dcadec_context_create -ldcadec
  4579. enabled libfaac && require2 libfaac "stdint.h faac.h" faacEncGetVersion -lfaac
  4580. enabled libfdk_aac && require libfdk_aac fdk-aac/aacenc_lib.h aacEncOpen -lfdk-aac
  4581. 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"
  4582. enabled libflite && require2 libflite "flite/flite.h" flite_init $flite_libs
  4583. enabled fontconfig && enable libfontconfig
  4584. enabled libfontconfig && require_pkg_config fontconfig "fontconfig/fontconfig.h" FcInit
  4585. enabled libfreetype && require_libfreetype
  4586. enabled libfribidi && require_pkg_config fribidi fribidi.h fribidi_version_info
  4587. enabled libgme && require libgme gme/gme.h gme_new_emu -lgme -lstdc++
  4588. enabled libgsm && { for gsm_hdr in "gsm.h" "gsm/gsm.h"; do
  4589. check_lib "${gsm_hdr}" gsm_create -lgsm && break;
  4590. done || die "ERROR: libgsm not found"; }
  4591. enabled libilbc && require libilbc ilbc.h WebRtcIlbcfix_InitDecode -lilbc
  4592. enabled libmfx && require_pkg_config libmfx "mfx/mfxvideo.h" MFXInit
  4593. enabled libmodplug && require_pkg_config libmodplug libmodplug/modplug.h ModPlug_Load
  4594. enabled libmp3lame && require "libmp3lame >= 3.98.3" lame/lame.h lame_set_VBR_quality -lmp3lame
  4595. enabled libnut && require libnut libnut.h nut_demuxer_init -lnut
  4596. enabled libopencore_amrnb && require libopencore_amrnb opencore-amrnb/interf_dec.h Decoder_Interface_init -lopencore-amrnb
  4597. enabled libopencore_amrwb && require libopencore_amrwb opencore-amrwb/dec_if.h D_IF_init -lopencore-amrwb
  4598. enabled libopencv && require_pkg_config opencv opencv/cxcore.h cvCreateImageHeader
  4599. enabled libopenh264 && require_pkg_config openh264 wels/codec_api.h WelsGetCodecVersion
  4600. enabled libopenjpeg && { check_lib openjpeg.h opj_version -lopenmj2 -DOPJ_STATIC ||
  4601. check_lib openjpeg-1.5/openjpeg.h opj_version -lopenjpeg -DOPJ_STATIC ||
  4602. check_lib openjpeg.h opj_version -lopenjpeg -DOPJ_STATIC ||
  4603. die "ERROR: libopenjpeg not found"; }
  4604. enabled libopus && require_pkg_config opus opus_multistream.h opus_multistream_decoder_create
  4605. enabled libpulse && require_pkg_config libpulse pulse/pulseaudio.h pa_context_new
  4606. enabled libquvi && require_pkg_config libquvi quvi/quvi.h quvi_init
  4607. enabled librtmp && require_pkg_config librtmp librtmp/rtmp.h RTMP_Socket
  4608. enabled libschroedinger && require_pkg_config schroedinger-1.0 schroedinger/schro.h schro_init
  4609. enabled libshine && require_pkg_config shine shine/layer3.h shine_encode_buffer
  4610. enabled libsmbclient && { use_pkg_config smbclient libsmbclient.h smbc_init ||
  4611. require smbclient libsmbclient.h smbc_init -lsmbclient; }
  4612. enabled libsoxr && require libsoxr soxr.h soxr_create -lsoxr
  4613. enabled libssh && require_pkg_config libssh libssh/sftp.h sftp_init
  4614. enabled libspeex && require_pkg_config speex speex/speex.h speex_decoder_init -lspeex
  4615. enabled libstagefright_h264 && require_cpp libstagefright_h264 "binder/ProcessState.h media/stagefright/MetaData.h
  4616. media/stagefright/MediaBufferGroup.h media/stagefright/MediaDebug.h media/stagefright/MediaDefs.h
  4617. media/stagefright/OMXClient.h media/stagefright/OMXCodec.h" android::OMXClient -lstagefright -lmedia -lutils -lbinder -lgnustl_static
  4618. enabled libtheora && require libtheora theora/theoraenc.h th_info_init -ltheoraenc -ltheoradec -logg
  4619. enabled libtwolame && require libtwolame twolame.h twolame_init -ltwolame &&
  4620. { check_lib twolame.h twolame_encode_buffer_float32_interleaved -ltwolame ||
  4621. die "ERROR: libtwolame must be installed and version must be >= 0.3.10"; }
  4622. enabled libutvideo && require_cpp utvideo "stdint.h stdlib.h utvideo/utvideo.h utvideo/Codec.h" 'CCodec*' -lutvideo -lstdc++
  4623. enabled libv4l2 && require_pkg_config libv4l2 libv4l2.h v4l2_ioctl
  4624. enabled libvidstab && require_pkg_config "vidstab >= 0.98" vid.stab/libvidstab.h vsMotionDetectInit
  4625. enabled libvo_aacenc && require libvo_aacenc vo-aacenc/voAAC.h voGetAACEncAPI -lvo-aacenc
  4626. enabled libvo_amrwbenc && require libvo_amrwbenc vo-amrwbenc/enc_if.h E_IF_init -lvo-amrwbenc
  4627. enabled libvorbis && require libvorbis vorbis/vorbisenc.h vorbis_info_init -lvorbisenc -lvorbis -logg
  4628. enabled libvpx && {
  4629. enabled libvpx_vp8_decoder && { check_lib2 "vpx/vpx_decoder.h vpx/vp8dx.h" vpx_codec_dec_init_ver -lvpx ||
  4630. die "ERROR: libvpx decoder version must be >=0.9.1"; }
  4631. 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 ||
  4632. die "ERROR: libvpx encoder version must be >=0.9.7"; }
  4633. enabled libvpx_vp9_decoder && { check_lib2 "vpx/vpx_decoder.h vpx/vp8dx.h" "vpx_codec_vp9_dx" -lvpx || disable libvpx_vp9_decoder; }
  4634. 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; } }
  4635. enabled libwavpack && require libwavpack wavpack/wavpack.h WavpackOpenFileOutput -lwavpack
  4636. enabled libwebp && require_pkg_config "libwebp >= 0.2.0" webp/encode.h WebPGetEncoderVersion
  4637. enabled libx264 && { use_pkg_config x264 "stdint.h x264.h" x264_encoder_encode ||
  4638. { require libx264 x264.h x264_encoder_encode -lx264 &&
  4639. warn "using libx264 without pkg-config"; } } &&
  4640. { check_cpp_condition x264.h "X264_BUILD >= 118" ||
  4641. die "ERROR: libx264 must be installed and version must be >= 0.118."; }
  4642. enabled libx265 && require_pkg_config x265 x265.h x265_encoder_encode &&
  4643. { check_cpp_condition x265.h "X265_BUILD >= 17" ||
  4644. die "ERROR: libx265 version must be >= 17."; }
  4645. enabled libxavs && require libxavs xavs.h xavs_encoder_encode -lxavs
  4646. enabled libxvid && require libxvid xvid.h xvid_global -lxvidcore
  4647. enabled libzmq && require_pkg_config libzmq zmq.h zmq_ctx_new
  4648. enabled libzvbi && require libzvbi libzvbi.h vbi_decoder_new -lzvbi
  4649. enabled mmal && { check_lib interface/mmal/mmal.h mmal_port_connect -lmmal_core -lmmal_util -lmmal_vc_client -lbcm_host ||
  4650. { ! enabled cross_compile && {
  4651. add_cflags -isystem/opt/vc/include/ -isystem/opt/vc/include/interface/vmcs_host/linux -isystem/opt/vc/include/interface/vcos/pthreads -fgnu89-inline ;
  4652. add_extralibs -L/opt/vc/lib/ -lmmal_core -lmmal_util -lmmal_vc_client -lbcm_host ;
  4653. check_lib interface/mmal/mmal.h mmal_port_connect ; }
  4654. check_lib interface/mmal/mmal.h mmal_port_connect ; } ||
  4655. die "ERROR: mmal not found"; }
  4656. enabled nvenc && { check_header nvEncodeAPI.h || die "ERROR: nvEncodeAPI.h not found."; } &&
  4657. { check_cpp_condition nvEncodeAPI.h "NVENCAPI_MAJOR_VERSION >= 5" ||
  4658. die "ERROR: NVENC API version 4 or older is not supported"; } &&
  4659. { [ $target_os != cygwin ] || die "ERROR: NVENC is not supported on Cygwin currently."; }
  4660. enabled openal && { { for al_libs in "${OPENAL_LIBS}" "-lopenal" "-lOpenAL32"; do
  4661. check_lib 'AL/al.h' alGetError "${al_libs}" && break; done } ||
  4662. die "ERROR: openal not found"; } &&
  4663. { check_cpp_condition "AL/al.h" "defined(AL_VERSION_1_1)" ||
  4664. die "ERROR: openal must be installed and version must be 1.1 or compatible"; }
  4665. enabled opencl && { check_lib2 OpenCL/cl.h clEnqueueNDRangeKernel -Wl,-framework,OpenCL ||
  4666. check_lib2 CL/cl.h clEnqueueNDRangeKernel -lOpenCL ||
  4667. die "ERROR: opencl not found"; } &&
  4668. { check_cpp_condition "OpenCL/cl.h" "defined(CL_VERSION_1_2)" ||
  4669. check_cpp_condition "CL/cl.h" "defined(CL_VERSION_1_2)" ||
  4670. die "ERROR: opencl must be installed and version must be 1.2 or compatible"; }
  4671. enabled opengl && { check_lib GL/glx.h glXGetProcAddress "-lGL" ||
  4672. check_lib2 windows.h wglGetProcAddress "-lopengl32 -lgdi32" ||
  4673. check_lib2 OpenGL/gl3.h glGetError "-Wl,-framework,OpenGL" ||
  4674. check_lib2 ES2/gl.h glGetError "-isysroot=${sysroot} -Wl,-framework,OpenGLES" ||
  4675. die "ERROR: opengl not found."
  4676. }
  4677. enabled openssl && { check_lib openssl/ssl.h SSL_library_init -lssl -lcrypto ||
  4678. check_lib openssl/ssl.h SSL_library_init -lssl32 -leay32 ||
  4679. check_lib openssl/ssl.h SSL_library_init -lssl -lcrypto -lws2_32 -lgdi32 ||
  4680. die "ERROR: openssl not found"; }
  4681. enabled qtkit_indev && { check_header_oc QTKit/QTKit.h || disable qtkit_indev; }
  4682. if enabled gnutls; then
  4683. { check_lib nettle/bignum.h nettle_mpz_get_str_256 -lnettle -lhogweed -lgmp && enable nettle; } ||
  4684. { check_lib gcrypt.h gcry_mpi_new -lgcrypt && enable gcrypt; }
  4685. fi
  4686. # libdc1394 check
  4687. if enabled libdc1394; then
  4688. { require_pkg_config libdc1394-2 dc1394/dc1394.h dc1394_new &&
  4689. enable libdc1394_2; } ||
  4690. { check_lib libdc1394/dc1394_control.h dc1394_create_handle -ldc1394_control -lraw1394 &&
  4691. enable libdc1394_1; } ||
  4692. die "ERROR: No version of libdc1394 found "
  4693. fi
  4694. if ! disabled sdl; then
  4695. SDL_CONFIG="${cross_prefix}sdl-config"
  4696. if check_pkg_config sdl SDL_events.h SDL_PollEvent; then
  4697. check_cpp_condition SDL.h "(SDL_MAJOR_VERSION<<16 | SDL_MINOR_VERSION<<8 | SDL_PATCHLEVEL) >= 0x010201" $sdl_cflags &&
  4698. check_cpp_condition SDL.h "(SDL_MAJOR_VERSION<<16 | SDL_MINOR_VERSION<<8 | SDL_PATCHLEVEL) < 0x010300" $sdl_cflags &&
  4699. enable sdl
  4700. else
  4701. if "${SDL_CONFIG}" --version > /dev/null 2>&1; then
  4702. sdl_cflags=$("${SDL_CONFIG}" --cflags)
  4703. sdl_libs=$("${SDL_CONFIG}" --libs)
  4704. check_func_headers SDL_version.h SDL_Linked_Version $sdl_cflags $sdl_libs &&
  4705. check_cpp_condition SDL.h "(SDL_MAJOR_VERSION<<16 | SDL_MINOR_VERSION<<8 | SDL_PATCHLEVEL) >= 0x010201" $sdl_cflags &&
  4706. check_cpp_condition SDL.h "(SDL_MAJOR_VERSION<<16 | SDL_MINOR_VERSION<<8 | SDL_PATCHLEVEL) < 0x010300" $sdl_cflags &&
  4707. enable sdl
  4708. elif enabled sdl ; then
  4709. die "ERROR: SDL not found"
  4710. else
  4711. disable sdl
  4712. fi
  4713. fi
  4714. fi
  4715. enabled sdl && add_cflags $sdl_cflags && add_extralibs $sdl_libs
  4716. makeinfo --version > /dev/null 2>&1 && enable makeinfo || disable makeinfo
  4717. enabled makeinfo && (makeinfo --version | \
  4718. grep -q 'makeinfo (GNU texinfo) 5' > /dev/null 2>&1) \
  4719. && enable makeinfo_html || disable makeinfo_html
  4720. disabled makeinfo_html && texi2html --help 2> /dev/null | grep -q 'init-file' && enable texi2html || disable texi2html
  4721. perl -v > /dev/null 2>&1 && enable perl || disable perl
  4722. pod2man --help > /dev/null 2>&1 && enable pod2man || disable pod2man
  4723. rsync --help 2> /dev/null | grep -q 'contimeout' && enable rsync_contimeout || disable rsync_contimeout
  4724. check_header linux/fb.h
  4725. check_header linux/videodev.h
  4726. check_header linux/videodev2.h
  4727. check_code cc linux/videodev2.h "struct v4l2_frmsizeenum vfse; vfse.discrete.width = 0;" && enable_safe struct_v4l2_frmivalenum_discrete
  4728. check_header sys/videoio.h
  4729. check_code cc sys/videoio.h "struct v4l2_frmsizeenum vfse; vfse.discrete.width = 0;" && enable_safe struct_v4l2_frmivalenum_discrete
  4730. check_func_headers "windows.h vfw.h" capCreateCaptureWindow "$vfwcap_indev_extralibs"
  4731. # check that WM_CAP_DRIVER_CONNECT is defined to the proper value
  4732. # w32api 3.12 had it defined wrong
  4733. check_cpp_condition vfw.h "WM_CAP_DRIVER_CONNECT > WM_USER" && enable vfwcap_defines
  4734. check_type "dshow.h" IBaseFilter
  4735. # check for ioctl_meteor.h, ioctl_bt848.h and alternatives
  4736. { check_header dev/bktr/ioctl_meteor.h &&
  4737. check_header dev/bktr/ioctl_bt848.h; } ||
  4738. { check_header machine/ioctl_meteor.h &&
  4739. check_header machine/ioctl_bt848.h; } ||
  4740. { check_header dev/video/meteor/ioctl_meteor.h &&
  4741. check_header dev/video/bktr/ioctl_bt848.h; } ||
  4742. check_header dev/ic/bt8xx.h
  4743. check_header sndio.h
  4744. if check_struct sys/soundcard.h audio_buf_info bytes; then
  4745. enable_safe sys/soundcard.h
  4746. else
  4747. check_cc -D__BSD_VISIBLE -D__XSI_VISIBLE <<EOF && add_cppflags -D__BSD_VISIBLE -D__XSI_VISIBLE && enable_safe sys/soundcard.h
  4748. #include <sys/soundcard.h>
  4749. audio_buf_info abc;
  4750. EOF
  4751. fi
  4752. check_header soundcard.h
  4753. enabled_any alsa_indev alsa_outdev &&
  4754. check_lib2 alsa/asoundlib.h snd_pcm_htimestamp -lasound
  4755. enabled jack_indev && check_lib2 jack/jack.h jack_client_open -ljack && check_func sem_timedwait &&
  4756. check_func jack_port_get_latency_range -ljack
  4757. enabled_any sndio_indev sndio_outdev && check_lib2 sndio.h sio_open -lsndio
  4758. if enabled libcdio; then
  4759. check_lib2 "cdio/cdda.h cdio/paranoia.h" cdio_cddap_open -lcdio_paranoia -lcdio_cdda -lcdio ||
  4760. check_lib2 "cdio/paranoia/cdda.h cdio/paranoia/paranoia.h" cdio_cddap_open -lcdio_paranoia -lcdio_cdda -lcdio ||
  4761. die "ERROR: No usable libcdio/cdparanoia found"
  4762. fi
  4763. enabled xlib &&
  4764. check_lib X11/Xlib.h XOpenDisplay -lX11 || disable xlib
  4765. if ! disabled libxcb; then
  4766. check_pkg_config "xcb >= 1.4" xcb/xcb.h xcb_connect || {
  4767. enabled libxcb && die "ERROR: libxcb >= 1.4 not found";
  4768. } && disable x11grab && enable libxcb
  4769. if enabled libxcb; then
  4770. disabled libxcb_shm || {
  4771. check_pkg_config xcb-shm xcb/shm.h xcb_shm_attach || {
  4772. enabled libxcb_shm && die "ERROR: libxcb_shm not found";
  4773. } && check_header sys/shm.h && enable libxcb_shm; }
  4774. disabled libxcb_xfixes || {
  4775. check_pkg_config xcb-xfixes xcb/xfixes.h xcb_xfixes_get_cursor_image || {
  4776. enabled libxcb_xfixes && die "ERROR: libxcb_xfixes not found";
  4777. } && enable libxcb_xfixes; }
  4778. disabled libxcb_shape || {
  4779. check_pkg_config xcb-shape xcb/shape.h xcb_shape_get_rectangles || {
  4780. enabled libxcb_shape && die "ERROR: libxcb_shape not found";
  4781. } && enable libxcb_shape; }
  4782. add_cflags $xcb_cflags $xcb_shm_cflags $xcb_xfixes_cflags $xcb_shape_cflags
  4783. add_extralibs $xcb_libs $xcb_shm_libs $xcb_xfixes_libs $xcb_shape_libs
  4784. fi
  4785. fi
  4786. if enabled x11grab; then
  4787. enabled xlib || die "ERROR: Xlib not found"
  4788. require Xext X11/extensions/XShm.h XShmCreateImage -lXext
  4789. require Xfixes X11/extensions/Xfixes.h XFixesGetCursorImage -lXfixes
  4790. fi
  4791. check_func_headers "windows.h" CreateDIBSection "$gdigrab_indev_extralibs"
  4792. enabled dxva2api_h &&
  4793. check_cc <<EOF && enable dxva2api_cobj
  4794. #define _WIN32_WINNT 0x0600
  4795. #define COBJMACROS
  4796. #include <windows.h>
  4797. #include <d3d9.h>
  4798. #include <dxva2api.h>
  4799. int main(void) { IDirectXVideoDecoder *o = NULL; IDirectXVideoDecoder_Release(o); return 0; }
  4800. EOF
  4801. enabled vaapi &&
  4802. check_lib va/va.h vaInitialize -lva ||
  4803. disable vaapi
  4804. enabled vaapi && enabled xlib &&
  4805. check_lib2 "va/va.h va/va_x11.h" vaGetDisplay -lva -lva-x11 &&
  4806. enable vaapi_x11
  4807. enabled vdpau &&
  4808. check_cpp_condition vdpau/vdpau.h "defined VDP_DECODER_PROFILE_MPEG4_PART2_ASP" ||
  4809. disable vdpau
  4810. enabled vdpau && enabled xlib &&
  4811. check_func_headers "vdpau/vdpau.h vdpau/vdpau_x11.h" vdp_device_create_x11 -lvdpau &&
  4812. prepend ffmpeg_libs $($ldflags_filter "-lvdpau") &&
  4813. enable vdpau_x11
  4814. # Funny iconv installations are not unusual, so check it after all flags have been set
  4815. disabled iconv || check_func_headers iconv.h iconv || check_lib2 iconv.h iconv -liconv || disable iconv
  4816. enabled debug && add_cflags -g"$debuglevel" && add_asflags -g"$debuglevel"
  4817. # add some useful compiler flags if supported
  4818. check_cflags -Wdeclaration-after-statement
  4819. check_cflags -Wall
  4820. check_cflags -Wdisabled-optimization
  4821. check_cflags -Wpointer-arith
  4822. check_cflags -Wredundant-decls
  4823. check_cflags -Wwrite-strings
  4824. check_cflags -Wtype-limits
  4825. check_cflags -Wundef
  4826. check_cflags -Wmissing-prototypes
  4827. check_cflags -Wno-pointer-to-int-cast
  4828. check_cflags -Wstrict-prototypes
  4829. check_cflags -Wempty-body
  4830. enabled extra_warnings && check_cflags -Winline
  4831. check_disable_warning(){
  4832. warning_flag=-W${1#-Wno-}
  4833. test_cflags $warning_flag && add_cflags $1
  4834. }
  4835. check_disable_warning -Wno-parentheses
  4836. check_disable_warning -Wno-switch
  4837. check_disable_warning -Wno-format-zero-length
  4838. check_disable_warning -Wno-pointer-sign
  4839. # add some linker flags
  4840. check_ldflags -Wl,--warn-common
  4841. check_ldflags -Wl,-rpath-link=libpostproc:libswresample:libswscale:libavfilter:libavdevice:libavformat:libavcodec:libavutil:libavresample
  4842. enabled rpath && add_ldexeflags -Wl,-rpath,$libdir
  4843. test_ldflags -Wl,-Bsymbolic && append SHFLAGS -Wl,-Bsymbolic
  4844. # add some strip flags
  4845. # -wN '..@*' is more selective than -x, but not available everywhere.
  4846. check_stripflags -wN \'..@*\' || check_stripflags -x
  4847. enabled neon_clobber_test &&
  4848. check_ldflags -Wl,--wrap,avcodec_open2 \
  4849. -Wl,--wrap,avcodec_decode_audio4 \
  4850. -Wl,--wrap,avcodec_decode_video2 \
  4851. -Wl,--wrap,avcodec_decode_subtitle2 \
  4852. -Wl,--wrap,avcodec_encode_audio2 \
  4853. -Wl,--wrap,avcodec_encode_video2 \
  4854. -Wl,--wrap,avcodec_encode_subtitle \
  4855. -Wl,--wrap,swr_convert \
  4856. -Wl,--wrap,avresample_convert ||
  4857. disable neon_clobber_test
  4858. enabled xmm_clobber_test &&
  4859. check_ldflags -Wl,--wrap,avcodec_open2 \
  4860. -Wl,--wrap,avcodec_decode_audio4 \
  4861. -Wl,--wrap,avcodec_decode_video2 \
  4862. -Wl,--wrap,avcodec_decode_subtitle2 \
  4863. -Wl,--wrap,avcodec_encode_audio2 \
  4864. -Wl,--wrap,avcodec_encode_video \
  4865. -Wl,--wrap,avcodec_encode_video2 \
  4866. -Wl,--wrap,avcodec_encode_subtitle \
  4867. -Wl,--wrap,swr_convert \
  4868. -Wl,--wrap,avresample_convert \
  4869. -Wl,--wrap,sws_scale ||
  4870. disable xmm_clobber_test
  4871. echo "X{};" > $TMPV
  4872. if test_ldflags -Wl,--version-script,$TMPV; then
  4873. append SHFLAGS '-Wl,--version-script,\$(SUBDIR)lib\$(NAME).ver'
  4874. check_cc <<EOF && enable symver_asm_label
  4875. void ff_foo(void) __asm__ ("av_foo@VERSION");
  4876. void ff_foo(void) { ${inline_asm+__asm__($quotes);} }
  4877. EOF
  4878. check_cc <<EOF && enable symver_gnu_asm
  4879. __asm__(".symver ff_foo,av_foo@VERSION");
  4880. void ff_foo(void) {}
  4881. EOF
  4882. fi
  4883. if [ -z "$optflags" ]; then
  4884. if enabled small; then
  4885. optflags=$cflags_size
  4886. elif enabled optimizations; then
  4887. optflags=$cflags_speed
  4888. else
  4889. optflags=$cflags_noopt
  4890. fi
  4891. fi
  4892. check_optflags(){
  4893. check_cflags "$@"
  4894. enabled lto && check_ldflags "$@"
  4895. }
  4896. if enabled lto; then
  4897. test "$cc_type" != "$ld_type" && die "LTO requires same compiler and linker"
  4898. check_cflags -flto
  4899. check_ldflags -flto $cpuflags
  4900. disable inline_asm_direct_symbol_refs
  4901. fi
  4902. check_optflags $optflags
  4903. check_optflags -fno-math-errno
  4904. check_optflags -fno-signed-zeros
  4905. enabled ftrapv && check_cflags -ftrapv
  4906. check_cc -mno-red-zone <<EOF && noredzone_flags="-mno-red-zone"
  4907. int x;
  4908. EOF
  4909. if enabled icc; then
  4910. # Just warnings, no remarks
  4911. check_cflags -w1
  4912. # -wd: Disable following warnings
  4913. # 144, 167, 556: -Wno-pointer-sign
  4914. # 188: enumerated type mixed with another type
  4915. # 1292: attribute "foo" ignored
  4916. # 1419: external declaration in primary source file
  4917. # 10006: ignoring unknown option -fno-signed-zeros
  4918. # 10148: ignoring unknown option -Wno-parentheses
  4919. # 10156: ignoring option '-W'; no argument required
  4920. # 13200: No EMMS instruction before call to function
  4921. # 13203: No EMMS instruction before return from function
  4922. check_cflags -wd144,167,188,556,1292,1419,10006,10148,10156,13200,13203
  4923. # 11030: Warning unknown option --as-needed
  4924. # 10156: ignoring option '-export'; no argument required
  4925. check_ldflags -wd10156,11030
  4926. # icc 11.0 and 11.1 work with ebp_available, but don't pass the test
  4927. enable ebp_available
  4928. # The test above does not test linking
  4929. enabled lto && disable symver_asm_label
  4930. if enabled x86_32; then
  4931. icc_version=$($cc -dumpversion)
  4932. test ${icc_version%%.*} -ge 11 &&
  4933. check_cflags -falign-stack=maintain-16-byte ||
  4934. disable aligned_stack
  4935. fi
  4936. elif enabled ccc; then
  4937. # disable some annoying warnings
  4938. add_cflags -msg_disable bitnotint
  4939. add_cflags -msg_disable mixfuncvoid
  4940. add_cflags -msg_disable nonstandcast
  4941. add_cflags -msg_disable unsupieee
  4942. elif enabled gcc; then
  4943. check_optflags -fno-tree-vectorize
  4944. check_cflags -Werror=format-security
  4945. check_cflags -Werror=implicit-function-declaration
  4946. check_cflags -Werror=missing-prototypes
  4947. check_cflags -Werror=return-type
  4948. check_cflags -Werror=vla
  4949. check_cflags -Wformat
  4950. check_cflags -fdiagnostics-color=auto
  4951. enabled extra_warnings || check_disable_warning -Wno-maybe-uninitialized
  4952. elif enabled llvm_gcc; then
  4953. check_cflags -mllvm -stack-alignment=16
  4954. elif enabled clang; then
  4955. check_cflags -mllvm -stack-alignment=16
  4956. check_cflags -Qunused-arguments
  4957. check_cflags -Werror=implicit-function-declaration
  4958. check_cflags -Werror=missing-prototypes
  4959. check_cflags -Werror=return-type
  4960. elif enabled cparser; then
  4961. add_cflags -Wno-missing-variable-declarations
  4962. add_cflags -Wno-empty-statement
  4963. elif enabled armcc; then
  4964. add_cflags -W${armcc_opt},--diag_suppress=4343 # hardfp compat
  4965. add_cflags -W${armcc_opt},--diag_suppress=3036 # using . as system include dir
  4966. # 2523: use of inline assembly is deprecated
  4967. add_cflags -W${armcc_opt},--diag_suppress=2523
  4968. add_cflags -W${armcc_opt},--diag_suppress=1207
  4969. add_cflags -W${armcc_opt},--diag_suppress=1293 # assignment in condition
  4970. add_cflags -W${armcc_opt},--diag_suppress=3343 # hardfp compat
  4971. add_cflags -W${armcc_opt},--diag_suppress=167 # pointer sign
  4972. add_cflags -W${armcc_opt},--diag_suppress=513 # pointer sign
  4973. elif enabled tms470; then
  4974. add_cflags -pds=824 -pds=837
  4975. disable inline_asm
  4976. elif enabled pathscale; then
  4977. add_cflags -fstrict-overflow -OPT:wrap_around_unsafe_opt=OFF
  4978. elif enabled_any msvc icl; then
  4979. enabled x86_32 && disable aligned_stack
  4980. enabled_all x86_32 debug && add_cflags -Oy-
  4981. enabled debug && add_ldflags -debug
  4982. enable pragma_deprecated
  4983. if enabled icl; then
  4984. # -Qansi-alias is basically -fstrict-aliasing, but does not work
  4985. # (correctly) on icl 13.x.
  4986. check_cpp_condition "windows.h" "__ICL < 1300 || __ICL >= 1400" &&
  4987. add_cflags -Qansi-alias
  4988. # Some inline asm is not compilable in debug
  4989. if enabled debug; then
  4990. disable ebp_available
  4991. disable ebx_available
  4992. fi
  4993. fi
  4994. # msvcrt10 x64 incorrectly enables log2, only msvcrt12 onwards actually has log2.
  4995. check_cpp_condition crtversion.h "_VC_CRT_MAJOR_VERSION >= 12" || disable log2
  4996. fi
  4997. case $as_type in
  4998. clang)
  4999. add_asflags -Qunused-arguments
  5000. ;;
  5001. esac
  5002. case $ld_type in
  5003. clang)
  5004. check_ldflags -Qunused-arguments
  5005. ;;
  5006. esac
  5007. case $target_os in
  5008. osf1)
  5009. enabled ccc && add_ldflags '-Wl,-expect_unresolved,*'
  5010. ;;
  5011. plan9)
  5012. add_cppflags -Dmain=plan9_main
  5013. ;;
  5014. esac
  5015. enable frame_thread_encoder
  5016. enabled asm || { arch=c; disable $ARCH_LIST $ARCH_EXT_LIST; }
  5017. check_deps $CONFIG_LIST \
  5018. $CONFIG_EXTRA \
  5019. $HAVE_LIST \
  5020. $ALL_COMPONENTS \
  5021. 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"
  5022. if test $target_os = "haiku"; then
  5023. disable memalign
  5024. disable posix_memalign
  5025. fi
  5026. enabled_all dxva2 dxva2api_cobj CoTaskMemFree &&
  5027. prepend ffmpeg_libs $($ldflags_filter "-lole32" "-luser32") &&
  5028. enable dxva2_lib
  5029. ! enabled_any memalign posix_memalign aligned_malloc &&
  5030. enabled simd_align_16 && enable memalign_hack
  5031. # add_dep lib dep
  5032. # -> enable ${lib}_deps_${dep}
  5033. # -> add $dep to ${lib}_deps only once
  5034. add_dep() {
  5035. lib=$1
  5036. dep=$2
  5037. enabled "${lib}_deps_${dep}" && return 0
  5038. enable "${lib}_deps_${dep}"
  5039. prepend "${lib}_deps" $dep
  5040. }
  5041. # merge deps lib components
  5042. # merge all ${component}_deps into ${lib}_deps and ${lib}_deps_*
  5043. merge_deps() {
  5044. lib=$1
  5045. shift
  5046. for comp in $*; do
  5047. enabled $comp || continue
  5048. eval "dep=\"\$${comp}_deps\""
  5049. for d in $dep; do
  5050. add_dep $lib $d
  5051. done
  5052. done
  5053. }
  5054. merge_deps libavfilter $FILTER_LIST
  5055. map 'enabled $v && intrinsics=${v#intrinsics_}' $INTRINSICS_LIST
  5056. for thread in $THREADS_LIST; do
  5057. if enabled $thread; then
  5058. test -n "$thread_type" &&
  5059. die "ERROR: Only one thread type must be selected." ||
  5060. thread_type="$thread"
  5061. fi
  5062. done
  5063. enabled zlib && add_cppflags -DZLIB_CONST
  5064. # conditional library dependencies, in linking order
  5065. enabled amovie_filter && prepend avfilter_deps "avformat avcodec"
  5066. enabled aresample_filter && prepend avfilter_deps "swresample"
  5067. enabled asyncts_filter && prepend avfilter_deps "avresample"
  5068. enabled atempo_filter && prepend avfilter_deps "avcodec"
  5069. enabled ebur128_filter && enabled swresample && prepend avfilter_deps "swresample"
  5070. enabled elbg_filter && prepend avfilter_deps "avcodec"
  5071. enabled fftfilt_filter && prepend avfilter_deps "avcodec"
  5072. enabled mcdeint_filter && prepend avfilter_deps "avcodec"
  5073. enabled movie_filter && prepend avfilter_deps "avformat avcodec"
  5074. enabled pan_filter && prepend avfilter_deps "swresample"
  5075. enabled pp_filter && prepend avfilter_deps "postproc"
  5076. enabled removelogo_filter && prepend avfilter_deps "avformat avcodec swscale"
  5077. enabled resample_filter && prepend avfilter_deps "avresample"
  5078. enabled sab_filter && prepend avfilter_deps "swscale"
  5079. enabled scale_filter && prepend avfilter_deps "swscale"
  5080. enabled showspectrum_filter && prepend avfilter_deps "avcodec"
  5081. enabled smartblur_filter && prepend avfilter_deps "swscale"
  5082. enabled subtitles_filter && prepend avfilter_deps "avformat avcodec"
  5083. enabled uspp_filter && prepend avfilter_deps "avcodec"
  5084. enabled lavfi_indev && prepend avdevice_deps "avfilter"
  5085. enabled opus_decoder && prepend avcodec_deps "swresample"
  5086. expand_deps(){
  5087. lib_deps=${1}_deps
  5088. eval "deps=\$$lib_deps"
  5089. append $lib_deps $(map 'eval echo \$${v}_deps' $deps)
  5090. unique $lib_deps
  5091. }
  5092. #we have to remove gpl from the deps here as some code assumes all lib deps are libs
  5093. postproc_deps="$(filter_out 'gpl' $postproc_deps)"
  5094. map 'expand_deps $v' $LIBRARY_LIST
  5095. echo "install prefix $prefix"
  5096. echo "source path $source_path"
  5097. echo "C compiler $cc"
  5098. echo "C library $libc_type"
  5099. if test "$host_cc" != "$cc"; then
  5100. echo "host C compiler $host_cc"
  5101. echo "host C library $host_libc_type"
  5102. fi
  5103. echo "ARCH $arch ($cpu)"
  5104. if test "$build_suffix" != ""; then
  5105. echo "build suffix $build_suffix"
  5106. fi
  5107. if test "$progs_suffix" != ""; then
  5108. echo "progs suffix $progs_suffix"
  5109. fi
  5110. if test "$extra_version" != ""; then
  5111. echo "version string suffix $extra_version"
  5112. fi
  5113. echo "big-endian ${bigendian-no}"
  5114. echo "runtime cpu detection ${runtime_cpudetect-no}"
  5115. if enabled x86; then
  5116. echo "${yasmexe} ${yasm-no}"
  5117. echo "MMX enabled ${mmx-no}"
  5118. echo "MMXEXT enabled ${mmxext-no}"
  5119. echo "3DNow! enabled ${amd3dnow-no}"
  5120. echo "3DNow! extended enabled ${amd3dnowext-no}"
  5121. echo "SSE enabled ${sse-no}"
  5122. echo "SSSE3 enabled ${ssse3-no}"
  5123. echo "AVX enabled ${avx-no}"
  5124. echo "XOP enabled ${xop-no}"
  5125. echo "FMA3 enabled ${fma3-no}"
  5126. echo "FMA4 enabled ${fma4-no}"
  5127. echo "i686 features enabled ${i686-no}"
  5128. echo "CMOV is fast ${fast_cmov-no}"
  5129. echo "EBX available ${ebx_available-no}"
  5130. echo "EBP available ${ebp_available-no}"
  5131. fi
  5132. if enabled aarch64; then
  5133. echo "NEON enabled ${neon-no}"
  5134. echo "VFP enabled ${vfp-no}"
  5135. fi
  5136. if enabled arm; then
  5137. echo "ARMv5TE enabled ${armv5te-no}"
  5138. echo "ARMv6 enabled ${armv6-no}"
  5139. echo "ARMv6T2 enabled ${armv6t2-no}"
  5140. echo "VFP enabled ${vfp-no}"
  5141. echo "NEON enabled ${neon-no}"
  5142. echo "THUMB enabled ${thumb-no}"
  5143. fi
  5144. if enabled mips; then
  5145. echo "MIPS FPU enabled ${mipsfpu-no}"
  5146. echo "MIPS32R5 enabled ${mips32r5-no}"
  5147. echo "MIPS64R6 enabled ${mips64r6-no}"
  5148. echo "MIPS DSP R1 enabled ${mipsdspr1-no}"
  5149. echo "MIPS DSP R2 enabled ${mipsdspr2-no}"
  5150. echo "MIPS MSA enabled ${msa-no}"
  5151. fi
  5152. if enabled ppc; then
  5153. echo "AltiVec enabled ${altivec-no}"
  5154. echo "PPC 4xx optimizations ${ppc4xx-no}"
  5155. echo "PPC VSX optimizations ${vsx-no}"
  5156. echo "dcbzl available ${dcbzl-no}"
  5157. fi
  5158. echo "debug symbols ${debug-no}"
  5159. echo "strip symbols ${stripping-no}"
  5160. echo "optimize for size ${small-no}"
  5161. echo "optimizations ${optimizations-no}"
  5162. echo "static ${static-no}"
  5163. echo "shared ${shared-no}"
  5164. echo "postprocessing support ${postproc-no}"
  5165. echo "new filter support ${avfilter-no}"
  5166. echo "network support ${network-no}"
  5167. echo "threading support ${thread_type-no}"
  5168. echo "safe bitstream reader ${safe_bitstream_reader-no}"
  5169. echo "SDL support ${sdl-no}"
  5170. echo "opencl enabled ${opencl-no}"
  5171. echo "texi2html enabled ${texi2html-no}"
  5172. echo "perl enabled ${perl-no}"
  5173. echo "pod2man enabled ${pod2man-no}"
  5174. echo "makeinfo enabled ${makeinfo-no}"
  5175. echo "makeinfo supports HTML ${makeinfo_html-no}"
  5176. test -n "$random_seed" &&
  5177. echo "random seed ${random_seed}"
  5178. echo
  5179. echo "External libraries:"
  5180. print_enabled '' $EXTERNAL_LIBRARY_LIST | print_3_columns
  5181. echo
  5182. for type in decoder encoder hwaccel parser demuxer muxer protocol filter bsf indev outdev; do
  5183. echo "Enabled ${type}s:"
  5184. eval list=\$$(toupper $type)_LIST
  5185. print_enabled '_*' $list | print_3_columns
  5186. echo
  5187. done
  5188. license="LGPL version 2.1 or later"
  5189. if enabled nonfree; then
  5190. license="nonfree and unredistributable"
  5191. elif enabled gplv3; then
  5192. license="GPL version 3 or later"
  5193. elif enabled lgplv3; then
  5194. license="LGPL version 3 or later"
  5195. elif enabled gpl; then
  5196. license="GPL version 2 or later"
  5197. fi
  5198. echo "License: $license"
  5199. echo "Creating config.mak, config.h, and doc/config.texi..."
  5200. test -e Makefile || echo "include $source_path/Makefile" > Makefile
  5201. enabled stripping || strip="echo skipping strip"
  5202. config_files="$TMPH config.mak doc/config.texi"
  5203. cat > config.mak <<EOF
  5204. # Automatically generated by configure - do not modify!
  5205. ifndef FFMPEG_CONFIG_MAK
  5206. FFMPEG_CONFIG_MAK=1
  5207. FFMPEG_CONFIGURATION=$FFMPEG_CONFIGURATION
  5208. prefix=$prefix
  5209. LIBDIR=\$(DESTDIR)$libdir
  5210. SHLIBDIR=\$(DESTDIR)$shlibdir
  5211. INCDIR=\$(DESTDIR)$incdir
  5212. BINDIR=\$(DESTDIR)$bindir
  5213. DATADIR=\$(DESTDIR)$datadir
  5214. DOCDIR=\$(DESTDIR)$docdir
  5215. MANDIR=\$(DESTDIR)$mandir
  5216. SRC_PATH=$source_path
  5217. ifndef MAIN_MAKEFILE
  5218. SRC_PATH:=\$(SRC_PATH:.%=..%)
  5219. endif
  5220. CC_IDENT=$cc_ident
  5221. ARCH=$arch
  5222. INTRINSICS=$intrinsics
  5223. CC=$cc
  5224. CXX=$cxx
  5225. AS=$as
  5226. LD=$ld
  5227. DEPCC=$dep_cc
  5228. DEPCCFLAGS=$DEPCCFLAGS \$(CPPFLAGS)
  5229. DEPAS=$as
  5230. DEPASFLAGS=$DEPASFLAGS \$(CPPFLAGS)
  5231. YASM=$yasmexe
  5232. DEPYASM=$yasmexe
  5233. AR=$ar
  5234. ARFLAGS=$arflags
  5235. AR_O=$ar_o
  5236. RANLIB=$ranlib
  5237. STRIP=$strip
  5238. CP=cp -p
  5239. LN_S=$ln_s
  5240. CPPFLAGS=$CPPFLAGS
  5241. CFLAGS=$CFLAGS
  5242. CXXFLAGS=$CXXFLAGS
  5243. ASFLAGS=$ASFLAGS
  5244. AS_C=$AS_C
  5245. AS_O=$AS_O
  5246. CC_C=$CC_C
  5247. CC_E=$CC_E
  5248. CC_O=$CC_O
  5249. CXX_C=$CXX_C
  5250. CXX_O=$CXX_O
  5251. LD_O=$LD_O
  5252. LD_LIB=$LD_LIB
  5253. LD_PATH=$LD_PATH
  5254. DLLTOOL=$dlltool
  5255. WINDRES=$windres
  5256. DEPWINDRES=$dep_cc
  5257. DOXYGEN=$doxygen
  5258. LDFLAGS=$LDFLAGS
  5259. LDEXEFLAGS=$LDEXEFLAGS
  5260. SHFLAGS=$(echo $($ldflags_filter $SHFLAGS))
  5261. ASMSTRIPFLAGS=$ASMSTRIPFLAGS
  5262. YASMFLAGS=$YASMFLAGS
  5263. BUILDSUF=$build_suffix
  5264. PROGSSUF=$progs_suffix
  5265. FULLNAME=$FULLNAME
  5266. LIBPREF=$LIBPREF
  5267. LIBSUF=$LIBSUF
  5268. LIBNAME=$LIBNAME
  5269. SLIBPREF=$SLIBPREF
  5270. SLIBSUF=$SLIBSUF
  5271. EXESUF=$EXESUF
  5272. EXTRA_VERSION=$extra_version
  5273. CCDEP=$CCDEP
  5274. CXXDEP=$CXXDEP
  5275. CCDEP_FLAGS=$CCDEP_FLAGS
  5276. ASDEP=$ASDEP
  5277. ASDEP_FLAGS=$ASDEP_FLAGS
  5278. CC_DEPFLAGS=$CC_DEPFLAGS
  5279. AS_DEPFLAGS=$AS_DEPFLAGS
  5280. HOSTCC=$host_cc
  5281. HOSTLD=$host_ld
  5282. HOSTCFLAGS=$host_cflags
  5283. HOSTCPPFLAGS=$host_cppflags
  5284. HOSTEXESUF=$HOSTEXESUF
  5285. HOSTLDFLAGS=$host_ldflags
  5286. HOSTLIBS=$host_libs
  5287. DEPHOSTCC=$host_cc
  5288. DEPHOSTCCFLAGS=$DEPHOSTCCFLAGS \$(HOSTCCFLAGS)
  5289. HOSTCCDEP=$HOSTCCDEP
  5290. HOSTCCDEP_FLAGS=$HOSTCCDEP_FLAGS
  5291. HOSTCC_DEPFLAGS=$HOSTCC_DEPFLAGS
  5292. HOSTCC_C=$HOSTCC_C
  5293. HOSTCC_O=$HOSTCC_O
  5294. HOSTLD_O=$HOSTLD_O
  5295. TARGET_EXEC=$target_exec $target_exec_args
  5296. TARGET_PATH=$target_path
  5297. TARGET_SAMPLES=${target_samples:-\$(SAMPLES)}
  5298. CFLAGS-ffplay=$sdl_cflags
  5299. ZLIB=$($ldflags_filter -lz)
  5300. LIB_INSTALL_EXTRA_CMD=$LIB_INSTALL_EXTRA_CMD
  5301. EXTRALIBS=$extralibs
  5302. COMPAT_OBJS=$compat_objs
  5303. EXEOBJS=$exeobjs
  5304. INSTALL=$install
  5305. LIBTARGET=${LIBTARGET}
  5306. SLIBNAME=${SLIBNAME}
  5307. SLIBNAME_WITH_VERSION=${SLIBNAME_WITH_VERSION}
  5308. SLIBNAME_WITH_MAJOR=${SLIBNAME_WITH_MAJOR}
  5309. SLIB_CREATE_DEF_CMD=${SLIB_CREATE_DEF_CMD}
  5310. SLIB_EXTRA_CMD=${SLIB_EXTRA_CMD}
  5311. SLIB_INSTALL_NAME=${SLIB_INSTALL_NAME}
  5312. SLIB_INSTALL_LINKS=${SLIB_INSTALL_LINKS}
  5313. SLIB_INSTALL_EXTRA_LIB=${SLIB_INSTALL_EXTRA_LIB}
  5314. SLIB_INSTALL_EXTRA_SHLIB=${SLIB_INSTALL_EXTRA_SHLIB}
  5315. SAMPLES:=${samples:-\$(FATE_SAMPLES)}
  5316. NOREDZONE_FLAGS=$noredzone_flags
  5317. EOF
  5318. get_version(){
  5319. lcname=lib${1}
  5320. name=$(toupper $lcname)
  5321. file=$source_path/$lcname/version.h
  5322. eval $(awk "/#define ${name}_VERSION_M/ { print \$2 \"=\" \$3 }" "$file")
  5323. enabled raise_major && eval ${name}_VERSION_MAJOR=$((${name}_VERSION_MAJOR+100))
  5324. eval ${name}_VERSION=\$${name}_VERSION_MAJOR.\$${name}_VERSION_MINOR.\$${name}_VERSION_MICRO
  5325. eval echo "${lcname}_VERSION=\$${name}_VERSION" >> config.mak
  5326. eval echo "${lcname}_VERSION_MAJOR=\$${name}_VERSION_MAJOR" >> config.mak
  5327. eval echo "${lcname}_VERSION_MINOR=\$${name}_VERSION_MINOR" >> config.mak
  5328. }
  5329. map 'get_version $v' $LIBRARY_LIST
  5330. map 'eval echo "${v}_FFLIBS=\$${v}_deps" >> config.mak' $LIBRARY_LIST
  5331. print_program_libs(){
  5332. eval "program_libs=\$${1}_libs"
  5333. eval echo "LIBS-${1}=${program_libs}" >> config.mak
  5334. }
  5335. map 'print_program_libs $v' $PROGRAM_LIST
  5336. cat > $TMPH <<EOF
  5337. /* Automatically generated by configure - do not modify! */
  5338. #ifndef FFMPEG_CONFIG_H
  5339. #define FFMPEG_CONFIG_H
  5340. #define FFMPEG_CONFIGURATION "$(c_escape $FFMPEG_CONFIGURATION)"
  5341. #define FFMPEG_LICENSE "$(c_escape $license)"
  5342. #define CONFIG_THIS_YEAR 2015
  5343. #define FFMPEG_DATADIR "$(eval c_escape $datadir)"
  5344. #define AVCONV_DATADIR "$(eval c_escape $datadir)"
  5345. #define CC_IDENT "$(c_escape ${cc_ident:-Unknown compiler})"
  5346. #define av_restrict $_restrict
  5347. #define EXTERN_PREFIX "${extern_prefix}"
  5348. #define EXTERN_ASM ${extern_prefix}
  5349. #define BUILDSUF "$build_suffix"
  5350. #define SLIBSUF "$SLIBSUF"
  5351. #define HAVE_MMX2 HAVE_MMXEXT
  5352. #define SWS_MAX_FILTER_SIZE $sws_max_filter_size
  5353. EOF
  5354. test -n "$assert_level" &&
  5355. echo "#define ASSERT_LEVEL $assert_level" >>$TMPH
  5356. test -n "$malloc_prefix" &&
  5357. echo "#define MALLOC_PREFIX $malloc_prefix" >>$TMPH
  5358. if enabled yasm; then
  5359. append config_files $TMPASM
  5360. printf '' >$TMPASM
  5361. fi
  5362. enabled getenv || echo "#define getenv(x) NULL" >> $TMPH
  5363. mkdir -p doc
  5364. mkdir -p tests
  5365. echo "@c auto-generated by configure" > doc/config.texi
  5366. print_config ARCH_ "$config_files" $ARCH_LIST
  5367. print_config HAVE_ "$config_files" $HAVE_LIST
  5368. print_config CONFIG_ "$config_files" $CONFIG_LIST \
  5369. $CONFIG_EXTRA \
  5370. $ALL_COMPONENTS \
  5371. echo "#endif /* FFMPEG_CONFIG_H */" >> $TMPH
  5372. echo "endif # FFMPEG_CONFIG_MAK" >> config.mak
  5373. # Do not overwrite an unchanged config.h to avoid superfluous rebuilds.
  5374. cp_if_changed $TMPH config.h
  5375. touch .config
  5376. enabled yasm && cp_if_changed $TMPASM config.asm
  5377. cat > $TMPH <<EOF
  5378. /* Generated by ffconf */
  5379. #ifndef AVUTIL_AVCONFIG_H
  5380. #define AVUTIL_AVCONFIG_H
  5381. EOF
  5382. print_config AV_HAVE_ $TMPH $HAVE_LIST_PUB
  5383. echo "#endif /* AVUTIL_AVCONFIG_H */" >> $TMPH
  5384. cp_if_changed $TMPH libavutil/avconfig.h
  5385. if test -n "$WARNINGS"; then
  5386. printf "\n$WARNINGS"
  5387. enabled fatal_warnings && exit 1
  5388. fi
  5389. # build pkg-config files
  5390. lib_version(){
  5391. eval printf "\"lib${1}${build_suffix} >= \$LIB$(toupper ${1})_VERSION, \""
  5392. }
  5393. pkgconfig_generate(){
  5394. name=$1
  5395. shortname=${name#lib}${build_suffix}
  5396. comment=$2
  5397. version=$3
  5398. libs=$4
  5399. requires=$(map 'lib_version $v' $(eval echo \$${name#lib}_deps))
  5400. requires=${requires%, }
  5401. enabled ${name#lib} || return 0
  5402. mkdir -p $name
  5403. cat <<EOF > $name/$name${build_suffix}.pc
  5404. prefix=$prefix
  5405. exec_prefix=\${prefix}
  5406. libdir=$libdir
  5407. includedir=$incdir
  5408. Name: $name
  5409. Description: $comment
  5410. Version: $version
  5411. Requires: $(enabled shared || echo $requires)
  5412. Requires.private: $(enabled shared && echo $requires)
  5413. Conflicts:
  5414. Libs: -L\${libdir} $(enabled rpath && echo "-Wl,-rpath,\${libdir}") -l${shortname} $(enabled shared || echo $libs)
  5415. Libs.private: $(enabled shared && echo $libs)
  5416. Cflags: -I\${includedir}
  5417. EOF
  5418. mkdir -p doc/examples/pc-uninstalled
  5419. includedir=${source_path}
  5420. [ "$includedir" = . ] && includedir="\${pcfiledir}/../../.."
  5421. cat <<EOF > doc/examples/pc-uninstalled/$name.pc
  5422. prefix=
  5423. exec_prefix=
  5424. libdir=\${pcfiledir}/../../../$name
  5425. includedir=${includedir}
  5426. Name: $name
  5427. Description: $comment
  5428. Version: $version
  5429. Requires: $requires
  5430. Conflicts:
  5431. Libs: -L\${libdir} -Wl,-rpath,\${libdir} -l${shortname} $(enabled shared || echo $libs)
  5432. Cflags: -I\${includedir}
  5433. EOF
  5434. }
  5435. pkgconfig_generate libavutil "FFmpeg utility library" "$LIBAVUTIL_VERSION" "$LIBRT $LIBM"
  5436. pkgconfig_generate libavcodec "FFmpeg codec library" "$LIBAVCODEC_VERSION" "$extralibs"
  5437. pkgconfig_generate libavformat "FFmpeg container format library" "$LIBAVFORMAT_VERSION" "$extralibs"
  5438. pkgconfig_generate libavdevice "FFmpeg device handling library" "$LIBAVDEVICE_VERSION" "$extralibs"
  5439. pkgconfig_generate libavfilter "FFmpeg audio/video filtering library" "$LIBAVFILTER_VERSION" "$extralibs"
  5440. pkgconfig_generate libpostproc "FFmpeg postprocessing library" "$LIBPOSTPROC_VERSION" ""
  5441. pkgconfig_generate libavresample "Libav audio resampling library" "$LIBAVRESAMPLE_VERSION" "$LIBM"
  5442. pkgconfig_generate libswscale "FFmpeg image rescaling library" "$LIBSWSCALE_VERSION" "$LIBM"
  5443. pkgconfig_generate libswresample "FFmpeg audio resampling library" "$LIBSWRESAMPLE_VERSION" "$LIBM"