Standards-Version: 3.9.6 (no changes)
[ckermit.git] / makefile
index b89778d..41eee42 100644 (file)
--- a/makefile
+++ b/makefile
@@ -1,10 +1,8 @@
 # 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
-CKVER= "9.0.299"
-TESTID= "Beta.01"
+# Sun Aug 21 10:33:08 2011
+BUILDID=20110821
+CKVER= "9.0.302"
 #
 # -- Makefile to build C-Kermit for UNIX and UNIX-like platforms --
 #
@@ -17,20 +15,23 @@ 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.
+# For new developments, also check:
+#
+#    http://www.columbia.edu/~fdc/kermit/
 #
 # Contributions from many others.  Special thanks to Jeff Altman for the
 # secure-build targets, Peter Eichhorn, assyst GmbH, for the consolidated
 # HP-UX targets and the "uninstall" target, to Robert Lipe for the updated
 # and consolidated SCO UNIX / ODT / OSR5 targets, to Ric Anderson for the
 # IRIX 6.x targets, to Seth Theriault for major improvements to the
-# Mac OS X targets.
+# Mac OS X targets, and to Alexey Dokuchaev for FreeBSD 9.0.
 #
 # C-Kermit is written and produced by hand without any automated procedures
 # such as autoconf / automake / configure, although some of the targets below
@@ -55,13 +56,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
-# 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: 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 +85,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 +121,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.
 # --------------------------
@@ -127,6 +135,10 @@ TESTID= "Beta.01"
 # + "make netbsd+ssl", NetBSD with OpenSSL 0.9.7 or later.
 # + "make netbsd+krb5", NetBSD with Kerberos 5.
 # + "make netbsd+krb5+ssl", NetBSD with Kerberos 5 and OpenSSL 0.9.7 or later.
+# ? "make freebsd1" for FreeBSD 1.x
+# ? "make freebsd2" for FreeBSD 2.x
+# + "make freebsd3" for FreeBSD 3.x
+# ? "make freebsd4" for FreeBSD 4.0
 # + "make freebsd", FreeBSD 4.1 or later.
 # + "make freebsd+ssl", FreeBSD 5.0 or later with OpenSSL 0.9.7 or later.
 # + "make openbsd", OpenBSD 2.3 or later.
@@ -296,7 +308,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 +331,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 +369,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 +438,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 +545,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 +663,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"
@@ -682,8 +701,7 @@ TESTID= "Beta.01"
 # ? for Solaris 8 on SPARC or Intel, GNU CC, "make solaris8g".
 # + for Solaris 9 on SPARC (or Intel?), 32-bit, SunPro CC, "make solaris9".
 # + for Solaris 9 on SPARC (or Intel?), 32-bit, GNU CC, "make solaris9g".
-# + for Solaris 9 on SPARC 100% 64-bit, SunPro CC, "make solaris9_64".
-# + for Solaris 9 on SPARC (or Intel?), 64-bit, GNU CC, "make solaris9g64".
+# ? for Solaris 9 on SPARC (or Intel?), 64-bit, GNU CC, "make solaris9g64".
 # + for Solaris 10 on SPARC (or Intel?), 32-bit, SunPro CC, "make solaris10".
 # + for Solaris 10 on SPARC 64-bit, SunPro CC, "make solaris10_64".
 # + for Solaris 10 on SPARC (or Intel?), 32-bit, GNU CC, "make solaris10g".
@@ -727,12 +745,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 +1009,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.:
@@ -1692,6 +1712,7 @@ freebsd2c:
 
 #FreeBSD 3.x with ncurses and uu_lock()
 #(Note: uu_lock() goes back to 2.2.2, but not necessarily 2.0)
+#OK 2011/08/20 FreeBSD 3.3
 freebsd3:
        @echo 'Making C-Kermit $(CKVER) for FreeBSD 3.x with ncurses...'
        $(MAKE) CC=$(CC) CC2=$(CC2) xermit KTARGET=$${KTARGET:-$(@)} \
@@ -1721,27 +1742,61 @@ 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
-freebsd freebsd41 freebsd72:
+#NOTE: This target definitely does not work for FreeBSD 3.3 in 9.0.302.
+#and it has not been tested on 4 or 5.
+#OK 2011/06/xx FreeBSD 3.3, 4,4, 4.7, and 8.2
+#OK 2011/08/21 FreeBSD 3.3, 4.4, 6.4, 9.0
+freebsd freebsd41 freebsd72 freebsd5 freebsd6 freebsd7 freebsd8 freebsd9:
        @echo 'Making C-Kermit $(CKVER) for FreeBSD 4.1 or later...'
