diff options
author | Nathan Rajlich <nathan@tootallnate.net> | 2012-03-16 02:17:25 +0400 |
---|---|---|
committer | Nathan Rajlich <nathan@tootallnate.net> | 2012-03-16 03:12:19 +0400 |
commit | dc752327bbd700e686e14169c7d635960eafe456 (patch) | |
tree | fc2d9e2b40d17f872fe97876b0a47f4629454679 /configure | |
parent | 1a9799864481c789950388b3c344110ff923e30a (diff) |
vcbuild: run the 'configure' script in vcbuild.bat
So that a 'config.gypi' file gets generated, which is
required for the `process.config` object (see #2928).
Diffstat (limited to 'configure')
-rwxr-xr-x | configure | 33 |
1 files changed, 30 insertions, 3 deletions
diff --git a/configure b/configure index 00a8ed0d6bc..30b8f4bcfe8 100755 --- a/configure +++ b/configure @@ -146,8 +146,8 @@ def pkg_config(pkg): return (libs, cflags) -def host_arch(): - """Host architecture. One of arm, ia32 or x64.""" +def host_arch_cc(): + """Host architecture check using the CC command.""" p = subprocess.Popen([CC, '-dM', '-E', '-'], stdin=subprocess.PIPE, @@ -183,6 +183,29 @@ def host_arch(): 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(): 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" + ("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']) |