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.

6231 lines
197KB

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