From 33685fee48a4ebcc63af95dc597ade44ccf322f0 Mon Sep 17 00:00:00 2001 From: Ryan Dahl Date: Thu, 2 Dec 2010 16:57:16 -0800 Subject: [PATCH] Add configure flag for oprofile --- wscript | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/wscript b/wscript index 43a44292bc..0698f0b60a 100644 --- a/wscript +++ b/wscript @@ -98,6 +98,13 @@ def set_options(opt): , dest='shared_v8_libname' ) + opt.add_option( '--oprofile' + , action='store_true' + , default=False + , help="add oprofile support" + , dest='use_oprofile' + ) + opt.add_option('--shared-cares' , action='store_true' @@ -178,6 +185,8 @@ def configure(conf): conf.env["USE_SHARED_CARES"] = o.shared_cares or o.shared_cares_includes or o.shared_cares_libpath conf.env["USE_SHARED_LIBEV"] = o.shared_libev or o.shared_libev_includes or o.shared_libev_libpath + conf.env["USE_OPROFILE"] = o.use_oprofile + conf.check(lib='dl', uselib_store='DL') if not sys.platform.startswith("sunos") and not sys.platform.startswith("cygwin"): conf.env.append_value("CCFLAGS", "-rdynamic") @@ -423,7 +432,12 @@ def v8_cmd(bld, variant): else: snapshot = "" - cmd_R = sys.executable + ' "%s" -j %d -C "%s" -Y "%s" visibility=default mode=%s %s library=static %s' + if bld.env["USE_OPROFILE"]: + profile = "prof=oprofile" + else: + profile = "" + + cmd_R = sys.executable + ' "%s" -j %d -C "%s" -Y "%s" visibility=default mode=%s %s library=static %s %s' cmd = cmd_R % ( scons , Options.options.jobs @@ -432,6 +446,7 @@ def v8_cmd(bld, variant): , mode , arch , snapshot + , profile ) return ("echo '%s' && " % cmd) + cmd