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