diff --git a/SConstruct b/SConstruct
index c0dd68a00d406b0148a93709cf916ad6d05f282c..75d708e91ee27c97bc1439494bc61a72fe3d0e3a 100644
--- a/SConstruct
+++ b/SConstruct
@@ -1,6 +1,45 @@
-
+import os
+import sys
 
 
 env=Environment()
+
+# default build options
+env.Replace(CFLAGS="-fPIC")
+env.Replace(CCFLAGS="-fPIC")
+env.Replace(LDFLAGS="-fPIC")
+
+# parse arguments
+env.Replace(SECURITY_TRANSFORMS_HOME=os.environ['SECURITY_TRANSFORMS_HOME'])
+env.Replace(do_64bit_build=ARGUMENTS.get("do_64bit_build",None))
+env.Replace(debug=ARGUMENTS.get("debug",0))
+
+
+if int(env['debug']) == 1:
+        print "Setting debug mode"
+        env.Append(CFLAGS=" -g")
+        env.Append(CCFLAGS=" -g")
+else:
+        print "Setting release mode"
+        env.Append(CFLAGS=" -O3")
+        env.Append(CCFLAGS=" -O3")
+
+# set 32/64 bit build properly
+print  "env[64bit]="+str(env['do_64bit_build'])
+if env['do_64bit_build'] is None:
+	print 'Defaulting to default compilation size.'
+elif int(env['do_64bit_build']) == 1:
+	print 'Using 64-bit compilation size.'
+        env.Append(CFLAGS=" -m64")
+        env.Append(CCFLAGS=" -m64")
+        env.Append(LDFLAGS=" -m64")
+else:
+	print 'Using 32-bit compilation size.'
+        env.Append(CFLAGS=" -m32")
+        env.Append(CCFLAGS=" -m32")
+        env.Append(LDFLAGS=" -m32")
+
+
 Export('env')
 SConscript("SConscript")
+
diff --git a/beaengine/SConscript b/beaengine/SConscript
index 559d97dfc8d9e037e96be864b45d53b9927cb618..bc99129773880f60fab8f1a7bdaab33a77ceb4c6 100644
--- a/beaengine/SConscript
+++ b/beaengine/SConscript
@@ -1,7 +1,9 @@
 import os
 
 Import('env')
-env.Replace(SECURITY_TRANSFORMS_HOME=os.environ['SECURITY_TRANSFORMS_HOME'])
+
+myenv=env.Clone();
+myenv.Replace(SECURITY_TRANSFORMS_HOME=os.environ['SECURITY_TRANSFORMS_HOME'])
 
 files=  '''
 	./beaengineSources/BeaEngine.c
@@ -10,19 +12,9 @@ cpppath='''
 	./include/
 	./beaengineSources/Includes/
 	'''
+myenv=myenv.Clone(CPPPATH=Split(cpppath))
+lib=myenv.Library("BeaEngine_s_d", Split(files))
 
-
-# inherit from above.
-#CFLAGS="-fPIC  -pedantic -ansi -pipe -fno-common -fshort-enums -g -Wall -W -Wextra -Wconversion -Wno-long-long -Wshadow -Wpointer-arith -Wcast-qual -Wcast-align -Wwrite-strings"
-#CC="gcc"
-#env=env.Clone(CC=CC, CPPPATH=Split(cpppath), CFLAGS=CFLAGS)
-
-
-env=env.Clone(CPPPATH=Split(cpppath))
-lib=env.Library("BeaEngine_s_d", Split(files))
-
-install=env.Install("$SECURITY_TRANSFORMS_HOME/lib/", lib)
-env.Alias("install", "$SECURITY_TRANSFORMS_HOME/lib/")
-
+install=myenv.Install("$SECURITY_TRANSFORMS_HOME/lib/", lib)
 Default(install)
 
diff --git a/libIRDB/SConscript b/libIRDB/SConscript
index 0a61561b9ed2c20eefe5e11a6a4bd516cb64e175..9a892bbbe37ce72b3e30aa45009940def655d08a 100644
--- a/libIRDB/SConscript
+++ b/libIRDB/SConscript
@@ -2,7 +2,6 @@ import os
 
 Import('env')
 
-print "In libIRDB/SConscript"
 
 SConscript("src/SConscript")
 SConscript("test/SConscript")
diff --git a/libIRDB/src/cfg/SConscript b/libIRDB/src/cfg/SConscript
index c467cb68f84e79a39c403cb2891d9bb316fa6907..8119b10ad7e3c8dffad7bf1cc149f2b13dae0d47 100644
--- a/libIRDB/src/cfg/SConscript
+++ b/libIRDB/src/cfg/SConscript
@@ -1,7 +1,9 @@
 import os
 
 Import('env')
-env.Replace(SECURITY_TRANSFORMS_HOME=os.environ['SECURITY_TRANSFORMS_HOME'])
+
+myenv=env
+myenv.Replace(SECURITY_TRANSFORMS_HOME=os.environ['SECURITY_TRANSFORMS_HOME'])
 
 
 libname="IRDB-cfg"
@@ -15,13 +17,11 @@ cpppath='''
 	$SECURITY_TRANSFORMS_HOME/beaengine/beaengineSources/Includes/
 	'''
 
-env['CCFLAGS'].append(Split("-Wall -W -Wextra -Wconversion "))
-
-env=env.Clone(CPPPATH=Split(cpppath))
-lib=env.Library(libname, Split(files))
+myenv.Append(CCFLAGS=" -Wall -W -Wextra -Wconversion ")
 
-install=env.Install("$SECURITY_TRANSFORMS_HOME/lib/", lib)
-env.Alias("install", "$SECURITY_TRANSFORMS_HOME/lib/")
+myenv=myenv.Clone(CPPPATH=Split(cpppath))
+lib=myenv.Library(libname, Split(files))
 
+install=myenv.Install("$SECURITY_TRANSFORMS_HOME/lib/", lib)
 Default(install)
 
diff --git a/libIRDB/src/core/SConscript b/libIRDB/src/core/SConscript
index a78db2e2c17d6d5df372e51a04a4295e11837ff4..58379f244157584223e66fc8d383dda8440a3c2f 100644
--- a/libIRDB/src/core/SConscript
+++ b/libIRDB/src/core/SConscript
@@ -1,7 +1,8 @@
 import os
 
 Import('env')
-env.Replace(SECURITY_TRANSFORMS_HOME=os.environ['SECURITY_TRANSFORMS_HOME'])
+myenv=env
+myenv.Replace(SECURITY_TRANSFORMS_HOME=os.environ['SECURITY_TRANSFORMS_HOME'])
 
 
 libname="IRDB-core"
@@ -28,13 +29,11 @@ cpppath='''
 	$SECURITY_TRANSFORMS_HOME/beaengine/beaengineSources/Includes/
 	'''
 
-env['CCFLAGS'].append(Split("-Wall -W -Wextra -Wconversion "))
+myenv.Append(CCFLAGS=" -Wall -W -Wextra -Wconversion ")
 
-env=env.Clone(CPPPATH=Split(cpppath))
-lib=env.Library(libname, Split(files))
-
-install=env.Install("$SECURITY_TRANSFORMS_HOME/lib/", lib)
-env.Alias("install", "$SECURITY_TRANSFORMS_HOME/lib/")
+myenv=myenv.Clone(CPPPATH=Split(cpppath))
+lib=myenv.Library(libname, Split(files))
 
+install=myenv.Install("$SECURITY_TRANSFORMS_HOME/lib/", lib)
 Default(install)
 
diff --git a/libIRDB/src/syscall/SConscript b/libIRDB/src/syscall/SConscript
index 1ac2a0f296fd426de55dd86c7d4e7ae7f68762d6..556175ade5ad8e38bddee8a79f16823d65f4a837 100644
--- a/libIRDB/src/syscall/SConscript
+++ b/libIRDB/src/syscall/SConscript
@@ -1,7 +1,8 @@
 import os
 
 Import('env')
-env.Replace(SECURITY_TRANSFORMS_HOME=os.environ['SECURITY_TRANSFORMS_HOME'])
+myenv=env
+myenv.Replace(SECURITY_TRANSFORMS_HOME=os.environ['SECURITY_TRANSFORMS_HOME'])
 
 
 libname="IRDB-syscall"
@@ -15,13 +16,11 @@ cpppath='''
 	$SECURITY_TRANSFORMS_HOME/beaengine/beaengineSources/Includes/
 	'''
 
-env['CCFLAGS'].append(Split("-Wall -W -Wextra -Wconversion "))
+myenv.Append(CCFLAGS=" -Wall -W -Wextra -Wconversion ")
 
-env=env.Clone(CPPPATH=Split(cpppath))
-lib=env.Library(libname, Split(files))
-
-install=env.Install("$SECURITY_TRANSFORMS_HOME/lib/", lib)
-env.Alias("install", "$SECURITY_TRANSFORMS_HOME/lib/")
+myenv=myenv.Clone(CPPPATH=Split(cpppath))
+lib=myenv.Library(libname, Split(files))
 
+install=myenv.Install("$SECURITY_TRANSFORMS_HOME/lib/", lib)
 Default(install)
 
diff --git a/libIRDB/src/util/SConscript b/libIRDB/src/util/SConscript
index b376c9b5e1a71990af00f853531c3393b3c3eb23..b2b7580a70cffa00efa0a5993e3540fe978bb842 100644
--- a/libIRDB/src/util/SConscript
+++ b/libIRDB/src/util/SConscript
@@ -1,7 +1,8 @@
 import os
 
 Import('env')
-env.Replace(SECURITY_TRANSFORMS_HOME=os.environ['SECURITY_TRANSFORMS_HOME'])
+myenv=env
+myenv.Replace(SECURITY_TRANSFORMS_HOME=os.environ['SECURITY_TRANSFORMS_HOME'])
 
 
 libname="IRDB-util"
@@ -15,13 +16,11 @@ cpppath='''
 	$SECURITY_TRANSFORMS_HOME/beaengine/beaengineSources/Includes/
 	'''
 
-env['CCFLAGS'].append(Split("-Wall -W -Wextra -Wconversion "))
+myenv.Append(CCFLAGS=" -Wall -W -Wextra -Wconversion ")
 
-env=env.Clone(CPPPATH=Split(cpppath))
-lib=env.Library(libname, Split(files))
+myenv=myenv.Clone(CPPPATH=Split(cpppath))
+lib=myenv.Library(libname, Split(files))
 
 install=env.Install("$SECURITY_TRANSFORMS_HOME/lib/", lib)
-env.Alias("install", "$SECURITY_TRANSFORMS_HOME/lib/")
-
 Default(install)
 
diff --git a/libIRDB/test/SConscript b/libIRDB/test/SConscript
index 5b8515f17816f08818ed1ddd1fbc0952a6342a92..d96aa88cbd5b366d328c877f9206b92353000f4a 100644
--- a/libIRDB/test/SConscript
+++ b/libIRDB/test/SConscript
@@ -1,10 +1,9 @@
 import os
 
-print "In libIRDB/tests/SConscript"
-
 
 Import('env')
-env.Replace(SECURITY_TRANSFORMS_HOME=os.environ['SECURITY_TRANSFORMS_HOME'])
+myenv=env.Clone()
+myenv.Replace(SECURITY_TRANSFORMS_HOME=os.environ['SECURITY_TRANSFORMS_HOME'])
 
 cpppath=''' 
 	 $SECURITY_TRANSFORMS_HOME/include 
