home *** CD-ROM | disk | FTP | other *** search
/ Columbia Kermit / kermit.zip / c-kermit / ckvold.com < prev    next >
Text File  |  2020-01-01  |  45KB  |  1,192 lines

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