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.

6056 lines
190KB

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