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.

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