Lumiera  0.pre.03
»edit your freedom«
Options.py
1 # -*- python -*-
2 
5 
6 # Copyright (C) Lumiera.org
7 # 2012, Hermann Vosseler <Ichthyostega@web.de>
8 #
9 # This program is free software; you can redistribute it and/or
10 # modify it under the terms of the GNU General Public License as
11 # published by the Free Software Foundation; either version 2 of
12 # the License, or (at your option) any later version.
13 #
14 # This program is distributed in the hope that it will be useful,
15 # but WITHOUT ANY WARRANTY; without even the implied warranty of
16 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 # GNU General Public License for more details.
18 #
19 # You should have received a copy of the GNU General Public License
20 # along with this program; if not, write to the Free Software
21 # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
22 
23 
24 
25 from SCons.Script import PathVariable, EnumVariable, BoolVariable, Help
26 
27 
28 
29 
30 
31 def defineCmdlineVariables(buildVars):
32  """ several toggles and configuration variables can be set on the commandline,
33  current settings will be persisted in a options cache file.
34  you may define custom variable settings in a separate file.
35  Commandline will override both.
36  """
37  buildVars.AddVariables(
38  ('ARCHFLAGS', 'Set architecture-specific compilation flags (passed literally to gcc)','')
39  ,('CC', 'Set the C compiler to use.', 'gcc')
40  ,('CXX', 'Set the C++ compiler to use.', 'g++')
41  ,PathVariable('CCACHE', 'Integrate with CCache', '', PathVariable.PathAccept)
42  ,PathVariable('DISTCC', 'Invoke C/C++ compiler commands through DistCC', '', PathVariable.PathAccept)
43  ,EnumVariable('BUILDLEVEL', 'NoBug build level for debugging', 'ALPHA', allowed_values=('ALPHA', 'BETA', 'RELEASE'))
44  ,BoolVariable('DEBUG', 'Build with debugging information and no optimisations', False)
45  ,BoolVariable('OPTIMIZE', 'Build with strong optimisation (-O3)', False)
46  ,BoolVariable('VALGRIND', 'Run Testsuite under valgrind control', True)
47  ,BoolVariable('VERBOSE', 'Print full build commands', False)
48  ,('TESTSUITES', 'Run only test suites matching the given pattern', '')
49  ,('TESTMODE', 'test suite error mode for test.sh', '')
50 # ,BoolVariable('OPENGL', 'Include support for OpenGL preview rendering', False)
51 # ,EnumVariable('DIST_TARGET', 'Build target architecture', 'auto',
52 # allowed_values=('auto', 'i386', 'i686', 'x86_64' ), ignorecase=2)
53  ,PathVariable('PREFIX', 'Installation dir prefix', 'usr/local', PathVariable.PathAccept)
54  ,PathVariable('INSTALLDIR', 'Root output directory for install. Final installation will happen in INSTALLDIR/PREFIX/... ', '/', PathVariable.PathIsDir)
55  ,PathVariable('PKGLIBDIR', 'Installation dir for plugins, defaults to PREFIX/lib/lumiera/modules', '',PathVariable.PathAccept)
56  ,PathVariable('PKGDATADIR', 'Installation dir for default config, usually PREFIX/share/lumiera', '',PathVariable.PathAccept)
57  )
58 
59 
60 
61 def prepareOptionsHelp(buildVars,env):
62  prelude = """
63 USAGE: scons [-c] [OPTS] [key=val [key=val...]] [TARGETS]
64  Build and optionally install Lumiera.
65  Without specifying any target, just the (re)build target will run.
66  Add -c to the commandline to clean up anything a given target would produce
67 
68 Special Targets:
69  build : just compile and link
70  research: build experimental code (might fail)
71  testcode: additionally compile the Testsuite
72  check : build and run the Testsuite
73  doc : generate documentation (Doxygen)
74  all : build and testcode and doc
75  install : install created artifacts at PREFIX
76 
77 Configuration Options:
78 """
79  Help(prelude + buildVars.GenerateHelpText(env))
80 
81 
82