mkfiles.pl 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149
  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/store",
  60. "crypto/pqueue",
  61. "crypto/whrlpool",
  62. "crypto/ts",
  63. "crypto/srp",
  64. "ssl",
  65. "apps",
  66. "engines",
  67. "engines/ccgost",
  68. "test",
  69. "tools"
  70. );
  71. %top;
  72. my $fipscanisteronly = 0;
  73. foreach (@dirs) {
  74. next if ($fipscanisteronly && !(-d $_));
  75. &files_dir ($_, "Makefile");
  76. }
  77. exit(0);
  78. sub files_dir
  79. {
  80. my ($dir, $makefile) = @_;
  81. my %sym;
  82. open (IN, "$dir/$makefile") || die "Can't open $dir/$makefile";
  83. my $s="";
  84. while (<IN>)
  85. {
  86. chop;
  87. s/#.*//;
  88. if (/^([^\s=]+)\s*=\s*(.*)$/)
  89. {
  90. $o="";
  91. ($s,$b)=($1,$2);
  92. for (;;)
  93. {
  94. if ($b =~ /\\$/)
  95. {
  96. chop($b);
  97. $o.=$b." ";
  98. $b=<IN>;
  99. chop($b);
  100. }
  101. else
  102. {
  103. $o.=$b." ";
  104. last;
  105. }
  106. }
  107. $o =~ s/^\s+//;
  108. $o =~ s/\s+$//;
  109. $o =~ s/\s+/ /g;
  110. $o =~ s/\$[({]([^)}]+)[)}]/$top{$1} or $sym{$1}/ge;
  111. $sym{$s}=($top{$s} or $o);
  112. }
  113. }
  114. print "RELATIVE_DIRECTORY=$dir\n";
  115. foreach (sort keys %sym)
  116. {
  117. print "$_=$sym{$_}\n";
  118. }
  119. if ($dir eq "." && defined($sym{"BUILDENV"}))
  120. {
  121. foreach (split(' ',$sym{"BUILDENV"}))
  122. {
  123. /^(.+)=/;
  124. $top{$1}=$sym{$1};
  125. }
  126. }
  127. print "RELATIVE_DIRECTORY=\n";
  128. close (IN);
  129. if ($dir eq "." && $sym{FIPSCANISTERONLY} eq "y")
  130. {
  131. $fipscanisteronly = 1;
  132. }
  133. }