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

  1. $ ! LINK_ZIP.COM
  2. $ !
  3. $ !    Command procedure to (re)link the VMS versions of
  4. $ !    Zip, ZipCloak, ZipNote, and ZipSplit
  5. $ !
  6. $ !
  7. $ on error then goto error
  8. $ on control_y then goto error
  9. $ OLD_VERIFY = f$verify (0)
  10. $!
  11. $ say := write sys$output
  12. $!##################### Customizing section #############################
  13. $!
  14. $ MAY_USE_DECC = 1
  15. $ MAY_USE_GNUC = 0
  16. $!
  17. $! Process command line parameters requesting optional features:
  18. $ arg_cnt = 1
  19. $ argloop:
  20. $  current_arg_name = "P''arg_cnt'"
  21. $  curr_arg = f$edit('current_arg_name',"UPCASE")
  22. $  IF curr_arg .eqs. "" THEN GOTO argloop_out
  23. $  IF curr_arg .eqs. "VAXC"
  24. $  THEN MAY_USE_DECC = 0
  25. $    MAY_USE_GNUC = 0
  26. $  ENDIF
  27. $  IF curr_arg .eqs. "DECC"
  28. $  THEN MAY_USE_DECC = 1
  29. $    MAY_USE_GNUC = 0
  30. $  ENDIF
  31. $  IF curr_arg .eqs. "GNUC"
  32. $  THEN MAY_USE_DECC = 0
  33. $    MAY_USE_GNUC = 1
  34. $  ENDIF
  35. $  arg_cnt = arg_cnt + 1
  36. $ GOTO argloop
  37. $ argloop_out:
  38. $!
  39. $!#######################################################################
  40. $!
  41. $ ! Find out current disk, directory, compiler and options
  42. $ !
  43. $ my_name = f$env("procedure")
  44. $ workdir = f$env("default")
  45. $ here = f$parse(workdir,,,"device") + f$parse(workdir,,,"directory")
  46. $ if f$type(LOCAL_ZIP).eqs.""
  47. $ then
  48. $    local_zip = ""
  49. $ else    ! Trim blanks and append comma if missing
  50. $    local_zip = f$edit(local_zip, "TRIM")
  51. $    if f$extract(f$length(local_zip)-1, 1, local_zip).nes."," then -
  52.         local_zip = local_zip + ","
  53. $ endif
  54. $ axp = f$getsyi("HW_MODEL").ge.1024
  55. $ if axp
  56. $ then
  57. $    ! Alpha AXP
  58. $    ARCH_NAME == "Alpha"
  59. $    ARCH_PREF = "AXP_"
  60. $    HAVE_DECC_VAX = 0
  61. $    USE_DECC_VAX = 0
  62. $    if MAY_USE_GNUC
  63. $    then say "GNU C has not yet been ported to OpenVMS AXP."
  64. $         say "You must use DEC C to build Zip."
  65. $         goto error
  66. $    endif
  67. $    ARCH_CC_P = ARCH_PREF
  68. $    opts = ""
  69. $    say "Linking on AXP using DECC"
  70. $ else
  71. $    ! VAX
  72. $    ARCH_NAME == "VAX"
  73. $    ARCH_PREF = "VAX_"
  74. $    HAVE_DECC_VAX = (F$TRNLNM("DECC$LIBRARY_INCLUDE") .NES. "")
  75. $    HAVE_VAXC_VAX = (f$search("SYS$SYSTEM:VAXC.EXE").nes."")
  76. $    MAY_HAVE_GNUC = (f$trnlnm("GNU_CC").nes."")
  77. $    IF HAVE_DECC_VAX .AND. MAY_USE_DECC
  78. $    THEN
  79. $!      We use DECC:
  80. $      USE_DECC_VAX = 1
  81. $      ARCH_CC_P = "''ARCH_PREF'DECC_"
  82. $      opts = ""
  83. $      say "Linking on VAX using DECC"
  84. $    ELSE
  85. $!      We use VAXC (or GNU C):
  86. $      USE_DECC_VAX = 0
  87. $      opts = ",[.VMS]VAXCSHR.OPT/OPTIONS"
  88. $      if (.not.HAVE_VAXC_VAX .and. MAY_HAVE_GNUC) .or. (MAY_USE_GNUC)
  89. $      then
  90. $        ARCH_CC_P = "''ARCH_PREF'GNUC_"
  91. $        opts = ",GNU_CC:[000000]GCCLIB.OLB/LIB ''opts'"
  92. $        say "Linking on VAX using GNUC"
  93. $      else
  94. $        ARCH_CC_P = "''ARCH_PREF'VAXC_"
  95. $        say "Linking on VAX using VAXC"
  96. $      endif
  97. $    ENDIF
  98. $ endif
  99. $ LFLAGS = "/notrace"
  100. $ if (opts .nes. "") .and. (f$search("[.vms]vaxcshr.opt") .eqs. "")
  101. $ then    create [.vms]vaxcshr.opt
  102. $    open/append tmp [.vms]vaxcshr.opt
  103. $    write tmp "SYS$SHARE:VAXCRTL.EXE/SHARE"
  104. $    close tmp
  105. $ endif
  106. $ set verify    ! like "echo on", eh?
  107. $ !
  108. $ !------------------------------- Zip section --------------------------------
  109. $ !
  110. $ link'LFLAGS'/exe=zip.'ARCH_CC_P'exe -
  111.     zip.'ARCH_CC_P'olb;/incl=(zip,globals)/lib 'opts'
  112. $ !
  113. $ !-------------------------- Zip utilities section ---------------------------
  114. $ !
  115. $ link'LFLAGS'/exe=zipcloak.'ARCH_CC_P'exe zipcloak.'ARCH_CC_P'obj, -
  116.     ziputils.'ARCH_CC_P'olb;/incl=(globals)/lib 'opts'
  117. $ link'LFLAGS'/exe=zipnote.'ARCH_CC_P'exe zipnote.'ARCH_CC_P'obj, -
  118.     ziputils.'ARCH_CC_P'olb;/incl=(globals)/lib 'opts'
  119. $ link'LFLAGS'/exe=zipsplit.'ARCH_CC_P'exe zipsplit.'ARCH_CC_P'obj, -
  120.     ziputils.'ARCH_CC_P'olb;/incl=(globals)/lib 'opts'
  121. $ !
  122. $ !----------------------------- Symbols section ------------------------------
  123. $ !
  124. $ ! Set up symbols for the various executables.  Edit the example below,
  125. $ ! changing "disk:[directory]" as appropriate.
  126. $ !
  127. $ zip           == "$''here'zip.''ARCH_CC_P'exe"
  128. $ zipcloak      == "$''here'zipcloak.''ARCH_CC_P'exe"
  129. $ zipnote       == "$''here'zipnote.''ARCH_CC_P'exe"
  130. $ zipsplit      == "$''here'zipsplit.''ARCH_CC_P'exe"
  131. $ !
  132. $error:
  133. $ dummy = f$verify (old_verify)
  134. $ exit
  135.