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.

5892 lines
184KB

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