perl: Separate compile-time environment from runtime environment
authorRichard Levitte <levitte@openssl.org>
Sat, 2 Jul 2016 14:39:15 +0000 (16:39 +0200)
committerRichard Levitte <levitte@openssl.org>
Mon, 4 Jul 2016 13:40:31 +0000 (15:40 +0200)
Make it possible to have a separate and different perl command string
for installable scripts than we use when building, with the
environment variable HASHBANGPERL.  Its value default to the same as
the environment PERL if it's defined, otherwise '/usr/bin/env perl'.

Note: this is only relevant for Unix-like environments.

Reviewed-by: Rich Salz <rsalz@openssl.org>
Reviewed-by: Andy Polyakov <appro@openssl.org>
Reviewed-by: Kurt Roeckx <kurt@openssl.org>
Configure
INSTALL
apps/CA.pl.in
apps/tsget.in
tools/c_rehash.in

index f8a6ec2e846b531eafaf897c5e6c054cf7cdd740..f43b5bfa36d25513eb39298939e33c33f282730f 100755 (executable)
--- a/Configure
+++ b/Configure
@@ -913,7 +913,11 @@ $config{cross_compile_prefix} = $ENV{'CROSS_COMPILE'}
     if $config{cross_compile_prefix} eq "";
 
 # Allow overriding the names of some tools.  USE WITH CARE
     if $config{cross_compile_prefix} eq "";
 
 # Allow overriding the names of some tools.  USE WITH CARE
+# Note: only Unix cares about HASHBANGPERL...  that explains
+# the default string.
 $config{perl} =    $ENV{'PERL'}    || ($^O ne "VMS" ? $^X : "perl");
 $config{perl} =    $ENV{'PERL'}    || ($^O ne "VMS" ? $^X : "perl");
+$config{hashbangperl} =
+    $ENV{'HASHBANGPERL'}           || $ENV{'PERL'}     || "/usr/bin/env perl";
 $target{cc} =      $ENV{'CC'}      || $target{cc}      || "cc";
 $target{ranlib} =  $ENV{'RANLIB'}  || $target{ranlib}  ||
                    (which("$config{cross_compile_prefix}ranlib") ?
 $target{cc} =      $ENV{'CC'}      || $target{cc}      || "cc";
 $target{ranlib} =  $ENV{'RANLIB'}  || $target{ranlib}  ||
                    (which("$config{cross_compile_prefix}ranlib") ?
diff --git a/INSTALL b/INSTALL
index 29db22ea75003217f971c94acdd1d1714b3b0016..0f246060fa7cb3d43eef42fd100bb1195fecd4ff 100644 (file)
--- a/INSTALL
+++ b/INSTALL
                 variable can be set to the directory where these files are held.
 
  PERL
                 variable can be set to the directory where these files are held.
 
  PERL
-                The name of the Perl executable to use.
+                The name of the Perl executable to use when building OpenSSL.
+
+ HASHBANGPERL
+                The command string for the Perl executable to insert in the
+                #! line of perl scripts that will be publically installed.
+                Default: /usr/bin/env perl
+                Note: the value of this variable is added to the same scripts
+                on all platforms, but it's only relevant on Unix-like platforms.
 
  RC
                 The name of the rc executable to use. The default will be as
 
  RC
                 The name of the rc executable to use. The default will be as
index 0dec24c36f28e6e54414a2bcd48e94189190518d..3187e473d236f5d1e2ba0ec83c6b52b332cf2544 100644 (file)
@@ -1,4 +1,4 @@
-#!{- $config{perl} -}
+#!{- $config{hashbangperl} -}
 # Copyright 2000-2016 The OpenSSL Project Authors. All Rights Reserved.
 #
 # Licensed under the OpenSSL license (the "License").  You may not use
 # Copyright 2000-2016 The OpenSSL Project Authors. All Rights Reserved.
 #
 # Licensed under the OpenSSL license (the "License").  You may not use
index 7067111552448be4f072c193badf643d200941ae..89d1bc7ea384ed0ba35de2a122b3f6b22416d0cf 100644 (file)
@@ -1,4 +1,4 @@
-#!{- $config{perl} -}
+#!{- $config{hashbangperl} -}
 # Copyright (c) 2002 The OpenTSA Project. All rights reserved.
 # Copyright 2002-2016 The OpenSSL Project Authors. All Rights Reserved.
 #
 # Copyright (c) 2002 The OpenTSA Project. All rights reserved.
 # Copyright 2002-2016 The OpenSSL Project Authors. All Rights Reserved.
 #
index 949e44f0751072cf0f9cc8146d0aac26ee9c924c..2fef62784fade48967c2c8a203deb8442ac07ed8 100644 (file)
@@ -1,4 +1,4 @@
-#!{- $config{perl} -}
+#!{- $config{hashbangperl} -}
 
 # {- join("\n# ", @autowarntext) -}
 # Copyright 1999-2016 The OpenSSL Project Authors. All Rights Reserved.
 
 # {- join("\n# ", @autowarntext) -}
 # Copyright 1999-2016 The OpenSSL Project Authors. All Rights Reserved.