+       @if test `uname -r | cut -d . -f 1` -ge 8; then \
+          HAVE_FBSD8='-DFREEBSD8'; \
+       else HAVE_FBSD8=''; fi; \
+       if test `uname -r | cut -d . -f 1` -ge 9; then \
+          HAVE_FBSD9='-DFREEBSD9'; \
+       else HAVE_FBSD9='';  fi; \
+       if test -f /usr/include/utmpx.h ; \
+       then HAVE_UTMPX='-DHAVEUTMPX' ; \
+       else HAVE_UTMPX='' ; fi; \
        $(MAKE) CC=$(CC) CC2=$(CC2) xermit KTARGET=$${KTARGET:-$(@)} \
        "CFLAGS= -DBSD44 -DCK_NCURSES -DCK_NEWTERM -DTCPSOCKET -DNOCOTFMC \
-       -DFREEBSD4 -DUSE_UU_LOCK -DFNFLOAT \
-       -DHERALD=\"\\\" `uname` `uname -r`\\\"\" \
-       -funsigned-char -DTPUTSARGTYPE=int -DUSE_STRERROR $(KFLAGS) -O -pipe" \
+       -DFREEBSD4 $$HAVE_FBSD8 $$HAVE_FBSD9 -DUSE_UU_LOCK -DFNFLOAT \
+       $$HAVE_UTMPX -DHERALD=\"\\\" `uname -rs`\\\"\" \
+       -funsigned-char -DTPUTSARGTYPE=int -DUSE_STRERROR $(KFLAGS) \
+       -O2 -pipe"\
        "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
+#FreeBSD 5.0 or later with OpenSSL.
+#OK 2011/06/15 FreeBSD 4.7 and 8.2
+#OK 2011/08/20 FreeBSD 9.0-CURRENT
 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:-$(@)} \
-       "CFLAGS= -DBSD44 -DCK_NCURSES -DCK_NEWTERM -DTCPSOCKET -DNOCOTFMC \
-       -DCK_AUTHENTICATION -DCK_SSL $(SSLINC) -DZLIB \
-       -DFREEBSD4 -DUSE_UU_LOCK -DFNFLOAT -funsigned-char -DTPUTSARGTYPE=int \
-       -DFREEBSD41 -DFREEBSD42 -DFREEBSD43 -DFREEBSD44 -DFREEBSD45 \
-       -DFREEBSD46 -DFREEBSD50 -DUSE_STRERROR $(KFLAGS) -O -pipe" \
-       "LIBS= -lncurses -lcrypt -lssl -lcrypto -lutil -lm $(SSLLIB) $(LIBS)"
+       @echo 'Making C-Kermit $(CKVER) for FreeBSD with Kerberos 5...'
+       @case `openssl version` in \
+         *0.9.7*) OPENSSLOPTION="-DOPENSSL_097" ;; \
+         *0.9.8*) OPENSSLOPTION="-DOPENSSL_098" ;; \
+         *1.[0-9].[0-9]*) OPENSSLOPTION="-DOPENSSL_100" ;; \
+         *) OPENSSLOPTION="" ;; \
+       esac; \
+       HAVE_DES=''; \
+       DES_LIB=''; \
+       if ls /usr/lib/libdes* > /dev/null 2> /dev/null || \
+          ls $(SSLLIB)/libdes* > /dev/null 2> /dev/null; then \
+             DES_LIB='-ldes'; \
+             HAVE_DES='-DCK_DES -DLIBDES'; \
+              echo "HAVE DES"; \
+           else echo "NO DES"; \
+       fi; \
+       $(MAKE) freebsd KTARGET=$${KTARGET:-$(@)} "CC = $(CC)" "CC2 = $(CC2)" \
+       KFLAGS="-DCK_AUTHENTICATION -DCK_SSL $(SSLINC) -DZLIB $$OPENSSLOPTION \
+       $$HAVE_DES $(KFLAGS)"  "LNKFLAGS = $(LNKFLAGS)" \
+       "LIBS= -lncurses -lcrypt -lssl -lcrypto -lutil -lm \
+       $(SSLLIB) $$DES_LIB $(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
 
 #NetBSD 1.4.1 or later with vanity banner automated with uname
 #and automatic inclusion of large file support if it is available.
