- Notifications
You must be signed in to change notification settings - Fork 7.8k
/
Copy pathgenif.pl
24 lines (22 loc) · 575 Bytes
/
genif.pl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/usr/bin/perl
$in_file = shift || die"Give .in file as first parameter";
$srcdir = shift || die"Give source dir as second parameter";
@extensions = @ARGV;
open(IN, $in_file) ordie"Could not open .in file $in_file";
while (<IN>) {
if (/\@EXT_INCLUDE_CODE\@/) {
foreach$ext (@extensions) {
$hdr_file = "ext/$ext/php3_${ext}.h";
if (-f"$srcdir/$hdr_file") {
print"#include \"ext/${ext}/php3_${ext}.h\"\n";
}
}
} elsif (/\@EXT_MODULE_PTRS\@/) {
foreach$ext (@extensions) {
print" phpext_${ext}_ptr,\n";
}
} else {
print;
}
}
close(IN);