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.

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