Subversion Repositories Kolibri OS

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
6725 siemargl 1
$! BUILD_UNZIP.COM
2
$!
3
$!     Build procedure for VMS versions of UnZip/ZipInfo and UnZipSFX.
4
$!
5
$!     Last revised:  2009-03-01  SMS.
6
$!
7
$!     Command arguments:
8
$!     - suppress help file processing: "NOHELP"
9
$!     - suppress message file processing: "NOMSG"
10
$!     - select link-only: "LINK"
11
$!     - select compiler environment: "VAXC", "DECC", "GNUC"
12
$!     - select BZIP2 support: "USEBZ2"
13
$!       This option is a shortcut for "IZ_BZIP2=SYS$DISK:[.bzip2]", and
14
$!       runs the DCL build procedure there,
15
$!     - select BZIP2 support: "IZ_BZIP2=dev:[dir]", where "dev:[dir]"
16
$!       (or a suitable logical name) tells where to find "bzlib.h".
17
$!       The BZIP2 object library (LIBBZ2_NS.OLB) is expected to be in
18
$!       a "[.dest]" directory under that one ("dev:[dir.ALPHAL]", for
19
$!       example), or in that directory itself.
20
$!       By default, the SFX programs are built without BZIP2 support.
21
$!       Add "BZIP2_SFX=1" to the LOCAL_UNZIP C macros to enable it.
22
$!       (See LOCAL_UNZIP, below.)
23
$!     - use ZLIB compression library: "IZ_ZLIB=dev:[dir]", where
24
$!       "dev:[dir]" (or a suitable logical name) tells where to find
25
$!       "zlib.h".  The ZLIB object library (LIBZ.OLB) is expected to be
26
$!       in a "[.dest]" directory under that one ("dev:[dir.ALPHAL]",
27
$!       for example), or in that directory itself.
28
$!     - select large-file support: "LARGE"
29
$!     - select compiler listings: "LIST"  Note that the whole argument
30
$!       is added to the compiler command, so more elaborate options
31
$!       like "LIST/SHOW=ALL" (quoted or space-free) may be specified.
32
$!     - supply additional compiler options: "CCOPTS=xxx"  Allows the
33
$!       user to add compiler command options like /ARCHITECTURE or
34
$!       /[NO]OPTIMIZE.  For example, CCOPTS=/ARCH=HOST/OPTI=TUNE=HOST
35
$!       or CCOPTS=/DEBUG/NOOPTI.  These options must be quoted or
36
$!       space-free.
37
$!     - supply additional linker options: "LINKOPTS=xxx"  Allows the
38
$!       user to add linker command options like /DEBUG or /MAP.  For
39
$!       example: LINKOPTS=/DEBUG or LINKOPTS=/MAP/CROSS.  These options
40
$!       must be quoted or space-free.  Default is
41
$!       LINKOPTS=/NOTRACEBACK, but if the user specifies a LINKOPTS
42
$!       string, /NOTRACEBACK will not be included unless specified by
43
$!       the user.
44
$!     - select installation of CLI interface version of UnZip:
45
$!       "VMSCLI" or "CLI"
46
$!     - force installation of UNIX interface version of UnZip
47
$!       (override LOCAL_UNZIP environment): "NOVMSCLI" or "NOCLI"
48
$!
49
$!     To specify additional options, define the symbol LOCAL_UNZIP
50
$!     as a comma-separated list of the C macros to be defined, and
51
$!     then run BUILD_UNZIP.COM.  For example:
52
$!
53
$!             $ LOCAL_UNZIP = "RETURN_CODES"
54
$!             $ @ [.VMS]BUILD_UNZIP.COM
55
$!
56
$!     VMS-specific options include VMSWILD and RETURN_CODES.  See the
57
$!     INSTALL file for other options (for example, CHECK_VERSIONS).
58
$!
59
$!     If you edit this procedure to set LOCAL_UNZIP here, be sure to
60
$!     use only one "=", to avoid affecting other procedures.
61
$!
62
$!     Note: This command procedure always generates both the "default"
63
$!     UnZip having the UNIX style command interface and the "VMSCLI"
64
$!     UnZip having the CLI compatible command interface.  There is no
65
$!     need to add "VMSCLI" to the LOCAL_UNZIP symbol.  (The only effect
66
$!     of "VMSCLI" now is the selection of the CLI style UnZip
67
$!     executable in the foreign command definition.)
68
$!
69
$!
70
$ on error then goto error
71
$ on control_y then goto error
72
$ OLD_VERIFY = f$verify( 0)
73
$!
74
$ edit := edit                  ! override customized edit commands
75
$ say := write sys$output
76
$!
77
$!##################### Read settings from environment ########################
78
$!
79
$ if (f$type( LOCAL_UNZIP) .eqs. "")
80
$ then
81
$     LOCAL_UNZIP = ""
82
$ else  ! Trim blanks and append comma if missing
83
$     LOCAL_UNZIP = f$edit( LOCAL_UNZIP, "TRIM")
84
$     if (f$extract( (f$length( LOCAL_UNZIP)- 1), 1, LOCAL_UNZIP) .nes. ",")
85
$     then
86
$         LOCAL_UNZIP = LOCAL_UNZIP + ", "
87
$     endif
88
$ endif
89
$!
90
$! Check for the presence of "VMSCLI" in LOCAL_UNZIP.  If yes, we will
91
$! define the foreign command for "unzip" to use the executable
92
$! containing the CLI interface.
93
$!
94
$ pos_cli = f$locate( "VMSCLI", LOCAL_UNZIP)
95
$ len_local_unzip = f$length( LOCAL_UNZIP)
96
$ if (pos_cli .ne. len_local_unzip)
97
$ then
98
$     CLI_IS_DEFAULT = 1
99
$     ! Remove "VMSCLI" macro from LOCAL_UNZIP. The UnZip executable
100
$     ! including the CLI interface is now created unconditionally.
101
$     LOCAL_UNZIP = f$extract( 0, pos_cli, LOCAL_UNZIP)+ -
102
       f$extract( pos_cli+7, len_local_unzip- (pos_cli+ 7), LOCAL_UNZIP)
