[openssl-commits] [openssl] master update

Andy Polyakov appro at openssl.org
Wed May 25 21:52:24 UTC 2016


The branch master has been updated
       via  656bbdc68c4f6e79209cb7622fac0ca1301dee24 (commit)
      from  02f603f29753b9b07a4d71229c68465e56e4f352 (commit)


- Log -----------------------------------------------------------------
commit 656bbdc68c4f6e79209cb7622fac0ca1301dee24
Author: Andy Polyakov <appro at openssl.org>
Date:   Fri May 20 21:31:11 2016 +0200

    Configure: pull 'which' back.
    
    At earlier point 'which' was replaced with IPC::Cmd::can_run call.
    Unfortunately on RPM-based systems it is a separate package and it's
    not given that it's installed. Resurrected 'which' provides
    poor-man fallback for IPC::Cmd::can_run.
    
    Reviewed-by: Rich Salz <rsalz at openssl.org>
    Reviewed-by: Richard Levitte <levitte at openssl.org>

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

Summary of changes:
 Configure | 26 +++++++++++++++++++++++---
 1 file changed, 23 insertions(+), 3 deletions(-)

diff --git a/Configure b/Configure
index 20470a9..37ace21 100755
--- a/Configure
+++ b/Configure
@@ -14,7 +14,6 @@ use strict;
 use File::Basename;
 use File::Spec::Functions qw/:DEFAULT abs2rel rel2abs/;
 use File::Path qw/mkpath/;
-use IPC::Cmd qw/can_run/;
 
 # see INSTALL for instructions.
 
@@ -913,7 +912,7 @@ $config{cross_compile_prefix} = $ENV{'CROSS_COMPILE'}
 $config{perl} =    $ENV{'PERL'}    || ($^O ne "VMS" ? $^X : "perl");
 $target{cc} =      $ENV{'CC'}      || $target{cc}      || "cc";
 $target{ranlib} =  $ENV{'RANLIB'}  || $target{ranlib}  ||
-                   (scalar can_run("$config{cross_compile_prefix}ranlib") ?
+                   (which("$config{cross_compile_prefix}ranlib") ?
                           "\$(CROSS_COMPILE)ranlib" : "true");
 $target{ar} =      $ENV{'AR'}      || $target{ar}      || "ar";
 $target{nm} =      $ENV{'NM'}      || $target{nm}      || "nm";
@@ -1158,7 +1157,7 @@ if ($^O ne "VMS" && !$disabled{makedepend}) {
     }
     close(PIPE);
 
-    $config{makedepprog} = scalar can_run('makedepend') unless $config{makedepprog};
+    $config{makedepprog} = which('makedepend') unless $config{makedepprog};
     $disabled{makedepend} = "unavailable" unless $config{makedepprog};
 }
 
@@ -2340,6 +2339,27 @@ sub run_dofile
     rename("$out.new", $out) || die "Can't rename $out.new, $!";
 }
 
+sub which
+{
+    my ($name)=@_;
+
+    if (eval { require IPC::Cmd; 1; }) {
+        IPC::Cmd->import();
+        return scalar IPC::Cmd::can_run($name);
+    } else {
+        # if there is $directories component in splitpath,
+        # then it's not something to test with $PATH...
+        return $name if (File::Spec->splitpath($name))[1];
+
+        foreach (File::Spec->path()) {
+            my $fullpath = catfile($_, "$name$target{exe_extension}");
+            if (-f $fullpath and -x $fullpath) {
+                return $fullpath;
+            }
+        }
+    }
+}
+
 # Configuration printer ##############################################
 
 sub print_table_entry


More information about the openssl-commits mailing list