Browse Source

build: allow building with dtrace on osx

v0.10.3-release
Dave Pacheco 12 years ago
committed by isaacs
parent
commit
ec69fcf425
  1. 2
      configure
  2. 34
      node.gyp

2
configure

@ -468,7 +468,7 @@ def configure_node(o):
# By default, enable DTrace on SunOS systems. Don't allow it on other # By default, enable DTrace on SunOS systems. Don't allow it on other
# systems, since it won't work. (The MacOS build process is different than # systems, since it won't work. (The MacOS build process is different than
# SunOS, and we haven't implemented it.) # SunOS, and we haven't implemented it.)
if sys.platform.startswith('sunos'): if sys.platform.startswith('sunos') or sys.platform.startswith('darwin'):
o['variables']['node_use_dtrace'] = b(not options.without_dtrace) o['variables']['node_use_dtrace'] = b(not options.without_dtrace)
elif sys.platform.startswith('linux'): elif sys.platform.startswith('linux'):
o['variables']['node_use_dtrace'] = 'false' o['variables']['node_use_dtrace'] = 'false'

34
node.gyp

@ -160,17 +160,33 @@
'dependencies': [ 'node_dtrace_header' ], 'dependencies': [ 'node_dtrace_header' ],
'include_dirs': [ '<(SHARED_INTERMEDIATE_DIR)' ], 'include_dirs': [ '<(SHARED_INTERMEDIATE_DIR)' ],
# #
# node_dtrace_provider.cc and node_dtrace_ustack.cc do not actually # DTrace is supported on solaris, mac, and bsd. There are three
# exist. They're here to trick GYP into linking the corresponding # object files associated with DTrace support, but they're not all
# object files into the final "node" executable. These files are # used all the time:
# generated by "dtrace -G" using custom actions below, and the #
# GYP-generated Makefiles will properly build them when needed. # node_dtrace.o all configurations
# node_dtrace_ustack.o not supported on OS X
# node_dtrace_provider.o All except OS X. "dtrace -G" is not
# used on OS X.
#
# Note that node_dtrace_provider.cc and node_dtrace_ustack.cc do not
# actually exist. They're listed here to trick GYP into linking the
# corresponding object files into the final "node" executable. These
# object files are generated by "dtrace -G" using custom actions
# below, and the GYP-generated Makefiles will properly build them when
# needed.
# #
'sources': [ 'sources': [
'src/node_dtrace.cc', 'src/node_dtrace.cc',
'src/node_dtrace_provider.cc',
'src/node_dtrace_ustack.cc',
], ],
'conditions': [ [
'OS!="mac"', {
'sources': [
'src/node_dtrace_ustack.cc',
'src/node_dtrace_provider.cc',
]
}
] ]
} ], } ],
[ 'node_use_systemtap=="true"', { [ 'node_use_systemtap=="true"', {
'defines': [ 'HAVE_SYSTEMTAP=1', 'STAP_SDT_V1=1' ], 'defines': [ 'HAVE_SYSTEMTAP=1', 'STAP_SDT_V1=1' ],
@ -397,7 +413,7 @@
'target_name': 'node_dtrace_provider', 'target_name': 'node_dtrace_provider',
'type': 'none', 'type': 'none',
'conditions': [ 'conditions': [
[ 'node_use_dtrace=="true"', { [ 'node_use_dtrace=="true" and OS!="mac"', {
'actions': [ 'actions': [
{ {
'action_name': 'node_dtrace_provider_o', 'action_name': 'node_dtrace_provider_o',
@ -419,7 +435,7 @@
'target_name': 'node_dtrace_ustack', 'target_name': 'node_dtrace_ustack',
'type': 'none', 'type': 'none',
'conditions': [ 'conditions': [
[ 'node_use_dtrace=="true"', { [ 'node_use_dtrace=="true" and OS!="mac"', {
'actions': [ 'actions': [
{ {
'action_name': 'node_dtrace_ustack_constants', 'action_name': 'node_dtrace_ustack_constants',

Loading…
Cancel
Save