imported 9.0.299 Beta 02
[ckermit.git] / makefile
index b89778d..454d3e4 100644 (file)
--- a/makefile
+++ b/makefile
@@ -1,10 +1,9 @@
 # makefile / Makefile / ckuker.mak / CKUKER.MAK
 #
-# Thu Jun 16 17:36:23 2011
-# Note: sources haven't changed since 20110615, only this file.
-BUILDID=20110615
+# Tue Jun 21 13:04:45 2011
+BUILDID=20110621
 CKVER= "9.0.299"
-TESTID= "Beta.01"
+TESTID= "Beta.02"
 #
 # -- Makefile to build C-Kermit for UNIX and UNIX-like platforms --
 #
@@ -17,13 +16,13 @@ TESTID= "Beta.01"
 #
 # Author: Frank da Cruz, Columbia University
 # 612 West 115th Street, New York NY 10025-7799, USA
-# E-mail: fdc@columbia.edu
-# Web:    http://www.columbia.edu/kermit/
-# FTP:    ftp://kermit.columbia.edu/kermit/
+# Email: fdc@columbia.edu
+# Web:   http://kermit.columbia.edu/
+# FTP:   ftp://kermit.columbia.edu/kermit/
 #
 # Note: Author is no longer at Columbia University or at the 115th Street
 # address effective 1 July 2011.  The email address should still work,
-# and the website and FTP addresses, for the foreseeable future.
+# as well as the website and FTP addresses, for the foreseeable future.
 #
 # Contributions from many others.  Special thanks to Jeff Altman for the
 # secure-build targets, Peter Eichhorn, assyst GmbH, for the consolidated
@@ -55,13 +54,18 @@ TESTID= "Beta.01"
 # separated by whitespace.  Some versions of "make" understand these as
 # directives.  Uppercase letters remove the danger, e.g. "# If you have..."
 # 
-# WARNING: This is a huge makefile and it contains nested makes.  Although
+# WARNING: This is a huge makefile.  Although
 # this is less likely since the turn of the century, some "make" programs
 # might run out of memory.  If this happens to you, edit away the parts that
 # do not apply to your platform and try again.
 #
+# WARNING 2: In many cases this file invokes itself recursively, sometimes
+# several levels deep (as in the Linux targets); i.e. some targets are used
+# as 'subroutines' of other targets, with parameters passed by setting
+# environment variables.  For that reason, don't use 'make -e'.
+#
 # Certain UNIX variations have their own separate makefiles:
-#  . For 2.10 or 2.11 BSD on DEC PDP-11s, use ckubs2.mak.
+#  . For 2.10 or 2.11 BSD on the DEC PDP-11, use ckubs2.mak.
 #  . For Plan 9, use ckpker.mk.
 #
 # Separate build procedures are provided non-UNIX platforms: VMS, VOS,
@@ -79,7 +83,9 @@ TESTID= "Beta.01"
 #
 # Other targets:
 #  'make install' is an installation script (read accompanying comments!).
+#  'make uninstall' undoes 'make install' (read accompanying comments!).
 #  'make clean' removes intermediate and object files.
+#  'make show' tells the default include and lib paths for secure builds.
 #
 # IMPORTANT:
 #   For more detailed installation instructions, read the files ckuins.txt
@@ -113,7 +119,7 @@ TESTID= "Beta.01"
 #
 # TARGETS FOR DIFFERENT UNIX PLATFORMS AND VERSIONS:
 #
-# + Marks those that have been built successfully for C-Kermit 8.0 or later.
+# + Marks those that have been built successfully for C-Kermit 9.0 or later.
 # - Those that once built OK but no longer do (e.g. too big).
 # ? Those that worked in a previous version but have not been tested recently.
 # --------------------------
@@ -296,7 +302,7 @@ TESTID= "Beta.01"
 # ? for Data General MV systems with DG/UX, ???
 # ? for Data General MV systems with MV/UX, use AOS/VS C-Kermit (CKDKER.MAK)
 # ? for Data General MV systems with AOS/VS, use CKDKER.MAK (last = C-K 7.0)
-#   for DEC PDP-11 with Berkeley UNIX 2.x, see Berkeley UNIX 2.x.
+# ? for DEC PDP-11 with Berkeley UNIX 2.x, see Berkeley UNIX 2.x.
 # ? for DEC PDP-11 with Mini-UNIX (Bell 6th Edition for PDP-11 with no MMU),
 #     probably no way to fit C-Kermit without I&D space.
 # ? for DEC PDP-11 with Ultrix-11 3.x, ??? (probably needs overlays)
@@ -319,6 +325,7 @@ TESTID= "Beta.01"
 # ? for DEC Alpha with Digital UNIX 3.2, "make du32"
 # ? for DEC Alpha with Digital UNIX 4.0-4.0D, "make du40" or "make du40gcc"
 # ? for DEC Alpha with Digital UNIX 4.0E or higher, see Tru64.
+# + for DEC Alpha with any version of DU or OSF/1, "make dec-osf1"
 # - for DEC Pro-350 with Pro/Venix V1.x, "make provx1" (version 5A is too big)
 # ? for DEC Pro-380 with Pro/Venix V2.0 (Sys V), "make sys3" or "make sys3nid"
 # ? for DEC Pro-380 with 2.9, 2.10, or 2.11 BSD, "make bsd29" or "make bsd210"
