home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 9 Archive / 09-Archive.zip / unzip531.zip / vms / make_unz.com < prev    next >
Text File  |  1997-05-01  |  8KB  |  224 lines

  1. $ ! MAKE_UNZ.COM
  2. $ !
  3. $ !    "Makefile" for VMS versions of UnZip/ZipInfo and UnZipSFX
  4. $ !
  5. $ !    last revised:  1 May 1997
  6. $ !
  7. $ !    To define additional options, define the global symbol
  8. $ !    LOCAL_UNZIP prior to executing MAKE_UNZ.COM:
  9. $ !
  10. $ !        $ LOCAL_UNZIP == "VMSCLI,RETURN_CODES,"
  11. $ !        $ @MAKE_UNZ
  12. $ !
  13. $ !    The trailing "," may be omitted.  Valid VMS-specific options
  14. $ !    include VMSCLI, VMSWILD and RETURN_CODES; see the INSTALL file
  15. $ !    for other options (e.g., CHECK_VERSIONS).
  16. $ !
  17. $ !
  18. $ on error then goto error
  19. $ on control_y then goto error
  20. $ OLD_VERIFY = f$verify (0)
  21. $!
  22. $ say := write sys$output
  23. $!##################### Customizing section #############################
  24. $!
  25. $ MAY_USE_DECC = 1
  26. $ MAY_USE_GNUC = 0
  27. $!
  28. $! Process command line parameters requesting optional features:
  29. $ arg_cnt = 1
  30. $ argloop:
  31. $  current_arg_name = "P''arg_cnt'"
  32. $  curr_arg = f$edit('current_arg_name',"UPCASE")
  33. $  IF curr_arg .eqs. "" THEN GOTO argloop_out
  34. $  IF curr_arg .eqs. "VAXC"
  35. $  THEN MAY_USE_DECC = 0
  36. $    MAY_USE_GNUC = 0
  37. $  ENDIF
  38. $  IF curr_arg .eqs. "DECC"
  39. $  THEN MAY_USE_DECC = 1
  40. $    MAY_USE_GNUC = 0
  41. $  ENDIF
  42. $  IF curr_arg .eqs. "GNUC"
  43. $  THEN MAY_USE_DECC = 0
  44. $    MAY_USE_GNUC = 1
  45. $  ENDIF
  46. $  arg_cnt = arg_cnt + 1
  47. $ GOTO argloop
  48. $ argloop_out:
  49. $!
  50. $!#######################################################################
  51. $!
  52. $ ! Find out current disk, directory, compiler and options
  53. $ !
  54. $ my_name = f$env("procedure")
  55. $ workdir = f$env("default")
  56. $ here = f$parse(workdir,,,"device") + f$parse(workdir,,,"directory")
  57. $ if f$type(LOCAL_UNZIP).eqs.""
  58. $ then
  59. $    local_unzip = ""
  60. $ else    ! Trim blanks and append comma if missing
  61. $    local_unzip = f$edit(local_unzip, "TRIM")
  62. $    if f$extract(f$length(local_unzip)-1, 1, local_unzip).nes."," then -
  63.         local_unzip = local_unzip + ","
  64. $ endif
  65. $ axp = f$getsyi("HW_MODEL").ge.1024
  66. $ if axp
  67. $ then
  68. $    ! Alpha AXP
  69. $    ARCH_NAME == "Alpha"
  70. $    ARCH_PREF = "AXP_"
  71. $    HAVE_DECC_VAX = 0
  72. $    USE_DECC_VAX = 0
  73. $       if MAY_USE_GNUC
  74. $    then say "GNU C has not yet been ported to OpenVMS AXP."
  75. $         say "You must use DEC C to build Zip."
  76. $         goto error
  77. $    endif
  78. $    ARCH_CC_P = ARCH_PREF
  79. $    cc = "cc/standard=vaxc/prefix=all/ansi"
  80. $    defs = "''local_unzip'MODERN"
  81. $    opts = ""
  82. $    say "Compiling on AXP using DEC C"
  83. $ else
  84. $    ! VAX
  85. $    ARCH_NAME == "VAX"
  86. $    ARCH_PREF = "VAX_"
  87. $    HAVE_DECC_VAX = (f$search("SYS$SYSTEM:DECC$COMPILER.EXE").nes."")
  88. $    HAVE_VAXC_VAX = (f$search("SYS$SYSTEM:VAXC.EXE").nes."")
  89. $    MAY_HAVE_GNUC = (f$trnlnm("GNU_CC").nes."")
  90. $    IF HAVE_DECC_VAX .AND. MAY_USE_DECC
  91. $    THEN
  92. $!      We use DECC:
  93. $      USE_DECC_VAX = 1
  94. $      cc = "cc/decc/standard=vaxc/prefix=all"
  95. $      ARCH_CC_P = "''ARCH_PREF'DECC_"
  96. $      defs = "''local_unzip'MODERN"
  97. $      opts = ""
  98. $      say "Compiling on VAX using DEC C"
  99. $       ELSE
  100. $!      We use VAXC (or GNU C):
  101. $      USE_DECC_VAX = 0
  102. $      defs = "''local_unzip'VMS"
  103. $      opts = ",[.VMS]VAXCSHR.OPT/OPTIONS"
  104. $      if (.not.HAVE_VAXC_VAX .and. MAY_HAVE_GNUC) .or. (MAY_USE_GNUC)
  105. $      then
  106. $        ARCH_CC_P = "''ARCH_PREF'GNUC_"
  107. $        cc = "gcc"
  108. $        opts = ",GNU_CC:[000000]GCCLIB.OLB/LIB ''opts'"
  109. $        say "Compiling on VAX using GNU C"
  110. $      else
  111. $        ARCH_CC_P = "''ARCH_PREF'VAXC_"
  112. $        if HAVE_DECC_VAX
  113. $        then
  114. $              cc = "cc/vaxc"
  115. $        else
  116. $            cc = "cc"
  117. $        endif
  118. $        say "Compiling on VAX using VAX C"
  119. $      endif
  120. $    ENDIF
  121. $ endif
  122. $ def = "/define=(''defs')"
  123. $ LFLAGS = "/notrace"
  124. $ if (opts .nes. "") .and. (f$search("[.vms]vaxcshr.opt") .eqs. "")
  125. $ then    create [.vms]vaxcshr.opt
  126. $    open/append tmp [.vms]vaxcshr.opt
  127. $    write tmp "SYS$SHARE:VAXCRTL.EXE/SHARE"
  128. $    close tmp
  129. $ endif
  130. $ !
  131. $ ! Currently, the following section is not needed, as vms.c does no longer
  132. $ ! include any of the headers from SYS$LIB_C.TLB.
  133. $ ! The commented section is solely maintained for reference.
  134. $ ! In case system headers from SYS$LIB_C.TLB are needed again,
  135. $ ! just append "'c'" to the respective source file specification.
  136. $! x = f$search("SYS$LIBRARY:SYS$LIB_C.TLB")
  137. $! if x .nes. "" then x = "+" + x
  138. $ !
  139. $ tmp = f$ver(1)    ! Turn echo on to see what's happening
  140. $ !
  141. $ cc/NOLIST'DEF' /OBJ=unzip.'ARCH_CC_P'obj unzip.c
  142. $ cc/NOLIST'DEF' /OBJ=crc32.'ARCH_CC_P'obj crc32.c
  143. $ cc/NOLIST'DEF' /OBJ=crctab.'ARCH_CC_P'obj crctab.c
  144. $ cc/NOLIST'DEF' /OBJ=crypt.'ARCH_CC_P'obj crypt.c
  145. $ cc/NOLIST'DEF' /OBJ=envargs.'ARCH_CC_P'obj envargs.c
  146. $ cc/NOLIST'DEF' /OBJ=explode.'ARCH_CC_P'obj explode.c
  147. $ cc/NOLIST'DEF' /OBJ=extract.'ARCH_CC_P'obj extract.c
  148. $ cc/NOLIST'DEF' /OBJ=fileio.'ARCH_CC_P'obj fileio.c
  149. $ cc/NOLIST'DEF' /OBJ=globals.'ARCH_CC_P'obj globals.c
  150. $ cc/NOLIST'DEF' /OBJ=inflate.'ARCH_CC_P'obj inflate.c
  151. $ cc/NOLIST'DEF' /OBJ=list.'ARCH_CC_P'obj list.c
  152. $ cc/NOLIST'DEF' /OBJ=match.'ARCH_CC_P'obj match.c
  153. $ cc/NOLIST'DEF' /OBJ=process.'ARCH_CC_P'obj process.c
  154. $ cc/NOLIST'DEF' /OBJ=ttyio.'ARCH_CC_P'obj ttyio.c
  155. $ cc/NOLIST'DEF' /OBJ=unreduce.'ARCH_CC_P'obj unreduce.c
  156. $ cc/NOLIST'DEF' /OBJ=unshrink.'ARCH_CC_P'obj unshrink.c
  157. $ cc/NOLIST'DEF' /OBJ=zipinfo.'ARCH_CC_P'obj zipinfo.c
  158. $ cc/INCLUDE=SYS$DISK:[]'DEF' /OBJ=vms.'ARCH_CC_P'obj; [.vms]vms.c
  159. $ !
  160. $ if f$locate("VMSCLI",local_unzip).ne.f$length(local_unzip)
  161. $ then
  162. $    cc/INCLUDE=SYS$DISK:[]'DEF' /OBJ=cmdline.'ARCH_CC_P'obj; -
  163.         [.vms]cmdline.c
  164. $    cc/INCLUDE=SYS$DISK:[]/DEF=('DEFS',SFX) -
  165.         /OBJ=cmdline_.'ARCH_CC_P'obj; -
  166.         [.vms]cmdline.c
  167. $    set command/obj=unz_cli.'ARCH_CC_P'obj [.vms]unz_cli.cld
  168. $    cliobjs = ",cmdline.'ARCH_CC_P'obj, unz_cli.'ARCH_CC_P'obj"
  169. $    cliobjx = ",cmdline_.'ARCH_CC_P'obj, unz_cli.'ARCH_CC_P'obj"
  170. $    set default [.vms]
  171. $    edit := edit    ! avoids problems with non-standard "edit" definitions
  172. $    edit/tpu/nosection/nodisplay/command=cvthelp.tpu unzip_cli.help
  173. $    set default [-]
  174. $    runoff/out=unzip.hlp [.vms]unzip_cli.rnh
  175. $ else
  176. $    cliobjs = ""
  177. $    cliobjx = ""
  178. $    runoff/out=unzip.hlp [.vms]unzip_def.rnh
  179. $ endif
  180. $ !
  181. $ IF F$SEARCH("unzip.''ARCH_CC_P'olb") .EQS. "" THEN -
  182.     lib/obj/create unzip.'ARCH_CC_P'olb
  183. $ lib/obj/replace unzip.'ARCH_CC_P'olb -
  184.     unzip.'ARCH_CC_P'obj;, crc32.'ARCH_CC_P'obj;, -
  185.     crctab.'ARCH_CC_P'obj;, crypt.'ARCH_CC_P'obj;, -
  186.     envargs.'ARCH_CC_P'obj;, explode.'ARCH_CC_P'obj;, -
  187.     extract.'ARCH_CC_P'obj;, fileio.'ARCH_CC_P'obj;, -
  188.     globals.'ARCH_CC_P'obj;, inflate.'ARCH_CC_P'obj;, -
  189.     list.'ARCH_CC_P'obj;, match.'ARCH_CC_P'obj;, -
  190.     process.'ARCH_CC_P'obj;, ttyio.'ARCH_CC_P'obj;, -
  191.     unreduce.'ARCH_CC_P'obj;, unshrink.'ARCH_CC_P'obj;, -
  192.     zipinfo.'ARCH_CC_P'obj;, vms.'ARCH_CC_P'obj; 'cliobjs'
  193. $ link'LFLAGS'/exe=unzip.'ARCH_CC_P'exe -
  194.     unzip.'ARCH_CC_P'olb;/incl=(unzip)/lib -
  195.     'opts', [.VMS]unzip.opt/opt
  196. $ !
  197. $ cc/DEF=('DEFS',SFX)/NOLIST /OBJ=unzipsfx.'ARCH_CC_P'obj unzip.c
  198. $ cc/DEF=('DEFS',SFX)/NOLIST /OBJ=extract_.'ARCH_CC_P'obj extract.c
  199. $ cc/DEF=('DEFS',SFX)/NOLIST /OBJ=process_.'ARCH_CC_P'obj process.c
  200. $ cc/DEF=('DEFS',SFX)/INCLUDE=SYS$DISK:[] /OBJ=vms_.'ARCH_CC_P'obj; -
  201.     [.vms]vms.c
  202. $ IF F$SEARCH("unzipsfx.''ARCH_CC_P'olb") .EQS. "" THEN -
  203.     lib/obj/create unzipsfx.'ARCH_CC_P'olb
  204. $ lib/obj/replace unzipsfx.'ARCH_CC_P'olb -
  205.     unzipsfx.'ARCH_CC_P'obj, crc32.'ARCH_CC_P'obj, -
  206.     crctab.'ARCH_CC_P'obj, crypt.'ARCH_CC_P'obj, -
  207.     extract_.'ARCH_CC_P'obj, fileio.'ARCH_CC_P'obj, -
  208.     globals.'ARCH_CC_P'obj, inflate.'ARCH_CC_P'obj, -
  209.     match.'ARCH_CC_P'obj, process_.'ARCH_CC_P'obj, -
  210.     ttyio.'ARCH_CC_P'obj, vms_.'ARCH_CC_P'obj 'cliobjx'
  211. $ link'LFLAGS'/exe=unzipsfx.'ARCH_CC_P'exe -
  212.     unzipsfx.'ARCH_CC_P'olb;/lib/incl=unzip -
  213.     'opts', [.VMS]unzipsfx.opt/opt
  214. $ !
  215. $ ! Next line:  put similar lines (full pathname for unzip.'ARCH_CC_P'exe) in
  216. $ ! login.com.  Remember to include the leading "$" before disk name.
  217. $ !
  218. $! unzip == "$''here'unzip.'ARCH_CC_P'exe"    ! command symbol for unzip
  219. $! zipinfo == "$''here'unzip.'ARCH_CC_P'exe ""-Z"""    ! command symbol for zipinfo
  220. $ !
  221. $error:
  222. $ tmp = f$ver(old_verify)
  223. $ exit
  224.