Keep supporting the env / make variable PERL
authorRichard Levitte <levitte@openssl.org>
Sun, 8 Jul 2018 10:00:06 +0000 (12:00 +0200)
committerRichard Levitte <levitte@openssl.org>
Mon, 9 Jul 2018 07:21:36 +0000 (09:21 +0200)
OpenSSL 1.1.0 supports the use of this environment variable for
passing to the build files.  For the sake of backward compatibility,
we keep it.

Reviewed-by: Tim Hudson <tjh@openssl.org>
Reviewed-by: Paul Dale <paul.dale@oracle.com>
Reviewed-by: Bernd Edlinger <bernd.edlinger@hotmail.de>
(Merged from https://github.com/openssl/openssl/pull/6668)

Configurations/descrip.mms.tmpl
Configurations/unix-Makefile.tmpl
Configurations/windows-makefile.tmpl
Configure

index 70e566ef129fb3e3faaa7fd1c418328930d4555c..0c2695d2d14ba3b810c7c8f4b60cd7adff9bd6cf 100644 (file)
@@ -180,7 +180,7 @@ CFLAGS={- join('', @{$config{CFLAGS}}) -}
 LDFLAGS={- join('', @{$config{LFLAGS}}) -}
 EX_LIBS={- join('', map { ",$_" } @{$config{LDLIBS}}) -}
 
-PERL={- $config{perl} -}
+PERL={- $config{PERL} -}
 
 AS={- $config{AS} -}
 ASFLAGS={- join(' ', @{$config{ASFLAGS}}) -}
index 8d33e8431854f1383e4e09dfb7f540aa26921434..2423ad28347a600bd1de943fa1fa6a6883e3db77 100644 (file)
@@ -212,7 +212,7 @@ EX_LIBS= {- join(' ', @{$config{LDLIBS}}) -}
 
 MAKEDEPEND={- $config{makedepprog} -}
 
-PERL={- $config{perl} -}
+PERL={- $config{PERL} -}
 
 AR=$(CROSS_COMPILE){- $config{AR} -}
 ARFLAGS= {- join(' ', @{$config{ARFLAGS}}) -}
index 11acdf00f6abf8ac910e76edebee9e569d17a86b..30fa5f904632e61d4a98637856175820657f0091 100644 (file)
@@ -173,7 +173,7 @@ LD={- $config{LD} -}
 LDFLAGS={- join(' ', @{$config{LDFLAGS}}) -}
 EX_LIBS={- join(' ', @{$config{LDLIBS}}) -}
 
-PERL={- $config{perl} -}
+PERL={- $config{PERL} -}
 
 AR={- $config{AR} -}
 ARFLAGS= {- join(' ', @{$config{ARFLAGS}}) -}
index 05b798bc7cf1fe43bcc4eea8d490fe46b38ed60b..1b4e1d23f2248c1802c9888d47cea2527cffe522 100755 (executable)
--- a/Configure
+++ b/Configure
@@ -553,6 +553,7 @@ my %user = (
     LDLIBS      => [],  # -l
     MT          => undef,
     MTFLAGS     => [],
+    PERL        => env('PERL') || ($^O ne "VMS" ? $^X : "perl"),
     RANLIB      => env('RANLIB'),
     RC          => env('RC') || env('WINDRES'),
     RCFLAGS     => [],
@@ -1117,10 +1118,8 @@ $target{dso_extension}//=$target{shared_extension_simple};
 ($target{shared_import_extension}=$target{shared_extension_simple}.".a")
     if ($config{target} =~ /^(?:Cygwin|mingw)/);
 
-# Allow overriding the names of some tools.  USE WITH CARE
-# Note: only Unix cares about HASHBANGPERL...  that explains
-# the default string.
-$config{perl} =    ($^O ne "VMS" ? $^X : "perl");
+# Fill %config with values from %user, and in case those are undefined or
+# empty, use values from %target (acting as a default).
 foreach (keys %user) {
     my $ref_type = ref $user{$_};
 
@@ -2459,7 +2458,7 @@ _____
     if ($dump || $cmdline) {
         print "\nCommand line (with current working directory = $here):\n\n";
         print '    ',join(' ',
-                          $config{perl},
+                          $config{PERL},
                           catfile($config{sourcedir}, 'Configure'),
                           @{$config{perlargv}}), "\n";
         print "\nPerl information:\n\n";
@@ -3065,7 +3064,7 @@ sub run_dofile
     foreach (@templates) {
         die "Can't open $_, $!" unless -f $_;
     }
-    my $perlcmd = (quotify("maybeshell", $config{perl}))[0];
+    my $perlcmd = (quotify("maybeshell", $config{PERL}))[0];
     my $cmd = "$perlcmd \"-I.\" \"-Mconfigdata\" \"$dofile\" -o\"Configure\" \"".join("\" \"",@templates)."\" > \"$out.new\"";
     #print STDERR "DEBUG[run_dofile]: \$cmd = $cmd\n";
     system($cmd);