summaryrefslogtreecommitdiffstats
path: root/util/mkdef.pl
diff options
context:
space:
mode:
authorRichard Levitte <levitte@openssl.org>2016-01-12 00:17:12 +0100
committerRichard Levitte <richard@levitte.org>2016-01-22 23:21:30 +0100
commit3fa04f0d72c22d45213bec1b26c7d84a5b31ac68 (patch)
tree5c04293dd322d49f15a11d9429cc621ba54bae1b /util/mkdef.pl
parentRefactor file writing - information on our use of Perl and Perl modules (diff)
downloadopenssl-3fa04f0d72c22d45213bec1b26c7d84a5b31ac68.tar.xz
openssl-3fa04f0d72c22d45213bec1b26c7d84a5b31ac68.zip
Refactor file writing - Adapt util/mkdef.pl to use configdata.pm
For this adaptation, the variables $options and $version needed to move to %config in Configure, and why not move all other variables holding diverse version numbers at the same time? Reviewed-by: Rich Salz <rsalz@openssl.org> Reviewed-by: Richard Levitte <levitte@openssl.org>
Diffstat (limited to 'util/mkdef.pl')
-rwxr-xr-xutil/mkdef.pl21
1 files changed, 5 insertions, 16 deletions
diff --git a/util/mkdef.pl b/util/mkdef.pl
index a2cc12619b..88c45c7d9b 100755
--- a/util/mkdef.pl
+++ b/util/mkdef.pl
@@ -38,6 +38,9 @@
# exclude.
#
+use lib ".";
+use configdata;
+
my $debug=0;
my $crypto_num= "util/libeay.num";
@@ -128,16 +131,9 @@ foreach (@known_algorithms) {
# disabled by default
$disabled_algorithms{"STATIC_ENGINE"} = 1;
-my $options="";
-open(IN,"<Makefile") || die "unable to open Makefile!\n";
-while(<IN>) {
- $options=$1 if (/^OPTIONS=(.*)$/);
-}
-close(IN);
-
my $zlib;
-foreach (@ARGV, split(/ /, $options))
+foreach (@ARGV, split(/ /, $config{options}))
{
$debug=1 if $_ eq "debug";
$W32=1 if $_ eq "32";
@@ -1177,14 +1173,7 @@ sub print_test_file
}
sub get_version {
- local *MF;
- my $v = '?';
- open MF, 'Makefile' or return $v;
- while (<MF>) {
- $v = $1, last if /^VERSION=(.*?)\s*$/;
- }
- close MF;
- return $v;
+ return $config{version};
}
sub print_def_file