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.

5840 lines
181KB

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