home *** CD-ROM | disk | FTP | other *** search
/ Columbia Kermit / kermit.zip / c-kermit / ckvker.com < prev    next >
Text File  |  2020-01-01  |  52KB  |  1,382 lines

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