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