|
@ -146,8 +146,8 @@ def pkg_config(pkg): |
|
|
return (libs, cflags) |
|
|
return (libs, cflags) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def host_arch(): |
|
|
def host_arch_cc(): |
|
|
"""Host architecture. One of arm, ia32 or x64.""" |
|
|
"""Host architecture check using the CC command.""" |
|
|
|
|
|
|
|
|
p = subprocess.Popen([CC, '-dM', '-E', '-'], |
|
|
p = subprocess.Popen([CC, '-dM', '-E', '-'], |
|
|
stdin=subprocess.PIPE, |
|
|
stdin=subprocess.PIPE, |
|
@ -183,6 +183,29 @@ def host_arch(): |
|
|
return rtn |
|
|
return rtn |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def host_arch_win(): |
|
|
|
|
|
"""Host architecture check using environ vars (better way to do this?)""" |
|
|
|
|
|
|
|
|
|
|
|
arch = os.environ.get('PROCESSOR_ARCHITECTURE', 'x86') |
|
|
|
|
|
|
|
|
|
|
|
matchup = { |
|
|
|
|
|
'AMD64' : 'x64', |
|
|
|
|
|
'x86' : 'ia32', |
|
|
|
|
|
'arm' : 'arm', |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
return matchup.get(arch, 'ia32') |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def host_arch(): |
|
|
|
|
|
"""Host architecture. One of arm, ia32 or x64.""" |
|
|
|
|
|
if os.name == 'nt': |
|
|
|
|
|
arch = host_arch_win() |
|
|
|
|
|
else: |
|
|
|
|
|
arch = host_arch_cc() |
|
|
|
|
|
return arch |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def target_arch(): |
|
|
def target_arch(): |
|
|
return host_arch() |
|
|
return host_arch() |
|
|
|
|
|
|
|
@ -314,4 +337,8 @@ write('config.gypi', "# Do not edit. Generated by the configure script.\n" + |
|
|
write('config.mk', "# Do not edit. Generated by the configure script.\n" + |
|
|
write('config.mk', "# Do not edit. Generated by the configure script.\n" + |
|
|
("BUILDTYPE=%s\n" % ('Debug' if options.debug else 'Release'))) |
|
|
("BUILDTYPE=%s\n" % ('Debug' if options.debug else 'Release'))) |
|
|
|
|
|
|
|
|
subprocess.call(['tools/gyp_node','-f', 'make']) |
|
|
if os.name == 'nt': |
|
|
|
|
|
subprocess.call(['python', 'tools/gyp_node', '-f', 'msvs', |
|
|
|
|
|
'-G', 'msvs_version=2010']) |
|
|
|
|
|
else: |
|
|
|
|
|
subprocess.call(['tools/gyp_node', '-f', 'make']) |
|
|