build: fix up style issues in configure script

* Use single quotes consistently.
* Remove a few stray semicolons.
* Fix up some overly long lines.
* Line up a few expressions.
This commit is contained in:
Ben Noordhuis 2013-08-02 11:50:45 +02:00
parent 52e47b24b3
commit c937f5b587

32
configure vendored
View File

@ -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)
@ -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 '')
@ -488,7 +490,7 @@ 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:
@ -496,7 +498,7 @@ def configure_node(o):
# 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:
@ -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 },
@ -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',