@@ -356,12 +363,17 @@ TESTID= "Beta.01"
 # ? for FreeBSD 3.x, "make freebsd3" (ncurses) or "make freebsd3c" (curses)
 # ? for FreeBSD 4.0, "make freebsd40"
 # ? for FreeBSD 4.1 or later, "make freebsd"
+# + NOTE: Just use "make freebsd" for any reasonably recent FreeBSD version.
 # ? for Harris HCX-2900, "make sys5r3"
 # ? for Harris Night Hawk 88K or 68K with CX/UX pre-6.1, "make sys5r3"
 # ? for Harris Night Hawk 88K or 68K with CX/UX 6.1 or later, "make cx_ux"
 # ? for Heurikon, "make sys3"
 # ? for HP-3000, MPE/ix, "make posix"?
 # ? for HP-9000 Series 300 with 4.4BSD, "make bsd44"
+
+# NOTE: Most of the HP-UX targets were tested successfully in 2010.
+# Verification needed for C-Kermit 9.0 Beta.01...
+
 # ? for HP-9000 Series 500, HP-UX 5.21 and no networking "make hpux0500"
 # ? for HP-9000 Series 500, HP-UX 5.21 with WIN/TCP 1.2 "make hpux0500wintcp"
 # ? for HP-9000 Series, HP-UX 6.5, without long filenames,
@@ -420,6 +432,7 @@ TESTID= "Beta.01"
 #     or if you have GNU CC, "make minix386gcc"
 # ? for IBM PC family, 386-based, with MINIX 2.0, "make minix20"
 # ? for IBM PC family, 386-based, with MINIX 3.0, "make minix3"
+# + for IBM PC family, 386-based, with MINIX 3.0, "make minix315"
 # ? for IBM PS/2 with PS/2 AIX 1.0, 1.1, or 1.2, "make ps2aix" or ps2aixnetc.
 # ? for IBM PS/2 with PS/2 AIX 1.3, "make ps2aix3"
 # ? for IBM RISC System/6000 with AIX 3.0, "make aix30"
@@ -526,8 +539,8 @@ TESTID= "Beta.01"
 #       ln /usr/include/sys/termiox.h /usr/include/termiox.h
 # ? for NCR System 3000, NCR UNIX 02.02.01, same as above.
 # ? for NCR MP-RAS System V R4 V2.03 or 3.02, "make mpras" or "make mprastcpc"
-# ? for NetBSD any version on any architecture, "make netbsd"
-# ? for NetBSD with SSL/TLS, SRP, and ZLIB, "make netbsd+ssl+srp+zlib"
+# + for NetBSD any version on any architecture, "make netbsd"
+# + for NetBSD with OpenSSL, "make netbsd+ssl"
 # ? for NetBSD with ncurses specified instead of curses, "make netbsdn"
 # ? for NetBSD with all curses support omitted, "make netbsdnc"
 # ? for NeXT with NeXTSTEP 1.0 through 3.2, "make next" (on a NeXT)
@@ -644,7 +657,7 @@ TESTID= "Beta.01"
 # ? for Sequent Symmetry S81 with DYNIX 3.0.xx, "make dynix3"
 # ? for Sequent DYNIX 3.1.xx, "make dynix31" or "make dynix31c"
 # ? for Siemens/Nixdorf SINIX-L Intel V5.41, "make sinix541i"
-# ? for Siemens/Nixdorf SINIX-N MIPS V5.42, "make sinix542"
+# + for Siemens/Nixdorf SINIX-N MIPS V5.42, "make sinix542"
 # ? for Siemens/Nixdorf SINIX-P MIPS V5.42 with gcc, "make sinix542g"
 # ? for Siemens/Nixdorf SINIX-Z Intel V5.42, "make sinix542i"
 # ? for Siemens/Nixdorf Reliant UNIX V5.43, "make sni543"
@@ -727,12 +740,13 @@ TESTID= "Beta.01"
 #     or (for models without hardware flow control), "make uteknohwfc"
 # ? for Tektronix XD88 series with UTekV OS, "make utekvr3"
 # ? for Tri Star Flash Cache with Esix SVR3.2, "make sys5r3"
-# + for Tru64 UNIX 4.0E, "make tru64-40e"
-# + for Tru64 UNIX 4.0F, "make tru64-40f"
-# + for Tru64 UNIX 4.0G, "make tru64-40g"
-# + for Tru64 UNIX 5.0A, "make tru64-50a"
-# + for Tru64 UNIX 5.1A, "make tru64-51a"
-# + for Tru64 UNIX 5.1B, "make tru64-51b"
+# NOTE: The Tru64 builds have been failing since 2010, but "make dec-osf" is OK
+# ? for Tru64 UNIX 4.0E, "make tru64-40e"
+# ? for Tru64 UNIX 4.0F, "make tru64-40f"
+# ? for Tru64 UNIX 4.0G, "make tru64-40g"
+# ? for Tru64 UNIX 5.0A, "make tru64-50a"
+# ? for Tru64 UNIX 5.1A, "make tru64-51a"
+# ? for Tru64 UNIX 5.1B, "make tru64-51b"
 # ? for Unistar, "make sys5"
 # ? for Unisys S/4040 68040 CTIX SVR3.2 6.4.1, "make ctix" or "make sys5r3"
 # ? for Unisys U5000 UNIX SVR3 6.x, "make sys5r3" or "make sys5r3c"
