Haiku: port (#431)

Port for Haiku.  Slight CMake changes, header changes, and resolv.conf/hosts paths specific to Haiku.

Port By: Jérôme Duval (@korli)
pull/434/head
Jérôme Duval 3 years ago committed by GitHub
parent db2c5d99e5
commit 7586c5f19f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 13
      CMakeLists.txt
  2. 2
      include/ares.h
  3. 5
      src/lib/ares_private.h

@ -146,16 +146,19 @@ ENDIF()
CARES_FUNCTION_IN_LIBRARY (gethostbyname nsl HAVE_LIBNSL)
CARES_FUNCTION_IN_LIBRARY (gethostbyname socket HAVE_GHBN_LIBSOCKET)
CARES_FUNCTION_IN_LIBRARY (gethostbyname network HAVE_LIBNETWORK)
CARES_FUNCTION_IN_LIBRARY (socket socket HAVE_SOCKET_LIBSOCKET)
IF (HAVE_GHBN_LIBSOCKET OR HAVE_SOCKET_LIBSOCKET)
SET(HAVE_LIBSOCKET TRUE)
ENDIF ()
CARES_FUNCTION_IN_LIBRARY (socket network HAVE_LIBNETWORK)
CARES_FUNCTION_IN_LIBRARY (clock_gettime rt HAVE_LIBRT)
# Look for necessary includes
CHECK_INCLUDE_FILES (sys/types.h HAVE_SYS_TYPES_H)
CHECK_INCLUDE_FILES (sys/socket.h HAVE_SYS_SOCKET_H)
CHECK_INCLUDE_FILES (sys/sockio.h HAVE_SYS_SOCKIO_H)
CHECK_INCLUDE_FILES (arpa/inet.h HAVE_ARPA_INET_H)
CHECK_INCLUDE_FILES (arpa/nameser_compat.h HAVE_ARPA_NAMESER_COMPAT_H)
CHECK_INCLUDE_FILES (arpa/nameser.h HAVE_ARPA_NAMESER_H)
@ -232,6 +235,9 @@ ENDIF ()
IF (HAVE_LIBSOCKET)
LIST (APPEND CARES_DEPENDENT_LIBS socket)
ENDIF ()
IF (HAVE_LIBNETWORK)
LIST (APPEND CARES_DEPENDENT_LIBS network)
ENDIF ()
IF (HAVE_LIBRT)
LIST (APPEND CARES_DEPENDENT_LIBS rt)
ENDIF ()
@ -270,6 +276,7 @@ CARES_EXTRAINCLUDE_IFSET (HAVE_STRINGS_H strings.h)
CARES_EXTRAINCLUDE_IFSET (HAVE_SYS_IOCTL_H sys/ioctl.h)
CARES_EXTRAINCLUDE_IFSET (HAVE_SYS_SELECT_H sys/select.h)
CARES_EXTRAINCLUDE_IFSET (HAVE_SYS_SOCKET_H sys/socket.h)
CARES_EXTRAINCLUDE_IFSET (HAVE_SYS_SOCKIO_H sys/sockio.h)
CARES_EXTRAINCLUDE_IFSET (HAVE_SYS_TIME_H sys/time.h)
CARES_EXTRAINCLUDE_IFSET (HAVE_SYS_UIO_H sys/uio.h)
CARES_EXTRAINCLUDE_IFSET (HAVE_TIME_H time.h)
@ -523,7 +530,8 @@ IF (HAVE_GETSERVBYPORT_R)
IF (CMAKE_SYSTEM_NAME STREQUAL "SunOS")
SET (GETSERVBYPORT_R_ARGS 5)
ELSEIF (CMAKE_SYSTEM_NAME STREQUAL "AIX" OR
CMAKE_SYSTEM_NAME STREQUAL "OpenBSD")
CMAKE_SYSTEM_NAME STREQUAL "OpenBSD" OR
HAIKU)
SET (GETSERVBYPORT_R_ARGS 4)
ELSE ()
# Probably linux
@ -536,7 +544,8 @@ IF (HAVE_GETSERVBYNAME_R)
IF (CMAKE_SYSTEM_NAME STREQUAL "SunOS")
SET (GETSERVBYNAME_R_ARGS 5)
ELSEIF (CMAKE_SYSTEM_NAME STREQUAL "AIX" OR
CMAKE_SYSTEM_NAME STREQUAL "OpenBSD")
CMAKE_SYSTEM_NAME STREQUAL "OpenBSD" OR
HAIKU)
SET (GETSERVBYNAME_R_ARGS 4)
ELSE ()
# Probably linux

@ -39,7 +39,7 @@
#if defined(_AIX) || defined(__NOVELL_LIBC__) || defined(__NetBSD__) || \
defined(__minix) || defined(__SYMBIAN32__) || defined(__INTEGRITY) || \
defined(ANDROID) || defined(__ANDROID__) || defined(__OpenBSD__) || \
defined(__QNXNTO__) || defined(__MVS__)
defined(__QNXNTO__) || defined(__MVS__) || defined(__HAIKU__)
#include <sys/select.h>
#endif
#if (defined(NETWARE) && !defined(__NOVELL_LIBC__))

@ -85,6 +85,11 @@ W32_FUNC const char *_w32_GetHostsFile (void);
#define PATH_HOSTS "InetDBase:Hosts"
#elif defined(__HAIKU__)
#define PATH_RESOLV_CONF "/system/settings/network/resolv.conf"
#define PATH_HOSTS "/system/settings/network/hosts"
#else
#define PATH_RESOLV_CONF "/etc/resolv.conf"

Loading…
Cancel
Save