-
Notifications
You must be signed in to change notification settings - Fork 0
/
ckuins.txt
3588 lines (3001 loc) · 171 KB
/
ckuins.txt
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
[1]The Columbia Crown The Kermit Project | Columbia University
612 West 115th Street, New York NY 10025 USA o [2]kermit@columbia.edu
...since 1981
[3]Home [4]Kermit 95 [5]C-Kermit [6]Scripts [7]Current [8]New [9]FAQ
[10]Support
C-Kermit 9.0 Installation Instructions and Options for Unix
[ [11]Contents ] [ [12]C-Kermit ] [ [13]Kermit Home ]
Frank da Cruz
The Kermit Project
Columbia University
As of C-Kermit version: 9.0.302, 20 August 2011
This file last updated: Sun Aug 21 12:08:29 2011 (New York City
time)
IF YOU ARE READING A PLAIN-TEXT version of this document, it is a
plain-text copy of a Web page. You can visit the original (and possibly
more up-to-date) Web page here:
[14]http://www.columbia.edu/kermit/ckuins.html
CONTENTS
[15]OVERVIEW
1. [16]INTERNET QUICK START
2. [17]INSTALLING FROM PACKAGES
3. [18]INSTALLING PREBUILT BINARIES
4. [19]BUILDING FROM SOURCE CODE
5. [20]INSTALLING THE KERMIT FILES
6. [21]INSTALLING UNIX C-KERMIT FROM DOS-FORMAT DISKETTES
7. [22]CHECKING THE RESULTS
8. [23]REDUCING THE SIZE OF THE EXECUTABLE PROGRAM IMAGE
9. [24]UNIX VERSIONS
10. [25]DIALING OUT AND COORDINATING WITH UUCP
11. [26]RUNNING UNIX C-KERMIT SETUID OR SETGID
12. [27]CONFIGURING UNIX WORKSTATIONS
13. [28]BIZARRE BEHAVIOR AT RUNTIME
14. [29]CRASHES AND CORE DUMPS
15. [30]SYSLOGGING
16. [31]BUILDING SECURE VERSIONS OF C-KERMIT 9.0
17. [32]INSTALLING C-KERMIT AS AN SSH SERVER SUBSYSTEM
OVERVIEW
[ [33]Top ] [ [34]Contents ] [ [35]Next ]
WARNING: This document contains notes that have been accumulating
since the mid 1980s. Many of the products and Unix versions
mentioned here have not been heard of in a long while, but that does
not necessarily mean they are not still running in some obscure
nook.
This file contains Unix-specific information. A lot of it. Unlike most
other packages, C-Kermit tries very hard to be portable to every Unix
variety (and every release of each one) known to exist, including many
that are quite old, as well as to other platforms like VMS, AOS/VS,
VOS, OS-9, the BeBox, the Amiga, etc.
Since C-Kermit gets so deeply into the file system, i/o system, and
other areas that differ radically from one Unix platform to the next,
this means that a lot can go wrong when you try to install C-Kermit on
(for example) a new release of a particular variety of Unix, in which
certain things might have changed that C-Kermit depended upon.
This file concentrates on installation. For a description of general
configuration options for C-Kermit, please read the [36]Configurations
Options document. For troubleshooting after installation, see the
[37]General Hints and Tips and [38]Unix-Specific Hints and Tips
documents. The latter, in particular, contains lots of information on
lots of specific Unix platforms. If you want to work on the source
code, see the [39]C-Kermit Program Logic Manual
You may install C-Kermit:
* From an "[40]install package", if one is available.
* As a [41]prebuilt binary, if available, plus accompanying text
files.
* By building from [42]source code.
1. INTERNET QUICK START
[ [43]Top ] [ [44]Contents ] [ [45]Next ] [ [46]Previous ]
If your Unix computer is on the Internet and it has a C compiler,
here's how to download, build, and install C-Kermit directly from the
"tarballs" or Zip archives:
1. Make a fresh directory and cd to it.
2. Download the C-Kermit source code:
[47]ftp://www.columbia.edu/kermit/archives/cku211.tar.Z (compress
format) or [48]ftp://www.columbia.edu/kermit/archives/cku211.tar.gz
(gunzip format). If those links don't work, FTP transfers are being
blocked; try these HTTP links instead:
[49]http://kermit.columbia.edu/ftp/archives/cku211.tar.Z (compress
format) or
[50]http://kermit.columbia.edu/ftp/archives/cku211.tar.gz (gunzip
format).
3. Uncompress the compressed tar file with "uncompress" or "gunzip",
according to which type of compressed file you downloaded. (If you
don't understand this, you could download a (much larger)
uncompressed tar archive directly:
[51]ftp://www.columbia.edu/kermit/archives/cku211.tar or
[52]http://kermit.columbia.edu/ftp/archives/cku211.tar
4. Now type "tar xvf cku211.tar" to unpack the individual files from
the tar archive.
5. Type "rm cku211.tar" to get rid of the tar archive, which is no
longer needed.
6. Read the comments at the top of the makefile to find out which
target to use and then type the appropriate "make" command, such as
"make linux", "make solaris8", etc.
7. This produces a binary in your current directory called "wermit".
Start it by typing "./wermit" and [53]try it out to make sure it
works. Then read [54]Section 5 for how to install it, or simply
copy the wermit binary to the desired public directory, rename it
to kermit, and give it the needed permissions (and, if it is going
to be used to dial out, give it the same group and owner and
permissions as the cu, tip, or minicom program).
For secure installations, see [55]Sections 5 and [56]16.
2. INSTALLING FROM PACKAGES
[ [57]Top ] [ [58]Contents ] [ [59]Next ] [ [60]Previous ]
Various Unix varieties -- Linux, Solaris, AIX, etc -- now incorporate
the idea of "install packages", and many users expect to find all new
applications in this format. A selection of install packages might be
available for any given release of C-Kermit, but there is a tradeoff
between convenience and safety. Unix presents several notable problems
to the builder of install packages:
a. Since C-Kermit is portable to many non-Unix platforms (VMS, VOS,
AOS/VS, etc), some of the files in the C-Kermit distribution do not
fit into the Unix application model. In particular, C-Kermit
includes some plain text files (described in [61]Section 5) and
Unix has no standard place to put such files. Typical Unix package
managers do not allow for them. Where should they go, and how will
the user know where to find them?
b. Installation of any program that will be used to make modem calls
requires some important decisions from the installer regarding
security and privilege.
Item (b) is discussed at length in [62]Sections 10 and [63]11 of this
document, but the package-related aspects are also given here. The
basic problem is that Unix dialout devices and the UUCP "lock files"
that regulate contention for them (described in [64]Section 10) are
usually protected against "world". Therefore, the install procedure
must either run as root in order to give the Kermit binary the required
permissions, group, and/or owner, or else the dialout devices and
associated directories must be open for group or world reading and
writing. Otherwise, the Kermit program just installed WILL NOT WORK for
dialing out.
Thus, a well-crafted installation procedure should present the options
and allow the installer to choose the method, if any, for regulating
access to the dialout devices:
a. Check the permissions of the lockfile directory and the dialout
devices. If they do not allow group or world R/W access, then:
b. "Your UUCP lockfile directory and/or dialout devices require
privilege to access. You must either change their permissions or
install Kermit with privileges."
c. "If you wish to install Kermit with privileges, it will be given
the same owner, group, and permissions as the cu program so it can
use the dialout devices." (This is increasingly problematic as some
newer Unix systems like Mac OS X don't have a cu program, or even a
serial port!)
d. If they choose (c) but the user is not root, give a message that
the install procedure can be run only by root and then quit.
It should go without saying, of course, that any binaries that are to
be included in an install package should be built fresh on the exact
platform (e.g. Red Hat 8.0 on Intel) for which the package is targeted;
prebuilt binaries ([65]next section) from other sites are likely to
have library mismatches. [66]CLICK HERE for more about building
C-Kermit install packages.
The Kermit Project does not have the resources or the expertise to make
install packages for every platform. Most install packages, therefore,
are contributed by others, and they do not necessarily follow the
guidelines given above. Pay attention to what they do.
If you are an end user who has obtained a C-Kermit install package for
a particular platform, you should be aware that some additional steps
might needed if you want to use Kermit to dial out. Read [67]Section 10
for details.
3. INSTALLING PREBUILT BINARIES
[ [68]Top ] [ [69]Contents ] [ [70]Next ] [ [71]Previous ]
Hundreds of prebuilt C-Kermit binaries are available on the CDROM in
the BINARY tree [NOTE: The C-Kermit CDROM is still for version 7.0],
and at our ftp site in the [72]kermit/bin area (with names starting
with "ck"), also accessible on the [73]C-Kermit website. To install a
prebuilt binary:
a. Rename the binary to "wermit".
b. Make sure it works; some tests are suggested in [74]Section 7.
c. Follow steps (b) through (e) in [75]Section 4.
d. Install related files as described in [76]Section 5.
But first... Please heed the following cautions:
a. If you pick the wrong binary, it won't work (or worse).
b. Even when you pick the appropriate binary, it still might not work
due to shared-library mismatches, etc. (see [77]Section 4.0).
c. Don't expect a binary built on or for version n of your OS to work
on version n - x (where x > 0). However, it is supposed to be safe
to run a binary built on (or for) an older OS release on a newer
one (but is [78]increasingly less so as time-honored principles of
stability and backwards compatibility go fading into obscurity).
Therefore, it is always better to build your own binary from source
code ([79]next section) if you can. But since it is increasingly common
for Unix systems (not to mention VMS and other OS's) to be delivered
without C compilers, it is sometimes not possible. In such cases, try
the most appropriate prebuilt binary or binaries, and if none of them
work, [80]contact us and we'll see what we can do to help.
4. BUILDING FROM SOURCE CODE
[ [81]Top ] [ [82]Contents ] [ [83]Next ] [ [84]Previous ]
Also see: [85]Section 8 and [86]Section 9.
C-Kermit is designed to be built and used on as many platforms as
possible: Unix and non-Unix, old and new (and ancient), ANSI C and K&R.
The Unix version does not use or depend on any external tools for
building except the "make" utility, the C compiler, the linker, and the
shell. It does not use any external automated configuration tools such
as configure, autoconf, automake, libtool, etc. Everything in C-Kermit
has been built by hand based on direct experience or reports or
contributions from users of each platform.
The [87]C-Kermit makefile contains the rules for building the program
for each of the hundreds of different kinds of Unix systems that
C-Kermit attempts to support. It covers all Unix variations since about
1980 -- pretty much everything after Unix V6. Separate makefiles are
used for [88]Plan 9 and [89]2.x BSD.
Prerequisites:
* The C compiler, linker, and make program must be installed.
* The C libraries and header files must be installed (*).
* The C-Kermit source code and makefile in your current directory.
* The C-Kermit text files ([90]Section 5) in your current directory.
* This is becoming problematic in this new age of "selective
installs" e.g. of Linux packages. C-Kermit builds will often fail
because replying "no" to some obscure Linux installation option
will result in missing libraries or header files. Ditto on
platforms like AIX and Solaris that don't come with C compilers,
and then later have gcc installed, but are still missing crucial
libraries, like libm (math).
Plus:
* For TCP/IP networking support, the sockets library and related
header files must be installed.
* The math library for floating-point arithmetic support (can be
deselected by adding -DNOFLOAT to CFLAGS and removing -lm from
LIBS).
* Many and varied security libraries for building a secure version
(Kerberos, SSL/TLS, SRP, Zlib,...) These are required only if you
select a secure target.
* For the curses-based fullscreen file-transfer display, the curses
or ncurses header file(s) and library, and probably also the
termcap and/or termlib library. Note that the names and locations
of these files and libraries are likely to change capriciously with
every new release of your Unix product. If you discover that the
C-Kermit build procedure fails because your curses and/or termxxx
headers or libraries are not named or located as expected, please
[91]let us know. In the meantime, work around by installing
symlinks.
* IMPORTANT: Modern Linux distributions might give you the choice
during installation of whether to install the "ncurses development
package" (perhaps called "ncurses-devel"). If you did not install
it, you won't be able to build C-Kermit with curses support
included. In this case, either go back and install ncurses, or else
choose (or create) a non-curses makefile target for your platform.
To install the ncurses developers tools in Red Hat Linux, do
"apt-get install ncurses-developer" or if you have the CD:
mount redhat cdrom
goto RedHat/RPMS
rpm -ivh ncurses-devel*.rpm
or to have the exact name ls ncurse* and load as
rpm -ivh filename
then leave the cdrom and unmount it.
* In AIX you might have to go back and install any or all of:
bos.adt.base
bos.adt.include
bos.adt.lib
bos.adt.libm
bos.adt.utils
from the first installation CD.
Depending on where you got it, the makefile might need to be renamed
from ckuker.mak to makefile. Directions:
a. Type "make xxx" where xxx is the name of the makefile target most
appropriate to your platform, e.g. "make linux", "make aix43", etc.
Read the [92]comments at the top of the makefile for a complete
list of available targets (it's a long list).
b. Test the resulting 'wermit' file (see [93]Section 7 for
suggestions). If it's OK, proceed; otherwise [94]notify us.
NOTE: steps (c) through (e) can be accomplished using the
[95]makefile 'install' target as described in [96]Section 5.4.
c. Rename the 'wermit' file to 'kermit', copy it to the desired binary
directory (such as /usr/local/bin or /opt/something), and if it is
to be used for dialing out, give it the same owner, group, and
permissions as the 'cu' program (IMPORTANT: read [97]Sections 10
and [98]11 for details).
d. Install the man page, ckuker.nr, with your other man pages.
e. Install the accompanying text files (see [99]Section 5).
f. If you want C-Kermit to also offer a Telnet command-line
personality, make a symbolic link as follows:
cd directory-where-kermit-binary-is
ln -s kermit telnet
If you want C-Kermit to be the default Telnet client, make sure the
directory in which you created the symlink is in the PATH ahead of
the where the regular Telnet client is.
g. If you want C-Kermit to also offer an FTP command-line personality,
make a symlink called "ftp" as in (f).
h. If you want C-Kermit to also offer an FTTP command-line
personality, make a symlink called "http" as in (f).
i. If you want to offer an Internet Kermit Service, follow the
directions in the [100]IKSD Administrator's Guide.
4.0. Special Considerations for C-Kermit 8.0-9.0
[ [101]Top ] [ [102]Contents ] [ [103]Next ]
Also see: [104]C-Kermit Configuration Options
SECTION CONTENTS
4.1. [105]The Unix Makefile
4.2. [106]The C-Kermit Initialization File
4.3. [107]The 2.x BSD Makefile
4.4. [108]The Plan 9 Makefile
4.5. [109]Makefile Failures
(Also see the [110]Configurations Options document, [111]Section 8).
Lots of new features have been added in versions 7.0 and 8.0 that
require access to new symbols, APIs, libraries, etc, and this will no
doubt cause problems in compiling, linking, or execution on platforms
where 6.0 and earlier built without incident. This section contains
what we know as of the date of this file.
The first category concerns the new Kermit Service Daemon (IKSD; see
the [112]IKSD Administrator's Guide for details):
The wtmp File
When C-Kermit is started as an IKSD (under inetd), it makes
syslog and wtmp entries, and also keeps its own ftpd-like log.
The code assumes the wtmp log is /var/log/wtmp on Linux and
/usr/adm/wtmp elsewhere. No doubt this assumption will need
adjustment. Use -DWTMPFILE=path to override at compile time
(there is also a runtime override). See [113]iksd.html for
details.
UTMP, utsname(), etc
C-Kermit 7.0 gets as much info as it can about its job -- mainly
for IKSD logging -- from utmp. But of course utmp formats and
fields differ, and for that matter, there can be two different
header files, <utmp.h> and <utmpx.h>. Look for HAVEUTMPX and
HAVEUTHOST in [114]ckufio.c and let me know of any needed
adjustments.
Password lookup
IKSD needs to authenticate incoming users against the password
list. In some cases, this requires the addition of -lcrypt (e.g.
in Unixware 2.x). In most others, the crypt functions are in the
regular C library. If you get "crypt" as an unresolved symbol at
link time, add -lcrypt to LIBS. If your site has local
replacement libraries for authentication, you might need a
special LIBS clause such as "LIBS=-L/usr/local/lib -lpwent".
These days most Unix systems take advantage of shadow password
files or Pluggable Authentication Modules (PAM). If your system
uses shadow passwords you must add -DCK_SHADOW to the CFLAGS
list. If your system requires PAM you must add -DCK_PAM to the
CFLAGS and -lpam -ldl to LIBS.
getusershell()
This is called by the IKSD at login time to see if a user has
been "turned off". But many Unix platforms lack this function.
In that case, you will get unresolved symbol reports at link
time for _getusershell, _endusershell; to work around, add
-DNOGETUSERSHELL.
initgroups()
This is called by IKSD after successful authentication. But some
platforms do not have this function, so obviously it can't be
called there, in which case add -DNOINITGROUPS.
setreuid(), setreuid(), setregid() not found or "deprecated"
Find out what your Unix variety wants you to use instead, and
make appropriate substitutions in routine zvpass(), module
[115]ckufio.c, and [116]let us know.
printf()
IKSD installs a printf() substitute to allow redirection of
printf-like output to the connection. However, this can conflict
with some curses libraries. In this case, separate binaries must
be built for IKSD and non-IKSD use.
If you encounter difficulties with any of the above, and you are not
interested in running C-Kermit as an IKSD, then simply add NOIKSD to
CFLAGS and rebuild. Example:
make sco286
(get lots of errors)
make clean
make sco286 "KFLAGS=-DNOIKSD"
Some non-IKSD things to watch out for:
Return type of main()
The main() routine is in [117]ckcmai.c. If you get complaints
about "main: return type is not blah", define MAINTYPE on the CC
command line, e.g.:
make xxx "KFLAGS=-DMAINTYPE=blah
(where blah is int, long, or whatever). If the complaint is
"Attempt to return a value from a function of type void" then
add -DMAINISVOID:
make xxx "KFLAGS=-DMAINISVOID=blah
DNS Service Records
This feature allows a remote host to redirect C-Kermit to the
appropriate socket for the requested service; e.g. if C-Kermit
requests service "telnet" and the host offers Telnet service on
port 999 rather than the customary port 23. If you get
compile-time complaints about not being able to find <resolv.h>,
<netdb.h>, or <arpa/nameser.h>, add -DNO_DNS_SRV to CFLAGS. If
you get link-time complaints about unresolved symbols res_search
or dn_expand, try adding -lresolve to LIBS.
\v(ipaddress)
If "echo \v(ipaddress)" shows an empty string rather than your
local IP address, add -DCKGHNLHOST to CFLAGS and rebuild.
<sys/wait.h>
If this file can't be found at compile time, add -DNOREDIRECT to
CFLAGS. This disables the REDIRECT and PIPE commands and
anything else that needs the wait() system service.
syslog()
C-Kermit can now write syslog records. Some older platforms
might not have the syslog facility. In that case, add
-DNOSYSLOG. Others might have it, but require addition of
-lsocket to LIBS (SCO OSR5 is an example). See [118]Section 15.
putenv()
If "_putenv" comes up as an undefined symbol, add -DNOPUTENV to
CFLAGS and rebuild.
"Passing arg1 of 'time' from incompatible pointer"
This is a mess. See the mass of #ifdefs in the appropriate
module, [119]ckutio.c or [120]ckufio.c.
gettimeofday()
Wrong number of arguments. On most platforms, gettimeofday()
takes two arguments, but on a handful of others (e.g. Motorola
System V/88 V4, SNI Reliant UNIX 5.43, etc) it takes one. If
your version of gettimeofday() is being called with two args but
wants one, add -DGTODONEARG.
"Assignment makes pointer from integer without a cast"
This warning might appear in [121]ckutio.c or [122]ckufio.c. (or
elsewhere), and usually can be traced to the use of a system or
library function that returns a pointer but that is not declared
in the system header files even though it should be. Several
functions are commonly associated with this error:
+ getcwd(): Add -DDCLGETCWD to CFLAGS and rebuild.
+ popen() : Add -DDCLPOPEN to CFLAGS and rebuild.
+ fdopen(): Add -DDCLFDOPEN to CFLAGS and rebuild.
"Operands of = have incompatible types"
"Incompatible types in assignment"
If this comes from [123]ckcnet.c and comes from a statement
involving inet_addr(), try adding -DINADDRX to CFLAGS. If that
doesn't help, then try adding -DNOMHHOST.
Complaints about args to get/setsockopt(), getpeername(), getsockname()
These are all in [124]ckcnet.c. Different platforms and OS's and
versions of the same OS change this all the time: int, size_t,
unsigned long, etc. All the affected variables are declared
according to #ifdefs within ckcnet.c, so find the declarations
and adjust the #ifdefs accordingly.
size_t
In case of complaints about "unknown type size_t", add
-DSIZE_T=int (or other appropriate type) to CFLAGS.
'tz' undefined
Use of undefined enum/struct/union 'timezone'
Left of 'tv_sec' specifies undefined struct/union 'timeval' And
similar complaints in [125]ckutio.c: Add -DNOGFTIMER and/or
-DNOTIMEVAL.
Symlinks
The new built-in DIRECTORY command should show symlinks like "ls
-l" does. If it does not, check to see if your platform has the
lstat() and readlink() functions. If so, add -DUSE_LSTAT and
-DCKSYMLINK to CFLAGS and rebuild. On the other hand, if lstat()
is unresolved at link time, add -DNOLSTAT to CFLAGS. If
readlink() is also unresolved, add -DNOSYMLINK.
realpath()
Link-time complains about realpath() -- find the library in
which it resides and add it to LIBS (example for Unixware 7.1:
"-lcudk70") or add -DNOREALPATH to CFLAGS and rebuild. If built
with realpath() but debug log file is truncated or mangled,
ditto (some realpath() implementations behave differently from
others). If built with realpath() and seemingly random core
dumps occur during file path resolution, ditto.
Failure to locate header file <term.h>
Usually happens on Linux systems that have the C compiler
installed, but not the ncurses package (see comments about
selective installs above). Go back and install ncurses, or use
"make linuxnc" (Linux No Curses).
"Can't find shared library libc.so.2.1"
"Can't find shared library libncurses.so.3.0", etc...
You are trying to run a binary that was built on a computer that
has different library versions than your computer, and your
computer's loader is picky about library version numbers.
Rebuild from source on your computer.
Time (struct tm) related difficulties:
Errors like the following:
"ckutio.c", line 11994: incomplete struct/union/enum tm: _tm
"ckutio.c", line 11995: error: cannot dereference non-pointer type
"ckutio.c", line 11995: error: assignment type mismatch
"ckutio.c", line 11997: warning: using out of scope declaration: localtime
"ckutio.c", line 11997: error: unknown operand size: op "="
"ckutio.c", line 11997: error: assignment type mismatch
"ckutio.c", line 11998: error: undefined struct/union member: tm_year
"ckutio.c", line 12000: error: undefined struct/union member: tm_mon
"ckutio.c", line 12001: error: undefined struct/union member: tm_mday
"ckutio.c", line 12002: error: undefined struct/union member: tm_hour
"ckutio.c", line 12003: error: undefined struct/union member: tm_min
"ckutio.c", line 12004: error: undefined struct/union member: tm_sec
are due to failure to include the appropriate time.h header
files. Unix platforms generally have one or more of the
following: <time.h>, <sys/time.h>, and <sys/timeb.h>. Any
combination of these might be required. Defaults are set up for
each makefile target. The defaults can be corrected on the CC
command line by adding the appropriate definition from the
following list to CFLAGS:
-DTIMEH Include <time.h>
-DNOTIMEH Don't include <time.h>
-DSYSTIMEH Include <sys/time.h>
-DNOSYSTIMEH Don't include <sys/time.h>
-DSYSTIMEBH Include <sys/timeb.h>
-DNOSYSTIMEBH Don't include <sys/timeb.h>
Note that <sys/timeb.h> is relatively scarce in the System V and
POSIX environments; the only platform of recent vintage where it
was/is used is OSF/1 and its derivatives (Digital Unix and Tru64
Unix).
Struct timeval and/or timezone not declared:
In some cases, merely including the appropriate time.h header
files is still not enough. POSIX.1 does not define the timeval
struct, and so the items we need from the header are protected
against us by #ifndef _POSIX_SOURCE or somesuch. In this case,
we have to declare the timeval (and timezone) structs ourselves.
To force this, include -DDCLTIMEVAL in CFLAGS.
Warnings about dn_expand() Argument #4
WARNING: argument is incompatible with prototyp. It's the old
char versus unsigned char stupidity again. Try to find a
compiler switch like GCC's "-funsigned-char". Failing that, add
-DCKQUERYTYPE=xxx to CFLAGS, where xxx is whatever 'man
dn_expand' tells you the type of the 4th argument should be
(presumably either char or unsigned char; in the latter case use
CHAR to avoid confusion caused by multiple words.
Switch Table Overflow (in [126]ckcuni.c)
Add -DNOUNICODE to CFLAGS.
Compile-time warnings about ck_out() or tgetstr() or tputs():
Easy solution: Add -DNOTERMCAP to CFLAGS. But then you lose the
SCREEN function. Real solution: Try all different combinations
of the following CFLAGS:
-DTPUTSARGTYPE=char -DTPUTSFNTYPE=int
-DTPUTSARGTYPE=int -DTPUTSFNTYPE=void
Until the warnings go away, except maybe "ck_outc: return with a
value in a function returning void", and in that case also add
-DTPUTSISVOID.
"Passing arg 1 of to tputs() makes pointer from integer without a
cast":
Add -DTPUTSARG1CONST to CFLAGS.
"Undefined symbol: dup2"
Add -DNOZEXEC to CFLAGS.
"header file 'termcap.h' not found"
Add -DNOHTERMCAP to CFLAGS.
Other difficulties are generally of the "where is curses.h and what is
it called this week?" variety (most easily solved by making symlinks in
the include and lib directories), or overzealous complaints regarding
type mismatches in function calls because of the totally needless and
silly signed versus unsigned char conflict (*), etc. In any case,
please send any compilation or linking warnings or errors to the
author, preferably along with fixes.
* C-Kermit does not use the signed property of chars at all anywhere,
ever. So if all chars and char *'s can be made unsigned at compile
time, as they can in gcc with "-funsigned-char", they should be.
IMPORTANT: If you find any of these hints necessary for a particular
make target (or you hit upon others not listed here), PLEASE SEND A
REPORT TO:
[127]kermit-support@columbia.edu
4.1. The Unix Makefile
[ [128]Top ] [ [129]Contents ] [ [130]Section Contents ] [ [131]Next ]
[ [132]Previous ]
If your distribution does not contain a file with the name "makefile"
or "Makefile", then rename the file called ckuker.mak to makefile:
mv ckuker.mak makefile
Then type "make xxx", where xxx is the platform you want to build
C-Kermit for. These are listed in the [133]comments at the top of the
makefile. For example, to build C-Kermit for Linux, type:
make linux
Here are some typical examples:
Target Description
linux Linux, any version on any hardware platform
openbsd OpenBSD, any version on any hardware platform
aix43 AIX 4.3
aix43g AIX 4.3, built with gcc
solaris9 Solaris 9
solaris9g Solaris 9 built with gcc
hpux1100 HP-UX 11-point-anything
The makefile is quite long, and at least two versions of Unix, SCO
Xenix/286 and 2.x BSD, cannot cope with its length. An attempt to "make
sco286" gives the message "Make: Cannot alloc mem for env.. Stop".
Solution: edit away some or all of the nonrelevant material from the
makefile. (A separate version of the makefile is provided for BSD 2.x:
ckubs2.mak but C-Kermit 8.0 can't be built for BSD 2.x -- it has simply
grown too large.)
Some make programs reportedly cannot handle continued lines (lines
ending in backslash (\)). If you have a problem with the makefile, try
editing the makefile to join the continued lines (remove the
backslashes and the following linefeed).
Other makefile troubles may occur because tabs in the makefile have
somehow been converted to spaces. Spaces and tabs are distinct in Unix
makefiles.
Similarly, carriage returns might have been added to the end of each
line, which also proves confusing to most Unix versions of make.
Check to see if there are comments about your particular version in its
makefile target itself. In a text editor such as EMACS or VI, search
for the make entry name followed by a colon, e.g. "linux:" (if you
really are building C-Kermit for Linux, do this now).
Check to see if there are comments about your particular version in the
[134]ckubwr.txt file ([135]CLICK HERE for the Web version).
If you have trouble with building [136]ckwart.c, or running the
resulting wart preprocessor program on [137]ckcpro.w:
1. Just "touch" the [138]ckcpro.c file that comes in the distribution
and then give the "make" command again, or:
2. Compile ckwart.c "by hand": cc -o wart ckwart.c, or:
3. Try various other tricks. E.g. one Linux user reported that that
adding the "static" switch to the rule for building wart fixed
everything:
wart: ckwart.$(EXT)
$(CC) -static -o wart ckwart.$(EXT) $(LIBS)
If your compiler supports a compile-time option to treat ALL chars (and
char *'s, etc) as unsigned, by all means use it -- and send me email to
let me know what it is (I already know about gcc -funsigned-char).
To add compilation options (which are explained later in this document)
to your makefile target without editing the makefile, include
"KFLAGS=..." on the make command line, for example:
make linux KFLAGS=-DNODEBUG
make bsd "KFLAGS=-DKANJI -DNODEBUG -DNOTLOG -DDYNAMIC -UTCPSOCKET"
Multiple options must be separated by spaces. Quotes are necessary if
the KFLAGS= clause includes spaces. The KFLAGS are added to the end of
the CFLAGS that are defined in the selected makefile target. For
example, the "bsd" entry includes -DBSD4 -DTCPSOCKET, so the second
example above compiles Kermit with the following options:
-DBSD4 -DTCPSOCKET -DKANJI -DNODEBUG -DNOTLOG -DDYNAMIC -UTCPSOCKET
(Notice how "-UTCPSOCKET" is used to negate the effect of the
"-DTCPSOCKET" option that is included in the makefile target.)
WARNING: Be careful with KFLAGS. If you build C-Kermit, change some
files, and then run make again using the same make entry but specifying
different KFLAGS than last time, make won't detect it and you could
easily wind up with inconsistent object modules, e.g. some of them
built with a certain option, others not. When in doubt, "make clean"
first to make sure all your object files are consistent. Similarly, if
you change CFLAGS, LIBS, or any other items in the makefile, or you
rebuild using a different makefile target, "make clean" first.
If you create a new makefile target, use static linking if possible.
Even though this makes your C-Kermit binary bigger, the resulting
binary will be more portable. Dynamically linked binaries tend to run
only on the exact configuration and version where they were built; on
others, invocation tends to fail with a message like:
Can't find shared library "libc.so.2.1"
4.2. The C-Kermit Initialization File
[ [139]Top ] [ [140]Contents ] [ [141]Section Contents ] [ [142]Next ]
[ [143]Previous ]
(This section is obsolete.) Read [144]Section 5 about the
initialization file.
4.3. The 2.x BSD Makefile
[ [145]Top ] [ [146]Contents ] [ [147]Section Contents ] [ [148]Next ]
[ [149]Previous ]
This section is obsolete. C-Kermit 6.0 was the last release that
could be built on PDP-11 based BSD versions.
4.4. The Plan 9 Makefile
[ [150]Top ] [ [151]Contents ] [ [152]Section Contents ] [ [153]Next ]
[ [154]Previous ]
Use the separate makefile [155]ckpker.mk. NOTE: The Plan 9 version of
C-Kermit 8.0 has not yet been built. There should be no impediment to
building it. However, even when built successfully, certain key
features are missing, notably TCP/IP networking.
4.5. Makefile Failures
[ [156]Top ] [ [157]Contents ] [ [158]Section Contents ] [
[159]Previous ]
First, be sure the source files are stored on your current disk and
directory with the right names (in lowercase). Second, make sure that
the makefile itself does not contain any lines with leading spaces:
indented lines must all start with horizontal TAB, and no spaces.
Then make sure that your Unix PATH is defined to find the appropriate
compiler for your makefile target. For example, on SunOS systems, "make
sunos41" builds C-Kermit for the BSD environment, and assumes that
/usr/ucb/cc will be used for compilation and linking. If your PATH has
/usr/5bin ahead of /usr/ucb, you can have problems at compile or link
time (a commonly reported symptom is the inability to find "ftime"
during linking). Fix such problems by redefining your Unix PATH, or by
specifying the appropriate "cc" in CC= and CC2= statements in your
makefile target.
During edits 166-167, considerable effort went into making C-Kermit
compilable by ANSI C compilers. This includes prototyping all of
C-Kermit's functions, and including the ANSI-defined system header
files for system and library functions, as defined in K&R, second
edition: <string.h>, <stdlib.h>, <unistd.h> (except in NeXTSTEP this is
<libc.h>), and <sys/stdtypes.h>. If you get warnings about any of these
header files not being found, or about argument mismatches involving
pid_t, uid_t, or gid_t, look in ckcdeb.h and make amendments. C-Kermit
assumes it is being compiled by an ANSI-compliant C compiler if
__STDC__ is defined, normally defined by the compiler itself. You can
force ANSI compilation without defining __STDC__ (which some compilers
won't let you define) by including -DCK_ANSIC on the cc command line.
On the other hand, if your compiler defines __STDC__ but still
complains about the syntax of Kermit's function prototypes, you can
disable the ANSI-style function prototyping by including -DNOANSI on
the command line.
For SCO OpenServer, UNIX, ODT, and XENIX compilations, be sure to pick
the most appropriate [160]makefile target, and be sure you have
installed an SCO development system that is keyed to your exact SCO
operating system release, down to the minor version (like 2.3.1).
Also note that SCO distributes some of its libraries in encrypted form,
and they must be decrypted before C-Kermit can be linked with them. If
not, you might see a message like:
ld: file /usr/lib/libsocket.a is of unknown type: magic number = 6365
To decrypt, you must supply a key (password) that came with your
license. Call SCO for further info.
If your compiler uses something other than int for the pid (process id)
data type, put -DPID_T=pid_t or whatever in your CFLAGS.
If you get complaints about unknown data types uid_t and gid_t, put
-DUID_T=xxx -DGID_T=yyy in your CFLAGS, where xxx and yyy are the
appropriate types.
If your compilation fails because of conflicting or duplicate
declarations for sys_errlist, add -DUSE_STRERROR or -DNDSYSERRLIST to
CFLAGS.
If your compilation dies because getpwnam() is being redeclared (or
because of "conflicting types for getwpnam"), add -DNDGPWNAM to your
CFLAGS. If that doesn't work, then add -DDCGPWNAM to your CFLAGS (see
ckufio.c around line 440).
If the compiler complains about the declaration of getpwnam() during an
ANSI C compilation, remove the declaration from ckufio.c or change the
argument in the prototype from (char *) to (const char *).
If you get complaints that getpwuid() is being called with an improper
type, put -DPWID_T=xx in your CFLAGS.
If you get compile-time warnings that t_brkc or t_eofc (tchars
structure members, used in BSD-based versions) are undefined, or
structure-member- related warnings that might be traced to this fact,
add -DNOBRKC to CFLAGS.
If you get a linker message to the effect that _setreuid or _setregid
is not defined, add -DNOSETREU to CFLAGS, or add -DCKTYP_H=blah to
CFLAGS to make C-Kermit read the right <types.h>-kind-of-file to pick
up these definitions.
If you get a message that _popen is undefined, add -DNOPOPEN to CFLAGS.
If you get a complaint at compile time about an illegal pointer-integer
combination in ckufio.c involving popen(), or at link time that _popen
is an undefined symbol, add the declaration "FILE *popen();" to the
function zxcmd() in ckufio.c (this declaration is supposed to be in
<stdio.h>). If making this change does not help, then apparently your
Unix does not have the popen() function, so you should add -DNOPOPEN to
your make entry, in which case certain functions involving "file" i/o
to the standard input and output of subprocesses will not be available.
If your linker complains that _getcwd is undefined, you can add a
getcwd() function to ckufio.c, or add it to your libc.a library using
ar:
#include <stdio.h>
char *
getcwd(buf,size) char *buf; int size; {
#ifndef NOPOPEN
#ifdef DCLPOPEN
FILE *popen();
#endif
FILE *pfp;
if (!buf) return(NULL);
if (!(pfp = popen("pwd","r"))) return(NULL);
fgets(buf,size-2,pfp);
pclose(pfp);
buf[strlen(buf)-1] = '\0';
return((char *)buf);
#else
buf[0] = '\0';
return(NULL);
#endif /* NOPOPEN */
}
#ifdef NOPOPEN
FILE *popen(s,t) char *s,*t; {
return(NULL);
}
#endif /* NOPOPEN */
If you get complaints about NPROC having an invalid value, add a valid
definition for it (depends on your system), as in the cray entry.
If you get some symbol that's multiply defined, it probably means that
a variable name used by Kermit is also used in one of your system
libraries that Kermit is linked with. For example, under PC/IX some
library has a variable or function called "data", and the variable
"data" is also used extensively by Kermit. Rather than edit the Kermit
source files, just put a -D in the make entry CFLAGS to change the
Kermit symbol at compile time. In this example, it might be
-Ddata=xdata.
Some symbol is defined in your system's header files, but it produces
conflicts with, or undesired results from, Kermit. Try undefining the
symbol in the makefile target's CFLAGS, for example -UFIONREAD.
Some well-known symbol is missing from your system header files. Try
defining in the makefile target's CFLAGS, for example -DFREAD=1.
You get many warnings about pointer mismatches. This probably means
that Kermit is assuming an int type for signal() when it should be
void, or vice-versa. Try adding -DSIG_I (for integer signal()) or
-DSIG_V (for void) to CFLAGS. Or just include KFLAGS=-DSIG_V (or
whatever) in your "make" command, for example:
make bsd KFLAGS=-DSIG_V
You get many messages about variables that are declared and/or set but
never used. It is difficult to avoid these because of all the
conditional compilation in the program. Ignore these messages.
Some of C-Kermit's modules are so large, or contain so many character
string constants, or are so offensive in some other way, that some C
compilers give up and refuse to compile them. This is usually because
the -O (optimize) option is included in the make entry. If this happens
to you, you can (a) remove the -O option from the make entry, which
will turn off the optimizer for ALL modules; or (b) compile the
offending module(s) by hand, including all the switches from make entry
except for -O, and then give the appropriate "make" command again; or
(c) increase the value of the -Olimit option, if your compiler supports
this option; or (d) change the [161]makefile target to first compile
each offending module explicitly without optimization, then compile the
others normally (with optimization), for example:
#Fortune 32:16, For:Pro 2.1 (mostly like 4.1bsd)
ft21:
@echo 'Making C-Kermit $(CKVER) for Fortune 32:16 For:Pro 2.1...'
$(MAKE) ckuusx.$(EXT) "CFLAGS= -DNODEBUG -DBSD4 -DFT21 -DNOFILEH \
-SYM 800 \ -DDYNAMIC -DNOSETBUF -DCK_CURSES $(KFLAGS) -DPID_T=short"
$(MAKE) ckuxla.$(EXT) "CFLAGS= -DNODEBUG -DBSD4 -DFT21 -DNOFILEH \
-SYM 800 \ -DDYNAMIC -DNOSETBUF -DCK_CURSES $(KFLAGS) -DPID_T=short"
$(MAKE) ckudia.$(EXT) "CFLAGS= -DNODEBUG -DBSD4 -DFT21 -DNOFILEH \
-SYM 800 \ -DDYNAMIC -DNOSETBUF -DCK_CURSES $(KFLAGS) -DPID_T=short"
$(MAKE) wermit "CFLAGS= -O -DNODEBUG -DBSD4 -DFT21 -DNOFILEH -SYM 800 \
-DDYNAMIC -DNOSETBUF -DCK_CURSES $(KFLAGS) -DPID_T=short" \
"LNKFLAGS= -n -s" "LIBS= -lcurses -ltermcap -lv -lnet"
As an extreme example, some compilers (e.g. gcc on the DG AViiON) have
been known to dump core when trying to compile ckwart.c with
optimization. So just do this one "by hand":
cc -o wart ckwart.c
or:
touch ckcpro.c
and then give the "make" command again.
Speaking of wart, it is unavoidable that some picky compilers might
generate "statement unreachable" messages when compiling ckcpro.c.
Unreachable statements can be generated by the wart program, which
generates ckcpro.c automatically from [162]ckcpro.w, which translates
lex-like state/input constructions into a big switch/case construction.
Some function in Kermit wreaks havoc when it is called. Change all
invocations of the function into a macro that evaluates to the
appropriate return code that would have been returned by the function
had it been called and failed, for example: -Dzkself()=0. Obviously not
a good idea if the function is really needed.
If you have just installed SunOS 4.1.2 or 4.1.3, you might find that
C-Kermit (and any other C program) fails to link because of unresolved
references from within libc. This is because of a mistake in Sun's
/usr/lib/shlib.etc files for building the new libc. Change the libc
Makefile so that the "ld" lines have "-ldl" at the end. Change the
README file to say "mv xccs.multibyte. xccs.multibyte.o" and follow
that instruction.
5. INSTALLING THE KERMIT FILES
[ [163]Top ] [ [164]Contents ] [ [165]Next ] [ [166]Previous ]
SECTION CONTENTS