Commit c2ae5a59 authored by hausmann's avatar hausmann
Browse files

Fix cssmakeprops and cssmakevalue scripts to work on Windows without cygwin...

Fix cssmakeprops and cssmakevalue scripts to work on Windows without cygwin perl. Avoid inplace substitutions and direct invocation of /bin/sh. Also call gperf with arguments that GnuWin32's gperf understands.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@24684 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 7a0f9535
2007-07-27 Simon Hausmann <hausmann@kde.org>
Done with and reviewed by Lars and Zack.
Fix cssmakeprops and cssmakevalue scripts to work on Windows without cygwin perl. Avoid inplace substitutions and direct invocation of /bin/sh. Also call gperf with arguments that GnuWin32's gperf understands.
* ksvg2/scripts/cssmakeprops:
* ksvg2/scripts/cssmakevalues:
2007-07-27 Simon Hausmann <hausmann@kde.org>
 
Done with and reviewed by Lars and Zack.
......@@ -107,19 +107,28 @@ print HEADER "}\n";
print HEADER "\n#endif\n";
close HEADER;
my $result = system("/bin/sh", "-c", "gperf -c -a -L 'ANSI-C' -G -D -E -C -o -t -k '*' -Nfind${ns}Prop -Hhash_prop -Wwordlist_prop -D -s 3 $filegperf > $filec");
my $result = system("gperf -c -a -L ANSI-C -G -D -E -C -o -t --key-positions=\"*\" -Nfind${ns}Prop -Hhash_prop -Wwordlist_prop -D -s 3 $filegperf > $filec");
if ($result) {
unlink "$filec";
exit $result;
}
# Avoid clashes in parser.cpp, which includes both CSSValueKeywords.c & CSSPropertyNames.c
system("/bin/sh", "-c", "perl -pi -e \"s/TOTAL_KEYWORDS/PROP_TOTAL_KEYWORDS/g\" $filec");
system("/bin/sh", "-c", "perl -pi -e \"s/MIN_WORD_LENGTH/PROP_MIN_WORD_LENGTH/g\" $filec");
system("/bin/sh", "-c", "perl -pi -e \"s/MAX_WORD_LENGTH/PROP_MAX_WORD_LENGTH/g\" $filec");
system("/bin/sh", "-c", "perl -pi -e \"s/MIN_HASH_VALUE/PROP_MIN_HASH_VALUE/g\" $filec");
system("/bin/sh", "-c", "perl -pi -e \"s/MAX_HASH_VALUE/PROP_MAX_HASH_VALUE/g\" $filec");
system("/bin/sh", "-c", "perl -pi -e \"s/lookup/lookupProp/g\" $filec");
open F, "<$filec";
my $tmp = "";
while (<F>) {
s/TOTAL_KEYWORDS/PROP_TOTAL_KEYWORDS/;
s/MIN_WORD_LENGTH/PROP_MIN_WORD_LENGTH/;
s/MAX_WORD_LENGTH/PROP_MAX_WORD_LENGTH/;
s/MIN_HASH_VALUE/PROP_MIN_HASH_VALUE/;
s/MAX_HASH_VALUE/PROP_MAX_HASH_VALUE/;
s/lookup/lookupProp/g;
$tmp = $tmp . $_;
}
close F;
open F, ">$filec";
print F $tmp;
close F;
# read the hash mappings (is there a better way?)
my %hmap = ();
......
......@@ -108,19 +108,28 @@ print HEADER "}\n";
print HEADER "\n#endif\n";
close HEADER;
my $result = system("/bin/sh", "-c", "gperf -c -a -L 'ANSI-C' -G -D -E -C -o -t -k '*' -Nfind${ns}Val -Hhash_val -Wwordlist_val -D -s 3 $filegperf > $filec");
my $result = system("gperf -c -a -L ANSI-C -G -D -E -C -o -t --key-positions=\"*\" -Nfind${ns}Val -Hhash_val -Wwordlist_val -D -s 3 $filegperf > $filec");
if ($result) {
unlink "$filec";
exit $result;
}
# Avoid clashes in parser.cpp, which includes both CSSValueKeywords.c & CSSPropertyNames.c
system("/bin/sh", "-c", "perl -pi -e \"s/TOTAL_KEYWORDS/VAL_TOTAL_KEYWORDS/g\" $filec");
system("/bin/sh", "-c", "perl -pi -e \"s/MIN_WORD_LENGTH/VAL_MIN_WORD_LENGTH/g\" $filec");
system("/bin/sh", "-c", "perl -pi -e \"s/MAX_WORD_LENGTH/VAL_MAX_WORD_LENGTH/g\" $filec");
system("/bin/sh", "-c", "perl -pi -e \"s/MIN_HASH_VALUE/VAL_MIN_HASH_VALUE/g\" $filec");
system("/bin/sh", "-c", "perl -pi -e \"s/MAX_HASH_VALUE/VAL_MAX_HASH_VALUE/g\" $filec");
system("/bin/sh", "-c", "perl -pi -e \"s/lookup/lookupVal/g\" $filec");
open F, "<$filec";
my $tmp = "";
while (<F>) {
s/TOTAL_KEYWORDS/VAL_TOTAL_KEYWORDS/;
s/MIN_WORD_LENGTH/VAL_MIN_WORD_LENGTH/;
s/MAX_WORD_LENGTH/VAL_MAX_WORD_LENGTH/;
s/MIN_HASH_VALUE/VAL_MIN_HASH_VALUE/;
s/MAX_HASH_VALUE/VAL_MAX_HASH_VALUE/;
s/lookup/lookupVal/g;
$tmp = $tmp . $_;
}
close F;
open F, ">$filec";
print F $tmp;
close F;
# read the hash mappings (is there a better way?)
my %hmap = ();
......
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