Commit | Line | Data |
918c0b2d |
1 | # Do not remove the following line; MakeMaker relies on it to identify |
2 | # this file as a template for defsubs.h |
3 | # Extracting defsubs.h (with variable substitutions) |
4c1f658f |
4 | #!perl |
32882678 |
5 | my ($out) = __FILE__ =~ /(^.*)\.PL/i; |
93804878 |
6 | $out =~ s/_h$/.h/; |
fd40a117 |
7 | unlink $out if -l $out; |
4c1f658f |
8 | open(OUT,">$out") || die "Cannot open $file:$!"; |
cc50ac46 |
9 | print "Extracting $out...\n"; |
651aa52e |
10 | print OUT <<"END"; |
11 | /* |
12 | !!! Don't modify this file - it's autogenerated from $0 !!! |
13 | */ |
14 | END |
15 | |
059a8bb7 |
16 | foreach my $const (qw( |
7386c4fb |
17 | CVf_ANON |
18 | CVf_ASSERTION |
19 | CVf_CLONE |
20 | CVf_CLONED |
21 | CVf_CONST |
22 | CVf_LOCKED |
23 | CVf_LVALUE |
24 | CVf_METHOD |
25 | CVf_NODEBUG |
e678f8d3 |
26 | CVf_ISXSUB |
7386c4fb |
27 | CVf_UNIQUE |
28 | CVf_WEAKOUTSIDE |
29 | GVf_IMPORTED_AV |
30 | GVf_IMPORTED_CV |
31 | GVf_IMPORTED_HV |
32 | GVf_IMPORTED_SV |
b874ff32 |
33 | HEf_SVKEY |
7386c4fb |
34 | SVTYPEMASK |
35 | SVf_FAKE |
36 | SVf_IOK |
37 | SVf_IVisUV |
38 | SVf_NOK |
39 | SVf_POK |
40 | SVf_READONLY |
41 | SVf_ROK |
42 | SVp_IOK |
43 | SVp_NOK |
44 | SVp_POK |
45 | SVpad_OUR |
46 | SVs_RMG |
47 | SVs_SMG |
48 | SVt_PVGV |
49 | SVt_PVHV |
059a8bb7 |
50 | )) |
4c1f658f |
51 | { |
52 | doconst($const); |
53 | } |
6c5e080d |
54 | foreach my $file (qw(op.h cop.h pad.h)) |
4c1f658f |
55 | { |
db5fd395 |
56 | my $path = $^O eq 'MacOS' ? ":::$file" : "../../$file"; |
57 | open(OPH,"$path") || die "Cannot open $path:$!"; |
4c1f658f |
58 | while (<OPH>) |
59 | { |
60 | doconst($1) if (/#define\s+(\w+)\s+([\(\)\|\dx]+)\s*(?:$|\/\*)/); |
61 | } |
62 | close(OPH); |
63 | } |
64 | close(OUT); |
65 | |
66 | sub doconst |
67 | { |
68 | my $sym = shift; |
69 | my $l = length($sym); |
70 | print OUT <<"END"; |
71 | newCONSTSUB(stash,"$sym",newSViv($sym)); |
79cb57f6 |
72 | av_push(export_ok,newSVpvn("$sym",$l)); |
4c1f658f |
73 | END |
74 | } |