103
$ else
104
$     CLI_IS_DEFAULT = 0
105
$ endif
106
$ delete /symbol /local pos_cli
107
$ delete /symbol /local len_local_unzip
108
$!
109
$!##################### Customizing section #############################
110
$!
111
$ unzx_unx = "UNZIP"
112
$ unzx_cli = "UNZIP_CLI"
113
$ unzsfx_unx = "UNZIPSFX"
114
$ unzsfx_cli = "UNZIPSFX_CLI"
115
$!
116
$ CCOPTS = ""
117
$ IZ_BZIP2 = ""
118
$ BUILD_BZIP2 = 0
119
$ IZ_ZLIB = ""
120
$ LINKOPTS = "/notraceback"
121
$ LINK_ONLY = 0
122
$ LISTING = " /nolist"
123
$ LARGE_FILE = 0
124
$ MAKE_HELP = 1
125
$ MAKE_MSG = 1
126
$ MAY_USE_DECC = 1
127
$ MAY_USE_GNUC = 0
128
$!
129
$! Process command line parameters requesting optional features.
130
$!
131
$ arg_cnt = 1
132
$ argloop:
133
$     current_arg_name = "P''arg_cnt'"
134
$     curr_arg = f$edit( 'current_arg_name', "UPCASE")
135
$     if (curr_arg .eqs. "") then goto argloop_out
136
$!
137
$     if (f$extract( 0, 5, curr_arg) .eqs. "CCOPT")
138
$     then
139
$         opts = f$edit( curr_arg, "COLLAPSE")
140
$         eq = f$locate( "=", opts)
141
$         CCOPTS = f$extract( (eq+ 1), 1000, opts)
142
$         goto argloop_end
143
$     endif
144
$!
145
$     if (f$extract( 0, 7, curr_arg) .eqs. "IZ_BZIP")
146
$     then
147
$         opts = f$edit( curr_arg, "COLLAPSE")
148
$         eq = f$locate( "=", opts)
149
$         IZ_BZIP2 = f$extract( (eq+ 1), 1000, opts)
150
$         goto argloop_end
151
$     endif
152
$!
153
$     if (f$extract( 0, 6, curr_arg) .eqs. "USEBZ2")
154
$     then
155
$         if (IZ_BZIP2 .eqs. "")
156
$         then
157
$             IZ_BZIP2 = "SYS$DISK:[.BZIP2]"
158
$             BUILD_BZIP2 = 1
159
$         endif
160
$         goto argloop_end
161
$     endif
162
$!
163
$     if (f$extract( 0, 7, curr_arg) .eqs. "IZ_ZLIB")
164
$     then
165
$         opts = f$edit( curr_arg, "COLLAPSE")
166
$         eq = f$locate( "=", opts)
167
$         IZ_ZLIB = f$extract( (eq+ 1), 1000, opts)
168
$         goto argloop_end
169
$     endif
170
$!
171
$     if (f$extract( 0, 5, curr_arg) .eqs. "LARGE")
172
$     then
173
$         LARGE_FILE = 1
174
$         goto argloop_end
175
$     endif
176
$!
177
$     if (f$extract( 0, 7, curr_arg) .eqs. "LINKOPT")
178
$     then
179
$         opts = f$edit( curr_arg, "COLLAPSE")
180
$         eq = f$locate( "=", opts)
181
$         LINKOPTS = f$extract( (eq+ 1), 1000, opts)
182
$         goto argloop_end
183
$     endif
184
$!
185
$! Note: LINK test must follow LINKOPTS test.
186
$!
187
$     if (f$extract( 0, 4, curr_arg) .eqs. "LINK")
188
$     then
189
$         LINK_ONLY = 1
190
$         goto argloop_end
191
$     endif
192
$!
193
$     if (f$extract( 0, 4, curr_arg) .eqs. "LIST")
194
$     then
195
$         LISTING = "/''curr_arg'"      ! But see below for mods.
196
$         goto argloop_end
197
$     endif
198
$!
199
$     if (curr_arg .eqs. "NOHELP")
200
$     then
201
$         MAKE_HELP = 0
202
$         goto argloop_end
203
$     endif
204
$!
205
$     if (curr_arg .eqs. "NOMSG")
206
$     then
207
$         MAKE_MSG = 0
208
$         goto argloop_end
209
$     endif
210
$!
211
$     if (curr_arg .eqs. "VAXC")
212
$     then
213
$         MAY_USE_DECC = 0
214
$         MAY_USE_GNUC = 0
215
$         goto argloop_end
216
$     endif
217
$!
218
$     if (curr_arg .eqs. "DECC")
219
$     then
220
$         MAY_USE_DECC = 1
221
$         MAY_USE_GNUC = 0
222
$         goto argloop_end
223
$     endif
224
$!
225
$     if (curr_arg .eqs. "GNUC")
226
$     then
227
$         MAY_USE_DECC = 0
228
$         MAY_USE_GNUC = 1
229
$         goto argloop_end
230
$     endif
231
$!
232
$     if ((curr_arg .eqs. "VMSCLI") .or. (curr_arg .eqs. "CLI"))
233
$     then
234
$         CLI_IS_DEFAULT = 1
235
$         goto argloop_end
236
$     endif
237
$!
238
$     if ((curr_arg .eqs. "NOVMSCLI") .or. (curr_arg .eqs. "NOCLI"))
239
$     then
240
$         CLI_IS_DEFAULT = 0
241
$         goto argloop_end
242
$     endif
243
$!
244
$     say "Unrecognized command-line option: ''curr_arg'"
245
$     goto error
246
$!
247
$     argloop_end:
248
$     arg_cnt = arg_cnt + 1
249
$ goto argloop
250
$ argloop_out:
251
$!
252
$ if (CLI_IS_DEFAULT)
253
$ then
254
$     UNZEXEC = unzx_cli
255
$ else
256
$     UNZEXEC = unzx_unx
257
$ endif
258
$!
259
$!#######################################################################
260
$!
261
$! Find out current disk, directory, compiler and options
262
$!
263
$ workdir = f$environment( "default")
264
$ here = f$parse( workdir, , , "device")+ f$parse( workdir, , , "directory")
265
$!
266
$! Sense the host architecture (Alpha, Itanium, or VAX).
267
$!
268
$ if (f$getsyi( "HW_MODEL") .lt. 1024)
269
$ then
270
$     arch = "VAX"
271
$ else
272
$     if (f$getsyi( "ARCH_TYPE") .eq. 2)
273
$     then
274
$         arch = "ALPHA"
275
$     else
276
$         if (f$getsyi( "ARCH_TYPE") .eq. 3)
277
$         then
278
$             arch = "IA64"
279
$         else
280
$             arch = "unknown_arch"
281
$         endif
282
$     endif
283
$ endif
284
$!
285
$ dest = arch
286
$ cmpl = "DEC/Compaq/HP C"
287
$ opts = ""
288
$ if (arch .nes. "VAX")
289
$ then
290
$     HAVE_DECC_VAX = 0
291
$     USE_DECC_VAX = 0
292
$!
293
$     if (MAY_USE_GNUC)
294
$     then
295
$         say "GNU C is not supported for ''arch'."
296
$         say "You must use DEC/Compaq/HP C to build UnZip."
297
$         goto error
298
$     endif
299
$!
300
$     if (.not. MAY_USE_DECC)
301
$     then
302
$         say "VAX C is not supported for ''arch'."
303
$         say "You must use DEC/Compaq/HP C to build UnZip."
304
$         goto error
305
$     endif
306
$!
307
$     cc = "cc /standard = relax /prefix = all /ansi"
308
$     defs = "''LOCAL_UNZIP'MODERN"
309
$     if (LARGE_FILE .ne. 0)
310
$     then
311
$         defs = "LARGE_FILE_SUPPORT, ''defs'"
312
$     endif
313
$ else
314
$     if (LARGE_FILE .ne. 0)
315
$     then
316
$        say "LARGE_FILE_SUPPORT is not available on VAX."
317
$        LARGE_FILE = 0
318
$     endif
319
$     HAVE_DECC_VAX = (f$search( "SYS$SYSTEM:DECC$COMPILER.EXE") .nes. "")
320
$     HAVE_VAXC_VAX = (f$search( "SYS$SYSTEM:VAXC.EXE") .nes. "")
321
$     MAY_HAVE_GNUC = (f$trnlnm( "GNU_CC") .nes. "")
322
$     if (HAVE_DECC_VAX .and. MAY_USE_DECC)
323
$     then
324
$         ! We use DECC:
325
$         USE_DECC_VAX = 1
326
$         cc = "cc /decc /prefix = all"
327
$         defs = "''LOCAL_UNZIP'MODERN"
328
$     else
329
$         ! We use VAXC (or GNU C):
330
$         USE_DECC_VAX = 0
331
$         defs = "''LOCAL_UNZIP'VMS"
332
$         if ((.not. HAVE_VAXC_VAX .and. MAY_HAVE_GNUC) .or. MAY_USE_GNUC)
333
$         then
334
$             cc = "gcc"
335
$             dest = "''dest'G"
336
$             cmpl = "GNU C"
337
$             opts = "GNU_CC:[000000]GCCLIB.OLB /LIBRARY,"
338
$         else
339
$             if (HAVE_DECC_VAX)
340
$             then
341
$                 cc = "cc /vaxc"
342
$             else
343
$                 cc = "cc"
344
$             endif
345
$             dest = "''dest'V"
346
$             cmpl = "VAX C"
347
$         endif
348
$         opts = "''opts' SYS$DISK:[.''dest']VAXCSHR.OPT /OPTIONS,"
349
$     endif
350
$ endif
351
$!
352
$ if (IZ_BZIP2 .nes. "")
353
$ then
354
$     defs = "USE_BZIP2, ''defs'"
355
$ endif
356
$!
357
$! Reveal the plan.  If compiling, set some compiler options.
358
$!
359
$ if (LINK_ONLY)
360
$ then
361
$     say "Linking on ''arch' for ''cmpl'."
362
$ else
363
$     say "Compiling on ''arch' using ''cmpl'."
364
$!
365
$     DEF_UNX = "/define = (''defs')"
366
$     DEF_CLI = "/define = (''defs', VMSCLI)"
367
$     DEF_SXUNX = "/define = (''defs', SFX)"
368
$     DEF_SXCLI = "/define = (''defs', VMSCLI, SFX)"
369
$ endif
370
$!
371
$! Search directory for BZIP2.
372
$!
373
$ if (BUILD_BZIP2)
374
$ then
375
$!    Our own BZIP2 directory.
376
$     seek_bz = dest
377
$ else
378
$!    User-specified BZIP2 directory.
379
$     seek_bz = arch
380
$ endif
381
$!
382
$! Search directory for ZLIB.
383
$!
384
$ seek_zl = arch
385
$!
386
$! Change the destination directory, if the large-file option is enabled.
387
$!
388
$ if (LARGE_FILE .ne. 0)
389
$ then
390
$     dest = "''dest'L"
391
$ endif
392
$!
393
$! If BZIP2 support was selected, find the header file and object
394
$! library.  Complain if things fail.
395
$!
396
$ cc_incl = "[]"
397
$ lib_bzip2_opts = ""
398
$ if (IZ_BZIP2 .nes. "")
399
$ then
400
$     bz2_olb = "LIBBZ2_NS.OLB"
401
$     if (.not. LINK_ONLY)
402
$     then
403
$         define incl_bzip2 'IZ_BZIP2'
404
$         if (BUILD_BZIP2 .and. (IZ_BZIP2 .eqs. "SYS$DISK:[.BZIP2]"))
405
$         then
406
$             set def [.BZIP2]
407
$             @buildbz2.com
408
$             set def [-]
409
$         endif
410
$     endif
411
$!
412
$     @ [.VMS]FIND_BZIP2_LIB.COM 'IZ_BZIP2' 'seek_bz' 'bz2_olb' lib_bzip2
413
$     if (f$trnlnm( "lib_bzip2") .eqs. "")
414
$     then
415
$         say "Can't find BZIP2 object library.  Can't link."
416
$         goto error
417
$     else
418
$         lib_bzip2_opts = "lib_bzip2:''bz2_olb' /library,"
419
$         cc_incl = cc_incl+ ", [.VMS]"
420
$     endif
421
$ endif
422
$!
423
$! If ZLIB use was selected, find the object library.
424
$! Complain if things fail.
425
$!
426
$ lib_zlib_opts = ""
427
$ if (IZ_ZLIB .nes. "")
428
$ then
429
$     zlib_olb = "LIBZ.OLB"
430
$     define incl_zlib 'IZ_ZLIB'
431
$     defs = "''defs', USE_ZLIB"
432
$     @ [.VMS]FIND_BZIP2_LIB.COM 'IZ_ZLIB' 'seek_zl' 'zlib_olb' lib_zlib
433
$     if (f$trnlnm( "lib_zlib") .eqs. "")
434
$     then
435
$         say "Can't find ZLIB object library.  Can't link."
436
$         goto error
437
$     else
438
$         lib_zlib_opts = "lib_zlib:''zlib_olb' /library, "
439
$         if (f$locate( "[.VMS]", cc_incl) .ge. f$length( cc_incl))
440
$         then
441
$             cc_incl = cc_incl+ ", [.VMS]"
442
$         endif
443
$         @ [.VMS]FIND_BZIP2_LIB.COM 'IZ_ZLIB' -
444
           contrib.infback9 infback9.h'zlib_olb' incl_zlib_contrib_infback9
