mkfiles.pl 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163
  1. #!/usr/local/bin/perl
  2. #
  3. # This is a hacked version of files.pl for systems that can't do a 'make files'.
  4. # Do a perl util/mkminfo.pl >MINFO to build MINFO
  5. # Written by Steve Henson 1999.
  6. # List of directories to process
  7. my @dirs = (
  8. ".",
  9. "crypto",
  10. "crypto/md2",
  11. "crypto/md4",
  12. "crypto/md5",
  13. "crypto/sha",
  14. "crypto/mdc2",
  15. "crypto/hmac",
  16. "crypto/ripemd",
  17. "crypto/des",
  18. "crypto/rc2",
  19. "crypto/rc4",
  20. "crypto/rc5",
  21. "crypto/idea",
  22. "crypto/bf",
  23. "crypto/cast",
  24. "crypto/aes",
  25. "crypto/camellia",
  26. "crypto/seed",
  27. "crypto/modes",
  28. "crypto/cmac",
  29. "crypto/bn",
  30. "crypto/rsa",
  31. "crypto/dsa",
  32. "crypto/dso",
  33. "crypto/dh",
  34. "crypto/ec",
  35. "crypto/ecdh",
  36. "crypto/ecdsa",
  37. "crypto/buffer",
  38. "crypto/bio",
  39. "crypto/stack",
  40. "crypto/lhash",
  41. "crypto/rand",
  42. "crypto/err",
  43. "crypto/objects",
  44. "crypto/evp",
  45. "crypto/asn1",
  46. "crypto/pem",
  47. "crypto/x509",
  48. "crypto/x509v3",
  49. "crypto/cms",
  50. "crypto/conf",
  51. "crypto/jpake",
  52. "crypto/txt_db",
  53. "crypto/pkcs7",
  54. "crypto/pkcs12",
  55. "crypto/comp",
  56. "crypto/engine",
  57. "crypto/ocsp",
  58. "crypto/ui",
  59. "crypto/krb5",
  60. #"crypto/store",
  61. "crypto/pqueue",
  62. "crypto/whrlpool",
  63. "crypto/ts",
  64. "crypto/srp",
  65. "fips",
  66. "fips/aes",
  67. "fips/cmac",
  68. "fips/des",
  69. "fips/dsa",
  70. "fips/dh",
  71. "fips/ecdh",
  72. "fips/ecdsa",
  73. "fips/hmac",
  74. "fips/rand",
  75. "fips/rsa",
  76. "fips/utl",
  77. "fips/sha",
  78. "ssl",
  79. "apps",
  80. "engines",
  81. "engines/ccgost",
  82. "test",
  83. "tools"
  84. );
  85. %top;
  86. my $fipscanisteronly = 0;
  87. foreach (@dirs) {
  88. next if ($fipscanisteronly && !(-d $_));
  89. &files_dir ($_, "Makefile");
  90. }
  91. exit(0);
  92. sub files_dir
  93. {
  94. my ($dir, $makefile) = @_;
  95. my %sym;
  96. open (IN, "$dir/$makefile") || die "Can't open $dir/$makefile";
  97. my $s="";
  98. while (<IN>)
  99. {
  100. chop;
  101. s/#.*//;
  102. if (/^(\S+)\s*=\s*(.*)$/)
  103. {
  104. $o="";
  105. ($s,$b)=($1,$2);
  106. for (;;)
  107. {
  108. if ($b =~ /\\$/)
  109. {
  110. chop($b);
  111. $o.=$b." ";
  112. $b=<IN>;
  113. chop($b);
  114. }
  115. else
  116. {
  117. $o.=$b." ";
  118. last;
  119. }
  120. }
  121. $o =~ s/^\s+//;
  122. $o =~ s/\s+$//;
  123. $o =~ s/\s+/ /g;
  124. $o =~ s/\$[({]([^)}]+)[)}]/$top{$1} or $sym{$1}/ge;
  125. $sym{$s}=($top{$s} or $o);
  126. }
  127. }
  128. print "RELATIVE_DIRECTORY=$dir\n";
  129. foreach (sort keys %sym)
  130. {
  131. print "$_=$sym{$_}\n";
  132. }
  133. if ($dir eq "." && defined($sym{"BUILDENV"}))
  134. {
  135. foreach (split(' ',$sym{"BUILDENV"}))
  136. {
  137. /^(.+)=/;
  138. $top{$1}=$sym{$1};
  139. }
  140. }
  141. print "RELATIVE_DIRECTORY=\n";
  142. close (IN);
  143. if ($dir eq "." && $sym{FIPSCANISTERONLY} eq "y")
  144. {
  145. $fipscanisteronly = 1;
  146. }
  147. }