1 # Copyright (c) 2008 Vincent Povirk
3 # Permission is hereby granted, free of charge, to any person
4 # obtaining a copy of this software and associated documentation
5 # files (the "Software"), to deal in the Software without
6 # restriction, including without limitation the rights to use,
7 # copy, modify, merge, publish, distribute, sublicense, and/or sell
8 # copies of the Software, and to permit persons to whom the
9 # Software is furnished to do so, subject to the following
12 # The above copyright notice and this permission notice shall be
13 # included in all copies or substantial portions of the Software.
15 # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16 # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
17 # OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18 # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
19 # HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
20 # WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21 # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
22 # OTHER DEALINGS IN THE SOFTWARE.
26 project_env
= Environment()
29 if ARGUMENTS
.get('debug', 1) not in [0, '0']:
30 project_env
.MergeFlags('-g -DLUCCA_DEBUG')
33 project_env
.MergeFlags('-O')
37 if ARGUMENTS
.get('usegnome', 1) not in [0, '0']:
43 project_env
.MergeFlags('-Wall -Wno-unused-function -Werror')
45 def pkgconfig(env
, package
):
46 #this is annoying; because ParseConfig doesn't like arguments that contain spaces, I have to do this manually
47 pc
= subprocess
.Popen(['pkg-config', package
, '--cflags', '--libs'], stdout
=subprocess
.PIPE
)
48 flags
= pc
.stdout
.read()
49 if pc
.wait() == 0: #pkg-config exited successfully
51 else: #pkg-config failed and printed an error message
56 project_include
= Dir('include') #directory for this project's headers
57 project_env
.Prepend(CPPPATH
=project_include
)
58 Export('project_include')
61 bin_files
, bin_config
= SConscript('bin/SConscript')
62 Export('bin_files bin_config')
65 layout_files
, layout_config
= SConscript('layout/SConscript')
66 Export('layout_files layout_config')
68 #X Window Management module
69 display_files
, display_config
= SConscript('xwm/SConscript')
70 Export('display_files display_config')
74 cc_files
, cc_config
= SConscript('crashcatcher/SConscript')
75 Export('cc_files cc_config')
78 core_files
, core_config
= SConscript('core/SConscript')
79 Export('core_files core_config')
82 main_program
= SConscript('loader/SConscript')
83 main_program
= project_env
.Install('.', main_program
)
86 if ARGUMENTS
.get('test', 1) not in [0, '0']:
88 SConscript('layout/test/SConscript')
89 SConscript('xwm/test/SConscript')