[cig-commits] commit: Updating the SCons build scripts to use

Mercurial hg at geodynamics.org
Mon Nov 24 11:30:45 PST 2008


changeset:   66:b4e4ea76486e
user:        LukeHodkinson
date:        Mon Mar 03 05:07:19 2008 +0000
files:       SConscript SConstruct
description:
Updating the SCons build scripts to use
a better configuration method.


diff -r 2c74b4c94da0 -r b4e4ea76486e SConscript
--- a/SConscript	Mon Mar 03 04:53:01 2008 +0000
+++ b/SConscript	Mon Mar 03 05:07:19 2008 +0000
@@ -1,15 +1,8 @@ Import('env')
 Import('env')
 
-# Need to copy the environment for use here.
 env = env.Copy()
-
-# Add some extra stuff.
-env.proj = 'PICellerator'
-env.Append(CPPPATH=['#build/include/' + env.proj])
-
-#
-# Target specification section.
-#
+env.project_name = 'PICellerator' # Need a project name.
+env.clear_all() # ... so that our structures are ready.
 
 env.build_directory('Voronoi')
 env.build_directory('PopulationControl')
diff -r 2c74b4c94da0 -r b4e4ea76486e SConstruct
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/SConstruct	Mon Mar 03 05:07:19 2008 +0000
@@ -0,0 +1,35 @@
+import os, sys
+
+# Source the configuration scripts.
+sys.path.insert(0, os.path.abspath(os.path.join(os.getcwd(), 'config')))
+SConscript('config/SConfig/SConscript')
+
+# Create our base construction environment.
+env = Environment()
+
+# Configuring or building? Or helping?
+if 'config' in COMMAND_LINE_TARGETS or 'help' in COMMAND_LINE_TARGETS:
+    import packages
+    opts = Options('config.cache') # Create our options database.
+
+    # Setup all the packages we want configured.
+    env.Package(packages.PICellerator, opts)
+    env.setup_packages(opts)
+
+    if 'help' in COMMAND_LINE_TARGETS:
+        env.Alias('help', '.')
+        print opts.GenerateHelpText(env)
+
+    else:
+        env.configure_packages(opts)
+
+else:
+    # Prepare our construction environment.
+    env.load_config('config.cfg') # Load configuration.
+    SConscript('StgSCons', exports='env') # Setup our StG specific utils.
+    if env['staticLibraries']: # Static libs or shared?
+        env.library_builder = env.StaticLibrary
+    else:
+        env.library_builder = env.SharedLibrary
+
+    SConscript('SConscript', exports='env')



More information about the CIG-COMMITS mailing list