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}
87 # This makes sure things get built in the order they need
92 return "$target : build_generated\n\t\pipe \$(MMS) depend && \$(MMS) _$target\n_$target";
95 #print STDERR "DEBUG: before:\n", Dumper($unified_info{before});
96 #print STDERR "DEBUG: after:\n", Dumper($unified_info{after});
99 PLATFORM={- $config{target} -}
100 OPTIONS={- $config{options} -}
101 CONFIGURE_ARGS=({- join(", ",quotify_l(@{$config{perlargv}})) -})
102 SRCDIR={- $config{sourcedir} -}
103 BLDDIR={- $config{builddir} -}
105 # Allow both V and VERBOSE to indicate verbosity. This only applies
109 VERSION={- $config{version} -}
110 MAJOR={- $config{major} -}
111 MINOR={- $config{minor} -}
112 SHLIB_VERSION_NUMBER={- $config{shlib_version_number} -}
113 SHLIB_VERSION_HISTORY={- $config{shlib_version_history} -}
114 SHLIB_MAJOR={- $config{shlib_major} -}
115 SHLIB_MINOR={- $config{shlib_minor} -}
116 SHLIB_TARGET={- $target{shared_target} -}
124 LIBS={- join(", ", map { "-\n\t".$_.".OLB" } @{$unified_info{libraries}}) -}
125 SHLIBS={- join(", ", map { "-\n\t".$_.".EXE" } @shlibs) -}
126 ENGINES={- join(", ", map { "-\n\t".$_.".EXE" } @{$unified_info{engines}}) -}
127 PROGRAMS={- join(", ", map { "-\n\t".$_.".EXE" } @{$unified_info{programs}}) -}
128 SCRIPTS={- join(", ", map { "-\n\t".$_ } @{$unified_info{scripts}}) -}
129 {- output_off() if $disabled{makedepend}; "" -}
130 DEPS={- our @deps = map { (my $x = $_) =~ s|\.o$|\$(DEP_EXT)|; $x; }
131 grep { $unified_info{sources}->{$_}->[0] =~ /\.c$/ }
132 keys %{$unified_info{sources}};
133 join(", ", map { "-\n\t".$_ } @deps); -}
134 {- output_on() if $disabled{makedepend}; "" -}
135 GENERATED_MANDATORY={- join(", ", map { "-\n\t".$_ } @{$unified_info{depends}->{""}} ) -}
136 GENERATED={- join(", ", map { "-\n\t".$_ } @generated) -}
138 INSTALL_LIBS={- join(", ", map { "-\n\t".$_.".OLB" } @{$unified_info{install}->{libraries}}) -}
139 INSTALL_SHLIBS={- join(", ", map { "-\n\t".$_.".EXE" } @install_shlibs) -}
140 INSTALL_ENGINES={- join(", ", map { "-\n\t".$_.".EXE" } @{$unified_info{install}->{engines}}) -}
141 INSTALL_PROGRAMS={- join(", ", map { "-\n\t".$_.".EXE" } @{$unified_info{install}->{programs}}) -}
142 {- output_off() if $disabled{apps}; "" -}
143 BIN_SCRIPTS=[.tools]c_rehash.pl
144 MISC_SCRIPTS=[.apps]CA.pl, [.apps]tsget.pl
145 {- output_on() if $disabled{apps}; "" -}
147 # DESTDIR is for package builders so that they can configure for, say,
148 # SYS$COMMON:[OPENSSL] and yet have everything installed in STAGING:[USER].
149 # In that case, configure with --prefix=SYS$COMMON:[OPENSSL] and then run
150 # MMS with /MACROS=(DESTDIR=STAGING:[USER]). The result will end up in
151 # STAGING:[USER.OPENSSL].
152 # Normally it is left empty.
155 # Do not edit this manually. Use Configure --prefix=DIR to change this!
156 INSTALLTOP={- our $installtop =
157 catdir($config{prefix}) || "SYS\$COMMON:[OPENSSL]";
159 SYSTARTUP={- catdir($installtop, '[.SYS$STARTUP]'); -}
160 # This is the standard central area to store certificates, private keys...
161 OPENSSLDIR={- catdir($config{openssldir}) or
162 $config{prefix} ? catdir($config{prefix},"COMMON")
163 : "SYS\$COMMON:[OPENSSL-COMMON]" -}
164 # The same, but for C
165 OPENSSLDIR_C={- $osslprefix -}DATAROOT:[000000]
166 # Where installed engines reside, for C
167 ENGINESDIR_C={- $osslprefix -}ENGINES{- $sover.$target{pointer_size} -}:
169 CC= {- $target{cc} -}
170 CFLAGS= /DEFINE=({- join(",", @{$target{defines}}, @{$config{defines}},"OPENSSLDIR=\"\"\"\$(OPENSSLDIR_C)\"\"\"","ENGINESDIR=\"\"\"\$(ENGINESDIR_C)\"\"\"") -}) {- $target{cflags} -} {- $config{cflags} -}
172 DEPFLAG= /DEFINE=({- join(",", @{$config{depdefines}}) -})
173 LDFLAGS= {- $target{lflags} -}
174 EX_LIBS= {- $target{ex_libs} ? ",".$target{ex_libs} : "" -}{- $config{ex_libs} ? ",".$config{ex_libs} : "" -}
175 LIB_CFLAGS={- $target{lib_cflags} || "" -}
176 DSO_CFLAGS={- $target{dso_cflags} || "" -}
177 BIN_CFLAGS={- $target{bin_cflags} || "" -}
179 PERL={- $config{perl} -}
181 # We let the C compiler driver to take care of .s files. This is done in
182 # order to be excused from maintaining a separate set of architecture
183 # dependent assembler flags. E.g. if you throw -mcpu=ultrasparc at SPARC
184 # gcc, then the driver will automatically translate it to -xarch=v8plus
185 # and pass it down to assembler.
187 ASFLAG={- $target{asflags} -}
189 # .FIRST and .LAST are special targets with MMS and MMK.
190 # The defines in there are for C. includes that look like
193 # #include <openssl/foo.h>
194 # #include "internal/bar.h"
196 # will use the logical names to find the files. Expecting
197 # DECompHP C to find files in subdirectories of whatever was
198 # given with /INCLUDE is a fantasy, unfortunately.
201 $(NODEBUG) openssl_inc1 = F$PARSE("[.include.openssl]","A.;",,,"syntax_only") - "A.;"
202 $(NODEBUG) openssl_inc2 = F$PARSE("{- catdir($config{sourcedir},"[.include.openssl]") -}","A.;",,,"SYNTAX_ONLY") - "A.;"
203 $(NODEBUG) internal_inc1 = F$PARSE("[.crypto.include.internal]","A.;",,,"SYNTAX_ONLY") - "A.;"
204 $(NODEBUG) internal_inc2 = F$PARSE("{- catdir($config{sourcedir},"[.include.internal]") -}","A.;",,,"SYNTAX_ONLY") - "A.;"
205 $(NODEBUG) internal_inc3 = F$PARSE("{- catdir($config{sourcedir},"[.crypto.include.internal]") -}","A.;",,,"SYNTAX_ONLY") - "A.;"
206 $(NODEBUG) DEFINE openssl 'openssl_inc1','openssl_inc2'
207 $(NODEBUG) DEFINE internal 'internal_inc1','internal_inc2','internal_inc3'
208 $(NODEBUG) staging_dir = "$(DESTDIR)"
209 $(NODEBUG) staging_instdir = ""
210 $(NODEBUG) staging_datadir = ""
211 $(NODEBUG) IF staging_dir .NES. "" THEN -
212 staging_instdir = F$PARSE("A.;",staging_dir,"[]",,"SYNTAX_ONLY")
213 $(NODEBUG) IF staging_instdir - "]A.;" .NES. staging_instdir THEN -
214 staging_instdir = staging_instdir - "]A.;" + ".OPENSSL-INSTALL]"
215 $(NODEBUG) IF staging_instdir - "A.;" .NES. staging_instdir THEN -
216 staging_instdir = staging_instdir - "A.;" + "[OPENSSL-INSTALL]"
217 $(NODEBUG) IF staging_dir .NES. "" THEN -
218 staging_datadir = F$PARSE("A.;",staging_dir,"[]",,"SYNTAX_ONLY")
219 $(NODEBUG) IF staging_datadir - "]A.;" .NES. staging_datadir THEN -
220 staging_datadir = staging_datadir - "]A.;" + ".OPENSSL-COMMON]"
221 $(NODEBUG) IF staging_datadir - "A.;" .NES. staging_datadir THEN -
222 staging_datadir = staging_datadir - "A.;" + "[OPENSSL-COMMON]"
224 $(NODEBUG) ! Installation logical names
226 $(NODEBUG) installtop = F$PARSE(staging_instdir,"$(INSTALLTOP)","[]A.;",,"SYNTAX_ONLY,NO_CONCEAL") - ".][000000" - "[000000." - "][" - "]A.;" + ".]"
227 $(NODEBUG) datatop = F$PARSE(staging_datadir,"$(OPENSSLDIR)","[]A.;",,"SYNTAX_ONLY,NO_CONCEAL") - ".][000000" - "[000000." - "][" - "]A.;" + ".]"
228 $(NODEBUG) DEFINE ossl_installroot 'installtop'
229 $(NODEBUG) DEFINE ossl_dataroot 'datatop'
231 $(NODEBUG) ! Figure out the architecture
233 $(NODEBUG) arch = f$edit( f$getsyi( "arch_name"), "upcase")
235 $(NODEBUG) ! Set up logical names for the libraries, so LINK and
236 $(NODEBUG) ! running programs can use them.
238 $(NODEBUG) {- join("\n\t\$(NODEBUG) ", map { "DEFINE ".uc($_)." 'F\$ENV(\"DEFAULT\")'".uc($_)."\$(SHLIB_EXT)" } map { $unified_info{sharednames}->{$_} || () } @{$unified_info{libraries}}) || "!" -}
241 $(NODEBUG) {- join("\n\t\$(NODEBUG) ", map { "DEASSIGN ".uc($_) } map { $unified_info{sharednames}->{$_} || () } @{$unified_info{libraries}}) || "!" -}
242 $(NODEBUG) DEASSIGN ossl_dataroot
243 $(NODEBUG) DEASSIGN ossl_installroot
244 $(NODEBUG) DEASSIGN internal
245 $(NODEBUG) DEASSIGN openssl
247 @ ! MMS cannot handle no actions...
249 # The main targets ###################################################
251 {- dependmagic('all'); -} : build_libs_nodep, build_engines_nodep, build_programs_nodep
252 {- dependmagic('build_libs'); -} : build_libs_nodep
253 {- dependmagic('build_engines'); -} : build_engines_nodep
254 {- dependmagic('build_programs'); -} : build_programs_nodep
256 build_generated : $(GENERATED_MANDATORY)
257 build_libs_nodep : $(LIBS), $(SHLIBS)
258 build_engines_nodep : $(ENGINES)
259 build_programs_nodep : $(PROGRAMS), $(SCRIPTS)
261 # Kept around for backward compatibility
262 build_apps build_tests : build_programs
265 {- dependmagic('tests'); -} : build_programs_nodep, build_engines_nodep
266 @ ! {- output_off() if $disabled{tests}; "" -}
267 SET DEFAULT [.test]{- move("test") -}
268 DEFINE SRCTOP {- sourcedir() -}
269 DEFINE BLDTOP {- builddir() -}
270 DEFINE OPENSSL_ENGINES {- builddir("engines") -}
271 DEFINE OPENSSL_DEBUG_MEMORY "on"
272 IF "$(VERBOSE)" .NES. "" THEN DEFINE VERBOSE "$(VERBOSE)"
273 $(PERL) {- sourcefile("test", "run_tests.pl") -} $(TESTS)
274 DEASSIGN OPENSSL_DEBUG_MEMORY
275 DEASSIGN OPENSSL_ENGINES
278 SET DEFAULT [-]{- move("..") -}
279 @ ! {- if ($disabled{tests}) { output_on(); } else { output_off(); } "" -}
280 @ WRITE SYS$OUTPUT "Tests are not supported with your chosen Configure options"
281 @ ! {- output_on() if !$disabled{tests}; "" -}
284 @ ! {- output_off() if $disabled{tests}; "" -}
285 @ DEFINE SRCTOP {- sourcedir() -}
286 @ $(PERL) {- sourcefile("test", "run_tests.pl") -} list
288 @ ! {- if ($disabled{tests}) { output_on(); } else { output_off(); } "" -}
289 @ WRITE SYS$OUTPUT "Tests are not supported with your chosen Configure options"
290 @ ! {- output_on() if !$disabled{tests}; "" -}
292 install : install_sw install_ssldirs install_docs
293 @ WRITE SYS$OUTPUT ""
294 @ WRITE SYS$OUTPUT "######################################################################"
295 @ WRITE SYS$OUTPUT ""
296 @ IF "$(DESTDIR)" .EQS. "" THEN -
297 PIPE ( WRITE SYS$OUTPUT "Installation complete" ; -
298 WRITE SYS$OUTPUT "" ; -
299 WRITE SYS$OUTPUT "Run @$(SYSTARTUP)openssl_startup{- $osslver -} to set up logical names" ; -
300 WRITE SYS$OUTPUT "then run @$(SYSTARTUP)openssl_utils{- $osslver -} to define commands" ; -
301 WRITE SYS$OUTPUT "" )
302 @ IF "$(DESTDIR)" .NES. "" THEN -
303 PIPE ( WRITE SYS$OUTPUT "Staging installation complete" ; -
304 WRITE SYS$OUTPUT "" ; -
305 WRITE SYS$OUTPUT "Finish or package in such a way that the contents of the directory tree" ; -
306 WRITE SYS$OUTPUT staging_instdir ; -
307 WRITE SYS$OUTPUT "ends up in $(INSTALLTOP)," ; -
308 WRITE SYS$OUTPUT "and that the contents of the contents of the directory tree" ; -
309 WRITE SYS$OUTPUT staging_datadir ; -
310 WRITE SYS$OUTPUT "ends up in $(OPENSSLDIR)" ; -
311 WRITE SYS$OUTPUT "" ; -
312 WRITE SYS$OUTPUT "When in its final destination," ; -
313 WRITE SYS$OUTPUT "Run @$(SYSTARTUP)openssl_startup{- $osslver -} to set up logical names" ; -
314 WRITE SYS$OUTPUT "then run @$(SYSTARTUP)openssl_utils{- $osslver -} to define commands" ; -
315 WRITE SYS$OUTPUT "" )
318 spawn/nolog @ossl_installroot:[SYSTEST]openssl_ivp{- $osslver -}.com
320 uninstall : uninstall_docs uninstall_sw
322 # Because VMS wants the generation number (or *) to delete files, we can't
323 # use $(LIBS), $(PROGRAMS), $(GENERATED) and $(ENGINES)directly.
325 {- join("\n\t", map { "- DELETE $_.OLB;*" } @{$unified_info{libraries}}) || "@ !" -}
326 {- join("\n\t", map { "- DELETE $_.EXE;*,$_.MAP;*,$_.OPT;*" } @shlibs) || "@ !" -}
329 {- join("\n\t", map { "- DELETE $_.EXE;*,$_.OPT;*" } @{$unified_info{programs}}) || "@ !" -}
330 {- join("\n\t", map { "- DELETE $_.EXE;*,$_.OPT;*" } @{$unified_info{engines}}) || "@ !" -}
331 {- join("\n\t", map { "- DELETE $_;*" } @{$unified_info{scripts}}) || "@ !" -}
332 {- join("\n\t", map { "- DELETE $_;*" } @generated) || "@ !" -}
333 - DELETE [...]*.MAP;*
335 - DELETE [...]*.OBJ;*,*.LIS;*
336 - DELETE []CXX$DEMANGLER_DB.;*
337 - DELETE [.VMS]openssl_startup.com;*
338 - DELETE [.VMS]openssl_shutdown.com;*
339 - DELETE []vmsconfig.pm;*
342 - DELETE configdata.pm;*
343 - DELETE descrip.mms;*
347 @ ! {- output_off() if $disabled{makedepend}; "" -}
348 @ $(PERL) -pe "if (/^# DO NOT DELETE.*/) { exit(0); }" -
349 < descrip.mms > descrip.mms-new
350 @ OPEN/APPEND DESCRIP descrip.mms-new
351 @ WRITE DESCRIP "# DO NOT DELETE THIS LINE -- make depend depends on it."
352 {- join("\n\t", map { "\@ IF F\$SEARCH(\"$_\") .NES. \"\" THEN TYPE $_ /OUTPUT=DESCRIP:" } @deps); -}
354 @ PIPE ( $(PERL) -e "use File::Compare qw/compare_text/; my $x = compare_text(""descrip.mms"",""descrip.mms-new""); exit(0x10000000 + ($x == 0));" || -
355 RENAME descrip.mms-new descrip.mms )
356 @ IF F$SEARCH("descrip.mms-new") .NES. "" THEN DELETE descrip.mms-new;*
357 -@ SPAWN/OUTPUT=NLA0: PURGE/NOLOG descrip.mms
358 @ ! {- output_on() if $disabled{makedepend}; "" -}
360 # Install helper targets #############################################
362 install_sw : all install_shared _install_dev_ns -
363 install_engines _install_runtime_ns -
364 install_startup install_ivp
366 uninstall_sw : uninstall_shared _uninstall_dev_ns -
367 uninstall_engines _uninstall_runtime_ns -
368 uninstall_startup uninstall_ivp
370 install_docs : install_html_docs
372 uninstall_docs : uninstall_html_docs
374 install_ssldirs : check_INSTALLTOP
375 - CREATE/DIR/PROT=(S:RWED,O:RWE,G:RE,W:RE) OSSL_DATAROOT:[000000]
376 IF F$SEARCH("OSSL_DATAROOT:[000000]CERTS.DIR;1") .EQS. "" THEN -
377 CREATE/DIR/PROT=(S:RWED,O:RWE,G:RE,W:RE) OSSL_DATAROOT:[CERTS]
378 IF F$SEARCH("OSSL_DATAROOT:[000000]PRIVATE.DIR;1") .EQS. "" THEN -
379 CREATE/DIR/PROT=(S:RWED,O:RWE,G,W) OSSL_DATAROOT:[PRIVATE]
380 IF F$SEARCH("OSSL_DATAROOT:[000000]MISC.DIR;1") .EQS. "" THEN -
381 CREATE/DIR/PROT=(S:RWED,O:RWE,G,W) OSSL_DATAROOT:[MISC]
382 COPY/PROT=W:RE $(MISC_SCRIPTS) OSSL_DATAROOT:[MISC]
383 @ ! Install configuration file
384 COPY/PROT=W:R {- sourcefile("apps", "openssl-vms.cnf") -} -
385 ossl_dataroot:[000000]openssl.cnf-dist
386 IF F$SEARCH("OSSL_DATAROOT:[000000]openssl.cnf") .EQS. "" THEN -
387 COPY/PROT=W:R {- sourcefile("apps", "openssl-vms.cnf") -} -
388 ossl_dataroot:[000000]openssl.cnf
390 install_shared : check_INSTALLTOP
391 @ {- output_off() if $disabled{shared}; "" -} !
392 @ WRITE SYS$OUTPUT "*** Installing shareable images"
393 @ ! Install shared (runtime) libraries
394 - CREATE/DIR ossl_installroot:[LIB.'arch']
396 map { "COPY/PROT=W:R $_.EXE ossl_installroot:[LIB.'arch']" }
398 @ {- output_on() if $disabled{shared}; "" -} !
400 _install_dev_ns : check_INSTALLTOP
401 @ WRITE SYS$OUTPUT "*** Installing development files"
402 @ ! Install header files
403 - CREATE/DIR ossl_installroot:[include.openssl]
404 COPY/PROT=W:R openssl:*.h ossl_installroot:[include.openssl]
405 @ ! Install static (development) libraries
406 - CREATE/DIR ossl_installroot:[LIB.'arch']
408 map { "COPY/PROT=W:R $_.OLB ossl_installroot:[LIB.'arch']" }
409 @{$unified_info{install}->{libraries}}) -}
411 install_dev : install_shared _install_dev_ns
413 _install_runtime_ns : check_INSTALLTOP
414 @ ! Install the main program
415 - CREATE/DIR ossl_installroot:[EXE.'arch']
416 COPY/PROT=W:RE [.APPS]openssl.EXE -
417 ossl_installroot:[EXE.'arch']openssl{- $osslver -}.EXE
419 COPY/PROT=W:RE $(BIN_SCRIPTS) ossl_installroot:[EXE]
420 @ ! {- output_on() if $disabled{apps}; "" -}
422 install_runtime : install_shared _install_runtime_ns
424 install_engines : check_INSTALLTOP
425 @ {- output_off() unless scalar @{$unified_info{engines}}; "" -} !
426 @ WRITE SYS$OUTPUT "*** Installing engines"
427 - CREATE/DIR ossl_installroot:[ENGINES{- $sover.$target{pointer_size} -}.'arch']
429 map { "COPY/PROT=W:RE $_.EXE ossl_installroot:[ENGINES$sover$target{pointer_size}.'arch']" }
430 @{$unified_info{install}->{engines}}) -}
431 @ {- output_on() unless scalar @{$unified_info{engines}}; "" -} !
433 install_startup : [.VMS]openssl_startup.com [.VMS]openssl_shutdown.com -
434 [.VMS]openssl_utils.com, check_INSTALLTOP
435 - CREATE/DIR ossl_installroot:[SYS$STARTUP]
436 COPY/PROT=W:RE [.VMS]openssl_startup.com -
437 ossl_installroot:[SYS$STARTUP]openssl_startup{- $osslver -}.com
438 COPY/PROT=W:RE [.VMS]openssl_shutdown.com -
439 ossl_installroot:[SYS$STARTUP]openssl_shutdown{- $osslver -}.com
440 COPY/PROT=W:RE [.VMS]openssl_utils.com -
441 ossl_installroot:[SYS$STARTUP]openssl_utils{- $osslver -}.com
443 install_ivp : [.VMS]openssl_ivp.com check_INSTALLTOP
444 - CREATE/DIR ossl_installroot:[SYSTEST]
445 COPY/PROT=W:RE [.VMS]openssl_ivp.com -
446 ossl_installroot:[SYSTEST]openssl_ivp{- $osslver -}.com
448 [.VMS]openssl_startup.com : vmsconfig.pm {- sourcefile("VMS", "openssl_startup.com.in") -}
450 $(PERL) "-I." "-Mvmsconfig" {- sourcefile("util", "dofile.pl") -} -
451 {- sourcefile("VMS", "openssl_startup.com.in") -} -
452 > [.VMS]openssl_startup.com
454 [.VMS]openssl_utils.com : vmsconfig.pm {- sourcefile("VMS", "openssl_utils.com.in") -}
456 $(PERL) "-I." "-Mvmsconfig" {- sourcefile("util", "dofile.pl") -} -
457 {- sourcefile("VMS", "openssl_utils.com.in") -} -
458 > [.VMS]openssl_utils.com
460 [.VMS]openssl_shutdown.com : vmsconfig.pm {- sourcefile("VMS", "openssl_shutdown.com.in") -}
462 $(PERL) "-I." "-Mvmsconfig" {- sourcefile("util", "dofile.pl") -} -
463 {- sourcefile("VMS", "openssl_shutdown.com.in") -} -
464 > [.VMS]openssl_shutdown.com
466 [.VMS]openssl_ivp.com : vmsconfig.pm {- sourcefile("VMS", "openssl_ivp.com.in") -}
468 $(PERL) "-I." "-Mvmsconfig" {- sourcefile("util", "dofile.pl") -} -
469 {- sourcefile("VMS", "openssl_ivp.com.in") -} -
470 > [.VMS]openssl_ivp.com
472 vmsconfig.pm : configdata.pm
473 OPEN/WRITE/SHARE=READ CONFIG []vmsconfig.pm
474 WRITE CONFIG "package vmsconfig;"
475 WRITE CONFIG "use strict; use warnings;"
476 WRITE CONFIG "use Exporter;"
477 WRITE CONFIG "our @ISA = qw(Exporter);"
478 WRITE CONFIG "our @EXPORT = qw(%config %target %withargs %unified_info %disabled);"
479 WRITE CONFIG "our %config = ("
480 WRITE CONFIG " target => '","{- $config{target} -}","',"
481 WRITE CONFIG " version => '","{- $config{version} -}","',"
482 WRITE CONFIG " shlib_major => '","{- $config{shlib_major} -}","',"
483 WRITE CONFIG " shlib_minor => '","{- $config{shlib_minor} -}","',"
484 WRITE CONFIG " no_shared => '","{- $disabled{shared} -}","',"
485 WRITE CONFIG " INSTALLTOP => '$(INSTALLTOP)',"
486 WRITE CONFIG " OPENSSLDIR => '$(OPENSSLDIR)',"
487 WRITE CONFIG " pointer_size => '","{- $target{pointer_size} -}","',"
489 WRITE CONFIG "our %target = ();"
490 WRITE CONFIG "our %disabled = ();"
491 WRITE CONFIG "our %withargs = ();"
492 WRITE CONFIG "our %unified_info = ();"
496 install_html_docs : check_INSTALLTOP
497 sourcedir = F$PARSE("{- $sourcedir -}A.;","[]") - "]A.;" + ".DOC]"
498 $(PERL) {- sourcefile("util", "process_docs.pl") -} -
499 --sourcedir='sourcedir' --destdir=ossl_installroot:[HTML] -
503 @ IF "$(INSTALLTOP)" .EQS. "" THEN -
504 WRITE SYS$ERROR "INSTALLTOP should not be empty"
505 @ IF "$(INSTALLTOP)" .EQS. "" THEN -
508 # Helper targets #####################################################
510 # Developer targets ##################################################
513 SH LOGICAL/PROC openssl,internal,ossl_installroot,ossl_dataroot
515 # Building targets ###################################################
517 configdata.pm : $(SRCDIR)Configure $(SRCDIR)config.com {- join(" ", @{$config{build_file_templates}}, @{$config{build_infos}}, @{$config{conf_files}}) -}
518 @ WRITE SYS$OUTPUT "Reconfiguring..."
519 perl $(SRCDIR)Configure reconf
520 @ WRITE SYS$OUTPUT "*************************************************"
521 @ WRITE SYS$OUTPUT "*** ***"
522 @ WRITE SYS$OUTPUT "*** Please run the same mms command again ***"
523 @ WRITE SYS$OUTPUT "*** ***"
524 @ WRITE SYS$OUTPUT "*************************************************"
525 @ PIPE ( EXIT %X10000000 )
529 use File::Spec::Functions qw/abs2rel rel2abs catfile catdir/;
533 my $generator = join(" ", @{$args{generator}});
534 my $generator_incs = join("", map { ' "-I'.$_.'"' } @{$args{generator_incs}});
535 my $deps = join(", -\n\t\t", @{$args{generator_deps}}, @{$args{deps}});
537 if ($args{src} !~ /\.[sS]$/) {
538 if ($args{generator}->[0] =~ m|^.*\.in$|) {
539 my $dofile = abs2rel(rel2abs(catfile($config{sourcedir},
540 "util", "dofile.pl")),
541 rel2abs($config{builddir}));
543 $args{src} : $args{generator}->[0] $deps
544 \$(PERL) "-I\$(BLDDIR)" "-Mconfigdata" $dofile \\
545 "-o$target{build_file}" $generator > \$@
549 $args{src} : $args{generator}->[0] $deps
550 \$(PERL)$generator_incs $generator > \$@
554 die "No method to generate assembler source present.\n";
560 my $obj = $args{obj};
561 my $deps = join(", -\n\t\t", @{$args{srcs}}, @{$args{deps}});
563 # Because VMS C isn't very good at combining a /INCLUDE path with
564 # #includes having a relative directory (like '#include "../foo.h"),
565 # the best choice is to move to the first source file's intended
566 # directory before compiling, and make sure to write the object file
567 # in the correct position (important when the object tree is other
568 # than the source tree).
569 my $forward = dirname($args{srcs}->[0]);
570 my $backward = abs2rel(rel2abs("."), rel2abs($forward));
571 my $objd = abs2rel(rel2abs(dirname($obj)), rel2abs($forward));
572 my $objn = basename($obj);
575 map { abs2rel(rel2abs($_), rel2abs($forward)) } @{$args{srcs}});
576 my $ecflags = { lib => '$(LIB_CFLAGS)',
577 dso => '$(DSO_CFLAGS)',
578 bin => '$(BIN_CFLAGS)' } -> {$args{intent}};
579 my $incs_on = "\@ !";
580 my $incs_off = "\@ !";
583 push @incs, @{$args{incs}} if @{$args{incs}};
584 unless ($disabled{zlib}) {
585 # GNV$ZLIB_INCLUDE is the standard logical name for later zlib
587 push @incs, ($withargs{zlib_include} || 'GNV$ZLIB_INCLUDE:');
591 "DEFINE tmp_includes "
592 .join(",-\n\t\t\t", map {
593 file_name_is_absolute($_)
594 ? $_ : catdir($backward,$_)
596 $incs_off = "DEASSIGN tmp_includes";
597 $incs = " /INCLUDE=(tmp_includes:)";
599 my $before = $unified_info{before}->{$obj.".OBJ"} || "\@ !";
600 my $after = $unified_info{after}->{$obj.".OBJ"} || "\@ !";
601 my $depbuild = $disabled{makedepend} ? ""
602 : " /MMS=(FILE=${objd}${objn}.tmp-D,TARGET=$obj.OBJ)";
609 \$(CC) \$(CFLAGS)${ecflags}${incs}${depbuild} /OBJECT=${objd}${objn}.OBJ /REPOSITORY=$backward $srcs
611 SET DEFAULT $backward
613 \@ PIPE ( \$(PERL) -e "use File::Compare qw/compare_text/; my \$x = compare_text(""$obj.D"",""$obj.tmp-D""); exit(0x10000000 + (\$x == 0));" || -
614 RENAME $obj.tmp-D $obj.d )
615 \@ IF F\$SEARCH("$obj.tmp-D") .NES. "" THEN DELETE $obj.tmp-D;*
621 my $lib = $args{lib};
622 my $shlib = $args{shlib};
623 my $libd = dirname($lib);
624 my $libn = basename($lib);
625 (my $mkdef_key = $libn) =~ s/^${osslprefix_q}lib([^0-9]*)\d*/$1/i;
627 $disabled{shared} ? $_.".OLB"
628 : $unified_info{sharednames}->{$_}.".EXE"; } @{$args{deps}};
629 my $deps = join(", -\n\t\t", @deps);
630 my $shlib_target = $disabled{shared} ? "" : $target{shared_target};
631 my $ordinalsfile = defined($args{ordinals}) ? $args{ordinals}->[1] : "";
632 my $engine_opt = abs2rel(rel2abs(catfile($config{sourcedir},
633 "VMS", "engine.opt")),
634 rel2abs($config{builddir}));
635 my $mkdef_pl = abs2rel(rel2abs(catfile($config{sourcedir},
636 "util", "mkdef.pl")),
637 rel2abs($config{builddir}));
638 my $translatesyms_pl = abs2rel(rel2abs(catfile($config{sourcedir},
639 "VMS", "translatesyms.pl")),
640 rel2abs($config{builddir}));
641 # The "[]" hack is because in .OPT files, each line inherits the
642 # previous line's file spec as default, so if no directory spec
643 # is present in the current line and the previous line has one that
644 # doesn't apply, you're in for a surprise.
646 join("\n\t", map { my $x = $_ =~ /\[/ ? $_ : "[]".$_;
647 $x =~ s|(\.EXE)|$1/SHARE|;
648 $x =~ s|(\.OLB)|$1/LIB|;
649 "WRITE OPT_FILE \"$x\"" } @deps)
652 $shlib.EXE : $lib.OLB $deps $ordinalsfile
653 \$(PERL) $mkdef_pl "$mkdef_key" "VMS" > $shlib.SYMVEC-tmp
654 \$(PERL) $translatesyms_pl \$(BLDDIR)CXX\$DEMANGLER_DB. < $shlib.SYMVEC-tmp > $shlib.SYMVEC
655 DELETE $shlib.SYMVEC-tmp;*
656 OPEN/WRITE/SHARE=READ OPT_FILE $shlib.OPT
657 WRITE OPT_FILE "IDENTIFICATION=""V$config{version}"""
658 TYPE $shlib.SYMVEC /OUTPUT=OPT_FILE:
659 WRITE OPT_FILE "$lib.OLB/LIBRARY"
662 LINK /MAP=$shlib.MAP /FULL/SHARE=$shlib.EXE $shlib.OPT/OPT \$(EX_LIBS)
663 DELETE $shlib.SYMVEC;*
664 PURGE $shlib.EXE,$shlib.OPT,$shlib.MAP
669 my $lib = $args{lib};
670 my $libd = dirname($lib);
671 my $libn = basename($lib);
672 (my $libn_nolib = $libn) =~ s/^lib//;
673 my @objs = map { "$_.OBJ" } @{$args{objs}};
675 $disabled{shared} ? $_.".OLB"
676 : $unified_info{sharednames}->{$_}.".EXE"; } @{$args{deps}};
677 my $deps = join(", -\n\t\t", @objs, @deps);
678 my $shlib_target = $disabled{shared} ? "" : $target{shared_target};
679 my $engine_opt = abs2rel(rel2abs(catfile($config{sourcedir},
680 "VMS", "engine.opt")),
681 rel2abs($config{builddir}));
682 # The "[]" hack is because in .OPT files, each line inherits the
683 # previous line's file spec as default, so if no directory spec
684 # is present in the current line and the previous line has one that
685 # doesn't apply, you're in for a surprise.
687 join(",-\"\n\t", map { my $x = $_ =~ /\[/ ? $_ : "[]".$_;
688 "WRITE OPT_FILE \"$x" } @objs).
691 join("\n\t", map { my $x = $_ =~ /\[/ ? $_ : "[]".$_;
692 $x =~ s|(\.EXE)|$1/SHARE|;
693 $x =~ s|(\.OLB)|$1/LIB|;
694 "WRITE OPT_FILE \"$x\"" } @deps)
698 OPEN/WRITE/SHARE=READ OPT_FILE $lib.OPT
699 TYPE $engine_opt /OUTPUT=OPT_FILE:
703 LINK /MAP=$lib.MAP /FULL/SHARE=$lib.EXE $lib.OPT/OPT \$(EX_LIBS)
704 - PURGE $lib.EXE,$lib.OPT,$lib.MAP
709 my $lib = $args{lib};
710 my $objs = join(", -\n\t\t", map { $_.".OBJ" } (@{$args{objs}}));
711 my $fill_lib = join("\n\t", (map { "LIBRARY/REPLACE $lib.OLB $_.OBJ" }
715 LIBRARY/CREATE/OBJECT $lib.OLB
722 my $bin = $args{bin};
723 my $bind = dirname($bin);
724 my $binn = basename($bin);
725 my @objs = map { "$_.OBJ" } @{$args{objs}};
727 $disabled{shared} ? $_.".OLB"
728 : $unified_info{sharednames}->{$_}.".EXE"; } @{$args{deps}};
729 my $deps = join(", -\n\t\t", @objs, @deps);
730 # The "[]" hack is because in .OPT files, each line inherits the
731 # previous line's file spec as default, so if no directory spec
732 # is present in the current line and the previous line has one that
733 # doesn't apply, you're in for a surprise.
735 join(",-\"\n\t", map { my $x = $_ =~ /\[/ ? $_ : "[]".$_;
736 "WRITE OPT_FILE \"$x" } @objs).
739 join("\n\t", map { my $x = $_ =~ /\[/ ? $_ : "[]".$_;
740 $x =~ s|(\.EXE)|$1/SHARE|;
741 $x =~ s|(\.OLB)|$1/LIB|;
742 "WRITE OPT_FILE \"$x\"" } @deps)
746 OPEN/WRITE/SHARE=READ OPT_FILE $bin.OPT
750 LINK/EXEC=$bin.EXE \$(LDFLAGS) $bin.OPT/OPT \$(EX_LIBS)
751 - PURGE $bin.EXE,$bin.OPT
756 my $script = $args{script};
757 return "" if grep { $_ eq $script } @{$args{sources}}; # No overwrite!
758 my $sources = join(" ", @{$args{sources}});
759 my $dofile = abs2rel(rel2abs(catfile($config{sourcedir},
760 "util", "dofile.pl")),
761 rel2abs($config{builddir}));
764 \$(PERL) "-I\$(BLDDIR)" "-Mconfigdata" $dofile -
765 "-o$target{build_file}" $sources > $script
766 SET FILE/PROT=(S:RWED,O:RWED,G:RE,W:RE) $script
770 "" # Important! This becomes part of the template result.