]> git.donarmstrong.com Git - lilypond.git/commitdiff
GO_FAST_BUTTON: implement tips from Andreas Roach.
authorJan Nieuwenhuizen <janneke@gnu.org>
Tue, 20 Jul 2004 22:47:23 +0000 (22:47 +0000)
committerJan Nieuwenhuizen <janneke@gnu.org>
Tue, 20 Jul 2004 22:47:23 +0000 (22:47 +0000)
This brings SCons run-time on up-to-date tree down from 48s with
only checksums, to 34s without 2day checksums, to 14s (make needs
4 seconds).

ChangeLog
SConstruct
lily/SConscript

index 2d74b469b8c5a16d1fc9a17cef800a94eb0b6516..d3f310e3f537f5bb4fadbdc3d61d60b4e27bcccd 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2004-07-21  Jan Nieuwenhuizen  <janneke@gnu.org>
+
+       * SConstruct: GO_FAST_BUTTON: implement tips from Andreas Roach.
+       This brings SCons run-time on up-to-date tree down from 48s with
+       only checksums, to 34s without 2day checksums, to 14s (make needs
+       4 seconds).
+
 2004-07-20  Han-Wen Nienhuys   <hanwen@xs4all.nl>
 
        * lily/slur-quanting.cc (score_extra_encompass): add  break ;
index 40c634a6f22c3ba5195b6bd4a16c90868fe2f4d5..e8df51cf5edc82faff59a475c564a41b810ce133 100644 (file)
@@ -164,6 +164,11 @@ env = Environment (
        TOPLEVEL_VERSION = version,
        )
 
+# Hardcoded usability switch (Anthony Roach).
+# See http://www.scons.org/cgi-bin/wiki/GoFastButton
+# First do: scons realclean .
+GO_FAST_BUTTON = 1
+
 # Add all config_vars to opts, so that they will be read and saved
 # together with the other configure options.
 map (lambda x: opts.AddOptions ((x,)), config_vars)
@@ -172,11 +177,18 @@ Help (usage + opts.GenerateHelpText (env))
 
 opts.Update (env)
 
-# Using content checksums prevents rebuilds after [re]configure if
-# config.hh has not changed.
-if env['checksums']:
+if GO_FAST_BUTTON:
+       env['checksums'] = 0
+       SetOption ('max_drift', 1)
+       # SetOption ('implicit_deps_unchanged', 1)
+       print "If scons feels slow, use --implicit-deps-unchanged"
+elif env['checksums']:
+       # Always use checksums (makes more sense than timestamps).
        SetOption ('max_drift', 0)
-       TargetSignatures ("content")
+       # Using *content* checksums prevents rebuilds after
+       # [re]configure if config.hh has not changed.  Too bad that it
+       # is unusably slow.
+       TargetSignatures ('content')
 
 absbuild = Dir (env['build']).abspath
 outdir = os.path.join (Dir (env['build']).abspath, env['out'])
@@ -314,7 +326,10 @@ def configure (target, source, env):
 
        command = r"""python -c 'import sys; sys.stdout.write ("%s/include/python%s" % (sys.prefix, sys.version[:3]))'""" #"
        PYTHON_INCLUDE = os.popen (command).read ()
-       env.Append (CPPPATH = PYTHON_INCLUDE)
+       if GO_FAST_BUTTON:
+               env.Append (CCFLAGS = ['-I%s ' % PYTHON_INCLUDE])
+       else:
+               env.Append (CPPPATH = PYTHON_INCLUDE)
 
        headers = ('sys/stat.h', 'assert.h', 'kpathsea/kpathsea.h', 'Python.h')
        for i in headers:
@@ -349,6 +364,10 @@ def configure (target, source, env):
        if conf.CheckLib ('kpathsea', 'kpse_find_tfm'):
                conf.env['DEFINES']['HAVE_KPSE_FIND_TFM'] = '1'
 
+       if GO_FAST_BUTTON:
+               cpppath = []
+               if env.has_key ('CPPPATH'):
+                       cpppath = env['CPPPATH']
        #this could happen after flower...
        env.ParseConfig ('guile-config compile')
 
@@ -364,6 +383,13 @@ def configure (target, source, env):
                        conf.env['DEFINES']['HAVE_PANGO_CVS'] = '1'
                        conf.env['DEFINES']['HAVE_PANGO_FC_FONT_MAP_ADD_DECODER_FIND_FUNC'] = '1'
 
+       if GO_FAST_BUTTON:
+               # Using CCFLAGS = -I<system-dir> rather than CPPPATH = [
+               # <system-dir>] speeds up SCons
+               env['CCFLAGS'] += map (lambda x: '-I' + x,
+                                      env['CPPPATH'][len (cpppath):])
+               env['CPPPATH'] = cpppath
+
        if required:
                print
                print '********************************'
@@ -575,7 +601,6 @@ env.Append (
        LILYPONDPREFIX = os.path.join (run_prefix, 'share/lilypond'),
 
        LIBPATH = [os.path.join (absbuild, 'flower', env['out']),],
-       ##CPPPATH = [outdir, '#',], # do not read auto*'s header
        CPPPATH = [outdir, ],
        LILYPOND_PATH = ['.', '$srcdir/input',
                         '$srcdir/input/regression',
index 78cd7e8cf1bbdb02a436b4de74bdac199341ff7e..3b447239cb2e0d799a3cab0f4e69bb9ddea84a89 100644 (file)
@@ -11,7 +11,7 @@ includes = src_glob ('include/*.hh')
 e = env.Copy ()
 
 e.Append (
-       CPPPATH = [outdir, '#/lily/include', '#/flower/include'],
+       CPPPATH = ['#/lily/include', '#/flower/include', outdir],
        LEXFLAGS = ['-Cfe', '-p', '-p'],
        LIBS = ['flower'],
        )