head	1.1;
branch	1.1.1;
access;
symbols
	netbsd-11-0-RC4:1.1.1.2
	netbsd-11-0-RC3:1.1.1.2
	netbsd-11-0-RC2:1.1.1.2
	netbsd-11-0-RC1:1.1.1.2
	perseant-exfatfs-base-20250801:1.1.1.2
	netbsd-11:1.1.1.2.0.8
	netbsd-11-base:1.1.1.2
	netbsd-10-1-RELEASE:1.1.1.2
	perseant-exfatfs-base-20240630:1.1.1.2
	perseant-exfatfs:1.1.1.2.0.6
	perseant-exfatfs-base:1.1.1.2
	netbsd-9-4-RELEASE:1.1.1.2.4.2
	netbsd-10-0-RELEASE:1.1.1.2
	netbsd-10-0-RC6:1.1.1.2
	netbsd-9:1.1.1.2.0.4
	netbsd-10-0-RC5:1.1.1.2
	netbsd-10-0-RC4:1.1.1.2
	netbsd-10-0-RC3:1.1.1.2
	netbsd-10-0-RC2:1.1.1.2
	netbsd-10-0-RC1:1.1.1.2
	netbsd-10:1.1.1.2.0.2
	netbsd-10-base:1.1.1.2
	libuv-1-44-2:1.1.1.2
	cjep_sun2x-base1:1.1.1.1
	cjep_sun2x:1.1.1.1.0.4
	cjep_sun2x-base:1.1.1.1
	cjep_staticlib_x-base1:1.1.1.1
	cjep_staticlib_x:1.1.1.1.0.2
	cjep_staticlib_x-base:1.1.1.1
	libuv-1-38-0:1.1.1.1
	LIBUV:1.1.1;
locks; strict;
comment	@# @;


1.1
date	2020.05.24.19.26.37;	author christos;	state Exp;
branches
	1.1.1.1;
next	;
commitid	YPjY7KK53L0OOw9C;

1.1.1.1
date	2020.05.24.19.26.37;	author christos;	state Exp;
branches;
next	1.1.1.2;
commitid	YPjY7KK53L0OOw9C;

1.1.1.2
date	2022.09.22.21.20.38;	author christos;	state Exp;
branches
	1.1.1.2.4.1;
next	;
commitid	8g2nsfCuyluC5UUD;

1.1.1.2.4.1
date	2022.09.22.21.20.38;	author martin;	state dead;
branches;
next	1.1.1.2.4.2;
commitid	bTWO471qeAcpZr0F;

1.1.1.2.4.2
date	2024.03.01.11.43.32;	author martin;	state Exp;
branches;
next	;
commitid	bTWO471qeAcpZr0F;


desc
@@


1.1
log
@Initial revision
@
text
@cmake_minimum_required(VERSION 3.4)
project(libuv LANGUAGES C)

cmake_policy(SET CMP0057 NEW) # Enable IN_LIST operator
cmake_policy(SET CMP0064 NEW) # Support if (TEST) operator

