X-Git-Url: https://git.openssl.org/gitweb/?p=openssl.git;a=blobdiff_plain;f=Configure;h=060ba24a9fc961fbaa8274784dd2197db1f29b9d;hp=52d4f934bcd34064b06197eae6c6ecf67ec02ca7;hb=3ec8a1cfd8e06e2308fc318d8071aa7b5ddda146;hpb=c38bb72797916f2a0ab9906aad29162ca8d53546 diff --git a/Configure b/Configure index 52d4f934bc..060ba24a9f 100755 --- a/Configure +++ b/Configure @@ -14,6 +14,7 @@ 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. @@ -909,7 +910,9 @@ $config{cross_compile_prefix} = $ENV{'CROSS_COMPILE'} # Allow overriding the names of some tools. USE WITH CARE $config{perl} = $ENV{'PERL'} || ($^O ne "VMS" ? $^X : "perl"); $target{cc} = $ENV{'CC'} || $target{cc} || "cc"; -$target{ranlib} = $ENV{'RANLIB'} || $target{ranlib} || which("ranlib") || "true"; +$target{ranlib} = $ENV{'RANLIB'} || $target{ranlib} || + (scalar can_run("$config{cross_compile_prefix}ranlib") ? + "\$(CROSS_COMPILE)ranlib" : "true"); $target{ar} = $ENV{'AR'} || $target{ar} || "ar"; $target{nm} = $ENV{'NM'} || $target{nm} || "nm"; @@ -1036,7 +1039,7 @@ if ($disabled{"dynamic-engine"}) { } unless ($disabled{fuzz}) { - push $config{dirs}, "fuzz"; + push @{$config{dirs}}, "fuzz"; $config{cflags} .= "-fsanitize-coverage=edge,indirect-calls "; } @@ -1151,7 +1154,7 @@ if ($^O ne "VMS" && !$disabled{makedepend}) { } close(PIPE); - $config{makedepprog} = which('makedepend') unless $config{makedepprog}; + $config{makedepprog} = scalar can_run('makedepend') unless $config{makedepprog}; $disabled{makedepend} = "unavailable" unless $config{makedepprog}; } @@ -1873,7 +1876,7 @@ print OUT "1;\n"; close(OUT); -print "CC =$target{cc}\n"; +print "CC =$config{cross_compile_prefix}$target{cc}\n"; print "CFLAG =$target{cflags} $config{cflags}\n"; print "SHARED_CFLAG =$target{shared_cflag}\n"; print "DEFINES =",join(" ", @{$target{defines}}, @{$config{defines}}),"\n"; @@ -1901,7 +1904,9 @@ print "CHACHA_ENC =$target{chacha_obj}\n"; print "POLY1305_OBJ =$target{poly1305_obj}\n"; print "BLAKE2_OBJ =$target{blake2_obj}\n"; print "PROCESSOR =$config{processor}\n"; -print "RANLIB =$target{ranlib}\n"; +print "RANLIB =", $target{ranlib} eq '$(CROSS_COMPILE)ranlib' ? + "$config{cross_compile_prefix}ranlib" : + "$target{ranlib}", "\n"; print "ARFLAGS =$target{arflags}\n"; print "PERL =$config{perl}\n"; print "\n"; @@ -2458,22 +2463,6 @@ sub absolutedir { return realpath($dir); } -sub which - { - my($name)=@_; - my $path; - foreach $path (split /:/, $ENV{PATH}) - { - my $fullpath = "$path/$name$target{exe_extension}"; - if (-f $fullpath and -x $fullpath) - { - return $fullpath - unless ($name eq "perl" and - system("$fullpath -e " . '\'exit($]<5.0);\'')); - } - } - } - sub quotify { my %processors = ( perl => sub { my $x = shift;