4 use File::Basename qw(&basename &dirname);
7 # List explicitly here the variables you want Configure to
8 # generate. Metaconfig only looks for shell variables, so you
9 # have to mention them as if they were shell variables, not
15 # This forces PL files to create target in same directory as PL file.
16 # This is so that make depend always knows where to find PL derivatives.
19 $file = basename($0, '.PL');
20 $file .= '.com' if $^O eq 'VMS';
22 # Open input file before creating output file.
23 $IN = '../lib/diagnostics.pm';
24 open IN or die "Can't open $IN: $!\n";
27 open OUT,">$file" or die "Can't create $file: $!";
29 print "Extracting $file (with variable substitutions)\n";
31 # In this section, perl variables will be expanded during extraction.
32 # You can use $Config{...} to use Configure variables.
34 print OUT <<"!GROK!THIS!";
36 eval 'exec $Config{perlpath} -S \$0 \${1+"\$@"}'
37 if \$running_under_some_shell;
41 print OUT unless /^package diagnostics/;
46 close OUT or die "Can't close $file: $!";
47 chmod 0755, $file or die "Can't reset permissions for $file: $!\n";
48 exec("$Config{'eunicefix'} $file") if $Config{'eunicefix'} ne ':';