summaryrefslogtreecommitdiffstats
path: root/Configure
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 /Configure
parentd36ab9ce9a984684d9cffb60bca5d072ed5279d7 (diff)
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 'Configure')
-rwxr-xr-xConfigure74
1 files changed, 37 insertions, 37 deletions
diff --git a/Configure b/Configure
index 45103ff063..661fe45c8f 100755
--- a/Configure
+++ b/Configure
@@ -395,7 +395,7 @@ my $openssl_sys_defines="";
my $openssl_other_defines="";
my $libs="";
my $target="";
-my $options="";
+$config{options}="";
my $api;
my $make_depend=0;
my %withargs=();
@@ -610,10 +610,10 @@ foreach (@argvcopy)
# we really only write OPTIONS to the Makefile out of
# nostalgia.)
- if ($options eq "")
- { $options = $_; }
+ if ($config{options} eq "")
+ { $config{options} = $_; }
else
- { $options .= " ".$_; }
+ { $config{options} .= " ".$_; }
}
if (defined($api) && !exists $apitable->{$api}) {
@@ -676,7 +676,7 @@ if ($target =~ m/^CygWin32(-.*)$/) {
foreach (sort (keys %disabled))
{
- $options .= " no-$_";
+ $config{options} .= " no-$_";
printf " no-%-12s %-10s", $_, "[$disabled{$_}]";
@@ -945,12 +945,12 @@ if ($target{build_scheme}->[0] ne "mk1mf")
if ($no_shared)
{
$openssl_other_defines.="#define OPENSSL_NO_DYNAMIC_ENGINE\n";
- $options.=" static-engine";
+ $config{options}.=" static-engine";
}
else
{
$openssl_other_defines.="#define OPENSSL_NO_STATIC_ENGINE\n";
- $options.=" no-static-engine";
+ $config{options}.=" no-static-engine";
}
}
@@ -1081,36 +1081,36 @@ if (!$no_asm) {
# and works as well on command lines.
$cflags =~ s/([\\\"])/\\\1/g;
-my $version = "unknown";
-my $version_num = "unknown";
-my $major = "unknown";
-my $minor = "unknown";
-my $shlib_version_number = "unknown";
-my $shlib_version_history = "unknown";
-my $shlib_major = "unknown";
-my $shlib_minor = "unknown";
+$config{version} = "unknown";
+$config{version_num} = "unknown";
+$config{major} = "unknown";
+$config{minor} = "unknown";
+$config{shlib_version_number} = "unknown";
+$config{shlib_version_history} = "unknown";
+$config{shlib_major} = "unknown";
+$config{shlib_minor} = "unknown";
open(IN,'<include/openssl/opensslv.h') || die "unable to read opensslv.h:$!\n";
while (<IN>)
{
- $version=$1 if /OPENSSL.VERSION.TEXT.*OpenSSL (\S+) /;
- $version_num=$1 if /OPENSSL.VERSION.NUMBER.*(0x\S+)/;
- $shlib_version_number=$1 if /SHLIB_VERSION_NUMBER *"([^"]+)"/;
- $shlib_version_history=$1 if /SHLIB_VERSION_HISTORY *"([^"]*)"/;
+ $config{version}=$1 if /OPENSSL.VERSION.TEXT.*OpenSSL (\S+) /;
+ $config{version_num}=$1 if /OPENSSL.VERSION.NUMBER.*(0x\S+)/;
+ $config{shlib_version_number}=$1 if /SHLIB_VERSION_NUMBER *"([^"]+)"/;
+ $config{shlib_version_history}=$1 if /SHLIB_VERSION_HISTORY *"([^"]*)"/;
}
close(IN);
-if ($shlib_version_history ne "") { $shlib_version_history .= ":"; }
+if ($config{shlib_version_history} ne "") { $config{shlib_version_history} .= ":"; }
-if ($version =~ /(^[0-9]*)\.([0-9\.]*)/)
+if ($config{version} =~ /(^[0-9]*)\.([0-9\.]*)/)
{
- $major=$1;
- $minor=$2;
+ $config{major}=$1;
+ $config{minor}=$2;
}
-if ($shlib_version_number =~ /(^[0-9]*)\.([0-9\.]*)/)
+if ($config{shlib_version_number} =~ /(^[0-9]*)\.([0-9\.]*)/)
{
- $shlib_major=$1;
- $shlib_minor=$2;
+ $config{shlib_major}=$1;
+ $config{shlib_minor}=$2;
}
if (defined($api)) {
@@ -1215,13 +1215,13 @@ while (<IN>)
$sdirs = 0 unless /\\$/;
s/fips // if (/^DIRS=/ && !$fips);
s/engines // if (/^DIRS=/ && $disabled{"engine"});
- s/^VERSION=.*/VERSION=$version/;
- s/^MAJOR=.*/MAJOR=$major/;
- s/^MINOR=.*/MINOR=$minor/;
- s/^SHLIB_VERSION_NUMBER=.*/SHLIB_VERSION_NUMBER=$shlib_version_number/;
- s/^SHLIB_VERSION_HISTORY=.*/SHLIB_VERSION_HISTORY=$shlib_version_history/;
- s/^SHLIB_MAJOR=.*/SHLIB_MAJOR=$shlib_major/;
- s/^SHLIB_MINOR=.*/SHLIB_MINOR=$shlib_minor/;
+ s/^VERSION=.*/VERSION=$config{version}/;
+ s/^MAJOR=.*/MAJOR=$config{major}/;
+ s/^MINOR=.*/MINOR=$config{minor}/;
+ s/^SHLIB_VERSION_NUMBER=.*/SHLIB_VERSION_NUMBER=$config{shlib_version_number}/;
+ s/^SHLIB_VERSION_HISTORY=.*/SHLIB_VERSION_HISTORY=$config{shlib_version_history}/;
+ s/^SHLIB_MAJOR=.*/SHLIB_MAJOR=$config{shlib_major}/;
+ s/^SHLIB_MINOR=.*/SHLIB_MINOR=$config{shlib_minor}/;
s/^SHLIB_EXT=.*/SHLIB_EXT=$target{shared_extension}/;
s/^INSTALLTOP=.*$/INSTALLTOP=$config{prefix}/;
s/^MULTILIB=.*$/MULTILIB=$target{multilib}/;
@@ -1229,7 +1229,7 @@ while (<IN>)
s/^LIBDIR=.*$/LIBDIR=$libdir/;
s/^INSTALL_PREFIX=.*$/INSTALL_PREFIX=$install_prefix/;
s/^PLATFORM=.*$/PLATFORM=$target/;
- s/^OPTIONS=.*$/OPTIONS=$options/;
+ s/^OPTIONS=.*$/OPTIONS=$config{options}/;
my $argvstring = "(".join(", ", map { quotify("perl", $_) } @argvcopy).")";
s/^CONFIGURE_ARGS=.*$/CONFIGURE_ARGS=$argvstring/;
if ($cross_compile_prefix)
@@ -1579,7 +1579,7 @@ EOF
# create the ms/version32.rc file if needed
if (! grep /^netware/, @{$target{build_scheme}}) {
my ($v1, $v2, $v3, $v4);
- if ($version_num =~ /^0x([0-9a-f]{1})([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{1})L$/i) {
+ if ($config{version_num} =~ /^0x([0-9a-f]{1})([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{1})L$/i) {
$v1=hex $1;
$v2=hex $2;
$v3=hex $3;
@@ -1611,7 +1611,7 @@ BEGIN
// Required:
VALUE "CompanyName", "The OpenSSL Project, http://www.openssl.org/\\0"
VALUE "FileDescription", "OpenSSL Shared Library\\0"
- VALUE "FileVersion", "$version\\0"
+ VALUE "FileVersion", "$config{version}\\0"
#if defined(CRYPTO)
VALUE "InternalName", "libeay32\\0"
VALUE "OriginalFilename", "libeay32.dll\\0"
@@ -1620,7 +1620,7 @@ BEGIN
VALUE "OriginalFilename", "ssleay32.dll\\0"
#endif
VALUE "ProductName", "The OpenSSL Toolkit\\0"
- VALUE "ProductVersion", "$version\\0"
+ VALUE "ProductVersion", "$config{version}\\0"
// Optional:
//VALUE "Comments", "\\0"
VALUE "LegalCopyright", "Copyright © 1998-2015 The OpenSSL Project. Copyright © 1995-1998 Eric A. Young, Tim J. Hudson. All rights reserved.\\0"