445
$     endif
446
$ endif
447
$!
448
$! If [.'dest'] does not exist, either complain (link-only) or make it.
449
$!
450
$ if (f$search( "''dest'.dir;1") .eqs. "")
451
$ then
452
$     if (LINK_ONLY)
453
$     then
454
$         say "Can't find directory ""[.''dest']"".  Can't link."
455
$         goto error
456
$     else
457
$         create /directory [.'dest']
458
$     endif
459
$ endif
460
$!
461
$ if (.not. LINK_ONLY)
462
$ then
463
$!
464
$! Arrange to get arch-specific list file placement, if listing, and if
465
$! the user didn't specify a particular "/LIST =" destination.
466
$!
467
$     L = f$edit( LISTING, "COLLAPSE")
468
$     if ((f$extract( 0, 5, L) .eqs. "/LIST") .and. -
469
       (f$extract( 4, 1, L) .nes. "="))
470
$     then
471
$         LISTING = " /LIST = [.''dest']"+ f$extract( 5, 1000, LISTING)
472
$     endif
473
$!
474
$! Define compiler command.
475
$!
476
$     cc = cc+ " /include = (''cc_incl')"+ LISTING+ CCOPTS
477
$!
478
$ endif
479
$!
480
$! Define linker command.
481
$!
482
$ link = "link ''LINKOPTS'"
483
$!
484
$! Make a VAXCRTL options file for GNU C or VAC C, if needed.
485
$!
486
$ if ((opts .nes. "") .and. -
487
   (f$locate( "VAXCSHR", f$edit( opts, "UPCASE")) .lt. f$length( opts)) .and. -
488
   (f$search( "[.''dest']VAXCSHR.OPT") .eqs. ""))
