home *** CD-ROM | disk | FTP | other *** search
/ Columbia Kermit / kermit.zip / archives / ckc197.zip / ckvold.com < prev    next >
Text File  |  2000-01-02  |  45KB  |  1,166 lines

  1. $!
  2. $! CKVKER.COM - C-Kermit 7.0 Construction for (Open)VMS
  3. $!
  4. $! Version 1.21, 6 Sep 1999
  5. $!
  6. $! 04-Oct-97 1.17 lh  Updated to CKVKER.COM 1.17
  7. $!                    C_Kermit 6.1.193.Alpha07
  8. $! 25-Dec-98 1.18 fdc Change C-Kermit version number to 7.0.195.
  9. $!  6-Jan-99 1.19 fdc Add new CKCLIB and CKCTEL modules.
  10. $! 21-Mar-99 1.20 lh  Update to CKVKER 1.20 (add X, ucxv5, if_dot_h)
  11. $!  6-Sep-99 1.21 wb  Update for ckcuni.[ch]
  12. $!
  13. $! CKVOLD.COM - C-Kermit 7.0 Construction for (Open)VMS
  14. $!
  15. $! A modified version of CKVKER.COM, originally based on
  16. $! CKVKER.COM  Version 1.15, 05 December 1996 for C-Kermit 6.0.192
  17. $! and updated to include subsequent CKVKER.COM revs.
  18. $!
  19. $! CKVOLD.COM uses DCL syntax compatible with VAX/VMS 4.x; it may also
  20. $! be used in place of CKVKER.COM with later {Open}VMS releases.
  21. $!
  22. $! It has been used to build C-Kermit v 6.0.192 with
  23. $!     VMS 4.4, VAX C 2.4; NONET, WINTCP v3.2
  24. $!              gcc  1.42; NONET
  25. $!
  26. $! See CKVKER.COM for documention on building VMS C-Kermit
  27. $! in general
  28. $!
  29. $! modifications specific to VMS 4 are
  30. $!   - the compiler macro "OLD_VMS" is automatically defined
  31. $!   - a compiler macro "OLD_TWG" is used for code modifications
  32. $!     specific to WINTCP v3.2.  If that is defined in P3,
  33. $!     the symbol "oldtwg" then selects the link libraries for
  34. $!     that TCPIP package
  35. $!
  36. $!    OLD_TWG and oldtwg may serve as a model for TCPIP
  37. $!    packages on older systems that do not have the standard
  38. $!    configuration of CKVKER.  However, features implemented
  39. $!    in the various TCPIP packages may differ from the current
  40. $!    versions, so CKCNET.H and CKCNET.C may also need to be
  41. $!    examined for appropriate options/actions with respect to
  42. $!    other packages.
  43. $!
  44. $!  Lucas Hart, Oregon State University, Nov 1996.
  45. $!
  46. $     if p1 .eqs. "" then goto Skip_Help
  47. $     if (f$locate(",",p1).ne.f$length(p1)) then goto Bad_param
  48. $     p1 = f$edit(p1,"UPCASE")
  49. $     if (f$locate("H",p1).eq.f$length(p1)) .and. -
  50.          (f$locate("?",p1).eq.f$length(p1)) then goto Skip_Help
  51. $!
  52. $Help:
  53. $type sys$input
  54.    Usage:
  55.        $ @[directory]ckvker p1 [ p2 [ p3 [ p4 [ p5] ] ] ]
  56.  
  57.        P1 = Build options
  58.        P2 = Compiler selection
  59.        P3 = C-Kermit DEFINES
  60.        P4 = Additional compiler qualifiers
  61.        P5 = Link qualifiers
  62.  
  63.    P1 Build options (no white space, or enclose in quotes):
  64.        S = share (VAX C default is noshare, i.e. no shared VAXCRTL)
  65.        L = RTL version level -- link with latest math RTL
  66.        D = compile&link /DEBUG (create map files, etc)
  67.        C = clean (remove object files, etc.)
  68.        M = don't use MMS or MMK; use the DCL MAKE subroutine herein
  69.        N = build with no network support
  70.        O = override the limit on MMS/MMK command line length
  71.        V = turn on verify
  72.        W = exit on warnings
  73.        H = display help message
  74.        X = build CKVCVT rather than C-Kermit
  75.        "" = Null place holder; use the defaults
  76.  
  77.    P2 compiler_selection
  78.        D = DEC C
  79.        V = VAX C
  80.        G = GNU C
  81.        "" = Use the first compiler found, searching in the above order
  82.  
  83.    P3    C-Kermit options (enclosed in quotes if more than one) including
  84.           NOPUSH                for security
  85.           NODEBUG               to reduce size of executable
  86.  
  87.           ""      Empty string; only needed as a spaceholder
  88.                   when other parameters follow.
  89.  
  90.          Note: Default C-Kermit options that can be negated, NO.....,
  91.          (see CKCCFG.DOC), as well as options that are not previously
  92.          defined, should be affected by specifying the flag here.
  93.          However, CKCDEB.H must be edited to "undefine" other defaults,
  94.          e.g. CK_CURSES.
  95.  
  96.    P4    Compiler qualifiers (enclosed in quotes)if desired; provides
  97.          additional flexibility, e.g., to change the compiler optimization,
  98.          "/OPT=LEV=2"
  99.  
  100.    P5    Linker qualifiers, e.g., the linker default is to search the
  101.          system shareable image library, IMAGELIB.OLB,  before the
  102.          object module STARLET.OLB.  To build an image that may run on
  103.          older system you might want to try linking /NOSYSSHR
  104.  Example:
  105.  
  106.       $ @ckvker snmd ""  "NOPUSH, NODEBUG" "/NOOPT"
  107.  
  108.       NOPUSH  - Disallow access to DCL from within Kermit.
  109.       NODEBUG - Remove debugging code to make C-Kermit smaller and faster.
  110.  
  111.       This procedure should be stored in the same directory as the source
  112.       files.  You can SET DEFAULT to that directory and execute the procedure
  113.       as shown above, or you can SET DEFAULT to a separate directory and run
  114.       run the procedure out of the source directory, e.g.:
  115.  
  116.       SET DEFAULT DKA300:[KERMIT.ALPHA]
  117.       @DKA300:[KERMIT.SOURCE]CKVKER
  118.  
  119.       This puts the object and executable files into your current directory.
  120.       Thus you can have (e.g.) and Alpha and an VAX build running at the
  121.       same time from the same source.  Similarly, you can define a logical
  122.       name for the source directory:
  123.  
  124.       DEFINE CK_SOURCE DKA300:[KERMIT.SOURCE]
  125.  
  126.       and then no matter which directory you run this procedure from, it
  127.       will look in the CK_SOURCE logical for the source files.
  128.  
  129.    NOTES:
  130.       If adding flags here makes ccopt too long for Multinet/Wollongong
  131.       you will have to do it in CKCDEB.H.
  132.  
  133.       The empty string, "", is needed only as a space holder if additional
  134.       strings follow.
  135.  
  136.    Works like MAKE in that only those source modules that are newer than the
  137.    corresponding object modules are recompiled.  Changing the C-Kermit command
  138.    line DEFINES or compiler options does not affect previously compiled
  139.    modules. To force a particular module to be recompiled, delete the object
  140.    file first.  To force a full rebuild:
  141.  
  142.    $  @ckvker c
  143.    $  @ckvker <desired-options>
  144.  
  145.    To use in batch, set up the appropriate directories and submit
  146.    (/NOLIST and /NOMAP will be defined unless P1 includes "D")
  147.     e.g., submit CKVKER /parameters=(SL,"","NODEBUG")
  148.  
  149.    See the CKVINS.DOC and CKVKER.BWR files for further information.
  150.  
  151. $Exit
  152. $!
  153. $!
  154. $! Uses MMS if it is installed, unless the M option is included.  If CKVKER.MMS
  155. $! is missing, you'll get an error; if MMS is not runnable for some reason
  156. $! (privilege, image mismatch, etc), you'll also get an error.  In either case,
  157. $! simply bypass MMS by including the M option.
  158. $!
  159. $! For network-type selection, you may also type (at the DCL prompt, prior
  160. $! to running this procedure):
  161. $!
  162. $!   net_option = "BLAH"
  163. $!
  164. $! where BLAH (uppercase, in quotes) is NONET, MULTINET, TCPWARE, WINTCP,
  165. $! DEC_TCPIP, or CMU_TCPIP, to force selection of a particular TCP/IP
  166. $! product, but only if the product's header files and libraries are installed
  167. $! on the system where this procedure is running.
  168. $!
  169. $! By default, this procedure builds C-Kermit with support for the TCP/IP
  170. $! network type that is installed on the system where this procedure is run,
  171. $! and tries to link statically with old libraries.  If the system is a VAX, a
  172. $! VAX binary is created; if it is an Alpha, an Alpha binary is created.  If
  173. $! more than one TCP/IP product is installed, the search proceeds in this
  174. $! order: MULTINET, TCPWARE, WINTCP, DEC_TCPIP, CMU_TCPIP.
  175. $!
  176. $! Should work for all combinations of VAXC/DECC/GCC, VAX/Alpha, and any of
  177. $! the following TCP/IP products: DEC TCP/IP (UCX), Cisco (TGV) MultiNet,
  178. $! Attachmate (Wollongong) WINTCP (Pathway), Process Software TCPware,
  179. $! or CMU/Tektronix TCP/IP (except CMU/Tek is not available for the Alpha).
  180. $! VAX C is supported back to version 3.1, and DEC C back to 1.3.
  181. $! Tested on VMS versions back to 5.4, but should work back to VAX/VMS 5.0,
  182. $! and hopefully even into the 4.x's.
  183. $!
  184. $! ERRORS:
  185. $! 1. At link time, you might see messages like:
  186. $!    %LINK-I-OPENIN, Error opening SYS$COMMON:[SYSLIB]VAXCRTLG.OLB; as input,
  187. $!    %RMS-E-FNF, file not found
  188. $!    %LINK-I-OPENIN, Error opening SYS$COMMON:[SYSLIB]VAXCRTL.OLB; as input,
  189. $!    %RMS-E-FNF, file not found
  190. $!    This generally indicates that the logical name(s) LNK$LIBRARY* is
  191. $!    defined and the runtime libraries are in SYS$SHARE but are not in
  192. $!    SYS$COMMON:[SYSLIB].  In the one case where this was observed, the
  193. $!    messages turned out to be harmless, since the runtime library is being
  194. $!    properly located in the .OPT file generated by this procedure.
  195. $! 2. In newer configurations, you might get a link-time message to the effect
  196. $!    that DECC$IOCTL is multiply defined (e.g. VMS 7.0 / DECC 5.3 / UCX or
  197. $!    TCPware of recent vintage), since the ioctl() function is now supplied
  198. $!    as of VMS 7.0.  This message should be harmless.
  199. $! 3. The compiler might warn that routines like bzero and bcopy are not
  200. $!    declared, or that they have been declared twice.  If the affected module
  201. $!    (usually ckcnet.c) builds anyway, and runs correctly, ignore the
  202. $!    warnings.  If it crashes at runtime, some (more) adjustments will be
  203. $!    needed at the source-code level.
  204. $!
  205. $! This procedure is intended to replace the many and varied Makefiles, MMS
  206. $! and MMK files, and so on, and to combine all of their features into one.
  207. $! It was written by Martin Zinser, Gesellschaft fuer Schwerionenforschung
  208. $! GSI, Darmstadt, Germany, m.zinser@gsi.de (preferred) or eurmpz@eur.sas.com,
  209. $! in September 1996, based on all of the older versions developed by:
  210. $!
  211. $!   Mark Berryman, Science Applications Int'l. Corp., San Diego, CA
  212. $!   Frank da Cruz, Columbia University, New York City <fdc@columbia.edu>
  213. $!   Mike Freeman, Bonneville Power Administration
  214. $!   Tarjei T. Jensen, Norwegian Hydrographic Service
  215. $!   Terry Kennedy, Saint Peters College, Jersey City NJ <terry@spcvxa.spc.edu>
  216. $!   Mike O'Malley, Digital Equipment Corporation
  217. $!   Piet W. Plomp, ICCE, Groningen University, The Netherlands
  218. $!     (piet@icce.rug.nl, piet@asterix.icce.rug.nl)
  219. $!   James Sturdevant, CAP GEMINI AMERICA, Minneapolis, MN
  220. $!   Lee Tibbert, DEC <tibbert@cosby.enet.dec.com>
  221. $!   Bernie Volz, Process Software <volz@process.com>
  222. $!
  223. $! Modification history:
  224. $!  fdc = Frank da Cruz, Columbia U, fdc@columbia.edu
  225. $!  mf  = Mike Freeman, Bonneville Power Authority, freeman@columbia.edu
  226. $!  cf  = Carl Friedberg, Comet & Company, carl@comets.com
  227. $!  hg  = Hunter Goatley, Process Software, goathunter@goat.process.com
  228. $!  lh  = Lucas Hart, Oregon State U, hartl@ucs.orst.edu
  229. $!  js  = John Santos, Evans Griffiths & Hart, john@egh.com
  230. $!  jw  = Joellen Windsor, U of Arizona, windsor@ccit.arizona.edu
  231. $!
  232. $! 23-Sep-96 1.01 fdc Shorten and fix syntax of MultiNet
  233. $!                    /PREFIX_LIBRARIES_ENTRIES clause, remove ccopt items to
  234. $!                    make string short enough.
  235. $! 26-Sep-96 1.02 jw  o Create a temporary file for the CCFLAGS=ccopt macro and
  236. $!                    "prepend" it to ckvker.mms to reduce the MMS command
  237. $!                    line length
  238. $!                    o Optionally, use the current level of the Fortran
  239. $!                    runtime library and not the "lowest common denominator".
  240. $!                    When using the "lowest common denominator," be sure to
  241. $!                    DEASSIGN the logicals before exit.
  242. $!                    o  Continue to operate on WARNING messages.
  243. $!                    o  Implement some .COM file debugging qualifiers:
  244. $!                    o  Modify .h file dependencies
  245. $! 06-Oct-96 1.03 fdc Add 'N' command-line switch for no nets, make 'C' list
  246. $!                    the files it deletes, clean up comments & messages, etc.
  247. $! 09-Oct-96 1.04 cf  Change error handling to use ON WARNING only; add "V"
  248. $!                    option to enable verify; fix CKWART so it doesn't come
  249. $!                    up in /debug; remove /DECC from alphas as this is the
  250. $!                    case anyway add /LOG to MMS to get more info
  251. $! 20-Oct-96 1.05 fdc Numerous changes suggested by lots of people to make it
  252. $!                    work in more settings.
  253. $! 21-Oct-96 1.06 jw  o Put the /vaxc qualifier in ccopt when both DECC and
  254. $!                    VAXC are present and user forces use of VAXC.
  255. $!                    o When forcing VAXC and building NOSHARE, add
  256. $!                    sys$share:vaxcrtl.olb/lib to kermit.opt
  257. $!                    o Purge rather than delete kermit.opt, aux.opt, and
  258. $!                    ccflags.mms so we will have them for reference.
  259. $! 21-Oct-96 1.07 hg  Adapt for TCPware and for MMK.
  260. $! 21-Oct-96 1.08 mf  Smooth out a couple differences between MMS and MMK.
  261. $! 21-Oct-96 1.09 hg  Fixes to fdc's interpretation of 1.08.
  262. $! 25-Oct-96 1.10 jw  o Allow compilation source in a centrally-located path
  263. $!                    o Pretty up write of ccopt to sys$output
  264. $!                    o Deassign logicals on warning exit
  265. $! 04-Nov-86 1.11 lh  A. Allow CFLAG options as command-line parameter p3
  266. $!                    (may require adding "ifndef NOopt" to "#define opt"
  267. $!                    construction wherever the VMS default is set, e.g.,
  268. $!                    in CKCDEB.H).
  269. $!                    B. Spiff up:
  270. $!                    (a) Line length limit for Multinet - arbitrary
  271. $!                    (b) Ioctl of VMS v7, DEC_TCPIP, DECC
  272. $!                    (c) Add a P4 option
  273. $!                    (d) Check for command-line length
  274. $!                    (e) Try to set up W for user selection of termination on
  275. $!                        warning, per Joellen's comments.
  276. $!                    C. Some cosmetic changes:
  277. $!                    Change (b) from  net_option {.eqs.} "DEC_TCPIP" to
  278. $!                    {includes string} per jas; move help text to start;
  279. $!                    add VAXC N vaxcrtl link.
  280. $!                    {what about missing net_option share/noshare options?}
  281. $!                    Test for CK_SOURCE to define a source directory different
  282. $!                    from the CKVKER.COM directory
  283. $! 05-Nov-86 1.12 fdc Clean up and amplify help text and add VMS >= 7.0 test.
  284. $! 06-Nov-86 1.12 hg  Remove extraneous comma in VMS >= 7.0 test.
  285. $! 08-Nov-96 1.13 js  Fixes to CMU/Tek build.
  286. $! 23-Nov-96 1.14 lh  Fixes for VMS V7, VAXCRTL links for all TCP/IP packages,
  287. $!                    improved batch operation, add P5 for link options,
  288. $!                    catch commas in P1.
  289. $! 05-Dec-96 1.15 lh  Fixes to work with GCC.
  290. $!
  291. $!
  292. $Skip_Help:
  293. $!
  294. $ On Control_Y then $ goto CY_Exit
  295. $! On ERROR then $ goto The_exit
  296. $ On SEVERE_ERROR then $ goto The_exit
  297. $! On Warning then goto warning_exit
  298. $!
  299. $ save_verify_image = f$environment("VERIFY_IMAGE")
  300. $ save_verify_procedure = f$verify(0)
  301. $!
  302. $ say == "Write sys$output"
  303. $ procedure = f$environment("PROCEDURE")
  304. $ procname = f$element(0,";",procedure)
  305. $ node = f$getsyi("NODENAME")
  306. $ say "Starting ''procedure' on ''node' at ''f$time()'"
  307. $ ccopt = ""
  308. $ lopt = ""
  309. $ make = ""
  310. $ CC = "CC"
  311. $ alpha=0
  312. $ debug=0
  313. $ noshare=1
  314. $ decc=0
  315. $ vaxc=0
  316. $ verify=0
  317. $ gnuc=0
  318. $ oldmath=0
  319. $ mathlevel=0
  320. $ vmsv4=0
  321. $ vmsv7=0
  322. $ ucxv5=0
  323. $ if_dot_h=0
  324. $ oldvms=0
  325. $ oldsrc=0
  326. $ oldobj=0
  327. $ nomms=0
  328. $ mmsclm=255        ! maximum command length limit for MMS/MMK (estimate)
  329. $ do_ckvcvt=0
  330. $!
  331. $! Find out which OpenVMS version we are running
  332. $! (do not use IF ... ENDIF for the VMS 4 test and exit)
  333. $!
  334. $ sys_ver = f$edit(f$getsyi("version"),"compress")
  335. $ if f$extract(0,1,sys_ver) .eqs. "V" then goto Production_version
  336. $     type sys$input
  337. WARNING: You appear to be running a Field Test version of VMS.
  338.          Please exercise caution until you have verified proper operation.
  339.  
  340. $Production_version:
  341. $!
  342. $     dot = f$locate(".",sys_ver)
  343. $     sys_maj = 0+f$extract(dot-1,1,sys_ver)
  344. $     sys_min = 0+f$extract(dot+1,1,sys_ver)
  345. $!
  346. $     if sys_maj .eq. 4 then if (sys_min/2)*2 .ne. sys_min then -
  347.         sys_min = sys_min - 1
  348. $     if sys_maj .ne. 4 then goto Supported_version
  349. $     vmsv4 = 1
  350. $     say f$fao("!/!_You are running VAX VMS ''sys_ver'")
  351. $     type sys$input
  352.  
  353. WARNING: VMS C-Kermit is maintained with more recent VMS releases.
  354.          Please exercise caution until you have verified proper operation.
  355.  
  356. $!
  357. $!
  358. $Supported_version:
  359. $!
  360. $     vms_ver = "VMS_V''sys_maj'''sys_min'"
  361. $
  362. $! VMSV70 must be defined if the VMS version is 7.0 OR GREATER, so we know
  363. $! we can include <strings.h>. We need this information again, so use
  364. $! a variable.
  365. $
  366. $    if vms_ver .ges."VMS_V70" then vmsv7=1
  367. $!
  368. $!
  369. $! Set the Kermit Source Path KSP: to be the same path as this procedure
  370. $! if the user has not specified another source with a CK_SOURCE logical
  371. $!
  372. $     if f$trnlnm("CK_SOURCE") .nes. ""  then goto Set_source
  373. $!
  374. $     source_device = f$parse(f$environment("procedure"),,,"device")
  375. $     source_directory = f$parse(f$environment("procedure"),,,"directory")
  376. $     define KSP 'source_device''source_directory
  377. $Goto Build_opt
  378. $!
  379. $Set_source:
  380. $     user_source = f$trnlnm("CK_SOURCE")
  381. $     define KSP 'user_source'
  382. $Goto Build_opt
  383. $!
  384. $Build_opt:
  385. $ if p1.eqs."" then goto Compiler_opt
  386. $     if f$locate("V",p1).ne.f$length(p1) then verify=1
  387. $     if verify .eq. 1 then set verify
  388. $     if f$locate("D",p1).ne.f$length(p1) then debug=1
  389. $     if f$locate("S",p1).ne.f$length(p1) then noshare=0
  390. $     if f$locate("L",p1).ne.f$length(p1) then mathlevel=1
  391. $     if f$locate("M",p1).ne.f$length(p1) then nomms=1
  392. $     if f$locate("N",p1).ne.f$length(p1) then net_option="NONET"
  393. $     if f$locate("C",p1).ne.f$length(p1) then goto clean
  394. $     if f$locate("X",p1).ne.f$length(p1) then do_ckvcvt=1
  395. $!
  396. $     if f$locate("O",p1).ne.f$length(p1) then mmsclm = 1024
  397. $     if f$locate("W",p1).ne.f$length(p1) then On Warning then goto warning_exit
  398. $! we have already tested for "H", help
  399. $Goto Compiler_opt
  400. $!
  401. $Compiler_opt:
  402. $!
  403. $!  customize for local configuration
  404. $!
  405. $! TWG 3.2 (WINTCP, May 1988)
  406. $!   "OLD_TWG" is a macro used in CKCNET
  407. $!   oldtwg is used to customize the link libraries (see WINTCP_opt)
  408. $!   and we overide any net_option symbol
  409. $!
  410. $     oldtwg=0
  411. $     if p3.nes."" then p3 = f$edit(p3,"UPCASE")
  412. $     if p3.nes."" then if f$locate("OLD_TWG",p3).ne.f$length(p3) then oldtwg=1
  413. $     if oldtwg then net_option = "WINTCP"
  414. $!
  415. $!
  416. $     cln_def = ""
  417. $     if p3 .nes. "" then cln_def = ","+p3  ! comma delimited string
  418. $!
  419. $     cln_qua = ""
  420. $     if p4 .nes. "" then cln_qua = p4
  421. $!
  422. $!
  423. $     if debug.eq.1 then ccopt = "/noopt/deb"
  424. $     if debug.eq.1 then  lopt = "/deb/map/full/sym"
  425. $!
  426. $     if p5 .nes. "" then p5 = f$edit(p5,"UPCASE")
  427. $     if p5 .nes. "" then lopt = lopt + p5
  428. $!
  429. $! Check for MMK/MMS
  430. $!
  431. $     if nomms .eq. 0 then goto Check_mms
  432. $     if nomms .eq. 1 then goto Build_opt_files
  433. $!
  434. $Check_mms:
  435. $     if f$search("sys$system:mms.exe") .nes. "" then make = "MMS"
  436. $     if (verify) .and.(make.nes."") then make = "MMS/LOG/VERIFY"
  437. $     if f$type(MMK) .eqs. "STRING" then make = "MMK"
  438. $     if make .nes. "" then say "Using ''make' utility"
  439. $Goto Build_opt_files
  440. $!
  441. $! Build the option-file
  442. $!
  443. $Build_opt_files:
  444. $     open/write aoptf aux.opt
  445. $     if do_ckvcvt then goto end_init_optf
  446. $     open/write optf kermit.opt
  447. $     write optf "ckcmai.obj"
  448. $     write optf "ckclib.obj"
  449. $     write optf "ckcfn2.obj"
  450. $     write optf "ckcfn3.obj"
  451. $     write optf "ckcfns.obj"
  452. $     write optf "ckcuni.obj"
  453. $     write optf "ckcpro.obj"
  454. $     write optf "ckucmd.obj"
  455. $     write optf "ckudia.obj"
  456. $     write optf "ckuscr.obj"
  457. $     write optf "ckuus2.obj"
  458. $     write optf "ckuus3.obj"
  459. $     write optf "ckuus4.obj"
  460. $     write optf "ckuus5.obj"
  461. $     write optf "ckuus6.obj"
  462. $     write optf "ckuus7.obj"
  463. $     write optf "ckuusr.obj"
  464. $     write optf "ckuusx.obj"
  465. $     write optf "ckuusy.obj"
  466. $     write optf "ckuxla.obj"
  467. $     write optf "ckvcon.obj"
  468. $     write optf "ckcnet.obj"
  469. $     write optf "ckctel.obj"
  470. $     write optf "ckvfio.obj"
  471. $     write optf "ckvtio.obj"
  472. $     write optf "ckvioc.obj"
  473. $     write optf "ckusig.obj"
  474. $     if (vmsv4) then write optf "ckvold.obj"
  475. $     write optf "Identification=""Kermit 7.0.196"""
  476. $end_init_optf:
  477. $!
  478. $!
  479. $! Look for old math-library to allow transfer of the production Kermit
  480. $! to old-fashioned VMS systems
  481. $!
  482. $     if f$search("SYS$SHARE:FORTRAN$MTHRTL-VMS.EXE") .nes. "" then -
  483.         oldmath=1
  484. $     if mathlevel.eq.1  then oldmath=0
  485. $     if   oldmath.eq.0  then goto Compiler_type
  486. $!
  487. $     define/nolog mthrtl fortran$mthrtl-vms
  488. $     define/nolog vmthrtl fortran$vmthrtl-vms
  489. $     type sys$input
  490. NOTE: You have currently DEC Fortran V6.0 or later installed, but the
  491.       old versions of the Math libraries are still available on your
  492.       system. We will link C-Kermit with these older, pre-Fortan V6
  493.       libraries so that it will run on systems which don't have Fortran
  494.       V6 installed. C-Kermit does not use any features of the new
  495.       libraries.
  496.  
  497.       You will receive %LINK-I-IDMISMCH informational messages during
  498.       linking, but these can be safely ignored.
  499. $Goto Compiler_type
  500. $!
  501. $Compiler_type:
  502. $!
  503. $! Look for the compiler used
  504. $!
  505. $ if p2.eqs."" then goto DECC
  506. $     p2 = f$edit(p2,"UPCASE")
  507. $     if f$locate("G",p2).ne.f$length(p2) then goto gnuc
  508. $     if f$locate("V",p2).ne.f$length(p2) then goto vaxc
  509. $     if f$locate("D",p2).ne.f$length(p2) then goto decc
  510. $Goto DECC
  511. $!
  512. $DECC:
  513. $ if f$search("SYS$SYSTEM:DECC$COMPILER.EXE").eqs."" then goto VAXC
  514. $     say "DECC compiler found"
  515. $     cc_ver = "DECC"
  516. $     ccopt = "/decc"+ccopt
  517. $Goto compile
  518. $!
  519. $VAXC:
  520. $ if f$search("SYS$SYSTEM:VAXC.EXE").eqs."" then goto GNUC
  521. $     say "VAXC compiler found, checking version..."
  522. $     cc_ver = "VAXC023"
  523. $     vaxc_h = f$trnlnm("VAXC$INCLUDE")
  524. $     if vaxc_h .eqs. "" then vaxc_h = "SYS$LIBRARY:"
  525. $     if f$search("''vaxc_h'fscndef.h") .nes. "" then cc_ver = "VAXC024"
  526. $     if f$search("''vaxc_h'ppl$routines.h") .nes. "" then cc_ver = "VAXC030"
  527. $     if f$search("''vaxc_h'xabrudef.h") .nes. "" then cc_ver = "VAXC031"
  528. $     if (cc_ver .eqs. "VAXC031") then goto Check_dual
  529. $     type sys$input
  530. WARNING: Your system has an older version of the C compiler.
  531.          VMS C-Kermit was designed to be compiled under VAX C V3.1 or
  532.          newer or DEC C V1.3 or newer.  It has not been verified to
  533.          build properly under older compilers, athough pre-built C-Kermit
  534.          versions should run properly.  Please exercise caution until you
  535.          have verified proper operation.
  536.  
  537. $Goto Check_dual
  538. $!
  539. $Check_dual:
  540. $!  If both DECC and VAXC are in this system, then use the /vaxc qualifier
  541. $     if f$search("SYS$SYSTEM:DECC$COMPILER.EXE").nes."" then -
  542.         ccopt = "/vaxc" + ccopt
  543. $Goto compile
  544. $
  545. $!
  546. $GNUC:
  547. $     if f$trnlnm("GNU_CC").eqs."" then goto NoCC
  548. $     say "GNUC compiler"
  549. $     CC="GCC"
  550. $     cc_ver="GNUC"+f$trnlnm("GNU_CC_VERSION")
  551. $!
  552. $Version_Loop:              ! convert period separator to underscore
  553. $     dot = f$locate(".",cc_ver)
  554. $     if dot .eq. f$length(cc_ver) then goto End_Version_Loop
  555. $     cc_ver[dot,1] := "_"
  556. $goto Version_Loop
  557. $!
  558. $End_Version_Loop:
  559. $!
  560. $     if debug.eq.0 then ccopt = "/nolist/optimize=4"
  561. $     if .not. do_ckvcvt then write optf "gnu_cc:[000000]gcclib.olb/lib"
  562. $     write aoptf "gnu_cc:[000000]gcclib.olb/lib"
  563. $     noshare=1
  564. $Goto compile
  565. $!
  566. $NoCC:
  567. $! No compiler found - Warning and Exit
  568. $!
  569. $     if .not. do_ckvcvt then close optf
  570. $     close aoptf
  571. $     type sys$input
  572. FATAL: No C-compiler found - Can't build Kermit on this system.
  573.  
  574. $Goto The_exit
  575. $!
  576. $COMPILE:
  577. $     say "C compiler: ''cc_ver', options: ''ccopt', command: ''CC'"
  578. $     if vmsv4 then goto VAX_arch
  579. $!
  580. $     if f$getsyi("HW_MODEL").ge.1024 then alpha=1
  581. $     if alpha .ne. 1 then goto VAX_arch
  582. $!
  583. $     say f$fao("!/Operating System: OpenVMS(tm) Alpha!/")
  584. $! alpha this is only option...recover a bit of DCL real estate
  585. $     ccopt = ccopt-"/decc"
  586. $Goto Set_share
  587. $!
  588. $VAX_arch:
  589. $     if vms_ver .lts. "VMS_V55" then -
  590.         say f$fao("!/Operating System: VAX/VMS(tm)!/")
  591. $     if vms_ver .ges. "VMS_V55" then -
  592.         say f$fao("!/Operating System: OpenVMS(tm) VAX(tm)!/")
  593. $Goto Set_share
  594. $!
  595. $Set_share:
  596. $! cc_ver could start with VAXC; DECC; or GNUC
  597. $!
  598. $! The linker default is to link /SYSSHR
  599. $! Only VAXCRTL and (and the TCPIP library if appropriate)
  600. $! is affected by the "S" build flag, unless the line with
  601. $! /NOSYSSHR is uncommented
  602. $!
  603. $!$ if (cc_ver.gts."DECC" .and. f$search("sys$share:vaxcrtl.exe").eqs."") .or. -
  604. $!     (vms_ver .lts. "VMS_V52") .or. noshare.eq.1
  605. $!
  606. $! VMS V4 DCL doesn't have an if ... then ... else ... endif
  607. $!
  608. $     if alpha.eq.0 then -
  609.         if (cc_ver.gts."DECC" .and. f$search("sys$share:vaxcrtl.exe").eqs."") -
  610.         .or. (vmsv4.eq.0 .and. vms_ver .lts. "VMS_V52") .or. noshare.eq.1 -
  611.         then goto noshare_opt
  612. $!
  613. $     noshare = 0                      ! Alpha default is SHARE
  614. $     if f$locate("/NOSYSS",p5).ne.f$length(p5) then noshare = 1
  615. $     if noshare .eq. 1 then goto noshare_opt
  616. $!
  617. $     share_opt  = "VMSSHARE"
  618. $     share_text = "shareable libs and"
  619. $goto end_share_opt
  620. $!
  621. $noshare_opt:
  622. $     share_opt  = "NOVMSSHARE"
  623. $     share_text = "system OLBs and"
  624. $!
  625. $end_share_opt:
  626. $!
  627. $!      Find out which network to use
  628. $!
  629. $! Type:
  630. $!    net_option = "NONET"
  631. $! before running this procedure to build C-Kermit without TCP/IP network
  632. $! support on a system that has a TCP/IP package installed, or use the
  633. $! N command-line option to force NONET.
  634. $!
  635. $     if .not. do_ckvcvt then goto check_net_option
  636. $     net_option = "NONET"
  637. $Goto Net_Done
  638. $!
  639. $check_net_option:
  640. $     if f$type(net_option) .nes. "STRING" then goto Find_net
  641. $!
  642. $     say "Network option override = ''net_option'"
  643. $     net_option = f$edit(net_option,"UPCASE")
  644. $Goto Net_Done
  645. $!
  646. $Find_Net:
  647. $!
  648. $     net_option = ""
  649. $     if f$search("MULTINET:MULTINET_SOCKET_LIBRARY.EXE") .nes. "" then -
  650.         net_option = "MULTINET"
  651. $     if net_option .nes "" then goto Net_Done
  652. $!
  653. $     if f$search("TCPWARE:UCX$IPC.OLB") .nes. ""  then -
  654.         net_option = "TCPWARE"
  655. $     if net_option .nes "" then goto Net_Done
  656. $!
  657. $     if f$search("TWG$TCP:[NETDIST.LIB]TWGLIB.OLB") .nes. ""  then -
  658.         net_option = "WINTCP"
  659. $     if net_option .nes "" then goto Net_Done
  660. $!
  661. $     if f$search("SYS$LIBRARY:UCX$ACCESS_SHR.EXE") .nes. ""  then -
  662.         net_option = "DEC_TCPIP"
  663. $     if net_option .nes "" then goto Net_Done
  664. $!
  665. $     if f$search(f$parse(f$trnlnm("LIBCMU"),-
  666.                          "cmuip_root:[syslib]libcmu.olb")) .nes. "" -
  667.         then net_option = "CMU_TCPIP"
  668. $     if net_option .nes "" then goto Net_Done
  669. $!
  670. $     if net_option .eqs. "" then net_option = "NONET"
  671. $     if net_option .nes "" then goto Net_Done
  672. $!
  673. $Net_Done:
  674. $!
  675. $!    The net may have been selected manually or automatically
  676. $!    First, the name of the link library for the specified TCPIP
  677. $!    package will be put in the option file, kermit.opt, and then
  678. $!    the VAXCRTL link object, if needed, will be added to the option
  679. $!    file, and placed in the auxillary option file, aux.opt.
  680. $!
  681. $     if net_option .eqs. "NONET"     then goto NoNet_opt
  682. $     if net_option .eqs. "MULTINET"  then goto Multinet_opt
  683. $     if net_option .eqs. "TCPWARE"   then goto TCPware_opt
  684. $     if net_option .eqs. "WINTCP"    then goto WINTCP_opt
  685. $     if net_option .eqs. "DEC_TCPIP" then goto UCX_opt
  686. $     if net_option .eqs. "CMU_TCPIP" then goto CMU_opt
  687. $Goto Unknown_net
  688. $!
  689. $!
  690. $NONet_opt:
  691. $     net_name = "no"
  692. $Goto End_Net_opt
  693. $!
  694. $!
  695. $Multinet_opt:
  696. $     net_name = "MultiNet"
  697. $     write optf "multinet:multinet_socket_library.exe/share"
  698. $Goto End_Net_opt
  699. $!
  700. $TCPware_opt:
  701. $     net_name = "Process Software TCPware"
  702. $     write optf "tcpware:ucx$ipc.olb/library"
  703. $     net_option = "TCPWARE,DEC_TCPIP"
  704. $Goto End_Net_opt
  705. $!
  706. $WINTCP_opt:
  707. $     net_name = "WIN/TCP"
  708. $     define/nolog vaxc$include twg$tcp:[netdist.include],sys$library
  709. $     define/nolog sys twg$tcp:[netdist.include.sys]
  710. $     if oldtwg  then goto Oldtwg_opt
  711. $     write optf "twg$common:[netdist.lib]twglib.olb/library"
  712. $Goto End_Net_opt
  713. $!
  714. $Oldtwg_opt:
  715. $     define/nolog vms twg$tcp:[netdist.include.vms]
  716. $     write optf "twg$tcp:[netdist.lib]LIBNET.OLB/library"
  717. $     write optf "twg$tcp:[netdist.lib]LIBNETACC.OLB/library"
  718. $     write optf "twg$tcp:[netdist.lib]LIBNET.OLB/library"
  719. $Goto End_Net_opt
  720. $!
  721. $UCX_opt:
  722. $     net_name = "DEC TCP/IP Services for OpenVMS(tm)"
  723. $     if f$search("SYS$LIBRARY:TCPIP$INETDEF.H") .nes. "" then ucxv5 = 1
  724. $     if alpha.eq.0 then write optf "sys$library:ucx$ipc.olb/library"
  725. $Goto End_Net_opt
  726. $!
  727. $CMU_opt:
  728. $     net_name = "CMU-OpenVMS/IP"
  729. $     libcmu = f$search(f$parse(f$trnlnm("LIBCMU"), -
  730.                                "cmuip_root:[syslib]libcmu.olb"))
  731. $     write optf "''libcmu'/library"
  732. $Goto End_Net_opt
  733. $!
  734. $Unknown_net:
  735. $     say "Unknown net_option: ''net_option', building as NONET"
  736. $     net_option = "NONET"
  737. $     net_name = "no"
  738. $Goto End_Net_opt
  739. $!
  740. $End_Net_opt:
  741. $!
  742. $! First specify the appropriate VAXCRTL then
  743. $! close the option-files
  744. $!
  745. $     if do_ckvcvt then goto close_aoptf
  746. $     if (noshare.eq.1) .and. -
  747.         (cc_ver.gts."DECC" .or. net_option .eqs. "CMU_TCPIP" .or. -
  748.         net_option .eqs. "TCPWARE")  then -
  749.         write  optf "sys$share:vaxcrtl.olb/lib"
  750. $     if (noshare.eq.0) .and. -
  751.         (cc_ver.gts."DECC" .or. net_option .eqs. "CMU_TCPIP" .or. -
  752.         net_option .eqs. "TCPWARE")  then -
  753.         write  optf "sys$share:vaxcrtl.exe/share"
  754. $     close optf
  755. $!
  756. $close_aoptf:
  757. $     if (noshare.eq.1) .and. cc_ver.gts."DECC" then -
  758.         write aoptf "sys$share:vaxcrtl.olb/lib"
  759. $     if (noshare.eq.0) .and.(cc_ver.gts."DECC") then -
  760.         write aoptf "sys$share:vaxcrtl.exe/share"
  761. $     close aoptf
  762. $!
  763. $!
  764. $! Set compile prefix as a function of the TCP/IP stack for DEC C.  The
  765. $! /PREFIX_LIBRARY_ENTRIES business is needed for MultiNet 3.2 and earlier,
  766. $! but is not needed for 4.0.  Not sure about WINTCP.  Not sure where the
  767. $! cutoff is.  CAUTION: There are limits on how long statements can be, and
  768. $! how long string constants can be, and how long strings can be, even when
  769. $! formed as below, by repeated concatenation.  These limits start out at
  770. $! 254 or so, and go up to maybe 1023.  Don't add anything to these
  771. $! strings (spaces, etc) that doesn't need to be there.
  772. $!
  773. $! also, DEC C and VMS >= 7.0 has its own ioctl
  774. $!
  775. $     if cc_ver.gts."DECC"  then goto Set_cflags
  776. $!
  777. $     if f$search("SYS$COMMON:[DECC$LIB.REFERENCE.DECC$RTLDEF]IF.H") -
  778.         .nes. "" then if_dot_h = 1
  779. $!
  780. $!   These packages provide their own header files
  781. $     if (net_option .nes. "MULTINET") .and. (net_option .nes. "WINTCP") -
  782.         then goto DEC_headers
  783. $!
  784. $     say "Adding /PREFIX for DECC and Multinet.."
  785. $     ccopt = ccopt + "/PREF=(AL,EX=("
  786. $     ccopt = ccopt + "accept,bind,connect,listen,select,"
  787. $     ccopt = ccopt + "socket,recv,send,sendmsg,getservbyname,"
  788. $     ccopt = ccopt + "getpeername,getsockname,getsockopt,setsockopt,"
  789. $     ccopt = ccopt + "gethostbyname,gethostbyaddr,inet_addr,"
  790. $     ccopt = ccopt + "inet_ntoa,htons,ntohs))"
  791. $Goto Set_cflags
  792. $!
  793. $DEC_headers:
  794. $!   use DEC C header files
  795. $!   OpenVMS >= 7.0 has a system ioctl; that is used by both
  796. $!   DEC_TCPIP and TCPware
  797. $     if vmsv7 .and. -
  798.         (f$locate("DEC_TCPIP",net_option) .ne. f$length(net_option)) -
  799.         then go to Special_case
  800. $!
  801. $! the rest of the DEC C
  802. $     ccopt = ccopt + "/PREFIX_LIBRARY_ENTRIES=(ALL_ENTRIES)"
  803. $Goto Set_cflags
  804. $!
  805. $Special_case:
  806. $     ccopt = ccopt + "/PREFIX_LIBRARY_ENTRIES=(AL,EX=ioctl)"
  807. $Goto Set_cflags
  808. $!
  809. $Set_cflags:
  810. $! CFLAGS equivalent - local site options are added here
  811. $!
  812. $     if vmsv4  then cln_def = cln_def+",OLD_VMS"
  813. $     if vmsv7  then cln_def = cln_def+",VMSV70"
  814. $     if ucxv5 then cln_def = cln_def+",UCX50"
  815. $     if if_dot_h then cln_def = cln_def+",IF_DOT_H"
  816. $!
  817. $     ccdef="/def=(''net_option',''cc_ver',''vms_ver',''share_opt'"+-
  818.             "''cln_def')''cln_qua'"
  819. $! say "length of ccopt is ''f$length(ccopt)'"
  820. $! say "length of ccdef is ''f$length(ccdef)'"
  821. $     ccopt = ccopt + ccdef
  822. $     mmscln = f$length(ccopt)
  823. $     if make .eqs "" .or. mmscln .lt. mmsclm  then goto build
  824. $say "Warning: The 'ccopt' command is ''mmscln' characters which could cause the"
  825. $say "         ''make' procedure to fail. You may continue on by restarting"
  826. $say "         with the either O (over-ride) flag or M (no MM_) flag set."
  827. $Goto The_exit
  828. $
  829. $!
  830. $Build:
  831. $     say "Compiling Kermit sources ..."
  832. $     set noon
  833. $     tempsymb = "CCOPT = ""''ccopt'"""
  834. $     say "Kermit Source Path = ''f$trnlnm(""KSP"")'"
  835. $     set on
  836. $     if .not. do_ckvcvt then say -
  837. "Building WERMIT with ''share_text' ''net_name' network support at ''f$time()"
  838. $!
  839. $     say f$fao("!/cc   options : ''ccopt'")
  840. $     say f$fao(  "link options : ''lopt'!/")
  841. $!
  842. $     if Make.eqs."" then goto Build_direct
  843. $     if Make.nes."" then goto Build_MMx
  844. $!
  845. $Build_direct:
  846. $! Build the thing plain
  847. $!
  848. $! To facilitate batch mode compilation, append /NOLIST and /NOMAP
  849. $! to the compiler and linker options (default for INTERACTIVE or MMx)
  850. $!
  851. $     batch_mode = 0
  852. $     if f$mode() .eqs. "BATCH" then batch_mode = 1
  853. $     if batch_mode then ccopt = ccopt + "/NOLIST"
  854. $     if batch_mode .and. (debug .eq. 0) then  lopt =  lopt + "/NOMAP"
  855. $!
  856. $     if do_ckvcvt then goto CKVCVT
  857. $     say "  Compiling CKWART at     ''f$time()"
  858. $!
  859. $! Note the use of single quotes (') apostrophe than double ('') in quoting
  860. $! CCOPT, to prevent CCOPT from being expanded prior to the MAKE call, which
  861. $! could result in the string being too long.  Using ' rather than '' forces
  862. $! evaluation of CCOPT to occure in the MAKE routine itself.
  863. $!
  864. $   CALL MAKE ckwart.OBJ "'CC' 'CCOPT' KSP:ckwart" -
  865.               KSP:ckwart.c
  866. $   say "  Linking   CKWART at     ''f$time()"
  867. $!
  868. $   call make ckwart.exe "LINK  ckwart,aux.opt/opt/NOMAP" ckwart.obj
  869. $   say "  Running   CKWART at     ''f$time()"
  870. $   ckwart = "$" +f$parse("CKWART.EXE",,,"DEVICE") +-
  871.             f$parse("CKWART.EXE",,,"DIRECTORY") + "CKWART"
  872. $   CALL MAKE ckcpro.c "ckwart  KSP:ckcpro.w ckcpro.c" -
  873.              " KSP:ckcpro.w "
  874. $   say "  Compiling WERMIT files  ''f$time()"
  875. $!
  876. $! Note how MAKE args are combined in quotes to get around the limitation
  877. $! on the number of arguments to a DCL procedure.
  878. $!
  879. $   CALL MAKE ckcmai.OBJ "'CC' 'CCOPT' KSP:ckcmai" -
  880.           KSP:ckcmai.c -
  881.           "KSP:ckcker.h KSP:ckcdeb.h KSP:ckcsym.h" -
  882.           "KSP:ckcasc.h KSP:ckcnet.h KSP:ckcsig.h" -
  883.           "KSP:ckuusr.h KSP:ckvioc.h KSP:ckucmd.h"
  884. $   CALL MAKE ckclib.OBJ "'CC' 'CCOPT' KSP:ckclib" -
  885.           KSP:ckclib.c -
  886.           "KSP:ckcdeb.h KSP:ckcsym.h KSP:ckcasc.h"
  887. $   CALL MAKE ckcfn2.OBJ "'CC' 'CCOPT' KSP:ckcfn2" -
  888.           KSP:ckcfn2.c -
  889.           "KSP:ckcker.h KSP:ckcdeb.h KSP:ckcsym.h" -
  890.           "KSP:ckcasc.h KSP:ckcxla.h KSP:ckuxla.h"
  891. $   CALL MAKE ckcfn3.OBJ "'CC' 'CCOPT' KSP:ckcfn3" -
  892.           KSP:ckcfn3.c -
  893.           "KSP:ckcker.h KSP:ckcdeb.h KSP:ckcsym.h" -
  894.           "KSP:ckcasc.h KSP:ckcxla.h KSP:ckuxla.h"
  895. $   CALL MAKE ckcfns.OBJ "'CC' 'CCOPT' KSP:ckcfns" -
  896.           KSP:ckcfns.c -
  897.           "KSP:ckcker.h KSP:ckcdeb.h KSP:ckcsym.h" -
  898.           "KSP:ckcasc.h KSP:ckcxla.h KSP:ckuxla.h"
  899. $   CALL MAKE ckcuni.OBJ "CC 'CCOPT' KSP:ckcuni" -
  900.           KSP:ckcuni.c -
  901.           "KSP:ckcker.h KSP:ckcdeb.h KSP:ckcsym.h" -
  902.           "KSP:ckcasc.h KSP:ckcxla.h KSP:ckuxla.h"
  903. $   CALL MAKE ckcpro.OBJ "'CC' 'CCOPT'/INCL=KSP: ckcpro" -
  904.           ckcpro.c -
  905.           "KSP:ckcker.h KSP:ckcdeb.h KSP:ckcasc.h" -
  906.           "KSP:ckcsym.h KSP:ckcnet.h KSP:ckvioc.h"
  907. $   CALL MAKE ckucmd.OBJ "'CC' 'CCOPT' KSP:ckucmd" -
  908.           KSP:ckucmd.c -
  909.           "KSP:ckcasc.h KSP:ckucmd.h KSP:ckcdeb.h" -
  910.           "KSP:ckcsym.h KSP:ckcker.h KSP:ckuusr.h" -
  911.           "KSP:ckucmd.h"
  912. $   CALL MAKE ckudia.OBJ "'CC' 'CCOPT' KSP:ckudia" -
  913.           KSP:ckudia.c -
  914.           "KSP:ckcker.h KSP:ckcdeb.h KSP:ckucmd.h" -
  915.           "KSP:ckcasc.h KSP:ckcsig.h KSP:ckcnet.h" -
  916.           "KSP:ckcsym.h KSP:ckuusr.h KSP:ckvioc.h"
  917. $   CALL MAKE ckuscr.OBJ "'CC' 'CCOPT' KSP:ckuscr" -
  918.           KSP:ckuscr.c -
  919.           "KSP:ckcker.h KSP:ckcdeb.h KSP:ckcasc.h" -
  920.           "KSP:ckcsig.h KSP:ckcsym.h KSP:ckuusr.h" -
  921.           "KSP:ckcnet.h KSP:ckvioc.h KSP:ckucmd.h"
  922. $   CALL MAKE ckuus2.OBJ "'CC' 'CCOPT' KSP:ckuus2" -
  923.           KSP:ckuus2.c -
  924.           "KSP:ckucmd.h KSP:ckcker.h KSP:ckuusr.h" -
  925.           "KSP:ckcdeb.h KSP:ckcxla.h KSP:ckuxla.h" -
  926.           "KSP:ckcasc.h KSP:ckcsym.h KSP:ckcnet.h" -
  927.           "KSP:ckvioc.h"
  928. $   CALL MAKE ckuus3.OBJ "'CC' 'CCOPT' KSP:ckuus3" -
  929.           KSP:ckuus3.c -
  930.           "KSP:ckucmd.h KSP:ckcker.h KSP:ckuusr.h" -
  931.           "KSP:ckcdeb.h KSP:ckcxla.h KSP:ckuxla.h" -
  932.           "KSP:ckcasc.h KSP:ckcnet.h KSP:ckcsym.h" -
  933.           "KSP:ckvioc.h"
  934. $   CALL MAKE ckuus4.OBJ "'CC' 'CCOPT' KSP:ckuus4" -
  935.           KSP:ckuus4.c -
  936.           "KSP:ckucmd.h KSP:ckcker.h KSP:ckuusr.h" -
  937.           "KSP:ckcdeb.h KSP:ckcxla.h KSP:ckuxla.h" -
  938.           "KSP:ckcasc.h KSP:ckcnet.h KSP:ckcsym.h" -
  939.           "KSP:ckuver.h KSP:ckvioc.h"
  940. $   CALL MAKE ckuus5.OBJ "'CC' 'CCOPT' KSP:ckuus5" -
  941.           KSP:ckuus5.c -
  942.           "KSP:ckucmd.h KSP:ckcker.h KSP:ckuusr.h" -
  943.           "KSP:ckcdeb.h KSP:ckcxla.h KSP:ckcsym.h" -
  944.           "KSP:ckcasc.h KSP:ckcnet.h KSP:ckvioc.h" -
  945.           "KSP:ckuxla.h"
  946. $   CALL MAKE ckuus6.OBJ "'CC' 'CCOPT' KSP:ckuus6" -
  947.           KSP:ckuus6.c -
  948.           "KSP:ckucmd.h KSP:ckcker.h KSP:ckuusr.h" -
  949.           "KSP:ckcdeb.h KSP:ckcasc.h KSP:ckcsym.h" -
  950.           "KSP:ckcxla.h KSP:ckcnet.h KSP:ckvioc.h" -
  951.           "KSP:ckuxla.h"
  952. $   CALL MAKE ckuus7.OBJ "'CC' 'CCOPT' KSP:ckuus7" -
  953.           KSP:ckuus7.c -
  954.           "KSP:ckucmd.h KSP:ckcker.h KSP:ckuusr.h" -
  955.           "KSP:ckcdeb.h KSP:ckcxla.h KSP:ckuxla.h" -
  956.           "KSP:ckcasc.h KSP:ckcnet.h KSP:ckcsym.h" -
  957.           "KSP:ckvioc.h"
  958. $   CALL MAKE ckuusr.OBJ "'CC' 'CCOPT' KSP:ckuusr" -
  959.           KSP:ckuusr.c -
  960.           "KSP:ckucmd.h KSP:ckcker.h KSP:ckuusr.h" -
  961.           "KSP:ckcdeb.h KSP:ckcxla.h KSP:ckuxla.h" -
  962.           "KSP:ckcasc.h KSP:ckcnet.h KSP:ckcsym.h" -
  963.           "KSP:ckvioc.h"
  964. $   CALL MAKE ckuusx.OBJ "'CC' 'CCOPT' KSP:ckuusx" -
  965.           KSP:ckuusx.c -
  966.           "KSP:ckucmd.h KSP:ckcker.h KSP:ckuusr.h" -
  967.           "KSP:ckcdeb.h KSP:ckcxla.h KSP:ckcsym.h" -
  968.           "KSP:ckcasc.h KSP:ckvvms.h KSP:ckuxla.h"
  969. $   CALL MAKE ckuusy.OBJ "'CC' 'CCOPT' KSP:ckuusy" -
  970.           KSP:ckuusy.c -
  971.           "KSP:ckucmd.h KSP:ckcker.h KSP:ckuusr.h" -
  972.           "KSP:ckcdeb.h KSP:ckcasc.h KSP:ckcsym.h" -
  973.           "KSP:ckcnet.h KSP:ckvioc.h"
  974. $   CALL MAKE ckuxla.OBJ "'CC' 'CCOPT' KSP:ckuxla" -
  975.           KSP:ckuxla.c -
  976.           "KSP:ckucmd.h KSP:ckcker.h KSP:ckcdeb.h" -
  977.           "KSP:ckcxla.h KSP:ckuxla.h KSP:ckcsym.h"
  978. $   CALL MAKE ckvcon.OBJ "'CC' 'CCOPT' KSP:ckvcon" -
  979.           KSP:ckvcon.c -
  980.           "KSP:ckcdeb.h KSP:ckcasc.h KSP:ckcker.h" -
  981.           "KSP:ckcnet.h KSP:ckvvms.h KSP:ckcxla.h" -
  982.           "KSP:ckucmd.h KSP:ckvioc.h KSP:ckuxla.h"
  983. $   CALL MAKE ckcnet.OBJ "'CC' 'CCOPT' KSP:ckcnet" -
  984.           KSP:ckcnet.c -
  985.           "KSP:ckcdeb.h KSP:ckcker.h KSP:ckcnet.h" -
  986.           "KSP:ckcsym.h KSP:ckuusr.h KSP:ckcsig.h" -
  987.           "KSP:ckvioc.h KSP:ckucmd.h"
  988. $   CALL MAKE ckctel.OBJ "'CC' 'CCOPT' KSP:ckctel" -
  989.           KSP:ckctel.c -
  990.           "KSP:ckcsym.h KSP:ckcdeb.h KSP:ckcker.h" -
  991.           "KSP:ckcnet.h KSP:ckctel.h"
  992. $   CALL MAKE ckvfio.OBJ "'CC' 'CCOPT' KSP:ckvfio" -
  993.           KSP:ckvfio.c -
  994.           "KSP:ckcdeb.h KSP:ckuver.h KSP:ckcasc.h" -
  995.           "KSP:ckcker.h KSP:ckvvms.h"
  996. $   CALL MAKE ckvtio.OBJ "'CC' 'CCOPT' KSP:ckvtio" -
  997.           KSP:ckvtio.c -
  998.           "KSP:ckcdeb.h KSP:ckcnet.h KSP:ckuver.h" -
  999.           "KSP:ckcasc.h KSP:ckcker.h KSP:ckvvms.h" -
  1000.           "KSP:ckvioc.h"
  1001. $   CALL MAKE ckvioc.OBJ "'CC' 'CCOPT' KSP:ckvioc" -
  1002.           KSP:ckvioc.c -
  1003.           "KSP:ckvioc.h KSP:ckcdeb.h"
  1004. $   CALL MAKE ckusig.OBJ "'CC' 'CCOPT' KSP:ckusig" -
  1005.           KSP:ckusig.c -
  1006.           "KSP:ckcdeb.h KSP:ckcasc.h KSP:ckcker.h" -
  1007.           "KSP:ckcnet.h KSP:ckuusr.h KSP:ckcsig.h" -
  1008.           "KSP:ckcsym.h KSP:ckvioc.h KSP:ckucmd.h"
  1009. $   if vmsv4 then -
  1010.     CALL MAKE ckvold.OBJ "'CC' 'CCOPT' KSP:ckvold" -
  1011.           KSP:ckvold.c
  1012. $!
  1013. $   say "  Linking   WERMIT at     ''f$time()"
  1014. $   CALL MAKE wermit.exe "LINK/exe=wermit.exe 'lopt' kermit.opt/opt" *.obj
  1015. $   say "Done building WERMIT at   ''f$time()"
  1016. $ goto Build_Complete
  1017. $!
  1018. $CKVCVT:
  1019. $     say "Building    CKVCVT at   ''f$time()"
  1020. $     say "  Compiling CKVCVT at   ''f$time()"
  1021. $     oldsrc = ""
  1022. $     oldobj = ""
  1023. $     if .not.vmsv4 then goto bld_ckvcvt
  1024. $         oldsrc =  "KSP:ckvold.c"
  1025. $         oldobj =  "ckvold.obj"
  1026. $         lopt = lopt + " ckvold.obj,"
  1027. $         CALL MAKE ckvold.OBJ "'CC' 'CCOPT' KSP:ckvold" -
  1028.               KSP:ckvold.c
  1029. $bld_ckvcvt:
  1030. $     CALL MAKE ckvcvt.OBJ "'CC' 'CCOPT' KSP:ckvcvt" -
  1031.              " KSP:ckvcvt.c  ''oldsrc'"
  1032. $     say "  Linking   CKVCVT at   ''f$time()"
  1033. $!
  1034. $     CALL MAKE ckvcvt.exe "LINK/exe=ckvcvt 'lopt' ckvcvt.obj,aux.opt/opt" -
  1035.               "ckvcvt.obj ''oldobj' "
  1036. $     say "Done building CKVCVT at ''f$time()"
  1037. $     if vmsv4.eq.0 then goto Build_complete
  1038. $ type sys$input
  1039.  
  1040.       Any link warning about an undefined symbol ZSYSCMD in CKVOLD
  1041.       may be safely ignored.  The SYSTEM function in CKVOLD which
  1042.       references ZSYSCMD is not used by CKVCVT, only by WERMIT.
  1043.  
  1044. $Goto Build_complete
  1045. $!
  1046. $!
  1047. $Build_MMx:
  1048. $!
  1049. $! ccopt gets _very_ loooong.  Shorten the MMS command line by prepending the
  1050. $! CCFLAGS macro to the mms file.  Note that the CC command line may now be
  1051. $! "at risk."  The OpenVMS User's Manual states:
  1052. $!
  1053. $!    Include no more than 127 elements (parameters, qualifiers, and
  1054. $!    qualifier values) in each command line.
  1055. $!
  1056. $!    Each element in a command must not exceed 255 characters.
  1057. $!    The entire command must not exceed 1024 characters after all symbols
  1058. $!    and lexical functions are converted to their values.
  1059. $!
  1060. $     open/write mmstemp ccflags.mms
  1061. $     ccopt = "CCFLAGS="+ccopt
  1062. $     write/symbol mmstemp ccopt
  1063. $     close mmstemp
  1064. $     target = "wermit"
  1065. $     if do_ckvcvt then target = "ckvcvt"
  1066. $     'Make' 'target' /des=KSP:ckvker.mms/ignore=warn -
  1067.          /macro=(cc="''CC'", linkflags="''lopt'")
  1068. $
  1069. $     say "Done building ''f$edit(target,""UPCASE"")' at ''f$time()"
  1070. $Goto Build_complete
  1071. $!
  1072. $Build_complete:
  1073. $!
  1074. $     if (noshare .ne. 1) then goto fini
  1075. $     type sys$input
  1076.  
  1077.  A link warning about an undefined symbol LIB$FIND_IMAGE_SYMBOL means
  1078.  you should link with the shareable library; add S to first parameter
  1079.  of CKVKER (and, if P5 is /NOSYSSHARE, omit that) and relink.
  1080.  
  1081. $!
  1082. $fini:
  1083. $     if f$search("kermit.opt") .nes. ""  then purge kermit.opt
  1084. $     if f$search("aux.opt") .nes. ""     then purge aux.opt
  1085. $     if f$search("ccflags.mms") .nes. "" then purge ccflags.mms
  1086. $     if f$search("wermit.exe") .nes. "" then -
  1087.         set file/protection=(g:re,w:re) wermit.exe
  1088. $     if f$search("ckvcvt.exe") .nes. "" then -
  1089.         set file/protection=(g:re,w:re) ckvcvt.exe
  1090. $     say f$fao("!/Kermit build completed  ''f$time()'!/")
  1091. $goto The_exit
  1092. $!
  1093. $CLEAN:
  1094. $     if f$search("ckwart.exe").nes."" then delete/noconf/log ckwart.exe;*
  1095. $     if f$search("*.obj")    .nes. "" then delete/noconf/log    *.obj;*
  1096. $     if f$search("ckcpro.c") .nes. "" then delete/noconf/log ckcpro.c;*
  1097. $     say f$fao("Cleanup done!/")
  1098. $ goto The_exit
  1099. $!
  1100. $!
  1101. $CY_exit:
  1102. $     $status = %x10000004
  1103. $!
  1104. $The_exit:
  1105. $     if f$trnlnm("KSP") .nes. "" then deassign KSP
  1106. $     if oldmath.eq.1 then deass mthrtl
  1107. $     if oldmath.eq.1 then deass vmthrtl
  1108. $!
  1109. $     x = f$verify(save_verify_procedure,save_verify_image)
  1110. $ exit $status
  1111. $!
  1112. $Bad_param:
  1113. $     say "ERROR: The first parameter should not include commas"
  1114. $     say "       P1 = "+ P1
  1115. $     say "       you may have used commas instead of spaces to
  1116. $     say "       separate parameters"
  1117. $Exit
  1118. $!
  1119. $MAKE: SUBROUTINE   !SUBROUTINE TO CHECK DEPENDENCIES
  1120. $! P1 = What we are trying to make
  1121. $! P2 = Command to make it
  1122. $! P3 - P8  What it depends on
  1123. $
  1124. $     If F$Search(P1) .Eqs. "" Then Goto Makeit
  1125. $     Time = F$CvTime(F$File(P1,"RDT"))
  1126. $arg=3
  1127. $Make_Loop:
  1128. $     Argument = P'arg
  1129. $     If Argument .Eqs. "" Then Goto Make_exit
  1130. $     El=0
  1131. $Loop2:
  1132. $     File = F$Element(El," ",Argument)
  1133. $     If File .Eqs. " " Then Goto Endl
  1134. $     AFile = ""
  1135. $Loop3:
  1136. $     OFile = AFile
  1137. $     AFile = F$Search(File)
  1138. $     If AFile .Eqs. "" .Or. AFile .Eqs. OFile Then Goto NextEl
  1139. $     If F$CvTime(F$File(AFile,"RDT")) .ges. Time Then Goto Makeit
  1140. $     Goto Loop3
  1141. $NextEL:
  1142. $     El = El + 1
  1143. $     Goto Loop2
  1144. $EndL:
  1145. $     arg=arg+1
  1146. $     If arg .Le. 8 Then Goto Make_Loop
  1147. $ Goto Make_Exit
  1148. $
  1149. $Makeit:
  1150. $     say P2
  1151. $     'P2'
  1152. $Make_Exit:
  1153. $     exit
  1154. $ENDSUBROUTINE
  1155. $!
  1156. $warning_exit:
  1157. $     status = $status
  1158. $     sev = $severity
  1159. $     set noon
  1160. $     xtext = f$message(status)
  1161. $     say "Warning:"
  1162. $     say "''xtext'"
  1163. $goto the_exit
  1164. $!
  1165.  
  1166.