1# This file is generated; do not edit.
2
3import os
4
5Import("env")
6
7env = env.Clone(COMPONENT_NAME='net',
8                TARGET_NAME='net_resources')
9
10configurations = {
11    'Debug' : {
12        'Append' : dict(
13            CCFLAGS = [
14                '-Werror',
15                '-pthread',
16                '-fno-exceptions',
17                '-fno-asynchronous-unwind-tables',
18                '-fvisibility=hidden',
19                '-Wall',
20                '-D_FILE_OFFSET_BITS=64',
21                '-O0',
22                '-g'
23            ],
24            CPPDEFINES = [
25                '__STDC_FORMAT_MACROS',
26                'CHROMIUM_BUILD',
27                '_DEBUG'
28            ],
29            CXXFLAGS = [
30                '-fno-rtti',
31                '-fno-threadsafe-statics',
32                '-fvisibility-inlines-hidden'
33            ],
34            LINKFLAGS = [
35                '-pthread',
36                '-rdynamic'
37            ],
38        ),
39        'FilterOut' : dict(
40        ),
41        'Replace' : dict(
42             FLOCK_LDMODULE = ['flock', '$TOP_BUILDDIR/linker.lock', '$LDMODULE'],
43             FLOCK_LINK = ['flock', '$TOP_BUILDDIR/linker.lock', '$LINK'],
44             FLOCK_SHLINK = ['flock', '$TOP_BUILDDIR/linker.lock', '$SHLINK'],
45             IMPLICIT_COMMAND_DEPENDENCIES = '0',
46             LDMODULECOM = [['$FLOCK_LDMODULE',
47  '-o',
48  '$TARGET',
49  '$_LIBDIRFLAGS',
50  '$LDMODULEFLAGS',
51  '$SOURCES',
52  '-Wl,--start-group',
53  '$_LIBFLAGS',
54  '-Wl,--end-group']],
55             LIBPATH = ['$LIB_DIR'],
56             LINKCOM = [['$FLOCK_LINK',
57  '-o',
58  '$TARGET',
59  '$_LIBDIRFLAGS',
60  '$LINKFLAGS',
61  '$SOURCES',
62  '-Wl,--start-group',
63  '$_LIBFLAGS',
64  '-Wl,--end-group']],
65             SHLINKCOM = [['$FLOCK_SHLINK',
66  '-o',
67  '$TARGET',
68  '$_LIBDIRFLAGS',
69  '$SHLINKFLAGS',
70  '$SOURCES',
71  '-Wl,--start-group',
72  '$_LIBFLAGS',
73  '-Wl,--end-group']],
74        ),
75        'ImportExternal' : [
76             'AS',
77             'CC',
78             'CXX',
79             'LINK',
80        ],
81        'PropagateExternal' : [
82             'AS',
83             'CC',
84             'CCACHE_DIR',
85             'CXX',
86             'DISTCC_DIR',
87             'DISTCC_HOSTS',
88             'HOME',
89             'INCLUDE_SERVER_ARGS',
90             'INCLUDE_SERVER_PORT',
91             'LINK',
92             'CHROME_BUILD_TYPE',
93             'CHROMIUM_BUILD',
94             'OFFICIAL_BUILD',
95        ],
96    },
97    'Release' : {
98        'Append' : dict(
99            CCFLAGS = [
100                '-Werror',
101                '-pthread',
102                '-fno-exceptions',
103                '-fno-asynchronous-unwind-tables',
104                '-fvisibility=hidden',
105                '-Wall',
106                '-D_FILE_OFFSET_BITS=64',
107                '-O2',
108                '-fno-ident',
109                '-fdata-sections',
110                '-ffunction-sections'
111            ],
112            CPPDEFINES = [
113                '__STDC_FORMAT_MACROS',
114                'CHROMIUM_BUILD',
115                'NDEBUG',
116                'NVALGRIND'
117            ],
118            CXXFLAGS = [
119                '-fno-rtti',
120                '-fno-threadsafe-statics',
121                '-fvisibility-inlines-hidden'
122            ],
123            LINKFLAGS = [
124                '-pthread',
125                '-Wl,--gc-sections'
126            ],
127        ),
128        'FilterOut' : dict(
129        ),
130        'Replace' : dict(
131             FLOCK_LDMODULE = ['flock', '$TOP_BUILDDIR/linker.lock', '$LDMODULE'],
132             FLOCK_LINK = ['flock', '$TOP_BUILDDIR/linker.lock', '$LINK'],
133             FLOCK_SHLINK = ['flock', '$TOP_BUILDDIR/linker.lock', '$SHLINK'],
134             IMPLICIT_COMMAND_DEPENDENCIES = '0',
135             LDMODULECOM = [['$FLOCK_LDMODULE',
136  '-o',
137  '$TARGET',
138  '$_LIBDIRFLAGS',
139  '$LDMODULEFLAGS',
140  '$SOURCES',
141  '-Wl,--start-group',
142  '$_LIBFLAGS',
143  '-Wl,--end-group']],
144             LIBPATH = ['$LIB_DIR'],
145             LINKCOM = [['$FLOCK_LINK',
146  '-o',
147  '$TARGET',
148  '$_LIBDIRFLAGS',
149  '$LINKFLAGS',
150  '$SOURCES',
151  '-Wl,--start-group',
152  '$_LIBFLAGS',
153  '-Wl,--end-group']],
154             SHLINKCOM = [['$FLOCK_SHLINK',
155  '-o',
156  '$TARGET',
157  '$_LIBDIRFLAGS',
158  '$SHLINKFLAGS',
159  '$SOURCES',
160  '-Wl,--start-group',
161  '$_LIBFLAGS',
162  '-Wl,--end-group']],
163        ),
164        'ImportExternal' : [
165             'AS',
166             'CC',
167             'CXX',
168             'LINK',
169        ],
170        'PropagateExternal' : [
171             'AS',
172             'CC',
173             'CCACHE_DIR',
174             'CXX',
175             'DISTCC_DIR',
176             'DISTCC_HOSTS',
177             'HOME',
178             'INCLUDE_SERVER_ARGS',
179             'INCLUDE_SERVER_PORT',
180             'LINK',
181             'CHROME_BUILD_TYPE',
182             'CHROMIUM_BUILD',
183             'OFFICIAL_BUILD',
184        ],
185    },
186}
187
188config = configurations[env['CONFIG_NAME']]
189env.Append(**config['Append'])
190env.FilterOut(**config['FilterOut'])
191env.Replace(**config['Replace'])
192
193# Scons forces -fPIC for SHCCFLAGS on some platforms.
194# Disable that so we can control it from cflags in gyp.
195# Note that Scons itself is inconsistent with its -fPIC
196# setting. SHCCFLAGS forces -fPIC, and SHCFLAGS does not.
197# This will make SHCCFLAGS consistent with SHCFLAGS.
198env['SHCCFLAGS'] = ['$CCFLAGS']
199
200for _var in config['ImportExternal']:
201  if _var in ARGUMENTS:
202    env[_var] = ARGUMENTS[_var]
203  elif _var in os.environ:
204    env[_var] = os.environ[_var]
205for _var in config['PropagateExternal']:
206  if _var in ARGUMENTS:
207    env[_var] = ARGUMENTS[_var]
208  elif _var in os.environ:
209    env['ENV'][_var] = os.environ[_var]
210
211env['ENV']['LD_LIBRARY_PATH'] = env.subst('$LIB_DIR')
212
213if ARGUMENTS.get('COVERAGE') not in (None, '0'):
214  env.AppendUnique(
215            CCFLAGS = [
216                '-fprofile-arcs',
217                '-ftest-coverage'
218            ],
219            LINKFLAGS = [
220                '-fprofile-arcs'
221            ],
222  )
223
224if ARGUMENTS.get('PROFILE') not in (None, '0'):
225  env.AppendUnique(
226            CCFLAGS = [
227                '-pg',
228                '-g'
229            ],
230            LINKFLAGS = [
231                '-pg'
232            ],
233  )
234
235if ARGUMENTS.get('SYMBOLS') not in (None, '0'):
236  env.AppendUnique(
237            CCFLAGS = [
238                '-g'
239            ],
240  )
241
242input_files = [
243    'base/net_resources.grd',
244]
245
246target_files = []
247prerequisites = []
248
249grit_additional_inputs = ['$SRC_DIR/net/../tools/grit/grit.py']
250grit_outputs = ['${SHARED_INTERMEDIATE_DIR}/net/grit/${SOURCE.filebase}.h',
251 '${SHARED_INTERMEDIATE_DIR}/net/${SOURCE.filebase}.rc',
252 '${SHARED_INTERMEDIATE_DIR}/net/${SOURCE.filebase}.pak']
253def grit_emitter(target, source, env):
254  return (grit_outputs, source + grit_additional_inputs)
255if GetOption('verbose'):
256  grit_action = Action([['cd',
257 '$SRC_DIR/net',
258 '&&',
259 'python',
260 '../tools/grit/grit.py',
261 '-i',
262 '${SOURCE.abspath}',
263 'build',
264 '-o',
265 '${SHARED_INTERMEDIATE_DIR}/net']])
266else:
267  grit_action = Action([['cd',
268 '$SRC_DIR/net',
269 '&&',
270 'python',
271 '../tools/grit/grit.py',
272 '-i',
273 '${SOURCE.abspath}',
274 'build',
275 '-o',
276 '${SHARED_INTERMEDIATE_DIR}/net']], 'Generating resources from ${SOURCE.abspath}')
277env['BUILDERS']['grit'] = Builder(action=grit_action,
278                                      emitter=grit_emitter)
279
280_outputs = []
281_processed_input_files = []
282for infile in input_files:
283  if (type(infile) == type('')
284      and not os.path.isabs(infile)
285      and not infile[0] == '$'):
286    infile = '$SRC_DIR/net/' + infile
287  if str(infile).endswith('.grd'):
288    _generated = env.grit(infile)
289    env.Precious(_generated)
290    _outputs.append(_generated)
291    _processed_input_files.append(infile)
292  else:
293    _processed_input_files.append(infile)
294prerequisites.extend(_outputs)
295input_files = _processed_input_files
296
297target_files.extend(input_files)
298
299gyp_target = env.Alias('net_resources', target_files)
300env.Requires(gyp_target, prerequisites)
301Return("gyp_target")
302