@@ -15,10 +14,9 @@ cpppath='''
 LIBPATH="$SECURITY_TRANSFORMS_HOME/lib"
 LIBS=Split("IRDB-core IRDB-cfg IRDB-util pqxx BeaEngine_s_d ")
 
-env=env.Clone(CPPPATH=Split(cpppath))
-pgm=env.Program("fill_in_indtargs.exe",  Split("read_ehframe.cpp fill_in_indtargs.cpp check_thunks.cpp"), LIBPATH=LIBPATH, LIBS=LIBS)
-install=env.Install("$SECURITY_TRANSFORMS_HOME/bin/", pgm)
-env.Alias("install", "$SECURITY_TRANSFORMS_HOME/bin/")
+myenv=myenv.Clone(CPPPATH=Split(cpppath))
+pgm=myenv.Program("fill_in_indtargs.exe",  Split("read_ehframe.cpp fill_in_indtargs.cpp check_thunks.cpp"), LIBPATH=LIBPATH, LIBS=LIBS)
+install=myenv.Install("$SECURITY_TRANSFORMS_HOME/bin/", pgm)
 Default(install)
 
 
@@ -28,9 +26,8 @@ pgms='''print_variant list_programs create_variant create_variantir read_variant
 	'''
 for i in Split(pgms):
 	print "Registering pgm: "+ i
-	pgm=env.Program(target=i+".exe",  source=Split(i+".cpp"), LIBPATH=LIBPATH, LIBS=LIBS)
-	install=env.Install("$SECURITY_TRANSFORMS_HOME/bin/", pgm)
-	env.Alias("install", "$SECURITY_TRANSFORMS_HOME/bin/")
+	pgm=myenv.Program(target=i+".exe",  source=Split(i+".cpp"), LIBPATH=LIBPATH, LIBS=LIBS)
+	install=myenv.Install("$SECURITY_TRANSFORMS_HOME/bin/", pgm)
 	Default(install)
 
 	
diff --git a/libMEDSannotation/SConscript b/libMEDSannotation/SConscript
index a1654c50cc8fb955fc32984735685d8686e3198f..41f99598e2fd608b6d79e98c4708dc46186c52f5 100644
--- a/libMEDSannotation/SConscript
+++ b/libMEDSannotation/SConscript
@@ -1,7 +1,8 @@
 import os
 
 Import('env')
-env.Replace(SECURITY_TRANSFORMS_HOME=os.environ['SECURITY_TRANSFORMS_HOME'])
+myenv=env.Clone()
+myenv.Replace(SECURITY_TRANSFORMS_HOME=os.environ['SECURITY_TRANSFORMS_HOME'])
 
 lib="MEDSannotation"
 
@@ -23,11 +24,9 @@ cpppath='''
 
 #CFLAGS="-fPIC  "
 
