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.

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