Mercurial > hg > Members > anatofuz > MoarVM
comparison 3rdparty/libuv/README.md @ 0:2cf249471370
convert mercurial for git
author | Takahiro SHIMIZU <anatofuz@cr.ie.u-ryukyu.ac.jp> |
---|---|
date | Tue, 08 May 2018 16:09:12 +0900 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:2cf249471370 |
---|---|
1 ![libuv][libuv_banner] | |
2 | |
3 ## Overview | |
4 | |
5 libuv is a multi-platform support library with a focus on asynchronous I/O. It | |
6 was primarily developed for use by [Node.js][], but it's also | |
7 used by [Luvit](http://luvit.io/), [Julia](http://julialang.org/), | |
8 [pyuv](https://github.com/saghul/pyuv), and [others](https://github.com/libuv/libuv/wiki/Projects-that-use-libuv). | |
9 | |
10 ## Feature highlights | |
11 | |
12 * Full-featured event loop backed by epoll, kqueue, IOCP, event ports. | |
13 | |
14 * Asynchronous TCP and UDP sockets | |
15 | |
16 * Asynchronous DNS resolution | |
17 | |
18 * Asynchronous file and file system operations | |
19 | |
20 * File system events | |
21 | |
22 * ANSI escape code controlled TTY | |
23 | |
24 * IPC with socket sharing, using Unix domain sockets or named pipes (Windows) | |
25 | |
26 * Child processes | |
27 | |
28 * Thread pool | |
29 | |
30 * Signal handling | |
31 | |
32 * High resolution clock | |
33 | |
34 * Threading and synchronization primitives | |
35 | |
36 ## Versioning | |
37 | |
38 Starting with version 1.0.0 libuv follows the [semantic versioning](http://semver.org/) | |
39 scheme. The API change and backwards compatibility rules are those indicated by | |
40 SemVer. libuv will keep a stable ABI across major releases. | |
41 | |
42 The ABI/API changes can be tracked [here](http://abi-laboratory.pro/tracker/timeline/libuv/). | |
43 | |
44 ## Licensing | |
45 | |
46 libuv is licensed under the MIT license. Check the [LICENSE file](LICENSE). | |
47 The documentation is licensed under the CC BY 4.0 license. Check the [LICENSE-docs file](LICENSE-docs). | |
48 | |
49 ## Community | |
50 | |
51 * [Support](https://github.com/libuv/help) | |
52 * [Mailing list](http://groups.google.com/group/libuv) | |
53 * [IRC chatroom (#libuv@irc.freenode.org)](http://webchat.freenode.net?channels=libuv&uio=d4) | |
54 | |
55 ## Documentation | |
56 | |
57 ### Official documentation | |
58 | |
59 Located in the docs/ subdirectory. It uses the [Sphinx](http://sphinx-doc.org/) | |
60 framework, which makes it possible to build the documentation in multiple | |
61 formats. | |
62 | |
63 Show different supported building options: | |
64 | |
65 ```bash | |
66 $ make help | |
67 ``` | |
68 | |
69 Build documentation as HTML: | |
70 | |
71 ```bash | |
72 $ make html | |
73 ``` | |
74 | |
75 Build documentation as HTML and live reload it when it changes (this requires | |
76 sphinx-autobuild to be installed and is only supported on Unix): | |
77 | |
78 ```bash | |
79 $ make livehtml | |
80 ``` | |
81 | |
82 Build documentation as man pages: | |
83 | |
84 ```bash | |
85 $ make man | |
86 ``` | |
87 | |
88 Build documentation as ePub: | |
89 | |
90 ```bash | |
91 $ make epub | |
92 ``` | |
93 | |
94 NOTE: Windows users need to use make.bat instead of plain 'make'. | |
95 | |
96 Documentation can be browsed online [here](http://docs.libuv.org). | |
97 | |
98 The [tests and benchmarks](https://github.com/libuv/libuv/tree/master/test) | |
99 also serve as API specification and usage examples. | |
100 | |
101 ### Other resources | |
102 | |
103 * [LXJS 2012 talk](http://www.youtube.com/watch?v=nGn60vDSxQ4) | |
104 — High-level introductory talk about libuv. | |
105 * [libuv-dox](https://github.com/thlorenz/libuv-dox) | |
106 — Documenting types and methods of libuv, mostly by reading uv.h. | |
107 * [learnuv](https://github.com/thlorenz/learnuv) | |
108 — Learn uv for fun and profit, a self guided workshop to libuv. | |
109 | |
110 These resources are not handled by libuv maintainers and might be out of | |
111 date. Please verify it before opening new issues. | |
112 | |
113 ## Downloading | |
114 | |
115 libuv can be downloaded either from the | |
116 [GitHub repository](https://github.com/libuv/libuv) | |
117 or from the [downloads site](http://dist.libuv.org/dist/). | |
118 | |
119 Starting with libuv 1.7.0, binaries for Windows are also provided. This is to | |
120 be considered EXPERIMENTAL. | |
121 | |
122 Before verifying the git tags or signature files, importing the relevant keys | |
123 is necessary. Key IDs are listed in the | |
124 [MAINTAINERS](https://github.com/libuv/libuv/blob/master/MAINTAINERS.md) | |
125 file, but are also available as git blob objects for easier use. | |
126 | |
127 Importing a key the usual way: | |
128 | |
129 ```bash | |
130 $ gpg --keyserver pool.sks-keyservers.net --recv-keys AE9BC059 | |
131 ``` | |
132 | |
133 Importing a key from a git blob object: | |
134 | |
135 ```bash | |
136 $ git show pubkey-saghul | gpg --import | |
137 ``` | |
138 | |
139 ### Verifying releases | |
140 | |
141 Git tags are signed with the developer's key, they can be verified as follows: | |
142 | |
143 ```bash | |
144 $ git verify-tag v1.6.1 | |
145 ``` | |
146 | |
147 Starting with libuv 1.7.0, the tarballs stored in the | |
148 [downloads site](http://dist.libuv.org/dist/) are signed and an accompanying | |
149 signature file sit alongside each. Once both the release tarball and the | |
150 signature file are downloaded, the file can be verified as follows: | |
151 | |
152 ```bash | |
153 $ gpg --verify libuv-1.7.0.tar.gz.sign | |
154 ``` | |
155 | |
156 ## Build Instructions | |
157 | |
158 For GCC there are two build methods: via autotools or via [GYP][]. | |
159 GYP is a meta-build system which can generate MSVS, Makefile, and XCode | |
160 backends. It is best used for integration into other projects. | |
161 | |
162 To build with autotools: | |
163 | |
164 ```bash | |
165 $ sh autogen.sh | |
166 $ ./configure | |
167 $ make | |
168 $ make check | |
169 $ make install | |
170 ``` | |
171 | |
172 ### Windows | |
173 | |
174 Prerequisites: | |
175 | |
176 * [Python 2.6 or 2.7][] as it is required | |
177 by [GYP][]. | |
178 If python is not in your path, set the environment variable `PYTHON` to its | |
179 location. For example: `set PYTHON=C:\Python27\python.exe` | |
180 * One of: | |
181 * [Visual C++ Build Tools][] | |
182 * [Visual Studio 2015 Update 3][], all editions | |
183 including the Community edition (remember to select | |
184 "Common Tools for Visual C++ 2015" feature during installation). | |
185 * [Visual Studio 2017][], any edition (including the Build Tools SKU). | |
186 **Required Components:** "MSbuild", "VC++ 2017 v141 toolset" and one of the | |
187 Windows SDKs (10 or 8.1). | |
188 * Basic Unix tools required for some tests, | |
189 [Git for Windows][] includes Git Bash | |
190 and tools which can be included in the global `PATH`. | |
191 | |
192 To build, launch a git shell (e.g. Cmd or PowerShell), run `vcbuild.bat` | |
193 (to build with VS2017 you need to explicitly add a `vs2017` argument), | |
194 which will checkout the GYP code into `build/gyp`, generate `uv.sln` | |
195 as well as the necesery related project files, and start building. | |
196 | |
197 ```console | |
198 > vcbuild | |
199 ``` | |
200 | |
201 Or: | |
202 | |
203 ```console | |
204 > vcbuild vs2017 | |
205 ``` | |
206 | |
207 To run the tests: | |
208 | |
209 ```console | |
210 > vcbuild test | |
211 ``` | |
212 | |
213 To see all the options that could passed to `vcbuild`: | |
214 | |
215 ```console | |
216 > vcbuild help | |
217 vcbuild.bat [debug/release] [test/bench] [clean] [noprojgen] [nobuild] [vs2017] [x86/x64] [static/shared] | |
218 Examples: | |
219 vcbuild.bat : builds debug build | |
220 vcbuild.bat test : builds debug build and runs tests | |
221 vcbuild.bat release bench: builds release build and runs benchmarks | |
222 ``` | |
223 | |
224 | |
225 ### Unix | |
226 | |
227 For Debug builds (recommended) run: | |
228 | |
229 ```bash | |
230 $ ./gyp_uv.py -f make | |
231 $ make -C out | |
232 ``` | |
233 | |
234 For Release builds run: | |
235 | |
236 ```bash | |
237 $ ./gyp_uv.py -f make | |
238 $ BUILDTYPE=Release make -C out | |
239 ``` | |
240 | |
241 Run `./gyp_uv.py -f make -Dtarget_arch=x32` to build [x32][] binaries. | |
242 | |
243 ### OS X | |
244 | |
245 Run: | |
246 | |
247 ```bash | |
248 $ ./gyp_uv.py -f xcode | |
249 $ xcodebuild -ARCHS="x86_64" -project uv.xcodeproj \ | |
250 -configuration Release -target All | |
251 ``` | |
252 | |
253 Using Homebrew: | |
254 | |
255 ```bash | |
256 $ brew install --HEAD libuv | |
257 ``` | |
258 | |
259 Note to OS X users: | |
260 | |
261 Make sure that you specify the architecture you wish to build for in the | |
262 "ARCHS" flag. You can specify more than one by delimiting with a space | |
263 (e.g. "x86_64 i386"). | |
264 | |
265 ### Android | |
266 | |
267 Run: | |
268 | |
269 ```bash | |
270 $ source ./android-configure NDK_PATH gyp [API_LEVEL] | |
271 $ make -C out | |
272 ``` | |
273 | |
274 The default API level is 24, but a different one can be selected as follows: | |
275 | |
276 ```bash | |
277 $ source ./android-configure ~/android-ndk-r15b gyp 21 | |
278 $ make -C out | |
279 ``` | |
280 | |
281 Note for UNIX users: compile your project with `-D_LARGEFILE_SOURCE` and | |
282 `-D_FILE_OFFSET_BITS=64`. GYP builds take care of that automatically. | |
283 | |
284 ### Using Ninja | |
285 | |
286 To use ninja for build on ninja supported platforms, run: | |
287 | |
288 ```bash | |
289 $ ./gyp_uv.py -f ninja | |
290 $ ninja -C out/Debug #for debug build OR | |
291 $ ninja -C out/Release | |
292 ``` | |
293 | |
294 | |
295 ### Running tests | |
296 | |
297 Run: | |
298 | |
299 ```bash | |
300 $ ./gyp_uv.py -f make | |
301 $ make -C out | |
302 $ ./out/Debug/run-tests | |
303 ``` | |
304 | |
305 ## Supported Platforms | |
306 | |
307 Check the [SUPPORTED_PLATFORMS file](SUPPORTED_PLATFORMS.md). | |
308 | |
309 ### AIX Notes | |
310 | |
311 AIX support for filesystem events requires the non-default IBM `bos.ahafs` | |
312 package to be installed. This package provides the AIX Event Infrastructure | |
313 that is detected by `autoconf`. | |
314 [IBM documentation](http://www.ibm.com/developerworks/aix/library/au-aix_event_infrastructure/) | |
315 describes the package in more detail. | |
316 | |
317 AIX support for filesystem events is not compiled when building with `gyp`. | |
318 | |
319 ## Patches | |
320 | |
321 See the [guidelines for contributing][]. | |
322 | |
323 [node.js]: http://nodejs.org/ | |
324 [GYP]: http://code.google.com/p/gyp/ | |
325 [guidelines for contributing]: https://github.com/libuv/libuv/blob/master/CONTRIBUTING.md | |
326 [libuv_banner]: https://raw.githubusercontent.com/libuv/libuv/master/img/banner.png | |
327 [x32]: https://en.wikipedia.org/wiki/X32_ABI | |
328 [Python 2.6 or 2.7]: https://www.python.org/downloads/ | |
329 [Visual C++ Build Tools]: http://landinghub.visualstudio.com/visual-cpp-build-tools | |
330 [Visual Studio 2015 Update 3]: https://www.visualstudio.com/vs/older-downloads/ | |
331 [Visual Studio 2017]: https://www.visualstudio.com/downloads/ | |
332 [Git for Windows]: http://git-scm.com/download/win |