-env=env.Clone(CPPPATH=Split(cpppath))
-lib=env.Library(lib, Split(files))
-
-install=env.Install("$SECURITY_TRANSFORMS_HOME/lib/", lib)
-env.Alias("install", "$SECURITY_TRANSFORMS_HOME/lib/")
+myenv=myenv.Clone(CPPPATH=Split(cpppath))
+lib=myenv.Library(lib, Split(files))
 
+install=myenv.Install("$SECURITY_TRANSFORMS_HOME/lib/", lib)
 Default(install)
 
diff --git a/libtransform/src/SConscript b/libtransform/src/SConscript
index 176588cd19d9a51774e1e83edac587ef0ff717bf..4dc51e5d605dfa49ce957c385ed3edc52691d98e 100644
--- a/libtransform/src/SConscript
+++ b/libtransform/src/SConscript
@@ -1,10 +1,10 @@
 import os
 
-print "In libIRDB/tests/SConscript"
 
 
 Import('env')
-env.Replace(SECURITY_TRANSFORMS_HOME=os.environ['SECURITY_TRANSFORMS_HOME'])
+myenv=env.Clone()
+myenv.Replace(SECURITY_TRANSFORMS_HOME=os.environ['SECURITY_TRANSFORMS_HOME'])
 
 files="integertransform32.cpp  integertransform64.cpp  integertransform.cpp  leapattern.cpp  pointercheck64.cpp  Rewrite_Utility.cpp  transform.cpp"
 
@@ -20,9 +20,8 @@ cpppath='''
 LIBPATH="$SECURITY_TRANSFORMS_HOME/lib"
 LIBS=Split("IRDB-core IRDB-cfg IRDB-util pqxx BeaEngine_s_d ")
 
-env=env.Clone(CPPPATH=Split(cpppath))
-lib=env.Library("transform",  Split(files), LIBPATH=LIBPATH, LIBS=LIBS)
-install=env.Install("$SECURITY_TRANSFORMS_HOME/lib/", lib)
-env.Alias("install", "$SECURITY_TRANSFORMS_HOME/lib/")
+myenv=myenv.Clone(CPPPATH=Split(cpppath))
+lib=myenv.Library("transform",  Split(files), LIBPATH=LIBPATH, LIBS=LIBS)
+install=myenv.Install("$SECURITY_TRANSFORMS_HOME/lib/", lib)
 Default(install)
 
diff --git a/tools/c2e/SConscript b/tools/c2e/SConscript
index 42a9332c40e4570fb71daa22bfbebac697e5393e..5874f617f5aaa3dce7f0b1dcdeb2a9eadf1bc6f3 100644
--- a/tools/c2e/SConscript
+++ b/tools/c2e/SConscript
@@ -1,10 +1,10 @@
 import os
 
-print "In libIRDB/tests/SConscript"
 
 
 Import('env')
-env.Replace(SECURITY_TRANSFORMS_HOME=os.environ['SECURITY_TRANSFORMS_HOME'])
+myenv=env.Clone()
+myenv.Replace(SECURITY_TRANSFORMS_HOME=os.environ['SECURITY_TRANSFORMS_HOME'])
 
 cpppath=''' 
 	 $SECURITY_TRANSFORMS_HOME/include 
@@ -22,10 +22,9 @@ pgm="c2e.exe"
 LIBPATH="$SECURITY_TRANSFORMS_HOME/lib"
 LIBS=Split("IRDB-core IRDB-cfg IRDB-util pqxx BeaEngine_s_d rewrite")
 
-env=env.Clone(CPPPATH=Split(cpppath))
-pgm=env.Program(pgm,  files,  LIBPATH=LIBPATH, LIBS=LIBS)
-install=env.Install("$SECURITY_TRANSFORMS_HOME/bin/", pgm)
-env.Alias("install", "$SECURITY_TRANSFORMS_HOME/bin/")
+myenv=myenv.Clone(CPPPATH=Split(cpppath))
+pgm=myenv.Program(pgm,  files,  LIBPATH=LIBPATH, LIBS=LIBS)
+install=myenv.Install("$SECURITY_TRANSFORMS_HOME/bin/", pgm)
 Default(install)
 
 	
diff --git a/tools/cgc_hlx/SConscript b/tools/cgc_hlx/SConscript
index 67d3b12b6a3d99216a75789bf0e7ca865c3daada..1ff38de270ba910929dcbc0c8e6a03642dfaf3c6 100644
--- a/tools/cgc_hlx/SConscript
+++ b/tools/cgc_hlx/SConscript
@@ -1,10 +1,10 @@
 import os
 
-print "In libIRDB/tests/SConscript"
 
 
 Import('env')
-env.Replace(SECURITY_TRANSFORMS_HOME=os.environ['SECURITY_TRANSFORMS_HOME'])
+myenv=env.Clone()
+myenv.Replace(SECURITY_TRANSFORMS_HOME=os.environ['SECURITY_TRANSFORMS_HOME'])
 
 cpppath=''' 
 	 $SECURITY_TRANSFORMS_HOME/include 
@@ -20,10 +20,9 @@ pgm="cgc_hlx.exe"
 
 LIBPATH="$SECURITY_TRANSFORMS_HOME/lib"
 LIBS=Split("IRDB-core IRDB-cfg IRDB-util pqxx BeaEngine_s_d rewrite MEDSannotation") 
-env=env.Clone(CPPPATH=Split(cpppath))
-pgm=env.Program(pgm,  files,  LIBPATH=LIBPATH, LIBS=LIBS)
-install=env.Install("$SECURITY_TRANSFORMS_HOME/bin/", pgm)
-env.Alias("install", "$SECURITY_TRANSFORMS_HOME/bin/")
+myenv=myenv.Clone(CPPPATH=Split(cpppath))
+pgm=myenv.Program(pgm,  files,  LIBPATH=LIBPATH, LIBS=LIBS)
+install=myenv.Install("$SECURITY_TRANSFORMS_HOME/bin/", pgm)
 Default(install)
 
 	
diff --git a/tools/cgc_rigrandom/SConscript b/tools/cgc_rigrandom/SConscript
index 955ef32a6592db0c9c29da5cc771f884cb4c7a86..4831a135e07e29169fcfecb02e45fcb852240b31 100644
--- a/tools/cgc_rigrandom/SConscript
+++ b/tools/cgc_rigrandom/SConscript
@@ -1,10 +1,10 @@
 import os
 
-print "In libIRDB/tests/SConscript"
 
 
 Import('env')
-env.Replace(SECURITY_TRANSFORMS_HOME=os.environ['SECURITY_TRANSFORMS_HOME'])
+myenv=env.Clone()
+myenv.Replace(SECURITY_TRANSFORMS_HOME=os.environ['SECURITY_TRANSFORMS_HOME'])
 
 cpppath=''' 
 	 $SECURITY_TRANSFORMS_HOME/include 
