home *** CD-ROM | disk | FTP | other *** search
/ Columbia Kermit / kermit.zip / archives / ckv209txt.zip / ckvker.com < prev    next >
Text File  |  2002-11-29  |  45KB  |  1,171 lines

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