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.

5703 lines
176KB

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