Commit Graph

140 Commits

Author SHA1 Message Date
Campbell He
c7843ecfbc
unix,win: add uv_ip_name to get name from sockaddr (#3368)
uv_ip_name is a kind of wrapper of uv_ip4_name and uv_ip6_name
which can be used after getaddrinfo to get the IP name directly
from addrinfo.ai_addr.
2021-11-25 10:05:15 +01:00
Jameson Nash
b2614a10a5
stream: permit read after seeing EOF (#3361)
On some streams (notably TTYs), it is permitted to continue reading
after getting EOF. So still stop reading on EOF, but allow the user to
reset the stream and try to read again (which may just get EOF).

This relaxes the constraint added in ce15b8405e.
Refs: https://github.com/libuv/libuv/pull/3006
2021-11-24 19:25:47 -05:00
AJ Heller
77e6bd4874
build: fix win build with cmake versions before v3.14 (#3343)
Before v3.14, cmake throws the following error:

```
CMake Error at third_party/libuv/CMakeLists.txt:663 (install):
  install Library TARGETS given no DESTINATION!
```

I confirmed on Windows 7 and Windows Server 2016, with about a dozen
cmake versions between 3.7 and 3.22. I also confirmed that the
DESTINATION `${CMAKE_INSTALL_LIBDIR}` is populated with a valid path.

PR-URL: https://github.com/libuv/libuv/pull/3343
2021-11-02 13:58:25 -04:00
Petr Menšík
172d64bc67
build: install cmake package module
If installed into correct location, libuv can be reused in
CMakeLists.txt by:

find_package(libuv)

PR-URL: https://github.com/libuv/libuv/pull/3293
2021-11-01 13:51:06 -04:00
Jameson Nash
22d6223928
build: add experimental TSAN configuration (#3328) 2021-10-16 12:13:29 +02:00
Jameson Nash
6564ccc900
asan: fix some tests (#3323)
Previously they were just being run incorrectly, but nothing wrong with
the test itself. We were also interpreting an ASAN failure as TEST_SKIP,
so test failures would not actually be reported as CI failures.
2021-10-10 00:57:43 +02:00
Darshan Sen
c852be467e
test: remove dns-server.c as it is not used anywhere (#3313)
Signed-off-by: Darshan Sen <darshan.sen@postman.com>
2021-10-09 14:32:31 +02:00
Sylvain Corlay
66a3053e70
cmake: use standard installation layout always
Fixes: https://github.com/libuv/libuv/issues/3074
PR-URL: https://github.com/libuv/libuv/pull/3084
Reviewed-By: Jameson Nash <vtjnash@gmail.com>
2021-09-08 10:37:12 -04:00
Andy Fiddaman
7b18d0aa15
sunos,cmake: use thread-safe errno
On illumos, the global errno variable is not thread-safe by default,
requiring that the application be built with gcc's -pthread option, or
that it defines -D_REENTRANT.

This was done already for the autotools build, but not for CMake.

PR-URL: https://github.com/libuv/libuv/pull/3243
Reviewed-By: Jameson Nash <vtjnash@gmail.com>
2021-07-19 22:27:40 -04:00
Andy Fiddaman
5fe597268e
sunos: restore use of event ports
The sunos platform currently covers at least the Solaris and illumos
operating systems. Although these diverged 11 years ago they still share
some common features such as support for event ports.

illumos also has a compatibility wrapper for epoll but this is not
recommended for use over event ports. From the NOTES section of
https://illumos.org/man/5/epoll:

	The epoll facility is implemented for purposes of offering
	compatibility to and portability of Linux-borne
	applications; native applications should continue to prefer
	using event ports... In particular, use of epoll in a
	multithreaded environment is fraught with peril...

Restore the event ports code so that libuv can continue to be used
on Solaris, and to avoid the problems that come with using epoll()
on illumos. The separation of epoll into src/unix/epoll.c has been
retained.

Fixes: https://github.com/libuv/libuv/issues/3241
PR-URL: https://github.com/libuv/libuv/pull/3242
Reviewed-By: Jameson Nash <vtjnash@gmail.com>
2021-07-19 22:19:24 -04:00
Jameson Nash
03f1a6979c
unix,stream: fix loop hang after uv_shutdown
While most users will likely typically call uv_close in their
uv_shutdown callback, some callers (notable nodejs) do not always do
so. This can result in libuv keeping the loop active, even though there
are no outstanding reqs left to handle.

This bug was added in 80f2f826bf, where
the premise of that commit appears to have simply been incorrect, as
demonstrated by the added test.

Refs: https://github.com/libuv/libuv/issues/3202
PR-URL: https://github.com/libuv/libuv/pull/3233
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
2021-07-13 10:54:02 -04:00
tjarlama
caf22ddbf5
illumos: event ports to epoll
Sunos has added epoll wrappers to offer compatability for binaries
build specifically for linux (https://illumos.org/man/5/epoll). With
this, it's now possible to develop epoll as a generic interface and
share between Linux and SUNOS, similar to kqueue.

Fixes: https://github.com/libuv/libuv/issues/3008
PR-URL: https://github.com/libuv/libuv/pull/3046
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2021-07-02 15:00:37 -04:00
Jameson Nash
ce15b8405e
Re-merge "unix,stream: clear read/write states on close/eof"
This reverts commit 46f36e3df1.

PR-URL: https://github.com/libuv/libuv/pull/3006
Refs: https://github.com/libuv/libuv/pull/2967
Refs: https://github.com/libuv/libuv/pull/2409
Refs: https://github.com/libuv/libuv/issues/2943
Refs: https://github.com/libuv/libuv/pull/2968
Refs: https://github.com/nodejs/node/pull/36111
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
2021-05-21 16:20:07 -04:00
Jameson Nash
ac5b21a2c9
Revert "win,build: Add cmake -DSTATIC_VCRT=ON option"
This reverts commit b94934f012.

The required version of cmake (3.15) is newer than we are currently 
using in Android CI (3.10).

PR-URL: https://github.com/libuv/libuv/pull/3172
Refs: https://github.com/libuv/libuv/pull/3085
2021-05-13 23:07:14 -04:00
Romain Roffé
b94934f012
win,build: Add cmake -DSTATIC_VCRT=ON option
PR-URL: https://github.com/libuv/libuv/pull/3085
Reviewed-By: Jameson Nash <vtjnash@gmail.com>
2021-05-13 11:06:22 -04:00
Zhao Zhili
67994c68fe
cmake: fix linker flags
There is no CMAKE_LINKER_FLAGS_DEBUG.

Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
PR-URL: https://github.com/libuv/libuv/pull/3137
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
2021-04-04 17:29:27 +02:00
Shuowang (Wayne) Zhang
c2589424f9
zos: use custom proctitle implementation
ZOSLIB uses `argv[0]` to determine the exepath. So it is necessary to
use an implementation of proctitle that does not modify `argv[0]`. Since
there is currently no support for process titles on z/OS, the custom
proctitle implementation simply stores the desired title in memory.

This resolves failure in tests `get_currentexe` and `process_title` on
z/OS.

PR-URL: https://github.com/libuv/libuv/pull/3060
Reviewed-By: Richard Lau <rlau@redhat.com>
2021-02-15 17:18:59 +00:00
Shuowang (Wayne) Zhang
bf1aea0d5b
zos: introduce zoslib
This commit introduces ZOSLIB for z/OS, which is a C/C++ library that
implements additional POSIX APIs not available in the LE C Runtime
Library, and provides API for EBCDIC <-> ASCII conversion. This library
requires the linker to be set to CXX when building for z/OS. ZOSLIB is
designed to be installed separately, and then linked to libuv with the
`-DZOSLIB_DIR` option.

PR-URL: https://github.com/libuv/libuv/pull/3060
Reviewed-By: Richard Lau <rlau@redhat.com>
2021-02-15 17:18:16 +00:00
Shuowang (Wayne) Zhang
1073ceaea4
zos: build in ascii code page
PR-URL: https://github.com/libuv/libuv/pull/3060
Reviewed-By: Richard Lau <rlau@redhat.com>
2021-02-15 17:17:52 +00:00
Bob Weinand
c9406ba0e3
poll,unix: ensure safety of rapid fd reuse
Consider the following scenario:

uv_poll_init(loop, poll, fd);
uv_poll_start(poll, UV_READABLE, cb);
// the cb gets invoked etc.
uv_poll_stop(poll);

close(fd);
fd = allocate_new_socket(); // allocate_new_socket() is assigned the same fd by "bad luck" from the OS

// some time later:
uv_poll_init(loop, otherpoll, fd);
uv_poll_start(otherpoll, UV_READABLE, cb);

uv_close(poll); // uv__io_stop: Assertion `loop->watchers[w->fd] == w' failed.

According to documentation, "however the fd can be safely closed
immediately after a call to uv_poll_stop() or uv_close()."
Though, in this scenario, we close()'d our file descriptor, and by
bad luck we got the same file descriptor again and register a new
handle for it and start polling.

Previously that would lead to an assertion failure, if we were to
properly free the original handle via uv_close().

This commit fixes that by moving the check whether a only a single
poll handle is active to uv_poll_start() instead of the stopping
routines.

Fixes: https://github.com/libuv/libuv/issues/1172
Fixes: https://github.com/bwoebi/php-uv/issues/81
Fixes: https://github.com/b2wdigital/aiologger/issues/82
Fixes: https://github.com/invenia/LibPQ.jl/issues/140
PR-URL: https://github.com/libuv/libuv/pull/2686
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Jameson Nash <vtjnash@gmail.com>
2020-12-28 11:51:23 -05:00
Ben Noordhuis
a779fccfd1
win: bump minimum supported version to windows 8
* Windows 7 went out of support earlier this year.

* As did Python 2.7. We no longer have to worry about MSVC 2008.
  Python 3.5 and up use VS 2015.

PR-URL: https://github.com/libuv/libuv/pull/2821
Reviewed-By: Bartosz Sosnowski <bartosz@janeasystems.com>
Reviewed-By: Jameson Nash <vtjnash@gmail.com>
Reviewed-By: Joao Reis <reis@janeasystems.com>
2020-12-28 12:44:29 +01:00
Ben Noordhuis
cbcd0cfc82
build: turn on -fno-strict-aliasing
Turn on `-fno-strict-aliasing` in libuv and add a note in the README for
downstream projects.

Fixes: https://github.com/libuv/libuv/issues/1230
PR-URL: https://github.com/libuv/libuv/pull/2588
Reviewed-By: Jameson Nash <vtjnash@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Richard Lau <rlau@redhat.com>
2020-11-06 14:39:00 -05:00
gengjiawen
97a903309f build: add asan checks
Fixes: https://github.com/libuv/libuv/issues/2999
PR-URL: https://github.com/libuv/libuv/pull/2998
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2020-10-21 14:52:58 +02:00
Elad Lahav
ed5b42d5b7
build,unix: add QNX support
Refs: https://github.com/libuv/libuv/pull/2881
PR-URL: https://github.com/libuv/libuv/pull/2991
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2020-09-22 23:14:46 -04:00
Nikolay Mitev
3ee60fa72a
build: add libuv-static pkg-config file
Fixes: https://github.com/libuv/libuv/issues/2988
PR-URL: https://github.com/libuv/libuv/pull/2993
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2020-09-21 21:53:59 -04:00
David Carlier
a7b3b0d0e7
build: fix the Haiku cmake build
PR-URL: https://github.com/libuv/libuv/pull/2994
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2020-09-20 11:47:39 -04:00
cjihrig
46f36e3df1
Revert "unix,stream: clear read/write states on close/eof"
This reverts commit 12be29f185.

The commit in question was introducing failures in the Node.js
test suite.

Refs: https://github.com/libuv/libuv/issues/2943
Refs: https://github.com/libuv/libuv/pull/2967
Refs: https://github.com/libuv/libuv/pull/2409
PR-URL: https://github.com/libuv/libuv/pull/2968
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2020-08-24 13:38:46 -04:00
tjarlama
904b1c9b47
test: avoid double evaluation in ASSERT_BASE macro
Passing expression as an argument to a function-like macro will replace
all occurrence of the arguments with expressions during preprocessing.
This result in multiple evaluation of the same expression and can
slow-down the program or even change program state. Here ASSERT_BASE
macro gets an expression involving a and b as first argument and macro
definition has a print statement with a and b, which means there is
double evaluation of a and b when the expression evaluates to false. To
avoid double evaluation temporary variables are created to store results
of a and b.

Since the expression argument is dropped from ASSERT_BASE, the macro no
longer works for string assertions. So a new macro, ASSERT_BASE_STR, is
introduced to deal with strings. ASSERT_BASE can still work with
pointers.

Fixes: https://github.com/libuv/libuv/issues/2916
PR-URL: https://github.com/libuv/libuv/pull/2926
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Jameson Nash <vtjnash@gmail.com>
2020-08-12 13:13:02 -04:00
司徒玟琅
3fc580ec4a
cmake: fix compile error C2001 on Chinese Windows
Fixes: https://github.com/libuv/libuv/issues/2887
PR-URL: https://github.com/libuv/libuv/pull/2889
Reviewed-By: Jameson Nash <vtjnash@gmail.com>
2020-08-12 13:07:44 -04:00
Richard Lau
ea92e9c720
aix: protect uv_exepath() from uv_set_process_title()
Store a copy of the original argv[0] to protect `uv_exepath()`
against `uv_set_process_title()` changing the value of argv[0].

Extract common code for finding a program on the current PATH.

Fixes: https://github.com/libuv/libuv/issues/2674
PR-URL: https://github.com/libuv/libuv/pull/2677
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Jameson Nash <vtjnash@gmail.com>
2020-08-10 11:27:30 -04:00
Trevor Norris
e8effd4556 core: add API to measure event loop idle time
The API addition `uv_metrics_idle_time()` is a thread safe call that
allows the user to retrieve the amount of time the event loop has spent
in the kernel's event provider (i.e. poll). It was done this way to
allow retrieving this value without needing to interrupt the execution
of the event loop. This option can be enabled by passing
`UV_METRICS_IDLE_TIME` to `uv_loop_configure()`.

One important aspect of this change is, when enabled, to always first
call the event provider with a `timeout == 0`. This allows libuv to know
whether any events were waiting in the event queue when the event
provider was called. The importance of this is because libuv is tracking
the amount of "idle time", not "poll time". Thus the provider entry time
is not recorded when `timeout == 0` (the event provider never idles in
this case).

While this does add a small amount of overhead, when enabled, but the
overhead decreases when the event loop has a heavier load. This is
because poll events will be waiting when the event provider is called.
Thus never actually recording the provider entry time.

Checking if `uv_loop_t` is configured with `UV_METRICS_IDLE_TIME` always
happens in `uv__metrics_set_provider_entry_time()` and
`uv__metrics_update_idle_time()`. Making the conditional logic wrapping
each call simpler and allows for instrumentation to always hook into
those two function calls.

Rather than placing the fields directly on `uv__loop_internal_fields_t`
add the struct `uv__loop_metrics_t` as a location for future metrics API
additions.

Tests and additional documentation has been included.

PR-URL: https://github.com/libuv/libuv/pull/2725
Reviewed-By: Fedor Indutny <fedor.indutny@gmail.com>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
Reviewed-By: Jameson Nash <vtjnash@gmail.com>
2020-08-04 10:31:42 -04:00
Ryan Liptak
540d723fa4
test: add udp-mmsg test
PR-URL: https://github.com/libuv/libuv/pull/2818
Reviewed-By: Jameson Nash <vtjnash@gmail.com>
2020-07-28 20:14:42 -04:00
Michael Penick
f779fd4f05
win,tcp: avoid reinserting a pending request (#2688)
This fix avoids inserting a duplicate pending request in the case where
`WSARecv()` returns an error (e.g. when a connection has been terminated
by its peer) when `uv_read_start()` is called in a read callback.

Fixes: https://github.com/libuv/libuv/issues/2687
PR-URL: https://github.com/libuv/libuv/pull/2688
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
Reviewed-By: Bartosz Sosnowski <bartosz@janeasystems.com>
Reviewed-By: Jameson Nash <vtjnash@gmail.com>
2020-07-28 13:59:08 -04:00
erw7
66632e7a44 build,cmake: Change installation location on MinGW
MinGW prefers a POSIX like file system hierarchy. Therefore, it is appropriate
that the installation destination is the same as UNIX.

PR-URL: https://github.com/libuv/libuv/pull/2697
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
Reviewed-By: Jameson Nash <vtjnash@gmail.com>
2020-07-28 10:27:49 -04:00
OleksandrKvl
12be29f185 unix,stream: clear read/write states on close/eof
Fixes: https://github.com/libuv/libuv/issues/1798
Refs: https://github.com/libuv/libuv/pull/1825
PR-URL: https://github.com/libuv/libuv/pull/2409
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
Co-Authored-By: Jameson Nash <vtjnash@gmail.com>
2020-07-28 09:05:05 -04:00
George Zhao
fd0e24d2cb build,win: link to user32.lib and advapi32.lib
PR-URL: https://github.com/libuv/libuv/pull/2908
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2020-07-20 11:38:01 +02:00
David Carlier
40bab5ed71 src: build fix for Android
pipe2 needs GNU source defined.

PR-URL: https://github.com/libuv/libuv/pull/2857
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
2020-07-03 15:23:00 +02:00
Santiago Gimeno
84305d8560
udp: fix write_queue cleanup on sendmmsg error
This issue manifested on `connected` udp sockets trying to send
datagrams to a non-existent server and returning `ECONNREFUSED` because
an ICMP error was received before the actual sending was performed.

PR-URL: https://github.com/libuv/libuv/pull/2899
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2020-07-02 21:29:42 +02:00
Ben Noordhuis
1c22b44380 linux: read load average from /proc/loadavg
It was reported that uv_loadavg() reports the wrong values inside an
lxc container.

Libuv calls sysinfo(2) but that isn't intercepted by lxc. /proc/loadavg
however is because /proc is a FUSE fs inside the container.

This commit makes libuv try /proc/loadavg first and fall back to
sysinfo(2) in case /proc isn't mounted.

This commit is very similar to commit 3a1be725 ("linux: read free/total
memory from /proc/meminfo") from April 2019.

Fixes: https://github.com/nodejs/node/issues/33791
PR-URL: https://github.com/libuv/libuv/pull/2876
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
2020-06-12 12:17:33 +02:00
Alexander Tokmakov
2967557b66 build: link libkvm on netbsd only
PR-URL: https://github.com/libuv/libuv/pull/2875
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2020-06-08 11:09:27 +02:00
gengjiawen
1c976110d5
build: test on more platforms via QEMU in CI
This commit runs the test suite via QEMU on GitHub Actions on
a variety of platforms.

Fixes: https://github.com/libuv/libuv/issues/2842
PR-URL: https://github.com/libuv/libuv/pull/2846
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2020-05-17 10:03:20 -04:00
Bartosz Sosnowski
be0e957f18 build, win: add long path aware manifest
Adds manifest file that makes the test runner work with long filenames
when those are enabled in the system.

PR-URL: https://github.com/libuv/libuv/pull/2789
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2020-04-28 18:41:46 +02:00
Bartosz Sosnowski
e1180a6417 build: remove unnessesary MSVC warnings
Removes warnings W4100, W4127, W4201, W4206, W4210, W4232, W4456, W4457,
W4459, W4706 and W4996 when building with MSVC.

PR-URL: https://github.com/libuv/libuv/pull/2777
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2020-04-28 17:22:27 +02:00
erw7
6b3df0577d build,cmake: fix compilation on old MinGW
_WIN32_WINNT specifies the minimum version of the operating system
supported by the code, so change it to the minimum version supported by
libuv.
If _WIN32_WINNT=0x0600, PSAPI_VERSION=1 is set and it is necessary to link
psapi, so it adds psapi unconditionally to the linked library.

Fixes: https://github.com/libuv/libuv/issues/2742
Refs: https://docs.microsoft.com/en-us/cpp/porting/modifying-winver-and-win32-winnt?view=vs-2019
PR-URL: https://github.com/libuv/libuv/pull/2748
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Jameson Nash <vtjnash@gmail.com>
2020-04-27 17:42:46 +09:00
twosee
13886c5293 build,android: fix typo
PR-URL: https://github.com/libuv/libuv/pull/2798
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
2020-04-22 12:41:58 +02:00
Ben Noordhuis
e15a3c45d8 build: make cmake build benchmarks
PR-URL: https://github.com/libuv/libuv/pull/2771
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
2020-04-06 12:33:29 +02:00
Santiago Gimeno
53caf044e3
test: add a bunch of ASSERT macros
To make the debugging of test issues easier.

The following integer macros are added:

`ASSERT_EQ(a, b)`, `ASSERT_GE(a, b)`, `ASSERT_GT(a, b)`,
`ASSERT_LE(a, b)`, `ASSERT_LT(a, b)` and `ASSERT_NE(a, b)`.

And its corresponding unsigned integer macros:

`ASSERT_UINT64_EQ(a, b)`, `ASSERT_UINT64_GE(a, b)`,
`ASSERT_UINT64_GT(a, b)`, `ASSERT_UINT64_LE(a, b)`,
`ASSERT_UINT64_LT(a, b)` and `ASSERT_UINT64_NE(a, b)`.

Also these macros for `NULL` and pointer checks:

`ASSERT_NULL(a)`, `ASSERT_NOT_NULL(a)`, `ASSERT_PTR_EQ(a, b)` and
`ASSERT_PTR_NE(a, b)`.

And finally these macros for strings and buffers:

`ASSERT_STR_EQ(a, b)`/`ASSERT_STR_NEQ(a, b)` that use the `strcmp()`
call.
`ASSERT_MEM_EQ(a, b)`/`ASSERT_MEM_NEQ(a, b)` and
`ASSERT_MEM_HEX_EQ(a, b)`/`ASSERT_MEM_HEX_NEQ(a, b)` that use the
`memcmp()` call. The former, prints the data in string format and the
latter in hex format.

These macros are used in the following way:
```c
ASSERT_EQ(UV_EINVAL, uv_loop_close(&loop));
```

With a sample output that would be as follows:
```
Assertion failed in test/test-loop-close.c on line 44: `UV_EINVAL == uv_loop_close(&loop)` (-22 == -16)
```

To view multiples examples if their use, the `test-ipc.c` file has been
modified to use these macros.

The `_ISOC99_SOURCE` is defined to support `inttypes.h` in `z/OS`.

PR-URL: https://github.com/libuv/libuv/pull/2739
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
2020-03-27 14:51:49 +01:00
Richard Lau
c10431165a
build: fix z/OS cmake build
- Correct CMAKE_SYSTEM_NAME.
- Exclude pthread lib on z/OS.
- Remove deleted src/unix/pthread-barrier.c.
- Set LIBPATH for shared library test.

PR-URL: https://github.com/libuv/libuv/pull/2737
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2020-03-24 09:34:06 -04:00
Jesse Gorzinski
104255f5af build: ibmi support for cmake
PR-URL: https://github.com/libuv/libuv/pull/2729
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Reviewed-By: Kevin Adler <kadler@us.ibm.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
2020-03-18 12:50:10 -04:00
Jesse Gorzinski
742e0ba7df
build: add aix-common.c for AIX cmake build
PR-URL: https://github.com/libuv/libuv/pull/2731
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
2020-03-13 13:18:37 -04:00
erw7
288a06727b win,tty: Added set cursor style to CSI sequences
PR-URL: https://github.com/libuv/libuv/pull/1884
Refs: https://github.com/libuv/libuv/issues/1874
Co-authored-by: Bert Belder <bertbelder@gmail.com>
Co-authored-by: Jameson Nash <vtjnash@gmail.com>
Reviewed-By: Jameson Nash <vtjnash@gmail.com>
Reviewed-By: Saúl Ibarra Corretgé <s@saghul.net>
2020-02-29 14:11:36 +09:00
Ben Noordhuis
c07a7c6cfa build: fix android cmake build, build missing file
Commit f261d04d ("android: enable getentropy on Android >= 28") didn't
add random-getentropy.c to the set of files to build on Android. This
commit rectifies that.

Fixes: https://github.com/libuv/libuv/issues/2702
PR-URL: https://github.com/libuv/libuv/pull/2704
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
2020-02-28 11:47:55 +01:00
Isabella Muerte
018363a163 build,cmake: improve buil experience
* Add two policies to reduce "regex" if statements
* Add CMAKE_MODULE_PATH for custom CMake modules
* Remove hard-coded C89 flag
* C compiler extensions are enabled via CMake
* The C standard minimum of C90 is now required (As C89 was never an
  international standard)
* CMAKE_C_VISIBILITY_PRESET is now used to set symbols to hidden
  instead of a hard-coded compiler flag
* Add (unused) LIBUV_BUILD_BENCH option
  This will allow #1886 to be implemented in a later commit
* Add compiler flag checks for gcc-style warnings
  This allows more compilers to be used with the same compiler settings
* Move uv_test_sources to be under the LIBUV_BUILD_TESTS check
  This clears up a lot of CMakeLists.txt file to allow us to work on the
  "core" of the project. We will eventually be able to move all the tests
  to tests/CMakeLists.txt
* Make the compiler flag checks more readable
* Fix indentation of test sources per request
* Fix target_include_directories when installing versus building
* Improve performance for unix when creating the libuv.pc.in file
* Improve performance when setting `UV_VERSION_MAJOR`
* Fix typo in lint-no-unused-parameter generator expression
* Fix clang-cl detection on newer CMake versions
* Fix targeting newer windows versions
* Fix building under Windows with Visual Studio Generator

PR-URL: https://github.com/libuv/libuv/pull/2504
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Saúl Ibarra Corretgé <s@saghul.net>
2020-02-04 08:30:48 +01:00
Ben Noordhuis
717bda8b7e
build: fix android build, add missing sources
PR-URL: https://github.com/libuv/libuv/pull/2542
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
2019-11-19 15:10:04 -05:00
nia
2dcf2e8188 unix: move random-sysctl to random-sysctl-linux
PR-URL: https://github.com/libuv/libuv/pull/2528
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Saúl Ibarra Corretgé <s@saghul.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
2019-10-29 13:31:41 +01:00
Carl Lei
e797163e75
build: install files on windows via cmake
PR-URL: https://github.com/libuv/libuv/pull/2443
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2019-10-09 15:34:12 -04:00
ZYSzys
8b1e352ffa
build: remove duplicated test in build files
Remove duplicated test-ip6-addr.c in cmake build file
and gyp file.

PR-URL: https://github.com/libuv/libuv/pull/2494
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
2019-10-07 22:12:29 -04:00
Isabella Muerte
edbf293479 build,cmake: don't try to detect a C++ compiler
- Bump CMake version to 3.4 so we can eventually use all the
cool things like better generator expression support, and
`target_sources`, and also better MSVC runtime linkage support

- Reorganize includes to be all in one place.

- Rename libuv_buildtests option to LIBUV_BUILD_TESTS. It is disabled
unless BUILD_TESTING is ON *and* libuv is the "root" project. This helps
projects that might use libuv as a git submodule, or as a download that
is then passed to `add_subdirectory`.

Refs: https://github.com/libuv/libuv/pull/2490
PR-URL: https://github.com/libuv/libuv/pull/2495
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Saúl Ibarra Corretgé <s@saghul.net>
2019-10-04 23:49:25 +02:00
Ben Noordhuis
4ed2a78f0e unix,win: add uv_random()
Add an API for obtaining cryptographically strong random data from the
system PRNG.

Co-authored-by: Saúl Ibarra Corretgé <s@saghul.net>
Refs: https://github.com/libuv/libuv/pull/1055
PR-URL: https://github.com/libuv/libuv/pull/2347
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
2019-09-18 08:09:14 +02:00
Daniel Hahler
1f1f1126b3 build: cmake_minimum_required(VERSION 2.8.12)
The lower minimum version makes it possible to build neovim but it
should be understood that libuv tests nor supports cmake versions
that old.

PR-URL: https://github.com/libuv/libuv/pull/2373
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
2019-09-06 10:09:15 +02:00
Ben Noordhuis
6325a7c840 build: export USING_UV_SHARED=1 to cmake deps
Build the shared library with `BUILDING_UV_SHARED=1` and export
`USING_UV_SHARED=1` to dependents so they get the right declspec.

Fixes: https://github.com/libuv/libuv/issues/1938
PR-URL: https://github.com/libuv/libuv/pull/2431
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
2019-09-06 10:07:47 +02:00
Ben Noordhuis
be449a1979 build: make include/ public in CMakeLists.txt
Fixes: https://github.com/libuv/libuv/issues/1938
PR-URL: https://github.com/libuv/libuv/pull/2431
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
2019-09-06 10:07:22 +02:00
Eneas U de Queiroz
ba1a770bdb build: add cmake library VERSION, SOVERSION
This mimics the behavior of the automake build, using
libuv.so.${UV_VERSION_MAJOR}.0.0 as the output file, and setting the
soname property to be libuv.so.${UV_VERSION_MAJOR}, currently ending up
like this:

    libuv.so.1.0.0
    libuv.so.1 -> libuv.so.1.0.0
    libuv.so -> libuv.so.1

The version information is extracted from the PACKAGE_VERSION string.

PR-URL: https://github.com/libuv/libuv/pull/2445
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
Signed-off-by: Eneas U de Queiroz <cotequeiroz@gmail.com>
2019-09-06 10:02:02 +02:00
Santiago Gimeno
80e931b38c
build,zos: add _OPEN_SYS_SOCK_EXT3 flag
To support source specific multicast operations.

PR-URL: https://github.com/libuv/libuv/pull/2202
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
2019-08-23 21:12:53 +02:00
Santiago Gimeno
958e85fbd8
tcp: add uv_tcp_close_reset method
It resets a TCP connection by sending a RST packet. Due to some platform
inconsistencies, mixing of `uv_shutdown` and `uv_tcp_close_reset` calls
is not allowed.

Fixes: https://github.com/libuv/libuv/issues/1991
PR-URL: https://github.com/libuv/libuv/pull/2425
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2019-08-19 23:41:15 +02:00
Santiago Gimeno
1de151700d
unix,signal: keep handle active if pending signal
Keep the signal handler active after being closed until all the caught
signals have been delivered.

Fixes: https://github.com/libuv/libuv/issues/2398
Fixes: https://github.com/libuv/libuv/issues/2415
PR-URL: https://github.com/libuv/libuv/pull/2423
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2019-08-19 22:39:06 +02:00
João Reis
2c279504f9 win: add UV_FS_O_FILEMAP
Reading and writing files using a memory file mapping can be
significantly faster on Windows.

PR-URL: https://github.com/libuv/libuv/pull/2295
Reviewed-By: Bartosz Sosnowski <bartosz@janeasystems.com>
2019-07-16 18:20:10 +02:00
Ben Noordhuis
c4ff0457b9 build: fix android cmake build
Fix two 'multiple definition' symbol errors caused by compiling in
sysinfo-memory.c when linux-core.c also provides them (and those
are the correct ones.)

Bug introduced in commit 3a1be725 ("linux: read free/total memory from
/proc/meminfo") released in libuv v1.29.0. It slipped under the radar
because there are no Android machines in our CI matrix.

Fixes: https://github.com/libuv/libuv/issues/2357
PR-URL: https://github.com/libuv/libuv/pull/2362
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2019-07-02 11:34:27 +02:00
Niels Lohmann
f8cab71872
build: add cmake option to skip building tests
In case libuv is included via add_subdirectory, its tests are always
built and executed. This cannot be skipped currently, because switching
BUILD_TESTING to false would also switch off all other tests in the
parent project.

This commit adds a switch "libuv_buildtests" which can individually
switch of the compilation and execution of libuv's tests. It is ON by
default, so the default behavior does not change. However, projects
that include libuv via add_subdirectory can not set libuv_buildtests to
OFF if they are not interested in its tests.

PR-URL: https://github.com/libuv/libuv/pull/2094
Reviewed-By: Refael Ackermann (רפאל פלחי) <refack@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2019-06-24 21:22:38 -04:00
Anna Henningsen
ee24ce900e
unix: return actual error from uv_try_write()
So far, for some (?) errors, `uv_try_write()` returns `EAGAIN`
regardless of the actual error, so `ECONNRESET` and `EPIPE` errors
can be swallowed here.

This commit changes `uv_try_write()` so that it prefers to return
the actual error it has seen.

PR-URL: https://github.com/libuv/libuv/pull/2321
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
2019-06-10 15:17:21 +02:00
Ben Noordhuis
3a1be72532 linux: read free/total memory from /proc/meminfo
It was reported that uv_get_free_memory() and uv_get_total_memory()
report the wrong values inside an lxc container.

Libuv calls sysinfo(2) but that isn't intercepted by lxc. /proc/meminfo
however is because /proc is a FUSE fs inside the container.

This commit makes libuv try /proc/meminfo first and fall back to
sysinfo(2) in case /proc isn't mounted.

Fixes: https://github.com/libuv/libuv/issues/2249
PR-URL: https://github.com/libuv/libuv/pull/2258
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2019-04-23 11:49:37 +02:00
zlargon
9521339c2e
build: use cmake APPLE variable to detect platform
- CMake 3.14: supports Cross Compiling for iOS, tvOS, or watchOS
  using simple toolchain files.
  https://cmake.org/cmake/help/v3.14/release/3.14.html#platforms

- CMake 3.10: APPLE variable set to TURE when the target system
  is an Apple platform (macOS, iOS, tvOS or watchOS).
  https://cmake.org/cmake/help/v3.10/variable/APPLE.html

- CMake 3.0: APPLE variable support since v3.0.
  https://cmake.org/cmake/help/v3.0/variable/APPLE.html

PR-URL: https://github.com/libuv/libuv/pull/2245
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2019-04-11 10:00:06 -04:00
cjihrig
99440bb673
unix,win: add uv_fs_{open,read,close}dir()
Co-authored-by: Julien Gilli <jgilli@nodejs.org>
Co-authored-by: Jeremy Whitlock <jwhitlock@apache.org>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
PR-URL: https://github.com/libuv/libuv/pull/2057
Refs: https://github.com/joyent/libuv/issues/1430
Refs: https://github.com/joyent/libuv/pull/1521
Refs: https://github.com/joyent/libuv/pull/1574
Refs: https://github.com/libuv/libuv/pull/175
Refs: https://github.com/nodejs/node/issues/583
Refs: https://github.com/libuv/libuv/pull/416
Refs: https://github.com/libuv/libuv/issues/170
2019-03-26 18:47:51 -04:00
cjihrig
575d41481e
unix,win: add uv_gettimeofday()
PR-URL: https://github.com/libuv/libuv/pull/2221
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2019-03-25 20:23:49 -04:00
Poul Thomas Lomholt
c4a77f5bc7
build: fix uv_test shared uv Windows cmake build
This commit fixes a linker error when building tests
via cmake on Windows by adding the proper
USING_UV_SHARED=1 define when linking to the shared
libuv.

Fixes: https://github.com/libuv/libuv/issues/2188
PR-URL: https://github.com/libuv/libuv/pull/2187
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2019-03-16 12:11:01 -04:00
Santiago Gimeno
90415a3394
udp: add support for UDP connected sockets
Add two new methods:

`uv_udp_connect()` to connect / disconnect an UDP handle.
`uv_udp_getpeername()` to get the remote peer address of a connected UDP
handle.

Modify `uv_udp_send()` and `uv_udp_try_send()` to accept a `NULL` `addr`
to send messages over an "UDP connection".

Refs: https://github.com/libuv/leps/pull/10
PR-URL: https://github.com/libuv/libuv/pull/1872
Backport-PR-URL: https://github.com/libuv/libuv/pull/2217
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2019-03-16 12:05:37 -04:00
Thomas Karl Pietrowski
bcef1c16fb build: make cmake install LICENSE only once
The license file is installed twice. Once where it should be installed
and the second time into the pkg-config directory. Among other files
from other projects it might be confusing why there is a license file
among with other files. Additionally, that is normally not the right
location for license files. Guess, that is only a copy/pasting mistake.

PR-URL: https://github.com/libuv/libuv/pull/2204
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2019-02-25 12:51:51 +01:00
erw7
7ed1eced31
win: fix duplicate tty vt100 fn key
Refs: https://github.com/libuv/libuv/pull/2114
Refs: https://github.com/nodejs/node/issues/25875
Refs: https://github.com/nodejs/node/issues/26013
Fixes: https://github.com/libuv/libuv/issues/2168
PR-URL: https://github.com/libuv/libuv/pull/2160
Reviewed-By: Bartosz Sosnowski <bartosz@janeasystems.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2019-02-10 10:04:18 -05:00
cjihrig
a44f41349b
Revert "ibmi: add support for IBM i to cmake build"
This reverts commit 8d62d933ef.
The corresponding autotools update broke the CI. This commit
is reverted for consistency.

Refs: https://github.com/libuv/libuv/pull/2148
PR-URL: https://github.com/libuv/libuv/pull/2156
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
2019-01-18 10:05:13 -05:00
Kevin Adler
8d62d933ef
ibmi: add support for IBM i to cmake build
PR-URL: https://github.com/libuv/libuv/pull/2148
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2019-01-17 11:10:38 -05:00
cjihrig
d4288bbeab
unix,win: add uv_os_uname()
Fixes: https://github.com/libuv/libuv/issues/2126
PR-URL: https://github.com/libuv/libuv/pull/2128
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Bartosz Sosnowski <bartosz@janeasystems.com>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
2019-01-14 10:47:20 -05:00
Michael Meier
67e771fe53
build: don't link against -lpthread on Android
On Android, pthread is part of the C standard library. Hence, there is
no need to specify -lpthread when building for Android.

PR-URL: https://github.com/libuv/libuv/pull/2110
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2018-12-14 17:21:04 -05:00
Ben Noordhuis
8972e65bf5 unix: harden string copying, introduce strscpy()
Replace calls to strcpy() and strncpy() with the newly introduced
uv__strscpy() function that is meticulous about zero-terminating
the destination buffer.

PR-URL: https://github.com/libuv/libuv/pull/2065
Refs: https://www.kernel.org/doc/htmldocs/kernel-api/API-strscpy.html
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
2018-12-04 17:08:09 +01:00
Ben Noordhuis
6dd44caa35 unix,win: support IDNA 2008 in uv_getaddrinfo()
Encode domain names before passing them on to the libc resolver.
Some getaddrinfo() implementations support IDNA 2008, some only
IDNA 2003 and some don't support i18n domain names at all.

This is a potential security issue because it means a domain name
might resolve differently depending on the system that libuv is
running on.

Fixes: https://github.com/libuv/libuv/issues/2028
PR-URL: https://github.com/libuv/libuv/pull/2046
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
2018-10-30 20:50:23 +01:00
Santiago Gimeno
d0b15844dd
core,bsd: refactor process_title functions
Use `setproctitle()` in `FreeBSD` as in the other `BSD` flavours.
Move `uv_setup_args()`, `uv_set_process_title()` and `uv_get_process_title()` to
`bsd-proctitle.c` so it's used by the supported BSDs.

PR-URL: https://github.com/libuv/libuv/pull/2042
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
2018-10-18 10:11:40 +02:00
Carlo Marcelo Arenas Belón
672b96fab4
win: remove req.c and other cleanup
PR-URL: https://github.com/libuv/libuv/pull/2018
Reviewed-By: Jameson Nash <vtjnash@gmail.com>
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2018-10-08 11:06:15 -04:00
cjihrig
e57e07172e
unix,win: add uv_os_{get,set}priority()
Refs: https://github.com/nodejs/node/pull/21675
PR-URL: https://github.com/libuv/libuv/pull/1945
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
2018-08-15 09:17:55 -04:00
Ben Noordhuis
95c5bf8db1 unix,win: merge timers implementation
Merge src/unix/timer.c and src/win/timer.c into src/timer.c.  This
changes the Windows implementation from a binary tree to a binary
heap for generally better performance.

PR-URL: https://github.com/libuv/libuv/pull/1882
Reviewed-By: Bartosz Sosnowski <bartosz@janeasystems.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2018-06-25 23:48:15 +02:00
Ben Noordhuis
1a0f619530 build: add test suite option to cmake build
PR-URL: https://github.com/libuv/libuv/pull/1850
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2018-06-14 18:42:51 +02:00
Ben Noordhuis
7e6681f733 build: add a cmake build file
All good things come in threes and that's why besides autotools and gyp,
you can now also build everyone's favorite platform abstraction library
with cmake.

This is Ouroboros eating its own tail in a way because cmake depends on
libuv, depends on cmake, depends on libuv, depends on... inception!

Things it does:

* build the shared library
* build the static library
* install the shared library
* install the static library
* install the header files
* install libuv.pc

Things it does not yet do:

* build or install the documentation
* build or execute the test suite
* produce a release tarball
* provide auto-config for downstream cmake-based projects

Fixes: https://github.com/libuv/libuv/issues/1362
PR-URL: https://github.com/libuv/libuv/pull/1850
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2018-06-14 18:40:16 +02:00