mail[Wesnoth-commits] r27525 - in /trunk: SConstruct scons/ccache.py scons/distcc.py


Others Months | Index by Date | Thread Index
>>   [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Header


Content

Posted by loonycyborg on June 27, 2008 - 16:08:
Author: loonycyborg
Date: Fri Jun 27 13:52:19 2008
New Revision: 27525

URL: http://svn.gna.org/viewcvs/wesnoth?rev=27525&view=rev
Log:
Added support for ccache and distcc.

Added:
    trunk/scons/ccache.py
    trunk/scons/distcc.py
Modified:
    trunk/SConstruct

Modified: trunk/SConstruct
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/SConstruct?rev=27525&r1=27524&r2=27525&view=diff
==============================================================================
--- trunk/SConstruct (original)
+++ trunk/SConstruct Fri Jun 27 13:52:19 2008
@@ -77,6 +77,8 @@
     ('boost_suffix', 'Suffix of boost libraries.'),
     PathOption('gettextdir', 'Root directory of Gettext\'s installation.', 
"", OptionalPath), 
     ('host', 'Cross-compile host.', ''),
+    BoolOption('distcc', "Use distcc", False),
+    BoolOption('ccache', "Use ccache", False),
     ('cxxtool', 'Set c++ compiler command if not using standard compiler.'),
     BoolOption("fast", "Make scons faster at cost of less precise dependency 
tracking.", False)
     )
@@ -100,6 +102,10 @@
 if env.get('cxxtool',""):
        env['CXX'] = env['cxxtool']
        env['ENV']['HOME'] = os.environ['HOME']
+
+if env['distcc']: env.Tool('distcc')
+if env['ccache']: env.Tool('ccache')
+
 
 Help("""Arguments may be a mixture of switches and targets an any order.
 Switches apply to the entire build regrdless of where they are in the order.
@@ -150,7 +156,7 @@
 be appended to the appropriate variables within scons.
 """ + opts.GenerateHelpText(env))
 
-if env["cachedir"]:
+if env["cachedir"] and not env['ccache']:
     CacheDir(env["cachedir"])
 
 if env["fast"]:

Added: trunk/scons/ccache.py
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/scons/ccache.py?rev=27525&view=auto
==============================================================================
--- trunk/scons/ccache.py (added)
+++ trunk/scons/ccache.py Fri Jun 27 13:52:19 2008
@@ -1,0 +1,32 @@
+# vi: syntax=python:et:ts=4
+# Shamelessly stolen from FreeOrion's SConstruct
+# 
http://freeorion.svn.sourceforge.net/viewvc/freeorion/trunk/FreeOrion/SConstruct?revision=2478&view=markup
+
+import os
+
+def exists():
+    return True
+
+def generate(env):
+        env['CC'] = 'ccache %s' % env['CC']
+        env['CXX'] = 'ccache %s' % env['CXX']
+        for i in ['HOME',
+                  'CCACHE_DIR',
+                  'CCACHE_TEMPDIR',
+                  'CCACHE_LOGFILE',
+                  'CCACHE_PATH',
+                  'CCACHE_CC',
+                  'CCACHE_PREFIX',
+                  'CCACHE_DISABLE',
+                  'CCACHE_READONLY',
+                  'CCACHE_CPP2',
+                  'CCACHE_NOSTATS',
+                  'CCACHE_NLEVELS',
+                  'CCACHE_HARDLINK',
+                  'CCACHE_RECACHE',
+                  'CCACHE_UMASK',
+                  'CCACHE_HASHDIR',
+                  'CCACHE_UNIFY',
+                  'CCACHE_EXTENSION']:
+            if os.environ.has_key(i) and not env.has_key(i):
+                env['ENV'][i] = os.environ[i]

Added: trunk/scons/distcc.py
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/scons/distcc.py?rev=27525&view=auto
==============================================================================
--- trunk/scons/distcc.py (added)
+++ trunk/scons/distcc.py Fri Jun 27 13:52:19 2008
@@ -1,0 +1,24 @@
+# vi: syntax=python:et:ts=4
+# Shamelessly stolen from FreeOrion's SConstruct
+# 
http://freeorion.svn.sourceforge.net/viewvc/freeorion/trunk/FreeOrion/SConstruct?revision=2478&view=markup
+
+import os
+
+def exists():
+    return True
+
+def generate(env):
+        env['CC'] = 'distcc %s' % env['CC']
+        env['CXX'] = 'distcc %s' % env['CXX']
+        for i in ['HOME',
+                  'DISTCC_HOSTS',
+                  'DISTCC_VERBOSE',
+                  'DISTCC_LOG',
+                  'DISTCC_FALLBACK',
+                  'DISTCC_MMAP',
+                  'DISTCC_SAVE_TEMPS',
+                  'DISTCC_TCP_CORK',
+                  'DISTCC_SSH'
+                  ]:
+            if os.environ.has_key(i) and not env.has_key(i):
+                env['ENV'][i] = os.environ[i]




Related Messages


Powered by MHonArc, Updated Fri Jun 27 16:42:32 2008