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.

6148 lines
193KB

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