home *** CD-ROM | disk | FTP | other *** search
/ Columbia Kermit / kermit.zip / archives / ckv211txt.zip / ckvker.com < prev    next >
Text File  |  2004-04-11  |  46KB  |  1,198 lines

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