V0.6 #3115

Closed
wants to merge 1 commit into
from
View
@@ -172,7 +172,10 @@
]
}],
[ 'OS=="mac"', {
- 'sources': [ 'src/platform_darwin.cc' ],
+ 'sources': [
+ 'src/platform_darwin.cc',
+ 'src/platform_darwin_proctitle.cc'
+ ],
'libraries': [ '-framework Carbon' ],
}],
[ 'OS=="linux"', {
View
@@ -38,14 +38,14 @@
#include <netinet/in.h>
#include <arpa/inet.h>
#include <ifaddrs.h>
-
-
+#include <errno.h>
@bnoordhuis

bnoordhuis Apr 16, 2012

Owner

What do you need <errno.h> for?

@jdduncan

jdduncan Apr 16, 2012

Without it I get this:

../src/platform_darwin.cc: In static member function ‘static v8::Handlev8::Value node::Platform::GetInterfaceAddresses()’:
../src/platform_darwin.cc:167: error: ‘errno’ was not declared in this scope

namespace node {
using namespace v8;
-static char *process_title;
+char *process_title;
+
double Platform::prog_start_time = Platform::GetUptime();
char** Platform::SetupArgs(int argc, char *argv[]) {
@@ -56,7 +56,6 @@ char** Platform::SetupArgs(int argc, char *argv[]) {
// Platform::SetProcessTitle implemented in platform_darwin_proctitle.cc
} // namespace node
-#include "platform_darwin_proctitle.cc"
namespace node {
@@ -36,8 +36,13 @@
#include <err.h>
#endif
+#include "node.h"
+#include "platform.h"
+
namespace node {
+extern char * process_title;
@bnoordhuis

bnoordhuis Apr 16, 2012

Owner

It's quite surprising that this even compiled on newer versions of OS X. Compilers and linkers are way too lenient these days. :-)

EDIT: Right, this file is excluded from the build, that's why.

+
void Platform::SetProcessTitle(char *title) {
static int symbol_lookup_status = 0; // 1=ok, 2=unavailable
if (symbol_lookup_status == 2) {
View
@@ -443,6 +443,8 @@ def configure(conf):
if sys.platform.startswith("darwin"):
# used by platform_darwin_*.cc
conf.env.append_value('LINKFLAGS', ['-framework','Carbon'])
+ # define _DARWIN_C_SOURCE to enable SUSv3 UNIX 2003 compatiblity
+ conf.env.append_value('CPPFLAGS', '-D_DARWIN_C_SOURCE')
@bnoordhuis

bnoordhuis Apr 16, 2012

Owner

My bad. This was already fixed in master but I never back-ported the patch. Fixed (in v0.6) in 3f42612.

# cross compile for architecture specified by DEST_CPU
if 'DEST_CPU' in conf.env:
arch = conf.env['DEST_CPU']
@@ -510,6 +512,9 @@ def configure(conf):
Options.options.platform_file = False
conf.env["PLATFORM_FILE"] = "src/platform_none.cc"
+ if sys.platform.startswith("darwin"):
+ conf.env["PLATFORM_FILE"] = "src/platform_darwin.cc src/platform_darwin_proctitle.cc"
+
if conf.env['USE_PROFILING'] == True:
conf.env.append_value('CPPFLAGS', '-pg')
conf.env.append_value('LINKFLAGS', '-pg')