aboutsummaryrefslogtreecommitdiffstats
path: root/Configurations
diff options
context:
space:
mode:
authorRichard Levitte <levitte@openssl.org>2017-04-19 12:32:42 +0200
committerRichard Levitte <levitte@openssl.org>2017-04-24 18:09:01 +0200
commitb3e5db40eca1b53fc37a95163feba0da82426142 (patch)
tree6257412f15da3bc3aec33b5be2def4da4981e02a /Configurations
parent4db40c94c38ee94fbef820a9816ac2d68f65506e (diff)
downloadopenssl-b3e5db40eca1b53fc37a95163feba0da82426142.tar.gz
VMS: Make sure to include MAIN from static libraries if needed
Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/3243)
Diffstat (limited to 'Configurations')
-rw-r--r--Configurations/descrip.mms.tmpl35
1 files changed, 27 insertions, 8 deletions
diff --git a/Configurations/descrip.mms.tmpl b/Configurations/descrip.mms.tmpl
index 27b407d028..e0ded0b667 100644
--- a/Configurations/descrip.mms.tmpl
+++ b/Configurations/descrip.mms.tmpl
@@ -756,21 +756,38 @@ EOF
my $bind = dirname($bin);
my $binn = basename($bin);
my @objs = map { "$_.OBJ" } @{$args{objs}};
+ my $objs = join(",", @objs);
my @deps = compute_lib_depends(@{$args{deps}});
my $deps = join(", -\n\t\t", @objs, @deps);
+
+ my $olb_count = scalar grep(m|\.OLB$|, @deps);
+ my $analyse_objs = "@ !";
+ if ($olb_count > 0) {
+ my $analyse_quals =
+ $config{target} =~ m|alpha| ? "/GSD" : "/SECTIONS=SYMTAB";
+ $analyse_objs = "- pipe ANALYSE/OBJECT$analyse_quals $objs | SEARCH SYS\$INPUT \"\"\"main\"\"\" ; nomain = \$severity .NE. 1"
+ }
# The "[]" hack is because in .OPT files, each line inherits the
# previous line's file spec as default, so if no directory spec
# is present in the current line and the previous line has one that
# doesn't apply, you're in for a surprise.
my $write_opt1 =
join(",-\"\n\t", map { my $x = $_ =~ /\[/ ? $_ : "[]".$_;
- "WRITE OPT_FILE \"$x" } @objs).
+ "\@ WRITE OPT_FILE \"$x" } @objs).
"\"";
my $write_opt2 =
- join("\n\t", map { my $x = $_ =~ /\[/ ? $_ : "[]".$_;
- $x =~ s|(\.EXE)|$1/SHARE|;
- $x =~ s|(\.OLB)|$1/LIB|;
- "WRITE OPT_FILE \"$x\"" } @deps)
+ join("\n\t", map { my @lines = ();
+ my $x = $_ =~ /\[/ ? $_ : "[]".$_;
+ if ($x =~ m|\.EXE$|) {
+ push @lines, "\@ WRITE OPT_FILE \"$x/SHARE\"";
+ } elsif ($x =~ m|\.OLB$|) {
+ (my $l = $x) =~ s/\W/_/g;
+ push @lines,
+ "\@ IF nomain THEN WRITE OPT_FILE \"$x/LIB\$(INCLUDE_MAIN_$l)\"",
+ "\@ IF .NOT. nomain THEN WRITE OPT_FILE \"$x/LIB\""
+ }
+ @lines
+ } @deps)
|| "\@ !";
# The linking commands looks a bit complex, but it's for good reason.
# When you link, say, foo.obj, bar.obj and libsomething.exe/share, and
@@ -792,10 +809,12 @@ EOF
# and let it break the build.
return <<"EOF"
$bin.EXE : $deps
- OPEN/WRITE/SHARE=READ OPT_FILE $bin.OPT
+ $analyse_objs
+ @ OPEN/WRITE/SHARE=READ OPT_FILE $bin.OPT
$write_opt1
$write_opt2
- CLOSE OPT_FILE
+ @ CLOSE OPT_FILE
+ TYPE $bin.opt ! For debugging
- pipe SPAWN/WAIT/NOLOG/OUT=$bin.LINKLOG -
LINK \$(LDFLAGS)/EXEC=\$\@ $bin.OPT/OPT \$(EX_LIBS) ; -
link_status = \$status ; link_severity = link_status .AND. 7
@@ -817,7 +836,7 @@ $bin.EXE : $deps
@ IF .NOT. link_severity THEN SPAWN/WAIT/NOLOG EXIT 'link_status'
- PURGE $bin.EXE,$bin.OPT
EOF
- . ($config{target} =~ m|alpha| ? "" : <<"EOF"
+ . ($config{target} =~ m|alpha| ? "" : <<"EOF"
SET IMAGE/FLAGS=(NOCALL_DEBUG) \$\@
EOF
);