@@ -22,10 +22,9 @@ pgm="rigrandom.exe"
 LIBPATH="$SECURITY_TRANSFORMS_HOME/lib"
 LIBS=Split("IRDB-core IRDB-cfg IRDB-util pqxx BeaEngine_s_d rewrite")
 
-env=env.Clone(CPPPATH=Split(cpppath))
-pgm=env.Program(pgm,  files,  LIBPATH=LIBPATH, LIBS=LIBS)
-install=env.Install("$SECURITY_TRANSFORMS_HOME/bin/", pgm)
-env.Alias("install", "$SECURITY_TRANSFORMS_HOME/bin/")
+myenv=myenv.Clone(CPPPATH=Split(cpppath))
+pgm=myenv.Program(pgm,  files,  LIBPATH=LIBPATH, LIBS=LIBS)
+install=myenv.Install("$SECURITY_TRANSFORMS_HOME/bin/", pgm)
 Default(install)
 
 	
diff --git a/tools/cgclibc/SConscript b/tools/cgclibc/SConscript
index 86d6a1b7c40db19520eb04ed91a8595887a50b7f..703eb0c95244f58c59cdc340bd2337fb616cd7e0 100644
--- a/tools/cgclibc/SConscript
+++ b/tools/cgclibc/SConscript
@@ -1,10 +1,10 @@
 import os
 
-print "In libIRDB/tests/SConscript"
 
 
 Import('env')
-env.Replace(SECURITY_TRANSFORMS_HOME=os.environ['SECURITY_TRANSFORMS_HOME'])
+myenv=env.Clone()
+myenv.Replace(SECURITY_TRANSFORMS_HOME=os.environ['SECURITY_TRANSFORMS_HOME'])
 
 
 cpppath=''' 
@@ -15,10 +15,10 @@ cpppath='''
 	 $SECURITY_TRANSFORMS_HOME/tools/transforms 
 	'''
 
-env['CCFLAGS'].append("-DCGC")
+myenv.Append(CCFLAGS="-DCGC")
 
-env=env.Clone(CPPPATH=Split(cpppath))
-cgclibc=env.Object("cgclibc.cpp")
+myenv=myenv.Clone(CPPPATH=Split(cpppath))
+cgclibc=myenv.Object("cgclibc.cpp")
 files1=Split("cgclibc_driver.cpp")+cgclibc
 files2=Split("display_functions.cpp")+cgclibc 
 files3=Split("infer_syscall_wrappers.cpp")+cgclibc 
@@ -28,16 +28,16 @@ files3=Split("infer_syscall_wrappers.cpp")+cgclibc
 LIBPATH="$SECURITY_TRANSFORMS_HOME/lib"
 LIBS=Split("IRDB-core IRDB-cfg IRDB-syscall IRDB-util pqxx BeaEngine_s_d rewrite")
 
-pgm=env.Program("cgclibc.exe",  files1,  LIBPATH=LIBPATH, LIBS=LIBS)
-install=env.Install("$SECURITY_TRANSFORMS_HOME/bin/", pgm)
+pgm=myenv.Program("cgclibc.exe",  files1,  LIBPATH=LIBPATH, LIBS=LIBS)
+install=myenv.Install("$SECURITY_TRANSFORMS_HOME/bin/", pgm)
 Default(install)
 
-pgm=env.Program("display_functions.exe",  files2,  LIBPATH=LIBPATH, LIBS=LIBS)
-install=env.Install("$SECURITY_TRANSFORMS_HOME/bin/", pgm)
+pgm=myenv.Program("display_functions.exe",  files2,  LIBPATH=LIBPATH, LIBS=LIBS)
+install=myenv.Install("$SECURITY_TRANSFORMS_HOME/bin/", pgm)
 Default(install)
 
-pgm=env.Program("infer_syscall_wrappers.exe",  files3,  LIBPATH=LIBPATH, LIBS=LIBS)
-install=env.Install("$SECURITY_TRANSFORMS_HOME/bin/", pgm)
+pgm=myenv.Program("infer_syscall_wrappers.exe",  files3,  LIBPATH=LIBPATH, LIBS=LIBS)
+install=myenv.Install("$SECURITY_TRANSFORMS_HOME/bin/", pgm)
 Default(install)
 
 
diff --git a/tools/cinderella/SConscript b/tools/cinderella/SConscript
index 5bb4180cba416cc44dee8b8f94da64e4b4d45e97..a3f25242b49174576020b8baeee8d2ca50483154 100644
--- a/tools/cinderella/SConscript
+++ b/tools/cinderella/SConscript
@@ -1,10 +1,10 @@
 import os
 
-print "In libIRDB/tests/SConscript"
 
 
 Import('env')
-env.Replace(SECURITY_TRANSFORMS_HOME=os.environ['SECURITY_TRANSFORMS_HOME'])
+myenv=env.Clone()
+myenv.Replace(SECURITY_TRANSFORMS_HOME=os.environ['SECURITY_TRANSFORMS_HOME'])
 
 cpppath=''' 
 	 $SECURITY_TRANSFORMS_HOME/include 
@@ -22,10 +22,9 @@ pgm="cinderella_prep.exe"
 
 LIBPATH="$SECURITY_TRANSFORMS_HOME/lib"
 LIBS=Split("IRDB-core IRDB-cfg IRDB-util pqxx BeaEngine_s_d rewrite MEDSannotation") 
-env=env.Clone(CPPPATH=Split(cpppath))
-pgm=env.Program(pgm,  files,  LIBPATH=LIBPATH, LIBS=LIBS)
-install=env.Install("$SECURITY_TRANSFORMS_HOME/bin/", pgm)
-env.Alias("install", "$SECURITY_TRANSFORMS_HOME/bin/")
+myenv=myenv.Clone(CPPPATH=Split(cpppath))
+pgm=myenv.Program(pgm,  files,  LIBPATH=LIBPATH, LIBS=LIBS)
+install=myenv.Install("$SECURITY_TRANSFORMS_HOME/bin/", pgm)
 Default(install)
 
 	
diff --git a/tools/cover/SConscript b/tools/cover/SConscript
index f5f98f875ab33faa18b8359d31906fffb29860e5..f5ebceadaae26e189928dc41adc09a060e5434ee 100644
--- a/tools/cover/SConscript
+++ b/tools/cover/SConscript
@@ -1,10 +1,10 @@
 import os
 
-print "In libIRDB/tests/SConscript"
 
 
 Import('env')
