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.

5820 lines
181KB

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