xref: /freebsd/crypto/openssl/VMS/openssl_startup.com.in (revision e1e636193db45630c7881246d25902e57c43d24e)
1$	! OpenSSL startup script
2$	!
3$	! This script defines the logical names used by the installation
4$	! of OpenSSL.  It can provide those logical names at any level,
5$	! defined by P1.
6$	!
7$	! The logical names created are:
8$	!
9$	!	OSSL$INSTROOT		Installation root
10$	!	OSSL$DATAROOT		Data root (common directory
11$	!				for certs etc)
12$	!	OSSL$INCLUDE		Include directory root
13$	!	OSSL$LIB		Where the static library files
14$	!				are located
15$	!	OSSL$SHARE		Where the shareable image files
16$	!				are located
17$	!	OSSL$EXE		Where the executables are located
18$	!	OSSL$ENGINESnnn		Where the engines modules are located
19$	!	OSSL$MODULES		Where the non-engine modules are located
20$	!	OSSL$LIBCRYPTO		The static crypto library
21$	!	OSSL$LIBSSL		The static ssl library
22$	!	OSSL$LIBCRYPTOnnn_SHR	The shareable crypto image
23$	!	OSSL$LIBSSLnnn_SHR	The shareable ssl image
24$	!	OPENSSL			is OSSL$INCLUDE:[OPENSSL]
25$	!
26$	! In all these, nnn is the OpenSSL version number.  This allows
27$	! several OpenSSL versions to be installed simultaneously, which
28$	! matters for applications that are linked to the shareable images
29$	! or that depend on engines.
30$	!
31$	! In addition, unless P2 is "NOALIASES", these logical names are
32$	! created:
33$	!
34$	!	OSSL$ENGINES		Alias for OSSL$ENGINESnnn
35$	!	OSSL$LIBCRYPTO_SHR	Alias for OSSL$LIBCRYPTOnnn_SHR
36$	!	OSSL$LIBSSL_SHR		Alias for OSSL$LIBSSLnnn_SHR
37$	!
38$	! P1	Qualifier(s) for DEFINE.  "/SYSTEM" would be typical when
39$	!	calling this script from SYS$STARTUP:SYSTARTUP_VMS.COM,
40$	!	while "/PROCESS" would be typical for a personal install.
41$	!	Default: /PROCESS
42$	!
43$	! P2	If the value is "NOALIASES", no alias logical names are
44$	!	created.
45$
46$	status = %x10000001	! Generic success
47$
48$	! In case there's a problem
49$	ON CONTROL_Y THEN GOTO bailout
50$	ON ERROR THEN GOTO bailout
51$
52$	! Find the architecture
53$	IF F$GETSYI("CPU") .LT. 128
54$	THEN
55$	    arch := VAX
56$	ELSE
57$	    arch = F$EDIT(F$GETSYI("ARCH_NAME"),"UPCASE")
58$	    IF arch .EQS. "" THEN GOTO unknown_arch
59$	ENDIF
60$
61$	! Generated information
62$	INSTALLTOP := {- $config{INSTALLTOP} -}
63$	OPENSSLDIR := {- $config{OPENSSLDIR} -}
64$
65$	! Make sure that INSTALLTOP and OPENSSLDIR become something one
66$	! can build concealed logical names on
67$	INSTALLTOP_ = F$PARSE("A.;",INSTALLTOP,,,"NO_CONCEAL") -
68		     - ".][000000" - "[000000." - "][" - "]A.;" + "."
69$	OPENSSLDIR_ = F$PARSE("A.;",OPENSSLDIR,,,"NO_CONCEAL") -
70		     - ".][000000" - "[000000." - "][" - "]A.;" + "."
71$
72$	DEFINE /TRANSLATION=CONCEALED /NOLOG WRK_INSTALLTOP 'INSTALLTOP_']
73$	DEFINE /TRANSLATION=CONCEALED /NOLOG WRK_OPENSSLDIR 'OPENSSLDIR_']
74$
75$	! Check that things are in place, and specifically, the stuff
76$	! belonging to this architecture
77$	IF F$SEARCH("WRK_INSTALLTOP:[000000]INCLUDE.DIR;1") .EQS. "" -
78	   .OR. F$SEARCH("WRK_INSTALLTOP:[000000]LIB.DIR;1") .EQS. "" -
79	   .OR. F$SEARCH("WRK_INSTALLTOP:[000000]EXE.DIR;1") .EQS. "" -
80	   .OR. F$SEARCH("WRK_INSTALLTOP:[LIB]''arch'.DIR;1") .EQS. "" -
81	   .OR. F$SEARCH("WRK_INSTALLTOP:[EXE]''arch'.DIR;1") .EQS. "" -
82	   .OR. F$SEARCH("WRK_OPENSSLDIR:[000000]openssl.cnf") .EQS. ""
83$	THEN
84$	    WRITE SYS$ERROR "''INSTALLTOP' doesn't look like an OpenSSL installation for ''arch'"
85$	    status = %x00018292 ! RMS$_FNF, file not found
86$	    GOTO bailout
87$	ENDIF
88$
89$	! Abbrevs
90$	DEFT := DEFINE /TRANSLATION=CONCEALED /NOLOG 'P1'
91$	DEF  := DEFINE /NOLOG 'P1'
92$	sv   := {- platform->shlib_version_as_filename(); -}
93$	pz   := {- $target{pointer_size} -}
94$
95$	DEFT OSSL$DATAROOT		'OPENSSLDIR_']
96$	DEFT OSSL$INSTROOT		'INSTALLTOP_']
97$	DEFT OSSL$INCLUDE		'INSTALLTOP_'INCLUDE.]
98$	DEF  OSSL$LIB			OSSL$INSTROOT:[LIB.'arch']
99$	DEF  OSSL$SHARE			OSSL$INSTROOT:[LIB.'arch']
100$	DEF  OSSL$ENGINES'sv''pz'	OSSL$INSTROOT:[ENGINES'sv''pz'.'arch']
101$	DEF  OSSL$MODULES'pz'           OSSL$INSTROOT:[MODULES'pz'.'arch']
102$	DEF  OSSL$EXE			OSSL$INSTROOT:[EXE.'arch'],-
103					OSSL$INSTROOT:[EXE]
104$	DEF  OSSL$LIBCRYPTO'pz'		OSSL$LIB:OSSL$LIBCRYPTO'pz'.OLB
105$	DEF  OSSL$LIBSSL'pz'		OSSL$LIB:OSSL$LIBSSL'pz'.OLB
106${- output_off() if $disabled{shared}; "" -}
107$	DEF  OSSL$LIBCRYPTO'sv'_SHR'pz'	OSSL$SHARE:OSSL$LIBCRYPTO'sv'_SHR'pz'.EXE
108$	DEF  OSSL$LIBSSL'sv'_SHR'pz'	OSSL$SHARE:OSSL$LIBSSL'sv'_SHR'pz'.EXE
109${- output_on() if $disabled{shared}; "" -}
110$	DEF  OPENSSL			OSSL$INCLUDE:[OPENSSL]
111$
112$	IF P2 .NES. "NOALIASES"
113$	THEN
114$	    DEF OSSL$ENGINES'pz'	OSSL$ENGINES'sv''pz'
115${- output_off() if $disabled{shared}; "" -}
116$	    DEF OSSL$LIBCRYPTO_SHR'pz'	OSSL$LIBCRYPTO'sv'_SHR'pz'
117$	    DEF OSSL$LIBSSL_SHR'pz'	OSSL$LIBSSL'sv'_SHR'pz'
118${- output_on() if $disabled{shared}; "" -}
119$	ENDIF
120$
121$ bailout:
122$	DEASSIGN WRK_INSTALLTOP
123$	DEASSIGN WRK_OPENSSLDIR
124$
125$	EXIT 'status'
126