]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
VMS: For executables, process the use of /INCLUDE=main a bit differently
authorRichard Levitte <levitte@openssl.org>
Wed, 5 Oct 2022 10:47:32 +0000 (12:47 +0200)
committerRichard Levitte <levitte@openssl.org>
Thu, 6 Oct 2022 14:06:44 +0000 (16:06 +0200)
The way it was implemented didn't play well with perl's join(), so it's
reimplemented a bit differently.

Reviewed-by: Tim Hudson <tjh@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/19347)

Configurations/descrip.mms.tmpl

index 2de2d6d633f53edda6cc1349cdb58a3e257626ae..c777bc636efcca464184a4808aef490731c4f723 100644 (file)
@@ -1352,14 +1352,15 @@ EOF
                 (map { my $x = $_ =~ /\[/ ? $_ : "[]".$_;
                        "\@ WRITE OPT_FILE \"$x" } @objs),
                 (map { my $x = ($_->{lib} =~ /\[/) ? $_->{lib} : "[]".$_->{lib};
-                       # Special hack to include the MAIN object
-                       # module explicitly.  This will only be done
-                       # if there isn't a 'main' in the program's
-                       # object modules already.
-                       my $main = $_->{attrs}->{has_main}
-                           ? '/INCLUDE=main' : '';
-                       ( "\@ IF nomain THEN WRITE OPT_FILE \"$x/LIB$main",
-                         "\@ IF .NOT. nomain THEN WRITE OPT_FILE \"$x/LIB" ) }
+                       # Special hack to include the MAIN object module
+                       # explicitly, if it's known that there is one.
+                       # |incmain| is defined in the rule generation further
+                       # down, with the necessary /INCLUDE=main option unless
+                       # the program has been determined to have a main function
+                       # already.
+                       $_->{attrs}->{has_main}
+                       ? "\@ WRITE OPT_FILE \"$x/LIB''incmain'"
+                       : "\@ WRITE OPT_FILE \"$x/LIB" }
                  grep { $_->{lib} =~ m|\.OLB$| }
                  @deps))
           ."\"";
@@ -1391,6 +1392,8 @@ EOF
       return <<"EOF"
 $bin : $deps
         $analyse_objs
+        @ incmain = "/INCLUDE=main"
+        @ IF .NOT. nomain THEN incmain = ""
         @ OPEN/WRITE/SHARE=READ OPT_FILE $binname.OPT
         $write_opt1
         $write_opt2