home *** CD-ROM | disk | FTP | other *** search
/ kermit.columbia.edu / kermit.columbia.edu.tar / kermit.columbia.edu / tmp4 / ckvker.com < prev    next >
Text File  |  2007-02-27  |  48KB  |  1,272 lines

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