Skip to content

Commit 29fdd30

Browse files
Use perl instead of Revolution for source generation
1 parent edab797 commit 29fdd30

22 files changed

Lines changed: 3806 additions & 68 deletions

common.gypi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
'config/crosscompile.gypi',
88
'config/exclusions.gypi',
99
'config/paths.gypi',
10-
'config/revolution.gypi',
10+
'config/perl.gypi',
1111
'config/target_os.gypi',
1212
'config/thirdparty.gypi',
1313
],

config/arch.gypi

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,5 +61,7 @@
6161
},
6262

6363
'target_arch%': '<(host_arch)',
64+
'host_arch': '<(host_arch)',
65+
'host_os': '<(host_os)',
6466
},
6567
}

config/perl.gypi

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
'variables':
3+
{
4+
'conditions':
5+
[
6+
[
7+
'host_os == "win"',
8+
{
9+
'perl': [ 'C:/perl/bin/perl.exe' ],
10+
},
11+
{
12+
'perl': [ 'perl' ],
13+
},
14+
],
15+
],
16+
},
17+
}

config/revolution.gypi

Lines changed: 0 additions & 30 deletions
This file was deleted.

engine/engine.gyp

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
'action_name': 'encode_version',
2323
'inputs':
2424
[
25-
'encode_version.rev',
25+
'../util/encode_version.pl',
2626
'../version',
2727
'include/revbuild.h.in',
2828
],
@@ -33,8 +33,8 @@
3333

3434
'action':
3535
[
36-
'<(revolution_path)',
37-
'encode_version.rev',
36+
'<@(perl)',
37+
'../util/encode_version.pl',
3838
'.',
3939
'<(SHARED_INTERMEDIATE_DIR)',
4040
],
@@ -60,7 +60,7 @@
6060
'action_name': 'quicktime_stubs',
6161
'inputs':
6262
[
63-
'../tools/weak_stub_maker.lc',
63+
'../util/weak_stub_maker.pl',
6464
'src/quicktime.stubs',
6565
],
6666
'outputs':
@@ -70,8 +70,8 @@
7070

7171
'action':
7272
[
73-
'<(revolution_path)',
74-
'../tools/weak_stub_maker.lc',
73+
'<@(perl)',
74+
'../util/weak_stub_maker.pl',
7575
'src/quicktime.stubs',
7676
'<@(_outputs)',
7777
],
@@ -89,7 +89,7 @@
8989
'action_name': 'encode_environment_stack',
9090
'inputs':
9191
[
92-
'compress_data.rev',
92+
'../util/compress_data.pl',
9393
'src/Environment.rev',
9494
],
9595
'outputs':
@@ -99,8 +99,8 @@
9999

