home *** CD-ROM | disk | FTP | other *** search
/ Columbia Kermit / kermit.zip / archives / ckv201.zip / ckvold.com < prev    next >
Text File  |  2001-12-11  |  45KB  |  1,164 lines

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