home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 9 Archive / 09-Archive.zip / zip21.zip / vms / make_zip.com < prev    next >
Text File  |  1996-04-01  |  7KB  |  202 lines

  1. $ ! MAKE_ZIP.COM
  2. $ !
  3. $ !    "Makefile" for VMS versions of Zip, ZipCloak, ZipNote,
  4. $ !    and ZipSplit (stolen from Unzip)
  5. $ !
  6. $ !    To define additional options, define the global symbol
  7. $ !    LOCAL_ZIP prior to executing MAKE_ZIP.COM:
  8. $ !
  9. $ !        $ LOCAL_ZIP == "VMSCLI,VMS_PK_EXTRA,"
  10. $ !        $ @MAKE_ZIP
  11. $ !
  12. $ !    The trailing "," may be omitted.  Valid VMS-specific options
  13. $ !    include VMSCLI, VMS_PK_EXTRA and VMS_IM_EXTRA; see the INSTALL file
  14. $ !    for other options.
  15. $ !
  16. $ !
  17. $ on error then goto error
  18. $ on control_y then goto error
  19. $ OLD_VERIFY = f$verify (0)
  20. $!
  21. $ say := write sys$output
  22. $!##################### Customizing section #############################
  23. $!
  24. $ MAY_USE_DECC = 1
  25. $ MAY_USE_GNUC = 0
  26. $!
  27. $! Process command line parameters requesting optional features:
  28. $ arg_cnt = 1
  29. $ argloop:
  30. $  current_arg_name = "P''arg_cnt'"
  31. $  curr_arg = f$edit('current_arg_name',"UPCASE")
  32. $  IF curr_arg .eqs. "" THEN GOTO argloop_out
  33. $  IF curr_arg .eqs. "VAXC"
  34. $  THEN MAY_USE_DECC = 0
  35. $    MAY_USE_GNUC = 0
  36. $  ENDIF
  37. $  IF curr_arg .eqs. "DECC"
  38. $  THEN MAY_USE_DECC = 1
  39. $    MAY_USE_GNUC = 0
  40. $  ENDIF
  41. $  IF curr_arg .eqs. "GNUC"
  42. $  THEN MAY_USE_DECC = 0
  43. $    MAY_USE_GNUC = 1
  44. $  ENDIF
  45. $  arg_cnt = arg_cnt + 1
  46. $ GOTO argloop
  47. $ argloop_out:
  48. $!
  49. $!#######################################################################
  50. $!
  51. $ ! Find out current disk, directory, compiler and options
  52. $ !
  53. $ my_name = f$env("procedure")
  54. $ workdir = f$env("default")
  55. $ here = f$parse(workdir,,,"device") + f$parse(workdir,,,"directory")
  56. $ if f$type(LOCAL_ZIP).eqs.""
  57. $ then
  58. $    local_zip = ""
  59. $ else    ! Trim blanks and append comma if missing
  60. $    local_zip = f$edit(local_zip, "TRIM")
  61. $    if f$extract(f$length(local_zip)-1, 1, local_zip).nes."," then -
  62.         local_zip = local_zip + ","
  63. $ endif
  64. $ axp = f$getsyi("HW_MODEL").ge.1024
  65. $ if axp
  66. $ then
  67. $    ! Alpha AXP
  68. $    ARCH_NAME == "Alpha"
  69. $    ARCH_PREF = "AXP_"
  70. $    HAVE_DECC_VAX = 0
  71. $    USE_DECC_VAX = 0
  72. $    if MAY_USE_GNUC
  73. $    then say "GNU C has not yet been ported to OpenVMS AXP."
  74. $         say "You must use DEC C to build Zip."
  75. $         goto error
  76. $    endif
  77. $    ARCH_CC_P = ARCH_PREF
  78. $    cc = "cc/standard=relax/prefix=all/ansi"
  79. $    defs = "''local_zip'VMS"
  80. $    opts = ""
  81. $    say "Compiling on AXP using DECC"
  82. $ else
  83. $    ! VAX
  84. $    ARCH_NAME == "VAX"
  85. $    ARCH_PREF = "VAX_"
  86. $    HAVE_DECC_VAX = (F$TRNLNM("DECC$LIBRARY_INCLUDE") .NES. "")
  87. $    HAVE_VAXC_VAX = (f$search("SYS$SYSTEM:VAXC.EXE").nes."")
  88. $    MAY_HAVE_GNUC = (f$trnlnm("GNU_CC").nes."")
  89. $    IF HAVE_DECC_VAX .AND. MAY_USE_DECC
  90. $    THEN
  91. $!      We use DECC:
  92. $      USE_DECC_VAX = 1
  93. $      cc = "cc/decc/standard=vaxc/prefix=all"
  94. $      ARCH_CC_P = "''ARCH_PREF'DECC_"
  95. $      defs = "''local_zip'VMS"
  96. $      opts = ""
  97. $      say "Compiling on VAX using DECC"
  98. $    ELSE
  99. $!      We use VAXC (or GNU C):
  100. $      USE_DECC_VAX = 0
  101. $      defs = "''local_zip'VMS"
  102. $      opts = ",[.VMS]VAXCSHR.OPT/OPTIONS"
  103. $      if (.not.HAVE_VAXC_VAX .and. MAY_HAVE_GNUC) .or. (MAY_USE_GNUC)
  104. $      then
  105. $        ARCH_CC_P = "''ARCH_PREF'GNUC_"
  106. $        cc = "gcc"
  107. $        opts = ",GNU_CC:[000000]GCCLIB.OLB/LIB ''opts'"
  108. $        say "Compiling on VAX using GNUC"
  109. $      else
  110. $        ARCH_CC_P = "''ARCH_PREF'VAXC_"
  111. $        if HAVE_DECC_VAX
  112. $        then
  113. $            cc = "cc/vaxc"
  114. $        else
  115. $            cc = "cc"
  116. $        endif
  117. $        say "Compiling on VAX using VAXC"
  118. $      endif
  119. $    ENDIF
  120. $ endif
  121. $ LFLAGS = "/notrace"
  122. $ if (opts .nes. "") .and. (f$search("[.vms]vaxcshr.opt") .eqs. "")
  123. $ then    create [.vms]vaxcshr.opt
  124. $    open/append tmp [.vms]vaxcshr.opt
  125. $    write tmp "SYS$SHARE:VAXCRTL.EXE/SHARE"
  126. $    close tmp
  127. $ endif
  128. $ set verify    ! like "echo on", eh?
  129. $ !
  130. $ !------------------------------- Zip section --------------------------------
  131. $ !
  132. $ cc/def=('DEFS') /obj=.'ARCH_CC_P'obj zip.c, crc32.c, crctab.c, crypt.c, -
  133.     ttyio.c, zipfile.c, zipup.c, fileio.c, globals.c, util.c
  134. $ cc/def=('DEFS') /obj=.'ARCH_CC_P'obj deflate.c, trees.c, bits.c
  135. $ cc/def=('DEFS') /obj=.'ARCH_CC_P'obj/inc=SYS$DISK:[] -
  136.     [.vms]vms.c, [.vms]vmszip.c, [.vms]VMSmunch.c
  137. $ !
  138. $ if f$locate("VMSCLI",local_zip).ne.f$length(local_zip)
  139. $ then
  140. $    cc/INCLUDE=SYS$DISK:[]'DEF' /OBJ=cmdline.'ARCH_CC_P'obj; -
  141.         [.vms]cmdline.c
  142. $    set command/obj=zip_cli.'ARCH_CC_P'obj [.vms]zip_cli.cld
  143. $    cliobjs = ",cmdline.'ARCH_CC_P'obj, zip_cli.'ARCH_CC_P'obj"
  144. $    set default [.vms]
  145. $    edit/tpu/nosection/nodisplay/command=cvthelp.tpu zip_cli.help
  146. $    set default [-]
  147. $    runoff/out=zip.hlp [.vms]zip_cli.rnh
  148. $ else
  149. $    cliobjs = ""
  150. $    runoff/out=zip.hlp [.vms]vms_zip.rnh
  151. $ endif
  152. $ !
  153. $ if f$search("zip.''ARCH_CC_P'olb") .EQS. "" then -
  154.     lib/obj/create zip.'ARCH_CC_P'olb
  155. $ lib/obj/replace zip.'ARCH_CC_P'olb -
  156.     zip.'ARCH_CC_P'obj;, crc32.'ARCH_CC_P'obj;, crctab.'ARCH_CC_P'obj;, -
  157.     crypt.'ARCH_CC_P'obj;, ttyio.'ARCH_CC_P'obj;, -
  158.     zipfile.'ARCH_CC_P'obj;, zipup.'ARCH_CC_P'obj;, -
  159.     fileio.'ARCH_CC_P'obj;, util.'ARCH_CC_P'obj;, globals.'ARCH_CC_P'obj;,-
  160.     deflate.'ARCH_CC_P'obj;, trees.'ARCH_CC_P'obj;, bits.'ARCH_CC_P'obj;, -
  161.     vms.'ARCH_CC_P'obj;, vmszip.'ARCH_CC_P'obj;, -
  162.     VMSmunch.'ARCH_CC_P'obj; 'cliobjs'
  163. $ link'LFLAGS'/exe=zip.'ARCH_CC_P'exe -
  164.     zip.'ARCH_CC_P'olb;/incl=(zip,globals)/lib 'opts'
  165. $ !
  166. $ !-------------------------- Zip utilities section ---------------------------
  167. $ !
  168. $ cc/def=('DEFS',UTIL) /obj=zipfile_.'ARCH_CC_P'obj zipfile.c
  169. $ cc/def=('DEFS',UTIL) /obj=fileio_.'ARCH_CC_P'obj fileio.c
  170. $ cc/def=('DEFS',UTIL) /obj=util_.'ARCH_CC_P'obj util.c
  171. $ cc/def=('DEFS',UTIL) /obj=crypt_.'ARCH_CC_P'obj crypt.c
  172. $ cc/def=('DEFS',UTIL)/incl=SYS$DISK:[] /obj=vms_.'ARCH_CC_P'obj [.vms]vms.c
  173. $ if f$search("ziputils.''ARCH_CC_P'olb") .EQS. "" then -
  174.     lib/obj/create ziputils.'ARCH_CC_P'olb
  175. $ lib/obj/replace ziputils.'ARCH_CC_P'olb -
  176.     zipfile_.'ARCH_CC_P'obj;, fileio_.'ARCH_CC_P'obj;, -
  177.     util_.'ARCH_CC_P'obj;, globals.'ARCH_CC_P'obj;, -
  178.     crctab.'ARCH_CC_P'obj;, crypt_.'ARCH_CC_P'obj;, ttyio.'ARCH_CC_P'obj;,-
  179.     vms_.'ARCH_CC_P'obj;, VMSmunch.'ARCH_CC_P'obj;
  180. $ cc /def=('DEFS') /obj=.'ARCH_CC_P'obj zipcloak, zipnote, zipsplit
  181. $ link'LFLAGS'/exe=zipcloak.'ARCH_CC_P'exe zipcloak.'ARCH_CC_P'obj, -
  182.     ziputils.'ARCH_CC_P'olb;/incl=(globals)/lib 'opts'
  183. $ link'LFLAGS'/exe=zipnote.'ARCH_CC_P'exe zipnote.'ARCH_CC_P'obj, -
  184.     ziputils.'ARCH_CC_P'olb;/incl=(globals)/lib 'opts'
  185. $ link'LFLAGS'/exe=zipsplit.'ARCH_CC_P'exe zipsplit.'ARCH_CC_P'obj, -
  186.     ziputils.'ARCH_CC_P'olb;/incl=(globals)/lib 'opts'
  187. $ !
  188. $ !----------------------------- Symbols section ------------------------------
  189. $ !
  190. $ ! Set up symbols for the various executables.  Edit the example below,
  191. $ ! changing "disk:[directory]" as appropriate.
  192. $ !
  193. $ zip           == "$''here'zip.''ARCH_CC_P'exe"
  194. $ zipcloak      == "$''here'zipcloak.''ARCH_CC_P'exe"
  195. $ zipnote       == "$''here'zipnote.''ARCH_CC_P'exe"
  196. $ zipsplit      == "$''here'zipsplit.''ARCH_CC_P'exe"
  197. $ !
  198. $error:
  199. $ if here .nes. "" then set default 'here'
  200. $ dummy = f$verify (old_verify)
  201. $ exit
  202.