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.

5998 lines
188KB

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