From d192a3aaeb76fc89f8285b4dc938c2bc0c37d0d4 Mon Sep 17 00:00:00 2001 From: Richard Levitte Date: Sun, 5 Mar 2017 21:51:18 +0100 Subject: [PATCH] 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 (Merged from https://github.com/openssl/openssl/pull/2851) --- Configurations/unix-checker.pm | 22 ++++++++++++++++++++++ Configurations/windows-checker.pm | 22 ++++++++++++++++++++++ Configure | 19 +++++++++++++++++++ 3 files changed, 63 insertions(+) create mode 100644 Configurations/unix-checker.pm create mode 100644 Configurations/windows-checker.pm diff --git a/Configurations/unix-checker.pm b/Configurations/unix-checker.pm new file mode 100644 index 0000000000..b39b0eb7cb --- /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 <($@); + } 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) -- 2.25.1