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.

6092 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. enable ldbrx
  3704. ;;
  3705. cell)
  3706. cpuflags="-mcpu=cell"
  3707. enable ldbrx
  3708. disable vsx
  3709. ;;
  3710. e500mc)
  3711. cpuflags="-mcpu=e500mc"
  3712. disable altivec
  3713. ;;
  3714. e500v2)
  3715. cpuflags="-mcpu=8548 -mhard-float -mfloat-gprs=double"
  3716. disable altivec
  3717. disable dcbzl
  3718. ;;
  3719. e500)
  3720. cpuflags="-mcpu=8540 -mhard-float"
  3721. disable altivec
  3722. disable dcbzl
  3723. ;;
  3724. esac
  3725. elif enabled sparc; then
  3726. case $cpu in
  3727. cypress|f93[04]|tsc701|sparcl*|supersparc|hypersparc|niagara|v[789])
  3728. cpuflags="-mcpu=$cpu"
  3729. ;;
  3730. ultrasparc*|niagara[234])
  3731. cpuflags="-mcpu=$cpu"
  3732. ;;
  3733. esac
  3734. elif enabled x86; then
  3735. case $cpu in
  3736. i[345]86|pentium)
  3737. cpuflags="-march=$cpu"
  3738. disable i686
  3739. disable mmx
  3740. ;;
  3741. # targets that do NOT support nopl and conditional mov (cmov)
  3742. pentium-mmx|k6|k6-[23]|winchip-c6|winchip2|c3)
  3743. cpuflags="-march=$cpu"
  3744. disable i686
  3745. ;;
  3746. # targets that do support nopl and conditional mov (cmov)
  3747. i686|pentiumpro|pentium[23]|pentium-m|athlon|athlon-tbird|athlon-4|athlon-[mx]p|athlon64*|k8*|opteron*|athlon-fx\
  3748. |core*|atom|bonnell|nehalem|westmere|silvermont|sandybridge|ivybridge|haswell|broadwell|amdfam10|barcelona|b[dt]ver*)
  3749. cpuflags="-march=$cpu"
  3750. enable i686
  3751. enable fast_cmov
  3752. ;;
  3753. # targets that do support conditional mov but on which it's slow
  3754. pentium4|pentium4m|prescott|nocona)
  3755. cpuflags="-march=$cpu"
  3756. enable i686
  3757. disable fast_cmov
  3758. ;;
  3759. esac
  3760. fi
  3761. if [ "$cpu" != generic ]; then
  3762. add_cflags $cpuflags
  3763. add_asflags $cpuflags
  3764. fi
  3765. # compiler sanity check
  3766. check_exec <<EOF
  3767. int main(void){ return 0; }
  3768. EOF
  3769. if test "$?" != 0; then
  3770. echo "$cc is unable to create an executable file."
  3771. if test -z "$cross_prefix" && ! enabled cross_compile ; then
  3772. echo "If $cc is a cross-compiler, use the --enable-cross-compile option."
  3773. echo "Only do this if you know what cross compiling means."
  3774. fi
  3775. die "C compiler test failed."
  3776. fi
  3777. add_cppflags -D_ISOC99_SOURCE
  3778. add_cxxflags -D__STDC_CONSTANT_MACROS
  3779. check_cflags -std=c99
  3780. check_cc -D_FILE_OFFSET_BITS=64 <<EOF && add_cppflags -D_FILE_OFFSET_BITS=64
  3781. #include <stdlib.h>
  3782. EOF
  3783. check_cc -D_LARGEFILE_SOURCE <<EOF && add_cppflags -D_LARGEFILE_SOURCE
  3784. #include <stdlib.h>
  3785. EOF
  3786. add_host_cppflags -D_ISOC99_SOURCE
  3787. check_host_cflags -std=c99
  3788. check_host_cflags -Wall
  3789. check_host_cflags -O3
  3790. check_64bit(){
  3791. arch32=$1
  3792. arch64=$2
  3793. expr=$3
  3794. check_code cc "" "int test[2*($expr) - 1]" &&
  3795. subarch=$arch64 || subarch=$arch32
  3796. }
  3797. case "$arch" in
  3798. aarch64|alpha|ia64)
  3799. spic=$shared
  3800. ;;
  3801. mips)
  3802. check_64bit mips mips64 '_MIPS_SIM > 1'
  3803. spic=$shared
  3804. ;;
  3805. parisc)
  3806. check_64bit parisc parisc64 'sizeof(void *) > 4'
  3807. spic=$shared
  3808. ;;
  3809. ppc)
  3810. check_64bit ppc ppc64 'sizeof(void *) > 4'
  3811. spic=$shared
  3812. ;;
  3813. s390)
  3814. check_64bit s390 s390x 'sizeof(void *) > 4'
  3815. spic=$shared
  3816. ;;
  3817. sparc)
  3818. check_64bit sparc sparc64 'sizeof(void *) > 4'
  3819. spic=$shared
  3820. ;;
  3821. x86)
  3822. check_64bit x86_32 x86_64 'sizeof(void *) > 4'
  3823. # Treat x32 as x64 for now. Note it also needs spic=$shared
  3824. test "$subarch" = "x86_32" && check_cpp_condition stddef.h 'defined(__x86_64__)' &&
  3825. subarch=x86_64
  3826. if test "$subarch" = "x86_64"; then
  3827. spic=$shared
  3828. fi
  3829. ;;
  3830. ppc)
  3831. check_cc <<EOF && subarch="ppc64"
  3832. int test[(int)sizeof(char*) - 7];
  3833. EOF
  3834. ;;
  3835. esac
  3836. enable $subarch
  3837. enabled spic && enable_weak pic
  3838. # OS specific
  3839. case $target_os in
  3840. aix)
  3841. SHFLAGS=-shared
  3842. add_cppflags '-I\$(SRC_PATH)/compat/aix'
  3843. enabled shared && add_ldflags -Wl,-brtl
  3844. ;;
  3845. android)
  3846. disable symver
  3847. enable section_data_rel_ro
  3848. SLIB_INSTALL_NAME='$(SLIBNAME)'
  3849. SLIB_INSTALL_LINKS=
  3850. # soname not set on purpose
  3851. SHFLAGS=-shared
  3852. ;;
  3853. haiku)
  3854. prefix_default="/boot/common"
  3855. network_extralibs="-lnetwork"
  3856. host_libs=
  3857. ;;
  3858. sunos)
  3859. SHFLAGS='-shared -Wl,-h,$$(@F)'
  3860. enabled x86 && SHFLAGS="-mimpure-text $SHFLAGS"
  3861. network_extralibs="-lsocket -lnsl"
  3862. add_cppflags -D__EXTENSIONS__
  3863. # When using suncc to build, the Solaris linker will mark
  3864. # an executable with each instruction set encountered by
  3865. # the Solaris assembler. As our libraries contain their own
  3866. # guards for processor-specific code, instead suppress
  3867. # generation of the HWCAPS ELF section on Solaris x86 only.
  3868. enabled_all suncc x86 &&
  3869. echo "hwcap_1 = OVERRIDE;" > mapfile &&
  3870. add_ldflags -Wl,-M,mapfile
  3871. nm_default='nm -P -g'
  3872. ;;
  3873. netbsd)
  3874. disable symver
  3875. oss_indev_extralibs="-lossaudio"
  3876. oss_outdev_extralibs="-lossaudio"
  3877. enabled gcc || check_ldflags -Wl,-zmuldefs
  3878. ;;
  3879. openbsd|bitrig)
  3880. disable symver
  3881. SHFLAGS='-shared'
  3882. SLIB_INSTALL_NAME='$(SLIBNAME).$(LIBMAJOR).$(LIBMINOR)'
  3883. SLIB_INSTALL_LINKS=
  3884. oss_indev_extralibs="-lossaudio"
  3885. oss_outdev_extralibs="-lossaudio"
  3886. ;;
  3887. dragonfly)
  3888. disable symver
  3889. ;;
  3890. freebsd)
  3891. ;;
  3892. bsd/os)
  3893. add_extralibs -lpoll -lgnugetopt
  3894. strip="strip -d"
  3895. ;;
  3896. darwin)
  3897. enabled ppc && add_asflags -force_cpusubtype_ALL
  3898. SHFLAGS='-dynamiclib -Wl,-single_module -Wl,-install_name,$(SHLIBDIR)/$(SLIBNAME_WITH_MAJOR),-current_version,$(LIBVERSION),-compatibility_version,$(LIBMAJOR)'
  3899. enabled x86_32 && append SHFLAGS -Wl,-read_only_relocs,suppress
  3900. strip="${strip} -x"
  3901. add_ldflags -Wl,-dynamic,-search_paths_first
  3902. SLIBSUF=".dylib"
  3903. SLIBNAME_WITH_VERSION='$(SLIBPREF)$(FULLNAME).$(LIBVERSION)$(SLIBSUF)'
  3904. SLIBNAME_WITH_MAJOR='$(SLIBPREF)$(FULLNAME).$(LIBMAJOR)$(SLIBSUF)'
  3905. objformat="macho"
  3906. enabled x86_64 && objformat="macho64"
  3907. enabled_any pic shared x86_64 ||
  3908. { check_cflags -mdynamic-no-pic && add_asflags -mdynamic-no-pic; }
  3909. ;;
  3910. mingw32*)
  3911. if test $target_os = "mingw32ce"; then
  3912. disable network
  3913. else
  3914. target_os=mingw32
  3915. fi
  3916. LIBTARGET=i386
  3917. if enabled x86_64; then
  3918. LIBTARGET="i386:x86-64"
  3919. elif enabled arm; then
  3920. LIBTARGET=arm-wince
  3921. fi
  3922. enabled shared && ! enabled small && check_cmd $windres --version && enable gnu_windres
  3923. check_ldflags -Wl,--nxcompat
  3924. check_ldflags -Wl,--dynamicbase
  3925. enabled x86_32 && check_ldflags -Wl,--large-address-aware
  3926. shlibdir_default="$bindir_default"
  3927. SLIBPREF=""
  3928. SLIBSUF=".dll"
  3929. SLIBNAME_WITH_VERSION='$(SLIBPREF)$(FULLNAME)-$(LIBVERSION)$(SLIBSUF)'
  3930. SLIBNAME_WITH_MAJOR='$(SLIBPREF)$(FULLNAME)-$(LIBMAJOR)$(SLIBSUF)'
  3931. dlltool="${cross_prefix}dlltool"
  3932. if check_cmd lib.exe -list; then
  3933. SLIB_EXTRA_CMD=-'sed -e "s/ @[^ ]*//" $$(@:$(SLIBSUF)=.orig.def) > $$(@:$(SLIBSUF)=.def); lib.exe /machine:$(LIBTARGET) /def:$$(@:$(SLIBSUF)=.def) /out:$(SUBDIR)$(SLIBNAME:$(SLIBSUF)=.lib)'
  3934. if enabled x86_64; then
  3935. LIBTARGET=x64
  3936. fi
  3937. elif check_cmd $dlltool --version; then
  3938. 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)'
  3939. fi
  3940. SLIB_INSTALL_NAME='$(SLIBNAME_WITH_MAJOR)'
  3941. SLIB_INSTALL_LINKS=
  3942. SLIB_INSTALL_EXTRA_SHLIB='$(SLIBNAME:$(SLIBSUF)=.lib)'
  3943. SLIB_INSTALL_EXTRA_LIB='lib$(SLIBNAME:$(SLIBSUF)=.dll.a) $(SLIBNAME_WITH_MAJOR:$(SLIBSUF)=.def)'
  3944. 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'
  3945. objformat="win32"
  3946. ranlib=:
  3947. enable dos_paths
  3948. ;;
  3949. win32|win64)
  3950. disable symver
  3951. if enabled shared; then
  3952. # Link to the import library instead of the normal static library
  3953. # for shared libs.
  3954. LD_LIB='%.lib'
  3955. # Cannot build both shared and static libs with MSVC or icl.
  3956. disable static
  3957. fi
  3958. enabled x86_32 && check_ldflags -LARGEADDRESSAWARE
  3959. shlibdir_default="$bindir_default"
  3960. SLIBPREF=""
  3961. SLIBSUF=".dll"
  3962. SLIBNAME_WITH_VERSION='$(SLIBPREF)$(FULLNAME)-$(LIBVERSION)$(SLIBSUF)'
  3963. SLIBNAME_WITH_MAJOR='$(SLIBPREF)$(FULLNAME)-$(LIBMAJOR)$(SLIBSUF)'
  3964. SLIB_CREATE_DEF_CMD='$(SRC_PATH)/compat/windows/makedef $(SUBDIR)lib$(NAME).ver $(OBJS) > $$(@:$(SLIBSUF)=.def)'
  3965. SLIB_INSTALL_NAME='$(SLIBNAME_WITH_MAJOR)'
  3966. SLIB_INSTALL_LINKS=
  3967. SLIB_INSTALL_EXTRA_SHLIB='$(SLIBNAME:$(SLIBSUF)=.lib)'
  3968. SLIB_INSTALL_EXTRA_LIB='$(SLIBNAME_WITH_MAJOR:$(SLIBSUF)=.def)'
  3969. SHFLAGS='-dll -def:$$(@:$(SLIBSUF)=.def) -implib:$(SUBDIR)$(SLIBNAME:$(SLIBSUF)=.lib)'
  3970. objformat="win32"
  3971. ranlib=:
  3972. enable dos_paths
  3973. ;;
  3974. cygwin*)
  3975. target_os=cygwin
  3976. shlibdir_default="$bindir_default"
  3977. SLIBPREF="cyg"
  3978. SLIBSUF=".dll"
  3979. SLIBNAME_WITH_VERSION='$(SLIBPREF)$(FULLNAME)-$(LIBVERSION)$(SLIBSUF)'
  3980. SLIBNAME_WITH_MAJOR='$(SLIBPREF)$(FULLNAME)-$(LIBMAJOR)$(SLIBSUF)'
  3981. SLIB_INSTALL_NAME='$(SLIBNAME_WITH_MAJOR)'
  3982. SLIB_INSTALL_LINKS=
  3983. SLIB_INSTALL_EXTRA_LIB='lib$(FULLNAME).dll.a'
  3984. SHFLAGS='-shared -Wl,--out-implib,$(SUBDIR)lib$(FULLNAME).dll.a'
  3985. objformat="win32"
  3986. enable dos_paths
  3987. enabled shared && ! enabled small && check_cmd $windres --version && enable gnu_windres
  3988. ;;
  3989. *-dos|freedos|opendos)
  3990. network_extralibs="-lsocket"
  3991. objformat="coff"
  3992. enable dos_paths
  3993. add_cppflags -U__STRICT_ANSI__
  3994. ;;
  3995. linux)
  3996. enable dv1394
  3997. enable section_data_rel_ro
  3998. ;;
  3999. irix*)
  4000. target_os=irix
  4001. ranlib="echo ignoring ranlib"
  4002. ;;
  4003. os/2*)
  4004. strip="lxlite -CS"
  4005. ln_s="cp -f"
  4006. objformat="aout"
  4007. add_cppflags -D_GNU_SOURCE
  4008. add_ldflags -Zomf -Zbin-files -Zargs-wild -Zmap
  4009. SHFLAGS='$(SUBDIR)$(NAME).def -Zdll -Zomf'
  4010. LIBSUF="_s.a"
  4011. SLIBPREF=""
  4012. SLIBSUF=".dll"
  4013. SLIBNAME_WITH_VERSION='$(SLIBPREF)$(NAME)-$(LIBVERSION)$(SLIBSUF)'
  4014. SLIBNAME_WITH_MAJOR='$(SLIBPREF)$(shell echo $(NAME) | cut -c1-6)$(LIBMAJOR)$(SLIBSUF)'
  4015. SLIB_CREATE_DEF_CMD='echo LIBRARY $(SLIBNAME_WITH_MAJOR) INITINSTANCE TERMINSTANCE > $(SUBDIR)$(NAME).def; \
  4016. echo CODE PRELOAD MOVEABLE DISCARDABLE >> $(SUBDIR)$(NAME).def; \
  4017. echo DATA PRELOAD MOVEABLE MULTIPLE NONSHARED >> $(SUBDIR)$(NAME).def; \
  4018. echo EXPORTS >> $(SUBDIR)$(NAME).def; \
  4019. emxexp $(OBJS) >> $(SUBDIR)$(NAME).def'
  4020. SLIB_EXTRA_CMD='emximp -o $(SUBDIR)$(LIBPREF)$(NAME)_dll.a $(SUBDIR)$(NAME).def; \
  4021. emximp -o $(SUBDIR)$(LIBPREF)$(NAME)_dll.lib $(SUBDIR)$(NAME).def;'
  4022. SLIB_INSTALL_EXTRA_LIB='$(LIBPREF)$(NAME)_dll.a $(LIBPREF)$(NAME)_dll.lib'
  4023. enable dos_paths
  4024. enable_weak os2threads
  4025. ;;
  4026. gnu/kfreebsd)
  4027. add_cppflags -D_BSD_SOURCE
  4028. ;;
  4029. gnu)
  4030. ;;
  4031. qnx)
  4032. add_cppflags -D_QNX_SOURCE
  4033. network_extralibs="-lsocket"
  4034. ;;
  4035. symbian)
  4036. SLIBSUF=".dll"
  4037. enable dos_paths
  4038. add_cflags --include=$sysinclude/gcce/gcce.h -fvisibility=default
  4039. add_cppflags -D__GCCE__ -D__SYMBIAN32__ -DSYMBIAN_OE_POSIX_SIGNALS
  4040. add_ldflags -Wl,--target1-abs,--no-undefined \
  4041. -Wl,-Ttext,0x80000,-Tdata,0x1000000 -shared \
  4042. -Wl,--entry=_E32Startup -Wl,-u,_E32Startup
  4043. add_extralibs -l:eexe.lib -l:usrt2_2.lib -l:dfpaeabi.dso \
  4044. -l:drtaeabi.dso -l:scppnwdl.dso -lsupc++ -lgcc \
  4045. -l:libc.dso -l:libm.dso -l:euser.dso -l:libcrt0.lib
  4046. ;;
  4047. osf1)
  4048. add_cppflags -D_OSF_SOURCE -D_POSIX_PII -D_REENTRANT
  4049. ;;
  4050. minix)
  4051. ;;
  4052. plan9)
  4053. add_cppflags -D_C99_SNPRINTF_EXTENSION \
  4054. -D_REENTRANT_SOURCE \
  4055. -D_RESEARCH_SOURCE \
  4056. -DFD_SETSIZE=96 \
  4057. -DHAVE_SOCK_OPTS
  4058. add_compat strtod.o strtod=avpriv_strtod
  4059. network_extralibs='-lbsd'
  4060. exeobjs=compat/plan9/main.o
  4061. disable ffserver
  4062. cp_f='cp'
  4063. ;;
  4064. none)
  4065. ;;
  4066. *)
  4067. die "Unknown OS '$target_os'."
  4068. ;;
  4069. esac
  4070. # determine libc flavour
  4071. probe_libc(){
  4072. pfx=$1
  4073. pfx_no_=${pfx%_}
  4074. # uclibc defines __GLIBC__, so it needs to be checked before glibc.
  4075. if check_${pfx}cpp_condition features.h "defined __UCLIBC__"; then
  4076. eval ${pfx}libc_type=uclibc
  4077. add_${pfx}cppflags -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600
  4078. elif check_${pfx}cpp_condition features.h "defined __GLIBC__"; then
  4079. eval ${pfx}libc_type=glibc
  4080. add_${pfx}cppflags -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600
  4081. # MinGW headers can be installed on Cygwin, so check for newlib first.
  4082. elif check_${pfx}cpp_condition newlib.h "defined _NEWLIB_VERSION"; then
  4083. eval ${pfx}libc_type=newlib
  4084. add_${pfx}cppflags -U__STRICT_ANSI__
  4085. # MinGW64 is backwards compatible with MinGW32, so check for it first.
  4086. elif check_${pfx}cpp_condition _mingw.h "defined __MINGW64_VERSION_MAJOR"; then
  4087. eval ${pfx}libc_type=mingw64
  4088. if check_${pfx}cpp_condition _mingw.h "__MINGW64_VERSION_MAJOR < 3"; then
  4089. add_compat msvcrt/snprintf.o
  4090. add_cflags "-include $source_path/compat/msvcrt/snprintf.h"
  4091. fi
  4092. add_${pfx}cppflags -U__STRICT_ANSI__ -D__USE_MINGW_ANSI_STDIO=1
  4093. eval test \$${pfx_no_}cc_type = "gcc" &&
  4094. add_${pfx}cppflags -D__printf__=__gnu_printf__
  4095. elif check_${pfx}cpp_condition _mingw.h "defined __MINGW_VERSION" ||
  4096. check_${pfx}cpp_condition _mingw.h "defined __MINGW32_VERSION"; then
  4097. eval ${pfx}libc_type=mingw32
  4098. check_${pfx}cpp_condition _mingw.h "__MINGW32_MAJOR_VERSION > 3 || \
  4099. (__MINGW32_MAJOR_VERSION == 3 && __MINGW32_MINOR_VERSION >= 15)" ||
  4100. die "ERROR: MinGW32 runtime version must be >= 3.15."
  4101. add_${pfx}cppflags -U__STRICT_ANSI__ -D__USE_MINGW_ANSI_STDIO=1
  4102. eval test \$${pfx_no_}cc_type = "gcc" &&
  4103. add_${pfx}cppflags -D__printf__=__gnu_printf__
  4104. elif check_${pfx}cpp_condition crtversion.h "defined _VC_CRT_MAJOR_VERSION"; then
  4105. eval ${pfx}libc_type=msvcrt
  4106. # The MSVC 2010 headers (Win 7.0 SDK) set _WIN32_WINNT to
  4107. # 0x601 by default unless something else is set by the user.
  4108. # This can easily lead to us detecting functions only present
  4109. # in such new versions and producing binaries requiring windows 7.0.
  4110. # Therefore explicitly set the default to XP unless the user has
  4111. # set something else on the command line.
  4112. check_${pfx}cpp_condition stdlib.h "defined(_WIN32_WINNT)" ||
  4113. add_${pfx}cppflags -D_WIN32_WINNT=0x0502
  4114. elif check_${pfx}cpp_condition stddef.h "defined __KLIBC__"; then
  4115. eval ${pfx}libc_type=klibc
  4116. elif check_${pfx}cpp_condition sys/cdefs.h "defined __BIONIC__"; then
  4117. eval ${pfx}libc_type=bionic
  4118. elif check_${pfx}cpp_condition sys/brand.h "defined LABELED_BRAND_NAME"; then
  4119. eval ${pfx}libc_type=solaris
  4120. add_${pfx}cppflags -D__EXTENSIONS__ -D_XOPEN_SOURCE=600
  4121. fi
  4122. check_${pfx}cc <<EOF
  4123. #include <time.h>
  4124. void *v = localtime_r;
  4125. EOF
  4126. 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
  4127. #include <time.h>
  4128. void *v = localtime_r;
  4129. EOF
  4130. }
  4131. probe_libc
  4132. test -n "$libc_type" && enable libc_$libc_type
  4133. probe_libc host_
  4134. test -n "$host_libc_type" && enable host_libc_$host_libc_type
  4135. case $libc_type in
  4136. bionic)
  4137. add_compat strtod.o strtod=avpriv_strtod
  4138. ;;
  4139. msvcrt)
  4140. if [ -z "$cl_major_ver" ] || [ $cl_major_ver -le 18 ]; then
  4141. add_compat strtod.o strtod=avpriv_strtod
  4142. add_compat msvcrt/snprintf.o snprintf=avpriv_snprintf \
  4143. _snprintf=avpriv_snprintf \
  4144. vsnprintf=avpriv_vsnprintf
  4145. fi
  4146. ;;
  4147. esac
  4148. # hacks for compiler/libc/os combinations
  4149. if enabled_all tms470 libc_glibc; then
  4150. CPPFLAGS="-I${source_path}/compat/tms470 ${CPPFLAGS}"
  4151. add_cppflags -D__USER_LABEL_PREFIX__=
  4152. add_cppflags -D__builtin_memset=memset
  4153. add_cppflags -D__gnuc_va_list=va_list -D_VA_LIST_DEFINED
  4154. add_cflags -pds=48 # incompatible redefinition of macro
  4155. fi
  4156. if enabled_all ccc libc_glibc; then
  4157. add_ldflags -Wl,-z,now # calls to libots crash without this
  4158. fi
  4159. check_compile_assert flt_lim "float.h limits.h" "DBL_MAX == (double)DBL_MAX" ||
  4160. add_cppflags '-I\$(SRC_PATH)/compat/float'
  4161. esc(){
  4162. echo "$*" | sed 's/%/%25/g;s/:/%3a/g'
  4163. }
  4164. echo "config:$arch:$subarch:$cpu:$target_os:$(esc $cc_ident):$(esc $FFMPEG_CONFIGURATION)" >config.fate
  4165. check_cpp_condition stdlib.h "defined(__PIC__) || defined(__pic__) || defined(PIC)" && enable_weak pic
  4166. set_default libdir
  4167. : ${shlibdir_default:="$libdir"}
  4168. : ${pkgconfigdir_default:="$libdir/pkgconfig"}
  4169. set_default $PATHS_LIST
  4170. set_default nm
  4171. # we need to build at least one lib type
  4172. if ! enabled_any static shared; then
  4173. cat <<EOF
  4174. At least one library type must be built.
  4175. Specify --enable-static to build the static libraries or --enable-shared to
  4176. build the shared libraries as well. To only build the shared libraries specify
  4177. --disable-static in addition to --enable-shared.
  4178. EOF
  4179. exit 1;
  4180. fi
  4181. die_license_disabled() {
  4182. enabled $1 || { enabled $2 && die "$2 is $1 and --enable-$1 is not specified."; }
  4183. }
  4184. die_license_disabled_gpl() {
  4185. enabled $1 || { enabled $2 && die "$2 is incompatible with the gpl and --enable-$1 is not specified."; }
  4186. }
  4187. die_license_disabled gpl frei0r
  4188. die_license_disabled gpl libcdio
  4189. die_license_disabled gpl libsmbclient
  4190. die_license_disabled gpl libutvideo
  4191. die_license_disabled gpl libvidstab
  4192. die_license_disabled gpl libx264
  4193. die_license_disabled gpl libx265
  4194. die_license_disabled gpl libxavs
  4195. die_license_disabled gpl libxvid
  4196. die_license_disabled gpl libzvbi
  4197. die_license_disabled gpl x11grab
  4198. die_license_disabled nonfree libaacplus
  4199. die_license_disabled nonfree libfaac
  4200. die_license_disabled nonfree nvenc
  4201. enabled gpl && die_license_disabled_gpl nonfree libfdk_aac
  4202. enabled gpl && die_license_disabled_gpl nonfree openssl
  4203. die_license_disabled version3 libopencore_amrnb
  4204. die_license_disabled version3 libopencore_amrwb
  4205. die_license_disabled version3 libsmbclient
  4206. die_license_disabled version3 libvo_aacenc
  4207. die_license_disabled version3 libvo_amrwbenc
  4208. enabled version3 && { enabled gpl && enable gplv3 || enable lgplv3; }
  4209. disabled optimizations || check_cflags -fomit-frame-pointer
  4210. enable_weak_pic() {
  4211. disabled pic && return
  4212. enable pic
  4213. add_cppflags -DPIC
  4214. case "$target_os" in
  4215. mingw*|cygwin*)
  4216. ;;
  4217. *)
  4218. add_cflags -fPIC
  4219. ;;
  4220. esac
  4221. add_asflags -fPIC
  4222. }
  4223. enabled pic && enable_weak_pic
  4224. check_cc <<EOF || die "Symbol mangling check failed."
  4225. int ff_extern;
  4226. EOF
  4227. sym=$($nm $TMPO | awk '/ff_extern/{ print substr($0, match($0, /[^ \t]*ff_extern/)) }')
  4228. extern_prefix=${sym%%ff_extern*}
  4229. check_cc <<EOF && enable_weak inline_asm
  4230. void foo(void) { __asm__ volatile ("" ::); }
  4231. EOF
  4232. _restrict=
  4233. for restrict_keyword in restrict __restrict__ __restrict; do
  4234. check_cc <<EOF && _restrict=$restrict_keyword && break
  4235. void foo(char * $restrict_keyword p);
  4236. EOF
  4237. done
  4238. check_cc <<EOF && enable pragma_deprecated
  4239. void foo(void) { _Pragma("GCC diagnostic ignored \"-Wdeprecated-declarations\"") }
  4240. EOF
  4241. check_cc <<EOF && enable attribute_packed
  4242. struct { int x; } __attribute__((packed)) x;
  4243. EOF
  4244. check_cc <<EOF && enable attribute_may_alias
  4245. union { int x; } __attribute__((may_alias)) x;
  4246. EOF
  4247. check_cc <<EOF || die "endian test failed"
  4248. unsigned int endian = 'B' << 24 | 'I' << 16 | 'G' << 8 | 'E';
  4249. EOF
  4250. od -t x1 $TMPO | grep -q '42 *49 *47 *45' && enable bigendian
  4251. if [ "$cpu" = "power7" ] || [ "$cpu" = "power8" ] || enabled ppc64; then
  4252. if ! enabled bigendian && enabled altivec ;then
  4253. enable vsx
  4254. fi
  4255. fi
  4256. check_gas() {
  4257. log "check_gas using '$as' as AS"
  4258. # :vararg is used on aarch64, arm and ppc altivec
  4259. check_as <<EOF || return 1
  4260. .macro m n, y:vararg=0
  4261. \n: .int \y
  4262. .endm
  4263. m x
  4264. EOF
  4265. # .altmacro is only used in arm asm
  4266. ! enabled arm || check_as <<EOF || return 1
  4267. .altmacro
  4268. EOF
  4269. enable gnu_as
  4270. return 0
  4271. }
  4272. if enabled_any arm aarch64 || enabled_all ppc altivec && enabled asm; then
  4273. nogas=:
  4274. enabled_any arm aarch64 && nogas=die
  4275. enabled_all ppc altivec && [ $target_os_default != aix ] && nogas=warn
  4276. as_noop=-v
  4277. case $as_type in
  4278. arm*) gaspp_as_type=armasm; as_noop=-h ;;
  4279. gcc) gaspp_as_type=gas ;;
  4280. *) gaspp_as_type=$as_type ;;
  4281. esac
  4282. [ $target_os = "darwin" ] && gaspp_as_type="apple-$gaspp_as_type"
  4283. test "${as#*gas-preprocessor.pl}" != "$as" ||
  4284. check_cmd gas-preprocessor.pl -arch $arch -as-type $gaspp_as_type -- ${as:=$cc} $as_noop &&
  4285. gas="${gas:=gas-preprocessor.pl} -arch $arch -as-type $gaspp_as_type -- ${as:=$cc}"
  4286. if ! check_gas ; then
  4287. as=${gas:=$as}
  4288. check_gas || \
  4289. $nogas "GNU assembler not found, install/update gas-preprocessor"
  4290. fi
  4291. check_as <<EOF && enable as_func
  4292. .func test
  4293. .endfunc
  4294. EOF
  4295. fi
  4296. check_inline_asm inline_asm_labels '"1:\n"'
  4297. check_inline_asm inline_asm_nonlocal_labels '"Label:\n"'
  4298. if enabled aarch64; then
  4299. enabled armv8 && check_insn armv8 'prfm pldl1strm, [x0]'
  4300. # internal assembler in clang 3.3 does not support this instruction
  4301. enabled neon && check_insn neon 'ext v0.8B, v0.8B, v1.8B, #1'
  4302. enabled vfp && check_insn vfp 'fmadd d0, d0, d1, d2'
  4303. map 'enabled_any ${v}_external ${v}_inline || disable $v' $ARCH_EXT_LIST_ARM
  4304. elif enabled alpha; then
  4305. check_cflags -mieee
  4306. elif enabled arm; then
  4307. check_cpp_condition stddef.h "defined __thumb__" && check_cc <<EOF && enable_weak thumb
  4308. float func(float a, float b){ return a+b; }
  4309. EOF
  4310. enabled thumb && check_cflags -mthumb || check_cflags -marm
  4311. if check_cpp_condition stddef.h "defined __ARM_PCS_VFP"; then
  4312. enable vfp_args
  4313. elif ! check_cpp_condition stddef.h "defined __ARM_PCS || defined __SOFTFP__"; then
  4314. case "${cross_prefix:-$cc}" in
  4315. *hardfloat*) enable vfp_args; fpabi=vfp ;;
  4316. *) check_ld "cc" <<EOF && enable vfp_args && fpabi=vfp || fpabi=soft ;;
  4317. __asm__ (".eabi_attribute 28, 1");
  4318. int main(void) { return 0; }
  4319. EOF
  4320. esac
  4321. warn "Compiler does not indicate floating-point ABI, guessing $fpabi."
  4322. fi
  4323. enabled armv5te && check_insn armv5te 'qadd r0, r0, r0'
  4324. enabled armv6 && check_insn armv6 'sadd16 r0, r0, r0'
  4325. enabled armv6t2 && check_insn armv6t2 'movt r0, #0'
  4326. enabled neon && check_insn neon 'vadd.i16 q0, q0, q0'
  4327. enabled vfp && check_insn vfp 'fadds s0, s0, s0'
  4328. enabled vfpv3 && check_insn vfpv3 'vmov.f32 s0, #1.0'
  4329. enabled setend && check_insn setend 'setend be'
  4330. [ $target_os = linux ] || [ $target_os = android ] ||
  4331. map 'enabled_any ${v}_external ${v}_inline || disable $v' \
  4332. $ARCH_EXT_LIST_ARM
  4333. check_inline_asm asm_mod_q '"add r0, %Q0, %R0" :: "r"((long long)0)'
  4334. check_as <<EOF && enable as_dn_directive
  4335. ra .dn d0.i16
  4336. .unreq ra
  4337. EOF
  4338. # llvm's integrated assembler supports .object_arch from llvm 3.5
  4339. [ "$objformat" = elf ] && check_as <<EOF && enable as_object_arch
  4340. .object_arch armv4
  4341. EOF
  4342. [ $target_os != win32 ] && enabled_all armv6t2 shared !pic && enable_weak_pic
  4343. elif enabled mips; then
  4344. # Enable minimum ISA based on selected options
  4345. if enabled mips64 && (enabled mipsdspr1 || enabled mipsdspr2); then
  4346. add_cflags "-mips64r2"
  4347. add_asflags "-mips64r2"
  4348. elif enabled mips64 && enabled mipsfpu && disabled loongson3; then
  4349. add_cflags "-mips64"
  4350. add_asflags "-mips64"
  4351. elif enabled mipsdspr1 || enabled mipsdspr2; then
  4352. add_cflags "-mips32r2 -mfp32"
  4353. add_asflags "-mips32r2 -mfp32"
  4354. elif enabled mips32r5 || enabled mips64r6; then
  4355. check_cflags "-mfp64"
  4356. check_ldflags "-mfp64"
  4357. fi
  4358. enabled mips32r5 && check_cflags "-mips32r5 -msched-weight -mload-store-pairs -funroll-loops" &&
  4359. check_ldflags "-mips32r5" &&
  4360. check_inline_asm mips32r5 '"ulw $t0, ($t1)"'
  4361. enabled mips64r6 && check_cflags "-mips64r6 -msched-weight -mload-store-pairs -funroll-loops" &&
  4362. check_ldflags "-mips64r6" &&
  4363. check_inline_asm mips64r6 '"aui $t0, $t1, 1"'
  4364. enabled mipsdspr1 && add_cflags "-mdsp" && add_asflags "-mdsp" &&
  4365. check_inline_asm mipsdspr1 '"addu.qb $t0, $t1, $t2"'
  4366. enabled mipsdspr2 && add_cflags "-mdspr2" && add_asflags "-mdspr2" &&
  4367. check_inline_asm mipsdspr2 '"absq_s.qb $t0, $t1"'
  4368. enabled mipsfpu && add_cflags "-mhard-float" && add_asflags "-mhard-float" &&
  4369. check_inline_asm mipsfpu '"madd.d $f0, $f2, $f4, $f6"'
  4370. enabled msa && check_cflags "-mmsa" && check_ldflags "-mmsa" &&
  4371. check_inline_asm msa '"addvi.b $w0, $w1, 1"'
  4372. enabled loongson3 && check_inline_asm loongson3 '"gsldxc1 $f0, 0($2, $3)"'
  4373. enabled mips32r5 && add_asflags "-mips32r5 -mfp64"
  4374. enabled mips64r6 && add_asflags "-mips64r6 -mfp64"
  4375. enabled msa && add_asflags "-mmsa"
  4376. elif enabled parisc; then
  4377. if enabled gcc; then
  4378. case $($cc -dumpversion) in
  4379. 4.[3-9].*) check_cflags -fno-optimize-sibling-calls ;;
  4380. esac
  4381. fi
  4382. elif enabled ppc; then
  4383. enable local_aligned_8 local_aligned_16 local_aligned_32
  4384. check_inline_asm dcbzl '"dcbzl 0, %0" :: "r"(0)'
  4385. check_inline_asm ibm_asm '"add 0, 0, 0"'
  4386. check_inline_asm ppc4xx '"maclhw r10, r11, r12"'
  4387. check_inline_asm xform_asm '"lwzx %1, %y0" :: "Z"(*(int*)0), "r"(0)'
  4388. # AltiVec flags: The FSF version of GCC differs from the Apple version
  4389. if enabled altivec; then
  4390. check_cflags -maltivec -mabi=altivec &&
  4391. { check_header altivec.h && inc_altivec_h="#include <altivec.h>" ; } ||
  4392. check_cflags -faltivec
  4393. # check if our compiler supports Motorola AltiVec C API
  4394. check_cc <<EOF || disable altivec
  4395. $inc_altivec_h
  4396. int main(void) {
  4397. vector signed int v1 = (vector signed int) { 0 };
  4398. vector signed int v2 = (vector signed int) { 1 };
  4399. v1 = vec_add(v1, v2);
  4400. return 0;
  4401. }
  4402. EOF
  4403. enabled altivec || warn "Altivec disabled, possibly missing --cpu flag"
  4404. fi
  4405. if enabled vsx; then
  4406. check_cflags -mvsx &&
  4407. check_builtin vec_vsx_ld "altivec.h" "__builtin_vec_vsx_ld" || disable vsx
  4408. fi
  4409. if enabled power8; then
  4410. check_cpp_condition "altivec.h" "defined(_ARCH_PWR8)" || disable power8
  4411. fi
  4412. elif enabled x86; then
  4413. check_builtin rdtsc intrin.h "__rdtsc()"
  4414. check_builtin mm_empty mmintrin.h "_mm_empty()"
  4415. enable local_aligned_8 local_aligned_16 local_aligned_32
  4416. # check whether EBP is available on x86
  4417. # As 'i' is stored on the stack, this program will crash
  4418. # if the base pointer is used to access it because the
  4419. # base pointer is cleared in the inline assembly code.
  4420. check_exec_crash <<EOF && enable ebp_available
  4421. volatile int i=0;
  4422. __asm__ volatile ("xorl %%ebp, %%ebp" ::: "%ebp");
  4423. return i;
  4424. EOF
  4425. # check whether EBX is available on x86
  4426. check_inline_asm ebx_available '""::"b"(0)' &&
  4427. check_inline_asm ebx_available '"":::"%ebx"'
  4428. # check whether xmm clobbers are supported
  4429. check_inline_asm xmm_clobbers '"":::"%xmm0"'
  4430. check_inline_asm inline_asm_direct_symbol_refs '"movl '$extern_prefix'test, %eax"' ||
  4431. check_inline_asm inline_asm_direct_symbol_refs '"movl '$extern_prefix'test(%rip), %eax"'
  4432. # check whether binutils is new enough to compile SSSE3/MMXEXT
  4433. enabled ssse3 && check_inline_asm ssse3_inline '"pabsw %xmm0, %xmm0"'
  4434. enabled mmxext && check_inline_asm mmxext_inline '"pmaxub %mm0, %mm1"'
  4435. if ! disabled_any asm mmx yasm; then
  4436. if check_cmd $yasmexe --version; then
  4437. enabled x86_64 && yasm_extra="-m amd64"
  4438. yasm_debug="-g dwarf2"
  4439. elif check_cmd nasm -v; then
  4440. yasmexe=nasm
  4441. yasm_debug="-g -F dwarf"
  4442. if enabled x86_64; then
  4443. case "$objformat" in
  4444. elf) objformat=elf64 ;;
  4445. win32) objformat=win64 ;;
  4446. esac
  4447. fi
  4448. fi
  4449. YASMFLAGS="-f $objformat $yasm_extra"
  4450. enabled pic && append YASMFLAGS "-DPIC"
  4451. test -n "$extern_prefix" && append YASMFLAGS "-DPREFIX"
  4452. case "$objformat" in
  4453. elf*) enabled debug && append YASMFLAGS $yasm_debug ;;
  4454. esac
  4455. check_yasm "movbe ecx, [5]" && enable yasm ||
  4456. die "yasm/nasm not found or too old. Use --disable-yasm for a crippled build."
  4457. check_yasm "vextracti128 xmm0, ymm0, 0" || disable avx2_external
  4458. check_yasm "vpmacsdd xmm0, xmm1, xmm2, xmm3" || disable xop_external
  4459. check_yasm "vfmaddps ymm0, ymm1, ymm2, ymm3" || disable fma4_external
  4460. check_yasm "CPU amdnop" || disable cpunop
  4461. fi
  4462. case "$cpu" in
  4463. athlon*|opteron*|k8*|pentium|pentium-mmx|prescott|nocona|atom|geode)
  4464. disable fast_clz
  4465. ;;
  4466. esac
  4467. fi
  4468. check_code cc arm_neon.h "int16x8_t test = vdupq_n_s16(0)" && enable intrinsics_neon
  4469. check_ldflags -Wl,--as-needed
  4470. check_ldflags -Wl,-z,noexecstack
  4471. if check_func dlopen; then
  4472. ldl=
  4473. elif check_func dlopen -ldl; then
  4474. ldl=-ldl
  4475. fi
  4476. frei0r_filter_extralibs='$ldl'
  4477. frei0r_src_filter_extralibs='$ldl'
  4478. ladspa_filter_extralibs='$ldl'
  4479. nvenc_encoder_extralibs='$ldl'
  4480. if ! disabled network; then
  4481. check_func getaddrinfo $network_extralibs
  4482. check_func getservbyport $network_extralibs
  4483. check_func inet_aton $network_extralibs
  4484. check_type netdb.h "struct addrinfo"
  4485. check_type netinet/in.h "struct group_source_req" -D_BSD_SOURCE
  4486. check_type netinet/in.h "struct ip_mreq_source" -D_BSD_SOURCE
  4487. check_type netinet/in.h "struct ipv6_mreq" -D_DARWIN_C_SOURCE
  4488. check_type poll.h "struct pollfd"
  4489. check_type netinet/sctp.h "struct sctp_event_subscribe"
  4490. check_struct "sys/types.h sys/socket.h" "struct sockaddr" sa_len
  4491. check_type netinet/in.h "struct sockaddr_in6"
  4492. check_type "sys/types.h sys/socket.h" "struct sockaddr_storage"
  4493. check_type "sys/types.h sys/socket.h" socklen_t
  4494. # Prefer arpa/inet.h over winsock2
  4495. if check_header arpa/inet.h ; then
  4496. check_func closesocket
  4497. elif check_header winsock2.h ; then
  4498. check_func_headers winsock2.h closesocket -lws2 &&
  4499. network_extralibs="-lws2" ||
  4500. { check_func_headers winsock2.h closesocket -lws2_32 &&
  4501. network_extralibs="-lws2_32"; } || disable winsock2_h network
  4502. check_func_headers ws2tcpip.h getaddrinfo $network_extralibs
  4503. check_type ws2tcpip.h socklen_t
  4504. check_type ws2tcpip.h "struct addrinfo"
  4505. check_type ws2tcpip.h "struct group_source_req"
  4506. check_type ws2tcpip.h "struct ip_mreq_source"
  4507. check_type ws2tcpip.h "struct ipv6_mreq"
  4508. check_type winsock2.h "struct pollfd"
  4509. check_struct winsock2.h "struct sockaddr" sa_len
  4510. check_type ws2tcpip.h "struct sockaddr_in6"
  4511. check_type ws2tcpip.h "struct sockaddr_storage"
  4512. else
  4513. disable network
  4514. fi
  4515. fi
  4516. check_builtin atomic_cas_ptr atomic.h "void **ptr; void *oldval, *newval; atomic_cas_ptr(ptr, oldval, newval)"
  4517. check_builtin atomic_compare_exchange "" "int *ptr, *oldval; int newval; __atomic_compare_exchange_n(ptr, oldval, newval, 0, __ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST)"
  4518. check_builtin machine_rw_barrier mbarrier.h "__machine_rw_barrier()"
  4519. check_builtin MemoryBarrier windows.h "MemoryBarrier()"
  4520. check_builtin sarestart signal.h "SA_RESTART"
  4521. check_builtin sync_val_compare_and_swap "" "int *ptr; int oldval, newval; __sync_val_compare_and_swap(ptr, oldval, newval)"
  4522. check_func_headers malloc.h _aligned_malloc && enable aligned_malloc
  4523. check_func ${malloc_prefix}memalign && enable memalign
  4524. check_func ${malloc_prefix}posix_memalign && enable posix_memalign
  4525. check_func access
  4526. check_func_headers time.h clock_gettime || { check_func_headers time.h clock_gettime -lrt && add_extralibs -lrt && LIBRT="-lrt"; }
  4527. check_func fcntl
  4528. check_func fork
  4529. check_func gethrtime
  4530. check_func getopt
  4531. check_func getrusage
  4532. check_func gettimeofday
  4533. check_func gmtime_r
  4534. check_func isatty
  4535. check_func localtime_r
  4536. check_func mach_absolute_time
  4537. check_func mkstemp
  4538. check_func mmap
  4539. check_func mprotect
  4540. # Solaris has nanosleep in -lrt, OpenSolaris no longer needs that
  4541. check_func_headers time.h nanosleep || { check_func_headers time.h nanosleep -lrt && add_extralibs -lrt && LIBRT="-lrt"; }
  4542. check_func sched_getaffinity
  4543. check_func setrlimit
  4544. check_struct "sys/stat.h" "struct stat" st_mtim.tv_nsec -D_BSD_SOURCE
  4545. check_func strerror_r
  4546. check_func sysconf
  4547. check_func sysctl
  4548. check_func usleep
  4549. check_func_headers conio.h kbhit
  4550. check_func_headers io.h setmode
  4551. check_func_headers lzo/lzo1x.h lzo1x_999_compress
  4552. check_func_headers stdlib.h getenv
  4553. check_func_headers windows.h CoTaskMemFree -lole32
  4554. check_func_headers windows.h GetProcessAffinityMask
  4555. check_func_headers windows.h GetProcessTimes
  4556. check_func_headers windows.h GetSystemTimeAsFileTime
  4557. check_func_headers windows.h MapViewOfFile
  4558. check_func_headers windows.h PeekNamedPipe
  4559. check_func_headers windows.h SetConsoleTextAttribute
  4560. check_func_headers windows.h Sleep
  4561. check_func_headers windows.h VirtualAlloc
  4562. check_struct windows.h "CONDITION_VARIABLE" Ptr
  4563. check_func_headers glob.h glob
  4564. enabled xlib &&
  4565. check_func_headers "X11/Xlib.h X11/extensions/Xvlib.h" XvGetPortAttribute -lXv -lX11 -lXext
  4566. check_header direct.h
  4567. check_header dlfcn.h
  4568. check_header d3d11.h
  4569. check_header dxva.h
  4570. check_header dxva2api.h -D_WIN32_WINNT=0x0600
  4571. check_header io.h
  4572. check_header libcrystalhd/libcrystalhd_if.h
  4573. check_header mach/mach_time.h
  4574. check_header malloc.h
  4575. check_header net/udplite.h
  4576. check_header poll.h
  4577. check_header sys/mman.h
  4578. check_header sys/param.h
  4579. check_header sys/resource.h
  4580. check_header sys/select.h
  4581. check_header sys/time.h
  4582. check_header sys/un.h
  4583. check_header termios.h
  4584. check_header unistd.h
  4585. check_header valgrind/valgrind.h
  4586. check_header vdpau/vdpau.h
  4587. check_header vdpau/vdpau_x11.h
  4588. check_header VideoDecodeAcceleration/VDADecoder.h
  4589. check_header windows.h
  4590. check_header X11/extensions/XvMClib.h
  4591. check_header asm/types.h
  4592. check_lib2 "windows.h shellapi.h" CommandLineToArgvW -lshell32
  4593. check_lib2 "windows.h wincrypt.h" CryptGenRandom -ladvapi32
  4594. check_lib2 "windows.h psapi.h" GetProcessMemoryInfo -lpsapi
  4595. check_struct "sys/time.h sys/resource.h" "struct rusage" ru_maxrss
  4596. check_type "windows.h dxva.h" "DXVA_PicParams_HEVC"
  4597. check_type "windows.h d3d11.h" "ID3D11VideoDecoder"
  4598. if ! disabled w32threads && ! enabled pthreads; then
  4599. check_func_headers "windows.h process.h" _beginthreadex &&
  4600. enable w32threads || disable w32threads
  4601. fi
  4602. # check for some common methods of building with pthread support
  4603. # do this before the optional library checks as some of them require pthreads
  4604. if ! disabled pthreads && ! enabled w32threads && ! enabled os2threads; then
  4605. enable pthreads
  4606. if check_func pthread_join -pthread && check_func pthread_create -pthread; then
  4607. add_cflags -pthread
  4608. add_extralibs -pthread
  4609. elif check_func pthread_join -pthreads && check_func pthread_create -pthreads; then
  4610. add_cflags -pthreads
  4611. add_extralibs -pthreads
  4612. elif check_func pthread_join -ldl -pthread && check_func pthread_create -ldl -pthread; then
  4613. add_cflags -ldl -pthread
  4614. add_extralibs -ldl -pthread
  4615. elif check_func pthread_join -lpthreadGC2 && check_func pthread_create -lpthreadGC2; then
  4616. add_extralibs -lpthreadGC2
  4617. elif check_lib pthread.h pthread_join -lpthread && check_lib pthread.h pthread_create -lpthread; then
  4618. :
  4619. elif ! check_func pthread_join && ! check_func pthread_create; then
  4620. disable pthreads
  4621. fi
  4622. check_code cc "pthread.h" "static pthread_mutex_t atomic_lock = PTHREAD_MUTEX_INITIALIZER" || disable pthreads
  4623. fi
  4624. if enabled pthreads; then
  4625. check_func pthread_cancel
  4626. fi
  4627. disabled zlib || check_lib zlib.h zlibVersion -lz || disable zlib
  4628. disabled bzlib || check_lib2 bzlib.h BZ2_bzlibVersion -lbz2 || disable bzlib
  4629. disabled lzma || check_lib2 lzma.h lzma_version_number -llzma || disable lzma
  4630. check_lib math.h sin -lm && LIBM="-lm"
  4631. disabled crystalhd || check_lib libcrystalhd/libcrystalhd_if.h DtsCrystalHDVersion -lcrystalhd || disable crystalhd
  4632. atan2f_args=2
  4633. ldexpf_args=2
  4634. powf_args=2
  4635. for func in $MATH_FUNCS; do
  4636. eval check_mathfunc $func \${${func}_args:-1}
  4637. done
  4638. # these are off by default, so fail if requested and not available
  4639. enabled avfoundation_indev && { check_header_oc AVFoundation/AVFoundation.h || disable avfoundation_indev; }
  4640. enabled avfoundation_indev && { check_lib2 CoreGraphics/CoreGraphics.h CGGetActiveDisplayList -framework CoreGraphics ||
  4641. check_lib2 ApplicationServices/ApplicationServices.h CGGetActiveDisplayList -framework ApplicationServices; }
  4642. enabled avisynth && { { check_lib2 "windows.h" LoadLibrary; } ||
  4643. { check_lib2 "dlfcn.h" dlopen -ldl; } ||
  4644. die "ERROR: LoadLibrary/dlopen not found for avisynth"; }
  4645. enabled decklink && { check_header DeckLinkAPI.h || die "ERROR: DeckLinkAPI.h header not found"; }
  4646. enabled frei0r && { check_header frei0r.h || die "ERROR: frei0r.h header not found"; }
  4647. enabled gnutls && require_pkg_config gnutls gnutls/gnutls.h gnutls_global_init
  4648. enabled ladspa && { check_header ladspa.h || die "ERROR: ladspa.h header not found"; }
  4649. enabled libiec61883 && require libiec61883 libiec61883/iec61883.h iec61883_cmp_connect -lraw1394 -lavc1394 -lrom1394 -liec61883
  4650. enabled libaacplus && require "libaacplus >= 2.0.0" aacplus.h aacplusEncOpen -laacplus
  4651. enabled libass && require_pkg_config libass ass/ass.h ass_library_init
  4652. enabled libbluray && require_pkg_config libbluray libbluray/bluray.h bd_open
  4653. enabled libbs2b && require_pkg_config libbs2b bs2b.h bs2b_open
  4654. enabled libcelt && require libcelt celt/celt.h celt_decode -lcelt0 &&
  4655. { check_lib celt/celt.h celt_decoder_create_custom -lcelt0 ||
  4656. die "ERROR: libcelt must be installed and version must be >= 0.11.0."; }
  4657. enabled libcaca && require_pkg_config caca caca.h caca_create_canvas
  4658. enabled libdcadec && require_pkg_config dcadec libdcadec/dca_context.h dcadec_context_create
  4659. enabled libfaac && require2 libfaac "stdint.h faac.h" faacEncGetVersion -lfaac
  4660. enabled libfdk_aac && require libfdk_aac fdk-aac/aacenc_lib.h aacEncOpen -lfdk-aac
  4661. 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"
  4662. enabled libflite && require2 libflite "flite/flite.h" flite_init $flite_libs
  4663. enabled fontconfig && enable libfontconfig
  4664. enabled libfontconfig && require_pkg_config fontconfig "fontconfig/fontconfig.h" FcInit
  4665. enabled libfreetype && require_libfreetype
  4666. enabled libfribidi && require_pkg_config fribidi fribidi.h fribidi_version_info
  4667. enabled libgme && require libgme gme/gme.h gme_new_emu -lgme -lstdc++
  4668. enabled libgsm && { for gsm_hdr in "gsm.h" "gsm/gsm.h"; do
  4669. check_lib "${gsm_hdr}" gsm_create -lgsm && break;
  4670. done || die "ERROR: libgsm not found"; }
  4671. enabled libilbc && require libilbc ilbc.h WebRtcIlbcfix_InitDecode -lilbc
  4672. enabled libmfx && require_pkg_config libmfx "mfx/mfxvideo.h" MFXInit
  4673. enabled libmodplug && require_pkg_config libmodplug libmodplug/modplug.h ModPlug_Load
  4674. enabled libmp3lame && require "libmp3lame >= 3.98.3" lame/lame.h lame_set_VBR_quality -lmp3lame
  4675. enabled libnut && require libnut libnut.h nut_demuxer_init -lnut
  4676. enabled libopencore_amrnb && require libopencore_amrnb opencore-amrnb/interf_dec.h Decoder_Interface_init -lopencore-amrnb
  4677. enabled libopencore_amrwb && require libopencore_amrwb opencore-amrwb/dec_if.h D_IF_init -lopencore-amrwb
  4678. enabled libopencv && require_pkg_config opencv opencv/cxcore.h cvCreateImageHeader
  4679. enabled libopenh264 && require_pkg_config openh264 wels/codec_api.h WelsGetCodecVersion
  4680. enabled libopenjpeg && { check_lib openjpeg.h opj_version -lopenmj2 -DOPJ_STATIC ||
  4681. check_lib openjpeg-1.5/openjpeg.h opj_version -lopenjpeg -DOPJ_STATIC ||
  4682. check_lib openjpeg.h opj_version -lopenjpeg -DOPJ_STATIC ||
  4683. die "ERROR: libopenjpeg not found"; }
  4684. enabled libopus && require_pkg_config opus opus_multistream.h opus_multistream_decoder_create
  4685. enabled libpulse && require_pkg_config libpulse pulse/pulseaudio.h pa_context_new
  4686. enabled libquvi && require_pkg_config libquvi quvi/quvi.h quvi_init
  4687. enabled librtmp && require_pkg_config librtmp librtmp/rtmp.h RTMP_Socket
  4688. enabled libschroedinger && require_pkg_config schroedinger-1.0 schroedinger/schro.h schro_init
  4689. enabled libshine && require_pkg_config shine shine/layer3.h shine_encode_buffer
  4690. enabled libsmbclient && { use_pkg_config smbclient libsmbclient.h smbc_init ||
  4691. require smbclient libsmbclient.h smbc_init -lsmbclient; }
  4692. enabled libsoxr && require libsoxr soxr.h soxr_create -lsoxr
  4693. enabled libssh && require_pkg_config libssh libssh/sftp.h sftp_init
  4694. enabled libspeex && require_pkg_config speex speex/speex.h speex_decoder_init -lspeex
  4695. enabled libstagefright_h264 && require_cpp libstagefright_h264 "binder/ProcessState.h media/stagefright/MetaData.h
  4696. media/stagefright/MediaBufferGroup.h media/stagefright/MediaDebug.h media/stagefright/MediaDefs.h
  4697. media/stagefright/OMXClient.h media/stagefright/OMXCodec.h" android::OMXClient -lstagefright -lmedia -lutils -lbinder -lgnustl_static
  4698. enabled libtheora && require libtheora theora/theoraenc.h th_info_init -ltheoraenc -ltheoradec -logg
  4699. enabled libtwolame && require libtwolame twolame.h twolame_init -ltwolame &&
  4700. { check_lib twolame.h twolame_encode_buffer_float32_interleaved -ltwolame ||
  4701. die "ERROR: libtwolame must be installed and version must be >= 0.3.10"; }
  4702. enabled libutvideo && require_cpp utvideo "stdint.h stdlib.h utvideo/utvideo.h utvideo/Codec.h" 'CCodec*' -lutvideo -lstdc++
  4703. enabled libv4l2 && require_pkg_config libv4l2 libv4l2.h v4l2_ioctl
  4704. enabled libvidstab && require_pkg_config "vidstab >= 0.98" vid.stab/libvidstab.h vsMotionDetectInit
  4705. enabled libvo_aacenc && require libvo_aacenc vo-aacenc/voAAC.h voGetAACEncAPI -lvo-aacenc
  4706. enabled libvo_amrwbenc && require libvo_amrwbenc vo-amrwbenc/enc_if.h E_IF_init -lvo-amrwbenc
  4707. enabled libvorbis && require libvorbis vorbis/vorbisenc.h vorbis_info_init -lvorbisenc -lvorbis -logg
  4708. enabled libvpx && {
  4709. enabled libvpx_vp8_decoder && { check_lib2 "vpx/vpx_decoder.h vpx/vp8dx.h" vpx_codec_dec_init_ver -lvpx ||
  4710. die "ERROR: libvpx decoder version must be >=0.9.1"; }
  4711. 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 ||
  4712. die "ERROR: libvpx encoder version must be >=0.9.7"; }
  4713. enabled libvpx_vp9_decoder && { check_lib2 "vpx/vpx_decoder.h vpx/vp8dx.h" "vpx_codec_vp9_dx" -lvpx || disable libvpx_vp9_decoder; }
  4714. 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; } }
  4715. enabled libwavpack && require libwavpack wavpack/wavpack.h WavpackOpenFileOutput -lwavpack
  4716. enabled libwebp && {
  4717. enabled libwebp_encoder && require_pkg_config "libwebp >= 0.2.0" webp/encode.h WebPGetEncoderVersion
  4718. enabled libwebp_anim_encoder && { use_pkg_config "libwebpmux >= 0.4.0" webp/mux.h WebPAnimEncoderOptionsInit || disable libwebp_anim_encoder; } }
  4719. enabled libx264 && { use_pkg_config x264 "stdint.h x264.h" x264_encoder_encode ||
  4720. { require libx264 x264.h x264_encoder_encode -lx264 &&
  4721. warn "using libx264 without pkg-config"; } } &&
  4722. { check_cpp_condition x264.h "X264_BUILD >= 118" ||
  4723. die "ERROR: libx264 must be installed and version must be >= 0.118."; }
  4724. enabled libx265 && require_pkg_config x265 x265.h x265_encoder_encode &&
  4725. { check_cpp_condition x265.h "X265_BUILD >= 57" ||
  4726. die "ERROR: libx265 version must be >= 57."; }
  4727. enabled libxavs && require libxavs xavs.h xavs_encoder_encode -lxavs
  4728. enabled libxvid && require libxvid xvid.h xvid_global -lxvidcore
  4729. enabled libzmq && require_pkg_config libzmq zmq.h zmq_ctx_new
  4730. enabled libzvbi && require libzvbi libzvbi.h vbi_decoder_new -lzvbi
  4731. enabled mmal && { check_lib interface/mmal/mmal.h mmal_port_connect -lmmal_core -lmmal_util -lmmal_vc_client -lbcm_host ||
  4732. { ! enabled cross_compile && {
  4733. add_cflags -isystem/opt/vc/include/ -isystem/opt/vc/include/interface/vmcs_host/linux -isystem/opt/vc/include/interface/vcos/pthreads -fgnu89-inline ;
  4734. add_extralibs -L/opt/vc/lib/ -lmmal_core -lmmal_util -lmmal_vc_client -lbcm_host ;
  4735. check_lib interface/mmal/mmal.h mmal_port_connect ; }
  4736. check_lib interface/mmal/mmal.h mmal_port_connect ; } ||
  4737. die "ERROR: mmal not found"; }
  4738. enabled nvenc && { check_header nvEncodeAPI.h || die "ERROR: nvEncodeAPI.h not found."; } &&
  4739. { check_cpp_condition nvEncodeAPI.h "NVENCAPI_MAJOR_VERSION >= 5" ||
  4740. die "ERROR: NVENC API version 4 or older is not supported"; } &&
  4741. { [ $target_os != cygwin ] || die "ERROR: NVENC is not supported on Cygwin currently."; }
  4742. enabled openal && { { for al_libs in "${OPENAL_LIBS}" "-lopenal" "-lOpenAL32"; do
  4743. check_lib 'AL/al.h' alGetError "${al_libs}" && break; done } ||
  4744. die "ERROR: openal not found"; } &&
  4745. { check_cpp_condition "AL/al.h" "defined(AL_VERSION_1_1)" ||
  4746. die "ERROR: openal must be installed and version must be 1.1 or compatible"; }
  4747. enabled opencl && { check_lib2 OpenCL/cl.h clEnqueueNDRangeKernel -Wl,-framework,OpenCL ||
  4748. check_lib2 CL/cl.h clEnqueueNDRangeKernel -lOpenCL ||
  4749. die "ERROR: opencl not found"; } &&
  4750. { check_cpp_condition "OpenCL/cl.h" "defined(CL_VERSION_1_2)" ||
  4751. check_cpp_condition "CL/cl.h" "defined(CL_VERSION_1_2)" ||
  4752. die "ERROR: opencl must be installed and version must be 1.2 or compatible"; }
  4753. enabled opengl && { check_lib GL/glx.h glXGetProcAddress "-lGL" ||
  4754. check_lib2 windows.h wglGetProcAddress "-lopengl32 -lgdi32" ||
  4755. check_lib2 OpenGL/gl3.h glGetError "-Wl,-framework,OpenGL" ||
  4756. check_lib2 ES2/gl.h glGetError "-isysroot=${sysroot} -Wl,-framework,OpenGLES" ||
  4757. die "ERROR: opengl not found."
  4758. }
  4759. enabled openssl && { check_lib openssl/ssl.h SSL_library_init -lssl -lcrypto ||
  4760. check_lib openssl/ssl.h SSL_library_init -lssl32 -leay32 ||
  4761. check_lib openssl/ssl.h SSL_library_init -lssl -lcrypto -lws2_32 -lgdi32 ||
  4762. die "ERROR: openssl not found"; }
  4763. enabled qtkit_indev && { check_header_oc QTKit/QTKit.h || disable qtkit_indev; }
  4764. if enabled gnutls; then
  4765. { check_lib nettle/bignum.h nettle_mpz_get_str_256 -lnettle -lhogweed -lgmp && enable nettle; } ||
  4766. { check_lib gcrypt.h gcry_mpi_new -lgcrypt && enable gcrypt; }
  4767. fi
  4768. # libdc1394 check
  4769. if enabled libdc1394; then
  4770. { require_pkg_config libdc1394-2 dc1394/dc1394.h dc1394_new &&
  4771. enable libdc1394_2; } ||
  4772. { check_lib libdc1394/dc1394_control.h dc1394_create_handle -ldc1394_control -lraw1394 &&
  4773. enable libdc1394_1; } ||
  4774. die "ERROR: No version of libdc1394 found "
  4775. fi
  4776. if ! disabled sdl; then
  4777. SDL_CONFIG="${cross_prefix}sdl-config"
  4778. if check_pkg_config sdl SDL_events.h SDL_PollEvent; then
  4779. check_cpp_condition SDL.h "(SDL_MAJOR_VERSION<<16 | SDL_MINOR_VERSION<<8 | SDL_PATCHLEVEL) >= 0x010201" $sdl_cflags &&
  4780. check_cpp_condition SDL.h "(SDL_MAJOR_VERSION<<16 | SDL_MINOR_VERSION<<8 | SDL_PATCHLEVEL) < 0x010300" $sdl_cflags &&
  4781. enable sdl
  4782. else
  4783. if "${SDL_CONFIG}" --version > /dev/null 2>&1; then
  4784. sdl_cflags=$("${SDL_CONFIG}" --cflags)
  4785. sdl_libs=$("${SDL_CONFIG}" --libs)
  4786. check_func_headers SDL_version.h SDL_Linked_Version $sdl_cflags $sdl_libs &&
  4787. check_cpp_condition SDL.h "(SDL_MAJOR_VERSION<<16 | SDL_MINOR_VERSION<<8 | SDL_PATCHLEVEL) >= 0x010201" $sdl_cflags &&
  4788. check_cpp_condition SDL.h "(SDL_MAJOR_VERSION<<16 | SDL_MINOR_VERSION<<8 | SDL_PATCHLEVEL) < 0x010300" $sdl_cflags &&
  4789. enable sdl
  4790. elif enabled sdl ; then
  4791. die "ERROR: SDL not found"
  4792. else
  4793. disable sdl
  4794. fi
  4795. fi
  4796. fi
  4797. enabled sdl && add_cflags $sdl_cflags && add_extralibs $sdl_libs
  4798. disabled securetransport || { check_func SecIdentityCreate "-Wl,-framework,CoreFoundation -Wl,-framework,Security" &&
  4799. check_lib2 "Security/SecureTransport.h Security/Security.h" "SSLCreateContext SecItemImport" "-Wl,-framework,CoreFoundation -Wl,-framework,Security" &&
  4800. enable securetransport; }
  4801. makeinfo --version > /dev/null 2>&1 && enable makeinfo || disable makeinfo
  4802. enabled makeinfo && (makeinfo --version | \
  4803. grep -q 'makeinfo (GNU texinfo) 5' > /dev/null 2>&1) \
  4804. && enable makeinfo_html || disable makeinfo_html
  4805. disabled makeinfo_html && texi2html --help 2> /dev/null | grep -q 'init-file' && enable texi2html || disable texi2html
  4806. perl -v > /dev/null 2>&1 && enable perl || disable perl
  4807. pod2man --help > /dev/null 2>&1 && enable pod2man || disable pod2man
  4808. rsync --help 2> /dev/null | grep -q 'contimeout' && enable rsync_contimeout || disable rsync_contimeout
  4809. check_header linux/fb.h
  4810. check_header linux/videodev.h
  4811. check_header linux/videodev2.h
  4812. check_code cc linux/videodev2.h "struct v4l2_frmsizeenum vfse; vfse.discrete.width = 0;" && enable_safe struct_v4l2_frmivalenum_discrete
  4813. check_header sys/videoio.h
  4814. check_code cc sys/videoio.h "struct v4l2_frmsizeenum vfse; vfse.discrete.width = 0;" && enable_safe struct_v4l2_frmivalenum_discrete
  4815. check_func_headers "windows.h vfw.h" capCreateCaptureWindow "$vfwcap_indev_extralibs"
  4816. # check that WM_CAP_DRIVER_CONNECT is defined to the proper value
  4817. # w32api 3.12 had it defined wrong
  4818. check_cpp_condition vfw.h "WM_CAP_DRIVER_CONNECT > WM_USER" && enable vfwcap_defines
  4819. check_type "dshow.h" IBaseFilter
  4820. # check for ioctl_meteor.h, ioctl_bt848.h and alternatives
  4821. { check_header dev/bktr/ioctl_meteor.h &&
  4822. check_header dev/bktr/ioctl_bt848.h; } ||
  4823. { check_header machine/ioctl_meteor.h &&
  4824. check_header machine/ioctl_bt848.h; } ||
  4825. { check_header dev/video/meteor/ioctl_meteor.h &&
  4826. check_header dev/video/bktr/ioctl_bt848.h; } ||
  4827. check_header dev/ic/bt8xx.h
  4828. check_header sndio.h
  4829. if check_struct sys/soundcard.h audio_buf_info bytes; then
  4830. enable_safe sys/soundcard.h
  4831. else
  4832. check_cc -D__BSD_VISIBLE -D__XSI_VISIBLE <<EOF && add_cppflags -D__BSD_VISIBLE -D__XSI_VISIBLE && enable_safe sys/soundcard.h
  4833. #include <sys/soundcard.h>
  4834. audio_buf_info abc;
  4835. EOF
  4836. fi
  4837. check_header soundcard.h
  4838. enabled_any alsa_indev alsa_outdev &&
  4839. check_lib2 alsa/asoundlib.h snd_pcm_htimestamp -lasound
  4840. enabled jack_indev && check_lib2 jack/jack.h jack_client_open -ljack && check_func sem_timedwait &&
  4841. check_func jack_port_get_latency_range -ljack
  4842. enabled_any sndio_indev sndio_outdev && check_lib2 sndio.h sio_open -lsndio
  4843. if enabled libcdio; then
  4844. check_lib2 "cdio/cdda.h cdio/paranoia.h" cdio_cddap_open -lcdio_paranoia -lcdio_cdda -lcdio ||
  4845. check_lib2 "cdio/paranoia/cdda.h cdio/paranoia/paranoia.h" cdio_cddap_open -lcdio_paranoia -lcdio_cdda -lcdio ||
  4846. die "ERROR: No usable libcdio/cdparanoia found"
  4847. fi
  4848. enabled xlib &&
  4849. check_lib X11/Xlib.h XOpenDisplay -lX11 || disable xlib
  4850. if ! disabled libxcb; then
  4851. check_pkg_config "xcb >= 1.4" xcb/xcb.h xcb_connect || {
  4852. enabled libxcb && die "ERROR: libxcb >= 1.4 not found";
  4853. } && disable x11grab && enable libxcb
  4854. if enabled libxcb; then
  4855. disabled libxcb_shm || {
  4856. check_pkg_config xcb-shm xcb/shm.h xcb_shm_attach || {
  4857. enabled libxcb_shm && die "ERROR: libxcb_shm not found";
  4858. } && check_header sys/shm.h && enable libxcb_shm; }
  4859. disabled libxcb_xfixes || {
  4860. check_pkg_config xcb-xfixes xcb/xfixes.h xcb_xfixes_get_cursor_image || {
  4861. enabled libxcb_xfixes && die "ERROR: libxcb_xfixes not found";
  4862. } && enable libxcb_xfixes; }
  4863. disabled libxcb_shape || {
  4864. check_pkg_config xcb-shape xcb/shape.h xcb_shape_get_rectangles || {
  4865. enabled libxcb_shape && die "ERROR: libxcb_shape not found";
  4866. } && enable libxcb_shape; }
  4867. add_cflags $xcb_cflags $xcb_shm_cflags $xcb_xfixes_cflags $xcb_shape_cflags
  4868. add_extralibs $xcb_libs $xcb_shm_libs $xcb_xfixes_libs $xcb_shape_libs
  4869. fi
  4870. fi
  4871. if enabled x11grab; then
  4872. enabled xlib || die "ERROR: Xlib not found"
  4873. require Xext X11/extensions/XShm.h XShmCreateImage -lXext
  4874. require Xfixes X11/extensions/Xfixes.h XFixesGetCursorImage -lXfixes
  4875. fi
  4876. check_func_headers "windows.h" CreateDIBSection "$gdigrab_indev_extralibs"
  4877. enabled dxva2api_h &&
  4878. check_cc <<EOF && enable dxva2api_cobj
  4879. #define _WIN32_WINNT 0x0600
  4880. #define COBJMACROS
  4881. #include <windows.h>
  4882. #include <d3d9.h>
  4883. #include <dxva2api.h>
  4884. int main(void) { IDirectXVideoDecoder *o = NULL; IDirectXVideoDecoder_Release(o); return 0; }
  4885. EOF
  4886. enabled d3d11_h &&
  4887. check_cc <<EOF && enable d3d11_cobj
  4888. #define _WIN32_WINNT 0x0600
  4889. #define COBJMACROS
  4890. #include <windows.h>
  4891. #include <d3d11.h>
  4892. int main(void) { ID3D11VideoDecoder *o = NULL; ID3D11VideoDecoder_Release(o); return 0; }
  4893. EOF
  4894. enabled vaapi &&
  4895. check_lib va/va.h vaInitialize -lva ||
  4896. disable vaapi
  4897. enabled vaapi && enabled xlib &&
  4898. check_lib2 "va/va.h va/va_x11.h" vaGetDisplay -lva -lva-x11 &&
  4899. enable vaapi_x11
  4900. enabled vdpau &&
  4901. check_cpp_condition vdpau/vdpau.h "defined VDP_DECODER_PROFILE_MPEG4_PART2_ASP" ||
  4902. disable vdpau
  4903. enabled vdpau && enabled xlib &&
  4904. check_func_headers "vdpau/vdpau.h vdpau/vdpau_x11.h" vdp_device_create_x11 -lvdpau &&
  4905. prepend ffmpeg_libs $($ldflags_filter "-lvdpau") &&
  4906. enable vdpau_x11
  4907. # Funny iconv installations are not unusual, so check it after all flags have been set
  4908. disabled iconv || check_func_headers iconv.h iconv || check_lib2 iconv.h iconv -liconv || disable iconv
  4909. enabled debug && add_cflags -g"$debuglevel" && add_asflags -g"$debuglevel"
  4910. # add some useful compiler flags if supported
  4911. check_cflags -Wdeclaration-after-statement
  4912. check_cflags -Wall
  4913. check_cflags -Wdisabled-optimization
  4914. check_cflags -Wpointer-arith
  4915. check_cflags -Wredundant-decls
  4916. check_cflags -Wwrite-strings
  4917. check_cflags -Wtype-limits
  4918. check_cflags -Wundef
  4919. check_cflags -Wmissing-prototypes
  4920. check_cflags -Wno-pointer-to-int-cast
  4921. check_cflags -Wstrict-prototypes
  4922. check_cflags -Wempty-body
  4923. enabled extra_warnings && check_cflags -Winline
  4924. check_disable_warning(){
  4925. warning_flag=-W${1#-Wno-}
  4926. test_cflags $warning_flag && add_cflags $1
  4927. }
  4928. check_disable_warning -Wno-parentheses
  4929. check_disable_warning -Wno-switch
  4930. check_disable_warning -Wno-format-zero-length
  4931. check_disable_warning -Wno-pointer-sign
  4932. # add some linker flags
  4933. check_ldflags -Wl,--warn-common
  4934. check_ldflags -Wl,-rpath-link=libpostproc:libswresample:libswscale:libavfilter:libavdevice:libavformat:libavcodec:libavutil:libavresample
  4935. enabled rpath && add_ldexeflags -Wl,-rpath,$libdir
  4936. test_ldflags -Wl,-Bsymbolic && append SHFLAGS -Wl,-Bsymbolic
  4937. # add some strip flags
  4938. # -wN '..@*' is more selective than -x, but not available everywhere.
  4939. check_stripflags -wN \'..@*\' || check_stripflags -x
  4940. enabled neon_clobber_test &&
  4941. check_ldflags -Wl,--wrap,avcodec_open2 \
  4942. -Wl,--wrap,avcodec_decode_audio4 \
  4943. -Wl,--wrap,avcodec_decode_video2 \
  4944. -Wl,--wrap,avcodec_decode_subtitle2 \
  4945. -Wl,--wrap,avcodec_encode_audio2 \
  4946. -Wl,--wrap,avcodec_encode_video2 \
  4947. -Wl,--wrap,avcodec_encode_subtitle \
  4948. -Wl,--wrap,swr_convert \
  4949. -Wl,--wrap,avresample_convert ||
  4950. disable neon_clobber_test
  4951. enabled xmm_clobber_test &&
  4952. check_ldflags -Wl,--wrap,avcodec_open2 \
  4953. -Wl,--wrap,avcodec_decode_audio4 \
  4954. -Wl,--wrap,avcodec_decode_video2 \
  4955. -Wl,--wrap,avcodec_decode_subtitle2 \
  4956. -Wl,--wrap,avcodec_encode_audio2 \
  4957. -Wl,--wrap,avcodec_encode_video \
  4958. -Wl,--wrap,avcodec_encode_video2 \
  4959. -Wl,--wrap,avcodec_encode_subtitle \
  4960. -Wl,--wrap,swr_convert \
  4961. -Wl,--wrap,avresample_convert \
  4962. -Wl,--wrap,sws_scale ||
  4963. disable xmm_clobber_test
  4964. echo "X{};" > $TMPV
  4965. if test_ldflags -Wl,--version-script,$TMPV; then
  4966. append SHFLAGS '-Wl,--version-script,\$(SUBDIR)lib\$(NAME).ver'
  4967. check_cc <<EOF && enable symver_asm_label
  4968. void ff_foo(void) __asm__ ("av_foo@VERSION");
  4969. void ff_foo(void) { ${inline_asm+__asm__($quotes);} }
  4970. EOF
  4971. check_cc <<EOF && enable symver_gnu_asm
  4972. __asm__(".symver ff_foo,av_foo@VERSION");
  4973. void ff_foo(void) {}
  4974. EOF
  4975. fi
  4976. if [ -z "$optflags" ]; then
  4977. if enabled small; then
  4978. optflags=$cflags_size
  4979. elif enabled optimizations; then
  4980. optflags=$cflags_speed
  4981. else
  4982. optflags=$cflags_noopt
  4983. fi
  4984. fi
  4985. check_optflags(){
  4986. check_cflags "$@"
  4987. enabled lto && check_ldflags "$@"
  4988. }
  4989. if enabled lto; then
  4990. test "$cc_type" != "$ld_type" && die "LTO requires same compiler and linker"
  4991. check_cflags -flto
  4992. check_ldflags -flto $cpuflags
  4993. disable inline_asm_direct_symbol_refs
  4994. fi
  4995. check_optflags $optflags
  4996. check_optflags -fno-math-errno
  4997. check_optflags -fno-signed-zeros
  4998. enabled ftrapv && check_cflags -ftrapv
  4999. check_cc -mno-red-zone <<EOF && noredzone_flags="-mno-red-zone"
  5000. int x;
  5001. EOF
  5002. if enabled icc; then
  5003. # Just warnings, no remarks
  5004. check_cflags -w1
  5005. # -wd: Disable following warnings
  5006. # 144, 167, 556: -Wno-pointer-sign
  5007. # 188: enumerated type mixed with another type
  5008. # 1292: attribute "foo" ignored
  5009. # 1419: external declaration in primary source file
  5010. # 10006: ignoring unknown option -fno-signed-zeros
  5011. # 10148: ignoring unknown option -Wno-parentheses
  5012. # 10156: ignoring option '-W'; no argument required
  5013. # 13200: No EMMS instruction before call to function
  5014. # 13203: No EMMS instruction before return from function
  5015. check_cflags -wd144,167,188,556,1292,1419,10006,10148,10156,13200,13203
  5016. # 11030: Warning unknown option --as-needed
  5017. # 10156: ignoring option '-export'; no argument required
  5018. check_ldflags -wd10156,11030
  5019. # icc 11.0 and 11.1 work with ebp_available, but don't pass the test
  5020. enable ebp_available
  5021. # The test above does not test linking
  5022. enabled lto && disable symver_asm_label
  5023. if enabled x86_32; then
  5024. icc_version=$($cc -dumpversion)
  5025. test ${icc_version%%.*} -ge 11 &&
  5026. check_cflags -falign-stack=maintain-16-byte ||
  5027. disable aligned_stack
  5028. fi
  5029. elif enabled ccc; then
  5030. # disable some annoying warnings
  5031. add_cflags -msg_disable bitnotint
  5032. add_cflags -msg_disable mixfuncvoid
  5033. add_cflags -msg_disable nonstandcast
  5034. add_cflags -msg_disable unsupieee
  5035. elif enabled gcc; then
  5036. check_optflags -fno-tree-vectorize
  5037. check_cflags -Werror=format-security
  5038. check_cflags -Werror=implicit-function-declaration
  5039. check_cflags -Werror=missing-prototypes
  5040. check_cflags -Werror=return-type
  5041. check_cflags -Werror=vla
  5042. check_cflags -Wformat
  5043. check_cflags -fdiagnostics-color=auto
  5044. enabled extra_warnings || check_disable_warning -Wno-maybe-uninitialized
  5045. elif enabled llvm_gcc; then
  5046. check_cflags -mllvm -stack-alignment=16
  5047. elif enabled clang; then
  5048. check_cflags -mllvm -stack-alignment=16
  5049. check_cflags -Qunused-arguments
  5050. check_cflags -Werror=implicit-function-declaration
  5051. check_cflags -Werror=missing-prototypes
  5052. check_cflags -Werror=return-type
  5053. elif enabled cparser; then
  5054. add_cflags -Wno-missing-variable-declarations
  5055. add_cflags -Wno-empty-statement
  5056. elif enabled armcc; then
  5057. add_cflags -W${armcc_opt},--diag_suppress=4343 # hardfp compat
  5058. add_cflags -W${armcc_opt},--diag_suppress=3036 # using . as system include dir
  5059. # 2523: use of inline assembly is deprecated
  5060. add_cflags -W${armcc_opt},--diag_suppress=2523
  5061. add_cflags -W${armcc_opt},--diag_suppress=1207
  5062. add_cflags -W${armcc_opt},--diag_suppress=1293 # assignment in condition
  5063. add_cflags -W${armcc_opt},--diag_suppress=3343 # hardfp compat
  5064. add_cflags -W${armcc_opt},--diag_suppress=167 # pointer sign
  5065. add_cflags -W${armcc_opt},--diag_suppress=513 # pointer sign
  5066. elif enabled tms470; then
  5067. add_cflags -pds=824 -pds=837
  5068. disable inline_asm
  5069. elif enabled pathscale; then
  5070. add_cflags -fstrict-overflow -OPT:wrap_around_unsafe_opt=OFF
  5071. elif enabled_any msvc icl; then
  5072. enabled x86_32 && disable aligned_stack
  5073. enabled_all x86_32 debug && add_cflags -Oy-
  5074. enabled debug && add_ldflags -debug
  5075. enable pragma_deprecated
  5076. if enabled icl; then
  5077. # -Qansi-alias is basically -fstrict-aliasing, but does not work
  5078. # (correctly) on icl 13.x.
  5079. check_cpp_condition "windows.h" "__ICL < 1300 || __ICL >= 1400" &&
  5080. add_cflags -Qansi-alias
  5081. # Some inline asm is not compilable in debug
  5082. if enabled debug; then
  5083. disable ebp_available
  5084. disable ebx_available
  5085. fi
  5086. fi
  5087. # msvcrt10 x64 incorrectly enables log2, only msvcrt12 (MSVC 2013) onwards actually has log2.
  5088. check_cpp_condition crtversion.h "_VC_CRT_MAJOR_VERSION >= 12" || disable log2
  5089. fi
  5090. case $as_type in
  5091. clang)
  5092. add_asflags -Qunused-arguments
  5093. ;;
  5094. esac
  5095. case $ld_type in
  5096. clang)
  5097. check_ldflags -Qunused-arguments
  5098. ;;
  5099. esac
  5100. case $target_os in
  5101. osf1)
  5102. enabled ccc && add_ldflags '-Wl,-expect_unresolved,*'
  5103. ;;
  5104. plan9)
  5105. add_cppflags -Dmain=plan9_main
  5106. ;;
  5107. esac
  5108. enable frame_thread_encoder
  5109. enabled asm || { arch=c; disable $ARCH_LIST $ARCH_EXT_LIST; }
  5110. check_deps $CONFIG_LIST \
  5111. $CONFIG_EXTRA \
  5112. $HAVE_LIST \
  5113. $ALL_COMPONENTS \
  5114. 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"
  5115. if test $target_os = "haiku"; then
  5116. disable memalign
  5117. disable posix_memalign
  5118. fi
  5119. enabled_all d3d11va d3d11_cobj CoTaskMemFree &&
  5120. prepend ffmpeg_libs $($ldflags_filter "-lole32") &&
  5121. enable d3d11va_lib
  5122. enabled_all dxva2 dxva2api_cobj CoTaskMemFree &&
  5123. prepend ffmpeg_libs $($ldflags_filter "-lole32" "-luser32") &&
  5124. enable dxva2_lib
  5125. ! enabled_any memalign posix_memalign aligned_malloc &&
  5126. enabled simd_align_16 && enable memalign_hack
  5127. # add_dep lib dep
  5128. # -> enable ${lib}_deps_${dep}
  5129. # -> add $dep to ${lib}_deps only once
  5130. add_dep() {
  5131. lib=$1
  5132. dep=$2
  5133. enabled "${lib}_deps_${dep}" && return 0
  5134. enable "${lib}_deps_${dep}"
  5135. prepend "${lib}_deps" $dep
  5136. }
  5137. # merge deps lib components
  5138. # merge all ${component}_deps into ${lib}_deps and ${lib}_deps_*
  5139. merge_deps() {
  5140. lib=$1
  5141. shift
  5142. for comp in $*; do
  5143. enabled $comp || continue
  5144. eval "dep=\"\$${comp}_deps\""
  5145. for d in $dep; do
  5146. add_dep $lib $d
  5147. done
  5148. done
  5149. }
  5150. merge_deps libavfilter $FILTER_LIST
  5151. map 'enabled $v && intrinsics=${v#intrinsics_}' $INTRINSICS_LIST
  5152. for thread in $THREADS_LIST; do
  5153. if enabled $thread; then
  5154. test -n "$thread_type" &&
  5155. die "ERROR: Only one thread type must be selected." ||
  5156. thread_type="$thread"
  5157. fi
  5158. done
  5159. enabled zlib && add_cppflags -DZLIB_CONST
  5160. # conditional library dependencies, in linking order
  5161. enabled amovie_filter && prepend avfilter_deps "avformat avcodec"
  5162. enabled aresample_filter && prepend avfilter_deps "swresample"
  5163. enabled asyncts_filter && prepend avfilter_deps "avresample"
  5164. enabled atempo_filter && prepend avfilter_deps "avcodec"
  5165. enabled cover_rect_filter && prepend avfilter_deps "avformat avcodec"
  5166. enabled ebur128_filter && enabled swresample && prepend avfilter_deps "swresample"
  5167. enabled elbg_filter && prepend avfilter_deps "avcodec"
  5168. enabled fftfilt_filter && prepend avfilter_deps "avcodec"
  5169. enabled find_rect_filter && prepend avfilter_deps "avformat avcodec"
  5170. enabled mcdeint_filter && prepend avfilter_deps "avcodec"
  5171. enabled movie_filter && prepend avfilter_deps "avformat avcodec"
  5172. enabled pan_filter && prepend avfilter_deps "swresample"
  5173. enabled pp_filter && prepend avfilter_deps "postproc"
  5174. enabled removelogo_filter && prepend avfilter_deps "avformat avcodec swscale"
  5175. enabled resample_filter && prepend avfilter_deps "avresample"
  5176. enabled sab_filter && prepend avfilter_deps "swscale"
  5177. enabled scale_filter && prepend avfilter_deps "swscale"
  5178. enabled showspectrum_filter && prepend avfilter_deps "avcodec"
  5179. enabled smartblur_filter && prepend avfilter_deps "swscale"
  5180. enabled subtitles_filter && prepend avfilter_deps "avformat avcodec"
  5181. enabled uspp_filter && prepend avfilter_deps "avcodec"
  5182. enabled lavfi_indev && prepend avdevice_deps "avfilter"
  5183. enabled opus_decoder && prepend avcodec_deps "swresample"
  5184. expand_deps(){
  5185. lib_deps=${1}_deps
  5186. eval "deps=\$$lib_deps"
  5187. append $lib_deps $(map 'eval echo \$${v}_deps' $deps)
  5188. unique $lib_deps
  5189. }
  5190. #we have to remove gpl from the deps here as some code assumes all lib deps are libs
  5191. postproc_deps="$(filter_out 'gpl' $postproc_deps)"
  5192. map 'expand_deps $v' $LIBRARY_LIST
  5193. echo "install prefix $prefix"
  5194. echo "source path $source_path"
  5195. echo "C compiler $cc"
  5196. echo "C library $libc_type"
  5197. if test "$host_cc" != "$cc"; then
  5198. echo "host C compiler $host_cc"
  5199. echo "host C library $host_libc_type"
  5200. fi
  5201. echo "ARCH $arch ($cpu)"
  5202. if test "$build_suffix" != ""; then
  5203. echo "build suffix $build_suffix"
  5204. fi
  5205. if test "$progs_suffix" != ""; then
  5206. echo "progs suffix $progs_suffix"
  5207. fi
  5208. if test "$extra_version" != ""; then
  5209. echo "version string suffix $extra_version"
  5210. fi
  5211. echo "big-endian ${bigendian-no}"
  5212. echo "runtime cpu detection ${runtime_cpudetect-no}"
  5213. if enabled x86; then
  5214. echo "${yasmexe} ${yasm-no}"
  5215. echo "MMX enabled ${mmx-no}"
  5216. echo "MMXEXT enabled ${mmxext-no}"
  5217. echo "3DNow! enabled ${amd3dnow-no}"
  5218. echo "3DNow! extended enabled ${amd3dnowext-no}"
  5219. echo "SSE enabled ${sse-no}"
  5220. echo "SSSE3 enabled ${ssse3-no}"
  5221. echo "AVX enabled ${avx-no}"
  5222. echo "XOP enabled ${xop-no}"
  5223. echo "FMA3 enabled ${fma3-no}"
  5224. echo "FMA4 enabled ${fma4-no}"
  5225. echo "i686 features enabled ${i686-no}"
  5226. echo "CMOV is fast ${fast_cmov-no}"
  5227. echo "EBX available ${ebx_available-no}"
  5228. echo "EBP available ${ebp_available-no}"
  5229. fi
  5230. if enabled aarch64; then
  5231. echo "NEON enabled ${neon-no}"
  5232. echo "VFP enabled ${vfp-no}"
  5233. fi
  5234. if enabled arm; then
  5235. echo "ARMv5TE enabled ${armv5te-no}"
  5236. echo "ARMv6 enabled ${armv6-no}"
  5237. echo "ARMv6T2 enabled ${armv6t2-no}"
  5238. echo "VFP enabled ${vfp-no}"
  5239. echo "NEON enabled ${neon-no}"
  5240. echo "THUMB enabled ${thumb-no}"
  5241. fi
  5242. if enabled mips; then
  5243. echo "MIPS FPU enabled ${mipsfpu-no}"
  5244. echo "MIPS32R5 enabled ${mips32r5-no}"
  5245. echo "MIPS64R6 enabled ${mips64r6-no}"
  5246. echo "MIPS DSP R1 enabled ${mipsdspr1-no}"
  5247. echo "MIPS DSP R2 enabled ${mipsdspr2-no}"
  5248. echo "MIPS MSA enabled ${msa-no}"
  5249. echo "LOONGSON3 enabled ${loongson3-no}"
  5250. fi
  5251. if enabled ppc; then
  5252. echo "AltiVec enabled ${altivec-no}"
  5253. echo "VSX enabled ${vsx-no}"
  5254. echo "POWER8 enabled ${power8-no}"
  5255. echo "PPC 4xx optimizations ${ppc4xx-no}"
  5256. echo "dcbzl available ${dcbzl-no}"
  5257. fi
  5258. echo "debug symbols ${debug-no}"
  5259. echo "strip symbols ${stripping-no}"
  5260. echo "optimize for size ${small-no}"
  5261. echo "optimizations ${optimizations-no}"
  5262. echo "static ${static-no}"
  5263. echo "shared ${shared-no}"
  5264. echo "postprocessing support ${postproc-no}"
  5265. echo "new filter support ${avfilter-no}"
  5266. echo "network support ${network-no}"
  5267. echo "threading support ${thread_type-no}"
  5268. echo "safe bitstream reader ${safe_bitstream_reader-no}"
  5269. echo "SDL support ${sdl-no}"
  5270. echo "opencl enabled ${opencl-no}"
  5271. echo "texi2html enabled ${texi2html-no}"
  5272. echo "perl enabled ${perl-no}"
  5273. echo "pod2man enabled ${pod2man-no}"
  5274. echo "makeinfo enabled ${makeinfo-no}"
  5275. echo "makeinfo supports HTML ${makeinfo_html-no}"
  5276. test -n "$random_seed" &&
  5277. echo "random seed ${random_seed}"
  5278. echo
  5279. echo "External libraries:"
  5280. print_enabled '' $EXTERNAL_LIBRARY_LIST | print_3_columns
  5281. echo
  5282. for type in decoder encoder hwaccel parser demuxer muxer protocol filter bsf indev outdev; do
  5283. echo "Enabled ${type}s:"
  5284. eval list=\$$(toupper $type)_LIST
  5285. print_enabled '_*' $list | print_3_columns
  5286. echo
  5287. done
  5288. license="LGPL version 2.1 or later"
  5289. if enabled nonfree; then
  5290. license="nonfree and unredistributable"
  5291. elif enabled gplv3; then
  5292. license="GPL version 3 or later"
  5293. elif enabled lgplv3; then
  5294. license="LGPL version 3 or later"
  5295. elif enabled gpl; then
  5296. license="GPL version 2 or later"
  5297. fi
  5298. echo "License: $license"
  5299. echo "Creating config.mak, config.h, and doc/config.texi..."
  5300. test -e Makefile || echo "include $source_path/Makefile" > Makefile
  5301. enabled stripping || strip="echo skipping strip"
  5302. config_files="$TMPH config.mak doc/config.texi"
  5303. cat > config.mak <<EOF
  5304. # Automatically generated by configure - do not modify!
  5305. ifndef FFMPEG_CONFIG_MAK
  5306. FFMPEG_CONFIG_MAK=1
  5307. FFMPEG_CONFIGURATION=$FFMPEG_CONFIGURATION
  5308. prefix=$prefix
  5309. LIBDIR=\$(DESTDIR)$libdir
  5310. SHLIBDIR=\$(DESTDIR)$shlibdir
  5311. INCDIR=\$(DESTDIR)$incdir
  5312. BINDIR=\$(DESTDIR)$bindir
  5313. DATADIR=\$(DESTDIR)$datadir
  5314. DOCDIR=\$(DESTDIR)$docdir
  5315. MANDIR=\$(DESTDIR)$mandir
  5316. PKGCONFIGDIR=\$(DESTDIR)$pkgconfigdir
  5317. SRC_PATH=$source_path
  5318. ifndef MAIN_MAKEFILE
  5319. SRC_PATH:=\$(SRC_PATH:.%=..%)
  5320. endif
  5321. CC_IDENT=$cc_ident
  5322. ARCH=$arch
  5323. INTRINSICS=$intrinsics
  5324. CC=$cc
  5325. CXX=$cxx
  5326. AS=$as
  5327. LD=$ld
  5328. DEPCC=$dep_cc
  5329. DEPCCFLAGS=$DEPCCFLAGS \$(CPPFLAGS)
  5330. DEPAS=$as
  5331. DEPASFLAGS=$DEPASFLAGS \$(CPPFLAGS)
  5332. YASM=$yasmexe
  5333. DEPYASM=$yasmexe
  5334. AR=$ar
  5335. ARFLAGS=$arflags
  5336. AR_O=$ar_o
  5337. RANLIB=$ranlib
  5338. STRIP=$strip
  5339. CP=cp -p
  5340. LN_S=$ln_s
  5341. CPPFLAGS=$CPPFLAGS
  5342. CFLAGS=$CFLAGS
  5343. CXXFLAGS=$CXXFLAGS
  5344. ASFLAGS=$ASFLAGS
  5345. AS_C=$AS_C
  5346. AS_O=$AS_O
  5347. CC_C=$CC_C
  5348. CC_E=$CC_E
  5349. CC_O=$CC_O
  5350. CXX_C=$CXX_C
  5351. CXX_O=$CXX_O
  5352. LD_O=$LD_O
  5353. LD_LIB=$LD_LIB
  5354. LD_PATH=$LD_PATH
  5355. DLLTOOL=$dlltool
  5356. WINDRES=$windres
  5357. DEPWINDRES=$dep_cc
  5358. DOXYGEN=$doxygen
  5359. LDFLAGS=$LDFLAGS
  5360. LDEXEFLAGS=$LDEXEFLAGS
  5361. SHFLAGS=$(echo $($ldflags_filter $SHFLAGS))
  5362. ASMSTRIPFLAGS=$ASMSTRIPFLAGS
  5363. YASMFLAGS=$YASMFLAGS
  5364. BUILDSUF=$build_suffix
  5365. PROGSSUF=$progs_suffix
  5366. FULLNAME=$FULLNAME
  5367. LIBPREF=$LIBPREF
  5368. LIBSUF=$LIBSUF
  5369. LIBNAME=$LIBNAME
  5370. SLIBPREF=$SLIBPREF
  5371. SLIBSUF=$SLIBSUF
  5372. EXESUF=$EXESUF
  5373. EXTRA_VERSION=$extra_version
  5374. CCDEP=$CCDEP
  5375. CXXDEP=$CXXDEP
  5376. CCDEP_FLAGS=$CCDEP_FLAGS
  5377. ASDEP=$ASDEP
  5378. ASDEP_FLAGS=$ASDEP_FLAGS
  5379. CC_DEPFLAGS=$CC_DEPFLAGS
  5380. AS_DEPFLAGS=$AS_DEPFLAGS
  5381. HOSTCC=$host_cc
  5382. HOSTLD=$host_ld
  5383. HOSTCFLAGS=$host_cflags
  5384. HOSTCPPFLAGS=$host_cppflags
  5385. HOSTEXESUF=$HOSTEXESUF
  5386. HOSTLDFLAGS=$host_ldflags
  5387. HOSTLIBS=$host_libs
  5388. DEPHOSTCC=$host_cc
  5389. DEPHOSTCCFLAGS=$DEPHOSTCCFLAGS \$(HOSTCCFLAGS)
  5390. HOSTCCDEP=$HOSTCCDEP
  5391. HOSTCCDEP_FLAGS=$HOSTCCDEP_FLAGS
  5392. HOSTCC_DEPFLAGS=$HOSTCC_DEPFLAGS
  5393. HOSTCC_C=$HOSTCC_C
  5394. HOSTCC_O=$HOSTCC_O
  5395. HOSTLD_O=$HOSTLD_O
  5396. TARGET_EXEC=$target_exec $target_exec_args
  5397. TARGET_PATH=$target_path
  5398. TARGET_SAMPLES=${target_samples:-\$(SAMPLES)}
  5399. CFLAGS-ffplay=$sdl_cflags
  5400. ZLIB=$($ldflags_filter -lz)
  5401. LIB_INSTALL_EXTRA_CMD=$LIB_INSTALL_EXTRA_CMD
  5402. EXTRALIBS=$extralibs
  5403. COMPAT_OBJS=$compat_objs
  5404. EXEOBJS=$exeobjs
  5405. INSTALL=$install
  5406. LIBTARGET=${LIBTARGET}
  5407. SLIBNAME=${SLIBNAME}
  5408. SLIBNAME_WITH_VERSION=${SLIBNAME_WITH_VERSION}
  5409. SLIBNAME_WITH_MAJOR=${SLIBNAME_WITH_MAJOR}
  5410. SLIB_CREATE_DEF_CMD=${SLIB_CREATE_DEF_CMD}
  5411. SLIB_EXTRA_CMD=${SLIB_EXTRA_CMD}
  5412. SLIB_INSTALL_NAME=${SLIB_INSTALL_NAME}
  5413. SLIB_INSTALL_LINKS=${SLIB_INSTALL_LINKS}
  5414. SLIB_INSTALL_EXTRA_LIB=${SLIB_INSTALL_EXTRA_LIB}
  5415. SLIB_INSTALL_EXTRA_SHLIB=${SLIB_INSTALL_EXTRA_SHLIB}
  5416. SAMPLES:=${samples:-\$(FATE_SAMPLES)}
  5417. NOREDZONE_FLAGS=$noredzone_flags
  5418. EOF
  5419. get_version(){
  5420. lcname=lib${1}
  5421. name=$(toupper $lcname)
  5422. file=$source_path/$lcname/version.h
  5423. eval $(awk "/#define ${name}_VERSION_M/ { print \$2 \"=\" \$3 }" "$file")
  5424. enabled raise_major && eval ${name}_VERSION_MAJOR=$((${name}_VERSION_MAJOR+100))
  5425. eval ${name}_VERSION=\$${name}_VERSION_MAJOR.\$${name}_VERSION_MINOR.\$${name}_VERSION_MICRO
  5426. eval echo "${lcname}_VERSION=\$${name}_VERSION" >> config.mak
  5427. eval echo "${lcname}_VERSION_MAJOR=\$${name}_VERSION_MAJOR" >> config.mak
  5428. eval echo "${lcname}_VERSION_MINOR=\$${name}_VERSION_MINOR" >> config.mak
  5429. }
  5430. map 'get_version $v' $LIBRARY_LIST
  5431. map 'eval echo "${v}_FFLIBS=\$${v}_deps" >> config.mak' $LIBRARY_LIST
  5432. print_program_libs(){
  5433. eval "program_libs=\$${1}_libs"
  5434. eval echo "LIBS-${1}=${program_libs}" >> config.mak
  5435. }
  5436. map 'print_program_libs $v' $PROGRAM_LIST
  5437. cat > $TMPH <<EOF
  5438. /* Automatically generated by configure - do not modify! */
  5439. #ifndef FFMPEG_CONFIG_H
  5440. #define FFMPEG_CONFIG_H
  5441. #define FFMPEG_CONFIGURATION "$(c_escape $FFMPEG_CONFIGURATION)"
  5442. #define FFMPEG_LICENSE "$(c_escape $license)"
  5443. #define CONFIG_THIS_YEAR 2015
  5444. #define FFMPEG_DATADIR "$(eval c_escape $datadir)"
  5445. #define AVCONV_DATADIR "$(eval c_escape $datadir)"
  5446. #define CC_IDENT "$(c_escape ${cc_ident:-Unknown compiler})"
  5447. #define av_restrict $_restrict
  5448. #define EXTERN_PREFIX "${extern_prefix}"
  5449. #define EXTERN_ASM ${extern_prefix}
  5450. #define BUILDSUF "$build_suffix"
  5451. #define SLIBSUF "$SLIBSUF"
  5452. #define HAVE_MMX2 HAVE_MMXEXT
  5453. #define SWS_MAX_FILTER_SIZE $sws_max_filter_size
  5454. EOF
  5455. test -n "$assert_level" &&
  5456. echo "#define ASSERT_LEVEL $assert_level" >>$TMPH
  5457. test -n "$malloc_prefix" &&
  5458. echo "#define MALLOC_PREFIX $malloc_prefix" >>$TMPH
  5459. if enabled yasm; then
  5460. append config_files $TMPASM
  5461. printf '' >$TMPASM
  5462. fi
  5463. enabled getenv || echo "#define getenv(x) NULL" >> $TMPH
  5464. mkdir -p doc
  5465. mkdir -p tests
  5466. echo "@c auto-generated by configure" > doc/config.texi
  5467. print_config ARCH_ "$config_files" $ARCH_LIST
  5468. print_config HAVE_ "$config_files" $HAVE_LIST
  5469. print_config CONFIG_ "$config_files" $CONFIG_LIST \
  5470. $CONFIG_EXTRA \
  5471. $ALL_COMPONENTS \
  5472. echo "#endif /* FFMPEG_CONFIG_H */" >> $TMPH
  5473. echo "endif # FFMPEG_CONFIG_MAK" >> config.mak
  5474. # Do not overwrite an unchanged config.h to avoid superfluous rebuilds.
  5475. cp_if_changed $TMPH config.h
  5476. touch .config
  5477. enabled yasm && cp_if_changed $TMPASM config.asm
  5478. cat > $TMPH <<EOF
  5479. /* Generated by ffconf */
  5480. #ifndef AVUTIL_AVCONFIG_H
  5481. #define AVUTIL_AVCONFIG_H
  5482. EOF
  5483. print_config AV_HAVE_ $TMPH $HAVE_LIST_PUB
  5484. echo "#endif /* AVUTIL_AVCONFIG_H */" >> $TMPH
  5485. cp_if_changed $TMPH libavutil/avconfig.h
  5486. if test -n "$WARNINGS"; then
  5487. printf "\n$WARNINGS"
  5488. enabled fatal_warnings && exit 1
  5489. fi
  5490. # build pkg-config files
  5491. lib_version(){
  5492. eval printf "\"lib${1}${build_suffix} >= \$LIB$(toupper ${1})_VERSION, \""
  5493. }
  5494. pkgconfig_generate(){
  5495. name=$1
  5496. shortname=${name#lib}${build_suffix}
  5497. comment=$2
  5498. version=$3
  5499. libs=$4
  5500. requires=$(map 'lib_version $v' $(eval echo \$${name#lib}_deps))
  5501. requires=${requires%, }
  5502. enabled ${name#lib} || return 0
  5503. mkdir -p $name
  5504. cat <<EOF > $name/$name${build_suffix}.pc
  5505. prefix=$prefix
  5506. exec_prefix=\${prefix}
  5507. libdir=$libdir
  5508. includedir=$incdir
  5509. Name: $name
  5510. Description: $comment
  5511. Version: $version
  5512. Requires: $(enabled shared || echo $requires)
  5513. Requires.private: $(enabled shared && echo $requires)
  5514. Conflicts:
  5515. Libs: -L\${libdir} $(enabled rpath && echo "-Wl,-rpath,\${libdir}") -l${shortname} $(enabled shared || echo $libs)
  5516. Libs.private: $(enabled shared && echo $libs)
  5517. Cflags: -I\${includedir}
  5518. EOF
  5519. mkdir -p doc/examples/pc-uninstalled
  5520. includedir=${source_path}
  5521. [ "$includedir" = . ] && includedir="\${pcfiledir}/../../.."
  5522. cat <<EOF > doc/examples/pc-uninstalled/$name.pc
  5523. prefix=
  5524. exec_prefix=
  5525. libdir=\${pcfiledir}/../../../$name
  5526. includedir=${includedir}
  5527. Name: $name
  5528. Description: $comment
  5529. Version: $version
  5530. Requires: $requires
  5531. Conflicts:
  5532. Libs: -L\${libdir} -Wl,-rpath,\${libdir} -l${shortname} $(enabled shared || echo $libs)
  5533. Cflags: -I\${includedir}
  5534. EOF
  5535. }
  5536. pkgconfig_generate libavutil "FFmpeg utility library" "$LIBAVUTIL_VERSION" "$LIBRT $LIBM"
  5537. pkgconfig_generate libavcodec "FFmpeg codec library" "$LIBAVCODEC_VERSION" "$extralibs"
  5538. pkgconfig_generate libavformat "FFmpeg container format library" "$LIBAVFORMAT_VERSION" "$extralibs"
  5539. pkgconfig_generate libavdevice "FFmpeg device handling library" "$LIBAVDEVICE_VERSION" "$extralibs"
  5540. pkgconfig_generate libavfilter "FFmpeg audio/video filtering library" "$LIBAVFILTER_VERSION" "$extralibs"
  5541. pkgconfig_generate libpostproc "FFmpeg postprocessing library" "$LIBPOSTPROC_VERSION" ""
  5542. pkgconfig_generate libavresample "Libav audio resampling library" "$LIBAVRESAMPLE_VERSION" "$LIBM"
  5543. pkgconfig_generate libswscale "FFmpeg image rescaling library" "$LIBSWSCALE_VERSION" "$LIBM"
  5544. pkgconfig_generate libswresample "FFmpeg audio resampling library" "$LIBSWRESAMPLE_VERSION" "$LIBM"