xref: /minix3/crypto/external/bsd/openssl/dist/VMS/openssl_startup.com (revision ebfedea0ce5bbe81e252ddf32d732e40fb633fae)
1*ebfedea0SLionel Sambuc$!
2*ebfedea0SLionel Sambuc$! Startup file for OpenSSL 1.x.
3*ebfedea0SLionel Sambuc$!
4*ebfedea0SLionel Sambuc$! 2011-03-05 SMS.
5*ebfedea0SLionel Sambuc$!
6*ebfedea0SLionel Sambuc$! This procedure must reside in the OpenSSL installation directory.
7*ebfedea0SLionel Sambuc$! It will fail if it is copied to a different location.
8*ebfedea0SLionel Sambuc$!
9*ebfedea0SLionel Sambuc$! P1  qualifier(s) for DEFINE.  For example, "/SYSTEM" to get the
10*ebfedea0SLionel Sambuc$!     logical names defined in the system logical name table.
11*ebfedea0SLionel Sambuc$!
12*ebfedea0SLionel Sambuc$! P2  "64", to use executables which were built with 64-bit pointers.
13*ebfedea0SLionel Sambuc$!
14*ebfedea0SLionel Sambuc$! Good (default) and bad status values.
15*ebfedea0SLionel Sambuc$!
16*ebfedea0SLionel Sambuc$ status =    %x00010001 ! RMS$_NORMAL, normal successful completion.
17*ebfedea0SLionel Sambuc$ rms_e_fnf = %x00018292 ! RMS$_FNF, file not found.
18*ebfedea0SLionel Sambuc$!
19*ebfedea0SLionel Sambuc$! Prepare for problems.
20*ebfedea0SLionel Sambuc$!
21*ebfedea0SLionel Sambuc$ orig_dev_dir = f$environment( "DEFAULT")
22*ebfedea0SLionel Sambuc$ on control_y then goto clean_up
23*ebfedea0SLionel Sambuc$ on error then goto clean_up
24*ebfedea0SLionel Sambuc$!
25*ebfedea0SLionel Sambuc$! Determine hardware architecture.
26*ebfedea0SLionel Sambuc$!
27*ebfedea0SLionel Sambuc$ if (f$getsyi( "cpu") .lt. 128)
28*ebfedea0SLionel Sambuc$ then
29*ebfedea0SLionel Sambuc$   arch_name = "VAX"
30*ebfedea0SLionel Sambuc$ else
31*ebfedea0SLionel Sambuc$   arch_name = f$edit( f$getsyi( "arch_name"), "upcase")
32*ebfedea0SLionel Sambuc$   if (arch_name .eqs. "") then arch_name = "UNK"
33*ebfedea0SLionel Sambuc$ endif
34*ebfedea0SLionel Sambuc$!
35*ebfedea0SLionel Sambuc$ if (p2 .eqs. "64")
36*ebfedea0SLionel Sambuc$ then
37*ebfedea0SLionel Sambuc$   arch_name_exe = arch_name+ "_64"
38*ebfedea0SLionel Sambuc$ else
39*ebfedea0SLionel Sambuc$   arch_name_exe = arch_name
40*ebfedea0SLionel Sambuc$ endif
41*ebfedea0SLionel Sambuc$!
42*ebfedea0SLionel Sambuc$! Derive the OpenSSL installation device:[directory] from the location
43*ebfedea0SLionel Sambuc$! of this command procedure.
44*ebfedea0SLionel Sambuc$!
45*ebfedea0SLionel Sambuc$ proc = f$environment( "procedure")
46*ebfedea0SLionel Sambuc$ proc_dev_dir = f$parse( "A.;", proc, , , "no_conceal") - "A.;"
47*ebfedea0SLionel Sambuc$ proc_dev = f$parse( proc_dev_dir, , , "device", "syntax_only")
48*ebfedea0SLionel Sambuc$ proc_dir = f$parse( proc_dev_dir, , , "directory", "syntax_only") - -
49*ebfedea0SLionel Sambuc   ".][000000"- "[000000."- "]["- "["- "]"
50*ebfedea0SLionel Sambuc$ proc_dev_dir = proc_dev+ "["+ proc_dir+ "]"
51*ebfedea0SLionel Sambuc$ set default 'proc_dev_dir'
52*ebfedea0SLionel Sambuc$ set default [-]
53*ebfedea0SLionel Sambuc$ ossl_dev_dir = f$environment( "default")
54*ebfedea0SLionel Sambuc$!
55*ebfedea0SLionel Sambuc$! Check existence of expected directories (to see if this procedure has
56*ebfedea0SLionel Sambuc$! been moved away from its proper place).
57*ebfedea0SLionel Sambuc$!
58*ebfedea0SLionel Sambuc$ if ((f$search( "certs.dir;1") .eqs. "") .or. -
59*ebfedea0SLionel Sambuc   (f$search( "include.dir;1") .eqs. "") .or. -
60*ebfedea0SLionel Sambuc   (f$search( "private.dir;1") .eqs. "") .or. -
61*ebfedea0SLionel Sambuc   (f$search( "vms.dir;1") .eqs. ""))
62*ebfedea0SLionel Sambuc$ then
63*ebfedea0SLionel Sambuc$    write sys$output -
64*ebfedea0SLionel Sambuc      "   Can't find expected common OpenSSL directories in:"
65*ebfedea0SLionel Sambuc$    write sys$output "   ''ossl_dev_dir'"
66*ebfedea0SLionel Sambuc$    status = rms_e_fnf
67*ebfedea0SLionel Sambuc$    goto clean_up
68*ebfedea0SLionel Sambuc$ endif
69*ebfedea0SLionel Sambuc$!
70*ebfedea0SLionel Sambuc$ if ((f$search( "''arch_name_exe'_exe.dir;1") .eqs. "") .or. -
71*ebfedea0SLionel Sambuc   (f$search( "''arch_name'_lib.dir;1") .eqs. ""))
72*ebfedea0SLionel Sambuc$ then
73*ebfedea0SLionel Sambuc$    write sys$output -
74*ebfedea0SLionel Sambuc      "   Can't find expected architecture-specific OpenSSL directories in:"
75*ebfedea0SLionel Sambuc$    write sys$output "   ''ossl_dev_dir'"
76*ebfedea0SLionel Sambuc$    status = rms_e_fnf
77*ebfedea0SLionel Sambuc$    goto clean_up
78*ebfedea0SLionel Sambuc$ endif
79*ebfedea0SLionel Sambuc$!
80*ebfedea0SLionel Sambuc$! All seems well (enough).  Define the OpenSSL logical names.
81*ebfedea0SLionel Sambuc$!
82*ebfedea0SLionel Sambuc$ ossl_root = ossl_dev_dir- "]"+ ".]"
83*ebfedea0SLionel Sambuc$ define /translation_attributes = concealed /nolog'p1 SSLROOT 'ossl_root'
84*ebfedea0SLionel Sambuc$ define /nolog 'p1' SSLCERTS     sslroot:[certs]
85*ebfedea0SLionel Sambuc$ define /nolog 'p1' SSLINCLUDE   sslroot:[include]
86*ebfedea0SLionel Sambuc$ define /nolog 'p1' SSLPRIVATE   sslroot:[private]
87*ebfedea0SLionel Sambuc$ define /nolog 'p1' SSLEXE       sslroot:['arch_name_exe'_exe]
88*ebfedea0SLionel Sambuc$ define /nolog 'p1' SSLLIB       sslroot:['arch_name'_lib]
89*ebfedea0SLionel Sambuc$!
90*ebfedea0SLionel Sambuc$! Defining OPENSSL lets a C program use "#include <openssl/{foo}.h>":
91*ebfedea0SLionel Sambuc$ define /nolog 'p1' OPENSSL      SSLINCLUDE:
92*ebfedea0SLionel Sambuc$!
93*ebfedea0SLionel Sambuc$! Run a site-specific procedure, if it exists.
94*ebfedea0SLionel Sambuc$!
95*ebfedea0SLionel Sambuc$ if f$search( "sslroot:[vms]openssl_systartup.com") .nes."" then -
96*ebfedea0SLionel Sambuc   @ sslroot:[vms]openssl_systartup.com
97*ebfedea0SLionel Sambuc$!
98*ebfedea0SLionel Sambuc$! Restore the original default dev:[dir] (if known).
99*ebfedea0SLionel Sambuc$!
100*ebfedea0SLionel Sambuc$ clean_up:
101*ebfedea0SLionel Sambuc$!
102*ebfedea0SLionel Sambuc$ if (f$type( orig_dev_dir) .nes. "")
103*ebfedea0SLionel Sambuc$ then
104*ebfedea0SLionel Sambuc$    set default 'orig_dev_dir'
105*ebfedea0SLionel Sambuc$ endif
106*ebfedea0SLionel Sambuc$!
107*ebfedea0SLionel Sambuc$ EXIT 'status'
108*ebfedea0SLionel Sambuc$!
109