From 3fa04f0d72c22d45213bec1b26c7d84a5b31ac68 Mon Sep 17 00:00:00 2001 From: Richard Levitte Date: Tue, 12 Jan 2016 00:17:12 +0100 Subject: 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 Reviewed-by: Richard Levitte --- util/mkdef.pl | 21 +++++---------------- 1 file changed, 5 insertions(+), 16 deletions(-) (limited to 'util') 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,") { - $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 () { - $v = $1, last if /^VERSION=(.*?)\s*$/; - } - close MF; - return $v; + return $config{version}; } sub print_def_file -- cgit v1.2.3