[openssl-commits] [openssl] OpenSSL_1_1_0-stable update

Richard Levitte levitte at openssl.org
Mon Mar 6 15:43:25 UTC 2017


The branch OpenSSL_1_1_0-stable has been updated
       via  08beac4f3d37247e2ed3bf49dd7d760f4c3e0389 (commit)
       via  a40b5be27e28eaf5a8be7193c8b6460bc6f851b4 (commit)
      from  0d41526f4f76b2f9384540503c21e8ef41e1fbbb (commit)


- Log -----------------------------------------------------------------
commit 08beac4f3d37247e2ed3bf49dd7d760f4c3e0389
Author: Richard Levitte <levitte at openssl.org>
Date:   Mon Mar 6 11:19:49 2017 +0100

    Add documentation on platform specific checks
    
    Reviewed-by: Andy Polyakov <appro at openssl.org>
    (Merged from https://github.com/openssl/openssl/pull/2851)
    (cherry picked from commit 44eb65ce20d673d0332802275d54f6811f448076)

commit a40b5be27e28eaf5a8be7193c8b6460bc6f851b4
Author: Richard Levitte <levitte at openssl.org>
Date:   Sun Mar 5 21:51:18 2017 +0100

    Add a platform specific configuration checker
    
    For each platform, we may need to perform some basic checks to see
    that available tools perform as we expect them.
    
    For the moment, the added checkers test that Perl gives the expected
    path format.  This should help MingW users to see if they run an
    appropriate Perl implementation, for example.
    
    Reviewed-by: Andy Polyakov <appro at openssl.org>
    (Merged from https://github.com/openssl/openssl/pull/2851)
    (cherry picked from commit d192a3aaeb76fc89f8285b4dc938c2bc0c37d0d4)

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

Summary of changes:
 Configurations/README             | 37 +++++++++++++++++++++++++++++++++++++
 Configurations/unix-checker.pm    | 22 ++++++++++++++++++++++
 Configurations/windows-checker.pm | 22 ++++++++++++++++++++++
 Configure                         | 19 +++++++++++++++++++
 4 files changed, 100 insertions(+)
 create mode 100644 Configurations/unix-checker.pm
 create mode 100644 Configurations/windows-checker.pm

diff --git a/Configurations/README b/Configurations/README
index da64e8c..428ac31 100644
--- a/Configurations/README
+++ b/Configurations/README
@@ -1,3 +1,20 @@
+Intro
+=====
+
+This directory contains a few sets of files that are used for
+configuration in diverse ways:
+
+    *.conf      Target platform configurations, please read
+                'Configurations of OpenSSL target platforms' for more
+                information.
+    *.tmpl      Build file templates, please read 'Build-file
+                programming with the "unified" build system' as well
+                as 'Build info files' for more information.
+    *.pm        Helper scripts / modules for the main `Configure`
+                script.  See 'Configure helper scripts for more
+                information.
+
+
 Configurations of OpenSSL target platforms
 ==========================================
 
@@ -653,3 +670,23 @@ else, end it like this:
 
       "";       # Make sure no lingering values end up in the Makefile
     -}
+
+
+Configure helper scripts
+========================
+
+Configure uses helper scripts in this directory:
+
+Checker scripts
+---------------
+
+These scripts are per platform family, to check the integrity of the
+tools used for configuration and building.  The checker script used is
+either {build_platform}-{build_file}-checker.pm or
+{build_platform}-checker.pm, where {build_platform} is the second
+'build_scheme' list element from the configuration target data, and
+{build_file} is 'build_file' from the same target data.
+
+If the check succeeds, the script is expected to end with a non-zero
+expression.  If the check fails, the script can end with a zero, or
+with a `die`.
diff --git a/Configurations/unix-checker.pm b/Configurations/unix-checker.pm
new file mode 100644
index 0000000..b39b0eb
--- /dev/null
+++ b/Configurations/unix-checker.pm
@@ -0,0 +1,22 @@
+#! /usr/bin/perl
+
+use Config;
+
+# Check that the perl implementation file modules generate paths that
+# we expect for the platform
+use File::Spec::Functions qw(:DEFAULT rel2abs);
+
+if (rel2abs('.') !~ m|/|) {
+    die <<EOF;
+
+******************************************************************************
+This perl implementation doesn't produce Unix like paths (with forward slash
+directory separators).  Please use an implementation that matches your
+building platform.
+
+This Perl version: $Config{version} for $Config{archname}
+******************************************************************************
+EOF
+}
+
+1;
diff --git a/Configurations/windows-checker.pm b/Configurations/windows-checker.pm
new file mode 100644
index 0000000..de46fbc
--- /dev/null
+++ b/Configurations/windows-checker.pm
@@ -0,0 +1,22 @@
+#! /usr/bin/perl
+
+use Config;
+
+# Check that the perl implementation file modules generate paths that
+# we expect for the platform
+use File::Spec::Functions qw(:DEFAULT rel2abs);
+
+if (rel2abs('.') !~ m|\\|) {
+    die <<EOF;
+
+******************************************************************************
+This perl implementation doesn't produce Windows like paths (with backward
+slash directory separators).  Please use an implementation that matches your
+building platform.
+
+This Perl version: $Config{version} for $Config{archname}
+******************************************************************************
+EOF
+}
+
+1;
diff --git a/Configure b/Configure
index 38081c4..79d9f33 100755
--- a/Configure
+++ b/Configure
@@ -994,6 +994,25 @@ $target{build_scheme} = [ $target{build_scheme} ]
 my ($builder, $builder_platform, @builder_opts) =
     @{$target{build_scheme}};
 
+foreach my $checker (($builder_platform."-".$target{build_file}."-checker.pm",
+                      $builder_platform."-checker.pm")) {
+    my $checker_path = catfile($srcdir, "Configurations", $checker);
+    if (-f $checker_path) {
+        my $fn = $ENV{CONFIGURE_CHECKER_WARN}
+            ? sub { warn $@; } : sub { die $@; };
+        if (! do $checker_path) {
+            if ($@) {
+                $fn->($@);
+            } elsif ($!) {
+                $fn->($!);
+            } else {
+                $fn->("The detected tools didn't match the platform\n");
+            }
+        }
+        last;
+    }
+}
+
 push @{$config{defines}}, "NDEBUG"    if $config{build_type} eq "release";
 
 if ($target =~ /^mingw/ && `$target{cc} --target-help 2>&1` =~ m/-mno-cygwin/m)


More information about the openssl-commits mailing list