PR: 2786
[mirror-openssl.git] / util / fipsobj.pl
blobbcc2a58b01f0e186e50b92dbea8203132cb8f145
2 # Filter script. Take all FIPS object files from the environment
3 # and print out only those in the given directory.
5 my $dir = $ARGV[0];
7 my $asmobjs = "";
9 # Add any needed assembly language files.
11 $asmobjs = $ENV{AES_ENC} if $dir eq "aes";
12 $asmobjs = $ENV{BN_ASM} if $dir eq "bn";
13 $asmobjs = $ENV{DES_ENC} if $dir eq "des";
14 $asmobjs = $ENV{SHA1_ASM_OBJ} if $dir eq "sha";
15 $asmobjs = $ENV{MODES_ASM_OBJ} if $dir eq "modes";
17 # Get all other FIPS object files, filtered by directory.
19 my @objlist = grep {/crypto\/$dir\//} split / /, $ENV{FIPS_EX_OBJ};
21 push @objlist, split / /, $asmobjs;
23 # Fatal error if no matches
24 die "No objects in $dir!" if (scalar @objlist == 0);
26 # Output all matches removing pathname.
27 foreach (@objlist)
29 s|../crypto/$dir/||;
30 print "$_\n";