489
$ then
490
$     open /write opt_file_ln [.'dest']VAXCSHR.OPT
491
$     write opt_file_ln "SYS$SHARE:VAXCRTL.EXE /SHARE"
492
$     close opt_file_ln
493
$ endif
494
$!
495
$! Show interesting facts.
496
$!
497
$ say "   architecture = ''arch' (destination = [.''dest'])"
498
$ if (IZ_BZIP2 .nes. "")
499
$ then
500
$     if (.not. LINK_ONLY)
501
$     then
502
$         say "   BZIP2 include dir: ''f$trnlnm( "incl_bzip2")'"
503
$     endif
504
$     say "   BZIP2 library dir: ''f$trnlnm( "lib_bzip2")'"
505
$ endif
506
$ if (IZ_ZLIB .nes. "")
507
$ then
508
$     if (.not. LINK_ONLY)
509
$     then
510
$         say "   ZLIB include dir:  ''f$trnlnm( "incl_zlib")'"
511
$     endif
512
$     say "   ZLIB library dir:  ''f$trnlnm( "lib_zlib")'"
513
$ endif
514
$ if (.not. LINK_ONLY)
515
$ then
516
$     say "   cc = ''cc'"
517
$ endif
518
$ say "   link = ''link'"
519
$ if (.not. MAKE_HELP)
520
$ then
521
$     say "   Not making new help files."
522
$ endif
523
$ if (.not. MAKE_MSG)
524
$ then
525
$     say "   Not making new message files."
526
$ endif
527
$ say ""
528
$!
529
$ tmp = f$verify( 1)    ! Turn echo on to see what's happening.
530
$!
531
$!------------------------------- UnZip section ------------------------------
532
$!
533
$ if (.not. LINK_ONLY)
534
$ then
535
$!
536
$! Process the help file, if desired.
537
$!
538
$     if (MAKE_HELP)
539
$     then
540
$         runoff /out = UNZIP.HLP [.VMS]UNZIP_DEF.RNH
541
$     endif
542
$!
543
$! Process the message file, if desired.
544
$!
545
$     if (MAKE_MSG)
546
$     then
547
$         message /object = [.'dest']UNZIP_MSG.OBJ /nosymbols -
548
           [.VMS]UNZIP_MSG.MSG
