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.

5913 lines
185KB

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