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,
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()
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'])
set config=Release
set target=Build
set target_arch=ia32
+set debug_arg=
+set nosnapshot_arg=
set noprojgen=
set nobuild=
set nosign=
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.