home *** CD-ROM | disk | FTP | other *** search
/ Columbia Kermit / kermit.zip / archives / ckv192.zip / ckvold.com < prev    next >
Text File  |  1996-12-28  |  41KB  |  1,085 lines

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