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.

5697 lines
175KB

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