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.

6091 lines
191KB

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