Commit ffa1b5cb authored by hausmann's avatar hausmann
Browse files

Added custom preprocessor support to make_names.pl and use the moc for it in the Qt build.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@24701 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 8496e302
2007-07-27 Simon Hausmann <hausmann@kde.org>
Done with and reviewed by Lars and Zack.
Added custom preprocessor support to make_names.pl and use the moc for it in the Qt build.
* WebCore.pro:
* ksvg2/scripts/make_names.pl:
2007-07-27 Simon Hausmann <hausmann@kde.org>
 
Done with and reviewed by Lars and Zack.
......@@ -1268,7 +1268,7 @@ gdk-port:SOURCES += \
# GENERATOR 5-C:
svgnames_a.output = tmp/SVGNames.cpp
svgnames_a.commands = perl $$PWD/ksvg2/scripts/make_names.pl --tags $$PWD/ksvg2/svg/svgtags.in --attrs $$PWD/ksvg2/svg/svgattrs.in --namespace SVG --cppNamespace WebCore --namespaceURI 'http://www.w3.org/2000/svg' --factory --attrsNullNamespace --output tmp
svgnames_a.commands = perl $$PWD/ksvg2/scripts/make_names.pl --tags $$PWD/ksvg2/svg/svgtags.in --attrs $$PWD/ksvg2/svg/svgattrs.in --namespace SVG --cppNamespace WebCore --namespaceURI 'http://www.w3.org/2000/svg' --factory --attrsNullNamespace --preprocessor \"$${QMAKE_MOC} -E\" --output tmp
svgnames_a.input = SVG_NAMES
svgnames_a.dependency_type = TYPE_C
svgnames_a.CONFIG = target_predeps
......@@ -1286,7 +1286,7 @@ gdk-port:SOURCES += \
# GENERATOR 5-D:
xlinknames.output = tmp/XLinkNames.cpp
xlinknames.commands = perl $$PWD/ksvg2/scripts/make_names.pl --attrs $$PWD/ksvg2/misc/xlinkattrs.in --namespace XLink --cppNamespace WebCore --namespaceURI 'http://www.w3.org/1999/xlink' --output tmp
xlinknames.commands = perl $$PWD/ksvg2/scripts/make_names.pl --attrs $$PWD/ksvg2/misc/xlinkattrs.in --namespace XLink --cppNamespace WebCore --namespaceURI 'http://www.w3.org/1999/xlink' --preprocessor \"$${QMAKE_MOC} -E\" --output tmp
xlinknames.input = XLINK_NAMES
xlinknames.dependency_type = TYPE_C
xlinknames.CONFIG = target_predeps
......@@ -1349,7 +1349,7 @@ QMAKE_EXTRA_TARGETS += grammar_h_dep
# GENERATOR 5-A:
htmlnames.output = tmp/HTMLNames.cpp
htmlnames.commands = perl $$PWD/ksvg2/scripts/make_names.pl --tags $$PWD/html/HTMLTagNames.in --attrs $$PWD/html/HTMLAttributeNames.in --namespace HTML --namespacePrefix xhtml --cppNamespace WebCore --namespaceURI 'http://www.w3.org/1999/xhtml' --attrsNullNamespace --output tmp
htmlnames.commands = perl $$PWD/ksvg2/scripts/make_names.pl --tags $$PWD/html/HTMLTagNames.in --attrs $$PWD/html/HTMLAttributeNames.in --namespace HTML --namespacePrefix xhtml --cppNamespace WebCore --namespaceURI 'http://www.w3.org/1999/xhtml' --attrsNullNamespace --preprocessor \"$${QMAKE_MOC} -E\" --output tmp
htmlnames.input = HTML_NAMES
htmlnames.dependency_type = TYPE_C
htmlnames.CONFIG = target_predeps
......@@ -1359,7 +1359,7 @@ QMAKE_EXTRA_COMPILERS += htmlnames
# GENERATOR 5-B:
xmlnames.output = tmp/XMLNames.cpp
xmlnames.commands = perl $$PWD/ksvg2/scripts/make_names.pl --attrs $$PWD/xml/xmlattrs.in --namespace XML --cppNamespace WebCore --namespaceURI 'http://www.w3.org/XML/1998/namespace' --output tmp
xmlnames.commands = perl $$PWD/ksvg2/scripts/make_names.pl --attrs $$PWD/xml/xmlattrs.in --namespace XML --cppNamespace WebCore --namespaceURI 'http://www.w3.org/XML/1998/namespace' --preprocessor \"$${QMAKE_MOC} -E\" --output tmp
xmlnames.input = XML_NAMES
xmlnames.dependency_type = TYPE_C
xmlnames.CONFIG = target_predeps
......
......@@ -29,6 +29,7 @@
use strict;
use Getopt::Long;
use File::Path;
use Config;
my $printFactory = 0;
my $cppNamespace = "";
......@@ -43,6 +44,7 @@ my @attrs = ();
my $tagsNullNamespace = 0;
my $attrsNullNamespace = 0;
my $extraDefines = 0;
my $preprocessor = "/usr/bin/gcc -E -P -x c++";
GetOptions('tags=s' => \$tagsFile,
'attrs=s' => \$attrsFile,
......@@ -54,7 +56,8 @@ GetOptions('tags=s' => \$tagsFile,
'factory' => \$printFactory,
'tagsNullNamespace' => \$tagsNullNamespace,
'attrsNullNamespace' => \$attrsNullNamespace,
'extraDefines=s' => \$extraDefines);
'extraDefines=s' => \$extraDefines,
'preprocessor=s' => \$preprocessor);
die "You must specify a namespace (e.g. SVG) for <namespace>Names.h" unless $namespace;
die "You must specify a namespaceURI (e.g. http://www.w3.org/2000/svg)" unless $namespaceURI;
......@@ -85,9 +88,9 @@ sub readNames
my $namesFile = shift;
if ($extraDefines eq 0) {
die "Failed to open file: $namesFile" unless open NAMES, "-|", "/usr/bin/gcc", "-E", "-P", "-x", "c++", $namesFile or die;
die "Failed to open file: $namesFile" unless open NAMES, $preprocessor . " " . $namesFile . "|" or die;
} else {
die "Failed to open file: $namesFile" unless open NAMES, "-|", "/usr/bin/gcc", "-E", "-P", "-x", "c++", "-D", "$extraDefines", $namesFile or die;
die "Failed to open file: $namesFile" unless open NAMES, $preprocessor . " -D" . $extraDefines . " " . $namesFile . "|" or die;
}
my @names = ();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment