From 5dd2d189ada193841285d8c19ff998de9f1574d2 Mon Sep 17 00:00:00 2001 From: Ian Wilson Date: Thu, 8 Sep 2011 19:41:53 -0400 Subject: Fixes for compiling with Solaris kernel. Fixed typo in CONF_PLATFORM_SOLARIS. Made sure that we don't try to use the gcc endianness for Solaris. Included sys/filio.h for Solaris so that FIONBIO is defined. Added linking flags -lsocket and -lnsl for Solaris in bam. --- bam.lua | 5 +++++ src/base/detect.h | 4 ++-- src/base/system.c | 4 ++++ 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/bam.lua b/bam.lua index 5816a26d..46cc18dd 100644 --- a/bam.lua +++ b/bam.lua @@ -159,6 +159,11 @@ function build(settings) else settings.link.libs:Add("pthread") end + + if platform == "solaris" then + settings.link.flags:Add("-lsocket") + settings.link.flags:Add("-lnsl") + end elseif family == "windows" then settings.link.libs:Add("gdi32") settings.link.libs:Add("user32") diff --git a/src/base/detect.h b/src/base/detect.h index f802b119..eb12244c 100644 --- a/src/base/detect.h +++ b/src/base/detect.h @@ -63,7 +63,7 @@ #if defined(__sun) #define CONF_FAMILY_UNIX 1 #define CONF_FAMILY_STRING "unix" - #define CONF_PLATFROM_SOLARIS 1 + #define CONF_PLATFORM_SOLARIS 1 #define CONF_PLATFORM_STRING "solaris" #endif @@ -77,7 +77,7 @@ /* use gcc endianness definitions when available */ -#if defined(__GNUC__) && !defined(__APPLE__) && !defined(__MINGW32__) +#if defined(__GNUC__) && !defined(__APPLE__) && !defined(__MINGW32__) && !defined(__sun) #if defined(__FreeBSD__) || defined(__OpenBSD__) #include #else diff --git a/src/base/system.c b/src/base/system.c index e451cb9a..6dc8cc7d 100644 --- a/src/base/system.c +++ b/src/base/system.c @@ -46,6 +46,10 @@ #error NOT IMPLEMENTED #endif +#if defined(CONF_PLATFORM_SOLARIS) + #include +#endif + #if defined(__cplusplus) extern "C" { #endif -- cgit 1.4.1