-env.Replace(SECURITY_TRANSFORMS_HOME=os.environ['SECURITY_TRANSFORMS_HOME'])
+myenv=env.Clone()
+myenv.Replace(SECURITY_TRANSFORMS_HOME=os.environ['SECURITY_TRANSFORMS_HOME'])
 
 cpppath=''' 
 	 $SECURITY_TRANSFORMS_HOME/include 
@@ -20,10 +20,9 @@ pgm="cover"
 LIBPATH="$SECURITY_TRANSFORMS_HOME/lib"
 LIBS=Split("IRDB-core IRDB-cfg IRDB-util pqxx BeaEngine_s_d rewrite")
 
-env=env.Clone(CPPPATH=Split(cpppath))
-pgm=env.Program(pgm,  files,  LIBPATH=LIBPATH, LIBS=LIBS)
-install=env.Install("$SECURITY_TRANSFORMS_HOME/bin/", pgm)
-env.Alias("install", "$SECURITY_TRANSFORMS_HOME/bin/")
+myenv=myenv.Clone(CPPPATH=Split(cpppath))
+pgm=myenv.Program(pgm,  files,  LIBPATH=LIBPATH, LIBS=LIBS)
+install=myenv.Install("$SECURITY_TRANSFORMS_HOME/bin/", pgm)
 Default(install)
 
 	
diff --git a/tools/fix_rets/SConscript b/tools/fix_rets/SConscript
index f3b13ab2245bc7d931422dcb76181f639bbe51ef..f3937a340759462b11520e68a3be0798c4761034 100644
--- a/tools/fix_rets/SConscript
+++ b/tools/fix_rets/SConscript
@@ -1,10 +1,10 @@
 import os
 
-print "In libIRDB/tests/SConscript"
 
 
 Import('env')
-env.Replace(SECURITY_TRANSFORMS_HOME=os.environ['SECURITY_TRANSFORMS_HOME'])
+myenv=env.Clone()
+myenv.Replace(SECURITY_TRANSFORMS_HOME=os.environ['SECURITY_TRANSFORMS_HOME'])
 
 cpppath=''' 
 	 $SECURITY_TRANSFORMS_HOME/include 
@@ -21,10 +21,9 @@ pgm="fix_rets.exe"
 
 LIBPATH="$SECURITY_TRANSFORMS_HOME/lib"
 LIBS=Split("IRDB-core IRDB-cfg IRDB-util pqxx BeaEngine_s_d transform rewrite MEDSannotation") 
-env=env.Clone(CPPPATH=Split(cpppath))
-pgm=env.Program(pgm,  files,  LIBPATH=LIBPATH, LIBS=LIBS)
-install=env.Install("$SECURITY_TRANSFORMS_HOME/bin/", pgm)
-env.Alias("install", "$SECURITY_TRANSFORMS_HOME/bin/")
+myenv=myenv.Clone(CPPPATH=Split(cpppath))
+pgm=myenv.Program(pgm,  files,  LIBPATH=LIBPATH, LIBS=LIBS)
+install=myenv.Install("$SECURITY_TRANSFORMS_HOME/bin/", pgm)
 Default(install)
 
 	
diff --git a/tools/fptr_shadow/SConscript b/tools/fptr_shadow/SConscript
index 03c3fa0c89f260b1016d7d069840bc3bc3c2269e..312b9bd32f0c430159cc80441fd171c3831a0eff 100644
--- a/tools/fptr_shadow/SConscript
+++ b/tools/fptr_shadow/SConscript
@@ -1,10 +1,10 @@
 import os
 
-print "In libIRDB/tests/SConscript"
 
 
 Import('env')
-env.Replace(SECURITY_TRANSFORMS_HOME=os.environ['SECURITY_TRANSFORMS_HOME'])
+myenv=env.Clone()
+myenv.Replace(SECURITY_TRANSFORMS_HOME=os.environ['SECURITY_TRANSFORMS_HOME'])
 
 cpppath=''' 
 	 $SECURITY_TRANSFORMS_HOME/include 
@@ -20,10 +20,9 @@ pgm="fptr_shadow64.exe"
 
 LIBPATH="$SECURITY_TRANSFORMS_HOME/lib"
 LIBS=Split("IRDB-core IRDB-cfg IRDB-util pqxx BeaEngine_s_d rewrite MEDSannotation") 
-env=env.Clone(CPPPATH=Split(cpppath))
-pgm=env.Program(pgm,  files,  LIBPATH=LIBPATH, LIBS=LIBS)
-install=env.Install("$SECURITY_TRANSFORMS_HOME/bin/", pgm)
-env.Alias("install", "$SECURITY_TRANSFORMS_HOME/bin/")
+myenv=myenv.Clone(CPPPATH=Split(cpppath))
+pgm=myenv.Program(pgm,  files,  LIBPATH=LIBPATH, LIBS=LIBS)
+install=myenv.Install("$SECURITY_TRANSFORMS_HOME/bin/", pgm)
 Default(install)
 
 	
diff --git a/tools/inferfn/SConscript b/tools/inferfn/SConscript
index 8a716d0be93b6fcd5b3a226d23f13a7d176ef194..fc81fd488065a09a4bac04a5d8cdedbb60fbd838 100644
--- a/tools/inferfn/SConscript
+++ b/tools/inferfn/SConscript
@@ -1,10 +1,10 @@
 import os
 
-print "In libIRDB/tests/SConscript"
 
 
 Import('env')
-env.Replace(SECURITY_TRANSFORMS_HOME=os.environ['SECURITY_TRANSFORMS_HOME'])
+myenv=env.Clone()
+myenv.Replace(SECURITY_TRANSFORMS_HOME=os.environ['SECURITY_TRANSFORMS_HOME'])
 
 cpppath=''' 
 	 $SECURITY_TRANSFORMS_HOME/include 
@@ -20,10 +20,9 @@ pgm="inferfn.exe"
 
 LIBPATH="$SECURITY_TRANSFORMS_HOME/lib"
 LIBS=Split("IRDB-core IRDB-cfg IRDB-util pqxx BeaEngine_s_d transform rewrite MEDSannotation") 
-env=env.Clone(CPPPATH=Split(cpppath))
-pgm=env.Program(pgm,  files,  LIBPATH=LIBPATH, LIBS=LIBS)
-install=env.Install("$SECURITY_TRANSFORMS_HOME/bin/", pgm)
-env.Alias("install", "$SECURITY_TRANSFORMS_HOME/bin/")
+myenv=myenv.Clone(CPPPATH=Split(cpppath))
+pgm=myenv.Program(pgm,  files,  LIBPATH=LIBPATH, LIBS=LIBS)
+install=myenv.Install("$SECURITY_TRANSFORMS_HOME/bin/", pgm)
 Default(install)
 
 	
diff --git a/tools/meds2pdb/SConscript b/tools/meds2pdb/SConscript
index eaf3bc29c49e6d355628c500dee4dcf9feff35e5..473e9884df6d9d3e707ac6d4870ff8d2dd5e93fe 100644
--- a/tools/meds2pdb/SConscript
+++ b/tools/meds2pdb/SConscript
@@ -1,10 +1,10 @@
 import os
 
-print "In libIRDB/tests/SConscript"
 
 
 Import('env')
