From 7cbba7ff7a02445684b3b7b344da5352ee57ca38 Mon Sep 17 00:00:00 2001 From: "jchaffraix@webkit.org" Date: Thu, 8 May 2008 23:59:39 +0000 Subject: [PATCH] 2008-05-08 Julien Chaffraix Reviewed by Eric. Bug 18916: make_names.pl --factory needs to support custom c++ guard Add --guardFactoryWith to handle the cpp guard around generated factories. * DerivedSources.make: Set the guardFactoryWith variable for SVG factory. * GNUmakefile.am: Ditto. * WebCore.pro: Ditto. * dom/make_names.pl: Add guardFactoryWith option. git-svn-id: https://svn.webkit.org/repository/webkit/trunk@32989 268f45cc-cd09-0410-ab3c-d52691b4dbfc --- WebCore/ChangeLog | 13 +++++++++++++ WebCore/DerivedSources.make | 4 ++-- WebCore/GNUmakefile.am | 4 ++-- WebCore/WebCore.pro | 2 +- WebCore/dom/make_names.pl | 36 ++++++++++++++++++++++++++++-------- 5 files changed, 46 insertions(+), 13 deletions(-) diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog index 8f71f1a..86090af 100644 --- a/WebCore/ChangeLog +++ b/WebCore/ChangeLog @@ -1,5 +1,18 @@ 2008-05-08 Julien Chaffraix + Reviewed by Eric. + + Bug 18916: make_names.pl --factory needs to support custom c++ guard + + Add --guardFactoryWith to handle the cpp guard around generated factories. + + * DerivedSources.make: Set the guardFactoryWith variable for SVG factory. + * GNUmakefile.am: Ditto. + * WebCore.pro: Ditto. + * dom/make_names.pl: Add guardFactoryWith option. + +2008-05-08 Julien Chaffraix + Reviewed by Adam Roben. wx & Gtk build fix. diff --git a/WebCore/DerivedSources.make b/WebCore/DerivedSources.make index c96c7f2f3..cbdc359 100644 --- a/WebCore/DerivedSources.make +++ b/WebCore/DerivedSources.make @@ -546,12 +546,12 @@ ifdef SVG_FLAGS SVGElementFactory.cpp SVGNames.cpp : dom/make_names.pl svg/svgtags.in svg/svgattrs.in perl $< --tags $(WebCore)/svg/svgtags.in --attrs $(WebCore)/svg/svgattrs.in --extraDefines "$(SVG_FLAGS)" \ - --namespace SVG --cppNamespace WebCore --namespaceURI "http://www.w3.org/2000/svg" --factory --attrsNullNamespace --output . + --namespace SVG --guardFactoryWith "ENABLE(SVG)" --cppNamespace WebCore --namespaceURI "http://www.w3.org/2000/svg" --factory --attrsNullNamespace --output . else SVGElementFactory.cpp SVGNames.cpp : dom/make_names.pl svg/svgtags.in svg/svgattrs.in perl $< --tags $(WebCore)/svg/svgtags.in --attrs $(WebCore)/svg/svgattrs.in \ - --namespace SVG --cppNamespace WebCore --namespaceURI "http://www.w3.org/2000/svg" --factory --attrsNullNamespace --output . + --namespace SVG --guardFactoryWith "ENABLE(SVG)" --cppNamespace WebCore --namespaceURI "http://www.w3.org/2000/svg" --factory --attrsNullNamespace --output . endif diff --git a/WebCore/GNUmakefile.am b/WebCore/GNUmakefile.am index eb6ad29..199326a 100644 --- a/WebCore/GNUmakefile.am +++ b/WebCore/GNUmakefile.am @@ -2105,10 +2105,10 @@ DerivedSources/SVGNames.cpp: DerivedSources/SVGElementFactory.cpp; if SVG_FLAGS DerivedSources/SVGElementFactory.cpp: $(WebCore)/dom/make_names.pl $(WebCore)/svg/svgtags.in $(WebCore)/svg/svgattrs.in $(PERL) $< --tags $(WebCore)/svg/svgtags.in --attrs $(WebCore)/svg/svgattrs.in --extraDefines "$(SVG_FEATURES)" \ - --namespace SVG --cppNamespace WebCore --namespaceURI "http://www.w3.org/2000/svg" --factory --attrsNullNamespace --output $(GENSOURCES) + --namespace SVG --guardFactoryWith "ENABLE(SVG)" --cppNamespace WebCore --namespaceURI "http://www.w3.org/2000/svg" --factory --attrsNullNamespace --output $(GENSOURCES) else DerivedSources/SVGElementFactory.cpp: $(WebCore)/dom/make_names.pl $(WebCore)/svg/svgtags.in $(WebCore)/svg/svgattrs.in - $(PERL) $< --tags $(WebCore)/svg/svgtags.in --attrs $(WebCore)/svg/svgattrs.in --namespace SVG --cppNamespace WebCore --namespaceURI "http://www.w3.org/2000/svg" --factory --attrsNullNamespace --output $(GENSOURCES) + $(PERL) $< --tags $(WebCore)/svg/svgtags.in --attrs $(WebCore)/svg/svgattrs.in --namespace SVG --guardFactoryWith "ENABLE(SVG)" --cppNamespace WebCore --namespaceURI "http://www.w3.org/2000/svg" --factory --attrsNullNamespace --output $(GENSOURCES) endif # SVG_FLAGS diff --git a/WebCore/WebCore.pro b/WebCore/WebCore.pro index f057a90..a80cffb 100644 --- a/WebCore/WebCore.pro +++ b/WebCore/WebCore.pro @@ -1758,7 +1758,7 @@ gtk-port:SOURCES += \ # GENERATOR 5-C: svgnames_a.output = $$GENERATED_SOURCES_DIR/SVGNames.cpp - svgnames_a.commands = perl $$PWD/dom/make_names.pl --tags $$PWD/svg/svgtags.in --attrs $$PWD/svg/svgattrs.in --extraDefines \"$${DEFINES}\" --namespace SVG --cppNamespace WebCore --namespaceURI 'http://www.w3.org/2000/svg' --factory --attrsNullNamespace --preprocessor \"$${QMAKE_MOC} -E\" --output $$GENERATED_SOURCES_DIR + svgnames_a.commands = perl $$PWD/dom/make_names.pl --tags $$PWD/svg/svgtags.in --attrs $$PWD/svg/svgattrs.in --extraDefines \"$${DEFINES}\" --namespace SVG --guardFactoryWith \"ENABLE(SVG)\" --cppNamespace WebCore --namespaceURI 'http://www.w3.org/2000/svg' --factory --attrsNullNamespace --preprocessor \"$${QMAKE_MOC} -E\" --output $$GENERATED_SOURCES_DIR svgnames_a.input = SVG_NAMES svgnames_a.dependency_type = TYPE_C svgnames_a.CONFIG = target_predeps diff --git a/WebCore/dom/make_names.pl b/WebCore/dom/make_names.pl index b89579b..6ccba87 100755 --- a/WebCore/dom/make_names.pl +++ b/WebCore/dom/make_names.pl @@ -45,6 +45,7 @@ my $tagsNullNamespace = 0; my $attrsNullNamespace = 0; my $extraDefines = 0; my $preprocessor = "/usr/bin/gcc -E -P -x c++"; +my $guardFactoryWith = 0; GetOptions('tags=s' => \$tagsFile, 'attrs=s' => \$attrsFile, @@ -57,7 +58,8 @@ GetOptions('tags=s' => \$tagsFile, 'tagsNullNamespace' => \$tagsNullNamespace, 'attrsNullNamespace' => \$attrsNullNamespace, 'extraDefines=s' => \$extraDefines, - 'preprocessor=s' => \$preprocessor); + 'preprocessor=s' => \$preprocessor, + 'guardFactoryWith=s' => \$guardFactoryWith); die "You must specify a namespace (e.g. SVG) for Names.h" unless $namespace; die "You must specify a namespaceURI (e.g. http://www.w3.org/2000/svg)" unless $namespaceURI; @@ -119,7 +121,7 @@ sub printMacros sub printConstructors { my ($F, @names) = @_; - print F "#if ENABLE(SVG)\n"; + print F "#if $guardFactoryWith\n" if $guardFactoryWith; for my $name (@names) { my $upperCase = upperCaseName($name); @@ -128,7 +130,7 @@ sub printConstructors print F " return new ${namespace}${upperCase}Element(${name}Tag, doc);\n"; print F "}\n\n"; } - print F "#endif\n"; + print F "#endif\n" if $guardFactoryWith; } sub printFunctionInits @@ -407,8 +409,9 @@ END printConstructors($F, @tags); +print F "#if $guardFactoryWith\n" if $guardFactoryWith; + print F <