@@ -1750,6 +1805,7 @@ freebsd+ssl freebsd+openssl freebsd50+openssl:
 #disabled on ckcfn2.c ("KFLAGS=-O0") (Letter O Digit Zero).
 #(This could be automated by testing `uname -m` for "sun3".)
 #OK: 2011/06/15 on NetBSD 1.5.2 and 5.1.
+#OK: 2011/08/21 on 5.1.
 netbsd netbsd2 netbsd15 netbsd16 old-netbsd:
        @echo Making C-Kermit $(CKVER) for NetBSD with curses...
        $(MAKE) CC=$(CC) CC2=$(CC2) xermit KTARGET=$${KTARGET:-$(@)} \
@@ -1762,6 +1818,7 @@ netbsd netbsd2 netbsd15 netbsd16 old-netbsd:
 
 #NetBSD 1.4.1 or later with OpenSSL
 #OK: 2011/06/15 on NetBSD 5.1 (but not 1.5.2 with OpenSSL 0.9.5a)
+#OK: 2011/08/21 on 5.1.
 netbsd+ssl netbsd+openssl:
        @echo 'Making C-Kermit $(CKVER) for NetBSD+OpenSSL SSLLIB=$(SSLLIB)'
        @case `openssl version` in \
@@ -1779,7 +1836,7 @@ netbsd+ssl netbsd+openssl:
               echo "HAVE DES"; \
            else echo "NO DES"; \
        fi; \
-       $(MAKE) netbsd KTARGET=$${KTARGET:-$(@)} "CC = gcc" "CC2 = gcc" \
+       $(MAKE) netbsd KTARGET=$${KTARGET:-$(@)} "CC = $(CC)" "CC2 = $(CC2)" \
        "KFLAGS= -DCK_AUTHENTICATION -DCK_ENCRYPTION -DCK_CAST $$HAVE_DES \
        -DCK_SSL -DCK_PAM -DZLIB -DNO_DCL_INET_ATON $$OPENSSLOPTION \
        $(KFLAGS)" "LNKFLAGS = $(LNKFLAGS)" \
@@ -1789,9 +1846,9 @@ netbsd+ssl netbsd+openssl:
 #NetBSD with MIT Kerberos 5:
 # OK 2011/06/15 (once K5INC and K5LIB were set right).
 # NOT OK for Heimdal - Heimdal Kerberos support in C-Kermit needs work.
+# OK: 2011/08/21 on 5.1.
 netbsd+krb5:
        @echo 'Making C-Kermit $(CKVER) for NetBSD with Kerberos 5...'
-       @echo 'Making C-Kermit $(CKVER) for NetBSD+OpenSSL+Kerberos5...'
        @case `openssl version` in \
          *0.9.7*) OPENSSLOPTION="-DOPENSSL_097" ;; \
          *0.9.8*) OPENSSLOPTION="-DOPENSSL_098" ;; \
@@ -1807,7 +1864,7 @@ netbsd+krb5:
               echo "HAVE DES"; \
            else echo "NO DES"; \
        fi; \
-       $(MAKE) netbsd KTARGET=$${KTARGET:-$(@)} "CC = gcc" "CC2 = gcc" \
+       $(MAKE) netbsd KTARGET=$${KTARGET:-$(@)} "CC = $(CC)" "CC2 = $(CC2)" \
        "KFLAGS= -DCK_AUTHENTICATION -DCK_ENCRYPTION -DCK_KERBEROS -DKRB5 \
        -DCK_CAST $$HAVE_DES -DNOFTP_GSSAPI $(K5INC) $(K5INC)/krb5 \
        $(KFLAGS)" \
@@ -1815,7 +1872,7 @@ netbsd+krb5:
        -lcrypto -lgssapi -lkrb5 -lm -lutil $(LIBS)"
 
 # NetBSD - With Kerberos 5 and SSL and Zlib.
-# OK 2011/06/15
+# OK: 2011/08/21 on 5.1 with MIT Kerberos.
 netbsd+krb5+ssl netbsd+krb5+openssl+zlib:
        @echo 'Making C-Kermit $(CKVER) for NetBSD+OpenSSL+Kerberos5...'
        @case `openssl version` in \
