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.

6186 lines
195KB

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