mirror of
https://github.com/TokTok/c-toxcore
synced 2026-05-29 13:34:13 +00:00
Link -lsocket and -lnsl for socket functions on Solaris.
Also, added some #defines to make symbols visible that are in BSD but not in UNIX. Solaris needs these, since it's fairly strict with its symbol visibility in system headers.
This commit is contained in:
@@ -309,11 +309,22 @@ if(CMAKE_THREAD_LIBS_INIT)
|
||||
set(toxcore_PKGCONFIG_LIBS ${toxcore_PKGCONFIG_LIBS} ${CMAKE_THREAD_LIBS_INIT})
|
||||
endif()
|
||||
|
||||
|
||||
if(NSL_LIBRARIES)
|
||||
set(toxcore_LINK_MODULES ${toxcore_LINK_MODULES} ${NSL_LIBRARIES})
|
||||
set(toxcore_PKGCONFIG_LIBS ${toxcore_PKGCONFIG_LIBS} -lnsl)
|
||||
endif()
|
||||
|
||||
if(RT_LIBRARIES)
|
||||
set(toxcore_LINK_MODULES ${toxcore_LINK_MODULES} ${RT_LIBRARIES})
|
||||
set(toxcore_PKGCONFIG_LIBS ${toxcore_PKGCONFIG_LIBS} -lrt)
|
||||
endif()
|
||||
|
||||
if(SOCKET_LIBRARIES)
|
||||
set(toxcore_LINK_MODULES ${toxcore_LINK_MODULES} ${SOCKET_LIBRARIES})
|
||||
set(toxcore_PKGCONFIG_LIBS ${toxcore_PKGCONFIG_LIBS} -lsocket)
|
||||
endif()
|
||||
|
||||
if(WIN32)
|
||||
set(toxcore_LINK_MODULES ${toxcore_LINK_MODULES} ws2_32 iphlpapi)
|
||||
set(toxcore_PKGCONFIG_LIBS ${toxcore_PKGCONFIG_LIBS} -lws2_32 -liphlpapi)
|
||||
|
||||
@@ -8,7 +8,9 @@ include(ModulePackage)
|
||||
|
||||
find_package(Threads REQUIRED)
|
||||
|
||||
find_library(NSL_LIBRARIES nsl )
|
||||
find_library(RT_LIBRARIES rt )
|
||||
find_library(SOCKET_LIBRARIES socket )
|
||||
|
||||
# For toxcore.
|
||||
pkg_use_module(LIBSODIUM libsodium )
|
||||
|
||||
@@ -29,6 +29,12 @@
|
||||
#define _DARWIN_C_SOURCE
|
||||
#endif
|
||||
|
||||
// For Solaris.
|
||||
#ifdef __sun
|
||||
#define __EXTENSIONS__ 1
|
||||
#endif
|
||||
|
||||
// For Linux (and some BSDs).
|
||||
#ifndef _XOPEN_SOURCE
|
||||
#define _XOPEN_SOURCE 700
|
||||
#endif
|
||||
@@ -85,6 +91,11 @@
|
||||
#include <sys/types.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#ifdef __sun
|
||||
#include <stropts.h>
|
||||
#include <sys/filio.h>
|
||||
#endif
|
||||
|
||||
#define TOX_EWOULDBLOCK EWOULDBLOCK
|
||||
|
||||
#else
|
||||
|
||||
Reference in New Issue
Block a user