list(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake")

include(CMakePackageConfigHelpers)
include(CMakeDependentOption)
include(CheckCCompilerFlag)
include(GNUInstallDirs)
include(CTest)

set(CMAKE_C_VISIBILITY_PRESET hidden)
set(CMAKE_C_STANDARD_REQUIRED ON)
set(CMAKE_C_EXTENSIONS ON)
set(CMAKE_C_STANDARD 90)

cmake_dependent_option(LIBUV_BUILD_TESTS
  "Build the unit tests when BUILD_TESTING is enabled and we are the root project" ON
  "BUILD_TESTING;CMAKE_SOURCE_DIR STREQUAL PROJECT_SOURCE_DIR" OFF)
cmake_dependent_option(LIBUV_BUILD_BENCH
  "Build the benchmarks when building unit tests and we are the root project" ON
  "LIBUV_BUILD_TESTS" OFF)

# Qemu Build
option(QEMU "build for qemu" OFF)
if(QEMU)
  add_definitions(-D__QEMU__=1)
endif()

# Compiler check
string(CONCAT is-msvc $<OR:
  $<C_COMPILER_ID:MSVC>,
  $<STREQUAL:${CMAKE_C_COMPILER_FRONTEND_VARIANT},MSVC>
>)

check_c_compiler_flag(/W4 UV_LINT_W4)
check_c_compiler_flag(/wd4100 UV_LINT_NO_UNUSED_PARAMETER_MSVC)
check_c_compiler_flag(/wd4127 UV_LINT_NO_CONDITIONAL_CONSTANT_MSVC)
check_c_compiler_flag(/wd4201 UV_LINT_NO_NONSTANDARD_MSVC)
check_c_compiler_flag(/wd4206 UV_LINT_NO_NONSTANDARD_EMPTY_TU_MSVC)
check_c_compiler_flag(/wd4210 UV_LINT_NO_NONSTANDARD_FILE_SCOPE_MSVC)
check_c_compiler_flag(/wd4232 UV_LINT_NO_NONSTANDARD_NONSTATIC_DLIMPORT_MSVC)
check_c_compiler_flag(/wd4456 UV_LINT_NO_HIDES_LOCAL)
check_c_compiler_flag(/wd4457 UV_LINT_NO_HIDES_PARAM)
check_c_compiler_flag(/wd4459 UV_LINT_NO_HIDES_GLOBAL)
check_c_compiler_flag(/wd4706 UV_LINT_NO_CONDITIONAL_ASSIGNMENT_MSVC)
check_c_compiler_flag(/wd4996 UV_LINT_NO_UNSAFE_MSVC)

check_c_compiler_flag(-Wall UV_LINT_WALL) # DO NOT use this under MSVC

# TODO: Place these into its own function
check_c_compiler_flag(-Wno-unused-parameter UV_LINT_NO_UNUSED_PARAMETER)
check_c_compiler_flag(-Wstrict-prototypes UV_LINT_STRICT_PROTOTYPES)
check_c_compiler_flag(-Wextra UV_LINT_EXTRA)

set(lint-no-unused-parameter $<$<BOOL:${UV_LINT_NO_UNUSED_PARAMETER}>:-Wno-unused-parameter>)
set(lint-strict-prototypes $<$<BOOL:${UV_LINT_STRICT_PROTOTYPES}>:-Wstrict-prototypes>)
set(lint-extra $<$<BOOL:${UV_LINT_EXTRA}>:-Wextra>)
set(lint-w4 $<$<BOOL:${UV_LINT_W4}>:/W4>)
set(lint-no-unused-parameter-msvc $<$<BOOL:${UV_LINT_NO_UNUSED_PARAMETER_MSVC}>:/wd4100>)
set(lint-no-conditional-constant-msvc $<$<BOOL:${UV_LINT_NO_CONDITIONAL_CONSTANT_MSVC}>:/wd4127>)
set(lint-no-nonstandard-msvc $<$<BOOL:${UV_LINT_NO_NONSTANDARD_MSVC}>:/wd4201>)
set(lint-no-nonstandard-empty-tu-msvc $<$<BOOL:${UV_LINT_NO_NONSTANDARD_EMPTY_TU_MSVC}>:/wd4206>)
set(lint-no-nonstandard-file-scope-msvc $<$<BOOL:${UV_LINT_NO_NONSTANDARD_FILE_SCOPE_MSVC}>:/wd4210>)
set(lint-no-nonstandard-nonstatic-dlimport-msvc $<$<BOOL:${UV_LINT_NO_NONSTANDARD_NONSTATIC_DLIMPORT_MSVC}>:/wd4232>)
set(lint-no-hides-local-msvc $<$<BOOL:${UV_LINT_NO_HIDES_LOCAL}>:/wd4456>)
set(lint-no-hides-param-msvc $<$<BOOL:${UV_LINT_NO_HIDES_PARAM}>:/wd4457>)
set(lint-no-hides-global-msvc $<$<BOOL:${UV_LINT_NO_HIDES_GLOBAL}>:/wd4459>)
set(lint-no-conditional-assignment-msvc $<$<BOOL:${UV_LINT_NO_CONDITIONAL_ASSIGNMENT_MSVC}>:/wd4706>)
set(lint-no-unsafe-msvc $<$<BOOL:${UV_LINT_NO_UNSAFE_MSVC}>:/wd4996>)
# Unfortunately, this one is complicated because MSVC and clang-cl support -Wall
# but using it is like calling -Weverything
string(CONCAT lint-default $<
  $<AND:$<BOOL:${UV_LINT_WALL}>,$<NOT:${is-msvc}>>:-Wall
>)

list(APPEND uv_cflags ${lint-strict-prototypes} ${lint-extra} ${lint-default} ${lint-w4})
list(APPEND uv_cflags ${lint-no-unused-parameter})
list(APPEND uv_cflags ${lint-no-unused-parameter-msvc})
list(APPEND uv_cflags ${lint-no-conditional-constant-msvc})
list(APPEND uv_cflags ${lint-no-nonstandard-msvc})
list(APPEND uv_cflags ${lint-no-nonstandard-empty-tu-msvc})
list(APPEND uv_cflags ${lint-no-nonstandard-file-scope-msvc})
list(APPEND uv_cflags ${lint-no-nonstandard-nonstatic-dlimport-msvc})
list(APPEND uv_cflags ${lint-no-hides-local-msvc})
list(APPEND uv_cflags ${lint-no-hides-param-msvc})
list(APPEND uv_cflags ${lint-no-hides-global-msvc})
list(APPEND uv_cflags ${lint-no-conditional-assignment-msvc})
list(APPEND uv_cflags ${lint-no-unsafe-msvc})

set(uv_sources
    src/fs-poll.c
    src/idna.c
    src/inet.c
    src/random.c
    src/strscpy.c
    src/threadpool.c
    src/timer.c
    src/uv-common.c
    src/uv-data-getter-setters.c
    src/version.c)

if(WIN32)
  list(APPEND uv_defines WIN32_LEAN_AND_MEAN _WIN32_WINNT=0x0600)
  list(APPEND uv_libraries
       psapi
       iphlpapi
       userenv
       ws2_32)
  list(APPEND uv_sources
       src/win/async.c
       src/win/core.c
       src/win/detect-wakeup.c
       src/win/dl.c
       src/win/error.c
       src/win/fs.c
       src/win/fs-event.c
       src/win/getaddrinfo.c
       src/win/getnameinfo.c
       src/win/handle.c
       src/win/loop-watcher.c
       src/win/pipe.c
       src/win/thread.c
       src/win/poll.c
       src/win/process.c
       src/win/process-stdio.c
       src/win/signal.c
       src/win/snprintf.c
       src/win/stream.c
       src/win/tcp.c
       src/win/tty.c
       src/win/udp.c
       src/win/util.c
       src/win/winapi.c
       src/win/winsock.c)
  list(APPEND uv_test_libraries ws2_32)
  list(APPEND uv_test_sources src/win/snprintf.c test/runner-win.c)
else()
  list(APPEND uv_defines _FILE_OFFSET_BITS=64 _LARGEFILE_SOURCE)
  if(NOT CMAKE_SYSTEM_NAME MATCHES "Android|OS390")
    # TODO: This should be replaced with find_package(Threads) if possible
    # Android has pthread as part of its c library, not as a separate
    # libpthread.so.
    list(APPEND uv_libraries pthread)
  endif()
  list(APPEND uv_sources
       src/unix/async.c
       src/unix/core.c
       src/unix/dl.c
       src/unix/fs.c
       src/unix/getaddrinfo.c
       src/unix/getnameinfo.c
       src/unix/loop-watcher.c
       src/unix/loop.c
       src/unix/pipe.c
       src/unix/poll.c
       src/unix/process.c
       src/unix/random-devurandom.c
       src/unix/signal.c
       src/unix/stream.c
       src/unix/tcp.c
       src/unix/thread.c
       src/unix/tty.c
       src/unix/udp.c)
  list(APPEND uv_test_sources test/runner-unix.c)
endif()

if(CMAKE_SYSTEM_NAME STREQUAL "AIX")
  list(APPEND uv_defines
       _ALL_SOURCE
       _LINUX_SOURCE_COMPAT
       _THREAD_SAFE
       _XOPEN_SOURCE=500
       HAVE_SYS_AHAFS_EVPRODS_H)
  list(APPEND uv_libraries perfstat)
  list(APPEND uv_sources
       src/unix/aix.c
       src/unix/aix-common.c)
endif()

if(CMAKE_SYSTEM_NAME STREQUAL "Android")
  list(APPEND uv_libraries dl)
  list(APPEND uv_sources
       src/unix/android-ifaddrs.c
       src/unix/linux-core.c
       src/unix/linux-inotify.c
       src/unix/linux-syscalls.c
       src/unix/procfs-exepath.c
       src/unix/pthread-fixes.c
       src/unix/random-getentropy.c
       src/unix/random-getrandom.c
       src/unix/random-sysctl-linux.c
       src/unix/sysinfo-loadavg.c)
endif()

if(APPLE OR CMAKE_SYSTEM_NAME MATCHES "Android|Linux|OS390")
  list(APPEND uv_sources src/unix/proctitle.c)
endif()

if(CMAKE_SYSTEM_NAME MATCHES "DragonFly|FreeBSD")
  list(APPEND uv_sources src/unix/freebsd.c)
endif()

if(CMAKE_SYSTEM_NAME MATCHES "DragonFly|FreeBSD|NetBSD|OpenBSD")
  list(APPEND uv_sources src/unix/posix-hrtime.c src/unix/bsd-proctitle.c)
  list(APPEND uv_libraries kvm)
endif()

if(APPLE OR CMAKE_SYSTEM_NAME MATCHES "DragonFly|FreeBSD|NetBSD|OpenBSD")
  list(APPEND uv_sources src/unix/bsd-ifaddrs.c src/unix/kqueue.c)
endif()

if(CMAKE_SYSTEM_NAME MATCHES "FreeBSD")
  list(APPEND uv_sources src/unix/random-getrandom.c)
endif()

if(APPLE OR CMAKE_SYSTEM_NAME STREQUAL "OpenBSD")
  list(APPEND uv_sources src/unix/random-getentropy.c)
endif()

if(APPLE)
  list(APPEND uv_defines _DARWIN_UNLIMITED_SELECT=1 _DARWIN_USE_64_BIT_INODE=1)
  list(APPEND uv_sources
       src/unix/darwin-proctitle.c
       src/unix/darwin.c
       src/unix/fsevents.c)
endif()

if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
  list(APPEND uv_defines _GNU_SOURCE _POSIX_C_SOURCE=200112)
  list(APPEND uv_libraries dl rt)
  list(APPEND uv_sources
       src/unix/linux-core.c
       src/unix/linux-inotify.c
       src/unix/linux-syscalls.c
       src/unix/procfs-exepath.c
       src/unix/random-getrandom.c
       src/unix/random-sysctl-linux.c
       src/unix/sysinfo-loadavg.c)
endif()

if(CMAKE_SYSTEM_NAME STREQUAL "NetBSD")
  list(APPEND uv_sources src/unix/netbsd.c)
endif()

if(CMAKE_SYSTEM_NAME STREQUAL "OpenBSD")
  list(APPEND uv_sources src/unix/openbsd.c)
endif()

if(CMAKE_SYSTEM_NAME STREQUAL "OS390")
  list(APPEND uv_defines PATH_MAX=255)
  list(APPEND uv_defines _AE_BIMODAL)
  list(APPEND uv_defines _ALL_SOURCE)
  list(APPEND uv_defines _ISOC99_SOURCE)
  list(APPEND uv_defines _LARGE_TIME_API)
  list(APPEND uv_defines _OPEN_MSGQ_EXT)
  list(APPEND uv_defines _OPEN_SYS_FILE_EXT)
  list(APPEND uv_defines _OPEN_SYS_IF_EXT)
  list(APPEND uv_defines _OPEN_SYS_SOCK_EXT3)
  list(APPEND uv_defines _OPEN_SYS_SOCK_IPV6)
  list(APPEND uv_defines _UNIX03_SOURCE)
  list(APPEND uv_defines _UNIX03_THREADS)
  list(APPEND uv_defines _UNIX03_WITHDRAWN)
  list(APPEND uv_defines _XOPEN_SOURCE_EXTENDED)
  list(APPEND uv_sources
       src/unix/pthread-fixes.c
       src/unix/os390.c
       src/unix/os390-syscalls.c)
  list(APPEND uv_cflags -Wc,DLL -Wc,exportall -Wc,xplink)
  list(APPEND uv_libraries -Wl,xplink)
  list(APPEND uv_test_libraries -Wl,xplink)
endif()

if(CMAKE_SYSTEM_NAME STREQUAL "OS400")
  list(APPEND uv_defines
       _ALL_SOURCE
       _LINUX_SOURCE_COMPAT
       _THREAD_SAFE
       _XOPEN_SOURCE=500)
  list(APPEND uv_sources
    src/unix/aix-common.c
    src/unix/ibmi.c
    src/unix/no-fsevents.c
    src/unix/no-proctitle.c
    src/unix/posix-poll.c)
endif()

if(CMAKE_SYSTEM_NAME STREQUAL "SunOS")
  list(APPEND uv_defines __EXTENSIONS__ _XOPEN_SOURCE=500)
  list(APPEND uv_libraries kstat nsl sendfile socket)
  list(APPEND uv_sources src/unix/no-proctitle.c src/unix/sunos.c)
endif()

if(APPLE OR CMAKE_SYSTEM_NAME MATCHES "DragonFly|FreeBSD|Linux|NetBSD|OpenBSD")
  list(APPEND uv_test_libraries util)
endif()

add_library(uv SHARED ${uv_sources})
target_compile_definitions(uv
  INTERFACE
    USING_UV_SHARED=1
  PRIVATE
    BUILDING_UV_SHARED=1
    ${uv_defines})
target_compile_options(uv PRIVATE ${uv_cflags})
target_include_directories(uv
  PUBLIC
    $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include>
    $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
  PRIVATE
    $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/src>)
target_link_libraries(uv ${uv_libraries})

add_library(uv_a STATIC ${uv_sources})
target_compile_definitions(uv_a PRIVATE ${uv_defines})
target_compile_options(uv_a PRIVATE ${uv_cflags})
target_include_directories(uv_a
  PUBLIC
    $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include>
    $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
  PRIVATE
    $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/src>)
target_link_libraries(uv_a ${uv_libraries})

if(LIBUV_BUILD_TESTS)
  # Small hack: use ${uv_test_sources} now to get the runner skeleton,
  # before the actual tests are added.
  add_executable(
    uv_run_benchmarks_a
    ${uv_test_sources}
    test/benchmark-async-pummel.c
    test/benchmark-async.c
    test/benchmark-fs-stat.c
    test/benchmark-getaddrinfo.c
    test/benchmark-loop-count.c
    test/benchmark-million-async.c
    test/benchmark-million-timers.c
    test/benchmark-multi-accept.c
    test/benchmark-ping-pongs.c
    test/benchmark-ping-udp.c
    test/benchmark-pound.c
    test/benchmark-pump.c
    test/benchmark-sizes.c
    test/benchmark-spawn.c
    test/benchmark-tcp-write-batch.c
    test/benchmark-thread.c
    test/benchmark-udp-pummel.c
    test/blackhole-server.c
    test/dns-server.c
    test/echo-server.c
    test/run-benchmarks.c
    test/runner.c)
  target_compile_definitions(uv_run_benchmarks_a PRIVATE ${uv_defines})
  target_compile_options(uv_run_benchmarks_a PRIVATE ${uv_cflags})
  target_link_libraries(uv_run_benchmarks_a uv_a ${uv_test_libraries})

  list(APPEND uv_test_sources
       test/blackhole-server.c
       test/echo-server.c
       test/run-tests.c
       test/runner.c
       test/test-active.c
       test/test-async-null-cb.c
       test/test-async.c
       test/test-barrier.c
       test/test-callback-order.c
       test/test-callback-stack.c
       test/test-close-fd.c
       test/test-close-order.c
       test/test-condvar.c
       test/test-connect-unspecified.c
       test/test-connection-fail.c
       test/test-cwd-and-chdir.c
       test/test-default-loop-close.c
       test/test-delayed-accept.c
       test/test-dlerror.c
       test/test-eintr-handling.c
       test/test-embed.c
       test/test-emfile.c
       test/test-env-vars.c
       test/test-error.c
       test/test-fail-always.c
       test/test-fork.c
       test/test-fs-copyfile.c
       test/test-fs-event.c
       test/test-fs-poll.c
       test/test-fs.c
       test/test-fs-readdir.c
       test/test-fs-fd-hash.c
       test/test-fs-open-flags.c
       test/test-get-currentexe.c
       test/test-get-loadavg.c
       test/test-get-memory.c
       test/test-get-passwd.c
       test/test-getaddrinfo.c
       test/test-gethostname.c
       test/test-getnameinfo.c
       test/test-getsockname.c
       test/test-getters-setters.c
       test/test-gettimeofday.c
       test/test-handle-fileno.c
       test/test-homedir.c
       test/test-hrtime.c
       test/test-idle.c
       test/test-idna.c
       test/test-ip4-addr.c
       test/test-ip6-addr.c
       test/test-ipc-heavy-traffic-deadlock-bug.c
       test/test-ipc-send-recv.c
       test/test-ipc.c
       test/test-loop-alive.c
       test/test-loop-close.c
       test/test-loop-configure.c
       test/test-loop-handles.c
       test/test-loop-stop.c
       test/test-loop-time.c
       test/test-multiple-listen.c
       test/test-mutexes.c
       test/test-osx-select.c
       test/test-pass-always.c
       test/test-ping-pong.c
       test/test-pipe-bind-error.c
       test/test-pipe-close-stdout-read-stdin.c
       test/test-pipe-connect-error.c
       test/test-pipe-connect-multiple.c
       test/test-pipe-connect-prepare.c
       test/test-pipe-getsockname.c
       test/test-pipe-pending-instances.c
       test/test-pipe-sendmsg.c
       test/test-pipe-server-close.c
       test/test-pipe-set-fchmod.c
       test/test-pipe-set-non-blocking.c
       test/test-platform-output.c
       test/test-poll-close-doesnt-corrupt-stack.c
       test/test-poll-close.c
       test/test-poll-closesocket.c
       test/test-poll-oob.c
       test/test-poll.c
       test/test-process-priority.c
       test/test-process-title-threadsafe.c
       test/test-process-title.c
       test/test-queue-foreach-delete.c
       test/test-random.c
       test/test-ref.c
       test/test-run-nowait.c
       test/test-run-once.c
       test/test-semaphore.c
       test/test-shutdown-close.c
       test/test-shutdown-eof.c
       test/test-shutdown-twice.c
       test/test-signal-multiple-loops.c
       test/test-signal-pending-on-close.c
       test/test-signal.c
       test/test-socket-buffer-size.c
       test/test-spawn.c
       test/test-stdio-over-pipes.c
       test/test-strscpy.c
       test/test-tcp-alloc-cb-fail.c
       test/test-tcp-bind-error.c
       test/test-tcp-bind6-error.c
       test/test-tcp-close-accept.c
       test/test-tcp-close-while-connecting.c
       test/test-tcp-close.c
       test/test-tcp-close-reset.c
       test/test-tcp-connect-error-after-write.c
       test/test-tcp-connect-error.c
       test/test-tcp-connect-timeout.c
       test/test-tcp-connect6-error.c
       test/test-tcp-create-socket-early.c
       test/test-tcp-flags.c
       test/test-tcp-oob.c
       test/test-tcp-open.c
       test/test-tcp-read-stop.c
       test/test-tcp-shutdown-after-write.c
       test/test-tcp-try-write.c
       test/test-tcp-try-write-error.c
       test/test-tcp-unexpected-read.c
       test/test-tcp-write-after-connect.c
       test/test-tcp-write-fail.c
       test/test-tcp-write-queue-order.c
       test/test-tcp-write-to-half-open-connection.c
       test/test-tcp-writealot.c
       test/test-thread-equal.c
       test/test-thread.c
       test/test-threadpool-cancel.c
       test/test-threadpool.c
       test/test-timer-again.c
       test/test-timer-from-check.c
       test/test-timer.c
       test/test-tmpdir.c
       test/test-tty-duplicate-key.c
       test/test-tty-escape-sequence-processing.c
       test/test-tty.c
       test/test-udp-alloc-cb-fail.c
       test/test-udp-bind.c
       test/test-udp-connect.c
       test/test-udp-create-socket-early.c
       test/test-udp-dgram-too-big.c
       test/test-udp-ipv6.c
       test/test-udp-multicast-interface.c
       test/test-udp-multicast-interface6.c
       test/test-udp-multicast-join.c
       test/test-udp-multicast-join6.c
       test/test-udp-multicast-ttl.c
       test/test-udp-open.c
       test/test-udp-options.c
       test/test-udp-send-and-recv.c
       test/test-udp-send-hang-loop.c
       test/test-udp-send-immediate.c
       test/test-udp-send-unreachable.c
       test/test-udp-try-send.c
       test/test-uname.c
       test/test-walk-handles.c
       test/test-watcher-cross-stop.c)

  add_executable(uv_run_tests ${uv_test_sources} uv_win_longpath.manifest)
  target_compile_definitions(uv_run_tests
                             PRIVATE ${uv_defines} USING_UV_SHARED=1)
  target_compile_options(uv_run_tests PRIVATE ${uv_cflags})
  target_link_libraries(uv_run_tests uv ${uv_test_libraries})
  add_test(NAME uv_test
           COMMAND uv_run_tests
           WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
  if(CMAKE_SYSTEM_NAME STREQUAL "OS390")
    set_tests_properties(uv_test PROPERTIES ENVIRONMENT
                         "LIBPATH=${CMAKE_BINARY_DIR}:$ENV{LIBPATH}")
  endif()
  add_executable(uv_run_tests_a ${uv_test_sources} uv_win_longpath.manifest)
  target_compile_definitions(uv_run_tests_a PRIVATE ${uv_defines})
  target_compile_options(uv_run_tests_a PRIVATE ${uv_cflags})
  if(QEMU)
    target_link_libraries(uv_run_tests_a uv_a ${uv_test_libraries} -static)
  else()
    target_link_libraries(uv_run_tests_a uv_a ${uv_test_libraries})
  endif()
  add_test(NAME uv_test_a
           COMMAND uv_run_tests_a
           WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
endif()

if(UNIX)
  # Now for some gibbering horrors from beyond the stars...
  foreach(lib IN LISTS uv_libraries)
    list(APPEND LIBS "-l${lib}")
  endforeach()
  string(REPLACE ";" " " LIBS "${LIBS}")
  # Consider setting project version via project() call?
  file(STRINGS configure.ac configure_ac REGEX ^AC_INIT)
  string(REGEX MATCH "([0-9]+)[.][0-9]+[.][0-9]+" PACKAGE_VERSION "${configure_ac}")
  set(UV_VERSION_MAJOR "${CMAKE_MATCH_1}")
  # The version in the filename is mirroring the behaviour of autotools.
  set_target_properties(uv PROPERTIES
    VERSION ${UV_VERSION_MAJOR}.0.0
    SOVERSION ${UV_VERSION_MAJOR})
  set(includedir ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_INCLUDEDIR})
  set(libdir ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR})
  set(prefix ${CMAKE_INSTALL_PREFIX})
  configure_file(libuv.pc.in libuv.pc @@ONLY)

  install(DIRECTORY include/ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
  install(FILES LICENSE DESTINATION ${CMAKE_INSTALL_DOCDIR})
  install(FILES ${PROJECT_BINARY_DIR}/libuv.pc
          DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
  install(TARGETS uv LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
  install(TARGETS uv_a ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
endif()

if(WIN32)
  install(DIRECTORY include/ DESTINATION include)
  install(FILES LICENSE DESTINATION .)
  install(TARGETS uv uv_a
          RUNTIME DESTINATION lib/$<CONFIG>
          ARCHIVE DESTINATION lib/$<CONFIG>)
endif()

message(STATUS "summary of build options:
    Install prefix:  ${CMAKE_INSTALL_PREFIX}
    Target system:   ${CMAKE_SYSTEM_NAME}
    Compiler:
      C compiler:    ${CMAKE_C_COMPILER}
      CFLAGS:        ${CMAKE_C_FLAGS_${_build_type}} ${CMAKE_C_FLAGS}
")
@


1.1.1.1
log
@Import libuv, needed by bind-9.16.x
@
text
@@


1.1.1.2
log
@Import libuv-1.44.2 (last imported version was 1.38.0)

2022.07.12, Version 1.44.2 (Stable)

Changes since version 1.44.1:

* Add SHA to ChangeLog (Jameson Nash)

* aix, ibmi: handle server hang when remote sends TCP RST (V-for-Vasili)

* build: make CI a bit noisier (Jameson Nash)

* process: reset the signal mask if the fork fails (Jameson Nash)

* zos: implement cmpxchgi() using assembly (Shuowang (Wayne) Zhang)

* build: AC_SUBST for AM_CFLAGS (Claes Nästén)

* ibmi: Implement UDP disconnect (V-for-Vasili)

* doc: update active maintainers list (Ben Noordhuis)

* build: fix kFreeBSD build (James McCoy)

* build: remove Windows 2016 workflows (Darshan Sen)

* Revert "win,errors: remap ERROR_ACCESS_DENIED to UV_EACCES" (Darshan Sen)

* unix: simplify getpwuid call (Jameson Nash)

* build: filter CI by paths and branches (Jameson Nash)

* build: add iOS to macos CI (Jameson Nash)

* build: re-enable CI for windows changes (Jameson Nash)

* process,iOS: fix build breakage in process.c (Denny C. Dai)

* test: remove unused declarations in tcp_rst test (V-for-Vasili)

* core: add thread-safe strtok implementation (Guilherme Íscaro)

* win: fix incompatible-types warning (twosee)

* test: fix flaky file watcher test (Ben Noordhuis)

* build: fix AIX xlc autotools build (V-for-Vasili)

* unix,win: fix UV_RUN_ONCE + uv_idle_stop loop hang (Ben Noordhuis)

* win: fix unexpected ECONNRESET error on TCP socket (twosee)

* doc: make sample cross-platform build (gengjiawen)

* test: separate some static variables by test cases (Hannah Shi)

* sunos: fs-event callback can be called after uv_close() (Andy Fiddaman)

* uv: re-register interest in a file after change (Shuowang (Wayne) Zhang)

* uv: register UV_RENAME event for _RFIM_UNLINK (Shuowang (Wayne) Zhang)

* uv: register __rfim_event 156 as UV_RENAME (Shuowang (Wayne) Zhang)

* doc: remove smartos from supported platforms (Ben Noordhuis)

* macos: avoid posix_spawnp() cwd bug (Jameson Nash)

* release: check versions of autogen scripts are newer (Jameson Nash)

* test: rewrite embed test (Ben Noordhuis)

* openbsd: use utimensat instead of lutimes (tuftedocelot)

* doc: fix link to uvwget example main() function (blogdaren)

* unix: use MSG_CMSG_CLOEXEC where supported (Ben Noordhuis)

* test: remove disabled callback_order test (Ben Noordhuis)

* win,pipe: fix bugs with pipe resource lifetime management (Jameson Nash)

* loop: better align order-of-events behavior between platforms (Jameson Nash)

* aix,test: uv_backend_fd is not supported by poll (V-for-Vasili)

* kqueue: skip EVFILT_PROC when invalidating fds (chucksilvers)

* darwin: fix atomic-ops.h ppc64 build (Sergey Fedorov)

* zos: don't err when killing a zombie process (Shuowang (Wayne) Zhang)

* zos: avoid fs event callbacks after uv_close() (Shuowang (Wayne) Zhang)

* zos: correctly format interface addresses names (Shuowang (Wayne) Zhang)

* zos: add uv_interface_addresses() netmask support (Shuowang (Wayne) Zhang)

* zos: improve memory management of ip addresses (Shuowang (Wayne) Zhang)

* tcp,pipe: fail `bind` or `listen` after `close` (theanarkh)

* zos: implement uv_available_parallelism() (Shuowang (Wayne) Zhang)

* udp,win: fix UDP compiler warning (Jameson Nash)

* zos: fix early exit of epoll_wait() (Shuowang (Wayne) Zhang)

* unix,tcp: fix errno handling in uv__tcp_bind() (Samuel Cabrero)

* shutdown,unix: reduce code duplication (Jameson Nash)

* unix: fix c99 comments (Ben Noordhuis)

* unix: retry tcgetattr/tcsetattr() on EINTR (Ben Noordhuis)

* docs: update introduction.rst (Ikko Ashimine)

* unix,stream: optimize uv_shutdown() codepath (Jameson Nash)

* zos: delay signal handling until after normal i/o (Shuowang (Wayne) Zhang)

* stream: uv__drain() always needs to stop POLLOUT (Jameson Nash)

* unix,tcp: allow EINVAL errno from setsockopt in uv_tcp_close_reset() (Stacey
  Marshall)

* win,shutdown: improve how shutdown is dispatched (Jameson Nash)


2022.03.09, Version 1.44.1 (Stable), e8b7eb6908a847ffbe6ab2eec7428e43a0aa53a2

Changes since version 1.44.0:

* process: simplify uv__write_int calls (Jameson Nash)

* macos: don't use thread-unsafe strtok() (Ben Noordhuis)

* process: fix hang after NOTE_EXIT (Jameson Nash)


2022.03.07, Version 1.44.0 (Stable), d2bff508457336d808ba7148b33088f6acbfe0a6

Changes since version 1.43.0:

* darwin: remove EPROTOTYPE error workaround (Ben Noordhuis)

* doc: fix v1.43.0 changelog entries (cjihrig)

* win: replace CRITICAL_SECTION+Semaphore with SRWLock (David Machaj)

* darwin: translate EPROTOTYPE to ECONNRESET (Ben Noordhuis)

* android: use libc getifaddrs() (Ben Noordhuis)

* unix: fix STATIC_ASSERT to check what it means to check (Jessica Clarke)

* unix: ensure struct msghdr is zeroed in recvmmsg (Ondřej Surý)

* test: test with maximum recvmmsg buffer (Ondřej Surý)

* unix: don't allow too small thread stack size (Ben Noordhuis)

* bsd: ensure mutex is initialized (Ben Noordhuis)

* doc: add gengjiawen as maintainer (gengjiawen)

* process: monitor for exit with kqueue on BSDs (Jeremy Rose)

* test: fix flaky uv_fs_lutime test (Momtchil Momtchev)

* build: fix cmake install locations (Jameson Nash)

* thread,win: fix C90 style nit (ssrlive)

* build: rename CFLAGS to AM_CFLAGS (Jameson Nash)

* doc/guide: update content and sample code (woclass)

* process,bsd: handle kevent NOTE_EXIT failure (Jameson Nash)

* test: remove flaky test ipc_closed_handle (Ben Noordhuis)

* darwin: bump minimum supported version to 10.15 (Ben Noordhuis)

* win: return fractional seconds in uv_uptime() (Luca Adrian L)

* build: export uv_a for cmake (WenTao Ou)

* loop: add pending work to loop-alive check (Jameson Nash)

* win: use GetTickCount64 for uptime again (Jameson Nash)

* win: restrict system DLL load paths (jonilaitinen)

* win,errors: remap ERROR_ACCESS_DENIED to UV_EACCES (Darshan Sen)

* bench: add `uv_queue_work` ping-pong measurement (Momtchil Momtchev)

* build: fix error C4146 on MSVC (UMU)

* test: fix benchmark-ping-udp (Ryan Liptak)

* win,fs: consider broken pipe error a normal EOF (Momtchil Momtchev)

* document the values of enum uv_stdio_flags (Paul Evans)

* win,loop: add missing uv_update_time (twosee)

* win,fs: avoid closing an invalid handle (Jameson Nash)

* fix oopsie from

* doc: clarify android api level (Ben Noordhuis)

* win: fix style nits [NFC] (Jameson Nash)

* test: fix flaky udp_mmsg test (Santiago Gimeno)

* test: fix ipc_send_recv_pipe flakiness (Ben Noordhuis)

* doc: checkout -> check out (wyckster)

* core: change uv_get_password uid/gid to unsigned (Jameson Nash)

* hurd: unbreak build on GNU/Hurd (Vittore F. Scolari)

* freebsd: use copy_file_range() in uv_fs_sendfile() (David Carlier)

* test: use closefd in runner-unix.c (Guilherme Íscaro)

* Reland "macos: use posix_spawn instead of fork" (Jameson Nash)

* android: fix build error when no ifaddrs.h (ssrlive)

* unix,win: add uv_available_parallelism() (Ben Noordhuis)

* process: remove OpenBSD from kevent list (Jameson Nash)

* zos: fix build breakage (Ben Noordhuis)

* process: only use F_DUPFD_CLOEXEC if it is defined (Jameson Nash)

* win,poll: add the MSAFD GUID for AF_UNIX (roflcopter4)

* unix: simplify uv__cloexec_fcntl() (Ben Noordhuis)

* doc: add secondary GPG ID for vtjnash (Jameson Nash)

* unix: remove uv__cloexec_ioctl() (Jameson Nash)


2022.01.05, Version 1.43.0 (Stable), 988f2bfc4defb9a85a536a3e645834c161143ee0

Changes since version 1.42.0:

* run test named ip6_sin6_len (Jameson Nash)

* docs: fix wrong information about scheduling (Mohamed Edrah)

* unix: protect fork in uv_spawn from signals (Jameson Nash)

* drop only successfully sent packets post sendmmsg (Supragya Raj)

* test: fix typo in test-tty-escape-sequence-processing.c (Ikko Ashimine)

* cmake: use standard installation layout always (Sylvain Corlay)

* win,spawn: allow UNC path with forward slash (earnal)

* win,fsevent: fix uv_fs_event_stop() assert (Ben Noordhuis)

* unix: remove redundant include in unix.h (Juan José Arboleda)

* doc: mark SmartOS as Tier 3 support (Ben Noordhuis)

* doc: fix broken links for netbsd's sysctl manpage (YAKSH BARIYA)

* misc: adjust stalebot deadline (Ben Noordhuis)

* test: remove `dns-server.c` as it is not used anywhere (Darshan Sen)

* build: fix non-cmake android builds (YAKSH BARIYA)

* doc: replace pyuv with uvloop (Ofek Lev)

* asan: fix some tests (Jameson Nash)

* build: add experimental TSAN configuration (Jameson Nash)

* pipe: remove useless assertion (~locpyl-tidnyd)

* bsd: destroy mutex in uv__process_title_cleanup() (Darshan Sen)

* build: add windows build to CI (Darshan Sen)

* win,fs: fix error code in uv_fs_read() and uv_fs_write() (Darshan Sen)

* build: add macos-latest to ci matrix (Ben Noordhuis)

* udp: fix &/&& typo in macro condition (Evan Miller)

* build: install cmake package module (Petr Menšík)

* win: fix build for mingw32 (Nicolas Noble)

* build: fix build failures with MinGW new headers (erw7)

* build: fix win build with cmake versions before v3.14 (AJ Heller)

* unix: support aarch64 in uv_cpu_info() (Juan José Arboleda)

* linux: work around CIFS EPERM bug (Ben Noordhuis)

* sunos: Oracle Developer Studio support (Stacey Marshall)

* Revert "sunos: Oracle Developer Studio support (cjihrig)

* sunos: Oracle Developer Studio support (Stacey Marshall)

* stream: permit read after seeing EOF (Jameson Nash)

* thread: initialize uv_thread_self for all threads (Jameson Nash)

* kqueue: ignore write-end closed notifications (Jameson Nash)

* macos: fix the cfdata length in uv__get_cpu_speed (Jesper Storm Bache)

* unix,win: add uv_ip_name to get name from sockaddr (Campbell He)

* win,test: fix a few typos (AJ Heller)

* zos: use destructor for uv__threadpool_cleanup() (Wayne Zhang)

* linux: use MemAvailable instead of MemFree (Andrey Hohutkin)

* freebsd: call dlerror() only if necessary (Jameson Nash)

* bsd,windows,zos: fix udp disconnect EINVAL (deal)


2021.07.21, Version 1.42.0 (Stable), 6ce14710da7079eb248868171f6343bc409ea3a4

Changes since version 1.41.0:

* doc: fix code highlighting (Darshan Sen)

* test: move to ASSERT_NULL and ASSERT_NOT_NULL test macros (tjarlama)

* zos: build in ascii code page (Shuowang (Wayne) Zhang)

* zos: don't use nanosecond timestamp fields (Shuowang (Wayne) Zhang)

* zos: introduce zoslib (Shuowang (Wayne) Zhang)

* zos: use strnlen() from zoslib (Shuowang (Wayne) Zhang)

* zos: use nanosleep() from zoslib (Shuowang (Wayne) Zhang)

* zos: use __getargv() from zoslib to get exe path (Shuowang (Wayne) Zhang)

* zos: treat __rfim_utok as binary (Shuowang (Wayne) Zhang)

* zos: use execvpe() to set environ explictly (Shuowang (Wayne) Zhang)

* zos: use custom proctitle implementation (Shuowang (Wayne) Zhang)

* doc: add instructions for building on z/OS (Shuowang (Wayne) Zhang)

* linux,udp: enable full ICMP error reporting (Ondřej Surý)

* test: fix test-udp-send-unreachable (Ondřej Surý)

* include: fix typo in documentation (Tobias Nießen)

* chore: use for(;;) instead of while (Yash Ladha)

* test: remove string + int warning on udp-pummel (Juan José Arboleda)

* cmake: fix linker flags (Zhao Zhili)

* test: fix stack-use-after-scope (Zhao Zhili)

* unix: expose thread_stack_size() internally (Brandon Cheng)

* darwin: use RLIMIT_STACK for fsevents pthread (Brandon Cheng)

* darwin: abort on pthread_attr_init fail (Brandon Cheng)

* benchmark: remove unreachable code (Matvii Hodovaniuk)

* macos: fix memleaks in uv__get_cpu_speed (George Zhao)

* Make Thread Sanitizer aware of file descriptor close in uv__close() (Ondřej
  Surý)

* darwin: fix iOS compilation and functionality (Hayden)

* linux: work around copy_file_range() cephfs bug (Ben Noordhuis)

* zos: implement uv_get_constrained_memory() (Shuowang (Wayne) Zhang)

* zos: fix uv_get_free_memory() (Shuowang (Wayne) Zhang)

* zos: use CVTRLSTG to get total memory accurately (Shuowang (Wayne) Zhang)

* ibmi: Handle interface names longer than 10 chars (Kevin Adler)

* docs: update read-the-docs version of sphinx (Jameson Nash)

* unix: refactor uv_try_write (twosee)

* linux-core: add proper divide by zero assert (yiyuaner)

* misc: remove unnecessary _GNU_SOURCE macros (Darshan Sen)

* test: log to stdout to conform TAP spec (bbara)

* win,fs: fix C4090 warning with MSVC (SeverinLeonhardt)

* build: some systems provide dlopen() in libc (Andy Fiddaman)

* include: add EOVERFLOW status code mapping (Darshan Sen)

* unix,fs: use uv__load_relaxed and uv__store_relaxed (Darshan Sen)

* win: fix string encoding issue of uv_os_gethostname (Eagle Liang)

* unix,process: add uv__write_errno helper function (Ricky Zhou)

* Re-merge "unix,stream: clear read/write states on close/eof" (Jameson Nash)

* unix,core: fix errno handling in uv__getpwuid_r (Darshan Sen)

* errors: map ESOCKTNOSUPPORT errno (Ryan Liptak)

* doc: uv_read_stop always succeeds (Simon Kissane)

* inet: fix inconsistent return value of inet_ntop6 (twosee)

* darwin: fix -Wsometimes-uninitialized warning (twosee)

* stream: introduce uv_try_write2 function (twosee)

* poll,win: UV_PRIORITIZED option should not assert (twosee)

* src: DragonFlyBSD has mmsghdr struct too (David Carlier)

* cleanup,win: Remove _WIN32 guards on threadpool (James M Snell)

* freebsd: fix an incompatible pointer type warning (Darshan Sen)

* core: Correct the conditionals for {cloexec,nonblock}_ioctl (Ali Mohammad
  Pur)

* win,tcp: make uv_close work more like unix (Jameson Nash)

* doc: more accurate list of valid send_handle's (twosee)

* win,tcp: translate system errors correctly (twosee)

* unix: implement cpu_relax() on ppc64 (Ben Noordhuis)

* docs: move list of project links under PR control (Jameson Nash)

* test: wrong pointer arithmetic multiplier (Erkhes N)

* doc: switch discussion forum to github (Jameson Nash)

* idna: fix OOB read in punycode decoder (Ben Noordhuis)

* build: make sure -fvisibility=hidden is set (Santiago Gimeno)

* illumos: event ports to epoll (tjarlama)

* illumos,tty: UV_TTY_MODE_IO waits for 4 bytes (Joshua M. Clulow)

* doc: add vtjnash GPG ID (Jameson Nash)

* linux: read CPU model information on ppc (Richard Lau)

* darwin: fix uv_barrier race condition (Guilherme Íscaro)

* unix,stream: fix loop hang after uv_shutdown (Jameson Nash)

* doc,udp: note that suggested_size is 1 max-sized dgram (Ryan Liptak)

* mingw: fix building for ARM/AArch64 (Martin Storsjö)

* unix: strnlen is not available on Solaris 10 (Claes Nästén)

* sunos: restore use of event ports (Andy Fiddaman)

* sunos,cmake: use thread-safe errno (Andy Fiddaman)


2021.02.14, Version 1.41.0 (Stable), 1dff88e5161cba5c59276d2070d2e304e4dcb242

Changes since version 1.40.0:

* mailmap: update contact information for richardlau (Richard Lau)

* build: add asan checks (gengjiawen)

* unix: report bind error in uv_tcp_connect() (Ben Noordhuis)

* doc: uv_tcp_bind() never returns UV_EADDRINUSE (Ben Noordhuis)

* test: fix pump and tcp_write_batch benchmarks (Santiago Gimeno)

* doc: mark IBM i as Tier 2 support (Jesse Gorzinski)

* doc,poll: add notes (repeated cb & cancel pending cb) (Elad Nachmias)

* linux: fix -Wincompatible-pointer-types warning (Ben Noordhuis)

* linux: fix -Wsign-compare warning (Ben Noordhuis)

* android: add system call api guards (Ben Noordhuis)

* unix,win: harmonize uv_read_start() error handling (Ben Noordhuis)

* unix,win: more uv_read_start() argument validation (Ben Noordhuis)

* build: turn on -fno-strict-aliasing (Ben Noordhuis)

* stream: add uv_pipe and uv_socketpair to the API (Jameson Nash)

* unix,win: initialize timer `timeout` field (Ben Noordhuis)

* bsd-ifaddrs: improve comments (Darshan Sen)

* test: remove unnecessary uv_fs_stat() calls (Ben Noordhuis)

* fs: fix utime/futime timestamp rounding errors (Ben Noordhuis)

* test: ensure reliable floating point comparison (Jameson Nash)

* unix,fs: fix uv_fs_sendfile() (Santiago Gimeno)

* unix: fix uv_fs_stat when using statx (Simon Kadisch)

* linux,macos: fix uv_set_process_title regression (Momtchil Momtchev)

* doc: clarify UDP errors and recvmmsg (Ethel Weston)

* test-getaddrinfo: use example.invalid (Drew DeVault)

* Revert "build: fix android autotools build" (Bernardo Ramos)

* unix,fs: on DVS fs, statx returns EOPNOTSUPP (Mark Klein)

* win, fs: mkdir really return UV_EINVAL for invalid names (Nicholas Vavilov)

* tools: migrate tools/make_dist_html.py to python3 (Dominique Dumont)

* unix: fix uv_uptime() on linux (schamberg97)

* unix: check for partial copy_file_range support (Momtchil Momtchev)

* win: bump minimum supported version to windows 8 (Ben Noordhuis)

* poll,unix: ensure safety of rapid fd reuse (Bob Weinand)

* test: fix some warnings (Issam E. Maghni)

* unix: fix uv_uptime() regression (Santiago Gimeno)

* doc: fix versionadded metadata (cjihrig)

* test: fix 'incompatible pointer types' warnings (cjihrig)

* unix: check for EXDEV in uv__fs_sendfile() (Darshan Sen)


2020.09.26, Version 1.40.0 (Stable), 4e69e333252693bd82d6338d6124f0416538dbfc

Changes since version 1.39.0:

* udp: add UV_UDP_MMSG_FREE recv_cb flag (Ryan Liptak)

* include: re-map UV__EPROTO from 4046 to -4046 (YuMeiJie)

* doc: correct UV_UDP_MMSG_FREE version added (cjihrig)

* doc: add uv_metrics_idle_time() version metadata (Ryan Liptak)

* win,tty: pass through utf-16 surrogate pairs (Mustafa M)

* unix: fix DragonFly BSD build (Aleksej Lebedev)

* win,udp: fix error code returned by connect() (Santiago Gimeno)

* src: suppress user_timeout maybe-uninitialized (Daniel Bevenius)

* test: fix compiler warning (Vladimír Čunát)

* build: fix the Haiku cmake build (David Carlier)

* linux: fix i386 sendmmsg/recvmmsg support (Ben Noordhuis)

* build: add libuv-static pkg-config file (Nikolay Mitev)

* unix,win: add uv_timer_get_due_in() (Ulrik Strid)

* build,unix: add QNX support (Elad Lahav)

* include: remove incorrect UV__ERR() for EPROTO (cjihrig)


2020.08.26, Version 1.39.0 (Stable), 25f4b8b8a3c0f934158cd37a37b0525d75ca488e

Changes since version 1.38.1:

* unix: use relaxed loads/stores for clock id (Ben Noordhuis)

* build,win: link to user32.lib and advapi32.lib (George Zhao)

* unix: squelch harmless valgrind warning (ssrlive)

* include: fx c++ style comments warnings (Turbinya)

* build,cmake: Change installation location on MinGW (erw7)

* linux: use copy_file_range for uv_fs_copyfile when possible (Carter Li)

* win,tcp: avoid reinserting a pending request (

* docs: improve the descriptions for get memory info (Juan Sebastian velez
  Posada)

* test: add udp-mmsg test (Ryan Liptak)

* udp: add uv_udp_using_recvmmsg query (Ryan Liptak)

* doc: add more error constants (TK-one)

* zos: fix potential event loop stall (Trevor Norris)

* include: add internal fields struct to uv_loop_t (Trevor Norris)

* core: add API to measure event loop idle time (Trevor Norris)

* win,fs: use CreateDirectoryW instead of _wmkdir (Mustafa M)

* win,nfc: fix integer comparison signedness (escherstair)

* win,nfc: use

* win,nfc: removed some unused variables (escherstair)

* win,nfc: add missing return statement (escherstair)

* win,nfc: disable clang-format for

* darwin: use IOKit for uv_cpu_info (Evan Lucas)

* test: fix thread race in process_title_threadsafe (Ben Noordhuis)

* win,fs: avoid implicit access to _doserrno (Jameson Nash)

* test: give hrtime test a custom 20s timeout (Jameson Nash)

* build: add more failed test, for qemu version bump (gengjiawen)

* unix: handle src, dest same in uv_fs_copyfile() (cjihrig)

* unix: error when uv_setup_args() is not called (Ryan Liptak)

* aix: protect uv_exepath() from uv_set_process_title() (Richard Lau)

* fs: clobber req->path on uv_fs_mkstemp() error (tjarlama)

* cmake: fix compile error C2001 on Chinese Windows (司徒玟琅)

* test: avoid double evaluation in ASSERT_BASE macro (tjarlama)

* tcp: fail instantly if local port is unbound (Bartosz Sosnowski)

* doc: fix most sphinx warnings (Jameson Nash)

* nfci: address some style nits (Jameson Nash)

* unix: don't use _POSIX_PATH_MAX (Ben Noordhuis)


2020.07.04, Version 1.38.1 (Stable), e8b989ea1f7f9d4083511a2caec7791e9abd1871

Changes since version 1.38.0:

* test: use last matching qemu version (cjihrig)

* win, util: rearrange uv_hrtime (Bartosz Sosnowski)

* test: skip signal_multiple_loops test on QEMU (gengjiawen)

* build: add android build to CI (gengjiawen)

* test: extend fs_event_error_reporting timeout (cjihrig)

* build: link libkvm on netbsd only (Alexander Tokmakov)

* linux: refactor /proc file reader logic (Ben Noordhuis)

* linux: read load average from /proc/loadavg (Ben Noordhuis)

* android: remove patch code for below 21 (gengjiawen)

* win: fix visual studio 2008 build (Arenoros)

* win,tty: fix deadlock caused by inconsistent state (lander0s)

* unix: use relaxed loads/stores for feature checks (Ben Noordhuis)

* build: don't .gitignore m4/ax_pthread.m4 (Ben Noordhuis)

* unix: fix gcc atomics feature check (Ben Noordhuis)

* darwin: work around clock jumping back in time (Ben Noordhuis)

* udp: fix write_queue cleanup on sendmmsg error (Santiago Gimeno)

* src: build fix for Android (David Carlier)
@
text
@a32 21
option(ASAN "Enable AddressSanitizer (ASan)" OFF)
option(TSAN "Enable ThreadSanitizer (TSan)" OFF)

if((ASAN OR TSAN) AND NOT (CMAKE_C_COMPILER_ID MATCHES "AppleClang|GNU|Clang"))
  message(SEND_ERROR "Sanitizer support requires clang or gcc. Try again with -DCMAKE_C_COMPILER.")
endif()

if(ASAN)
  add_definitions(-D__ASAN__=1)
  set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fno-omit-frame-pointer -fsanitize=address")
  set (CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -fno-omit-frame-pointer -fsanitize=address")
  set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fno-omit-frame-pointer -fsanitize=address")
endif()

if(TSAN)
  add_definitions(-D__TSAN__=1)
  set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fno-omit-frame-pointer -fsanitize=thread")
  set (CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -fno-omit-frame-pointer -fsanitize=thread")
  set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fno-omit-frame-pointer -fsanitize=thread")
endif()

a58 2
check_c_compiler_flag(/utf-8 UV_LINT_UTF8_MSVC)

a78 1
set(lint-utf8-msvc $<$<BOOL:${UV_LINT_UTF8_MSVC}>:/utf-8>)
a92 4
list(APPEND uv_cflags ${lint-utf8-msvc} )

check_c_compiler_flag(-fno-strict-aliasing UV_F_STRICT_ALIASING)
list(APPEND uv_cflags $<$<BOOL:${UV_F_STRICT_ALIASING}>:-fno-strict-aliasing>)
a99 1
    src/strtok.c
d107 1
a107 1
  list(APPEND uv_defines WIN32_LEAN_AND_MEAN _WIN32_WINNT=0x0602)
a109 2
       user32
       advapi32
d143 1
a143 1
  if(NOT CMAKE_SYSTEM_NAME MATCHES "Android|OS390|QNX")
a184 1
  list(APPEND uv_defines _GNU_SOURCE)
d187 1
d196 1
a196 1
       src/unix/epoll.c)
d199 1
a199 1
if(APPLE OR CMAKE_SYSTEM_NAME MATCHES "Android|Linux")
d209 1
a231 16
if(CMAKE_SYSTEM_NAME STREQUAL "GNU")
  list(APPEND uv_libraries dl)
  list(APPEND uv_sources
       src/unix/bsd-ifaddrs.c
       src/unix/no-fsevents.c
       src/unix/no-proctitle.c
       src/unix/posix-hrtime.c
       src/unix/posix-poll.c
       src/unix/hurd.c)
endif()

if(CMAKE_SYSTEM_NAME STREQUAL "kFreeBSD")
  list(APPEND uv_defines _GNU_SOURCE)
  list(APPEND uv_libraries dl freebsd-glue)
endif()

d242 1
a242 1
       src/unix/epoll.c)
a246 1
  list(APPEND uv_libraries kvm)
d254 1
a254 2
  enable_language(CXX)
  list(APPEND uv_defines PATH_MAX=1024)
a256 1
  list(APPEND uv_defines _ENHANCED_ASCII_EXT=0xFFFFFFFF)
a266 1
  list(APPEND uv_defines _XOPEN_SOURCE=600)
d271 4
a274 20
       src/unix/os390-syscalls.c
       src/unix/os390-proctitle.c)
  list(APPEND uv_cflags
       -q64
       -qascii
       -qexportall
       -qgonumber
       -qlongname
       -qlibansi
       -qfloat=IEEE
       -qtune=10
       -qarch=10
       -qasm
       -qasmlib=sys1.maclib:sys1.modgen)
  find_library(ZOSLIB
    NAMES zoslib
    PATHS ${ZOSLIB_DIR}
    PATH_SUFFIXES lib
  )
  list(APPEND uv_libraries ${ZOSLIB})
d287 1
d292 1
a292 1
  list(APPEND uv_defines __EXTENSIONS__ _XOPEN_SOURCE=500 _REENTRANT)
d294 1
a294 26
  list(APPEND uv_sources
       src/unix/no-proctitle.c
       src/unix/sunos.c)
endif()

if(CMAKE_SYSTEM_NAME STREQUAL "Haiku")
  list(APPEND uv_defines _BSD_SOURCE)
  list(APPEND uv_libraries bsd network)
  list(APPEND uv_sources
	  src/unix/haiku.c
	  src/unix/bsd-ifaddrs.c
	  src/unix/no-fsevents.c
	  src/unix/no-proctitle.c
	  src/unix/posix-hrtime.c
	  src/unix/posix-poll.c)
endif()

if(CMAKE_SYSTEM_NAME STREQUAL "QNX")
  list(APPEND uv_sources
    src/unix/posix-hrtime.c
    src/unix/posix-poll.c
    src/unix/qnx.c
    src/unix/bsd-ifaddrs.c
    src/unix/no-proctitle.c
    src/unix/no-fsevents.c)
  list(APPEND uv_libraries socket)
a314 4
if(CMAKE_SYSTEM_NAME STREQUAL "OS390")
  target_include_directories(uv PUBLIC $<BUILD_INTERFACE:${ZOSLIB_DIR}/include>)
  set_target_properties(uv PROPERTIES LINKER_LANGUAGE CXX)
endif()
a325 4
if(CMAKE_SYSTEM_NAME STREQUAL "OS390")
  target_include_directories(uv_a PUBLIC $<BUILD_INTERFACE:${ZOSLIB_DIR}/include>)
  set_target_properties(uv_a PROPERTIES LINKER_LANGUAGE CXX)
endif()
a338 1
    test/benchmark-queue-work.c
d352 1
d369 1
a410 1
       test/test-ip-name.c
a419 1
       test/test-metrics.c
a421 2
       test/test-not-readable-nor-writable-on-read-error.c
       test/test-not-writable-after-shutdown.c
a439 1
       test/test-poll-multiple-handles.c
a446 1
       test/test-readable-on-eof.c
a452 1
       test/test-shutdown-simultaneous.c
a460 1
       test/test-strtok.c
a464 1
       test/test-tcp-close-after-read-timeout.c
a476 2
       test/test-tcp-read-stop-start.c
       test/test-tcp-rst.c
a485 1
       test/test-test-macros.c
a499 1
       test/test-udp-connect6.c
a502 1
       test/test-udp-mmsg.c
a512 1
       test/test-udp-sendmmsg-error.c
a541 5
  if(CMAKE_SYSTEM_NAME STREQUAL "OS390")
    set_target_properties(uv_run_benchmarks_a PROPERTIES LINKER_LANGUAGE CXX)
    set_target_properties(uv_run_tests PROPERTIES LINKER_LANGUAGE CXX)
    set_target_properties(uv_run_tests_a PROPERTIES LINKER_LANGUAGE CXX)
  endif()
d544 26
a569 30
# Now for some gibbering horrors from beyond the stars...
foreach(lib IN LISTS uv_libraries)
  list(APPEND LIBS "-l${lib}")
endforeach()
string(REPLACE ";" " " LIBS "${LIBS}")
# Consider setting project version via project() call?
file(STRINGS configure.ac configure_ac REGEX ^AC_INIT)
string(REGEX MATCH "([0-9]+)[.][0-9]+[.][0-9]+" PACKAGE_VERSION "${configure_ac}")
set(UV_VERSION_MAJOR "${CMAKE_MATCH_1}")
# The version in the filename is mirroring the behaviour of autotools.
set_target_properties(uv PROPERTIES
  VERSION ${UV_VERSION_MAJOR}.0.0
  SOVERSION ${UV_VERSION_MAJOR})
set(includedir ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_INCLUDEDIR})
set(libdir ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR})
set(prefix ${CMAKE_INSTALL_PREFIX})
configure_file(libuv.pc.in libuv.pc @@ONLY)
configure_file(libuv-static.pc.in libuv-static.pc @@ONLY)

install(DIRECTORY include/ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
install(FILES LICENSE DESTINATION ${CMAKE_INSTALL_DOCDIR})
install(FILES ${PROJECT_BINARY_DIR}/libuv.pc ${PROJECT_BINARY_DIR}/libuv-static.pc
        DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
install(TARGETS uv EXPORT libuvConfig
        RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
        LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
        ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
install(TARGETS uv_a EXPORT libuvConfig
        ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
install(EXPORT libuvConfig DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/libuv)
d571 6
a576 2
if(MSVC)
  set(CMAKE_DEBUG_POSTFIX d)
d583 1
a583 1
      C compiler:    ${CMAKE_C_COMPILER} (${CMAKE_C_COMPILER_ID})
@


1.1.1.2.4.1
log
@file CMakeLists.txt was added on branch netbsd-9 on 2024-03-01 11:43:32 +0000
@
text
@d1 702
@


1.1.1.2.4.2
log
@Sync external/mit/libuv and apply patch, requested by christos in ticket #1805:

	external/mit/libuv/dist/.github/workflows/CI-sample.yml up to 1.1.1.1
	external/mit/libuv/dist/.github/workflows/CI-unix.yml up to 1.1.1.1
	external/mit/libuv/dist/.github/workflows/CI-win.yml up to 1.1.1.1
	external/mit/libuv/dist/.github/workflows/sanitizer.yml up to 1.1.1.1
	external/mit/libuv/dist/.github/ISSUE_TEMPLATE.md up to 1.1.1.2
	external/mit/libuv/dist/.github/stale.yml       up to 1.1.1.2
	external/mit/libuv/dist/.mailmap                up to 1.1.1.2
	external/mit/libuv/dist/AUTHORS                 up to 1.1.1.2
	external/mit/libuv/dist/CMakeLists.txt          up to 1.1.1.2
	external/mit/libuv/dist/CONTRIBUTING.md         up to 1.1.1.2
	external/mit/libuv/dist/ChangeLog               up to 1.1.1.2
	external/mit/libuv/dist/LICENSE                 up to 1.1.1.2
	external/mit/libuv/dist/LICENSE-docs            up to 1.1.1.1
	external/mit/libuv/dist/MAINTAINERS.md          up to 1.1.1.2
	external/mit/libuv/dist/Makefile.am             up to 1.1.1.2
	external/mit/libuv/dist/README.md               up to 1.1.1.2
	external/mit/libuv/dist/SUPPORTED_PLATFORMS.md  up to 1.1.1.2
	external/mit/libuv/dist/autogen.sh              up to 1.1.1.2
	external/mit/libuv/dist/configure.ac            up to 1.1.1.2
	external/mit/libuv/dist/libuv.pc.in             up to 1.1.1.1
	external/mit/libuv/dist/uv_win_longpath.manifest up to 1.1.1.1
	external/mit/libuv/dist/docs/code/cgi/main.c    up to 1.1.1.2
	external/mit/libuv/dist/docs/code/cgi/tick.c    up to 1.1.1.1
	external/mit/libuv/dist/docs/code/detach/main.c up to 1.1.1.1
	external/mit/libuv/dist/docs/code/dns/main.c    up to 1.1.1.2
	external/mit/libuv/dist/docs/code/helloworld/main.c up to 1.1.1.1
	external/mit/libuv/dist/docs/code/idle-basic/main.c up to 1.1.1.1
	external/mit/libuv/dist/docs/code/idle-compute/main.c up to 1.1.1.1
	external/mit/libuv/dist/docs/code/interfaces/main.c up to 1.1.1.2
	external/mit/libuv/dist/docs/code/locks/main.c  up to 1.1.1.1
	external/mit/libuv/dist/docs/code/multi-echo-server/hammer.js up to 1.1.1.1
	external/mit/libuv/dist/docs/code/multi-echo-server/main.c up to 1.1.1.1
	external/mit/libuv/dist/docs/code/multi-echo-server/worker.c up to 1.1.1.1
	external/mit/libuv/dist/docs/code/onchange/main.c up to 1.1.1.1
	external/mit/libuv/dist/docs/code/pipe-echo-server/main.c up to 1.1.1.1
	external/mit/libuv/dist/docs/code/plugin/hello.c up to 1.1.1.1
	external/mit/libuv/dist/docs/code/plugin/main.c up to 1.1.1.1
	external/mit/libuv/dist/docs/code/plugin/plugin.h up to 1.1.1.1
	external/mit/libuv/dist/docs/code/proc-streams/main.c up to 1.1.1.1
	external/mit/libuv/dist/docs/code/proc-streams/test.c up to 1.1.1.1
	external/mit/libuv/dist/docs/code/progress/main.c up to 1.1.1.1
	external/mit/libuv/dist/docs/code/queue-cancel/main.c up to 1.1.1.1
	external/mit/libuv/dist/docs/code/queue-work/main.c up to 1.1.1.1
	external/mit/libuv/dist/docs/code/ref-timer/main.c up to 1.1.1.1
	external/mit/libuv/dist/docs/code/signal/main.c up to 1.1.1.1
	external/mit/libuv/dist/docs/code/spawn/main.c  up to 1.1.1.1
	external/mit/libuv/dist/docs/code/tcp-echo-server/main.c up to 1.1.1.1
	external/mit/libuv/dist/docs/code/thread-create/main.c up to 1.1.1.2
	external/mit/libuv/dist/docs/code/tty/main.c    up to 1.1.1.1
	external/mit/libuv/dist/docs/code/tty-gravity/main.c up to 1.1.1.1
	external/mit/libuv/dist/docs/code/udp-dhcp/main.c up to 1.1.1.2
	external/mit/libuv/dist/docs/code/uvcat/main.c  up to 1.1.1.2
	external/mit/libuv/dist/docs/code/uvstop/main.c up to 1.1.1.1
	external/mit/libuv/dist/docs/code/uvtee/main.c  up to 1.1.1.2
	external/mit/libuv/dist/docs/code/uvwget/main.c up to 1.1.1.1
	external/mit/libuv/dist/docs/code/default-loop/main.c up to 1.1.1.1
	external/mit/libuv/dist/docs/code/CMakeLists.txt up to 1.1.1.1
	external/mit/libuv/dist/docs/code/Makefile      up to 1.1.1.1
	external/mit/libuv/dist/docs/Makefile           up to 1.1.1.1
	external/mit/libuv/dist/docs/make.bat           up to 1.1.1.1
	external/mit/libuv/dist/docs/src/guide/about.rst up to 1.1.1.1
	external/mit/libuv/dist/docs/src/guide/basics.rst up to 1.1.1.2
	external/mit/libuv/dist/docs/src/guide/eventloops.rst up to 1.1.1.2
	external/mit/libuv/dist/docs/src/guide/filesystem.rst up to 1.1.1.2
	external/mit/libuv/dist/docs/src/guide/introduction.rst up to 1.1.1.2
	external/mit/libuv/dist/docs/src/guide/networking.rst up to 1.1.1.2
	external/mit/libuv/dist/docs/src/guide/processes.rst up to 1.1.1.2
	external/mit/libuv/dist/docs/src/guide/threads.rst up to 1.1.1.2
	external/mit/libuv/dist/docs/src/guide/utilities.rst up to 1.1.1.2
	external/mit/libuv/dist/docs/src/api.rst        up to 1.1.1.2
	external/mit/libuv/dist/docs/src/async.rst      up to 1.1.1.2
	external/mit/libuv/dist/docs/src/check.rst      up to 1.1.1.1
	external/mit/libuv/dist/docs/src/conf.py        up to 1.1.1.1
	external/mit/libuv/dist/docs/src/design.rst     up to 1.1.1.2
	external/mit/libuv/dist/docs/src/dll.rst        up to 1.1.1.1
	external/mit/libuv/dist/docs/src/dns.rst        up to 1.1.1.1
	external/mit/libuv/dist/docs/src/errors.rst     up to 1.1.1.2
	external/mit/libuv/dist/docs/src/fs.rst         up to 1.1.1.2
	external/mit/libuv/dist/docs/src/fs_event.rst   up to 1.1.1.1
	external/mit/libuv/dist/docs/src/fs_poll.rst    up to 1.1.1.1
	external/mit/libuv/dist/docs/src/guide.rst      up to 1.1.1.1
	external/mit/libuv/dist/docs/src/handle.rst     up to 1.1.1.2
	external/mit/libuv/dist/docs/src/idle.rst       up to 1.1.1.1
	external/mit/libuv/dist/docs/src/index.rst      up to 1.1.1.2
	external/mit/libuv/dist/docs/src/loop.rst       up to 1.1.1.2
	external/mit/libuv/dist/docs/src/migration_010_100.rst up to 1.1.1.1
	external/mit/libuv/dist/docs/src/misc.rst       up to 1.1.1.2
	external/mit/libuv/dist/docs/src/pipe.rst       up to 1.1.1.2
	external/mit/libuv/dist/docs/src/poll.rst       up to 1.1.1.2
	external/mit/libuv/dist/docs/src/prepare.rst    up to 1.1.1.1
	external/mit/libuv/dist/docs/src/process.rst    up to 1.1.1.2
	external/mit/libuv/dist/docs/src/tcp.rst        up to 1.1.1.2
	external/mit/libuv/dist/docs/src/request.rst    up to 1.1.1.2
	external/mit/libuv/dist/docs/src/signal.rst     up to 1.1.1.1
	external/mit/libuv/dist/docs/src/stream.rst     up to 1.1.1.2
	external/mit/libuv/dist/docs/src/threading.rst  up to 1.1.1.1
	external/mit/libuv/dist/docs/src/threadpool.rst up to 1.1.1.1
	external/mit/libuv/dist/docs/src/timer.rst      up to 1.1.1.2
	external/mit/libuv/dist/docs/src/tty.rst        up to 1.1.1.2
	external/mit/libuv/dist/docs/src/udp.rst        up to 1.1.1.2
	external/mit/libuv/dist/docs/src/upgrading.rst  up to 1.1.1.1
	external/mit/libuv/dist/docs/src/version.rst    up to 1.1.1.1
	external/mit/libuv/dist/docs/src/sphinx-plugins/manpage.py up to 1.1.1.2
	external/mit/libuv/dist/docs/src/static/diagrams.key/Data/st0-311.jpg up to 1.1.1.1
	external/mit/libuv/dist/docs/src/static/diagrams.key/Data/st1-475.jpg up to 1.1.1.1
	external/mit/libuv/dist/docs/src/static/diagrams.key/Index.zip up to 1.1.1.1
	external/mit/libuv/dist/docs/src/static/diagrams.key/preview-micro.jpg up to 1.1.1.1
	external/mit/libuv/dist/docs/src/static/diagrams.key/preview-web.jpg up to 1.1.1.1
	external/mit/libuv/dist/docs/src/static/diagrams.key/preview.jpg up to 1.1.1.1
	external/mit/libuv/dist/docs/src/static/diagrams.key/Metadata/BuildVersionHistory.plist up to 1.1.1.1
	external/mit/libuv/dist/docs/src/static/diagrams.key/Metadata/DocumentIdentifier up to 1.1.1.1
	external/mit/libuv/dist/docs/src/static/diagrams.key/Metadata/Properties.plist up to 1.1.1.1
	external/mit/libuv/dist/docs/src/static/architecture.png up to 1.1.1.1
	external/mit/libuv/dist/docs/src/static/favicon.ico up to 1.1.1.1
	external/mit/libuv/dist/docs/src/static/logo.png up to 1.1.1.1
	external/mit/libuv/dist/docs/src/static/loop_iteration.png up to 1.1.1.1
	external/mit/libuv/dist/docs/src/metrics.rst    up to 1.1.1.1
	external/mit/libuv/dist/docs/requirements.txt   up to 1.1.1.1
	external/mit/libuv/dist/img/banner.png          up to 1.1.1.1
	external/mit/libuv/dist/img/logos.svg           up to 1.1.1.1
	external/mit/libuv/dist/include/uv/darwin.h     up to 1.1.1.1
	external/mit/libuv/dist/include/uv/aix.h        up to 1.1.1.1
	external/mit/libuv/dist/include/uv/bsd.h        up to 1.1.1.1
	external/mit/libuv/dist/include/uv/errno.h      up to 1.1.1.2
	external/mit/libuv/dist/include/uv/linux.h      up to 1.1.1.1
	external/mit/libuv/dist/include/uv/os390.h      up to 1.1.1.1
	external/mit/libuv/dist/include/uv/posix.h      up to 1.1.1.1
	external/mit/libuv/dist/include/uv/stdint-msvc2008.h up to 1.1.1.1
	external/mit/libuv/dist/include/uv/sunos.h      up to 1.1.1.1
	external/mit/libuv/dist/include/uv/threadpool.h up to 1.1.1.1
	external/mit/libuv/dist/include/uv/tree.h       up to 1.1.1.2
	external/mit/libuv/dist/include/uv/unix.h       up to 1.1.1.2
	external/mit/libuv/dist/include/uv/version.h    up to 1.1.1.2
	external/mit/libuv/dist/include/uv/win.h        up to 1.1.1.2
	external/mit/libuv/dist/include/uv.h            up to 1.1.1.2
	external/mit/libuv/dist/m4/as_case.m4           up to 1.1.1.1
	external/mit/libuv/dist/m4/ax_pthread.m4        up to 1.1.1.1
	external/mit/libuv/dist/m4/libuv-check-flags.m4 up to 1.1.1.2
	external/mit/libuv/dist/m4/libuv-check-versions.m4 up to 1.1.1.1
	external/mit/libuv/dist/src/unix/aix-common.c   up to 1.1.1.2
	external/mit/libuv/dist/src/unix/aix.c          up to 1.1.1.2
	external/mit/libuv/dist/src/unix/async.c        up to 1.1.1.2
	external/mit/libuv/dist/src/unix/atomic-ops.h   up to 1.1.1.2
	external/mit/libuv/dist/src/unix/bsd-ifaddrs.c  up to 1.1.1.2
	external/mit/libuv/dist/src/unix/bsd-proctitle.c up to 1.1.1.2
	external/mit/libuv/dist/src/unix/core.c         up to 1.1.1.2
	external/mit/libuv/dist/src/unix/cygwin.c       up to 1.1.1.1
	external/mit/libuv/dist/src/unix/darwin-proctitle.c up to 1.1.1.1
	external/mit/libuv/dist/src/unix/darwin-stub.h  up to 1.1.1.2
	external/mit/libuv/dist/src/unix/darwin.c       up to 1.1.1.2
	external/mit/libuv/dist/src/unix/dl.c           up to 1.1.1.2
	external/mit/libuv/dist/src/unix/freebsd.c      up to 1.1.1.2
	external/mit/libuv/dist/src/unix/fs.c           up to 1.1.1.2
	external/mit/libuv/dist/src/unix/fsevents.c     up to 1.1.1.2
	external/mit/libuv/dist/src/unix/getaddrinfo.c  up to 1.1.1.2
	external/mit/libuv/dist/src/unix/getnameinfo.c  up to 1.1.1.1
	external/mit/libuv/dist/src/unix/haiku.c        up to 1.1.1.1
	external/mit/libuv/dist/src/unix/ibmi.c         up to 1.1.1.2
	external/mit/libuv/dist/src/unix/internal.h     up to 1.1.1.2
	external/mit/libuv/dist/src/unix/loop.c         up to 1.1.1.2
	external/mit/libuv/dist/src/unix/kqueue.c       up to 1.1.1.2
	external/mit/libuv/dist/src/unix/linux-core.c   up to 1.1.1.2
	external/mit/libuv/dist/src/unix/linux-inotify.c up to 1.1.1.2
	external/mit/libuv/dist/src/unix/linux-syscalls.c up to 1.1.1.2
	external/mit/libuv/dist/src/unix/linux-syscalls.h up to 1.1.1.2
	external/mit/libuv/dist/src/unix/loop-watcher.c up to 1.1.1.1
	external/mit/libuv/dist/src/unix/netbsd.c       up to 1.1.1.1
	external/mit/libuv/dist/src/unix/no-fsevents.c  up to 1.1.1.1
	external/mit/libuv/dist/src/unix/no-proctitle.c up to 1.1.1.1
	external/mit/libuv/dist/src/unix/openbsd.c      up to 1.1.1.1
	external/mit/libuv/dist/src/unix/os390-syscalls.c up to 1.1.1.2
	external/mit/libuv/dist/src/unix/os390-syscalls.h up to 1.1.1.2
	external/mit/libuv/dist/src/unix/os390.c        up to 1.1.1.2
	external/mit/libuv/dist/src/unix/pipe.c         up to 1.1.1.2
	external/mit/libuv/dist/src/unix/poll.c         up to 1.1.1.2
	external/mit/libuv/dist/src/unix/posix-hrtime.c up to 1.1.1.1
	external/mit/libuv/dist/src/unix/posix-poll.c   up to 1.1.1.2
	external/mit/libuv/dist/src/unix/process.c      up to 1.1.1.2
	external/mit/libuv/dist/src/unix/procfs-exepath.c up to 1.1.1.1
	external/mit/libuv/dist/src/unix/proctitle.c    up to 1.1.1.2
	external/mit/libuv/dist/src/unix/pthread-fixes.c up to 1.1.1.2
	external/mit/libuv/dist/src/unix/random-devurandom.c up to 1.1.1.1
	external/mit/libuv/dist/src/unix/signal.c       up to 1.1.1.2
	external/mit/libuv/dist/src/unix/random-getentropy.c up to 1.1.1.1
	external/mit/libuv/dist/src/unix/random-getrandom.c up to 1.1.1.1
	external/mit/libuv/dist/src/unix/random-sysctl-linux.c up to 1.1.1.1
	external/mit/libuv/dist/src/unix/spinlock.h     up to 1.1.1.1
	external/mit/libuv/dist/src/unix/stream.c       up to 1.1.1.2
	external/mit/libuv/dist/src/unix/sunos.c        up to 1.1.1.2
	external/mit/libuv/dist/src/unix/sysinfo-loadavg.c up to 1.1.1.1
	external/mit/libuv/dist/src/unix/sysinfo-memory.c up to 1.1.1.1
	external/mit/libuv/dist/src/unix/tcp.c          up to 1.1.1.2
	external/mit/libuv/dist/src/unix/thread.c       up to 1.1.1.2
	external/mit/libuv/dist/src/unix/tty.c          up to 1.1.1.2
	external/mit/libuv/dist/src/unix/udp.c          up to 1.1.1.2
	external/mit/libuv/dist/src/unix/epoll.c        up to 1.1.1.1
	external/mit/libuv/dist/src/unix/hurd.c         up to 1.1.1.1
	external/mit/libuv/dist/src/unix/os390-proctitle.c up to 1.1.1.1
	external/mit/libuv/dist/src/unix/qnx.c          up to 1.1.1.1
	external/mit/libuv/dist/src/fs-poll.c           up to 1.1.1.2
	external/mit/libuv/dist/src/heap-inl.h          up to 1.1.1.1
	external/mit/libuv/dist/src/idna.c              up to 1.1.1.2
	external/mit/libuv/dist/src/idna.h              up to 1.1.1.1
	external/mit/libuv/dist/src/inet.c              up to 1.1.1.2
	external/mit/libuv/dist/src/queue.h             up to 1.1.1.1
	external/mit/libuv/dist/src/random.c            up to 1.1.1.2
	external/mit/libuv/dist/src/strscpy.c           up to 1.1.1.2
	external/mit/libuv/dist/src/strscpy.h           up to 1.1.1.2
	external/mit/libuv/dist/src/threadpool.c        up to 1.1.1.2
	external/mit/libuv/dist/src/timer.c             up to 1.1.1.2
	external/mit/libuv/dist/src/uv-common.c         up to 1.1.1.2
	external/mit/libuv/dist/src/uv-common.h         up to 1.1.1.2
	external/mit/libuv/dist/src/uv-data-getter-setters.c up to 1.1.1.2
	external/mit/libuv/dist/src/version.c           up to 1.1.1.1
	external/mit/libuv/dist/src/win/async.c         up to 1.1.1.2
	external/mit/libuv/dist/src/win/atomicops-inl.h up to 1.1.1.2
	external/mit/libuv/dist/src/win/core.c          up to 1.1.1.2
	external/mit/libuv/dist/src/win/detect-wakeup.c up to 1.1.1.2
	external/mit/libuv/dist/src/win/dl.c            up to 1.1.1.1
	external/mit/libuv/dist/src/win/error.c         up to 1.1.1.2
	external/mit/libuv/dist/src/win/fs-event.c      up to 1.1.1.2
	external/mit/libuv/dist/src/win/fs-fd-hash-inl.h up to 1.1.1.2
	external/mit/libuv/dist/src/win/fs.c            up to 1.1.1.2
	external/mit/libuv/dist/src/win/getaddrinfo.c   up to 1.1.1.1
	external/mit/libuv/dist/src/win/getnameinfo.c   up to 1.1.1.1
	external/mit/libuv/dist/src/win/handle-inl.h    up to 1.1.1.2
	external/mit/libuv/dist/src/win/handle.c        up to 1.1.1.2
	external/mit/libuv/dist/src/win/internal.h      up to 1.1.1.2
	external/mit/libuv/dist/src/win/loop-watcher.c  up to 1.1.1.2
	external/mit/libuv/dist/src/win/pipe.c          up to 1.1.1.2
	external/mit/libuv/dist/src/win/poll.c          up to 1.1.1.2
	external/mit/libuv/dist/src/win/process-stdio.c up to 1.1.1.2
	external/mit/libuv/dist/src/win/process.c       up to 1.1.1.2
	external/mit/libuv/dist/src/win/req-inl.h       up to 1.1.1.2
	external/mit/libuv/dist/src/win/signal.c        up to 1.1.1.2
	external/mit/libuv/dist/src/win/snprintf.c      up to 1.1.1.1
	external/mit/libuv/dist/src/win/stream-inl.h    up to 1.1.1.2
	external/mit/libuv/dist/src/win/stream.c        up to 1.1.1.2
	external/mit/libuv/dist/src/win/tcp.c           up to 1.1.1.2
	external/mit/libuv/dist/src/win/thread.c        up to 1.1.1.2
	external/mit/libuv/dist/src/win/tty.c           up to 1.1.1.2
	external/mit/libuv/dist/src/win/udp.c           up to 1.1.1.2
	external/mit/libuv/dist/src/win/util.c          up to 1.1.1.2
	external/mit/libuv/dist/src/win/winapi.c        up to 1.1.1.2
	external/mit/libuv/dist/src/win/winapi.h        up to 1.1.1.2
	external/mit/libuv/dist/src/win/winsock.c       up to 1.1.1.2
	external/mit/libuv/dist/src/win/winsock.h       up to 1.1.1.1
	external/mit/libuv/dist/src/strtok.c            up to 1.1.1.1
	external/mit/libuv/dist/src/strtok.h            up to 1.1.1.1
	external/mit/libuv/dist/test/fixtures/empty_file up to 1.1.1.1
	external/mit/libuv/dist/test/fixtures/load_error.node up to 1.1.1.1
	external/mit/libuv/dist/test/fixtures/lorem_ipsum.txt up to 1.1.1.1
	external/mit/libuv/dist/test/benchmark-async-pummel.c up to 1.1.1.2
	external/mit/libuv/dist/test/benchmark-async.c  up to 1.1.1.2
	external/mit/libuv/dist/test/benchmark-fs-stat.c up to 1.1.1.1
	external/mit/libuv/dist/test/benchmark-getaddrinfo.c up to 1.1.1.1
	external/mit/libuv/dist/test/benchmark-list.h   up to 1.1.1.2
	external/mit/libuv/dist/test/benchmark-loop-count.c up to 1.1.1.1
	external/mit/libuv/dist/test/benchmark-million-async.c up to 1.1.1.2
	external/mit/libuv/dist/test/benchmark-million-timers.c up to 1.1.1.2
	external/mit/libuv/dist/test/benchmark-multi-accept.c up to 1.1.1.2
	external/mit/libuv/dist/test/benchmark-ping-pongs.c up to 1.1.1.1
	external/mit/libuv/dist/test/benchmark-ping-udp.c up to 1.1.1.2
	external/mit/libuv/dist/test/benchmark-pound.c  up to 1.1.1.2
	external/mit/libuv/dist/test/benchmark-pump.c   up to 1.1.1.2
	external/mit/libuv/dist/test/benchmark-sizes.c  up to 1.1.1.1
	external/mit/libuv/dist/test/task.h             up to 1.1.1.2
	external/mit/libuv/dist/test/benchmark-spawn.c  up to 1.1.1.1
	external/mit/libuv/dist/test/benchmark-tcp-write-batch.c up to 1.1.1.2
	external/mit/libuv/dist/test/benchmark-thread.c up to 1.1.1.1
	external/mit/libuv/dist/test/benchmark-udp-pummel.c up to 1.1.1.2
	external/mit/libuv/dist/test/blackhole-server.c up to 1.1.1.2
	external/mit/libuv/dist/test/echo-server.c      up to 1.1.1.2
	external/mit/libuv/dist/test/run-benchmarks.c   up to 1.1.1.2
	external/mit/libuv/dist/test/run-tests.c        up to 1.1.1.2
	external/mit/libuv/dist/test/runner-unix.c      up to 1.1.1.2
	external/mit/libuv/dist/test/runner-unix.h      up to 1.1.1.1
	external/mit/libuv/dist/test/runner-win.c       up to 1.1.1.1
	external/mit/libuv/dist/test/runner-win.h       up to 1.1.1.1
	external/mit/libuv/dist/test/runner.c           up to 1.1.1.2
	external/mit/libuv/dist/test/runner.h           up to 1.1.1.1
	external/mit/libuv/dist/test/test-active.c      up to 1.1.1.2
	external/mit/libuv/dist/test/test-async-null-cb.c up to 1.1.1.1
	external/mit/libuv/dist/test/test-async.c       up to 1.1.1.2
	external/mit/libuv/dist/test/test-barrier.c     up to 1.1.1.1
	external/mit/libuv/dist/test/test-close-fd.c    up to 1.1.1.2
	external/mit/libuv/dist/test/test-ip-name.c     up to 1.1.1.1
	external/mit/libuv/dist/test/test-callback-stack.c up to 1.1.1.2
	external/mit/libuv/dist/test/test-close-order.c up to 1.1.1.2
	external/mit/libuv/dist/test/test-condvar.c     up to 1.1.1.1
	external/mit/libuv/dist/test/test-connect-unspecified.c up to 1.1.1.1
	external/mit/libuv/dist/test/test-connection-fail.c up to 1.1.1.1
	external/mit/libuv/dist/test/test-cwd-and-chdir.c up to 1.1.1.1
	external/mit/libuv/dist/test/test-default-loop-close.c up to 1.1.1.2
	external/mit/libuv/dist/test/test-delayed-accept.c up to 1.1.1.2
	external/mit/libuv/dist/test/test-dlerror.c     up to 1.1.1.2
	external/mit/libuv/dist/test/test-eintr-handling.c up to 1.1.1.1
	external/mit/libuv/dist/test/test-embed.c       up to 1.1.1.2
	external/mit/libuv/dist/test/test-emfile.c      up to 1.1.1.1
	external/mit/libuv/dist/test/test-env-vars.c    up to 1.1.1.1
	external/mit/libuv/dist/test/test-error.c       up to 1.1.1.2
	external/mit/libuv/dist/test/test-fail-always.c up to 1.1.1.1
	external/mit/libuv/dist/test/test-fork.c        up to 1.1.1.1
	external/mit/libuv/dist/test/test-fs-copyfile.c up to 1.1.1.2
	external/mit/libuv/dist/test/test-fs-event.c    up to 1.1.1.2
	external/mit/libuv/dist/test/test-fs-fd-hash.c  up to 1.1.1.1
	external/mit/libuv/dist/test/test-fs-open-flags.c up to 1.1.1.2
	external/mit/libuv/dist/test/test-fs-poll.c     up to 1.1.1.2
	external/mit/libuv/dist/test/test-fs-readdir.c  up to 1.1.1.2
	external/mit/libuv/dist/test/test-fs.c          up to 1.1.1.2
	external/mit/libuv/dist/test/test-get-currentexe.c up to 1.1.1.2
	external/mit/libuv/dist/test/test-get-loadavg.c up to 1.1.1.1
	external/mit/libuv/dist/test/test-get-memory.c  up to 1.1.1.1
	external/mit/libuv/dist/test/test-get-passwd.c  up to 1.1.1.2
	external/mit/libuv/dist/test/test-getaddrinfo.c up to 1.1.1.2
	external/mit/libuv/dist/test/test-gethostname.c up to 1.1.1.1
	external/mit/libuv/dist/test/test-getnameinfo.c up to 1.1.1.2
	external/mit/libuv/dist/test/test-getsockname.c up to 1.1.1.2
	external/mit/libuv/dist/test/test-getters-setters.c up to 1.1.1.2
	external/mit/libuv/dist/test/test-gettimeofday.c up to 1.1.1.1
	external/mit/libuv/dist/test/test-handle-fileno.c up to 1.1.1.1
	external/mit/libuv/dist/test/test-homedir.c     up to 1.1.1.1
	external/mit/libuv/dist/test/test-hrtime.c      up to 1.1.1.1
	external/mit/libuv/dist/test/test-idle.c        up to 1.1.1.2
	external/mit/libuv/dist/test/test-idna.c        up to 1.1.1.2
	external/mit/libuv/dist/test/test-ip4-addr.c    up to 1.1.1.1
	external/mit/libuv/dist/test/test-ip6-addr.c    up to 1.1.1.2
	external/mit/libuv/dist/test/test-ipc-heavy-traffic-deadlock-bug.c up to 1.1.1.2
	external/mit/libuv/dist/test/test-ipc-send-recv.c up to 1.1.1.2
	external/mit/libuv/dist/test/test-ipc.c         up to 1.1.1.2
	external/mit/libuv/dist/test/test-list.h        up to 1.1.1.2
	external/mit/libuv/dist/test/test-loop-alive.c  up to 1.1.1.1
	external/mit/libuv/dist/test/test-loop-close.c  up to 1.1.1.1
	external/mit/libuv/dist/test/test-loop-configure.c up to 1.1.1.1
	external/mit/libuv/dist/test/test-loop-handles.c up to 1.1.1.2
	external/mit/libuv/dist/test/test-loop-stop.c   up to 1.1.1.1
	external/mit/libuv/dist/test/test-loop-time.c   up to 1.1.1.2
	external/mit/libuv/dist/test/test-multiple-listen.c up to 1.1.1.2
	external/mit/libuv/dist/test/test-mutexes.c     up to 1.1.1.1
	external/mit/libuv/dist/test/test-osx-select.c  up to 1.1.1.1
	external/mit/libuv/dist/test/test-poll-oob.c    up to 1.1.1.1
	external/mit/libuv/dist/test/test-pass-always.c up to 1.1.1.1
	external/mit/libuv/dist/test/test-ping-pong.c   up to 1.1.1.2
	external/mit/libuv/dist/test/test-pipe-bind-error.c up to 1.1.1.2
	external/mit/libuv/dist/test/test-pipe-close-stdout-read-stdin.c up to 1.1.1.1
	external/mit/libuv/dist/test/test-pipe-connect-error.c up to 1.1.1.2
	external/mit/libuv/dist/test/test-pipe-connect-multiple.c up to 1.1.1.1
	external/mit/libuv/dist/test/test-pipe-connect-prepare.c up to 1.1.1.2
	external/mit/libuv/dist/test/test-pipe-getsockname.c up to 1.1.1.2
	external/mit/libuv/dist/test/test-pipe-pending-instances.c up to 1.1.1.1
	external/mit/libuv/dist/test/test-pipe-sendmsg.c up to 1.1.1.1
	external/mit/libuv/dist/test/test-pipe-server-close.c up to 1.1.1.2
	external/mit/libuv/dist/test/test-pipe-set-fchmod.c up to 1.1.1.1
	external/mit/libuv/dist/test/test-pipe-set-non-blocking.c up to 1.1.1.2
	external/mit/libuv/dist/test/test-platform-output.c up to 1.1.1.2
	external/mit/libuv/dist/test/test-poll-close.c  up to 1.1.1.1
	external/mit/libuv/dist/test/test-poll-close-doesnt-corrupt-stack.c up to 1.1.1.1
	external/mit/libuv/dist/test/test-poll-closesocket.c up to 1.1.1.1
	external/mit/libuv/dist/test/test-poll.c        up to 1.1.1.2
	external/mit/libuv/dist/test/test-process-priority.c up to 1.1.1.1
	external/mit/libuv/dist/test/test-process-title-threadsafe.c up to 1.1.1.2
	external/mit/libuv/dist/test/test-process-title.c up to 1.1.1.1
	external/mit/libuv/dist/test/test-queue-foreach-delete.c up to 1.1.1.1
	external/mit/libuv/dist/test/test-random.c      up to 1.1.1.1
	external/mit/libuv/dist/test/test-ref.c         up to 1.1.1.2
	external/mit/libuv/dist/test/test-run-nowait.c  up to 1.1.1.1
	external/mit/libuv/dist/test/test-run-once.c    up to 1.1.1.1
	external/mit/libuv/dist/test/test-semaphore.c   up to 1.1.1.1
	external/mit/libuv/dist/test/test-shutdown-close.c up to 1.1.1.1
	external/mit/libuv/dist/test/test-shutdown-eof.c up to 1.1.1.2
	external/mit/libuv/dist/test/test-shutdown-twice.c up to 1.1.1.1
	external/mit/libuv/dist/test/test-signal.c      up to 1.1.1.1
	external/mit/libuv/dist/test/test-spawn.c       up to 1.1.1.2
	external/mit/libuv/dist/test/test-signal-multiple-loops.c up to 1.1.1.2
	external/mit/libuv/dist/test/test-signal-pending-on-close.c up to 1.1.1.2
	external/mit/libuv/dist/test/test-socket-buffer-size.c up to 1.1.1.1
	external/mit/libuv/dist/test/test-stdio-over-pipes.c up to 1.1.1.1
	external/mit/libuv/dist/test/test-strscpy.c     up to 1.1.1.1
	external/mit/libuv/dist/test/test-tcp-alloc-cb-fail.c up to 1.1.1.2
	external/mit/libuv/dist/test/test-tcp-bind-error.c up to 1.1.1.2
	external/mit/libuv/dist/test/test-tcp-bind6-error.c up to 1.1.1.2
	external/mit/libuv/dist/test/test-tcp-close-accept.c up to 1.1.1.1
	external/mit/libuv/dist/test/test-tcp-close-reset.c up to 1.1.1.2
	external/mit/libuv/dist/test/test-tcp-close-while-connecting.c up to 1.1.1.1
	external/mit/libuv/dist/test/test-tcp-close.c   up to 1.1.1.2
	external/mit/libuv/dist/test/test-tcp-connect-error-after-write.c up to 1.1.1.1
	external/mit/libuv/dist/test/test-tcp-flags.c   up to 1.1.1.1
	external/mit/libuv/dist/test/test-tcp-oob.c     up to 1.1.1.1
	external/mit/libuv/dist/test/test-tcp-connect-error.c up to 1.1.1.2
	external/mit/libuv/dist/test/test-tcp-connect-timeout.c up to 1.1.1.2
	external/mit/libuv/dist/test/test-tcp-connect6-error.c up to 1.1.1.2
	external/mit/libuv/dist/test/test-tcp-create-socket-early.c up to 1.1.1.2
	external/mit/libuv/dist/test/test-tcp-open.c    up to 1.1.1.2
	external/mit/libuv/dist/test/test-tcp-read-stop.c up to 1.1.1.1
	external/mit/libuv/dist/test/test-tcp-shutdown-after-write.c up to 1.1.1.1
	external/mit/libuv/dist/test/test-tcp-try-write-error.c up to 1.1.1.1
	external/mit/libuv/dist/test/test-tcp-try-write.c up to 1.1.1.1
	external/mit/libuv/dist/test/test-tcp-unexpected-read.c up to 1.1.1.1
	external/mit/libuv/dist/test/test-tcp-write-after-connect.c up to 1.1.1.1
	external/mit/libuv/dist/test/test-tcp-write-fail.c up to 1.1.1.2
	external/mit/libuv/dist/test/test-tcp-write-queue-order.c up to 1.1.1.1
	external/mit/libuv/dist/test/test-thread-equal.c up to 1.1.1.2
	external/mit/libuv/dist/test/test-thread.c      up to 1.1.1.2
	external/mit/libuv/dist/test/test-tcp-write-to-half-open-connection.c up to 1.1.1.2
	external/mit/libuv/dist/test/test-tcp-writealot.c up to 1.1.1.2
	external/mit/libuv/dist/test/test-threadpool-cancel.c up to 1.1.1.2
	external/mit/libuv/dist/test/test-threadpool.c  up to 1.1.1.1
	external/mit/libuv/dist/test/test-timer-again.c up to 1.1.1.2
	external/mit/libuv/dist/test/test-timer-from-check.c up to 1.1.1.1
	external/mit/libuv/dist/test/test-timer.c       up to 1.1.1.2
	external/mit/libuv/dist/test/test-tmpdir.c      up to 1.1.1.1
	external/mit/libuv/dist/test/test-tty-duplicate-key.c up to 1.1.1.2
	external/mit/libuv/dist/test/test-tty-escape-sequence-processing.c up to 1.1.1.2
	external/mit/libuv/dist/test/test-tty.c         up to 1.1.1.2
	external/mit/libuv/dist/test/test-udp-alloc-cb-fail.c up to 1.1.1.2
	external/mit/libuv/dist/test/test-udp-bind.c    up to 1.1.1.1
	external/mit/libuv/dist/test/test-udp-connect.c up to 1.1.1.2
	external/mit/libuv/dist/test/test-udp-create-socket-early.c up to 1.1.1.1
	external/mit/libuv/dist/test/test-udp-ipv6.c    up to 1.1.1.1
	external/mit/libuv/dist/test/test-udp-dgram-too-big.c up to 1.1.1.1
	external/mit/libuv/dist/test/test-udp-multicast-interface.c up to 1.1.1.2
	external/mit/libuv/dist/test/test-udp-multicast-interface6.c up to 1.1.1.2
	external/mit/libuv/dist/test/test-udp-multicast-join.c up to 1.1.1.2
	external/mit/libuv/dist/test/test-udp-multicast-join6.c up to 1.1.1.2
	external/mit/libuv/dist/test/test-udp-multicast-ttl.c up to 1.1.1.2
	external/mit/libuv/dist/test/test-udp-open.c    up to 1.1.1.2
	external/mit/libuv/dist/test/test-udp-options.c up to 1.1.1.1
	external/mit/libuv/dist/test/test-udp-send-and-recv.c up to 1.1.1.2
	external/mit/libuv/dist/test/test-udp-send-hang-loop.c up to 1.1.1.2
	external/mit/libuv/dist/test/test-udp-send-immediate.c up to 1.1.1.2
	external/mit/libuv/dist/test/test-udp-send-unreachable.c up to 1.1.1.2
	external/mit/libuv/dist/test/test-udp-try-send.c up to 1.1.1.2
	external/mit/libuv/dist/test/test-uname.c       up to 1.1.1.1
	external/mit/libuv/dist/test/test-walk-handles.c up to 1.1.1.1
	external/mit/libuv/dist/test/test-watcher-cross-stop.c up to 1.1.1.1
	external/mit/libuv/dist/test/test-metrics.c     up to 1.1.1.1
	external/mit/libuv/dist/test/benchmark-queue-work.c up to 1.1.1.1
	external/mit/libuv/dist/test/test-not-readable-nor-writable-on-read-error.c up to 1.1.1.1
	external/mit/libuv/dist/test/test-not-writable-after-shutdown.c up to 1.1.1.1
	external/mit/libuv/dist/test/test-poll-multiple-handles.c up to 1.1.1.1
	external/mit/libuv/dist/test/test-readable-on-eof.c up to 1.1.1.1
	external/mit/libuv/dist/test/test-shutdown-simultaneous.c up to 1.1.1.1
	external/mit/libuv/dist/test/test-strtok.c      up to 1.1.1.1
	external/mit/libuv/dist/test/test-tcp-close-after-read-timeout.c up to 1.1.1.1
	external/mit/libuv/dist/test/test-tcp-read-stop-start.c up to 1.1.1.1
	external/mit/libuv/dist/test/test-tcp-rst.c     up to 1.1.1.1
	external/mit/libuv/dist/test/test-test-macros.c up to 1.1.1.1
	external/mit/libuv/dist/test/test-udp-connect6.c up to 1.1.1.1
	external/mit/libuv/dist/test/test-udp-mmsg.c    up to 1.1.1.1
	external/mit/libuv/dist/test/test-udp-sendmmsg-error.c up to 1.1.1.1
	external/mit/libuv/dist/tools/make_dist_html.py up to 1.1.1.2
	external/mit/libuv/dist/tools/vswhere_usability_wrapper.cmd up to 1.1.1.1
	external/mit/libuv/dist/LINKS.md                up to 1.1.1.1
	external/mit/libuv/dist/.readthedocs.yaml       up to 1.1.1.1
	external/mit/libuv/dist/libuv-static.pc.in      up to 1.1.1.1
	external/mit/libuv/Makefile                     up to 1.1
	external/mit/libuv/mkpc                         up to 1.1
	external/mit/libuv/pkgconfig.mk                 up to 1.1
	external/mit/libuv/lib/Makefile                 up to 1.6
	external/mit/libuv/lib/libuv.3                  up to 1.1
	etc/mtree/NetBSD.dist.base			(apply patch)
	external/bsd/nsd/include/config.h		(apply patch)
	external/bsd/unbound/include/config.h		(apply patch)
	external/mpl/bind/Makefile			(apply patch)
	external/mpl/bind/Makefile.inc			(apply patch)
	external/mpl/bind/dist/lib/ns/pfilter.c		(apply patch)
	external/mpl/bind/include/config.h		(apply patch)
	external/mpl/bind/lib/libdns/Makefile		(apply patch)
	external/mpl/bind/lib/libisc/Makefile		(apply patch)
	lib/Makefile					(apply patch)
	share/mk/bsd.lib.mk				1.383 (adapted),1.391 via patch
	doc/3RDPARTY					(manually edited)

Import libuv 1.44.2.
Adjust nsd, unbound and bind to the netbsd-9 branch.
@
text
@a0 702
cmake_minimum_required(VERSION 3.4)
project(libuv LANGUAGES C)

cmake_policy(SET CMP0057 NEW) # Enable IN_LIST operator
cmake_policy(SET CMP0064 NEW) # Support if (TEST) operator

list(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake")

include(CMakePackageConfigHelpers)
include(CMakeDependentOption)
include(CheckCCompilerFlag)
include(GNUInstallDirs)
include(CTest)

set(CMAKE_C_VISIBILITY_PRESET hidden)
set(CMAKE_C_STANDARD_REQUIRED ON)
set(CMAKE_C_EXTENSIONS ON)
set(CMAKE_C_STANDARD 90)

cmake_dependent_option(LIBUV_BUILD_TESTS
  "Build the unit tests when BUILD_TESTING is enabled and we are the root project" ON
  "BUILD_TESTING;CMAKE_SOURCE_DIR STREQUAL PROJECT_SOURCE_DIR" OFF)
cmake_dependent_option(LIBUV_BUILD_BENCH
  "Build the benchmarks when building unit tests and we are the root project" ON
  "LIBUV_BUILD_TESTS" OFF)

# Qemu Build
option(QEMU "build for qemu" OFF)
if(QEMU)
  add_definitions(-D__QEMU__=1)
endif()

option(ASAN "Enable AddressSanitizer (ASan)" OFF)
option(TSAN "Enable ThreadSanitizer (TSan)" OFF)

if((ASAN OR TSAN) AND NOT (CMAKE_C_COMPILER_ID MATCHES "AppleClang|GNU|Clang"))
  message(SEND_ERROR "Sanitizer support requires clang or gcc. Try again with -DCMAKE_C_COMPILER.")
endif()

if(ASAN)
  add_definitions(-D__ASAN__=1)
  set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fno-omit-frame-pointer -fsanitize=address")
  set (CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -fno-omit-frame-pointer -fsanitize=address")
  set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fno-omit-frame-pointer -fsanitize=address")
endif()

if(TSAN)
  add_definitions(-D__TSAN__=1)
  set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fno-omit-frame-pointer -fsanitize=thread")
  set (CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -fno-omit-frame-pointer -fsanitize=thread")
  set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fno-omit-frame-pointer -fsanitize=thread")
endif()

# Compiler check
string(CONCAT is-msvc $<OR:
  $<C_COMPILER_ID:MSVC>,
  $<STREQUAL:${CMAKE_C_COMPILER_FRONTEND_VARIANT},MSVC>
>)

check_c_compiler_flag(/W4 UV_LINT_W4)
check_c_compiler_flag(/wd4100 UV_LINT_NO_UNUSED_PARAMETER_MSVC)
check_c_compiler_flag(/wd4127 UV_LINT_NO_CONDITIONAL_CONSTANT_MSVC)
check_c_compiler_flag(/wd4201 UV_LINT_NO_NONSTANDARD_MSVC)
check_c_compiler_flag(/wd4206 UV_LINT_NO_NONSTANDARD_EMPTY_TU_MSVC)
check_c_compiler_flag(/wd4210 UV_LINT_NO_NONSTANDARD_FILE_SCOPE_MSVC)
check_c_compiler_flag(/wd4232 UV_LINT_NO_NONSTANDARD_NONSTATIC_DLIMPORT_MSVC)
check_c_compiler_flag(/wd4456 UV_LINT_NO_HIDES_LOCAL)
check_c_compiler_flag(/wd4457 UV_LINT_NO_HIDES_PARAM)
check_c_compiler_flag(/wd4459 UV_LINT_NO_HIDES_GLOBAL)
check_c_compiler_flag(/wd4706 UV_LINT_NO_CONDITIONAL_ASSIGNMENT_MSVC)
check_c_compiler_flag(/wd4996 UV_LINT_NO_UNSAFE_MSVC)

check_c_compiler_flag(-Wall UV_LINT_WALL) # DO NOT use this under MSVC

# TODO: Place these into its own function
check_c_compiler_flag(-Wno-unused-parameter UV_LINT_NO_UNUSED_PARAMETER)
check_c_compiler_flag(-Wstrict-prototypes UV_LINT_STRICT_PROTOTYPES)
check_c_compiler_flag(-Wextra UV_LINT_EXTRA)

check_c_compiler_flag(/utf-8 UV_LINT_UTF8_MSVC)

set(lint-no-unused-parameter $<$<BOOL:${UV_LINT_NO_UNUSED_PARAMETER}>:-Wno-unused-parameter>)
set(lint-strict-prototypes $<$<BOOL:${UV_LINT_STRICT_PROTOTYPES}>:-Wstrict-prototypes>)
set(lint-extra $<$<BOOL:${UV_LINT_EXTRA}>:-Wextra>)
set(lint-w4 $<$<BOOL:${UV_LINT_W4}>:/W4>)
set(lint-no-unused-parameter-msvc $<$<BOOL:${UV_LINT_NO_UNUSED_PARAMETER_MSVC}>:/wd4100>)
set(lint-no-conditional-constant-msvc $<$<BOOL:${UV_LINT_NO_CONDITIONAL_CONSTANT_MSVC}>:/wd4127>)
set(lint-no-nonstandard-msvc $<$<BOOL:${UV_LINT_NO_NONSTANDARD_MSVC}>:/wd4201>)
set(lint-no-nonstandard-empty-tu-msvc $<$<BOOL:${UV_LINT_NO_NONSTANDARD_EMPTY_TU_MSVC}>:/wd4206>)
set(lint-no-nonstandard-file-scope-msvc $<$<BOOL:${UV_LINT_NO_NONSTANDARD_FILE_SCOPE_MSVC}>:/wd4210>)
set(lint-no-nonstandard-nonstatic-dlimport-msvc $<$<BOOL:${UV_LINT_NO_NONSTANDARD_NONSTATIC_DLIMPORT_MSVC}>:/wd4232>)
set(lint-no-hides-local-msvc $<$<BOOL:${UV_LINT_NO_HIDES_LOCAL}>:/wd4456>)
set(lint-no-hides-param-msvc $<$<BOOL:${UV_LINT_NO_HIDES_PARAM}>:/wd4457>)
set(lint-no-hides-global-msvc $<$<BOOL:${UV_LINT_NO_HIDES_GLOBAL}>:/wd4459>)
set(lint-no-conditional-assignment-msvc $<$<BOOL:${UV_LINT_NO_CONDITIONAL_ASSIGNMENT_MSVC}>:/wd4706>)
set(lint-no-unsafe-msvc $<$<BOOL:${UV_LINT_NO_UNSAFE_MSVC}>:/wd4996>)
# Unfortunately, this one is complicated because MSVC and clang-cl support -Wall
# but using it is like calling -Weverything
string(CONCAT lint-default $<
  $<AND:$<BOOL:${UV_LINT_WALL}>,$<NOT:${is-msvc}>>:-Wall
>)
set(lint-utf8-msvc $<$<BOOL:${UV_LINT_UTF8_MSVC}>:/utf-8>)

list(APPEND uv_cflags ${lint-strict-prototypes} ${lint-extra} ${lint-default} ${lint-w4})
list(APPEND uv_cflags ${lint-no-unused-parameter})
list(APPEND uv_cflags ${lint-no-unused-parameter-msvc})
list(APPEND uv_cflags ${lint-no-conditional-constant-msvc})
list(APPEND uv_cflags ${lint-no-nonstandard-msvc})
list(APPEND uv_cflags ${lint-no-nonstandard-empty-tu-msvc})
list(APPEND uv_cflags ${lint-no-nonstandard-file-scope-msvc})
list(APPEND uv_cflags ${lint-no-nonstandard-nonstatic-dlimport-msvc})
list(APPEND uv_cflags ${lint-no-hides-local-msvc})
list(APPEND uv_cflags ${lint-no-hides-param-msvc})
list(APPEND uv_cflags ${lint-no-hides-global-msvc})
list(APPEND uv_cflags ${lint-no-conditional-assignment-msvc})
list(APPEND uv_cflags ${lint-no-unsafe-msvc})
list(APPEND uv_cflags ${lint-utf8-msvc} )

check_c_compiler_flag(-fno-strict-aliasing UV_F_STRICT_ALIASING)
list(APPEND uv_cflags $<$<BOOL:${UV_F_STRICT_ALIASING}>:-fno-strict-aliasing>)

set(uv_sources
    src/fs-poll.c
    src/idna.c
    src/inet.c
    src/random.c
    src/strscpy.c
    src/strtok.c
    src/threadpool.c
    src/timer.c
    src/uv-common.c
    src/uv-data-getter-setters.c
    src/version.c)

if(WIN32)
  list(APPEND uv_defines WIN32_LEAN_AND_MEAN _WIN32_WINNT=0x0602)
  list(APPEND uv_libraries
       psapi
       user32
       advapi32
       iphlpapi
       userenv
       ws2_32)
  list(APPEND uv_sources
       src/win/async.c
       src/win/core.c
       src/win/detect-wakeup.c
       src/win/dl.c
       src/win/error.c
       src/win/fs.c
       src/win/fs-event.c
       src/win/getaddrinfo.c
       src/win/getnameinfo.c
       src/win/handle.c
       src/win/loop-watcher.c
       src/win/pipe.c
       src/win/thread.c
       src/win/poll.c
       src/win/process.c
       src/win/process-stdio.c
       src/win/signal.c
       src/win/snprintf.c
       src/win/stream.c
       src/win/tcp.c
       src/win/tty.c
       src/win/udp.c
       src/win/util.c
       src/win/winapi.c
       src/win/winsock.c)
  list(APPEND uv_test_libraries ws2_32)
  list(APPEND uv_test_sources src/win/snprintf.c test/runner-win.c)
else()
  list(APPEND uv_defines _FILE_OFFSET_BITS=64 _LARGEFILE_SOURCE)
  if(NOT CMAKE_SYSTEM_NAME MATCHES "Android|OS390|QNX")
    # TODO: This should be replaced with find_package(Threads) if possible
    # Android has pthread as part of its c library, not as a separate
    # libpthread.so.
    list(APPEND uv_libraries pthread)
  endif()
  list(APPEND uv_sources
       src/unix/async.c
       src/unix/core.c
       src/unix/dl.c
       src/unix/fs.c
       src/unix/getaddrinfo.c
       src/unix/getnameinfo.c
       src/unix/loop-watcher.c
       src/unix/loop.c
       src/unix/pipe.c
       src/unix/poll.c
       src/unix/process.c
       src/unix/random-devurandom.c
       src/unix/signal.c
       src/unix/stream.c
       src/unix/tcp.c
       src/unix/thread.c
       src/unix/tty.c
       src/unix/udp.c)
  list(APPEND uv_test_sources test/runner-unix.c)
endif()

if(CMAKE_SYSTEM_NAME STREQUAL "AIX")
  list(APPEND uv_defines
       _ALL_SOURCE
       _LINUX_SOURCE_COMPAT
       _THREAD_SAFE
       _XOPEN_SOURCE=500
       HAVE_SYS_AHAFS_EVPRODS_H)
  list(APPEND uv_libraries perfstat)
  list(APPEND uv_sources
       src/unix/aix.c
       src/unix/aix-common.c)
endif()

if(CMAKE_SYSTEM_NAME STREQUAL "Android")
  list(APPEND uv_defines _GNU_SOURCE)
  list(APPEND uv_libraries dl)
  list(APPEND uv_sources
       src/unix/linux-core.c
       src/unix/linux-inotify.c
       src/unix/linux-syscalls.c
       src/unix/procfs-exepath.c
       src/unix/pthread-fixes.c
       src/unix/random-getentropy.c
       src/unix/random-getrandom.c
       src/unix/random-sysctl-linux.c
       src/unix/epoll.c)
endif()

if(APPLE OR CMAKE_SYSTEM_NAME MATCHES "Android|Linux")
  list(APPEND uv_sources src/unix/proctitle.c)
endif()

if(CMAKE_SYSTEM_NAME MATCHES "DragonFly|FreeBSD")
  list(APPEND uv_sources src/unix/freebsd.c)
endif()

if(CMAKE_SYSTEM_NAME MATCHES "DragonFly|FreeBSD|NetBSD|OpenBSD")
  list(APPEND uv_sources src/unix/posix-hrtime.c src/unix/bsd-proctitle.c)
endif()

if(APPLE OR CMAKE_SYSTEM_NAME MATCHES "DragonFly|FreeBSD|NetBSD|OpenBSD")
  list(APPEND uv_sources src/unix/bsd-ifaddrs.c src/unix/kqueue.c)
endif()

if(CMAKE_SYSTEM_NAME MATCHES "FreeBSD")
  list(APPEND uv_sources src/unix/random-getrandom.c)
endif()

if(APPLE OR CMAKE_SYSTEM_NAME STREQUAL "OpenBSD")
  list(APPEND uv_sources src/unix/random-getentropy.c)
endif()

if(APPLE)
  list(APPEND uv_defines _DARWIN_UNLIMITED_SELECT=1 _DARWIN_USE_64_BIT_INODE=1)
  list(APPEND uv_sources
       src/unix/darwin-proctitle.c
       src/unix/darwin.c
       src/unix/fsevents.c)
endif()

if(CMAKE_SYSTEM_NAME STREQUAL "GNU")
  list(APPEND uv_libraries dl)
  list(APPEND uv_sources
       src/unix/bsd-ifaddrs.c
       src/unix/no-fsevents.c
       src/unix/no-proctitle.c
       src/unix/posix-hrtime.c
       src/unix/posix-poll.c
       src/unix/hurd.c)
endif()

if(CMAKE_SYSTEM_NAME STREQUAL "kFreeBSD")
  list(APPEND uv_defines _GNU_SOURCE)
  list(APPEND uv_libraries dl freebsd-glue)
endif()

if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
  list(APPEND uv_defines _GNU_SOURCE _POSIX_C_SOURCE=200112)
  list(APPEND uv_libraries dl rt)
  list(APPEND uv_sources
       src/unix/linux-core.c
       src/unix/linux-inotify.c
       src/unix/linux-syscalls.c
       src/unix/procfs-exepath.c
       src/unix/random-getrandom.c
       src/unix/random-sysctl-linux.c
       src/unix/epoll.c)
endif()

if(CMAKE_SYSTEM_NAME STREQUAL "NetBSD")
  list(APPEND uv_sources src/unix/netbsd.c)
  list(APPEND uv_libraries kvm)
endif()

if(CMAKE_SYSTEM_NAME STREQUAL "OpenBSD")
  list(APPEND uv_sources src/unix/openbsd.c)
endif()

if(CMAKE_SYSTEM_NAME STREQUAL "OS390")
  enable_language(CXX)
  list(APPEND uv_defines PATH_MAX=1024)
  list(APPEND uv_defines _AE_BIMODAL)
  list(APPEND uv_defines _ALL_SOURCE)
  list(APPEND uv_defines _ENHANCED_ASCII_EXT=0xFFFFFFFF)
  list(APPEND uv_defines _ISOC99_SOURCE)
  list(APPEND uv_defines _LARGE_TIME_API)
  list(APPEND uv_defines _OPEN_MSGQ_EXT)
  list(APPEND uv_defines _OPEN_SYS_FILE_EXT)
  list(APPEND uv_defines _OPEN_SYS_IF_EXT)
  list(APPEND uv_defines _OPEN_SYS_SOCK_EXT3)
  list(APPEND uv_defines _OPEN_SYS_SOCK_IPV6)
  list(APPEND uv_defines _UNIX03_SOURCE)
  list(APPEND uv_defines _UNIX03_THREADS)
  list(APPEND uv_defines _UNIX03_WITHDRAWN)
  list(APPEND uv_defines _XOPEN_SOURCE=600)
  list(APPEND uv_defines _XOPEN_SOURCE_EXTENDED)
  list(APPEND uv_sources
       src/unix/pthread-fixes.c
       src/unix/os390.c
       src/unix/os390-syscalls.c
       src/unix/os390-proctitle.c)
  list(APPEND uv_cflags
       -q64
       -qascii
       -qexportall
       -qgonumber
       -qlongname
       -qlibansi
       -qfloat=IEEE
       -qtune=10
       -qarch=10
       -qasm
       -qasmlib=sys1.maclib:sys1.modgen)
  find_library(ZOSLIB
    NAMES zoslib
    PATHS ${ZOSLIB_DIR}
    PATH_SUFFIXES lib
  )
  list(APPEND uv_libraries ${ZOSLIB})
endif()

if(CMAKE_SYSTEM_NAME STREQUAL "OS400")
  list(APPEND uv_defines
       _ALL_SOURCE
       _LINUX_SOURCE_COMPAT
       _THREAD_SAFE
       _XOPEN_SOURCE=500)
  list(APPEND uv_sources
    src/unix/aix-common.c
    src/unix/ibmi.c
    src/unix/no-fsevents.c
    src/unix/posix-poll.c)
endif()

if(CMAKE_SYSTEM_NAME STREQUAL "SunOS")
  list(APPEND uv_defines __EXTENSIONS__ _XOPEN_SOURCE=500 _REENTRANT)
  list(APPEND uv_libraries kstat nsl sendfile socket)
  list(APPEND uv_sources
       src/unix/no-proctitle.c
       src/unix/sunos.c)
endif()

if(CMAKE_SYSTEM_NAME STREQUAL "Haiku")
  list(APPEND uv_defines _BSD_SOURCE)
  list(APPEND uv_libraries bsd network)
  list(APPEND uv_sources
	  src/unix/haiku.c
	  src/unix/bsd-ifaddrs.c
	  src/unix/no-fsevents.c
	  src/unix/no-proctitle.c
	  src/unix/posix-hrtime.c
	  src/unix/posix-poll.c)
endif()

if(CMAKE_SYSTEM_NAME STREQUAL "QNX")
  list(APPEND uv_sources
    src/unix/posix-hrtime.c
    src/unix/posix-poll.c
    src/unix/qnx.c
    src/unix/bsd-ifaddrs.c
    src/unix/no-proctitle.c
    src/unix/no-fsevents.c)
  list(APPEND uv_libraries socket)
endif()

if(APPLE OR CMAKE_SYSTEM_NAME MATCHES "DragonFly|FreeBSD|Linux|NetBSD|OpenBSD")
  list(APPEND uv_test_libraries util)
endif()

add_library(uv SHARED ${uv_sources})
target_compile_definitions(uv
  INTERFACE
    USING_UV_SHARED=1
  PRIVATE
    BUILDING_UV_SHARED=1
    ${uv_defines})
target_compile_options(uv PRIVATE ${uv_cflags})
target_include_directories(uv
  PUBLIC
    $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include>
    $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
  PRIVATE
    $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/src>)
if(CMAKE_SYSTEM_NAME STREQUAL "OS390")
  target_include_directories(uv PUBLIC $<BUILD_INTERFACE:${ZOSLIB_DIR}/include>)
  set_target_properties(uv PROPERTIES LINKER_LANGUAGE CXX)
endif()
target_link_libraries(uv ${uv_libraries})

add_library(uv_a STATIC ${uv_sources})
target_compile_definitions(uv_a PRIVATE ${uv_defines})
target_compile_options(uv_a PRIVATE ${uv_cflags})
target_include_directories(uv_a
  PUBLIC
    $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include>
    $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
  PRIVATE
    $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/src>)
if(CMAKE_SYSTEM_NAME STREQUAL "OS390")
  target_include_directories(uv_a PUBLIC $<BUILD_INTERFACE:${ZOSLIB_DIR}/include>)
  set_target_properties(uv_a PROPERTIES LINKER_LANGUAGE CXX)
endif()
target_link_libraries(uv_a ${uv_libraries})

if(LIBUV_BUILD_TESTS)
  # Small hack: use ${uv_test_sources} now to get the runner skeleton,
  # before the actual tests are added.
  add_executable(
    uv_run_benchmarks_a
    ${uv_test_sources}
    test/benchmark-async-pummel.c
    test/benchmark-async.c
    test/benchmark-fs-stat.c
    test/benchmark-getaddrinfo.c
    test/benchmark-loop-count.c
    test/benchmark-queue-work.c
    test/benchmark-million-async.c
    test/benchmark-million-timers.c
    test/benchmark-multi-accept.c
    test/benchmark-ping-pongs.c
    test/benchmark-ping-udp.c
    test/benchmark-pound.c
    test/benchmark-pump.c
    test/benchmark-sizes.c
    test/benchmark-spawn.c
    test/benchmark-tcp-write-batch.c
    test/benchmark-thread.c
    test/benchmark-udp-pummel.c
    test/blackhole-server.c
    test/echo-server.c
    test/run-benchmarks.c
    test/runner.c)
  target_compile_definitions(uv_run_benchmarks_a PRIVATE ${uv_defines})
  target_compile_options(uv_run_benchmarks_a PRIVATE ${uv_cflags})
  target_link_libraries(uv_run_benchmarks_a uv_a ${uv_test_libraries})

  list(APPEND uv_test_sources
       test/blackhole-server.c
       test/echo-server.c
       test/run-tests.c
       test/runner.c
       test/test-active.c
       test/test-async-null-cb.c
       test/test-async.c
       test/test-barrier.c
       test/test-callback-stack.c
       test/test-close-fd.c
       test/test-close-order.c
       test/test-condvar.c
       test/test-connect-unspecified.c
       test/test-connection-fail.c
       test/test-cwd-and-chdir.c
       test/test-default-loop-close.c
       test/test-delayed-accept.c
       test/test-dlerror.c
       test/test-eintr-handling.c
       test/test-embed.c
       test/test-emfile.c
       test/test-env-vars.c
       test/test-error.c
       test/test-fail-always.c
       test/test-fork.c
       test/test-fs-copyfile.c
       test/test-fs-event.c
       test/test-fs-poll.c
       test/test-fs.c
       test/test-fs-readdir.c
       test/test-fs-fd-hash.c
       test/test-fs-open-flags.c
       test/test-get-currentexe.c
       test/test-get-loadavg.c
       test/test-get-memory.c
       test/test-get-passwd.c
       test/test-getaddrinfo.c
       test/test-gethostname.c
       test/test-getnameinfo.c
       test/test-getsockname.c
       test/test-getters-setters.c
       test/test-gettimeofday.c
       test/test-handle-fileno.c
       test/test-homedir.c
       test/test-hrtime.c
       test/test-idle.c
       test/test-idna.c
       test/test-ip4-addr.c
       test/test-ip6-addr.c
       test/test-ip-name.c
       test/test-ipc-heavy-traffic-deadlock-bug.c
       test/test-ipc-send-recv.c
       test/test-ipc.c
       test/test-loop-alive.c
       test/test-loop-close.c
       test/test-loop-configure.c
       test/test-loop-handles.c
       test/test-loop-stop.c
       test/test-loop-time.c
       test/test-metrics.c
       test/test-multiple-listen.c
       test/test-mutexes.c
       test/test-not-readable-nor-writable-on-read-error.c
       test/test-not-writable-after-shutdown.c
       test/test-osx-select.c
       test/test-pass-always.c
       test/test-ping-pong.c
       test/test-pipe-bind-error.c
       test/test-pipe-close-stdout-read-stdin.c
       test/test-pipe-connect-error.c
       test/test-pipe-connect-multiple.c
       test/test-pipe-connect-prepare.c
       test/test-pipe-getsockname.c
       test/test-pipe-pending-instances.c
       test/test-pipe-sendmsg.c
       test/test-pipe-server-close.c
       test/test-pipe-set-fchmod.c
       test/test-pipe-set-non-blocking.c
       test/test-platform-output.c
       test/test-poll-close-doesnt-corrupt-stack.c
       test/test-poll-close.c
       test/test-poll-closesocket.c
       test/test-poll-multiple-handles.c
       test/test-poll-oob.c
       test/test-poll.c
       test/test-process-priority.c
       test/test-process-title-threadsafe.c
       test/test-process-title.c
       test/test-queue-foreach-delete.c
       test/test-random.c
       test/test-readable-on-eof.c
       test/test-ref.c
       test/test-run-nowait.c
       test/test-run-once.c
       test/test-semaphore.c
       test/test-shutdown-close.c
       test/test-shutdown-eof.c
       test/test-shutdown-simultaneous.c
       test/test-shutdown-twice.c
       test/test-signal-multiple-loops.c
       test/test-signal-pending-on-close.c
       test/test-signal.c
       test/test-socket-buffer-size.c
       test/test-spawn.c
       test/test-stdio-over-pipes.c
       test/test-strscpy.c
       test/test-strtok.c
       test/test-tcp-alloc-cb-fail.c
       test/test-tcp-bind-error.c
       test/test-tcp-bind6-error.c
       test/test-tcp-close-accept.c
       test/test-tcp-close-after-read-timeout.c
       test/test-tcp-close-while-connecting.c
       test/test-tcp-close.c
       test/test-tcp-close-reset.c
       test/test-tcp-connect-error-after-write.c
       test/test-tcp-connect-error.c
       test/test-tcp-connect-timeout.c
       test/test-tcp-connect6-error.c
       test/test-tcp-create-socket-early.c
       test/test-tcp-flags.c
       test/test-tcp-oob.c
       test/test-tcp-open.c
       test/test-tcp-read-stop.c
       test/test-tcp-read-stop-start.c
       test/test-tcp-rst.c
       test/test-tcp-shutdown-after-write.c
       test/test-tcp-try-write.c
       test/test-tcp-try-write-error.c
       test/test-tcp-unexpected-read.c
       test/test-tcp-write-after-connect.c
       test/test-tcp-write-fail.c
       test/test-tcp-write-queue-order.c
       test/test-tcp-write-to-half-open-connection.c
       test/test-tcp-writealot.c
       test/test-test-macros.c
       test/test-thread-equal.c
       test/test-thread.c
       test/test-threadpool-cancel.c
       test/test-threadpool.c
       test/test-timer-again.c
       test/test-timer-from-check.c
       test/test-timer.c
       test/test-tmpdir.c
       test/test-tty-duplicate-key.c
       test/test-tty-escape-sequence-processing.c
       test/test-tty.c
       test/test-udp-alloc-cb-fail.c
       test/test-udp-bind.c
       test/test-udp-connect.c
       test/test-udp-connect6.c
       test/test-udp-create-socket-early.c
       test/test-udp-dgram-too-big.c
       test/test-udp-ipv6.c
       test/test-udp-mmsg.c
       test/test-udp-multicast-interface.c
       test/test-udp-multicast-interface6.c
       test/test-udp-multicast-join.c
       test/test-udp-multicast-join6.c
       test/test-udp-multicast-ttl.c
       test/test-udp-open.c
       test/test-udp-options.c
       test/test-udp-send-and-recv.c
       test/test-udp-send-hang-loop.c
       test/test-udp-send-immediate.c
       test/test-udp-sendmmsg-error.c
       test/test-udp-send-unreachable.c
       test/test-udp-try-send.c
       test/test-uname.c
       test/test-walk-handles.c
       test/test-watcher-cross-stop.c)

  add_executable(uv_run_tests ${uv_test_sources} uv_win_longpath.manifest)
  target_compile_definitions(uv_run_tests
                             PRIVATE ${uv_defines} USING_UV_SHARED=1)
  target_compile_options(uv_run_tests PRIVATE ${uv_cflags})
  target_link_libraries(uv_run_tests uv ${uv_test_libraries})
  add_test(NAME uv_test
           COMMAND uv_run_tests
           WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
  if(CMAKE_SYSTEM_NAME STREQUAL "OS390")
    set_tests_properties(uv_test PROPERTIES ENVIRONMENT
                         "LIBPATH=${CMAKE_BINARY_DIR}:$ENV{LIBPATH}")
  endif()
  add_executable(uv_run_tests_a ${uv_test_sources} uv_win_longpath.manifest)
  target_compile_definitions(uv_run_tests_a PRIVATE ${uv_defines})
  target_compile_options(uv_run_tests_a PRIVATE ${uv_cflags})
  if(QEMU)
    target_link_libraries(uv_run_tests_a uv_a ${uv_test_libraries} -static)
  else()
    target_link_libraries(uv_run_tests_a uv_a ${uv_test_libraries})
  endif()
  add_test(NAME uv_test_a
           COMMAND uv_run_tests_a
           WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
  if(CMAKE_SYSTEM_NAME STREQUAL "OS390")
    set_target_properties(uv_run_benchmarks_a PROPERTIES LINKER_LANGUAGE CXX)
    set_target_properties(uv_run_tests PROPERTIES LINKER_LANGUAGE CXX)
    set_target_properties(uv_run_tests_a PROPERTIES LINKER_LANGUAGE CXX)
  endif()
endif()

# Now for some gibbering horrors from beyond the stars...
foreach(lib IN LISTS uv_libraries)
  list(APPEND LIBS "-l${lib}")
endforeach()
string(REPLACE ";" " " LIBS "${LIBS}")
# Consider setting project version via project() call?
file(STRINGS configure.ac configure_ac REGEX ^AC_INIT)
string(REGEX MATCH "([0-9]+)[.][0-9]+[.][0-9]+" PACKAGE_VERSION "${configure_ac}")
set(UV_VERSION_MAJOR "${CMAKE_MATCH_1}")
# The version in the filename is mirroring the behaviour of autotools.
set_target_properties(uv PROPERTIES
  VERSION ${UV_VERSION_MAJOR}.0.0
  SOVERSION ${UV_VERSION_MAJOR})
set(includedir ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_INCLUDEDIR})
set(libdir ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR})
set(prefix ${CMAKE_INSTALL_PREFIX})
configure_file(libuv.pc.in libuv.pc @@ONLY)
configure_file(libuv-static.pc.in libuv-static.pc @@ONLY)

install(DIRECTORY include/ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
install(FILES LICENSE DESTINATION ${CMAKE_INSTALL_DOCDIR})
install(FILES ${PROJECT_BINARY_DIR}/libuv.pc ${PROJECT_BINARY_DIR}/libuv-static.pc
        DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
install(TARGETS uv EXPORT libuvConfig
        RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
        LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
        ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
install(TARGETS uv_a EXPORT libuvConfig
        ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
install(EXPORT libuvConfig DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/libuv)

if(MSVC)
  set(CMAKE_DEBUG_POSTFIX d)
endif()

message(STATUS "summary of build options:
    Install prefix:  ${CMAKE_INSTALL_PREFIX}
    Target system:   ${CMAKE_SYSTEM_NAME}
    Compiler:
      C compiler:    ${CMAKE_C_COMPILER} (${CMAKE_C_COMPILER_ID})
      CFLAGS:        ${CMAKE_C_FLAGS_${_build_type}} ${CMAKE_C_FLAGS}
")
@


