Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

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).
  • Loading branch information...
commit dc752327bbd700e686e14169c7d635960eafe456 1 parent 1a97998
@TooTallNate TooTallNate authored
Showing with 35 additions and 12 deletions.
  1. +30 −3 configure
  2. +5 −9 vcbuild.bat
View
33 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'])
View
14 vcbuild.bat
@@ -15,6 +15,8 @@ if /i "%1"=="/?" goto help
set config=Release
set target=Build
set target_arch=ia32
+set debug_arg=
+set nosnapshot_arg=
set noprojgen=
set nobuild=
set nosign=
@@ -57,21 +59,15 @@ goto next-arg
if defined upload goto upload
if defined jslint goto jslint
+if "%config%"=="Debug" set debug_arg=--debug
+if defined nosnapshot set nosnapshot_arg=--without-snapshot
:project-gen
@rem Skip project generation if requested.
if defined noprojgen goto msbuild
@rem Generate the VS project.
-if defined nosnapshot goto nosnapshotgen
-python tools\gyp_node -f msvs -G msvs_version=2010 -Dtarget_arch=%target_arch%
-if errorlevel 1 goto create-msvs-files-failed
-if not exist node.sln goto create-msvs-files-failed
-echo Project files generated.
-goto msbuild
-
-:nosnapshotgen
-python tools\gyp_node -f msvs -G msvs_version=2010 -D v8_use_snapshot='false' -Dtarget_arch=%target_arch%
+python configure %debug_arg% %nosnapshot_arg% --dest-cpu=%target_arch%
if errorlevel 1 goto create-msvs-files-failed
if not exist node.sln goto create-msvs-files-failed
echo Project files generated.
Please sign in to comment.
Something went wrong with that request. Please try again.