3
$ ! Command procedure to (re)link the VMS versions of
4
$ ! UnZip/ZipInfo and UnZipSFX
6
$ ! last updated: 13 February 2001
9
$ ! - select compiler environment: "VAXC", "DECC", "GNUC"
10
$ ! - select installation of CLI interface version of unzip:
12
$ ! - force installation of UNIX interface version of unzip
13
$ ! (override LOCAL_UNZIP environment): "NOVMSCLI" or "NOCLI"
16
$ on error then goto error
17
$ on control_y then goto error
18
$ OLD_VERIFY = f$verify(0)
20
$ say := write sys$output
21
$!##################### Read settings from environment ########################
23
$ if f$type(LOCAL_UNZIP).eqs.""
26
$ else ! Trim blanks and append comma if missing
27
$ local_unzip = f$edit(local_unzip, "TRIM")
28
$ if f$extract(f$length(local_unzip)-1, 1, local_unzip).nes."," then -
29
local_unzip = local_unzip + ","
31
$! Check for the presence of "VMSCLI" in local_unzip. If yes, we will define
32
$! the foreign command for "unzip" to use the executable containing the
34
$ pos_cli = f$locate("VMSCLI",local_unzip)
35
$ len_local_unzip = f$length(local_unzip)
36
$ if pos_cli.ne.len_local_unzip
39
$ ! Remove "VMSCLI" macro from local_unzip. The UnZip executable including
40
$ ! the CLI interface is now created unconditionally.
41
$ local_unzip = f$extract(0, pos_cli, local_unzip) + -
42
$ f$extract(pos_cli+7, len_local_unzip-(pos_cli+7), local_unzip)
46
$ delete/symbol/local pos_cli
47
$ delete/symbol/local len_local_unzip
48
$!##################### Customizing section #############################
51
$ unzx_cli = "unzip_cli"
52
$ unzsfx_unx = "unzipsfx"
53
$ unzsfx_cli = "unzipsfx_cli"
58
$! Process command line parameters requesting optional features:
61
$ current_arg_name = "P''arg_cnt'"
62
$ curr_arg = f$edit('current_arg_name',"UPCASE")
63
$ IF curr_arg .eqs. "" THEN GOTO argloop_out
64
$ IF curr_arg .eqs. "VAXC"
65
$ THEN MAY_USE_DECC = 0
68
$ IF curr_arg .eqs. "DECC"
69
$ THEN MAY_USE_DECC = 1
72
$ IF curr_arg .eqs. "GNUC"
73
$ THEN MAY_USE_DECC = 0
76
$ IF (curr_arg .eqs. "VMSCLI") .or. (curr_arg .eqs. "CLI")
80
$ IF (curr_arg .eqs. "NOVMSCLI") .or. (curr_arg .eqs. "NOCLI")
84
$ arg_cnt = arg_cnt + 1
95
$!#######################################################################
97
$ ! Find out current disk, directory, compiler and options
99
$ my_name = f$env("procedure")
100
$ workdir = f$env("default")
101
$ here = f$parse(workdir,,,"device") + f$parse(workdir,,,"directory")
102
$ axp = f$getsyi("HW_MODEL").ge.1024
106
$ ARCH_NAME == "Alpha"
110
$ IF (f$search("SYS$DISK:[]UNZIP.''ARCH_PREF'OLB").eqs."")
112
$ say "Cannot find any AXP object library for UnZip."
113
$ say " You must keep all binary files of the object distribution"
114
$ say " in the current directory !"
118
$ then say "GNU C has not yet been ported to OpenVMS AXP."
119
$ say "You must use DEC C to build UnZip."
122
$ ARCH_CC_P = ARCH_PREF
124
$ say "Linking on AXP using DEC C"
129
$ ! check which object libraries are present:
131
(f$search("SYS$DISK:[]UNZIP.''ARCH_PREF'DECC_OLB").nes."")
133
(f$search("SYS$DISK:[]UNZIP.''ARCH_PREF'VAXC_OLB").nes."")
135
(f$search("SYS$DISK:[]UNZIP.''ARCH_PREF'GNUC_OLB").nes."")
136
$ IF .not.HAVE_DECC_VAX .and. .not.HAVE_VAXC_VAX .and. .not.HAVE_GNUC_VAX
138
$ say "Cannot find any VAX object library for UnZip."
139
$ say " You must keep all binary files of the object distribution"
140
$ say " in the current directory !"
143
$ IF HAVE_DECC_VAX .AND. MAY_USE_DECC
147
$ ARCH_CC_P = "''ARCH_PREF'DECC_"
149
$ say "Linking on VAX using DEC C"
151
$ ! We use VAXC (or GNU C):
153
$ opts = ",SYS$DISK:[.VMS]VAXCSHR.OPT/OPTIONS"
154
$ if HAVE_GNUC_VAX .and. (.not.HAVE_VAXC_VAX .or. MAY_USE_GNUC)
156
$ ARCH_CC_P = "''ARCH_PREF'GNUC_"
157
$ opts = ",GNU_CC:[000000]GCCLIB.OLB/LIB ''opts'"
158
$ say "Linking on VAX using GNU C"
160
$ ARCH_CC_P = "''ARCH_PREF'VAXC_"
161
$ say "Linking on VAX using VAX C"
165
$ LFLAGS = "/notrace"
166
$ if (opts .nes. "") .and. (f$search("[.vms]vaxcshr.opt") .eqs. "")
167
$ then create [.vms]vaxcshr.opt
168
$ open/append tmp [.vms]vaxcshr.opt
169
$ write tmp "SYS$SHARE:VAXCRTL.EXE/SHARE"
172
$ tmp = f$verify(1) ! Turn echo on to see what's happening
174
$ link'LFLAGS'/exe='unzx_unx'.'ARCH_CC_P'exe -
175
unzip.'ARCH_CC_P'olb;/incl=(unzip)/lib -
176
'opts', [.VMS]unzip.opt/opt
178
$ link'LFLAGS'/exe='unzx_cli'.'ARCH_CC_P'exe -
179
unzipcli.'ARCH_CC_P'olb;/incl=(unzip)/lib, -
180
unzip.'ARCH_CC_P'olb;/lib -
181
'opts', [.VMS]unzip.opt/opt
183
$ link'LFLAGS'/exe='unzsfx_unx'.'ARCH_CC_P'exe -
184
unzipsfx.'ARCH_CC_P'olb;/lib/incl=unzip -
185
'opts', [.VMS]unzipsfx.opt/opt
187
$ link'LFLAGS'/exe='unzsfx_cli'.'ARCH_CC_P'exe -
188
unzsxcli.'ARCH_CC_P'olb;/lib/incl=unzip, -
189
unzipsfx.'ARCH_CC_P'olb;/lib -
190
'opts', [.VMS]unzipsfx.opt/opt
192
$ ! Next line: put similar lines (full pathname for unzip.'ARCH_CC_P'exe) in
193
$ ! login.com. Remember to include the leading "$" before disk name.
195
$ unzip == "$''here'''UNZEXEC'.''ARCH_CC_P'exe"
196
$ zipinfo == "$''here'''UNZEXEC'.''ARCH_CC_P'exe ""-Z"""
199
$ tmp = f$verify(OLD_VERIFY)