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.

5707 lines
176KB

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