Skip to content

Commit

Permalink
build: fix up style issues in configure script
Browse files Browse the repository at this point in the history
* Use single quotes consistently.
* Remove a few stray semicolons.
* Fix up some overly long lines.
* Line up a few expressions.
  • Loading branch information
bnoordhuis committed Aug 10, 2013
1 parent 52e47b2 commit c937f5b
Showing 1 changed file with 18 additions and 14 deletions.
32 changes: 18 additions & 14 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -406,13 +406,15 @@ def host_arch_win():

def compiler_version():
try:
proc = subprocess.Popen(shlex.split(CC) + ['--version'], stdout=subprocess.PIPE)
proc = subprocess.Popen(shlex.split(CC) + ['--version'],
stdout=subprocess.PIPE)
except WindowsError:
return (0, False)

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('.')))

return (version, is_clang)
Expand All @@ -432,7 +434,7 @@ def configure_arm(o):

def configure_node(o):
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_no_strict_aliasing'] = 1 # work around compiler bugs
o['variables']['node_prefix'] = os.path.expanduser(options.prefix or '')
Expand Down Expand Up @@ -488,15 +490,15 @@ def configure_node(o):

# By default, enable ETW on Windows.
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:
raise Exception('ETW is only supported on Windows.')
else:
o['variables']['node_use_etw'] = 'false'

# By default, enable Performance counters on Windows.
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:
raise Exception('Performance counter is only supported on Windows.')
else:
Expand Down Expand Up @@ -611,22 +613,24 @@ def configure_winsdk(o):
if flavor != 'win':
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'):
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'
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,
# leveraging gyp's GetFlavor function
flavor_params = {};
flavor_params = {}
if (options.dest_os):
flavor_params['flavor'] = options.dest_os;
flavor = GetFlavor(flavor_params);
flavor_params['flavor'] = options.dest_os
flavor = GetFlavor(flavor_params)

output = {
'variables': { 'python': sys.executable },
Expand Down Expand Up @@ -658,12 +662,12 @@ pprint.pprint(output, indent=2)

def write(filename, data):
filename = os.path.join(root_dir, filename)
print "creating ", filename
print 'creating ', filename
f = open(filename, 'w+')
f.write(data)

write('config.gypi', "# Do not edit. Generated by the configure script.\n" +
pprint.pformat(output, indent=2) + "\n")
write('config.gypi', '# Do not edit. Generated by the configure script.\n' +
pprint.pformat(output, indent=2) + '\n')

config = {
'BUILDTYPE': 'Debug' if options.debug else 'Release',
Expand Down

0 comments on commit c937f5b

Please sign in to comment.