diff options
Diffstat (limited to 'src/lib/libcrypto/util/files.pl')
| -rw-r--r-- | src/lib/libcrypto/util/files.pl | 61 |
1 files changed, 61 insertions, 0 deletions
diff --git a/src/lib/libcrypto/util/files.pl b/src/lib/libcrypto/util/files.pl new file mode 100644 index 0000000000..bf3b7effdc --- /dev/null +++ b/src/lib/libcrypto/util/files.pl | |||
| @@ -0,0 +1,61 @@ | |||
| 1 | #!/usr/bin/perl | ||
| 2 | # | ||
| 3 | # used to generate the file MINFO for use by util/mk1mf.pl | ||
| 4 | # It is basically a list of all variables from the passed makefile | ||
| 5 | # | ||
| 6 | |||
| 7 | $s=""; | ||
| 8 | while (<>) | ||
| 9 | { | ||
| 10 | chop; | ||
| 11 | s/#.*//; | ||
| 12 | if (/^(\S+)\s*=\s*(.*)$/) | ||
| 13 | { | ||
| 14 | $o=""; | ||
| 15 | ($s,$b)=($1,$2); | ||
| 16 | for (;;) | ||
| 17 | { | ||
| 18 | if ($b =~ /\\$/) | ||
| 19 | { | ||
| 20 | chop($b); | ||
| 21 | $o.=$b." "; | ||
| 22 | $b=<>; | ||
| 23 | chop($b); | ||
| 24 | } | ||
| 25 | else | ||
| 26 | { | ||
| 27 | $o.=$b." "; | ||
| 28 | last; | ||
| 29 | } | ||
| 30 | } | ||
| 31 | $o =~ s/^\s+//; | ||
| 32 | $o =~ s/\s+$//; | ||
| 33 | $o =~ s/\s+/ /g; | ||
| 34 | |||
| 35 | $o =~ s/\$[({]([^)}]+)[)}]/$sym{$1}/g; | ||
| 36 | $sym{$s}=$o; | ||
| 37 | } | ||
| 38 | } | ||
| 39 | |||
| 40 | $pwd=`pwd`; chop($pwd); | ||
| 41 | |||
| 42 | if ($sym{'TOP'} eq ".") | ||
| 43 | { | ||
| 44 | $n=0; | ||
| 45 | $dir="."; | ||
| 46 | } | ||
| 47 | else { | ||
| 48 | $n=split(/\//,$sym{'TOP'}); | ||
| 49 | @_=split(/\//,$pwd); | ||
| 50 | $z=$#_-$n+1; | ||
| 51 | foreach $i ($z .. $#_) { $dir.=$_[$i]."/"; } | ||
| 52 | chop($dir); | ||
| 53 | } | ||
| 54 | |||
| 55 | print "RELATIVE_DIRECTORY=$dir\n"; | ||
| 56 | |||
| 57 | foreach (sort keys %sym) | ||
| 58 | { | ||
| 59 | print "$_=$sym{$_}\n"; | ||
| 60 | } | ||
| 61 | print "RELATIVE_DIRECTORY=\n"; | ||
