[openssl-commits] [openssl] master update

Richard Levitte levitte at openssl.org
Wed Jun 21 23:26:07 UTC 2017


The branch master has been updated
       via  906eb3d0316194681ddac09bfa7d1e5143dcb616 (commit)
      from  410e8c9356e54d0b96ac15ffcae30f4528b9565e (commit)


- Log -----------------------------------------------------------------
commit 906eb3d0316194681ddac09bfa7d1e5143dcb616
Author: Richard Levitte <levitte at openssl.org>
Date:   Thu Jun 22 00:47:49 2017 +0200

    Configure: give config targets the possibility to enable or disable features
    
    Reviewed-by: Rich Salz <rsalz at openssl.org>
    (Merged from https://github.com/openssl/openssl/pull/3745)

-----------------------------------------------------------------------

Summary of changes:
 Configurations/00-base-templates.conf |  4 +++
 Configurations/README                 |  7 +++++
 Configure                             | 57 +++++++++++++++++++++++------------
 3 files changed, 49 insertions(+), 19 deletions(-)

diff --git a/Configurations/00-base-templates.conf b/Configurations/00-base-templates.conf
index 8c47e9e..84f7144 100644
--- a/Configurations/00-base-templates.conf
+++ b/Configurations/00-base-templates.conf
@@ -42,6 +42,10 @@
 
     BASE_common => {
 	template	=> 1,
+
+	enable		=> [],
+	disable		=> [],
+
 	defines		=>
 	    sub {
                 my @defs = ();
diff --git a/Configurations/README b/Configurations/README
index 92ff1ac..40fcc45 100644
--- a/Configurations/README
+++ b/Configurations/README
@@ -34,6 +34,13 @@ In each table entry, the following keys are significant:
         sys_id          => System identity for systems where that
                            is difficult to determine automatically.
 
+        enable          => Enable specific configuration features.
+                           This MUST be an array of words.
+        disable         => Disable specific configuration features.
+                           This MUST be an array of words.
+                           Note: if the same feature is both enabled
+                           and disabled, disable wins.
+
         cc              => The C compiler command, usually one of "cc",
                            "gcc" or "clang".  This command is normally
                            also used to link object files and
diff --git a/Configure b/Configure
index 87c235d..65fcea0 100755
--- a/Configure
+++ b/Configure
@@ -857,6 +857,44 @@ if ($target =~ m/^CygWin32(-.*)$/) {
     $target = "Cygwin".$1;
 }
 
+# Support for legacy targets having a name starting with 'debug-'
+my ($d, $t) = $target =~ m/^(debug-)?(.*)$/;
+if ($d) {
+    $config{build_type} = "debug";
+
+    # If we do not find debug-foo in the table, the target is set to foo.
+    if (!$table{$target}) {
+	$target = $t;
+    }
+}
+$config{target} = $target;
+my %target = resolve_config($target);
+
+&usage if (!%target || $target{template});
+
+my %conf_files = map { $_ => 1 } (@{$target{_conf_fname_int}});
+$config{conf_files} = [ sort keys %conf_files ];
+%target = ( %{$table{DEFAULTS}}, %target );
+
+foreach my $feature (@{$target{disable}}) {
+    if (exists $deprecated_disablables{$feature}) {
+        warn "***** config $target disables deprecated feature $feature\n";
+    } elsif (!grep { $feature eq $_ } @disablables) {
+        die "***** config $target disables unknown feature $feature\n";
+    }
+    $disabled{$feature} = 'config';
+}
+foreach my $feature (@{$target{enable}}) {
+    if ("default" eq ($disabled{$_} // "")) {
+        if (exists $deprecated_disablables{$feature}) {
+            warn "***** config $target enables deprecated feature $feature\n";
+        } elsif (!grep { $feature eq $_ } @disablables) {
+            die "***** config $target enables unknown feature $feature\n";
+        }
+        delete $disabled{$_};
+    }
+}
+
 foreach (sort (keys %disabled))
 	{
 	$config{options} .= " no-$_";
@@ -921,25 +959,6 @@ foreach (sort (keys %disabled))
 	print "\n";
 	}
 
-# Support for legacy targets having a name starting with 'debug-'
-my ($d, $t) = $target =~ m/^(debug-)?(.*)$/;
-if ($d) {
-    $config{build_type} = "debug";
-
-    # If we do not find debug-foo in the table, the target is set to foo.
-    if (!$table{$target}) {
-	$target = $t;
-    }
-}
-$config{target} = $target;
-my %target = resolve_config($target);
-
-&usage if (!%target || $target{template});
-
-my %conf_files = map { $_ => 1 } (@{$target{_conf_fname_int}});
-$config{conf_files} = [ sort keys %conf_files ];
-%target = ( %{$table{DEFAULTS}}, %target );
-
 $target{cxxflags}=$target{cflags} unless defined $target{cxxflags};
 $target{exe_extension}="";
 $target{exe_extension}=".exe" if ($config{target} eq "DJGPP"


More information about the openssl-commits mailing list