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';
23 open OUT,">$file" or die "Can't create $file: $!";
25 print "Extracting $file (with variable substitutions)\n";
27 # In this section, perl variables will be expanded during extraction.
28 # You can use $Config{...} to use Configure variables.
30 print OUT <<"!GROK!THIS!";
32 eval 'exec $Config{'perlpath'} -S \$0 \${1+"\$@"}'
33 if \$running_under_some_shell;
36 # In the following, perl variables are not expanded during extraction.
38 print OUT <<'!NO!SUBS!';
50 -p Print a preface before each test telling what it will test.
51 -v Verbose mode in which extra information about test results
52 is printed. Test failures always print out some extra information
53 regardless of whether or not this switch is set.
54 -h Prints this help message.
59 use vars (%opt); # allow testing with older versions (do not use our)
61 @opt{ qw/? H h P p V v/ } = qw(0 0 0 0 0 0 0);
63 while ($ARGV[0] =~ /^-/) {
65 for my $flag (split(//,$ARGV[0])) {
66 usage() if '?' =~ /\Q$flag/;
67 usage() if 'h' =~ /\Q$flag/;
68 usage() if 'H' =~ /\Q$flag/;
69 usage("unknown flag: `$flag'") unless 'HhPpVv' =~ /\Q$flag/;
70 warn "$0: `$flag' flag already set\n" if $opt{$flag}++;
84 # We cannot merely check the variable `$^X' in general since on many
85 # Unixes it is the basename rather than the full path to the perl binary.
87 if (defined($Config{'perlpath'})) { $perlpath = $Config{'perlpath'}; }
88 # Of course some platforms are distinct...
89 if ($^O eq 'VMS') { $perlpath = $^X; }
91 print OUT <<"!GROK!THIS!";
92 my \$perlpath = '$perlpath';
95 print OUT <<'!NO!SUBS!';
97 print "## Checking Perl binary via variable `\$perlpath' = $perlpath.\n" if $opt{'p'};
100 print "## Perl binary `$perlpath' appears executable.\n" if $opt{'v'};
105 print "# Perl binary `$perlpath' does not appear executable.\n";
112 print "## Checking Perl version via variable `\$]'.\n" if $opt{'p'};
116 print OUT <<"!GROK!THIS!";
117 my \$ivp_VERSION = $];
120 print OUT <<'!NO!SUBS!';
121 if ($ivp_VERSION == $]) {
122 print "## Perl version `$]' appears installed as expected.\n" if $opt{'v'};
127 print "# Perl version `$]' installed, expected $ivp_VERSION.\n";
134 print "## Checking roots of the Perl library directory tree via variable `\@INC'.\n" if $opt{'p'};
139 next if $_ eq '.'; # skip -d test here
140 if ($^O eq 'MacOS') {
141 next if $_ eq ':'; # skip -d test here
142 next if $_ eq 'Dev:Pseudo:'; # why is this in @INC?
145 print "## Perl \@INC directory `$_' exists.\n" if $opt{'v'};
149 print "# Perl \@INC directory `$_' does not appear to exist.\n";
153 if ($INC_total == $INC_there) {
164 print "## Checking installations of modules necessary for ivp.\n" if $opt{'p'};
166 my $needed_total = 0;
167 my $needed_there = 0;
168 foreach (qw(Config.pm ExtUtils/Installed.pm)) {
171 eval "require \"$_\";";
173 print "## Module `$_' appears to be installed.\n" if $opt{'v'};
177 print "# Needed module `$_' does not appear to be properly installed.\n";
181 if ($needed_total == $needed_there) {
192 print "## Checking installations of extensions built with perl.\n" if $opt{'p'};
196 my $extensions_total = 0;
197 my $extensions_there = 0;
198 if (defined($Config{'extensions'})) {
199 my @extensions = split(/\s+/,$Config{'extensions'});
200 foreach (@extensions) {
202 next if ($_ eq 'Devel/DProf');
203 # VMS$ perl -e "eval ""require \""Devel/DProf.pm\"";"" print $@"
204 # \NT> perl -e "eval \"require 'Devel/DProf.pm'\"; print $@"
205 # DProf: run perl with -d to use DProf.
206 # Compilation failed in require at (eval 1) line 1.
207 eval " require \"$_.pm\"; ";
209 print "## Module `$_' appears to be installed.\n" if $opt{'v'};
213 print "# Required module `$_' does not appear to be properly installed.\n";
219 # A silly name for a module (that hopefully won't ever exist).
220 # Note that this test serves more as a check of the validity of the
221 # actuall required module tests above.
222 my $unnecessary = 'bLuRfle';
224 if (!grep(/$unnecessary/, @extensions)) {
226 eval " require \"$unnecessary.pm\"; ";
228 print "## Unnecessary module `$unnecessary' does not appear to be installed.\n" if $opt{'v'};
231 print "# Unnecessary module `$unnecessary' appears to be installed.\n";
237 if ($extensions_total == $extensions_there) {
248 print "## Checking installations of later additional extensions.\n" if $opt{'p'};
250 use ExtUtils::Installed;
252 my $installed_total = 0;
253 my $installed_there = 0;
254 my $version_check = 0;
255 my $installed = ExtUtils::Installed -> new();
256 my @modules = $installed -> modules();
261 # Consider it there if it contains one or more files,
262 # and has zero missing files,
263 # and has a defined version
265 $version = $installed -> version($_);
267 print "## $_; $version\n" if $opt{'v'};
271 print "# $_; NO VERSION\n" if $opt{'v'};
275 @missing = $installed -> validate($_);
276 if ($#missing >= 0) {
277 print "# file",+($#missing == 0) ? '' : 's'," missing from installation:\n";
278 print '# ',join(' ',@missing),"\n";
280 elsif ($#missing == -1) {
285 if (($installed_total == $installed_there) &&
286 ($installed_total == $version_check)) {
297 print "## Checking installations of *.h -> *.ph header files.\n" if $opt{'p'};
302 # Just about "any" C implementation ought to have a stdio.h (even if
303 # Config.pm may not list a i_stdio var).
304 my @ph_files = qw(stdio.ph);
305 # Add the ones that we know that perl thinks are there:
306 while (($var, $val) = each %Config) {
307 if ($var =~ m/i_(.+)/ && $val eq 'define') {
309 # This ought to distinguish syslog from sys/syslog.
310 # (NB syslog.ph is heavily used for the DBI pre-requisites).
311 $h_file =~ s{^sys(.+)}{sys/$1} unless $h_file eq 'syslog';
312 push(@ph_files, "$h_file.ph");
315 #foreach (qw(stdio.ph syslog.ph)) {
316 foreach (@ph_files) {
318 eval "require \"$_\";";
320 print "## Perl header `$_' appears to be installed.\n" if $opt{'v'};
324 print "# Perl header `$_' does not appear to be properly installed.\n";
329 if (scalar(@ph_files) == $ph_there) {
339 # Final report (rather than feed ousrselves to Test::Harness::runtests()
340 # we simply format some output on our own to keep things simple and
341 # easier to "fix" - at least for now.
343 if ($error_total == 0 && $tests_total) {
344 print "All tests successful.\n";
345 } elsif ($tests_total==0){
346 die "FAILED--no tests were run for some reason.\n";
349 if ($tests_total > 0) { $rate = sprintf "%.2f", 100.0 * ($pass__total / $tests_total); }
350 printf " %d/%d subtests failed, %.2f%% okay.\n",
351 $error_total, $tests_total, $rate;
356 B<perlivp> - Perl Installation Verification Procedure
360 B<perlivp> [B<-p>] [B<-v>] [B<-h>]
364 The B<perlivp> program is set up at Perl source code build time to test the
365 Perl version it was built under. It can be used after running:
369 (or your platform's equivalent procedure) to verify that B<perl> and its
370 libraries have been installed correctly. A correct installation is verified
371 by output that looks like:
384 Prints out a brief help message.
386 =item B<-p> print preface
388 Gives a description of each test prior to performing it.
392 Gives more detailed information about each test, after it has been performed.
393 Note that any failed tests ought to print out some extra information whether
402 =item * print "# Perl binary `$perlpath' does not appear executable.\n";
404 Likely to occur for a perl binary that was not properly installed.
405 Correct by conducting a proper installation.
407 =item * print "# Perl version `$]' installed, expected $ivp_VERSION.\n";
409 Likely to occur for a perl that was not properly installed.
410 Correct by conducting a proper installation.
412 =item * print "# Perl \@INC directory `$_' does not appear to exist.\n";
414 Likely to occur for a perl library tree that was not properly installed.
415 Correct by conducting a proper installation.
417 =item * print "# Needed module `$_' does not appear to be properly installed.\n";
419 One of the two modules that is used by perlivp was not present in the
420 installation. This is a serious error since it adversely affects perlivp's
421 ability to function. You may be able to correct this by performing a
422 proper perl installation.
424 =item * print "# Required module `$_' does not appear to be properly installed.\n";
426 An attempt to C<eval "require $module"> failed, even though the list of
427 extensions indicated that it should succeed. Correct by conducting a proper
430 =item * print "# Unnecessary module `bLuRfle' appears to be installed.\n";
432 This test not coming out ok could indicate that you have in fact installed
433 a bLuRfle.pm module or that the C<eval " require \"$module_name.pm\"; ">
434 test may give misleading results with your installation of perl. If yours
435 is the latter case then please let the author know.
437 =item * print "# file",+($#missing == 0) ? '' : 's'," missing from installation:\n";
439 One or more files turned up missing according to a run of
440 C<ExtUtils::Installed -E<gt> validate()> over your installation.
441 Correct by conducting a proper installation.
443 =item * print "# Perl header `$_' does not appear to be properly installed.\n";
445 Correct by running B<h2ph> over your system's C header files. If necessary,
446 edit the resulting *.ph files to eliminate perl syntax errors.
450 For further information on how to conduct a proper installation consult the
451 INSTALL file that comes with the perl source and the README file for your
462 close OUT or die "Can't close $file: $!";
463 chmod 0755, $file or die "Can't reset permissions for $file: $!\n";
464 exec("$Config{'eunicefix'} $file") if $Config{'eunicefix'} ne ':';