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.

6171 lines
194KB

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