Skip to content

Commit 7d9d881

Browse files
committed
Correctly guess x64 architecture
Previously was dependent on how python was compiled, and this was causing build errors for some Macintosh Snow Leopard users. The solution is to use a functionality already in WAF which looks at the output of echo | gcc -E -dM -
1 parent 04e53ca commit 7d9d881

File tree

1 file changed

+2
-15
lines changed

1 file changed

+2
-15
lines changed

wscript

+2-15
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
# /usr/bin/env python
2-
import platform
32
import re
43
import Options
54
import sys, os, shutil
@@ -182,19 +181,6 @@ def build_udns(bld):
182181
bld.env_of_name('debug')["LIBPATH_UDNS"] = debug_dir
183182
bld.install_files('${PREFIX}/include/node/', 'deps/udns/udns.h')
184183

185-
# XXX Remove this when v8 defaults x86_64 to native builds
186-
def GuessArchitecture():
187-
id = platform.machine()
188-
arch = platform.architecture()[0]
189-
if id.startswith('arm'):
190-
return 'arm'
191-
elif ('64' in id) or ('64' in arch):
192-
return 'x64'
193-
elif (not id) or (not re.match('(x|i[3-6])86', id) is None):
194-
return 'ia32'
195-
else:
196-
return None
197-
198184
def v8_cmd(bld, variant):
199185
scons = join(cwd, 'tools/scons/scons.py')
200186
deps_src = join(bld.path.abspath(),"deps")
@@ -205,8 +191,9 @@ def v8_cmd(bld, variant):
205191
# cannot see symbols in the executable which are hidden, even if the
206192
# executable is statically linked together...
207193

194+
# XXX Remove this when v8 defaults x86_64 to native builds
208195
arch = ""
209-
if GuessArchitecture() == "x64":
196+
if bld.env['DEST_CPU'] == 'x86_64':
210197
arch = "arch=x64"
211198

212199
if variant == "default":

0 commit comments

Comments
 (0)