@@ -990,7 +1004,8 @@ show:
        @echo SRPINC=$(SRPINC)
        @echo SSLLIB=$(SSLLIB)
        @echo SSLINC=$(SSLINC)
-       
+       @exit
+
 # Install C-Kermit after building -- IMPORTANT: Read the instructions above
 # (SAMPLE INSTALLATION SCRIPT).  For SSL/TLS versions, ca_certs.pem file
 # should be installed in the appropriate place for your OpenSSL library, e.g.:
@@ -1721,7 +1736,7 @@ freebsd40:
 
 #FreeBSD 4.1 and above
 #Like FreeBSD 4.0 but without the NONOSETBUF hack and with CK_NEWTERM.
-#OK 2009/11/17 FreeBSD 7.2-RELEASE
+#OK 2011/06/15 FreeBSD 3.3, 4,4, 4.7, and 8.2
 freebsd freebsd41 freebsd72:
        @echo 'Making C-Kermit $(CKVER) for FreeBSD 4.1 or later...'
        $(MAKE) CC=$(CC) CC2=$(CC2) xermit KTARGET=$${KTARGET:-$(@)} \
@@ -1732,7 +1747,7 @@ freebsd freebsd41 freebsd72:
        "LIBS= -lncurses -lcrypt -lutil -lm $(LIBS)"
 
 #FreeBSD 5.0 or later with OpenSSL 0.9.7 or later.
-#OK 2009/11/17 FreeBSD 7.2-RELEASE
+#OK 2011/06/15 FreeBSD 4.7 and 8.2
 freebsd+ssl freebsd+openssl freebsd50+openssl:
        @echo 'Making C-Kermit $(CKVER) for FreeBSD 5.0, ncurses, openssl'
        $(MAKE) CC=$(CC) CC2=$(CC2) xermit KTARGET=$${KTARGET:-$(@)} \
@@ -1847,6 +1862,7 @@ netbsd+krb5+ssl netbsd+krb5+openssl+zlib:
 #then go to work/srp-x.y.z/libsrp and "bmake install".  As of 2005Q3, the
 #pkgsrc install only installed the statically linked client applications.  You
 #need to manually install the libraries to build your own applications.
+#NOT TESTED RECENTLY - probably needs work.
 netbsd+ssl+srp+zlib:
        @echo Making C-Kermit $(CKVER) for NetBSD with curses...
        $(MAKE) CC=$(CC) CC2=$(CC2) xermit KTARGET=$${KTARGET:-$(@)} \
@@ -1875,7 +1891,7 @@ netbsdn:
        -DCK_DTRCD -DCK_DTRCTS -DTPUTSARGTYPE=int -DFNFLOAT $(KFLAGS) -O" \
        "LIBS= -L/usr/pkg/lib -lncurses -lcrypt -lm -lutil $(LIBS)"
 
-#OpenBSD - All versions.
+#OpenBSD before 2.3.
 #Uses ncurses as its curses so use -ltermlib, not -ltermcap
 #But it doesn't use uu_lock() which was introduced in OpenBSD 2.3.
 #For that use the next entry.
@@ -2020,7 +2036,7 @@ oldmacosx103+secure:
 # Note: Mac OS X 10.5 and earlier are 32-bit; 10.6 and later 64-bit.
 # Note 2: As of C-Kermit 9.0 -NOUUCP is included by default because
 # Mac OS X doesn't support UUCP.  To undo this, use KFLAGS=-UNOUUCP.
-#OK: 2009/11/16 (for 10.3.9, 10.4.11, 10.5.8, 10.6.1)
+#OK: 2011/06/14 (for 10.4.11, 10.5.8, 10.6.7)
 macosx macosx10 macosx10.3.9 macosx10.4 macosx10.5 macosx10.6:
        @MACOSNAME=`/usr/bin/sw_vers -productName`; \
        MACOSV=`/usr/bin/sw_vers -productVersion`; \
@@ -2045,6 +2061,7 @@ macosx macosx10 macosx10.3.9 macosx10.4 macosx10.5 macosx10.6:
 #   automatically based on the Mac OS X version number.
 # See note about UUCP in previous target.
 #OK: 2009/11/16 (for 10.3.9, 10.4.11, 10.5.8, 10.6.1)
+#OK: 2011/06/14 (for 10.4.11, 10.5.8, 10.6.7)
 macosx+krb5+ssl macosx10.5+krb5+ssl macosx10.6+krb5+ssl \
 macosx+krb5+openssl macosx10.5+krb5+openssl macosx10.6+krb5+openssl:
        @MACOSNAME=`/usr/bin/sw_vers -productName`; \
@@ -2870,7 +2887,7 @@ rtacis:
 
 # This one should work for any AIX 4.2 or later: "make aix".
 # Other tags are for compatibility with old makefile targets.
-#OK: 2009/11/16
+#OK: 2011/06/11
 aix aix42 aix43 aix44 aix45 aix50 aix51 aix52 aix53 aix54 aix61:
        @echo Making C-Kermit $(CKVER) for IBM AIX...
        $(MAKE) xermit KTARGET=$${KTARGET:-$(@)} \