100100
'action':
101101
[
102-
'<(revolution_path)',
103-
'compress_data.rev',
102+
'<@(perl)',
103+
'../util/compress_data.pl',
104104
'src/Environment.rev',
105105
'<@(_outputs)',
106106
# Really nasty hack to prevent this from being treated as a path

engine/kernel-mode-template.gypi

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,16 @@
11
{
2+
'includes':
3+
[
4+
'../util/perfect/perfect.gyp',
5+
],
6+
27
'dependencies':
38
[
49
'encode_version',
5-
10+
611
'../libcore/libcore.gyp:libCore',
712
'../libgraphics/libgraphics.gyp:libGraphics',
13+
'../util/perfect/perfect.gyp:perfect',
814
],
915

1016
'include_dirs':
@@ -29,7 +35,7 @@
2935

3036
'inputs':
3137
[
32-
'encode_errors.rev',
38+
'../util/encode_errors.pl',
3339
'src/executionerrors.h',
3440
'src/parseerrors.h',
3541
],
@@ -40,8 +46,8 @@
4046

4147
'action':
4248
[
43-
'<(revolution_path)',
44-
'encode_errors.rev',
49+
'<@(perl)',
50+
'../util/encode_errors.pl',
4551
'./src',
4652
'<@(_outputs)',
4753
],
@@ -51,7 +57,8 @@
5157

5258
'inputs':
5359
[
54-
'hash_strings.rev',
60+
'../util/hash_strings.pl',
61+
'<(perfect_name)',
5562

5663
# It really does depend on this but gyp doesn't compile sources listed as action inputs...
5764
#'src/lextable.cpp',
@@ -63,11 +70,11 @@
6370

6471
'action':
6572
[
66-
'<(revolution_path)',
67-
'hash_strings.rev',
73+
'<@(perl)',
74+
'../util/hash_strings.pl',
6875
'./src/lextable.cpp',
6976
'<@(_outputs)',
70-
'<(perfect_path)',
77+
'<(perfect_name)',
7178
],
7279
},
7380
],

engine/kernel-server.gypi

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@
118118
'action_name': 'linux_library_stubs',
119119
'inputs':
120120
[
121-
'../tools/weak_stub_maker.lc',
121+
'../util/weak_stub_maker.pl',
122122
'src/linux.stubs',
123123
],
124124
'outputs':
@@ -128,8 +128,8 @@
128128

129129
'action':
130130
[
131-
'<(revolution_path)',
132-
'../tools/weak_stub_maker.lc',
131+
'<@(perl)',
132+
'../util/weak_stub_maker.pl',
133133
'src/linux.stubs',
134134
'<@(_outputs)',
135135
],

engine/kernel.gypi

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@
151151
'action_name': 'linux_library_stubs',
152152
'inputs':
153153
[
154-
'../tools/weak_stub_maker.lc',
154+
'../util/weak_stub_maker.pl',
155155
'src/linux.stubs',
156156
],
157157
'outputs':
@@ -161,8 +161,8 @@
161161

162162
'action':
163163
[
164-
'<(revolution_path)',
165-
'../tools/weak_stub_maker.lc',
164+
'<@(perl)',
165+
'../util/weak_stub_maker.pl',
166166
'src/linux.stubs',
167167
'<@(_outputs)',
168168
],

thirdparty

util/build_libinfo.pl

Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
#!/usr/bin/env perl
2+
3+
use warnings;
4+
5+
sub trim
6+
{
7+
my $trim = $_[0];
8+
$trim =~ s/^\s+|\s+$// ;
9+
return $trim;
10+
}
11+
12+
# Predeclarations
13+
sub output;
14+
15+
# Parameters
16+
my $name = $ARGV[0];
17+
18+
# Read in from stdin
19+
my @spec = <STDIN>;
20+
21+
# Prefix for symbols
22+
my $prefix = "";
23+
if (defined $ARGV[0] and $ARGV[0] ne "")
24+
{
25+
$prefix = $ARGV[0];
26+
}
27+
28+
# Output variables
29+
my $symbolExterns = "";
30+
my $symbolEntries = "";
31+
32+
foreach my $line (@spec)
33+
{
34+
# Ignore empty lines
35+
if ($line =~ /^\s*$/)
36+
{
37+
next;
38+
}
39+
40+
# Ignore comment lines
41+
if ($line =~ /^\s*#/)
42+
{
43+
next;
44+
}
45+
46+
# Ignore lines defining modules (we only care about symbols)
47+
if (substr($line, 0, 1) ne "\t")
48+
{
49+
next;
50+
}
51+
52+
# Skip the tab character
53+
substr($line, 0, 1) = "";
54+
trim($line);
55+
56+
# Handle optional symbols
57+
my $symbol = undef;
58+
my @words = split('\s+', $line);
59+
if (substr($line, 0, 1) eq "?")
60+
{
61+
$symbol = $words[1];
62+
}
63+
else
64+
{
65+
$symbol = $words[0];
66+
}
67+
68+
# Remove any trailing colons
69+
$symbol =~ s/:$// ;
70+
71+
$symbolExterns .= "extern \"C\" void *$symbol;\n";
72+
$symbolEntries .= " { \"$symbol\", $symbol },\n";
73+
}
74+
75+
print STDOUT $symbolExterns;
76+
output "struct LibExport { const char *name; void *address; };";
77+
output "struct LibInfo { const char **name; struct LibExport *exports; };";
78+
output "static const char *__libexternalname = \"$name\";";
79+
output "static struct LibExport __libexports[] =";
80+
output "{";
81+
print STDOUT $symbolEntries;
82+
output " { 0, 0 }";
83+
output "};";
84+
output "static struct LibInfo __libinfo=";
85+
output "{";
86+
output " &__libexternalname,";
87+
output " __libexports";
88+
output "};";
89+
output "LibInfo *__libinfoptr_$name = &__libinfo;";
90+
91+
sub output
92+
{
93+
my $line = $_[0];
94+
if (@_ != 1)
95+
{
96+
$line = "";
97+
}
98+
99+
print STDOUT "$line\n";
100+
}

0 commit comments

Comments
 (0)