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.

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