geom_gate userland utility improvements
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

126 lines
2.4 KiB

  1. $!
  2. $!
  3. $ olddir = f$environment("default")
  4. $ on control_y then goto YExit
  5. $!
  6. $ gosub Init
  7. $ if .not. init_status then goto YExit
  8. $!
  9. $ if what .eqs. "ALL"
  10. $ then
  11. $ call MakeAll
  12. $ else
  13. $ call Make
  14. $endif
  15. $!
  16. $YExit:
  17. $ set noon
  18. $! deassign exadir
  19. $! deassign objdir
  20. $ delete 'link_opts';*
  21. $ set default 'olddir'
  22. $exit
  23. $MakeAll: subroutine
  24. $!
  25. $ set noon
  26. $Loop:
  27. $ this = f$search("exadir:*.c;0")
  28. $ if this .eqs. "" then goto EndLoop
  29. $!
  30. $ what = f$parse( this,,,"name")
  31. $ if what .eqs. "x11" then goto loop ! not portable yet
  32. $ call Make
  33. $!
  34. $ goto Loop
  35. $EndLoop:
  36. $!
  37. $exit
  38. $endsubroutine
  39. $Make: subroutine
  40. $!
  41. $ set noon
  42. $!
  43. $ cc 'cc_include' 'cc_flags'/object=objdir:'what' exadir:'what'
  44. $ sev = $severity
  45. $ if sev .and. 2
  46. $ then
  47. $ say "Error compiling ''what', not linked."
  48. $ else
  49. $ if .not. (sev .and. 1)
  50. $ then
  51. $ say "Compile warnings in ''what'"
  52. $ endif
  53. $ link/exe='what'.exe objdir:'what'.obj, 'link_opts'/opt
  54. $ endif
  55. $!
  56. $!
  57. $End:
  58. $ delete objdir:'what'.obj;*
  59. $exit
  60. $endsubroutine
  61. $Init:
  62. $!
  63. $!
  64. $ init_status = 1
  65. $ thisid = f$integer( %x'f$getjpi(0,"pid")') + "''f$cvtime(,,"second")'"
  66. $ mdir = f$environment("procedure")
  67. $ mdir = mdir - f$parse(mdir,,,"name") - f$parse(mdir,,,"type") - f$parse(mdir,,,"version")
  68. $ set default 'mdir'
  69. $!
  70. $ objdir = "[.example_objects]"
  71. $ exadir = "[-.example]"
  72. $!
  73. $ objdirfile = objdir - "[." - "]" + ".dir"
  74. $ if f$search( objdirfile ) .eqs. ""
  75. $ then
  76. $ create/directory 'objdir'
  77. $ endif
  78. $!
  79. $ define objdir 'objdir'
  80. $ define exadir 'exadir'
  81. $!
  82. $ cc_include = "/include=([],[-.include])"
  83. $ cc_flags = "/name=shortened/show=all/define=(_USE_STD_STAT=1)"
  84. $ link_opts = "objdir:libssh2_''thisid'.opt"
  85. $!
  86. $!
  87. $ what = "''p1'"
  88. $ if what .eqs. "" .or. f$edit(p1,"trim,collapse,upcase") .eqs. "ALL"
  89. $ then
  90. $ what = "ALL"
  91. $ else
  92. $ what = f$parse(what,,,"name")
  93. $ if f$search("exadir:''what'.c") .eqs. ""
  94. $ then
  95. $ write sys$output "Can't make ''what'"
  96. $ init_status = 0
  97. $ endif
  98. $ endif
  99. $!
  100. $ currentlib = f$search("libssh2*.exe")
  101. $!
  102. $ define libssh2 'currentlib'
  103. $!
  104. $ how = "''p2'"
  105. $ if how .eqs. "" .or. f$edit(p2,"trim,collapse,upcase") .eqs. "STATIC"
  106. $ then
  107. $ open/write lout 'link_opts'
  108. $ write lout "libssh2.olb/lib"
  109. $ write lout "sys$share:ssl$libcrypto_shr32.exe/share"
  110. $ write lout "sys$share:ssl$libssl_shr32.exe/share"
  111. $ write lout "gnv$libzshr/share"
  112. $ close lout
  113. $ else
  114. $ how = "SHARED"
  115. $ open/write lout 'link_opts'
  116. $ write lout "libssh2/share"
  117. $ close lout
  118. $ endif
  119. $!
  120. $return