@@ -2899,7 +2916,7 @@ aixg:
 #
 # To build with gcc use "make aix CC=gcc CC2=gcc", or "make aixg"
 #
-#OK: 2009/11/16
+#OK: 2011/06/15
 aix+ssl aix51+openssl aix52+openssl aix53+openssl:
        @echo "Making C-Kermit $(CKVER) for IBM AIX with OpenSSL..."
        @echo "SSLINC=$(SSLINC) SSLLIB=$(SSLLIB)"
@@ -3895,6 +3912,7 @@ solaris9g64 solaris10g64 solaris11g64:
 #Solaris 9, 10, or 11 with SunPro CC
 #Uses streams PTYs rather than BSD ptys as in C-Kermit 8.0 and earlier.
 #This target is chained to by the secure targets below.
+#OK: 2011/06/15
 solaris9 solaris10 solaris11:
        @echo 'Making C-Kermit $(CKVER) for Solaris 9 or later with Sun CC'
        @case `uname -r` in \
@@ -3950,7 +3968,7 @@ solaris9+openssl solaris10+openssl solaris11+openssl:
 # chains to the solaris{9,10,11}g target but for some reason it doesn't work if
 # you add the -DFORWARD_X option, thus the solaris9g+openssl+forward_x target.
 #
-#OK: 2009/09/25 (but not tested on Solaris 11)
+#OK: 2020/06/15
 solaris9g+ssl solaris10g+ssl solaris11g+ssl \
 solaris9g+openssl solaris10g+openssl solaris11g+openssl:
        @echo 'Making C-Kermit $(CKVER) for Solaris 9/10/11 with OpenSSL: gcc'
@@ -5463,7 +5481,7 @@ hpux0700osf:
 #other files) increase the '...' value in '-Wc,-Ns...'! The default maximum
 #symbol table size (-Ns) is 2000 table entries. ckuus4.c from Mar 12 2010
 #needs 2031 table entries (C-Kermit Version "9.0.299").
-#OK: 2020/03/24
+#OK: 2010/03/24
 hpux0700sftcpc:
        @$(MAKE) hpux-header
        @echo 'supporting: NO long filenames, \c'
@@ -6049,9 +6067,9 @@ linuxp:
 #On 64-bit platforms, it does no harm.
 #As of 3 March 2009 we detect automatically if we have curses, ncurses,
 #or no curses at all.
-#OK: 2009/11/16
 #Added HAVE_LOCKDEV as openSuSE >= 11.3 uses ttylock directly instead of
 #baudboy 2010/08/23
+#OK: 2011/06/18
 linux:
        @if test \
        `grep grantpt /usr/include/*.h /usr/include/sys/*.h | wc -l` -gt 0; \
