summaryrefslogtreecommitdiffstats
path: root/util
diff options
context:
space:
mode:
authorDr. Stephen Henson <steve@openssl.org>2011-02-21 14:07:15 +0000
committerDr. Stephen Henson <steve@openssl.org>2011-02-21 14:07:15 +0000
commiteead69f5ed15510b65df545a083a0b63abc6b29d (patch)
tree58a62659e43048b0c7457f4757818bbccd6e1e45 /util
parentab8a4e54dbada9bdc7f4786fb54e1f6e7ae52bc7 (diff)
Make fipscanisteronly build only required files.
Diffstat (limited to 'util')
-rw-r--r--util/fipsobj.pl31
1 files changed, 31 insertions, 0 deletions
diff --git a/util/fipsobj.pl b/util/fipsobj.pl
new file mode 100644
index 0000000000..09fe34a244
--- /dev/null
+++ b/util/fipsobj.pl
@@ -0,0 +1,31 @@
+
+# Filter script. Take all FIPS object files from the environment
+# and print out only those in the given directory.
+
+my $dir = $ARGV[0];
+
+my $asmobjs = "";
+
+# Add any needed assembly languagr files.
+
+$asmobjs = $ENV{AES_ENC} if $dir eq "aes";
+$asmobjs = $ENV{BN_ASM} if $dir eq "bn";
+$asmobjs = $ENV{DES_ENC} if $dir eq "des";
+$asmobjs = $ENV{SHA1_ASM_OBJ} if $dir eq "sha";
+$asmobjs = $ENV{MODES_ASM_OBJ} if $dir eq "modes";
+
+# Get all other FIPS object files, filtered by directory.
+
+my @objlist = grep {/crypto\/$dir\//} split / /, $ENV{FIPS_EX_OBJ};
+
+push @objlist, split / /, $asmobjs;
+
+# Fatal error if no matches
+die "No objects in $dir!" if (scalar @objlist == 0);
+
+# Output all matches removing pathname.
+foreach (@objlist)
+ {
+ s|../crypto/$dir/||;
+ print "$_\n";
+ }