Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRyan Dahl <ry@tinyclouds.org>2011-07-06 05:31:33 +0400
committerRyan Dahl <ry@tinyclouds.org>2011-07-06 05:31:59 +0400
commit111305c1bdc14546e515c8cf3f2975d610aafa84 (patch)
tree21c128b0163a7934456ad732e5237f2ce7098465
parenta845bf74ae065a809dbe342c19db4774ae74f57c (diff)
Support SunOS 121. Check for ifaddrs in wscript for SunOS build.
-rw-r--r--src/platform_sunos.cc12
-rw-r--r--wscript11
2 files changed, 22 insertions, 1 deletions
diff --git a/src/platform_sunos.cc b/src/platform_sunos.cc
index 3a1cedbb106..76946fdec9c 100644
--- a/src/platform_sunos.cc
+++ b/src/platform_sunos.cc
@@ -36,7 +36,10 @@
#include <net/if.h>
#include <netinet/in.h>
#include <arpa/inet.h>
-#include <ifaddrs.h>
+
+#ifdef SUNOS_HAVE_IFADDRS
+# include <ifaddrs.h>
+#endif
@@ -297,6 +300,11 @@ int Platform::GetLoadAvg(Local<Array> *loads) {
Handle<Value> Platform::GetInterfaceAddresses() {
HandleScope scope;
+
+#ifndef SUNOS_HAVE_IFADDRS
+ return ThrowException(Exception::Error(String::New(
+ "This version of sunos doesn't support getifaddrs")));
+#else
struct ::ifaddrs *addrs, *ent;
struct ::sockaddr_in *in4;
struct ::sockaddr_in6 *in6;
@@ -355,6 +363,8 @@ Handle<Value> Platform::GetInterfaceAddresses() {
freeifaddrs(addrs);
return scope.Close(ret);
+
+#endif // SUNOS_HAVE_IFADDRS
}
diff --git a/wscript b/wscript
index 1e35c0f4fe1..cdc1c886a2b 100644
--- a/wscript
+++ b/wscript
@@ -351,6 +351,17 @@ def configure(conf):
conf.env.append_value('CPPFLAGS', '-DHAVE_MONOTONIC_CLOCK=0')
if sys.platform.startswith("sunos"):
+ code = """
+ #include <ifaddrs.h>
+ int main(void) {
+ struct ifaddrs hello;
+ return 0;
+ }
+ """
+
+ if conf.check_cc(msg="Checking for ifaddrs on solaris", fragment=code):
+ conf.env.append_value('CPPFLAGS', '-DSUNOS_HAVE_IFADDRS')
+
if not conf.check(lib='socket', uselib_store="SOCKET"):
conf.fatal("Cannot find socket library")
if not conf.check(lib='nsl', uselib_store="NSL"):