-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathSConscript
114 lines (88 loc) · 3.7 KB
/
SConscript
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
# -*- coding: utf-8 -*-
#-------------------------------------------------------------------------#
# Copyright (C) 2011 by Christoph Thelen #
# #
# This program is free software; you can redistribute it and/or modify #
# it under the terms of the GNU General Public License as published by #
# the Free Software Foundation; either version 2 of the License, or #
# (at your option) any later version. #
# #
# This program is distributed in the hope that it will be useful, #
# but WITHOUT ANY WARRANTY; without even the implied warranty of #
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
# GNU General Public License for more details. #
# #
# You should have received a copy of the GNU General Public License #
# along with this program; if not, write to the #
# Free Software Foundation, Inc., #
# 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #
#-------------------------------------------------------------------------#
# Try to load the global build_properties first.
try:
import build_properties
except ImportError:
pass
# Import all local modules.
import build_properties
import scons_common
build_properties.Read()
#----------------------------------------------------------------------------
#
# set help text
#
Help("""
This SConstruct file is part of a Muhkuh buildsystem project. Run
'python path/to/mbs'
from your project's root folder to setup the project environment. Usually
this will be
'python mbs/mbs'
This will also download all missing tools.
""")
build_properties.GenerateHelp()
#----------------------------------------------------------------------------
# Show summary of the build properties.
build_properties.PrintSummary()
# Collect the tools in this list.
astrTools = []
#----------------------------------------------------------------------------
#
# Get the Compiler for the default environment.
#
strGccVersion = None
try:
# Allow the user to specify the GCC version with the MBS_GCC_VERSION veriable.
strGccVersion = MBS_GCC_VERSION
except NameError:
# The default is to take the first available GCC version from the tools.
strGccVersion = scons_common.find_first_tool("^gcc")
if not strGccVersion is None:
astrTools.append(strGccVersion)
#----------------------------------------------------------------------------
#
# Get the Asciidoc version for the default environment.
#
strAsciidocVersion = None
try:
# Allow the user to specify the Asciidoc version with the MBS_ASCIIDOC_VERSION veriable.
strAsciidocVersion = MBS_ASCIIDOC_VERSION
except NameError:
# The default is to take the first available Asciidoc version from the tools.
strAsciidocVersion = scons_common.find_first_tool("^asciidoc")
if not strAsciidocVersion is None:
astrTools.append(strAsciidocVersion)
#----------------------------------------------------------------------------
#
# Create the list of environments.
#
class EnvironmentList:
pass
atEnv = EnvironmentList()
Export('atEnv')
#----------------------------------------------------------------------------
#
# Create the default environment and append it to the list.
#
env_default = scons_common.CreateEnvironment(env=None, astrToolPatterns=astrTools)
env_default.Replace(MBS_ENVIRONMENT_LIST = atEnv)
setattr(atEnv, 'DEFAULT', env_default)