]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
Fix util/wrap.pl.in for VMS usage
authorRichard Levitte <levitte@openssl.org>
Wed, 1 Mar 2023 15:27:50 +0000 (16:27 +0100)
committerRichard Levitte <levitte@openssl.org>
Wed, 8 Mar 2023 11:29:22 +0000 (12:29 +0100)
In the name of consistency, make sure that this same script is used
across more platforms, in this case VMS.  This removes the need for
util/local_shlib.com.in and util/unlocal_shlib.com.in, which were
under-used anyway.

Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/20415)

util/build.info
util/local_shlib.com.in [deleted file]
util/unlocal_shlib.com.in [deleted file]
util/wrap.pl.in

index 80120fdae1dd652766596f094b423318eb3117a6..c49d3e068debdaecd5c4443361df63d7d4e43b44 100644 (file)
@@ -1,8 +1,4 @@
-IF[{- $target{build_scheme}->[1] eq "VMS" -}]
- SCRIPTS{noinst}=local_shlib.com unlocal_shlib.com
- SOURCE[local_shlib.com]=local_shlib.com.in
- SOURCE[unlocal_shlib.com]=unlocal_shlib.com.in
-ELSIF[{- $target{build_scheme}->[1] eq "unix" -}]
+IF[{- $target{build_scheme}->[1] eq "unix" -}]
  SCRIPTS{noinst}=shlib_wrap.sh
  SOURCE[shlib_wrap.sh]=shlib_wrap.sh.in
 ENDIF
diff --git a/util/local_shlib.com.in b/util/local_shlib.com.in
deleted file mode 100644 (file)
index fbb648d..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-${-
-  use File::Spec::Functions qw(rel2abs);
-
-  my $bldtop = rel2abs($config{builddir});
-  our %names = ( map { platform->sharedname($_) =>
-                           $bldtop.platform->sharedlib($_) }
-                 grep { !$unified_info{attributes}->{libraries}->{$_}->{noinst} }
-                 @{$unified_info{libraries}} );
-  "" -}
-$       ! Create a local environment with the shared library logical names
-$       ! properly set.  Undo this with unlocal_shlib.com
-$
-$       OPENSSL_NAMES := OPENSSL_NAMES_'F$GETJPI("","PID")'
-$       CREATE/NAME_TABLE/PARENT_TABLE=LNM$PROCESS_DIRECTORY 'OPENSSL_NAMES'
-$       DEFINE/TABLE='OPENSSL_NAMES' OSSL_FLAG YES
-$
-$       NAMES := {- join(",", keys %names); -}
-{-
-  join("\n", map { "\$       __$_ = \"".$names{$_}."\"" } sort keys %names);
--}      
-$       I = 0
-$       LOOP:
-$           E = F$ELEMENT(I,",",NAMES)
-$           I = I + 1
-$           IF E .EQS. "," THEN GOTO ENDLOOP
-$           EV = __'E'
-$           OLDV = F$TRNLNM(E,"LNM$PROCESS")
-$           IF OLDV .NES. "" THEN DEFINE/TABLE='OPENSSL_NAMES' 'E' 'OLDV'
-$           DEFINE 'E' 'EV'
-$           GOTO LOOP
-$       ENDLOOP:
diff --git a/util/unlocal_shlib.com.in b/util/unlocal_shlib.com.in
deleted file mode 100644 (file)
index 17cb489..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-${-
-  use File::Spec::Functions qw(rel2abs);
-
-  my $bldtop = rel2abs($config{builddir});
-  our %names = ( map { platform->sharedname($_) =>
-                           $bldtop.platform->sharedlib($_) }
-                 grep { !$unified_info{attributes}->{libraries}->{$_}->{noinst} }
-                 @{$unified_info{libraries}} );
-  "" -}
-$       ! Remove the local environment created by local_shlib.com
-$
-$       OPENSSL_NAMES := OPENSSL_NAMES_'F$GETJPI("","PID")'
-$       IF F$TRNLNM("OSSL_FLAG",OPENSSL_NAMES) .EQS. "" THEN EXIT 0
-$
-$       NAMES := {- join(",", sort keys %names); -}
-$       I = 0
-$       LOOP:
-$           E = F$ELEMENT(I,",",NAMES)
-$           I = I + 1
-$           IF E .EQS. "," THEN GOTO ENDLOOP
-$           OLDV = F$TRNLNM(E,OPENSSL_NAMES)
-$           DEASSIGN 'E'
-$           IF OLDV .NES. "" THEN DEFINE 'E' 'OLDV'
-$           GOTO LOOP
-$       ENDLOOP:
-$
-$       DEASSIGN 'OPENSSL_NAMES' /TABLE=LNM$PROCESS_DIRECTORY
index 5126513d4c3e91a58273f0d425b5bca60ad4dd1d..7d11cb7c271e37eabe3077edb6deff67e674b4c8 100644 (file)
@@ -23,6 +23,7 @@ my $std_engines = catdir($there, 'engines');
 my $std_providers = catdir($there, 'providers');
 my $std_openssl_conf = catdir($there, 'apps/openssl.cnf');
 my $unix_shlib_wrap = catfile($there, 'util/shlib_wrap.sh');
+my $std_openssl_conf_include;
 
 if ($ARGV[0] eq '-fips') {
     $std_openssl_conf = {-
@@ -32,19 +33,36 @@ if ($ARGV[0] eq '-fips') {
          -};
     shift;
 
-    my $std_openssl_conf_include = catdir($there, 'providers');
-    $ENV{OPENSSL_CONF_INCLUDE} = $std_openssl_conf_include
-        if ($ENV{OPENSSL_CONF_INCLUDE} // '') eq ''
-            && -d $std_openssl_conf_include;
+    $std_openssl_conf_include = catdir($there, 'providers');
 }
 
-$ENV{OPENSSL_ENGINES} = $std_engines
+local $ENV{OPENSSL_CONF_INCLUDE} = $std_openssl_conf_include
+    if defined $std_openssl_conf_include
+       &&($ENV{OPENSSL_CONF_INCLUDE} // '') eq ''
+       && -d $std_openssl_conf_include;
+local $ENV{OPENSSL_ENGINES} = $std_engines
     if ($ENV{OPENSSL_ENGINES} // '') eq '' && -d $std_engines;
-$ENV{OPENSSL_MODULES} = $std_providers
+local $ENV{OPENSSL_MODULES} = $std_providers
     if ($ENV{OPENSSL_MODULES} // '') eq '' && -d $std_providers;
-$ENV{OPENSSL_CONF} = $std_openssl_conf
+local $ENV{OPENSSL_CONF} = $std_openssl_conf
     if ($ENV{OPENSSL_CONF} // '') eq '' && -f $std_openssl_conf;
-
+{-
+     # For VMS, we define logical names to get the libraries properly
+     # defined.
+     use File::Spec::Functions qw(rel2abs);
+
+     if ($^O eq "VMS") {
+         my $bldtop = rel2abs($config{builddir});
+         my %names =
+             map { platform->sharedname($_) => $bldtop.platform->sharedlib($_) }
+             grep { !$unified_info{attributes}->{libraries}->{$_}->{noinst} }
+             @{$unified_info{libraries}};
+
+         foreach (sort keys %names) {
+             $OUT .= "local \$ENV\{'$_'\} = '$names{$_}';\n";
+         }
+     }
+-}
 my $use_system = 0;
 my @cmd;