549
$         link /shareable = [.'dest']UNZIP_MSG.EXE [.'dest']UNZIP_MSG.OBJ
550
$     endif
551
$!
552
$! Compile the sources.
553
$!
554
$     cc 'DEF_UNX' /object = [.'dest']UNZIP.OBJ UNZIP.C
555
$     cc 'DEF_UNX' /object = [.'dest']CRC32.OBJ CRC32.C
556
$     cc 'DEF_UNX' /object = [.'dest']CRYPT.OBJ CRYPT.C
557
$     cc 'DEF_UNX' /object = [.'dest']ENVARGS.OBJ ENVARGS.C
558
$     cc 'DEF_UNX' /object = [.'dest']EXPLODE.OBJ EXPLODE.C
559
$     cc 'DEF_UNX' /object = [.'dest']EXTRACT.OBJ EXTRACT.C
560
$     cc 'DEF_UNX' /object = [.'dest']FILEIO.OBJ FILEIO.C
561
$     cc 'DEF_UNX' /object = [.'dest']GLOBALS.OBJ GLOBALS.C
562
$     cc 'DEF_UNX' /object = [.'dest']INFLATE.OBJ INFLATE.C
563
$     cc 'DEF_UNX' /object = [.'dest']LIST.OBJ LIST.C
564
$     cc 'DEF_UNX' /object = [.'dest']MATCH.OBJ MATCH.C
565
$     cc 'DEF_UNX' /object = [.'dest']PROCESS.OBJ PROCESS.C
566
$     cc 'DEF_UNX' /object = [.'dest']TTYIO.OBJ TTYIO.C
567
$     cc 'DEF_UNX' /object = [.'dest']UBZ2ERR.OBJ UBZ2ERR.C
568
$     cc 'DEF_UNX' /object = [.'dest']UNREDUCE.OBJ UNREDUCE.C
569
$     cc 'DEF_UNX' /object = [.'dest']UNSHRINK.OBJ UNSHRINK.C
570
$     cc 'DEF_UNX' /object = [.'dest']ZIPINFO.OBJ ZIPINFO.C
571
$     cc 'DEF_UNX' /object = [.'dest']VMS.OBJ [.VMS]VMS.C
572
$!
573
$! Create the object library.
574
$!
575
$     if (f$search( "[.''dest']UNZIP.OLB") .eqs. "") then -
576
       libr /object /create [.'dest']UNZIP.OLB
