diff options
Diffstat (limited to '')
| -rw-r--r-- | src/lib/libcrypto/util/selftest.pl | 31 |
1 files changed, 26 insertions, 5 deletions
diff --git a/src/lib/libcrypto/util/selftest.pl b/src/lib/libcrypto/util/selftest.pl index 91e962a312..276b81183d 100644 --- a/src/lib/libcrypto/util/selftest.pl +++ b/src/lib/libcrypto/util/selftest.pl | |||
| @@ -19,13 +19,14 @@ my $ok=0; | |||
| 19 | my $cc="cc"; | 19 | my $cc="cc"; |
| 20 | my $cversion="??"; | 20 | my $cversion="??"; |
| 21 | my $sep="-----------------------------------------------------------------------------\n"; | 21 | my $sep="-----------------------------------------------------------------------------\n"; |
| 22 | my $not_our_fault="\nPlease ask your system administrator/vendor for more information.\n[Problems with your operating system setup should not be reported\nto the OpenSSL project.]\n"; | ||
| 22 | 23 | ||
| 23 | open(OUT,">$report") or die; | 24 | open(OUT,">$report") or die; |
| 24 | 25 | ||
| 25 | print OUT "OpenSSL self-test report:\n\n"; | 26 | print OUT "OpenSSL self-test report:\n\n"; |
| 26 | 27 | ||
| 27 | $uname=`uname -a`; | 28 | $uname=`uname -a`; |
| 28 | $uname="??" if $uname eq ""; | 29 | $uname="??\n" if $uname eq ""; |
| 29 | 30 | ||
| 30 | $c=`sh config -t`; | 31 | $c=`sh config -t`; |
| 31 | foreach $_ (split("\n",$c)) { | 32 | foreach $_ (split("\n",$c)) { |
| @@ -49,6 +50,7 @@ if (open(IN,"<Makefile.ssl")) { | |||
| 49 | 50 | ||
| 50 | $cversion=`$cc -v 2>&1`; | 51 | $cversion=`$cc -v 2>&1`; |
| 51 | $cversion=`$cc -V 2>&1` if $cversion =~ "usage"; | 52 | $cversion=`$cc -V 2>&1` if $cversion =~ "usage"; |
| 53 | $cversion=`$cc -V |head -1` if $cversion =~ "Error"; | ||
| 52 | $cversion=`$cc --version` if $cversion eq ""; | 54 | $cversion=`$cc --version` if $cversion eq ""; |
| 53 | $cversion =~ s/Reading specs.*\n//; | 55 | $cversion =~ s/Reading specs.*\n//; |
| 54 | $cversion =~ s/usage.*\n//; | 56 | $cversion =~ s/usage.*\n//; |
| @@ -56,7 +58,7 @@ chomp $cversion; | |||
| 56 | 58 | ||
| 57 | if (open(IN,"<CHANGES")) { | 59 | if (open(IN,"<CHANGES")) { |
| 58 | while(<IN>) { | 60 | while(<IN>) { |
| 59 | if (/\*\) (.{0,55})/) { | 61 | if (/\*\) (.{0,55})/ && !/applies to/) { |
| 60 | $last=$1; | 62 | $last=$1; |
| 61 | last; | 63 | last; |
| 62 | } | 64 | } |
| @@ -76,11 +78,18 @@ print OUT "\n"; | |||
| 76 | 78 | ||
| 77 | print "Checking compiler...\n"; | 79 | print "Checking compiler...\n"; |
| 78 | if (open(TEST,">cctest.c")) { | 80 | if (open(TEST,">cctest.c")) { |
| 79 | print TEST "#include <stdio.h>\nmain(){printf(\"Hello world\\n\");}\n"; | 81 | print TEST "#include <stdio.h>\n#include <errno.h>\nmain(){printf(\"Hello world\\n\");}\n"; |
| 80 | close(TEST); | 82 | close(TEST); |
| 81 | system("$cc -o cctest cctest.c"); | 83 | system("$cc -o cctest cctest.c"); |
| 82 | if (`./cctest` !~ /Hello world/) { | 84 | if (`./cctest` !~ /Hello world/) { |
| 83 | print OUT "Compiler doesn't work.\n"; | 85 | print OUT "Compiler doesn't work.\n"; |
| 86 | print OUT $not_our_fault; | ||
| 87 | goto err; | ||
| 88 | } | ||
| 89 | system("ar r cctest.a /dev/null"); | ||
| 90 | if (not -f "cctest.a") { | ||
| 91 | print OUT "Check your archive tool (ar).\n"; | ||
| 92 | print OUT $not_our_fault; | ||
| 84 | goto err; | 93 | goto err; |
| 85 | } | 94 | } |
| 86 | } else { | 95 | } else { |
| @@ -97,6 +106,7 @@ if (open(TEST,">cctest.c")) { | |||
| 97 | } else { | 106 | } else { |
| 98 | print OUT "Can't compile test program!\n"; | 107 | print OUT "Can't compile test program!\n"; |
| 99 | } | 108 | } |
| 109 | print OUT $not_our_fault; | ||
| 100 | goto err; | 110 | goto err; |
| 101 | } | 111 | } |
| 102 | } else { | 112 | } else { |
| @@ -122,6 +132,8 @@ if (system("make 2>&1 | tee make.log") > 255) { | |||
| 122 | 132 | ||
| 123 | $_=$options; | 133 | $_=$options; |
| 124 | s/no-asm//; | 134 | s/no-asm//; |
| 135 | s/no-shared//; | ||
| 136 | s/no-krb5//; | ||
| 125 | if (/no-/) | 137 | if (/no-/) |
| 126 | { | 138 | { |
| 127 | print OUT "Test skipped.\n"; | 139 | print OUT "Test skipped.\n"; |
| @@ -129,14 +141,14 @@ if (/no-/) | |||
| 129 | } | 141 | } |
| 130 | 142 | ||
| 131 | print "Running make test...\n"; | 143 | print "Running make test...\n"; |
| 132 | if (system("make test 2>&1 | tee make.log") > 255) | 144 | if (system("make test 2>&1 | tee maketest.log") > 255) |
| 133 | { | 145 | { |
| 134 | print OUT "make test failed!\n"; | 146 | print OUT "make test failed!\n"; |
| 135 | } else { | 147 | } else { |
| 136 | $ok=1; | 148 | $ok=1; |
| 137 | } | 149 | } |
| 138 | 150 | ||
| 139 | if ($ok and open(IN,"<make.log")) { | 151 | if ($ok and open(IN,"<maketest.log")) { |
| 140 | while (<IN>) { | 152 | while (<IN>) { |
| 141 | $ok=2 if /^platform: $platform/; | 153 | $ok=2 if /^platform: $platform/; |
| 142 | } | 154 | } |
| @@ -155,6 +167,15 @@ if ($ok != 2) { | |||
| 155 | } else { | 167 | } else { |
| 156 | print OUT "make.log not found!\n"; | 168 | print OUT "make.log not found!\n"; |
| 157 | } | 169 | } |
| 170 | if (open(IN,"<maketest.log")) { | ||
| 171 | while (<IN>) { | ||
| 172 | print OUT; | ||
| 173 | } | ||
| 174 | close(IN); | ||
| 175 | print OUT $sep; | ||
| 176 | } else { | ||
| 177 | print OUT "maketest.log not found!\n"; | ||
| 178 | } | ||
| 158 | } else { | 179 | } else { |
| 159 | print OUT "Test passed.\n"; | 180 | print OUT "Test passed.\n"; |
| 160 | } | 181 | } |
