diff options
author | Dr. Stephen Henson <steve@openssl.org> | 2011-02-23 15:03:43 +0000 |
---|---|---|
committer | Dr. Stephen Henson <steve@openssl.org> | 2011-02-23 15:03:43 +0000 |
commit | 548b4763e1c3fb36517804a07f3823c8af6ee022 (patch) | |
tree | 31d758886c5ce1beb27e469ae3bfd9d3976b5c2c /util/fipsas.pl | |
parent | 227d6a9347d4c94ff1bb0a91191a33ec18e682e3 (diff) | |
download | openssl-548b4763e1c3fb36517804a07f3823c8af6ee022.tar.gz |
Make -DOPENSSL_FIPSSYMS work under WIN32: run perl script when
WIN32 assembly language files are created, add norunasm option
to just translate and not run the assembler.
Diffstat (limited to 'util/fipsas.pl')
-rw-r--r-- | util/fipsas.pl | 41 |
1 files changed, 32 insertions, 9 deletions
diff --git a/util/fipsas.pl b/util/fipsas.pl index c6964e19cf..49cf564e5c 100644 --- a/util/fipsas.pl +++ b/util/fipsas.pl @@ -9,6 +9,14 @@ my @ARGS = @ARGV; my $top = shift @ARGS; my $target = shift @ARGS; +my $runasm = 1; + +if ($ARGS[0] eq "norunasm") + { + $runasm = 0; + shift @ARGS; + } + # HACK to disable operation if no OPENSSL_FIPSSYMS option. # will go away when tested more fully. @@ -16,12 +24,13 @@ my $enabled = 0; foreach (@ARGS) { $enabled = 1 if /-DOPENSSL_FIPSSYMS/ ; } -if ($enabled == 0) +if ($enabled == 0 && $runasm) { system @ARGS; exit $? } + # Open symbol rename file. open(IN, "$top/fips/fipssyms.h") || die "Can't open fipssyms.h"; @@ -53,18 +62,32 @@ while (<IN>) { while (($from, $to) = each %edits) { - s/(\b)$from(\b)/$1$to$2/g; + s/(\b_*)$from(\b)/$1$to$2/g; } print OUT $_; } -# run assembler -system @ARGS; -my $rv = $?; +close OUT; + +if ($runasm) + { + # run assembler + system @ARGS; + + my $rv = $?; + + # restore target + unlink $target; + rename "tmptarg.s", $target; + + die "Error executing assembler!" if $rv != 0; + } +else + { + # Don't care about target + unlink "tmptarg.s"; + } + -# restore target -unlink $target; -rename "tmptarg.s", $target; -die "Error executing assembler!" if $rv != 0; |