From: Jan Nieuwenhuizen Date: Tue, 20 Jul 2004 22:47:23 +0000 (+0000) Subject: GO_FAST_BUTTON: implement tips from Andreas Roach. X-Git-Tag: release/2.3.8~13 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=a425af00968d9453934ab33ef462ef223e9b3588;p=lilypond.git 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). --- diff --git a/ChangeLog b/ChangeLog index 2d74b469b8..d3f310e3f5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2004-07-21 Jan Nieuwenhuizen + + * 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 * lily/slur-quanting.cc (score_extra_encompass): add break ; diff --git a/SConstruct b/SConstruct index 40c634a6f2..e8df51cf5e 100644 --- a/SConstruct +++ b/SConstruct @@ -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 rather than CPPPATH = [ + # ] 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', diff --git a/lily/SConscript b/lily/SConscript index 78cd7e8cf1..3b447239cb 100644 --- a/lily/SConscript +++ b/lily/SConscript @@ -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'], )