build.com 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468
  1. $ v0 = 0
  2. $ v = f$verify(v0)
  3. $! $LynxId: build.com,v 1.19 2011/05/23 23:49:53 tom Exp $
  4. $! BUILD.COM
  5. $!
  6. $! Command file to build LYNX.EXE on VMS systems.
  7. $! Also invokes build of the WWWLibrary if its
  8. $! object library does not already exist.
  9. $!
  10. $!
  11. $! 11-Jun-2010 Ch. Gartmann
  12. $! add support for "Multinet UCX emulation"
  13. $! 01-Jul-2007 T.Dickey
  14. $! add support for "TCPIP" (TCPIP Services)
  15. $! 04-Nov-2004 T.Dickey
  16. $! workarounds to build with IA64 platform.
  17. $! 23-Oct-2004 T.Dickey
  18. $! cleanup, remove duplication, etc.
  19. $! 08-Oct-1997 F.Macrides macrides@sci.wfeb.edu
  20. $! Added comments and minor tweaks for convenient addition of
  21. $! compiler definitions and compiler and linker options.
  22. $! 28-Jun-1997 F.Macrides macrides@sci.wfeb.edu
  23. $! Added chartrans support.
  24. $! 29-Feb-1996 F.Macrides macrides@sci.wfeb.edu
  25. $! Added LYMap to the compilation and link lists.
  26. $! 26-Jul-1995 F.Macrides macrides@sci.wfeb.edu
  27. $! Reorganized the option files into ones for the transport and
  28. $! ones for the compiler, and adding support for GNUC.
  29. $! 14-Jun-1995 F.Macrides macrides@sci.wfeb.edu
  30. $! Added LYList.
  31. $! 03-May-1995 F.Macrides macrides@sci.wfeb.edu
  32. $! Include /nomember for compilations with DECC. It's not the
  33. $! default on AXP and the code assumes byte alignment.
  34. $! 23-Mar-1995 F.Macrides macrides@sci.wfeb.edu
  35. $! Replaced references to v2.3.8 or v2.3.9 with v2.3-FM to avoid
  36. $! any confusion with official releases at UKans.
  37. $! 16-Mar-1995 F.Macrides macrides@sci.wfeb.edu
  38. $! Updated to permit submission to BATCH.
  39. $! 17-Feb-1995 F.Macrides macriees@sci.wfeb.edu
  40. $! Updated for v2.3-FM
  41. $! 07-Dec-1994 F.Macrides macrides@sci.wfeb.edu
  42. $! Updated for DECC/VAX, VAXC/VAX and DECC/AXP
  43. $! 03-OCT-1994 A.Harper A.Harper@kcl.ac.uk
  44. $! Mods to support SOCKETSHR/NETLIB and add a /DEBUG/NOOPT option
  45. $! 02-Jun-1994 F.Macrides macrides@sci.wfeb.edu
  46. $! Mods to support TCPWare (To use non-blocking connects, you need
  47. $! the DRIVERS_V405B.INC patch from FTP.PROCESS.COM for TCPware for
  48. $! OpenVMS Version 4.0-5, or a higher version of TCPWare, which will
  49. $! have that bug in the TCPDRIVER fixed. Otherwise, add NO_IOCTL to
  50. $! the $ cc := cc/define=(...) list in [.WWW.Library.VMS]libmake.com).
  51. $! 20-May-1994 Andy Harper A.Harper@bay.cc.kcl.ac.uk
  52. $! Mods to support CMU TCP/IP
  53. $! 13-Dec-1993 F.Macrides macrides@sci.wfeb.edu
  54. $! Mods for conditional compilations with VAXC versus DECC
  55. $! 10-Dec-1993 F.Macrides macrides@sci.wfeb.edu
  56. $! Initial version, for Lynx v2.1
  57. $!
  58. $ ON CONTROL_Y THEN GOTO CLEANUP
  59. $ ON ERROR THEN GOTO CLEANUP
  60. $ proc = f$environment("PROCEDURE")
  61. $ where = f$parse(proc,,,"DEVICE") + f$parse(proc,,,"DIRECTORY")
  62. $ set default 'where'
  63. $ write sys$output "Default directory:"
  64. $ show default
  65. $ write sys$output ""
  66. $!
  67. $! Compiler definitions can be added here as a comma separated
  68. $! list with a lead comma, e.g., ",HAVE_FOO_H,DO_BLAH". The
  69. $! definitions will apply only to the LYfoo.c modules. Ones
  70. $! for the libwww-FM modules can be added equivalently in
  71. $! [.WWW.Library.vms]libmake.com. - FM
  72. $!
  73. $ extra_defs = ""
  74. $!
  75. $! Include-paths can be added here as a comma separated
  76. $! list with a lead comma, e.g., ",foo".
  77. $!
  78. $ extra_incs = ""
  79. $!
  80. $! Library definitions can be added here as a comma separated
  81. $! list with a lead comma, e.g., ",foo/LIB".
  82. $!
  83. $ extra_libs = ""
  84. $!
  85. $! If no TCP/IP agent is specified (as the first argument),
  86. $! prompt for a number from the list. Note that the agent
  87. $! must be the first argument if the debugger mode is to be
  88. $! set via a second argument (see below). - FM
  89. $!
  90. $ agent = 0
  91. $ IF P1 .EQS. ""
  92. $ THEN
  93. $ If f$mode() .eqs. "BATCH"
  94. $ Then
  95. $ write sys$output "TCP/IP agent not specified!"
  96. $ write sys$output "Defaulting to MULTINET"
  97. $ agent = 1
  98. $ Else
  99. $ write sys$output "Acceptable TCP/IP agents are"
  100. $ write sys$output " [1] MULTINET (default)"
  101. $ write sys$output " [2] UCX"
  102. $ write sys$output " [3] WIN_TCP"
  103. $ write sys$output " [4] CMU_TCP"
  104. $ write sys$output " [5] SOCKETSHR_TCP"
  105. $ write sys$output " [6] TCPWARE"
  106. $ write sys$output " [7] DECNET"
  107. $ write sys$output " [8] TCPIP"
  108. $ write sys$output " [9] Multinet with UCX emulation"
  109. $ read sys$command/prompt="Agent [1,2,3,4,5,6,7,8,9] (RETURN = [1]) " agent
  110. $ EndIf
  111. $ ENDIF
  112. $ option = ""
  113. $ if agent .eq. 1 .or. agent .eqs. "" .or. p1 .eqs. "" .or. p1 .eqs. "MULTINET" then -
  114. option = "MULTINET"
  115. $ if agent .eq. 2 .or. p1 .eqs. "UCX" then option = "UCX"
  116. $ if agent .eq. 3 .or. p1 .eqs. "WIN_TCP" then option = "WIN_TCP"
  117. $ if agent .eq. 4 .or. p1 .eqs. "CMU_TCP" then option = "CMU_TCP"
  118. $ if agent .eq. 5 .or. p1 .eqs. "SOCKETSHR_TCP" then option = "SOCKETSHR_TCP"
  119. $ if agent .eq. 6 .or. p1 .eqs. "TCPWARE" then option = "TCPWARE"
  120. $ if agent .eq. 7 .or. p1 .eqs. "DECNET" then option = "DECNET"
  121. $ if agent .eq. 8 .or. p1 .eqs. "TCPIP" then option = "TCPIP"
  122. $ if agent .eq. 9 .or. p1 .eqs. "MULTINETUCX"
  123. $ then
  124. $ option = "UCX"
  125. $ mucx = 1
  126. $ extra_defs = extra_defs + ",MUCX"
  127. $ ELSE
  128. $ mucx = 0
  129. $ ENDIF
  130. $!
  131. $ if option .eqs. ""
  132. $ then
  133. $ write sys$output "TCP/IP agent could not be determined"
  134. $ exit 18
  135. $ endif
  136. $!
  137. $ if option .eqs. "TCPWARE"
  138. $ then
  139. $ write sys$output "Building Lynx for TCPWARE with UCX emulation..."
  140. $ extra_defs = extra_defs + ",UCX"
  141. $ endif
  142. $!
  143. $ optfile = "''option'"
  144. $!
  145. $! Compiler and linker options can be specified here. If
  146. $! there was a second argument (with any value), then debugger
  147. $! mode with no optimization will be specified as well. The
  148. $! compiler options will apply only to the LYfoo.c and UCfoo.c
  149. $! modules. Ones for the libwww-FM modules can be specified
  150. $! in [.WWW.Library.vms]libmake.com. - FM
  151. $!
  152. $ cc_opts = ""
  153. $ link_opts = ""
  154. $!
  155. $! The second parameter is a comma-separated list of the optional
  156. $! libraries:
  157. $! bzlib, slang, ssl, zlib
  158. $! Because these are normally not installed in a standard place,
  159. $! you must define their locations (see below for the symbols ending
  160. $! with "_INC" or "_LIB").
  161. $!
  162. $ if P2 .nes. ""
  163. $ then
  164. $ count_parm = 0
  165. $ parse_p2:
  166. $ value_parm = f$element('count_parm, ",", "''p2'")
  167. $ if value_parm .nes. ","
  168. $ then
  169. $ if value_parm .eqs. "BZLIB"
  170. $ then
  171. $ write sys$output "** adding BZlib to build."
  172. $ extra_defs = extra_defs + ",USE_BZLIB"
  173. $ extra_incs = extra_incs + "," + BZLIB_INC
  174. $ extra_libs = extra_libs + "," + BZLIB_LIB + "libbz2/LIB"
  175. $ endif
  176. $ if value_parm .eqs. "SLANG"
  177. $ then
  178. $ write sys$output "** adding SLang to build."
  179. $ extra_defs = extra_defs + ",USE_SLANG"
  180. $ extra_incs = extra_incs + "," + SLANG_INC
  181. $ extra_libs = extra_libs + "," + SLANG_LIB + "slang.olb/lib"
  182. $ endif
  183. $ if value_parm .eqs. "SSL"
  184. $ then
  185. $ write sys$output "** adding SSL to build."
  186. $ IF F$TYPE( ssl_lib ) .EQS. "" THEN ssl_lib = F$TRNLNM("SSLLIB")
  187. $ IF F$TYPE( ssl_inc ) .EQS. "" THEN ssl_inc = F$TRNLNM("SSLINCLUDE")
  188. $ extra_defs = extra_defs + ",USE_SSL,USE_OPENSSL_INCL"
  189. $ extra_libs = extra_libs + "," + SSL_LIB + "libssl/LIB," + SSL_LIB + "libcrypto/LIB"
  190. $!
  191. $! The "#include <openssl/ssl.h>" requires a logical variable "openssl".
  192. $!
  193. $ define/nolog openssl 'SSL_INC
  194. $ endif
  195. $ if value_parm .eqs. "ZLIB"
  196. $ then
  197. $ write sys$output "** adding Zlib to build."
  198. $ extra_defs = extra_defs + ",USE_ZLIB"
  199. $ extra_incs = extra_incs + "," + ZLIB_INC
  200. $ extra_libs = extra_libs + "," + ZLIB_LIB + "libz/LIB"
  201. $ endif
  202. $ count_parm = count_parm + 1
  203. $ goto parse_p2
  204. $ endif
  205. $ endif
  206. $!
  207. $! The third parameter is nonempty to make a debug build
  208. $!
  209. $ if P3 .nes. ""
  210. $ then
  211. $ debug_arg = "DEBUG"
  212. $ cc_opts = cc_opts + "/DEBUG/NOOPT"
  213. $ link_opts = link_opts + "/DEBUG"
  214. $ else
  215. $ debug_arg = ""
  216. $ endif
  217. $!
  218. $ IF f$search("[.WWW.Library.Implementation]WWWLib_''option'.olb") .nes. ""
  219. $ THEN
  220. $ write sys$output " WWWLib_''option'.olb already exists."
  221. $ If f$mode() .eqs. "BATCH"
  222. $ Then
  223. $ write sys$output " Updating WWWLib_''option'.olb"
  224. $ Else
  225. $ read sys$command/prompt=" Update it [default Y]? " reply
  226. $ if reply .nes. "" .and. -
  227. f$extract(0,1,f$edit(reply, "TRIM, UPCASE")) .nes. "Y" then -
  228. $ goto Compile_CHRTRANS
  229. $ EndIf
  230. $ ENDIF
  231. $ v1 = f$verify(1)
  232. $!
  233. $! Build the WWWLibrary
  234. $!
  235. $ set default [.WWW.Library.VMS]
  236. $ v1 = f$verify(v0)
  237. $ @libmake "''option'" "''P2'" "''debug_arg'"
  238. $ v1 = f$verify(1)
  239. $ set default [-.-.-]
  240. $ v1 = f$verify(v0)
  241. $ ON CONTROL_Y THEN GOTO CLEANUP
  242. $ ON ERROR THEN GOTO CLEANUP
  243. $!
  244. $Compile_CHRTRANS:
  245. $ IF f$search("[.src.chrtrans]makeuctb.exe") .nes. ""
  246. $ THEN
  247. $ write sys$output " [.src.chrtrans]makeuctb.exe already exists."
  248. $ If f$mode() .eqs. "BATCH"
  249. $ Then
  250. $ write sys$output " Updating makeuctb.exe and chrtrans header files."
  251. $ Else
  252. $ read sys$command -
  253. /prompt=" Update it and chrtrans header files [default Y]? " reply
  254. $ if reply .nes. "" .and. -
  255. f$extract(0,1,f$edit(reply, "TRIM, UPCASE")) .nes. "Y" then -
  256. $ goto Compile_SRC
  257. $ EndIf
  258. $ ENDIF
  259. $!
  260. $ v1 = f$verify(1)
  261. $!
  262. $! Build the chrtrans modules.
  263. $!
  264. $ set default [.src.chrtrans]
  265. $ v1 = 'f$verify(v0)
  266. $ @build-chrtrans
  267. $ v1 = f$verify(1)
  268. $ set default [-.-]
  269. $ v1 = f$verify(v0)
  270. $ ON CONTROL_Y THEN GOTO CLEANUP
  271. $ ON ERROR THEN GOTO CLEANUP
  272. $!
  273. $Compile_SRC:
  274. $ v1 = f$verify(1)
  275. $!
  276. $! Compile the Lynx [.SRC] modules
  277. $!
  278. $ set default [.SRC]
  279. $ v1 = f$verify(v0)
  280. $ IF f$getsyi("ARCH_NAME") .eqs. "Alpha" .or. -
  281. f$getsyi("ARCH_NAME") .eqs. "IA64" .or. -
  282. f$trnlnm("VAXCMSG") .eqs. "DECC$MSG" .or. -
  283. f$trnlnm("DECC$CC_DEFAULT") .eqs. "/DECC" .or. -
  284. f$trnlnm("DECC$CC_DEFAULT") .eqs. "/VAXC"
  285. $ THEN
  286. $ compiler := "DECC"
  287. $!
  288. $ if option .eqs. "UCX"
  289. $ then
  290. $ optfile = "UCXSHR"
  291. $ IF mucx THEN optfile = "MULTINET_UCX"
  292. $ ENDIF
  293. $ if option .eqs. "TCPIP" then optfile = "TCPIPSHR"
  294. $ if option .eqs. "TCPWARE" then optfile = "TCPWARESHR"
  295. $!
  296. $ if option .eqs. "SOCKETSHR_TCP" then extra_defs = extra_defs + ",_DECC_V4_SOURCE"
  297. $ if option .eqs. "TCPIP" then extra_defs = extra_defs + ",TCPIP_SERVICES"
  298. $ if option .eqs. "MULTINET" then -
  299. extra_defs = extra_defs + ",_DECC_V4_SOURCE,__SOCKET_TYPEDEFS"
  300. $!
  301. $ if option .eqs. "TCPIP"
  302. $ then
  303. $ if f$trnlnm("TCPIP$IPC_SHR") .eqs. "" then define TCPIP$IPC_SHR SYS$LIBRARY:TCPIP$IPC_SHR
  304. $ endif
  305. $!
  306. $ v1 = f$verify(1)
  307. $! DECC:
  308. $ cc := cc/decc/prefix=all/nomember'cc_opts' -
  309. /DEFINE=(ACCESS_AUTH,'option''extra_defs',__VMS_CURSES)-
  310. /INCLUDE=([],[-],[-.WWW.Library.Implementation],[.chrtrans]'extra_incs')
  311. $ v1 = f$verify(v0)
  312. $ ELSE
  313. $ IF option .eqs. "UCX"
  314. $ THEN
  315. $ optfile = "UCXSHR"
  316. $ IF mucx THEN optfile = "MULTINET_UCX"
  317. $ ENDIF
  318. $ if option .eqs. "TCPIP" then optfile = "TCPIPOLB"
  319. $ if option .eqs. "TCPWARE" then optfile = "TCPWAREOLB"
  320. $ IF f$search("gnu_cc:[000000]gcclib.olb") .nes. ""
  321. $ THEN
  322. $ compiler := "GNUC"
  323. $ v1 = f$verify(1)
  324. $! GNUC:
  325. $ cc := gcc'cc_opts' -
  326. /DEFINE=(ACCESS_AUTH,'option''extra_defs')-
  327. /INCLUDE=([],[-],[-.WWW.Library.Implementation],[.chrtrans]'extra_incs')
  328. $ v1 = f$verify(v0)
  329. $ ELSE
  330. $ compiler := "VAXC"
  331. $ v1 = f$verify(1)
  332. $! VAXC:
  333. $ cc := cc'cc_opts' -
  334. /DEFINE=(ACCESS_AUTH,'option''extra_defs')-
  335. /INCLUDE=([],[-],[-.WWW.Library.Implementation],[.chrtrans]'extra_incs')
  336. $ v1 = f$verify(v0)
  337. $ ENDIF
  338. $ ENDIF
  339. $ v1 = f$verify(1)
  340. $!
  341. $ cc DefaultStyle
  342. $ cc GridText
  343. $ cc HTAlert
  344. $ cc HTFWriter
  345. $ cc HTInit
  346. $ cc HTML
  347. $ cc LYBookmark
  348. $ cc LYCgi
  349. $ cc LYCharSets
  350. $ cc LYCharUtils
  351. $ cc LYClean
  352. $ cc LYCookie
  353. $ cc/nooptimize LYCurses
  354. $ cc LYDownload
  355. $ cc LYEdit
  356. $ cc LYEditmap
  357. $ cc LYexit
  358. $ cc LYForms
  359. $ cc LYGetFile
  360. $ cc LYHistory
  361. $ cc LYJump
  362. $ cc LYKeymap
  363. $ cc LYLeaks
  364. $ cc LYList
  365. $ cc LYMail
  366. $ cc LYMain
  367. $ cc LYMainLoop
  368. $ cc LYMap
  369. $ cc LYMktime
  370. $ cc LYNews
  371. $ cc LYOptions
  372. $ cc LYPrint
  373. $ cc LYrcFile
  374. $ cc LYReadCFG
  375. $ cc LYSearch
  376. $ cc LYSession
  377. $ cc LYShowInfo
  378. $ cc LYStrings
  379. $ cc LYTraversal
  380. $ cc LYUpload
  381. $ cc LYUtils
  382. $ cc PARSDATE
  383. $ cc TRSTable
  384. $ cc UCAuto
  385. $ cc UCAux
  386. $ cc UCdomap
  387. $!
  388. $! Link the objects and libaries.
  389. $!
  390. $ IF f$getsyi("ARCH_NAME") .eqs. "IA64"
  391. $ THEN
  392. $ optslibs="''extra_libs'"
  393. $ ELSE
  394. $ optslibs=", sys$disk:[]''optfile'.opt/opt, sys$disk:[]''compiler'.opt/opt ''extra_libs'"
  395. $ ENDIF
  396. $!
  397. $ link/exe=lynx.exe/map=lynx 'link_opts' -
  398. DefaultStyle.obj, -
  399. GridText.obj, -
  400. HTAlert.obj, -
  401. HTFWriter.obj, -
  402. HTInit.obj, -
  403. HTML.obj, -
  404. LYBookmark.obj, -
  405. LYCgi.obj, -
  406. LYCharSets.obj, -
  407. LYCharUtils.obj, -
  408. LYClean.obj, -
  409. LYCookie.obj, -
  410. LYCurses.obj, -
  411. LYDownload.obj, -
  412. LYEdit.obj, -
  413. LYEditmap.obj, -
  414. LYexit.obj, -
  415. LYForms.obj, -
  416. LYGetFile.obj, -
  417. LYHistory.obj, -
  418. LYJump.obj, -
  419. LYKeymap.obj, -
  420. LYLeaks.obj, -
  421. LYList.obj, -
  422. LYMail.obj, -
  423. LYMain.obj, -
  424. LYMainLoop.obj, -
  425. LYMap.obj, -
  426. LYMktime.obj, -
  427. LYNews.obj, -
  428. LYOptions.obj, -
  429. LYPrint.obj, -
  430. LYrcFile.obj, -
  431. LYReadCFG.obj, -
  432. LYSearch.obj, -
  433. LYSession.obj, -
  434. LYShowInfo.obj, -
  435. LYStrings.obj, -
  436. LYTraversal.obj, -
  437. LYUpload.obj, -
  438. LYUtils.obj, -
  439. Parsdate.obj, -
  440. TRSTable.obj, -
  441. UCAuto.obj, -
  442. UCAux.obj, -
  443. UCdomap.obj, -
  444. [-.WWW.Library.Implementation]WWWLib_'option'.olb/library 'optslibs
  445. $!
  446. $! Copy the executable to the top directory and restore the default.
  447. $!
  448. $ copy lynx.exe [-]
  449. $ set def [-]
  450. $!
  451. $ v1 = f$verify(v0)
  452. $!
  453. $! Issue message on how to include LYNX.HLP in the system HELP library
  454. $!
  455. $ write sys$output ""
  456. $ write sys$output " To install or update lynx.hlp in the system HELP library,"
  457. $ write sys$output " use:"
  458. $ write sys$output " library/replace sys$help:helplib.hlb lynx.hlp"
  459. $ write sys$output ""
  460. $!
  461. $ CLEANUP:
  462. $ v1 = f$verify(v0)
  463. $ set default 'where'
  464. $ write sys$output "Default directory:"
  465. $ show default
  466. $ v1 = f$verify(v)
  467. $ exit