File: SConstruct

package info (click to toggle)
cheesetracker 0.9.9-8
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 4,584 kB
  • ctags: 6,585
  • sloc: cpp: 43,276; python: 315; makefile: 54; ansic: 6
file content (167 lines) | stat: -rw-r--r-- 3,945 bytes parent folder | download
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
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
EnsureSConsVersion(0,14);
#EnsurePythonVersion(2,1); this is buggy in scons, so i commented this out

import os;
import string;
import sys

import detect;
import methods;

moc_binary = "moc-qt3"

################# QT FILES PARSER ##############

def process_moc_list(moc_list):
	for moc_file in moc_list:
		must_create=0;

		moc_source = moc_file;
		moc_dest = 'moc__' + moc_file[:-2] + '.cpp';
                if (not os.path.exists(moc_dest)):
			must_create=1;
		else:
			date_src = os.path.getmtime(moc_source);
			date_dst = os.path.getmtime(moc_dest);
			if (date_src > date_dst):
				must_create=1;

		if (must_create==0):
			continue;
		moc_command = moc_binary + ' ' + moc_source + ' > ' + moc_dest;

		print("MOC check: " +moc_source);
		print("moc command:" + moc_command);
		os.system(moc_command);

########################

env = Environment(CPPPATH = ['#/common','#.','#/common/defines']);

opts = Options(['custom.py'])
opts.Add('optimize', 'Optimize.', 1)
opts.Add('debug', 'Add debug symbols.', 0)
opts.Add('prefix', 'The installation prefix', '/usr/local/')

opts.Update(env)

Help(opts.GenerateHelpText(env))

env.__class__.make_targets = methods.make_targets
#env.__class__.Dir = Dir
env.build_dir = None
env.make_so = None
env.detect = detect.Detect()

if os.environ.has_key('DISTCC_HOSTS'):
	env['CXX'] = os.environ['CXX']
	env['ENV']['DISTCC_HOSTS'] = os.environ['DISTCC_HOSTS']
	env['ENV']['HOME'] = os.environ['HOME']

if (detect.check_dependences(env.detect)):
	sys.exit(1);

moc_binary=env.detect.moc_bin;
print "detected " + env.detect.moc_bin;

#env.sigc_flags=sigc_flags;
#env.sigc_libs=sigc_libs;
#env.gtkmm_flags=gtkmm_flags;
#env.gtkmm_libs=gtkmm_libs;

env.Append(CXXFLAGS=env.detect.sigc_flags);
env.Append(CXXFLAGS=env.detect.dl_flags);
env.Append(CXXFLAGS="-trigraphs");

#detect OSS

env.Append(CXXFLAGS=['-DPOSIX_ENABLED']);


if (env['debug'] and not env['optimize']):
	env.Append(CXXFLAGS=['-g','-Wall']);

if os.environ.has_key('USE_STACK_CHECK'):
	env.Append(CXXFLAGS=['-fstack-check']);


env.optimize_resampler_hack=0

if (env['optimize']):
	env.Append(CXXFLAGS=['-O3','-ffast-math', '-fno-strict-aliasing']);
	env.optimize_resampler_hack=0

profile=0;

if (profile):
	env.Append(CXXFLAGS=['-pg']);
	env.Append(LINKFLAGS=['-pg']);

if (env.detect.os_is_cygwin):
	env.Append(CXXFLAGS=['-DCYGWIN_ENABLED']);
	env.Append(LIBS=['winmm']);
else:
	env.Append(CXXFLAGS=['-DLADSPA_ENABLED']);

if (env.detect.os_is_macosx):
	env.Append(CXXFLAGS=['-DMACOSX_ENABLED']);
	env.Append(LINKFLAGS=['-framework','CoreAudio'])
	env.Append(CPPFLAGS=['-I/sw/include']);

if (env.detect.is_oss_installed):
	env.Append(CXXFLAGS=['-DOSS_ENABLED']);

if (os.environ.has_key('ZYN_DUMMY_DRIVERS')):
	env.Append(CSSFLAGS=['-DDUMMY_ENABLED']);

if (env.detect.has_jack):
	env.Append(CXXFLAGS=['-DJACK_ENABLED']);
	env.Append(CXXFLAGS=env.detect.jack_flags);

if (env.detect.has_alsa):
	env.Append(CXXFLAGS=['-DALSA_ENABLED']);
	env.Append(CXXFLAGS=env.detect.alsa_flags);

env.detect.use_stlport=0
env.detect.use_stlport_debug=1

if (env.detect.use_stlport):
	env.Append(CXXFLAGS=['-I/usr/include/stlport','-DUSING_STLPORT']);
	if (env.detect.use_stlport_debug):
		env.Append(CXXFLAGS=['-D_STLP_DEBUG']);
		env.Append(LIBS=['stlport_debug']);
	else:
		env.Append(LIBS=['stlport']);



env.Append(LIBS=['z','m','pthread']);




env.common_libs=[];
env.process_moc_list=process_moc_list;
env.dl_flags = env.detect.dl_flags
env.dl_libs = env.detect.dl_libs
env.dl_link_flags = env.detect.dl_link_flags
env.qt_flags = env.detect.qt_flags
env.qt_libs = env.detect.qt_libs
env.sigc_flags=env.detect.sigc_flags
env.sigc_libs=env.detect.sigc_libs
env.sigc_link_flags=env.detect.sigc_link_flags


env.bin_targets = [];

Export('env');

SConscript('common/SCsub');
SConscript('cheesetracker/SCsub');

if env['prefix']:
        dst_target = env.Install(env['prefix']+'/bin', env.bin_targets)
        env.Alias('install', dst_target )