577
$!
578
$     libr /object /replace [.'dest']UNZIP.OLB -
579
       [.'dest']CRC32.OBJ, -
580
       [.'dest']CRYPT.OBJ, -
581
       [.'dest']ENVARGS.OBJ, -
582
       [.'dest']EXPLODE.OBJ, -
583
       [.'dest']EXTRACT.OBJ, -
584
       [.'dest']FILEIO.OBJ, -
585
       [.'dest']GLOBALS.OBJ, -
586
       [.'dest']INFLATE.OBJ, -
587
       [.'dest']LIST.OBJ, -
588
       [.'dest']MATCH.OBJ, -
589
       [.'dest']PROCESS.OBJ, -
590
       [.'dest']TTYIO.OBJ, -
591
       [.'dest']UBZ2ERR.OBJ, -
592
       [.'dest']UNREDUCE.OBJ, -
593
       [.'dest']UNSHRINK.OBJ, -
594
       [.'dest']ZIPINFO.OBJ, -
595
       [.'dest']VMS.OBJ
596
$!
597
$ endif
598
$!
599
$! Link the executable.
600
$!
601
$ link /executable = [.'dest']'unzx_unx'.EXE -
602
   SYS$DISK:[.'dest']UNZIP.OBJ, -
603
   SYS$DISK:[.'dest']UNZIP.OLB /library, -
604
   'lib_bzip2_opts' -
605
   SYS$DISK:[.'dest']UNZIP.OLB /library, -
606
   'lib_zlib_opts' -
607
   'opts' -
