1 ## descrip.mms to build OpenSSL on OpenVMS
3 ## {- join("\n## ", @autowarntext) -}
5 use File::Spec::Functions qw/:DEFAULT abs2rel rel2abs/;
8 (our $osslprefix_q = platform->osslprefix()) =~ s/\$/\\\$/;
10 our $sover_dirname = platform->shlib_version_as_filename();
11 our $osslver = sprintf "%02d%02d", split(/\./, $config{version});
13 our $sourcedir = $config{sourcedir};
14 our $builddir = $config{builddir};
16 catfile($sourcedir, @_);
19 catfile($builddir, @_);
22 catdir($sourcedir, @_);
25 catdir($builddir, @_);
28 (my $x = shift) =~ s|\]$|...]|;
33 my $b = abs2rel(rel2abs("."),rel2abs($f));
34 $sourcedir = catdir($b,$sourcedir)
35 if !file_name_is_absolute($sourcedir);
36 $builddir = catdir($b,$builddir)
37 if !file_name_is_absolute($builddir);
41 # Because we need to make two computations of these data,
42 # we store them in arrays for reuse
44 map { platform->staticname($_) }
45 @{$unified_info{libraries}};
47 map { platform->sharedname($_) // () }
48 @{$unified_info{libraries}};
50 map { platform->staticname($_) }
51 grep { !$unified_info{attributes}->{libraries}->{$_}->{noinst} }
52 @{$unified_info{libraries}};
54 map { platform->sharedname($_) // () }
55 grep { !$unified_info{attributes}->{libraries}->{$_}->{noinst} }
56 @{$unified_info{libraries}};
57 our @install_engines =
58 grep { !$unified_info{attributes}->{modules}->{$_}->{noinst}
59 && $unified_info{attributes}->{modules}->{$_}->{engine} }
60 @{$unified_info{modules}};
61 our @install_programs =
62 grep { !$unified_info{attributes}->{programs}->{$_}->{noinst} }
63 @{$unified_info{programs}};
64 our @install_bin_scripts =
65 grep { !$unified_info{attributes}->{scripts}->{$_}->{noinst}
66 && !$unified_info{attributes}->{scripts}->{$_}->{misc} }
67 @{$unified_info{scripts}};
68 our @install_misc_scripts =
69 grep { !$unified_info{attributes}->{scripts}->{$_}->{noinst}
70 && $unified_info{attributes}->{scripts}->{$_}->{misc} }
71 @{$unified_info{scripts}};
73 # This is a horrible hack, but is needed because recursive inclusion of files
74 # in different directories does not work well with HP C.
75 my $sd = sourcedir("crypto", "async", "arch");
76 foreach (grep /\[\.crypto\.async\.arch\].*\.o$/, keys %{$unified_info{sources}}) {
77 my $obj = platform->obj($_);
78 $unified_info{before}->{$obj}
79 = qq(arch_include = F\$PARSE("$sd","A.;",,,"SYNTAX_ONLY") - "A.;"
80 define arch 'arch_include');
81 $unified_info{after}->{$obj}
84 my $sd1 = sourcedir("ssl","record");
85 my $sd2 = sourcedir("ssl","statem");
86 my @ssl_locl_users = grep(/^\[\.(?:ssl\.(?:record|statem)|test)\].*\.o$/,
87 keys %{$unified_info{sources}});
88 foreach (@ssl_locl_users) {
89 my $obj = platform->obj($_);
90 $unified_info{before}->{$obj}
91 = qq(record_include = F\$PARSE("$sd1","A.;",,,"SYNTAX_ONLY") - "A.;"
92 define record 'record_include'
93 statem_include = F\$PARSE("$sd2","A.;",,,"SYNTAX_ONLY") - "A.;"
94 define statem 'statem_include');
95 $unified_info{after}->{$obj}
99 # This makes sure things get built in the order they need
100 # to. You're welcome.
104 return "$target : build_generated\n\t\pipe \$(MMS) \$(MMSQUALIFIERS) depend && \$(MMS) \$(MMSQUALIFIERS) _$target\n_$target";
108 PLATFORM={- $config{target} -}
109 OPTIONS={- $config{options} -}
110 CONFIGURE_ARGS=({- join(", ",quotify_l(@{$config{perlargv}})) -})
111 SRCDIR={- $config{sourcedir} -}
112 BLDDIR={- $config{builddir} -}
114 # Allow both V and VERBOSE to indicate verbosity. This only applies
117 VERBOSE_FAILURE=$(VF)
119 VERSION={- "$config{full_version}" -}
120 MAJOR={- $config{major} -}
121 MINOR={- $config{minor} -}
122 SHLIB_VERSION_NUMBER={- $config{shlib_version} -}
123 SHLIB_TARGET={- $target{shared_target} -}
125 LIBS={- join(", ", map { "-\n\t".$_.".OLB" } @libs) -}
126 SHLIBS={- join(", ", map { "-\n\t".$_.".EXE" } @shlibs) -}
127 MODULES={- join(", ", map { "-\n\t".$_.".EXE" } @{$unified_info{modules}}) -}
128 PROGRAMS={- join(", ", map { "-\n\t".$_.".EXE" } @{$unified_info{programs}}) -}
129 SCRIPTS={- join(", ", map { "-\n\t".$_ } @{$unified_info{scripts}}) -}
130 {- output_off() if $disabled{makedepend}; "" -}
131 DEPS={- our @deps = map { platform->isobj($_) ? platform->dep($_) : $_ }
132 grep { $unified_info{sources}->{$_}->[0] =~ /\.c$/ }
133 keys %{$unified_info{sources}};
134 join(", ", map { "-\n\t".$_ } @deps); -}
135 {- output_on() if $disabled{makedepend}; "" -}
136 GENERATED_MANDATORY={- join(", ", map { "-\n\t".$_ } @{$unified_info{depends}->{""}} ) -}
137 GENERATED={- # common0.tmpl provides @generated
138 join(", ", map { platform->convertext($_) } @generated) -}
140 INSTALL_LIBS={- join(", ", map { "-\n\t".$_.".OLB" } @install_libs) -}
141 INSTALL_SHLIBS={- join(", ", map { "-\n\t".$_.".EXE" } @install_shlibs) -}
142 INSTALL_ENGINES={- join(", ", map { "-\n\t".$_.".EXE" } @install_engines) -}
143 INSTALL_PROGRAMS={- join(", ", map { "-\n\t".$_.".EXE" } @install_programs) -}
144 BIN_SCRIPTS={- join(", ", @install_bin_scripts) -}
145 MISC_SCRIPTS={- join(", ", @install_misc_scripts) -}
146 HTMLDOCS1={- join(", ", map { "-\n\t".$_ } @{$unified_info{htmldocs}->{man1}}) -}
147 HTMLDOCS3={- join(", ", map { "-\n\t".$_ } @{$unified_info{htmldocs}->{man3}}) -}
148 HTMLDOCS5={- join(", ", map { "-\n\t".$_ } @{$unified_info{htmldocs}->{man5}}) -}
149 HTMLDOCS7={- join(", ", map { "-\n\t".$_ } @{$unified_info{htmldocs}->{man7}}) -}
151 APPS_OPENSSL={- use File::Spec::Functions;
152 catfile("apps","openssl") -}
154 # DESTDIR is for package builders so that they can configure for, say,
155 # SYS$COMMON:[OPENSSL] and yet have everything installed in STAGING:[USER].
156 # In that case, configure with --prefix=SYS$COMMON:[OPENSSL] and then run
157 # MMS with /MACROS=(DESTDIR=STAGING:[USER]). The result will end up in
158 # STAGING:[USER.OPENSSL].
159 # Normally it is left empty.
162 # Do not edit this manually. Use Configure --prefix=DIR to change this!
163 INSTALLTOP={- our $installtop =
164 catdir($config{prefix}) || "SYS\$COMMON:[OPENSSL]";
166 SYSTARTUP={- catdir($installtop, '[.SYS$STARTUP]'); -}
167 # This is the standard central area to store certificates, private keys...
168 OPENSSLDIR={- catdir($config{openssldir}) or
169 $config{prefix} ? catdir($config{prefix},"COMMON")
170 : "SYS\$COMMON:[OPENSSL-COMMON]" -}
171 # The same, but for C
172 OPENSSLDIR_C={- platform->osslprefix() -}DATAROOT:[000000]
173 # Where installed ENGINE modules reside, for C
174 ENGINESDIR_C={- platform->osslprefix() -}ENGINES{- $sover_dirname.$target{pointer_size} -}:
175 # Where modules reside, for C
176 MODULESDIR_C={- platform->osslprefix() -}MODULES{- $sover_dirname.$target{pointer_size} -}:
178 ##### User defined commands and flags ################################
181 CPP={- $config{CPP} -}
182 DEFINES={- our $defines1 = join('', map { ",$_" } @{$config{CPPDEFINES}}) -}
183 INCLUDES={- our $includes1 = join(',', @{$config{CPPINCLUDES}}) -}
184 CPPFLAGS={- our $cppflags1 = join('', @{$config{CPPFLAGS}}) -}
185 CFLAGS={- join('', @{$config{CFLAGS}}) -}
186 LDFLAGS={- join('', @{$config{LFLAGS}}) -}
187 EX_LIBS={- join('', map { ",$_" } @{$config{LDLIBS}}) -}
189 PERL={- $config{PERL} -}
192 ASFLAGS={- join(' ', @{$config{ASFLAGS}}) -}
194 ##### Special command flags ##########################################
196 ASOUTFLAG={- $target{asoutflag} -}$(OSSL_EMPTY)
198 ##### Project flags ##################################################
200 # Variables starting with CNF_ are common variables for all product types
202 CNF_ASFLAGS={- join('', $target{asflags} || (),
203 @{$config{asflags}}) -}
204 CNF_DEFINES={- our $defines2 = join('', (map { ",$_" } @{$target{defines}},
205 @{$config{defines}}),
207 CNF_INCLUDES={- our $includes2 = join(',', @{$target{includes}},
208 @{$config{includes}}) -}
209 CNF_CPPFLAGS={- our $cppflags2 = join('', $target{cppflags} || (),
210 @{$config{cppflags}}) -}
211 CNF_CFLAGS={- join('', $target{cflags} || (),
212 @{$config{cflags}}) -}
213 CNF_CXXFLAGS={- join('', $target{cxxflags} || (),
214 @{$config{cxxflags}}) -}
215 CNF_LDFLAGS={- join('', $target{lflags} || (),
216 @{$config{lflags}}) -}
217 CNF_EX_LIBS={- join('', map{ ",$_" } @{$target{ex_libs}},
218 @{$config{ex_libs}}) -}
220 # Variables starting with LIB_ are used to build library object files
221 # and shared libraries.
222 # Variables starting with DSO_ are used to build DSOs and their object files.
223 # Variables starting with BIN_ are used to build programs and their object
226 LIB_ASFLAGS={- join(' ', $target{lib_asflags} || (),
227 @{$config{lib_asflags}},
228 '$(CNF_ASFLAGS)', '$(ASFLAGS)') -}
229 LIB_DEFINES={- our $lib_defines =
230 join('', (map { ",$_" } @{$target{lib_defines}},
231 @{$target{shared_defines}},
232 @{$config{lib_defines}},
233 @{$config{shared_defines}}));
234 join('', $lib_defines,
235 (map { ",$_" } 'OPENSSLDIR="""$(OPENSSLDIR_C)"""',
236 'ENGINESDIR="""$(ENGINESDIR_C)"""',
237 'MODULESDIR="""$(MODULESDIR_C)"""'),
238 '$(CNF_DEFINES)', '$(DEFINES)') -}
239 LIB_INCLUDES={- our $lib_includes =
240 join(',', @{$target{lib_includes}},
241 @{$target{shared_includes}},
242 @{$config{lib_includes}},
243 @{$config{shared_includes}}) -}
244 LIB_CPPFLAGS={- our $lib_cppflags =
245 join('', $target{lib_cppflags} || (),
246 $target{shared_cppflags} || (),
247 @{$config{lib_cppflags}},
248 @{$config{shared_cppflag}});
249 join('', "'qual_includes'",
250 '/DEFINE=(__dummy$(LIB_DEFINES))',
252 '$(CNF_CPPFLAGS)', '$(CPPFLAGS)') -}
253 LIB_CFLAGS={- join('', $target{lib_cflags} || (),
254 $target{shared_cflag} || (),
255 @{$config{lib_cflags}},
256 @{$config{shared_cflag}},
257 '$(CNF_CFLAGS)', '$(CFLAGS)') -}
258 LIB_LDFLAGS={- join('', $target{lib_lflags} || (),
259 $target{shared_ldflag} || (),
260 @{$config{lib_lflags}},
261 @{$config{shared_ldflag}},
262 '$(CNF_LDFLAGS)', '$(LDFLAGS)') -}
263 LIB_EX_LIBS=$(CNF_EX_LIBS)$(EX_LIBS)
264 DSO_ASFLAGS={- join(' ', $target{dso_asflags} || (),
265 $target{module_asflags} || (),
266 @{$config{dso_asflags}},
267 @{$config{module_asflags}},
268 '$(CNF_ASFLAGS)', '$(ASFLAGS)') -}
269 DSO_DEFINES={- join('', (map { ",$_" } @{$target{dso_defines}},
270 @{$target{module_defines}},
271 @{$config{dso_defines}},
272 @{$config{module_defines}}),
273 '$(CNF_DEFINES)', '$(DEFINES)') -}
274 DSO_INCLUDES={- join(',', @{$target{dso_includes}},
275 @{$target{module_includes}},
276 @{$config{dso_includes}},
277 @{$config{module_includes}}) -}
278 DSO_CPPFLAGS={- join('', "'qual_includes'",
279 '/DEFINE=(__dummy$(DSO_DEFINES))',
280 $target{dso_cppflags} || (),
281 $target{module_cppflags} || (),
282 @{$config{dso_cppflags}},
283 @{$config{module_cppflags}},
284 '$(CNF_CPPFLAGS)', '$(CPPFLAGS)') -}
285 DSO_CFLAGS={- join('', $target{dso_cflags} || (),
286 $target{module_cflags} || (),
287 @{$config{dso_cflags}},
288 @{$config{module_cflags}},
289 '$(CNF_CFLAGS)', '$(CFLAGS)') -}
290 DSO_LDFLAGS={- join('', $target{dso_lflags} || (),
291 $target{module_ldflags} || (),
292 @{$config{dso_lflags}},
293 @{$config{module_ldflags}},
294 '$(CNF_LDFLAGS)', '$(LDFLAGS)') -}
295 DSO_EX_LIBS=$(CNF_EX_LIBS) $(EX_LIBS)
296 BIN_ASFLAGS={- join(' ', $target{bin_asflags} || (),
297 @{$config{bin_asflags}},
298 '$(CNF_ASFLAGS)', '$(ASFLAGS)') -}
299 BIN_DEFINES={- join('', (map { ",$_" } @{$target{bin_defines}},
300 @{$config{bin_defines}}),
301 '$(CNF_DEFINES)', '$(DEFINES)') -}
302 BIN_INCLUDES={- join(',', @{$target{bin_includes}},
303 @{$config{bin_includes}}) -}
304 BIN_CPPFLAGS={- join('', "'qual_includes'",
305 '/DEFINE=(__dummy$(DSO_DEFINES))',
306 $target{bin_cppflags} || (),
307 @{$config{bin_cppflag}},
308 '$(CNF_CPPFLAGS)', '$(CPPFLAGS)') -}
309 BIN_CFLAGS={- join('', $target{bin_cflags} || (),
310 @{$config{bin_cflags}},
311 '$(CNF_CFLAGS)', '$(CFLAGS)') -}
312 BIN_LDFLAGS={- join('', $target{bin_lflags} || (),
313 @{$config{bin_lflags}} || (),
314 '$(CNF_LDFLAGS)', '$(LDFLAGS)') -}
315 BIN_EX_LIBS=$(CNF_EX_LIBS) $(EX_LIBS)
316 NO_INST_LIB_CFLAGS={- join('', $target{no_inst_lib_cflags}
317 // $target{lib_cflags}
319 $target{shared_cflag} || (),
320 @{$config{lib_cflags}},
321 @{$config{shared_cflag}},
322 '$(CNF_CFLAGS)', '$(CFLAGS)') -}
323 NO_INST_DSO_CFLAGS={- join('', $target{no_inst_dso_cflags}
324 // $target{dso_cflags}
326 $target{no_inst_module_cflags}
327 // $target{module_cflags}
329 @{$config{dso_cflags}},
330 @{$config{module_cflags}},
331 '$(CNF_CFLAGS)', '$(CFLAGS)') -}
332 NO_INST_BIN_CFLAGS={- join('', $target{no_inst_bin_cflags}
333 // $target{bin_cflags}
335 @{$config{bin_cflags}},
336 '$(CNF_CFLAGS)', '$(CFLAGS)') -}
338 PERLASM_SCHEME={- $target{perlasm_scheme} -}
340 # CPPFLAGS_Q is used for one thing only: to build up buildinf.h
341 CPPFLAGS_Q={- (my $c = $lib_cppflags.$cppflags2.$cppflags1) =~ s|"|""|g;
342 (my $d = $lib_defines.$defines2.$defines1) =~ s|"|""|g;
343 my $i = join(',', $lib_includes || (), $includes2 || (),
346 $x .= "/INCLUDE=($i)" if $i;
347 $x .= "/DEFINE=($d)" if $d;
350 # .FIRST and .LAST are special targets with MMS and MMK.
351 # The defines in there are for C. includes that look like
354 # #include <openssl/foo.h>
355 # #include "internal/bar.h"
357 # will use the logical names to find the files. Expecting
358 # DECompHP C to find files in subdirectories of whatever was
359 # given with /INCLUDE is a fantasy, unfortunately.
362 $(NODEBUG) openssl_inc1 = F$PARSE("[.include.openssl]","A.;",,,"syntax_only") - "A.;"
363 $(NODEBUG) openssl_inc2 = F$PARSE("{- catdir($config{sourcedir},"[.include.openssl]") -}","A.;",,,"SYNTAX_ONLY") - "A.;"
364 $(NODEBUG) internal_inc1 = F$PARSE("[.crypto.include.internal]","A.;",,,"SYNTAX_ONLY") - "A.;"
365 $(NODEBUG) internal_inc2 = F$PARSE("{- catdir($config{sourcedir},"[.include.internal]") -}","A.;",,,"SYNTAX_ONLY") - "A.;"
366 $(NODEBUG) internal_inc3 = F$PARSE("{- catdir($config{sourcedir},"[.crypto.include.internal]") -}","A.;",,,"SYNTAX_ONLY") - "A.;"
367 $(NODEBUG) DEFINE openssl 'openssl_inc1','openssl_inc2'
368 $(NODEBUG) DEFINE internal 'internal_inc1','internal_inc2','internal_inc3'
369 $(NODEBUG) staging_dir = "$(DESTDIR)"
370 $(NODEBUG) staging_instdir = ""
371 $(NODEBUG) staging_datadir = ""
372 $(NODEBUG) IF staging_dir .NES. "" THEN -
373 staging_instdir = F$PARSE("A.;",staging_dir,"[]",,"SYNTAX_ONLY")
374 $(NODEBUG) IF staging_instdir - "]A.;" .NES. staging_instdir THEN -
375 staging_instdir = staging_instdir - "]A.;" + ".OPENSSL-INSTALL]"
376 $(NODEBUG) IF staging_instdir - "A.;" .NES. staging_instdir THEN -
377 staging_instdir = staging_instdir - "A.;" + "[OPENSSL-INSTALL]"
378 $(NODEBUG) IF staging_dir .NES. "" THEN -
379 staging_datadir = F$PARSE("A.;",staging_dir,"[]",,"SYNTAX_ONLY")
380 $(NODEBUG) IF staging_datadir - "]A.;" .NES. staging_datadir THEN -
381 staging_datadir = staging_datadir - "]A.;" + ".OPENSSL-COMMON]"
382 $(NODEBUG) IF staging_datadir - "A.;" .NES. staging_datadir THEN -
383 staging_datadir = staging_datadir - "A.;" + "[OPENSSL-COMMON]"
385 $(NODEBUG) ! Installation logical names
387 $(NODEBUG) installtop = F$PARSE(staging_instdir,"$(INSTALLTOP)","[]A.;",,"SYNTAX_ONLY,NO_CONCEAL") - ".][000000" - "[000000." - "][" - "]A.;" + ".]"
388 $(NODEBUG) datatop = F$PARSE(staging_datadir,"$(OPENSSLDIR)","[]A.;",,"SYNTAX_ONLY,NO_CONCEAL") - ".][000000" - "[000000." - "][" - "]A.;" + ".]"
389 $(NODEBUG) DEFINE ossl_installroot 'installtop'
390 $(NODEBUG) DEFINE ossl_dataroot 'datatop'
392 $(NODEBUG) ! Figure out the architecture
394 $(NODEBUG) arch = f$edit( f$getsyi( "arch_name"), "upcase")
396 $(NODEBUG) ! Set up logical names for the libraries, so LINK and
397 $(NODEBUG) ! running programs can use them.
399 $(NODEBUG) {- join("\n\t\$(NODEBUG) ", map { "DEFINE ".uc($_)." 'F\$ENV(\"DEFAULT\")'".uc($_)."\$(SHLIB_EXT)" } @shlibs) || "!" -}
402 $(NODEBUG) {- join("\n\t\$(NODEBUG) ", map { "DEASSIGN ".uc($_) } @shlibs) || "!" -}
403 $(NODEBUG) DEASSIGN ossl_dataroot
404 $(NODEBUG) DEASSIGN ossl_installroot
405 $(NODEBUG) DEASSIGN internal
406 $(NODEBUG) DEASSIGN openssl
408 @ ! MMS cannot handle no actions...
410 # The main targets ###################################################
412 {- dependmagic('build_sw'); -} : build_libs_nodep, build_modules_nodep, build_programs_nodep
413 {- dependmagic('build_libs'); -} : build_libs_nodep
414 {- dependmagic('build_modules'); -} : build_modules_nodep
415 {- dependmagic('build_programs'); -} : build_programs_nodep
417 build_generated : $(GENERATED_MANDATORY)
418 build_libs_nodep : $(LIBS), $(SHLIBS)
419 build_modules_nodep : $(MODULES)
420 build_programs_nodep : $(PROGRAMS), $(SCRIPTS)
422 build_docs: build_html_docs
423 build_html_docs: $(HTMLDOCS1) $(HTMLDOCS3) $(HTMLDOCS5) $(HTMLDOCS7)
425 # Kept around for backward compatibility
426 build_apps build_tests : build_programs
428 # Convenience target to prebuild all generated files, not just the mandatory
430 build_all_generated : $(GENERATED_MANDATORY) $(GENERATED) build_docs
431 @ ! {- output_off() if $disabled{makedepend}; "" -}
432 @ WRITE SYS$OUTPUT "Warning: consider configuring with no-makedepend, because if"
433 @ WRITE SYS$OUTPUT " target system doesn't have $(PERL),"
434 @ WRITE SYS$OUTPUT " then make will fail..."
435 @ ! {- output_on() if $disabled{makedepend}; "" -}
437 all : build_sw build_docs
440 {- dependmagic('tests'); -} : build_programs_nodep, build_modules_nodep
441 @ ! {- output_off() if $disabled{tests}; "" -}
442 SET DEFAULT [.test]{- move("test") -}
443 CREATE/DIR [.test-runs]
444 DEFINE SRCTOP {- sourcedir() -}
445 DEFINE BLDTOP {- builddir() -}
446 DEFINE RESULT_D {- builddir(qw(test test-runs)) -}
447 DEFINE OPENSSL_ENGINES {- builddir("engines") -}
448 DEFINE OPENSSL_MODULES {- builddir("providers") -}
449 IF "$(VERBOSE)" .NES. "" THEN DEFINE VERBOSE "$(VERBOSE)"
450 $(PERL) {- sourcefile("test", "run_tests.pl") -} $(TESTS)
451 DEASSIGN OPENSSL_MODULES
452 DEASSIGN OPENSSL_ENGINES
455 SET DEFAULT [-]{- move("..") -}
456 @ ! {- if ($disabled{tests}) { output_on(); } else { output_off(); } "" -}
457 @ WRITE SYS$OUTPUT "Tests are not supported with your chosen Configure options"
458 @ ! {- output_on() if !$disabled{tests}; "" -}
461 @ ! {- output_off() if $disabled{tests}; "" -}
462 @ DEFINE SRCTOP {- sourcedir() -}
463 @ $(PERL) {- sourcefile("test", "run_tests.pl") -} list
465 @ ! {- if ($disabled{tests}) { output_on(); } else { output_off(); } "" -}
466 @ WRITE SYS$OUTPUT "Tests are not supported with your chosen Configure options"
467 @ ! {- output_on() if !$disabled{tests}; "" -}
469 install : install_sw install_ssldirs install_docs install_final
472 @ WRITE SYS$OUTPUT ""
473 @ WRITE SYS$OUTPUT "######################################################################"
474 @ WRITE SYS$OUTPUT ""
475 @ IF "$(DESTDIR)" .EQS. "" THEN -
476 PIPE ( WRITE SYS$OUTPUT "Installation complete" ; -
477 WRITE SYS$OUTPUT "" ; -
478 WRITE SYS$OUTPUT "Run @$(SYSTARTUP)openssl_startup{- $osslver -} to set up logical names" ; -
479 WRITE SYS$OUTPUT "then run @$(SYSTARTUP)openssl_utils{- $osslver -} to define commands" ; -
480 WRITE SYS$OUTPUT "" )
481 @ IF "$(DESTDIR)" .NES. "" THEN -
482 PIPE ( WRITE SYS$OUTPUT "Staging installation complete" ; -
483 WRITE SYS$OUTPUT "" ; -
484 WRITE SYS$OUTPUT "Finish or package in such a way that the contents of the directory tree" ; -
485 WRITE SYS$OUTPUT staging_instdir ; -
486 WRITE SYS$OUTPUT "ends up in $(INSTALLTOP)," ; -
487 WRITE SYS$OUTPUT "and that the contents of the contents of the directory tree" ; -
488 WRITE SYS$OUTPUT staging_datadir ; -
489 WRITE SYS$OUTPUT "ends up in $(OPENSSLDIR)" ; -
490 WRITE SYS$OUTPUT "" ; -
491 WRITE SYS$OUTPUT "When in its final destination," ; -
492 WRITE SYS$OUTPUT "Run @$(SYSTARTUP)openssl_startup{- $osslver -} to set up logical names" ; -
493 WRITE SYS$OUTPUT "then run @$(SYSTARTUP)openssl_utils{- $osslver -} to define commands" ; -
494 WRITE SYS$OUTPUT "" )
497 spawn/nolog @ossl_installroot:[SYSTEST]openssl_ivp{- $osslver -}.com
499 uninstall : uninstall_docs uninstall_sw
501 # Because VMS wants the generation number (or *) to delete files, we can't
502 # use $(LIBS), $(PROGRAMS), $(GENERATED) and $(MODULES) directly.
504 {- join("\n\t", map { "- DELETE $_.OLB;*" } @libs) || "@ !" -}
505 {- join("\n\t", map { "- DELETE $_.EXE;*,$_.MAP;*" } @shlibs) || "@ !" -}
508 {- join("\n\t", map { "- DELETE $_;*" } @{$unified_info{htmldocs}->{man1}}) || "@ !" -}
509 {- join("\n\t", map { "- DELETE $_;*" } @{$unified_info{htmldocs}->{man3}}) || "@ !" -}
510 {- join("\n\t", map { "- DELETE $_;*" } @{$unified_info{htmldocs}->{man5}}) || "@ !" -}
511 {- join("\n\t", map { "- DELETE $_;*" } @{$unified_info{htmldocs}->{man7}}) || "@ !" -}
512 {- join("\n\t", map { "- DELETE $_.EXE;*,$_.OPT;*" } @{$unified_info{programs}}) || "@ !" -}
513 {- join("\n\t", map { "- DELETE $_.EXE;*,$_.OPT;*" } @{$unified_info{modules}}) || "@ !" -}
514 {- join("\n\t", map { "- DELETE $_;*" } @{$unified_info{scripts}}) || "@ !" -}
515 {- join("\n\t", map { "- DELETE $_;*" } @{$unified_info{depends}->{""}}) || "@ !" -}
516 {- join("\n\t", map { "- DELETE $_;*" } @generated) || "@ !" -}
517 - DELETE [...]*.MAP;*
519 - DELETE [...]*.OBJ;*,*.LIS;*
520 - DELETE []CXX$DEMANGLER_DB.;*
521 - DELETE [.VMS]openssl_startup.com;*
522 - DELETE [.VMS]openssl_shutdown.com;*
523 - DELETE []vmsconfig.pm;*
526 - DELETE configdata.pm;*
527 - DELETE descrip.mms;*
531 @ ! {- output_off() if $disabled{makedepend}; "" -}
532 @ $(PERL) {- sourcefile("util", "add-depends.pl") -} "VMS C"
533 @ ! {- output_on() if $disabled{makedepend}; "" -}
535 # Install helper targets #############################################
537 install_sw : install_dev install_engines install_runtime -
538 install_startup install_ivp
540 uninstall_sw : uninstall_dev uninstall_engines uninstall_runtime -
541 uninstall_startup uninstall_ivp
543 install_docs : install_html_docs
545 uninstall_docs : uninstall_html_docs
547 install_ssldirs : check_INSTALLTOP
548 - CREATE/DIR/PROT=(S:RWED,O:RWE,G:RE,W:RE) OSSL_DATAROOT:[000000]
549 IF F$SEARCH("OSSL_DATAROOT:[000000]CERTS.DIR;1") .EQS. "" THEN -
550 CREATE/DIR/PROT=(S:RWED,O:RWE,G:RE,W:RE) OSSL_DATAROOT:[CERTS]
551 IF F$SEARCH("OSSL_DATAROOT:[000000]PRIVATE.DIR;1") .EQS. "" THEN -
552 CREATE/DIR/PROT=(S:RWED,O:RWE,G,W) OSSL_DATAROOT:[PRIVATE]
553 IF F$SEARCH("OSSL_DATAROOT:[000000]MISC.DIR;1") .EQS. "" THEN -
554 CREATE/DIR/PROT=(S:RWED,O:RWE,G,W) OSSL_DATAROOT:[MISC]
555 COPY/PROT=W:RE $(MISC_SCRIPTS) OSSL_DATAROOT:[MISC]
556 @ ! Install configuration file
557 COPY/PROT=W:R {- sourcefile("apps", "openssl-vms.cnf") -} -
558 ossl_dataroot:[000000]openssl.cnf-dist
559 IF F$SEARCH("OSSL_DATAROOT:[000000]openssl.cnf") .EQS. "" THEN -
560 COPY/PROT=W:R {- sourcefile("apps", "openssl-vms.cnf") -} -
561 ossl_dataroot:[000000]openssl.cnf
562 @ ! Install CTLOG configuration file
563 COPY/PROT=W:R {- sourcefile("apps", "ct_log_list.cnf") -} -
564 ossl_dataroot:[000000]ct_log_list.cnf-dist
565 IF F$SEARCH("OSSL_DATAROOT:[000000]ct_log_list.cnf") .EQS. "" THEN -
566 COPY/PROT=W:R {- sourcefile("apps", "ct_log_list.cnf") -} -
567 ossl_dataroot:[000000]ct_log_list.cnf
569 install_dev : check_INSTALLTOP install_runtime_libs
570 @ WRITE SYS$OUTPUT "*** Installing development files"
571 @ ! Install header files
572 - CREATE/DIR ossl_installroot:[include.openssl]
573 COPY/PROT=W:R openssl:*.h ossl_installroot:[include.openssl]
574 @ ! Install static (development) libraries
575 - CREATE/DIR ossl_installroot:[LIB.'arch']
577 map { "COPY/PROT=W:R $_.OLB ossl_installroot:[LIB.'arch']" }
580 install_engines : check_INSTALLTOP install_runtime_libs build_modules
581 @ {- output_off() unless scalar @install_engines; "" -} !
582 @ WRITE SYS$OUTPUT "*** Installing ENGINE modules"
583 - CREATE/DIR ossl_installroot:[ENGINES{- $sover_dirname.$target{pointer_size} -}.'arch']
585 map { "COPY/PROT=W:RE $_.EXE ossl_installroot:[ENGINES$sover_dirname$target{pointer_size}.'arch']" }
587 @ {- output_on() unless scalar @install_engines; "" -} !
589 install_runtime : install_programs
591 install_runtime_libs : check_INSTALLTOP build_libs
592 @ {- output_off() if $disabled{shared}; "" -} !
593 @ WRITE SYS$OUTPUT "*** Installing shareable images"
594 @ ! Install shared (runtime) libraries
595 - CREATE/DIR ossl_installroot:[LIB.'arch']
597 map { "COPY/PROT=W:R $_.EXE ossl_installroot:[LIB.'arch']" }
599 @ {- output_on() if $disabled{shared}; "" -} !
601 install_programs : check_INSTALLTOP install_runtime_libs build_programs
602 @ {- output_off() if $disabled{apps}; "" -} !
603 @ ! Install the main program
604 - CREATE/DIR ossl_installroot:[EXE.'arch']
605 COPY/PROT=W:RE [.APPS]openssl.EXE -
606 ossl_installroot:[EXE.'arch']openssl{- $osslver -}.EXE
608 COPY/PROT=W:RE $(BIN_SCRIPTS) ossl_installroot:[EXE]
609 @ ! {- output_on() if $disabled{apps}; "" -}
611 install_startup : [.VMS]openssl_startup.com [.VMS]openssl_shutdown.com -
612 [.VMS]openssl_utils.com, check_INSTALLTOP
613 - CREATE/DIR ossl_installroot:[SYS$STARTUP]
614 COPY/PROT=W:RE [.VMS]openssl_startup.com -
615 ossl_installroot:[SYS$STARTUP]openssl_startup{- $osslver -}.com
616 COPY/PROT=W:RE [.VMS]openssl_shutdown.com -
617 ossl_installroot:[SYS$STARTUP]openssl_shutdown{- $osslver -}.com
618 COPY/PROT=W:RE [.VMS]openssl_utils.com -
619 ossl_installroot:[SYS$STARTUP]openssl_utils{- $osslver -}.com
621 install_ivp : [.VMS]openssl_ivp.com check_INSTALLTOP
622 - CREATE/DIR ossl_installroot:[SYSTEST]
623 COPY/PROT=W:RE [.VMS]openssl_ivp.com -
624 ossl_installroot:[SYSTEST]openssl_ivp{- $osslver -}.com
626 [.VMS]openssl_startup.com : vmsconfig.pm {- sourcefile("VMS", "openssl_startup.com.in") -}
628 $(PERL) "-I." "-Mvmsconfig" {- sourcefile("util", "dofile.pl") -} -
629 {- sourcefile("VMS", "openssl_startup.com.in") -} -
630 > [.VMS]openssl_startup.com
632 [.VMS]openssl_utils.com : vmsconfig.pm {- sourcefile("VMS", "openssl_utils.com.in") -}
634 $(PERL) "-I." "-Mvmsconfig" {- sourcefile("util", "dofile.pl") -} -
635 {- sourcefile("VMS", "openssl_utils.com.in") -} -
636 > [.VMS]openssl_utils.com
638 [.VMS]openssl_shutdown.com : vmsconfig.pm {- sourcefile("VMS", "openssl_shutdown.com.in") -}
640 $(PERL) "-I." "-Mvmsconfig" {- sourcefile("util", "dofile.pl") -} -
641 {- sourcefile("VMS", "openssl_shutdown.com.in") -} -
642 > [.VMS]openssl_shutdown.com
644 [.VMS]openssl_ivp.com : vmsconfig.pm {- sourcefile("VMS", "openssl_ivp.com.in") -}
646 $(PERL) "-I." "-Mvmsconfig" {- sourcefile("util", "dofile.pl") -} -
647 {- sourcefile("VMS", "openssl_ivp.com.in") -} -
648 > [.VMS]openssl_ivp.com
650 vmsconfig.pm : configdata.pm
651 OPEN/WRITE/SHARE=READ CONFIG []vmsconfig.pm
652 WRITE CONFIG "package vmsconfig;"
653 WRITE CONFIG "use strict; use warnings;"
654 WRITE CONFIG "use Exporter;"
655 WRITE CONFIG "our @ISA = qw(Exporter);"
656 WRITE CONFIG "our @EXPORT = qw(%config %target %withargs %unified_info %disabled);"
657 WRITE CONFIG "our %config = ("
658 WRITE CONFIG " target => '","{- $config{target} -}","',"
659 WRITE CONFIG " version => '","{- $config{version} -}","',"
660 WRITE CONFIG " shlib_version => '","{- $config{shlib_version} -}","',"
661 WRITE CONFIG " shlib_major => '","{- $config{shlib_major} -}","',"
662 WRITE CONFIG " shlib_minor => '","{- $config{shlib_minor} -}","',"
663 WRITE CONFIG " no_shared => '","{- $disabled{shared} -}","',"
664 WRITE CONFIG " INSTALLTOP => '$(INSTALLTOP)',"
665 WRITE CONFIG " OPENSSLDIR => '$(OPENSSLDIR)',"
666 WRITE CONFIG " pointer_size => '","{- $target{pointer_size} -}","',"
668 WRITE CONFIG "our %target = ();"
669 WRITE CONFIG "our %disabled = ();"
670 WRITE CONFIG "our %withargs = ();"
671 WRITE CONFIG "our %unified_info = ();"
675 install_html_docs : check_INSTALLTOP build_html_docs
676 @ WRITE SYS$OUTPUT "*** Installing HTML docs"
677 - CREATE/DIR ossl_installroot:[HTML.MAN1]
678 - CREATE/DIR ossl_installroot:[HTML.MAN3]
679 - CREATE/DIR ossl_installroot:[HTML.MAN5]
680 - CREATE/DIR ossl_installroot:[HTML.MAN7]
682 ( map { "COPY/PROT=W:RE $_ ossl_installroot:[HTML.MAN1]" }
683 @{$unified_info{htmldocs}->{man1}} ),
684 ( map { "COPY/PROT=W:RE $_ ossl_installroot:[HTML.MAN3]" }
685 @{$unified_info{htmldocs}->{man3}} ),
686 ( map { "COPY/PROT=W:RE $_ ossl_installroot:[HTML.MAN5]" }
687 @{$unified_info{htmldocs}->{man5}} ),
688 ( map { "COPY/PROT=W:RE $_ ossl_installroot:[HTML.MAN7]" }
689 @{$unified_info{htmldocs}->{man7}} )) -}
692 @ IF "$(INSTALLTOP)" .EQS. "" THEN -
693 WRITE SYS$ERROR "INSTALLTOP should not be empty"
694 @ IF "$(INSTALLTOP)" .EQS. "" THEN -
697 # Helper targets #####################################################
699 # Developer targets ##################################################
702 SH LOGICAL/PROC openssl,internal,ossl_installroot,ossl_dataroot
704 # Building targets ###################################################
706 configdata.pm : $(SRCDIR)Configure $(SRCDIR)config.com {- join(" ", @{$config{build_file_templates}}, @{$config{build_infos}}, @{$config{conf_files}}) -}
707 perl configdata.pm -r
708 @ WRITE SYS$OUTPUT "*************************************************"
709 @ WRITE SYS$OUTPUT "*** ***"
710 @ WRITE SYS$OUTPUT "*** Please run the same mms command again ***"
711 @ WRITE SYS$OUTPUT "*** ***"
712 @ WRITE SYS$OUTPUT "*************************************************"
713 @ PIPE ( EXIT %X10000000 )
716 perl configdata.pm -r
720 use File::Spec::Functions qw/abs2rel rel2abs catfile catdir/;
722 # Helper function to figure out dependencies on libraries
723 # It takes a list of library names and outputs a list of dependencies
724 sub compute_lib_depends {
725 # Depending on shared libraries:
726 # On Windows POSIX layers, we depend on {libname}.dll.a
727 # On Unix platforms, we depend on {shlibname}.so
729 { lib => platform->sharedlib($_) // platform->staticlib($_),
730 attrs => $unified_info{attributes}->{libraries}->{$_} }
734 # Helper function to deal with inclusion directory specs.
735 # We have to deal with two things:
736 # 1. comma separation and no possibility of trailing comma
737 # 2. no inclusion directories given at all
738 # 3. long compiler command lines
739 # To resolve 1, we need to iterate through the sources of inclusion
740 # directories, and only add a comma when needed.
741 # To resolve 2, we need to have a variable that will hold the whole
742 # inclusion qualifier, or be the empty string if there are no inclusion
743 # directories. That's the symbol 'qual_includes' that's used in CPPFLAGS
744 # To resolve 3, we creata a logical name TMP_INCLUDES: to hold the list
745 # of inclusion directories.
747 # This function returns a list of two lists, one being the collection of
748 # commands to execute before the compiler is called, and the other being
749 # the collection of commands to execute after. It takes as arguments the
750 # collection of strings to include as directory specs.
757 'DELETE/SYMBOL/LOCAL qual_includes',
760 if (scalar @stuff > 0) {
761 push @before, 'tmp_includes := '.shift(@stuff);
763 push @before, 'tmp_add := '.shift(@stuff);
764 push @before, 'IF tmp_includes .NES. "" .AND. tmp_add .NES. "" THEN tmp_includes = tmp_includes + ","';
765 push @before, 'tmp_includes = tmp_includes + tmp_add';
767 push @before, "IF tmp_includes .NES. \"\" THEN DEFINE tmp_includes 'tmp_includes'";
768 push @before, 'IF tmp_includes .NES. "" THEN qual_includes := /INCLUDE=(tmp_includes:)';
769 push @before, 'DELETE/SYMBOL/LOCAL tmp_includes';
770 push @before, 'DELETE/SYMBOL/LOCAL tmp_add';
771 push @after, 'DEASSIGN tmp_includes:'
773 return ([ @before ], [ @after ]);
778 my $generator = join(" ", @{$args{generator}});
779 my $generator_incs = join("", map { ' "-I'.$_.'"' } @{$args{generator_incs}});
780 my $deps = join(", -\n\t\t", @{$args{generator_deps}}, @{$args{deps}});
782 if ($args{src} =~ /\.html$/) {
783 my $title = basename($args{src}, ".html");
785 $args{src}: $args{generator}->[0]
786 pipe pod2html "--podroot=\$(SRCDIR)/doc" --htmldir=.. -
787 --podpath=man1:man3:man5:man7 "--infile=\$<" -
789 | \$(PERL) -pe "s|href=""http://man\\.he\\.net/(man\d/[^""]+)(?:\\.html)?""|href=""../\$1.html|g;" -
792 } elsif (platform->isdef($args{src})) {
793 my $target = platform->def($args{src});
794 my $mkdef = sourcefile('util', 'mkdef.pl');
795 my $ord_ver = $args{intent} eq 'lib' ? ' --version $(VERSION)' : '';
797 $args{generator}->[1] || basename($args{product}, '.EXE');
798 my $case_insensitive =
799 $target{$args{intent}.'_cflags'} =~ m|/NAMES=[^/]*AS_IS|i
800 ? '' : ' --case-insensitive';
802 $target : $args{generator}->[0] $deps $mkdef
803 \$(PERL) $mkdef$ord_ver --ordinals $args{generator}->[0] --name $ord_name "--OS" "VMS"$case_insensitive > $target
805 } elsif (!platform->isasm($args{src})) {
806 my $target = $args{src};
807 if ($args{generator}->[0] =~ m|^.*\.in$|) {
808 my $dofile = abs2rel(rel2abs(catfile($config{sourcedir},
809 "util", "dofile.pl")),
810 rel2abs($config{builddir}));
811 my @modules = ( 'configdata.pm',
812 grep { $_ =~ m|\.pm$| } @{$args{deps}} );
813 my %moduleincs = map { '"-I'.dirname($_).'"' => 1 } @modules;
814 @modules = map { '"-M'.basename($_, '.pm').'"' } @modules;
815 my $modules = join(' ', '', sort keys %moduleincs, @modules);
817 $target : $args{generator}->[0] $deps
818 \$(PERL)$modules $dofile "-o$target{build_file}" $generator > \$\@
822 $target : $args{generator}->[0] $deps
823 \$(PERL)$generator_incs $generator > \$\@
828 shlib => '$(LIB_CFLAGS) $(LIB_CPPFLAGS)',
829 lib => '$(LIB_CFLAGS) $(LIB_CPPFLAGS)',
830 dso => '$(DSO_CFLAGS) $(DSO_CPPFLAGS)',
831 bin => '$(BIN_CFLAGS) $(BIN_CPPFLAGS)'
832 } -> {$args{intent}};
833 my @incs_cmds = includes({ shlib => '$(LIB_INCLUDES)',
834 lib => '$(LIB_INCLUDES)',
835 dso => '$(DSO_INCLUDES)',
836 bin => '$(BIN_INCLUDES)' } -> {$args{intent}},
840 my $incs_on = join("\n\t\@ ", @{$incs_cmds[0]}) || '!';
841 my $incs_off = join("\n\t\@ ", @{$incs_cmds[1]}) || '!';
842 my $defs = join("", map { ",".$_ } @{$args{defs}});
843 my $target = platform->asm($args{src});
845 if ($args{generator}->[0] =~ /\.pl$/) {
846 $generator = '$(PERL)'.$generator_incs.' '.$generator
848 } elsif ($args{generator}->[0] =~ /\.S$/) {
851 die "Generator type for $src unknown: $generator\n";
854 if (defined($generator)) {
855 # If the target is named foo.S in build.info, we want to
856 # end up generating foo.s in two steps.
857 if ($args{src} =~ /\.S$/) {
859 $target : $args{generator}->[0] $deps
862 \@ extradefines = "$defs"
863 PIPE \$(CPP) $cppflags \$\@-S | -
864 \$(PERL) -ne "/^#(\\s*line)?\\s*[0-9]+\\s+""/ or print" > \$\@-i
865 \@ DELETE/SYMBOL/LOCAL extradefines
873 $target : $args{generator}->[0] $deps
875 \@ extradefines = "$defs"
877 \@ DELETE/SYMBOL/LOCAL extradefines
882 $target : $args{generator}->[0] $deps
884 \@ extradefines = "$defs"
885 SHOW SYMBOL qual_includes
886 PIPE \$(CPP) $cppflags $args{generator}->[0] | -
887 \$(PERL) "-ne" "/^#(\\s*line)?\\s*[0-9]+\\s+""/ or print" > \$\@
888 \@ DELETE/SYMBOL/LOCAL extradefines
895 my $asmext = platform->asmext();
899 (platform->isasm($x) && grep { $x eq $_ } @generated)
900 ? platform->asm($x) : $x }
902 my $obj = platform->obj($args{obj});
903 my $dep = platform->dep($args{obj});
904 my $deps = join(", -\n\t\t", @srcs, @{$args{deps}});
906 # Because VMS C isn't very good at combining a /INCLUDE path with
907 # #includes having a relative directory (like '#include "../foo.h"),
908 # the best choice is to move to the first source file's intended
909 # directory before compiling, and make sure to write the object file
910 # in the correct position (important when the object tree is other
911 # than the source tree).
912 my $forward = dirname($args{srcs}->[0]);
913 my $backward = abs2rel(rel2abs("."), rel2abs($forward));
914 my $objd = abs2rel(rel2abs(dirname($obj)), rel2abs($forward));
915 my $objn = basename($obj);
916 my $depd = abs2rel(rel2abs(dirname($dep)), rel2abs($forward));
917 my $depn = basename($dep);
919 join(", ", map { abs2rel(rel2abs($_), rel2abs($forward)) } @srcs);
920 my $before = $unified_info{before}->{$obj} || "\@ !";
921 my $after = $unified_info{after}->{$obj} || "\@ !";
924 if ($args{attrs}->{noinst}) {
925 $cflags = { shlib => '$(NO_INST_LIB_CFLAGS)',
926 lib => '$(NO_INST_LIB_CFLAGS)',
927 dso => '$(NO_INST_DSO_CFLAGS)',
928 bin => '$(NO_INST_BIN_CFLAGS)' } -> {$args{intent}};
930 $cflags = { shlib => '$(LIB_CFLAGS)',
931 lib => '$(LIB_CFLAGS)',
932 dso => '$(DSO_CFLAGS)',
933 bin => '$(BIN_CFLAGS)' } -> {$args{intent}};
935 $cflags .= { shlib => '$(LIB_CPPFLAGS)',
936 lib => '$(LIB_CPPFLAGS)',
937 dso => '$(DSO_CPPFLAGS)',
938 bin => '$(BIN_CPPFLAGS)' } -> {$args{intent}};
939 my $defs = join("", map { ",".$_ } @{$args{defs}});
940 my $asflags = { shlib => ' $(LIB_ASFLAGS)',
941 lib => ' $(LIB_ASFLAGS)',
942 dso => ' $(DSO_ASFLAGS)',
943 bin => ' $(BIN_ASFLAGS)' } -> {$args{intent}};
945 my @incs_cmds = includes({ shlib => '$(LIB_INCLUDES)',
946 lib => '$(LIB_INCLUDES)',
947 dso => '$(DSO_INCLUDES)',
948 bin => '$(BIN_INCLUDES)' } -> {$args{intent}},
951 file_name_is_absolute($_)
952 ? $_ : catdir($backward,$_)
954 my $incs_on = join("\n\t\@ ", @{$incs_cmds[0]}) || '!';
955 my $incs_off = join("\n\t\@ ", @{$incs_cmds[1]}) || '!';
957 if ($srcs[0] =~ /\Q${asmext}\E$/) {
962 \$(AS) $asflags \$(ASOUTFLAG)${objd}${objn} $srcs
963 SET DEFAULT $backward
967 } elsif ($srcs[0] =~ /.S$/) {
973 \@ extradefines = "$defs"
974 PIPE \$(CPP) ${cflags} $srcs | -
975 \$(PERL) -ne "/^#(\\s*line)?\\s*[0-9]+\\s+""/ or print" -
977 \@ DELETE/SYMBOL/LOCAL extradefines
979 SET DEFAULT $backward
981 \$(AS) $asflags \$(ASOUTFLAG)$obj $obj-asm
986 my $depbuild = $disabled{makedepend} ? ""
987 : " /MMS=(FILE=${depd}${depn},TARGET=$obj)";
994 \@ extradefines = "$defs"
995 \$(CC) ${cflags}${depbuild} /OBJECT=${objd}${objn} /REPOSITORY=$backward $srcs
996 \@ DELETE/SYMBOL/LOCAL extradefines
998 SET DEFAULT $backward
1005 my $shlibname = platform->sharedname($args{lib});
1006 my $shlib = platform->sharedlib($args{lib});
1007 my @objs = map { platform->convertext($_) }
1008 grep { platform->isobj($_) }
1010 my @defs = map { platform->convertext($_) }
1011 grep { platform->isdef($_) }
1013 my @deps = compute_lib_depends(@{$args{deps}});
1014 die "More than one symbol vector" if scalar @defs > 1;
1015 my $deps = join(", -\n\t\t", @objs, @defs, map { $_->{lib} } @deps);
1016 my $shlib_target = $disabled{shared} ? "" : $target{shared_target};
1017 my $translatesyms_pl = abs2rel(rel2abs(catfile($config{sourcedir},
1018 "VMS", "translatesyms.pl")),
1019 rel2abs($config{builddir}));
1020 # The "[]" hack is because in .OPT files, each line inherits the
1021 # previous line's file spec as default, so if no directory spec
1022 # is present in the current line and the previous line has one that
1023 # doesn't apply, you're in for a surprise.
1025 join(",-\"\n\t", map { my $x = $_ =~ /\[/ ? $_ : "[]".$_;
1026 "WRITE OPT_FILE \"$x" } @objs).
1029 join("\n\t", map { my $x = $_->{lib} =~ /\[/
1030 ? $_->{lib} : "[]".$_->{lib};
1031 $x =~ s|(\.EXE)|$1/SHARE|;
1032 $x =~ s|(\.OLB)|$1/LIB|;
1033 "WRITE OPT_FILE \"$x\"" } @deps)
1037 \$(PERL) $translatesyms_pl \$(BLDDIR)CXX\$DEMANGLER_DB. < $defs[0] > $defs[0]-translated
1038 OPEN/WRITE/SHARE=READ OPT_FILE $shlibname-components.OPT
1042 LINK \$(LIB_LDFLAGS)/SHARE=\$\@ $defs[0]-translated/OPT,-
1043 $shlibname-components.OPT/OPT \$(LIB_EX_LIBS)
1044 DELETE $defs[0]-translated;*,$shlibname-components.OPT;*
1045 PURGE $shlibname.EXE,$shlibname.MAP
1047 . ($config{target} =~ m|alpha| ? "" : <<"EOF"
1048 SET IMAGE/FLAGS=(NOCALL_DEBUG) \$\@
1054 my $dsoname = platform->dsoname($args{module});
1055 my $dso = platform->dso($args{module});
1056 my @objs = map { platform->convertext($_) }
1057 grep { platform->isobj($_) }
1059 my @defs = map { platform->convertext($_) }
1060 grep { platform->isdef($_) }
1062 my @deps = compute_lib_depends(@{$args{deps}});
1063 my $deps = join(", -\n\t\t", @objs, @defs, map { $_->{lib} } @deps);
1064 die "More than one symbol vector" if scalar @defs > 1;
1065 my $shlib_target = $disabled{shared} ? "" : $target{shared_target};
1066 # The "[]" hack is because in .OPT files, each line inherits the
1067 # previous line's file spec as default, so if no directory spec
1068 # is present in the current line and the previous line has one that
1069 # doesn't apply, you're in for a surprise.
1071 join(",-\"\n\t", map { my $x = $_ =~ /\[/ ? $_ : "[]".$_;
1072 "WRITE OPT_FILE \"$x" } @objs).
1075 join("\n\t", map { my $x = $_->{lib} =~ /\[/
1076 ? $_->{lib} : "[]".$_->{lib};
1077 $x =~ s|(\.EXE)|$1/SHARE|;
1078 $x =~ s|(\.OLB)|$1/LIB|;
1079 "WRITE OPT_FILE \"$x\"" } @deps)
1083 OPEN/WRITE/SHARE=READ OPT_FILE $dsoname-components.OPT
1087 LINK \$(DSO_LDFLAGS)/SHARE=\$\@ $defs[0]/OPT,-
1088 $dsoname-components.OPT/OPT \$(DSO_EX_LIBS)
1089 - PURGE $dsoname.EXE,$dsoname.OPT,$dsoname.MAP
1091 . ($config{target} =~ m|alpha| ? "" : <<"EOF"
1092 SET IMAGE/FLAGS=(NOCALL_DEBUG) \$\@
1098 my $lib = platform->staticlib($args{lib});
1099 my @objs = map { platform->convertext($_) }
1100 grep { platform->isobj($_) }
1102 my $objs = join(", -\n\t\t", @objs);
1103 my $fill_lib = join("\n\t", (map { "LIBRARY/REPLACE $lib $_" } @objs));
1106 LIBRARY/CREATE/OBJECT $lib
1113 my $bin = platform->bin($args{bin});
1114 my $binname = platform->binname($args{bin});
1115 my @objs = map { platform->convertext($_) }
1116 grep { platform->isobj($_) }
1118 my $objs = join(",", @objs);
1119 my @deps = compute_lib_depends(@{$args{deps}});
1120 my $deps = join(", -\n\t\t", @objs, map { $_->{lib} } @deps);
1122 my $olb_count = scalar grep(m|\.OLB$|, map { $_->{lib} } @deps);
1123 my $analyse_objs = "@ !";
1124 if ($olb_count > 0) {
1126 $config{target} =~ m|alpha| ? "/GSD" : "/SECTIONS=SYMTAB";
1127 $analyse_objs = "- pipe ANALYSE/OBJECT$analyse_quals $objs | SEARCH SYS\$INPUT \"\"\"main\"\"\" ; nomain = \$severity .NE. 1"
1129 # The "[]" hack is because in .OPT files, each line inherits the
1130 # previous line's file spec as default, so if no directory spec
1131 # is present in the current line and the previous line has one that
1132 # doesn't apply, you're in for a surprise.
1134 join(",-\"\n\t", map { my $x = $_ =~ /\[/ ? $_ : "[]".$_;
1135 "\@ WRITE OPT_FILE \"$x" } @objs).
1138 join("\n\t", "WRITE OPT_FILE \"CASE_SENSITIVE=YES\"",
1139 map { my @lines = ();
1141 my $x = $_->{lib} =~ /\[/
1142 ? $_->{lib} : "[]".$_->{lib};
1143 if ($x =~ m|\.EXE$|) {
1144 push @lines, "\@ WRITE OPT_FILE \"$x/SHARE\"";
1145 } elsif ($x =~ m|\.OLB$|) {
1146 # Special hack to include the MAIN object
1147 # module explicitly. This will only be done
1148 # if there isn't a 'main' in the program's
1149 # object modules already.
1150 my $main = $_->{attrs}->{has_main}
1151 ? '/INCLUDE=main' : '';
1153 "\@ IF nomain THEN WRITE OPT_FILE \"$x/LIB$main\"",
1154 "\@ IF .NOT. nomain THEN WRITE OPT_FILE \"$x/LIB\""
1159 # The linking commands looks a bit complex, but it's for good reason.
1160 # When you link, say, foo.obj, bar.obj and libsomething.exe/share, and
1161 # bar.obj happens to have a symbol that also exists in libsomething.exe,
1162 # the linker will warn about it, loudly, and will then choose to pick
1163 # the first copy encountered (the one in bar.obj in this example).
1164 # On Unix and on Windows, the corresponding maneuvre goes through
1165 # silently with the same effect.
1166 # With some test programs, made for checking the internals of OpenSSL,
1167 # we do this kind of linking deliberately, picking a few specific object
1168 # files from within [.crypto] or [.ssl] so we can reach symbols that are
1169 # otherwise unreachable (since the shareable images only exports the
1170 # symbols listed in [.util]*.num), and then with the shared libraries
1171 # themselves. So we need to silence the warning about multiply defined
1172 # symbols, to mimic the way linking work on Unix and Windows, and so
1173 # the build isn't interrupted (MMS stops when warnings are signaled,
1174 # by default), and so someone building doesn't have to worry where it
1175 # isn't necessary. If there are other warnings, however, we show them
1176 # and let it break the build.
1180 @ OPEN/WRITE/SHARE=READ OPT_FILE $binname.OPT
1184 TYPE $binname.OPT ! For debugging
1185 - pipe SPAWN/WAIT/NOLOG/OUT=$binname.LINKLOG -
1186 LINK \$(BIN_LDFLAGS)/EXEC=\$\@ $binname.OPT/OPT \$(BIN_EX_LIBS) ; -
1187 link_status = \$status ; link_severity = link_status .AND. 7
1188 @ search_severity = 1
1189 -@ IF link_severity .EQ. 0 THEN -
1190 pipe SEARCH $binname.LINKLOG "%","-"/MATCH=AND | -
1191 SPAWN/WAIT/NOLOG/OUT=NLA0: -
1192 SEARCH SYS\$INPUT: "-W-MULDEF,"/MATCH=NOR ; -
1193 search_severity = \$severity
1194 @ ! search_severity is 3 when the last search didn't find any matching
1195 @ ! string: %SEARCH-I-NOMATCHES, no strings matched
1196 @ ! If that was the result, we pretend linking got through without
1197 @ ! fault or warning.
1198 @ IF search_severity .EQ. 3 THEN link_severity = 1
1199 @ ! At this point, if link_severity shows that there was a fault
1200 @ ! or warning, make sure to restore the linking status.
1201 -@ IF .NOT. link_severity THEN TYPE $binname.LINKLOG
1202 -@ DELETE $binname.LINKLOG;*
1203 @ IF .NOT. link_severity THEN SPAWN/WAIT/NOLOG EXIT 'link_status'
1204 - PURGE $bin,$binname.OPT
1206 . ($config{target} =~ m|alpha| ? "" : <<"EOF"
1207 SET IMAGE/FLAGS=(NOCALL_DEBUG) \$\@
1213 my $script = $args{script};
1214 return "" if grep { $_ eq $script } @{$args{sources}}; # No overwrite!
1215 my $sources = join(" ", @{$args{sources}});
1216 my $dofile = abs2rel(rel2abs(catfile($config{sourcedir},
1217 "util", "dofile.pl")),
1218 rel2abs($config{builddir}));
1221 \$(PERL) "-I\$(BLDDIR)" "-Mconfigdata" $dofile -
1222 "-o$target{build_file}" $sources > $script
1223 SET FILE/PROT=(S:RWED,O:RWED,G:RE,W:RE) $script
1227 "" # Important! This becomes part of the template result.