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.

5658 lines
174KB

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