home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Internet Tools 1995 April / Internet Tools.iso / osi / isode / vmsisode / vmsgcc139_tar.Z / vmsgcc139_tar / gcc_install.com < prev    next >
Encoding:
Text File  |  1991-12-18  |  2.2 KB  |  82 lines

  1. $!
  2. $!    This command procedure makes the necessary definitions for GNU CC
  3. $!    to run.
  4. $!
  5. $! Find the directory spec. for the install procedure
  6. $!
  7. $ Procedure:='f$environment("PROCEDURE")'
  8. $ Device:='f$parse(Procedure,,,"DEVICE","NO_CONCEAL")'
  9. $ Directory:='f$parse(Procedure,,,"DIRECTORY","NO_CONCEAL")'
  10. $ Path:="''Device'''Directory'"
  11. $!
  12. $! Check for "rooted" directory specs
  13. $!
  14. $ l = 'f$length(Path)'
  15. $ tmp = 'f$locate(".][",Path)'
  16. $ if 'tmp' .ne. 'l' then goto 10$
  17. $ tmp = 'f$locate(".><",Path)'
  18. $ if 'tmp' .ne. 'l' then goto 10$
  19. $ goto 100$
  20. $!
  21. $! Eliminate rooted directory specs
  22. $!
  23. $ 10$:
  24. $ if "''f$extract(tmp,255,Path)'" .eqs. ".][000000]" then goto 20$
  25. $ if "''f$extract(tmp,255,Path)'" .eqs. ".><000000>" then goto 20$
  26. $ l = tmp + 3
  27. $ Path:="''f$extract(0,tmp,Path)'.''f$extract(l,255,Path)'"
  28. $ goto 100$
  29. $ 20$:
  30. $ l = tmp + 1
  31. $ Path:="''f$extract(0,tmp,Path)'''f$extract(l,1,Path)'"
  32. $ 100$:
  33. $!
  34. $! Calculate the prefix and suffix (used in generating desired paths)
  35. $!
  36. $ l = 'f$length(Path)' - 1
  37. $ Prefix:='f$Extract(0,l,Path)'
  38. $ Suffix:='f$extract(l,1,Path)'
  39. $!
  40. $!    Setup the values for the GNU CC logical names
  41. $!
  42. $ gnu_cc_path:="''Prefix'.''Suffix'"
  43. $ gnu_include_path:="''Prefix'.INCLUDE.''Suffix'"
  44. $ gpp_include_path:="''Prefix'.GXX_INCLUDE.''Suffix'"
  45. $!
  46. $!    Assign GNU_CC
  47. $!
  48. $ assign/system 'gnu_cc_path' GNU_CC/tran=(conc)
  49. $!
  50. $!    Assign GNU_CC_INCLUDE
  51. $!
  52. $ assign/system 'gnu_include_path' GNU_CC_INCLUDE/tran=(conc)
  53. $ assign/system 'gpp_include_path' GNU_GXX_INCLUDE/tran=(conc)
  54. $!
  55. $!    Calculate the GCC version number
  56. $!    (we get it from the GCC pre-processor)
  57. $!
  58. $ Version_File_Name:="sys$scratch:gcc-version.tmp"
  59. $ Version:=""
  60. $ cpp:=$gnu_cc:[000000]gcc-cpp
  61. $ assign/user nla0: sys$output
  62. $ assign/user 'Version_File_Name' sys$error
  63. $ cpp -v
  64. $ open/read/error=Version_File_Not_Found Version_File 'Version_File_Name'
  65. $ read/error=Read_Error/end_of_file=Read_Error Version_File Line
  66. $ 1000$:
  67. $ tmp = 'f$locate(" ", Line)'
  68. $ if 'f$length(Line)' .eq. tmp then goto 1020$
  69. $ tmp = tmp + 1
  70. $ Line:="''f$extract(tmp, 255, Line)'"
  71. $ goto 1000$
  72. $ 1020$:
  73. $ Version:="''Line'"
  74. $!
  75. $ Read_Error:
  76. $ close Version_File
  77. $ delete/nolog/noconfirm 'Version_File_Name';*
  78. $!
  79. $ Version_File_Not_Found:
  80. $ if "''Version'" .eqs. "" then Version:="Unknown"
  81. $ define/system GNU_CC_VERSION "''Version'"
  82.