Skip to content

Commit a727bba

Browse files
committed
Revert "Removing the baked in libuv."
This reverts commit df30663.
1 parent e8519b5 commit a727bba

File tree

286 files changed

+142036
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

286 files changed

+142036
-0
lines changed

src/rt/libuv/.gitignore

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
*.swp
2+
*.o
3+
*.lo
4+
*.la
5+
*.a
6+
*.opensdf
7+
*.orig
8+
*.sdf
9+
*.suo
10+
/out/
11+
/build/gyp
12+
13+
/test/run-tests
14+
/test/run-tests.exe
15+
/test/run-tests.dSYM
16+
/test/run-benchmarks
17+
/test/run-benchmarks.exe
18+
/test/run-benchmarks.dSYM
19+
20+
*.sln
21+
*.vcproj
22+
*.vcxproj
23+
*.vcxproj.filters
24+
*.vcxproj.user
25+
_UpgradeReport_Files/
26+
UpgradeLog*.XML
27+
Debug
28+
Release
29+
ipch

src/rt/libuv/.mailmap

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# update AUTHORS with:
2+
# git log --all --reverse --format='%aN <%aE>' | perl -ne 'BEGIN{print "# Authors ordered by first contribution.\n"} print unless $h{$_}; $h{$_} = 1' > AUTHORS
3+
4+
5+
6+
7+
San-Tai Hsu <[email protected]>
8+
Isaac Z. Schlueter <[email protected]>
9+
Saúl Ibarra Corretgé <[email protected]>
10+
Yuki OKUMURA <[email protected]>

src/rt/libuv/AUTHORS

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# Authors ordered by first contribution.
2+
Ryan Dahl <[email protected]>
3+
Bert Belder <[email protected]>
4+
Josh Roesslein <[email protected]>
5+
Alan Gutierrez <[email protected]>
6+
Joshua Peek <[email protected]>
7+
Igor Zinkovsky <[email protected]>
8+
San-Tai Hsu <[email protected]>
9+
Ben Noordhuis <[email protected]>
10+
Henry Rawas <[email protected]>
11+
Robert Mustacchi <[email protected]>
12+
Matt Stevens <[email protected]>
13+
Paul Querna <[email protected]>
14+
Shigeki Ohtsu <[email protected]>
15+
Tom Hughes <[email protected]>
16+
Peter Bright <[email protected]>
17+
Jeroen Janssen <[email protected]>
18+
Andrea Lattuada <[email protected]>
19+
Augusto Henrique Hentz <[email protected]>
20+
Clifford Heath <[email protected]>
21+
Jorge Chamorro Bieling <[email protected]>
22+
Luis Lavena <[email protected]>
23+
Matthew Sporleder <[email protected]>
24+
Erick Tryzelaar <[email protected]>
25+
Isaac Z. Schlueter <[email protected]>
26+
Pieter Noordhuis <[email protected]>
27+
Marek Jelen <[email protected]>
28+
Fedor Indutny <[email protected]>
29+
Saúl Ibarra Corretgé <[email protected]>
30+
Felix Geisendörfer <[email protected]>
31+
Yuki OKUMURA <[email protected]>
32+
Roman Shtylman <[email protected]>
33+
Frank DENIS <[email protected]>

src/rt/libuv/LICENSE

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
libuv is part of the Node project: http://nodejs.org/
2+
libuv may be distributed alone under Node's license:
3+
4+
====
5+
6+
Copyright Joyent, Inc. and other Node contributors. All rights reserved.
7+
Permission is hereby granted, free of charge, to any person obtaining a copy
8+
of this software and associated documentation files (the "Software"), to
9+
deal in the Software without restriction, including without limitation the
10+
rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
11+
sell copies of the Software, and to permit persons to whom the Software is
12+
furnished to do so, subject to the following conditions:
13+
14+
The above copyright notice and this permission notice shall be included in
15+
all copies or substantial portions of the Software.
16+
17+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
22+
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
23+
IN THE SOFTWARE.
24+
25+
====
26+
27+
This license applies to all parts of libuv that are not externally
28+
maintained libraries.
29+
30+
The externally maintained libraries used by libuv are:
31+
32+
- tree.h (from FreeBSD), copyright Niels Provos. Two clause BSD license.
33+
34+
- ngx_queue.h (from Nginx), copyright Igor Sysoev. Two clause BSD license.
35+
36+
- libev, located at ev/ is copyright Marc Alexander Lehmann, and
37+
dual-licensed under the MIT license and GPL2.
38+
39+
- libeio, located at eio/ is copyright Marc Alexander Lehmann, and
40+
dual-licensed under the MIT license and GPL2.

src/rt/libuv/Makefile