@@ -1833,7 +1890,7 @@ netbsd+krb5+ssl netbsd+krb5+openssl+zlib:
               echo "HAVE DES"; \
            else echo "NO DES"; \
        fi; \
-       $(MAKE) netbsd KTARGET=$${KTARGET:-$(@)} "CC = gcc" "CC2 = gcc" \
+       $(MAKE) netbsd KTARGET=$${KTARGET:-$(@)} "CC = $(CC)" "CC2 = $(CC2)" \
        "KFLAGS= -DCK_AUTHENTICATION -DCK_ENCRYPTION -DCK_CAST $$HAVE_DES \
        -DCK_KERBEROS -DKRB5 -DNOFTP_GSSAPI $(K5INC) $(K5INC)/krb5 \
        -DCK_SSL -DCK_PAM -DZLIB -DNO_DCL_INET_ATON $$OPENSSLOPTION \
@@ -1847,6 +1904,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 +1933,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.
@@ -1893,6 +1951,8 @@ openbsdold:
 # -DUSE_UU_LOCK and -lutil added for uu_lock()
 # -DNDSYSERRLIST changed to -DUSE_STRERROR
 #If this gives you trouble use the previous entry.
+#NOTE: The openbsd and openbsd+ssl should be reworked to be like the
+#corresponding FreeBSD and NetBSD targets.  The mirbsd targets should
 openbsd:
        @echo Making C-Kermit $(CKVER) for OpenBSD 2.3 or later...
        $(MAKE) CC=$(CC) CC2=$(CC2) xermit KTARGET=$${KTARGET:-$(@)} \
@@ -2020,7 +2080,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 +2105,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 +2931,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 +2960,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)"
@@ -3788,12 +3849,30 @@ solaris9g+krb5+krb4:
        -lkrb4 -lcrypto -lgssapi_krb5 -lkrb5 -lcom_err -lk5crypto \
        -ldes $(LIBS)"
 
-#Solaris 9 with gcc + Kerberos 5.
-#Columbia Only - libdes has a version number in its name.
-#In the general case, change -ldes425 to -des.
-#If you have Kerberos 1.4 or later and and krb5_init_ets can't be found
-#at link time, add -DNO_KRB5_INIT_ETS.
-cu-solaris9g+krb5:
+#Solaris 9, 10, or 11 with gcc...  
+#Uses streams PTYs rather than BSD ptys as in C-Kermit 8.0 and earlier.
+#This target is chained to be the secure solaris9g+xxx targets below.
+solaris9g solaris10g solaris11g:
+       @echo 'Making C-Kermit $(CKVER) for Solaris 9 or later with gcc'
+       @case `uname -r` in \
+         5.9) SOLARISVERSION="-DSOLARIS9" ;; \
+         5.10) SOLARISVERSION="-DSOLARIS10" ;; \
+         5.11) SOLARISVERSION="-DSOLARIS11" ;; \
+         *) SOLARISVERSION="-DSOLARIS" ;; \
+       esac ; \
+       $(MAKE) "MAKE=$(MAKE)" CC="gcc -m32" CC2="gcc -m32" xermit \
+       KTARGET=$${KTARGET:-$(@)} \
+       "CFLAGS = -g -O -Usun -DSVR4 $$SOLARISVERSION -DUSE_STRERROR \
+       -DSTERMIOX -DSELECT -DFNFLOAT -DCK_PAM -DCK_SHADOW -funsigned-char \
+       -DHAVE_STREAMS -DHAVE_GRANTPT -DHAVE_PTSNAME -DPUSH_PTEM \
+       -DPUSH_LDTERM -DPUSH_TTCOMPAT \
+       -DCK_CURSES -DCK_NEWTERM -DDIRENT -DHDBUUCP -DTCPSOCKET \
+       -D_FILE_OFFSET_BITS=64 $(KFLAGS)" \
+       "LIBS= -ltermlib -lsocket -lnsl -lm -lresolv -lpam $(LIBS)"
+
+#Solaris 9, 10, or 11 with gcc + Kerberos 5 + OpenSSL.
+#OK C-Kermit 9.0.301.
+solaris9g+krb5+ssl solaris10g+krb5+ssl solaris11g+krb5+ssl:
        @case `openssl version` in \
          *0.9.7*) OPENSSLOPTION="-DOPENSSL_097" ;; \
          *0.9.8*) OPENSSLOPTION="-DOPENSSL_098" ;; \
