Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(516)

Side by Side Diff: webkit/build/port/SConscript

Issue 53121: Remove the checked-in scons configuration files. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 11 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « webkit/build/WebKit/SConscript ('k') | webkit/build/webkit_resources/SConscript » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 # Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file.
4
5 import os.path
6 import re
7
8 Import('env')
9
10 webcore = env.Dir('$CHROME_SRC_DIR/third_party/WebKit/WebCore')
11 webcore_posix = webcore.abspath.replace('\\', '/')
12
13 cygwin = env.Dir('$CYGWIN_DIR/bin')
14 cygwin_posix = cygwin.abspath.replace('\\', '/')
15
16 pending = env.Dir('$CHROME_SRC_DIR/webkit/pending')
17 portroot = env.Dir('$CHROME_SRC_DIR/webkit/port')
18 webkit_build = env.Dir('$CHROME_SRC_DIR/webkit/build')
19
20
21 def PosixIncludes(env, prefix, files, suffix):
22 # This is basically a custom version of the _concat() function,
23 # which we need because the binding script needs posix style paths,
24 # even on windows, and _concat() doesn't make that easy to do... :-(
25 #
26 # Note that because we're not using the RDirs function that the
27 # normal _concat() call uses, this will only add the build
28 # directory paths, not the paths in the underlying source directory,
29 # to its list.
30 posix_files = [str(env.Dir(f).abspath).replace('\\', '/') for f in files]
31 combined = [prefix + f + suffix for f in posix_files]
32 return ' '.join(combined)
33
34
35 env = env.Clone(
36 WEBCORE = webcore,
37 PENDING = pending,
38 PORTROOT = portroot,
39 WEBKIT_BUILD = webkit_build,
40
41 BINDINGS_SCRIPTS_DIR = '$WEBKIT_DIR/port/bindings/scripts',
42 BINDINGS_SCRIPT = '$BINDINGS_SCRIPTS_DIR/generate-bindings.pl',
43
44 PERL_INCLUDE_PATH = ['$BINDINGS_SCRIPTS_DIR',
45 '$CHROME_SRC_DIR/third_party/WebKit/WebCore/bindings/sc ripts'],
46
47 FEATURE_DEFINES = [
48 'ENABLE_CROSS_DOCUMENT_MESSAGING',
49 'ENABLE_XSLT',
50 'ENABLE_XPATH',
51 'ENABLE_SVG',
52 'ENABLE_SVG_ANIMATION',
53 'ENABLE_SVG_AS_IMAGE',
54 'ENABLE_SVG_FONTS',
55 'ENABLE_SVG_FOREIGN_OBJECT',
56 'ENABLE_SVG_USE',
57 ],
58
59 SVG_FLAGS = [
60 'ENABLE_SVG_ANIMATION=1',
61 'ENABLE_SVG_AS_IMAGE=1',
62 'ENABLE_SVG_FONTS=1',
63 'ENABLE_SVG_FOREIGN_OBJECT=1',
64 'ENABLE_SVG_USE=1',
65 ],
66
67 BINDINGS_INCLUDE_PATH = [
68 '$PENDING',
69 '$WEBCORE/css',
70 '$WEBCORE/dom',
71 '$WEBCORE/html',
72 '$WEBCORE/page',
73 '$WEBCORE/svg',
74 '$WEBCORE/xml',
75 ],
76 BINDINGS_INCLUDE_FLAG = '--include ',
77 BINDINGS_INCLUDE_SUFFIX = '',
78 _posix_includes = PosixIncludes,
79 _BINDINGS_INCLUDE_FLAGS = '${_posix_includes(__env__, ' + \
80 'BINDINGS_INCLUDE_FLAG, ' + \
81 'BINDINGS_INCLUDE_PATH, ' + \
82 'BINDINGS_INCLUDE_SUFFIX)}',
83 )
84
85 env.PrependENVPath('PATH', cygwin_posix)
86
87
88 # When we haven't specified --verbose (aka brief_comstr), make the
89 # WebKit bindings building step output more brief to match the brief
90 # compile/link/etc. lines.
91 if env.GetOption('brief_comstr'):
92 env.SetDefault(BINDINGSCOMSTR='________Building bindings in $TARGET')
93
94 bindings_perl_modules = env.Glob('$BINDINGS_SCRIPTS_DIR/*.pm')
95
96 def BindingsEmitter(target, source, env):
97 source.append('$BINDINGS_SCRIPT')
98 try:
99 idl_contents = open(source[0].rfile().abspath, 'r').read()
100 except EnvironmentError:
101 return target, source
102 idl_contents = re.sub('//[^\\n]*\\n', '', idl_contents)
103 interfaces = re.findall('interface\\s*(?:\\[[^]]+\\])?\\s*'
104 '(\\w+)[^{]*[{]', idl_contents)
105 new_target = []
106 for i in interfaces:
107 new_cpp = '$DERIVED_DIR/${BINDINGSPREFIX}' + i + '.cpp'
108 new_h = '$DERIVED_DIR/${BINDINGSPREFIX}' + i + '.h'
109 new_target.extend([new_cpp, new_h])
110 env.Depends(new_cpp, bindings_perl_modules)
111 env.Depends(new_h, bindings_perl_modules)
112 return new_target, source
113
114 env.Append(
115 BUILDERS = {'Bindings': Builder(
116 action = Action('$BINDINGSCOM', '$BINDINGSCOMSTR'),
117 src_suffix = '.idl',
118 emitter = BindingsEmitter,
119 )},
120 )
121
122 env.Replace(
123 # TODO(bradnelson): fix ugly hack with one include!
124 BINDINGSCOM = '$PERL $_PERL_INCLUDE_FLAGS ' + \
125 '${SOURCES[1].posix} ' + \
126 '--defines "$FEATURE_DEFINES $BINDINGS_LANGUAGE" ' + \
127 '--generator $BINDINGS_GENERATOR_ARG ' + \
128 '$_BINDINGS_INCLUDE_FLAGS ' + \
129 '--outputdir ${TARGET.dir} ' + \
130 '${SOURCES[0].posix}',
131 )
132
133 if env.Bit('mac'): # Mac OS X
134 env['BINDINGSPREFIX'] = 'DOM'
135 env['BINDINGS_GENERATOR_ARG'] = 'ObjC'
136 env['BINDINGS_LANGUAGE'] = 'LANGUAGE_OBJECTIVE_C'
137 env.Append(BINDINGS_INCLUDE_PATH = [ 'bindings/js' ])
138 elif False:
139 env['BINDINGSPREFIX'] = 'JS'
140 env['BINDINGS_GENERATOR_ARG'] = 'JS'
141 env['BINDINGS_LANGUAGE'] = 'LANGUAGE_JAVASCRIPT'
142 env.Append(BINDINGS_INCLUDE_PATH = [ 'bindings/js' ])
143 elif True:
144 env['BINDINGSPREFIX'] = 'V8'
145 env['BINDINGS_GENERATOR_ARG'] = 'V8'
146 env['BINDINGS_LANGUAGE'] = 'LANGUAGE_JAVASCRIPT V8_BINDING'
147 env.Prepend(PERL_INCLUDE_PATH = [ '$PORTROOT/bindings/scripts' ])
148 else:
149 print 'I am not going to generate bindings for you!'
150
151
152 idl_files = [
153 'bindings/v8/UndetectableHTMLCollection.idl',
154
155 'css/Counter.idl',
156 'css/CSSCharsetRule.idl',
157 'css/CSSFontFaceRule.idl',
158 'css/CSSImportRule.idl',
159 'css/CSSMediaRule.idl',
160 'css/CSSPageRule.idl',
161 'css/CSSPrimitiveValue.idl',
162 'css/CSSRule.idl',
163 'css/CSSRuleList.idl',
164 'css/CSSStyleDeclaration.idl',
165 'css/CSSStyleRule.idl',
166 'css/CSSStyleSheet.idl',
167 'css/CSSUnknownRule.idl',
168 'css/CSSValue.idl',
169 'css/CSSValueList.idl',
170 'css/CSSVariablesDeclaration.idl',
171 'css/CSSVariablesRule.idl',
172 'css/MediaList.idl',
173 'css/Rect.idl',
174 'css/RGBColor.idl',
175 'css/StyleSheet.idl',
176 'css/StyleSheetList.idl',
177 'css/WebKitCSSKeyframeRule.idl',
178 'css/WebKitCSSKeyframesRule.idl',
179 'css/WebKitCSSMatrix.idl',
180 'css/WebKitCSSTransformValue.idl',
181
182 'dom/Attr.idl',
183 'dom/CDATASection.idl',
184 'dom/CharacterData.idl',
185 'dom/ClientRect.idl',
186 'dom/ClientRectList.idl',
187 'dom/Clipboard.idl',
188 'dom/Comment.idl',
189 'dom/Document.idl',
190 'dom/DocumentFragment.idl',
191 'dom/DocumentType.idl',
192 'dom/DOMCoreException.idl',
193 'dom/DOMImplementation.idl',
194 'dom/DOMStringList.idl',
195 'dom/Element.idl',
196 'dom/Entity.idl',
197 'dom/EntityReference.idl',
198 'dom/Event.idl',
199 'dom/EventException.idl',
200 'dom/EventListener.idl',
201 'dom/EventTarget.idl',
202 'dom/KeyboardEvent.idl',
203 'dom/MessageChannel.idl',
204 'dom/MessageEvent.idl',
205 'dom/MessagePort.idl',
206 'dom/MouseEvent.idl',
207 'dom/MutationEvent.idl',
208 'dom/NamedNodeMap.idl',
209 'dom/Node.idl',
210 'dom/NodeFilter.idl',
211 'dom/NodeIterator.idl',
212 'dom/NodeList.idl',
213 'dom/Notation.idl',
214 'dom/OverflowEvent.idl',
215 'dom/ProcessingInstruction.idl',
216 'dom/ProgressEvent.idl',
217 'dom/Range.idl',
218 'dom/RangeException.idl',
219 'dom/Text.idl',
220 'dom/TextEvent.idl',
221 'dom/TreeWalker.idl',
222 'dom/UIEvent.idl',
223 'dom/WebKitAnimationEvent.idl',
224 'dom/WebKitTransitionEvent.idl',
225 'dom/WheelEvent.idl',
226
227 'html/CanvasGradient.idl',
228 'html/CanvasPattern.idl',
229 'html/CanvasPixelArray.idl',
230 'html/CanvasRenderingContext2D.idl',
231 'html/File.idl',
232 'html/FileList.idl',
233 'html/HTMLAnchorElement.idl',
234 'html/HTMLAppletElement.idl',
235 'html/HTMLAreaElement.idl',
236 'html/HTMLAudioElement.idl',
237 'html/HTMLBaseElement.idl',
238 'html/HTMLBaseFontElement.idl',
239 'html/HTMLBlockquoteElement.idl',
240 'html/HTMLBodyElement.idl',
241 'html/HTMLBRElement.idl',
242 'html/HTMLButtonElement.idl',
243 'html/HTMLCanvasElement.idl',
244 'html/HTMLCollection.idl',
245 'html/HTMLDirectoryElement.idl',
246 'html/HTMLDivElement.idl',
247 'html/HTMLDListElement.idl',
248 'html/HTMLDocument.idl',
249 'html/HTMLElement.idl',
250 'html/HTMLEmbedElement.idl',
251 'html/HTMLFieldSetElement.idl',
252 'html/HTMLFontElement.idl',
253 'html/HTMLFormElement.idl',
254 'html/HTMLFrameElement.idl',
255 'html/HTMLFrameSetElement.idl',
256 'html/HTMLHeadElement.idl',
257 'html/HTMLHeadingElement.idl',
258 'html/HTMLHRElement.idl',
259 'html/HTMLHtmlElement.idl',
260 'html/HTMLIFrameElement.idl',
261 'html/HTMLImageElement.idl',
262 'html/HTMLInputElement.idl',
263 'html/HTMLIsIndexElement.idl',
264 'html/HTMLLabelElement.idl',
265 'html/HTMLLegendElement.idl',
266 'html/HTMLLIElement.idl',
267 'html/HTMLLinkElement.idl',
268 'html/HTMLMapElement.idl',
269 'html/HTMLMarqueeElement.idl',
270 'html/HTMLMediaElement.idl',
271 'html/HTMLMenuElement.idl',
272 'html/HTMLMetaElement.idl',
273 'html/HTMLModElement.idl',
274 'html/HTMLObjectElement.idl',
275 'html/HTMLOListElement.idl',
276 'html/HTMLOptGroupElement.idl',
277 'html/HTMLOptionElement.idl',
278 'html/HTMLOptionsCollection.idl',
279 'html/HTMLParagraphElement.idl',
280 'html/HTMLParamElement.idl',
281 'html/HTMLPreElement.idl',
282 'html/HTMLQuoteElement.idl',
283 'html/HTMLScriptElement.idl',
284 'html/HTMLSelectElement.idl',
285 'html/HTMLSourceElement.idl',
286 'html/HTMLStyleElement.idl',
287 'html/HTMLTableCaptionElement.idl',
288 'html/HTMLTableCellElement.idl',
289 'html/HTMLTableColElement.idl',
290 'html/HTMLTableElement.idl',
291 'html/HTMLTableRowElement.idl',
292 'html/HTMLTableSectionElement.idl',
293 'html/HTMLTextAreaElement.idl',
294 'html/HTMLTitleElement.idl',
295 'html/HTMLUListElement.idl',
296 'html/HTMLVideoElement.idl',
297 'html/ImageData.idl',
298 'html/MediaError.idl',
299 'html/TextMetrics.idl',
300 'html/TimeRanges.idl',
301 'html/VoidCallback.idl',
302
303 # 'loader/appcache/DOMApplicationCache.idl',
304
305 'page/AbstractView.idl',
306 'page/BarInfo.idl',
307 'page/Console.idl',
308 'page/DOMSelection.idl',
309 'page/DOMWindow.idl',
310 'page/History.idl',
311 'page/Location.idl',
312 'page/Navigator.idl',
313 'page/Screen.idl',
314 'page/WebKitPoint.idl',
315 'page/WorkerNavigator.idl',
316
317 'inspector/InspectorController.idl',
318
319 'plugins/MimeTypeArray.idl',
320 'plugins/MimeType.idl',
321 'plugins/PluginArray.idl',
322 'plugins/Plugin.idl',
323
324 'storage/Database.idl',
325 'storage/SQLError.idl',
326 'storage/SQLResultSet.idl',
327 'storage/SQLResultSetRowList.idl',
328 'storage/SQLTransaction.idl',
329
330 'svg/ElementTimeControl.idl',
331 'svg/SVGAElement.idl',
332 'svg/SVGAltGlyphElement.idl',
333 'svg/SVGAngle.idl',
334 'svg/SVGAnimateColorElement.idl',
335 'svg/SVGAnimatedAngle.idl',
336 'svg/SVGAnimatedBoolean.idl',
337 'svg/SVGAnimatedEnumeration.idl',
338 'svg/SVGAnimatedInteger.idl',
339 'svg/SVGAnimatedLength.idl',
340 'svg/SVGAnimatedLengthList.idl',
341 'svg/SVGAnimatedNumber.idl',
342 'svg/SVGAnimatedNumberList.idl',
343 'svg/SVGAnimatedPathData.idl',
344 'svg/SVGAnimatedPoints.idl',
345 'svg/SVGAnimatedPreserveAspectRatio.idl',
346 'svg/SVGAnimatedRect.idl',
347 'svg/SVGAnimatedString.idl',
348 'svg/SVGAnimatedTransformList.idl',
349 'svg/SVGAnimateElement.idl',
350 'svg/SVGAnimateTransformElement.idl',
351 'svg/SVGAnimationElement.idl',
352 'svg/SVGCircleElement.idl',
353 'svg/SVGClipPathElement.idl',
354 'svg/SVGColor.idl',
355 'svg/SVGComponentTransferFunctionElement.idl',
356 'svg/SVGCursorElement.idl',
357 'svg/SVGDefinitionSrcElement.idl',
358 'svg/SVGDefsElement.idl',
359 'svg/SVGDescElement.idl',
360 'svg/SVGDocument.idl',
361 'svg/SVGElement.idl',
362 'svg/SVGElementInstance.idl',
363 'svg/SVGElementInstanceList.idl',
364 'svg/SVGEllipseElement.idl',
365 'svg/SVGException.idl',
366 'svg/SVGExternalResourcesRequired.idl',
367 'svg/SVGFEBlendElement.idl',
368 'svg/SVGFEColorMatrixElement.idl',
369 'svg/SVGFEComponentTransferElement.idl',
370 'svg/SVGFECompositeElement.idl',
371 'svg/SVGFEDiffuseLightingElement.idl',
372 'svg/SVGFEDisplacementMapElement.idl',
373 'svg/SVGFEDistantLightElement.idl',
374 'svg/SVGFEFloodElement.idl',
375 'svg/SVGFEFuncAElement.idl',
376 'svg/SVGFEFuncBElement.idl',
377 'svg/SVGFEFuncGElement.idl',
378 'svg/SVGFEFuncRElement.idl',
379 'svg/SVGFEGaussianBlurElement.idl',
380 'svg/SVGFEImageElement.idl',
381 'svg/SVGFEMergeElement.idl',
382 'svg/SVGFEMergeNodeElement.idl',
383 'svg/SVGFEOffsetElement.idl',
384 'svg/SVGFEPointLightElement.idl',
385 'svg/SVGFESpecularLightingElement.idl',
386 'svg/SVGFESpotLightElement.idl',
387 'svg/SVGFETileElement.idl',
388 'svg/SVGFETurbulenceElement.idl',
389 'svg/SVGFilterElement.idl',
390 'svg/SVGFilterPrimitiveStandardAttributes.idl',
391 'svg/SVGFitToViewBox.idl',
392 'svg/SVGFontElement.idl',
393 'svg/SVGFontFaceElement.idl',
394 'svg/SVGFontFaceFormatElement.idl',
395 'svg/SVGFontFaceNameElement.idl',
396 'svg/SVGFontFaceSrcElement.idl',
397 'svg/SVGFontFaceUriElement.idl',
398 'svg/SVGForeignObjectElement.idl',
399 'svg/SVGGElement.idl',
400 'svg/SVGGlyphElement.idl',
401 'svg/SVGGradientElement.idl',
402 'svg/SVGHKernElement.idl',
403 'svg/SVGImageElement.idl',
404 'svg/SVGLangSpace.idl',
405 'svg/SVGLength.idl',
406 'svg/SVGLengthList.idl',
407 'svg/SVGLinearGradientElement.idl',
408 'svg/SVGLineElement.idl',
409 'svg/SVGLocatable.idl',
410 'svg/SVGMarkerElement.idl',
411 'svg/SVGMaskElement.idl',
412 'svg/SVGMatrix.idl',
413 'svg/SVGMetadataElement.idl',
414 'svg/SVGMissingGlyphElement.idl',
415 'svg/SVGNumber.idl',
416 'svg/SVGNumberList.idl',
417 'svg/SVGPaint.idl',
418 'svg/SVGPathElement.idl',
419 'svg/SVGPathSeg.idl',
420 'svg/SVGPathSegArcAbs.idl',
421 'svg/SVGPathSegArcRel.idl',
422 'svg/SVGPathSegClosePath.idl',
423 'svg/SVGPathSegCurvetoCubicAbs.idl',
424 'svg/SVGPathSegCurvetoCubicRel.idl',
425 'svg/SVGPathSegCurvetoCubicSmoothAbs.idl',
426 'svg/SVGPathSegCurvetoCubicSmoothRel.idl',
427 'svg/SVGPathSegCurvetoQuadraticAbs.idl',
428 'svg/SVGPathSegCurvetoQuadraticRel.idl',
429 'svg/SVGPathSegCurvetoQuadraticSmoothAbs.idl',
430 'svg/SVGPathSegCurvetoQuadraticSmoothRel.idl',
431 'svg/SVGPathSegLinetoAbs.idl',
432 'svg/SVGPathSegLinetoHorizontalAbs.idl',
433 'svg/SVGPathSegLinetoHorizontalRel.idl',
434 'svg/SVGPathSegLinetoRel.idl',
435 'svg/SVGPathSegLinetoVerticalAbs.idl',
436 'svg/SVGPathSegLinetoVerticalRel.idl',
437 'svg/SVGPathSegList.idl',
438 'svg/SVGPathSegMovetoAbs.idl',
439 'svg/SVGPathSegMovetoRel.idl',
440 'svg/SVGPatternElement.idl',
441 'svg/SVGPoint.idl',
442 'svg/SVGPointList.idl',
443 'svg/SVGPolygonElement.idl',
444 'svg/SVGPolylineElement.idl',
445 'svg/SVGPreserveAspectRatio.idl',
446 'svg/SVGRadialGradientElement.idl',
447 'svg/SVGRect.idl',
448 'svg/SVGRectElement.idl',
449 'svg/SVGRenderingIntent.idl',
450 'svg/SVGScriptElement.idl',
451 'svg/SVGSetElement.idl',
452 'svg/SVGStopElement.idl',
453 'svg/SVGStringList.idl',
454 'svg/SVGStylable.idl',
455 'svg/SVGStyleElement.idl',
456 'svg/SVGSVGElement.idl',
457 'svg/SVGSwitchElement.idl',
458 'svg/SVGSymbolElement.idl',
459 'svg/SVGTests.idl',
460 'svg/SVGTextContentElement.idl',
461 'svg/SVGTextElement.idl',
462 'svg/SVGTextPathElement.idl',
463 'svg/SVGTextPositioningElement.idl',
464 'svg/SVGTitleElement.idl',
465 'svg/SVGTransform.idl',
466 'svg/SVGTransformable.idl',
467 'svg/SVGTransformList.idl',
468 'svg/SVGTRefElement.idl',
469 'svg/SVGTSpanElement.idl',
470 'svg/SVGUnitTypes.idl',
471 'svg/SVGURIReference.idl',
472 'svg/SVGUseElement.idl',
473 'svg/SVGViewElement.idl',
474 'svg/SVGViewSpec.idl',
475 'svg/SVGZoomAndPan.idl',
476 'svg/SVGZoomEvent.idl',
477
478 'workers/Worker.idl',
479 'workers/WorkerContext.idl',
480 'workers/WorkerLocation.idl',
481
482 'xml/DOMParser.idl',
483 'xml/DOMParser.idl',
484 'xml/XMLHttpRequest.idl',
485 'xml/XMLHttpRequestException.idl',
486 'xml/XMLHttpRequestProgressEvent.idl',
487 'xml/XMLHttpRequestUpload.idl',
488 'xml/XMLSerializer.idl',
489 'xml/XPathEvaluator.idl',
490 'xml/XPathException.idl',
491 'xml/XPathExpression.idl',
492 'xml/XPathNSResolver.idl',
493 'xml/XPathResult.idl',
494 'xml/XSLTProcessor.idl',
495 ]
496
497 for name in idl_files:
498 env.Bindings('$WEBKIT_DIR/port/' + name)
499
500
501 # copy over some files
502 # TODO(eroman): can probably get rid of this.
503 i = env.Install('$SHARED_DIR', [])
504 env.Alias('webkit', i)
505
506 # HTML tag and attribute names
507 # If we add ENABLE_ flags via HTML_FLAGS, we need to pass in
508 # --extraDefines $HTML_FLAGS.
509 env.Command(['$DERIVED_DIR/HTMLNames.cpp',
510 '$DERIVED_DIR/HTMLNames.h',
511 '$DERIVED_DIR/HTMLElementFactory.cpp',
512 '$DERIVED_DIR/HTMLElementFactory.h'],
513 ['$PORT_DIR/dom/make_names.pl',
514 '$PORT_DIR/html/HTMLTagNames.in',
515 '$PORT_DIR/html/HTMLAttributeNames.in'],
516 '$PERL $_PERL_INCLUDE_FLAGS ${SOURCES[0].posix} '
517 '--tags ${SOURCES[1].posix} '
518 '--attrs ${SOURCES[2].posix} '
519 '--factory '
520 '--wrapperFactory '
521 '--outputDir $DERIVED_DIR')
522
523 env.Command(['$DERIVED_DIR/XMLNames.cpp',
524 '$DERIVED_DIR/XMLNames.h'],
525 ['$PORT_DIR/dom/make_names.pl',
526 '$PORT_DIR/xml/xmlattrs.in'],
527 '$PERL $_PERL_INCLUDE_FLAGS ${SOURCES[0].posix} '
528 '--attrs ${SOURCES[1].posix} '
529 '--outputDir $DERIVED_DIR')
530
531 env.Command(['$DERIVED_DIR/SVGElementFactory.cpp',
532 '$DERIVED_DIR/SVGElementFactory.h',
533 '$DERIVED_DIR/SVGNames.cpp',
534 '$DERIVED_DIR/SVGNames.h'],
535 ['$PORT_DIR/dom/make_names.pl',
536 '$PORT_DIR/svg/svgtags.in',
537 '$PORT_DIR/svg/svgattrs.in'],
538 '$PERL $_PERL_INCLUDE_FLAGS ${SOURCES[0].posix} '
539 '--tags ${SOURCES[1].posix} '
540 '--attrs ${SOURCES[2].posix} '
541 '--extraDefines "$SVG_FLAGS" '
542 '--factory '
543 '--wrapperFactory '
544 '--outputDir $DERIVED_DIR')
545
546 env.Command(['$DERIVED_DIR/XLinkNames.cpp',
547 '$DERIVED_DIR/XLinkNames.h'],
548 ['$PORT_DIR/dom/make_names.pl',
549 '$PORT_DIR/svg/xlinkattrs.in'],
550 '$PERL $_PERL_INCLUDE_FLAGS ${SOURCES[0].posix} '
551 '--attrs ${SOURCES[1].posix} '
552 '--outputDir $DERIVED_DIR')
553
554 # Add SVG Symbols to the WebCore exported symbols file
555 # TODO(bradnelson): fix this
556 #WebCore.exp : WebCore.base.exp WebCore.SVG.exp
557 # cat $^ > $@
558
559 def cat_files(target, source, env):
560 fout = open(str(target[0]), "w")
561 for src in source:
562 fin = open(str(src))
563 fout.writelines(fin.readlines())
564 fin.close()
565 fout.close()
566
567 env.Command(['$DERIVED_DIR/UserAgentStyleSheets.h',
568 '$DERIVED_DIR/UserAgentStyleSheetsData.cpp'],
569 ['$PORT_DIR/css/make-css-file-arrays.pl',
570 '$PORT_DIR/css/view-source.css',
571 '$PORT_DIR/css/svg.css',
572 '$PORT_DIR/css/html4.css',
573 '$PORT_DIR/css/quirks.css',
574 '$PORT_DIR/css/themeChromiumWin.css',
575 '$PORT_DIR/css/themeWinQuirks.css'],
576 '$PERL ${SOURCES[0].posix} ${TARGETS.posix} ${SOURCES[1:].posix}')
577
578 def create_h_wrapper(target, source, env):
579 """
580 Create a *.h file by surrounding the contents of a
581 yacc-generated *.hpp with a #ifndef-#define-#endif guard.
582 """
583 t = str(target[1])
584 fp = open(t, 'w')
585 define = os.path.splitext(os.path.split(t)[1])[0]
586 fp.write('#ifndef %s_h\n' % define)
587 fp.write('#define %s_h\n' % define)
588 fp.write(open(t + 'pp', 'r').read())
589 fp.write('#endif // %s_h\n' % define)
590
591 # TODO(sgk): make this a real pseudo-Builder
592 def BuildYacc(env, dir, name, file):
593 yacc_env = env.Clone()
594 yacc_env['YACC'] = env.Detect('bison') or 'yacc'
595 yacc_env.Command(['$DERIVED_DIR/%s.cpp' % file,
596 '$DERIVED_DIR/%s.h' % file],
597 ['$PORT_DIR/%s/%s.y' % (dir, file)],
598 ['$YACC -d -p %s ${SOURCES[0].posix} ' % name +
599 '-o ${TARGET.posix}',
600 Action(create_h_wrapper),
601 Delete('${TARGETS[1]}pp')])
602
603 BuildYacc(env, 'xml', 'xpathyy', 'XPathGrammar')
604 BuildYacc(env, 'css', 'cssyy', 'CSSGrammar')
605
606 # TODO(bradnelson): need to add in error checking
607
608 env.Command('$PORT_DIR/SVGCSSValueKeywords.in',
609 '$PORT_DIR/css/SVGCSSValueKeywords.in',
610 '$PERL -ne "print lc" $SOURCES > $TARGET')
611
612 env.Command('$PORT_DIR/CSSValueKeywords.in',
613 ['$PORT_DIR/css/CSSValueKeywords.in',
614 '$PORT_DIR/css/SVGCSSValueKeywords.in'],
615 '$PERL -ne "print lc" $SOURCES > $TARGET')
616
617 env.Command('$PORT_DIR/CSSPropertyNames.in',
618 ['$PORT_DIR/css/CSSPropertyNames.in',
619 '$PORT_DIR/css/SVGCSSPropertyNames.in'],
620 '$PERL -ne "print lc" $SOURCES > $TARGET')
621
622 env.Command(['$DERIVED_DIR/CSSValueKeywords.c',
623 '$DERIVED_DIR/CSSValueKeywords.h'],
624 ['$PORT_DIR/css/makevalues.pl',
625 '$PORT_DIR/CSSValueKeywords.in'],
626 ['cd ${SOURCES[1].dir} && $PERL ${str(SOURCES[0].abspath).replace("\ \\\", "/")}',
627 Move('${TARGETS[0]}', '${SOURCES[1].dir}/${TARGETS[0].file}'),
628 Move('${TARGETS[1]}', '${SOURCES[1].dir}/${TARGETS[1].file}'),
629 ])
630
631 env.Command(['$DERIVED_DIR/CSSPropertyNames.cpp',
632 '$DERIVED_DIR/CSSPropertyNames.h'],
633 ['$PORT_DIR/css/makeprop.pl',
634 '$PORT_DIR/CSSPropertyNames.in'],
635 ['cd ${SOURCES[1].dir} && $PERL ${str(SOURCES[0].abspath).replace("\ \\\", "/")}',
636 Move('${TARGETS[0]}', '${SOURCES[1].dir}/${TARGETS[0].file}'),
637 Move('${TARGETS[1]}', '${SOURCES[1].dir}/${TARGETS[1].file}'),
638 ])
639
640
641 # DOCTYPE strings
642 env.Command('$DERIVED_DIR/DocTypeStrings.cpp',
643 '$PORT_DIR/html/DocTypeStrings.gperf',
644 'gperf -CEot -L ANSI-C -k "*" -N findDoctypeEntry -F ' + \
645 ',PubIDInfo::eAlmostStandards,PubIDInfo::eAlmostStandards ' + \
646 '$SOURCE > $TARGET')
647
648 # color names
649 env.Command('$DERIVED_DIR/ColorData.c',
650 '$PORT_DIR/platform/ColorData.gperf',
651 'gperf -CDEot -L ANSI-C -k "*" -N findColor -D -s 2 ' + \
652 '$SOURCE > $TARGET')
653
654 # HTML entity names
655 env.Command('$DERIVED_DIR/HTMLEntityNames.c',
656 '$PORT_DIR/html/HTMLEntityNames.gperf',
657 'gperf -a -L ANSI-C -C -G -c -o -t -k "*" -N findEntity ' + \
658 '-D -s 2 $SOURCE > $TARGET')
659
660 # CSS tokenizer
661 env.Command('$DERIVED_DIR/tokenizer.cpp',
662 ['$PORT_DIR/css/tokenizer.flex',
663 '$PORT_DIR/css/maketokenizer'],
664 'flex --nowarn -t $SOURCE | perl ${SOURCES[1]} > $TARGET')
OLDNEW
« no previous file with comments | « webkit/build/WebKit/SConscript ('k') | webkit/build/webkit_resources/SConscript » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698