mirror of
https://github.com/irungentoo/toxcore.git
synced 2024-03-22 13:30:51 +08: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:
parent
7c05b3a85e
commit
bf79fdbb43
|
@ -309,11 +309,22 @@ if(CMAKE_THREAD_LIBS_INIT)
|
||||||
set(toxcore_PKGCONFIG_LIBS ${toxcore_PKGCONFIG_LIBS} ${CMAKE_THREAD_LIBS_INIT})
|
set(toxcore_PKGCONFIG_LIBS ${toxcore_PKGCONFIG_LIBS} ${CMAKE_THREAD_LIBS_INIT})
|
||||||
endif()
|
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)
|
if(RT_LIBRARIES)
|
||||||
set(toxcore_LINK_MODULES ${toxcore_LINK_MODULES} ${RT_LIBRARIES})
|
set(toxcore_LINK_MODULES ${toxcore_LINK_MODULES} ${RT_LIBRARIES})
|
||||||
set(toxcore_PKGCONFIG_LIBS ${toxcore_PKGCONFIG_LIBS} -lrt)
|
set(toxcore_PKGCONFIG_LIBS ${toxcore_PKGCONFIG_LIBS} -lrt)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
if(SOCKET_LIBRARIES)
|
||||||
|
set(toxcore_LINK_MODULES ${toxcore_LINK_MODULES} ${SOCKET_LIBRARIES})
|
||||||
|
set(toxcore_PKGCONFIG_LIBS ${toxcore_PKGCONFIG_LIBS} -lsocket)
|
||||||
|
endif()
|
||||||
|
|
||||||
if(WIN32)
|
if(WIN32)
|
||||||
set(toxcore_LINK_MODULES ${toxcore_LINK_MODULES} ws2_32 iphlpapi)
|
set(toxcore_LINK_MODULES ${toxcore_LINK_MODULES} ws2_32 iphlpapi)
|
||||||
set(toxcore_PKGCONFIG_LIBS ${toxcore_PKGCONFIG_LIBS} -lws2_32 -liphlpapi)
|
set(toxcore_PKGCONFIG_LIBS ${toxcore_PKGCONFIG_LIBS} -lws2_32 -liphlpapi)
|
||||||
|
|
|
@ -8,7 +8,9 @@ include(ModulePackage)
|
||||||
|
|
||||||
find_package(Threads REQUIRED)
|
find_package(Threads REQUIRED)
|
||||||
|
|
||||||
|
find_library(NSL_LIBRARIES nsl )
|
||||||
find_library(RT_LIBRARIES rt )
|
find_library(RT_LIBRARIES rt )
|
||||||
|
find_library(SOCKET_LIBRARIES socket )
|
||||||
|
|
||||||
# For toxcore.
|
# For toxcore.
|
||||||
pkg_use_module(LIBSODIUM libsodium )
|
pkg_use_module(LIBSODIUM libsodium )
|
||||||
|
|
|
@ -29,6 +29,12 @@
|
||||||
#define _DARWIN_C_SOURCE
|
#define _DARWIN_C_SOURCE
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
// For Solaris.
|
||||||
|
#ifdef __sun
|
||||||
|
#define __EXTENSIONS__ 1
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// For Linux (and some BSDs).
|
||||||
#ifndef _XOPEN_SOURCE
|
#ifndef _XOPEN_SOURCE
|
||||||
#define _XOPEN_SOURCE 700
|
#define _XOPEN_SOURCE 700
|
||||||
#endif
|
#endif
|
||||||
|
@ -85,6 +91,11 @@
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
|
||||||
|
#ifdef __sun
|
||||||
|
#include <stropts.h>
|
||||||
|
#include <sys/filio.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#define TOX_EWOULDBLOCK EWOULDBLOCK
|
#define TOX_EWOULDBLOCK EWOULDBLOCK
|
||||||
|
|
||||||
#else
|
#else
|
||||||
|
|
Loading…
Reference in New Issue
Block a user