зеркало из https://github.com/mozilla/pjs.git
Made it build and work on linux
This commit is contained in:
Родитель
83e77accb1
Коммит
96908e6611
|
@ -24,20 +24,25 @@ include $(DEPTH)/config/autoconf.mk
|
|||
|
||||
TARGETS = generated
|
||||
|
||||
|
||||
CPPSRCS = nsCSSProps.cpp nsCSSKeywords.cpp nsColorNames.cpp
|
||||
|
||||
include $(topsrcdir)/config/config.mk
|
||||
HEADERS = nsCSSPropIDs.h nsCSSKeywordIDs.h nsColorNameIDs.h
|
||||
|
||||
# XXX copy this to a shared config file for raptor
|
||||
#PERL = /usr/sbin/perl
|
||||
GENHASH_PL = $(srcdir)/genhash.pl
|
||||
GENHASH_INC = genhash.inc
|
||||
GENHASH = $(PERL) $(GENHASH_PL)
|
||||
|
||||
include $(topsrcdir)/config/config.mk
|
||||
|
||||
include $(topsrcdir)/config/rules.mk
|
||||
|
||||
all:: $(CPPSRCS)
|
||||
|
||||
export:: $(CPPSRCS)
|
||||
|
||||
clobber::
|
||||
rm -f $(CPPSRCS) $(HEADERS) nsColorNamesRGB.cpp
|
||||
|
||||
nsCSSProps.cpp: $(GENHASH_PL) $(GENHASH_INC) CSSProps.txt Makefile
|
||||
$(GENHASH) "1,2,6,8,12" "-r" nsCSSProps PROP_ CSSProps.txt nsCSSPropIDs.h > nsCSSProps.cpp
|
||||
cp nsCSSProps.cpp nsCSSPropIDs.h ../html/style/src
|
||||
|
|
|
@ -22,9 +22,15 @@ $prefix = @ARGV[3];
|
|||
$props = @ARGV[4];
|
||||
$ids = @ARGV[5];
|
||||
|
||||
# print "/* klist=$klist */\n";
|
||||
# print "/* gperfopts=$gperfopts */\n";
|
||||
# print "/* clazz=$clazz */\n";
|
||||
# print "/* prefix=$prefix */\n";
|
||||
# print "/* props=$props */\n";
|
||||
# print "/* ids=$ids */\n";
|
||||
|
||||
open(NAMES_FILE, "<$props");
|
||||
open(HASH, "|/tools/ns/bin/gperf -T -t -l $gperfopts -NHashFunc -p -k$klist,\$ > gperf.out.$$");
|
||||
open(HASH, "|gperf -7 -T -t -l $gperfopts -NHashFunc -p -k$klist,\$ > gperf.out.$$");
|
||||
|
||||
# NOTE: the decl here needs to match the TAG_TABLE rules in genhash.inc!!!
|
||||
print HASH 'struct StaticNameTable { char *name; int id; };
|
||||
|
@ -62,9 +68,9 @@ unlink("gperf.out.$$");
|
|||
open(T, "<genhash.inc");
|
||||
|
||||
while (<T>) {
|
||||
if (/^@begin/) {
|
||||
if (/^\@begin/) {
|
||||
($name, $start, $end) =
|
||||
m#@begin[ ]*([A-Za-z0-9_]+)[ ]*/([^/]*)/[ ]*/([^/]*)/#;
|
||||
m#\@begin[ ]*([A-Za-z0-9_]+)[ ]*/([^/]*)/[ ]*/([^/]*)/#;
|
||||
$line = <C> until (eof(C) || $line =~ /$start/);
|
||||
if ($line =~ /$start/) {
|
||||
$template{$name} .= $line;
|
||||
|
@ -73,16 +79,16 @@ while (<T>) {
|
|||
$template{$name} .= $line;
|
||||
} until ($line =~ /$end/ || eof(C));
|
||||
}
|
||||
} elsif (/^@include/) {
|
||||
($name) = /@include[ ]*(.*)$/;
|
||||
} elsif (/^\@include/) {
|
||||
($name) = /\@include[ ]*(.*)$/;
|
||||
print $template{$name};
|
||||
} elsif (/^@sub/) {
|
||||
} elsif (/^\@sub/) {
|
||||
($name, $old, $new) =
|
||||
m#@sub[ ]*([A-Za-z0-9_]*)[ ]/([^/]*)/([^/]*)/#;
|
||||
m#\@sub[ ]*([A-Za-z0-9_]*)[ ]/([^/]*)/([^/]*)/#;
|
||||
$template{$name} =~ s/$old/$new/g;
|
||||
} elsif (/^@classfunc/) {
|
||||
print "PRInt32 $clazz::LookupName(const char* str)\n";
|
||||
} elsif (/^@classincl/) {
|
||||
} elsif (/^\@classfunc/) {
|
||||
print "PRInt32 $clazz\:\:LookupName(const char* str)\n";
|
||||
} elsif (/^\@classincl/) {
|
||||
print "#include \"$clazz.h\"\n";
|
||||
} elsif (/^@/) {
|
||||
;
|
||||
|
@ -92,7 +98,7 @@ while (<T>) {
|
|||
}
|
||||
|
||||
# Print out tag name table at the end
|
||||
print "\nconst $clazz::NameTableEntry $clazz::kNameTable[] = {\n";
|
||||
print "\nconst $clazz\:\:NameTableEntry $clazz\:\:kNameTable\[\] = {\n";
|
||||
for ($i = 0; $i < $nextval; $i++) {
|
||||
$val = $vals[$i];
|
||||
$newval = $val;
|
||||
|
|
Загрузка…
Ссылка в новой задаче