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.

5730 lines
177KB

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