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']) diff --git a/vcbuild.bat b/vcbuild.bat index 632668e4b0f..fc4d94ea6d0 100644 --- a/vcbuild.bat +++ b/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.