Commit | Line | Data |
5f05dabc |
1 | #!/usr/local/bin/perl |
2 | |
3 | use Config; |
4 | use File::Basename qw(&basename &dirname); |
5 | |
6 | # List explicitly here the variables you want Configure to |
7 | # generate. Metaconfig only looks for shell variables, so you |
8 | # have to mention them as if they were shell variables, not |
9 | # %Config entries: |
10 | # $startperl |
11 | # $perlpath |
12 | # $eunicefix |
13 | |
14 | # This forces PL files to create target in same directory as PL file. |
15 | # This is so that make depend always knows where to find PL derivatives. |
44a8e56a |
16 | chdir dirname($0); |
17 | $file = basename($0, '.PL'); |
774d564b |
18 | $file .= '.com' if $^O eq 'VMS'; |
5f05dabc |
19 | |
20 | # Open input file before creating output file. |
21 | $IN = '../lib/diagnostics.pm'; |
22 | open IN or die "Can't open $IN: $!\n"; |
23 | |
24 | # Create output file. |
25 | open OUT,">$file" or die "Can't create $file: $!"; |
26 | |
27 | print "Extracting $file (with variable substitutions)\n"; |
28 | |
29 | # In this section, perl variables will be expanded during extraction. |
30 | # You can use $Config{...} to use Configure variables. |
31 | |
32 | print OUT <<"!GROK!THIS!"; |
33 | $Config{startperl} |
34 | eval 'exec $Config{perlpath} -S \$0 \${1+"\$@"}' |
35 | if \$running_under_some_shell; |
36 | !GROK!THIS! |
37 | |
38 | while (<IN>) { |
39 | print OUT unless /^package diagnostics/; |
40 | } |
41 | |
42 | close IN; |
43 | |
44 | close OUT or die "Can't close $file: $!"; |
45 | chmod 0755, $file or die "Can't reset permissions for $file: $!\n"; |
46 | exec("$Config{'eunicefix'} $file") if $Config{'eunicefix'} ne ':'; |