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.

5889 lines
183KB

  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. # demuxers / muxers
  2220. ac3_demuxer_select="ac3_parser"
  2221. asf_demuxer_select="riffdec"
  2222. asf_muxer_select="riffenc"
  2223. asf_stream_muxer_select="asf_muxer"
  2224. avi_demuxer_select="riffdec exif"
  2225. avi_muxer_select="riffenc"
  2226. avisynth_demuxer_deps="avisynth"
  2227. avisynth_demuxer_select="riffdec"
  2228. caf_demuxer_select="riffdec"
  2229. dash_muxer_select="mp4_muxer"
  2230. dirac_demuxer_select="dirac_parser"
  2231. dts_demuxer_select="dca_parser"
  2232. dtshd_demuxer_select="dca_parser"
  2233. dv_demuxer_select="dvprofile"
  2234. dv_muxer_select="dvprofile"
  2235. dxa_demuxer_select="riffdec"
  2236. eac3_demuxer_select="ac3_parser"
  2237. f4v_muxer_select="mov_muxer"
  2238. flac_demuxer_select="flac_parser"
  2239. hds_muxer_select="flv_muxer"
  2240. hls_muxer_select="mpegts_muxer"
  2241. image2_alias_pix_demuxer_select="image2_demuxer"
  2242. image2_brender_pix_demuxer_select="image2_demuxer"
  2243. ipod_muxer_select="mov_muxer"
  2244. ismv_muxer_select="mov_muxer"
  2245. libnut_demuxer_deps="libnut"
  2246. libnut_muxer_deps="libnut"
  2247. matroska_audio_muxer_select="matroska_muxer"
  2248. matroska_demuxer_select="riffdec"
  2249. matroska_demuxer_suggest="bzlib lzo zlib"
  2250. matroska_muxer_select="riffenc"
  2251. mmf_muxer_select="riffenc"
  2252. mov_demuxer_select="riffdec"
  2253. mov_demuxer_suggest="zlib"
  2254. mov_muxer_select="riffenc rtpenc_chain"
  2255. mp3_demuxer_select="mpegaudio_parser"
  2256. mp4_muxer_select="mov_muxer"
  2257. mpegts_muxer_select="adts_muxer latm_muxer"
  2258. mpegtsraw_demuxer_select="mpegts_demuxer"
  2259. mxf_d10_muxer_select="mxf_muxer"
  2260. mxf_opatom_muxer_select="mxf_muxer"
  2261. nut_muxer_select="riffenc"
  2262. nuv_demuxer_select="riffdec"
  2263. oga_muxer_select="ogg_muxer"
  2264. ogg_demuxer_select="golomb"
  2265. opus_muxer_select="ogg_muxer"
  2266. psp_muxer_select="mov_muxer"
  2267. rtp_demuxer_select="sdp_demuxer"
  2268. rtpdec_select="asf_demuxer rm_demuxer rtp_protocol mpegts_demuxer mov_demuxer"
  2269. rtsp_demuxer_select="http_protocol rtpdec"
  2270. rtsp_muxer_select="rtp_muxer http_protocol rtp_protocol rtpenc_chain"
  2271. sap_demuxer_select="sdp_demuxer"
  2272. sap_muxer_select="rtp_muxer rtp_protocol rtpenc_chain"
  2273. sdp_demuxer_select="rtpdec"
  2274. smoothstreaming_muxer_select="ismv_muxer"
  2275. spdif_muxer_select="aac_parser"
  2276. spx_muxer_select="ogg_muxer"
  2277. tak_demuxer_select="tak_parser"
  2278. tg2_muxer_select="mov_muxer"
  2279. tgp_muxer_select="mov_muxer"
  2280. vobsub_demuxer_select="mpegps_demuxer"
  2281. w64_demuxer_select="wav_demuxer"
  2282. w64_muxer_select="wav_muxer"
  2283. wav_demuxer_select="riffdec"
  2284. wav_muxer_select="riffenc"
  2285. webm_muxer_select="riffenc"
  2286. wtv_demuxer_select="riffdec"
  2287. wtv_muxer_select="riffenc"
  2288. xmv_demuxer_select="riffdec"
  2289. xwma_demuxer_select="riffdec"
  2290. # indevs / outdevs
  2291. alsa_indev_deps="alsa_asoundlib_h snd_pcm_htimestamp"
  2292. alsa_outdev_deps="alsa_asoundlib_h"
  2293. avfoundation_indev_extralibs="-framework CoreVideo -framework Foundation -framework AVFoundation -framework CoreMedia"
  2294. avfoundation_indev_select="avfoundation"
  2295. bktr_indev_deps_any="dev_bktr_ioctl_bt848_h machine_ioctl_bt848_h dev_video_bktr_ioctl_bt848_h dev_ic_bt8xx_h"
  2296. caca_outdev_deps="libcaca"
  2297. decklink_outdev_deps="decklink pthreads"
  2298. decklink_outdev_extralibs="-lstdc++"
  2299. decklink_indev_deps="decklink pthreads"
  2300. decklink_indev_extralibs="-lstdc++"
  2301. dshow_indev_deps="IBaseFilter"
  2302. dshow_indev_extralibs="-lpsapi -lole32 -lstrmiids -luuid -loleaut32"
  2303. dv1394_indev_deps="dv1394"
  2304. dv1394_indev_select="dv_demuxer"
  2305. fbdev_indev_deps="linux_fb_h"
  2306. fbdev_outdev_deps="linux_fb_h"
  2307. gdigrab_indev_deps="CreateDIBSection"
  2308. gdigrab_indev_extralibs="-lgdi32"
  2309. gdigrab_indev_select="bmp_decoder"
  2310. iec61883_indev_deps="libiec61883"
  2311. jack_indev_deps="jack_jack_h sem_timedwait"
  2312. lavfi_indev_deps="avfilter"
  2313. libcdio_indev_deps="libcdio"
  2314. libdc1394_indev_deps="libdc1394"
  2315. libv4l2_indev_deps="libv4l2"
  2316. openal_indev_deps="openal"
  2317. opengl_outdev_deps="opengl"
  2318. oss_indev_deps_any="soundcard_h sys_soundcard_h"
  2319. oss_outdev_deps_any="soundcard_h sys_soundcard_h"
  2320. pulse_indev_deps="libpulse"
  2321. pulse_outdev_deps="libpulse"
  2322. qtkit_indev_extralibs="-framework QTKit -framework Foundation -framework QuartzCore"
  2323. qtkit_indev_select="qtkit"
  2324. sdl_outdev_deps="sdl"
  2325. sndio_indev_deps="sndio_h"
  2326. sndio_outdev_deps="sndio_h"
  2327. v4l_indev_deps="linux_videodev_h"
  2328. v4l2_indev_deps_any="linux_videodev2_h sys_videoio_h"
  2329. v4l2_outdev_deps_any="linux_videodev2_h sys_videoio_h"
  2330. vfwcap_indev_deps="capCreateCaptureWindow vfwcap_defines"
  2331. vfwcap_indev_extralibs="-lavicap32"
  2332. xv_outdev_deps="X11_extensions_Xvlib_h XvGetPortAttribute"
  2333. xv_outdev_extralibs="-lXv -lX11 -lXext"
  2334. x11grab_indev_deps="x11grab"
  2335. x11grab_xcb_indev_deps="libxcb"
  2336. # protocols
  2337. bluray_protocol_deps="libbluray"
  2338. ffrtmpcrypt_protocol_deps="!librtmp_protocol"
  2339. ffrtmpcrypt_protocol_deps_any="gcrypt nettle openssl"
  2340. ffrtmpcrypt_protocol_select="tcp_protocol"
  2341. ffrtmphttp_protocol_deps="!librtmp_protocol"
  2342. ffrtmphttp_protocol_select="http_protocol"
  2343. ftp_protocol_select="tcp_protocol"
  2344. gopher_protocol_select="network"
  2345. http_protocol_select="tcp_protocol"
  2346. httpproxy_protocol_select="tcp_protocol"
  2347. https_protocol_select="tls_protocol"
  2348. icecast_protocol_select="http_protocol"
  2349. librtmp_protocol_deps="librtmp"
  2350. librtmpe_protocol_deps="librtmp"
  2351. librtmps_protocol_deps="librtmp"
  2352. librtmpt_protocol_deps="librtmp"
  2353. librtmpte_protocol_deps="librtmp"
  2354. libsmbclient_protocol_deps="libsmbclient gplv3"
  2355. libssh_protocol_deps="libssh"
  2356. mmsh_protocol_select="http_protocol"
  2357. mmst_protocol_select="network"
  2358. rtmp_protocol_deps="!librtmp_protocol"
  2359. rtmp_protocol_select="tcp_protocol"
  2360. rtmpe_protocol_select="ffrtmpcrypt_protocol"
  2361. rtmps_protocol_deps="!librtmp_protocol"
  2362. rtmps_protocol_select="tls_protocol"
  2363. rtmpt_protocol_select="ffrtmphttp_protocol"
  2364. rtmpte_protocol_select="ffrtmpcrypt_protocol ffrtmphttp_protocol"
  2365. rtmpts_protocol_select="ffrtmphttp_protocol https_protocol"
  2366. rtp_protocol_select="udp_protocol"
  2367. sctp_protocol_deps="struct_sctp_event_subscribe"
  2368. sctp_protocol_select="network"
  2369. srtp_protocol_select="rtp_protocol"
  2370. tcp_protocol_select="network"
  2371. tls_protocol_deps_any="openssl gnutls"
  2372. tls_protocol_select="tcp_protocol"
  2373. udp_protocol_select="network"
  2374. udplite_protocol_select="network"
  2375. unix_protocol_deps="sys_un_h"
  2376. unix_protocol_select="network"
  2377. # filters
  2378. amovie_filter_deps="avcodec avformat"
  2379. aresample_filter_deps="swresample"
  2380. ass_filter_deps="libass"
  2381. asyncts_filter_deps="avresample"
  2382. atempo_filter_deps="avcodec"
  2383. atempo_filter_select="rdft"
  2384. azmq_filter_deps="libzmq"
  2385. blackframe_filter_deps="gpl"
  2386. boxblur_filter_deps="gpl"
  2387. bs2b_filter_deps="libbs2b"
  2388. colormatrix_filter_deps="gpl"
  2389. cropdetect_filter_deps="gpl"
  2390. delogo_filter_deps="gpl"
  2391. deshake_filter_select="pixelutils"
  2392. drawtext_filter_deps="libfreetype"
  2393. ebur128_filter_deps="gpl"
  2394. eq_filter_deps="gpl"
  2395. fftfilt_filter_deps="avcodec"
  2396. fftfilt_filter_select="rdft"
  2397. flite_filter_deps="libflite"
  2398. frei0r_filter_deps="frei0r dlopen"
  2399. frei0r_src_filter_deps="frei0r dlopen"
  2400. fspp_filter_deps="gpl"
  2401. geq_filter_deps="gpl"
  2402. histeq_filter_deps="gpl"
  2403. hqdn3d_filter_deps="gpl"
  2404. interlace_filter_deps="gpl"
  2405. kerndeint_filter_deps="gpl"
  2406. ladspa_filter_deps="ladspa dlopen"
  2407. mcdeint_filter_deps="avcodec gpl"
  2408. movie_filter_deps="avcodec avformat"
  2409. mpdecimate_filter_deps="gpl"
  2410. mpdecimate_filter_select="pixelutils"
  2411. mptestsrc_filter_deps="gpl"
  2412. negate_filter_deps="lut_filter"
  2413. perspective_filter_deps="gpl"
  2414. pp7_filter_deps="gpl"
  2415. ocv_filter_deps="libopencv"
  2416. owdenoise_filter_deps="gpl"
  2417. pan_filter_deps="swresample"
  2418. phase_filter_deps="gpl"
  2419. pp_filter_deps="gpl postproc"
  2420. pullup_filter_deps="gpl"
  2421. removelogo_filter_deps="avcodec avformat swscale"
  2422. repeatfields_filter_deps="gpl"
  2423. resample_filter_deps="avresample"
  2424. sab_filter_deps="gpl swscale"
  2425. scale_filter_deps="swscale"
  2426. select_filter_select="pixelutils"
  2427. smartblur_filter_deps="gpl swscale"
  2428. showspectrum_filter_deps="avcodec"
  2429. showspectrum_filter_select="rdft"
  2430. spp_filter_deps="gpl avcodec"
  2431. spp_filter_select="fft idctdsp fdctdsp me_cmp pixblockdsp"
  2432. stereo3d_filter_deps="gpl"
  2433. subtitles_filter_deps="avformat avcodec libass"
  2434. super2xsai_filter_deps="gpl"
  2435. tinterlace_filter_deps="gpl"
  2436. vidstabdetect_filter_deps="libvidstab"
  2437. vidstabtransform_filter_deps="libvidstab"
  2438. pixfmts_super2xsai_test_deps="super2xsai_filter"
  2439. tinterlace_merge_test_deps="tinterlace_filter"
  2440. tinterlace_pad_test_deps="tinterlace_filter"
  2441. uspp_filter_deps="gpl avcodec"
  2442. zmq_filter_deps="libzmq"
  2443. zoompan_filter_deps="swscale"
  2444. # examples
  2445. avio_reading="avformat avcodec avutil"
  2446. avcodec_example_deps="avcodec avutil"
  2447. decoding_encoding_example_deps="avcodec avformat avutil"
  2448. demuxing_decoding_example_deps="avcodec avformat avutil"
  2449. extract_mvs_example_deps="avcodec avformat avutil"
  2450. filter_audio_example_deps="avfilter avutil"
  2451. filtering_audio_example_deps="avfilter avcodec avformat avutil"
  2452. filtering_video_example_deps="avfilter avcodec avformat avutil"
  2453. metadata_example_deps="avformat avutil"
  2454. muxing_example_deps="avcodec avformat avutil swscale"
  2455. qsvdec_example_deps="avcodec avutil libmfx h264_qsv_decoder vaapi_x11"
  2456. remuxing_example_deps="avcodec avformat avutil"
  2457. resampling_audio_example_deps="avutil swresample"
  2458. scaling_video_example_deps="avutil swscale"
  2459. transcode_aac_example_deps="avcodec avformat swresample"
  2460. transcoding_example_deps="avfilter avcodec avformat avutil"
  2461. # libraries, in linking order
  2462. avcodec_deps="avutil"
  2463. avdevice_deps="avformat avcodec avutil"
  2464. avfilter_deps="avutil"
  2465. avformat_deps="avcodec avutil"
  2466. avresample_deps="avutil"
  2467. postproc_deps="avutil gpl"
  2468. swresample_deps="avutil"
  2469. swscale_deps="avutil"
  2470. # programs
  2471. ffmpeg_deps="avcodec avfilter avformat swresample"
  2472. ffmpeg_select="aformat_filter anull_filter atrim_filter format_filter
  2473. null_filter
  2474. setpts_filter trim_filter"
  2475. ffplay_deps="avcodec avformat swscale swresample sdl"
  2476. ffplay_libs='$sdl_libs'
  2477. ffplay_select="rdft crop_filter transpose_filter hflip_filter vflip_filter rotate_filter"
  2478. ffprobe_deps="avcodec avformat"
  2479. ffserver_deps="avformat fork sarestart"
  2480. ffserver_select="ffm_muxer rtp_protocol rtsp_demuxer"
  2481. # documentation
  2482. podpages_deps="perl"
  2483. manpages_deps="perl pod2man"
  2484. htmlpages_deps="perl"
  2485. htmlpages_deps_any="makeinfo_html texi2html"
  2486. txtpages_deps="perl makeinfo"
  2487. doc_deps_any="manpages htmlpages podpages txtpages"
  2488. # default parameters
  2489. logfile="config.log"
  2490. # installation paths
  2491. prefix_default="/usr/local"
  2492. bindir_default='${prefix}/bin'
  2493. datadir_default='${prefix}/share/ffmpeg'
  2494. docdir_default='${prefix}/share/doc/ffmpeg'
  2495. incdir_default='${prefix}/include'
  2496. libdir_default='${prefix}/lib'
  2497. mandir_default='${prefix}/share/man'
  2498. # toolchain
  2499. ar_default="ar"
  2500. cc_default="gcc"
  2501. cxx_default="g++"
  2502. host_cc_default="gcc"
  2503. cp_f="cp -f"
  2504. doxygen_default="doxygen"
  2505. install="install"
  2506. ln_s="ln -s -f"
  2507. nm_default="nm -g"
  2508. objformat="elf"
  2509. pkg_config_default=pkg-config
  2510. if ranlib 2>&1 | grep -q "\-D "; then
  2511. ranlib_default="ranlib -D"
  2512. else
  2513. ranlib_default="ranlib"
  2514. fi
  2515. strip_default="strip"
  2516. yasmexe_default="yasm"
  2517. windres_default="windres"
  2518. # OS
  2519. target_os_default=$(tolower $(uname -s))
  2520. host_os=$target_os_default
  2521. # machine
  2522. if test "$target_os_default" = aix; then
  2523. arch_default=$(uname -p)
  2524. strip_default="strip -X32_64"
  2525. else
  2526. arch_default=$(uname -m)
  2527. fi
  2528. cpu="generic"
  2529. intrinsics="none"
  2530. # configurable options
  2531. enable $PROGRAM_LIST
  2532. enable $DOCUMENT_LIST
  2533. enable $EXAMPLE_LIST
  2534. enable $(filter_out avresample $LIBRARY_LIST)
  2535. enable stripping
  2536. enable asm
  2537. enable debug
  2538. enable doc
  2539. enable faan faandct faanidct
  2540. enable optimizations
  2541. enable runtime_cpudetect
  2542. enable safe_bitstream_reader
  2543. enable static
  2544. enable swscale_alpha
  2545. sws_max_filter_size_default=256
  2546. set_default sws_max_filter_size
  2547. # Enable hwaccels by default.
  2548. enable dxva2 vaapi vda vdpau xvmc
  2549. enable xlib
  2550. # build settings
  2551. SHFLAGS='-shared -Wl,-soname,$$(@F)'
  2552. LIBPREF="lib"
  2553. LIBSUF=".a"
  2554. FULLNAME='$(NAME)$(BUILDSUF)'
  2555. LIBNAME='$(LIBPREF)$(FULLNAME)$(LIBSUF)'
  2556. SLIBPREF="lib"
  2557. SLIBSUF=".so"
  2558. SLIBNAME='$(SLIBPREF)$(FULLNAME)$(SLIBSUF)'
  2559. SLIBNAME_WITH_VERSION='$(SLIBNAME).$(LIBVERSION)'
  2560. SLIBNAME_WITH_MAJOR='$(SLIBNAME).$(LIBMAJOR)'
  2561. LIB_INSTALL_EXTRA_CMD='$$(RANLIB) "$(LIBDIR)/$(LIBNAME)"'
  2562. SLIB_INSTALL_NAME='$(SLIBNAME_WITH_VERSION)'
  2563. SLIB_INSTALL_LINKS='$(SLIBNAME_WITH_MAJOR) $(SLIBNAME)'
  2564. asflags_filter=echo
  2565. cflags_filter=echo
  2566. ldflags_filter=echo
  2567. AS_C='-c'
  2568. AS_O='-o $@'
  2569. CC_C='-c'
  2570. CC_E='-E -o $@'
  2571. CC_O='-o $@'
  2572. CXX_C='-c'
  2573. CXX_O='-o $@'
  2574. LD_O='-o $@'
  2575. LD_LIB='-l%'
  2576. LD_PATH='-L'
  2577. HOSTCC_C='-c'
  2578. HOSTCC_E='-E -o $@'
  2579. HOSTCC_O='-o $@'
  2580. HOSTLD_O='-o $@'
  2581. host_libs='-lm'
  2582. host_cflags_filter=echo
  2583. host_ldflags_filter=echo
  2584. target_path='$(CURDIR)'
  2585. # since the object filename is not given with the -MM flag, the compiler
  2586. # is only able to print the basename, and we must add the path ourselves
  2587. DEPCMD='$(DEP$(1)) $(DEP$(1)FLAGS) $($(1)DEP_FLAGS) $< | sed -e "/^\#.*/d" -e "s,^[[:space:]]*$(*F)\\.o,$(@D)/$(*F).o," > $(@:.o=.d)'
  2588. DEPFLAGS='-MM'
  2589. # find source path
  2590. if test -f configure; then
  2591. source_path=.
  2592. else
  2593. source_path=$(cd $(dirname "$0"); pwd)
  2594. echo "$source_path" | grep -q '[[:blank:]]' &&
  2595. die "Out of tree builds are impossible with whitespace in source path."
  2596. test -e "$source_path/config.h" &&
  2597. die "Out of tree builds are impossible with config.h in source dir."
  2598. fi
  2599. for v in "$@"; do
  2600. r=${v#*=}
  2601. l=${v%"$r"}
  2602. r=$(sh_quote "$r")
  2603. FFMPEG_CONFIGURATION="${FFMPEG_CONFIGURATION# } ${l}${r}"
  2604. done
  2605. find_things(){
  2606. thing=$1
  2607. pattern=$2
  2608. file=$source_path/$3
  2609. sed -n "s/^[^#]*$pattern.*([^,]*, *\([^,]*\)\(,.*\)*).*/\1_$thing/p" "$file"
  2610. }
  2611. ENCODER_LIST=$(find_things encoder ENC libavcodec/allcodecs.c)
  2612. DECODER_LIST=$(find_things decoder DEC libavcodec/allcodecs.c)
  2613. HWACCEL_LIST=$(find_things hwaccel HWACCEL libavcodec/allcodecs.c)
  2614. PARSER_LIST=$(find_things parser PARSER libavcodec/allcodecs.c)
  2615. BSF_LIST=$(find_things bsf BSF libavcodec/allcodecs.c)
  2616. MUXER_LIST=$(find_things muxer _MUX libavformat/allformats.c)
  2617. DEMUXER_LIST=$(find_things demuxer DEMUX libavformat/allformats.c)
  2618. OUTDEV_LIST=$(find_things outdev OUTDEV libavdevice/alldevices.c)
  2619. INDEV_LIST=$(find_things indev _IN libavdevice/alldevices.c)
  2620. PROTOCOL_LIST=$(find_things protocol PROTOCOL libavformat/allformats.c)
  2621. FILTER_LIST=$(find_things filter FILTER libavfilter/allfilters.c)
  2622. ALL_COMPONENTS="
  2623. $BSF_LIST
  2624. $DECODER_LIST
  2625. $DEMUXER_LIST
  2626. $ENCODER_LIST
  2627. $FILTER_LIST
  2628. $HWACCEL_LIST
  2629. $INDEV_LIST
  2630. $MUXER_LIST
  2631. $OUTDEV_LIST
  2632. $PARSER_LIST
  2633. $PROTOCOL_LIST
  2634. "
  2635. for n in $COMPONENT_LIST; do
  2636. v=$(toupper ${n%s})_LIST
  2637. eval enable \$$v
  2638. eval ${n}_if_any="\$$v"
  2639. done
  2640. enable $ARCH_EXT_LIST
  2641. die_unknown(){
  2642. echo "Unknown option \"$1\"."
  2643. echo "See $0 --help for available options."
  2644. exit 1
  2645. }
  2646. print_3_columns() {
  2647. cat | tr ' ' '\n' | sort | pr -r -3 -t
  2648. }
  2649. show_list() {
  2650. suffix=_$1
  2651. shift
  2652. echo $* | sed s/$suffix//g | print_3_columns
  2653. exit 0
  2654. }
  2655. rand_list(){
  2656. IFS=', '
  2657. set -- $*
  2658. unset IFS
  2659. for thing; do
  2660. comp=${thing%:*}
  2661. prob=${thing#$comp}
  2662. prob=${prob#:}
  2663. is_in ${comp} $COMPONENT_LIST && eval comp=\$$(toupper ${comp%s})_LIST
  2664. echo "prob ${prob:-0.5}"
  2665. printf '%s\n' $comp
  2666. done
  2667. }
  2668. do_random(){
  2669. action=$1
  2670. shift
  2671. random_seed=$(awk "BEGIN { srand($random_seed); print srand() }")
  2672. $action $(rand_list "$@" | awk "BEGIN { srand($random_seed) } \$1 == \"prob\" { prob = \$2; next } rand() < prob { print }")
  2673. }
  2674. for opt do
  2675. optval="${opt#*=}"
  2676. case "$opt" in
  2677. --extra-ldflags=*)
  2678. add_ldflags $optval
  2679. ;;
  2680. --extra-ldexeflags=*)
  2681. add_ldexeflags $optval
  2682. ;;
  2683. --extra-libs=*)
  2684. add_extralibs $optval
  2685. ;;
  2686. --disable-devices)
  2687. disable $INDEV_LIST $OUTDEV_LIST
  2688. ;;
  2689. --enable-debug=*)
  2690. debuglevel="$optval"
  2691. ;;
  2692. --disable-programs)
  2693. disable $PROGRAM_LIST
  2694. ;;
  2695. --disable-everything)
  2696. map 'eval unset \${$(toupper ${v%s})_LIST}' $COMPONENT_LIST
  2697. ;;
  2698. --disable-all)
  2699. map 'eval unset \${$(toupper ${v%s})_LIST}' $COMPONENT_LIST
  2700. disable $LIBRARY_LIST $PROGRAM_LIST doc
  2701. ;;
  2702. --enable-random|--disable-random)
  2703. action=${opt%%-random}
  2704. do_random ${action#--} $COMPONENT_LIST
  2705. ;;
  2706. --enable-random=*|--disable-random=*)
  2707. action=${opt%%-random=*}
  2708. do_random ${action#--} $optval
  2709. ;;
  2710. --enable-*=*|--disable-*=*)
  2711. eval $(echo "${opt%%=*}" | sed 's/--/action=/;s/-/ thing=/')
  2712. is_in "${thing}s" $COMPONENT_LIST || die_unknown "$opt"
  2713. eval list=\$$(toupper $thing)_LIST
  2714. name=$(echo "${optval}" | sed "s/,/_${thing}|/g")_${thing}
  2715. list=$(filter "$name" $list)
  2716. [ "$list" = "" ] && warn "Option $opt did not match anything"
  2717. $action $list
  2718. ;;
  2719. --enable-?*|--disable-?*)
  2720. eval $(echo "$opt" | sed 's/--/action=/;s/-/ option=/;s/-/_/g')
  2721. if is_in $option $COMPONENT_LIST; then
  2722. test $action = disable && action=unset
  2723. eval $action \$$(toupper ${option%s})_LIST
  2724. elif is_in $option $CMDLINE_SELECT; then
  2725. $action $option
  2726. else
  2727. die_unknown $opt
  2728. fi
  2729. ;;
  2730. --list-*)
  2731. NAME="${opt#--list-}"
  2732. is_in $NAME $COMPONENT_LIST || die_unknown $opt
  2733. NAME=${NAME%s}
  2734. eval show_list $NAME \$$(toupper $NAME)_LIST
  2735. ;;
  2736. --help|-h) show_help
  2737. ;;
  2738. --fatal-warnings) enable fatal_warnings
  2739. ;;
  2740. *)
  2741. optname="${opt%%=*}"
  2742. optname="${optname#--}"
  2743. optname=$(echo "$optname" | sed 's/-/_/g')
  2744. if is_in $optname $CMDLINE_SET; then
  2745. eval $optname='$optval'
  2746. elif is_in $optname $CMDLINE_APPEND; then
  2747. append $optname "$optval"
  2748. else
  2749. die_unknown $opt
  2750. fi
  2751. ;;
  2752. esac
  2753. done
  2754. disabled logging && logfile=/dev/null
  2755. echo "# $0 $FFMPEG_CONFIGURATION" > $logfile
  2756. set >> $logfile
  2757. test -n "$valgrind" && toolchain="valgrind-memcheck"
  2758. case "$toolchain" in
  2759. clang-asan)
  2760. cc_default="clang"
  2761. add_cflags -fsanitize=address
  2762. add_ldflags -fsanitize=address
  2763. ;;
  2764. clang-tsan)
  2765. cc_default="clang"
  2766. add_cflags -fsanitize=thread -pie
  2767. add_ldflags -fsanitize=thread -pie
  2768. ;;
  2769. clang-usan)
  2770. cc_default="clang"
  2771. add_cflags -fsanitize=undefined
  2772. add_ldflags -fsanitize=undefined
  2773. ;;
  2774. gcc-asan)
  2775. cc_default="gcc"
  2776. add_cflags -fsanitize=address
  2777. add_ldflags -fsanitize=address
  2778. ;;
  2779. gcc-tsan)
  2780. cc_default="gcc"
  2781. add_cflags -fsanitize=thread -pie -fPIC
  2782. add_ldflags -fsanitize=thread -pie -fPIC
  2783. ;;
  2784. gcc-usan)
  2785. cc_default="gcc"
  2786. add_cflags -fsanitize=undefined
  2787. add_ldflags -fsanitize=undefined
  2788. ;;
  2789. valgrind-massif)
  2790. target_exec_default=${valgrind:-"valgrind"}
  2791. 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"
  2792. ;;
  2793. valgrind-memcheck)
  2794. target_exec_default=${valgrind:-"valgrind"}
  2795. 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"
  2796. ;;
  2797. msvc)
  2798. # Check whether the current MSVC version needs the C99 converter.
  2799. # From MSVC 2013 (compiler major version 18) onwards, it does actually
  2800. # support enough of C99 to build ffmpeg. Default to the new
  2801. # behaviour if the regexp was unable to match anything, since this
  2802. # successfully parses the version number of existing supported
  2803. # versions that require the converter (MSVC 2010 and 2012).
  2804. cl_major_ver=$(cl 2>&1 | sed -n 's/.*Version \([[:digit:]]\{1,\}\)\..*/\1/p')
  2805. if [ -z "$cl_major_ver" ] || [ $cl_major_ver -ge 18 ]; then
  2806. cc_default="cl"
  2807. else
  2808. cc_default="c99wrap cl"
  2809. fi
  2810. ld_default="link"
  2811. nm_default="dumpbin -symbols"
  2812. ar_default="lib"
  2813. target_os_default="win32"
  2814. # Use a relative path for TMPDIR. This makes sure all the
  2815. # ffconf temp files are written with a relative path, avoiding
  2816. # issues with msys/win32 path conversion for MSVC parameters
  2817. # such as -Fo<file> or -out:<file>.
  2818. TMPDIR=.
  2819. ;;
  2820. icl)
  2821. cc_default="icl"
  2822. ld_default="xilink"
  2823. nm_default="dumpbin -symbols"
  2824. ar_default="xilib"
  2825. target_os_default="win32"
  2826. TMPDIR=.
  2827. ;;
  2828. gcov)
  2829. add_cflags -fprofile-arcs -ftest-coverage
  2830. add_ldflags -fprofile-arcs -ftest-coverage
  2831. ;;
  2832. hardened)
  2833. add_cppflags -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2
  2834. add_cflags -fno-strict-overflow -fstack-protector-all
  2835. add_ldflags -Wl,-z,relro -Wl,-z,now
  2836. ;;
  2837. ?*)
  2838. die "Unknown toolchain $toolchain"
  2839. ;;
  2840. esac
  2841. test -n "$cross_prefix" && enable cross_compile
  2842. if enabled cross_compile; then
  2843. test -n "$arch" && test -n "$target_os" ||
  2844. die "Must specify target arch and OS when cross-compiling"
  2845. fi
  2846. ar_default="${cross_prefix}${ar_default}"
  2847. cc_default="${cross_prefix}${cc_default}"
  2848. cxx_default="${cross_prefix}${cxx_default}"
  2849. nm_default="${cross_prefix}${nm_default}"
  2850. pkg_config_default="${cross_prefix}${pkg_config_default}"
  2851. ranlib_default="${cross_prefix}${ranlib_default}"
  2852. strip_default="${cross_prefix}${strip_default}"
  2853. windres_default="${cross_prefix}${windres_default}"
  2854. sysinclude_default="${sysroot}/usr/include"
  2855. set_default arch cc cxx doxygen pkg_config ranlib strip sysinclude \
  2856. target_exec target_os yasmexe
  2857. enabled cross_compile || host_cc_default=$cc
  2858. set_default host_cc
  2859. pkg_config_fail_message=""
  2860. if ! $pkg_config --version >/dev/null 2>&1; then
  2861. warn "$pkg_config not found, library detection may fail."
  2862. pkg_config=false
  2863. elif is_in -static $cc $LDFLAGS && ! is_in --static $pkg_config $pkg_config_flags; then
  2864. pkg_config_fail_message="
  2865. Note: When building a static binary, add --pkg-config-flags=\"--static\"."
  2866. fi
  2867. if test $doxygen != $doxygen_default && \
  2868. ! $doxygen --version >/dev/null 2>&1; then
  2869. warn "Specified doxygen \"$doxygen\" not found, API documentation will fail to build."
  2870. fi
  2871. exesuf() {
  2872. case $1 in
  2873. mingw32*|win32|win64|cygwin*|*-dos|freedos|opendos|os/2*|symbian) echo .exe ;;
  2874. esac
  2875. }
  2876. EXESUF=$(exesuf $target_os)
  2877. HOSTEXESUF=$(exesuf $host_os)
  2878. # set temporary file name
  2879. : ${TMPDIR:=$TEMPDIR}
  2880. : ${TMPDIR:=$TMP}
  2881. : ${TMPDIR:=/tmp}
  2882. if [ -n "$tempprefix" ] ; then
  2883. mktemp(){
  2884. echo $tempprefix.${HOSTNAME}.${UID}
  2885. }
  2886. elif ! check_cmd mktemp -u XXXXXX; then
  2887. # simple replacement for missing mktemp
  2888. # NOT SAFE FOR GENERAL USE
  2889. mktemp(){
  2890. echo "${2%%XXX*}.${HOSTNAME}.${UID}.$$"
  2891. }
  2892. fi
  2893. tmpfile(){
  2894. tmp=$(mktemp -u "${TMPDIR}/ffconf.XXXXXXXX")$2 &&
  2895. (set -C; exec > $tmp) 2>/dev/null ||
  2896. die "Unable to create temporary file in $TMPDIR."
  2897. append TMPFILES $tmp
  2898. eval $1=$tmp
  2899. }
  2900. trap 'rm -f -- $TMPFILES' EXIT
  2901. tmpfile TMPASM .asm
  2902. tmpfile TMPC .c
  2903. tmpfile TMPCPP .cpp
  2904. tmpfile TMPE $EXESUF
  2905. tmpfile TMPH .h
  2906. tmpfile TMPM .m
  2907. tmpfile TMPO .o
  2908. tmpfile TMPS .S
  2909. tmpfile TMPSH .sh
  2910. tmpfile TMPV .ver
  2911. unset -f mktemp
  2912. chmod +x $TMPE
  2913. # make sure we can execute files in $TMPDIR
  2914. cat > $TMPSH 2>> $logfile <<EOF
  2915. #! /bin/sh
  2916. EOF
  2917. chmod +x $TMPSH >> $logfile 2>&1
  2918. if ! $TMPSH >> $logfile 2>&1; then
  2919. cat <<EOF
  2920. Unable to create and execute files in $TMPDIR. Set the TMPDIR environment
  2921. variable to another directory and make sure that it is not mounted noexec.
  2922. EOF
  2923. die "Sanity test failed."
  2924. fi
  2925. armasm_flags(){
  2926. for flag; do
  2927. case $flag in
  2928. # Filter out MSVC cl.exe options from cflags that shouldn't
  2929. # be passed to gas-preprocessor
  2930. -M[TD]*) ;;
  2931. *) echo $flag ;;
  2932. esac
  2933. done
  2934. }
  2935. ccc_flags(){
  2936. for flag; do
  2937. case $flag in
  2938. -std=c99) echo -c99 ;;
  2939. -mcpu=*) echo -arch ${flag#*=} ;;
  2940. -mieee) echo -ieee ;;
  2941. -O*|-fast) echo $flag ;;
  2942. -fno-math-errno) echo -assume nomath_errno ;;
  2943. -g) echo -g3 ;;
  2944. -Wall) echo -msg_enable level2 ;;
  2945. -Wno-pointer-sign) echo -msg_disable ptrmismatch1 ;;
  2946. -Wl,*) echo $flag ;;
  2947. -f*|-W*) ;;
  2948. *) echo $flag ;;
  2949. esac
  2950. done
  2951. }
  2952. cparser_flags(){
  2953. for flag; do
  2954. case $flag in
  2955. -Wno-switch) echo -Wno-switch-enum ;;
  2956. -Wno-format-zero-length) ;;
  2957. -Wdisabled-optimization) ;;
  2958. -Wno-pointer-sign) echo -Wno-other ;;
  2959. *) echo $flag ;;
  2960. esac
  2961. done
  2962. }
  2963. msvc_common_flags(){
  2964. for flag; do
  2965. case $flag in
  2966. # In addition to specifying certain flags under the compiler
  2967. # specific filters, they must be specified here as well or else the
  2968. # generic catch all at the bottom will print the original flag.
  2969. -Wall) ;;
  2970. -std=c99) ;;
  2971. # Common flags
  2972. -fomit-frame-pointer) ;;
  2973. -g) echo -Z7 ;;
  2974. -fno-math-errno) ;;
  2975. -fno-common) ;;
  2976. -fno-signed-zeros) ;;
  2977. -fPIC) ;;
  2978. -mthumb) ;;
  2979. -march=*) ;;
  2980. -lz) echo zlib.lib ;;
  2981. -lavifil32) echo vfw32.lib ;;
  2982. -lavicap32) echo vfw32.lib user32.lib ;;
  2983. -l*) echo ${flag#-l}.lib ;;
  2984. -L*) echo -libpath:${flag#-L} ;;
  2985. *) echo $flag ;;
  2986. esac
  2987. done
  2988. }
  2989. msvc_flags(){
  2990. msvc_common_flags "$@"
  2991. for flag; do
  2992. case $flag in
  2993. -Wall) echo -W4 -wd4244 -wd4127 -wd4018 -wd4389 \
  2994. -wd4146 -wd4057 -wd4204 -wd4706 -wd4305 \
  2995. -wd4152 -wd4324 -we4013 -wd4100 -wd4214 \
  2996. -wd4307 \
  2997. -wd4273 -wd4554 -wd4701 ;;
  2998. esac
  2999. done
  3000. }
  3001. icl_flags(){
  3002. msvc_common_flags "$@"
  3003. for flag; do
  3004. case $flag in
  3005. # Despite what Intel's documentation says -Wall, which is supported
  3006. # on Windows, does enable remarks so disable them here.
  3007. -Wall) echo $flag -Qdiag-disable:remark ;;
  3008. -std=c99) echo -Qstd=c99 ;;
  3009. -flto) echo -ipo ;;
  3010. esac
  3011. done
  3012. }
  3013. icc_flags(){
  3014. for flag; do
  3015. case $flag in
  3016. -flto) echo -ipo ;;
  3017. *) echo $flag ;;
  3018. esac
  3019. done
  3020. }
  3021. pgi_flags(){
  3022. for flag; do
  3023. case $flag in
  3024. -flto) echo -Mipa=fast,libopt,libinline,vestigial ;;
  3025. -fomit-frame-pointer) echo -Mnoframe ;;
  3026. -g) echo -gopt ;;
  3027. *) echo $flag ;;
  3028. esac
  3029. done
  3030. }
  3031. suncc_flags(){
  3032. for flag; do
  3033. case $flag in
  3034. -march=*|-mcpu=*)
  3035. case "${flag#*=}" in
  3036. native) echo -xtarget=native ;;
  3037. v9|niagara) echo -xarch=sparc ;;
  3038. ultrasparc) echo -xarch=sparcvis ;;
  3039. ultrasparc3|niagara2) echo -xarch=sparcvis2 ;;
  3040. i586|pentium) echo -xchip=pentium ;;
  3041. i686|pentiumpro|pentium2) echo -xtarget=pentium_pro ;;
  3042. pentium3*|c3-2) echo -xtarget=pentium3 ;;
  3043. pentium-m) echo -xarch=sse2 -xchip=pentium3 ;;
  3044. pentium4*) echo -xtarget=pentium4 ;;
  3045. prescott|nocona) echo -xarch=sse3 -xchip=pentium4 ;;
  3046. *-sse3) echo -xarch=sse3 ;;
  3047. core2) echo -xarch=ssse3 -xchip=core2 ;;
  3048. bonnell) echo -xarch=ssse3 ;;
  3049. corei7|nehalem) echo -xtarget=nehalem ;;
  3050. westmere) echo -xtarget=westmere ;;
  3051. silvermont) echo -xarch=sse4_2 ;;
  3052. corei7-avx|sandybridge) echo -xtarget=sandybridge ;;
  3053. core-avx*|ivybridge|haswell|broadwell)
  3054. echo -xarch=avx ;;
  3055. amdfam10|barcelona) echo -xtarget=barcelona ;;
  3056. btver1) echo -xarch=amdsse4a ;;
  3057. btver2|bdver*) echo -xarch=avx ;;
  3058. athlon-4|athlon-[mx]p) echo -xarch=ssea ;;
  3059. k8|opteron|athlon64|athlon-fx)
  3060. echo -xarch=sse2a ;;
  3061. athlon*) echo -xarch=pentium_proa ;;
  3062. esac
  3063. ;;
  3064. -std=c99) echo -xc99 ;;
  3065. -fomit-frame-pointer) echo -xregs=frameptr ;;
  3066. -fPIC) echo -KPIC -xcode=pic32 ;;
  3067. -W*,*) echo $flag ;;
  3068. -f*-*|-W*|-mimpure-text) ;;
  3069. -shared) echo -G ;;
  3070. *) echo $flag ;;
  3071. esac
  3072. done
  3073. }
  3074. tms470_flags(){
  3075. for flag; do
  3076. case $flag in
  3077. -march=*|-mcpu=*)
  3078. case "${flag#*=}" in
  3079. armv7-a|cortex-a*) echo -mv=7a8 ;;
  3080. armv7-r|cortex-r*) echo -mv=7r4 ;;
  3081. armv7-m|cortex-m*) echo -mv=7m3 ;;
  3082. armv6*|arm11*) echo -mv=6 ;;
  3083. armv5*e|arm[79]*e*|arm9[24]6*|arm96*|arm102[26])
  3084. echo -mv=5e ;;
  3085. armv4*|arm7*|arm9[24]*) echo -mv=4 ;;
  3086. esac
  3087. ;;
  3088. -mfpu=neon) echo --float_support=vfpv3 --neon ;;
  3089. -mfpu=vfp) echo --float_support=vfpv2 ;;
  3090. -mfpu=vfpv3) echo --float_support=vfpv3 ;;
  3091. -mfpu=vfpv3-d16) echo --float_support=vfpv3d16 ;;
  3092. -msoft-float) echo --float_support=vfplib ;;
  3093. -O[0-3]|-mf=*) echo $flag ;;
  3094. -g) echo -g -mn ;;
  3095. -pds=*) echo $flag ;;
  3096. -D*|-I*) echo $flag ;;
  3097. --gcc|--abi=*) echo $flag ;;
  3098. -me) echo $flag ;;
  3099. esac
  3100. done
  3101. }
  3102. probe_cc(){
  3103. pfx=$1
  3104. _cc=$2
  3105. unset _type _ident _cc_c _cc_e _cc_o _flags _cflags
  3106. unset _ld_o _ldflags _ld_lib _ld_path
  3107. unset _depflags _DEPCMD _DEPFLAGS
  3108. _flags_filter=echo
  3109. if $_cc --version 2>&1 | grep -q '^GNU assembler'; then
  3110. true # no-op to avoid reading stdin in following checks
  3111. elif $_cc -v 2>&1 | grep -q '^gcc.*LLVM'; then
  3112. _type=llvm_gcc
  3113. gcc_extra_ver=$(expr "$($_cc --version | head -n1)" : '.*\((.*)\)')
  3114. _ident="llvm-gcc $($_cc -dumpversion) $gcc_extra_ver"
  3115. _depflags='-MMD -MF $(@:.o=.d) -MT $@'
  3116. _cflags_speed='-O3'
  3117. _cflags_size='-Os'
  3118. elif $_cc -v 2>&1 | grep -qi ^gcc; then
  3119. _type=gcc
  3120. gcc_version=$($_cc --version | head -n1)
  3121. gcc_basever=$($_cc -dumpversion)
  3122. gcc_pkg_ver=$(expr "$gcc_version" : '[^ ]* \(([^)]*)\)')
  3123. gcc_ext_ver=$(expr "$gcc_version" : ".*$gcc_pkg_ver $gcc_basever \\(.*\\)")
  3124. _ident=$(cleanws "gcc $gcc_basever $gcc_pkg_ver $gcc_ext_ver")
  3125. if ! $_cc -dumpversion | grep -q '^2\.'; then
  3126. _depflags='-MMD -MF $(@:.o=.d) -MT $@'
  3127. fi
  3128. _cflags_speed='-O3'
  3129. _cflags_size='-Os'
  3130. elif $_cc --version 2>/dev/null | grep -q ^icc; then
  3131. _type=icc
  3132. _ident=$($_cc --version | head -n1)
  3133. _depflags='-MMD'
  3134. _cflags_speed='-O3'
  3135. _cflags_size='-Os'
  3136. _cflags_noopt='-O1'
  3137. _flags_filter=icc_flags
  3138. elif $_cc -v 2>&1 | grep -q xlc; then
  3139. _type=xlc
  3140. _ident=$($_cc -qversion 2>/dev/null | head -n1)
  3141. _cflags_speed='-O5'
  3142. _cflags_size='-O5 -qcompact'
  3143. elif $_cc -V 2>/dev/null | grep -q Compaq; then
  3144. _type=ccc
  3145. _ident=$($_cc -V | head -n1 | cut -d' ' -f1-3)
  3146. _DEPFLAGS='-M'
  3147. _cflags_speed='-fast'
  3148. _cflags_size='-O1'
  3149. _flags_filter=ccc_flags
  3150. elif $_cc --vsn 2>/dev/null | grep -Eq "ARM (C/C\+\+ )?Compiler"; then
  3151. test -d "$sysroot" || die "No valid sysroot specified."
  3152. _type=armcc
  3153. _ident=$($_cc --vsn | grep -i build | head -n1 | sed 's/.*: //')
  3154. armcc_conf="$PWD/armcc.conf"
  3155. $_cc --arm_linux_configure \
  3156. --arm_linux_config_file="$armcc_conf" \
  3157. --configure_sysroot="$sysroot" \
  3158. --configure_cpp_headers="$sysinclude" >>$logfile 2>&1 ||
  3159. die "Error creating armcc configuration file."
  3160. $_cc --vsn | grep -q RVCT && armcc_opt=rvct || armcc_opt=armcc
  3161. _flags="--arm_linux_config_file=$armcc_conf --translate_gcc"
  3162. as_default="${cross_prefix}gcc"
  3163. _depflags='-MMD'
  3164. _cflags_speed='-O3'
  3165. _cflags_size='-Os'
  3166. elif $_cc -version 2>/dev/null | grep -Eq 'TMS470|TI ARM'; then
  3167. _type=tms470
  3168. _ident=$($_cc -version | head -n1 | tr -s ' ')
  3169. _flags='--gcc --abi=eabi -me'
  3170. _cc_e='-ppl -fe=$@'
  3171. _cc_o='-fe=$@'
  3172. _depflags='-ppa -ppd=$(@:.o=.d)'
  3173. _cflags_speed='-O3 -mf=5'
  3174. _cflags_size='-O3 -mf=2'
  3175. _flags_filter=tms470_flags
  3176. elif $_cc -v 2>&1 | grep -q clang; then
  3177. _type=clang
  3178. _ident=$($_cc --version | head -n1)
  3179. _depflags='-MMD -MF $(@:.o=.d) -MT $@'
  3180. _cflags_speed='-O3'
  3181. _cflags_size='-Os'
  3182. elif $_cc -V 2>&1 | grep -q Sun; then
  3183. _type=suncc
  3184. _ident=$($_cc -V 2>&1 | head -n1 | cut -d' ' -f 2-)
  3185. _DEPCMD='$(DEP$(1)) $(DEP$(1)FLAGS) $($(1)DEP_FLAGS) $< | sed -e "1s,^.*: ,$@: ," -e "\$$!s,\$$, \\\," -e "1!s,^.*: , ," > $(@:.o=.d)'
  3186. _DEPFLAGS='-xM1 -xc99'
  3187. _ldflags='-std=c99'
  3188. _cflags_speed='-O5'
  3189. _cflags_size='-O5 -xspace'
  3190. _flags_filter=suncc_flags
  3191. elif $_cc -v 2>&1 | grep -q 'PathScale\|Path64'; then
  3192. _type=pathscale
  3193. _ident=$($_cc -v 2>&1 | head -n1 | tr -d :)
  3194. _depflags='-MMD -MF $(@:.o=.d) -MT $@'
  3195. _cflags_speed='-O2'
  3196. _cflags_size='-Os'
  3197. _flags_filter='filter_out -Wdisabled-optimization'
  3198. elif $_cc -v 2>&1 | grep -q Open64; then
  3199. _type=open64
  3200. _ident=$($_cc -v 2>&1 | head -n1 | tr -d :)
  3201. _depflags='-MMD -MF $(@:.o=.d) -MT $@'
  3202. _cflags_speed='-O2'
  3203. _cflags_size='-Os'
  3204. _flags_filter='filter_out -Wdisabled-optimization|-Wtype-limits|-fno-signed-zeros'
  3205. elif $_cc -V 2>&1 | grep -q Portland; then
  3206. _type=pgi
  3207. _ident="PGI $($_cc -V 2>&1 | awk '/^pgcc/ { print $2; exit }')"
  3208. opt_common='-alias=ansi -Mdse -Mlre -Mpre'
  3209. _cflags_speed="-O3 -Mautoinline -Munroll=c:4 $opt_common"
  3210. _cflags_size="-O2 -Munroll=c:1 $opt_common"
  3211. _cflags_noopt="-O"
  3212. _flags_filter=pgi_flags
  3213. elif $_cc 2>&1 | grep -q 'Microsoft.*ARM.*Assembler'; then
  3214. _type=armasm
  3215. _ident=$($_cc | head -n1)
  3216. # 4509: "This form of conditional instruction is deprecated"
  3217. _flags="-nologo -ignore 4509"
  3218. _flags_filter=armasm_flags
  3219. elif $_cc 2>&1 | grep -q Intel; then
  3220. _type=icl
  3221. _ident=$($cc 2>&1 | head -n1)
  3222. _depflags='-QMMD -QMF$(@:.o=.d) -QMT$@'
  3223. # Not only is O3 broken on 13.x+ but it is slower on all previous
  3224. # versions (tested) as well.
  3225. _cflags_speed="-O2"
  3226. _cflags_size="-O1 -Oi" # -O1 without -Oi miscompiles stuff
  3227. if $_cc 2>&1 | grep -q Linker; then
  3228. _ld_o='-out:$@'
  3229. else
  3230. _ld_o='-Fe$@'
  3231. fi
  3232. _cc_o='-Fo$@'
  3233. _cc_e='-P'
  3234. _flags_filter=icl_flags
  3235. _ld_lib='lib%.a'
  3236. _ld_path='-libpath:'
  3237. # -Qdiag-error to make icl error when seeing certain unknown arguments
  3238. _flags='-nologo -Qdiag-error:4044,10157'
  3239. # -Qvec- -Qsimd- to prevent miscompilation, -GS, fp:precise for consistency
  3240. # with MSVC which enables it by default.
  3241. _cflags='-D_USE_MATH_DEFINES -FIstdlib.h -Dstrtoll=_strtoi64 -Qms0 -Qvec- -Qsimd- -GS -fp:precise'
  3242. if [ $pfx = hostcc ]; then
  3243. append _cflags -Dsnprintf=_snprintf
  3244. fi
  3245. disable stripping
  3246. elif $_cc 2>&1 | grep -q Microsoft; then
  3247. _type=msvc
  3248. _ident=$($cc 2>&1 | head -n1)
  3249. _DEPCMD='$(DEP$(1)) $(DEP$(1)FLAGS) $($(1)DEP_FLAGS) $< 2>&1 | awk '\''/including/ { sub(/^.*file: */, ""); gsub(/\\/, "/"); if (!match($$0, / /)) print "$@:", $$0 }'\'' > $(@:.o=.d)'
  3250. _DEPFLAGS='$(CPPFLAGS) $(CFLAGS) -showIncludes -Zs'
  3251. _cflags_speed="-O2"
  3252. _cflags_size="-O1"
  3253. if $_cc 2>&1 | grep -q Linker; then
  3254. _ld_o='-out:$@'
  3255. else
  3256. _ld_o='-Fe$@'
  3257. fi
  3258. _cc_o='-Fo$@'
  3259. _cc_e='-P -Fi$@'
  3260. _flags_filter=msvc_flags
  3261. _ld_lib='lib%.a'
  3262. _ld_path='-libpath:'
  3263. _flags='-nologo'
  3264. _cflags='-D_USE_MATH_DEFINES -D_CRT_SECURE_NO_WARNINGS -Dinline=__inline -FIstdlib.h -Dstrtoll=_strtoi64'
  3265. if [ $pfx = hostcc ]; then
  3266. if [ -z "$cl_major_ver" ] || [ $cl_major_ver -le 18 ]; then
  3267. append _cflags -Dsnprintf=_snprintf
  3268. fi
  3269. fi
  3270. disable stripping
  3271. elif $_cc --version 2>/dev/null | grep -q ^cparser; then
  3272. _type=cparser
  3273. _ident=$($_cc --version | head -n1)
  3274. _depflags='-MMD'
  3275. _cflags_speed='-O4'
  3276. _cflags_size='-O2'
  3277. _flags_filter=cparser_flags
  3278. fi
  3279. eval ${pfx}_type=\$_type
  3280. eval ${pfx}_ident=\$_ident
  3281. }
  3282. set_ccvars(){
  3283. eval ${1}_C=\${_cc_c-\${${1}_C}}
  3284. eval ${1}_E=\${_cc_e-\${${1}_E}}
  3285. eval ${1}_O=\${_cc_o-\${${1}_O}}
  3286. if [ -n "$_depflags" ]; then
  3287. eval ${1}_DEPFLAGS=\$_depflags
  3288. else
  3289. eval ${1}DEP=\${_DEPCMD:-\$DEPCMD}
  3290. eval ${1}DEP_FLAGS=\${_DEPFLAGS:-\$DEPFLAGS}
  3291. eval DEP${1}FLAGS=\$_flags
  3292. fi
  3293. }
  3294. probe_cc cc "$cc"
  3295. cflags_filter=$_flags_filter
  3296. cflags_speed=$_cflags_speed
  3297. cflags_size=$_cflags_size
  3298. cflags_noopt=$_cflags_noopt
  3299. add_cflags $_flags $_cflags
  3300. cc_ldflags=$_ldflags
  3301. set_ccvars CC
  3302. probe_cc hostcc "$host_cc"
  3303. host_cflags_filter=$_flags_filter
  3304. add_host_cflags $_flags $_cflags
  3305. set_ccvars HOSTCC
  3306. test -n "$cc_type" && enable $cc_type ||
  3307. warn "Unknown C compiler $cc, unable to select optimal CFLAGS"
  3308. : ${as_default:=$cc}
  3309. : ${dep_cc_default:=$cc}
  3310. : ${ld_default:=$cc}
  3311. : ${host_ld_default:=$host_cc}
  3312. set_default ar as dep_cc ld host_ld windres
  3313. probe_cc as "$as"
  3314. asflags_filter=$_flags_filter
  3315. add_asflags $_flags $_cflags
  3316. set_ccvars AS
  3317. probe_cc ld "$ld"
  3318. ldflags_filter=$_flags_filter
  3319. add_ldflags $_flags $_ldflags
  3320. test "$cc_type" != "$ld_type" && add_ldflags $cc_ldflags
  3321. LD_O=${_ld_o-$LD_O}
  3322. LD_LIB=${_ld_lib-$LD_LIB}
  3323. LD_PATH=${_ld_path-$LD_PATH}
  3324. probe_cc hostld "$host_ld"
  3325. host_ldflags_filter=$_flags_filter
  3326. add_host_ldflags $_flags $_ldflags
  3327. HOSTLD_O=${_ld_o-$HOSTLD_O}
  3328. if [ -z "$CC_DEPFLAGS" ] && [ "$dep_cc" != "$cc" ]; then
  3329. probe_cc depcc "$dep_cc"
  3330. CCDEP=${_DEPCMD:-$DEPCMD}
  3331. CCDEP_FLAGS=${_DEPFLAGS:=$DEPFLAGS}
  3332. DEPCCFLAGS=$_flags
  3333. fi
  3334. if $ar 2>&1 | grep -q Microsoft; then
  3335. arflags="-nologo"
  3336. ar_o='-out:$@'
  3337. elif $ar 2>&1 | grep -q 'Texas Instruments'; then
  3338. arflags="rq"
  3339. ar_o='$@'
  3340. elif $ar 2>&1 | grep -q 'Usage: ar.*-X.*any'; then
  3341. arflags='-Xany -r -c'
  3342. ar_o='$@'
  3343. elif $ar 2>&1 | grep -q "\[D\] "; then
  3344. arflags="rcD"
  3345. ar_o='$@'
  3346. else
  3347. arflags="rc"
  3348. ar_o='$@'
  3349. fi
  3350. add_cflags $extra_cflags
  3351. add_cxxflags $extra_cxxflags
  3352. add_asflags $extra_cflags
  3353. if test -n "$sysroot"; then
  3354. case "$cc_type" in
  3355. gcc|llvm_gcc|clang)
  3356. add_cppflags --sysroot="$sysroot"
  3357. add_ldflags --sysroot="$sysroot"
  3358. # On Darwin --sysroot may be ignored, -isysroot always affects headers and linking
  3359. add_cppflags -isysroot "$sysroot"
  3360. add_ldflags -isysroot "$sysroot"
  3361. ;;
  3362. tms470)
  3363. add_cppflags -I"$sysinclude"
  3364. add_ldflags --sysroot="$sysroot"
  3365. ;;
  3366. esac
  3367. fi
  3368. if test "$cpu" = host; then
  3369. enabled cross_compile &&
  3370. die "--cpu=host makes no sense when cross-compiling."
  3371. case "$cc_type" in
  3372. gcc|llvm_gcc)
  3373. check_native(){
  3374. $cc $1=native -v -c -o $TMPO $TMPC >$TMPE 2>&1 || return
  3375. sed -n "/cc1.*$1=/{
  3376. s/.*$1=\\([^ ]*\\).*/\\1/
  3377. p
  3378. q
  3379. }" $TMPE
  3380. }
  3381. cpu=$(check_native -march || check_native -mcpu)
  3382. ;;
  3383. esac
  3384. test "${cpu:-host}" = host &&
  3385. die "--cpu=host not supported with compiler $cc"
  3386. fi
  3387. # Deal with common $arch aliases
  3388. case "$arch" in
  3389. aarch64|arm64)
  3390. arch="aarch64"
  3391. ;;
  3392. arm*|iPad*|iPhone*)
  3393. arch="arm"
  3394. ;;
  3395. mips*|IP*)
  3396. arch="mips"
  3397. ;;
  3398. parisc*|hppa*)
  3399. arch="parisc"
  3400. ;;
  3401. "Power Macintosh"|ppc*|powerpc*)
  3402. arch="ppc"
  3403. ;;
  3404. s390|s390x)
  3405. arch="s390"
  3406. ;;
  3407. sh4|sh)
  3408. arch="sh4"
  3409. ;;
  3410. sun4u|sparc*)
  3411. arch="sparc"
  3412. ;;
  3413. tilegx|tile-gx)
  3414. arch="tilegx"
  3415. ;;
  3416. i[3-6]86*|i86pc|BePC|x86pc|x86_64|x86_32|amd64)
  3417. arch="x86"
  3418. ;;
  3419. esac
  3420. is_in $arch $ARCH_LIST || warn "unknown architecture $arch"
  3421. enable $arch
  3422. # Add processor-specific flags
  3423. if enabled aarch64; then
  3424. case $cpu in
  3425. armv*)
  3426. cpuflags="-march=$cpu"
  3427. ;;
  3428. *)
  3429. cpuflags="-mcpu=$cpu"
  3430. ;;
  3431. esac
  3432. elif enabled alpha; then
  3433. cpuflags="-mcpu=$cpu"
  3434. elif enabled arm; then
  3435. check_arm_arch() {
  3436. check_cpp_condition stddef.h \
  3437. "defined __ARM_ARCH_${1}__ || defined __TARGET_ARCH_${2:-$1}" \
  3438. $cpuflags
  3439. }
  3440. probe_arm_arch() {
  3441. if check_arm_arch 4; then echo armv4;
  3442. elif check_arm_arch 4T; then echo armv4t;
  3443. elif check_arm_arch 5; then echo armv5;
  3444. elif check_arm_arch 5E; then echo armv5e;
  3445. elif check_arm_arch 5T; then echo armv5t;
  3446. elif check_arm_arch 5TE; then echo armv5te;
  3447. elif check_arm_arch 5TEJ; then echo armv5te;
  3448. elif check_arm_arch 6; then echo armv6;
  3449. elif check_arm_arch 6J; then echo armv6j;
  3450. elif check_arm_arch 6K; then echo armv6k;
  3451. elif check_arm_arch 6Z; then echo armv6z;
  3452. elif check_arm_arch 6ZK; then echo armv6zk;
  3453. elif check_arm_arch 6T2; then echo armv6t2;
  3454. elif check_arm_arch 7; then echo armv7;
  3455. elif check_arm_arch 7A 7_A; then echo armv7-a;
  3456. elif check_arm_arch 7S; then echo armv7-a;
  3457. elif check_arm_arch 7R 7_R; then echo armv7-r;
  3458. elif check_arm_arch 7M 7_M; then echo armv7-m;
  3459. elif check_arm_arch 7EM 7E_M; then echo armv7-m;
  3460. elif check_arm_arch 8A 8_A; then echo armv8-a;
  3461. fi
  3462. }
  3463. [ "$cpu" = generic ] && cpu=$(probe_arm_arch)
  3464. case $cpu in
  3465. armv*)
  3466. cpuflags="-march=$cpu"
  3467. subarch=$(echo $cpu | sed 's/[^a-z0-9]//g')
  3468. ;;
  3469. *)
  3470. cpuflags="-mcpu=$cpu"
  3471. case $cpu in
  3472. cortex-a*) subarch=armv7a ;;
  3473. cortex-r*) subarch=armv7r ;;
  3474. cortex-m*) enable thumb; subarch=armv7m ;;
  3475. arm11*) subarch=armv6 ;;
  3476. arm[79]*e*|arm9[24]6*|arm96*|arm102[26]) subarch=armv5te ;;
  3477. armv4*|arm7*|arm9[24]*) subarch=armv4 ;;
  3478. *) subarch=$(probe_arm_arch) ;;
  3479. esac
  3480. ;;
  3481. esac
  3482. case "$subarch" in
  3483. armv5t*) enable fast_clz ;;
  3484. armv[6-8]*)
  3485. enable fast_clz
  3486. disabled fast_unaligned || enable fast_unaligned
  3487. ;;
  3488. esac
  3489. elif enabled avr32; then
  3490. case $cpu in
  3491. ap7[02]0[0-2])
  3492. subarch="avr32_ap"
  3493. cpuflags="-mpart=$cpu"
  3494. ;;
  3495. ap)
  3496. subarch="avr32_ap"
  3497. cpuflags="-march=$cpu"
  3498. ;;
  3499. uc3[ab]*)
  3500. subarch="avr32_uc"
  3501. cpuflags="-mcpu=$cpu"
  3502. ;;
  3503. uc)
  3504. subarch="avr32_uc"
  3505. cpuflags="-march=$cpu"
  3506. ;;
  3507. esac
  3508. elif enabled bfin; then
  3509. cpuflags="-mcpu=$cpu"
  3510. elif enabled mips; then
  3511. cpuflags="-march=$cpu"
  3512. case $cpu in
  3513. 24kc)
  3514. disable mipsfpu
  3515. disable mipsdspr1
  3516. disable mipsdspr2
  3517. ;;
  3518. 24kf*)
  3519. disable mipsdspr1
  3520. disable mipsdspr2
  3521. ;;
  3522. 24kec|34kc|1004kc)
  3523. disable mipsfpu
  3524. disable mipsdspr2
  3525. ;;
  3526. 24kef*|34kf*|1004kf*)
  3527. disable mipsdspr2
  3528. ;;
  3529. 74kc)
  3530. disable mipsfpu
  3531. ;;
  3532. esac
  3533. elif enabled ppc; then
  3534. disable ldbrx
  3535. disable vsx
  3536. case $(tolower $cpu) in
  3537. 601|ppc601|powerpc601)
  3538. cpuflags="-mcpu=601"
  3539. disable altivec
  3540. ;;
  3541. 603*|ppc603*|powerpc603*)
  3542. cpuflags="-mcpu=603"
  3543. disable altivec
  3544. ;;
  3545. 604*|ppc604*|powerpc604*)
  3546. cpuflags="-mcpu=604"
  3547. disable altivec
  3548. ;;
  3549. g3|75*|ppc75*|powerpc75*)
  3550. cpuflags="-mcpu=750"
  3551. disable altivec
  3552. ;;
  3553. g4|745*|ppc745*|powerpc745*)
  3554. cpuflags="-mcpu=7450"
  3555. ;;
  3556. 74*|ppc74*|powerpc74*)
  3557. cpuflags="-mcpu=7400"
  3558. ;;
  3559. g5|970|ppc970|powerpc970)
  3560. cpuflags="-mcpu=970"
  3561. ;;
  3562. power[3-8]*)
  3563. cpuflags="-mcpu=$cpu"
  3564. ;;
  3565. cell)
  3566. cpuflags="-mcpu=cell"
  3567. enable ldbrx
  3568. ;;
  3569. e500mc)
  3570. cpuflags="-mcpu=e500mc"
  3571. disable altivec
  3572. ;;
  3573. e500v2)
  3574. cpuflags="-mcpu=8548 -mhard-float -mfloat-gprs=double"
  3575. disable altivec
  3576. disable dcbzl
  3577. ;;
  3578. e500)
  3579. cpuflags="-mcpu=8540 -mhard-float"
  3580. disable altivec
  3581. disable dcbzl
  3582. ;;
  3583. esac
  3584. elif enabled sparc; then
  3585. case $cpu in
  3586. cypress|f93[04]|tsc701|sparcl*|supersparc|hypersparc|niagara|v[789])
  3587. cpuflags="-mcpu=$cpu"
  3588. ;;
  3589. ultrasparc*|niagara[234])
  3590. cpuflags="-mcpu=$cpu"
  3591. ;;
  3592. esac
  3593. elif enabled x86; then
  3594. case $cpu in
  3595. i[345]86|pentium)
  3596. cpuflags="-march=$cpu"
  3597. disable i686
  3598. disable mmx
  3599. ;;
  3600. # targets that do NOT support nopl and conditional mov (cmov)
  3601. pentium-mmx|k6|k6-[23]|winchip-c6|winchip2|c3)
  3602. cpuflags="-march=$cpu"
  3603. disable i686
  3604. ;;
  3605. # targets that do support nopl and conditional mov (cmov)
  3606. i686|pentiumpro|pentium[23]|pentium-m|athlon|athlon-tbird|athlon-4|athlon-[mx]p|athlon64*|k8*|opteron*|athlon-fx\
  3607. |core*|atom|bonnell|nehalem|westmere|silvermont|sandybridge|ivybridge|haswell|broadwell|amdfam10|barcelona|b[dt]ver*)
  3608. cpuflags="-march=$cpu"
  3609. enable i686
  3610. enable fast_cmov
  3611. ;;
  3612. # targets that do support conditional mov but on which it's slow
  3613. pentium4|pentium4m|prescott|nocona)
  3614. cpuflags="-march=$cpu"
  3615. enable i686
  3616. disable fast_cmov
  3617. ;;
  3618. esac
  3619. fi
  3620. if [ "$cpu" != generic ]; then
  3621. add_cflags $cpuflags
  3622. add_asflags $cpuflags
  3623. fi
  3624. # compiler sanity check
  3625. check_exec <<EOF
  3626. int main(void){ return 0; }
  3627. EOF
  3628. if test "$?" != 0; then
  3629. echo "$cc is unable to create an executable file."
  3630. if test -z "$cross_prefix" && ! enabled cross_compile ; then
  3631. echo "If $cc is a cross-compiler, use the --enable-cross-compile option."
  3632. echo "Only do this if you know what cross compiling means."
  3633. fi
  3634. die "C compiler test failed."
  3635. fi
  3636. add_cppflags -D_ISOC99_SOURCE
  3637. add_cxxflags -D__STDC_CONSTANT_MACROS
  3638. check_cflags -std=c99
  3639. check_cc -D_FILE_OFFSET_BITS=64 <<EOF && add_cppflags -D_FILE_OFFSET_BITS=64
  3640. #include <stdlib.h>
  3641. EOF
  3642. check_cc -D_LARGEFILE_SOURCE <<EOF && add_cppflags -D_LARGEFILE_SOURCE
  3643. #include <stdlib.h>
  3644. EOF
  3645. add_host_cppflags -D_ISOC99_SOURCE
  3646. check_host_cflags -std=c99
  3647. check_host_cflags -Wall
  3648. check_host_cflags -O3
  3649. check_64bit(){
  3650. arch32=$1
  3651. arch64=$2
  3652. expr=$3
  3653. check_code cc "" "int test[2*($expr) - 1]" &&
  3654. subarch=$arch64 || subarch=$arch32
  3655. }
  3656. case "$arch" in
  3657. aarch64|alpha|ia64)
  3658. spic=$shared
  3659. ;;
  3660. mips)
  3661. check_64bit mips mips64 '_MIPS_SIM > 1'
  3662. spic=$shared
  3663. ;;
  3664. parisc)
  3665. check_64bit parisc parisc64 'sizeof(void *) > 4'
  3666. spic=$shared
  3667. ;;
  3668. ppc)
  3669. check_64bit ppc ppc64 'sizeof(void *) > 4'
  3670. spic=$shared
  3671. ;;
  3672. s390)
  3673. check_64bit s390 s390x 'sizeof(void *) > 4'
  3674. spic=$shared
  3675. ;;
  3676. sparc)
  3677. check_64bit sparc sparc64 'sizeof(void *) > 4'
  3678. spic=$shared
  3679. ;;
  3680. x86)
  3681. check_64bit x86_32 x86_64 'sizeof(void *) > 4'
  3682. # Treat x32 as x64 for now. Note it also needs spic=$shared
  3683. test "$subarch" = "x86_32" && check_cpp_condition stddef.h 'defined(__x86_64__)' &&
  3684. subarch=x86_64
  3685. if test "$subarch" = "x86_64"; then
  3686. spic=$shared
  3687. fi
  3688. ;;
  3689. ppc)
  3690. check_cc <<EOF && subarch="ppc64"
  3691. int test[(int)sizeof(char*) - 7];
  3692. EOF
  3693. ;;
  3694. esac
  3695. enable $subarch
  3696. enabled spic && enable_weak pic
  3697. # OS specific
  3698. case $target_os in
  3699. aix)
  3700. SHFLAGS=-shared
  3701. add_cppflags '-I\$(SRC_PATH)/compat/aix'
  3702. enabled shared && add_ldflags -Wl,-brtl
  3703. ;;
  3704. android)
  3705. disable symver
  3706. enable section_data_rel_ro
  3707. SLIB_INSTALL_NAME='$(SLIBNAME)'
  3708. SLIB_INSTALL_LINKS=
  3709. # soname not set on purpose
  3710. SHFLAGS=-shared
  3711. ;;
  3712. haiku)
  3713. prefix_default="/boot/common"
  3714. network_extralibs="-lnetwork"
  3715. host_libs=
  3716. ;;
  3717. sunos)
  3718. SHFLAGS='-shared -Wl,-h,$$(@F)'
  3719. enabled x86 && SHFLAGS="-mimpure-text $SHFLAGS"
  3720. network_extralibs="-lsocket -lnsl"
  3721. add_cppflags -D__EXTENSIONS__
  3722. # When using suncc to build, the Solaris linker will mark
  3723. # an executable with each instruction set encountered by
  3724. # the Solaris assembler. As our libraries contain their own
  3725. # guards for processor-specific code, instead suppress
  3726. # generation of the HWCAPS ELF section on Solaris x86 only.
  3727. enabled_all suncc x86 &&
  3728. echo "hwcap_1 = OVERRIDE;" > mapfile &&
  3729. add_ldflags -Wl,-M,mapfile
  3730. nm_default='nm -P -g'
  3731. ;;
  3732. netbsd)
  3733. disable symver
  3734. oss_indev_extralibs="-lossaudio"
  3735. oss_outdev_extralibs="-lossaudio"
  3736. enabled gcc || check_ldflags -Wl,-zmuldefs
  3737. ;;
  3738. openbsd|bitrig)
  3739. disable symver
  3740. SHFLAGS='-shared'
  3741. SLIB_INSTALL_NAME='$(SLIBNAME).$(LIBMAJOR).$(LIBMINOR)'
  3742. SLIB_INSTALL_LINKS=
  3743. oss_indev_extralibs="-lossaudio"
  3744. oss_outdev_extralibs="-lossaudio"
  3745. ;;
  3746. dragonfly)
  3747. disable symver
  3748. ;;
  3749. freebsd)
  3750. ;;
  3751. bsd/os)
  3752. add_extralibs -lpoll -lgnugetopt
  3753. strip="strip -d"
  3754. ;;
  3755. darwin)
  3756. enabled ppc && add_asflags -force_cpusubtype_ALL
  3757. SHFLAGS='-dynamiclib -Wl,-single_module -Wl,-install_name,$(SHLIBDIR)/$(SLIBNAME_WITH_MAJOR),-current_version,$(LIBVERSION),-compatibility_version,$(LIBMAJOR)'
  3758. enabled x86_32 && append SHFLAGS -Wl,-read_only_relocs,suppress
  3759. strip="${strip} -x"
  3760. add_ldflags -Wl,-dynamic,-search_paths_first
  3761. SLIBSUF=".dylib"
  3762. SLIBNAME_WITH_VERSION='$(SLIBPREF)$(FULLNAME).$(LIBVERSION)$(SLIBSUF)'
  3763. SLIBNAME_WITH_MAJOR='$(SLIBPREF)$(FULLNAME).$(LIBMAJOR)$(SLIBSUF)'
  3764. objformat="macho"
  3765. enabled x86_64 && objformat="macho64"
  3766. enabled_any pic shared x86_64 ||
  3767. { check_cflags -mdynamic-no-pic && add_asflags -mdynamic-no-pic; }
  3768. ;;
  3769. mingw32*)
  3770. if test $target_os = "mingw32ce"; then
  3771. disable network
  3772. else
  3773. target_os=mingw32
  3774. fi
  3775. LIBTARGET=i386
  3776. if enabled x86_64; then
  3777. LIBTARGET="i386:x86-64"
  3778. elif enabled arm; then
  3779. LIBTARGET=arm-wince
  3780. fi
  3781. enabled shared && ! enabled small && check_cmd $windres --version && enable gnu_windres
  3782. check_ldflags -Wl,--nxcompat
  3783. check_ldflags -Wl,--dynamicbase
  3784. enabled x86_32 && check_ldflags -Wl,--large-address-aware
  3785. shlibdir_default="$bindir_default"
  3786. SLIBPREF=""
  3787. SLIBSUF=".dll"
  3788. SLIBNAME_WITH_VERSION='$(SLIBPREF)$(FULLNAME)-$(LIBVERSION)$(SLIBSUF)'
  3789. SLIBNAME_WITH_MAJOR='$(SLIBPREF)$(FULLNAME)-$(LIBMAJOR)$(SLIBSUF)'
  3790. dlltool="${cross_prefix}dlltool"
  3791. if check_cmd lib.exe -list; then
  3792. SLIB_EXTRA_CMD=-'sed -e "s/ @[^ ]*//" $$(@:$(SLIBSUF)=.orig.def) > $$(@:$(SLIBSUF)=.def); lib.exe /machine:$(LIBTARGET) /def:$$(@:$(SLIBSUF)=.def) /out:$(SUBDIR)$(SLIBNAME:$(SLIBSUF)=.lib)'
  3793. if enabled x86_64; then
  3794. LIBTARGET=x64
  3795. fi
  3796. elif check_cmd $dlltool --version; then
  3797. 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)'
  3798. fi
  3799. SLIB_INSTALL_NAME='$(SLIBNAME_WITH_MAJOR)'
  3800. SLIB_INSTALL_LINKS=
  3801. SLIB_INSTALL_EXTRA_SHLIB='$(SLIBNAME:$(SLIBSUF)=.lib)'
  3802. SLIB_INSTALL_EXTRA_LIB='lib$(SLIBNAME:$(SLIBSUF)=.dll.a) $(SLIBNAME_WITH_MAJOR:$(SLIBSUF)=.def)'
  3803. 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'
  3804. objformat="win32"
  3805. ranlib=:
  3806. enable dos_paths
  3807. ;;
  3808. win32|win64)
  3809. disable symver
  3810. if enabled shared; then
  3811. # Link to the import library instead of the normal static library
  3812. # for shared libs.
  3813. LD_LIB='%.lib'
  3814. # Cannot build both shared and static libs with MSVC or icl.
  3815. disable static
  3816. fi
  3817. enabled x86_32 && check_ldflags -LARGEADDRESSAWARE
  3818. shlibdir_default="$bindir_default"
  3819. SLIBPREF=""
  3820. SLIBSUF=".dll"
  3821. SLIBNAME_WITH_VERSION='$(SLIBPREF)$(FULLNAME)-$(LIBVERSION)$(SLIBSUF)'
  3822. SLIBNAME_WITH_MAJOR='$(SLIBPREF)$(FULLNAME)-$(LIBMAJOR)$(SLIBSUF)'
  3823. SLIB_CREATE_DEF_CMD='$(SRC_PATH)/compat/windows/makedef $(SUBDIR)lib$(NAME).ver $(OBJS) > $$(@:$(SLIBSUF)=.def)'
  3824. SLIB_INSTALL_NAME='$(SLIBNAME_WITH_MAJOR)'
  3825. SLIB_INSTALL_LINKS=
  3826. SLIB_INSTALL_EXTRA_SHLIB='$(SLIBNAME:$(SLIBSUF)=.lib)'
  3827. SLIB_INSTALL_EXTRA_LIB='$(SLIBNAME_WITH_MAJOR:$(SLIBSUF)=.def)'
  3828. SHFLAGS='-dll -def:$$(@:$(SLIBSUF)=.def) -implib:$(SUBDIR)$(SLIBNAME:$(SLIBSUF)=.lib)'
  3829. objformat="win32"
  3830. ranlib=:
  3831. enable dos_paths
  3832. ;;
  3833. cygwin*)
  3834. target_os=cygwin
  3835. shlibdir_default="$bindir_default"
  3836. SLIBPREF="cyg"
  3837. SLIBSUF=".dll"
  3838. SLIBNAME_WITH_VERSION='$(SLIBPREF)$(FULLNAME)-$(LIBVERSION)$(SLIBSUF)'
  3839. SLIBNAME_WITH_MAJOR='$(SLIBPREF)$(FULLNAME)-$(LIBMAJOR)$(SLIBSUF)'
  3840. SLIB_INSTALL_NAME='$(SLIBNAME_WITH_MAJOR)'
  3841. SLIB_INSTALL_LINKS=
  3842. SLIB_INSTALL_EXTRA_LIB='lib$(FULLNAME).dll.a'
  3843. SHFLAGS='-shared -Wl,--out-implib,$(SUBDIR)lib$(FULLNAME).dll.a'
  3844. objformat="win32"
  3845. enable dos_paths
  3846. enabled shared && ! enabled small && check_cmd $windres --version && enable gnu_windres
  3847. ;;
  3848. *-dos|freedos|opendos)
  3849. network_extralibs="-lsocket"
  3850. objformat="coff"
  3851. enable dos_paths
  3852. add_cppflags -U__STRICT_ANSI__
  3853. ;;
  3854. linux)
  3855. enable dv1394
  3856. enable section_data_rel_ro
  3857. ;;
  3858. irix*)
  3859. target_os=irix
  3860. ranlib="echo ignoring ranlib"
  3861. ;;
  3862. os/2*)
  3863. strip="lxlite -CS"
  3864. ln_s="cp -f"
  3865. objformat="aout"
  3866. add_cppflags -D_GNU_SOURCE
  3867. add_ldflags -Zomf -Zbin-files -Zargs-wild -Zmap
  3868. SHFLAGS='$(SUBDIR)$(NAME).def -Zdll -Zomf'
  3869. LIBSUF="_s.a"
  3870. SLIBPREF=""
  3871. SLIBSUF=".dll"
  3872. SLIBNAME_WITH_VERSION='$(SLIBPREF)$(NAME)-$(LIBVERSION)$(SLIBSUF)'
  3873. SLIBNAME_WITH_MAJOR='$(SLIBPREF)$(shell echo $(NAME) | cut -c1-6)$(LIBMAJOR)$(SLIBSUF)'
  3874. SLIB_CREATE_DEF_CMD='echo LIBRARY $(SLIBNAME_WITH_MAJOR) INITINSTANCE TERMINSTANCE > $(SUBDIR)$(NAME).def; \
  3875. echo PROTMODE >> $(SUBDIR)$(NAME).def; \
  3876. echo CODE PRELOAD MOVEABLE DISCARDABLE >> $(SUBDIR)$(NAME).def; \
  3877. echo DATA PRELOAD MOVEABLE MULTIPLE NONSHARED >> $(SUBDIR)$(NAME).def; \
  3878. echo EXPORTS >> $(SUBDIR)$(NAME).def; \
  3879. emxexp -o $(OBJS) >> $(SUBDIR)$(NAME).def'
  3880. SLIB_EXTRA_CMD='emximp -o $(SUBDIR)$(LIBPREF)$(NAME)_dll.a $(SUBDIR)$(NAME).def; \
  3881. emximp -o $(SUBDIR)$(LIBPREF)$(NAME)_dll.lib $(SUBDIR)$(NAME).def;'
  3882. SLIB_INSTALL_EXTRA_LIB='$(LIBPREF)$(NAME)_dll.a $(LIBPREF)$(NAME)_dll.lib'
  3883. enable dos_paths
  3884. enable_weak os2threads
  3885. ;;
  3886. gnu/kfreebsd)
  3887. add_cppflags -D_BSD_SOURCE
  3888. ;;
  3889. gnu)
  3890. ;;
  3891. qnx)
  3892. add_cppflags -D_QNX_SOURCE
  3893. network_extralibs="-lsocket"
  3894. ;;
  3895. symbian)
  3896. SLIBSUF=".dll"
  3897. enable dos_paths
  3898. add_cflags --include=$sysinclude/gcce/gcce.h -fvisibility=default
  3899. add_cppflags -D__GCCE__ -D__SYMBIAN32__ -DSYMBIAN_OE_POSIX_SIGNALS
  3900. add_ldflags -Wl,--target1-abs,--no-undefined \
  3901. -Wl,-Ttext,0x80000,-Tdata,0x1000000 -shared \
  3902. -Wl,--entry=_E32Startup -Wl,-u,_E32Startup
  3903. add_extralibs -l:eexe.lib -l:usrt2_2.lib -l:dfpaeabi.dso \
  3904. -l:drtaeabi.dso -l:scppnwdl.dso -lsupc++ -lgcc \
  3905. -l:libc.dso -l:libm.dso -l:euser.dso -l:libcrt0.lib
  3906. ;;
  3907. osf1)
  3908. add_cppflags -D_OSF_SOURCE -D_POSIX_PII -D_REENTRANT
  3909. ;;
  3910. minix)
  3911. ;;
  3912. plan9)
  3913. add_cppflags -D_C99_SNPRINTF_EXTENSION \
  3914. -D_REENTRANT_SOURCE \
  3915. -D_RESEARCH_SOURCE \
  3916. -DFD_SETSIZE=96 \
  3917. -DHAVE_SOCK_OPTS
  3918. add_compat strtod.o strtod=avpriv_strtod
  3919. network_extralibs='-lbsd'
  3920. exeobjs=compat/plan9/main.o
  3921. disable ffserver
  3922. cp_f='cp'
  3923. ;;
  3924. none)
  3925. ;;
  3926. *)
  3927. die "Unknown OS '$target_os'."
  3928. ;;
  3929. esac
  3930. # determine libc flavour
  3931. probe_libc(){
  3932. pfx=$1
  3933. pfx_no_=${pfx%_}
  3934. # uclibc defines __GLIBC__, so it needs to be checked before glibc.
  3935. if check_${pfx}cpp_condition features.h "defined __UCLIBC__"; then
  3936. eval ${pfx}libc_type=uclibc
  3937. add_${pfx}cppflags -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600
  3938. elif check_${pfx}cpp_condition features.h "defined __GLIBC__"; then
  3939. eval ${pfx}libc_type=glibc
  3940. add_${pfx}cppflags -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600
  3941. # MinGW headers can be installed on Cygwin, so check for newlib first.
  3942. elif check_${pfx}cpp_condition newlib.h "defined _NEWLIB_VERSION"; then
  3943. eval ${pfx}libc_type=newlib
  3944. add_${pfx}cppflags -U__STRICT_ANSI__
  3945. # MinGW64 is backwards compatible with MinGW32, so check for it first.
  3946. elif check_${pfx}cpp_condition _mingw.h "defined __MINGW64_VERSION_MAJOR"; then
  3947. eval ${pfx}libc_type=mingw64
  3948. if check_${pfx}cpp_condition _mingw.h "__MINGW64_VERSION_MAJOR < 3"; then
  3949. add_compat msvcrt/snprintf.o
  3950. add_cflags "-include $source_path/compat/msvcrt/snprintf.h"
  3951. fi
  3952. add_${pfx}cppflags -U__STRICT_ANSI__ -D__USE_MINGW_ANSI_STDIO=1
  3953. eval test \$${pfx_no_}cc_type = "gcc" &&
  3954. add_${pfx}cppflags -D__printf__=__gnu_printf__
  3955. elif check_${pfx}cpp_condition _mingw.h "defined __MINGW_VERSION" ||
  3956. check_${pfx}cpp_condition _mingw.h "defined __MINGW32_VERSION"; then
  3957. eval ${pfx}libc_type=mingw32
  3958. check_${pfx}cpp_condition _mingw.h "__MINGW32_MAJOR_VERSION > 3 || \
  3959. (__MINGW32_MAJOR_VERSION == 3 && __MINGW32_MINOR_VERSION >= 15)" ||
  3960. die "ERROR: MinGW32 runtime version must be >= 3.15."
  3961. add_${pfx}cppflags -U__STRICT_ANSI__ -D__USE_MINGW_ANSI_STDIO=1
  3962. eval test \$${pfx_no_}cc_type = "gcc" &&
  3963. add_${pfx}cppflags -D__printf__=__gnu_printf__
  3964. elif check_${pfx}cpp_condition crtversion.h "defined _VC_CRT_MAJOR_VERSION"; then
  3965. eval ${pfx}libc_type=msvcrt
  3966. # The MSVC 2010 headers (Win 7.0 SDK) set _WIN32_WINNT to
  3967. # 0x601 by default unless something else is set by the user.
  3968. # This can easily lead to us detecting functions only present
  3969. # in such new versions and producing binaries requiring windows 7.0.
  3970. # Therefore explicitly set the default to XP unless the user has
  3971. # set something else on the command line.
  3972. check_${pfx}cpp_condition stdlib.h "defined(_WIN32_WINNT)" ||
  3973. add_${pfx}cppflags -D_WIN32_WINNT=0x0502
  3974. elif check_${pfx}cpp_condition stddef.h "defined __KLIBC__"; then
  3975. eval ${pfx}libc_type=klibc
  3976. elif check_${pfx}cpp_condition sys/cdefs.h "defined __BIONIC__"; then
  3977. eval ${pfx}libc_type=bionic
  3978. elif check_${pfx}cpp_condition sys/brand.h "defined LABELED_BRAND_NAME"; then
  3979. eval ${pfx}libc_type=solaris
  3980. add_${pfx}cppflags -D__EXTENSIONS__ -D_XOPEN_SOURCE=600
  3981. fi
  3982. check_${pfx}cc <<EOF
  3983. #include <time.h>
  3984. void *v = localtime_r;
  3985. EOF
  3986. 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
  3987. #include <time.h>
  3988. void *v = localtime_r;
  3989. EOF
  3990. }
  3991. probe_libc
  3992. test -n "$libc_type" && enable libc_$libc_type
  3993. probe_libc host_
  3994. test -n "$host_libc_type" && enable host_libc_$host_libc_type
  3995. case $libc_type in
  3996. bionic)
  3997. add_compat strtod.o strtod=avpriv_strtod
  3998. ;;
  3999. msvcrt)
  4000. if [ -z "$cl_major_ver" ] || [ $cl_major_ver -le 18 ]; then
  4001. add_compat strtod.o strtod=avpriv_strtod
  4002. add_compat msvcrt/snprintf.o snprintf=avpriv_snprintf \
  4003. _snprintf=avpriv_snprintf \
  4004. vsnprintf=avpriv_vsnprintf
  4005. fi
  4006. ;;
  4007. esac
  4008. # hacks for compiler/libc/os combinations
  4009. if enabled_all tms470 libc_glibc; then
  4010. CPPFLAGS="-I${source_path}/compat/tms470 ${CPPFLAGS}"
  4011. add_cppflags -D__USER_LABEL_PREFIX__=
  4012. add_cppflags -D__builtin_memset=memset
  4013. add_cppflags -D__gnuc_va_list=va_list -D_VA_LIST_DEFINED
  4014. add_cflags -pds=48 # incompatible redefinition of macro
  4015. fi
  4016. if enabled_all ccc libc_glibc; then
  4017. add_ldflags -Wl,-z,now # calls to libots crash without this
  4018. fi
  4019. check_compile_assert flt_lim "float.h limits.h" "DBL_MAX == (double)DBL_MAX" ||
  4020. add_cppflags '-I\$(SRC_PATH)/compat/float'
  4021. esc(){
  4022. echo "$*" | sed 's/%/%25/g;s/:/%3a/g'
  4023. }
  4024. echo "config:$arch:$subarch:$cpu:$target_os:$(esc $cc_ident):$(esc $FFMPEG_CONFIGURATION)" >config.fate
  4025. check_cpp_condition stdlib.h "defined(__PIC__) || defined(__pic__) || defined(PIC)" && enable_weak pic
  4026. set_default libdir
  4027. : ${shlibdir_default:="$libdir"}
  4028. set_default $PATHS_LIST
  4029. set_default nm
  4030. # we need to build at least one lib type
  4031. if ! enabled_any static shared; then
  4032. cat <<EOF
  4033. At least one library type must be built.
  4034. Specify --enable-static to build the static libraries or --enable-shared to
  4035. build the shared libraries as well. To only build the shared libraries specify
  4036. --disable-static in addition to --enable-shared.
  4037. EOF
  4038. exit 1;
  4039. fi
  4040. die_license_disabled() {
  4041. enabled $1 || { enabled $2 && die "$2 is $1 and --enable-$1 is not specified."; }
  4042. }
  4043. die_license_disabled_gpl() {
  4044. enabled $1 || { enabled $2 && die "$2 is incompatible with the gpl and --enable-$1 is not specified."; }
  4045. }
  4046. die_license_disabled gpl frei0r
  4047. die_license_disabled gpl libcdio
  4048. die_license_disabled gpl libsmbclient
  4049. die_license_disabled gpl libutvideo
  4050. die_license_disabled gpl libvidstab
  4051. die_license_disabled gpl libx264
  4052. die_license_disabled gpl libx265
  4053. die_license_disabled gpl libxavs
  4054. die_license_disabled gpl libxvid
  4055. die_license_disabled gpl libzvbi
  4056. die_license_disabled gpl x11grab
  4057. die_license_disabled nonfree libaacplus
  4058. die_license_disabled nonfree libfaac
  4059. die_license_disabled nonfree nvenc
  4060. enabled gpl && die_license_disabled_gpl nonfree libfdk_aac
  4061. enabled gpl && die_license_disabled_gpl nonfree openssl
  4062. die_license_disabled version3 libopencore_amrnb
  4063. die_license_disabled version3 libopencore_amrwb
  4064. die_license_disabled version3 libsmbclient
  4065. die_license_disabled version3 libvo_aacenc
  4066. die_license_disabled version3 libvo_amrwbenc
  4067. enabled version3 && { enabled gpl && enable gplv3 || enable lgplv3; }
  4068. disabled optimizations || check_cflags -fomit-frame-pointer
  4069. enable_weak_pic() {
  4070. disabled pic && return
  4071. enable pic
  4072. add_cppflags -DPIC
  4073. case "$target_os" in
  4074. mingw*|cygwin*)
  4075. ;;
  4076. *)
  4077. add_cflags -fPIC
  4078. ;;
  4079. esac
  4080. add_asflags -fPIC
  4081. }
  4082. enabled pic && enable_weak_pic
  4083. check_cc <<EOF || die "Symbol mangling check failed."
  4084. int ff_extern;
  4085. EOF
  4086. sym=$($nm $TMPO | awk '/ff_extern/{ print substr($0, match($0, /[^ \t]*ff_extern/)) }')
  4087. extern_prefix=${sym%%ff_extern*}
  4088. check_cc <<EOF && enable_weak inline_asm
  4089. void foo(void) { __asm__ volatile ("" ::); }
  4090. EOF
  4091. _restrict=
  4092. for restrict_keyword in restrict __restrict__ __restrict; do
  4093. check_cc <<EOF && _restrict=$restrict_keyword && break
  4094. void foo(char * $restrict_keyword p);
  4095. EOF
  4096. done
  4097. check_cc <<EOF && enable pragma_deprecated
  4098. void foo(void) { _Pragma("GCC diagnostic ignored \"-Wdeprecated-declarations\"") }
  4099. EOF
  4100. check_cc <<EOF && enable attribute_packed
  4101. struct { int x; } __attribute__((packed)) x;
  4102. EOF
  4103. check_cc <<EOF && enable attribute_may_alias
  4104. union { int x; } __attribute__((may_alias)) x;
  4105. EOF
  4106. check_cc <<EOF || die "endian test failed"
  4107. unsigned int endian = 'B' << 24 | 'I' << 16 | 'G' << 8 | 'E';
  4108. EOF
  4109. od -t x1 $TMPO | grep -q '42 *49 *47 *45' && enable bigendian
  4110. if [ "$cpu" = "power7" ] || [ "$cpu" = "power8" ] || enabled ppc64; then
  4111. if ! enabled bigendian && enabled altivec ;then
  4112. enable vsx
  4113. fi
  4114. fi
  4115. check_gas() {
  4116. log "check_gas using '$as' as AS"
  4117. # :vararg is used on aarch64, arm and ppc altivec
  4118. check_as <<EOF || return 1
  4119. .macro m n, y:vararg=0
  4120. \n: .int \y
  4121. .endm
  4122. m x
  4123. EOF
  4124. # .altmacro is only used in arm asm
  4125. ! enabled arm || check_as <<EOF || return 1
  4126. .altmacro
  4127. EOF
  4128. enable gnu_as
  4129. return 0
  4130. }
  4131. if enabled_any arm aarch64 || enabled_all ppc altivec && enabled asm; then
  4132. nogas=:
  4133. enabled_any arm aarch64 && nogas=die
  4134. enabled_all ppc altivec && [ $target_os_default != aix ] && nogas=warn
  4135. as_noop=-v
  4136. case $as_type in
  4137. arm*) gaspp_as_type=armasm; as_noop=-h ;;
  4138. gcc) gaspp_as_type=gas ;;
  4139. *) gaspp_as_type=$as_type ;;
  4140. esac
  4141. [ $target_os = "darwin" ] && gaspp_as_type="apple-$gaspp_as_type"
  4142. test "${as#*gas-preprocessor.pl}" != "$as" ||
  4143. check_cmd gas-preprocessor.pl -arch $arch -as-type $gaspp_as_type -- ${as:=$cc} $as_noop &&
  4144. gas="${gas:=gas-preprocessor.pl} -arch $arch -as-type $gaspp_as_type -- ${as:=$cc}"
  4145. if ! check_gas ; then
  4146. as=${gas:=$as}
  4147. check_gas || \
  4148. $nogas "GNU assembler not found, install/update gas-preprocessor"
  4149. fi
  4150. check_as <<EOF && enable as_func
  4151. .func test
  4152. .endfunc
  4153. EOF
  4154. fi
  4155. check_inline_asm inline_asm_labels '"1:\n"'
  4156. check_inline_asm inline_asm_nonlocal_labels '"Label:\n"'
  4157. if enabled aarch64; then
  4158. enabled armv8 && check_insn armv8 'prfm pldl1strm, [x0]'
  4159. # internal assembler in clang 3.3 does not support this instruction
  4160. enabled neon && check_insn neon 'ext v0.8B, v0.8B, v1.8B, #1'
  4161. enabled vfp && check_insn vfp 'fmadd d0, d0, d1, d2'
  4162. map 'enabled_any ${v}_external ${v}_inline || disable $v' $ARCH_EXT_LIST_ARM
  4163. elif enabled alpha; then
  4164. check_cflags -mieee
  4165. elif enabled arm; then
  4166. check_cpp_condition stddef.h "defined __thumb__" && check_cc <<EOF && enable_weak thumb
  4167. float func(float a, float b){ return a+b; }
  4168. EOF
  4169. enabled thumb && check_cflags -mthumb || check_cflags -marm
  4170. if check_cpp_condition stddef.h "defined __ARM_PCS_VFP"; then
  4171. enable vfp_args
  4172. elif ! check_cpp_condition stddef.h "defined __ARM_PCS || defined __SOFTFP__"; then
  4173. case "${cross_prefix:-$cc}" in
  4174. *hardfloat*) enable vfp_args; fpabi=vfp ;;
  4175. *) check_ld "cc" <<EOF && enable vfp_args && fpabi=vfp || fpabi=soft ;;
  4176. __asm__ (".eabi_attribute 28, 1");
  4177. int main(void) { return 0; }
  4178. EOF
  4179. esac
  4180. warn "Compiler does not indicate floating-point ABI, guessing $fpabi."
  4181. fi
  4182. enabled armv5te && check_insn armv5te 'qadd r0, r0, r0'
  4183. enabled armv6 && check_insn armv6 'sadd16 r0, r0, r0'
  4184. enabled armv6t2 && check_insn armv6t2 'movt r0, #0'
  4185. enabled neon && check_insn neon 'vadd.i16 q0, q0, q0'
  4186. enabled vfp && check_insn vfp 'fadds s0, s0, s0'
  4187. enabled vfpv3 && check_insn vfpv3 'vmov.f32 s0, #1.0'
  4188. enabled setend && check_insn setend 'setend be'
  4189. [ $target_os = linux ] || [ $target_os = android ] ||
  4190. map 'enabled_any ${v}_external ${v}_inline || disable $v' \
  4191. $ARCH_EXT_LIST_ARM
  4192. check_inline_asm asm_mod_q '"add r0, %Q0, %R0" :: "r"((long long)0)'
  4193. check_as <<EOF && enable as_dn_directive
  4194. ra .dn d0.i16
  4195. .unreq ra
  4196. EOF
  4197. # llvm's integrated assembler supports .object_arch from llvm 3.5
  4198. [ "$objformat" = elf ] && check_as <<EOF && enable as_object_arch
  4199. .object_arch armv4
  4200. EOF
  4201. [ $target_os != win32 ] && enabled_all armv6t2 shared !pic && enable_weak_pic
  4202. elif enabled mips; then
  4203. check_inline_asm loongson '"dmult.g $1, $2, $3"'
  4204. # Enable minimum ISA based on selected options
  4205. if enabled mips64 && (enabled mipsdspr1 || enabled mipsdspr2); then
  4206. add_cflags "-mips64r2"
  4207. add_asflags "-mips64r2"
  4208. elif enabled mips64 && enabled mipsfpu; then
  4209. add_cflags "-mips64"
  4210. add_asflags "-mips64"
  4211. elif enabled mipsfpu || enabled mipsdspr1 || enabled mipsdspr2; then
  4212. add_cflags "-mips32r2"
  4213. add_asflags "-mips32r2"
  4214. fi
  4215. enabled mipsdspr1 && add_cflags "-mdsp" && add_asflags "-mdsp" &&
  4216. check_inline_asm mipsdspr1 '"addu.qb $t0, $t1, $t2"'
  4217. enabled mipsdspr2 && add_cflags "-mdspr2" && add_asflags "-mdspr2" &&
  4218. check_inline_asm mipsdspr2 '"absq_s.qb $t0, $t1"'
  4219. enabled mipsfpu && add_cflags "-mhard-float" && add_asflags "-mhard-float" &&
  4220. check_inline_asm mipsfpu '"madd.d $f0, $f2, $f4, $f6"'
  4221. elif enabled parisc; then
  4222. if enabled gcc; then
  4223. case $($cc -dumpversion) in
  4224. 4.[3-9].*) check_cflags -fno-optimize-sibling-calls ;;
  4225. esac
  4226. fi
  4227. elif enabled ppc; then
  4228. enable local_aligned_8 local_aligned_16 local_aligned_32
  4229. check_inline_asm dcbzl '"dcbzl 0, %0" :: "r"(0)'
  4230. check_inline_asm ibm_asm '"add 0, 0, 0"'
  4231. check_inline_asm ppc4xx '"maclhw r10, r11, r12"'
  4232. check_inline_asm xform_asm '"lwzx %1, %y0" :: "Z"(*(int*)0), "r"(0)'
  4233. # AltiVec flags: The FSF version of GCC differs from the Apple version
  4234. if enabled altivec; then
  4235. check_cflags -maltivec -mabi=altivec &&
  4236. { check_header altivec.h && inc_altivec_h="#include <altivec.h>" ; } ||
  4237. check_cflags -faltivec
  4238. # check if our compiler supports Motorola AltiVec C API
  4239. check_cc <<EOF || disable altivec
  4240. $inc_altivec_h
  4241. int main(void) {
  4242. vector signed int v1 = (vector signed int) { 0 };
  4243. vector signed int v2 = (vector signed int) { 1 };
  4244. v1 = vec_add(v1, v2);
  4245. return 0;
  4246. }
  4247. EOF
  4248. enabled altivec || warn "Altivec disabled, possibly missing --cpu flag"
  4249. fi
  4250. if enabled vsx; then
  4251. check_cflags -mvsx
  4252. fi
  4253. elif enabled x86; then
  4254. check_builtin rdtsc intrin.h "__rdtsc()"
  4255. check_builtin mm_empty mmintrin.h "_mm_empty()"
  4256. enable local_aligned_8 local_aligned_16 local_aligned_32
  4257. # check whether EBP is available on x86
  4258. # As 'i' is stored on the stack, this program will crash
  4259. # if the base pointer is used to access it because the
  4260. # base pointer is cleared in the inline assembly code.
  4261. check_exec_crash <<EOF && enable ebp_available
  4262. volatile int i=0;
  4263. __asm__ volatile ("xorl %%ebp, %%ebp" ::: "%ebp");
  4264. return i;
  4265. EOF
  4266. # check whether EBX is available on x86
  4267. check_inline_asm ebx_available '""::"b"(0)' &&
  4268. check_inline_asm ebx_available '"":::"%ebx"'
  4269. # check whether xmm clobbers are supported
  4270. check_inline_asm xmm_clobbers '"":::"%xmm0"'
  4271. check_inline_asm inline_asm_direct_symbol_refs '"movl '$extern_prefix'test, %eax"' ||
  4272. check_inline_asm inline_asm_direct_symbol_refs '"movl '$extern_prefix'test(%rip), %eax"'
  4273. # check whether binutils is new enough to compile SSSE3/MMXEXT
  4274. enabled ssse3 && check_inline_asm ssse3_inline '"pabsw %xmm0, %xmm0"'
  4275. enabled mmxext && check_inline_asm mmxext_inline '"pmaxub %mm0, %mm1"'
  4276. if ! disabled_any asm mmx yasm; then
  4277. if check_cmd $yasmexe --version; then
  4278. enabled x86_64 && yasm_extra="-m amd64"
  4279. yasm_debug="-g dwarf2"
  4280. elif check_cmd nasm -v; then
  4281. yasmexe=nasm
  4282. yasm_debug="-g -F dwarf"
  4283. if enabled x86_64; then
  4284. case "$objformat" in
  4285. elf) objformat=elf64 ;;
  4286. win32) objformat=win64 ;;
  4287. esac
  4288. fi
  4289. fi
  4290. YASMFLAGS="-f $objformat $yasm_extra"
  4291. enabled pic && append YASMFLAGS "-DPIC"
  4292. test -n "$extern_prefix" && append YASMFLAGS "-DPREFIX"
  4293. case "$objformat" in
  4294. elf*) enabled debug && append YASMFLAGS $yasm_debug ;;
  4295. esac
  4296. check_yasm "movbe ecx, [5]" && enable yasm ||
  4297. die "yasm/nasm not found or too old. Use --disable-yasm for a crippled build."
  4298. check_yasm "vextracti128 xmm0, ymm0, 0" || disable avx2_external
  4299. check_yasm "vpmacsdd xmm0, xmm1, xmm2, xmm3" || disable xop_external
  4300. check_yasm "vfmaddps ymm0, ymm1, ymm2, ymm3" || disable fma4_external
  4301. check_yasm "CPU amdnop" || disable cpunop
  4302. fi
  4303. case "$cpu" in
  4304. athlon*|opteron*|k8*|pentium|pentium-mmx|prescott|nocona|atom|geode)
  4305. disable fast_clz
  4306. ;;
  4307. esac
  4308. fi
  4309. check_code cc arm_neon.h "int16x8_t test = vdupq_n_s16(0)" && enable intrinsics_neon
  4310. check_ldflags -Wl,--as-needed
  4311. check_ldflags -Wl,-z,noexecstack
  4312. if check_func dlopen; then
  4313. ldl=
  4314. elif check_func dlopen -ldl; then
  4315. ldl=-ldl
  4316. fi
  4317. frei0r_filter_extralibs='$ldl'
  4318. frei0r_src_filter_extralibs='$ldl'
  4319. ladspa_filter_extralibs='$ldl'
  4320. nvenc_encoder_extralibs='$ldl'
  4321. if ! disabled network; then
  4322. check_func getaddrinfo $network_extralibs
  4323. check_func getservbyport $network_extralibs
  4324. check_func inet_aton $network_extralibs
  4325. check_type netdb.h "struct addrinfo"
  4326. check_type netinet/in.h "struct group_source_req" -D_BSD_SOURCE
  4327. check_type netinet/in.h "struct ip_mreq_source" -D_BSD_SOURCE
  4328. check_type netinet/in.h "struct ipv6_mreq" -D_DARWIN_C_SOURCE
  4329. check_type poll.h "struct pollfd"
  4330. check_type netinet/sctp.h "struct sctp_event_subscribe"
  4331. check_struct "sys/types.h sys/socket.h" "struct sockaddr" sa_len
  4332. check_type netinet/in.h "struct sockaddr_in6"
  4333. check_type "sys/types.h sys/socket.h" "struct sockaddr_storage"
  4334. check_type "sys/types.h sys/socket.h" socklen_t
  4335. # Prefer arpa/inet.h over winsock2
  4336. if check_header arpa/inet.h ; then
  4337. check_func closesocket
  4338. elif check_header winsock2.h ; then
  4339. check_func_headers winsock2.h closesocket -lws2 &&
  4340. network_extralibs="-lws2" ||
  4341. { check_func_headers winsock2.h closesocket -lws2_32 &&
  4342. network_extralibs="-lws2_32"; } || disable winsock2_h network
  4343. check_func_headers ws2tcpip.h getaddrinfo $network_extralibs
  4344. check_type ws2tcpip.h socklen_t
  4345. check_type ws2tcpip.h "struct addrinfo"
  4346. check_type ws2tcpip.h "struct group_source_req"
  4347. check_type ws2tcpip.h "struct ip_mreq_source"
  4348. check_type ws2tcpip.h "struct ipv6_mreq"
  4349. check_type winsock2.h "struct pollfd"
  4350. check_struct winsock2.h "struct sockaddr" sa_len
  4351. check_type ws2tcpip.h "struct sockaddr_in6"
  4352. check_type ws2tcpip.h "struct sockaddr_storage"
  4353. else
  4354. disable network
  4355. fi
  4356. fi
  4357. check_builtin atomic_cas_ptr atomic.h "void **ptr; void *oldval, *newval; atomic_cas_ptr(ptr, oldval, newval)"
  4358. check_builtin atomic_compare_exchange "" "int *ptr, *oldval; int newval; __atomic_compare_exchange_n(ptr, oldval, newval, 0, __ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST)"
  4359. check_builtin machine_rw_barrier mbarrier.h "__machine_rw_barrier()"
  4360. check_builtin MemoryBarrier windows.h "MemoryBarrier()"
  4361. check_builtin sarestart signal.h "SA_RESTART"
  4362. check_builtin sync_val_compare_and_swap "" "int *ptr; int oldval, newval; __sync_val_compare_and_swap(ptr, oldval, newval)"
  4363. check_func_headers malloc.h _aligned_malloc && enable aligned_malloc
  4364. check_func ${malloc_prefix}memalign && enable memalign
  4365. check_func ${malloc_prefix}posix_memalign && enable posix_memalign
  4366. check_func access
  4367. check_func_headers time.h clock_gettime || { check_func_headers time.h clock_gettime -lrt && add_extralibs -lrt && LIBRT="-lrt"; }
  4368. check_func fcntl
  4369. check_func fork
  4370. check_func gethrtime
  4371. check_func getopt
  4372. check_func getrusage
  4373. check_func gettimeofday
  4374. check_func gmtime_r
  4375. check_func isatty
  4376. check_func localtime_r
  4377. check_func mach_absolute_time
  4378. check_func mkstemp
  4379. check_func mmap
  4380. check_func mprotect
  4381. # Solaris has nanosleep in -lrt, OpenSolaris no longer needs that
  4382. check_func_headers time.h nanosleep || { check_func_headers time.h nanosleep -lrt && add_extralibs -lrt && LIBRT="-lrt"; }
  4383. check_func sched_getaffinity
  4384. check_func setrlimit
  4385. check_struct "sys/stat.h" "struct stat" st_mtim.tv_nsec -D_BSD_SOURCE
  4386. check_func strerror_r
  4387. check_func sysconf
  4388. check_func sysctl
  4389. check_func usleep
  4390. check_func_headers conio.h kbhit
  4391. check_func_headers io.h setmode
  4392. check_func_headers lzo/lzo1x.h lzo1x_999_compress
  4393. check_func_headers stdlib.h getenv
  4394. check_func_headers windows.h CoTaskMemFree -lole32
  4395. check_func_headers windows.h GetProcessAffinityMask
  4396. check_func_headers windows.h GetProcessTimes
  4397. check_func_headers windows.h GetSystemTimeAsFileTime
  4398. check_func_headers windows.h MapViewOfFile
  4399. check_func_headers windows.h PeekNamedPipe
  4400. check_func_headers windows.h SetConsoleTextAttribute
  4401. check_func_headers windows.h Sleep
  4402. check_func_headers windows.h VirtualAlloc
  4403. check_struct windows.h "CONDITION_VARIABLE" Ptr
  4404. check_func_headers glob.h glob
  4405. enabled xlib &&
  4406. check_func_headers "X11/Xlib.h X11/extensions/Xvlib.h" XvGetPortAttribute -lXv -lX11 -lXext
  4407. check_header direct.h
  4408. check_header dlfcn.h
  4409. check_header dxva.h
  4410. check_header dxva2api.h -D_WIN32_WINNT=0x0600
  4411. check_header io.h
  4412. check_header libcrystalhd/libcrystalhd_if.h
  4413. check_header mach/mach_time.h
  4414. check_header malloc.h
  4415. check_header net/udplite.h
  4416. check_header poll.h
  4417. check_header sys/mman.h
  4418. check_header sys/param.h
  4419. check_header sys/resource.h
  4420. check_header sys/select.h
  4421. check_header sys/time.h
  4422. check_header sys/un.h
  4423. check_header termios.h
  4424. check_header unistd.h
  4425. check_header vdpau/vdpau.h
  4426. check_header vdpau/vdpau_x11.h
  4427. check_header VideoDecodeAcceleration/VDADecoder.h
  4428. check_header windows.h
  4429. check_header X11/extensions/XvMClib.h
  4430. check_header asm/types.h
  4431. check_lib2 "windows.h shellapi.h" CommandLineToArgvW -lshell32
  4432. check_lib2 "windows.h wincrypt.h" CryptGenRandom -ladvapi32
  4433. check_lib2 "windows.h psapi.h" GetProcessMemoryInfo -lpsapi
  4434. check_struct "sys/time.h sys/resource.h" "struct rusage" ru_maxrss
  4435. check_type "windows.h dxva.h" "DXVA_PicParams_HEVC"
  4436. if ! disabled w32threads && ! enabled pthreads; then
  4437. check_func_headers "windows.h process.h" _beginthreadex &&
  4438. enable w32threads || disable w32threads
  4439. fi
  4440. # check for some common methods of building with pthread support
  4441. # do this before the optional library checks as some of them require pthreads
  4442. if ! disabled pthreads && ! enabled w32threads && ! enabled os2threads; then
  4443. enable pthreads
  4444. if check_func pthread_join -pthread && check_func pthread_create -pthread; then
  4445. add_cflags -pthread
  4446. add_extralibs -pthread
  4447. elif check_func pthread_join -pthreads && check_func pthread_create -pthreads; then
  4448. add_cflags -pthreads
  4449. add_extralibs -pthreads
  4450. elif check_func pthread_join -ldl -pthread && check_func pthread_create -ldl -pthread; then
  4451. add_cflags -ldl -pthread
  4452. add_extralibs -ldl -pthread
  4453. elif check_func pthread_join -lpthreadGC2 && check_func pthread_create -lpthreadGC2; then
  4454. add_extralibs -lpthreadGC2
  4455. elif check_lib pthread.h pthread_join -lpthread && check_lib pthread.h pthread_create -lpthread; then
  4456. :
  4457. elif ! check_func pthread_join && ! check_func pthread_create; then
  4458. disable pthreads
  4459. fi
  4460. check_code cc "pthread.h" "static pthread_mutex_t atomic_lock = PTHREAD_MUTEX_INITIALIZER" || disable pthreads
  4461. fi
  4462. if enabled pthreads; then
  4463. check_func pthread_cancel
  4464. fi
  4465. disabled zlib || check_lib zlib.h zlibVersion -lz || disable zlib
  4466. disabled bzlib || check_lib2 bzlib.h BZ2_bzlibVersion -lbz2 || disable bzlib
  4467. disabled lzma || check_lib2 lzma.h lzma_version_number -llzma || disable lzma
  4468. check_lib math.h sin -lm && LIBM="-lm"
  4469. disabled crystalhd || check_lib libcrystalhd/libcrystalhd_if.h DtsCrystalHDVersion -lcrystalhd || disable crystalhd
  4470. atan2f_args=2
  4471. ldexpf_args=2
  4472. powf_args=2
  4473. for func in $MATH_FUNCS; do
  4474. eval check_mathfunc $func \${${func}_args:-1}
  4475. done
  4476. # these are off by default, so fail if requested and not available
  4477. enabled avfoundation_indev && { check_header_oc AVFoundation/AVFoundation.h || disable avfoundation_indev; }
  4478. enabled avfoundation_indev && { check_lib2 CoreGraphics/CoreGraphics.h CGGetActiveDisplayList -framework CoreGraphics ||
  4479. check_lib2 ApplicationServices/ApplicationServices.h CGGetActiveDisplayList -framework ApplicationServices; }
  4480. enabled avisynth && { { check_lib2 "windows.h" LoadLibrary; } ||
  4481. { check_lib2 "dlfcn.h" dlopen -ldl; } ||
  4482. die "ERROR: LoadLibrary/dlopen not found for avisynth"; }
  4483. enabled decklink && { check_header DeckLinkAPI.h || die "ERROR: DeckLinkAPI.h header not found"; }
  4484. enabled frei0r && { check_header frei0r.h || die "ERROR: frei0r.h header not found"; }
  4485. enabled gnutls && require_pkg_config gnutls gnutls/gnutls.h gnutls_global_init
  4486. enabled ladspa && { check_header ladspa.h || die "ERROR: ladspa.h header not found"; }
  4487. enabled libiec61883 && require libiec61883 libiec61883/iec61883.h iec61883_cmp_connect -lraw1394 -lavc1394 -lrom1394 -liec61883
  4488. enabled libaacplus && require "libaacplus >= 2.0.0" aacplus.h aacplusEncOpen -laacplus
  4489. enabled libass && require_pkg_config libass ass/ass.h ass_library_init
  4490. enabled libbluray && require_pkg_config libbluray libbluray/bluray.h bd_open
  4491. enabled libbs2b && require_pkg_config libbs2b bs2b.h bs2b_open
  4492. enabled libcelt && require libcelt celt/celt.h celt_decode -lcelt0 &&
  4493. { check_lib celt/celt.h celt_decoder_create_custom -lcelt0 ||
  4494. die "ERROR: libcelt must be installed and version must be >= 0.11.0."; }
  4495. enabled libcaca && require_pkg_config caca caca.h caca_create_canvas
  4496. enabled libdcadec && require libdcadec libdcadec/dca_context.h dcadec_context_create -ldcadec
  4497. enabled libfaac && require2 libfaac "stdint.h faac.h" faacEncGetVersion -lfaac
  4498. enabled libfdk_aac && require libfdk_aac fdk-aac/aacenc_lib.h aacEncOpen -lfdk-aac
  4499. 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"
  4500. enabled libflite && require2 libflite "flite/flite.h" flite_init $flite_libs
  4501. enabled fontconfig && enable libfontconfig
  4502. enabled libfontconfig && require_pkg_config fontconfig "fontconfig/fontconfig.h" FcInit
  4503. enabled libfreetype && require_libfreetype
  4504. enabled libfribidi && require_pkg_config fribidi fribidi.h fribidi_version_info
  4505. enabled libgme && require libgme gme/gme.h gme_new_emu -lgme -lstdc++
  4506. enabled libgsm && { for gsm_hdr in "gsm.h" "gsm/gsm.h"; do
  4507. check_lib "${gsm_hdr}" gsm_create -lgsm && break;
  4508. done || die "ERROR: libgsm not found"; }
  4509. enabled libilbc && require libilbc ilbc.h WebRtcIlbcfix_InitDecode -lilbc
  4510. enabled libmfx && require_pkg_config libmfx "mfx/mfxvideo.h" MFXInit
  4511. enabled libmodplug && require_pkg_config libmodplug libmodplug/modplug.h ModPlug_Load
  4512. enabled libmp3lame && require "libmp3lame >= 3.98.3" lame/lame.h lame_set_VBR_quality -lmp3lame
  4513. enabled libnut && require libnut libnut.h nut_demuxer_init -lnut
  4514. enabled libopencore_amrnb && require libopencore_amrnb opencore-amrnb/interf_dec.h Decoder_Interface_init -lopencore-amrnb
  4515. enabled libopencore_amrwb && require libopencore_amrwb opencore-amrwb/dec_if.h D_IF_init -lopencore-amrwb
  4516. enabled libopencv && require_pkg_config opencv opencv/cxcore.h cvCreateImageHeader
  4517. enabled libopenh264 && require_pkg_config openh264 wels/codec_api.h WelsGetCodecVersion
  4518. enabled libopenjpeg && { check_lib openjpeg.h opj_version -lopenmj2 -DOPJ_STATIC ||
  4519. check_lib openjpeg-1.5/openjpeg.h opj_version -lopenjpeg -DOPJ_STATIC ||
  4520. check_lib openjpeg.h opj_version -lopenjpeg -DOPJ_STATIC ||
  4521. die "ERROR: libopenjpeg not found"; }
  4522. enabled libopus && require_pkg_config opus opus_multistream.h opus_multistream_decoder_create
  4523. enabled libpulse && require_pkg_config libpulse pulse/pulseaudio.h pa_context_new
  4524. enabled libquvi && require_pkg_config libquvi quvi/quvi.h quvi_init
  4525. enabled librtmp && require_pkg_config librtmp librtmp/rtmp.h RTMP_Socket
  4526. enabled libschroedinger && require_pkg_config schroedinger-1.0 schroedinger/schro.h schro_init
  4527. enabled libshine && require_pkg_config shine shine/layer3.h shine_encode_buffer
  4528. enabled libsmbclient && { use_pkg_config smbclient libsmbclient.h smbc_init ||
  4529. require smbclient libsmbclient.h smbc_init -lsmbclient; }
  4530. enabled libsoxr && require libsoxr soxr.h soxr_create -lsoxr
  4531. enabled libssh && require_pkg_config libssh libssh/sftp.h sftp_init
  4532. enabled libspeex && require_pkg_config speex speex/speex.h speex_decoder_init -lspeex
  4533. enabled libstagefright_h264 && require_cpp libstagefright_h264 "binder/ProcessState.h media/stagefright/MetaData.h
  4534. media/stagefright/MediaBufferGroup.h media/stagefright/MediaDebug.h media/stagefright/MediaDefs.h
  4535. media/stagefright/OMXClient.h media/stagefright/OMXCodec.h" android::OMXClient -lstagefright -lmedia -lutils -lbinder -lgnustl_static
  4536. enabled libtheora && require libtheora theora/theoraenc.h th_info_init -ltheoraenc -ltheoradec -logg
  4537. enabled libtwolame && require libtwolame twolame.h twolame_init -ltwolame &&
  4538. { check_lib twolame.h twolame_encode_buffer_float32_interleaved -ltwolame ||
  4539. die "ERROR: libtwolame must be installed and version must be >= 0.3.10"; }
  4540. enabled libutvideo && require_cpp utvideo "stdint.h stdlib.h utvideo/utvideo.h utvideo/Codec.h" 'CCodec*' -lutvideo -lstdc++
  4541. enabled libv4l2 && require_pkg_config libv4l2 libv4l2.h v4l2_ioctl
  4542. enabled libvidstab && require_pkg_config "vidstab >= 0.98" vid.stab/libvidstab.h vsMotionDetectInit
  4543. enabled libvo_aacenc && require libvo_aacenc vo-aacenc/voAAC.h voGetAACEncAPI -lvo-aacenc
  4544. enabled libvo_amrwbenc && require libvo_amrwbenc vo-amrwbenc/enc_if.h E_IF_init -lvo-amrwbenc
  4545. enabled libvorbis && require libvorbis vorbis/vorbisenc.h vorbis_info_init -lvorbisenc -lvorbis -logg
  4546. enabled libvpx && {
  4547. enabled libvpx_vp8_decoder && { check_lib2 "vpx/vpx_decoder.h vpx/vp8dx.h" vpx_codec_dec_init_ver -lvpx ||
  4548. die "ERROR: libvpx decoder version must be >=0.9.1"; }
  4549. 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 ||
  4550. die "ERROR: libvpx encoder version must be >=0.9.7"; }
  4551. enabled libvpx_vp9_decoder && { check_lib2 "vpx/vpx_decoder.h vpx/vp8dx.h" "vpx_codec_vp9_dx" -lvpx || disable libvpx_vp9_decoder; }
  4552. 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; } }
  4553. enabled libwavpack && require libwavpack wavpack/wavpack.h WavpackOpenFileOutput -lwavpack
  4554. enabled libwebp && require_pkg_config "libwebp >= 0.2.0" webp/encode.h WebPGetEncoderVersion
  4555. enabled libx264 && { use_pkg_config x264 "stdint.h x264.h" x264_encoder_encode ||
  4556. { require libx264 x264.h x264_encoder_encode -lx264 &&
  4557. warn "using libx264 without pkg-config"; } } &&
  4558. { check_cpp_condition x264.h "X264_BUILD >= 118" ||
  4559. die "ERROR: libx264 must be installed and version must be >= 0.118."; }
  4560. enabled libx265 && require_pkg_config x265 x265.h x265_encoder_encode &&
  4561. { check_cpp_condition x265.h "X265_BUILD >= 17" ||
  4562. die "ERROR: libx265 version must be >= 17."; }
  4563. enabled libxavs && require libxavs xavs.h xavs_encoder_encode -lxavs
  4564. enabled libxvid && require libxvid xvid.h xvid_global -lxvidcore
  4565. enabled libzmq && require_pkg_config libzmq zmq.h zmq_ctx_new
  4566. enabled libzvbi && require libzvbi libzvbi.h vbi_decoder_new -lzvbi
  4567. enabled nvenc && { check_header nvEncodeAPI.h || die "ERROR: nvEncodeAPI.h not found."; } &&
  4568. { [ $target_os != cygwin ] || die "ERROR: NVENC is not supported on Cygwin currently."; }
  4569. enabled openal && { { for al_libs in "${OPENAL_LIBS}" "-lopenal" "-lOpenAL32"; do
  4570. check_lib 'AL/al.h' alGetError "${al_libs}" && break; done } ||
  4571. die "ERROR: openal not found"; } &&
  4572. { check_cpp_condition "AL/al.h" "defined(AL_VERSION_1_1)" ||
  4573. die "ERROR: openal must be installed and version must be 1.1 or compatible"; }
  4574. enabled opencl && { check_lib2 OpenCL/cl.h clEnqueueNDRangeKernel -Wl,-framework,OpenCL ||
  4575. check_lib2 CL/cl.h clEnqueueNDRangeKernel -lOpenCL ||
  4576. die "ERROR: opencl not found"; } &&
  4577. { check_cpp_condition "OpenCL/cl.h" "defined(CL_VERSION_1_2)" ||
  4578. check_cpp_condition "CL/cl.h" "defined(CL_VERSION_1_2)" ||
  4579. die "ERROR: opencl must be installed and version must be 1.2 or compatible"; }
  4580. enabled opengl && { check_lib GL/glx.h glXGetProcAddress "-lGL" ||
  4581. check_lib2 windows.h wglGetProcAddress "-lopengl32 -lgdi32" ||
  4582. check_lib2 OpenGL/gl3.h glGetError "-Wl,-framework,OpenGL" ||
  4583. check_lib2 ES2/gl.h glGetError "-isysroot=${sysroot} -Wl,-framework,OpenGLES" ||
  4584. die "ERROR: opengl not found."
  4585. }
  4586. enabled openssl && { check_lib openssl/ssl.h SSL_library_init -lssl -lcrypto ||
  4587. check_lib openssl/ssl.h SSL_library_init -lssl32 -leay32 ||
  4588. check_lib openssl/ssl.h SSL_library_init -lssl -lcrypto -lws2_32 -lgdi32 ||
  4589. die "ERROR: openssl not found"; }
  4590. enabled qtkit_indev && { check_header_oc QTKit/QTKit.h || disable qtkit_indev; }
  4591. if enabled gnutls; then
  4592. { check_lib nettle/bignum.h nettle_mpz_get_str_256 -lnettle -lhogweed -lgmp && enable nettle; } ||
  4593. { check_lib gcrypt.h gcry_mpi_new -lgcrypt && enable gcrypt; }
  4594. fi
  4595. # libdc1394 check
  4596. if enabled libdc1394; then
  4597. { require_pkg_config libdc1394-2 dc1394/dc1394.h dc1394_new &&
  4598. enable libdc1394_2; } ||
  4599. { check_lib libdc1394/dc1394_control.h dc1394_create_handle -ldc1394_control -lraw1394 &&
  4600. enable libdc1394_1; } ||
  4601. die "ERROR: No version of libdc1394 found "
  4602. fi
  4603. if ! disabled sdl; then
  4604. SDL_CONFIG="${cross_prefix}sdl-config"
  4605. if check_pkg_config sdl SDL_events.h SDL_PollEvent; then
  4606. check_cpp_condition SDL.h "(SDL_MAJOR_VERSION<<16 | SDL_MINOR_VERSION<<8 | SDL_PATCHLEVEL) >= 0x010201" $sdl_cflags &&
  4607. check_cpp_condition SDL.h "(SDL_MAJOR_VERSION<<16 | SDL_MINOR_VERSION<<8 | SDL_PATCHLEVEL) < 0x010300" $sdl_cflags &&
  4608. enable sdl
  4609. else
  4610. if "${SDL_CONFIG}" --version > /dev/null 2>&1; then
  4611. sdl_cflags=$("${SDL_CONFIG}" --cflags)
  4612. sdl_libs=$("${SDL_CONFIG}" --libs)
  4613. check_func_headers SDL_version.h SDL_Linked_Version $sdl_cflags $sdl_libs &&
  4614. check_cpp_condition SDL.h "(SDL_MAJOR_VERSION<<16 | SDL_MINOR_VERSION<<8 | SDL_PATCHLEVEL) >= 0x010201" $sdl_cflags &&
  4615. check_cpp_condition SDL.h "(SDL_MAJOR_VERSION<<16 | SDL_MINOR_VERSION<<8 | SDL_PATCHLEVEL) < 0x010300" $sdl_cflags &&
  4616. enable sdl
  4617. elif enabled sdl ; then
  4618. die "ERROR: SDL not found"
  4619. else
  4620. disable sdl
  4621. fi
  4622. fi
  4623. fi
  4624. enabled sdl && add_cflags $sdl_cflags && add_extralibs $sdl_libs
  4625. makeinfo --version > /dev/null 2>&1 && enable makeinfo || disable makeinfo
  4626. enabled makeinfo && (makeinfo --version | \
  4627. grep -q 'makeinfo (GNU texinfo) 5' > /dev/null 2>&1) \
  4628. && enable makeinfo_html || disable makeinfo_html
  4629. disabled makeinfo_html && texi2html --help 2> /dev/null | grep -q 'init-file' && enable texi2html || disable texi2html
  4630. perl -v > /dev/null 2>&1 && enable perl || disable perl
  4631. pod2man --help > /dev/null 2>&1 && enable pod2man || disable pod2man
  4632. rsync --help 2> /dev/null | grep -q 'contimeout' && enable rsync_contimeout || disable rsync_contimeout
  4633. check_header linux/fb.h
  4634. check_header linux/videodev.h
  4635. check_header linux/videodev2.h
  4636. check_code cc linux/videodev2.h "struct v4l2_frmsizeenum vfse; vfse.discrete.width = 0;" && enable_safe struct_v4l2_frmivalenum_discrete
  4637. check_header sys/videoio.h
  4638. check_code cc sys/videoio.h "struct v4l2_frmsizeenum vfse; vfse.discrete.width = 0;" && enable_safe struct_v4l2_frmivalenum_discrete
  4639. check_func_headers "windows.h vfw.h" capCreateCaptureWindow "$vfwcap_indev_extralibs"
  4640. # check that WM_CAP_DRIVER_CONNECT is defined to the proper value
  4641. # w32api 3.12 had it defined wrong
  4642. check_cpp_condition vfw.h "WM_CAP_DRIVER_CONNECT > WM_USER" && enable vfwcap_defines
  4643. check_type "dshow.h" IBaseFilter
  4644. # check for ioctl_meteor.h, ioctl_bt848.h and alternatives
  4645. { check_header dev/bktr/ioctl_meteor.h &&
  4646. check_header dev/bktr/ioctl_bt848.h; } ||
  4647. { check_header machine/ioctl_meteor.h &&
  4648. check_header machine/ioctl_bt848.h; } ||
  4649. { check_header dev/video/meteor/ioctl_meteor.h &&
  4650. check_header dev/video/bktr/ioctl_bt848.h; } ||
  4651. check_header dev/ic/bt8xx.h
  4652. check_header sndio.h
  4653. if check_struct sys/soundcard.h audio_buf_info bytes; then
  4654. enable_safe sys/soundcard.h
  4655. else
  4656. check_cc -D__BSD_VISIBLE -D__XSI_VISIBLE <<EOF && add_cppflags -D__BSD_VISIBLE -D__XSI_VISIBLE && enable_safe sys/soundcard.h
  4657. #include <sys/soundcard.h>
  4658. audio_buf_info abc;
  4659. EOF
  4660. fi
  4661. check_header soundcard.h
  4662. enabled_any alsa_indev alsa_outdev &&
  4663. check_lib2 alsa/asoundlib.h snd_pcm_htimestamp -lasound
  4664. enabled jack_indev && check_lib2 jack/jack.h jack_client_open -ljack && check_func sem_timedwait &&
  4665. check_func jack_port_get_latency_range -ljack
  4666. enabled_any sndio_indev sndio_outdev && check_lib2 sndio.h sio_open -lsndio
  4667. if enabled libcdio; then
  4668. check_lib2 "cdio/cdda.h cdio/paranoia.h" cdio_cddap_open -lcdio_paranoia -lcdio_cdda -lcdio ||
  4669. check_lib2 "cdio/paranoia/cdda.h cdio/paranoia/paranoia.h" cdio_cddap_open -lcdio_paranoia -lcdio_cdda -lcdio ||
  4670. die "ERROR: No usable libcdio/cdparanoia found"
  4671. fi
  4672. enabled xlib &&
  4673. check_lib X11/Xlib.h XOpenDisplay -lX11 || disable xlib
  4674. if ! disabled libxcb; then
  4675. check_pkg_config "xcb >= 1.4" xcb/xcb.h xcb_connect || {
  4676. enabled libxcb && die "ERROR: libxcb >= 1.4 not found";
  4677. } && disable x11grab && enable libxcb
  4678. if enabled libxcb; then
  4679. disabled libxcb_shm || {
  4680. check_pkg_config xcb-shm xcb/shm.h xcb_shm_attach || {
  4681. enabled libxcb_shm && die "ERROR: libxcb_shm not found";
  4682. } && check_header sys/shm.h && enable libxcb_shm; }
  4683. disabled libxcb_xfixes || {
  4684. check_pkg_config xcb-xfixes xcb/xfixes.h xcb_xfixes_get_cursor_image || {
  4685. enabled libxcb_xfixes && die "ERROR: libxcb_xfixes not found";
  4686. } && enable libxcb_xfixes; }
  4687. disabled libxcb_shape || {
  4688. check_pkg_config xcb-shape xcb/shape.h xcb_shape_get_rectangles || {
  4689. enabled libxcb_shape && die "ERROR: libxcb_shape not found";
  4690. } && enable libxcb_shape; }
  4691. add_cflags $xcb_cflags $xcb_shm_cflags $xcb_xfixes_cflags $xcb_shape_cflags
  4692. add_extralibs $xcb_libs $xcb_shm_libs $xcb_xfixes_libs $xcb_shape_libs
  4693. fi
  4694. fi
  4695. if enabled x11grab; then
  4696. enabled xlib || die "ERROR: Xlib not found"
  4697. require Xext X11/extensions/XShm.h XShmCreateImage -lXext
  4698. require Xfixes X11/extensions/Xfixes.h XFixesGetCursorImage -lXfixes
  4699. fi
  4700. check_func_headers "windows.h" CreateDIBSection "$gdigrab_indev_extralibs"
  4701. enabled dxva2api_h &&
  4702. check_cc <<EOF && enable dxva2api_cobj
  4703. #define _WIN32_WINNT 0x0600
  4704. #define COBJMACROS
  4705. #include <windows.h>
  4706. #include <d3d9.h>
  4707. #include <dxva2api.h>
  4708. int main(void) { IDirectXVideoDecoder *o = NULL; IDirectXVideoDecoder_Release(o); return 0; }
  4709. EOF
  4710. enabled vaapi &&
  4711. check_lib va/va.h vaInitialize -lva ||
  4712. disable vaapi
  4713. enabled vaapi && enabled xlib &&
  4714. check_lib2 "va/va.h va/va_x11.h" vaGetDisplay -lva -lva-x11 &&
  4715. enable vaapi_x11
  4716. enabled vdpau &&
  4717. check_cpp_condition vdpau/vdpau.h "defined VDP_DECODER_PROFILE_MPEG4_PART2_ASP" ||
  4718. disable vdpau
  4719. enabled vdpau && enabled xlib &&
  4720. check_func_headers "vdpau/vdpau.h vdpau/vdpau_x11.h" vdp_device_create_x11 -lvdpau &&
  4721. prepend ffmpeg_libs $($ldflags_filter "-lvdpau") &&
  4722. enable vdpau_x11
  4723. # Funny iconv installations are not unusual, so check it after all flags have been set
  4724. disabled iconv || check_func_headers iconv.h iconv || check_lib2 iconv.h iconv -liconv || disable iconv
  4725. enabled debug && add_cflags -g"$debuglevel" && add_asflags -g"$debuglevel"
  4726. # add some useful compiler flags if supported
  4727. check_cflags -Wdeclaration-after-statement
  4728. check_cflags -Wall
  4729. check_cflags -Wdisabled-optimization
  4730. check_cflags -Wpointer-arith
  4731. check_cflags -Wredundant-decls
  4732. check_cflags -Wwrite-strings
  4733. check_cflags -Wtype-limits
  4734. check_cflags -Wundef
  4735. check_cflags -Wmissing-prototypes
  4736. check_cflags -Wno-pointer-to-int-cast
  4737. check_cflags -Wstrict-prototypes
  4738. check_cflags -Wempty-body
  4739. enabled extra_warnings && check_cflags -Winline
  4740. check_disable_warning(){
  4741. warning_flag=-W${1#-Wno-}
  4742. test_cflags $warning_flag && add_cflags $1
  4743. }
  4744. check_disable_warning -Wno-parentheses
  4745. check_disable_warning -Wno-switch
  4746. check_disable_warning -Wno-format-zero-length
  4747. check_disable_warning -Wno-pointer-sign
  4748. # add some linker flags
  4749. check_ldflags -Wl,--warn-common
  4750. check_ldflags -Wl,-rpath-link=libpostproc:libswresample:libswscale:libavfilter:libavdevice:libavformat:libavcodec:libavutil:libavresample
  4751. enabled rpath && add_ldexeflags -Wl,-rpath,$libdir
  4752. test_ldflags -Wl,-Bsymbolic && append SHFLAGS -Wl,-Bsymbolic
  4753. # add some strip flags
  4754. # -wN '..@*' is more selective than -x, but not available everywhere.
  4755. check_stripflags -wN \'..@*\' || check_stripflags -x
  4756. enabled neon_clobber_test &&
  4757. check_ldflags -Wl,--wrap,avcodec_open2 \
  4758. -Wl,--wrap,avcodec_decode_audio4 \
  4759. -Wl,--wrap,avcodec_decode_video2 \
  4760. -Wl,--wrap,avcodec_decode_subtitle2 \
  4761. -Wl,--wrap,avcodec_encode_audio2 \
  4762. -Wl,--wrap,avcodec_encode_video2 \
  4763. -Wl,--wrap,avcodec_encode_subtitle \
  4764. -Wl,--wrap,swr_convert \
  4765. -Wl,--wrap,avresample_convert ||
  4766. disable neon_clobber_test
  4767. enabled xmm_clobber_test &&
  4768. check_ldflags -Wl,--wrap,avcodec_open2 \
  4769. -Wl,--wrap,avcodec_decode_audio4 \
  4770. -Wl,--wrap,avcodec_decode_video2 \
  4771. -Wl,--wrap,avcodec_decode_subtitle2 \
  4772. -Wl,--wrap,avcodec_encode_audio2 \
  4773. -Wl,--wrap,avcodec_encode_video \
  4774. -Wl,--wrap,avcodec_encode_video2 \
  4775. -Wl,--wrap,avcodec_encode_subtitle \
  4776. -Wl,--wrap,swr_convert \
  4777. -Wl,--wrap,avresample_convert \
  4778. -Wl,--wrap,sws_scale ||
  4779. disable xmm_clobber_test
  4780. echo "X{};" > $TMPV
  4781. if test_ldflags -Wl,--version-script,$TMPV; then
  4782. append SHFLAGS '-Wl,--version-script,\$(SUBDIR)lib\$(NAME).ver'
  4783. check_cc <<EOF && enable symver_asm_label
  4784. void ff_foo(void) __asm__ ("av_foo@VERSION");
  4785. void ff_foo(void) { ${inline_asm+__asm__($quotes);} }
  4786. EOF
  4787. check_cc <<EOF && enable symver_gnu_asm
  4788. __asm__(".symver ff_foo,av_foo@VERSION");
  4789. void ff_foo(void) {}
  4790. EOF
  4791. fi
  4792. if [ -z "$optflags" ]; then
  4793. if enabled small; then
  4794. optflags=$cflags_size
  4795. elif enabled optimizations; then
  4796. optflags=$cflags_speed
  4797. else
  4798. optflags=$cflags_noopt
  4799. fi
  4800. fi
  4801. check_optflags(){
  4802. check_cflags "$@"
  4803. enabled lto && check_ldflags "$@"
  4804. }
  4805. if enabled lto; then
  4806. test "$cc_type" != "$ld_type" && die "LTO requires same compiler and linker"
  4807. check_cflags -flto
  4808. check_ldflags -flto $cpuflags
  4809. disable inline_asm_direct_symbol_refs
  4810. fi
  4811. check_optflags $optflags
  4812. check_optflags -fno-math-errno
  4813. check_optflags -fno-signed-zeros
  4814. enabled ftrapv && check_cflags -ftrapv
  4815. check_cc -mno-red-zone <<EOF && noredzone_flags="-mno-red-zone"
  4816. int x;
  4817. EOF
  4818. if enabled icc; then
  4819. # Just warnings, no remarks
  4820. check_cflags -w1
  4821. # -wd: Disable following warnings
  4822. # 144, 167, 556: -Wno-pointer-sign
  4823. # 188: enumerated type mixed with another type
  4824. # 1292: attribute "foo" ignored
  4825. # 1419: external declaration in primary source file
  4826. # 10006: ignoring unknown option -fno-signed-zeros
  4827. # 10148: ignoring unknown option -Wno-parentheses
  4828. # 10156: ignoring option '-W'; no argument required
  4829. # 13200: No EMMS instruction before call to function
  4830. # 13203: No EMMS instruction before return from function
  4831. check_cflags -wd144,167,188,556,1292,1419,10006,10148,10156,13200,13203
  4832. # 11030: Warning unknown option --as-needed
  4833. # 10156: ignoring option '-export'; no argument required
  4834. check_ldflags -wd10156,11030
  4835. # icc 11.0 and 11.1 work with ebp_available, but don't pass the test
  4836. enable ebp_available
  4837. # The test above does not test linking
  4838. enabled lto && disable symver_asm_label
  4839. if enabled x86_32; then
  4840. icc_version=$($cc -dumpversion)
  4841. test ${icc_version%%.*} -ge 11 &&
  4842. check_cflags -falign-stack=maintain-16-byte ||
  4843. disable aligned_stack
  4844. fi
  4845. elif enabled ccc; then
  4846. # disable some annoying warnings
  4847. add_cflags -msg_disable bitnotint
  4848. add_cflags -msg_disable mixfuncvoid
  4849. add_cflags -msg_disable nonstandcast
  4850. add_cflags -msg_disable unsupieee
  4851. elif enabled gcc; then
  4852. check_optflags -fno-tree-vectorize
  4853. check_cflags -Werror=format-security
  4854. check_cflags -Werror=implicit-function-declaration
  4855. check_cflags -Werror=missing-prototypes
  4856. check_cflags -Werror=return-type
  4857. check_cflags -Werror=vla
  4858. check_cflags -Wformat
  4859. check_cflags -fdiagnostics-color=auto
  4860. enabled extra_warnings || check_disable_warning -Wno-maybe-uninitialized
  4861. elif enabled llvm_gcc; then
  4862. check_cflags -mllvm -stack-alignment=16
  4863. elif enabled clang; then
  4864. check_cflags -mllvm -stack-alignment=16
  4865. check_cflags -Qunused-arguments
  4866. check_cflags -Werror=implicit-function-declaration
  4867. check_cflags -Werror=missing-prototypes
  4868. check_cflags -Werror=return-type
  4869. elif enabled cparser; then
  4870. add_cflags -Wno-missing-variable-declarations
  4871. add_cflags -Wno-empty-statement
  4872. elif enabled armcc; then
  4873. add_cflags -W${armcc_opt},--diag_suppress=4343 # hardfp compat
  4874. add_cflags -W${armcc_opt},--diag_suppress=3036 # using . as system include dir
  4875. # 2523: use of inline assembly is deprecated
  4876. add_cflags -W${armcc_opt},--diag_suppress=2523
  4877. add_cflags -W${armcc_opt},--diag_suppress=1207
  4878. add_cflags -W${armcc_opt},--diag_suppress=1293 # assignment in condition
  4879. add_cflags -W${armcc_opt},--diag_suppress=3343 # hardfp compat
  4880. add_cflags -W${armcc_opt},--diag_suppress=167 # pointer sign
  4881. add_cflags -W${armcc_opt},--diag_suppress=513 # pointer sign
  4882. elif enabled tms470; then
  4883. add_cflags -pds=824 -pds=837
  4884. disable inline_asm
  4885. elif enabled pathscale; then
  4886. add_cflags -fstrict-overflow -OPT:wrap_around_unsafe_opt=OFF
  4887. elif enabled_any msvc icl; then
  4888. enabled x86_32 && disable aligned_stack
  4889. enabled_all x86_32 debug && add_cflags -Oy-
  4890. enabled debug && add_ldflags -debug
  4891. enable pragma_deprecated
  4892. if enabled icl; then
  4893. # -Qansi-alias is basically -fstrict-aliasing, but does not work
  4894. # (correctly) on icl 13.x.
  4895. check_cpp_condition "windows.h" "__ICL < 1300 || __ICL >= 1400" &&
  4896. add_cflags -Qansi-alias
  4897. # Some inline asm is not compilable in debug
  4898. if enabled debug; then
  4899. disable ebp_available
  4900. disable ebx_available
  4901. fi
  4902. fi
  4903. # msvcrt10 x64 incorrectly enables log2, only msvcrt12 onwards actually has log2.
  4904. check_cpp_condition crtversion.h "_VC_CRT_MAJOR_VERSION >= 12" || disable log2
  4905. fi
  4906. case $as_type in
  4907. clang)
  4908. add_asflags -Qunused-arguments
  4909. ;;
  4910. esac
  4911. case $ld_type in
  4912. clang)
  4913. check_ldflags -Qunused-arguments
  4914. ;;
  4915. esac
  4916. case $target_os in
  4917. osf1)
  4918. enabled ccc && add_ldflags '-Wl,-expect_unresolved,*'
  4919. ;;
  4920. plan9)
  4921. add_cppflags -Dmain=plan9_main
  4922. ;;
  4923. esac
  4924. enable frame_thread_encoder
  4925. enabled asm || { arch=c; disable $ARCH_LIST $ARCH_EXT_LIST; }
  4926. check_deps $CONFIG_LIST \
  4927. $CONFIG_EXTRA \
  4928. $HAVE_LIST \
  4929. $ALL_COMPONENTS \
  4930. 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"
  4931. if test $target_os = "haiku"; then
  4932. disable memalign
  4933. disable posix_memalign
  4934. fi
  4935. enabled_all dxva2 dxva2api_cobj CoTaskMemFree &&
  4936. prepend ffmpeg_libs $($ldflags_filter "-lole32" "-luser32") &&
  4937. enable dxva2_lib
  4938. ! enabled_any memalign posix_memalign aligned_malloc &&
  4939. enabled simd_align_16 && enable memalign_hack
  4940. # add_dep lib dep
  4941. # -> enable ${lib}_deps_${dep}
  4942. # -> add $dep to ${lib}_deps only once
  4943. add_dep() {
  4944. lib=$1
  4945. dep=$2
  4946. enabled "${lib}_deps_${dep}" && return 0
  4947. enable "${lib}_deps_${dep}"
  4948. prepend "${lib}_deps" $dep
  4949. }
  4950. # merge deps lib components
  4951. # merge all ${component}_deps into ${lib}_deps and ${lib}_deps_*
  4952. merge_deps() {
  4953. lib=$1
  4954. shift
  4955. for comp in $*; do
  4956. enabled $comp || continue
  4957. eval "dep=\"\$${comp}_deps\""
  4958. for d in $dep; do
  4959. add_dep $lib $d
  4960. done
  4961. done
  4962. }
  4963. merge_deps libavfilter $FILTER_LIST
  4964. map 'enabled $v && intrinsics=${v#intrinsics_}' $INTRINSICS_LIST
  4965. for thread in $THREADS_LIST; do
  4966. if enabled $thread; then
  4967. test -n "$thread_type" &&
  4968. die "ERROR: Only one thread type must be selected." ||
  4969. thread_type="$thread"
  4970. fi
  4971. done
  4972. enabled zlib && add_cppflags -DZLIB_CONST
  4973. # conditional library dependencies, in linking order
  4974. enabled amovie_filter && prepend avfilter_deps "avformat avcodec"
  4975. enabled aresample_filter && prepend avfilter_deps "swresample"
  4976. enabled asyncts_filter && prepend avfilter_deps "avresample"
  4977. enabled atempo_filter && prepend avfilter_deps "avcodec"
  4978. enabled ebur128_filter && enabled swresample && prepend avfilter_deps "swresample"
  4979. enabled elbg_filter && prepend avfilter_deps "avcodec"
  4980. enabled fftfilt_filter && prepend avfilter_deps "avcodec"
  4981. enabled mcdeint_filter && prepend avfilter_deps "avcodec"
  4982. enabled movie_filter && prepend avfilter_deps "avformat avcodec"
  4983. enabled pan_filter && prepend avfilter_deps "swresample"
  4984. enabled pp_filter && prepend avfilter_deps "postproc"
  4985. enabled removelogo_filter && prepend avfilter_deps "avformat avcodec swscale"
  4986. enabled resample_filter && prepend avfilter_deps "avresample"
  4987. enabled sab_filter && prepend avfilter_deps "swscale"
  4988. enabled scale_filter && prepend avfilter_deps "swscale"
  4989. enabled showspectrum_filter && prepend avfilter_deps "avcodec"
  4990. enabled smartblur_filter && prepend avfilter_deps "swscale"
  4991. enabled subtitles_filter && prepend avfilter_deps "avformat avcodec"
  4992. enabled uspp_filter && prepend avfilter_deps "avcodec"
  4993. enabled lavfi_indev && prepend avdevice_deps "avfilter"
  4994. enabled opus_decoder && prepend avcodec_deps "swresample"
  4995. expand_deps(){
  4996. lib_deps=${1}_deps
  4997. eval "deps=\$$lib_deps"
  4998. append $lib_deps $(map 'eval echo \$${v}_deps' $deps)
  4999. unique $lib_deps
  5000. }
  5001. #we have to remove gpl from the deps here as some code assumes all lib deps are libs
  5002. postproc_deps="$(filter_out 'gpl' $postproc_deps)"
  5003. map 'expand_deps $v' $LIBRARY_LIST
  5004. echo "install prefix $prefix"
  5005. echo "source path $source_path"
  5006. echo "C compiler $cc"
  5007. echo "C library $libc_type"
  5008. if test "$host_cc" != "$cc"; then
  5009. echo "host C compiler $host_cc"
  5010. echo "host C library $host_libc_type"
  5011. fi
  5012. echo "ARCH $arch ($cpu)"
  5013. if test "$build_suffix" != ""; then
  5014. echo "build suffix $build_suffix"
  5015. fi
  5016. if test "$progs_suffix" != ""; then
  5017. echo "progs suffix $progs_suffix"
  5018. fi
  5019. if test "$extra_version" != ""; then
  5020. echo "version string suffix $extra_version"
  5021. fi
  5022. echo "big-endian ${bigendian-no}"
  5023. echo "runtime cpu detection ${runtime_cpudetect-no}"
  5024. if enabled x86; then
  5025. echo "${yasmexe} ${yasm-no}"
  5026. echo "MMX enabled ${mmx-no}"
  5027. echo "MMXEXT enabled ${mmxext-no}"
  5028. echo "3DNow! enabled ${amd3dnow-no}"
  5029. echo "3DNow! extended enabled ${amd3dnowext-no}"
  5030. echo "SSE enabled ${sse-no}"
  5031. echo "SSSE3 enabled ${ssse3-no}"
  5032. echo "AVX enabled ${avx-no}"
  5033. echo "XOP enabled ${xop-no}"
  5034. echo "FMA3 enabled ${fma3-no}"
  5035. echo "FMA4 enabled ${fma4-no}"
  5036. echo "i686 features enabled ${i686-no}"
  5037. echo "CMOV is fast ${fast_cmov-no}"
  5038. echo "EBX available ${ebx_available-no}"
  5039. echo "EBP available ${ebp_available-no}"
  5040. fi
  5041. if enabled aarch64; then
  5042. echo "NEON enabled ${neon-no}"
  5043. echo "VFP enabled ${vfp-no}"
  5044. fi
  5045. if enabled arm; then
  5046. echo "ARMv5TE enabled ${armv5te-no}"
  5047. echo "ARMv6 enabled ${armv6-no}"
  5048. echo "ARMv6T2 enabled ${armv6t2-no}"
  5049. echo "VFP enabled ${vfp-no}"
  5050. echo "NEON enabled ${neon-no}"
  5051. echo "THUMB enabled ${thumb-no}"
  5052. fi
  5053. if enabled mips; then
  5054. echo "MIPS FPU enabled ${mipsfpu-no}"
  5055. echo "MIPS DSP R1 enabled ${mipsdspr1-no}"
  5056. echo "MIPS DSP R2 enabled ${mipsdspr2-no}"
  5057. fi
  5058. if enabled ppc; then
  5059. echo "AltiVec enabled ${altivec-no}"
  5060. echo "PPC 4xx optimizations ${ppc4xx-no}"
  5061. echo "PPC VSX optimizations ${vsx-no}"
  5062. echo "dcbzl available ${dcbzl-no}"
  5063. fi
  5064. echo "debug symbols ${debug-no}"
  5065. echo "strip symbols ${stripping-no}"
  5066. echo "optimize for size ${small-no}"
  5067. echo "optimizations ${optimizations-no}"
  5068. echo "static ${static-no}"
  5069. echo "shared ${shared-no}"
  5070. echo "postprocessing support ${postproc-no}"
  5071. echo "new filter support ${avfilter-no}"
  5072. echo "network support ${network-no}"
  5073. echo "threading support ${thread_type-no}"
  5074. echo "safe bitstream reader ${safe_bitstream_reader-no}"
  5075. echo "SDL support ${sdl-no}"
  5076. echo "opencl enabled ${opencl-no}"
  5077. echo "texi2html enabled ${texi2html-no}"
  5078. echo "perl enabled ${perl-no}"
  5079. echo "pod2man enabled ${pod2man-no}"
  5080. echo "makeinfo enabled ${makeinfo-no}"
  5081. echo "makeinfo supports HTML ${makeinfo_html-no}"
  5082. test -n "$random_seed" &&
  5083. echo "random seed ${random_seed}"
  5084. echo
  5085. echo "External libraries:"
  5086. print_enabled '' $EXTERNAL_LIBRARY_LIST | print_3_columns
  5087. echo
  5088. for type in decoder encoder hwaccel parser demuxer muxer protocol filter bsf indev outdev; do
  5089. echo "Enabled ${type}s:"
  5090. eval list=\$$(toupper $type)_LIST
  5091. print_enabled '_*' $list | print_3_columns
  5092. echo
  5093. done
  5094. license="LGPL version 2.1 or later"
  5095. if enabled nonfree; then
  5096. license="nonfree and unredistributable"
  5097. elif enabled gplv3; then
  5098. license="GPL version 3 or later"
  5099. elif enabled lgplv3; then
  5100. license="LGPL version 3 or later"
  5101. elif enabled gpl; then
  5102. license="GPL version 2 or later"
  5103. fi
  5104. echo "License: $license"
  5105. echo "Creating config.mak, config.h, and doc/config.texi..."
  5106. test -e Makefile || echo "include $source_path/Makefile" > Makefile
  5107. enabled stripping || strip="echo skipping strip"
  5108. config_files="$TMPH config.mak doc/config.texi"
  5109. cat > config.mak <<EOF
  5110. # Automatically generated by configure - do not modify!
  5111. ifndef FFMPEG_CONFIG_MAK
  5112. FFMPEG_CONFIG_MAK=1
  5113. FFMPEG_CONFIGURATION=$FFMPEG_CONFIGURATION
  5114. prefix=$prefix
  5115. LIBDIR=\$(DESTDIR)$libdir
  5116. SHLIBDIR=\$(DESTDIR)$shlibdir
  5117. INCDIR=\$(DESTDIR)$incdir
  5118. BINDIR=\$(DESTDIR)$bindir
  5119. DATADIR=\$(DESTDIR)$datadir
  5120. DOCDIR=\$(DESTDIR)$docdir
  5121. MANDIR=\$(DESTDIR)$mandir
  5122. SRC_PATH=$source_path
  5123. ifndef MAIN_MAKEFILE
  5124. SRC_PATH:=\$(SRC_PATH:.%=..%)
  5125. endif
  5126. CC_IDENT=$cc_ident
  5127. ARCH=$arch
  5128. INTRINSICS=$intrinsics
  5129. CC=$cc
  5130. CXX=$cxx
  5131. AS=$as
  5132. LD=$ld
  5133. DEPCC=$dep_cc
  5134. DEPCCFLAGS=$DEPCCFLAGS \$(CPPFLAGS)
  5135. DEPAS=$as
  5136. DEPASFLAGS=$DEPASFLAGS \$(CPPFLAGS)
  5137. YASM=$yasmexe
  5138. DEPYASM=$yasmexe
  5139. AR=$ar
  5140. ARFLAGS=$arflags
  5141. AR_O=$ar_o
  5142. RANLIB=$ranlib
  5143. STRIP=$strip
  5144. CP=cp -p
  5145. LN_S=$ln_s
  5146. CPPFLAGS=$CPPFLAGS
  5147. CFLAGS=$CFLAGS
  5148. CXXFLAGS=$CXXFLAGS
  5149. ASFLAGS=$ASFLAGS
  5150. AS_C=$AS_C
  5151. AS_O=$AS_O
  5152. CC_C=$CC_C
  5153. CC_E=$CC_E
  5154. CC_O=$CC_O
  5155. CXX_C=$CXX_C
  5156. CXX_O=$CXX_O
  5157. LD_O=$LD_O
  5158. LD_LIB=$LD_LIB
  5159. LD_PATH=$LD_PATH
  5160. DLLTOOL=$dlltool
  5161. WINDRES=$windres
  5162. DEPWINDRES=$dep_cc
  5163. DOXYGEN=$doxygen
  5164. LDFLAGS=$LDFLAGS
  5165. LDEXEFLAGS=$LDEXEFLAGS
  5166. SHFLAGS=$(echo $($ldflags_filter $SHFLAGS))
  5167. ASMSTRIPFLAGS=$ASMSTRIPFLAGS
  5168. YASMFLAGS=$YASMFLAGS
  5169. BUILDSUF=$build_suffix
  5170. PROGSSUF=$progs_suffix
  5171. FULLNAME=$FULLNAME
  5172. LIBPREF=$LIBPREF
  5173. LIBSUF=$LIBSUF
  5174. LIBNAME=$LIBNAME
  5175. SLIBPREF=$SLIBPREF
  5176. SLIBSUF=$SLIBSUF
  5177. EXESUF=$EXESUF
  5178. EXTRA_VERSION=$extra_version
  5179. CCDEP=$CCDEP
  5180. CXXDEP=$CXXDEP
  5181. CCDEP_FLAGS=$CCDEP_FLAGS
  5182. ASDEP=$ASDEP
  5183. ASDEP_FLAGS=$ASDEP_FLAGS
  5184. CC_DEPFLAGS=$CC_DEPFLAGS
  5185. AS_DEPFLAGS=$AS_DEPFLAGS
  5186. HOSTCC=$host_cc
  5187. HOSTLD=$host_ld
  5188. HOSTCFLAGS=$host_cflags
  5189. HOSTCPPFLAGS=$host_cppflags
  5190. HOSTEXESUF=$HOSTEXESUF
  5191. HOSTLDFLAGS=$host_ldflags
  5192. HOSTLIBS=$host_libs
  5193. DEPHOSTCC=$host_cc
  5194. DEPHOSTCCFLAGS=$DEPHOSTCCFLAGS \$(HOSTCCFLAGS)
  5195. HOSTCCDEP=$HOSTCCDEP
  5196. HOSTCCDEP_FLAGS=$HOSTCCDEP_FLAGS
  5197. HOSTCC_DEPFLAGS=$HOSTCC_DEPFLAGS
  5198. HOSTCC_C=$HOSTCC_C
  5199. HOSTCC_O=$HOSTCC_O
  5200. HOSTLD_O=$HOSTLD_O
  5201. TARGET_EXEC=$target_exec $target_exec_args
  5202. TARGET_PATH=$target_path
  5203. TARGET_SAMPLES=${target_samples:-\$(SAMPLES)}
  5204. CFLAGS-ffplay=$sdl_cflags
  5205. ZLIB=$($ldflags_filter -lz)
  5206. LIB_INSTALL_EXTRA_CMD=$LIB_INSTALL_EXTRA_CMD
  5207. EXTRALIBS=$extralibs
  5208. COMPAT_OBJS=$compat_objs
  5209. EXEOBJS=$exeobjs
  5210. INSTALL=$install
  5211. LIBTARGET=${LIBTARGET}
  5212. SLIBNAME=${SLIBNAME}
  5213. SLIBNAME_WITH_VERSION=${SLIBNAME_WITH_VERSION}
  5214. SLIBNAME_WITH_MAJOR=${SLIBNAME_WITH_MAJOR}
  5215. SLIB_CREATE_DEF_CMD=${SLIB_CREATE_DEF_CMD}
  5216. SLIB_EXTRA_CMD=${SLIB_EXTRA_CMD}
  5217. SLIB_INSTALL_NAME=${SLIB_INSTALL_NAME}
  5218. SLIB_INSTALL_LINKS=${SLIB_INSTALL_LINKS}
  5219. SLIB_INSTALL_EXTRA_LIB=${SLIB_INSTALL_EXTRA_LIB}
  5220. SLIB_INSTALL_EXTRA_SHLIB=${SLIB_INSTALL_EXTRA_SHLIB}
  5221. SAMPLES:=${samples:-\$(FATE_SAMPLES)}
  5222. NOREDZONE_FLAGS=$noredzone_flags
  5223. EOF
  5224. get_version(){
  5225. lcname=lib${1}
  5226. name=$(toupper $lcname)
  5227. file=$source_path/$lcname/version.h
  5228. eval $(awk "/#define ${name}_VERSION_M/ { print \$2 \"=\" \$3 }" "$file")
  5229. enabled raise_major && eval ${name}_VERSION_MAJOR=$((${name}_VERSION_MAJOR+100))
  5230. eval ${name}_VERSION=\$${name}_VERSION_MAJOR.\$${name}_VERSION_MINOR.\$${name}_VERSION_MICRO
  5231. eval echo "${lcname}_VERSION=\$${name}_VERSION" >> config.mak
  5232. eval echo "${lcname}_VERSION_MAJOR=\$${name}_VERSION_MAJOR" >> config.mak
  5233. eval echo "${lcname}_VERSION_MINOR=\$${name}_VERSION_MINOR" >> config.mak
  5234. }
  5235. map 'get_version $v' $LIBRARY_LIST
  5236. map 'eval echo "${v}_FFLIBS=\$${v}_deps" >> config.mak' $LIBRARY_LIST
  5237. print_program_libs(){
  5238. eval "program_libs=\$${1}_libs"
  5239. eval echo "LIBS-${1}=${program_libs}" >> config.mak
  5240. }
  5241. map 'print_program_libs $v' $PROGRAM_LIST
  5242. cat > $TMPH <<EOF
  5243. /* Automatically generated by configure - do not modify! */
  5244. #ifndef FFMPEG_CONFIG_H
  5245. #define FFMPEG_CONFIG_H
  5246. #define FFMPEG_CONFIGURATION "$(c_escape $FFMPEG_CONFIGURATION)"
  5247. #define FFMPEG_LICENSE "$(c_escape $license)"
  5248. #define CONFIG_THIS_YEAR 2015
  5249. #define FFMPEG_DATADIR "$(eval c_escape $datadir)"
  5250. #define AVCONV_DATADIR "$(eval c_escape $datadir)"
  5251. #define CC_IDENT "$(c_escape ${cc_ident:-Unknown compiler})"
  5252. #define av_restrict $_restrict
  5253. #define EXTERN_PREFIX "${extern_prefix}"
  5254. #define EXTERN_ASM ${extern_prefix}
  5255. #define BUILDSUF "$build_suffix"
  5256. #define SLIBSUF "$SLIBSUF"
  5257. #define HAVE_MMX2 HAVE_MMXEXT
  5258. #define SWS_MAX_FILTER_SIZE $sws_max_filter_size
  5259. EOF
  5260. test -n "$assert_level" &&
  5261. echo "#define ASSERT_LEVEL $assert_level" >>$TMPH
  5262. test -n "$malloc_prefix" &&
  5263. echo "#define MALLOC_PREFIX $malloc_prefix" >>$TMPH
  5264. if enabled yasm; then
  5265. append config_files $TMPASM
  5266. printf '' >$TMPASM
  5267. fi
  5268. enabled getenv || echo "#define getenv(x) NULL" >> $TMPH
  5269. mkdir -p doc
  5270. mkdir -p tests
  5271. echo "@c auto-generated by configure" > doc/config.texi
  5272. print_config ARCH_ "$config_files" $ARCH_LIST
  5273. print_config HAVE_ "$config_files" $HAVE_LIST
  5274. print_config CONFIG_ "$config_files" $CONFIG_LIST \
  5275. $CONFIG_EXTRA \
  5276. $ALL_COMPONENTS \
  5277. echo "#endif /* FFMPEG_CONFIG_H */" >> $TMPH
  5278. echo "endif # FFMPEG_CONFIG_MAK" >> config.mak
  5279. # Do not overwrite an unchanged config.h to avoid superfluous rebuilds.
  5280. cp_if_changed $TMPH config.h
  5281. touch .config
  5282. enabled yasm && cp_if_changed $TMPASM config.asm
  5283. cat > $TMPH <<EOF
  5284. /* Generated by ffconf */
  5285. #ifndef AVUTIL_AVCONFIG_H
  5286. #define AVUTIL_AVCONFIG_H
  5287. EOF
  5288. print_config AV_HAVE_ $TMPH $HAVE_LIST_PUB
  5289. echo "#endif /* AVUTIL_AVCONFIG_H */" >> $TMPH
  5290. cp_if_changed $TMPH libavutil/avconfig.h
  5291. if test -n "$WARNINGS"; then
  5292. printf "\n$WARNINGS"
  5293. enabled fatal_warnings && exit 1
  5294. fi
  5295. # build pkg-config files
  5296. lib_version(){
  5297. eval printf "\"lib${1}${build_suffix} >= \$LIB$(toupper ${1})_VERSION, \""
  5298. }
  5299. pkgconfig_generate(){
  5300. name=$1
  5301. shortname=${name#lib}${build_suffix}
  5302. comment=$2
  5303. version=$3
  5304. libs=$4
  5305. requires=$(map 'lib_version $v' $(eval echo \$${name#lib}_deps))
  5306. requires=${requires%, }
  5307. enabled ${name#lib} || return 0
  5308. mkdir -p $name
  5309. cat <<EOF > $name/$name${build_suffix}.pc
  5310. prefix=$prefix
  5311. exec_prefix=\${prefix}
  5312. libdir=$libdir
  5313. includedir=$incdir
  5314. Name: $name
  5315. Description: $comment
  5316. Version: $version
  5317. Requires: $(enabled shared || echo $requires)
  5318. Requires.private: $(enabled shared && echo $requires)
  5319. Conflicts:
  5320. Libs: -L\${libdir} $(enabled rpath && echo "-Wl,-rpath,\${libdir}") -l${shortname} $(enabled shared || echo $libs)
  5321. Libs.private: $(enabled shared && echo $libs)
  5322. Cflags: -I\${includedir}
  5323. EOF
  5324. mkdir -p doc/examples/pc-uninstalled
  5325. includedir=${source_path}
  5326. [ "$includedir" = . ] && includedir="\${pcfiledir}/../../.."
  5327. cat <<EOF > doc/examples/pc-uninstalled/$name.pc
  5328. prefix=
  5329. exec_prefix=
  5330. libdir=\${pcfiledir}/../../../$name
  5331. includedir=${includedir}
  5332. Name: $name
  5333. Description: $comment
  5334. Version: $version
  5335. Requires: $requires
  5336. Conflicts:
  5337. Libs: -L\${libdir} -Wl,-rpath,\${libdir} -l${shortname} $(enabled shared || echo $libs)
  5338. Cflags: -I\${includedir}
  5339. EOF
  5340. }
  5341. pkgconfig_generate libavutil "FFmpeg utility library" "$LIBAVUTIL_VERSION" "$LIBRT $LIBM"
  5342. pkgconfig_generate libavcodec "FFmpeg codec library" "$LIBAVCODEC_VERSION" "$extralibs"
  5343. pkgconfig_generate libavformat "FFmpeg container format library" "$LIBAVFORMAT_VERSION" "$extralibs"
  5344. pkgconfig_generate libavdevice "FFmpeg device handling library" "$LIBAVDEVICE_VERSION" "$extralibs"
  5345. pkgconfig_generate libavfilter "FFmpeg audio/video filtering library" "$LIBAVFILTER_VERSION" "$extralibs"
  5346. pkgconfig_generate libpostproc "FFmpeg postprocessing library" "$LIBPOSTPROC_VERSION" ""
  5347. pkgconfig_generate libavresample "Libav audio resampling library" "$LIBAVRESAMPLE_VERSION" "$LIBM"
  5348. pkgconfig_generate libswscale "FFmpeg image rescaling library" "$LIBSWSCALE_VERSION" "$LIBM"
  5349. pkgconfig_generate libswresample "FFmpeg audio resampling library" "$LIBSWRESAMPLE_VERSION" "$LIBM"