home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Source Code 1993 July / THE_SOURCE_CODE_CD_ROM.iso / gnu / gccdist / gcc / gcc_install.com < prev    next >
Encoding:
Text File  |  1992-09-25  |  2.9 KB  |  101 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. $ system = "/job"
  47. $ if f$priv("SYSNAM").eqs."TRUE" then system = "/system"
  48. $ if f$priv("SYSPRV").eqs."TRUE" then system = "/system"
  49. $!
  50. $!    Assign GNU_CC
  51. $!
  52. $ assign'system' 'gnu_cc_path' GNU_CC/tran=(conc)
  53. $!
  54. $!    Assign GNU_CC_INCLUDE
  55. $!
  56. $ assign'system' 'gnu_include_path' GNU_CC_INCLUDE/tran=(conc)
  57. $ assign'system' 'gpp_include_path' GNU_GXX_INCLUDE/tran=(conc)
  58. $!
  59. $!    Calculate the GCC version number
  60. $!    (we get it from the GCC pre-processor)
  61. $!
  62. $ Version_File_Name="sys$scratch:gcc-version-" + f$getjpi("","pid") +".tmp"
  63. $!
  64. $! make sure case where sys$scratch not being defined is handled with grace.
  65. $!
  66. $ if f$trnlnm("sys$scratch").eqs."" then -
  67.        Version_File_Name="gcc-version-" + f$getjpi("","pid") +".tmp"
  68. $!
  69. $ Version:=""
  70. $ cpp:=$gnu_cc:[000000]gcc-cpp
  71. $ assign/user nla0: sys$output
  72. $ assign/user 'Version_File_Name' sys$error
  73. $ cpp -v
  74. $ open/read/error=Version_File_Not_Found Version_File 'Version_File_Name'
  75. $ read/error=Read_Error/end_of_file=Read_Error Version_File Line
  76. $ 1000$:
  77. $ tmp = 'f$locate(".", Line)'
  78. $ if 'f$length(Line)' .eq. tmp then goto 1020$
  79. $ 1001$:
  80. $ tmp = tmp - 1
  81. $ if f$extract(tmp,1,Line).nes." " then goto 1001$
  82. $ tmp = tmp + 1
  83. $ Line:="''f$extract(tmp, 255, Line)'"
  84. $ tmp = 'f$locate(" ", Line)'
  85. $ if 'f$length(Line)' .ne. tmp then Line = f$extract(0,tmp,Line)
  86. $ 1020$:
  87. $ Version:="''Line'"
  88. $!
  89. $ Read_Error:
  90. $ close Version_File
  91. $ delete/nolog/noconfirm 'Version_File_Name';*
  92. $!
  93. $ Version_File_Not_Found:
  94. $ if "''Version'" .eqs. "" then Version:="Unknown"
  95. $ define'system' GNU_CC_VERSION "''Version'"
  96. $!
  97. $! Make it easier to have libg++ in the gnu_cc directory tree.
  98. $!
  99. $ if f$search("gnu_cc:[000000]libgxx_shr.exe").nes."" then -
  100.     define'system' libgxx_shr gnu_cc:[000000]libgxx_shr.exe
  101.