From 5d80bdb6aed3729a654c9b5839b7e4944b542410 Mon Sep 17 00:00:00 2001 From: Ben Noordhuis Date: Sat, 13 Nov 2010 12:58:24 +0100 Subject: [PATCH] Add --profile flag to configure script, enables gprof profiling. --- wscript | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/wscript b/wscript index 28addfb9b7..d2a517bb7d 100644 --- a/wscript +++ b/wscript @@ -39,6 +39,12 @@ def set_options(opt): , help='Build debug variant [Default: False]' , dest='debug' ) + opt.add_option( '--profile' + , action='store_true' + , default=False + , help='Enable profiling [Default: False]' + , dest='profile' + ) opt.add_option( '--efence' , action='store_true' , default=False @@ -163,6 +169,7 @@ def configure(conf): conf.env["USE_DEBUG"] = o.debug conf.env["SNAPSHOT_V8"] = not o.without_snapshot + conf.env["USE_PROFILING"] = o.profile conf.env["USE_SHARED_V8"] = o.shared_v8 or o.shared_v8_includes or o.shared_v8_libpath or o.shared_v8_libname conf.env["USE_SHARED_CARES"] = o.shared_cares or o.shared_cares_includes or o.shared_cares_libpath @@ -346,6 +353,10 @@ def configure(conf): # platform conf.env.append_value('CPPFLAGS', '-DPLATFORM="' + conf.env['DEST_OS'] + '"') + if conf.env['USE_PROFILING'] == True: + conf.env.append_value('CPPFLAGS', '-pg') + conf.env.append_value('LINKFLAGS', '-pg') + # Split off debug variant before adding variant specific defines debug_env = conf.env.copy() conf.set_env_name('debug', debug_env)