mirror of
https://github.com/yquake2/yquake2remaster.git
synced 2024-11-10 07:12:07 +00:00
solairs/illumos build fix proposal.
This commit is contained in:
parent
f4e7ee59c4
commit
53c684525f
4 changed files with 17 additions and 2 deletions
|
@ -160,6 +160,9 @@ else()
|
|||
else()
|
||||
list(APPEND yquake2LinkerFlags "-lnetwork")
|
||||
endif()
|
||||
if (${CMAKE_SYSTEM_NAME} MATCHES "SunOS")
|
||||
list(APPEND yquake2LinkerFlags "-lsocket -lnsl")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(NOT ${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
|
||||
|
|
2
Makefile
2
Makefile
|
@ -339,6 +339,8 @@ else ifeq ($(YQ2_OSTYPE), Darwin)
|
|||
override LDFLAGS += -arch $(YQ2_ARCH)
|
||||
else ifeq ($(YQ2_OSTYPE), Haiku)
|
||||
override LDFLAGS += -lm -lnetwork
|
||||
else ifeq ($(YQ2_OSTYPE), SunOS)
|
||||
override LDFLAGS += -lm -lsocket -lnsl
|
||||
endif
|
||||
|
||||
ifneq ($(YQ2_OSTYPE), Darwin)
|
||||
|
|
|
@ -29,7 +29,7 @@
|
|||
|
||||
#include "../../common/header/shared.h"
|
||||
|
||||
#if defined(__linux) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__)
|
||||
#if defined(__linux) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__sun)
|
||||
#include <unistd.h> // readlink(), amongst others
|
||||
#endif
|
||||
|
||||
|
@ -73,14 +73,18 @@ static void SetExecutablePath(char* exePath)
|
|||
exePath[0] = '\0';
|
||||
}
|
||||
|
||||
#elif defined(__linux)
|
||||
#elif defined(__linux) || defined(__sun)
|
||||
|
||||
// all the platforms that have /proc/$pid/exe or similar that symlink the
|
||||
// real executable - basiscally Linux and the BSDs except for FreeBSD which
|
||||
// doesn't enable proc by default and has a sysctl() for this. OpenBSD once
|
||||
// had /proc but removed it for security reasons.
|
||||
char buf[PATH_MAX] = {0};
|
||||
#if defined(__linux)
|
||||
snprintf(buf, sizeof(buf), "/proc/%d/exe", getpid());
|
||||
#else
|
||||
snprintf(buf, sizeof(buf), "/proc/%ld/path/a.out", getpid());
|
||||
#endif
|
||||
// readlink() doesn't null-terminate!
|
||||
int len = readlink(buf, exePath, PATH_MAX-1);
|
||||
if (len <= 0)
|
||||
|
|
|
@ -34,6 +34,12 @@
|
|||
#include <sys/param.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include <sys/uio.h>
|
||||
#if defined(__sun)
|
||||
#include <sys/filio.h>
|
||||
#if !defined(MAX)
|
||||
#define MAX(a, b) (((a) > (b)) ? (a) : (b))
|
||||
#endif
|
||||
#endif
|
||||
#include <errno.h>
|
||||
#include <arpa/inet.h>
|
||||
#include <net/if.h>
|
||||
|
|
Loading…
Reference in a new issue