ca2220efe75c42b5faf422d06fd790b9adc315fc
[openssl.git] / VMS / openssl_startup.com.in
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$ROOTnnn    Installation root
10 $       !       OSSL$EXEnnn     Where the executables are located
11 $       !       OSSL$LIBnnn     Where the library files are located
12 $       !       OSSL$SHAREnnn   Where the sahreable images are located
13 $       !       OSSL$INCLUDEnnn Include directory root
14 $       !       OSSL$ENGINESnnn Where the sahreable images are located
15 $       !
16 $       ! In all these, nnn is the OpenSSL version number.  This allows
17 $       ! several OpenSSL versions to be installed simultaneously.
18 $       !
19 $       ! In addition, unless P2 is "NOALIASES", these logical names are
20 $       ! created:
21 $       !
22 $       !       OSSL$ROOT       Alias for OSSL$ROOTnnn
23 $       !       OSSL$EXE        Alias for OSSL$EXEnnn
24 $       !       OSSL$LIB        Alias for OSSL$LIBnnn
25 $       !       OSSL$SHARE      Alias for OSSL$SHAREnnn
26 $       !       OSSL$INCLUDE    Alias for OSSL$INCLUDEnnn
27 $       !       OPENSSL         is OSSL$INCLUDE:[OPENSSL]
28 $       !       OSSL$ENGINES    Alias for OSSL$ENGINESnnn
29 $       !
30 $       ! P1    Qualifier(s) for DEFINE.  "/SYSTEM" would be typical when
31 $       !       calling this script from SYS$STARTUP:SYSTARTUP_VMS.COM,
32 $       !       while "/PROCESS" would be typical for a personal install.
33 $       !       Default: /PROCESS
34 $       !
35 $       ! P2    If the value is "NOALIASES", no alias logical names are
36 $       !       created.
37 $
38 $       status = %x10000001     ! Generic success
39 $
40 $       ! In case there's a problem
41 $       ON CONTROL_Y THEN GOTO bailout
42 $       ON ERROR THEN GOTO bailout
43 $
44 $       ! Find the architecture
45 $       IF F$GETSYI("CPU") .LT. 128
46 $       THEN
47 $           arch := VAX
48 $       ELSE
49 $           arch = F$EDIT(F$GETSYI("ARCH_NAME"),"UPCASE")
50 $           IF arch .EQS. "" THEN GOTO unknown_arch
51 $       ENDIF
52 $
53 $       ! Generated information
54 $       INSTALLTOP := {- $config{INSTALLTOP} -}
55 $       OPENSSLDIR := {- $config{OPENSSLDIR} -}
56 $
57 $       ! Make sure that INSTALLTOP and OPENSSLDIR become something one
58 $       ! can build concealed logical names on
59 $       INSTALLTOP_ = F$PARSE("A.;",INSTALLTOP,,,"NO_CONCEAL") -
60                      - ".][000000" - "[000000." - "][" - "]A.;" + "."
61 $       OPENSSLDIR_ = F$PARSE("A.;",OPENSSLDIR,,,"NO_CONCEAL") -
62                      - ".][000000" - "[000000." - "][" - "]A.;" + "."
63 $       DEFINE /TRANSLATION=CONCEALED /NOLOG WRK_INSTALLTOP 'INSTALLTOP_']
64 $       DEFINE /TRANSLATION=CONCEALED /NOLOG WRK_OPENSSLDIR 'OPENSSLDIR_']
65 $
66 $       ! Check that things are in place, and specifically, the stuff
67 $       ! belonging to this architecture
68 $       IF F$SEARCH("WRK_INSTALLTOP:[000000]INCLUDE.DIR;1") .EQS. "" -
69            .OR. F$SEARCH("WRK_INSTALLTOP:[000000]LIB.DIR;1") .EQS. "" -
70            .OR. F$SEARCH("WRK_INSTALLTOP:[000000]EXE.DIR;1") .EQS. "" -
71            .OR. F$SEARCH("WRK_INSTALLTOP:[LIB]''arch'.DIR;1") .EQS. "" -
72            .OR. F$SEARCH("WRK_INSTALLTOP:[EXE]''arch'.DIR;1") .EQS. "" -
73            .OR. F$SEARCH("WRK_OPENSSLDIR:[000000]openssl.cnf") .EQS. ""
74 $       THEN
75 $           WRITE SYS$ERROR "''INSTALLTOP' doesn't look like an OpenSSL installation for ''arch'"
76 $           status = %x00018292 ! RMS$_FNF, file not found
77 $           GOTO bailout
78 $       ENDIF
79 $
80 $       ! Abbrevs
81 $       DEFT := DEFINE /TRANSLATION=CONCEALED /NOLOG 'P1'
82 $       DEF  := DEFINE /NOLOG 'P1'
83 $       sv   := {- sprintf "%02d%02d", $config{shlib_major}, $config{shlib_minor} -}
84 $       pz   := {- $config{pointer_size} -}
85 $
86 $       DEFT OSSL$INSTROOT              'INSTALLTOP_']
87 $       DEFT OSSL$INCLUDE               'INSTALLTOP_'INCLUDE.]
88 $       DEF  OSSL$LIB                   OSSL$INSTROOT:[LIB.'arch']
89 $       DEF  OSSL$SHARE                 OSSL$INSTROOT:[LIB.'arch']
90 $       DEF  OSSL$ENGINES'sv'           OSSL$INSTROOT:[ENGINES'sv'.'arch']
91 $       DEF  OSSL$EXE                   OSSL$INSTROOT:[EXE.'arch']
92 $       DEF  OSSL$LIBCRYPTO'pz'         OSSL$LIB:OSSL$LIBCRYPTO'pz'.OLB
93 $       DEF  OSSL$LIBSSL'pz'            OSSL$LIB:OSSL$LIBSSL'pz'.OLB
94 $       DEF  OSSL$LIBCRYPTO'sv'_SHR'pz' OSSL$SHARE:OSSL$LIBCRYPTO'sv'_SHR'pz'.EXE
95 $       DEF  OSSL$LIBSSL'sv'_SHR'pz'    OSSL$SHARE:OSSL$LIBSSL'sv'_SHR'pz'.EXE
96 $       DEF  OPENSSL                    OSSL$INCLUDE:[OPENSSL]
97 $
98 $       IF P2 .NES. "NOALIASES"
99 $       THEN
100 $           DEF OSSL$ENGINES            OSSL$ENGINES'sv'
101 $           DEF OSSL$LIBCRYPTO_SHR'pz'  OSSL$LIBCRYPTO'sv'_SHR'pz'
102 $           DEF OSSL$LIBSSL_SHR'pz'     OSSL$LIBSSL'sv'_SHR'pz'
103 $       ENDIF
104 $
105 $       DEFT OSSL$DATAROOT      'OPENSSLDIR_']
106 $       DEF  OSSL$CERTS         OSSL$DATAROOT:[CERTS]
107 $       DEF  OSSL$PRIVATE       OSSL$DATAROOT:[PRIVATE]
108 $
109 $ bailout:
110 $       DEASSIGN WRK_INSTALLTOP
111 $
112 $       EXIT 'status'