mirror of
https://github.com/Kitware/CMake.git
synced 2025-10-19 02:17:27 +08:00
libuv: Add partial port to HP-UX
Port enough of libuv to HP-UX 11.31 ia64 with GCC 4.9.3 to work for CMake.
This commit is contained in:
@@ -300,6 +300,23 @@ if(CMAKE_SYSTEM_NAME STREQUAL "SunOS")
|
|||||||
)
|
)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
if(CMAKE_SYSTEM_NAME STREQUAL "HP-UX")
|
||||||
|
list(APPEND uv_libraries
|
||||||
|
rt
|
||||||
|
)
|
||||||
|
list(APPEND uv_headers
|
||||||
|
include/uv/posix.h
|
||||||
|
)
|
||||||
|
list(APPEND uv_defines
|
||||||
|
_XOPEN_SOURCE_EXTENDED
|
||||||
|
)
|
||||||
|
list(APPEND uv_sources
|
||||||
|
src/unix/hpux.c
|
||||||
|
src/unix/no-fsevents.c
|
||||||
|
src/unix/posix-poll.c
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
|
||||||
include_directories(
|
include_directories(
|
||||||
${uv_includes}
|
${uv_includes}
|
||||||
${KWSYS_HEADER_ROOT}
|
${KWSYS_HEADER_ROOT}
|
||||||
|
@@ -55,6 +55,8 @@
|
|||||||
# include "aix.h"
|
# include "aix.h"
|
||||||
#elif defined(__sun)
|
#elif defined(__sun)
|
||||||
# include "sunos.h"
|
# include "sunos.h"
|
||||||
|
#elif defined(__hpux)
|
||||||
|
# include "posix.h"
|
||||||
#elif defined(__APPLE__)
|
#elif defined(__APPLE__)
|
||||||
# include "darwin.h"
|
# include "darwin.h"
|
||||||
#elif defined(__DragonFly__) || \
|
#elif defined(__DragonFly__) || \
|
||||||
|
@@ -587,7 +587,7 @@ int uv__nonblock_ioctl(int fd, int set) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#if !defined(__CYGWIN__) && !defined(__MSYS__) && !defined(__HAIKU__)
|
#if !defined(__hpux) && !defined(__CYGWIN__) && !defined(__MSYS__) && !defined(__HAIKU__)
|
||||||
int uv__cloexec_ioctl(int fd, int set) {
|
int uv__cloexec_ioctl(int fd, int set) {
|
||||||
int r;
|
int r;
|
||||||
|
|
||||||
|
@@ -234,7 +234,7 @@ static ssize_t uv__fs_futime(uv_fs_t* req) {
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(__sun) && (_XOPEN_SOURCE < 600 || defined(CMAKE_BOOTSTRAP))
|
#if (defined(__sun) || defined(__hpux)) && (_XOPEN_SOURCE < 600 || defined(CMAKE_BOOTSTRAP))
|
||||||
static char* uv__mkdtemp(char *template)
|
static char* uv__mkdtemp(char *template)
|
||||||
{
|
{
|
||||||
if (!mktemp(template) || mkdir(template, 0700))
|
if (!mktemp(template) || mkdir(template, 0700))
|
||||||
|
30
Utilities/cmlibuv/src/unix/hpux.c
Normal file
30
Utilities/cmlibuv/src/unix/hpux.c
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
/* Copyright libuv project contributors. All rights reserved.
|
||||||
|
*
|
||||||
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
* of this software and associated documentation files (the "Software"), to
|
||||||
|
* deal in the Software without restriction, including without limitation the
|
||||||
|
* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
|
||||||
|
* sell copies of the Software, and to permit persons to whom the Software is
|
||||||
|
* furnished to do so, subject to the following conditions:
|
||||||
|
*
|
||||||
|
* The above copyright notice and this permission notice shall be included in
|
||||||
|
* all copies or substantial portions of the Software.
|
||||||
|
*
|
||||||
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||||
|
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
||||||
|
* IN THE SOFTWARE.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "uv.h"
|
||||||
|
#include "internal.h"
|
||||||
|
|
||||||
|
#include <stdint.h>
|
||||||
|
#include <time.h>
|
||||||
|
|
||||||
|
uint64_t uv__hrtime(uv_clocktype_t type) {
|
||||||
|
return (uint64_t) gethrtime();
|
||||||
|
}
|
@@ -43,6 +43,20 @@ uint64_t uv__hrtime(uv_clocktype_t type) {
|
|||||||
return mach_absolute_time() * info.numer / info.denom;
|
return mach_absolute_time() * info.numer / info.denom;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#elif defined(__hpux)
|
||||||
|
/* Special case for CMake bootstrap: no CLOCK_MONOTONIC on HP-UX */
|
||||||
|
|
||||||
|
#ifndef CMAKE_BOOTSTRAP
|
||||||
|
#error "This code path meant only for use during CMake bootstrap."
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include <stdint.h>
|
||||||
|
#include <time.h>
|
||||||
|
|
||||||
|
uint64_t uv__hrtime(uv_clocktype_t type) {
|
||||||
|
return (uint64_t) gethrtime();
|
||||||
|
}
|
||||||
|
|
||||||
#else
|
#else
|
||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
@@ -700,7 +700,7 @@ int uv_cond_init(uv_cond_t* cond) {
|
|||||||
if (err)
|
if (err)
|
||||||
return UV__ERR(err);
|
return UV__ERR(err);
|
||||||
|
|
||||||
#if !(defined(__ANDROID_API__) && __ANDROID_API__ < 21)
|
#if !(defined(__ANDROID_API__) && __ANDROID_API__ < 21) && !defined(__hpux)
|
||||||
err = pthread_condattr_setclock(&attr, CLOCK_MONOTONIC);
|
err = pthread_condattr_setclock(&attr, CLOCK_MONOTONIC);
|
||||||
if (err)
|
if (err)
|
||||||
goto error2;
|
goto error2;
|
||||||
|
@@ -200,7 +200,7 @@ skip:
|
|||||||
static void uv__tty_make_raw(struct termios* tio) {
|
static void uv__tty_make_raw(struct termios* tio) {
|
||||||
assert(tio != NULL);
|
assert(tio != NULL);
|
||||||
|
|
||||||
#if defined __sun || defined __MVS__
|
#if defined __sun || defined __MVS__ || defined __hpux
|
||||||
/*
|
/*
|
||||||
* This implementation of cfmakeraw for Solaris and derivatives is taken from
|
* This implementation of cfmakeraw for Solaris and derivatives is taken from
|
||||||
* http://www.perkin.org.uk/posts/solaris-portability-cfmakeraw.html.
|
* http://www.perkin.org.uk/posts/solaris-portability-cfmakeraw.html.
|
||||||
|
@@ -1435,6 +1435,9 @@ else
|
|||||||
*Darwin*)
|
*Darwin*)
|
||||||
uv_c_flags="${uv_c_flags} -D_DARWIN_USE_64_BIT_INODE=1 -D_DARWIN_UNLIMITED_SELECT=1"
|
uv_c_flags="${uv_c_flags} -D_DARWIN_USE_64_BIT_INODE=1 -D_DARWIN_UNLIMITED_SELECT=1"
|
||||||
;;
|
;;
|
||||||
|
*HP-UX*)
|
||||||
|
uv_c_flags="${uv_c_flags} -D_XOPEN_SOURCE_EXTENDED"
|
||||||
|
;;
|
||||||
*Linux*)
|
*Linux*)
|
||||||
uv_c_flags="${uv_c_flags} -D_GNU_SOURCE"
|
uv_c_flags="${uv_c_flags} -D_GNU_SOURCE"
|
||||||
libs="${libs} -ldl -lrt"
|
libs="${libs} -ldl -lrt"
|
||||||
|
Reference in New Issue
Block a user