-env.Replace(SECURITY_TRANSFORMS_HOME=os.environ['SECURITY_TRANSFORMS_HOME'])
+myenv=env.Clone()
+myenv.Replace(SECURITY_TRANSFORMS_HOME=os.environ['SECURITY_TRANSFORMS_HOME'])
 
 cpppath=''' 
 	 $SECURITY_TRANSFORMS_HOME/include 
@@ -21,10 +21,9 @@ pgm="meds2pdb"
 
 LIBPATH="$SECURITY_TRANSFORMS_HOME/lib"
 LIBS=Split("IRDB-core IRDB-cfg IRDB-util pqxx xform BeaEngine_s_d rewrite MEDSannotation ") 
-env=env.Clone(CPPPATH=Split(cpppath))
-pgm=env.Program(pgm,  files,  LIBPATH=LIBPATH, LIBS=LIBS)
-install=env.Install("$SECURITY_TRANSFORMS_HOME/bin/", pgm)
-env.Alias("install", "$SECURITY_TRANSFORMS_HOME/bin/")
+myenv=myenv.Clone(CPPPATH=Split(cpppath))
+pgm=myenv.Program(pgm,  files,  LIBPATH=LIBPATH, LIBS=LIBS)
+install=myenv.Install("$SECURITY_TRANSFORMS_HOME/bin/", pgm)
 Default(install)
 
 	
diff --git a/tools/memcover/SConscript b/tools/memcover/SConscript
index 601a75da6852f467c265d29749fcb0073352a1af..7ca7cbdd43ac11b8ff44e4999e313fe1fe04b641 100644
--- a/tools/memcover/SConscript
+++ b/tools/memcover/SConscript
@@ -1,10 +1,10 @@
 import os
 
-print "In libIRDB/tests/SConscript"
 
 
 Import('env')
-env.Replace(SECURITY_TRANSFORMS_HOME=os.environ['SECURITY_TRANSFORMS_HOME'])
+myenv=env.Clone()
+myenv.Replace(SECURITY_TRANSFORMS_HOME=os.environ['SECURITY_TRANSFORMS_HOME'])
 
 cpppath=''' 
 	 $SECURITY_TRANSFORMS_HOME/include 
@@ -21,10 +21,10 @@ pgm="memcover.exe"
 
 LIBPATH="$SECURITY_TRANSFORMS_HOME/lib"
 LIBS=Split("IRDB-core IRDB-cfg IRDB-util pqxx BeaEngine_s_d transform rewrite MEDSannotation") 
-env=env.Clone(CPPPATH=Split(cpppath))
-pgm=env.Program(pgm,  files,  LIBPATH=LIBPATH, LIBS=LIBS)
-install=env.Install("$SECURITY_TRANSFORMS_HOME/bin/", pgm)
-env.Alias("install", "$SECURITY_TRANSFORMS_HOME/bin/")
+myenv=myenv.Clone(CPPPATH=Split(cpppath))
+pgm=myenv.Program(pgm,  files,  LIBPATH=LIBPATH, LIBS=LIBS)
+install=myenv.Install("$SECURITY_TRANSFORMS_HOME/bin/", pgm)
+myenv.Alias("install", "$SECURITY_TRANSFORMS_HOME/bin/")
 Default(install)
 
 	
diff --git a/tools/prince/SConscript b/tools/prince/SConscript
index f3a38c155c6872128d66d911e814a6f91039d5d9..5650841ee5b3ef54ca14e87047ce0e92fc3ea74a 100644
--- a/tools/prince/SConscript
+++ b/tools/prince/SConscript
@@ -1,11 +1,10 @@
 import os
 
-print "In libIRDB/tests/SConscript"
-
 
 Import('env')
-env.Replace(SECURITY_TRANSFORMS_HOME=os.environ['SECURITY_TRANSFORMS_HOME'])
-env.Replace(ZIPR_CALLBACKS=os.environ['ZIPR_CALLBACKS'])
+myenv=env.Clone()
+myenv.Replace(SECURITY_TRANSFORMS_HOME=os.environ['SECURITY_TRANSFORMS_HOME'])
+myenv.Replace(ZIPR_CALLBACKS=os.environ['ZIPR_CALLBACKS'])
 
 cpppath=''' 
 	 $SECURITY_TRANSFORMS_HOME/include 
@@ -22,10 +21,9 @@ pgm="prince_driver.exe"
 
 LIBPATH="$SECURITY_TRANSFORMS_HOME/lib"
 LIBS=Split("IRDB-core IRDB-cfg IRDB-util pqxx BeaEngine_s_d rewrite MEDSannotation") 
-env=env.Clone(CPPPATH=Split(cpppath))
-pgm=env.Program(pgm,  files,  LIBPATH=LIBPATH, LIBS=LIBS)
-install=env.Install("$SECURITY_TRANSFORMS_HOME/bin/", pgm)
-env.Alias("install", "$SECURITY_TRANSFORMS_HOME/bin/")
+myenv=myenv.Clone(CPPPATH=Split(cpppath))
+pgm=myenv.Program(pgm,  files,  LIBPATH=LIBPATH, LIBS=LIBS)
+install=myenv.Install("$SECURITY_TRANSFORMS_HOME/bin/", pgm)
 Default(install)
 
 	
diff --git a/tools/ret_shadow_stack/SConscript b/tools/ret_shadow_stack/SConscript
index e31a59d9b8377b716aa48d26a38dce0551ecb836..2f6353b21f850ebbeb2d7d18e1bdf75b200f016a 100644
--- a/tools/ret_shadow_stack/SConscript
+++ b/tools/ret_shadow_stack/SConscript
@@ -1,10 +1,10 @@
 import os
 
-print "In libIRDB/tests/SConscript"
 
 
 Import('env')
-env.Replace(SECURITY_TRANSFORMS_HOME=os.environ['SECURITY_TRANSFORMS_HOME'])
+myenv=env.Clone()
+myenv.Replace(SECURITY_TRANSFORMS_HOME=os.environ['SECURITY_TRANSFORMS_HOME'])
 
 cpppath=''' 
 	 $SECURITY_TRANSFORMS_HOME/include 
@@ -20,10 +20,9 @@ pgm="ret_shadow_stack.exe"
 
 LIBPATH="$SECURITY_TRANSFORMS_HOME/lib"
 LIBS=Split("IRDB-core IRDB-cfg IRDB-util pqxx BeaEngine_s_d transform rewrite MEDSannotation") 
-env=env.Clone(CPPPATH=Split(cpppath))
-pgm=env.Program(pgm,  files,  LIBPATH=LIBPATH, LIBS=LIBS)
-install=env.Install("$SECURITY_TRANSFORMS_HOME/bin/", pgm)
-env.Alias("install", "$SECURITY_TRANSFORMS_HOME/bin/")
+myenv=myenv.Clone(CPPPATH=Split(cpppath))
+pgm=myenv.Program(pgm,  files,  LIBPATH=LIBPATH, LIBS=LIBS)
+install=myenv.Install("$SECURITY_TRANSFORMS_HOME/bin/", pgm)
 Default(install)
 
 	
diff --git a/tools/safefr/SConscript b/tools/safefr/SConscript
index 63fd17a23178c4076f9fc644fee922db7bd147eb..c05b4d951d6f96b9fee389fbf9d5edc9075de544 100644
--- a/tools/safefr/SConscript
+++ b/tools/safefr/SConscript
@@ -1,10 +1,10 @@
 import os
 
