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.

5885 lines
183KB

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