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.

6133 lines
193KB

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