home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 5 Edit / 05-Edit.zip / vile-src.zip / vile-8.1 / vmsbuild.com < prev    next >
Text File  |  1998-10-02  |  9KB  |  322 lines

  1. $! $Header: /usr/build/vile/vile/RCS/vmsbuild.com,v 1.22 1998/10/03 02:42:15 tom Exp $
  2. $! VMS build-script for vile.  Requires installed C compiler
  3. $!
  4. $! Tested with:
  5. $!    VMS system version 5.4-2
  6. $!    VAX-C version 3.2
  7. $! and
  8. $!    VMS system version 6.1, 6.2
  9. $!    DEC C version 5.0, 5.2
  10. $!
  11. $! To build vile invoke @vmsbuild 
  12. $! To build xvile invoke @vmsbuild xvile
  13. $!
  14. $!
  15. $!
  16. $!      Build the option-file
  17. $!
  18. $ open/write optf vms_link.opt
  19. $ write optf "Identification=""Vile 8.1"""
  20. $ write optf "basic.obj"
  21. $ write optf "bind.obj"
  22. $ write optf "btree.obj"
  23. $ write optf "buffer.obj"
  24. $ write optf "crypt.obj"
  25. $ write optf "csrch.obj"
  26. $ write optf "display.obj"
  27. $ write optf "dumbterm.obj"
  28. $ write optf "eval.obj"
  29. $ write optf "exec.obj"
  30. $ write optf "externs.obj"
  31. $ write optf "fences.obj"
  32. $ write optf "file.obj"
  33. $ write optf "filec.obj"
  34. $ write optf "fileio.obj"
  35. $ write optf "finderr.obj"
  36. $ write optf "glob.obj"
  37. $ write optf "globals.obj"
  38. $ write optf "history.obj"
  39. $ write optf "input.obj"
  40. $ write optf "insert.obj"
  41. $ write optf "itbuff.obj"
  42. $ write optf "isearch.obj"
  43. $ write optf "line.obj"
  44. $ write optf "map.obj"
  45. $ write optf "menu.obj"
  46. $ write optf "modes.obj"
  47. $ write optf "msgs.obj"
  48. $ write optf "npopen.obj"
  49. $ write optf "oneliner.obj"
  50. $ write optf "opers.obj"
  51. $ write optf "path.obj"
  52. $ write optf "random.obj"
  53. $ write optf "regexp.obj"
  54. $ write optf "region.obj"
  55. $ write optf "search.obj"
  56. $ write optf "select.obj"
  57. $ write optf "spawn.obj"
  58. $ write optf "tags.obj"
  59. $ write optf "tbuff.obj"
  60. $ write optf "termio.obj"
  61. $ write optf "undo.obj"
  62. $ write optf "version.obj"
  63. $ write optf "vms2unix.obj"
  64. $ write optf "vmspipe.obj"
  65. $ write optf "watch.obj"
  66. $ write optf "window.obj"
  67. $ write optf "word.obj"
  68. $ write optf "wordmov.obj"
  69. $! Look for the compiler used
  70. $!
  71. $ CC = "CC"
  72. $ if f$getsyi("HW_MODEL").ge.1024
  73. $ then
  74. $  arch = "__alpha__=1"
  75. $  comp  = "__decc__=1"
  76. $  CFLAGS = "/prefix=all"
  77. $  DEFS = ",HAVE_ALARM"
  78. $  if f$trnlnm("SYS").eqs."" then define sys sys$library:
  79. $ else
  80. $  arch = "__vax__=1"
  81. $  if f$search("SYS$SYSTEM:DECC$COMPILER.EXE").eqs.""
  82. $   then
  83. $    if f$trnlnm("SYS").eqs."" then define sys sys$library:
  84. $    DEFS = ",HAVE_SYS_ERRLIST"
  85. $    write optf "sys$library:vaxcrtl.exe/share"
  86. $    if f$search("SYS$SYSTEM:VAXC.EXE").eqs.""
  87. $     then
  88. $     if f$trnlnm("GNU_CC").eqs.""
  89. $      then
  90. $       write sys$output "C compiler required to rebuild vile"
  91. $       close optf
  92. $       exit
  93. $     else
  94. $      write optf "gnu_cc:[000000]gcclib.olb/lib"
  95. $      comp = "__gcc__=1"
  96. $      CC = "GCC"
  97. $     endif 
  98. $    else
  99. $    comp  = "__vaxc__=1"
  100. $    endif
  101. $   else
  102. $    if f$trnlnm("SYS").eqs."" then define sys decc$library_include:
  103. $    comp  = "__decc__=1"
  104. $  endif
  105. $ endif
  106. $
  107. $ MKTBLS :== $SYS$DISK:'F$DIRECTORY()MKTBLS.EXE    ! make a foreign command
  108. $
  109. $ if "''p1'" .nes. "XVILE" .and. "''p1'" .nes. "XVILE.EXE"
  110. $  then
  111. $! for regular vile, use these:
  112. $   SCREEN := vmsvt
  113. $   TARGET := vile
  114. $   SCRDEF := "DISP_VMSVT,scrn_chosen"
  115. $   mmstar = "__vile__=1"
  116. $ else
  117. $! for building the Motif version (untested):
  118. $   SCREEN := x11
  119. $   TARGET := xvile
  120. $   SCRDEF := "MOTIF_WIDGETS,XTOOLKIT,DISP_X11,scrn_chosen"
  121. $   mmstar = "__xvile__=1"
  122. $!
  123. $!  Find out which X-Version we're running.  This will fail for older
  124. $!  VMS versions (i.e., v5.5-1).  Therefore, choose DECWindows XUI for
  125. $!  default.
  126. $!
  127. $   On Error Then GoTo XUI
  128. $   @sys$update:decw$get_image_version sys$share:decw$xlibshr.exe decw$version
  129. $   if f$extract(4,3,decw$version).eqs."1.0"
  130. $   then
  131. $     write optf "Sys$share:DECW$DWTLIBSHR.EXE/Share"
  132. $   endif
  133. $   if f$extract(4,3,decw$version).eqs."1.1"
  134. $   then
  135. $     write optf "sys$share:decw$xmlibshr.exe/share"
  136. $     write optf "sys$share:decw$xtshr.exe/share"
  137. $   endif
  138. $   if f$extract(4,3,decw$version).eqs."1.2"
  139. $   then
  140. $     write optf "sys$share:decw$xmlibshr12.exe/share"
  141. $     write optf "sys$share:decw$xtlibshrr5.exe/share"
  142. $   endif
  143. $   GoTo MAIN
  144. $!
  145. $XUI:
  146. $!
  147. $   write optf "Sys$share:DECW$DWTLIBSHR.EXE/Share"
  148. $MAIN:
  149. $!
  150. $   write optf "sys$share:decw$xlibshr.exe/share"
  151. $ endif
  152. $ close optf
  153. $! for building the X version, xvile, use these:
  154. $!SCREEN == x11simp
  155. $!TARGET == xvile
  156. $!SCRDEF == "DISP_X11,scrn_chosen"
  157. $
  158. $! for building the X-toolkit version:
  159. $!SCREEN := x11
  160. $!TARGET := xvile
  161. $!SCRDEF := "NO_WIDGETS,XTOOLKIT,DISP_X11,scrn_chosen"
  162. $
  163. $
  164. $! used /G_FLOAT with vaxcrtlg/share in vms_link.opt
  165. $! can also use /Debug /Listing, /Show=All
  166. $
  167. $ if f$search("SYS$SYSTEM:MMS.EXE").eqs.""
  168. $  then
  169. $
  170. $   CFLAGS := 'CFLAGS/Diagnostics /Define=("os_chosen","''SCRDEF'''DEFS'") /Include=([])
  171. $
  172. $      if "''p2'" .nes. "" then goto 'p2
  173. $
  174. $
  175. $ all :
  176. $    if f$search("mktbls.exe") .eqs. ""
  177. $    then
  178. $        call make mktbls
  179. $        link /exec=mktbls/map/cross mktbls.obj,SYS$LIBRARY:VAXCRTL/LIB
  180. $    endif
  181. $    if f$search("nebind.h") .eqs. "" then mktbls cmdtbl
  182. $    if f$search("nemode.h") .eqs. "" then mktbls modetbl
  183. $
  184. $    call make main
  185. $    call make 'SCREEN
  186. $    call make basic
  187. $    call make bind
  188. $    call make btree
  189. $    call make buffer
  190. $    call make crypt
  191. $    call make csrch
  192. $    call make display
  193. $    call make dumbterm
  194. $    call make eval
  195. $    call make exec
  196. $    call make externs
  197. $    call make fences
  198. $    call make file
  199. $    call make filec
  200. $    call make fileio
  201. $    call make finderr
  202. $    call make glob
  203. $    call make globals
  204. $    call make history
  205. $    call make input
  206. $    call make insert
  207. $    call make itbuff
  208. $    call make isearch
  209. $    call make line
  210. $    call make map
  211. $    call make menu
  212. $    call make modes
  213. $    call make msgs
  214. $    call make npopen
  215. $    call make oneliner
  216. $    call make opers
  217. $    call make path
  218. $    call make random
  219. $    call make regexp
  220. $    call make region
  221. $    call make search
  222. $    call make select
  223. $    call make spawn
  224. $    call make tags
  225. $    call make tbuff
  226. $    call make termio
  227. $    call make undo
  228. $    call make version
  229. $    call make vms2unix
  230. $    call make vmspipe
  231. $    call make watch
  232. $    call make window
  233. $    call make word
  234. $    call make wordmov
  235. $
  236. $    link /exec='target/map/cross main.obj, 'SCREEN.obj, vms_link/opt 
  237. $    goto build_last
  238. $
  239. $ install :
  240. $    WRITE SYS$ERROR "** no rule for install"
  241. $    goto build_last
  242. $    
  243. $ clobber :
  244. $    if f$search("vile.com") .nes. "" then delete vile.com;*
  245. $    if f$search("xvile.com") .nes. "" then delete xvile.com;*
  246. $    if f$search("*.exe") .nes. "" then delete *.exe;*
  247. $! fallthru
  248. $
  249. $ clean :
  250. $    if f$search("*.obj") .nes. "" then delete *.obj;*
  251. $    if f$search("*.bak") .nes. "" then delete *.bak;*
  252. $    if f$search("*.lis") .nes. "" then delete *.lis;*
  253. $    if f$search("*.log") .nes. "" then delete *.log;*
  254. $    if f$search("*.map") .nes. "" then delete *.map;*
  255. $    if f$search("*.opt") .nes. "" then delete *.opt;*
  256. $    if f$search("ne*.h") .nes. "" then delete ne*.h;
  257. $    if f$search("$(MKTBLS)") .nes. "" then delete $(MKTBLS);
  258. $! fallthru
  259. $
  260. $ build_last :
  261. $    if f$search("*.dia") .nes. "" then delete *.dia;*
  262. $    if f$search("*.lis") .nes. "" then purge *.lis
  263. $    if f$search("*.obj") .nes. "" then purge *.obj
  264. $    if f$search("*.map") .nes. "" then purge *.map
  265. $    if f$search("*.opt") .nes. "" then purge *.opt
  266. $    if f$search("*.exe") .nes. "" then purge *.exe
  267. $    if f$search("*.log") .nes. "" then purge *.log
  268. $! fallthru
  269. $
  270. $ vms_link_opt :
  271. $    exit
  272. $
  273. $! Runs VILE from the current directory (used for testing)
  274. $ vile_com :
  275. $    if "''f$search("vile.com")'" .nes. "" then delete vile.com;*
  276. $    copy nl: vile.com
  277. $    open/append  test_script vile.com
  278. $    write test_script "$ temp = f$environment(""procedure"")"
  279. $    write test_script "$ temp = temp -"
  280. $    write test_script "        - f$parse(temp,,,""version"",""syntax_only"") -"
  281. $    write test_script "        - f$parse(temp,,,""type"",""syntax_only"")"
  282. $    write test_script "$ vile :== $ 'temp'.exe"
  283. $    write test_script "$ define/user_mode sys$input  sys$command"
  284. $    write test_script "$ define/user_mode sys$output sys$command"
  285. $    write test_script "$ vile 'p1 'p2 'p3 'p4 'p5 'p6 'p7 'p8"
  286. $    close test_script
  287. $    write sys$output "** made vile.com"
  288. $    exit
  289. $
  290. $! Runs XVILE from the current directory (used for testing)
  291. $ xvile_com :
  292. $    if "''f$search("xvile.com")'" .nes. "" then delete xvile.com;*
  293. $    copy nl: xvile.com
  294. $    open/append  test_script xvile.com
  295. $    write test_script "$ temp = f$environment(""procedure"")"
  296. $    write test_script "$ temp = temp -"
  297. $    write test_script "        - f$parse(temp,,,""name"",""syntax_only"") -"
  298. $    write test_script "        - f$parse(temp,,,""version"",""syntax_only"") -"
  299. $    write test_script "        - f$parse(temp,,,""type"",""syntax_only"")"
  300. $    write test_script "$ xvile :== $ 'temp'xvile.exe"
  301. $    write test_script "$ define/user_mode sys$input  sys$command"
  302. $    write test_script "$ define/user_mode sys$output sys$command"
  303. $    write test_script "$ xvile 'p1 'p2 'p3 'p4 'p5 'p6 'p7 'p8"
  304. $    close test_script
  305. $    write sys$output "** made xvile.com"
  306. $    exit
  307. $
  308. $  else
  309. $   mms/ignore=warning/macro=('comp','mmstar','arch') 'p2
  310. $  endif
  311. $ exit
  312. $ make: subroutine
  313. $    if f$search("''p1'.obj") .eqs. ""
  314. $    then
  315. $        write sys$output "compiling ''p1'"
  316. $        'CC 'CFLAGS 'p1.c
  317. $        if f$search("''p1'.dia") .nes. "" then delete 'p1.dia;*
  318. $    endif
  319. $exit
  320. $    return
  321. $ endsubroutine
  322.