home *** CD-ROM | disk | FTP | other *** search
/ Columbia Kermit / kermit.zip / archives / ckv201txt.zip / ckvker.com < prev    next >
Text File  |  2002-02-09  |  42KB  |  1,103 lines

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