]> git.ipfire.org Git - thirdparty/openssl.git/blame - util/files.pl
Fix memory leak in DSA redo case.
[thirdparty/openssl.git] / util / files.pl
CommitLineData
d02b48c6
RE
1#!/usr/local/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
83084112 7while ($ARGV[0] =~ /^([^\s=]+)\s*=\s*(.*)$/)
7b0d591d
BL
8 {
9 $sym{$1} = $2;
10 shift;
11 }
12
d02b48c6
RE
13$s="";
14while (<>)
15 {
16 chop;
17 s/#.*//;
83084112 18 if (/^([^\s=]+)\s*=\s*(.*)$/)
d02b48c6
RE
19 {
20 $o="";
21 ($s,$b)=($1,$2);
22 for (;;)
23 {
24 if ($b =~ /\\$/)
25 {
26 chop($b);
27 $o.=$b." ";
28 $b=<>;
29 chop($b);
30 }
31 else
32 {
33 $o.=$b." ";
34 last;
35 }
36 }
37 $o =~ s/^\s+//;
38 $o =~ s/\s+$//;
39 $o =~ s/\s+/ /g;
40
41 $o =~ s/\$[({]([^)}]+)[)}]/$sym{$1}/g;
7b0d591d 42 $sym{$s}=$o if !exists $sym{$s};
d02b48c6
RE
43 }
44 }
45
46$pwd=`pwd`; chop($pwd);
47
48if ($sym{'TOP'} eq ".")
49 {
50 $n=0;
51 $dir=".";
52 }
53else {
54 $n=split(/\//,$sym{'TOP'});
55 @_=split(/\//,$pwd);
56 $z=$#_-$n+1;
57 foreach $i ($z .. $#_) { $dir.=$_[$i]."/"; }
58 chop($dir);
59 }
60
61print "RELATIVE_DIRECTORY=$dir\n";
62
63foreach (sort keys %sym)
64 {
65 print "$_=$sym{$_}\n";
66 }
67print "RELATIVE_DIRECTORY=\n";