home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 9 Archive / 09-Archive.zip / unzip531.zip / vms / link_unz.com < prev    next >
Text File  |  1995-10-10  |  4KB  |  127 lines

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