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