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")
22 $enabled = 1 if $ENV{FIPSCANISTERINTERNAL} eq "y";
24 if ($enabled == 0 && $runasm)
31 # Open symbol rename file.
32 open(IN, "$top/fips/fipssyms.h") || die "Can't open fipssyms.h";
34 # Skip to assembler symbols
43 if (/^#define\s+(\w+)\s+(\w+)\b/)
51 #rename target temporarily
52 rename($target, "tmptarg.s") || die "Can't rename $target";
55 open(IN,"tmptarg.s") || die "Can't open temporary file";
56 open(OUT, ">$target") || die "Can't open output file $target";
60 while (($from, $to) = each %edits)
62 s/(\b_*)$from(\b)/$1$to$2/g;
78 rename "tmptarg.s", $target;
80 die "Error executing assembler!" if $rv != 0;
84 # Don't care about target