-print "In libIRDB/tests/SConscript"
 
 
 Import('env')
-env.Replace(SECURITY_TRANSFORMS_HOME=os.environ['SECURITY_TRANSFORMS_HOME'])
+myenv=env.Clone()
+myenv.Replace(SECURITY_TRANSFORMS_HOME=os.environ['SECURITY_TRANSFORMS_HOME'])
 
 cpppath=''' 
 	 $SECURITY_TRANSFORMS_HOME/include 
@@ -21,10 +21,9 @@ pgm="fill_in_safefr.exe"
 
 LIBPATH="$SECURITY_TRANSFORMS_HOME/lib"
 LIBS=Split("IRDB-core IRDB-cfg IRDB-util pqxx BeaEngine_s_d rewrite MEDSannotation") 
-env=env.Clone(CPPPATH=Split(cpppath))
-pgm=env.Program(pgm,  files,  LIBPATH=LIBPATH, LIBS=LIBS)
-install=env.Install("$SECURITY_TRANSFORMS_HOME/bin/", pgm)
-env.Alias("install", "$SECURITY_TRANSFORMS_HOME/bin/")
+myenv=myenv.Clone(CPPPATH=Split(cpppath))
+pgm=myenv.Program(pgm,  files,  LIBPATH=LIBPATH, LIBS=LIBS)
+install=myenv.Install("$SECURITY_TRANSFORMS_HOME/bin/", pgm)
 Default(install)
 
 	
diff --git a/tools/selective_cfi/SConscript b/tools/selective_cfi/SConscript
index 52382e42e049a4dd8928203398c19dd9f6cdf6b4..187e520df4330970b79dfb6c9c1329d56ff9a480 100644
--- a/tools/selective_cfi/SConscript
+++ b/tools/selective_cfi/SConscript
@@ -1,10 +1,10 @@
 import os
 
-print "In libIRDB/tests/SConscript"
 
 
 Import('env')
-env.Replace(SECURITY_TRANSFORMS_HOME=os.environ['SECURITY_TRANSFORMS_HOME'])
+myenv=env.Clone()
+myenv.Replace(SECURITY_TRANSFORMS_HOME=os.environ['SECURITY_TRANSFORMS_HOME'])
 
 cpppath=''' 
 	 $SECURITY_TRANSFORMS_HOME/include 
@@ -21,10 +21,9 @@ pgm="selective_cfi.exe"
 
 LIBPATH="$SECURITY_TRANSFORMS_HOME/lib"
 LIBS=Split("IRDB-core IRDB-cfg IRDB-util pqxx BeaEngine_s_d transform rewrite MEDSannotation") 
-env=env.Clone(CPPPATH=Split(cpppath))
-pgm=env.Program(pgm,  files,  LIBPATH=LIBPATH, LIBS=LIBS)
-install=env.Install("$SECURITY_TRANSFORMS_HOME/bin/", pgm)
-env.Alias("install", "$SECURITY_TRANSFORMS_HOME/bin/")
+myenv=myenv.Clone(CPPPATH=Split(cpppath))
+pgm=myenv.Program(pgm,  files,  LIBPATH=LIBPATH, LIBS=LIBS)
+install=myenv.Install("$SECURITY_TRANSFORMS_HOME/bin/", pgm)
 Default(install)
 
 	
diff --git a/tools/simple_cdi/SConscript b/tools/simple_cdi/SConscript
index 16a324bef6249472c6e4b88a29efa0150bfb43f7..65b849442d725a05dd056a9d84ee06cab633f83e 100644
--- a/tools/simple_cdi/SConscript
+++ b/tools/simple_cdi/SConscript
@@ -1,10 +1,10 @@
 import os
 
-print "In libIRDB/tests/SConscript"
 
 
 Import('env')
-env.Replace(SECURITY_TRANSFORMS_HOME=os.environ['SECURITY_TRANSFORMS_HOME'])
+myenv=env.Clone()
+myenv.Replace(SECURITY_TRANSFORMS_HOME=os.environ['SECURITY_TRANSFORMS_HOME'])
 
 cpppath=''' 
 	 $SECURITY_TRANSFORMS_HOME/include 
@@ -20,10 +20,9 @@ pgm="simple_cdi.exe"
 
 LIBPATH="$SECURITY_TRANSFORMS_HOME/lib"
 LIBS=Split("IRDB-core IRDB-cfg IRDB-util pqxx BeaEngine_s_d rewrite MEDSannotation") 
-env=env.Clone(CPPPATH=Split(cpppath))
-pgm=env.Program(pgm,  files,  LIBPATH=LIBPATH, LIBS=LIBS)
-install=env.Install("$SECURITY_TRANSFORMS_HOME/bin/", pgm)
-env.Alias("install", "$SECURITY_TRANSFORMS_HOME/bin/")
+myenv=myenv.Clone(CPPPATH=Split(cpppath))
+pgm=myenv.Program(pgm,  files,  LIBPATH=LIBPATH, LIBS=LIBS)
+install=myenv.Install("$SECURITY_TRANSFORMS_HOME/bin/", pgm)
 Default(install)
 
 	
diff --git a/tools/spasm/SConscript b/tools/spasm/SConscript
index e30253e1f4c12a6cc21511fce6d7d53f74736c69..fd8c7ee246cc28c66d1506b3ef526e86b6ae58a6 100644
--- a/tools/spasm/SConscript
+++ b/tools/spasm/SConscript
@@ -1,10 +1,10 @@
 import os
 
-print "In libIRDB/tests/SConscript"
 
 
 Import('env')
-env.Replace(SECURITY_TRANSFORMS_HOME=os.environ['SECURITY_TRANSFORMS_HOME'])
+myenv=env.Clone()
+myenv.Replace(SECURITY_TRANSFORMS_HOME=os.environ['SECURITY_TRANSFORMS_HOME'])
 
 cpppath=''' 
 	 $SECURITY_TRANSFORMS_HOME/include 
@@ -21,10 +21,9 @@ pgm="spasm"
 
 LIBPATH="$SECURITY_TRANSFORMS_HOME/lib"
 LIBS=Split("IRDB-core IRDB-cfg IRDB-util pqxx BeaEngine_s_d transform rewrite MEDSannotation") 
-env=env.Clone(CPPPATH=Split(cpppath))
-pgm=env.Program(pgm,  files,  LIBPATH=LIBPATH, LIBS=LIBS)
-install=env.Install("$SECURITY_TRANSFORMS_HOME/bin/", pgm)
-env.Alias("install", "$SECURITY_TRANSFORMS_HOME/bin/")
+myenv=myenv.Clone(CPPPATH=Split(cpppath))
+pgm=myenv.Program(pgm,  files,  LIBPATH=LIBPATH, LIBS=LIBS)
+install=myenv.Install("$SECURITY_TRANSFORMS_HOME/bin/", pgm)
 Default(install)
 
 	
