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