608
   SYS$DISK:[.VMS]UNZIP.OPT /options
609
$!
610
$!----------------------- UnZip (CLI interface) section ----------------------
611
$!
612
$ if (.not. LINK_ONLY)
613
$ then
614
$!
615
$! Process the CLI help file, if desired.
616
$!
617
$     if (MAKE_HELP)
618
$     then
619
$         set default [.VMS]
620
$         edit /tpu /nosection /nodisplay /command = CVTHELP.TPU -
621
           UNZIP_CLI.HELP
622
$         set default [-]
623
$         runoff /output = UNZIP_CLI.HLP [.VMS]UNZIP_CLI.RNH
624
$     endif
625
$!
626
$! Compile the CLI sources.
627
$!
628
$     cc 'DEF_CLI' /object = [.'dest']UNZIPCLI.OBJ UNZIP.C
629
$     cc 'DEF_CLI' /object = [.'dest']CMDLINE.OBJ -
630
       [.VMS]CMDLINE.C
631
$!
632
$! Create the command definition object file.
633
$!
634
$     set command /object = [.'dest']UNZ_CLI.OBJ [.VMS]UNZ_CLI.CLD
635
$!
636
$! Create the CLI object library.
637
$!
638
$     if (f$search( "[.''dest']UNZIPCLI.OLB") .eqs. "") then -
639
       libr /object /create [.'dest']UNZIPCLI.OLB
640
$!
641
$     libr /object /replace [.'dest']UNZIPCLI.OLB -
642
       [.'dest']CMDLINE.OBJ, -
643
       [.'dest']UNZ_CLI.OBJ
644
$!
645
$ endif
646
$!
647
$! Link the CLI executable.
648
$!
649
$ link /executable = [.'dest']'unzx_cli'.EXE -
650
   SYS$DISK:[.'dest']UNZIPCLI.OBJ, -
651
   SYS$DISK:[.'dest']UNZIPCLI.OLB /library, -
652
   SYS$DISK:[.'dest']UNZIP.OLB /library, -
653
   'lib_bzip2_opts' -
654
   SYS$DISK:[.'dest']UNZIP.OLB /library, -
655
   'lib_zlib_opts' -
656
   'opts' -
657
   SYS$DISK:[.VMS]UNZIP.OPT /options
658
$!
659
$!-------------------------- UnZipSFX section --------------------------------
660
$!
661
$ if (.not. LINK_ONLY)
662
$ then
663
$!
664
$! Compile the variant SFX sources.
665
$!
666
$     cc 'DEF_SXUNX' /object = [.'dest']UNZIPSFX.OBJ UNZIP.C
667
$     cc 'DEF_SXUNX' /object = [.'dest']CRC32_.OBJ CRC32.C
668
$     cc 'DEF_SXUNX' /object = [.'dest']CRYPT_.OBJ CRYPT.C
669
$     cc 'DEF_SXUNX' /object = [.'dest']EXTRACT_.OBJ EXTRACT.C
670
$     cc 'DEF_SXUNX' /object = [.'dest']FILEIO_.OBJ FILEIO.C
671
$     cc 'DEF_SXUNX' /object = [.'dest']GLOBALS_.OBJ GLOBALS.C
672
$     cc 'DEF_SXUNX' /object = [.'dest']INFLATE_.OBJ INFLATE.C
673
$     cc 'DEF_SXUNX' /object = [.'dest']MATCH_.OBJ MATCH.C
674
$     cc 'DEF_SXUNX' /object = [.'dest']PROCESS_.OBJ PROCESS.C
675
$     cc 'DEF_SXUNX' /object = [.'dest']TTYIO_.OBJ TTYIO.C
676
$     cc 'DEF_SXUNX' /object = [.'dest']UBZ2ERR_.OBJ UBZ2ERR.C
677
$     cc 'DEF_SXUNX' /object = [.'dest']VMS_.OBJ [.VMS]VMS.C
678
$!
679
$! Create the SFX object library.
680
$!
681
$     if (f$search( "[.''dest']UNZIPSFX.OLB") .eqs. "") then -
682
       libr /object /create [.'dest']UNZIPSFX.OLB
683
$!
684
$     libr /object /replace [.'dest']UNZIPSFX.OLB -
685
       [.'dest']CRC32_.OBJ, -
686
       [.'dest']CRYPT_.OBJ, -
687
       [.'dest']EXTRACT_.OBJ, -
688
       [.'dest']FILEIO_.OBJ, -
689
       [.'dest']GLOBALS_.OBJ, -
690
       [.'dest']INFLATE_.OBJ, -
691
       [.'dest']MATCH_.OBJ, -
692
       [.'dest']PROCESS_.OBJ, -
