Refactor the ranlib attribute
authorRichard Levitte <levitte@openssl.org>
Fri, 2 Feb 2018 11:23:09 +0000 (12:23 +0100)
committerRichard Levitte <levitte@openssl.org>
Thu, 22 Feb 2018 13:57:21 +0000 (14:57 +0100)
It was inconsistent to see this specific command have
'$(CROSS_COMPILE)' in its value when no other command did.

Reviewed-by: Rich Salz <rsalz@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/5247)

Configurations/00-base-templates.conf
Configurations/unix-Makefile.tmpl

index 99c271e5b19da76a7f59e1e7ee1d80013567be83..0350997ff7ed86313fe9f5fb32a94a1254b3b47d 100644 (file)
@@ -50,8 +50,8 @@ my %targets=(
        arflags         => "r",
        cc              => "cc",
        hashbangperl    => "/usr/bin/env perl",
-       ranlib          => sub { which("$config{cross_compile_prefix}ranlib") ?
-                                    "\$(CROSS_COMPILE)ranlib" : "true"; },
+       ranlib          => sub { which("$config{cross_compile_prefix}ranlib")
+                                     ? "ranlib" : "" },
        rc              => "windres",
 
        #### THESE WILL BE ENABLED IN OpenSSL 1.2
@@ -94,8 +94,8 @@ my %targets=(
                   && defined($disabled{"zlib-dynamic"})
                   ? "-lz" : () },
         hashbangperl    => "/usr/bin/env perl", # Only Unix actually cares
-        ranlib          => sub { which("$config{cross_compile_prefix}ranlib") ?
-                                     "\$(CROSS_COMPILE)ranlib" : "true"; },
+        ranlib          => sub { which("$config{cross_compile_prefix}ranlib")
+                                     ? "ranlib" : "" },
         rc              => "windres",
 
         build_scheme    => [ "unified", "unix" ],
index 1f214a2747bca26f7eb4060799328e4fa37ad430..2a4d2df332ee3a0f5e0d3c421b7e227a7ef6b779 100644 (file)
@@ -218,7 +218,7 @@ PERL={- $config{perl} -}
 
 AR=$(CROSS_COMPILE){- $config{ar} -}
 ARFLAGS= {- join(' ', @{$config{arflags}}) -}
-RANLIB= {- $config{ranlib} -}
+RANLIB={- $config{ranlib} ? "\$(CROSS_COMPILE)$config{ranlib}" : "true"; -}
 RC= $(CROSS_COMPILE){- $target{rc} || "windres" -}
 RCFLAGS={- join(' ', @{$config{rcflags}}) -} {- $target{shared_rcflag} -}
 RM= rm -f