-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathckvker.com
More file actions
1587 lines (1549 loc) · 56.7 KB
/
ckvker.com
File metadata and controls
1587 lines (1549 loc) · 56.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
$!
$! CKVKER.COM - C-Kermit 9.0-10.0 Construction for (Open)VMS
$!
$! Version 1.48+sms, 15-Nov-2022, 04-May-2023
$!
$! DCL usage requires VMS 5.0 or higher - use CKVOLD.COM for VMS 4.x.
$!
$ p1 = f$edit( p1, "UPCASE")
$ p1_len = f$length( p1)
$! Provide help if P1 includes "H" or "?".
$ if p1 .eqs. "" then goto Skip_Help
$ if (f$locate( "H", p1) .eq. p1_len) .and. -
(f$locate( "?", p1) .eq. p1_len) then goto Skip_Help
$! Reject comma in P1.
$ if (f$locate( ",", p1) .ne. p1_len) then goto Bad_param
$!
$Help:
$type sys$input
Usage:
$ @[directory]ckvker [ p1 [ p2 [ p3 [ p4 [ p5 ] ] ] ] ]
P1 = Build options
P2 = Compiler selection
P3 = C-Kermit DEFINES
P4 = Additional compiler qualifiers (like /LIST/SHOW=INCLUDE)
P5 = Link Qualifiers
P6 = ZLIB LIBZ.OLB directory (if required by OpenSSL)
P1 Build options (no white space, or enclose in quotes):
A = Use DCL symbol ARCH to specify hardware architecture
manually: ARCH="<hw_arch>"
Also ignore missing compiler, but user may also want to set
DCL symbol like: CC_VER="DECC" or CC_VER="XDECC"
B = Link with SSL object libraries (.OLB) instead of shared
images (.EXE, default).
C = clean (remove object files, etc. "CC" = remove more.)
D = compile and link /DEBUG (Create map files, etc.)
F = DISABLE large-file support (See LARGE_FILE NOTES below.)
H = display help message
I = DISABLE internal FTP (it's enabled by default in network builds)
L = RTL version level -- link with latest math RTL
M = don't use MMS or MMK; use the DCL MAKE subroutine herein
N = build with no network support
O = override the limit on MMS/MMK command line length
S = share (VAX C default is noshare, i.e. no shared VAXCRTL)
V = turn on verify
W = exit on warnings
X = build CKVCVT rather than C-Kermit
"" = Null place holder; use the defaults
P2 compiler_selection
D = DEC C
V = VAX C
G = GNU C
"" = Use the first compiler found, searching in the above order.
P3 C-Kermit options (C macros, comma-separated, enclosed in quotes
if more than one) including:
"" Empty string. Include this if you want none of these
options, and other parameters follow.
BUGFILL7 If you get %CC-E-NEEDMEMBER, '"xab$b_bkz" is not a member
of "xaball_ofile"'. (Effectively implies NOCONVROUTINES.)
CK_SSL includes SSL/TLS support for secure connections. OpenSSL
CKSSL111 logical names will override vendor-supplied SSL kit.
As of Kermit version 9.0.305 (or so), OpenSSL 1.1.1 (or
later) is required, so logical names like OSSL$INCLUDE
(OpenSSL), or SSL111$INCLUDE or SSL3$INCLUDE (VSI SSL),
will be used, with VSI SSL3 preferred over VSI SSL111 if
both are installed. Specify CK_SSL111 to use VSI SSL111
if VSI SSL3 is also installed.
CK_SSL0 Do not define C macro OPENSSL_100 (generally unwise).
INTSELECT If you get %CC-W-PTRMISMATCH on statements with select().
NEEDUINT If you get complaints about "u_int" not defined (TCPware5.4)
NOCONVROUTINES If <conv$routines.h> not found (VMS 6.1 / UCX 4.1).
NODEBUG To reduce size of executable.
NOPUSH prevents escape to DCL or running external programs.
OLDFIB If you get %CC-I-NONSEQUITUR on statements with ut_fib.
OLDIP Use a very old TCP/IP run-time scheme (where "very old" is
not precisely known, but pre-dates VMS V5.4, VAX C V3.1-051,
UCX V1.3).
NOTE: SSL-enabled binaries may be restricted by USA export law.
P4 Compiler qualifiers (enclosed in quotes) if desired; provides
additional flexibility, e.g., to change the compiler optimization,
"/OPT=LEV=2" or "/CHECK" to add runtime array bounds checking, etc,
in DECC.
P5 Link qualifiers, e.g., the linker default is to search the
system shareable image library, IMAGELIB.OLB, before the
object module STARLET.OLB. To build an image that may run on
older system you might want to try linking /NOSYSSHR
P6 Location of LIBZ.OLB, which may be needed if using OpenSSL, and
the OpenSSL libraries were built with zlib support.
Example:
$ @ckvker snmd "" "NOPUSH, NODEBUG" "/NOOPT"
NOPUSH - Disallow access to DCL from within Kermit.
NODEBUG - Remove debugging code to make C-Kermit smaller and faster.
How to use this procedure:
This procedure should be stored in the same directory as the source
files. You can SET DEFAULT to that directory and execute the procedure
as shown above, or you can SET DEFAULT to a separate directory and run
run the procedure out of the source directory, e.g.:
SET DEFAULT DKA300:[KERMIT.ALPHA]
@DKA300:[KERMIT.SOURCE]CKVKER
This puts the object and executable files into your current directory.
Thus you can have (e.g.) an Alpha and a VAX build running at the
same time from the same source on a shared disk. Alternatively, you
can define a logical name for the source directory:
DEFINE CK_SOURCE DKA300:[KERMIT.SOURCE]
and then no matter which directory you run this procedure from, it
will look in the CK_SOURCE logical for the source files.
NOTES:
If adding flags here makes ccopt too long for Multinet/Wollongong
you will have to do it in CKCDEB.H.
The empty string, "", is needed as a place holder only if additional
parameter strings follow.
This procedure defines a process logical name, "K". If this
interferes with an existing definition of "K", consider using
SPAWN to give this procedure its own process.
If more than one TCP/IP stack is installed, the first one found is
used in the build. To force a different one, do:
$ net_option = "DEC_TCPIP"
(or other) prior to invoking this command procedure (see CKVINS.TXT
for a complete list).
Works like MAKE in that only those source modules that are newer than the
corresponding object modules are recompiled. Changing the C-Kermit command
line DEFINES or compiler options does not affect previously compiled
modules. To force a particular module to be recompiled, delete the object
file first. To force a full rebuild:
$ @ckvker c
$ @ckvker <desired-options>
To use in batch, set up the appropriate directories and submit.
(/NOLIST and /NOMAP are not needed unless P1 includes "D".)
E.g., submit CKVKER /parameters=(SL,"","NODEBUG")
See the CKVINS.TXT and CKVBWR.TXT files for further information.
$Exit
$!
$!
$! Uses MMS if it is installed, unless the M option is included. If CKVKER.MMS
$! is missing, you'll get an error; if MMS is not runnable for some reason
$! (privilege, image mismatch, etc), you'll also get an error. In either case,
$! simply bypass MMS by including the M option in P1.
$!
$! For network-type selection, you may also type (at the DCL prompt, prior
$! to running this procedure):
$!
$! net_option = "BLAH"
$!
$! where BLAH (uppercase, in quotes) is NONET, MULTINET, TCPWARE, WINTCP,
$! DEC_TCPIP, or CMU_TCPIP, to force selection of a particular TCP/IP
$! product, but only if the product's header files and libraries are installed
$! on the system where this procedure is running.
$!
$! By default, this procedure builds C-Kermit with support for the TCP/IP
$! network type that is installed on the system where this procedure is run,
$! and tries to link statically with old libraries. If the system is a VAX, a
$! VAX binary is created; if it is an Alpha, an Alpha binary is created. If
$! IA64, an IA64 binary is created. If more than one TCP/IP product is
$! installed, the search proceeds in this order: MULTINET, TCPWARE, WINTCP,
$! DEC_TCPIP, CMU_TCPIP.
$!
$! Should work for all combinations of VAXC/DECC/GCC, VAX/Alpha/IA64, and any
$! of the following TCP/IP products: DEC TCP/IP (UCX), Cisco (TGV) MultiNet,
$! Attachmate (Wollongong) WINTCP (Pathway), Process Software TCPware, or
$! CMU/Tektronix TCP/IP (except CMU/Tek is available only for the VAX). VAX
$! C is supported back to version 3.1, and DEC C back to 1.3. Tested on VMS
$! versions back to 5.4, but should work back to VAX/VMS 5.0. Use CKVOLD.COM
$! for pre-VMS-5.0 builds since this procedure uses DCL features introduced in
$! VMS 5.0.
$!
$! WOLLONGONG/ATTATCHMATE/WINTCP/PATHWAY BUILDS:
$! You also need to edit TWG$COMMON:[NETDIST.MISC]DEF.COM.
$! Comment out the following lines:
$!
$! 37 $ define decc$system_include twg$tcp:[netdist.include], -
$! 38 $ twg$tcp:[netdist.include.sys]
$!
$! ERRORS:
$! 1. At link time, you might see messages like:
$! %LINK-I-OPENIN, Error opening SYS$COMMON:[SYSLIB]VAXCRTLG.OLB; as input,
$! %RMS-E-FNF, file not found
$! %LINK-I-OPENIN, Error opening SYS$COMMON:[SYSLIB]VAXCRTL.OLB; as input,
$! %RMS-E-FNF, file not found
$! This generally indicates that the logical name(s) LNK$LIBRARY* is
$! defined and the runtime libraries are in SYS$SHARE but are not in
$! SYS$COMMON:[SYSLIB]. In the one case where this was observed, the
$! messages turned out to be harmless, since the runtime library is being
$! properly located in the .OPT file generated by this procedure.
$! 2. In newer configurations, you might get a link-time message to the effect
$! that DECC$IOCTL is multiply defined (e.g. VMS 7.0 / DECC 5.3 / UCX or
$! TCPware of recent vintage), since the ioctl() function is now supplied
$! as of VMS 7.0. This message should be harmless.
$! 3. The compiler might warn that routines like bzero and bcopy are not
$! declared, or that they have been declared twice. If the affected module
$! (usually ckcnet.c) builds anyway, and runs correctly, ignore the
$! warnings. If it crashes at runtime, some (more) adjustments will be
$! needed at the source-code level.
$!
$! This procedure is intended to replace the many and varied Makefiles, MMS
$! and MMK files, and so on, and to combine all of their features into one.
$! It was written by Martin Zinser, Gesellschaft fuer Schwerionenforschung
$! GSI, Darmstadt, Germany, m.zinser@gsi.de (preferred) or eurmpz@eur.sas.com,
$! in September 1996, based on all of the older versions developed by:
$!
$! Mark Berryman, Science Applications Int'l. Corp., San Diego, CA
$! Frank da Cruz, Columbia University, New York City <fdc@columbia.edu>
$! Mike Freeman, Bonneville Power Administration
$! Tarjei T. Jensen, Norwegian Hydrographic Service
$! Terry Kennedy, Saint Peters College, Jersey City NJ <terry@spcvxa.spc.edu>
$! Mike O'Malley, Digital Equipment Corporation
$! Piet W. Plomp, ICCE, Groningen University, The Netherlands
$! (piet@icce.rug.nl, piet@asterix.icce.rug.nl)
$! James Sturdevant, CAP GEMINI AMERICA, Minneapolis, MN
$! Lee Tibbert, DEC <tibbert@cosby.enet.dec.com>
$! Bernie Volz, Process Software <volz@process.com>
$!
$! Modification history:
$! jw = Joellen Windsor, U of Arizona, windsor@ccit.arizona.edu
$! fdc = Frank da Cruz, Columbia U, fdc@columbia.edu
$! mf = Mike Freeman, Bonneville Power Authority, freeman@columbia.edu
$! cf = Carl Friedberg, Comet & Company, carl@comets.com
$! hg = Hunter Goatley, Process Software, goathunter@goat.process.com
$! lh = Lucas Hart, Oregon State U, hartl@ucs.orst.edu
$! js = John Santos, Evans Griffiths & Hart, john@egh.com
$! dbs = David B Sneddon, dbsneddon@bigpond.com
$! mv = Martin Vorlaender, martin@radiogaga.harz.de
$! sms = Steven M Schweda, sms@antinode.info
$! jaltman = Jeff Altman, Columbia U <jaltman@columbia.edu>
$!
$! 23-Sep-96 1.01 fdc Shorten and fix syntax of MultiNet
$! /PREFIX_LIBRARIES_ENTRIES clause, remove ccopt items to
$! make string short enough.
$! 26-Sep-96 1.02 jw o Create a temporary file for the CCFLAGS=ccopt macro and
$! "prepend" it to ckvker.mms to reduce the MMS command
$! line length
$! o Optionally, use the current level of the Fortran
$! runtime library and not the "lowest common denominator".
$! When using the "lowest common denominator," be sure to
$! DEASSIGN the logicals before exit.
$! o Continue to operate on WARNING messages.
$! o Implement some .COM file debugging qualifiers:
$! o Modify .h file dependencies
$! 06-Oct-96 1.03 fdc Add 'N' command-line switch for no nets, make 'C' list
$! the files it deletes, clean up comments & messages, etc.
$! 09-Oct-96 1.04 cf Change error handling to use ON WARNING only; add "V"
$! option to enable verify; fix CKWART so it doesn't come
$! up in /debug; remove /DECC from alphas as this is the
$! case anyway add /LOG to MMS to get more info
$! 20-Oct-96 1.05 fdc Numerous changes suggested by lots of people to make it
$! work in more settings.
$! 21-Oct-96 1.06 jw o Put the /vaxc qualifier in ccopt when both DECC and
$! VAXC are present and user forces use of VAXC.
$! o When forcing VAXC and building NOSHARE, add
$! sys$share:vaxcrtl.olb/lib to kermit.opt
$! o Purge rather than delete kermit.opt, aux.opt, and
$! ccflags.mms so we will have them for reference.
$! 21-Oct-96 1.07 hg Adapt for TCPware and for MMK.
$! 21-Oct-96 1.08 mf Smooth out a couple differences between MMS and MMK.
$! 21-Oct-96 1.09 hg Fixes to fdc's interpretation of 1.08.
$! 25-Oct-96 1.10 jw o Allow compilation source in a centrally-located path
$! o Pretty up write of ccopt to sys$output
$! o Deassign logicals on warning exit
$! 04-Nov-96 1.11 lh A. Allow CFLAG options as command-line parameter p3
$! (may require adding "ifndef NOopt" to "#define opt"
$! construction wherever the VMS default is set, e.g.,
$! in CKCDEB.H).
$! B. Spiff up:
$! (a) Line length limit for Multinet - arbitrary
$! (b) Ioctl of VMS v7, DEC_TCPIP, DECC
$! (c) Add a P4 option
$! (d) Check for command-line length
$! (e) Try to set up W for user selection of termination on
$! warning, per Joellen's comments.
$! C. Some cosmetic changes:
$! Change (b) from net_option {.eqs.} "DEC_TCPIP" to
$! {includes string} per jas; move help text to start;
$! add VAXC N vaxcrtl link.
$! {what about missing net_option share/noshare options?}
$! Test for CK_SOURCE to define a source directory different
$! from the CKVKER.COM directory
$! 05-Nov-96 1.12 fdc Clean up and amplify help text and add VMS >= 7.0 test.
$! 06-Nov-96 1.12 hg Remove extraneous comma in VMS >= 7.0 test.
$! 08-Nov-96 1.13 js Fixes to CMU/Tek build.
$! 23-Nov-96 1.14 lh Fixes for VMS V7, VAXCRTL links for all TCP/IP packages,
$! improved batch operation, add P5 for link options,
$! catch commas in P1.
$! 05-Dec-96 1.15 lh Fixes to work with GCC.
$! 20-Aug-97 1.16 fdc Change version number to 6.0.193.
$! 20-Sep-97 1.16 js More fixes to CMU/Tek build.
$! 3-Dec-97 1.17 lh VAX build default, link /NOSYSSHARE; Alpha /SYSSHARE
$! 25-Dec-98 1.18 fdc Change C-Kermit version number to 7.0.195.
$! 6-Jan-99 1.19 fdc Add new CKCLIB and CKCTEL modules.
$! 8-Feb-99 1.20 fdc Add UCX 5.0 detection, add separate P1 (X) for CKVCVT.
$! 18-May-99 1.21 bt Fix TWG/WINTCP/PathWay 3.1 support.
$! 17-Jul-99 1.22 fdc Can't remember.
$! 22-Jul-99 1.23 fdc Define TCPSOCKET for all TCP/IP builds.
$! 25-Jul-99 1.24 dbs Use SYS$LIBRARY:TCPIP$IPC_SHR.EXE for UCX V5.0.
$! 26-Jul-99 1.25 dbs Now check the share/noshare stuff for UCX V5.0.
$! 3-Aug-99 1.26 fdc Compile and link CKCUNI module.
$! 11-Aug-99 1.27 fdc Don't set if_dot_h for non-UCX builds.
$! 20-Sep-99 1.28 fdc Add /UNSIGNED_CHAR to ccopt for DECC.
$! 8-Dec-00 1.29 fdc Update version numbers.
$! 28-Jun-01 1.30 fdc Update version numbers.
$! 22-Nov-01 1.31 dbs Fix for UCX 5.1. Use TCPIP$IPC_SHR.EXE since there is
$! no .OLB to use.
$! 9-Jan-02 1.32 fdc Add ckcxla.h to depencies for ckuusy.c.
$! 8-Feb-02 1.33 fdc Update version numbers, add VMS60 symbol definition.
$! 24-Oct-02 1.34 fdc Update version number.
$! 10-Nov-02 1.35 mv, jaltman Add SSL support.
$! 16-Nov-02 1.36 mv Update SSL support to include Compaq SSL
$! 17-Nov-02 1.37 lh Allow for VAX C 2.x
$! 25-Jun-03 1.38 mv Update OpenSSL support. Include/exclude HTTP client
$! support based on VMS version. Get Kermit version
$! number from CKCMAI.C
$! 06-Apr-04 1.39 fdc CK version = 8.0.211. Allow for VMS 8.x.
$! 05-Jan-05 1.40 dbs Fix problem where COMPAQ_SSL was not defined but later
$! referenced generating an undefined symbol error.
$! 01-Feb-07 1.40+sms Added P1 options F (large-file) and I (internal
$! FTP). Added IA64 announcement, and changed most
$! uses of "alpha" to "non_vax". Changed to use
$! actual VMS source dependencies. Shortened logical
$! name "KSP" to "K" to shorten DCL commands for the
$! internal CALL MAKE scheme. Added CKVRTL.C/H for
$! utime() for __CRTL_VER < 70300000.
$! 25-Jan-10 1.41 fdc Update comments about building with SSL.
$! 15-Feb-10 1.42 fdc Update C-Kermit version and comments about large files.
$! 22-Feb-10 1.43 mv Automatically detect SSL version.
$! 09-Mar-10 1.44 sms Added/documented P3 options INTSELECT, OLDFIB, OLDIP.
$! Disabled (commented out) automatic definition of
$! NOSETTIME for VMS before V7.2 (vms_ver .lts. "VMS_V72").
$! 18-Mar-10 1.45 fdc Configure for large files by default for VMS 7.3 and
$! later on non-VAX.
$! 18-Mar-10 1.46 fdc Include FTP client by default in non-nonet builds.
$! Fixed C-Kermit version number ck_version.
$! 08-Dec-19 1.46+sms Criteron for compaq_ssl (f$trnlnm("ssl$include")
$! .nes. "") failed to see OpenSSL. Now, OpenSSL
$! logicals override HP SSL[1] logicals for hp_ssl.
$! Allow modern OpenSSL library names ("SSL_*").
$! Added P6 for location of ZLIB.OLB, which may be
$! needed for OpenSSL libraries built with zlib
$! support.
$! Changed erroneous "write" to "type".
$! 22-Mar-10 1.48 ??? Added "CC" clean_all option, and changed .MMS and
$! .OPT product file names to upper case.
$! 04-Nov-21 1.48+sms Added support for OpenSSL version 1.1.1 ("OSSL$*"
$! logical names), and choice of .EXE or .OLB (P1=B).
$! Removed attempts to support OpenSSL versions before
$! 1.1.1.
$! 24-Dec-21 1.48+sms Restored erroneously deleted code to define
$! process logical name, OPENSSL.
$! 17-Feb-22 1.48+sms Added support for VSI SSL3 product.
$! Added logical name CK_VERIFY to control DCL verify
$! in this script. (Define non-empty for VERIFY.)
$! 13-Jul-22 1.48+sms Added support for x86_64 hardware architecture.
$! IA64-to-x86_64 cross tools can be made to work.
$! 01-Sep-22 1.48+sms Added definition of C macro OPENSSL_100, unless
$! user specifies CK_SSL0 in P3.
$! 15-Nov-22 1.48+sms Removed CKWART.C, et al.
$!
$Skip_Help:
$!
$ On Control_C then $ goto CY_Exit
$ On Control_Y then $ goto CY_Exit
$! On ERROR then $ goto The_exit
$ On SEVERE_ERROR then $ goto The_exit
$! On Warning then goto warning_exit
$!
$ if (f$trnlnm( "CK_VERIFY") .eqs. "")
$ then
$ ck_verify = 0
$ else
$ ck_verify = 1
$ endif
$ save_verify_image = f$environment( "VERIFY_IMAGE")
$ save_verify_procedure = f$verify( ck_verify)
$!
$ say == "Write sys$output"
$ procedure = f$environment("PROCEDURE")
$ procname = f$element(0,";",procedure)
$ node = f$getsyi("NODENAME")
$ say "Starting ''procedure' on ''node' at ''f$time()'"
$ ccopt = ""
$ lopt = ""
$ make = ""
$ non_vax=0
$ use_arch=0
$ debug=0
$ noshare=1
$ decc=0
$ vaxc=0
$ verify=0
$ gnuc=0
$ oldmath=0
$ mathlevel=0
$ vmsv6=0
$ vmsv7=0
$ vmsv8=0
$ havetcp=0
$ ucxv5=0
$ if_dot_h=0
$ nomms=0
$ mmsclm=264 ! maximum command length limit for MMS/MMK (estimate)
$ do_ckvcvt=0
$ ssl=0 ! SSL support disabled by default.
$ ssl111=0 ! Use vendor SSL 1.1.1 when vendor SSL 3 is available.
$ sslolb=0 ! SSL uses shared images by default.
$ openssl_def = 0 ! Redefined OPENSSL process logical name.
$ internal_ftp=1 ! FTP client enabled by default.
$ large_file=1 ! Large file support enabled by default.
$!
$ if (f$type( cc) .eqs. "")
$ then
$ cc = "cc"
$ endif
$!
$! Find out which OpenVMS version we are running
$! (do not use IF ... ENDIF for the VMS 4 test and exit)
$!
$ sys_ver = f$edit(f$getsyi("version"),"compress")
$ if f$extract(0,1,sys_ver) .eqs. "V" then goto Production_version
$ type sys$input
WARNING: You appear to be running a Field Test version of VMS.
Please exercise caution until you have verified proper operation.
$Production_version:
$!
$ dot = f$locate(".",sys_ver)
$ sys_maj = 0+f$extract(dot-1,1,sys_ver)
$ sys_min = 0+f$extract(dot+1,1,sys_ver)
$!
$ if sys_maj .eq. 4 then if (sys_min/2)*2 .ne. sys_min then -
sys_min = sys_min - 1
$ if sys_maj .ne. 4 then goto Supported_version
$ say ""
$ say " You are running VMS ''sys_ver'"
$ type sys$input
WARNING: CKVKER.COM will not build VMS C-Kermit using that version of VMS.
Prebuilt images should run properly, or try CKVOLD.COM.
Please exercise caution until you have verified proper operation.
$!
$goto The_exit
$!
$Supported_version:
$!
$ vms_ver = "VMS_V''sys_maj'''sys_min'"
$!
$! VMSV70 must be defined if the VMS version is 7.0 OR GREATER, so we know
$! we can include <strings.h>.
$!
$ if vms_ver .ges. "VMS_V60" then vmsv6 = 1
$ if vms_ver .ges. "VMS_V70" then vmsv7 = 1
$ if vms_ver .ges. "VMS_V80" then vmsv8 = 1
$!
$!
$! Set the Kermit Source Path K: to be the same path as this procedure
$! if the user has not specified another source with a CK_SOURCE logical
$!
$ if f$trnlnm("CK_SOURCE") .eqs. ""
$ then
$ source_device = f$parse(f$environment("procedure"),,,"device")
$ source_directory = f$parse(f$environment("procedure"),,,"directory")
$ define K 'source_device''source_directory
$ else
$ user_source = f$trnlnm("CK_SOURCE")
$ define K 'user_source'
$ endif
$!
$! Parse P1: Build options.
$!
$ if p1 .nes. ""
$ then
$!
$! Parse P1: (non-HELP build options).
$!
$! CLEAN, CLEAN_ALL
$!
$ if f$locate( "CC", p1) .ne. p1_len then goto clean_all
$ if f$locate( "C", p1) .ne. p1_len then goto clean
$!
$! Non-fatal parameter setting.
$!
$ if f$locate( "A", p1) .ne. p1_len then use_arch=1
$ if f$locate( "B", p1) .ne. p1_len then sslolb=1
$ if f$locate( "D", p1) .ne. p1_len then debug=1
$ if f$locate( "F", p1) .ne. p1_len then large_file=0
$ if f$locate( "I", p1) .ne. p1_len then internal_ftp=0
$ if f$locate( "L", p1) .ne. p1_len then mathlevel=1
$ if f$locate( "M", p1) .ne. p1_len then nomms=1
$ if f$locate( "N", p1) .ne. p1_len
$ then
$ net_option="NONET"
$ internal_ftp=0
$ endif
$ if f$locate( "O", p1) .ne. p1_len then mmsclm = 1024
$ if f$locate( "S", p1) .ne. p1_len then noshare=0
$ if f$locate( "V", p1) .ne. p1_len then verify=1
$ if f$locate( "W", p1) .ne. p1_len then On Warning then goto warning_exit
$ if f$locate( "X", p1) .ne. p1_len then do_ckvcvt=1
$ endif
$!
$! Parse P3: C macros (including SSL).
$!
$ p3_len = f$length( p3)
$ v_ssl = 0
$ if (p3 .nes. "") .and. (f$locate( "CK_SSL", p3) .ne. p3_len)
$ then
$ ssl = 1
$ if (f$locate( "CK_SSL111", p3) .ne. p3_len)
$ then
$ ssl111 = 1
$ p3 = p3+ ",CK_SSL" ! Ensure that "CK_SSL" is (also) defined.
$ p3_len = f$length( p3)
$ endif
$ if (f$locate( "CK_SSL0", p3) .eq. p3_len)
$ then
$ p3 = p3+ ",OPENSSL_100" ! Define "OPENSSL_100", unless "CK_SSL0".
$ endif
$ endif
$!
$ if (ssl)
$ then
$ if ((f$trnlnm( "OSSL$INCLUDE") .eqs. "") .and. -
(f$trnlnm( "SSL111$INCLUDE") .eqs. "") .and. -
((f$trnlnm( "SSL3$INCLUDE") .eqs. "") .or. (ssl111 .ne. 0)))
$ then
$ type sys$input
FATAL: You specified that OpenSSL be used, but the required logical names
have not been defined.
$ goto The_exit
$ endif
$! Choose between object libraries and shared images for SSL.
$ if (sslolb)
$ then
$ ssl_link = "OLB"
$ else
$ ssl_link = "EXE"
$ endif
$! Distinguish between VSI SSL and OpenSSL, based on OpenSSL logical names.
$! Any OpenSSL (OSSL$*") overrides any VSI SSL ("SSL111$*", "SSL3$*").
$! VSI SSL3 preferred over SSL111 unless used specified SSL111.
$!
$ v_ssl = f$trnlnm( "OSSL$INCLUDE") .eqs. ""
$ if (v_ssl)
$ then
$ if ((f$trnlnm("SSL3$INCLUDE") .nes. "") .and. (ssl111 .eq. 0))
$ then
$ ssl_brand = "(vendor (3), "+ ssl_link+ ") "
$ else
$ ssl_brand = "(vendor (111), "+ ssl_link+ ") "
$ ssl111 = 3 ! No SSL3, or user specified SSL111.
$ endif
$ else
$ ssl_brand = "(OpenSSL, "+ ssl_link+ ") "
$ endif
$ ssl_text = "SSL "+ ssl_brand+ "support and"
$ else
$ ssl_text = ""
$ endif
$!
$ cln_def = ""
$ if p3 .nes. "" then cln_def = ","+ p3 ! comma delimited string
$ cln_qua = ""
$ if p4 .nes. "" then cln_qua = p4
$!
$! If used, get the OpenSSL version from an "openssl version" command.
$!
$ if (ssl)
$ then
$! Find the "openssl" command executable.
$ openssl_cmd = ""
$ if (v_ssl)
$ then
$ if (ssl111 .ne. 0)
$ then
$ openssl_cmd = "$ SSL111$EXE:OPENSSL.EXE"
$ else
$ openssl_cmd = "$ SSL3$EXE:OPENSSL.EXE"
$ endif
$ else
$ openssl_exe = f$search( "OSSL$EXE:openssl*.EXE")
$ openssl_cmd = "$ OSSL$EXE:"+ -
f$parse( openssl_exe, , , "NAME", "SYNTAX_ONLY")+ ".EXE"
$ endif
$!
$ if (openssl_cmd .eqs. "")
$ then
$ type sys$input
FATAL: Cannot determine the OpenSSL version installed. Ensure that the
appropriate SSL set-up procedure has been run.
$ goto The_exit
$ endif
$ define/user sys$output openssl_version.tmp
$ openssl_cmd version
$ close/nolog LOG
$ open/read LOG openssl_version.tmp
$ read LOG line
$ close LOG
$ delete_ openssl_version.tmp;
$ ssl_version = f$element(1," ",f$edit(line,"compress"))
$ if ssl_version .lts. "1.1.1"
$ then
$ say -
"FATAL: OpenSSL version ''ssl_version' is older than 1.1.1, which is too old."
$ goto The_exit
$ else
$ say "OpenSSL ''ssl_version' found"
$ endif
$ endif
$!
$! If necessary, define the logical name OPENSSL for #include directives.
$!
$ if ssl
$ then
$ openssl_proc = f$edit( f$trnlnm( "OPENSSL", "LNM$PROCESS"), "UPCASE")
$ openssl_orig = f$edit( f$trnlnm( "OPENSSL"), "UPCASE")
$ if v_ssl
$ then
$ if (ssl111 .ne. 0)
$ then
$ openssl_new = "SSL111$INCLUDE:"
$ else
$ openssl_new = "SSL3$INCLUDE:"
$ endif
$ else
$ openssl_new = "OSSL$INCLUDE:[OPENSSL]"
$ endif
$!
$ if (openssl_new .nes. openssl_orig)
$ then
$ if (openssl_proc .eqs. "")
$ then
$ say "Defining process logical name OPENSSL as ''openssl_new'"
$ else
$ say "Replacing process logical name OPENSSL definition:"
$ say " ''openssl_proc'"
$ say "with:"
$ say " ''openssl_new'"
$ endif
$ endif
$ define OPENSSL 'openssl_new'
$ openssl_def = 1
$ endif
$!
$! P1 "D", debug option.
$!
$ if debug.eq.1
$ then
$ ccopt = "/noopt/deb"
$ lopt = "/deb/map/full/sym"
$ endif
$!
$! P5, LINK qualifiers.
$!
$ if p5 .nes. ""
$ then
$ p5 = f$edit(p5,"UPCASE")
$ lopt = lopt + p5
$ endif
$!
$! Check for MMK/MMS.
$!
$ if nomms .eq. 0
$ then
$ if f$search("sys$system:mms.exe") .nes. ""
$ then
$ make = "MMS"
$ if (verify) then make = "MMS/LOG/VERIFY"
$ endif
$ if f$type(MMK) .eqs. "STRING" then make = "MMK"
$ if make .nes. "" then say "Using ''make' utility"
$ endif
$!
$! Find out which Kermit version we are building
$! (from CKCMAI.C's ck_s_ver variable declaration)
$!
$ ck_version = "9.0.299"
$ search /exact /nostatistic /output=ck_version.tmp -
K:ckcmai.c "char *ck_s_ver = "
$ open /read /error=end_version VERSION_TMP ck_version.tmp
$ read /error=end_version VERSION_TMP line
$ close VERSION_TMP
$ delete ck_version.tmp;
$ ck_version = f$element(1,"""",line)
$end_version:
$!
$! Build the option-file
$!
$ open/write aoptf AUX.OPT
$ if .not. do_ckvcvt
$ then
$ open/write optf KERMIT.OPT
$ write optf "ckcmai.obj"
$ write optf "ckclib.obj"
$ write optf "ckcuni.obj"
$ write optf "ckcfn2.obj"
$ write optf "ckcfn3.obj"
$ write optf "ckcfns.obj"
$ write optf "ckcpro.obj"
$ write optf "ckucmd.obj"
$ write optf "ckudia.obj"
$ write optf "ckuscr.obj"
$ write optf "ckuus2.obj"
$ write optf "ckuus3.obj"
$ write optf "ckuus4.obj"
$ write optf "ckuus5.obj"
$ write optf "ckuus6.obj"
$ write optf "ckuus7.obj"
$ write optf "ckuusr.obj"
$ write optf "ckuusx.obj"
$ write optf "ckuusy.obj"
$ write optf "ckuxla.obj"
$ write optf "ckcnet.obj"
$ write optf "ckctel.obj"
$ write optf "ckvfio.obj"
$ write optf "ckvtio.obj"
$ write optf "ckvcon.obj"
$ write optf "ckvioc.obj"
$ write optf "ckusig.obj"
$ if internal_ftp
$ then
$ write optf "ckcftp.obj"
$ write optf "ckvrtl.obj"
$ endif
$ write optf "Identification=""Kermit ''ck_version'"""
$!
$ if (ssl)
$ then
$ write optf "ckuath.obj"
$ write optf "ck_crp.obj"
$ write optf "ck_ssl.obj"
$ if (v_ssl)
$ then
$ if (ssl111 .ne. 0)
$ then
$! Vendor SSL111.
$ if (sslolb)
$ then
$! Object libraries.
$ write optf "SSL111$LIB:SSL111$LIBSSL32.OLB/library"
$ write optf "SSL111$LIB:SSL111$LIBCRYPTO32.OLB/library"
$ else ! sslolb
$! Shared images.
$ write optf "SYS$SHARE:SSL111$LIBSSL_SHR32.EXE/shareable"
$ write optf "SYS$SHARE:SSL111$LIBCRYPTO_SHR32.EXE/shareable"
$ endif ! sslolb
$ else ! ssl111
$! Vendor SSL3.
$ if (sslolb)
$ then
$! Object libraries.
$ write optf "SSL3$LIB:SSL111$LIBSSL32.OLB/library"
$ write optf "SSL3$LIB:SSL111$LIBCRYPTO32.OLB/library"
$ else ! sslolb
$! Shared images.
$ write optf "SYS$SHARE:SSL3$LIBSSL_SHR32.EXE/shareable"
$ write optf "SYS$SHARE:SSL3$LIBCRYPTO_SHR32.EXE/shareable"
$ endif ! sslolb
$ endif ! ssl111
$ else ! v_ssl
$! OpenSSL. (Use newer "OSSL$*" logical names).
$ if (sslolb)
$ then
$! Object libraries.
$ write optf "OSSL$LIBSSL/library"
$ write optf "OSSL$LIBCRYPTO/library"
$ else ! sslolb
$! Shared images.
$ write optf "OSSL$LIBSSL_SHR/shareable"
$ write optf "OSSL$LIBCRYPTO_SHR/shareable"
$ endif ! sslolb
$! Add zlib object library, if location specified.
$ if (p6 .nes. "")
$ then
$ write optf "''p6'libz.olb/library"
$ endif
$ endif ! v_ssl
$ endif ! ssl
$ endif ! .not. do_ckvcvt
$!
$! Look for old math-library to allow transfer of the production Kermit
$! to old-fashioned VMS systems
$!
$ if (mathlevel .eq. 0) .and. -
(f$search("SYS$SHARE:FORTRAN$MTHRTL-VMS.EXE") .nes. "")
$ then
$ oldmath = 1
$ define/nolog mthrtl fortran$mthrtl-vms
$ define/nolog vmthrtl fortran$vmthrtl-vms
$ type sys$input
NOTE: You have currently DEC Fortran V6.0 or later installed, but the
old versions of the Math libraries are still available on your
system. We will link C-Kermit with these older, pre-Fortan V6
libraries so that it will run on systems which don't have Fortran
V6 installed. C-Kermit does not use any features of the new
libraries.
You will receive %LINK-I-IDMISMCH informational messages during
linking, but these can be safely ignored.
$ endif
$!
$! Parse P2: Compiler selection.
$!
$ if p2.nes.""
$ then
$ p2 = f$edit(p2,"UPCASE")
$ p2_len = f$length( p2)
$ if f$locate("G",p2) .ne. p2_len then goto gnuc
$ if f$locate("V",p2) .ne. p2_len then goto vaxc
$ if f$locate("D",p2) .ne. p2_len then goto decc
$ endif
$!
$DECC:
$ if f$search("SYS$SYSTEM:DECC$COMPILER.EXE").nes.""
$ then
$ say "DECC compiler found"
$ cc_ver = "DECC"
$ ccopt = "/decc/unsigned_char"+ccopt
$ goto compile
$ endif
$!
$VAXC:
$ if f$search("SYS$SYSTEM:VAXC.EXE").nes.""
$ then
$ say "VAXC compiler found, checking version..."
$!
$ if f$trnlnm("VAXC$INCLUDE") .eqs. ""
$ then
$ vaxc_h = "SYS$LIBRARY:"
$ else
$ vaxc_h = "VAXC$INCLUDE:" ! keep as logical name, may be a search list
$ endif
$ cc_ver = "VAXC023"
$ if f$search("''vaxc_h'fscndef.h") .nes. "" then cc_ver = "VAXC024"
$ if f$search("''vaxc_h'ppl$routines.h") .nes. "" then cc_ver = "VAXC030"
$ if f$search("''vaxc_h'xabrudef.h") .nes. "" then cc_ver = "VAXC031"
$ if (cc_ver .lts. "VAXC031") then vaxc = 2
$ if (cc_ver .nes. "VAXC031")
$ then
$ type sys$input
WARNING: Your system has an older version of the C compiler.
VMS C-Kermit was designed to be compiled under VAX C V3.1 or
newer or DEC C V1.3 or newer. It has not been verified to
build properly under older compilers, athough pre-built C-Kermit
versions should run properly. Please exercise caution until you
have verified proper operation.
$ endif
$! If both DECC and VAXC are in this system, then use the /vaxc qualifier
$ if f$search("SYS$SYSTEM:DECC$COMPILER.EXE").nes."" then -
ccopt = "/vaxc" + ccopt
$ goto compile
$ endif
$!
$GNUC:
$ if f$trnlnm("GNU_CC").nes.""
$ then
$ say "GNUC compiler found"
$ CC="GCC"
$ cc_ver="GNUC"+f$trnlnm("GNU_CC_VERSION")
$!
$Version_Loop: ! convert period separator to underscore
$ dot = f$locate(".",cc_ver)
$ if dot .eq. f$length(cc_ver) then goto End_Version_Loop
$ cc_ver[dot,1] := "_"
$ goto Version_Loop
$End_Version_Loop:
$!
$ if debug.eq.0 then ccopt = "/nolist/optimize=4"
$ if .not. do_ckvcvt then write optf "gnu_cc:[000000]gcclib.olb/lib"
$ write aoptf "gnu_cc:[000000]gcclib.olb/lib"
$ noshare=1
$ goto compile
$ endif
$!
$! No compiler found - Warning and Exit
$!
$ if .not. use_arch
$ then
$ if .not. do_ckvcvt then close optf
$ close aoptf
$ type sys$input
FATAL: No C-compiler found - Can't build Kermit on this system.
$ goto The_exit
$ endif
$!
$COMPILE:
$!
$! say "C compiler: ''cc_ver', options: ''ccopt', command: ''CC'"
$!
$! Determine hardware architecture.
$!
$ if (use_arch .eq. 0) .or. (f$type( arch) .nes. "STRING")
$ then
$! No (potentially valid) user-specified ARCH value. Determine
$! automatically.
$ arch = ""
$ endif
$!
$ if (arch .eqs. "")
$ then
$ if (f$getsyi( "HW_MODEL") .gt. 0) .and. -
(f$getsyi( "HW_MODEL") .lt. 1024)
$ then
$ arch = "VAX"
$ else
$ non_vax=1
$! non-vax this is only option...recover a bit of DCL real estate
$ ccopt = ccopt-"/decc"
$! say ccopt
$ if (f$getsyi( "ARCH_TYPE") .eq. 2)
$ then
$ arch = "ALPHA"
$ else
$ arch = f$edit( f$getsyi( "ARCH_NAME"), "UPCASE")
$ endif
$ endif
$ else
$ if arch .nes. "VAX"
$ then
$ non_vax=1
$ endif
$ endif
$!
$ say f$fao("!/Operating System: OpenVMS(tm) !AS!/", arch)
$!
$! cc_ver could start with DECC, GNUC, or VAXC, or be specified by the
$! user ("XDECC", for example). Treat any string containing "DECC" as
$! "DECC".
$!
$ cc_decc = f$locate( "DECC", cc_ver) .lt. f$length( cc_ver)
$!
$! The VMS linker default is to link /SYSSHR
$!
$! C-Kermit default is to link w/ shareable libraries on non-VAX
$! and w/ object libraries on VAX. For backwards compatibility, use
$! p1 "S", to use shareable libraries on VAX, and p5 "/NOSYSSHARE" to
$! use object libraries on non-VAX.
$!
$!
$ if (cc_decc .and f$search("sys$share:vaxcrtl.exe").eqs."") .or. -
(non_vax .eq. 0 .and. vms_ver .lts. "VMS_V52") .or. -
(non_vax .eq. 0 .and. noshare .eq. 1) .or. -
(non_vax .eq. 1 .and. (f$locate("/NOSYSS",p5) .ne. f$length(p5)) )
$ then
$ noshare = 1
$ share_opt = "NOVMSSHARE"
$ share_text = "system OLBs and"
$ else
$ noshare = 0
$ share_opt = "VMSSHARE"
$ share_text = "shareable libs and"
$ endif
$!
$! Find out which network to use.
$!
$! Type:
$! net_option = "NONET"
$! before running this procedure to build C-Kermit without TCP/IP network
$! support on a system that has a TCP/IP package installed, or use the
$! N command-line option to force NONET.
$!
$!
$ if f$search("SYS$LIBRARY:TCPIP$IPC_SHR.EXE") .nes. "" then ucxv5 = 1
$ if do_ckvcvt
$ then
$ net_option = "NONET"
$ goto Net_Done
$ endif
$!
$ if f$type(net_option) .eqs. "STRING"
$ then
$ say "Network option override = ''net_option'"
$ net_option = f$edit(net_option,"UPCASE")