| 1 |
$! BUILD_ZIP.COM |
| 2 |
$! |
| 3 |
$! Build procedure for VMS versions of Zip. |
| 4 |
$! |
| 5 |
$! last revised: 2007-03-15 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 large-file support: "LARGE" |
| 13 |
$! - select compiler listings: "LIST" Note that the whole argument |
| 14 |
$! is added to the compiler command, so more elaborate options |
| 15 |
$! like "LIST/SHOW=ALL" (quoted or space-free) may be specified. |
| 16 |
$! - supply additional compiler options: "CCOPTS=xxx" Allows the |
| 17 |
$! user to add compiler command options like /ARCHITECTURE or |
| 18 |
$! /[NO]OPTIMIZE. For example, CCOPTS=/ARCH=HOST/OPTI=TUNE=HOST |
| 19 |
$! or CCOPTS=/DEBUG/NOOPTI. These options must be quoted or |
| 20 |
$! space-free. |
| 21 |
$! - supply additional linker options: "LINKOPTS=xxx" Allows the |
| 22 |
$! user to add linker command options like /DEBUG or /MAP. For |
| 23 |
$! example: LINKOPTS=/DEBUG or LINKOPTS=/MAP/CROSS. These options |
| 24 |
$! must be quoted or space-free. Default is |
| 25 |
$! LINKOPTS=/NOTRACEBACK, but if the user specifies a LINKOPTS |
| 26 |
$! string, /NOTRACEBACK will not be included unless specified by |
| 27 |
$! the user. |
| 28 |
$! - select installation of CLI interface version of zip: |
| 29 |
$! "VMSCLI" or "CLI" |
| 30 |
$! - force installation of UNIX interface version of zip |
| 31 |
$! (override LOCAL_ZIP environment): "NOVMSCLI" or "NOCLI" |
| 32 |
$! - select BZIP2 support: "IZ_BZIP2=dev:[dir]", where "dev:[dir]" |
| 33 |
$! (or a suitable logical name) tells where to find "bzlib.h". |
| 34 |
$! The BZIP2 object library (LIBBZ2_NS.OLB) is expected to be in |
| 35 |
$! a "[.dest]" directory under that one ("dev:[dir.ALPHAL]", for |
| 36 |
$! example), or in that directory itself. |
| 37 |
$! |
| 38 |
$! To specify additional options, define the global symbol |
| 39 |
$! LOCAL_ZIP as a comma-separated list of the C macros to be |
| 40 |
$! defined, and then run BUILD_ZIP.COM. For example: |
| 41 |
$! |
| 42 |
$! $ LOCAL_ZIP == "VMS_IM_EXTRA" |
| 43 |
$! $ @ [.VMS]BUILD_ZIP.COM |
| 44 |
$! |
| 45 |
$! Valid VMS-specific options include VMS_PK_EXTRA and VMS_IM_EXTRA. |
| 46 |
$! See the INSTALL file for other options. (VMS_PK_EXTRA is the |
| 47 |
$! default.) |
| 48 |
$! |
| 49 |
$! If editing this procedure to set LOCAL_ZIP, be sure to use only |
| 50 |
$! one "=", to avoid affecting other procedures. For example: |
| 51 |
$! $ LOCAL_ZIP = "VMS_IM_EXTRA" |
| 52 |
$! |
| 53 |
$! Note: This command procedure always generates both the "default" |
| 54 |
$! Zip having the UNIX style command interface and the "VMSCLI" Zip |
| 55 |
$! having the CLI compatible command interface. There is no need to |
| 56 |
$! add "VMSCLI" to the LOCAL_ZIP symbol. (The only effect of |
| 57 |
$! "VMSCLI" now is the selection of the CLI style Zip executable in |
| 58 |
$! the foreign command definition.) |
| 59 |
$! |
| 60 |
$! |
| 61 |
$ on error then goto error |
| 62 |
$ on control_y then goto error |
| 63 |
$ OLD_VERIFY = f$verify( 0) |
| 64 |
$! |
| 65 |
$ edit := edit ! override customized edit commands |
| 66 |
$ say := write sys$output |
| 67 |
$! |
| 68 |
$!##################### Read settings from environment ######################## |
| 69 |
$! |
| 70 |
$ if (f$type( LOCAL_ZIP) .eqs. "") |
| 71 |
$ then |
| 72 |
$ LOCAL_ZIP = "" |
| 73 |
$ else ! Trim blanks and append comma if missing |
| 74 |
$ LOCAL_ZIP = f$edit( LOCAL_ZIP, "TRIM") |
| 75 |
$ if (f$extract( f$length( LOCAL_ZIP)- 1, 1, LOCAL_ZIP) .nes. ",") |
| 76 |
$ then |
| 77 |
$ LOCAL_ZIP = LOCAL_ZIP + "," |
| 78 |
$ endif |
| 79 |
$ endif |
| 80 |
$! |
| 81 |
$! Check for the presence of "VMSCLI" in LOCAL_ZIP. If yes, we will |
| 82 |
$! define the foreign command for "zip" to use the executable |
| 83 |
$! containing the CLI interface. |
| 84 |
$! |
| 85 |
$ len_local_zip = f$length( LOCAL_ZIP) |
| 86 |
$! |
| 87 |
$ pos_cli = f$locate( "VMSCLI", LOCAL_ZIP) |
| 88 |
$ if (pos_cli .ne. len_local_zip) |
| 89 |
$ then |
| 90 |
$ CLI_IS_DEFAULT = 1 |
| 91 |
$ ! Remove "VMSCLI" macro from LOCAL_ZIP. The Zip executable |
| 92 |
$ ! including the CLI interface is now created unconditionally. |
| 93 |
$ LOCAL_ZIP = f$extract( 0, pos_cli, LOCAL_ZIP)+ - |
| 94 |
f$extract( pos_cli+7, len_local_zip- (pos_cli+ 7), LOCAL_ZIP) |
| 95 |
$ else |
| 96 |
$ CLI_IS_DEFAULT = 0 |
| 97 |
$ endif |
| 98 |
$ delete /symbol /local pos_cli |
| 99 |
$! |
| 100 |
$! Check for the presence of "VMS_IM_EXTRA" in LOCAL_ZIP. If yes, we |
| 101 |
$! will (later) add "I" to the destination directory name. |
| 102 |
$! |
| 103 |
$ desti = "" |
| 104 |
$ pos_im = f$locate( "VMS_IM_EXTRA", LOCAL_ZIP) |
| 105 |
$ if (pos_im .ne. len_local_zip) |
| 106 |
$ then |
| 107 |
$ desti = "I" |
| 108 |
$ endif |
| 109 |
$! |
| 110 |
$ delete /symbol /local len_local_zip |
| 111 |
$! |
| 112 |
$!##################### Customizing section ############################# |
| 113 |
$! |
| 114 |
$ zipx_unx = "ZIP" |
| 115 |
$ zipx_cli = "ZIP_CLI" |
| 116 |
$! |
| 117 |
$ CCOPTS = "" |
| 118 |
$ IZ_BZIP2 = "" |
| 119 |
$ LINKOPTS = "/notraceback" |
| 120 |
$ LINK_ONLY = 0 |
| 121 |
$ LISTING = " /nolist" |
| 122 |
$ LARGE_FILE = 0 |
| 123 |
$ MAKE_HELP = 1 |
| 124 |
$ MAKE_MSG = 1 |
| 125 |
$ MAY_USE_DECC = 1 |
| 126 |
$ MAY_USE_GNUC = 0 |
| 127 |
$! |
| 128 |
$! Process command line parameters requesting optional features. |
| 129 |
$! |
| 130 |
$ arg_cnt = 1 |
| 131 |
$ argloop: |
| 132 |
$ current_arg_name = "P''arg_cnt'" |
| 133 |
$ curr_arg = f$edit( 'current_arg_name', "UPCASE") |
| 134 |
$ if (curr_arg .eqs. "") then goto argloop_out |
| 135 |
$! |
| 136 |
$ if (f$extract( 0, 5, curr_arg) .eqs. "CCOPT") |
| 137 |
$ then |
| 138 |
$ opts = f$edit( curr_arg, "COLLAPSE") |
| 139 |
$ eq = f$locate( "=", opts) |
| 140 |
$ CCOPTS = f$extract( (eq+ 1), 1000, opts) |
| 141 |
$ goto argloop_end |
| 142 |
$ endif |
| 143 |
$! |
| 144 |
$ if f$extract( 0, 7, curr_arg) .eqs. "IZ_BZIP" |
| 145 |
$ then |
| 146 |
$ opts = f$edit( curr_arg, "COLLAPSE") |
| 147 |
$ eq = f$locate( "=", opts) |
| 148 |
$ IZ_BZIP2 = f$extract( (eq+ 1), 1000, opts) |
| 149 |
$ goto argloop_end |
| 150 |
$ endif |
| 151 |
$! |
| 152 |
$ if (f$extract( 0, 5, curr_arg) .eqs. "LARGE") |
| 153 |
$ then |
| 154 |
$ LARGE_FILE = 1 |
| 155 |
$ goto argloop_end |
| 156 |
$ endif |
| 157 |
$! |
| 158 |
$ if (f$extract( 0, 7, curr_arg) .eqs. "LINKOPT") |
| 159 |
$ then |
| 160 |
$ opts = f$edit( curr_arg, "COLLAPSE") |
| 161 |
$ eq = f$locate( "=", opts) |
| 162 |
$ LINKOPTS = f$extract( (eq+ 1), 1000, opts) |
| 163 |
$ goto argloop_end |
| 164 |
$ endif |
| 165 |
$! |
| 166 |
$! Note: LINK test must follow LINKOPTS test. |
| 167 |
$! |
| 168 |
$ if (f$extract( 0, 4, curr_arg) .eqs. "LINK") |
| 169 |
$ then |
| 170 |
$ LINK_ONLY = 1 |
| 171 |
$ goto argloop_end |
| 172 |
$ endif |
| 173 |
$! |
| 174 |
$ if (f$extract( 0, 4, curr_arg) .eqs. "LIST") |
| 175 |
$ then |
| 176 |
$ LISTING = "/''curr_arg'" ! But see below for mods. |
| 177 |
$ goto argloop_end |
| 178 |
$ endif |
| 179 |
$! |
| 180 |
$ if (curr_arg .eqs. "NOHELP") |
| 181 |
$ then |
| 182 |
$ MAKE_HELP = 0 |
| 183 |
$ goto argloop_end |
| 184 |
$ endif |
| 185 |
$! |
| 186 |
$ if (curr_arg .eqs. "NOMSG") |
| 187 |
$ then |
| 188 |
$ MAKE_MSG = 0 |
| 189 |
$ goto argloop_end |
| 190 |
$ endif |
| 191 |
$! |
| 192 |
$ if (curr_arg .eqs. "VAXC") |
| 193 |
$ then |
| 194 |
$ MAY_USE_DECC = 0 |
| 195 |
$ MAY_USE_GNUC = 0 |
| 196 |
$ goto argloop_end |
| 197 |
$ endif |
| 198 |
$! |
| 199 |
$ if (curr_arg .eqs. "DECC") |
| 200 |
$ then |
| 201 |
$ MAY_USE_DECC = 1 |
| 202 |
$ MAY_USE_GNUC = 0 |
| 203 |
$ goto argloop_end |
| 204 |
$ endif |
| 205 |
$! |
| 206 |
$ if (curr_arg .eqs. "GNUC") |
| 207 |
$ then |
| 208 |
$ MAY_USE_DECC = 0 |
| 209 |
$ MAY_USE_GNUC = 1 |
| 210 |
$ goto argloop_end |
| 211 |
$ endif |
| 212 |
$! |
| 213 |
$ if ((curr_arg .eqs. "VMSCLI") .or. (curr_arg .eqs. "CLI")) |
| 214 |
$ then |
| 215 |
$ CLI_IS_DEFAULT = 1 |
| 216 |
$ goto argloop_end |
| 217 |
$ endif |
| 218 |
$! |
| 219 |
$ if ((curr_arg .eqs. "NOVMSCLI") .or. (curr_arg .eqs. "NOCLI")) |
| 220 |
$ then |
| 221 |
$ CLI_IS_DEFAULT = 0 |
| 222 |
$ goto argloop_end |
| 223 |
$ endif |
| 224 |
$! |
| 225 |
$ say "Unrecognized command-line option: ''curr_arg'" |
| 226 |
$ goto error |
| 227 |
$! |
| 228 |
$ argloop_end: |
| 229 |
$ arg_cnt = arg_cnt + 1 |
| 230 |
$ goto argloop |
| 231 |
$ argloop_out: |
| 232 |
$! |
| 233 |
$ if (CLI_IS_DEFAULT) |
| 234 |
$ then |
| 235 |
$ ZIPEXEC = zipx_cli |
| 236 |
$ else |
| 237 |
$ ZIPEXEC = zipx_unx |
| 238 |
$ endif |
| 239 |
$! |
| 240 |
$!####################################################################### |
| 241 |
$! |
| 242 |
$! Find out current disk, directory, compiler and options |
| 243 |
$! |
| 244 |
$ workdir = f$environment( "default") |
| 245 |
$ here = f$parse( workdir, , , "device")+ f$parse( workdir, , , "directory") |
| 246 |
$! |
| 247 |
$! Sense the host architecture (Alpha, Itanium, or VAX). |
| 248 |
$! |
| 249 |
$ if (f$getsyi( "HW_MODEL") .lt. 1024) |
| 250 |
$ then |
| 251 |
$ arch = "VAX" |
| 252 |
$ else |
| 253 |
$ if (f$getsyi( "ARCH_TYPE") .eq. 2) |
| 254 |
$ then |
| 255 |
$ arch = "ALPHA" |
| 256 |
$ else |
| 257 |
$ if (f$getsyi( "ARCH_TYPE") .eq. 3) |
| 258 |
$ then |
| 259 |
$ arch = "IA64" |
| 260 |
$ else |
| 261 |
$ arch = "unknown_arch" |
| 262 |
$ endif |
| 263 |
$ endif |
| 264 |
$ endif |
| 265 |
$! |
| 266 |
$ dest = arch |
| 267 |
$ cmpl = "DEC/Compaq/HP C" |
| 268 |
$ opts = "" |
| 269 |
$ if (arch .nes. "VAX") |
| 270 |
$ then |
| 271 |
$ HAVE_DECC_VAX = 0 |
| 272 |
$ USE_DECC_VAX = 0 |
| 273 |
$! |
| 274 |
$ if (MAY_USE_GNUC) |
| 275 |
$ then |
| 276 |
$ say "GNU C is not supported for ''arch'." |
| 277 |
$ say "You must use DEC/Compaq/HP C to build Zip." |
| 278 |
$ goto error |
| 279 |
$ endif |
| 280 |
$! |
| 281 |
$ if (.not. MAY_USE_DECC) |
| 282 |
$ then |
| 283 |
$ say "VAX C is not supported for ''arch'." |
| 284 |
$ say "You must use DEC/Compaq/HP C to build Zip." |
| 285 |
$ goto error |
| 286 |
$ endif |
| 287 |
$! |
| 288 |
$ cc = "cc /standard = relax /prefix = all /ansi" |
| 289 |
$ defs = "''LOCAL_ZIP' VMS" |
| 290 |
$ if (LARGE_FILE .ne. 0) |
| 291 |
$ then |
| 292 |
$ defs = "LARGE_FILE_SUPPORT, ''defs'" |
| 293 |
$ endif |
| 294 |
$ else |
| 295 |
$ if (LARGE_FILE .ne. 0) |
| 296 |
$ then |
| 297 |
$ say "LARGE_FILE_SUPPORT is not available on VAX." |
| 298 |
$ LARGE_FILE = 0 |
| 299 |
$ endif |
| 300 |
$ HAVE_DECC_VAX = (f$search( "SYS$SYSTEM:DECC$COMPILER.EXE") .nes. "") |
| 301 |
$ HAVE_VAXC_VAX = (f$search( "SYS$SYSTEM:VAXC.EXE") .nes. "") |
| 302 |
$ MAY_HAVE_GNUC = (f$trnlnm( "GNU_CC") .nes. "") |
| 303 |
$ if (HAVE_DECC_VAX .and. MAY_USE_DECC) |
| 304 |
$ then |
| 305 |
$ ! We use DECC: |
| 306 |
$ USE_DECC_VAX = 1 |
| 307 |
$ cc = "cc /decc /prefix = all" |
| 308 |
$ defs = "''LOCAL_ZIP' VMS" |
| 309 |
$ else |
| 310 |
$ ! We use VAXC (or GNU C): |
| 311 |
$ USE_DECC_VAX = 0 |
| 312 |
$ defs = "''LOCAL_ZIP' VMS" |
| 313 |
$ if ((.not. HAVE_VAXC_VAX .and. MAY_HAVE_GNUC) .or. MAY_USE_GNUC) |
| 314 |
$ then |
| 315 |
$ cc = "gcc" |
| 316 |
$ opts = "GNU_CC:[000000]GCCLIB.OLB /LIBRARY," |
| 317 |
$ dest = "''dest'G" |
| 318 |
$ cmpl = "GNU C" |
| 319 |
$ else |
| 320 |
$ if (HAVE_DECC_VAX) |
| 321 |
$ then |
| 322 |
$ cc = "cc /vaxc" |
| 323 |
$ else |
| 324 |
$ cc = "cc" |
| 325 |
$ endif |
| 326 |
$ dest = "''dest'V" |
| 327 |
$ cmpl = "VAC C" |
| 328 |
$ endif |
| 329 |
$ opts = "''opts' SYS$DISK:[.''dest']VAXCSHR.OPT /OPTIONS," |
| 330 |
$ endif |
| 331 |
$ endif |
| 332 |
$! |
| 333 |
$! Change the destination directory, according to the VMS_IM_EXTRA and |
| 334 |
$! large-file options. Set the bzip2 directory. |
| 335 |
$! |
| 336 |
$ dest = dest+ desti |
| 337 |
$ seek_bz = arch |
| 338 |
$ if (LARGE_FILE .ne. 0) |
| 339 |
$ then |
| 340 |
$ dest = dest+ "L" |
| 341 |
$ seek_bz = seek_bz+ "L" |
| 342 |
$ endif |
| 343 |
$! |
| 344 |
$! If BZIP2 support was selected, find the object library. |
| 345 |
$! Complain if things fail. |
| 346 |
$! |
| 347 |
$ cc_incl = "[]" |
| 348 |
$ incl_bzip2_m = "" |
| 349 |
$ lib_bzip2_opts = "" |
| 350 |
$ if (IZ_BZIP2 .nes. "") |
| 351 |
$ then |
| 352 |
$ bz2_olb = "LIBBZ2_NS.OLB" |
| 353 |
$ define incl_bzip2 'IZ_BZIP2' |
| 354 |
$ defs = "''defs', BZIP2_SUPPORT" |
| 355 |
$ @ [.VMS]FIND_BZIP2_LIB.COM 'IZ_BZIP2' 'seek_bz' 'bz2_olb' lib_bzip2 |
| 356 |
$ if (f$trnlnm( "lib_bzip2") .eqs. "") |
| 357 |
$ then |
| 358 |
$ say "Can't find BZIP2 object library. Can't link." |
| 359 |
$ goto error |
| 360 |
$ else |
| 361 |
$ say "BZIP2 dir = ''f$trnlnm( "lib_bzip2")'" |
| 362 |
$ incl_bzip2_m = ", ZBZ2ERR" |
| 363 |
$ lib_bzip2_opts = "lib_bzip2:''bz2_olb' /library, " |
| 364 |
$ cc_incl = cc_incl+ ", [.VMS]" |
| 365 |
$ endif |
| 366 |
$ endif |
| 367 |
$! |
| 368 |
$! Reveal the plan. If compiling, set some compiler options. |
| 369 |
$! |
| 370 |
$ if (LINK_ONLY) |
| 371 |
$ then |
| 372 |
$ say "Linking on ''arch' for ''cmpl'." |
| 373 |
$ else |
| 374 |
$ say "Compiling on ''arch' using ''cmpl'." |
| 375 |
$! |
| 376 |
$ DEF_UNX = "/define = (''defs')" |
| 377 |
$ DEF_CLI = "/define = (''defs', VMSCLI)" |
| 378 |
$ DEF_UTIL = "/define = (''defs', UTIL)" |
| 379 |
$ endif |
| 380 |
$! |
| 381 |
$! If [.'dest'] does not exist, either complain (link-only) or make it. |
| 382 |
$! |
| 383 |
$ if (f$search( "''dest'.DIR;1") .eqs. "") |
| 384 |
$ then |
| 385 |
$ if (LINK_ONLY) |
| 386 |
$ then |
| 387 |
$ say "Can't find directory ""[.''dest']"". Can't link." |
| 388 |
$ goto error |
| 389 |
$ else |
| 390 |
$ create /directory [.'dest'] |
| 391 |
$ endif |
| 392 |
$ endif |
| 393 |
$! |
| 394 |
$ if (.not. LINK_ONLY) |
| 395 |
$ then |
| 396 |
$! |
| 397 |
$! Arrange to get arch-specific list file placement, if LISTING, and if |
| 398 |
$! the user didn't specify a particular "/LIST =" destination. |
| 399 |
$! |
| 400 |
$ L = f$edit( LISTING, "COLLAPSE") |
| 401 |
$ if ((f$extract( 0, 5, L) .eqs. "/LIST") .and. - |
| 402 |
(f$extract( 4, 1, L) .nes. "=")) |
| 403 |
$ then |
| 404 |
$ LISTING = " /LIST = [.''dest']"+ f$extract( 5, 1000, LISTING) |
| 405 |
$ endif |
| 406 |
$! |
| 407 |
$! Define compiler command. |
| 408 |
$! |
| 409 |
$ cc = cc+ " /include = (''cc_incl')"+ LISTING+ CCOPTS |
| 410 |
$! |
| 411 |
$ endif |
| 412 |
$! |
| 413 |
$! Define linker command. |
| 414 |
$! |
| 415 |
$ link = "link ''LINKOPTS'" |
| 416 |
$! |
| 417 |
$! Make a VAXCRTL options file for GNU C or VAC C, if needed. |
| 418 |
$! |
| 419 |
$ if ((opts .nes. "") .and. - |
| 420 |
(f$locate( "VAXCSHR", f$edit( opts, "UPCASE")) .lt. f$length( opts)) .and. - |
| 421 |
(f$search( "[.''dest']VAXCSHR.OPT") .eqs. "")) |
| 422 |
$ then |
| 423 |
$ open /write opt_file_ln [.'dest']VAXCSHR.OPT |
| 424 |
$ write opt_file_ln "SYS$SHARE:VAXCRTL.EXE /SHARE" |
| 425 |
$ close opt_file_ln |
| 426 |
$ endif |
| 427 |
$! |
| 428 |
$! Show interesting facts. |
| 429 |
$! |
| 430 |
$ say " architecture = ''arch' (destination = [.''dest'])" |
| 431 |
$ if (.not. LINK_ONLY) |
| 432 |
$ then |
| 433 |
$ say " cc = ''cc'" |
| 434 |
$ endif |
| 435 |
$ say " link = ''link'" |
| 436 |
$ if (.not. MAKE_HELP) |
| 437 |
$ then |
| 438 |
$ say " Not making new help files." |
| 439 |
$ endif |
| 440 |
$ say "" |
| 441 |
$ if (.not. MAKE_MSG) |
| 442 |
$ then |
| 443 |
$ say " Not making new message files." |
| 444 |
$ endif |
| 445 |
$ say "" |
| 446 |
$! |
| 447 |
$ tmp = f$verify( 1) ! Turn echo on to see what's happening. |
| 448 |
$! |
| 449 |
$!-------------------------------- Zip section ------------------------------- |
| 450 |
$! |
| 451 |
$ if (.not. LINK_ONLY) |
| 452 |
$ then |
| 453 |
$! |
| 454 |
$! Process the help file, if desired. |
| 455 |
$! |
| 456 |
$ if (MAKE_HELP) |
| 457 |
$ then |
| 458 |
$ runoff /out = ZIP.HLP [.VMS]VMS_ZIP.RNH |
| 459 |
$ endif |
| 460 |
$! |
| 461 |
$! Process the message file, if desired. |
| 462 |
$! |
| 463 |
$ if (MAKE_MSG) |
| 464 |
$ then |
| 465 |
$! |
| 466 |
$! Create the message source file first, if it's not found. |
| 467 |
$! |
| 468 |
$ if (f$search( "[.VMS]ZIP_MSG.MSG") .eqs. "") |
| 469 |
$ then |
| 470 |
$ cc /include = [] /object = [.'dest']VMS_MSG_GEN.OBJ - |
| 471 |
[.VMS]VMS_MSG_GEN.C |
| 472 |
$ link /executable = [.'dest']VMS_MSG_GEN.EXE - |
| 473 |
[.'dest']VMS_MSG_GEN.OBJ |
| 474 |
$ create /fdl = [.VMS]STREAM_LF.FDL [.VMS]ZIP_MSG.MSG |
| 475 |
$ define /user_mode sys$output [.VMS]ZIP_MSG.MSG |
| 476 |
$ run [.'dest']VMS_MSG_GEN.EXE |
| 477 |
$ purge [.VMS]ZIP_MSG.MSG |
| 478 |
$ delete [.'dest']VMS_MSG_GEN.EXE;*, - |
| 479 |
[.'dest']VMS_MSG_GEN.OBJ;* |
| 480 |
$ endif |
| 481 |
$! |
| 482 |
$ message /object = [.'dest']ZIP_MSG.OBJ /nosymbols - |
| 483 |
[.VMS]ZIP_MSG.MSG |
| 484 |
$ link /shareable = [.'dest']ZIP_MSG.EXE [.'dest']ZIP_MSG.OBJ |
| 485 |
$ endif |
| 486 |
$! |
| 487 |
$! Compile the sources. |
| 488 |
$! |
| 489 |
$ cc 'DEF_UNX' /object = [.'dest']ZIP.OBJ ZIP.C |
| 490 |
$ cc 'DEF_UNX' /object = [.'dest']CRC32.OBJ CRC32.C |
| 491 |
$ cc 'DEF_UNX' /object = [.'dest']CRYPT.OBJ CRYPT.C |
| 492 |
$ cc 'DEF_UNX' /object = [.'dest']DEFLATE.OBJ DEFLATE.C |
| 493 |
$ cc 'DEF_UNX' /object = [.'dest']FILEIO.OBJ FILEIO.C |
| 494 |
$ cc 'DEF_UNX' /object = [.'dest']GLOBALS.OBJ GLOBALS.C |
| 495 |
$ cc 'DEF_UNX' /object = [.'dest']TREES.OBJ TREES.C |
| 496 |
$ cc 'DEF_UNX' /object = [.'dest']TTYIO.OBJ TTYIO.C |
| 497 |
$ cc 'DEF_UNX' /object = [.'dest']UTIL.OBJ UTIL.C |
| 498 |
$ cc 'DEF_UNX' /object = [.'dest']ZBZ2ERR.OBJ ZBZ2ERR.C |
| 499 |
$ cc 'DEF_UNX' /object = [.'dest']ZIPFILE.OBJ ZIPFILE.C |
| 500 |
$ cc 'DEF_UNX' /object = [.'dest']ZIPUP.OBJ ZIPUP.C |
| 501 |
$ cc /include = [] 'DEF_UNX' /object = [.'dest']VMS.OBJ - |
| 502 |
[.VMS]VMS.C |
| 503 |
$ cc /include = [] 'DEF_UNX' /object = [.'dest']VMSMUNCH.OBJ - |
| 504 |
[.VMS]VMSMUNCH.C |
| 505 |
$ cc /include = [] 'DEF_UNX' /object = [.'dest']VMSZIP.OBJ - |
| 506 |
[.VMS]VMSZIP.C |
| 507 |
$! |
| 508 |
$! Create the object library. |
| 509 |
$! |
| 510 |
$ if (f$search( "[.''dest']ZIP.OLB") .eqs. "") then - |
| 511 |
libr /object /create [.'dest']ZIP.OLB |
| 512 |
$! |
| 513 |
$ libr /object /replace [.'dest']ZIP.OLB - |
| 514 |
[.'dest']CRC32.OBJ, - |
| 515 |
[.'dest']CRYPT.OBJ, - |
| 516 |
[.'dest']DEFLATE.OBJ, - |
| 517 |
[.'dest']FILEIO.OBJ, - |
| 518 |
[.'dest']GLOBALS.OBJ, - |
| 519 |
[.'dest']TREES.OBJ, - |
| 520 |
[.'dest']TTYIO.OBJ, - |
| 521 |
[.'dest']UTIL.OBJ, - |
| 522 |
[.'dest']ZBZ2ERR.OBJ, - |
| 523 |
[.'dest']ZIPFILE.OBJ, - |
| 524 |
[.'dest']ZIPUP.OBJ, - |
| 525 |
[.'dest']VMS.OBJ, - |
| 526 |
[.'dest']VMSMUNCH.OBJ, - |
| 527 |
[.'dest']VMSZIP.OBJ |
| 528 |
$! |
| 529 |
$ endif |
| 530 |
$! |
| 531 |
$! Link the executable. |
| 532 |
$! |
| 533 |
$ link /executable = [.'dest']'ZIPX_UNX'.EXE - |
| 534 |
[.'dest']ZIP.OBJ, - |
| 535 |
[.'dest']ZIP.OLB /include = (GLOBALS 'incl_bzip2_m') /library, - |
| 536 |
'lib_bzip2_opts' - |
| 537 |
'opts' - |
| 538 |
SYS$DISK:[.VMS]ZIP.OPT /options |
| 539 |
$! |
| 540 |
$!------------------------ Zip (CLI interface) section ----------------------- |
| 541 |
$! |
| 542 |
$ if (.not. LINK_ONLY) |
| 543 |
$ then |
| 544 |
$! |
| 545 |
$! Process the CLI help file, if desired. |
| 546 |
$! |
| 547 |
$ if (MAKE_HELP) |
| 548 |
$ then |
| 549 |
$ set default [.VMS] |
| 550 |
$ edit /tpu /nosection /nodisplay /command = cvthelp.tpu - |
| 551 |
zip_cli.help |
| 552 |
$ set default [-] |
| 553 |
$ runoff /output = ZIP_CLI.HLP [.VMS]ZIP_CLI.RNH |
| 554 |
$ endif |
| 555 |
$! |
| 556 |
$! Compile the CLI sources. |
| 557 |
$! |
| 558 |
$ cc 'DEF_CLI' /object = [.'dest']ZIPCLI.OBJ ZIP.C |
| 559 |
$ cc /include = [] 'DEF_CLI' /object = [.'dest']CMDLINE.OBJ - |
| 560 |
[.VMS]CMDLINE.C |
| 561 |
$! |
| 562 |
$! Create the command definition object file. |
| 563 |
$! |
| 564 |
$ set command /object = [.'dest']ZIP_CLI.OBJ [.VMS]ZIP_CLI.CLD |
| 565 |
$! |
| 566 |
$! Create the CLI object library. |
| 567 |
$! |
| 568 |
$ if (f$search( "[.''dest']ZIPCLI.OLB") .eqs. "") then - |
| 569 |
libr /object /create [.'dest']ZIPCLI.OLB |
| 570 |
$! |
| 571 |
$ libr /object /replace [.'dest']ZIPCLI.OLB - |
| 572 |
[.'dest']ZIPCLI.OBJ, - |
| 573 |
[.'dest']CMDLINE.OBJ, - |
| 574 |
[.'dest']ZIP_CLI.OBJ |
| 575 |
$! |
| 576 |
$ endif |
| 577 |
$! |
| 578 |
$! Link the CLI executable. |
| 579 |
$! |
| 580 |
$ link /executable = [.'dest']'ZIPX_CLI'.EXE - |
| 581 |
[.'dest']ZIPCLI.OBJ, - |
| 582 |
[.'dest']ZIPCLI.OLB /library, - |
| 583 |
[.'dest']ZIP.OLB /include = (GLOBALS 'incl_bzip2_m') /library, - |
| 584 |
'lib_bzip2_opts' - |
| 585 |
'opts' - |
| 586 |
SYS$DISK:[.VMS]ZIP.OPT /options |
| 587 |
$! |
| 588 |
$!--------------------------- Zip utilities section -------------------------- |
| 589 |
$! |
| 590 |
$ if (.not. LINK_ONLY) |
| 591 |
$ then |
| 592 |
$! |
| 593 |
$! Compile the variant Zip utilities library sources. |
| 594 |
$! |
| 595 |
$ cc 'DEF_UTIL' /object = [.'dest']CRC32_.OBJ CRC32.C |
| 596 |
$ cc 'DEF_UTIL' /object = [.'dest']CRYPT_.OBJ CRYPT.C |
| 597 |
$ cc 'DEF_UTIL' /object = [.'dest']FILEIO_.OBJ FILEIO.C |
| 598 |
$ cc 'DEF_UTIL' /object = [.'dest']UTIL_.OBJ UTIL.C |
| 599 |
$ cc 'DEF_UTIL' /object = [.'dest']ZIPFILE_.OBJ ZIPFILE.C |
| 600 |
$ cc 'DEF_UTIL' /include = [] /object = [.'dest']VMS_.OBJ [.VMS]VMS.C |
| 601 |
$! |
| 602 |
$! Create the Zip utilities object library. |
| 603 |
$! |
| 604 |
$ if f$search( "[.''dest']ZIPUTILS.OLB") .eqs. "" then - |
| 605 |
libr /object /create [.'dest']ZIPUTILS.OLB |
| 606 |
$! |
| 607 |
$ libr /object /replace [.'dest']ZIPUTILS.OLB - |
| 608 |
[.'dest']CRC32_.OBJ, - |
| 609 |
[.'dest']CRYPT_.OBJ, - |
| 610 |
[.'dest']FILEIO_.OBJ, - |
| 611 |
[.'dest']GLOBALS.OBJ, - |
| 612 |
[.'dest']TTYIO.OBJ, - |
| 613 |
[.'dest']UTIL_.OBJ, - |
| 614 |
[.'dest']ZIPFILE_.OBJ, - |
| 615 |
[.'dest']VMS_.OBJ, - |
| 616 |
[.'dest']VMSMUNCH.OBJ |
| 617 |
$! |
| 618 |
$! Compile the Zip utilities main program sources. |
| 619 |
$! |
| 620 |
$ cc 'DEF_UTIL' /object = [.'dest']ZIPCLOAK.OBJ ZIPCLOAK.C |
| 621 |
$ cc 'DEF_UTIL' /object = [.'dest']ZIPNOTE.OBJ ZIPNOTE.C |
| 622 |
$ cc 'DEF_UTIL' /object = [.'dest']ZIPSPLIT.OBJ ZIPSPLIT.C |
| 623 |
$! |
| 624 |
$ endif |
| 625 |
$! |
| 626 |
$! Link the Zip utilities executables. |
| 627 |
$! |
| 628 |
$ link /executable = [.'dest']ZIPCLOAK.EXE - |
| 629 |
[.'dest']ZIPCLOAK.OBJ, - |
| 630 |
[.'dest']ZIPUTILS.OLB /include = (GLOBALS) /library, - |
| 631 |
'opts' - |
| 632 |
SYS$DISK:[.VMS]ZIP.OPT /options |
| 633 |
$! |
| 634 |
$ link /executable = [.'dest']ZIPNOTE.EXE - |
| 635 |
[.'dest']ZIPNOTE.OBJ, - |
| 636 |
[.'dest']ZIPUTILS.OLB /include = (GLOBALS) /library, - |
| 637 |
'opts' - |
| 638 |
SYS$DISK:[.VMS]ZIP.OPT /OPTIONS |
| 639 |
$! |
| 640 |
$ LINK /EXECUTABLE = [.'DEST']ZIPSPLIT.EXE - |
| 641 |
[.'DEST']ZIPSPLIT.OBJ, - |
| 642 |
[.'DEST']ZIPUTILS.OLB /INCLUDE = (globals) /LIBRARY, - |
| 643 |
'opts' - |
| 644 |
SYS$DISK:[.VMS]ZIP.OPT /options |
| 645 |
$! |
| 646 |
$!----------------------- Logical name removal section ----------------------- |
| 647 |
$! |
| 648 |
$ if (IZ_BZIP2 .nes. "") |
| 649 |
$ then |
| 650 |
$ if (f$trnlnm( "incl_bzip2", "LNM$PROCESS_TABLE") .nes. "") |
| 651 |
$ then |
| 652 |
$ deassign incl_bzip2 |
| 653 |
$ endif |
| 654 |
$ if (f$trnlnm( "lib_bzip2", "LNM$PROCESS_TABLE") .nes. "") |
| 655 |
$ then |
| 656 |
$ deassign lib_bzip2 |
| 657 |
$ endif |
| 658 |
$ endif |
| 659 |
$! |
| 660 |
$!------------------------------ Symbols section ----------------------------- |
| 661 |
$! |
| 662 |
$ there = here- "]"+ ".''dest']" |
| 663 |
$! |
| 664 |
$! Define the foreign command symbols. Similar commands may be useful |
| 665 |
$! in SYS$MANAGER:SYLOGIN.COM and/or users' LOGIN.COM. |
| 666 |
$! |
| 667 |
$ zip == "$''there'''ZIPEXEC'.exe" |
| 668 |
$ zipcloak == "$''there'zipcloak.exe" |
| 669 |
$ zipnote == "$''there'zipnote.exe" |
| 670 |
$ zipsplit == "$''there'zipsplit.exe" |
| 671 |
$! |
| 672 |
$! Restore the original default directory and DCL verify status. |
| 673 |
$! |
| 674 |
$ error: |
| 675 |
$! |
| 676 |
$ if (f$type( here) .nes. "") |
| 677 |
$ then |
| 678 |
$ if (here .nes. "") |
| 679 |
$ then |
| 680 |
$ set default 'here' |
| 681 |
$ endif |
| 682 |
$ endif |
| 683 |
$! |
| 684 |
$ if (f$type( OLD_VERIFY) .nes. "") |
| 685 |
$ then |
| 686 |
$ tmp = f$verify( OLD_VERIFY) |
| 687 |
$ endif |
| 688 |
$! |
| 689 |
$ exit |
| 690 |
$! |