@@ -3818,58 +3897,13 @@ cu-solaris9g+krb5:
        $(MAKE) xermit KTARGET=$${KTARGET:-$(@)} CC=gcc CC2=gcc \
        "CFLAGS = -O -Usun -DSVR4 -DSOLARIS9 -DSTERMIOX -DSELECT -DFNFLOAT \
        -DCK_CURSES -DCK_NEWTERM -DDIRENT -DHDBUUCP -DTCPSOCKET  -DBIGBUFOK \
-       -DCK_AUTHENTICATION -DCK_KERBEROS -DKRB5 -DCK_ENCRYPTION -DCK_CAST \
-       $$OPENSSLOPTION $$HAVE_DES $(K5INC) $(K5INC)/krb5 $(KFLAGS)" \
-       "LIBS= $(K5LIB) -ltermlib -lsocket -lnsl -lm -lresolv -lcrypto \
+       -DCK_AUTHENTICATION -DCK_SSL -DZLIB -DCK_KERBEROS -DKRB5 \
+       -DCK_ENCRYPTION -DCK_CAST $$OPENSSLOPTION \
+       $$HAVE_DES $(SSLINC) $(K5INC) $(K5INC)/krb5 $(KFLAGS)" \
+       "LIBS= $(SSLLIB) $(K5LIB) -lz -lssl -ltermlib -lsocket -lnsl -lm \
+       -lresolv -lcrypto \
        $$GSSAPILIB -lkrb5 -lcom_err -lk5crypto $$DES_LIB $(LIBS)"
 
-#Solaris 9 with gcc + OpenSSL + Kerberos 5 + Krb4 + Shadow + Long files
-#Columbia Only, mainly because of the -R clause.
-# (I tried adding -DCK_SRP and -lsrp but got a lot of symbol referencing
-#  errors at link time.)
-cu-solaris9g+krb5+krb4+openssl+shadow+pam+zlib:
-       $(MAKE) xermit KTARGET=$${KTARGET:-$(@)} CC=gcc CC2=gcc \
-       "CFLAGS = -O -Usun -DSVR4 -DSOLARIS -DSTERMIOX -DSELECT -DFNFLOAT \
-       -DSOLARIS9 -D_FILE_OFFSET_BITS=64 -DBIGBUFOK \
-       -DCK_CURSES -DCK_NEWTERM -DDIRENT -DHDBUUCP -DTCPSOCKET \
-       -DCK_AUTHENTICATION -DCK_KERBEROS -DKRB5 -DKRB4 -DKRB524 \
-       -DCK_ENCRYPTION -DCK_SSL -DCK_DES -DCK_CAST -DNO_KRB5_INIT_ETS \
-       -DZLIB -DCK_PAM -DCK_SHADOW -DLIBDES -DOPENSSL_097 -DCK_FORWARD_X \
-       $(K5INC) $(K5INC)/krb5 $(SSLINC) $(KFLAGS)" \
-       "LIBS= $(K5LIB) $(SSLLIB) -R/opt/local/lib -ltermlib -lsocket -lnsl \
-       -lm -lresolv -lkrb4 -lssl -lcrypto -lgssapi_krb5 -lkrb5 \
-       -lcom_err -lk5crypto -lpam -ldes425 -lz $(LIBS)"
-
-#Solaris 9, 10, or 11 with gcc...  
-#Uses streams PTYs rather than BSD ptys as in C-Kermit 8.0 and earlier.
-#This target is chained to be the secure solaris9g+xxx targets below.
-solaris9g solaris10g solaris11g:
-       @echo 'Making C-Kermit $(CKVER) for Solaris 9 or later with gcc'
-       @case `uname -r` in \
-         5.9) SOLARISVERSION="-DSOLARIS9" ;; \
-         5.10) SOLARISVERSION="-DSOLARIS10" ;; \
-         5.11) SOLARISVERSION="-DSOLARIS11" ;; \
-         *) SOLARISVERSION="-DSOLARIS" ;; \
-       esac ; \
-       $(MAKE) "MAKE=$(MAKE)" CC="gcc -m32" CC2="gcc -m32" xermit \
-       KTARGET=$${KTARGET:-$(@)} \
-       "CFLAGS = -g -O -Usun -DSVR4 $$SOLARISVERSION -DUSE_STRERROR \
-       -DSTERMIOX -DSELECT -DFNFLOAT -DCK_PAM -DCK_SHADOW -funsigned-char \
-       -DHAVE_STREAMS -DHAVE_GRANTPT -DHAVE_PTSNAME -DPUSH_PTEM \
-       -DPUSH_LDTERM -DPUSH_TTCOMPAT \
-       -DCK_CURSES -DCK_NEWTERM -DDIRENT -DHDBUUCP -DTCPSOCKET \
-       -D_FILE_OFFSET_BITS=64 $(KFLAGS)" \
-       "LIBS= -ltermlib -lsocket -lnsl -lm -lresolv -lpam $(LIBS)"
-
-#Solaris 9, 10, or 11 with Sun CC, 64 bit build.
-#DON'T USE THIS ONE ON PC ARCHITECTURE - It compiles and links but won't run.
-#OK: 2009/11/16 (but not tested on Solaris 11)
-solaris9_64 solaris10_64 solaris11_64:
-       @echo 'Making C-Kermit $(CKVER) for Solaris 9/10/11 64-bit Sun CC'
-       $(MAKE) "MAKE=$(MAKE)" solaris9 KTARGET=$${KTARGET:-$(@)} \
-       "KFLAGS=-xarch=generic64 -U_FILE_OFFSET_BITS -DNOARROWKEYS" \
-       "LNKFLAGS= -xarch=generic64"
-
 #Solaris 9, 10, or 11 with gcc, 64 bit build.
 #Peeking inside FILE struct not allowed in 64-bit world.
 #DON'T USE THIS ONE ON PC ARCHITECTURE - It compiles and links but won't run.
