home *** CD-ROM | disk | FTP | other *** search
/ Columbia Kermit / kermit.zip / archives / ckv192.zip / ckvker.com < prev    next >
Text File  |  1996-12-28  |  36KB  |  979 lines

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