+119
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,119 @@
1+
# Copyright Joyent, Inc. and other Node contributors. All rights reserved.
2+
#
3+
# Permission is hereby granted, free of charge, to any person obtaining a copy
4+
# of this software and associated documentation files (the "Software"), to
5+
# deal in the Software without restriction, including without limitation the
6+
# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
7+
# sell copies of the Software, and to permit persons to whom the Software is
8+
# furnished to do so, subject to the following conditions:
9+
#
10+
# The above copyright notice and this permission notice shall be included in
11+
# all copies or substantial portions of the Software.
12+
#
13+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
18+
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
19+
# IN THE SOFTWARE.
20+
21+
uname_S := $(shell sh -c 'uname -s 2>/dev/null || echo not')
22+
23+
ifdef MSVC
24+
uname_S := MINGW
25+
endif
26+
27+
CPPFLAGS += -Iinclude -Iinclude/uv-private
28+
29+
CARES_OBJS =
30+
CARES_OBJS += src/ares/ares__close_sockets.o
31+
CARES_OBJS += src/ares/ares__get_hostent.o
32+
CARES_OBJS += src/ares/ares__read_line.o
33+
CARES_OBJS += src/ares/ares__timeval.o
34+
CARES_OBJS += src/ares/ares_cancel.o
35+
CARES_OBJS += src/ares/ares_data.o
36+
CARES_OBJS += src/ares/ares_destroy.o
37+
CARES_OBJS += src/ares/ares_expand_name.o
38+
CARES_OBJS += src/ares/ares_expand_string.o
39+
CARES_OBJS += src/ares/ares_fds.o
40+
CARES_OBJS += src/ares/ares_free_hostent.o
41+
CARES_OBJS += src/ares/ares_free_string.o
42+
CARES_OBJS += src/ares/ares_gethostbyaddr.o
43+
CARES_OBJS += src/ares/ares_gethostbyname.o
44+
CARES_OBJS += src/ares/ares_getnameinfo.o
45+
CARES_OBJS += src/ares/ares_getopt.o
46+
CARES_OBJS += src/ares/ares_getsock.o
47+
CARES_OBJS += src/ares/ares_init.o
48+
CARES_OBJS += src/ares/ares_library_init.o
49+
CARES_OBJS += src/ares/ares_llist.o
50+
CARES_OBJS += src/ares/ares_mkquery.o
51+
CARES_OBJS += src/ares/ares_nowarn.o
52+
CARES_OBJS += src/ares/ares_options.o
53+
CARES_OBJS += src/ares/ares_parse_a_reply.o
54+
CARES_OBJS += src/ares/ares_parse_aaaa_reply.o
55+
CARES_OBJS += src/ares/ares_parse_mx_reply.o
56+
CARES_OBJS += src/ares/ares_parse_ns_reply.o
57+
CARES_OBJS += src/ares/ares_parse_ptr_reply.o
58+
CARES_OBJS += src/ares/ares_parse_srv_reply.o
59+
CARES_OBJS += src/ares/ares_parse_txt_reply.o
60+
CARES_OBJS += src/ares/ares_process.o
61+
CARES_OBJS += src/ares/ares_query.o
62+
CARES_OBJS += src/ares/ares_search.o
63+
CARES_OBJS += src/ares/ares_send.o
64+
CARES_OBJS += src/ares/ares_strcasecmp.o
65+
CARES_OBJS += src/ares/ares_strdup.o
66+
CARES_OBJS += src/ares/ares_strerror.o
67+
CARES_OBJS += src/ares/ares_timeout.o
68+
CARES_OBJS += src/ares/ares_version.o
69+
CARES_OBJS += src/ares/ares_writev.o
70+
CARES_OBJS += src/ares/bitncmp.o
71+
CARES_OBJS += src/ares/inet_net_pton.o
72+
CARES_OBJS += src/ares/inet_ntop.o
73+
74+
ifneq (,$(findstring MINGW,$(uname_S)))
75+
include config-mingw.mk
76+
else
77+
include config-unix.mk
78+
endif
79+
80+
TESTS=test/blackhole-server.c test/echo-server.c test/test-*.c
81+
BENCHMARKS=test/blackhole-server.c test/echo-server.c test/dns-server.c test/benchmark-*.c
82+
83+
all: uv.a
84+
85+
$(CARES_OBJS): %.o: %.c
86+
$(CC) -o $*.o -c $(CFLAGS) $(CPPFLAGS) $< -DHAVE_CONFIG_H
87+
88+
test/run-tests$(E): test/*.h test/run-tests.c $(RUNNER_SRC) test/runner-unix.c $(TESTS) uv.a
89+
$(CC) $(CPPFLAGS) $(RUNNER_CFLAGS) -o test/run-tests test/run-tests.c \
90+
test/runner.c $(RUNNER_SRC) $(TESTS) uv.a $(RUNNER_LIBS) $(RUNNER_LINKFLAGS)
91+
92+
test/run-benchmarks$(E): test/*.h test/run-benchmarks.c test/runner.c $(RUNNER_SRC) $(BENCHMARKS) uv.a
93+
$(CC) $(CPPFLAGS) $(RUNNER_CFLAGS) -o test/run-benchmarks test/run-benchmarks.c \
94+
test/runner.c $(RUNNER_SRC) $(BENCHMARKS) uv.a $(RUNNER_LIBS) $(RUNNER_LINKFLAGS)
95+
96+
test/echo.o: test/echo.c test/echo.h
97+
$(CC) $(CPPFLAGS) $(CFLAGS) -c test/echo.c -o test/echo.o
98+
99+
100+
.PHONY: clean clean-platform distclean distclean-platform test bench
101+
102+
103+
test: test/run-tests$(E)
104+
test/run-tests
105+
106+
#test-%: test/run-tests$(E)
107+
# test/run-tests $(@:test-%=%)
108+
109+
bench: test/run-benchmarks$(E)
110+
test/run-benchmarks
111+
112+
#bench-%: test/run-benchmarks$(E)
113+
# test/run-benchmarks $(@:bench-%=%)
114+
115+
clean: clean-platform
116+
$(RM) -f src/*.o *.a test/run-tests$(E) test/run-benchmarks$(E)
117+
118+
distclean: distclean-platform
119+
$(RM) -f src/*.o *.a test/run-tests$(E) test/run-benchmarks$(E)

src/rt/libuv/README.md

+88
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
# libuv
2+
3+
libuv is a new platform layer for Node. Its purpose is to abstract IOCP on
4+
windows and libev on Unix systems. We intend to eventually contain all
5+
platform differences in this library.
6+
7+
http://nodejs.org/
8+
9+
## Features
10+
11+
* Non-blocking TCP sockets
12+
13+
* Non-blocking named pipes
14+
15+
* UDP
16+
17+
* Timers
18+
19+
* Child process spawning
20+
21+
* Asynchronous DNS via c-ares or `uv_getaddrinfo`.
22+
23+
* Asynchronous file system APIs `uv_fs_*`
24+
25+
* High resolution time `uv_hrtime`
26+
27+
* Current executable path look up `uv_exepath`
28+
29+
* Thread pool scheduling `uv_queue_work`
30+
31+
* ANSI escape code controlled TTY `uv_tty_t`
32+
33+
* File system events Currently supports inotify, `ReadDirectoryChangesW`
34+
and kqueue. Event ports in the near future.
35+
`uv_fs_event_t`
36+
37+
* IPC and socket sharing between processes `uv_write2`
38+
39+
40+
## Documentation
41+
42+
See `include/uv.h`.
43+
44+
45+
## Build Instructions
46+
47+
For GCC (including MinGW) there are two methods building: via normal
48+
makefiles or via GYP. GYP is a meta-build system which can generate MSVS,
49+
Makefile, and XCode backends. It is best used for integration into other
50+
projects. The old (more stable) system is using Makefiles.
51+
52+
To build via Makefile simply execute:
53+
54+
make
55+
56+
To build with Visual Studio run the vcbuilds.bat file which will
57+
checkout the GYP code into build/gyp and generate the uv.sln and
58+
related files.
59+
60+
Windows users can also build from cmd-line using msbuild. This is
61+
done by running vcbuild.bat from Visual Studio command prompt.
62+
63+
To have GYP generate build script for another system you will need to
64+
checkout GYP into the project tree manually:
65+
66+
svn co http://gyp.googlecode.com/svn/trunk build/gyp
67+
68+
Unix users run
69+
70+
./gyp_uv -f make
71+
make
72+
73+
Macintosh users run
74+
75+
./gyp_uv -f xcode
76+
xcodebuild -project uv.xcodeproj -configuration Release -target All
77+
78+
79+
## Supported Platforms
80+
81+
Microsoft Windows operating systems since Windows XP SP2. It can be built
82+
with either Visual Studio or MinGW.
83+
84+
Linux 2.6 using the GCC toolchain.
85+
86+
MacOS using the GCC or XCode toolchain.
87+
88+
Solaris 121 and later using GCC toolchain.

src/rt/libuv/build/gcc_version.py

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#!/usr/bin/env python
2+
3+
import os
4+
import re
5+
import subprocess
6+
import sys
7+
8+
9+
def DoMain(*args):
10+
cc = os.environ.get('CC', 'gcc')
11+
stdin, stderr = os.pipe()
12+
subprocess.call([cc, '-v'], stderr=stderr)
13+
output = os.read(stdin, 4096)
14+
match = re.search("\ngcc version (\d+\.\d+\.\d+)", output)
15+
if match:
16+
print(match.group(1))
17+
18+
19+
if __name__ == '__main__':
20+
DoMain(*sys.argv)

0 commit comments

Comments
 (0)