diff --git a/SConstruct b/SConstruct
index ff3f7e3fe4f222c0d547f479a81baacebdaad195..2fedae36fdba9ffc1a555d016506b22e89fd5de0 100644
--- a/SConstruct
+++ b/SConstruct
@@ -8,7 +8,7 @@ env=Environment()
 
 # default build options
 env.Replace(CFLAGS=" -fPIC ")
-env.Replace(CXXFLAGS=" -std=c++11 -fPIC ")
+env.Replace(CXXFLAGS=" -std=c++0x -fPIC ")
 env.Replace(LINKFLAGS=" -fPIC ")
 
 # parse arguments
@@ -16,11 +16,17 @@ env.Replace(SECURITY_TRANSFORMS_HOME=os.environ['SECURITY_TRANSFORMS_HOME'])
 env.Replace(ZIPR_HOME=os.environ['ZIPR_HOME'])
 env.Replace(ZIPR_INSTALL=os.environ['ZIPR_INSTALL'])
 env.Replace(ZIPR_SDK=os.environ['ZIPR_SDK'])
+env.Replace(profile=ARGUMENTS.get("profile",0))
 env.Replace(debug=ARGUMENTS.get("debug",0))
 env.Replace(do_cgc=ARGUMENTS.get("do_cgc",0))
 env.Replace(do_64bit_build=ARGUMENTS.get("do_64bit_build",0))
 
-
+if int(env['profile']) == 1:
+        print "Setting profile and debug mode"
+        env.Append(CFLAGS=" -pg")
+        env.Append(CXXFLAGS=" -pg")
+        env.Append(LINKFLAGS=" -pg")
+        env['debug'] = 1
 if int(env['debug']) == 1:
         print "Setting debug mode"
         env.Append(CFLAGS=" -g")
diff --git a/test/SConscript b/test/SConscript
index daf96ce13d34c3df15e5ce4ae42f61acfd596af4..5570714ef1acb2e6f173a66011406551ccc3cbb6 100644
--- a/test/SConscript
+++ b/test/SConscript
@@ -62,7 +62,7 @@ libpath='''
 	'''
 
 myenv.Append(CCFLAGS=" -Wall ")
-myenv.Append(CXXFLAGS=" -pg -std=c++11 -g -O0 ")
+myenv.Append(CXXFLAGS=" -pg -std=c++0x -g -O0 ")
 #myenv.Append(CXXFLAGS=" -pg -g -O0 ")
 myenv.Append(LINKFLAGS="  -pg -Wl,-E ")	# export all symbols