|
@ -406,13 +406,15 @@ def host_arch_win(): |
|
|
|
|
|
|
|
|
def compiler_version(): |
|
|
def compiler_version(): |
|
|
try: |
|
|
try: |
|
|
proc = subprocess.Popen(shlex.split(CC) + ['--version'], stdout=subprocess.PIPE) |
|
|
proc = subprocess.Popen(shlex.split(CC) + ['--version'], |
|
|
|
|
|
stdout=subprocess.PIPE) |
|
|
except WindowsError: |
|
|
except WindowsError: |
|
|
return (0, False) |
|
|
return (0, False) |
|
|
|
|
|
|
|
|
is_clang = 'clang' in proc.communicate()[0].split('\n')[0] |
|
|
is_clang = 'clang' in proc.communicate()[0].split('\n')[0] |
|
|
|
|
|
|
|
|
proc = subprocess.Popen(shlex.split(CC) + ['-dumpversion'], stdout=subprocess.PIPE) |
|
|
proc = subprocess.Popen(shlex.split(CC) + ['-dumpversion'], |
|
|
|
|
|
stdout=subprocess.PIPE) |
|
|
version = tuple(map(int, proc.communicate()[0].split('.'))) |
|
|
version = tuple(map(int, proc.communicate()[0].split('.'))) |
|
|
|
|
|
|
|
|
return (version, is_clang) |
|
|
return (version, is_clang) |
|
@ -432,7 +434,7 @@ def configure_arm(o): |
|
|
|
|
|
|
|
|
def configure_node(o): |
|
|
def configure_node(o): |
|
|
if options.dest_os == 'android': |
|
|
if options.dest_os == 'android': |
|
|
o['variables']['OS'] = "android" |
|
|
o['variables']['OS'] = 'android' |
|
|
o['variables']['v8_enable_gdbjit'] = 1 if options.gdb else 0 |
|
|
o['variables']['v8_enable_gdbjit'] = 1 if options.gdb else 0 |
|
|
o['variables']['v8_no_strict_aliasing'] = 1 # work around compiler bugs |
|
|
o['variables']['v8_no_strict_aliasing'] = 1 # work around compiler bugs |
|
|
o['variables']['node_prefix'] = os.path.expanduser(options.prefix or '') |
|
|
o['variables']['node_prefix'] = os.path.expanduser(options.prefix or '') |
|
@ -488,7 +490,7 @@ def configure_node(o): |
|
|
|
|
|
|
|
|
# By default, enable ETW on Windows. |
|
|
# By default, enable ETW on Windows. |
|
|
if flavor == 'win': |
|
|
if flavor == 'win': |
|
|
o['variables']['node_use_etw'] = b(not options.without_etw); |
|
|
o['variables']['node_use_etw'] = b(not options.without_etw) |
|
|
elif options.with_etw: |
|
|
elif options.with_etw: |
|
|
raise Exception('ETW is only supported on Windows.') |
|
|
raise Exception('ETW is only supported on Windows.') |
|
|
else: |
|
|
else: |
|
@ -496,7 +498,7 @@ def configure_node(o): |
|
|
|
|
|
|
|
|
# By default, enable Performance counters on Windows. |
|
|
# By default, enable Performance counters on Windows. |
|
|
if flavor == 'win': |
|
|
if flavor == 'win': |
|
|
o['variables']['node_use_perfctr'] = b(not options.without_perfctr); |
|
|
o['variables']['node_use_perfctr'] = b(not options.without_perfctr) |
|
|
elif options.with_perfctr: |
|
|
elif options.with_perfctr: |
|
|
raise Exception('Performance counter is only supported on Windows.') |
|
|
raise Exception('Performance counter is only supported on Windows.') |
|
|
else: |
|
|
else: |
|
@ -611,22 +613,24 @@ def configure_winsdk(o): |
|
|
if flavor != 'win': |
|
|
if flavor != 'win': |
|
|
return |
|
|
return |
|
|
|
|
|
|
|
|
winsdk_dir = os.environ.get("WindowsSdkDir") |
|
|
winsdk_dir = os.environ.get('WindowsSdkDir') |
|
|
|
|
|
|
|
|
if winsdk_dir and os.path.isfile(winsdk_dir + '\\bin\\ctrpp.exe'): |
|
|
if winsdk_dir and os.path.isfile(winsdk_dir + '\\bin\\ctrpp.exe'): |
|
|
print "Found ctrpp in WinSDK--will build generated files into tools/msvs/genfiles." |
|
|
print('Found ctrpp in WinSDK--will build generated files ' |
|
|
|
|
|
'into tools/msvs/genfiles.') |
|
|
o['variables']['node_has_winsdk'] = 'true' |
|
|
o['variables']['node_has_winsdk'] = 'true' |
|
|
return |
|
|
return |
|
|
|
|
|
|
|
|
print "ctrpp not found in WinSDK path--using pre-gen files from tools/msvs/genfiles." |
|
|
print('ctrpp not found in WinSDK path--using pre-gen files ' |
|
|
|
|
|
'from tools/msvs/genfiles.') |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# determine the "flavor" (operating system) we're building for, |
|
|
# determine the "flavor" (operating system) we're building for, |
|
|
# leveraging gyp's GetFlavor function |
|
|
# leveraging gyp's GetFlavor function |
|
|
flavor_params = {}; |
|
|
flavor_params = {} |
|
|
if (options.dest_os): |
|
|
if (options.dest_os): |
|
|
flavor_params['flavor'] = options.dest_os; |
|
|
flavor_params['flavor'] = options.dest_os |
|
|
flavor = GetFlavor(flavor_params); |
|
|
flavor = GetFlavor(flavor_params) |
|
|
|
|
|
|
|
|
output = { |
|
|
output = { |
|
|
'variables': { 'python': sys.executable }, |
|
|
'variables': { 'python': sys.executable }, |
|
@ -658,12 +662,12 @@ pprint.pprint(output, indent=2) |
|
|
|
|
|
|
|
|
def write(filename, data): |
|
|
def write(filename, data): |
|
|
filename = os.path.join(root_dir, filename) |
|
|
filename = os.path.join(root_dir, filename) |
|
|
print "creating ", filename |
|
|
print 'creating ', filename |
|
|
f = open(filename, 'w+') |
|
|
f = open(filename, 'w+') |
|
|
f.write(data) |
|
|
f.write(data) |
|
|
|
|
|
|
|
|
write('config.gypi', "# Do not edit. Generated by the configure script.\n" + |
|
|
write('config.gypi', '# Do not edit. Generated by the configure script.\n' + |
|
|
pprint.pformat(output, indent=2) + "\n") |
|
|
pprint.pformat(output, indent=2) + '\n') |
|
|
|
|
|
|
|
|
config = { |
|
|
config = { |
|
|
'BUILDTYPE': 'Debug' if options.debug else 'Release', |
|
|
'BUILDTYPE': 'Debug' if options.debug else 'Release', |
|
|