| # FIPS assembly language preprocessor |
| # Renames all symbols in the file to |
| # their modified fips versions. |
| my $target = shift @ARGS; |
| if ($ARGS[0] eq "norunasm") |
| # HACK to disable operation if no OPENSSL_FIPSSYMS option. |
| # will go away when tested more fully. |
| foreach (@ARGS) { $enabled = 1 if /-DOPENSSL_FIPSSYMS/ ; } |
| if ($enabled == 0 && $runasm) |
| # Open symbol rename file. |
| open(IN, "$top/fips/fipssyms.h") || die "Can't open fipssyms.h"; |
| # Skip to assembler symbols |
| if (/^#define\s+(\w+)\s+(\w+)\b/) |
| #rename target temporarily |
| rename($target, "tmptarg.s") || die "Can't rename $target\n"; |
| while (($from, $to) = each %edits) |
| s/(\b_*)$from(\b)/$1$to$2/g; |
| rename "tmptarg.s", $target; |
| die "Error executing assembler!" if $rv != 0; |
| # Don't care about target |