3
$ ! "Makefile" for VMS versions of UnZip/ZipInfo and UnZipSFX
5
$ ! last revised: 13 February 2001
8
$ ! - select compiler environment: "VAXC", "DECC", "GNUC"
9
$ ! - select installation of CLI interface version of unzip:
11
$ ! - force installation of UNIX interface version of unzip
12
$ ! (override LOCAL_UNZIP environment): "NOVMSCLI" or "NOCLI"
14
$ ! To define additional options, define the global symbol
15
$ ! LOCAL_UNZIP prior to executing MAKE_UNZ.COM, e.g.:
17
$ ! $ LOCAL_UNZIP == "RETURN_CODES,"
20
$ ! The trailing "," may be omitted. Valid VMS-specific options
21
$ ! include VMSWILD and RETURN_CODES; see the INSTALL file
22
$ ! for other options (e.g., CHECK_VERSIONS).
23
$ ! NOTE: This command procedure does always generate both the
24
$ ! "default" UnZip containing the UNIX style command interface
25
$ ! and the "VMSCLI" UnZip containing the CLI compatible command
26
$ ! interface. There is no need to add "VMSCLI" to the LOCAL_UNZIP
27
$ ! symbol. (The only effect of "VMSCLI" is now the selection of the
28
$ ! CLI style UnZip executable in the foreign command definition.)
31
$ on error then goto error
32
$ on control_y then goto error
33
$ OLD_VERIFY = f$verify(0)
35
$ edit := edit ! override customized edit commands
36
$ say := write sys$output
37
$!##################### Read settings from environment ########################
39
$ if f$type(LOCAL_UNZIP).eqs.""
42
$ else ! Trim blanks and append comma if missing
43
$ local_unzip = f$edit(local_unzip, "TRIM")
44
$ if f$extract(f$length(local_unzip)-1, 1, local_unzip).nes."," then -
45
local_unzip = local_unzip + ","
47
$! Check for the presence of "VMSCLI" in local_unzip. If yes, we will define
48
$! the foreign command for "unzip" to use the executable containing the
50
$ pos_cli = f$locate("VMSCLI",local_unzip)
51
$ len_local_unzip = f$length(local_unzip)
52
$ if pos_cli.ne.len_local_unzip
55
$ ! Remove "VMSCLI" macro from local_unzip. The UnZip executable including
56
$ ! the CLI interface is now created unconditionally.
57
$ local_unzip = f$extract(0, pos_cli, local_unzip) + -
58
$ f$extract(pos_cli+7, len_local_unzip-(pos_cli+7), local_unzip)
62
$ delete/symbol/local pos_cli
63
$ delete/symbol/local len_local_unzip
64
$!##################### Customizing section #############################
67
$ unzx_cli = "unzip_cli"
68
$ unzsfx_unx = "unzipsfx"
69
$ unzsfx_cli = "unzipsfx_cli"
74
$! Process command line parameters requesting optional features:
77
$ current_arg_name = "P''arg_cnt'"
78
$ curr_arg = f$edit('current_arg_name',"UPCASE")
79
$ IF curr_arg .eqs. "" THEN GOTO argloop_out
80
$ IF curr_arg .eqs. "VAXC"
81
$ THEN MAY_USE_DECC = 0
84
$ IF curr_arg .eqs. "DECC"
85
$ THEN MAY_USE_DECC = 1
88
$ IF curr_arg .eqs. "GNUC"
89
$ THEN MAY_USE_DECC = 0
92
$ IF (curr_arg .eqs. "VMSCLI") .or. (curr_arg .eqs. "CLI")
96
$ IF (curr_arg .eqs. "NOVMSCLI") .or. (curr_arg .eqs. "NOCLI")
100
$ arg_cnt = arg_cnt + 1
111
$!#######################################################################
113
$ ! Find out current disk, directory, compiler and options
115
$ my_name = f$env("procedure")
116
$ workdir = f$env("default")
117
$ here = f$parse(workdir,,,"device") + f$parse(workdir,,,"directory")
118
$ axp = f$getsyi("HW_MODEL").ge.1024
122
$ ARCH_NAME == "Alpha"
127
$ then say "GNU C has not yet been ported to OpenVMS AXP."
128
$ say "You must use DEC C to build UnZip."
131
$ ARCH_CC_P = ARCH_PREF
132
$ cc = "cc/standard=relax/prefix=all/ansi"
133
$ defs = "''local_unzip'MODERN"
135
$ say "Compiling on AXP using DEC C"
140
$ HAVE_DECC_VAX = (f$search("SYS$SYSTEM:DECC$COMPILER.EXE").nes."")
141
$ HAVE_VAXC_VAX = (f$search("SYS$SYSTEM:VAXC.EXE").nes."")
142
$ MAY_HAVE_GNUC = (f$trnlnm("GNU_CC").nes."")
143
$ IF HAVE_DECC_VAX .AND. MAY_USE_DECC
147
$ ARCH_CC_P = "''ARCH_PREF'DECC_"
148
$ cc = "cc/decc/standard=vaxc/prefix=all"
149
$ defs = "''local_unzip'MODERN"
151
$ say "Compiling on VAX using DEC C"
153
$ ! We use VAXC (or GNU C):
155
$ defs = "''local_unzip'VMS"
156
$ opts = ",SYS$DISK:[.VMS]VAXCSHR.OPT/OPTIONS"
157
$ if (.not.HAVE_VAXC_VAX .and. MAY_HAVE_GNUC) .or. (MAY_USE_GNUC)
159
$ ARCH_CC_P = "''ARCH_PREF'GNUC_"
161
$ opts = ",GNU_CC:[000000]GCCLIB.OLB/LIB ''opts'"
162
$ say "Compiling on VAX using GNU C"
164
$ ARCH_CC_P = "''ARCH_PREF'VAXC_"
171
$ say "Compiling on VAX using VAX C"
175
$ DEF_UNX = "/define=(''defs')"
176
$ DEF_CLI = "/define=(''defs',VMSCLI)"
177
$ DEF_SXUNX = "/define=(''defs',SFX)"
178
$ DEF_SXCLI = "/define=(''defs',VMSCLI,SFX)"
179
$ LFLAGS = "/notrace"
180
$ if (opts .nes. "") .and. (f$search("[.vms]vaxcshr.opt") .eqs. "")
181
$ then create [.vms]vaxcshr.opt
182
$ open/append tmp [.vms]vaxcshr.opt
183
$ write tmp "SYS$SHARE:VAXCRTL.EXE/SHARE"
187
$ ! Currently, the following section is not needed, as vms.c does no longer
188
$ ! include any of the headers from SYS$LIB_C.TLB.
189
$ ! The commented section is solely maintained for reference.
190
$ ! In case system headers from SYS$LIB_C.TLB are needed again,
191
$ ! just append "'x'" to the respective source file specification.
192
$! x = f$search("SYS$LIBRARY:SYS$LIB_C.TLB")
193
$! if x .nes. "" then x = "+" + x
195
$ tmp = f$verify(1) ! Turn echo on to see what's happening
197
$ !------------------------------- UnZip section ------------------------------
199
$ runoff/out=unzip.hlp [.vms]unzip_def.rnh
201
$ cc/NOLIST'DEF_UNX' /OBJ=unzip.'ARCH_CC_P'obj unzip.c
202
$ cc/NOLIST'DEF_UNX' /OBJ=crc32.'ARCH_CC_P'obj crc32.c
203
$ cc/NOLIST'DEF_UNX' /OBJ=crctab.'ARCH_CC_P'obj crctab.c
204
$ cc/NOLIST'DEF_UNX' /OBJ=crypt.'ARCH_CC_P'obj crypt.c
205
$ cc/NOLIST'DEF_UNX' /OBJ=envargs.'ARCH_CC_P'obj envargs.c
206
$ cc/NOLIST'DEF_UNX' /OBJ=explode.'ARCH_CC_P'obj explode.c
207
$ cc/NOLIST'DEF_UNX' /OBJ=extract.'ARCH_CC_P'obj extract.c
208
$ cc/NOLIST'DEF_UNX' /OBJ=fileio.'ARCH_CC_P'obj fileio.c
209
$ cc/NOLIST'DEF_UNX' /OBJ=globals.'ARCH_CC_P'obj globals.c
210
$ cc/NOLIST'DEF_UNX' /OBJ=inflate.'ARCH_CC_P'obj inflate.c
211
$ cc/NOLIST'DEF_UNX' /OBJ=list.'ARCH_CC_P'obj list.c
212
$ cc/NOLIST'DEF_UNX' /OBJ=match.'ARCH_CC_P'obj match.c
213
$ cc/NOLIST'DEF_UNX' /OBJ=process.'ARCH_CC_P'obj process.c
214
$ cc/NOLIST'DEF_UNX' /OBJ=ttyio.'ARCH_CC_P'obj ttyio.c
215
$ cc/NOLIST'DEF_UNX' /OBJ=unreduce.'ARCH_CC_P'obj unreduce.c
216
$ cc/NOLIST'DEF_UNX' /OBJ=unshrink.'ARCH_CC_P'obj unshrink.c
217
$ cc/NOLIST'DEF_UNX' /OBJ=zipinfo.'ARCH_CC_P'obj zipinfo.c
218
$ cc/INCLUDE=SYS$DISK:[]'DEF_UNX' /OBJ=vms.'ARCH_CC_P'obj; [.vms]vms.c
220
$ if f$search("unzip.''ARCH_CC_P'olb") .eqs. "" then -
221
lib/obj/create unzip.'ARCH_CC_P'olb
222
$ lib/obj/replace unzip.'ARCH_CC_P'olb -
223
unzip.'ARCH_CC_P'obj;, crc32.'ARCH_CC_P'obj;, -
224
crctab.'ARCH_CC_P'obj;, crypt.'ARCH_CC_P'obj;, -
225
envargs.'ARCH_CC_P'obj;, explode.'ARCH_CC_P'obj;, -
226
extract.'ARCH_CC_P'obj;, fileio.'ARCH_CC_P'obj;, -
227
globals.'ARCH_CC_P'obj;, inflate.'ARCH_CC_P'obj;, -
228
list.'ARCH_CC_P'obj;, match.'ARCH_CC_P'obj;, -
229
process.'ARCH_CC_P'obj;, ttyio.'ARCH_CC_P'obj;, -
230
unreduce.'ARCH_CC_P'obj;, unshrink.'ARCH_CC_P'obj;, -
231
zipinfo.'ARCH_CC_P'obj;, vms.'ARCH_CC_P'obj;
233
$ link'LFLAGS'/exe='unzx_unx'.'ARCH_CC_P'exe -
234
unzip.'ARCH_CC_P'olb;/incl=(unzip)/lib -
235
'opts', [.VMS]unzip.opt/opt
237
$ !----------------------- UnZip (CLI interface) section ----------------------
240
$ edit/tpu/nosection/nodisplay/command=cvthelp.tpu unzip_cli.help
242
$ runoff/out=unzip_cli.hlp [.vms]unzip_cli.rnh
244
$ cc/NOLIST'DEF_CLI' /OBJ=unzipcli.'ARCH_CC_P'obj unzip.c
245
$ cc/INCLUDE=SYS$DISK:[]'DEF_CLI' /OBJ=cmdline.'ARCH_CC_P'obj; -
247
$ set command/obj=unz_cli.'ARCH_CC_P'obj [.vms]unz_cli.cld
249
$ if f$search("unzipcli.''ARCH_CC_P'olb") .eqs. "" then -
250
lib/obj/create unzipcli.'ARCH_CC_P'olb
251
$ lib/obj/replace unzipcli.'ARCH_CC_P'olb -
252
unzipcli.'ARCH_CC_P'obj;, -
253
cmdline.'ARCH_CC_P'obj;, unz_cli.'ARCH_CC_P'obj;
255
$ link'LFLAGS'/exe='unzx_cli'.'ARCH_CC_P'exe -
256
unzipcli.'ARCH_CC_P'olb;/incl=(unzip)/lib, -
257
unzip.'ARCH_CC_P'olb;/lib -
258
'opts', [.VMS]unzip.opt/opt
260
$ !-------------------------- UnZipSFX section --------------------------------
262
$ cc/NOLIST'DEF_SXUNX' /OBJ=unzipsfx.'ARCH_CC_P'obj unzip.c
263
$ cc/NOLIST'DEF_SXUNX' /OBJ=crc32_.'ARCH_CC_P'obj crc32.c
264
$ cc/NOLIST'DEF_SXUNX' /OBJ=crctab_.'ARCH_CC_P'obj crctab.c
265
$ cc/NOLIST'DEF_SXUNX' /OBJ=crypt_.'ARCH_CC_P'obj crypt.c
266
$ cc/NOLIST'DEF_SXUNX' /OBJ=extract_.'ARCH_CC_P'obj extract.c
267
$ cc/NOLIST'DEF_SXUNX' /OBJ=fileio_.'ARCH_CC_P'obj fileio.c
268
$ cc/NOLIST'DEF_SXUNX' /OBJ=globals_.'ARCH_CC_P'obj globals.c
269
$ cc/NOLIST'DEF_SXUNX' /OBJ=inflate_.'ARCH_CC_P'obj inflate.c
270
$ cc/NOLIST'DEF_SXUNX' /OBJ=match_.'ARCH_CC_P'obj match.c
271
$ cc/NOLIST'DEF_SXUNX' /OBJ=process_.'ARCH_CC_P'obj process.c
272
$ cc/NOLIST'DEF_SXUNX' /OBJ=ttyio_.'ARCH_CC_P'obj ttyio.c
273
$ cc/NOLIST'DEF_SXUNX'/INCLUDE=SYS$DISK:[] /OBJ=vms_.'ARCH_CC_P'obj; -
275
$ if f$search("unzipsfx.''ARCH_CC_P'olb") .eqs. "" then -
276
lib/obj/create unzipsfx.'ARCH_CC_P'olb
277
$ lib/obj/replace unzipsfx.'ARCH_CC_P'olb -
278
unzipsfx.'ARCH_CC_P'obj, crc32_.'ARCH_CC_P'obj, -
279
crctab_.'ARCH_CC_P'obj, crypt_.'ARCH_CC_P'obj, -
280
extract_.'ARCH_CC_P'obj, fileio_.'ARCH_CC_P'obj, -
281
globals_.'ARCH_CC_P'obj, inflate_.'ARCH_CC_P'obj, -
282
match_.'ARCH_CC_P'obj, process_.'ARCH_CC_P'obj, -
283
ttyio_.'ARCH_CC_P'obj, vms_.'ARCH_CC_P'obj
285
$ link'LFLAGS'/exe='unzsfx_unx'.'ARCH_CC_P'exe -
286
unzipsfx.'ARCH_CC_P'olb;/lib/incl=unzip -
287
'opts', [.VMS]unzipsfx.opt/opt
289
$ !--------------------- UnZipSFX (CLI interface) section ---------------------
291
$ cc/NOLIST'DEF_SXCLI' /OBJ=unzsxcli.'ARCH_CC_P'obj unzip.c
292
$ cc/NOLIST/INCLUDE=SYS$DISK:[]'DEF_SXCLI' /OBJ=cmdline_.'ARCH_CC_P'obj; -
294
$ if f$search("unzsxcli.''ARCH_CC_P'olb") .eqs. "" then -
295
lib/obj/create unzsxcli.'ARCH_CC_P'olb
296
$ lib/obj/replace unzsxcli.'ARCH_CC_P'olb -
297
unzsxcli.'ARCH_CC_P'obj;, -
298
cmdline_.'ARCH_CC_P'obj;, unz_cli.'ARCH_CC_P'obj;
300
$ link'LFLAGS'/exe='unzsfx_cli'.'ARCH_CC_P'exe -
301
unzsxcli.'ARCH_CC_P'olb;/lib/incl=unzip, -
302
unzipsfx.'ARCH_CC_P'olb;/lib -
303
'opts', [.VMS]unzipsfx.opt/opt
305
$ !----------------------------- Symbols section ------------------------------
307
$ ! Next line: put similar lines (full pathname for unzip.'ARCH_CC_P'exe) in
308
$ ! login.com. Remember to include the leading "$" before disk name.
310
$ unzip == "$''here'''UNZEXEC'.''ARCH_CC_P'exe"
311
$ zipinfo == "$''here'''UNZEXEC'.''ARCH_CC_P'exe ""-Z"""
314
$ if here .nes. "" then set default 'here'
315
$ tmp = f$verify(OLD_VERIFY)