home *** CD-ROM | disk | FTP | other *** search
/ vsiftp.vmssoftware.com / VSIPUBLIC@vsiftp.vmssoftware.com.tar / FREEWARE / FREEWARE40.ZIP / pp / build_pp.com next >
Text File  |  1998-08-12  |  3KB  |  82 lines

  1. $!------------------------------------------------------------------------------
  2. $!  Compile and/or link PP under VAX or Alpha.
  3. $!
  4. $!  Optional P1 parameter value:
  5. $!
  6. $!    None    - if P1 is missing, compile and link with NO TRACEBACK.
  7. $!    C    - if "C" is in P1, compile.
  8. $!    L    - if "L" is in P1, link with NO TRACEBACK.
  9. $!    T    - if "T" is in P1, link with TRACEBACK.
  10. $!
  11. $!  If P1 contains both "L" and "T", "T" is used.
  12. $!
  13. $!  Optional P2 parameter value:
  14. $!
  15. $!    None    - if P2 is missing, presume Pascal at particular version
  16. $!          based on architecture (see code below).
  17. $!    N    - if "N" is in P2, use /USAGE=NOPERFORMANCE in the compile.
  18. $!..............................................................................
  19. $!  Author: Jonathan Ridler,
  20. $!        Information Technology Services,
  21. $!        The University of Melbourne,
  22. $!        Parkville, Victoria, AUSTRALIA, 3052.
  23. $!
  24. $!        Internet: jonathan@unimelb.edu.au
  25. $!
  26. $!..............................................................................
  27. $!  PP has been successfully built and tested under OpenVMS VAX v6.2 with
  28. $!  Pascal v5.4, and OpenVMS Alpha v6.2 and v7.1 with Pascal v5.5.
  29. $!------------------------------------------------------------------------------
  30. $
  31. $ on ERROR  then  EXIT
  32. $ say   := write SYS$OUTPUT
  33. $ arch   = f$getsyi ("ARCH_NAME")            ! "VAX" or "Alpha"
  34. $ trace := /notraceback
  35. $
  36. $ p1    = f$edit (p1,"UPCASE,UNCOMMENT,COLLAPSE")
  37. $ p1len = f$length (p1)
  38. $ compile = (p1 .eqs. "") .or. (f$locate (p1,"C") .nes. p1len)
  39. $ linking = (p1 .eqs. "") .or. (f$locate (p1,"L") .nes. p1len) .or. -
  40.                    (f$locate (p1,"T") .nes. p1len)
  41. $
  42. $ p2 = f$edit (p2,"UPCASE,UNCOMMENT,COLLAPSE")
  43. $ perform = f$locate (p2,"N") .nes. f$length (p2)
  44. $
  45. $!  If the Pascal compiler is version 5.3 or later, add ",noperformance" to
  46. $!  the usage_types below.  Presume Pascal version from architecture.  Allow
  47. $!  ",noperformance" to be forced by p2.
  48. $
  49. $ if (arch .eqs. "VAX") .and. .not. perform
  50. $ then
  51. $   usage_types = "all"            ! Assume Pascal <= v5.2 for VAX.
  52. $ else
  53. $   usage_types = "all,noperformance"    ! Assume Pascal >= v5.3 for Alpha.
  54. $ endif
  55. $
  56. $ if compile
  57. $ then
  58. $   say "Compiling PP source ..."
  59. $   pascal pp /usage=('usage_types') /object=pp.obj_'arch'
  60. $ endif
  61. $
  62. $!  Compile each time to ensure the object is correct for the architecture.
  63. $
  64. $ say "Compiling PP CLD ..."
  65. $ set command /object pp_cld
  66. $
  67. $ if linking
  68. $ then
  69. $   if (f$locate (p1,"T") .nes. p1len)  then  trace := /traceback
  70. $   say "Linking PP ..."
  71. $   if arch .eqs. "VAX"
  72. $   then
  73. $     link 'trace' pp.obj_vax,  pp_cld.obj,pp.opt/option
  74. $   else
  75. $     link 'trace' pp.obj_alpha,pp_cld.obj,pp.opt/option
  76. $   endif
  77. $ endif
  78. $
  79. $ if linking  then  say "*** PP built successfully ***"
  80. $
  81. $ EXIT 1
  82.