@ -99,24 +99,12 @@ def configure(conf):
debug_env.set_variant('debug')
debug_env.set_variant('debug')
debug_env.append_value('CCFLAGS', ['-DDEBUG', '-g', '-O0', '-Wall', '-Wextra'])
debug_env.append_value('CCFLAGS', ['-DDEBUG', '-g', '-O0', '-Wall', '-Wextra'])
debug_env.append_value('CXXFLAGS', ['-DDEBUG', '-g', '-O0', '-Wall', '-Wextra'])
debug_env.append_value('CXXFLAGS', ['-DDEBUG', '-g', '-O0', '-Wall', '-Wextra'])
# HACK FIXME - use 32bit on Mac
if platform.system() == "Darwin":
debug_env.append_value('CCFLAGS', '-m32')
debug_env.append_value('CXXFLAGS', '-m32')
conf.write_config_header("config.h")
conf.write_config_header("config.h")
# Configure default variant
# Configure default variant
conf.setenv('default')
conf.setenv('default')
conf.env.append_value('CCFLAGS', ['-DNDEBUG', '-O3'])
conf.env.append_value('CCFLAGS', ['-DNDEBUG', '-O3'])
conf.env.append_value('CXXFLAGS', ['-DNDEBUG', '-O3'])
conf.env.append_value('CXXFLAGS', ['-DNDEBUG', '-O3'])
# HACK FIXME - use 32bit on Mac
if platform.system() == "Darwin":
conf.env.append_value('CCFLAGS', '-m32')
conf.env.append_value('CXXFLAGS', '-m32')
conf.write_config_header("config.h")
conf.write_config_header("config.h")
def build_udns(bld):
def build_udns(bld):
@ -154,9 +142,10 @@ def build_udns(bld):
# XXX Remove this when v8 defaults x86_64 to native builds
# XXX Remove this when v8 defaults x86_64 to native builds
def GuessArchitecture():
def GuessArchitecture():
id = platform.machine()
id = platform.machine()
arch = platform.architecture()[0]
if id.startswith('arm'):
if id.startswith('arm'):
return 'arm'
return 'arm'
elif '64' in id:
elif ( '64' in id) or ('64' in arch) :
return 'x64'
return 'x64'
elif (not id) or (not re.match('(x|i[3-6])86', id) is None):
elif (not id) or (not re.match('(x|i[3-6])86', id) is None):
return 'ia32'
return 'ia32'
@ -178,9 +167,6 @@ def build_v8(bld):
if GuessArchitecture() == "x64":
if GuessArchitecture() == "x64":
arch = "arch=x64"
arch = "arch=x64"
# HACK FIXME - use 32bit on Mac
if platform.system() == "Darwin": arch = "arch=ia32";
v8 = bld.new_task_gen(
v8 = bld.new_task_gen(
target = join("deps/v8", bld.env["staticlib_PATTERN"] % "v8"),
target = join("deps/v8", bld.env["staticlib_PATTERN"] % "v8"),
rule=v8rule % (v8dir_tgt, scons, "release", arch),
rule=v8rule % (v8dir_tgt, scons, "release", arch),
@ -192,10 +178,6 @@ def build_v8(bld):
bld.env_of_name('default')["LIBPATH_V8"] = v8dir_tgt
bld.env_of_name('default')["LIBPATH_V8"] = v8dir_tgt
bld.env_of_name('default')["LINKFLAGS_V8"] = ["-pthread"]
bld.env_of_name('default')["LINKFLAGS_V8"] = ["-pthread"]
# HACK FIXME - use 32bit on Mac
if platform.system() == "Darwin":
bld.env_of_name('default')["LINKFLAGS_V8"] = ["-pthread", "-m32"]
### v8 debug
### v8 debug
if bld.env["USE_DEBUG"]:
if bld.env["USE_DEBUG"]:
deps_tgt = join(bld.srcnode.abspath(bld.env_of_name("debug")),"deps")
deps_tgt = join(bld.srcnode.abspath(bld.env_of_name("debug")),"deps")
@ -205,11 +187,6 @@ def build_v8(bld):
bld.env_of_name('debug')["STATICLIB_V8"] = "v8_g"
bld.env_of_name('debug')["STATICLIB_V8"] = "v8_g"
bld.env_of_name('debug')["LIBPATH_V8"] = v8dir_tgt
bld.env_of_name('debug')["LIBPATH_V8"] = v8dir_tgt
bld.env_of_name('debug')["LINKFLAGS_V8"] = ["-pthread"]
bld.env_of_name('debug')["LINKFLAGS_V8"] = ["-pthread"]
# HACK FIXME - use 32bit on Mac
if platform.system() == "Darwin":
bld.env_of_name('debug')["LINKFLAGS_V8"] = ["-pthread", "-m32"]
v8_debug.rule = v8rule % (v8dir_tgt, scons, "debug", arch)
v8_debug.rule = v8rule % (v8dir_tgt, scons, "debug", arch)
v8_debug.target = join("deps/v8", bld.env["staticlib_PATTERN"] % "v8_g")
v8_debug.target = join("deps/v8", bld.env["staticlib_PATTERN"] % "v8_g")