Imported Upstream version 302
[ckermit.git] / makefile
index ddd0cd4..9efe262 100644 (file)
--- a/makefile
+++ b/makefile
@@ -1,8 +1,8 @@
 # makefile / Makefile / ckuker.mak / CKUKER.MAK
 #
-# Mon Jul 11 09:24:25 2011
-BUILDID=20110711
-CKVER= "9.0.301"
+# Sun Aug 21 10:33:08 2011
+BUILDID=20110821
+CKVER= "9.0.302"
 #
 # -- Makefile to build C-Kermit for UNIX and UNIX-like platforms --
 #
@@ -22,13 +22,16 @@ CKVER= "9.0.301"
 # Note: Author is no longer at Columbia University or at the 115th Street
 # address effective 1 July 2011.  The email address should still work,
 # 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
@@ -53,10 +56,10 @@ CKVER= "9.0.301"
 # 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.  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
@@ -132,6 +135,10 @@ CKVER= "9.0.301"
 # + "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.
@@ -1705,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:-$(@)} \
@@ -1734,27 +1742,61 @@ freebsd40:
 
 #FreeBSD 4.1 and above
 #Like FreeBSD 4.0 but without the NONOSETBUF hack and with CK_NEWTERM.
-#OK 2011/06/15 FreeBSD 3.3, 4,4, 4.7, and 8.2
-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.
+#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.
@@ -1763,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:-$(@)} \
@@ -1775,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 \
@@ -1792,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)" \
@@ -1802,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" ;; \
@@ -1820,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)" \
@@ -1828,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 \
@@ -1846,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 \
@@ -1907,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:-$(@)} \
@@ -3803,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" ;; \
@@ -3833,49 +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 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.
@@ -3901,7 +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: 2011/06/15
+#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 \
@@ -3929,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'
@@ -3957,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: 2020/06/15
+#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'
@@ -5342,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.
@@ -5352,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
@@ -6170,9 +6198,11 @@ linux+krb5:
        K5CRYPTO=''; \
         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'; \
         else if ls /usr/lib64/libk5crypto* > /dev/null 2> /dev/null; then \
                 K5CRYPTO='-lk5crypto'; \
-        fi; fi; \
+        fi; fi; fi; \
        COM_ERR=''; \
        if ls /lib/libcom_err* > /dev/null 2> /dev/null; then \
                COM_ERR='-lcom_err'; \
@@ -6275,9 +6305,11 @@ linux+krb5+ssl linux+krb5+openssl:
        K5CRYPTO=''; \
         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'; \
         else if ls /usr/lib64/libk5crypto* > /dev/null 2> /dev/null; then \
                 K5CRYPTO='-lk5crypto'; \
-        fi; fi; \
+       fi; fi; fi; \
        COM_ERR=''; \
        if ls /lib/libcom_err* > /dev/null 2> /dev/null; then \
                COM_ERR='-lcom_err'; \