@@ -3895,6 +3929,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 C-Kermit 9.0
 solaris9 solaris10 solaris11:
        @echo 'Making C-Kermit $(CKVER) for Solaris 9 or later with Sun CC'
        @case `uname -r` in \
@@ -3922,7 +3957,7 @@ solaris9 solaris10 solaris11:
 # Don't use 'make -e' because that inhibits passing of KFLAGS to
 # the base (solaris9) target.
 #
-#OK: 2011/06/14
+#OK C-Kermit 9.0
 solaris9+ssl solaris10+ssl solaris11+ssl \
 solaris9+openssl solaris10+openssl solaris11+openssl:
        @echo 'Making C-Kermit $(CKVER) for Solaris 9/10/11 with OpenSSL: cc'
@@ -3950,7 +3985,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: 2011/06/14
 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'
@@ -5335,7 +5370,7 @@ hpux0500:
        "CFLAGS = -DHPUX -DHPUX5 -DHPUXPRE65 -DNOREDIRECT -DDCLGETCWD \
        -DNOGETUSERSHELL -DNOGFTIMER -DNOSYSLOG -DNOTOMACROS -DNOLSTAT \
        -DNOSYMLINK -DNOINITGROUPS -DNOUNICODE -DNOLEARN -DNOLONGLONG \
-       $(KFLAGS)" "LIBS = $(LIBS)" "LNKFLAGS = "
+       -DVOID=int -DCKVOID=int $(KFLAGS)" "LIBS = $(LIBS)" "LNKFLAGS = "
 
 #HP-9000 500 HP-UX 5.21 with Wollongong WIN/TCP 1.2 TCP/IP.
 #Requires /usr/wins/usr/include and /usr/lib/libnet.a from Wollongong.
@@ -5345,9 +5380,9 @@ hpux0500:
 hpux0500wintcp:
        @MESSAGE1="with WIN/TCP but without any extra compiler optimization" \
        $(MAKE) hpux0500 KTARGET=$${KTARGET:-$(@)} \
-       "KFLAGS = -DTCPSOCKET -DHPUX5WINTCP -DINADDRX -DNO_DNS_SRV -DNOMHHOST \
-       -DNOHADDRLIST -DNOLONGLONG -I/usr/wins/usr/include $(KFLAGS)" \
-       "LIBS = /usr/lib/libnet.a"
+       "KFLAGS = -DTCPSOCKET -DHPUX5WINTCP -DINADDRX -DNO_DNS_SRV \
+       -DNOMHHOST -DVOID=int -DCKVOID=int -DNOHADDRLIST -DNOLONGLONG \
+       -I/usr/wins/usr/include $(KFLAGS)" "LIBS = /usr/lib/libnet.a"
 
 #HP-UX 6.5, short filenames, no network and no curses support.
 #ckcpro, ckuusr, ckuus3 and others are broken out because they make the
