1 ## descrip.mms to build OpenSSL on OpenVMS
3 ## {- join("\n## ", @autowarntext) -}
5 use File::Spec::Functions qw/:DEFAULT abs2rel rel2abs/;
7 # Our prefix, claimed when speaking with the VSI folks Tuesday
9 our $osslprefix = 'OSSL$';
10 (our $osslprefix_q = $osslprefix) =~ s/\$/\\\$/;
12 our $sover = sprintf "%02d%02d", $config{shlib_major}, $config{shlib_minor};
13 our $osslver = sprintf "%02d%02d", split(/\./, $config{version});
15 our $sourcedir = $config{sourcedir};
16 our $builddir = $config{builddir};
18 catfile($sourcedir, @_);
21 catfile($builddir, @_);
24 catdir($sourcedir, @_);
27 catdir($builddir, @_);
30 (my $x = shift) =~ s|\]$|...]|;
35 my $b = abs2rel(rel2abs("."),rel2abs($f));
36 $sourcedir = catdir($b,$sourcedir)
37 if !file_name_is_absolute($sourcedir);
38 $builddir = catdir($b,$builddir)
39 if !file_name_is_absolute($builddir);
43 # Because we need to make two computations of these data,
44 # we store them in arrays for reuse
45 our @shlibs = map { $unified_info{sharednames}->{$_} || () } @{$unified_info{libraries}};
46 our @install_shlibs = map { $unified_info{sharednames}->{$_} || () } @{$unified_info{install}->{libraries}};
47 our @generated = ( ( map { (my $x = $_) =~ s|\.S$|\.s|; $x }
48 grep { defined $unified_info{generate}->{$_} }
49 map { @{$unified_info{sources}->{$_}} }
50 grep { /\.o$/ } keys %{$unified_info{sources}} ),
51 ( grep { /\.h$/ } keys %{$unified_info{generate}} ) );
53 # This is a horrible hack, but is needed because recursive inclusion of files
54 # in different directories does not work well with HP C.
55 my $sd = sourcedir("crypto", "async", "arch");
56 foreach (grep /\[\.crypto\.async\.arch\].*\.o$/, keys %{$unified_info{sources}}) {
57 (my $x = $_) =~ s|\.o$|.OBJ|;
58 $unified_info{before}->{$x}
59 = qq(arch_include = F\$PARSE("$sd","A.;",,,"SYNTAX_ONLY") - "A.;"
60 define arch 'arch_include');
61 $unified_info{after}->{$x}
64 my $sd1 = sourcedir("ssl","record");
65 my $sd2 = sourcedir("ssl","statem");
66 $unified_info{before}->{"[.test]heartbeat_test.OBJ"}
67 = $unified_info{before}->{"[.test]ssltest_old.OBJ"}
68 = qq(record_include = F\$PARSE("$sd1","A.;",,,"SYNTAX_ONLY") - "A.;"
69 define record 'record_include'
70 statem_include = F\$PARSE("$sd2","A.;",,,"SYNTAX_ONLY") - "A.;"
71 define statem 'statem_include');
72 $unified_info{after}->{"[.test]heartbeat_test.OBJ"}
73 = $unified_info{after}->{"[.test]ssltest.OBJ"}
76 foreach (grep /^\[\.ssl\.(?:record|statem)\].*\.o$/, keys %{$unified_info{sources}}) {
77 (my $x = $_) =~ s|\.o$|.OBJ|;
78 $unified_info{before}->{$x}
79 = qq(record_include = F\$PARSE("$sd1","A.;",,,"SYNTAX_ONLY") - "A.;"
80 define record 'record_include'
81 statem_include = F\$PARSE("$sd2","A.;",,,"SYNTAX_ONLY") - "A.;"
82 define statem 'statem_include');
83 $unified_info{after}->{$x}
88 #print STDERR "DEBUG: before:\n", Dumper($unified_info{before});
89 #print STDERR "DEBUG: after:\n", Dumper($unified_info{after});
92 PLATFORM={- $config{target} -}
93 OPTIONS={- $config{options} -}
94 CONFIGURE_ARGS=({- join(", ",quotify_l(@{$config{perlargv}})) -})
95 SRCDIR={- $config{sourcedir} -}
96 BLDDIR={- $config{builddir} -}
98 # Allow both V and VERBOSE to indicate verbosity. This only applies
102 VERSION={- $config{version} -}
103 MAJOR={- $config{major} -}
104 MINOR={- $config{minor} -}
105 SHLIB_VERSION_NUMBER={- $config{shlib_version_number} -}
106 SHLIB_VERSION_HISTORY={- $config{shlib_version_history} -}
107 SHLIB_MAJOR={- $config{shlib_major} -}
108 SHLIB_MINOR={- $config{shlib_minor} -}
109 SHLIB_TARGET={- $target{shared_target} -}
117 LIBS={- join(", ", map { "-\n\t".$_.".OLB" } @{$unified_info{libraries}}) -}
118 SHLIBS={- join(", ", map { "-\n\t".$_.".EXE" } @shlibs) -}
119 ENGINES={- join(", ", map { "-\n\t".$_.".EXE" } @{$unified_info{engines}}) -}
120 PROGRAMS={- join(", ", map { "-\n\t".$_.".EXE" } @{$unified_info{programs}}) -}
121 SCRIPTS={- join(", ", map { "-\n\t".$_ } @{$unified_info{scripts}}) -}
122 {- output_off() if $disabled{makedepend}; "" -}
123 DEPS={- our @deps = map { (my $x = $_) =~ s|\.o$|\$(DEP_EXT)|; $x; }
124 grep { $unified_info{sources}->{$_}->[0] =~ /\.c$/ }
125 keys %{$unified_info{sources}};
126 join(", ", map { "-\n\t".$_ } @deps); -}
127 {- output_on() if $disabled{makedepend}; "" -}
128 GENERATED_MANDATORY={- join(", ", map { "-\n\t".$_ } @{$unified_info{depends}->{""}} ) -}
129 GENERATED={- join(", ", map { "-\n\t".$_ } @generated) -}
131 INSTALL_LIBS={- join(", ", map { "-\n\t".$_.".OLB" } @{$unified_info{install}->{libraries}}) -}
132 INSTALL_SHLIBS={- join(", ", map { "-\n\t".$_.".EXE" } @install_shlibs) -}
133 INSTALL_ENGINES={- join(", ", map { "-\n\t".$_.".EXE" } @{$unified_info{install}->{engines}}) -}
134 INSTALL_PROGRAMS={- join(", ", map { "-\n\t".$_.".EXE" } @{$unified_info{install}->{programs}}) -}
135 {- output_off() if $disabled{apps}; "" -}
136 BIN_SCRIPTS=[.tools]c_rehash.pl
137 MISC_SCRIPTS=[.apps]CA.pl, [.apps]tsget.pl
138 {- output_on() if $disabled{apps}; "" -}
140 # DESTDIR is for package builders so that they can configure for, say,
141 # SYS$COMMON:[OPENSSL] and yet have everything installed in STAGING:[USER].
142 # In that case, configure with --prefix=SYS$COMMON:[OPENSSL] and then run
143 # MMS with /MACROS=(DESTDIR=STAGING:[USER]). The result will end up in
144 # STAGING:[USER.OPENSSL].
145 # Normally it is left empty.
148 # Do not edit this manually. Use Configure --prefix=DIR to change this!
149 INSTALLTOP={- our $installtop =
150 catdir($config{prefix}) || "SYS\$COMMON:[OPENSSL]";
152 SYSTARTUP={- catdir($installtop, '[.SYS$STARTUP]'); -}
153 # This is the standard central area to store certificates, private keys...
154 OPENSSLDIR={- catdir($config{openssldir}) ||
155 $config{prefix} ? catdir($config{prefix},"COMMON")
156 : "SYS\$COMMON:[OPENSSL-COMMON]" -}
157 # The same, but for C
158 OPENSSLDIR_C={- $osslprefix -}DATAROOT:[000000]
159 # Where installed engines reside, for C
160 ENGINESDIR_C={- $osslprefix -}ENGINES{- $sover.$target{pointer_size} -}:
162 CC= {- $target{cc} -}
163 CFLAGS= /DEFINE=({- join(",", @{$target{defines}}, @{$config{defines}},"OPENSSLDIR=\"\"\"\$(OPENSSLDIR_C)\"\"\"","ENGINESDIR=\"\"\"\$(ENGINESDIR_C)\"\"\"") -}) {- $target{cflags} -} {- $config{cflags} -}
165 DEPFLAG= /DEFINE=({- join(",", @{$config{depdefines}}) -})
166 LDFLAGS= {- $target{lflags} -}
167 EX_LIBS= {- $target{ex_libs} ? ",".$target{ex_libs} : "" -}{- $config{ex_libs} ? ",".$config{ex_libs} : "" -}
168 LIB_CFLAGS={- $target{lib_cflags} || "" -}
169 DSO_CFLAGS={- $target{dso_cflags} || "" -}
170 BIN_CFLAGS={- $target{bin_cflags} || "" -}
172 PERL={- $config{perl} -}
174 # We let the C compiler driver to take care of .s files. This is done in
175 # order to be excused from maintaining a separate set of architecture
176 # dependent assembler flags. E.g. if you throw -mcpu=ultrasparc at SPARC
177 # gcc, then the driver will automatically translate it to -xarch=v8plus
178 # and pass it down to assembler.
180 ASFLAG={- $target{asflags} -}
182 # .FIRST and .LAST are special targets with MMS and MMK.
183 # The defines in there are for C. includes that look like
186 # #include <openssl/foo.h>
187 # #include "internal/bar.h"
189 # will use the logical names to find the files. Expecting
190 # DECompHP C to find files in subdirectories of whatever was
191 # given with /INCLUDE is a fantasy, unfortunately.
194 $(NODEBUG) openssl_inc1 = F$PARSE("[.include.openssl]","A.;",,,"syntax_only") - "A.;"
195 $(NODEBUG) openssl_inc2 = F$PARSE("{- catdir($config{sourcedir},"[.include.openssl]") -}","A.;",,,"SYNTAX_ONLY") - "A.;"
196 $(NODEBUG) internal_inc1 = F$PARSE("[.crypto.include.internal]","A.;",,,"SYNTAX_ONLY") - "A.;"
197 $(NODEBUG) internal_inc2 = F$PARSE("{- catdir($config{sourcedir},"[.include.internal]") -}","A.;",,,"SYNTAX_ONLY") - "A.;"
198 $(NODEBUG) internal_inc3 = F$PARSE("{- catdir($config{sourcedir},"[.crypto.include.internal]") -}","A.;",,,"SYNTAX_ONLY") - "A.;"
199 $(NODEBUG) DEFINE openssl 'openssl_inc1','openssl_inc2'
200 $(NODEBUG) DEFINE internal 'internal_inc1','internal_inc2','internal_inc3'
201 $(NODEBUG) staging_dir = "$(DESTDIR)"
202 $(NODEBUG) staging_instdir = ""
203 $(NODEBUG) staging_datadir = ""
204 $(NODEBUG) IF staging_dir .NES. "" THEN -
205 staging_instdir = F$PARSE("A.;",staging_dir,"[]",,"SYNTAX_ONLY")
206 $(NODEBUG) IF staging_instdir - "]A.;" .NES. staging_instdir THEN -
207 staging_instdir = staging_instdir - "]A.;" + ".OPENSSL-INSTALL]"
208 $(NODEBUG) IF staging_instdir - "A.;" .NES. staging_instdir THEN -
209 staging_instdir = staging_instdir - "A.;" + "[OPENSSL-INSTALL]"
210 $(NODEBUG) IF staging_dir .NES. "" THEN -
211 staging_datadir = F$PARSE("A.;",staging_dir,"[]",,"SYNTAX_ONLY")
212 $(NODEBUG) IF staging_datadir - "]A.;" .NES. staging_datadir THEN -
213 staging_datadir = staging_datadir - "]A.;" + ".OPENSSL-COMMON]"
214 $(NODEBUG) IF staging_datadir - "A.;" .NES. staging_datadir THEN -
215 staging_datadir = staging_datadir - "A.;" + "[OPENSSL-COMMON]"
217 $(NODEBUG) ! Installation logical names
219 $(NODEBUG) installtop = F$PARSE(staging_instdir,"$(INSTALLTOP)","[]A.;",,"SYNTAX_ONLY,NO_CONCEAL") - ".][000000" - "[000000." - "][" - "]A.;" + ".]"
220 $(NODEBUG) datatop = F$PARSE(staging_datadir,"$(OPENSSLDIR)","[]A.;",,"SYNTAX_ONLY,NO_CONCEAL") - ".][000000" - "[000000." - "][" - "]A.;" + ".]"
221 $(NODEBUG) DEFINE ossl_installroot 'installtop'
222 $(NODEBUG) DEFINE ossl_dataroot 'datatop'
224 $(NODEBUG) ! Figure out the architecture
226 $(NODEBUG) arch == f$edit( f$getsyi( "arch_name"), "upcase")
228 $(NODEBUG) ! Set up logical names for the libraries, so LINK and
229 $(NODEBUG) ! running programs can use them.
231 $(NODEBUG) {- join("\n\t\$(NODEBUG) ", map { "DEFINE ".uc($_)." 'F\$ENV(\"DEFAULT\")'".uc($_)."\$(SHLIB_EXT)" } map { $unified_info{sharednames}->{$_} || () } @{$unified_info{libraries}}) || "!" -}
234 $(NODEBUG) {- join("\n\t\$(NODEBUG) ", map { "DEASSIGN ".uc($_) } map { $unified_info{sharednames}->{$_} || () } @{$unified_info{libraries}}) || "!" -}
235 $(NODEBUG) DEASSIGN ossl_dataroot
236 $(NODEBUG) DEASSIGN ossl_installroot
237 $(NODEBUG) DEASSIGN internal
238 $(NODEBUG) DEASSIGN openssl
240 @ ! MMS cannot handle no actions...
242 # The main targets ###################################################
244 all : build_generated, -
245 build_libs_nodep, build_engines_nodep, build_programs_nodep, -
248 build_libs : build_generated, build_libs_nodep, depend
249 build_libs_nodep : $(LIBS), $(SHLIBS)
250 build_engines : build_generated, build_engines_nodep, depend
251 build_engines_nodep : $(ENGINES)
252 build_programs : build_generated, build_programs_nodep, depend
253 build_programs_nodep : $(PROGRAMS), $(SCRIPTS)
255 build_generated : $(GENERATED_MANDATORY)
257 # Kept around for backward compatibility
258 build_apps build_tests : build_programs
260 test tests : build_generated, build_programs_nodep, build_engines_nodep, -
262 @ ! {- output_off() if $disabled{tests}; "" -}
263 SET DEFAULT [.test]{- move("test") -}
264 DEFINE SRCTOP {- sourcedir() -}
265 DEFINE BLDTOP {- builddir() -}
266 DEFINE OPENSSL_ENGINES {- builddir("engines") -}
267 IF "$(VERBOSE)" .NES. "" THEN DEFINE VERBOSE "$(VERBOSE)"
268 $(PERL) {- sourcefile("test", "run_tests.pl") -} $(TESTS)
269 DEASSIGN OPENSSL_ENGINES
272 SET DEFAULT [-]{- move("..") -}
273 @ ! {- if ($disabled{tests}) { output_on(); } else { output_off(); } "" -}
274 @ WRITE SYS$OUTPUT "Tests are not supported with your chosen Configure options"
275 @ ! {- output_on() if !$disabled{tests}; "" -}
278 @ ! {- output_off() if $disabled{tests}; "" -}
279 @ DEFINE SRCTOP {- sourcedir() -}
280 @ $(PERL) {- sourcefile("test", "run_tests.pl") -} list
282 @ ! {- if ($disabled{tests}) { output_on(); } else { output_off(); } "" -}
283 @ WRITE SYS$OUTPUT "Tests are not supported with your chosen Configure options"
284 @ ! {- output_on() if !$disabled{tests}; "" -}
286 install : install_sw install_ssldirs install_docs
287 @ WRITE SYS$OUTPUT ""
288 @ WRITE SYS$OUTPUT "######################################################################"
289 @ WRITE SYS$OUTPUT ""
290 @ IF "$(DESTDIR)" .EQS. "" THEN -
291 PIPE ( WRITE SYS$OUTPUT "Installation complete" ; -
292 WRITE SYS$OUTPUT "" ; -
293 WRITE SYS$OUTPUT "Run @$(SYSTARTUP)openssl_startup{- $osslver -} to set up logical names" ; -
294 WRITE SYS$OUTPUT "then run @$(SYSTARTUP)openssl_utils{- $osslver -} to define commands" ; -
295 WRITE SYS$OUTPUT "" )
296 @ IF "$(DESTDIR)" .NES. "" THEN -
297 PIPE ( WRITE SYS$OUTPUT "Staging installation complete" ; -
298 WRITE SYS$OUTPUT "" ; -
299 WRITE SYS$OUTPUT "Finish or package in such a way that the contents of the directory tree" ; -
300 WRITE SYS$OUTPUT staging_instdir ; -
301 WRITE SYS$OUTPUT "ends up in $(INSTALLTOP)," ; -
302 WRITE SYS$OUTPUT "and that the contents of the contents of the directory tree" ; -
303 WRITE SYS$OUTPUT staging_datadir ; -
304 WRITE SYS$OUTPUT "ends up in $(OPENSSLDIR)" ; -
305 WRITE SYS$OUTPUT "" ; -
306 WRITE SYS$OUTPUT "When in its final destination," ; -
307 WRITE SYS$OUTPUT "Run @$(SYSTARTUP)openssl_startup{- $osslver -} to set up logical names" ; -
308 WRITE SYS$OUTPUT "then run @$(SYSTARTUP)openssl_utils{- $osslver -} to define commands" ; -
309 WRITE SYS$OUTPUT "" )
312 spawn/nolog @ossl_installroot:[SYSTEST]openssl_ivp{- $osslver -}.com
314 uninstall : uninstall_docs uninstall_sw
316 # Because VMS wants the generation number (or *) to delete files, we can't
317 # use $(LIBS), $(PROGRAMS), $(GENERATED) and $(ENGINES)directly.
319 {- join("\n\t", map { "- DELETE $_.OLB;*" } @{$unified_info{libraries}}) || "@ !" -}
320 {- join("\n\t", map { "- DELETE $_.EXE;*,$_.MAP;*,$_.OPT;*" } @shlibs) || "@ !" -}
323 {- join("\n\t", map { "- DELETE $_.EXE;*,$_.OPT;*" } @{$unified_info{programs}}) || "@ !" -}
324 {- join("\n\t", map { "- DELETE $_.EXE;*,$_.OPT;*" } @{$unified_info{engines}}) || "@ !" -}
325 {- join("\n\t", map { "- DELETE $_;*" } @{$unified_info{scripts}}) || "@ !" -}
326 {- join("\n\t", map { "- DELETE $_;*" } @generated) || "@ !" -}
327 - DELETE [...]*.MAP;*
329 - DELETE [...]*.OBJ;*,*.LIS;*
330 - DELETE []CXX$DEMANGLER_DB.;*
331 - DELETE [.VMS]openssl_startup.com;*
332 - DELETE [.VMS]openssl_shutdown.com;*
333 - DELETE []vmsconfig.pm;*
336 - DELETE configdata.pm;*
337 - DELETE descrip.mms;*
341 @ ! {- output_off() if $disabled{makedepend}; "" -}
342 @ $(PERL) -pe "if (/^# DO NOT DELETE.*/) { exit(0); }" -
343 < descrip.mms > descrip.mms-new
344 @ OPEN/APPEND DESCRIP descrip.mms-new
345 @ WRITE DESCRIP "# DO NOT DELETE THIS LINE -- make depend depends on it."
346 {- join("\n\t", map { "\@ IF F\$SEARCH(\"$_\") .NES. \"\" THEN TYPE $_ /OUTPUT=DESCRIP:" } @deps); -}
348 @ PIPE ( $(PERL) -e "use File::Compare qw/compare_text/; my $x = compare_text(""descrip.mms"",""descrip.mms-new""); exit(0x10000000 + ($x == 0));" || -
349 RENAME descrip.mms-new descrip.mms )
350 @ IF F$SEARCH("descrip.mms-new") .NES. "" THEN DELETE descrip.mms-new;*
351 -@ SPAWN/OUTPUT=NLA0: PURGE/NOLOG descrip.mms
352 @ ! {- output_on() if $disabled{makedepend}; "" -}
354 # Install helper targets #############################################
356 install_sw : all install_dev install_engines install_runtime install_startup install_ivp
358 uninstall_sw : uninstall_dev uninstall_engines uninstall_runtime uninstall_startup uninstall_ivp
360 install_docs : install_html_docs
362 uninstall_docs : uninstall_html_docs
364 install_ssldirs : check_INSTALLTOP
365 - CREATE/DIR/PROT=(S:RWED,O:RWE,G:RE,W:RE) OSSL_DATAROOT:[000000]
366 IF F$SEARCH("OSSL_DATAROOT:[000000]CERTS.DIR;1") .EQS. "" THEN -
367 CREATE/DIR/PROT=(S:RWED,O:RWE,G:RE,W:RE) OSSL_DATAROOT:[CERTS]
368 IF F$SEARCH("OSSL_DATAROOT:[000000]PRIVATE.DIR;1") .EQS. "" THEN -
369 CREATE/DIR/PROT=(S:RWED,O:RWE,G,W) OSSL_DATAROOT:[PRIVATE]
370 IF F$SEARCH("OSSL_DATAROOT:[000000]MISC.DIR;1") .EQS. "" THEN -
371 CREATE/DIR/PROT=(S:RWED,O:RWE,G,W) OSSL_DATAROOT:[MISC]
372 COPY/PROT=W:RE $(MISC_SCRIPTS) OSSL_DATAROOT:[MISC]
373 @ ! Install configuration file
374 COPY/PROT=W:RE {- sourcefile("apps", "openssl-vms.cnf") -} -
375 ossl_dataroot:[000000]openssl.cnf
377 install_dev : check_INSTALLTOP
378 @ WRITE SYS$OUTPUT "*** Installing development files"
379 @ ! Install header files
380 - CREATE/DIR ossl_installroot:[include.openssl]
381 COPY/PROT=W:R openssl:*.h ossl_installroot:[include.openssl]
382 @ ! Install static (development) libraries
383 - CREATE/DIR ossl_installroot:[LIB.'arch']
385 map { "COPY/PROT=W:R $_.OLB ossl_installroot:[LIB.'arch']" }
386 @{$unified_info{install}->{libraries}}) -}
387 @ {- output_off() if $disabled{shared}; "" -} !
388 @ ! Install shared (runtime) libraries
390 map { "COPY/PROT=W:R $_.EXE ossl_installroot:[LIB.'arch']" }
392 @ {- output_on() if $disabled{shared}; "" -} !
394 install_runtime : check_INSTALLTOP
395 @ ! {- output_off() if $disabled{apps}; "" -}
396 @ WRITE SYS$OUTPUT "*** Installing runtime files"
397 @ {- output_off() if $disabled{shared}; "" -} !
398 @ ! Install shared (runtime) libraries
400 map { "COPY/PROT=W:R $_.OLB ossl_installroot:[LIB.'arch']" }
402 @ {- output_on() if $disabled{shared}; "" -} !
403 @ ! Install the main program
404 - CREATE/DIR ossl_installroot:[EXE.'arch']
405 COPY/PROT=W:RE [.APPS]openssl.EXE -
406 ossl_installroot:[EXE.'arch']openssl{- $osslver -}.EXE
408 COPY/PROT=W:RE $(BIN_SCRIPTS) ossl_installroot:[EXE]
409 @ ! {- output_on() if $disabled{apps}; "" -}
411 install_engines : check_INSTALLTOP
412 @ {- output_off() unless scalar @{$unified_info{engines}}; "" -} !
413 @ WRITE SYS$OUTPUT "*** Installing engines"
414 - CREATE/DIR ossl_installroot:[ENGINES{- $sover.$target{pointer_size} -}.'arch']
416 map { "COPY/PROT=W:RE $_.EXE ossl_installroot:[ENGINES$sover$target{pointer_size}.'arch']" }
417 @{$unified_info{install}->{engines}}) -}
418 @ {- output_on() unless scalar @{$unified_info{engines}}; "" -} !
420 install_startup : [.VMS]openssl_startup.com [.VMS]openssl_shutdown.com -
421 [.VMS]openssl_utils.com, check_INSTALLTOP
422 - CREATE/DIR ossl_installroot:[SYS$STARTUP]
423 COPY/PROT=W:RE [.VMS]openssl_startup.com -
424 ossl_installroot:[SYS$STARTUP]openssl_startup{- $osslver -}.com
425 COPY/PROT=W:RE [.VMS]openssl_shutdown.com -
426 ossl_installroot:[SYS$STARTUP]openssl_shutdown{- $osslver -}.com
427 COPY/PROT=W:RE [.VMS]openssl_utils.com -
428 ossl_installroot:[SYS$STARTUP]openssl_utils{- $osslver -}.com
430 install_ivp : [.VMS]openssl_ivp.com check_INSTALLTOP
431 - CREATE/DIR ossl_installroot:[SYSTEST]
432 COPY/PROT=W:RE [.VMS]openssl_ivp.com -
433 ossl_installroot:[SYSTEST]openssl_ivp{- $osslver -}.com
435 [.VMS]openssl_startup.com : vmsconfig.pm {- sourcefile("VMS", "openssl_startup.com.in") -}
437 $(PERL) "-I." "-Mvmsconfig" {- sourcefile("util", "dofile.pl") -} -
438 {- sourcefile("VMS", "openssl_startup.com.in") -} -
439 > [.VMS]openssl_startup.com
441 [.VMS]openssl_utils.com : vmsconfig.pm {- sourcefile("VMS", "openssl_utils.com.in") -}
443 $(PERL) "-I." "-Mvmsconfig" {- sourcefile("util", "dofile.pl") -} -
444 {- sourcefile("VMS", "openssl_utils.com.in") -} -
445 > [.VMS]openssl_utils.com
447 [.VMS]openssl_shutdown.com : vmsconfig.pm {- sourcefile("VMS", "openssl_shutdown.com.in") -}
449 $(PERL) "-I." "-Mvmsconfig" {- sourcefile("util", "dofile.pl") -} -
450 {- sourcefile("VMS", "openssl_shutdown.com.in") -} -
451 > [.VMS]openssl_shutdown.com
453 [.VMS]openssl_ivp.com : vmsconfig.pm {- sourcefile("VMS", "openssl_ivp.com.in") -}
455 $(PERL) "-I." "-Mvmsconfig" {- sourcefile("util", "dofile.pl") -} -
456 {- sourcefile("VMS", "openssl_ivp.com.in") -} -
457 > [.VMS]openssl_ivp.com
459 vmsconfig.pm : configdata.pm
460 OPEN/WRITE/SHARE=READ CONFIG []vmsconfig.pm
461 WRITE CONFIG "package vmsconfig;"
462 WRITE CONFIG "use strict; use warnings;"
463 WRITE CONFIG "use Exporter;"
464 WRITE CONFIG "our @ISA = qw(Exporter);"
465 WRITE CONFIG "our @EXPORT = qw(%config %target %withargs %unified_info %disabled);"
466 WRITE CONFIG "our %config = ("
467 WRITE CONFIG " target => '","{- $config{target} -}","',"
468 WRITE CONFIG " version => '","{- $config{version} -}","',"
469 WRITE CONFIG " shlib_major => '","{- $config{shlib_major} -}","',"
470 WRITE CONFIG " shlib_minor => '","{- $config{shlib_minor} -}","',"
471 WRITE CONFIG " no_shared => '","{- $disabled{shared} -}","',"
472 WRITE CONFIG " INSTALLTOP => '$(INSTALLTOP)',"
473 WRITE CONFIG " OPENSSLDIR => '$(OPENSSLDIR)',"
474 WRITE CONFIG " pointer_size => '","{- $target{pointer_size} -}","',"
476 WRITE CONFIG "our %target = ();"
477 WRITE CONFIG "our %disabled = ();"
478 WRITE CONFIG "our %withargs = ();"
479 WRITE CONFIG "our %unified_info = ();"
483 install_html_docs : check_INSTALLTOP
484 @ $(PERL) {- sourcefile("util", "process_docs.pl") -} -
485 --destdir=ossl_installroot:[HTML] --type=html
488 @ IF "$(INSTALLTOP)" .EQS. "" THEN -
489 WRITE SYS$ERROR "INSTALLTOP should not be empty"
490 @ IF "$(INSTALLTOP)" .EQS. "" THEN -
493 # Helper targets #####################################################
495 # Developer targets ##################################################
498 SH LOGICAL/PROC openssl,internal,ossl_installroot,ossl_dataroot
500 # Building targets ###################################################
502 configdata.pm : {- join(" ", sourcefile("Configurations", "descrip.mms.tmpl"), sourcefile("Configurations", "common.tmpl")) -} $(SRCDIR)Configure $(SRCDIR)config.com {- join(" ", @{$config{build_infos}}) -}
503 @ WRITE SYS$OUTPUT "Reconfiguring..."
504 perl $(SRCDIR)Configure reconf
505 @ WRITE SYS$OUTPUT "*************************************************"
506 @ WRITE SYS$OUTPUT "*** ***"
507 @ WRITE SYS$OUTPUT "*** Please run the same mms command again ***"
508 @ WRITE SYS$OUTPUT "*** ***"
509 @ WRITE SYS$OUTPUT "*************************************************"
510 @ PIPE ( EXIT %X10000000 )
514 use File::Spec::Functions qw/abs2rel rel2abs catfile catdir/;
518 my $generator = join(" ", @{$args{generator}});
519 my $generator_incs = join("", map { ' "-I'.$_.'"' } @{$args{generator_incs}});
520 my $deps = join(", -\n\t\t", @{$args{generator_deps}}, @{$args{deps}});
522 if ($args{src} !~ /\.[sS]$/) {
523 if ($args{generator}->[0] =~ m|^.*\.in$|) {
524 my $dofile = abs2rel(rel2abs(catfile($config{sourcedir},
525 "util", "dofile.pl")),
526 rel2abs($config{builddir}));
528 $args{src} : $args{generator}->[0] $deps
529 \$(PERL) "-I\$(BLDDIR)" "-Mconfigdata" $dofile \\
530 "-o$target{build_file}" $generator > \$@
534 $args{src} : $args{generator}->[0] $deps
535 \$(PERL)$generator_incs $generator > \$@
539 die "No method to generate assembler source present.\n";
545 my $obj = $args{obj};
546 my $deps = join(", -\n\t\t", @{$args{srcs}}, @{$args{deps}});
548 # Because VMS C isn't very good at combining a /INCLUDE path with
549 # #includes having a relative directory (like '#include "../foo.h"),
550 # the best choice is to move to the first source file's intended
551 # directory before compiling, and make sure to write the object file
552 # in the correct position (important when the object tree is other
553 # than the source tree).
554 my $forward = dirname($args{srcs}->[0]);
555 my $backward = abs2rel(rel2abs("."), rel2abs($forward));
556 my $objd = abs2rel(rel2abs(dirname($obj)), rel2abs($forward));
557 my $objn = basename($obj);
560 map { abs2rel(rel2abs($_), rel2abs($forward)) } @{$args{srcs}});
561 my $ecflags = { lib => '$(LIB_CFLAGS)',
562 dso => '$(DSO_CFLAGS)',
563 bin => '$(BIN_CFLAGS)' } -> {$args{intent}};
564 my $incs_on = "\@ !";
565 my $incs_off = "\@ !";
568 push @incs, @{$args{incs}} if @{$args{incs}};
569 unless ($disabled{zlib}) {
570 # GNV$ZLIB_INCLUDE is the standard logical name for later zlib
572 push @incs, ($withargs{zlib_include} || 'GNV$ZLIB_INCLUDE:');
576 "DEFINE tmp_includes "
577 .join(",-\n\t\t\t", map {
578 file_name_is_absolute($_)
579 ? $_ : catdir($backward,$_)
581 $incs_off = "DEASSIGN tmp_includes";
582 $incs = " /INCLUDE=(tmp_includes:)";
584 my $before = $unified_info{before}->{$obj.".OBJ"} || "\@ !";
585 my $after = $unified_info{after}->{$obj.".OBJ"} || "\@ !";
586 my $depbuild = $disabled{makedepend} ? ""
587 : " /MMS=(FILE=${objd}${objn}.tmp-D,TARGET=$obj.OBJ)";
594 \$(CC) \$(CFLAGS)${ecflags}${incs}${depbuild} /OBJECT=${objd}${objn}.OBJ /REPOSITORY=$backward $srcs
596 SET DEFAULT $backward
598 \@ PIPE ( \$(PERL) -e "use File::Compare qw/compare_text/; my \$x = compare_text(""$obj.D"",""$obj.tmp-D""); exit(0x10000000 + (\$x == 0));" || -
599 RENAME $obj.tmp-D $obj.d )
600 \@ IF F\$SEARCH("$obj.tmp-D") .NES. "" THEN DELETE $obj.tmp-D;*
606 my $lib = $args{lib};
607 my $shlib = $args{shlib};
608 my $libd = dirname($lib);
609 my $libn = basename($lib);
610 (my $mkdef_key = $libn) =~ s/^${osslprefix_q}lib([^0-9]*)\d*/$1/i;
612 $disabled{shared} ? $_.".OLB"
613 : $unified_info{sharednames}->{$_}.".EXE"; } @{$args{deps}};
614 my $deps = join(", -\n\t\t", @deps);
615 my $shlib_target = $disabled{shared} ? "" : $target{shared_target};
616 my $ordinalsfile = defined($args{ordinals}) ? $args{ordinals}->[1] : "";
617 my $engine_opt = abs2rel(rel2abs(catfile($config{sourcedir},
618 "VMS", "engine.opt")),
619 rel2abs($config{builddir}));
620 my $mkdef_pl = abs2rel(rel2abs(catfile($config{sourcedir},
621 "util", "mkdef.pl")),
622 rel2abs($config{builddir}));
623 my $translatesyms_pl = abs2rel(rel2abs(catfile($config{sourcedir},
624 "VMS", "translatesyms.pl")),
625 rel2abs($config{builddir}));
626 # The "[]" hack is because in .OPT files, each line inherits the
627 # previous line's file spec as default, so if no directory spec
628 # is present in the current line and the previous line has one that
629 # doesn't apply, you're in for a surprise.
631 join("\n\t", map { my $x = $_ =~ /\[/ ? $_ : "[]".$_;
632 $x =~ s|(\.EXE)|$1/SHARE|;
633 $x =~ s|(\.OLB)|$1/LIB|;
634 "WRITE OPT_FILE \"$x\"" } @deps)
637 $shlib.EXE : $lib.OLB $deps $ordinalsfile
638 \$(PERL) $mkdef_pl "$mkdef_key" "VMS" > $shlib.SYMVEC-tmp
639 \$(PERL) $translatesyms_pl \$(BLDDIR)CXX\$DEMANGLER_DB. < $shlib.SYMVEC-tmp > $shlib.SYMVEC
640 DELETE $shlib.SYMVEC-tmp;*
641 OPEN/WRITE/SHARE=READ OPT_FILE $shlib.OPT
642 WRITE OPT_FILE "IDENTIFICATION=""V$config{version}"""
643 TYPE $shlib.SYMVEC /OUTPUT=OPT_FILE:
644 WRITE OPT_FILE "$lib.OLB/LIBRARY"
647 LINK /MAP=$shlib.MAP /FULL/SHARE=$shlib.EXE $shlib.OPT/OPT \$(EX_LIBS)
648 DELETE $shlib.SYMVEC;*
649 PURGE $shlib.EXE,$shlib.OPT,$shlib.MAP
654 my $lib = $args{lib};
655 my $libd = dirname($lib);
656 my $libn = basename($lib);
657 (my $libn_nolib = $libn) =~ s/^lib//;
658 my @objs = map { "$_.OBJ" } @{$args{objs}};
660 $disabled{shared} ? $_.".OLB"
661 : $unified_info{sharednames}->{$_}.".EXE"; } @{$args{deps}};
662 my $deps = join(", -\n\t\t", @objs, @deps);
663 my $shlib_target = $disabled{shared} ? "" : $target{shared_target};
664 my $engine_opt = abs2rel(rel2abs(catfile($config{sourcedir},
665 "VMS", "engine.opt")),
666 rel2abs($config{builddir}));
667 # The "[]" hack is because in .OPT files, each line inherits the
668 # previous line's file spec as default, so if no directory spec
669 # is present in the current line and the previous line has one that
670 # doesn't apply, you're in for a surprise.
672 join(",-\"\n\t", map { my $x = $_ =~ /\[/ ? $_ : "[]".$_;
673 "WRITE OPT_FILE \"$x" } @objs).
675 join("\n\t", map { my $x = $_ =~ /\[/ ? $_ : "[]".$_;
676 $x =~ s|(\.EXE)|$1/SHARE|;
677 $x =~ s|(\.OLB)|$1/LIB|;
678 "WRITE OPT_FILE \"$x\"" } @deps)
682 OPEN/WRITE/SHARE=READ OPT_FILE $lib.OPT
683 TYPE $engine_opt /OUTPUT=OPT_FILE:
686 LINK /MAP=$lib.MAP /FULL/SHARE=$lib.EXE $lib.OPT/OPT \$(EX_LIBS)
687 - PURGE $lib.EXE,$lib.OPT,$lib.MAP
692 my $lib = $args{lib};
693 my $objs = join(", -\n\t\t", map { $_.".OBJ" } (@{$args{objs}}));
694 my $fill_lib = join("\n\t", (map { "LIBRARY/REPLACE $lib.OLB $_.OBJ" }
698 LIBRARY/CREATE/OBJECT $lib.OLB
705 my $bin = $args{bin};
706 my $bind = dirname($bin);
707 my $binn = basename($bin);
708 my @objs = map { "$_.OBJ" } @{$args{objs}};
710 $disabled{shared} ? $_.".OLB"
711 : $unified_info{sharednames}->{$_}.".EXE"; } @{$args{deps}};
712 my $deps = join(", -\n\t\t", @objs, @deps);
713 # The "[]" hack is because in .OPT files, each line inherits the
714 # previous line's file spec as default, so if no directory spec
715 # is present in the current line and the previous line has one that
716 # doesn't apply, you're in for a surprise.
718 join(",-\"\n\t", map { my $x = $_ =~ /\[/ ? $_ : "[]".$_;
719 "WRITE OPT_FILE \"$x" } @objs).
721 join("\n\t", map { my $x = $_ =~ /\[/ ? $_ : "[]".$_;
722 $x =~ s|(\.EXE)|$1/SHARE|;
723 $x =~ s|(\.OLB)|$1/LIB|;
724 "WRITE OPT_FILE \"$x\"" } @deps)
728 OPEN/WRITE/SHARE=READ OPT_FILE $bin.OPT
731 LINK/EXEC=$bin.EXE \$(LDFLAGS) $bin.OPT/OPT \$(EX_LIBS)
732 - PURGE $bin.EXE,$bin.OPT
737 my $script = $args{script};
738 return "" if grep { $_ eq $script } @{$args{sources}}; # No overwrite!
739 my $sources = join(" ", @{$args{sources}});
740 my $dofile = abs2rel(rel2abs(catfile($config{sourcedir},
741 "util", "dofile.pl")),
742 rel2abs($config{builddir}));
745 \$(PERL) "-I\$(BLDDIR)" "-Mconfigdata" $dofile -
746 "-o$target{build_file}" $sources > $script
747 SET FILE/PROT=(S:RWED,O:RWED,G:RE,W:RE) $script
751 "" # Important! This becomes part of the template result.