home *** CD-ROM | disk | FTP | other *** search
/ Columbia Kermit / kermit.zip / archives / ckv200.zip / ckvker.com < prev    next >
Text File  |  2001-11-22  |  42KB  |  1,099 lines

  1. $!
  2. $! CKVKER.COM - C-Kermit 8.0 Construction for (Open)VMS
  3. $!
  4. $! Version 1.31, 22 Nov 2001
  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. $!
  290. $Skip_Help:
  291. $!
  292. $ On Control_C then $ goto CY_Exit
  293. $ On Control_Y then $ goto CY_Exit
  294. $! On ERROR then $ goto The_exit
  295. $ On SEVERE_ERROR then $ goto The_exit
  296. $! On Warning then goto warning_exit
  297. $ save_verify_image = f$environment("VERIFY_IMAGE")
  298. $ save_verify_procedure = f$verify(0)
  299. $!
  300. $ say == "Write sys$output"
  301. $ procedure = f$environment("PROCEDURE")
  302. $ procname = f$element(0,";",procedure)
  303. $ node = f$getsyi("NODENAME")
  304. $ say "Starting ''procedure' on ''node' at ''f$time()'"
  305. $ ccopt = ""
  306. $ lopt = ""
  307. $ make = ""
  308. $ CC = "CC"
  309. $ alpha=0
  310. $ debug=0
  311. $ noshare=1
  312. $ decc=0
  313. $ vaxc=0
  314. $ verify=0
  315. $ gnuc=0
  316. $ oldmath=0
  317. $ mathlevel=0
  318. $ vmsv7=0
  319. $ havetcp=0
  320. $ ucxv5=0
  321. $ if_dot_h=0
  322. $ nomms=0
  323. $ mmsclm=264        ! maximum command length limit for MMS/MMK (estimate)
  324. $ do_ckvcvt=0
  325. $!
  326. $! Find out which OpenVMS version we are running
  327. $! (do not use IF ... ENDIF for the VMS 4 test and exit)
  328. $!
  329. $ sys_ver = f$edit(f$getsyi("version"),"compress")
  330. $ if f$extract(0,1,sys_ver) .eqs. "V" then goto Production_version
  331. $ type sys$input
  332. WARNING: You appear to be running a Field Test version of VMS.
  333.          Please exercise caution until you have verified proper operation.
  334.  
  335. $Production_version:
  336. $!
  337. $ dot = f$locate(".",sys_ver)
  338. $ sys_maj = 0+f$extract(dot-1,1,sys_ver)
  339. $ sys_min = 0+f$extract(dot+1,1,sys_ver)
  340. $!
  341. $ if sys_maj .eq. 4 then if (sys_min/2)*2 .ne. sys_min then -
  342.        sys_min = sys_min - 1
  343. $   if sys_maj .ne. 4 then goto Supported_version
  344. $     say ""
  345. $     say "         You are running VMS ''sys_ver'"
  346. $     type sys$input
  347.  
  348. WARNING: CKVKER.COM will not build VMS C-Kermit using that version of VMS.
  349.          Prebuilt images should run properly, or try CKVOLD.COM.
  350.          Please exercise caution until you have verified proper operation.
  351.  
  352. $!
  353. $goto The_exit
  354. $!
  355. $Supported_version:
  356. $!
  357. $ vms_ver = "VMS_V''sys_maj'''sys_min'"
  358. $
  359. $! VMSV70 must be defined if the VMS version is 7.0 OR GREATER, so we know
  360. $! we can include <strings.h>.
  361. $
  362. $ if vms_ver .ges."VMS_V70" then vmsv7 = 1
  363. $!
  364. $!
  365. $! Set the Kermit Source Path KSP: to be the same path as this procedure
  366. $! if the user has not specified another source with a CK_SOURCE logical
  367. $!
  368. $ if f$trnlnm("CK_SOURCE") .eqs. ""
  369. $ then
  370. $    source_device = f$parse(f$environment("procedure"),,,"device")
  371. $    source_directory = f$parse(f$environment("procedure"),,,"directory")
  372. $    define KSP 'source_device''source_directory
  373. $ else
  374. $   user_source = f$trnlnm("CK_SOURCE")
  375. $   define KSP 'user_source'
  376. $ endif
  377. $!
  378. $ if p1.nes.""
  379. $   then
  380. $    p1 = f$edit(p1,"UPCASE")
  381. $    if f$locate("V",p1).ne.f$length(p1) then verify=1
  382. $    if f$locate("D",p1).ne.f$length(p1) then debug=1
  383. $    if f$locate("S",p1).ne.f$length(p1) then noshare=0
  384. $    if f$locate("L",p1).ne.f$length(p1) then mathlevel=1
  385. $    if f$locate("M",p1).ne.f$length(p1) then nomms=1
  386. $    if f$locate("N",p1).ne.f$length(p1) then net_option="NONET"
  387. $    if f$locate("C",p1).ne.f$length(p1) then goto clean
  388. $    if f$locate("X",p1).ne.f$length(p1) then do_ckvcvt=1
  389. $!
  390. $    if f$locate("O",p1).ne.f$length(p1) then mmsclm = 1024
  391. $    if f$locate("W",p1).ne.f$length(p1) then On Warning then goto warning_exit
  392. $ endif
  393. $!
  394. $ cln_def = ""
  395. $ if p3 .nes. "" then cln_def = ","+p3  ! comma delimited string
  396. $ cln_qua = ""
  397. $ if p4 .nes. "" then cln_qua = p4
  398. $!
  399. $!
  400. $ if debug.eq.1
  401. $ then
  402. $   ccopt = "/noopt/deb"
  403. $   lopt  = "/deb/map/full/sym"
  404. $ endif
  405. $!
  406. $ if p5 .nes. ""
  407. $ then
  408. $   p5   = f$edit(p5,"UPCASE")
  409. $   lopt = lopt + p5
  410. $ endif
  411. $!
  412. $! Check for MMK/MMS
  413. $!
  414. $ if nomms .eq. 0
  415. $ then
  416. $     if f$search("sys$system:mms.exe") .nes. ""
  417. $       then
  418. $         make = "MMS"
  419. $         if (verify) then make = "MMS/LOG/VERIFY"
  420. $       endif
  421. $     if f$type(MMK) .eqs. "STRING" then make = "MMK"
  422. $     if make .nes. "" then say "Using ''make' utility"
  423. $ endif
  424. $!
  425. $! Build the option-file
  426. $!
  427. $ open/write aoptf aux.opt
  428. $ if .not. do_ckvcvt
  429. $ then
  430. $   open/write optf kermit.opt
  431. $   write optf "ckcmai.obj"
  432. $   write optf "ckclib.obj"
  433. $   write optf "ckcuni.obj"
  434. $   write optf "ckcfn2.obj"
  435. $   write optf "ckcfn3.obj"
  436. $   write optf "ckcfns.obj"
  437. $   write optf "ckcpro.obj"
  438. $   write optf "ckucmd.obj"
  439. $   write optf "ckudia.obj"
  440. $   write optf "ckuscr.obj"
  441. $   write optf "ckuus2.obj"
  442. $   write optf "ckuus3.obj"
  443. $   write optf "ckuus4.obj"
  444. $   write optf "ckuus5.obj"
  445. $   write optf "ckuus6.obj"
  446. $   write optf "ckuus7.obj"
  447. $   write optf "ckuusr.obj"
  448. $   write optf "ckuusx.obj"
  449. $   write optf "ckuusy.obj"
  450. $   write optf "ckuxla.obj"
  451. $   write optf "ckcnet.obj"
  452. $   write optf "ckctel.obj"
  453. $   write optf "ckvfio.obj"
  454. $   write optf "ckvtio.obj"
  455. $   write optf "ckvcon.obj"
  456. $   write optf "ckvioc.obj"
  457. $   write optf "ckusig.obj"
  458. $   write optf "Identification=""Kermit 8.0.200"""
  459. $ endif
  460. $!
  461. $! Look for old math-library to allow transfer of the production Kermit
  462. $! to old-fashiond VMS systems
  463. $!
  464. $ if (mathlevel .eq. 0) .and. -
  465.       (f$search("SYS$SHARE:FORTRAN$MTHRTL-VMS.EXE") .nes. "")
  466. $ then
  467. $   oldmath = 1
  468. $   define/nolog mthrtl fortran$mthrtl-vms
  469. $   define/nolog vmthrtl fortran$vmthrtl-vms
  470. $   type sys$input
  471. NOTE: You have currently DEC Fortran V6.0 or later installed, but the
  472.       old versions of the Math libraries are still available on your
  473.       system. We will link C-Kermit with these older, pre-Fortan V6
  474.       libraries so that it will run on systems which don't have Fortran
  475.       V6 installed. C-Kermit does not use any features of the new
  476.       libraries.
  477.  
  478.       You will receive %LINK-I-IDMISMCH informational messages during
  479.       linking, but these can be safely ignored.
  480. $ endif
  481. $!
  482. $! Look for the compiler used
  483. $!
  484. $ if p2.nes.""
  485. $   then
  486. $     p2 = f$edit(p2,"UPCASE")
  487. $     if f$locate("G",p2).ne.f$length(p2) then goto gnuc
  488. $     if f$locate("V",p2).ne.f$length(p2) then goto vaxc
  489. $     if f$locate("D",p2).ne.f$length(p2) then goto decc
  490. $ endif
  491. $!
  492. $DECC:
  493. $ if f$search("SYS$SYSTEM:DECC$COMPILER.EXE").nes.""
  494. $ then
  495. $   say "DECC compiler found"
  496. $   cc_ver = "DECC"
  497. $   ccopt = "/decc/unsigned_char"+ccopt
  498. $   goto compile
  499. $ endif
  500. $!
  501. $VAXC:
  502. $ if f$search("SYS$SYSTEM:VAXC.EXE").nes.""
  503. $ then
  504. $   say "VAXC compiler found, checking version..."
  505. $   cc_ver = "VAXC023"
  506. $   if f$search("sys$library:fscndef.h") .nes. "" then cc_ver = "VAXC024"
  507. $   if f$search("sys$library:ppl$routines.h") .nes. "" then cc_ver = "VAXC030"
  508. $   if f$search("sys$library:xabrudef.h") .nes. "" then cc_ver = "VAXC031"
  509. $   if (cc_ver .nes. "VAXC031")
  510. $   then
  511. $     type sys$input
  512. WARNING: Your system has an older version of the C compiler.
  513.          VMS C-Kermit was designed to be compiled under VAX C V3.1 or
  514.          newer or DEC C V1.3 or newer.  It has not been verified to
  515.          build properly under older compilers, athough pre-built C-Kermit
  516.          versions should run properly.  Please exercise caution until you
  517.          have verified proper operation.
  518.  
  519. $   endif
  520. $!  If both DECC and VAXC are in this system, then use the /vaxc qualifier
  521. $   if f$search("SYS$SYSTEM:DECC$COMPILER.EXE").nes."" then -
  522.            ccopt = "/vaxc" + ccopt
  523. $   goto compile
  524. $ endif
  525. $!
  526. $GNUC:
  527. $ if f$trnlnm("GNU_CC").nes.""
  528. $ then
  529. $   say "GNUC compiler found"
  530. $   CC="GCC"
  531. $   cc_ver="GNUC"+f$trnlnm("GNU_CC_VERSION")
  532. $!
  533. $Version_Loop:              ! convert period separator to underscore
  534. $   dot = f$locate(".",cc_ver)
  535. $   if dot .eq. f$length(cc_ver) then goto End_Version_Loop
  536. $   cc_ver[dot,1] := "_"
  537. $   goto Version_Loop
  538. $End_Version_Loop:
  539. $!
  540. $   if debug.eq.0 then ccopt = "/nolist/optimize=4"
  541. $   if .not. do_ckvcvt then write optf "gnu_cc:[000000]gcclib.olb/lib"
  542. $   write aoptf "gnu_cc:[000000]gcclib.olb/lib"
  543. $   noshare=1
  544. $   goto compile
  545. $ endif
  546. $!
  547. $! No compiler found - Warning and Exit
  548. $!
  549. $ if .not. do_ckvcvt then close optf
  550. $ close aoptf
  551. $ type sys$input
  552. FATAL: No C-compiler found - Can't build Kermit on this system.
  553.  
  554. $ goto The_exit
  555. $!
  556. $COMPILE:
  557. $!
  558. $! say "C compiler: ''cc_ver', options: ''ccopt', command: ''CC'"
  559. $ if f$getsyi("HW_MODEL").ge.1024
  560. $ then
  561. $  say f$fao("!/Operating System: OpenVMS(tm) Alpha!/")
  562. $  alpha=1
  563. $! alpha this is only option...recover a bit of DCL real estate
  564. $  ccopt = ccopt-"/decc"
  565. $! say ccopt
  566. $ else
  567. $  say f$fao("!/Operating System: OpenVMS(tm) VAX(tm)!/")
  568. $ endif
  569. $!
  570. $! cc_ver could start with VAXC; DECC; or GNUC
  571. $!
  572. $! The VMS linker default is to link /SYSSHR
  573. $!
  574. $! C-Kermit default is to link w/ shareable libraries on Alpha
  575. $! and w/ object libraries on VAX. For backwards compatibility, use
  576. $! p1 "S", to use shareable libraries on VAX, and p5 "/NOSYSSHARE" to
  577. $! use object libraries on Alpha.
  578. $!
  579. $ if (cc_ver.gts."DECC" .and. f$search("sys$share:vaxcrtl.exe").eqs."") .or. -
  580.      (alpha.eq.0 .and. vms_ver .lts. "VMS_V52") .or. -
  581.      (alpha.eq.0 .and. noshare.eq.1) .or. -
  582.      (alpha.eq.1 .and. (f$locate("/NOSYSS",p5).ne.f$length(p5)) )
  583. $   then
  584. $     noshare = 1
  585. $     share_opt = "NOVMSSHARE"
  586. $     share_text = "system OLBs and"
  587. $   else
  588. $     noshare = 0
  589. $     share_opt = "VMSSHARE"
  590. $     share_text = "shareable libs and"
  591. $ endif
  592. $!
  593. $!      Find out which network to use
  594. $!
  595. $! Type:
  596. $!    net_option = "NONET"
  597. $! before running this procedure to build C-Kermit without TCP/IP network
  598. $! support on a system that has a TCP/IP package installed, or use the
  599. $! N command-line option to force NONET.
  600. $!
  601. $!
  602. $ if f$search("SYS$LIBRARY:TCPIP$IPC_SHR.EXE") .nes. "" then ucxv5 = 1
  603. $ if do_ckvcvt
  604. $ then
  605. $   net_option = "NONET"
  606. $   goto Net_Done
  607. $ endif
  608. $!
  609. $ if f$type(net_option) .eqs. "STRING"
  610. $ then
  611. $   say "Network option override = ''net_option'"
  612. $   net_option = f$edit(net_option,"UPCASE")
  613. $   goto Net_Done
  614. $ endif
  615. $!
  616. $ net_option = "NONET"
  617. $ if f$search("MULTINET:MULTINET_SOCKET_LIBRARY.EXE") .nes. ""
  618. $ then
  619. $   net_option = "MULTINET"
  620. $ else
  621. $  if f$search("TCPWARE:UCX$IPC.OLB") .nes. ""
  622. $  then
  623. $    net_option = "TCPWARE"
  624. $  else
  625. $   if f$search("TWG$TCP:[NETDIST.LIB]TWGLIB.OLB") .nes. ""
  626. $   then
  627. $     net_option = "WINTCP"
  628. $   else
  629. $    if (f$search("SYS$LIBRARY:UCX$ACCESS_SHR.EXE") .nes. "") -
  630.        .or. (f$search("SYS$LIBRARY:TCPIP$ACCESS_SHR.EXE") .nes. "")
  631. $    then
  632. $      net_option = "DEC_TCPIP"
  633. $    else
  634. $     if f$search(f$parse(f$trnlnm("LIBCMU"),-
  635.                          "cmuip_root:[syslib]libcmu.olb")) .nes. ""
  636. $     then
  637. $       net_option = "CMU_TCPIP"
  638. $     endif ! CMU TCP/IP
  639. $    endif ! DEC TCP/IP
  640. $   endif ! Wollongong
  641. $  endif ! Process
  642. $ endif ! MultiNet
  643. $!
  644. $!
  645. $ Net_Done:
  646. $!
  647. $ if f$type(net_option) .eqs. ""
  648. $ then
  649. $   net_option = "NONET"
  650. $ endif
  651. $!
  652. $ if net_option .eqs. "NONET"
  653. $ then
  654. $   net_name = "no"
  655. $ else
  656. $  havetcp = 1
  657. $  if net_option .eqs. "MULTINET"
  658. $  then
  659. $    net_name = "MultiNet"
  660. $    write optf "multinet:multinet_socket_library.exe/share"
  661. $  else
  662. $   if net_option .eqs. "TCPWARE"
  663. $   then
  664. $    net_name = "Process Software TCPware"
  665. $    write optf "tcpware:ucx$ipc.olb/library"
  666. $    net_option = "TCPWARE,DEC_TCPIP"
  667. $   else
  668. $    if net_option .eqs. "WINTCP"
  669. $    then
  670. $      net_name = "WIN/TCP"
  671. $      define/nolog vaxc$include twg$tcp:[netdist.include],sys$library
  672. $      @twg$tcp:[netdist.misc]def
  673. $      if noshare .eq. 0
  674. $        then write optf "twglib/share"
  675. $        else write optf "twg$common:[netdist.lib]twglib.olb/library"
  676. $      endif
  677. $    else
  678. $     if net_option .eqs. "DEC_TCPIP"                !+1.24
  679. $     then
  680. $       net_name = "DEC TCP/IP Services for OpenVMS(tm)"
  681. $       if alpha.eq.0
  682. $         then
  683. $         if ucxv5
  684. $           then
  685. $           write optf "sys$library:tcpip$ipc_shr.exe/share" !1.31
  686. $         else write optf "sys$library:ucx$ipc.olb/library"
  687. $         endif
  688. $       endif                            !-1.24
  689. $     else
  690. $      if net_option .eqs. "CMU_TCPIP"
  691. $      then
  692. $        net_name = "CMU-OpenVMS/IP"
  693. $        libcmu = f$search(f$parse(f$trnlnm("LIBCMU"), -
  694.                                    "cmuip_root:[syslib]libcmu.olb"))
  695. $        write optf "''libcmu'/library"
  696. $      else
  697. $        say "Unknown net_option: ''net_option'"
  698. $        net_option = "NONET"
  699. $        net_name = "no"
  700. $      endif ! None
  701. $     endif ! CMU TCP/IP
  702. $    endif ! DEC TCP/IP
  703. $   endif ! Wollongong
  704. $  endif ! Process
  705. $ endif ! MultiNet
  706. $
  707. $ if f$search("SYS$COMMON:[DECC$LIB.REFERENCE.DECC$RTLDEF]IF.H") -
  708.    .nes. "" then if_dot_h = 1
  709. $ if f$search("SYS$LIBRARY:TCPIP$IPC_SHR.EXE") .nes. "" then ucxv5 = 1
  710. $ if net_option .nes. "DEC_TCPIP" then ucxv5 = 0
  711. $ if net_option .nes. "DEC_TCPIP" then if_dot_h = 0
  712. $!
  713. $! Now specify the appropriate VAXCRTL
  714. $! then close the option-files
  715. $!
  716. $ if (noshare.eq.1) .and. -
  717.    ((cc_ver.gts."DECC") .or. (net_option .eqs. "CMU_TCPIP"))
  718. $  then
  719. $    if .not. do_ckvcvt then write optf "sys$share:vaxcrtl.olb/lib"
  720. $    write aoptf "sys$share:vaxcrtl.olb/lib"
  721. $  endif
  722. $!
  723. $ if (noshare.eq.0) .and. -
  724.    ((cc_ver.gts."DECC") .or. (net_option .eqs. "CMU_TCPIP"))
  725. $ then
  726. $   if .not. do_ckvcvt then write  optf "sys$share:vaxcrtl.exe/share"
  727. $   write aoptf "sys$share:vaxcrtl.exe/share"
  728. $ endif
  729. $!
  730. $! Close the option-files
  731. $!
  732. $ if .not. do_ckvcvt then close optf
  733. $ close aoptf
  734. $!
  735. $! Set compile prefix as a function of the TCP/IP stack for DEC C.  The
  736. $! /PREFIX_LIBRARY_ENTRIES business is needed for MultiNet 3.2 and earlier,
  737. $! but is not needed for 4.0.  Not sure about WINTCP.  Not sure where the
  738. $! cutoff is.  CAUTION: There are limits on how long statements can be, and
  739. $! how long string constants can be, and how long strings can be, even when
  740. $! formed as below, by repeated concatenation.  These limits start out at
  741. $! 254 or so, and go up to maybe 1023.  Don't add anything to these
  742. $! strings (spaces, etc) that doesn't need to be there.
  743. $!
  744. $! also, DEC C and VMS >= 7.0 has its own ioctl
  745. $!
  746. $ if cc_ver.eqs."DECC"
  747. $ then
  748. $   if (net_option .eqs. "MULTINET") .or. (net_option .eqs. "WINTCP")
  749. $   then
  750. $     say "Adding /PREFIX for DECC and Multinet.."
  751. $     ccopt = ccopt + "/PREF=(AL,EX=("
  752. $     ccopt = ccopt + "accept,bind,connect,listen,select,"
  753. $     ccopt = ccopt + "socket,recv,send,sendmsg,getservbyname,"
  754. $     ccopt = ccopt + "getpeername,getsockname,getsockopt,setsockopt,"
  755. $     ccopt = ccopt + "gethostbyname,gethostbyaddr,inet_addr,"
  756. $     ccopt = ccopt + "inet_ntoa,htons,ntohs))"
  757. $   else
  758. $     if vms_ver .ges."VMS_V70" .and. -
  759.          f$locate("DEC_TCPIP",net_option) .ne. f$length(net_option)
  760. $     then
  761. $       ccopt = ccopt + "/PREFIX_LIBRARY_ENTRIES=(AL,EX=ioctl)"
  762. $     else
  763. $       ccopt = ccopt + "/PREFIX_LIBRARY_ENTRIES=(ALL_ENTRIES)"
  764. $     endif
  765. $   endif
  766. $ endif
  767. $!
  768. $! CFLAGS equivalent - local site options are added here
  769. $!
  770. $ if vmsv7 then cln_def = cln_def+",VMSV70"
  771. $ if ucxv5 then cln_def = cln_def+",UCX50"
  772. $ if if_dot_h then cln_def = cln_def+",IF_DOT_H"
  773. $ if havetcp then cln_def = cln_def+",TCPSOCKET"
  774. $!
  775. $ ccdef="/def=(''net_option',''cc_ver',''vms_ver',''share_opt'"+-
  776.         "''cln_def')''cln_qua'"
  777. $! say "length of ccopt is ''f$length(ccopt)'"
  778. $! say "length of ccdef is ''f$length(ccdef)'"
  779. $ ccopt = ccopt + ccdef
  780. $ mmscln = f$length(ccopt)
  781. $ if make .nes "" .and. mmscln .ge. mmsclm
  782. $   then
  783. $say "Warning: The 'ccopt' command is ''mmscln' characters which could make"
  784. $say " the ''make' procedure fail. You may continue on by restarting with"
  785. $say " either O (over-ride) flag or M (no MM_) flag set."
  786. $ goto The_exit
  787. $ endif
  788. $!
  789. $! To facilitate batch mode compilation, append /NOLIST and /NOMAP to
  790. $! the compiler and linker options (not needed for INTERACTIVE or MMx)
  791. $!
  792. $ if (f$mode() .eqs. "BATCH") .and. (make .eqs. "")
  793. $ then
  794. $   ccopt = ccopt + "/NOLIST"
  795. $   if debug .eq. 0 then lopt =  lopt + "/NOMAP"
  796. $ endif
  797. $!
  798. $ say "Compiling Kermit sources ..."
  799. $ set noon
  800. $ tempsymb = "CCOPT = ""''ccopt'"""
  801. $ write/symbol sys$output tempsymb
  802. $ say "Kermit Source Path = ''f$trnlnm(""KSP"")'"
  803. $ set on
  804. $ if .not. do_ckvcvt then say -
  805.  "Building WERMIT with ''share_text' ''net_name' network support at ''f$time()"
  806. $! if vmsv7 then say "VMSV7 detected"
  807. $! if ucxv5 then say "UCXV5 detected"
  808. $! if if_dot_h then say "<if.h> detected"
  809. $ if Make.eqs.""
  810. $ then
  811. $!
  812. $   if do_ckvcvt then goto CKVCVT
  813. $!
  814. $! Build the thing plain
  815. $!
  816. $   say ""
  817. $   show symb ccopt
  818. $   show symb lopt
  819. $   say ""
  820. $   say "  Compiling CKWART at ''f$time()"
  821. $!
  822. $! Note the use of single quotes (') apostrophe than double ('') in quoting
  823. $! CCOPT, to prevent CCOPT from being expanded prior to the MAKE call, which
  824. $! could result in the string being too long.  Using ' rather than '' forces
  825. $! evaluation of CCOPT to occure in the MAKE routine itself.
  826. $!
  827. $   CALL MAKE ckwart.OBJ "'CC' 'CCOPT' KSP:ckwart" -
  828.               KSP:ckwart.c
  829. $   say "  Linking   CKWART at ''f$time()"
  830. $!
  831. $   call make ckwart.exe "LINK  ckwart,aux.opt/opt/NOMAP" ckwart.obj
  832. $   say "  Running   CKWART at ''f$time()"
  833. $   ckwart = "$" +f$parse("CKWART.EXE",,,"DEVICE") +-
  834.             f$parse("CKWART.EXE",,,"DIRECTORY") + "CKWART"
  835. $   CALL MAKE ckcpro.c "ckwart  KSP:ckcpro.w ckcpro.c" -
  836.              " KSP:ckcpro.w "
  837. $   say f$fao("!/  Compiling WERMIT files at ''f$time()")
  838. $!
  839. $! Note how MAKE args are combined in quotes to get around the limitation
  840. $! on the number of arguments to a DCL procedure.
  841. $!
  842. $   CALL MAKE ckcmai.OBJ "'CC' 'CCOPT' KSP:ckcmai" -
  843.           KSP:ckcmai.c -
  844.           "KSP:ckcker.h KSP:ckcdeb.h KSP:ckcsym.h" -
  845.           "KSP:ckcasc.h KSP:ckcnet.h KSP:ckcsig.h" -
  846.           "KSP:ckuusr.h KSP:ckvioc.h KSP:ckucmd.h"
  847. $   CALL MAKE ckclib.OBJ "'CC' 'CCOPT' KSP:ckclib" -
  848.           KSP:ckclib.c -
  849.           "KSP:ckcdeb.h KSP:ckcsym.h KSP:ckcasc.h"
  850. $   CALL MAKE ckcfn2.OBJ "'CC' 'CCOPT' KSP:ckcfn2" -
  851.           KSP:ckcfn2.c -
  852.           "KSP:ckcker.h KSP:ckcdeb.h KSP:ckcsym.h" -
  853.           "KSP:ckcasc.h KSP:ckcxla.h KSP:ckuxla.h"
  854. $   CALL MAKE ckcfn3.OBJ "'CC' 'CCOPT' KSP:ckcfn3" -
  855.           KSP:ckcfn3.c -
  856.           "KSP:ckcker.h KSP:ckcdeb.h KSP:ckcsym.h" -
  857.           "KSP:ckcasc.h KSP:ckcxla.h KSP:ckuxla.h"
  858. $   CALL MAKE ckcfns.OBJ "'CC' 'CCOPT' KSP:ckcfns" -
  859.           KSP:ckcfns.c -
  860.           "KSP:ckcker.h KSP:ckcdeb.h KSP:ckcsym.h" -
  861.           "KSP:ckcasc.h KSP:ckcxla.h KSP:ckuxla.h"
  862. $   CALL MAKE ckcpro.OBJ "'CC' 'CCOPT'/INCL=KSP: ckcpro" -
  863.           ckcpro.c -
  864.           "KSP:ckcker.h KSP:ckcdeb.h KSP:ckcasc.h" -
  865.           "KSP:ckcsym.h KSP:ckcnet.h KSP:ckvioc.h"
  866. $   CALL MAKE ckucmd.OBJ "'CC' 'CCOPT' KSP:ckucmd" -
  867.           KSP:ckucmd.c -
  868.           "KSP:ckcasc.h KSP:ckucmd.h KSP:ckcdeb.h" -
  869.           "KSP:ckcsym.h KSP:ckcker.h KSP:ckuusr.h" -
  870.           "KSP:ckucmd.h"
  871. $   CALL MAKE ckudia.OBJ "'CC' 'CCOPT' KSP:ckudia" -
  872.           KSP:ckudia.c -
  873.           "KSP:ckcker.h KSP:ckcdeb.h KSP:ckucmd.h" -
  874.           "KSP:ckcasc.h KSP:ckcsig.h KSP:ckcnet.h" -
  875.           "KSP:ckcsym.h KSP:ckuusr.h KSP:ckvioc.h"
  876. $   CALL MAKE ckuscr.OBJ "'CC' 'CCOPT' KSP:ckuscr" -
  877.           KSP:ckuscr.c -
  878.           "KSP:ckcker.h KSP:ckcdeb.h KSP:ckcasc.h" -
  879.           "KSP:ckcsig.h KSP:ckcsym.h KSP:ckuusr.h" -
  880.           "KSP:ckcnet.h KSP:ckvioc.h KSP:ckucmd.h"
  881. $   CALL MAKE ckuus2.OBJ "'CC' 'CCOPT' KSP:ckuus2" -
  882.           KSP:ckuus2.c -
  883.           "KSP:ckucmd.h KSP:ckcker.h KSP:ckuusr.h" -
  884.           "KSP:ckcdeb.h KSP:ckcxla.h KSP:ckuxla.h" -
  885.           "KSP:ckcasc.h KSP:ckcsym.h KSP:ckcnet.h" -
  886.           "KSP:ckvioc.h"
  887. $   CALL MAKE ckuus3.OBJ "'CC' 'CCOPT' KSP:ckuus3" -
  888.           KSP:ckuus3.c -
  889.           "KSP:ckucmd.h KSP:ckcker.h KSP:ckuusr.h" -
  890.           "KSP:ckcdeb.h KSP:ckcxla.h KSP:ckuxla.h" -
  891.           "KSP:ckcasc.h KSP:ckcnet.h KSP:ckcsym.h" -
  892.           "KSP:ckvioc.h"
  893. $   CALL MAKE ckuus4.OBJ "'CC' 'CCOPT' KSP:ckuus4" -
  894.           KSP:ckuus4.c -
  895.           "KSP:ckucmd.h KSP:ckcker.h KSP:ckuusr.h" -
  896.           "KSP:ckcdeb.h KSP:ckcxla.h KSP:ckuxla.h" -
  897.           "KSP:ckcasc.h KSP:ckcnet.h KSP:ckcsym.h" -
  898.           "KSP:ckuver.h KSP:ckvioc.h"
  899. $   CALL MAKE ckuus5.OBJ "'CC' 'CCOPT' KSP:ckuus5" -
  900.           KSP:ckuus5.c -
  901.           "KSP:ckucmd.h KSP:ckcker.h KSP:ckuusr.h" -
  902.           "KSP:ckcdeb.h KSP:ckcxla.h KSP:ckcsym.h" -
  903.           "KSP:ckcasc.h KSP:ckcnet.h KSP:ckvioc.h" -
  904.           "KSP:ckuxla.h"
  905. $   CALL MAKE ckuus6.OBJ "'CC' 'CCOPT' KSP:ckuus6" -
  906.           KSP:ckuus6.c -
  907.           "KSP:ckucmd.h KSP:ckcker.h KSP:ckuusr.h" -
  908.           "KSP:ckcdeb.h KSP:ckcasc.h KSP:ckcsym.h" -
  909.           "KSP:ckcxla.h KSP:ckcnet.h KSP:ckvioc.h" -
  910.           "KSP:ckuxla.h"
  911. $   CALL MAKE ckuus7.OBJ "'CC' 'CCOPT' KSP:ckuus7" -
  912.           KSP:ckuus7.c -
  913.           "KSP:ckucmd.h KSP:ckcker.h KSP:ckuusr.h" -
  914.           "KSP:ckcdeb.h KSP:ckcxla.h KSP:ckuxla.h" -
  915.           "KSP:ckcasc.h KSP:ckcnet.h KSP:ckcsym.h" -
  916.           "KSP:ckvioc.h"
  917. $   CALL MAKE ckuusr.OBJ "'CC' 'CCOPT' KSP:ckuusr" -
  918.           KSP:ckuusr.c -
  919.           "KSP:ckucmd.h KSP:ckcker.h KSP:ckuusr.h" -
  920.           "KSP:ckcdeb.h KSP:ckcxla.h KSP:ckuxla.h" -
  921.           "KSP:ckcasc.h KSP:ckcnet.h KSP:ckcsym.h" -
  922.           "KSP:ckvioc.h KSP:ckctel.h"
  923. $   CALL MAKE ckuusx.OBJ "'CC' 'CCOPT' KSP:ckuusx" -
  924.           KSP:ckuusx.c -
  925.           "KSP:ckucmd.h KSP:ckcker.h KSP:ckuusr.h" -
  926.           "KSP:ckcdeb.h KSP:ckcxla.h KSP:ckcsym.h" -
  927.           "KSP:ckcasc.h KSP:ckvvms.h KSP:ckuxla.h"
  928. $   CALL MAKE ckuusy.OBJ "'CC' 'CCOPT' KSP:ckuusy" -
  929.           KSP:ckuusy.c -
  930.           "KSP:ckucmd.h KSP:ckcker.h KSP:ckuusr.h" -
  931.           "KSP:ckcdeb.h KSP:ckcasc.h KSP:ckcsym.h" -
  932.           "KSP:ckcnet.h KSP:ckvioc.h"
  933. $   CALL MAKE ckcuni.OBJ "'CC' 'CCOPT' KSP:ckcuni" -
  934.           KSP:ckcuni.c -
  935.           "KSP:ckcdeb.h KSP:ckcker.h KSP:ckcxla.h" -
  936.           "KSP:ckuxla.h KSP:ckucmd.h"
  937. $   CALL MAKE ckuxla.OBJ "'CC' 'CCOPT' KSP:ckuxla" -
  938.           KSP:ckuxla.c -
  939.           "KSP:ckucmd.h KSP:ckcker.h KSP:ckcdeb.h" -
  940.           "KSP:ckcxla.h KSP:ckuxla.h KSP:ckcsym.h"
  941. $   CALL MAKE ckcnet.OBJ "'CC' 'CCOPT' KSP:ckcnet" -
  942.           KSP:ckcnet.c -
  943.           "KSP:ckcdeb.h KSP:ckcker.h KSP:ckcnet.h" -
  944.           "KSP:ckcsym.h KSP:ckuusr.h KSP:ckcsig.h" -
  945.           "KSP:ckvioc.h KSP:ckucmd.h"
  946. $   CALL MAKE ckctel.OBJ "'CC' 'CCOPT' KSP:ckctel" -
  947.           KSP:ckctel.c -
  948.           "KSP:ckcsym.h KSP:ckcdeb.h KSP:ckcker.h" -
  949.           "KSP:ckcnet.h KSP:ckctel.h"
  950. $   CALL MAKE ckvfio.OBJ "'CC' 'CCOPT' KSP:ckvfio" -
  951.           KSP:ckvfio.c -
  952.           "KSP:ckcdeb.h KSP:ckuver.h KSP:ckcasc.h" -
  953.           "KSP:ckcker.h KSP:ckvvms.h"
  954. $   CALL MAKE ckvtio.OBJ "'CC' 'CCOPT' KSP:ckvtio" -
  955.           KSP:ckvtio.c -
  956.           "KSP:ckcdeb.h KSP:ckcnet.h KSP:ckuver.h" -
  957.           "KSP:ckcasc.h KSP:ckcker.h KSP:ckvvms.h" -
  958.           "KSP:ckvioc.h"
  959. $   CALL MAKE ckvcon.OBJ "'CC' 'CCOPT' KSP:ckvcon" -
  960.           KSP:ckvcon.c -
  961.           "KSP:ckcdeb.h KSP:ckcasc.h KSP:ckcker.h" -
  962.           "KSP:ckcnet.h KSP:ckvvms.h KSP:ckcxla.h" -
  963.           "KSP:ckucmd.h KSP:ckvioc.h KSP:ckuxla.h"
  964. $   CALL MAKE ckvioc.OBJ "'CC' 'CCOPT' KSP:ckvioc" -
  965.           KSP:ckvioc.c -
  966.           "KSP:ckvioc.h KSP:ckcdeb.h"
  967. $   CALL MAKE ckusig.OBJ "'CC' 'CCOPT' KSP:ckusig" -
  968.           KSP:ckusig.c -
  969.           "KSP:ckcdeb.h KSP:ckcasc.h KSP:ckcker.h" -
  970.           "KSP:ckcnet.h KSP:ckuusr.h KSP:ckcsig.h" -
  971.           "KSP:ckcsym.h KSP:ckvioc.h KSP:ckucmd.h"
  972. $   say "  Linking WERMIT at ''f$time()"
  973. $   CALL MAKE wermit.exe "LINK/exe=wermit.exe 'lopt' kermit.opt/opt" *.obj
  974. $   say "Done building WERMIT at ''f$time()"
  975. $ goto The_exit
  976. $!
  977. $!
  978. $CKVCVT:
  979. $   say f$fao("!/Building CKVCVT at ''f$time()")
  980. $   say "  Compiling CKVCVT at ''f$time()"
  981. $   CALL MAKE ckvcvt.OBJ "'CC' 'CCOPT' KSP:ckvcvt" -
  982.               KSP:ckvcvt.c
  983. $   say "  Linking   CKVCVT at ''f$time()"
  984. $   CALL MAKE ckvcvt.exe "LINK 'lopt' ckvcvt.obj,aux.opt/opt" ckvcvt.obj
  985. $   write sys$output "Done building CKVCVT at ''f$time()"
  986. $ else
  987. $! ccopt gets _very_ loooong.  Shorten the MMS command line by prepending the
  988. $! CCFLAGS macro to the mms file.  Note that the CC command line may now be
  989. $! "at risk."  The OpenVMS User's Manual states:
  990. $!
  991. $!    Include no more than 127 elements (parameters, qualifiers, and
  992. $!    qualifier values) in each command line.
  993. $!
  994. $!    Each element in a command must not exceed 255 characters.
  995. $!    The entire command must not exceed 1024 characters after all symbols
  996. $!    and lexical functions are converted to their values.
  997. $!
  998. $   open/write mmstemp ccflags.mms
  999. $   ccopt = "CCFLAGS="+ccopt
  1000. $   write/symbol mmstemp ccopt
  1001. $   close mmstemp
  1002. $!
  1003. $   target = "wermit"
  1004. $   if do_ckvcvt then target = "ckvcvt"
  1005. $   'Make' 'target' /des=KSP:ckvker.mms/ignore=warn -
  1006.           /macro=(cc="''CC'", linkflags="''lopt'")
  1007. $ endif    ! make/mms
  1008. $ if (noshare .eq. 1)
  1009. $ then
  1010. $   type sys$input
  1011.  
  1012.  A link warning about an undefined symbol LIB$FIND_IMAGE_SYMBOL means
  1013.  you should link with the shareable library; add S to first parameter
  1014.  of CKVKER (and, if P5 is /NOSYSSHARE, omit that) and relink.
  1015.  
  1016. $ endif
  1017. $ if f$search("kermit.opt") .nes. "" then purge kermit.opt
  1018. $ if f$search("aux.opt") .nes. "" then purge aux.opt
  1019. $ if f$search("ccflags.mms") .nes. "" then purge ccflags.mms
  1020. $ if f$search("wermit.exe") .nes. "" then -
  1021.      set file/protection=(g:re,w:re) wermit.exe
  1022. $ if f$search("ckvcvt.exe") .nes. "" then -
  1023.      set file/protection=(g:re,w:re) ckvcvt.exe
  1024. $ say "Kermit build completed"
  1025. $goto The_exit
  1026. $!
  1027. $CLEAN:
  1028. $ if f$search("ckwart.exe") .nes. "" then delete/noconf/log ckwart.exe;*
  1029. $ if f$search("*.obj")      .nes. "" then delete/noconf/log *.obj;*
  1030. $ if f$search("ckcpro.c")   .nes. "" then delete/noconf/log ckcpro.c;*
  1031. $ say "Cleanup done"
  1032. $ say ""
  1033. $ goto The_exit
  1034. $!
  1035. $CY_exit:
  1036. $ $status = %x10000004
  1037. $!
  1038. $The_exit:
  1039. $ if f$trnlnm("KSP") .nes. "" then deassign KSP
  1040. $ if oldmath.eq.1 then deass mthrtl
  1041. $ if oldmath.eq.1 then deass vmthrtl
  1042. $!
  1043. $ x = f$verify(save_verify_procedure,save_verify_image)
  1044. $ exit $status
  1045. $!
  1046. $Bad_param:
  1047. $ write sys$output "ERROR: The first parameter should not include commas"
  1048. $ write sys$output "       P1 = "+ P1
  1049. $ write sys$output "       you may have used commas instead of spaces to
  1050. $ write sys$output "       seperate parameters"
  1051. $Exit
  1052. $!
  1053. $MAKE: SUBROUTINE   !SUBROUTINE TO CHECK DEPENDENCIES
  1054. $! P1 = What we are trying to make
  1055. $! P2 = Command to make it
  1056. $! P3 - P8  What it depends on
  1057. $
  1058. $ If F$Search(P1) .Eqs. "" Then Goto Makeit
  1059. $ Time = F$CvTime(F$File(P1,"RDT"))
  1060. $arg=3
  1061. $Make_Loop:
  1062. $       Argument = P'arg
  1063. $       If Argument .Eqs. "" Then Goto Make_exit
  1064. $       El=0
  1065. $Loop2:
  1066. $       File = F$Element(El," ",Argument)
  1067. $       If File .Eqs. " " Then Goto Endl
  1068. $       AFile = ""
  1069. $Loop3:
  1070. $       OFile = AFile
  1071. $       AFile = F$Search(File)
  1072. $       If AFile .Eqs. "" .Or. AFile .Eqs. OFile Then Goto NextEl
  1073. $       If F$CvTime(F$File(AFile,"RDT")) .Ges. Time Then Goto Makeit
  1074. $       Goto Loop3
  1075. $NextEL:
  1076. $       El = El + 1
  1077. $       Goto Loop2
  1078. $EndL:
  1079. $ arg=arg+1
  1080. $ If arg .Le. 8 Then Goto Make_Loop
  1081. $ Goto Make_Exit
  1082. $
  1083. $Makeit:
  1084. $ say P2
  1085. $ 'P2'
  1086. $Make_Exit:
  1087. $ exit
  1088. $ENDSUBROUTINE
  1089. $!
  1090. $warning_exit:
  1091. $ status = $status
  1092. $ sev = $severity
  1093. $ set noon
  1094. $ xtext = f$message(status)
  1095. $ say "Warning:"
  1096. $ say "''xtext'"
  1097. $ goto the_exit
  1098. $!
  1099.