diff --git a/tools/transforms/SConscript b/tools/transforms/SConscript
index c765aab1bf577beb7b8427dbca2d3492ac3e73f6..9c833fd593e1d484b5200fdf0fff7dc370ec7f0f 100644
--- a/tools/transforms/SConscript
+++ b/tools/transforms/SConscript
@@ -1,7 +1,8 @@
 import os
 
 Import('env')
-env.Replace(SECURITY_TRANSFORMS_HOME=os.environ['SECURITY_TRANSFORMS_HOME'])
+myenv=env.Clone()
+myenv.Replace(SECURITY_TRANSFORMS_HOME=os.environ['SECURITY_TRANSFORMS_HOME'])
 
 
 libname="IRDB-util"
@@ -22,26 +23,27 @@ LIBPATH="$SECURITY_TRANSFORMS_HOME/lib"
 
 integer_files="transformutils.cpp integertransformdriver.cpp"
 
-env['CFLAGS'].append("-Wall")
+myenv.Append(CFLAGS="-Wall")
+myenv.Append(CCFLAGS="-Wall")
 
 all_files="PNTransformDriver.cpp PNStackLayout.cpp PNRange.cpp Range.cpp OffsetInference.cpp DirectOffsetInference.cpp ScaledOffsetInference.cpp P1Inference.cpp PNRegularExpressions.cpp PNMain.cpp StackLayout.cpp General_Utility.cpp AnnotationBoundaryGenerator.cpp PrecedenceBoundaryInference.cpp PNIrdbManager.cpp"
 
 
-env=env.Clone(CPPPATH=Split(cpppath))
-ru_obj=env.Object("Rewrite_Utility.cpp");
-ru_lib=env.Library("rewrite", ru_obj);
-install=env.Install("$SECURITY_TRANSFORMS_HOME/lib/", ru_lib)
+myenv=myenv.Clone(CPPPATH=Split(cpppath))
+ru_obj=myenv.Object("Rewrite_Utility.cpp");
+ru_lib=myenv.Library("rewrite", ru_obj);
+install=myenv.Install("$SECURITY_TRANSFORMS_HOME/lib/", ru_lib)
 Default(install)
 
-p1=env.Program("p1transform.exe", Split(all_files), LIBS=Split(LIBS)+ru_lib, LIBPATH=Split(LIBPATH))
-install=env.Install("$SECURITY_TRANSFORMS_HOME/bin/", p1)
-install=env.InstallAs("$SECURITY_TRANSFORMS_HOME/bin/pntransform.exe", p1)
+p1=myenv.Program("p1transform.exe", Split(all_files), LIBS=Split(LIBS)+ru_lib, LIBPATH=Split(LIBPATH))
+install=myenv.Install("$SECURITY_TRANSFORMS_HOME/bin/", p1)
+install=myenv.InstallAs("$SECURITY_TRANSFORMS_HOME/bin/pntransform.exe", p1)
 Default(install)
-install=env.InstallAs("pntransform.exe", p1)
+install=myenv.InstallAs("pntransform.exe", p1)
 Default(install)
 
-intdr=env.Program("integertransformdriver.exe", Split(integer_files), LIBS=Split(LIBS)+ru_lib, LIBPATH=Split(LIBPATH))
-install=env.Install("$SECURITY_TRANSFORMS_HOME/bin/", intdr)
+intdr=myenv.Program("integertransformdriver.exe", Split(integer_files), LIBS=Split(LIBS)+ru_lib, LIBPATH=Split(LIBPATH))
+install=myenv.Install("$SECURITY_TRANSFORMS_HOME/bin/", intdr)
 Default(install)
 
 
diff --git a/tools/watch_syscall/SConscript b/tools/watch_syscall/SConscript
index 268cddf012cec7cebd7f4477410900a4dff14cb5..24425889c5e281410bc6f5df956497ada90d9078 100644
--- a/tools/watch_syscall/SConscript
+++ b/tools/watch_syscall/SConscript
@@ -1,10 +1,10 @@
 import os
 
-print "In libIRDB/tests/SConscript"
 
 
 Import('env')
-env.Replace(SECURITY_TRANSFORMS_HOME=os.environ['SECURITY_TRANSFORMS_HOME'])
+myenv=env.Clone()
+myenv.Replace(SECURITY_TRANSFORMS_HOME=os.environ['SECURITY_TRANSFORMS_HOME'])
 
 cpppath=''' 
 	 $SECURITY_TRANSFORMS_HOME/include 
@@ -14,7 +14,7 @@ cpppath='''
 	 $SECURITY_TRANSFORMS_HOME/tools/transforms 
 	'''
 
-env['CFLAGS'].append("-DCGC")
+myenv.Append(CCFLAGS=" -DCGC")
 
 files=Glob("*.cpp")
 
@@ -22,10 +22,10 @@ pgm="watch_syscall.exe"
 
 LIBPATH="$SECURITY_TRANSFORMS_HOME/lib"
 LIBS=Split("IRDB-core IRDB-cfg IRDB-syscall IRDB-util pqxx BeaEngine_s_d transform rewrite MEDSannotation") 
-env=env.Clone(CPPPATH=Split(cpppath))
-pgm=env.Program(pgm,  files,  LIBPATH=LIBPATH, LIBS=LIBS)
-install=env.Install("$SECURITY_TRANSFORMS_HOME/bin/", pgm)
-env.Alias("install", "$SECURITY_TRANSFORMS_HOME/bin/")
+myenv=myenv.Clone(CPPPATH=Split(cpppath))
+pgm=myenv.Program(pgm,  files,  LIBPATH=LIBPATH, LIBS=LIBS)
+install=myenv.Install("$SECURITY_TRANSFORMS_HOME/bin/", pgm)
+myenv.Alias("install", "$SECURITY_TRANSFORMS_HOME/bin/")
 Default(install)
 
 
diff --git a/xform/SConscript b/xform/SConscript
index 742697b230e1d1a893f1c13d954cc8102d3e21f8..f6ac0cab6866294cb689c88c190e98d4af32b0a4 100644
--- a/xform/SConscript
+++ b/xform/SConscript
@@ -1,7 +1,8 @@
 import os
 
 Import('env')
-env.Replace(SECURITY_TRANSFORMS_HOME=os.environ['SECURITY_TRANSFORMS_HOME'])
+myenv=env.Clone()
+myenv.Replace(SECURITY_TRANSFORMS_HOME=os.environ['SECURITY_TRANSFORMS_HOME'])
 
 lib="xform"
 
@@ -26,11 +27,10 @@ cpppath='''
 
 CFLAGS="-fPIC  -DUBUNTU"
 
-env=env.Clone(CC="g++", CPPPATH=Split(cpppath), CFLAGS=CFLAGS)
-lib=env.Library(lib, Split(files))
+myenv=myenv.Clone(CC="g++", CPPPATH=Split(cpppath), CFLAGS=CFLAGS)
+lib=myenv.Library(lib, Split(files))
 
-install=env.Install("$SECURITY_TRANSFORMS_HOME/lib/", lib)
-env.Alias("install", "$SECURITY_TRANSFORMS_HOME/lib/")
+install=myenv.Install("$SECURITY_TRANSFORMS_HOME/lib/", lib)
 
 Default(install)