2 # FIPS assembly language preprocessor
3 # Renames all symbols in the file to
4 # their modified fips versions.
10 my $target = shift @ARGS;
11 my $tmptarg = $target;
13 $tmptarg =~ s/\.[^\\\/\.]+$/.tmp
/;
17 if ($ARGS[0] eq "norunasm")
25 $enabled = 1 if $ENV{FIPSCANISTERINTERNAL
} eq "y";
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 #delete any temp file lying around
58 #rename target temporarily
59 rename($target, $tmptarg) || die "Can't rename $target";
62 open(IN
,$tmptarg) || die "Can't open temporary file";
63 open(OUT
, ">$target") || die "Can't open output file $target";
67 while (($from, $to) = each %edits)
69 s/(\b_*)$from(\b)/$1$to$2/g;
85 rename $tmptarg, $target;
87 die "Error executing assembler!" if $rv != 0;
91 # Don't care about target