unified build scheme: add a "unified" template for VMS descrip.mms
[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 $       VERSION := {- $config{version} -}
55 $       INSTALLTOP := {- $config{INSTALLTOP} -}
56 $       OPENSSLDIR := {- $config{OPENSSLDIR} -}
57 $       POINTER_SIZE = {- $config{pointersize} -}
58 $
59 $       ! Make sure that INSTALLTOP and OPENSSLDIR become something one
60 $       ! can build concealed logical names on
61 $       INSTALLTOP_ = F$PARSE("A.;",INSTALLTOP,,,"NO_CONCEAL") - "A.;" -
62                      - ".][000000" - "[000000." - "][" - "]" + ".]"
63 $       OPENSSLDIR_ = F$PARSE("A.;",OPENSSLDIR,,,"NO_CONCEAL") - "A.;" -
64                      - ".][000000" - "[000000." - "][" - "]" + ".]"
65 $       DEFINE /TRANSLATION=CONCEALED /NOLOG WRK_INSTALLTOP 'INSTALLTOP_'
66 $
67 $       ! Check that things are in place, and specifically, the stuff
68 $       ! belonging to this architecture
69 $       IF F$SEARCH("WRK_INSTALLTOP:[000000]INCLUDE.DIR;1") .EQS. "" -
70            .OR. F$SEARCH("WRK_INSTALLTOP:[000000]''arch'.DIR;1") .EQS. "" -
71            .OR. F$SEARCH("WRK_INSTALLTOP:[''arch']LIB.DIR;1") .EQS. "" -
72            .OR. F$SEARCH("WRK_INSTALLTOP:[''arch']EXE.DIR;1") .EQS. "" -
73            .OR. F$SEARCH("WRK_INSTALLTOP:[000000]openssl.cnf;1") .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 $       v    =  VERSION - "." - "."
84 $
85 $       DEFT OSSL$INSTROOT'v'   'INSTALLTOP_'
86 $       DEFT OSSL$INCLUDE'v'    OSSL$INSTROOT:[INCLUDE.]
87 $       DEF  OSSL$LIB'v'        OSSL$INSTROOT:['arch'.LIB]
88 $       DEF  OSSL$SHARE'v'      OSSL$INSTROOT:['arch'.LIB]
89 $       DEF  OSSL$ENGINES'v'    OSSL$INSTROOT:['arch'.ENGINES]
90 $       DEF  OSSL$EXE'v'        OSSL$INSTROOT:['arch'.EXE]
91 $       {- output_off() if $config{no_shared} -}
92 $       {- join("\n\$       ", map { "DEF  $_'v' OSSL\$SHARE:$_" } map { $unified_info{sharednames}->{$_} || () } @{$unified_info{libraries}}) -}
93 $       {- output_on() -}
94 $       IF P2 .NES. "NOALIASES"
95 $       THEN
96 $           DEF OSSL$INSTROOT   OSSL$INSTROOT'v'
97 $           DEF OSSL$INCLUDE    OSSL$INCLUDE'v'
98 $           DEF OSSL$LIB        OSSL$LIB'v'
99 $           DEF OSSL$SHARE      OSSL$SHARE'v'
100 $           DEF OSSL$ENGINES    OSSL$ENGINES'v'
101 $           DEF OSSL$EXE        OSSL$EXE'v'
102 $           DEF OPENSSL         OSSL$INCLUDE:[OPENSSL]
103 $       {- output_off() if $config{no_shared} -}
104 $       {- join("\n\$           ", map { "DEF  $_ $_'v'" } map { $unified_info{sharednames}->{$_} || () } @{$unified_info{libraries}}) -}
105 $       {- output_on() -}
106 $       ENDIF
107 $
108 $       DEFT OSSL$DATAROOT      'OPENSSLDIR_'
109 $       DEF  OSSL$CERTS         OSSL$DATAROOT:[CERTS]
110 $       DEF  OSSL$PRIVATE       OSSL$DATAROOT:[PRIVATE]
111 $
112 $ bailout:
113 $       DEASSIGN WRK_INSTALLTOP
114 $
115 $       EXIT 'status'