@@ -5463,7 +5498,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 +6084,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; \
@@ -6065,10 +6100,14 @@ linux:
           test -f /usr/lib/libncurses.a  || \
           test -f /usr/lib/libncurses.so; then \
          HAVE_LIBCURSES='-lncurses'; \
+       else if test -f /usr/lib/$(MULTIARCH)/libncurses.so || \
+          test -f /usr/lib/$(MULTIARCH)/libncurses.a  || \
+          test -f /usr/lib/$(MULTIARCH)/libncurses.so; then \
+         HAVE_LIBCURSES='-lncurses'; \
        else if test -f /usr/lib64/libcurses.so || \
           test -f /usr/lib/libcurses.a || \
           test -f /usr/lib/libcurses.so; then \
-            HAVE_LIBCURSES='-lcurses'; fi; fi; \
+            HAVE_LIBCURSES='-lcurses'; fi; fi; fi; \
        HAVE_CURSES=''; \
        if test -n '$$HAVE_LIBCURSES'; then \
          if test -f /usr/include/ncurses.h; then \
@@ -6092,33 +6131,58 @@ 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 \
+       || test -f /usr/lib/i386-linux-gnu/libresolv.a \
+       || test -f /usr/lib/i386-linux-gnu/libresolv.so \
+       || ls /lib/$(MULTIARCH)/libresolv.* > /dev/null 2> /dev/null \
+       || 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/$(MULTIARCH)/libcrypt.* > /dev/null 2> /dev/null \
+       || 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 || \
        test -f /usr/lib/liblockdev.a || \
-       test -f /usr/lib/liblockdev.so; \
+       test -f /usr/lib/liblockdev.so \
+       ls /usr/lib/$(MULTIARCH)/liblockdev.* > /dev/null 2> /dev/null; \
        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 +6203,48 @@ linux+krb5:
            else echo "NO DES"; \
        fi; \
        K5CRYPTO=''; \
-       if ls /lib/libk5crypto* > /dev/null 2> /dev/null; then \
+        if ls /lib/libk5crypto* > /dev/null 2> /dev/null; then \
+                K5CRYPTO='-lk5crypto'; \
+       else if ls /usr/lib/libk5crypto* > /dev/null 2> /dev/null; then \
                K5CRYPTO='-lk5crypto'; \
-       fi; \
+        else if ls /usr/lib64/libk5crypto* > /dev/null 2> /dev/null; then \
+                K5CRYPTO='-lk5crypto'; \
+        fi; 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 +6258,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 +6272,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 +6310,55 @@ linux+krb5+ssl linux+krb5+openssl:
           else echo "NO DES"; \
        fi; \
        K5CRYPTO=''; \
-       if ls /lib/libk5crypto* > /dev/null 2> /dev/null; then \
+        if ls /lib/libk5crypto* > /dev/null 2> /dev/null; then \
+                K5CRYPTO='-lk5crypto'; \
+       else if ls /usr/lib/libk5crypto* > /dev/null 2> /dev/null; then \
                K5CRYPTO='-lk5crypto'; \
-       fi; \
+        else if ls /usr/lib64/libk5crypto* > /dev/null 2> /dev/null; then \
+                K5CRYPTO='-lk5crypto'; \
+               else if ls /usr/lib/$(MULTIARCH)/libk5crypto* > /dev/null 2> /dev/null; then \
+                                       K5CRYPTO='-lk5crypto'; \
+       fi; fi; fi; fi; \
        COM_ERR=''; \
        if ls /lib/libcom_err* > /dev/null 2> /dev/null; then \
                COM_ERR='-lcom_err'; \
-       fi; \
+       else if ls /lib/$(MULTIARCH)/libcom_err* > /dev/null 2> /dev/null; then \
+               COM_ERR='-lcom_err'; \
+       fi; 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/$(MULTIARCH)/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)"
+       "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
 
-# As above but for Linux systems that have no <sys/select.h>.
-linuxns:
-       $(MAKE) linux KTARGET=$${KTARGET:-$(@)} KFLAGS=-DNO_SYS_SELECT_H
+# ::BEGIN_OLD_LINUX_TARGETS::
 
-# 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 = "
-
-# 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 +6426,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 +6500,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 +6917,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 +7173,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 +7605,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 +7656,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 \