693
       [.'dest']TTYIO_.OBJ, -
694
       [.'dest']UBZ2ERR_.OBJ, -
695
       [.'dest']VMS_.OBJ
696
$!
697
$ endif
698
$!
699
$! Link the SFX executable.
700
$!
701
$ link /executable = [.'dest']'unzsfx_unx'.EXE -
702
   SYS$DISK:[.'dest']UNZIPSFX.OBJ, -
703
   SYS$DISK:[.'dest']UNZIPSFX.OLB /library, -
704
   'lib_bzip2_opts' -
705
   SYS$DISK:[.'dest']UNZIPSFX.OLB /library, -
706
   'lib_zlib_opts' -
707
   'opts' -
708
   SYS$DISK:[.VMS]UNZIPSFX.OPT /options
709
$!
710
$!--------------------- UnZipSFX (CLI interface) section ---------------------
711
$!
712
$ if (.not. LINK_ONLY)
713
$ then
714
$!
715
$! Compile the SFX CLI sources.
716
$!
717
$     cc 'DEF_SXCLI' /object = [.'dest']UNZSXCLI.OBJ UNZIP.C
718
$     cc 'DEF_SXCLI' /object = [.'dest']CMDLINE_.OBJ -
719
       [.VMS]CMDLINE.C
720
$!
721
$! Create the SFX CLI object library.
722
$!
723
$     if (f$search( "[.''dest']UNZSXCLI.OLB") .eqs. "") then -
724
       libr /object /create [.'dest']UNZSXCLI.OLB
725
$!
726
$     libr /object /replace [.'dest']UNZSXCLI.OLB -
727
       [.'dest']CMDLINE_.OBJ, -
728
       [.'dest']UNZ_CLI.OBJ
729
$!
730
$ endif
731
$!
732
$! Link the SFX CLI executable.
733
$!
734
$ link /executable = [.'dest']'unzsfx_cli'.EXE -
735
   SYS$DISK:[.'dest']UNZSXCLI.OBJ, -
736
   SYS$DISK:[.'dest']UNZSXCLI.OLB /library, -
737
   SYS$DISK:[.'dest']UNZIPSFX.OLB /library, -
738
   'lib_bzip2_opts' -
739
   SYS$DISK:[.'dest']UNZIPSFX.OLB /library, -
740
   'lib_zlib_opts' -
741
   'opts' -
742
   SYS$DISK:[.VMS]UNZIPSFX.OPT /options
743
$!
744
$!----------------------------- Symbols section ------------------------------
745
$!
746
$ there = here- "]"+ ".''dest']"
747
$!
748
$! Define the foreign command symbols.  Similar commands may be useful
749
$! in SYS$MANAGER:SYLOGIN.COM and/or users' LOGIN.COM.
750
$!
751
$ unzip   == "$''there'''unzexec'.EXE"
752
$ zipinfo == "$''there'''unzexec'.EXE ""-Z"""
753
$!
754
$! Deassign the temporary process logical names, restore the original
755
$! default directory, and restore the DCL verify status.
756
$!
757
$ error:
758
$!
759
$ if (IZ_BZIP2 .nes. "")
760
$ then
761
$     if (f$trnlnm( "incl_bzip2", "LNM$PROCESS_TABLE") .nes. "")
762
$     then
763
$         deassign incl_bzip2
764
$     endif
765
$     if (f$trnlnm( "lib_bzip2", "LNM$PROCESS_TABLE") .nes. "")
766
$     then
767
$         deassign lib_bzip2
768
$     endif
769
$ endif
770
$!
771
$ if (IZ_ZLIB .nes. "")
772
$ then
773
$     if (f$trnlnm( "incl_zlib", "LNM$PROCESS_TABLE") .nes. "")
774
$     then
775
$         deassign incl_zlib
776
$     endif
777
$     if (f$trnlnm( "incl_zlib_contrib_infback9", -
778
       "LNM$PROCESS_TABLE") .nes. "")
779
$     then
780
$         deassign incl_zlib_contrib_infback9
781
$     endif
782
$     if (f$trnlnm( "lib_zlib", "LNM$PROCESS_TABLE") .nes. "")
783
$     then
784
$         deassign lib_zlib
785
$     endif
786
$ endif
787
$!
788
$ if (f$type( here) .nes. "")
789
$ then
790
$     if (here .nes. "")
791
$     then
792
$         set default 'here'
793
$     endif
794
$ endif
795
$!
796
$ if (f$type( OLD_VERIFY) .nes. "")
797
$ then
798
$     tmp = f$verify( OLD_VERIFY)
799
$ endif
800
$!
801
$ exit
802
$!