@@ -6092,10 +6110,12 @@ linux:
        "LIBS=$(LIBS) $$HAVE_LIBCURSES \
        `if test -n '$$HAVE_OPENPTY'; then echo -lutil; fi` \
        `if test -f /usr/lib64/libresolv.a || test -f /usr/lib64/libresolv.so \
-       || test -f /usr/lib/libresolv.a || test -f /usr/lib/libresolv.so; \
+       || test -f /usr/lib/libresolv.a || test -f /usr/lib/libresolv.so \
+       || ls /lib/x86_64-linux-gnu/libresolv.* > /dev/null 2> /dev/null; \
        then echo -lresolv; fi` \
        `if test -f /usr/lib64/libcrypt.a || test -f /usr/lib64/libcrypt.so \
-       || test -f /usr/lib/libcrypt.a || test -f /usr/lib/libcrypt.so; \
+       || test -f /usr/lib/libcrypt.a || test -f /usr/lib/libcrypt.so \
+       || ls /lib/x86_64-linux-gnu/libcrypt.* > /dev/null 2> /dev/null; \
        then echo -lcrypt; fi` \
        `if test -f /usr/lib64/liblockdev.a || \
        test -f /usr/lib64/liblockdev.so || \
@@ -6104,21 +6124,39 @@ linux:
        then echo -llockdev; fi`" \
        linuxa
 
+# Linux + Shadow passwords + PAM
+# OK 2011/06/18
+linux+shadow+pam:
+       @echo 'Making C-Kermit $(CKVER) for Linux+Shadow+PAM...'
+       $(MAKE) linux KTARGET=$${KTARGET:-$(@)} \
+       KFLAGS="-DCK_SHADOW -DCK_PAM $(KFLAGS)" \
+       "LNKFLAGS = $(LNKFLAGS)" \
+       "LIBS = -lpam"
+
+# Linux systems that have no <sys/select.h>.
+# (not tested in recent years, perhaps no longer needed)
+linuxns:
+       $(MAKE) linux KTARGET=$${KTARGET:-$(@)} KFLAGS=-DNO_SYS_SELECT_H
+
+# Linux-script-only:
+# A minimum-size version for Linux that does only scripting and
+# serial communication -- no networks, no file transfer, no security.
+# OK 2011/06/18
+linuxso:
+       $(MAKE) xermit KTARGET=$${KTARGET:-$(@)} "CC = gcc" "CC2 = gcc" \
+       "CFLAGS = -O -DLINUX -pipe -funsigned-char -DPOSIX -DCK_POSIX_SIG \
+       -DLINUXFSSTND -DNOCOTFMC -DNOXFER -DNODEBUG -DNOCSETS -DNOHELP \
+       -DNONET -DMINIDIAL -DNOSCRIPT -DNOIKSD -DNOPUSH $(KFLAGS)" \
+       "LNKFLAGS = $(LNKFLAGS)" "LIBS = "
+
 # Secure targets for Linux.  These work on RHAS4, RHEL4, and RHEL5,
 # unlike some of the older targets that follow.  They hook into the main Linux
 # target so we pick up all the other new stuff - large files, baudboy.h, the
 # appropriate pty interface, etc.
 
-# Linux with Kerberos 5 (but not 4) and OpenSSL.
-# Note: -DOPENSSL_097 is necessary.  Without it we use the wrong names
-# for the DES routines and the link step fails.
-# Note 2: In recent Red Hat releases libpam might be in /lib instead of in
-# /usr/lib.  There should be symlinks in place but if not add them yourself.
-#OK: 2010/04/01
-
 # Linux with Kerberos 5.
 # Use "make linux+krb5 KFLAGS=-DNO_KRB5_INIT_ETS" if necessary.
-#OK 2011/06/14 on Fedora 14:
+#OK 2011/06/16 on Fedora 14 with:
 # make linux+krb5 "LIBS=$LIBS /lib/libk5crypto.so.3 /lib/libcom_err.so.2"
 # On RHEL5: make linux+krb5 -UCK_DES
 linux+krb5:
@@ -6139,24 +6177,46 @@ linux+krb5:
            else echo "NO DES"; \
        fi; \
        K5CRYPTO=''; \
-       if ls /lib/libk5crypto* > /dev/null 2> /dev/null; then \
-               K5CRYPTO='-lk5crypto'; \
-       fi; \
+        if ls /lib/libk5crypto* > /dev/null 2> /dev/null; then \
+                K5CRYPTO='-lk5crypto'; \
+        else if ls /usr/lib64/libk5crypto* > /dev/null 2> /dev/null; then \
+                K5CRYPTO='-lk5crypto'; \
+        fi; fi; \
        COM_ERR=''; \
        if ls /lib/libcom_err* > /dev/null 2> /dev/null; then \
                COM_ERR='-lcom_err'; \
        fi; \
        GSSAPILIB='-lgssapi'; \
-       K5DIR=`echo $(K5LIB) | sed 's|-L||'`; \
-       if ls $$K5DIR/libgssapi_krb5* > /dev/null 2> /dev/null; then \
+       if ls /lib/libgssapi_krb5* > /dev/null 2> /dev/null; then \
                GSSAPILIB='-lgssapi_krb5'; \
-       fi; \
+       else if ls /usr/lib/libgssapi_krb5* > /dev/null 2> /dev/null; then \
+               GSSAPILIB='-lgssapi_krb5'; \
+       else K5DIR=`echo $(K5LIB) | sed 's|-L||'`; \
+               if ls $$K5DIR/libgssapi_krb5* > /dev/null 2> /dev/null; then \
+                       GSSAPILIB='-lgssapi_krb5'; \
+       fi; fi; fi; \
        $(MAKE) linux KTARGET=$${KTARGET:-$(@)} "CC = gcc" "CC2 = gcc" \
        "KFLAGS= -DCK_AUTHENTICATION -DCK_KERBEROS -DKRB5 $$OPENSSLOPTION \
        -DCK_ENCRYPTION $$HAVE_DES $(K5INC) $(K5INC)/krb5 \
        -I/usr/include/et $(KFLAGS)" "LNKFLAGS = $(LNKFLAGS)" \
        "LIBS = $(K5LIB) $$DES_LIB -lcrypto $$GSSAPILIB -lkrb5 \
-       $$K5CRYPTO $$COM_ERR $(LIBS)"
+       $$K5CRYPTO $$COM_ERR $(LIBS)" ; \
+       if [ ! -f ./wermit ] || [ ./ckcmai.o -nt ./wermit ] ; then \
+               echo ""; \
+               echo "If build failed try:"; \
+               echo ""; \
+               echo "  make clean ; make $${KTARGET:-$(@)} KFLAGS=-UCK_DES"; \
+               echo ""; \
+       fi
+
+# Linux with Kerberos 5 and Kerberos 4.
+# Use "make linux+krb5 KFLAGS=-DNO_KRB5_INIT_ETS" if necessary.
+# Add "KFLAGS=-UCK_DES" if failure messages look DES-related.
+# UNTESTED (because I can't find a box with Krb4 and Krb5 installed)
+linux+krb5+krb4:
+       @echo 'Making C-Kermit for Linux with Kerberos 4 and Kerberos 5'
+       $(MAKE) linux+krb5 KTARGET=$${KTARGET:-$(@)} \
+       "KFLAGS=-DKRB4 -DKRB524 $(KFLAGS)" "LIBS=$(LIBS) -lkrb4"
 
 # Linux with OpenSSL 
 # In Linux, SSL libs are often in /lib or /usr/lib and so found by default.
@@ -6170,7 +6230,7 @@ linux+krb5:
 # There's a new warning at the end that should come out if this happens,
 # and that should not come out if it didn't.
 #
-linux+ssl linux+openssl:
+linux+ssl linux+openssl linux+openssl+zlib+shadow+pam linux+openssl+shadow:
        @echo 'Making C-Kermit $(CKVER) for Linux+OpenSSL SSLLIB=$(SSLLIB)'
        @case `openssl version` in \
          *0.9.7*) OPENSSLOPTION="-DOPENSSL_097" ;; \
@@ -6184,20 +6244,21 @@ linux+ssl linux+openssl:
           ls $(SSLLIB)/libdes* > /dev/null 2> /dev/null; then \
              DES_LIB='-ldes425'; \
              HAVE_DES='-DCK_DES -DLIBDES'; \
-              echo "HAVE DES"; \
-           else echo "NO DES"; \
+             echo "HAVE DES"; \
+          else echo "NO DES"; \
        fi; \
        $(MAKE) linux KTARGET=$${KTARGET:-$(@)} "CC = gcc" "CC2 = gcc" \
        "KFLAGS= -DCK_AUTHENTICATION -DCK_ENCRYPTION -DCK_CAST $$HAVE_DES \
        -DCK_SSL -DCK_PAM -DZLIB -DCK_SHADOW $$OPENSSLOPTION $(SSLINC) \
        $(KFLAGS)" "LNKFLAGS = $(LNKFLAGS)" \
-       "LIBS = $(SSLLIBS) -lssl $$DES_LIB -lcrypto -lpam -ldl -lz $(LIBS)"; \
-       if [ ! -f ./wermit ] || [ ckcmai.o -nt ./wermit ]; then \
-       echo ""; \
-       echo "If build failed try:"; \
-       echo ""; \
-       echo "  make clean ; make linux+ssl KFLAGS=-UCK_DES"; \
-       echo ""; fi
+       "LIBS = $(SSLLIB) -lssl $$DES_LIB -lcrypto -lpam -ldl -lz $(LIBS)" ; \
+       if [ ! -f ./wermit ] || [ ./ckcmai.o -nt ./wermit ] ; then \
+               echo ""; \
+               echo "If build failed try:"; \
+               echo ""; \
+               echo "  make clean ; make $${KTARGET:-$(@)} KFLAGS=-UCK_DES"; \
+               echo ""; \
+       fi
 
 # Linux with Kerberos 5 and OpenSSL
 # OK 2011/05/16
@@ -6221,61 +6282,49 @@ linux+krb5+ssl linux+krb5+openssl:
           else echo "NO DES"; \
        fi; \
        K5CRYPTO=''; \
-       if ls /lib/libk5crypto* > /dev/null 2> /dev/null; then \
-               K5CRYPTO='-lk5crypto'; \
-       fi; \
+        if ls /lib/libk5crypto* > /dev/null 2> /dev/null; then \
+                K5CRYPTO='-lk5crypto'; \
+        else if ls /usr/lib64/libk5crypto* > /dev/null 2> /dev/null; then \
+                K5CRYPTO='-lk5crypto'; \
+        fi; fi; \
        COM_ERR=''; \
        if ls /lib/libcom_err* > /dev/null 2> /dev/null; then \
                COM_ERR='-lcom_err'; \
        fi; \
        GSSAPILIB='-lgssapi'; \
-       K5DIR=`echo $(K5LIB) | sed 's|-L||'`; \
-       echo K5DIR=$$K5DIR; \
-       if ls $$K5DIR/libgssapi_krb5* > /dev/null 2> /dev/null; then \
+       if ls /lib/libgssapi_krb5* > /dev/null 2> /dev/null; then \
                GSSAPILIB='-lgssapi_krb5'; \
-       fi; \
+       else if ls /usr/lib/libgssapi_krb5* > /dev/null 2> /dev/null; then \
+               GSSAPILIB='-lgssapi_krb5'; \
+       else K5DIR=`echo $(K5LIB) | sed 's|-L||'`; \
+               if ls $$K5DIR/libgssapi_krb5* > /dev/null 2> /dev/null; then \
+                       GSSAPILIB='-lgssapi_krb5'; \
+       fi; fi; fi; \
        $(MAKE) linux KTARGET=$${KTARGET:-$(@)} "CC = gcc" "CC2 = gcc" \
        "KFLAGS= -DCK_AUTHENTICATION -DCK_KERBEROS -DKRB5 \
        -DCK_SSL -DCK_PAM -DZLIB -DCK_SHADOW $$OPENSSLOPTION $(SSLINC) \
        -DCK_ENCRYPTION $$HAVE_DES $(K5INC) $(K5INC)/krb5 \
        -I/usr/include/et $(KFLAGS)" "LNKFLAGS = $(LNKFLAGS)" \
-       "LIBS = $(K5LIB) $(SSLLIBS) -lssl $$DES_LIB -lpam -lz \
-       -lcrypto $$GSSAPILIB_krb5 -lkrb5 $$K5CRYPTO $$COM_ERR $(LIBS)" \
-       if [ ! -f ./wermit ] || [ ckcmai.o -nt ./wermit ]; then \
-       echo ""; \
-       echo "If build failed try:"; \
-       echo ""; \
-       echo "  make clean ; make linux+ssl KFLAGS=-UCK_DES"; \
-       echo ""; fi
-
-#Linux configured for SSL/TLS, ZLIB, PAM and Shadow Passwords
-#OK: 2009/11/17
-linux+openssl+zlib+shadow+pam:
-       @echo 'Making C-Kermit $(CKVER) for Linux on i386 with SSL/TLS...'
-       $(MAKE) linux KTARGET=$${KTARGET:-$(@)} "CC = gcc" "CC2 = gcc" \
-       "KFLAGS = -DCK_AUTHENTICATION -DCK_SSL -DCK_PAM -DZLIB -DOPENSSL_097 \
-       -DCK_SHADOW $(SSLINC) $(KFLAGS)" "LNKFLAGS = $(LNKFLAGS)" \
-       "LIBS= $(SSLLIB) -lssl -lcrypto -lz -lpam -ldl $(LIBS)"
-
-# As above but for Linux systems that have no <sys/select.h>.
-linuxns:
-       $(MAKE) linux KTARGET=$${KTARGET:-$(@)} KFLAGS=-DNO_SYS_SELECT_H
+       "LIBS = $(K5LIB) $(SSLLIB) -lssl $$DES_LIB -lpam -lz \
+       -lcrypto $$GSSAPILIB -lkrb5 $$K5CRYPTO $$COM_ERR $(LIBS)" ; \
+       if [ ! -f ./wermit ] || [ ./ckcmai.o -nt ./wermit ] ; then \
+               echo ""; \
+               echo "If build failed try:"; \
+               echo ""; \
+               echo "  make clean ; make $${KTARGET:-$(@)} KFLAGS=-UCK_DES"; \
+               echo ""; \
+       fi
 
-# A minimum-size version for Linux that does only scripting and
-# serial communication -- no networks, no file transfer.
-linuxso:
-       $(MAKE) xermit KTARGET=$${KTARGET:-$(@)} "CC = gcc" "CC2 = gcc" \
-       "CFLAGS = -O -DLINUX -pipe -funsigned-char -DPOSIX -DCK_POSIX_SIG \
-       -DLINUXFSSTND -DNOCOTFMC -DNOXFER -DNODEBUG -DNOCSETS -DNOHELP \
-       -DNONET -DMINIDIAL -DNOSCRIPT -DNOIKSD -DNOPUSH $(KFLAGS)" \
-       "LNKFLAGS = $(LNKFLAGS)" "LIBS = "
+# ::BEGIN_OLD_LINUX_TARGETS::
 
-# The remaining Linux entries are for special or customized builds.  They
-# have not been generalized like the ones above.  Ideally, we should allow
-# for every combination of libc vs glibc, gcc vs egcs, curses vs ncurses,
-# Kerberos IV vs Kerberos V vs SRP (in any combination), and so on.  The
-# best way to do this is simply to set KFLAGS and LIBS values and then
-# chain to the main "linux" target, as in the examples just above.
+# The remaining Linux entries are for special or customized builds.  They have
+# not been generalized ("subroutinized") like the ones above.  Ideally, we
+# should allow for every combination of libc vs glibc, gcc vs egcs, curses vs
+# ncurses, Kerberos IV vs Kerberos V vs SRP (in any combination), and so on.
+# The best way to do this is to set KFLAGS and LIBS values and then chain to
+# the main "linux" target, as in the examples just above.  To skip past all of
+# these old targets (and there are many) search for ::END_OLD_LINUX_TARGETS::
+# (after this line).
 
 #Sharp Zaurus SL-5500 - Linux based
 zsl5500:
@@ -6343,20 +6392,6 @@ linux+krb5-old:
        "LIBS = $(K5LIB) -lncurses -ltermcap -ldes425 -lkrb5 \
        -lcom_err -lk5crypto -lgssapi_krb5 -lcrypt -lresolv"
 
-#Linux on Intel PC with Cygnus or MIT Kerberos 5 1.2.1 with K4 compatibility.
-#
-# Requires the Kerberos 1.2.1 be compiled with KRB4 compatibility.
-linux+krb5+krb4:
-       @echo 'Making C-Kermit $(CKVER) for Linux on Intel with Kerberos...'
-       $(MAKE) xermit KTARGET=$${KTARGET:-$(@)} "CC = gcc" "CC2 = gcc" \
-       "CFLAGS = -O -funsigned-char -pipe -DPOSIX -DLINUX -DNOCOTFMC \
-       -DCK_AUTHENTICATION -DCK_KERBEROS -DKRB5 -DKRB4 -DKRB524 \
-       -DCK_ENCRYPTION -DCK_DES -DCK_CURSES -DCK_POSIX_SIG \
-       -DTCPSOCKET -DLINUXFSSTND -DHAVE_CRYPT_H $(K5INC) $(K5INC)/krb5 \
-       $(KFLAGS)" "LNKFLAGS = $(LNKFLAGS)" \
-       "LIBS = $(K5LIB) -lncurses -ltermcap -lkrb4 -ldes425 -lkrb5 \
-       -lcom_err -lk5crypto -lcrypt -lgssapi_krb5 -lresolv"
-
 # Linux on Intel PC with SRP 1.7.4 using GNU MP, Krypto, and Eric Young's
 # DES library.  Remove the -DCK_DES, -DLIBDES and -ldes if you do not have
 # Eric Young's# libdes.a installed.
@@ -6431,41 +6466,6 @@ linux+srp+pam:
        "LIBS = $(SRPLIB) $(SSLLIB) -lncurses -ltermcap -lsrp -lkrypto \
        -lcrypto -lcrypt -lpam -ldl -lm -lresolv"
 
-linux+shadow+pam:
-       @echo 'Making C-Kermit $(CKVER) for Linux on i386 with Shadow+PAM...'
-       $(MAKE) xermit KTARGET=$${KTARGET:-$(@)} "CC = gcc" "CC2 = gcc" \
-       "CFLAGS = -O -funsigned-char -pipe -DPOSIX -DLINUX -DNOCOTFMC \
-       -DCK_CURSES -DCK_POSIX_SIG -DTCPSOCKET -DLINUXFSSTND -DHAVE_CRYPT_H \
-       -DCK_SHADOW -DCK_PAM -DFNFLOAT \
-       $(KFLAGS)" "LNKFLAGS = $(LNKFLAGS)" \
-       "LIBS = -lncurses -ltermcap -lcrypt -lpam -ldl -lm -lresolv"
-
-#Linux configured for SSL/TLS.
-#Remove -ltermcap if it causes trouble e.g. in Debian 2.2.
-#If you have OpenSSL 0.9.7 or later, add -DOPENSSL_097 to KFLAGS.
-oldlinux+openssl:
-       @echo 'Making C-Kermit $(CKVER) for Linux on i386 with SSL/TLS...'
-       $(MAKE) xermit KTARGET=$${KTARGET:-$(@)} "CC = gcc" "CC2 = gcc" \
-       "CFLAGS = -O -funsigned-char -pipe -DPOSIX -DLINUX -DNOCOTFMC \
-       -DCK_AUTHENTICATION -DCK_SSL \
-       -DCK_CURSES -DCK_POSIX_SIG -DTCPSOCKET -DLINUXFSSTND -DHAVE_CRYPT_H \
-       -DFNFLOAT $(SSLINC) $(KFLAGS)" "LNKFLAGS = $(LNKFLAGS)" \
-       "LIBS= $(SSLLIB) \
-       -lncurses -ltermcap -lssl -lcrypto -lm -lresolv -lcrypt"
-
-#Linux configured for SSL/TLS and Shadow Passwords
-#Remove -ltermcap if it causes trouble e.g. in Debian 2.2.
-#If you have OpenSSL 0.9.7 or later, add -DOPENSSL_097 to KFLAGS.
-linux+openssl+shadow:
-       @echo 'Making C-Kermit $(CKVER) for Linux on i386 with SSL/TLS...'
-       $(MAKE) xermit KTARGET=$${KTARGET:-$(@)} "CC = gcc" "CC2 = gcc" \
-       "CFLAGS = -O -funsigned-char -pipe -DPOSIX -DLINUX -DNOCOTFMC \
-       -DCK_AUTHENTICATION -DCK_SSL \
-       -DCK_CURSES -DCK_POSIX_SIG -DTCPSOCKET -DLINUXFSSTND -DHAVE_CRYPT_H \
-       -DFNFLOAT -DCK_SHADOW $(SSLINC) $(KFLAGS)" "LNKFLAGS = $(LNKFLAGS)" \
-       "LIBS= $(SSLLIB) \
-       -lncurses -ltermcap -lssl -lcrypto -lm -lresolv -lcrypt"
-
 #Linux on Intel PC with SRP and SSL/TLS.
 #
 # libsrp.a should be build with OpenSSL
@@ -6883,6 +6883,8 @@ linuxold:
        "CFLAGS = -O -DLINUX -DPOSIX -DCK_CURSES -DCK_POSIX_SIG -DNOLEARN \
        $(KFLAGS)" "LNKFLAGS = $(LNKFLAGS)" "LIBS = -lcurses -ltermcap"
 
+# ::END_OLD_LINUX_TARGETS::
+
 # LynxOS 2.2 with GCC compiler, TCP/IP and fullscreen display.
 # Probably also works with Lynx 2.1, and maybe even Lynx 2.0.
 # -X means use termios serial drivers rather than BSD4.3-style sgtty drivers.
@@ -7137,6 +7139,7 @@ sco3r22netc:
 #Use -M3 to generate 32-bit i386 code instead of 16-bit segmented i286 code.
 #Use -Me to enable MS nonstandard keywords in system headers.
 #Use -W2 or W3 to increase the warning level.
+#OK: 2011/06/15
 sco234:
        @echo 'Making C-Kermit $(CKVER) for SCO XENIX 2.3.4...'
        $(MAKE) wermit KTARGET=$${KTARGET:-$(@)} \
@@ -7568,7 +7571,7 @@ sco32v507net:
        -b elf -DPOSIX $(KFLAGS)"
 
 #SCO OpenServer 6 (new target 30 Jan 2006)
-sco_osr600:
+sco_osr600 sco600:
        @echo Making C-Kermit $(CKVER) for SCO OpenServer 6.0.0...
        $(MAKE) xermit KTARGET=$${KTARGET:-$(@)} \
        "CFLAGS= -O -DDIRENT -DHDBUUCP -DSVR4 -DCK_SCOV5 -DCK_RTSCTS \
@@ -7619,6 +7622,7 @@ trs16:
 #      @rm use.qnx
 #
 # If you get warnings about HEADER or C_IN add -DNO_DNS_SRV.
+# OK 2011/06/14
 qnx32:
        @echo 'Making C-Kermit $(CKVER) for QNX 4.2x, 32-bit...'
        $(MAKE) xermit \