home *** CD-ROM | disk | FTP | other *** search
/ Columbia Kermit / kermit.zip / archives / ckc197.zip / ckvker.com < prev    next >
Text File  |  2000-02-27  |  42KB  |  1,098 lines

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