diff -Naur openssh-3.1p1/Makefile.in openssh-3.1p1-gsi/Makefile.in
--- openssh-3.1p1/Makefile.in	Tue Feb 26 13:24:22 2002
+++ openssh-3.1p1-gsi/Makefile.in	Thu Apr  4 17:03:45 2002
@@ -50,11 +50,11 @@
 
 TARGETS=ssh$(EXEEXT) sshd$(EXEEXT) ssh-add$(EXEEXT) ssh-keygen$(EXEEXT) ssh-keyscan${EXEEXT} ssh-agent$(EXEEXT) scp$(EXEEXT) ssh-rand-helper${EXEEXT} $(SFTP_PROGS)
 
-LIBSSH_OBJS=atomicio.o authfd.o authfile.o bufaux.o buffer.o canohost.o channels.o cipher.o compat.o compress.o crc32.o deattack.o dh.o dispatch.o fatal.o mac.o hostfile.o key.o kex.o kexdh.o kexgex.o log.o match.o misc.o mpaux.o nchan.o packet.o radix.o rijndael.o entropy.o readpass.o rsa.o scard.o ssh-dss.o ssh-rsa.o tildexpand.o ttymodes.o uidswap.o uuencode.o xmalloc.o 
+LIBSSH_OBJS=atomicio.o authfd.o authfile.o bufaux.o buffer.o canohost.o channels.o cipher.o compat.o compress.o crc32.o deattack.o dh.o dispatch.o fatal.o mac.o hostfile.o key.o kex.o kexdh.o kexgex.o log.o match.o misc.o mpaux.o nchan.o packet.o radix.o rijndael.o entropy.o readpass.o rsa.o scard.o ssh-dss.o ssh-rsa.o tildexpand.o ttymodes.o uidswap.o uuencode.o xmalloc.o kexgss.o gss-genr.o
 
 SSHOBJS= ssh.o sshconnect.o sshconnect1.o sshconnect2.o sshtty.o readconf.o clientloop.o
 
-SSHDOBJS= sshd.o auth.o auth1.o auth2.o auth-chall.o auth2-chall.o auth-rhosts.o auth-options.o auth-krb4.o auth-pam.o auth2-pam.o auth-passwd.o auth-rsa.o auth-rh-rsa.o auth-sia.o sshpty.o sshlogin.o loginrec.o servconf.o serverloop.o md5crypt.o session.o groupaccess.o auth-skey.o auth-bsdauth.o
+SSHDOBJS= sshd.o auth.o auth1.o auth2.o auth-chall.o auth2-chall.o auth-rhosts.o auth-options.o auth-krb4.o auth-krb5.o auth-pam.o auth2-pam.o auth-passwd.o auth-rsa.o auth-rh-rsa.o auth-sia.o sshpty.o sshlogin.o loginrec.o servconf.o serverloop.o md5crypt.o session.o groupaccess.o auth-skey.o auth-bsdauth.o gss-serv.o
 
 MANPAGES	= scp.1.out ssh-add.1.out ssh-agent.1.out ssh-keygen.1.out ssh-keyscan.1.out ssh.1.out sshd.8.out sftp-server.8.out sftp.1.out
 MANPAGES_IN	= scp.1 ssh-add.1 ssh-agent.1 ssh-keygen.1 ssh-keyscan.1 ssh.1 sshd.8 sftp-server.8 sftp.1
diff -Naur openssh-3.1p1/acconfig.h openssh-3.1p1-gsi/acconfig.h
--- openssh-3.1p1/acconfig.h	Tue Feb 26 10:40:49 2002
+++ openssh-3.1p1-gsi/acconfig.h	Thu Apr  4 17:03:45 2002
@@ -178,11 +178,23 @@
 /* Define if libc defines __progname */
 #undef HAVE___PROGNAME
 
+/* Define this is you want GSSAPI support in the version 2 protocol */
+#undef GSSAPI
+
+/* Define if you want Kerberos 5 support */
+#undef KRB5
+
+/* Define this if you are using Heimdal version of Kerberos V5 */
+#undef HEIMDAL
+
 /* Define if you want Kerberos 4 support */
 #undef KRB4
 
 /* Define if you want AFS support */
 #undef AFS
+
+/* Define if you want GSI/Globus authentication support */
+#undef GSI
 
 /* Define if you want S/Key support */
 #undef SKEY
diff -Naur openssh-3.1p1/auth-krb5.c openssh-3.1p1-gsi/auth-krb5.c
--- openssh-3.1p1/auth-krb5.c	Mon Mar  4 19:53:04 2002
+++ openssh-3.1p1-gsi/auth-krb5.c	Thu Apr  4 17:03:45 2002
@@ -18,6 +18,9 @@
 
 #ifdef KRB5
 #include <krb5.h>
+#ifndef HEIMDAL
+#define krb5_get_err_text(context,code) error_message(code)
+#endif /* !HEIMDAL */
 
 extern ServerOptions	 options;
 
@@ -70,8 +73,15 @@
 		goto err;
 
 	fd = packet_get_connection_in();
+#ifdef HEIMDAL
 	problem = krb5_auth_con_setaddrs_from_fd(authctxt->krb5_ctx,
 	    authctxt->krb5_auth_ctx, &fd);
+#else
+	problem = krb5_auth_con_genaddrs(authctxt->krb5_ctx, 
+	    authctxt->krb5_auth_ctx,fd,
+	    KRB5_AUTH_CONTEXT_GENERATE_REMOTE_FULL_ADDR |
+	    KRB5_AUTH_CONTEXT_GENERATE_LOCAL_FULL_ADDR);
+#endif
 	if (problem)
 		goto err;
 
@@ -85,8 +95,14 @@
 	if (problem)
 		goto err;
 
+#ifdef HEIMDAL
 	problem = krb5_copy_principal(authctxt->krb5_ctx, ticket->client,
 	    &authctxt->krb5_user);
+#else
+	problem = krb5_copy_principal(authctxt->krb5_ctx, 
+				      ticket->enc_part2->client,
+				      &authctxt->krb5_user);
+#endif
 	if (problem)
 		goto err;
 
@@ -137,13 +153,37 @@
 	krb5_error_code problem;
 	krb5_ccache ccache = NULL;
 	char *pname;
+	krb5_creds **creds;
 
 	if (authctxt->pw == NULL || authctxt->krb5_user == NULL)
 		return (0);
 
 	temporarily_use_uid(authctxt->pw);
 
+#ifdef HEIMDAL
 	problem = krb5_cc_gen_new(authctxt->krb5_ctx, &krb5_fcc_ops, &ccache);
+#else
+{
+	char ccname[40];
+	int tmpfd;
+	
+	snprintf(ccname,sizeof(ccname),"FILE:/tmp/krb5cc_%d_XXXXXX",geteuid());
+	
+	if ((tmpfd = mkstemp(ccname+strlen("FILE:")))==-1) {
+		log("mkstemp(): %.100s", strerror(errno));
+		problem = errno;
+		goto fail;
+	}
+	if (fchmod(tmpfd,S_IRUSR | S_IWUSR) == -1) {
+		log("fchmod(): %.100s", strerror(errno));
+		close(tmpfd);
+		problem = errno;
+		goto fail;
+	}
+	close(tmpfd);
+	problem = krb5_cc_resolve(authctxt->krb5_ctx, ccname, &ccache);
+}
+#endif
 	if (problem)
 		goto fail;
 
@@ -152,10 +192,20 @@
 	if (problem)
 		goto fail;
 
+#ifdef HEIMDAL
 	problem = krb5_rd_cred2(authctxt->krb5_ctx, authctxt->krb5_auth_ctx,
 	    ccache, tgt);
 	if (problem)
 		goto fail;
+#else
+	problem = krb5_rd_cred(authctxt->krb5_ctx, authctxt->krb5_auth_ctx,
+	    tgt, &creds, NULL);
+	if (problem)
+		goto fail;
+	problem = krb5_cc_store_cred(authctxt->krb5_ctx, ccache, *creds);
+	if (problem)
+		goto fail;
+#endif
 
 	authctxt->krb5_fwd_ccache = ccache;
 	ccache = NULL;
@@ -188,6 +238,12 @@
 int
 auth_krb5_password(Authctxt *authctxt, const char *password)
 {
+#ifndef HEIMDAL
+	krb5_creds creds;
+	krb5_principal server;
+	char ccname[40];
+	int tmpfd;
+#endif	
 	krb5_error_code problem;
 
 	if (authctxt->pw == NULL)
@@ -204,6 +260,7 @@
 	if (problem)
 		goto out;
 
+#ifdef HEIMDAL
 	problem = krb5_cc_gen_new(authctxt->krb5_ctx, &krb5_mcc_ops,
 	    &authctxt->krb5_fwd_ccache);
 	if (problem)
@@ -222,13 +279,69 @@
 	if (problem)
 		goto out;
 
+#else
+	problem = krb5_get_init_creds_password(authctxt->krb5_ctx, &creds,
+	    authctxt->krb5_user, (char *)password, NULL, NULL, 0, NULL, NULL);
+	if (problem)
+		goto out;
+
+	problem = krb5_sname_to_principal(authctxt->krb5_ctx, NULL, NULL,
+	    KRB5_NT_SRV_HST, &server);
+	if (problem)
+		goto out;
+
+	restore_uid();
+	problem = krb5_verify_init_creds(authctxt->krb5_ctx, &creds, server,
+	    NULL, NULL, NULL);
+	krb5_free_principal(authctxt->krb5_ctx, server);
+	temporarily_use_uid(authctxt->pw);
+	if (problem)
+		goto out;
+	
+	if (!krb5_kuserok(authctxt->krb5_ctx, authctxt->krb5_user, 
+			  authctxt->pw->pw_name)) {
+	 	problem = -1;
+		goto out;
+	} 
+
+	snprintf(ccname,sizeof(ccname),"FILE:/tmp/krb5cc_%d_XXXXXX",geteuid());
+	
+	if ((tmpfd = mkstemp(ccname+strlen("FILE:")))==-1) {
+		log("mkstemp(): %.100s", strerror(errno));
+		problem = errno;
+		goto out;
+	}
+	
+	if (fchmod(tmpfd,S_IRUSR | S_IWUSR) == -1) {
+		log("fchmod(): %.100s", strerror(errno));
+		close(tmpfd);
+		problem = errno;
+		goto out;
+	}
+	close(tmpfd);
+
+	problem = krb5_cc_resolve(authctxt->krb5_ctx, ccname, &authctxt->krb5_fwd_ccache);
+	if (problem)
+		goto out;
+
+	problem = krb5_cc_initialize(authctxt->krb5_ctx, authctxt->krb5_fwd_ccache,
+				     authctxt->krb5_user);
+	if (problem)
+		goto out;
+				
+	problem= krb5_cc_store_cred(authctxt->krb5_ctx, authctxt->krb5_fwd_ccache,
+				 &creds);
+	if (problem)
+		goto out;
+#endif		
+
 	authctxt->krb5_ticket_file = (char *)krb5_cc_get_name(authctxt->krb5_ctx, authctxt->krb5_fwd_ccache);
 
  out:
 	restore_uid();
 
 	if (problem) {
-		if (authctxt->krb5_ctx != NULL)
+		if (authctxt->krb5_ctx != NULL && problem!=-1)
 			debug("Kerberos password authentication failed: %s",
 			    krb5_get_err_text(authctxt->krb5_ctx, problem));
 		else
diff -Naur openssh-3.1p1/auth-pam.c openssh-3.1p1-gsi/auth-pam.c
--- openssh-3.1p1/auth-pam.c	Mon Feb  4 19:40:47 2002
+++ openssh-3.1p1-gsi/auth-pam.c	Thu Apr  4 17:03:45 2002
@@ -394,6 +394,26 @@
 #endif /* HAVE_PAM_GETENVLIST */
 }
 
+/* Set a PAM environment string. We need to do this so that the session
+ * modules can handle things like Kerberos/GSI credentials that appear
+ * during the ssh authentication process.
+ */
+
+int do_pam_putenv(char *name, char *value) {
+	char *compound;
+	int ret=1;
+
+#ifdef HAVE_PAM_PUTENV	
+	compound=xmalloc(strlen(name)+strlen(value)+2);
+	if (compound) {
+		sprintf(compound,"%s=%s",name,value);
+		ret=pam_putenv(__pamh,compound);
+		xfree(compound);
+	}
+#endif
+	return(ret);
+}
+
 /* Print any messages that have been generated during authentication */
 /* or account checking to stderr */
 void print_pam_messages(void)
diff -Naur openssh-3.1p1/auth-pam.h openssh-3.1p1-gsi/auth-pam.h
--- openssh-3.1p1/auth-pam.h	Tue Mar 27 00:12:24 2001
+++ openssh-3.1p1-gsi/auth-pam.h	Thu Apr  4 17:03:45 2002
@@ -17,6 +17,7 @@
 int is_pam_password_change_required(void);
 void do_pam_chauthtok(void);
 void do_pam_set_conv(struct pam_conv *);
+int do_pam_putenv(char *, char *);
 void message_cat(char **p, const char *a);
 
 #endif /* USE_PAM */
diff -Naur openssh-3.1p1/auth.h openssh-3.1p1-gsi/auth.h
--- openssh-3.1p1/auth.h	Mon Mar  4 19:53:04 2002
+++ openssh-3.1p1-gsi/auth.h	Thu Apr  4 17:03:45 2002
@@ -69,6 +69,7 @@
 	krb5_principal	 krb5_user;
 	char		*krb5_ticket_file;
 #endif
+	void *methoddata;
 };
 
 /*
diff -Naur openssh-3.1p1/auth1.c openssh-3.1p1-gsi/auth1.c
--- openssh-3.1p1/auth1.c	Thu Feb 14 03:39:50 2002
+++ openssh-3.1p1-gsi/auth1.c	Thu Apr  4 17:03:45 2002
@@ -15,6 +15,7 @@
 #include "xmalloc.h"
 #include "rsa.h"
 #include "ssh1.h"
+#include "dispatch.h"
 #include "packet.h"
 #include "buffer.h"
 #include "mpaux.h"
@@ -30,6 +31,117 @@
 /* import */
 extern ServerOptions options;
 
+#ifdef GSSAPI
+#ifdef GSI
+#include "globus_gss_assist.h"
+#endif
+
+int     userauth_gssapi(Authctxt *authctxt);
+
+void
+auth1_gss_protocol_error(int type, u_int32_t plen, void *ctxt)
+{
+  Authctxt *authctxt = ctxt;
+  /* Other side told us to abort, dont need to tell him */ 
+  /* maybe we can us some other method. */
+  if (type == SSH_MSG_AUTH_GSSAPI_ABORT) {
+      log("auth1: GSSAPI aborting");
+      dispatch_set(SSH_MSG_AUTH_GSSAPI_TOKEN, NULL);
+      authctxt->success = 1; /* get out of loop*/
+      return;
+  }
+
+  log("auth1: protocol error: type %d plen %d", type, plen);
+  packet_disconnect("Protocol error during GSSAPI authentication: "
+          "Unknown packet type %d", type);
+}
+
+/*
+ * SSH1 GSSAPI clients may send us a user name of the form:
+ *
+ *   (1) username:x:SSL Subject Name
+ *     or
+ *   (2) username:i:SSL Subject Name
+ *     or
+ *   (3) username
+ *
+ *  if case 1, then uname is an explicit name (ssh -l uname). Keep this
+ *  name always, rewrite the user parameter to be just uname. We'll pull
+ *  the GSSAPI idenity out and deal with (or skip it) later.
+ *  
+ *  if case 2, then uname is implicit (user didn't use the -l option), so
+ *  use the default gridmap mapping and replace uname with whatever
+ *  the gridmap maps to. If the gridmap mapping fails, drop down
+ *  to just uname
+ *  
+ *  if case 3, then leave it be.
+ *
+ *  This function may return the original pointer to the orginal string,
+ *  the original pointer to a modified string, or a completely new pointer.
+ */
+static char *
+ssh1_gssapi_parse_userstring(char *userstring)
+{
+  char name_type = '\0';	/* explicit 'x' or implicit 'i' */
+  char *ssl_subject_name = NULL;
+  char *delim = NULL;
+
+  debug("Looking at username '%s' for gssapi-ssleay type name", userstring);
+  if((delim = strchr(userstring, ':')) != NULL) {
+      /* Parse and split into components */
+      ssl_subject_name = strchr(delim + 1, ':');
+
+      if (ssl_subject_name) {
+	/* Successful parse, split into components */
+	*delim = '\0';
+	name_type = *(delim + 1);
+	*ssl_subject_name = '\0';
+	ssl_subject_name++;
+
+	debug("Name parsed. type = '%c'. ssl subject name is \"%s\"",
+	      name_type, ssl_subject_name);
+
+      } else {
+
+	debug("Don't understand name format. Letting it pass.");
+      }	
+  }	
+
+#ifdef GSI
+  if(ssl_subject_name) {
+    char *gridmapped_name = NULL;
+    switch (name_type) {
+    case 'x':
+      debug("explicit name given, using %s as username", userstring);
+      break;
+
+    case 'i':
+      /* gridmap check */
+      debug("implicit name given. gridmapping '%s'", ssl_subject_name);
+
+      if(globus_gss_assist_gridmap(ssl_subject_name,
+				     &gridmapped_name) == 0) {
+	userstring = gridmapped_name;
+	debug("I gridmapped and got %s", userstring);
+
+      } else {
+	debug("I gridmapped and got null, reverting to %s", userstring);
+      }
+      break;
+
+    default:
+      debug("Unknown name type '%c'. Ignoring.", name_type);
+      break;
+    }
+  } else {
+    debug("didn't find any :'s so I assume it's just a user name");
+  }
+#endif /* GSI */
+
+  return userstring;
+}
+#endif
+
 /*
  * convert ssh auth msg type into description
  */
@@ -53,6 +165,10 @@
 	case SSH_CMSG_AUTH_KERBEROS:
 		return "kerberos";
 #endif
+#if defined(GSSAPI)
+	case SSH_CMSG_AUTH_GSSAPI:
+	    	return "gssapi";
+#endif
 	}
 	snprintf(buf, sizeof buf, "bad-auth-msg-%d", type);
 	return buf;
@@ -156,6 +272,41 @@
 			break;
 #endif /* KRB4 || KRB5 */
 
+#ifdef GSSAPI
+		case SSH_CMSG_AUTH_GSSAPI:
+			if (!options.gss_authentication) {
+				verbose("GSSAPI authentication disabled.");
+				break;
+			}
+			/*
+			* GSSAPI was first added to ssh1 in ssh-1.2.27, and
+			* was added to the SecurtCRT product. In order
+			* to continue operating with these, we will add
+			* the equivelent GSSAPI support to SSH1. 
+			* Will use the gssapi routines from the ssh2 as
+			* they are almost identical. But they use dispatch
+			* so we need to setup the dispatch tables here 
+			* auth1.c for use only by the gssapi code. 
+			* Since we already have the packet, we will call
+			* userauth_gssapi then start the dispatch loop.
+			*/
+			if (!authctxt->valid) {
+			packet_disconnect("Authentication rejected for invalid user");
+			}
+			dispatch_init(&auth1_gss_protocol_error);
+			userauth_gssapi(authctxt);
+			dispatch_run(DISPATCH_BLOCK, &authctxt->success, authctxt);
+			if (authctxt->postponed) { /* failed, try other methods */
+				authctxt->success = 0;
+				authctxt->postponed = 0;
+				break;
+			}
+			do_authenticated(authctxt);
+			/* will only return if authenticated */
+			authenticated = 1;
+			break;
+#endif /* GSSAPI */
+			
 #if defined(AFS) || defined(KRB5)
 			/* XXX - punt on backward compatibility here. */
 		case SSH_CMSG_HAVE_KERBEROS_TGT:
@@ -369,6 +520,11 @@
 	/* Get the user name. */
 	user = packet_get_string(&ulen);
 	packet_check_eom();
+
+#ifdef GSSAPI
+  /* Parse GSSAPI identity from userstring */
+  user = ssh1_gssapi_parse_userstring(user);
+#endif /* GSSAPI */
 
 	if ((style = strchr(user, ':')) != NULL)
 		*style++ = '\0';
diff -Naur openssh-3.1p1/auth2.c openssh-3.1p1-gsi/auth2.c
--- openssh-3.1p1/auth2.c	Tue Feb 26 12:09:43 2002
+++ openssh-3.1p1-gsi/auth2.c	Thu Apr  4 17:03:45 2002
@@ -28,6 +28,7 @@
 #include <openssl/evp.h>
 
 #include "ssh2.h"
+#include "ssh1.h"
 #include "xmalloc.h"
 #include "rsa.h"
 #include "sshpty.h"
@@ -52,6 +53,10 @@
 #include "canohost.h"
 #include "match.h"
 
+#ifdef GSSAPI
+#include "ssh-gss.h"
+#endif
+
 /* import */
 extern ServerOptions options;
 extern u_char *session_id2;
@@ -86,10 +91,23 @@
 static int userauth_hostbased(Authctxt *);
 static int userauth_kbdint(Authctxt *);
 
+#ifdef GSSAPI
+int 	userauth_external(Authctxt *authctxt);
+int	userauth_gssapi(Authctxt *authctxt);
+#endif
+
 Authmethod authmethods[] = {
 	{"none",
 		userauth_none,
 		&one},
+#ifdef GSSAPI
+	{"external-keyx",
+		userauth_external,
+		&options.gss_authentication},
+	{"gssapi",
+		userauth_gssapi,
+		&options.gss_authentication},
+#endif
 	{"publickey",
 		userauth_pubkey,
 		&options.pubkey_authentication},
@@ -210,6 +228,12 @@
 	}
 	/* reset state */
 	auth2_challenge_stop(authctxt);
+
+#ifdef GSSAPI
+	dispatch_set(SSH2_MSG_USERAUTH_GSSAPI_TOKEN, NULL);
+	dispatch_set(SSH2_MSG_USERAUTH_GSSAPI_EXCHANGE_COMPLETE, NULL);
+#endif
+
 	authctxt->postponed = 0;
 
 	/* try to authenticate user */
@@ -246,6 +270,9 @@
 #endif /* USE_PAM */
 
 	/* Log before sending the reply */
+	if (!compat20)
+	auth_log(authctxt, authenticated, method, " ssh1");
+	else
 	auth_log(authctxt, authenticated, method, " ssh2");
 
 	if (authctxt->postponed)
@@ -255,6 +282,9 @@
 	if (authenticated == 1) {
 		/* turn off userauth */
 		dispatch_set(SSH2_MSG_USERAUTH_REQUEST, &dispatch_protocol_ignore);
+		if (!compat20)
+		packet_start(SSH_SMSG_SUCCESS);
+		else
 		packet_start(SSH2_MSG_USERAUTH_SUCCESS);
 		packet_send();
 		packet_write_wait();
@@ -270,6 +300,9 @@
 			packet_disconnect(AUTH_FAIL_MSG, authctxt->user);
 		}
 		methods = authmethods_get();
+		if (!compat20)
+		packet_disconnect("GSSAPI authentication failed");
+		else
 		packet_start(SSH2_MSG_USERAUTH_FAILURE);
 		packet_put_cstring(methods);
 		packet_put_char(0);	/* XXX partial success, unused */
diff -Naur openssh-3.1p1/cipher.c openssh-3.1p1-gsi/cipher.c
--- openssh-3.1p1/cipher.c	Mon Feb 18 22:26:43 2002
+++ openssh-3.1p1-gsi/cipher.c	Thu Apr  4 17:03:45 2002
@@ -35,7 +35,7 @@
  */
 
 #include "includes.h"
-RCSID("$OpenBSD: cipher.c,v 1.52 2002/02/18 13:05:32 markus Exp $");
+RCSID("$OpenBSD: cipher.c,v 1.54 2002/03/19 10:49:35 markus Exp $");
 
 #include "xmalloc.h"
 #include "log.h"
@@ -73,16 +73,21 @@
 
 /*--*/
 
-u_int	
+u_int
 cipher_blocksize(Cipher *c)
 {
 	return (c->block_size);
 }
-u_int	
+u_int
 cipher_keylen(Cipher *c)
 {
 	return (c->key_len);
 }
+u_int
+cipher_get_number(Cipher *c)
+{
+	return (c->number);
+}
 
 u_int
 cipher_mask_ssh1(int client)
@@ -497,4 +502,172 @@
 	rijndal_cbc.flags = EVP_CIPH_CBC_MODE | EVP_CIPH_VARIABLE_LENGTH |
 	    EVP_CIPH_ALWAYS_CALL_INIT;
 	return (&rijndal_cbc);
+}
+
+/*
+ * Exports an IV from the CipherContext required to export the key
+ * state back from the unprivileged child to the privileged parent
+ * process.
+ */
+
+int
+cipher_get_keyiv_len(CipherContext *cc)
+{
+	Cipher *c = cc->cipher;
+	int ivlen;
+
+	if (c->number == SSH_CIPHER_3DES)
+		ivlen = 24;
+	else
+		ivlen = EVP_CIPHER_CTX_iv_length(&cc->evp);
+	return (ivlen);
+}
+
+void
+cipher_get_keyiv(CipherContext *cc, u_char *iv, u_int len)
+{
+	Cipher *c = cc->cipher;
+	u_char *civ = NULL;
+	int evplen;
+
+	switch (c->number) {
+	case SSH_CIPHER_SSH2:
+	case SSH_CIPHER_DES:
+	case SSH_CIPHER_BLOWFISH:
+		evplen = EVP_CIPHER_CTX_iv_length(&cc->evp);
+		if (evplen == 0)
+			return;
+		if (evplen != len)
+			fatal("%s: wrong iv length %d != %d", __FUNCTION__,
+			    evplen, len);
+
+		if (strncmp(c->name, "aes", 3) == 0) {
+			struct ssh_rijndael_ctx *aesc;
+
+			aesc = EVP_CIPHER_CTX_get_app_data(&cc->evp);
+			if (aesc == NULL)
+				fatal("%s: no rijndael context", __FUNCTION__);
+			civ = aesc->r_iv;
+		} else {
+			civ = cc->evp.iv;
+		}
+		break;
+	case SSH_CIPHER_3DES: {
+		struct ssh1_3des_ctx *desc;
+		if (len != 24)
+			fatal("%s: bad 3des iv length: %d", __FUNCTION__, len);
+		desc = EVP_CIPHER_CTX_get_app_data(&cc->evp);
+		if (desc == NULL)
+			fatal("%s: no 3des context", __FUNCTION__);
+		debug3("%s: Copying 3DES IV", __FUNCTION__);
+		memcpy(iv, desc->k1.iv, 8);
+		memcpy(iv + 8, desc->k2.iv, 8);
+		memcpy(iv + 16, desc->k3.iv, 8);
+		return;
+	}
+	default:
+		fatal("%s: bad cipher %d", __FUNCTION__, c->number);
+	}
+	memcpy(iv, civ, len);
+}
+
+void
+cipher_set_keyiv(CipherContext *cc, u_char *iv)
+{
+	Cipher *c = cc->cipher;
+	u_char *div = NULL;
+	int evplen = 0;
+
+	switch (c->number) {
+	case SSH_CIPHER_SSH2:
+	case SSH_CIPHER_DES:
+	case SSH_CIPHER_BLOWFISH:
+		evplen = EVP_CIPHER_CTX_iv_length(&cc->evp);
+		if (evplen == 0)
+			return;
+
+		if (strncmp(c->name, "aes", 3) == 0) {
+			struct ssh_rijndael_ctx *aesc;
+
+			aesc = EVP_CIPHER_CTX_get_app_data(&cc->evp);
+			if (aesc == NULL)
+				fatal("%s: no rijndael context", __FUNCTION__);
+			div = aesc->r_iv;
+		}else {
+			div = cc->evp.iv;
+		}
+		break;
+	case SSH_CIPHER_3DES: {
+		struct ssh1_3des_ctx *desc;
+		desc = EVP_CIPHER_CTX_get_app_data(&cc->evp);
+		if (desc == NULL)
+			fatal("%s: no 3des context", __FUNCTION__);
+		debug3("%s: Installed 3DES IV", __FUNCTION__);
+		memcpy(desc->k1.iv, iv, 8);
+		memcpy(desc->k2.iv, iv + 8, 8);
+		memcpy(desc->k3.iv, iv + 16, 8);
+		return;
+	}
+	default:
+		fatal("%s: bad cipher %d", __FUNCTION__, c->number);
+	}
+	memcpy(div, iv, evplen);
+}
+
+#if OPENSSL_VERSION_NUMBER < 0x00907000L
+#define EVP_X_STATE(evp)	&(evp).c
+#define EVP_X_STATE_LEN(evp)	sizeof((evp).c)
+#else
+#define EVP_X_STATE(evp)	(evp).cipher_data
+#define EVP_X_STATE_LEN(evp)	(evp).cipher->ctx_size
+#endif
+
+int
+cipher_get_keycontext(CipherContext *cc, u_char *dat)
+{
+	Cipher *c = cc->cipher;
+	int plen;
+
+	if (c->number == SSH_CIPHER_3DES) {
+		struct ssh1_3des_ctx *desc;
+		desc = EVP_CIPHER_CTX_get_app_data(&cc->evp);
+		if (desc == NULL)
+			fatal("%s: no 3des context", __FUNCTION__);
+		plen = EVP_X_STATE_LEN(desc->k1);
+		if (dat == NULL)
+			return (3*plen);
+		memcpy(dat, EVP_X_STATE(desc->k1), plen);
+		memcpy(dat + plen, EVP_X_STATE(desc->k2), plen);
+		memcpy(dat + 2*plen, EVP_X_STATE(desc->k3), plen);
+		return (3*plen);
+	}
+
+	/* Generic EVP */
+	plen = EVP_X_STATE_LEN(cc->evp);
+	if (dat == NULL)
+		return (plen);
+
+	memcpy(dat, EVP_X_STATE(cc->evp), plen);
+	return (plen);
+}
+
+void
+cipher_set_keycontext(CipherContext *cc, u_char *dat)
+{
+	Cipher *c = cc->cipher;
+	int plen;
+
+	if (c->number == SSH_CIPHER_3DES) {
+		struct ssh1_3des_ctx *desc;
+		desc = EVP_CIPHER_CTX_get_app_data(&cc->evp);
+		if (desc == NULL)
+			fatal("%s: no 3des context", __FUNCTION__);
+		plen = EVP_X_STATE_LEN(desc->k1);
+		memcpy(EVP_X_STATE(desc->k1), dat, plen);
+		memcpy(EVP_X_STATE(desc->k2), dat + plen, plen);
+		memcpy(EVP_X_STATE(desc->k3), dat + 2*plen, plen);
+	} else {
+		plen = EVP_X_STATE_LEN(cc->evp);
+		memcpy(EVP_X_STATE(cc->evp), dat, plen);
+	}
 }
diff -Naur openssh-3.1p1/compat.c openssh-3.1p1-gsi/compat.c
--- openssh-3.1p1/compat.c	Wed Mar  6 19:59:04 2002
+++ openssh-3.1p1-gsi/compat.c	Thu Apr  4 17:03:45 2002
@@ -69,11 +69,12 @@
 		{ "OpenSSH_2.5.0p1*,"
 		  "OpenSSH_2.5.1p1*",
 					SSH_BUG_BIGENDIANAES|SSH_OLD_DHGEX|
-					SSH_BUG_NOREKEY },
+					SSH_BUG_NOREKEY|SSH_OLD_GSSAPI },
 		{ "OpenSSH_2.5.0*,"
 		  "OpenSSH_2.5.1*,"
 		  "OpenSSH_2.5.2*",	SSH_OLD_DHGEX|SSH_BUG_NOREKEY },
 		{ "OpenSSH_2.5.3*",	SSH_BUG_NOREKEY },
+		{ "OpenSSH_2.9p*",	SSH_OLD_GSSAPI },
 		{ "Sun_SSH_1.0*",	SSH_BUG_NOREKEY },
 		{ "OpenSSH*",		0 },
 		{ "*MindTerm*",		0 },
diff -Naur openssh-3.1p1/compat.h openssh-3.1p1-gsi/compat.h
--- openssh-3.1p1/compat.h	Mon Mar  4 19:53:04 2002
+++ openssh-3.1p1-gsi/compat.h	Thu Apr  4 17:03:45 2002
@@ -52,6 +52,7 @@
 #define SSH_BUG_OPENFAILURE	0x00020000
 #define SSH_BUG_DERIVEKEY	0x00040000
 #define SSH_BUG_DUMMYCHAN	0x00100000
+#define SSH_OLD_GSSAPI		0x00200000
 
 void     enable_compat13(void);
 void     enable_compat20(void);
diff -Naur openssh-3.1p1/config.h.in openssh-3.1p1-gsi/config.h.in
--- openssh-3.1p1/config.h.in	Wed Mar  6 20:22:30 2002
+++ openssh-3.1p1-gsi/config.h.in	Thu Apr  4 17:03:56 2002
@@ -1,4 +1,4 @@
-/* config.h.in.  Generated from configure.ac by autoheader.  */
+/* config.h.in.  Generated automatically from configure.ac by autoheader.  */
 /* $Id: acconfig.h,v 1.122 2002/02/26 16:40:49 tim Exp $ */
 
 #ifndef _CONFIG_H
@@ -8,6 +8,7 @@
 /* Please make your changes there */
 
 
+
 /* Define to a Set Process Title type if your system is */
 /* supported by bsd-setproctitle.c */
 #undef SPT_TYPE
@@ -178,12 +179,24 @@
 /* Define if libc defines __progname */
 #undef HAVE___PROGNAME
 
+/* Define this is you want GSSAPI support in the version 2 protocol */
+#undef GSSAPI
+
+/* Define if you want Kerberos 5 support */
+#undef KRB5
+
+/* Define this if you are using Heimdal version of Kerberos V5 */
+#undef HEIMDAL
+
 /* Define if you want Kerberos 4 support */
 #undef KRB4
 
 /* Define if you want AFS support */
 #undef AFS
 
+/* Define if you want GSI/Globus authentication support */
+#undef GSI
+
 /* Define if you want S/Key support */
 #undef SKEY
 
@@ -441,6 +454,9 @@
 /* Define if you have the <glob.h> header file. */
 #undef HAVE_GLOB_H
 
+/* Define if you have the <gssapi.h> header file. */
+#undef HAVE_GSSAPI_H
+
 /* Define if you have the `inet_aton' function. */
 #undef HAVE_INET_ATON
 
@@ -551,6 +567,9 @@
 
 /* Define if you have the `pam_getenvlist' function. */
 #undef HAVE_PAM_GETENVLIST
+
+/* Define if you have the `pam_putenv' function. */
+#undef HAVE_PAM_PUTENV
 
 /* Define if you have the <paths.h> header file. */
 #undef HAVE_PATHS_H
diff -Naur openssh-3.1p1/configure openssh-3.1p1-gsi/configure
--- openssh-3.1p1/configure	Wed Mar  6 20:22:29 2002
+++ openssh-3.1p1-gsi/configure	Thu Apr  4 17:04:05 2002
@@ -1,6 +1,6 @@
 #! /bin/sh
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by Autoconf 2.52d.
+# Generated by Autoconf 2.52.
 #
 # Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
 # Free Software Foundation, Inc.
@@ -20,10 +20,6 @@
 # Sed expression to map a string onto a valid CPP name.
 as_tr_cpp="sed y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g"
 
-## --------------------- ##
-## M4sh Initialization.  ##
-## --------------------- ##
-
 # Be Bourne compatible
 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
   emulate sh
@@ -557,10 +553,10 @@
 fi
 if test ! -r $srcdir/$ac_unique_file; then
   if test "$ac_srcdir_defaulted" = yes; then
-    { echo "$as_me: error: cannot find sources ($ac_unique_file) in $ac_confdir or .." >&2
+    { echo "$as_me: error: cannot find sources in $ac_confdir or .." >&2
    { (exit 1); exit 1; }; }
   else
-    { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2
+    { echo "$as_me: error: cannot find sources in $srcdir" >&2
    { (exit 1); exit 1; }; }
   fi
 fi
@@ -604,7 +600,7 @@
 if test "$ac_init_help" = "long"; then
   # Omit some internal or obsolete options to make the list less imposing.
   # This message is too long to be a string in the A/UX 3.1 sh.
-  cat <<_ACEOF
+  cat <<EOF
 \`configure' configures this package to adapt to many kinds of systems.
 
 Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -625,9 +621,9 @@
   -n, --no-create         do not create output files
       --srcdir=DIR        find the sources in DIR [configure dir or \`..']
 
-_ACEOF
+EOF
 
-  cat <<_ACEOF
+  cat <<EOF
 Installation directories:
   --prefix=PREFIX         install architecture-independent files in PREFIX
                           [$ac_default_prefix]
@@ -654,19 +650,19 @@
   --oldincludedir=DIR    C header files for non-gcc [/usr/include]
   --infodir=DIR          info documentation [PREFIX/info]
   --mandir=DIR           man documentation [PREFIX/man]
-_ACEOF
+EOF
 
-  cat <<\_ACEOF
+  cat <<\EOF
 
 System types:
   --build=BUILD     configure for building on BUILD [guessed]
   --host=HOST       build programs to run on HOST [BUILD]
-_ACEOF
+EOF
 fi
 
 if test -n "$ac_init_help"; then
 
-  cat <<\_ACEOF
+  cat <<\EOF
 
 Optional Features:
   --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
@@ -693,6 +689,9 @@
   --with-libs             Specify additional libraries to link with
   --without-rpath         Disable auto-added -R linker paths
   --with-zlib=PATH        Use zlib in PATH
+  --with-gsi=PATH         Enable GSI/Globus authentication support
+  --with-globus=PATH      Enable GSI/Globus authentication support
+  --with-globus-flavor=TYPE         Describe Globus flavor type (ex: gcc32dbg, etc.)
   --with-skey[=PATH]      Enable S/Key support
                             (optionally in PATH)
   --with-tcp-wrappers[=PATH]      Enable tcpwrappers support
@@ -704,6 +703,7 @@
   --with-prngd-socket=FILE read entropy from PRNGD/EGD socket FILE (default=/var/run/egd-pool)
   --with-entropy-timeout  Specify entropy gathering command timeout (msec)
   --with-smartcard        Enable smartcard support
+  --with-kerberos5=PATH   Enable Kerberos 5 support
   --with-kerberos4=PATH   Enable Kerberos 4 support
   --with-afs=PATH         Enable AFS support
   --with-rsh=PATH         Specify path to remote shell program
@@ -731,51 +731,40 @@
 Use these variables to override the choices made by `configure' or to help
 it to find libraries and programs with nonstandard names/locations.
 
-_ACEOF
+EOF
 fi
 
 if test "$ac_init_help" = "recursive"; then
   # If there are subdirs, report their specific --help.
   ac_popdir=`pwd`
-  for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue
-    cd $ac_dir
-    if test "$ac_dir" != .; then
-  ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\./,,'`
-  # A "../" for each directory in $ac_dir_suffix.
-  ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^/]*,../,g'`
-else
-  ac_dir_suffix= ac_top_builddir=
-fi
-
-case $srcdir in
-  .)  # No --srcdir option.  We are building in place.
-    ac_srcdir=.
-    if test -z "$ac_top_builddir"; then
-       ac_top_srcdir=.
-    else
-       ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'`
-    fi ;;
-  [\\/]* | ?:[\\/]* )  # Absolute path.
-    ac_srcdir=$srcdir$ac_dir_suffix;
-    ac_top_srcdir=$srcdir ;;
-  *) # Relative path.
-    ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix
-    ac_top_srcdir=$ac_top_builddir$srcdir ;;
-esac
+  for ac_subdir in : $ac_subdirs_all; do test "x$ac_subdir" = x: && continue
+    cd $ac_subdir
+    # A "../" for each directory in /$ac_subdir.
+    ac_dots=`echo $ac_subdir |
+             sed 's,^\./,,;s,[^/]$,&/,;s,[^/]*/,../,g'`
+
+    case $srcdir in
+    .) # No --srcdir option.  We are building in place.
+      ac_sub_srcdir=$srcdir ;;
+    [\\/]* | ?:[\\/]* ) # Absolute path.
+      ac_sub_srcdir=$srcdir/$ac_subdir ;;
+    *) # Relative path.
+      ac_sub_srcdir=$ac_dots$srcdir/$ac_subdir ;;
+    esac
 
     # Check for guested configure; otherwise get Cygnus style configure.
-    if test -f $ac_srcdir/configure.gnu; then
+    if test -f $ac_sub_srcdir/configure.gnu; then
       echo
-      $SHELL $ac_srcdir/configure.gnu  --help=recursive
-    elif test -f $ac_srcdir/configure; then
+      $SHELL $ac_sub_srcdir/configure.gnu  --help=recursive
+    elif test -f $ac_sub_srcdir/configure; then
       echo
-      $SHELL $ac_srcdir/configure  --help=recursive
-    elif test -f $ac_srcdir/configure.ac ||
-           test -f $ac_srcdir/configure.in; then
+      $SHELL $ac_sub_srcdir/configure  --help=recursive
+    elif test -f $ac_sub_srcdir/configure.ac ||
+           test -f $ac_sub_srcdir/configure.in; then
       echo
       $ac_configure --help
     else
-      echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
+      echo "$as_me: WARNING: no configuration information is in $ac_subdir" >&2
     fi
     cd $ac_popdir
   done
@@ -783,31 +772,31 @@
 
 test -n "$ac_init_help" && exit 0
 if $ac_init_version; then
-  cat <<\_ACEOF
+  cat <<\EOF
 
 Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
 Free Software Foundation, Inc.
 This configure script is free software; the Free Software Foundation
 gives unlimited permission to copy, distribute and modify it.
-_ACEOF
+EOF
   exit 0
 fi
 exec 5>config.log
-cat >&5 <<_ACEOF
+cat >&5 <<EOF
 This file contains any messages produced by compilers while
 running configure, to aid debugging if configure makes a mistake.
 
 It was created by $as_me, which was
-generated by GNU Autoconf 2.52d.  Invocation command line was
+generated by GNU Autoconf 2.52.  Invocation command line was
 
   $ $0 $@
 
-_ACEOF
+EOF
 {
 cat <<_ASUNAME
-## --------- ##
-## Platform. ##
-## --------- ##
+## ---------- ##
+## Platform.  ##
+## ---------- ##
 
 hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
 uname -m = `(uname -m) 2>/dev/null || echo unknown`
@@ -831,12 +820,12 @@
 _ASUNAME
 } >&5
 
-cat >&5 <<_ACEOF
-## ----------- ##
-## Core tests. ##
-## ----------- ##
+cat >&5 <<EOF
+## ------------ ##
+## Core tests.  ##
+## ------------ ##
 
-_ACEOF
+EOF
 
 # Keep a trace of the command line.
 # Strip out --no-create and --no-recursion so they do not pile up.
@@ -863,19 +852,14 @@
 # When interrupted or exit'd, cleanup temporary files, and complete
 # config.log.  We remove comments because anyway the quotes in there
 # would cause problems or look ugly.
-# WARNING: Be sure not to use single quotes in there, as some shells,
-# such as our DU 5.0 friend, will then `close' the trap.
 trap 'exit_status=$?
   # Save into config.log some information that might help in debugging.
-  {
-    echo
-    cat <<\_ASBOX
-## ---------------- ##
-## Cache variables. ##
-## ---------------- ##
-_ASBOX
-    echo
-    # The following way of writing the cache mishandles newlines in values,
+  echo >&5
+  echo "## ----------------- ##" >&5
+  echo "## Cache variables.  ##" >&5
+  echo "## ----------------- ##" >&5
+  echo >&5
+  # The following way of writing the cache mishandles newlines in values,
 {
   (set) 2>&1 |
     case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in
@@ -889,22 +873,20 @@
         "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
       ;;
     esac;
-}
-    echo
-    if test -s confdefs.h; then
-      cat <<\_ASBOX
-## ----------- ##
-## confdefs.h. ##
-## ----------- ##
-_ASBOX
-      echo
-      sed "/^$/d" confdefs.h
-      echo
-    fi
-    test "$ac_signal" != 0 &&
-      echo "$as_me: caught signal $ac_signal"
-    echo "$as_me: exit $exit_status"
-  } >&5
+} >&5
+  sed "/^$/d" confdefs.h >conftest.log
+  if test -s conftest.log; then
+    echo >&5
+    echo "## ------------ ##" >&5
+    echo "## confdefs.h.  ##" >&5
+    echo "## ------------ ##" >&5
+    echo >&5
+    cat conftest.log >&5
+  fi
+  (echo; echo) >&5
+  test "$ac_signal" != 0 &&
+    echo "$as_me: caught signal $ac_signal" >&5
+  echo "$as_me: exit $exit_status" >&5
   rm -rf conftest* confdefs* core core.* *.core conf$$* $ac_clean_files &&
     exit $exit_status
      ' 0
@@ -929,9 +911,9 @@
 fi
 for ac_site_file in $CONFIG_SITE; do
   if test -r "$ac_site_file"; then
-    { echo "$as_me:932: loading site script $ac_site_file" >&5
+    { echo "$as_me:914: loading site script $ac_site_file" >&5
 echo "$as_me: loading site script $ac_site_file" >&6;}
-    sed 's/^/| /' "$ac_site_file" >&5
+    cat "$ac_site_file" >&5
     . "$ac_site_file"
   fi
 done
@@ -940,7 +922,7 @@
   # Some versions of bash will fail to source /dev/null (special
   # files actually), so we avoid doing that.
   if test -f "$cache_file"; then
-    { echo "$as_me:943: loading cache $cache_file" >&5
+    { echo "$as_me:925: loading cache $cache_file" >&5
 echo "$as_me: loading cache $cache_file" >&6;}
     case $cache_file in
       [\\/]* | ?:[\\/]* ) . $cache_file;;
@@ -948,7 +930,7 @@
     esac
   fi
 else
-  { echo "$as_me:951: creating cache $cache_file" >&5
+  { echo "$as_me:933: creating cache $cache_file" >&5
 echo "$as_me: creating cache $cache_file" >&6;}
   >$cache_file
 fi
@@ -964,21 +946,21 @@
   eval ac_new_val="\$ac_env_${ac_var}_value"
   case $ac_old_set,$ac_new_set in
     set,)
-      { echo "$as_me:967: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
+      { echo "$as_me:949: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
 echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
       ac_cache_corrupted=: ;;
     ,set)
-      { echo "$as_me:971: error: \`$ac_var' was not set in the previous run" >&5
+      { echo "$as_me:953: error: \`$ac_var' was not set in the previous run" >&5
 echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
       ac_cache_corrupted=: ;;
     ,);;
     *)
       if test "x$ac_old_val" != "x$ac_new_val"; then
-        { echo "$as_me:977: error: \`$ac_var' has changed since the previous run:" >&5
+        { echo "$as_me:959: error: \`$ac_var' has changed since the previous run:" >&5
 echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
-        { echo "$as_me:979:   former value:  $ac_old_val" >&5
+        { echo "$as_me:961:   former value:  $ac_old_val" >&5
 echo "$as_me:   former value:  $ac_old_val" >&2;}
-        { echo "$as_me:981:   current value: $ac_new_val" >&5
+        { echo "$as_me:963:   current value: $ac_new_val" >&5
 echo "$as_me:   current value: $ac_new_val" >&2;}
         ac_cache_corrupted=:
       fi;;
@@ -997,9 +979,9 @@
   fi
 done
 if $ac_cache_corrupted; then
-  { echo "$as_me:1000: error: changes in the environment can compromise the build" >&5
+  { echo "$as_me:982: error: changes in the environment can compromise the build" >&5
 echo "$as_me: error: changes in the environment can compromise the build" >&2;}
-  { { echo "$as_me:1002: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5
+  { { echo "$as_me:984: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5
 echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;}
    { (exit 1); exit 1; }; }
 fi
@@ -1019,10 +1001,10 @@
 echo "#! $SHELL" >conftest.sh
 echo  "exit 0"   >>conftest.sh
 chmod +x conftest.sh
-if { (echo "$as_me:1022: PATH=\".;.\"; conftest.sh") >&5
+if { (echo "$as_me:1004: PATH=\".;.\"; conftest.sh") >&5
   (PATH=".;."; conftest.sh) 2>&5
   ac_status=$?
-  echo "$as_me:1025: \$? = $ac_status" >&5
+  echo "$as_me:1007: \$? = $ac_status" >&5
   (exit $ac_status); }; then
   ac_path_separator=';'
 else
@@ -1041,7 +1023,7 @@
 if test -n "$ac_tool_prefix"; then
   # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
 set dummy ${ac_tool_prefix}gcc; ac_word=$2
-echo "$as_me:1044: checking for $ac_word" >&5
+echo "$as_me:1026: checking for $ac_word" >&5
 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
 if test "${ac_cv_prog_CC+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -1056,7 +1038,7 @@
   test -z "$ac_dir" && ac_dir=.
   $as_executable_p "$ac_dir/$ac_word" || continue
 ac_cv_prog_CC="${ac_tool_prefix}gcc"
-echo "$as_me:1059: found $ac_dir/$ac_word" >&5
+echo "$as_me:1041: found $ac_dir/$ac_word" >&5
 break
 done
 
@@ -1064,10 +1046,10 @@
 fi
 CC=$ac_cv_prog_CC
 if test -n "$CC"; then
-  echo "$as_me:1067: result: $CC" >&5
+  echo "$as_me:1049: result: $CC" >&5
 echo "${ECHO_T}$CC" >&6
 else
-  echo "$as_me:1070: result: no" >&5
+  echo "$as_me:1052: result: no" >&5
 echo "${ECHO_T}no" >&6
 fi
 
@@ -1076,7 +1058,7 @@
   ac_ct_CC=$CC
   # Extract the first word of "gcc", so it can be a program name with args.
 set dummy gcc; ac_word=$2
-echo "$as_me:1079: checking for $ac_word" >&5
+echo "$as_me:1061: checking for $ac_word" >&5
 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -1091,7 +1073,7 @@
   test -z "$ac_dir" && ac_dir=.
   $as_executable_p "$ac_dir/$ac_word" || continue
 ac_cv_prog_ac_ct_CC="gcc"
-echo "$as_me:1094: found $ac_dir/$ac_word" >&5
+echo "$as_me:1076: found $ac_dir/$ac_word" >&5
 break
 done
 
@@ -1099,10 +1081,10 @@
 fi
 ac_ct_CC=$ac_cv_prog_ac_ct_CC
 if test -n "$ac_ct_CC"; then
-  echo "$as_me:1102: result: $ac_ct_CC" >&5
+  echo "$as_me:1084: result: $ac_ct_CC" >&5
 echo "${ECHO_T}$ac_ct_CC" >&6
 else
-  echo "$as_me:1105: result: no" >&5
+  echo "$as_me:1087: result: no" >&5
 echo "${ECHO_T}no" >&6
 fi
 
@@ -1115,7 +1097,7 @@
   if test -n "$ac_tool_prefix"; then
   # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
 set dummy ${ac_tool_prefix}cc; ac_word=$2
-echo "$as_me:1118: checking for $ac_word" >&5
+echo "$as_me:1100: checking for $ac_word" >&5
 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
 if test "${ac_cv_prog_CC+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -1130,7 +1112,7 @@
   test -z "$ac_dir" && ac_dir=.
   $as_executable_p "$ac_dir/$ac_word" || continue
 ac_cv_prog_CC="${ac_tool_prefix}cc"
-echo "$as_me:1133: found $ac_dir/$ac_word" >&5
+echo "$as_me:1115: found $ac_dir/$ac_word" >&5
 break
 done
 
@@ -1138,10 +1120,10 @@
 fi
 CC=$ac_cv_prog_CC
 if test -n "$CC"; then
-  echo "$as_me:1141: result: $CC" >&5
+  echo "$as_me:1123: result: $CC" >&5
 echo "${ECHO_T}$CC" >&6
 else
-  echo "$as_me:1144: result: no" >&5
+  echo "$as_me:1126: result: no" >&5
 echo "${ECHO_T}no" >&6
 fi
 
@@ -1150,7 +1132,7 @@
   ac_ct_CC=$CC
   # Extract the first word of "cc", so it can be a program name with args.
 set dummy cc; ac_word=$2
-echo "$as_me:1153: checking for $ac_word" >&5
+echo "$as_me:1135: checking for $ac_word" >&5
 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -1165,7 +1147,7 @@
   test -z "$ac_dir" && ac_dir=.
   $as_executable_p "$ac_dir/$ac_word" || continue
 ac_cv_prog_ac_ct_CC="cc"
-echo "$as_me:1168: found $ac_dir/$ac_word" >&5
+echo "$as_me:1150: found $ac_dir/$ac_word" >&5
 break
 done
 
@@ -1173,10 +1155,10 @@
 fi
 ac_ct_CC=$ac_cv_prog_ac_ct_CC
 if test -n "$ac_ct_CC"; then
-  echo "$as_me:1176: result: $ac_ct_CC" >&5
+  echo "$as_me:1158: result: $ac_ct_CC" >&5
 echo "${ECHO_T}$ac_ct_CC" >&6
 else
-  echo "$as_me:1179: result: no" >&5
+  echo "$as_me:1161: result: no" >&5
 echo "${ECHO_T}no" >&6
 fi
 
@@ -1189,7 +1171,7 @@
 if test -z "$CC"; then
   # Extract the first word of "cc", so it can be a program name with args.
 set dummy cc; ac_word=$2
-echo "$as_me:1192: checking for $ac_word" >&5
+echo "$as_me:1174: checking for $ac_word" >&5
 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
 if test "${ac_cv_prog_CC+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -1209,7 +1191,7 @@
   continue
 fi
 ac_cv_prog_CC="cc"
-echo "$as_me:1212: found $ac_dir/$ac_word" >&5
+echo "$as_me:1194: found $ac_dir/$ac_word" >&5
 break
 done
 
@@ -1231,10 +1213,10 @@
 fi
 CC=$ac_cv_prog_CC
 if test -n "$CC"; then
-  echo "$as_me:1234: result: $CC" >&5
+  echo "$as_me:1216: result: $CC" >&5
 echo "${ECHO_T}$CC" >&6
 else
-  echo "$as_me:1237: result: no" >&5
+  echo "$as_me:1219: result: no" >&5
 echo "${ECHO_T}no" >&6
 fi
 
@@ -1245,7 +1227,7 @@
   do
     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
-echo "$as_me:1248: checking for $ac_word" >&5
+echo "$as_me:1230: checking for $ac_word" >&5
 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
 if test "${ac_cv_prog_CC+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -1260,7 +1242,7 @@
   test -z "$ac_dir" && ac_dir=.
   $as_executable_p "$ac_dir/$ac_word" || continue
 ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
-echo "$as_me:1263: found $ac_dir/$ac_word" >&5
+echo "$as_me:1245: found $ac_dir/$ac_word" >&5
 break
 done
 
@@ -1268,10 +1250,10 @@
 fi
 CC=$ac_cv_prog_CC
 if test -n "$CC"; then
-  echo "$as_me:1271: result: $CC" >&5
+  echo "$as_me:1253: result: $CC" >&5
 echo "${ECHO_T}$CC" >&6
 else
-  echo "$as_me:1274: result: no" >&5
+  echo "$as_me:1256: result: no" >&5
 echo "${ECHO_T}no" >&6
 fi
 
@@ -1284,7 +1266,7 @@
 do
   # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
-echo "$as_me:1287: checking for $ac_word" >&5
+echo "$as_me:1269: checking for $ac_word" >&5
 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -1299,7 +1281,7 @@
   test -z "$ac_dir" && ac_dir=.
   $as_executable_p "$ac_dir/$ac_word" || continue
 ac_cv_prog_ac_ct_CC="$ac_prog"
-echo "$as_me:1302: found $ac_dir/$ac_word" >&5
+echo "$as_me:1284: found $ac_dir/$ac_word" >&5
 break
 done
 
@@ -1307,10 +1289,10 @@
 fi
 ac_ct_CC=$ac_cv_prog_ac_ct_CC
 if test -n "$ac_ct_CC"; then
-  echo "$as_me:1310: result: $ac_ct_CC" >&5
+  echo "$as_me:1292: result: $ac_ct_CC" >&5
 echo "${ECHO_T}$ac_ct_CC" >&6
 else
-  echo "$as_me:1313: result: no" >&5
+  echo "$as_me:1295: result: no" >&5
 echo "${ECHO_T}no" >&6
 fi
 
@@ -1322,40 +1304,34 @@
 
 fi
 
-test -z "$CC" && { { echo "$as_me:1325: error: no acceptable cc found in \$PATH" >&5
+test -z "$CC" && { { echo "$as_me:1307: error: no acceptable cc found in \$PATH" >&5
 echo "$as_me: error: no acceptable cc found in \$PATH" >&2;}
    { (exit 1); exit 1; }; }
 
 # Provide some information about the compiler.
-echo "$as_me:1330:" \
+echo "$as_me:1312:" \
      "checking for C compiler version" >&5
 ac_compiler=`set X $ac_compile; echo $2`
-{ (eval echo "$as_me:1333: \"$ac_compiler --version </dev/null >&5\"") >&5
+{ (eval echo "$as_me:1315: \"$ac_compiler --version </dev/null >&5\"") >&5
   (eval $ac_compiler --version </dev/null >&5) 2>&5
   ac_status=$?
-  echo "$as_me:1336: \$? = $ac_status" >&5
+  echo "$as_me:1318: \$? = $ac_status" >&5
   (exit $ac_status); }
-{ (eval echo "$as_me:1338: \"$ac_compiler -v </dev/null >&5\"") >&5
+{ (eval echo "$as_me:1320: \"$ac_compiler -v </dev/null >&5\"") >&5
   (eval $ac_compiler -v </dev/null >&5) 2>&5
   ac_status=$?
-  echo "$as_me:1341: \$? = $ac_status" >&5
+  echo "$as_me:1323: \$? = $ac_status" >&5
   (exit $ac_status); }
-{ (eval echo "$as_me:1343: \"$ac_compiler -V </dev/null >&5\"") >&5
+{ (eval echo "$as_me:1325: \"$ac_compiler -V </dev/null >&5\"") >&5
   (eval $ac_compiler -V </dev/null >&5) 2>&5
   ac_status=$?
-  echo "$as_me:1346: \$? = $ac_status" >&5
+  echo "$as_me:1328: \$? = $ac_status" >&5
   (exit $ac_status); }
 
 cat >conftest.$ac_ext <<_ACEOF
-#line 1350 "configure"
+#line 1332 "configure"
 #include "confdefs.h"
 
-#ifdef F77_DUMMY_MAIN
-#  ifdef __cplusplus
-     extern "C"
-#  endif
-   int F77_DUMMY_MAIN() { return 1; }
-#endif
 int
 main ()
 {
@@ -1369,13 +1345,13 @@
 # Try to create an executable without -o first, disregard a.out.
 # It will help us diagnose broken compilers, and finding out an intuition
 # of exeext.
-echo "$as_me:1372: checking for C compiler default output" >&5
+echo "$as_me:1348: checking for C compiler default output" >&5
 echo $ECHO_N "checking for C compiler default output... $ECHO_C" >&6
 ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
-if { (eval echo "$as_me:1375: \"$ac_link_default\"") >&5
+if { (eval echo "$as_me:1351: \"$ac_link_default\"") >&5
   (eval $ac_link_default) 2>&5
   ac_status=$?
-  echo "$as_me:1378: \$? = $ac_status" >&5
+  echo "$as_me:1354: \$? = $ac_status" >&5
   (exit $ac_status); }; then
   # Find the output, starting from the most likely.  This scheme is
 # not robust to junk in `.', hence go to wildcards (a.*) only as a last
@@ -1384,7 +1360,7 @@
                 ls a.out conftest 2>/dev/null;
                 ls a.* conftest.* 2>/dev/null`; do
   case $ac_file in
-    *.$ac_ext | *.o | *.obj | *.xcoff | *.tds | *.d | *.pdb | *.xSYM ) ;;
+    *.$ac_ext | *.o | *.obj | *.xcoff | *.tds | *.d | *.pdb ) ;;
     a.out ) # We found the default executable, but exeext='' is most
             # certainly right.
             break;;
@@ -1398,34 +1374,34 @@
 else
   echo "$as_me: failed program was:" >&5
 cat conftest.$ac_ext >&5
-{ { echo "$as_me:1401: error: C compiler cannot create executables" >&5
+{ { echo "$as_me:1377: error: C compiler cannot create executables" >&5
 echo "$as_me: error: C compiler cannot create executables" >&2;}
    { (exit 77); exit 77; }; }
 fi
 
 ac_exeext=$ac_cv_exeext
-echo "$as_me:1407: result: $ac_file" >&5
+echo "$as_me:1383: result: $ac_file" >&5
 echo "${ECHO_T}$ac_file" >&6
 
 # Check the compiler produces executables we can run.  If not, either
 # the compiler is broken, or we cross compile.
-echo "$as_me:1412: checking whether the C compiler works" >&5
+echo "$as_me:1388: checking whether the C compiler works" >&5
 echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6
 # FIXME: These cross compiler hacks should be removed for Autoconf 3.0
 # If not cross compiling, check that we can run a simple program.
 if test "$cross_compiling" != yes; then
   if { ac_try='./$ac_file'
-  { (eval echo "$as_me:1418: \"$ac_try\"") >&5
+  { (eval echo "$as_me:1394: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:1421: \$? = $ac_status" >&5
+  echo "$as_me:1397: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
     cross_compiling=no
   else
     if test "$cross_compiling" = maybe; then
 	cross_compiling=yes
     else
-	{ { echo "$as_me:1428: error: cannot run C compiled programs.
+	{ { echo "$as_me:1404: error: cannot run C compiled programs.
 If you meant to cross compile, use \`--host'." >&5
 echo "$as_me: error: cannot run C compiled programs.
 If you meant to cross compile, use \`--host'." >&2;}
@@ -1433,24 +1409,24 @@
     fi
   fi
 fi
-echo "$as_me:1436: result: yes" >&5
+echo "$as_me:1412: result: yes" >&5
 echo "${ECHO_T}yes" >&6
 
 rm -f a.out a.exe conftest$ac_cv_exeext
 ac_clean_files=$ac_clean_files_save
 # Check the compiler produces executables we can run.  If not, either
 # the compiler is broken, or we cross compile.
-echo "$as_me:1443: checking whether we are cross compiling" >&5
+echo "$as_me:1419: checking whether we are cross compiling" >&5
 echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6
-echo "$as_me:1445: result: $cross_compiling" >&5
+echo "$as_me:1421: result: $cross_compiling" >&5
 echo "${ECHO_T}$cross_compiling" >&6
 
-echo "$as_me:1448: checking for executable suffix" >&5
+echo "$as_me:1424: checking for executable suffix" >&5
 echo $ECHO_N "checking for executable suffix... $ECHO_C" >&6
-if { (eval echo "$as_me:1450: \"$ac_link\"") >&5
+if { (eval echo "$as_me:1426: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:1453: \$? = $ac_status" >&5
+  echo "$as_me:1429: \$? = $ac_status" >&5
   (exit $ac_status); }; then
   # If both `conftest.exe' and `conftest' are `present' (well, observable)
 # catch `conftest.exe'.  For instance with Cygwin, `ls conftest' will
@@ -1466,33 +1442,27 @@
   esac
 done
 else
-  { { echo "$as_me:1469: error: cannot compute EXEEXT: cannot compile and link" >&5
+  { { echo "$as_me:1445: error: cannot compute EXEEXT: cannot compile and link" >&5
 echo "$as_me: error: cannot compute EXEEXT: cannot compile and link" >&2;}
    { (exit 1); exit 1; }; }
 fi
 
 rm -f conftest$ac_cv_exeext
-echo "$as_me:1475: result: $ac_cv_exeext" >&5
+echo "$as_me:1451: result: $ac_cv_exeext" >&5
 echo "${ECHO_T}$ac_cv_exeext" >&6
 
 rm -f conftest.$ac_ext
 EXEEXT=$ac_cv_exeext
 ac_exeext=$EXEEXT
-echo "$as_me:1481: checking for object suffix" >&5
+echo "$as_me:1457: checking for object suffix" >&5
 echo $ECHO_N "checking for object suffix... $ECHO_C" >&6
 if test "${ac_cv_objext+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line 1487 "configure"
+#line 1463 "configure"
 #include "confdefs.h"
 
-#ifdef F77_DUMMY_MAIN
-#  ifdef __cplusplus
-     extern "C"
-#  endif
-   int F77_DUMMY_MAIN() { return 1; }
-#endif
 int
 main ()
 {
@@ -1502,10 +1472,10 @@
 }
 _ACEOF
 rm -f conftest.o conftest.obj
-if { (eval echo "$as_me:1505: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:1475: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:1508: \$? = $ac_status" >&5
+  echo "$as_me:1478: \$? = $ac_status" >&5
   (exit $ac_status); }; then
   for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do
   case $ac_file in
@@ -1517,32 +1487,26 @@
 else
   echo "$as_me: failed program was:" >&5
 cat conftest.$ac_ext >&5
-{ { echo "$as_me:1520: error: cannot compute OBJEXT: cannot compile" >&5
+{ { echo "$as_me:1490: error: cannot compute OBJEXT: cannot compile" >&5
 echo "$as_me: error: cannot compute OBJEXT: cannot compile" >&2;}
    { (exit 1); exit 1; }; }
 fi
 
 rm -f conftest.$ac_cv_objext conftest.$ac_ext
 fi
-echo "$as_me:1527: result: $ac_cv_objext" >&5
+echo "$as_me:1497: result: $ac_cv_objext" >&5
 echo "${ECHO_T}$ac_cv_objext" >&6
 OBJEXT=$ac_cv_objext
 ac_objext=$OBJEXT
-echo "$as_me:1531: checking whether we are using the GNU C compiler" >&5
+echo "$as_me:1501: checking whether we are using the GNU C compiler" >&5
 echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6
 if test "${ac_cv_c_compiler_gnu+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line 1537 "configure"
+#line 1507 "configure"
 #include "confdefs.h"
 
-#ifdef F77_DUMMY_MAIN
-#  ifdef __cplusplus
-     extern "C"
-#  endif
-   int F77_DUMMY_MAIN() { return 1; }
-#endif
 int
 main ()
 {
@@ -1555,16 +1519,16 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:1558: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:1522: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:1561: \$? = $ac_status" >&5
+  echo "$as_me:1525: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:1564: \"$ac_try\"") >&5
+  { (eval echo "$as_me:1528: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:1567: \$? = $ac_status" >&5
+  echo "$as_me:1531: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_compiler_gnu=yes
 else
@@ -1576,27 +1540,21 @@
 ac_cv_c_compiler_gnu=$ac_compiler_gnu
 
 fi
-echo "$as_me:1579: result: $ac_cv_c_compiler_gnu" >&5
+echo "$as_me:1543: result: $ac_cv_c_compiler_gnu" >&5
 echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6
 GCC=`test $ac_compiler_gnu = yes && echo yes`
 ac_test_CFLAGS=${CFLAGS+set}
 ac_save_CFLAGS=$CFLAGS
 CFLAGS="-g"
-echo "$as_me:1585: checking whether $CC accepts -g" >&5
+echo "$as_me:1549: checking whether $CC accepts -g" >&5
 echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6
 if test "${ac_cv_prog_cc_g+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line 1591 "configure"
+#line 1555 "configure"
 #include "confdefs.h"
 
-#ifdef F77_DUMMY_MAIN
-#  ifdef __cplusplus
-     extern "C"
-#  endif
-   int F77_DUMMY_MAIN() { return 1; }
-#endif
 int
 main ()
 {
@@ -1606,16 +1564,16 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:1609: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:1567: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:1612: \$? = $ac_status" >&5
+  echo "$as_me:1570: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:1615: \"$ac_try\"") >&5
+  { (eval echo "$as_me:1573: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:1618: \$? = $ac_status" >&5
+  echo "$as_me:1576: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_prog_cc_g=yes
 else
@@ -1625,7 +1583,7 @@
 fi
 rm -f conftest.$ac_objext conftest.$ac_ext
 fi
-echo "$as_me:1628: result: $ac_cv_prog_cc_g" >&5
+echo "$as_me:1586: result: $ac_cv_prog_cc_g" >&5
 echo "${ECHO_T}$ac_cv_prog_cc_g" >&6
 if test "$ac_test_CFLAGS" = set; then
   CFLAGS=$ac_save_CFLAGS
@@ -1652,16 +1610,16 @@
 #endif
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:1655: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:1613: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:1658: \$? = $ac_status" >&5
+  echo "$as_me:1616: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:1661: \"$ac_try\"") >&5
+  { (eval echo "$as_me:1619: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:1664: \$? = $ac_status" >&5
+  echo "$as_me:1622: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   for ac_declaration in \
    ''\
@@ -1673,16 +1631,10 @@
    'void exit (int);'
 do
   cat >conftest.$ac_ext <<_ACEOF
-#line 1676 "configure"
+#line 1634 "configure"
 #include "confdefs.h"
 #include <stdlib.h>
 $ac_declaration
-#ifdef F77_DUMMY_MAIN
-#  ifdef __cplusplus
-     extern "C"
-#  endif
-   int F77_DUMMY_MAIN() { return 1; }
-#endif
 int
 main ()
 {
@@ -1692,16 +1644,16 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:1695: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:1647: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:1698: \$? = $ac_status" >&5
+  echo "$as_me:1650: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:1701: \"$ac_try\"") >&5
+  { (eval echo "$as_me:1653: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:1704: \$? = $ac_status" >&5
+  echo "$as_me:1656: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   :
 else
@@ -1711,15 +1663,9 @@
 fi
 rm -f conftest.$ac_objext conftest.$ac_ext
   cat >conftest.$ac_ext <<_ACEOF
-#line 1714 "configure"
+#line 1666 "configure"
 #include "confdefs.h"
 $ac_declaration
-#ifdef F77_DUMMY_MAIN
-#  ifdef __cplusplus
-     extern "C"
-#  endif
-   int F77_DUMMY_MAIN() { return 1; }
-#endif
 int
 main ()
 {
@@ -1729,16 +1675,16 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:1732: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:1678: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:1735: \$? = $ac_status" >&5
+  echo "$as_me:1681: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:1738: \"$ac_try\"") >&5
+  { (eval echo "$as_me:1684: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:1741: \$? = $ac_status" >&5
+  echo "$as_me:1687: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   break
 else
@@ -1782,7 +1728,7 @@
   fi
 done
 if test -z "$ac_aux_dir"; then
-  { { echo "$as_me:1785: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&5
+  { { echo "$as_me:1731: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&5
 echo "$as_me: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&2;}
    { (exit 1); exit 1; }; }
 fi
@@ -1792,11 +1738,11 @@
 
 # Make sure we can run config.sub.
 $ac_config_sub sun4 >/dev/null 2>&1 ||
-  { { echo "$as_me:1795: error: cannot run $ac_config_sub" >&5
+  { { echo "$as_me:1741: error: cannot run $ac_config_sub" >&5
 echo "$as_me: error: cannot run $ac_config_sub" >&2;}
    { (exit 1); exit 1; }; }
 
-echo "$as_me:1799: checking build system type" >&5
+echo "$as_me:1745: checking build system type" >&5
 echo $ECHO_N "checking build system type... $ECHO_C" >&6
 if test "${ac_cv_build+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -1805,23 +1751,23 @@
 test -z "$ac_cv_build_alias" &&
   ac_cv_build_alias=`$ac_config_guess`
 test -z "$ac_cv_build_alias" &&
-  { { echo "$as_me:1808: error: cannot guess build type; you must specify one" >&5
+  { { echo "$as_me:1754: error: cannot guess build type; you must specify one" >&5
 echo "$as_me: error: cannot guess build type; you must specify one" >&2;}
    { (exit 1); exit 1; }; }
 ac_cv_build=`$ac_config_sub $ac_cv_build_alias` ||
-  { { echo "$as_me:1812: error: $ac_config_sub $ac_cv_build_alias failed." >&5
+  { { echo "$as_me:1758: error: $ac_config_sub $ac_cv_build_alias failed." >&5
 echo "$as_me: error: $ac_config_sub $ac_cv_build_alias failed." >&2;}
    { (exit 1); exit 1; }; }
 
 fi
-echo "$as_me:1817: result: $ac_cv_build" >&5
+echo "$as_me:1763: result: $ac_cv_build" >&5
 echo "${ECHO_T}$ac_cv_build" >&6
 build=$ac_cv_build
 build_cpu=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
 build_vendor=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
 build_os=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
 
-echo "$as_me:1824: checking host system type" >&5
+echo "$as_me:1770: checking host system type" >&5
 echo $ECHO_N "checking host system type... $ECHO_C" >&6
 if test "${ac_cv_host+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -1830,36 +1776,31 @@
 test -z "$ac_cv_host_alias" &&
   ac_cv_host_alias=$ac_cv_build_alias
 ac_cv_host=`$ac_config_sub $ac_cv_host_alias` ||
-  { { echo "$as_me:1833: error: $ac_config_sub $ac_cv_host_alias failed" >&5
+  { { echo "$as_me:1779: error: $ac_config_sub $ac_cv_host_alias failed" >&5
 echo "$as_me: error: $ac_config_sub $ac_cv_host_alias failed" >&2;}
    { (exit 1); exit 1; }; }
 
 fi
-echo "$as_me:1838: result: $ac_cv_host" >&5
+echo "$as_me:1784: result: $ac_cv_host" >&5
 echo "${ECHO_T}$ac_cv_host" >&6
 host=$ac_cv_host
 host_cpu=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
 host_vendor=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
 host_os=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
 
-echo "$as_me:1845: checking whether byte ordering is bigendian" >&5
+echo "$as_me:1791: checking whether byte ordering is bigendian" >&5
 echo $ECHO_N "checking whether byte ordering is bigendian... $ECHO_C" >&6
 if test "${ac_cv_c_bigendian+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  # See if sys/param.h defines the BYTE_ORDER macro.
+  ac_cv_c_bigendian=unknown
+# See if sys/param.h defines the BYTE_ORDER macro.
 cat >conftest.$ac_ext <<_ACEOF
-#line 1852 "configure"
+#line 1799 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <sys/param.h>
 
-#ifdef F77_DUMMY_MAIN
-#  ifdef __cplusplus
-     extern "C"
-#  endif
-   int F77_DUMMY_MAIN() { return 1; }
-#endif
 int
 main ()
 {
@@ -1872,30 +1813,24 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:1875: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:1816: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:1878: \$? = $ac_status" >&5
+  echo "$as_me:1819: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:1881: \"$ac_try\"") >&5
+  { (eval echo "$as_me:1822: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:1884: \$? = $ac_status" >&5
+  echo "$as_me:1825: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   # It does; now see whether it defined to BIG_ENDIAN or not.
 cat >conftest.$ac_ext <<_ACEOF
-#line 1888 "configure"
+#line 1829 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <sys/param.h>
 
-#ifdef F77_DUMMY_MAIN
-#  ifdef __cplusplus
-     extern "C"
-#  endif
-   int F77_DUMMY_MAIN() { return 1; }
-#endif
 int
 main ()
 {
@@ -1908,16 +1843,16 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:1911: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:1846: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:1914: \$? = $ac_status" >&5
+  echo "$as_me:1849: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:1917: \"$ac_try\"") >&5
+  { (eval echo "$as_me:1852: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:1920: \$? = $ac_status" >&5
+  echo "$as_me:1855: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_c_bigendian=yes
 else
@@ -1929,64 +1864,16 @@
 else
   echo "$as_me: failed program was:" >&5
 cat conftest.$ac_ext >&5
-# It does not; compile a test program.
-if test "$cross_compiling" = yes; then
-  # try to guess the endianess by grep'ing values into an object file
-  ac_cv_c_bigendian=unknown
-  cat >conftest.$ac_ext <<_ACEOF
-#line 1937 "configure"
-#include "confdefs.h"
-short ascii_mm[] = { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 };
-short ascii_ii[] = { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 };
-void _ascii () { char *s = (char *) ascii_mm; s = (char *) ascii_ii; }
-short ebcdic_ii[] = { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 };
-short ebcdic_mm[] = { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 };
-void _ebcdic () { char *s = (char *) ebcdic_mm; s = (char *) ebcdic_ii; }
-#ifdef F77_DUMMY_MAIN
-#  ifdef __cplusplus
-     extern "C"
-#  endif
-   int F77_DUMMY_MAIN() { return 1; }
-#endif
-int
-main ()
-{
- _ascii (); _ebcdic ();
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:1960: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
-  ac_status=$?
-  echo "$as_me:1963: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-         { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:1966: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:1969: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  if fgrep BIGenDianSyS conftest.$ac_objext >/dev/null ; then
-  ac_cv_c_bigendian=yes
-fi
-if fgrep LiTTleEnDian conftest.$ac_objext >/dev/null ; then
-  if test "$ac_cv_c_bigendian" = unknown; then
-    ac_cv_c_bigendian=no
-  else
-    # finding both strings is unlikely to happen, but who knows?
-    ac_cv_c_bigendian=unknown
-  fi
-fi
-else
-  echo "$as_me: failed program was:" >&5
-cat conftest.$ac_ext >&5
 fi
 rm -f conftest.$ac_objext conftest.$ac_ext
+if test $ac_cv_c_bigendian = unknown; then
+if test "$cross_compiling" = yes; then
+  { { echo "$as_me:1871: error: cannot run test program while cross compiling" >&5
+echo "$as_me: error: cannot run test program while cross compiling" >&2;}
+   { (exit 1); exit 1; }; }
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line 1989 "configure"
+#line 1876 "configure"
 #include "confdefs.h"
 int
 main ()
@@ -2002,15 +1889,15 @@
 }
 _ACEOF
 rm -f conftest$ac_exeext
-if { (eval echo "$as_me:2005: \"$ac_link\"") >&5
+if { (eval echo "$as_me:1892: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:2008: \$? = $ac_status" >&5
+  echo "$as_me:1895: \$? = $ac_status" >&5
   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
-  { (eval echo "$as_me:2010: \"$ac_try\"") >&5
+  { (eval echo "$as_me:1897: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:2013: \$? = $ac_status" >&5
+  echo "$as_me:1900: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_c_bigendian=no
 else
@@ -2022,26 +1909,16 @@
 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
 fi
 fi
-rm -f conftest.$ac_objext conftest.$ac_ext
 fi
-echo "$as_me:2027: result: $ac_cv_c_bigendian" >&5
+echo "$as_me:1913: result: $ac_cv_c_bigendian" >&5
 echo "${ECHO_T}$ac_cv_c_bigendian" >&6
-case $ac_cv_c_bigendian in
-  yes)
+if test $ac_cv_c_bigendian = yes; then
 
-cat >>confdefs.h <<\_ACEOF
+cat >>confdefs.h <<\EOF
 #define WORDS_BIGENDIAN 1
-_ACEOF
- ;;
-  no)
-     ;;
-  *)
-    { { echo "$as_me:2039: error: unknown endianess
-presetting ac_cv_c_bigendian=no (or yes) will help" >&5
-echo "$as_me: error: unknown endianess
-presetting ac_cv_c_bigendian=no (or yes) will help" >&2;}
-   { (exit 1); exit 1; }; } ;;
-esac
+EOF
+
+fi
 
 # Checks for programs.
 ac_ext=c
@@ -2049,7 +1926,7 @@
 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
 ac_compiler_gnu=$ac_cv_c_compiler_gnu
-echo "$as_me:2052: checking how to run the C preprocessor" >&5
+echo "$as_me:1929: checking how to run the C preprocessor" >&5
 echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6
 # On Suns, sometimes $CPP names a directory.
 if test -n "$CPP" && test -d "$CPP"; then
@@ -2070,18 +1947,18 @@
   # On the NeXT, cc -E runs the code through the compiler's parser,
   # not just through cpp. "Syntax error" is here to catch this case.
   cat >conftest.$ac_ext <<_ACEOF
-#line 2073 "configure"
+#line 1950 "configure"
 #include "confdefs.h"
 #include <assert.h>
                      Syntax error
 _ACEOF
-if { (eval echo "$as_me:2078: \"$ac_cpp conftest.$ac_ext\"") >&5
+if { (eval echo "$as_me:1955: \"$ac_cpp conftest.$ac_ext\"") >&5
   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
   ac_status=$?
   egrep -v '^ *\+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:2084: \$? = $ac_status" >&5
+  echo "$as_me:1961: \$? = $ac_status" >&5
   (exit $ac_status); } >/dev/null; then
   if test -s conftest.err; then
     ac_cpp_err=$ac_c_preproc_warn_flag
@@ -2104,17 +1981,17 @@
   # OK, works on sane cases.  Now check whether non-existent headers
   # can be detected and how.
   cat >conftest.$ac_ext <<_ACEOF
-#line 2107 "configure"
+#line 1984 "configure"
 #include "confdefs.h"
 #include <ac_nonexistent.h>
 _ACEOF
-if { (eval echo "$as_me:2111: \"$ac_cpp conftest.$ac_ext\"") >&5
+if { (eval echo "$as_me:1988: \"$ac_cpp conftest.$ac_ext\"") >&5
   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
   ac_status=$?
   egrep -v '^ *\+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:2117: \$? = $ac_status" >&5
+  echo "$as_me:1994: \$? = $ac_status" >&5
   (exit $ac_status); } >/dev/null; then
   if test -s conftest.err; then
     ac_cpp_err=$ac_c_preproc_warn_flag
@@ -2151,7 +2028,7 @@
 else
   ac_cv_prog_CPP=$CPP
 fi
-echo "$as_me:2154: result: $CPP" >&5
+echo "$as_me:2031: result: $CPP" >&5
 echo "${ECHO_T}$CPP" >&6
 ac_preproc_ok=false
 for ac_c_preproc_warn_flag in '' yes
@@ -2161,18 +2038,18 @@
   # On the NeXT, cc -E runs the code through the compiler's parser,
   # not just through cpp. "Syntax error" is here to catch this case.
   cat >conftest.$ac_ext <<_ACEOF
-#line 2164 "configure"
+#line 2041 "configure"
 #include "confdefs.h"
 #include <assert.h>
                      Syntax error
 _ACEOF
-if { (eval echo "$as_me:2169: \"$ac_cpp conftest.$ac_ext\"") >&5
+if { (eval echo "$as_me:2046: \"$ac_cpp conftest.$ac_ext\"") >&5
   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
   ac_status=$?
   egrep -v '^ *\+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:2175: \$? = $ac_status" >&5
+  echo "$as_me:2052: \$? = $ac_status" >&5
   (exit $ac_status); } >/dev/null; then
   if test -s conftest.err; then
     ac_cpp_err=$ac_c_preproc_warn_flag
@@ -2195,17 +2072,17 @@
   # OK, works on sane cases.  Now check whether non-existent headers
   # can be detected and how.
   cat >conftest.$ac_ext <<_ACEOF
-#line 2198 "configure"
+#line 2075 "configure"
 #include "confdefs.h"
 #include <ac_nonexistent.h>
 _ACEOF
-if { (eval echo "$as_me:2202: \"$ac_cpp conftest.$ac_ext\"") >&5
+if { (eval echo "$as_me:2079: \"$ac_cpp conftest.$ac_ext\"") >&5
   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
   ac_status=$?
   egrep -v '^ *\+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:2208: \$? = $ac_status" >&5
+  echo "$as_me:2085: \$? = $ac_status" >&5
   (exit $ac_status); } >/dev/null; then
   if test -s conftest.err; then
     ac_cpp_err=$ac_c_preproc_warn_flag
@@ -2233,7 +2110,7 @@
 if $ac_preproc_ok; then
   :
 else
-  { { echo "$as_me:2236: error: C preprocessor \"$CPP\" fails sanity check" >&5
+  { { echo "$as_me:2113: error: C preprocessor \"$CPP\" fails sanity check" >&5
 echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check" >&2;}
    { (exit 1); exit 1; }; }
 fi
@@ -2247,7 +2124,7 @@
 if test -n "$ac_tool_prefix"; then
   # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
 set dummy ${ac_tool_prefix}ranlib; ac_word=$2
-echo "$as_me:2250: checking for $ac_word" >&5
+echo "$as_me:2127: checking for $ac_word" >&5
 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
 if test "${ac_cv_prog_RANLIB+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -2262,7 +2139,7 @@
   test -z "$ac_dir" && ac_dir=.
   $as_executable_p "$ac_dir/$ac_word" || continue
 ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
-echo "$as_me:2265: found $ac_dir/$ac_word" >&5
+echo "$as_me:2142: found $ac_dir/$ac_word" >&5
 break
 done
 
@@ -2270,10 +2147,10 @@
 fi
 RANLIB=$ac_cv_prog_RANLIB
 if test -n "$RANLIB"; then
-  echo "$as_me:2273: result: $RANLIB" >&5
+  echo "$as_me:2150: result: $RANLIB" >&5
 echo "${ECHO_T}$RANLIB" >&6
 else
-  echo "$as_me:2276: result: no" >&5
+  echo "$as_me:2153: result: no" >&5
 echo "${ECHO_T}no" >&6
 fi
 
@@ -2282,7 +2159,7 @@
   ac_ct_RANLIB=$RANLIB
   # Extract the first word of "ranlib", so it can be a program name with args.
 set dummy ranlib; ac_word=$2
-echo "$as_me:2285: checking for $ac_word" >&5
+echo "$as_me:2162: checking for $ac_word" >&5
 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
 if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -2297,7 +2174,7 @@
   test -z "$ac_dir" && ac_dir=.
   $as_executable_p "$ac_dir/$ac_word" || continue
 ac_cv_prog_ac_ct_RANLIB="ranlib"
-echo "$as_me:2300: found $ac_dir/$ac_word" >&5
+echo "$as_me:2177: found $ac_dir/$ac_word" >&5
 break
 done
 
@@ -2306,10 +2183,10 @@
 fi
 ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
 if test -n "$ac_ct_RANLIB"; then
-  echo "$as_me:2309: result: $ac_ct_RANLIB" >&5
+  echo "$as_me:2186: result: $ac_ct_RANLIB" >&5
 echo "${ECHO_T}$ac_ct_RANLIB" >&6
 else
-  echo "$as_me:2312: result: no" >&5
+  echo "$as_me:2189: result: no" >&5
 echo "${ECHO_T}no" >&6
 fi
 
@@ -2330,7 +2207,7 @@
 # AFS /usr/afsws/bin/install, which mishandles nonexistent args
 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
 # ./install, which can be erroneously created by make from ./install.sh.
-echo "$as_me:2333: checking for a BSD compatible install" >&5
+echo "$as_me:2210: checking for a BSD compatible install" >&5
 echo $ECHO_N "checking for a BSD compatible install... $ECHO_C" >&6
 if test -z "$INSTALL"; then
 if test "${ac_cv_path_install+set}" = set; then
@@ -2379,7 +2256,7 @@
     INSTALL=$ac_install_sh
   fi
 fi
-echo "$as_me:2382: result: $INSTALL" >&5
+echo "$as_me:2259: result: $INSTALL" >&5
 echo "${ECHO_T}$INSTALL" >&6
 
 # Use test -z because SunOS4 sh mishandles braces in ${var-val}.
@@ -2392,7 +2269,7 @@
 
 # Extract the first word of "ar", so it can be a program name with args.
 set dummy ar; ac_word=$2
-echo "$as_me:2395: checking for $ac_word" >&5
+echo "$as_me:2272: checking for $ac_word" >&5
 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
 if test "${ac_cv_path_AR+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -2409,7 +2286,7 @@
   test -z "$ac_dir" && ac_dir=.
   if $as_executable_p "$ac_dir/$ac_word"; then
    ac_cv_path_AR="$ac_dir/$ac_word"
-   echo "$as_me:2412: found $ac_dir/$ac_word" >&5
+   echo "$as_me:2289: found $ac_dir/$ac_word" >&5
    break
 fi
 done
@@ -2420,10 +2297,10 @@
 AR=$ac_cv_path_AR
 
 if test -n "$AR"; then
-  echo "$as_me:2423: result: $AR" >&5
+  echo "$as_me:2300: result: $AR" >&5
 echo "${ECHO_T}$AR" >&6
 else
-  echo "$as_me:2426: result: no" >&5
+  echo "$as_me:2303: result: no" >&5
 echo "${ECHO_T}no" >&6
 fi
 
@@ -2431,7 +2308,7 @@
 do
   # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
-echo "$as_me:2434: checking for $ac_word" >&5
+echo "$as_me:2311: checking for $ac_word" >&5
 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
 if test "${ac_cv_path_PERL+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -2448,7 +2325,7 @@
   test -z "$ac_dir" && ac_dir=.
   if $as_executable_p "$ac_dir/$ac_word"; then
    ac_cv_path_PERL="$ac_dir/$ac_word"
-   echo "$as_me:2451: found $ac_dir/$ac_word" >&5
+   echo "$as_me:2328: found $ac_dir/$ac_word" >&5
    break
 fi
 done
@@ -2459,10 +2336,10 @@
 PERL=$ac_cv_path_PERL
 
 if test -n "$PERL"; then
-  echo "$as_me:2462: result: $PERL" >&5
+  echo "$as_me:2339: result: $PERL" >&5
 echo "${ECHO_T}$PERL" >&6
 else
-  echo "$as_me:2465: result: no" >&5
+  echo "$as_me:2342: result: no" >&5
 echo "${ECHO_T}no" >&6
 fi
 
@@ -2471,7 +2348,7 @@
 
 # Extract the first word of "ent", so it can be a program name with args.
 set dummy ent; ac_word=$2
-echo "$as_me:2474: checking for $ac_word" >&5
+echo "$as_me:2351: checking for $ac_word" >&5
 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
 if test "${ac_cv_path_ENT+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -2488,7 +2365,7 @@
   test -z "$ac_dir" && ac_dir=.
   if $as_executable_p "$ac_dir/$ac_word"; then
    ac_cv_path_ENT="$ac_dir/$ac_word"
-   echo "$as_me:2491: found $ac_dir/$ac_word" >&5
+   echo "$as_me:2368: found $ac_dir/$ac_word" >&5
    break
 fi
 done
@@ -2499,10 +2376,10 @@
 ENT=$ac_cv_path_ENT
 
 if test -n "$ENT"; then
-  echo "$as_me:2502: result: $ENT" >&5
+  echo "$as_me:2379: result: $ENT" >&5
 echo "${ECHO_T}$ENT" >&6
 else
-  echo "$as_me:2505: result: no" >&5
+  echo "$as_me:2382: result: no" >&5
 echo "${ECHO_T}no" >&6
 fi
 
@@ -2510,7 +2387,7 @@
 do
   # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
-echo "$as_me:2513: checking for $ac_word" >&5
+echo "$as_me:2390: checking for $ac_word" >&5
 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
 if test "${ac_cv_path_FILEPRIV+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -2527,7 +2404,7 @@
   test -z "$ac_dir" && ac_dir=.
   if $as_executable_p "$ac_dir/$ac_word"; then
    ac_cv_path_FILEPRIV="$ac_dir/$ac_word"
-   echo "$as_me:2530: found $ac_dir/$ac_word" >&5
+   echo "$as_me:2407: found $ac_dir/$ac_word" >&5
    break
 fi
 done
@@ -2538,10 +2415,10 @@
 FILEPRIV=$ac_cv_path_FILEPRIV
 
 if test -n "$FILEPRIV"; then
-  echo "$as_me:2541: result: $FILEPRIV" >&5
+  echo "$as_me:2418: result: $FILEPRIV" >&5
 echo "${ECHO_T}$FILEPRIV" >&6
 else
-  echo "$as_me:2544: result: no" >&5
+  echo "$as_me:2421: result: no" >&5
 echo "${ECHO_T}no" >&6
 fi
 
@@ -2551,7 +2428,7 @@
 
 # Extract the first word of "bash", so it can be a program name with args.
 set dummy bash; ac_word=$2
-echo "$as_me:2554: checking for $ac_word" >&5
+echo "$as_me:2431: checking for $ac_word" >&5
 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
 if test "${ac_cv_path_TEST_MINUS_S_SH+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -2568,7 +2445,7 @@
   test -z "$ac_dir" && ac_dir=.
   if $as_executable_p "$ac_dir/$ac_word"; then
    ac_cv_path_TEST_MINUS_S_SH="$ac_dir/$ac_word"
-   echo "$as_me:2571: found $ac_dir/$ac_word" >&5
+   echo "$as_me:2448: found $ac_dir/$ac_word" >&5
    break
 fi
 done
@@ -2579,16 +2456,16 @@
 TEST_MINUS_S_SH=$ac_cv_path_TEST_MINUS_S_SH
 
 if test -n "$TEST_MINUS_S_SH"; then
-  echo "$as_me:2582: result: $TEST_MINUS_S_SH" >&5
+  echo "$as_me:2459: result: $TEST_MINUS_S_SH" >&5
 echo "${ECHO_T}$TEST_MINUS_S_SH" >&6
 else
-  echo "$as_me:2585: result: no" >&5
+  echo "$as_me:2462: result: no" >&5
 echo "${ECHO_T}no" >&6
 fi
 
 # Extract the first word of "ksh", so it can be a program name with args.
 set dummy ksh; ac_word=$2
-echo "$as_me:2591: checking for $ac_word" >&5
+echo "$as_me:2468: checking for $ac_word" >&5
 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
 if test "${ac_cv_path_TEST_MINUS_S_SH+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -2605,7 +2482,7 @@
   test -z "$ac_dir" && ac_dir=.
   if $as_executable_p "$ac_dir/$ac_word"; then
    ac_cv_path_TEST_MINUS_S_SH="$ac_dir/$ac_word"
-   echo "$as_me:2608: found $ac_dir/$ac_word" >&5
+   echo "$as_me:2485: found $ac_dir/$ac_word" >&5
    break
 fi
 done
@@ -2616,16 +2493,16 @@
 TEST_MINUS_S_SH=$ac_cv_path_TEST_MINUS_S_SH
 
 if test -n "$TEST_MINUS_S_SH"; then
-  echo "$as_me:2619: result: $TEST_MINUS_S_SH" >&5
+  echo "$as_me:2496: result: $TEST_MINUS_S_SH" >&5
 echo "${ECHO_T}$TEST_MINUS_S_SH" >&6
 else
-  echo "$as_me:2622: result: no" >&5
+  echo "$as_me:2499: result: no" >&5
 echo "${ECHO_T}no" >&6
 fi
 
 # Extract the first word of "sh", so it can be a program name with args.
 set dummy sh; ac_word=$2
-echo "$as_me:2628: checking for $ac_word" >&5
+echo "$as_me:2505: checking for $ac_word" >&5
 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
 if test "${ac_cv_path_TEST_MINUS_S_SH+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -2642,7 +2519,7 @@
   test -z "$ac_dir" && ac_dir=.
   if $as_executable_p "$ac_dir/$ac_word"; then
    ac_cv_path_TEST_MINUS_S_SH="$ac_dir/$ac_word"
-   echo "$as_me:2645: found $ac_dir/$ac_word" >&5
+   echo "$as_me:2522: found $ac_dir/$ac_word" >&5
    break
 fi
 done
@@ -2653,10 +2530,10 @@
 TEST_MINUS_S_SH=$ac_cv_path_TEST_MINUS_S_SH
 
 if test -n "$TEST_MINUS_S_SH"; then
-  echo "$as_me:2656: result: $TEST_MINUS_S_SH" >&5
+  echo "$as_me:2533: result: $TEST_MINUS_S_SH" >&5
 echo "${ECHO_T}$TEST_MINUS_S_SH" >&6
 else
-  echo "$as_me:2659: result: no" >&5
+  echo "$as_me:2536: result: no" >&5
 echo "${ECHO_T}no" >&6
 fi
 
@@ -2668,7 +2545,7 @@
 fi;
 if test "$enable_largefile" != no; then
 
-  echo "$as_me:2671: checking for special C compiler options needed for large files" >&5
+  echo "$as_me:2548: checking for special C compiler options needed for large files" >&5
 echo $ECHO_N "checking for special C compiler options needed for large files... $ECHO_C" >&6
 if test "${ac_cv_sys_largefile_CC+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -2680,7 +2557,7 @@
      	 # IRIX 6.2 and later do not support large files by default,
      	 # so use the C compiler's -n32 option if that helps.
          cat >conftest.$ac_ext <<_ACEOF
-#line 2683 "configure"
+#line 2560 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
  /* Check that off_t can represent 2**63 - 1 correctly.
@@ -2691,12 +2568,6 @@
   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
 		       && LARGE_OFF_T % 2147483647 == 1)
 		      ? 1 : -1];
-#ifdef F77_DUMMY_MAIN
-#  ifdef __cplusplus
-     extern "C"
-#  endif
-   int F77_DUMMY_MAIN() { return 1; }
-#endif
 int
 main ()
 {
@@ -2706,16 +2577,16 @@
 }
 _ACEOF
      	 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:2709: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:2580: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:2712: \$? = $ac_status" >&5
+  echo "$as_me:2583: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:2715: \"$ac_try\"") >&5
+  { (eval echo "$as_me:2586: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:2718: \$? = $ac_status" >&5
+  echo "$as_me:2589: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   break
 else
@@ -2725,16 +2596,16 @@
 rm -f conftest.$ac_objext
      	 CC="$CC -n32"
      	 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:2728: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:2599: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:2731: \$? = $ac_status" >&5
+  echo "$as_me:2602: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:2734: \"$ac_try\"") >&5
+  { (eval echo "$as_me:2605: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:2737: \$? = $ac_status" >&5
+  echo "$as_me:2608: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_sys_largefile_CC=' -n32'; break
 else
@@ -2748,13 +2619,13 @@
        rm -f conftest.$ac_ext
     fi
 fi
-echo "$as_me:2751: result: $ac_cv_sys_largefile_CC" >&5
+echo "$as_me:2622: result: $ac_cv_sys_largefile_CC" >&5
 echo "${ECHO_T}$ac_cv_sys_largefile_CC" >&6
   if test "$ac_cv_sys_largefile_CC" != no; then
     CC=$CC$ac_cv_sys_largefile_CC
   fi
 
-  echo "$as_me:2757: checking for _FILE_OFFSET_BITS value needed for large files" >&5
+  echo "$as_me:2628: checking for _FILE_OFFSET_BITS value needed for large files" >&5
 echo $ECHO_N "checking for _FILE_OFFSET_BITS value needed for large files... $ECHO_C" >&6
 if test "${ac_cv_sys_file_offset_bits+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -2762,7 +2633,7 @@
   while :; do
   ac_cv_sys_file_offset_bits=no
   cat >conftest.$ac_ext <<_ACEOF
-#line 2765 "configure"
+#line 2636 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
  /* Check that off_t can represent 2**63 - 1 correctly.
@@ -2773,12 +2644,6 @@
   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
 		       && LARGE_OFF_T % 2147483647 == 1)
 		      ? 1 : -1];
-#ifdef F77_DUMMY_MAIN
-#  ifdef __cplusplus
-     extern "C"
-#  endif
-   int F77_DUMMY_MAIN() { return 1; }
-#endif
 int
 main ()
 {
@@ -2788,16 +2653,16 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:2791: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:2656: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:2794: \$? = $ac_status" >&5
+  echo "$as_me:2659: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:2797: \"$ac_try\"") >&5
+  { (eval echo "$as_me:2662: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:2800: \$? = $ac_status" >&5
+  echo "$as_me:2665: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   break
 else
@@ -2806,7 +2671,7 @@
 fi
 rm -f conftest.$ac_objext conftest.$ac_ext
   cat >conftest.$ac_ext <<_ACEOF
-#line 2809 "configure"
+#line 2674 "configure"
 #include "confdefs.h"
 #define _FILE_OFFSET_BITS 64
 #include <sys/types.h>
@@ -2818,12 +2683,6 @@
   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
 		       && LARGE_OFF_T % 2147483647 == 1)
 		      ? 1 : -1];
-#ifdef F77_DUMMY_MAIN
-#  ifdef __cplusplus
-     extern "C"
-#  endif
-   int F77_DUMMY_MAIN() { return 1; }
-#endif
 int
 main ()
 {
@@ -2833,16 +2692,16 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:2836: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:2695: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:2839: \$? = $ac_status" >&5
+  echo "$as_me:2698: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:2842: \"$ac_try\"") >&5
+  { (eval echo "$as_me:2701: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:2845: \$? = $ac_status" >&5
+  echo "$as_me:2704: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_sys_file_offset_bits=64; break
 else
@@ -2853,17 +2712,17 @@
   break
 done
 fi
-echo "$as_me:2856: result: $ac_cv_sys_file_offset_bits" >&5
+echo "$as_me:2715: result: $ac_cv_sys_file_offset_bits" >&5
 echo "${ECHO_T}$ac_cv_sys_file_offset_bits" >&6
 if test "$ac_cv_sys_file_offset_bits" != no; then
 
-cat >>confdefs.h <<_ACEOF
+cat >>confdefs.h <<EOF
 #define _FILE_OFFSET_BITS $ac_cv_sys_file_offset_bits
-_ACEOF
+EOF
 
 fi
 rm -f conftest*
-  echo "$as_me:2866: checking for _LARGE_FILES value needed for large files" >&5
+  echo "$as_me:2725: checking for _LARGE_FILES value needed for large files" >&5
 echo $ECHO_N "checking for _LARGE_FILES value needed for large files... $ECHO_C" >&6
 if test "${ac_cv_sys_large_files+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -2871,7 +2730,7 @@
   while :; do
   ac_cv_sys_large_files=no
   cat >conftest.$ac_ext <<_ACEOF
-#line 2874 "configure"
+#line 2733 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
  /* Check that off_t can represent 2**63 - 1 correctly.
@@ -2882,12 +2741,6 @@
   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
 		       && LARGE_OFF_T % 2147483647 == 1)
 		      ? 1 : -1];
-#ifdef F77_DUMMY_MAIN
-#  ifdef __cplusplus
-     extern "C"
-#  endif
-   int F77_DUMMY_MAIN() { return 1; }
-#endif
 int
 main ()
 {
@@ -2897,16 +2750,16 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:2900: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:2753: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:2903: \$? = $ac_status" >&5
+  echo "$as_me:2756: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:2906: \"$ac_try\"") >&5
+  { (eval echo "$as_me:2759: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:2909: \$? = $ac_status" >&5
+  echo "$as_me:2762: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   break
 else
@@ -2915,7 +2768,7 @@
 fi
 rm -f conftest.$ac_objext conftest.$ac_ext
   cat >conftest.$ac_ext <<_ACEOF
-#line 2918 "configure"
+#line 2771 "configure"
 #include "confdefs.h"
 #define _LARGE_FILES 1
 #include <sys/types.h>
@@ -2927,12 +2780,6 @@
   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
 		       && LARGE_OFF_T % 2147483647 == 1)
 		      ? 1 : -1];
-#ifdef F77_DUMMY_MAIN
-#  ifdef __cplusplus
-     extern "C"
-#  endif
-   int F77_DUMMY_MAIN() { return 1; }
-#endif
 int
 main ()
 {
@@ -2942,16 +2789,16 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:2945: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:2792: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:2948: \$? = $ac_status" >&5
+  echo "$as_me:2795: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:2951: \"$ac_try\"") >&5
+  { (eval echo "$as_me:2798: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:2954: \$? = $ac_status" >&5
+  echo "$as_me:2801: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_sys_large_files=1; break
 else
@@ -2962,35 +2809,35 @@
   break
 done
 fi
-echo "$as_me:2965: result: $ac_cv_sys_large_files" >&5
+echo "$as_me:2812: result: $ac_cv_sys_large_files" >&5
 echo "${ECHO_T}$ac_cv_sys_large_files" >&6
 if test "$ac_cv_sys_large_files" != no; then
 
-cat >>confdefs.h <<_ACEOF
+cat >>confdefs.h <<EOF
 #define _LARGE_FILES $ac_cv_sys_large_files
-_ACEOF
+EOF
 
 fi
 rm -f conftest*
 fi
 
 if test -z "$AR" ; then
-	{ { echo "$as_me:2978: error: *** 'ar' missing, please install or fix your \$PATH ***" >&5
+	{ { echo "$as_me:2825: error: *** 'ar' missing, please install or fix your \$PATH ***" >&5
 echo "$as_me: error: *** 'ar' missing, please install or fix your \$PATH ***" >&2;}
    { (exit 1); exit 1; }; }
 fi
 
 # Use LOGIN_PROGRAM from environment if possible
 if test ! -z "$LOGIN_PROGRAM" ; then
-	cat >>confdefs.h <<_ACEOF
+	cat >>confdefs.h <<EOF
 #define LOGIN_PROGRAM_FALLBACK "$LOGIN_PROGRAM"
-_ACEOF
+EOF
 
 else
 	# Search for login
 	# Extract the first word of "login", so it can be a program name with args.
 set dummy login; ac_word=$2
-echo "$as_me:2993: checking for $ac_word" >&5
+echo "$as_me:2840: checking for $ac_word" >&5
 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
 if test "${ac_cv_path_LOGIN_PROGRAM_FALLBACK+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -3007,7 +2854,7 @@
   test -z "$ac_dir" && ac_dir=.
   if $as_executable_p "$ac_dir/$ac_word"; then
    ac_cv_path_LOGIN_PROGRAM_FALLBACK="$ac_dir/$ac_word"
-   echo "$as_me:3010: found $ac_dir/$ac_word" >&5
+   echo "$as_me:2857: found $ac_dir/$ac_word" >&5
    break
 fi
 done
@@ -3018,17 +2865,17 @@
 LOGIN_PROGRAM_FALLBACK=$ac_cv_path_LOGIN_PROGRAM_FALLBACK
 
 if test -n "$LOGIN_PROGRAM_FALLBACK"; then
-  echo "$as_me:3021: result: $LOGIN_PROGRAM_FALLBACK" >&5
+  echo "$as_me:2868: result: $LOGIN_PROGRAM_FALLBACK" >&5
 echo "${ECHO_T}$LOGIN_PROGRAM_FALLBACK" >&6
 else
-  echo "$as_me:3024: result: no" >&5
+  echo "$as_me:2871: result: no" >&5
 echo "${ECHO_T}no" >&6
 fi
 
 	if test ! -z "$LOGIN_PROGRAM_FALLBACK" ; then
-		cat >>confdefs.h <<_ACEOF
+		cat >>confdefs.h <<EOF
 #define LOGIN_PROGRAM_FALLBACK "$LOGIN_PROGRAM_FALLBACK"
-_ACEOF
+EOF
 
 	fi
 fi
@@ -3037,7 +2884,7 @@
 	LD=$CC
 fi
 
-echo "$as_me:3040: checking for $CC option to accept ANSI C" >&5
+echo "$as_me:2887: checking for $CC option to accept ANSI C" >&5
 echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6
 if test "${ac_cv_prog_cc_stdc+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -3045,7 +2892,7 @@
   ac_cv_prog_cc_stdc=no
 ac_save_CC=$CC
 cat >conftest.$ac_ext <<_ACEOF
-#line 3048 "configure"
+#line 2895 "configure"
 #include "confdefs.h"
 #include <stdarg.h>
 #include <stdio.h>
@@ -3075,12 +2922,6 @@
 int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
 int argc;
 char **argv;
-#ifdef F77_DUMMY_MAIN
-#  ifdef __cplusplus
-     extern "C"
-#  endif
-   int F77_DUMMY_MAIN() { return 1; }
-#endif
 int
 main ()
 {
@@ -3100,16 +2941,16 @@
 do
   CC="$ac_save_CC $ac_arg"
   rm -f conftest.$ac_objext
-if { (eval echo "$as_me:3103: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:2944: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:3106: \$? = $ac_status" >&5
+  echo "$as_me:2947: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:3109: \"$ac_try\"") >&5
+  { (eval echo "$as_me:2950: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:3112: \$? = $ac_status" >&5
+  echo "$as_me:2953: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_prog_cc_stdc=$ac_arg
 break
@@ -3126,15 +2967,15 @@
 
 case "x$ac_cv_prog_cc_stdc" in
   x|xno)
-    echo "$as_me:3129: result: none needed" >&5
+    echo "$as_me:2970: result: none needed" >&5
 echo "${ECHO_T}none needed" >&6 ;;
   *)
-    echo "$as_me:3132: result: $ac_cv_prog_cc_stdc" >&5
+    echo "$as_me:2973: result: $ac_cv_prog_cc_stdc" >&5
 echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6
     CC="$CC $ac_cv_prog_cc_stdc" ;;
 esac
 
-echo "$as_me:3137: checking for inline" >&5
+echo "$as_me:2978: checking for inline" >&5
 echo $ECHO_N "checking for inline... $ECHO_C" >&6
 if test "${ac_cv_c_inline+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -3142,7 +2983,7 @@
   ac_cv_c_inline=no
 for ac_kw in inline __inline__ __inline; do
   cat >conftest.$ac_ext <<_ACEOF
-#line 3145 "configure"
+#line 2986 "configure"
 #include "confdefs.h"
 #ifndef __cplusplus
 static $ac_kw int static_foo () {return 0; }
@@ -3151,16 +2992,16 @@
 
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:3154: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:2995: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:3157: \$? = $ac_status" >&5
+  echo "$as_me:2998: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:3160: \"$ac_try\"") >&5
+  { (eval echo "$as_me:3001: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:3163: \$? = $ac_status" >&5
+  echo "$as_me:3004: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_c_inline=$ac_kw; break
 else
@@ -3171,18 +3012,18 @@
 done
 
 fi
-echo "$as_me:3174: result: $ac_cv_c_inline" >&5
+echo "$as_me:3015: result: $ac_cv_c_inline" >&5
 echo "${ECHO_T}$ac_cv_c_inline" >&6
 case $ac_cv_c_inline in
   inline | yes) ;;
   no)
-cat >>confdefs.h <<\_ACEOF
+cat >>confdefs.h <<\EOF
 #define inline
-_ACEOF
+EOF
  ;;
-  *)  cat >>confdefs.h <<_ACEOF
+  *)  cat >>confdefs.h <<EOF
 #define inline $ac_cv_c_inline
-_ACEOF
+EOF
  ;;
 esac
 
@@ -3199,13 +3040,13 @@
 	if (test "$LD" != "gcc" && test -z "$blibpath"); then
 		blibpath="/usr/lib:/lib:/usr/local/lib"
 	fi
-	echo "$as_me:3202: checking for authenticate" >&5
+	echo "$as_me:3043: checking for authenticate" >&5
 echo $ECHO_N "checking for authenticate... $ECHO_C" >&6
 if test "${ac_cv_func_authenticate+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line 3208 "configure"
+#line 3049 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char authenticate (); below.  */
@@ -3219,12 +3060,6 @@
 char authenticate ();
 char (*f) ();
 
-#ifdef F77_DUMMY_MAIN
-#  ifdef __cplusplus
-     extern "C"
-#  endif
-   int F77_DUMMY_MAIN() { return 1; }
-#endif
 int
 main ()
 {
@@ -3242,16 +3077,16 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:3245: \"$ac_link\"") >&5
+if { (eval echo "$as_me:3080: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:3248: \$? = $ac_status" >&5
+  echo "$as_me:3083: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:3251: \"$ac_try\"") >&5
+  { (eval echo "$as_me:3086: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:3254: \$? = $ac_status" >&5
+  echo "$as_me:3089: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_func_authenticate=yes
 else
@@ -3261,65 +3096,65 @@
 fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:3264: result: $ac_cv_func_authenticate" >&5
+echo "$as_me:3099: result: $ac_cv_func_authenticate" >&5
 echo "${ECHO_T}$ac_cv_func_authenticate" >&6
 if test $ac_cv_func_authenticate = yes; then
-  cat >>confdefs.h <<\_ACEOF
+  cat >>confdefs.h <<\EOF
 #define WITH_AIXAUTHENTICATE 1
-_ACEOF
+EOF
 
 fi
 
-	cat >>confdefs.h <<\_ACEOF
+	cat >>confdefs.h <<\EOF
 #define BROKEN_GETADDRINFO 1
-_ACEOF
+EOF
 
-		cat >>confdefs.h <<\_ACEOF
+		cat >>confdefs.h <<\EOF
 #define DISABLE_LASTLOG 1
-_ACEOF
+EOF
 
-	cat >>confdefs.h <<\_ACEOF
+	cat >>confdefs.h <<\EOF
 #define HAVE_BOGUS_SYS_QUEUE_H 1
-_ACEOF
+EOF
 
 	;;
 *-*-cygwin*)
 	LIBS="$LIBS /usr/lib/textmode.o"
-	cat >>confdefs.h <<\_ACEOF
+	cat >>confdefs.h <<\EOF
 #define HAVE_CYGWIN 1
-_ACEOF
+EOF
 
-	cat >>confdefs.h <<\_ACEOF
+	cat >>confdefs.h <<\EOF
 #define USE_PIPES 1
-_ACEOF
+EOF
 
-	cat >>confdefs.h <<\_ACEOF
+	cat >>confdefs.h <<\EOF
 #define DISABLE_SHADOW 1
-_ACEOF
+EOF
 
-	cat >>confdefs.h <<\_ACEOF
+	cat >>confdefs.h <<\EOF
 #define IPV4_DEFAULT 1
-_ACEOF
+EOF
 
-	cat >>confdefs.h <<\_ACEOF
+	cat >>confdefs.h <<\EOF
 #define IP_TOS_IS_BROKEN 1
-_ACEOF
+EOF
 
-	cat >>confdefs.h <<\_ACEOF
+	cat >>confdefs.h <<\EOF
 #define NO_X11_UNIX_SOCKETS 1
-_ACEOF
+EOF
 
 	;;
 *-*-dgux*)
-	cat >>confdefs.h <<\_ACEOF
+	cat >>confdefs.h <<\EOF
 #define IP_TOS_IS_BROKEN 1
-_ACEOF
+EOF
 
 	;;
 *-*-darwin*)
-	cat >>confdefs.h <<\_ACEOF
+	cat >>confdefs.h <<\EOF
 #define BROKEN_GETADDRINFO 1
-_ACEOF
+EOF
 
 	;;
 *-*-hpux10*)
@@ -3328,46 +3163,46 @@
 	fi
 	CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE -D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED=1"
 	IPADDR_IN_DISPLAY=yes
-	cat >>confdefs.h <<\_ACEOF
+	cat >>confdefs.h <<\EOF
 #define USE_PIPES 1
-_ACEOF
+EOF
 
-	cat >>confdefs.h <<\_ACEOF
+	cat >>confdefs.h <<\EOF
 #define DISABLE_SHADOW 1
-_ACEOF
+EOF
 
-	cat >>confdefs.h <<\_ACEOF
+	cat >>confdefs.h <<\EOF
 #define DISABLE_UTMP 1
-_ACEOF
+EOF
 
-	cat >>confdefs.h <<\_ACEOF
+	cat >>confdefs.h <<\EOF
 #define SPT_TYPE SPT_PSTAT
-_ACEOF
+EOF
 
 	LIBS="$LIBS -lxnet -lsec"
 	;;
 *-*-hpux11*)
 	CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE -D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED=1"
 	IPADDR_IN_DISPLAY=yes
-	cat >>confdefs.h <<\_ACEOF
+	cat >>confdefs.h <<\EOF
 #define PAM_SUN_CODEBASE 1
-_ACEOF
+EOF
 
-	cat >>confdefs.h <<\_ACEOF
+	cat >>confdefs.h <<\EOF
 #define USE_PIPES 1
-_ACEOF
+EOF
 
-	cat >>confdefs.h <<\_ACEOF
+	cat >>confdefs.h <<\EOF
 #define DISABLE_SHADOW 1
-_ACEOF
+EOF
 
-	cat >>confdefs.h <<\_ACEOF
+	cat >>confdefs.h <<\EOF
 #define DISABLE_UTMP 1
-_ACEOF
+EOF
 
-	cat >>confdefs.h <<\_ACEOF
+	cat >>confdefs.h <<\EOF
 #define SPT_TYPE SPT_PSTAT
-_ACEOF
+EOF
 
 	LIBS="$LIBS -lxnet -lsec"
 	;;
@@ -3375,34 +3210,34 @@
 	CPPFLAGS="$CPPFLAGS -I/usr/local/include"
 	LDFLAGS="$LDFLAGS"
 	PATH="$PATH:/usr/etc"
-	cat >>confdefs.h <<\_ACEOF
+	cat >>confdefs.h <<\EOF
 #define BROKEN_INET_NTOA 1
-_ACEOF
+EOF
 
 	;;
 *-*-irix6*)
 	CPPFLAGS="$CPPFLAGS -I/usr/local/include"
 	LDFLAGS="$LDFLAGS"
 	PATH="$PATH:/usr/etc"
-	cat >>confdefs.h <<\_ACEOF
+	cat >>confdefs.h <<\EOF
 #define WITH_IRIX_ARRAY 1
-_ACEOF
+EOF
 
-	cat >>confdefs.h <<\_ACEOF
+	cat >>confdefs.h <<\EOF
 #define WITH_IRIX_PROJECT 1
-_ACEOF
+EOF
 
-	cat >>confdefs.h <<\_ACEOF
+	cat >>confdefs.h <<\EOF
 #define WITH_IRIX_AUDIT 1
-_ACEOF
+EOF
 
-	echo "$as_me:3399: checking for jlimit_startjob" >&5
+	echo "$as_me:3234: checking for jlimit_startjob" >&5
 echo $ECHO_N "checking for jlimit_startjob... $ECHO_C" >&6
 if test "${ac_cv_func_jlimit_startjob+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line 3405 "configure"
+#line 3240 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char jlimit_startjob (); below.  */
@@ -3416,12 +3251,6 @@
 char jlimit_startjob ();
 char (*f) ();
 
-#ifdef F77_DUMMY_MAIN
-#  ifdef __cplusplus
-     extern "C"
-#  endif
-   int F77_DUMMY_MAIN() { return 1; }
-#endif
 int
 main ()
 {
@@ -3439,16 +3268,16 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:3442: \"$ac_link\"") >&5
+if { (eval echo "$as_me:3271: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:3445: \$? = $ac_status" >&5
+  echo "$as_me:3274: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:3448: \"$ac_try\"") >&5
+  { (eval echo "$as_me:3277: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:3451: \$? = $ac_status" >&5
+  echo "$as_me:3280: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_func_jlimit_startjob=yes
 else
@@ -3458,44 +3287,44 @@
 fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:3461: result: $ac_cv_func_jlimit_startjob" >&5
+echo "$as_me:3290: result: $ac_cv_func_jlimit_startjob" >&5
 echo "${ECHO_T}$ac_cv_func_jlimit_startjob" >&6
 if test $ac_cv_func_jlimit_startjob = yes; then
-  cat >>confdefs.h <<\_ACEOF
+  cat >>confdefs.h <<\EOF
 #define WITH_IRIX_JOBS 1
-_ACEOF
+EOF
 
 fi
 
-	cat >>confdefs.h <<\_ACEOF
+	cat >>confdefs.h <<\EOF
 #define BROKEN_INET_NTOA 1
-_ACEOF
+EOF
 
 	;;
 *-*-linux*)
 	no_dev_ptmx=1
 	check_for_libcrypt_later=1
-	cat >>confdefs.h <<\_ACEOF
+	cat >>confdefs.h <<\EOF
 #define DONT_TRY_OTHER_AF 1
-_ACEOF
+EOF
 
-	cat >>confdefs.h <<\_ACEOF
+	cat >>confdefs.h <<\EOF
 #define PAM_TTY_KLUDGE 1
-_ACEOF
+EOF
 
-	cat >>confdefs.h <<\_ACEOF
+	cat >>confdefs.h <<\EOF
 #define HAVE_BOGUS_SYS_QUEUE_H 1
-_ACEOF
+EOF
 
 	inet6_default_4in6=yes
 	;;
 mips-sony-bsd|mips-sony-newsos4)
-	cat >>confdefs.h <<\_ACEOF
+	cat >>confdefs.h <<\EOF
 #define HAVE_NEWS4 1
-_ACEOF
+EOF
 
 	SONY=1
-	echo "$as_me:3498: checking for xatexit in -liberty" >&5
+	echo "$as_me:3327: checking for xatexit in -liberty" >&5
 echo $ECHO_N "checking for xatexit in -liberty... $ECHO_C" >&6
 if test "${ac_cv_lib_iberty_xatexit+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -3503,7 +3332,7 @@
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-liberty  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
-#line 3506 "configure"
+#line 3335 "configure"
 #include "confdefs.h"
 
 /* Override any gcc2 internal prototype to avoid an error.  */
@@ -3513,12 +3342,6 @@
 /* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
 char xatexit ();
-#ifdef F77_DUMMY_MAIN
-#  ifdef __cplusplus
-     extern "C"
-#  endif
-   int F77_DUMMY_MAIN() { return 1; }
-#endif
 int
 main ()
 {
@@ -3528,16 +3351,16 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:3531: \"$ac_link\"") >&5
+if { (eval echo "$as_me:3354: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:3534: \$? = $ac_status" >&5
+  echo "$as_me:3357: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:3537: \"$ac_try\"") >&5
+  { (eval echo "$as_me:3360: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:3540: \$? = $ac_status" >&5
+  echo "$as_me:3363: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_lib_iberty_xatexit=yes
 else
@@ -3548,15 +3371,15 @@
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-echo "$as_me:3551: result: $ac_cv_lib_iberty_xatexit" >&5
+echo "$as_me:3374: result: $ac_cv_lib_iberty_xatexit" >&5
 echo "${ECHO_T}$ac_cv_lib_iberty_xatexit" >&6
 if test $ac_cv_lib_iberty_xatexit = yes; then
-  cat >>confdefs.h <<\_ACEOF
+  cat >>confdefs.h <<\EOF
 #define HAVE_XATEXIT 1
-_ACEOF
+EOF
 
 else
-  { { echo "$as_me:3559: error: *** libiberty missing - please install first or check config.log ***" >&5
+  { { echo "$as_me:3382: error: *** libiberty missing - please install first or check config.log ***" >&5
 echo "$as_me: error: *** libiberty missing - please install first or check config.log ***" >&2;}
    { (exit 1); exit 1; }; }
 
@@ -3574,21 +3397,21 @@
 	conf_utmp_location=/etc/utmp
 	conf_wtmp_location=/usr/adm/wtmp
 	MAIL=/usr/spool/mail
-	cat >>confdefs.h <<\_ACEOF
+	cat >>confdefs.h <<\EOF
 #define HAVE_NEXT 1
-_ACEOF
+EOF
 
-	cat >>confdefs.h <<\_ACEOF
+	cat >>confdefs.h <<\EOF
 #define BROKEN_REALPATH 1
-_ACEOF
+EOF
 
-	cat >>confdefs.h <<\_ACEOF
+	cat >>confdefs.h <<\EOF
 #define USE_PIPES 1
-_ACEOF
+EOF
 
-	cat >>confdefs.h <<\_ACEOF
+	cat >>confdefs.h <<\EOF
 #define BROKEN_SAVED_UIDS 1
-_ACEOF
+EOF
 
 	CPPFLAGS="$CPPFLAGS -I/usr/local/include"
 	CFLAGS="$CFLAGS"
@@ -3597,40 +3420,40 @@
 	CPPFLAGS="$CPPFLAGS -I/usr/local/include"
 	LDFLAGS="$LDFLAGS -L/usr/local/lib -R/usr/local/lib"
 	need_dash_r=1
-	cat >>confdefs.h <<\_ACEOF
+	cat >>confdefs.h <<\EOF
 #define PAM_SUN_CODEBASE 1
-_ACEOF
+EOF
 
-	cat >>confdefs.h <<\_ACEOF
+	cat >>confdefs.h <<\EOF
 #define LOGIN_NEEDS_UTMPX 1
-_ACEOF
+EOF
 
-	cat >>confdefs.h <<\_ACEOF
+	cat >>confdefs.h <<\EOF
 #define LOGIN_NEEDS_TERM 1
-_ACEOF
+EOF
 
-	cat >>confdefs.h <<\_ACEOF
+	cat >>confdefs.h <<\EOF
 #define PAM_TTY_KLUDGE 1
-_ACEOF
+EOF
 
 	# hardwire lastlog location (can't detect it on some versions)
 	conf_lastlog_location="/var/adm/lastlog"
-	echo "$as_me:3618: checking for obsolete utmp and wtmp in solaris2.x" >&5
+	echo "$as_me:3441: checking for obsolete utmp and wtmp in solaris2.x" >&5
 echo $ECHO_N "checking for obsolete utmp and wtmp in solaris2.x... $ECHO_C" >&6
 	sol2ver=`echo "$host"| sed -e 's/.*[0-9]\.//'`
 	if test "$sol2ver" -ge 8; then
-		echo "$as_me:3622: result: yes" >&5
+		echo "$as_me:3445: result: yes" >&5
 echo "${ECHO_T}yes" >&6
-		cat >>confdefs.h <<\_ACEOF
+		cat >>confdefs.h <<\EOF
 #define DISABLE_UTMP 1
-_ACEOF
+EOF
 
-		cat >>confdefs.h <<\_ACEOF
+		cat >>confdefs.h <<\EOF
 #define DISABLE_WTMP 1
-_ACEOF
+EOF
 
 	else
-		echo "$as_me:3633: result: no" >&5
+		echo "$as_me:3456: result: no" >&5
 echo "${ECHO_T}no" >&6
 	fi
 	;;
@@ -3640,13 +3463,13 @@
 for ac_func in getpwanam
 do
 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-echo "$as_me:3643: checking for $ac_func" >&5
+echo "$as_me:3466: checking for $ac_func" >&5
 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
 if eval "test \"\${$as_ac_var+set}\" = set"; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line 3649 "configure"
+#line 3472 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func (); below.  */
@@ -3660,12 +3483,6 @@
 char $ac_func ();
 char (*f) ();
 
-#ifdef F77_DUMMY_MAIN
-#  ifdef __cplusplus
-     extern "C"
-#  endif
-   int F77_DUMMY_MAIN() { return 1; }
-#endif
 int
 main ()
 {
@@ -3683,16 +3500,16 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:3686: \"$ac_link\"") >&5
+if { (eval echo "$as_me:3503: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:3689: \$? = $ac_status" >&5
+  echo "$as_me:3506: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:3692: \"$ac_try\"") >&5
+  { (eval echo "$as_me:3509: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:3695: \$? = $ac_status" >&5
+  echo "$as_me:3512: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   eval "$as_ac_var=yes"
 else
@@ -3702,43 +3519,43 @@
 fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:3705: result: `eval echo '${'$as_ac_var'}'`" >&5
+echo "$as_me:3522: result: `eval echo '${'$as_ac_var'}'`" >&5
 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
 if test `eval echo '${'$as_ac_var'}'` = yes; then
-  cat >>confdefs.h <<_ACEOF
+  cat >>confdefs.h <<EOF
 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
-_ACEOF
+EOF
 
 fi
 done
 
-	cat >>confdefs.h <<\_ACEOF
+	cat >>confdefs.h <<\EOF
 #define PAM_SUN_CODEBASE 1
-_ACEOF
+EOF
 
-	cat >>confdefs.h <<\_ACEOF
+	cat >>confdefs.h <<\EOF
 #define HAVE_BOGUS_SYS_QUEUE_H 1
-_ACEOF
+EOF
 
 	conf_utmp_location=/etc/utmp
 	conf_wtmp_location=/var/adm/wtmp
 	conf_lastlog_location=/var/adm/lastlog
-	cat >>confdefs.h <<\_ACEOF
+	cat >>confdefs.h <<\EOF
 #define USE_PIPES 1
-_ACEOF
+EOF
 
 	;;
 *-ncr-sysv*)
 	CPPFLAGS="$CPPFLAGS -I/usr/local/include"
 	LDFLAGS="$LDFLAGS -L/usr/local/lib"
 	LIBS="$LIBS -lc89"
-	cat >>confdefs.h <<\_ACEOF
+	cat >>confdefs.h <<\EOF
 #define HAVE_BOGUS_SYS_QUEUE_H 1
-_ACEOF
+EOF
 
-	cat >>confdefs.h <<\_ACEOF
+	cat >>confdefs.h <<\EOF
 #define USE_PIPES 1
-_ACEOF
+EOF
 
 	;;
 *-sni-sysv*)
@@ -3746,17 +3563,17 @@
 	# /usr/ucblib MUST NOT be searched on ReliantUNIX
 	LDFLAGS="$LDFLAGS -L/usr/local/lib"
 	IPADDR_IN_DISPLAY=yes
-	cat >>confdefs.h <<\_ACEOF
+	cat >>confdefs.h <<\EOF
 #define USE_PIPES 1
-_ACEOF
+EOF
 
-	cat >>confdefs.h <<\_ACEOF
+	cat >>confdefs.h <<\EOF
 #define IP_TOS_IS_BROKEN 1
-_ACEOF
+EOF
 
-	cat >>confdefs.h <<\_ACEOF
+	cat >>confdefs.h <<\EOF
 #define HAVE_BOGUS_SYS_QUEUE_H 1
-_ACEOF
+EOF
 
 	# /usr/ucblib/libucb.a no longer needed on ReliantUNIX
 	# Attention: always take care to bind libsocket and libnsl before libc,
@@ -3766,18 +3583,18 @@
 	CPPFLAGS="$CPPFLAGS -I/usr/local/include"
 	LDFLAGS="$LDFLAGS -L/usr/local/lib"
 #	enable_suid_ssh=no
-	cat >>confdefs.h <<\_ACEOF
+	cat >>confdefs.h <<\EOF
 #define USE_PIPES 1
-_ACEOF
+EOF
 
 	;;
 *-*-sysv5*)
 	CPPFLAGS="$CPPFLAGS -I/usr/local/include"
 	LDFLAGS="$LDFLAGS -L/usr/local/lib"
 #	enable_suid_ssh=no
-	cat >>confdefs.h <<\_ACEOF
+	cat >>confdefs.h <<\EOF
 #define USE_PIPES 1
-_ACEOF
+EOF
 
 	;;
 *-*-sysv*)
@@ -3791,40 +3608,40 @@
 	rsh_path="/usr/bin/rcmd"
 	RANLIB=true
 	no_dev_ptmx=1
-	cat >>confdefs.h <<\_ACEOF
+	cat >>confdefs.h <<\EOF
 #define BROKEN_SYS_TERMIO_H 1
-_ACEOF
+EOF
 
-	cat >>confdefs.h <<\_ACEOF
+	cat >>confdefs.h <<\EOF
 #define USE_PIPES 1
-_ACEOF
+EOF
 
-	cat >>confdefs.h <<\_ACEOF
+	cat >>confdefs.h <<\EOF
 #define HAVE_SCO_PROTECTED_PW 1
-_ACEOF
+EOF
 
-	cat >>confdefs.h <<\_ACEOF
+	cat >>confdefs.h <<\EOF
 #define DISABLE_SHADOW 1
-_ACEOF
+EOF
 
-	cat >>confdefs.h <<\_ACEOF
+	cat >>confdefs.h <<\EOF
 #define HAVE_BOGUS_SYS_QUEUE_H 1
-_ACEOF
+EOF
 
-	cat >>confdefs.h <<\_ACEOF
+	cat >>confdefs.h <<\EOF
 #define BROKEN_SAVED_UIDS 1
-_ACEOF
+EOF
 
 for ac_func in getluid setluid
 do
 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-echo "$as_me:3821: checking for $ac_func" >&5
+echo "$as_me:3638: checking for $ac_func" >&5
 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
 if eval "test \"\${$as_ac_var+set}\" = set"; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line 3827 "configure"
+#line 3644 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func (); below.  */
@@ -3838,12 +3655,6 @@
 char $ac_func ();
 char (*f) ();
 
-#ifdef F77_DUMMY_MAIN
-#  ifdef __cplusplus
-     extern "C"
-#  endif
-   int F77_DUMMY_MAIN() { return 1; }
-#endif
 int
 main ()
 {
@@ -3861,16 +3672,16 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:3864: \"$ac_link\"") >&5
+if { (eval echo "$as_me:3675: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:3867: \$? = $ac_status" >&5
+  echo "$as_me:3678: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:3870: \"$ac_try\"") >&5
+  { (eval echo "$as_me:3681: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:3873: \$? = $ac_status" >&5
+  echo "$as_me:3684: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   eval "$as_ac_var=yes"
 else
@@ -3880,12 +3691,12 @@
 fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:3883: result: `eval echo '${'$as_ac_var'}'`" >&5
+echo "$as_me:3694: result: `eval echo '${'$as_ac_var'}'`" >&5
 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
 if test `eval echo '${'$as_ac_var'}'` = yes; then
-  cat >>confdefs.h <<_ACEOF
+  cat >>confdefs.h <<EOF
 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
-_ACEOF
+EOF
 
 fi
 done
@@ -3899,32 +3710,32 @@
 	LIBS="$LIBS -lprot -lx -ltinfo -lm"
 	no_dev_ptmx=1
 	rsh_path="/usr/bin/rcmd"
-	cat >>confdefs.h <<\_ACEOF
+	cat >>confdefs.h <<\EOF
 #define USE_PIPES 1
-_ACEOF
+EOF
 
-	cat >>confdefs.h <<\_ACEOF
+	cat >>confdefs.h <<\EOF
 #define HAVE_SCO_PROTECTED_PW 1
-_ACEOF
+EOF
 
-	cat >>confdefs.h <<\_ACEOF
+	cat >>confdefs.h <<\EOF
 #define DISABLE_SHADOW 1
-_ACEOF
+EOF
 
-	cat >>confdefs.h <<\_ACEOF
+	cat >>confdefs.h <<\EOF
 #define HAVE_BOGUS_SYS_QUEUE_H 1
-_ACEOF
+EOF
 
 for ac_func in getluid setluid
 do
 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-echo "$as_me:3921: checking for $ac_func" >&5
+echo "$as_me:3732: checking for $ac_func" >&5
 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
 if eval "test \"\${$as_ac_var+set}\" = set"; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line 3927 "configure"
+#line 3738 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func (); below.  */
@@ -3938,12 +3749,6 @@
 char $ac_func ();
 char (*f) ();
 
-#ifdef F77_DUMMY_MAIN
-#  ifdef __cplusplus
-     extern "C"
-#  endif
-   int F77_DUMMY_MAIN() { return 1; }
-#endif
 int
 main ()
 {
@@ -3961,16 +3766,16 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:3964: \"$ac_link\"") >&5
+if { (eval echo "$as_me:3769: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:3967: \$? = $ac_status" >&5
+  echo "$as_me:3772: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:3970: \"$ac_try\"") >&5
+  { (eval echo "$as_me:3775: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:3973: \$? = $ac_status" >&5
+  echo "$as_me:3778: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   eval "$as_ac_var=yes"
 else
@@ -3980,12 +3785,12 @@
 fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:3983: result: `eval echo '${'$as_ac_var'}'`" >&5
+echo "$as_me:3788: result: `eval echo '${'$as_ac_var'}'`" >&5
 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
 if test `eval echo '${'$as_ac_var'}'` = yes; then
-  cat >>confdefs.h <<_ACEOF
+  cat >>confdefs.h <<EOF
 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
-_ACEOF
+EOF
 
 fi
 done
@@ -3995,15 +3800,15 @@
 *-*-unicos*)
 	no_libsocket=1
 	no_libnsl=1
-	cat >>confdefs.h <<\_ACEOF
+	cat >>confdefs.h <<\EOF
 #define USE_PIPES 1
-_ACEOF
+EOF
 
 	LDFLAGS="$LDFLAGS -Wl,-Dmsglevel=334:fatal,-L/usr/local/lib"
 	LIBS="$LIBS -lgen -lrsc"
 	;;
 *-dec-osf*)
-	echo "$as_me:4006: checking for Digital Unix SIA" >&5
+	echo "$as_me:3811: checking for Digital Unix SIA" >&5
 echo $ECHO_N "checking for Digital Unix SIA... $ECHO_C" >&6
 	no_osfsia=""
 
@@ -4012,7 +3817,7 @@
   withval="$with_osfsia"
 
 			if test "x$withval" = "xno" ; then
-				echo "$as_me:4015: result: disabled" >&5
+				echo "$as_me:3820: result: disabled" >&5
 echo "${ECHO_T}disabled" >&6
 				no_osfsia=1
 			fi
@@ -4020,44 +3825,44 @@
 fi;
 	if test -z "$no_osfsia" ; then
 		if test -f /etc/sia/matrix.conf; then
-			echo "$as_me:4023: result: yes" >&5
+			echo "$as_me:3828: result: yes" >&5
 echo "${ECHO_T}yes" >&6
-			cat >>confdefs.h <<\_ACEOF
+			cat >>confdefs.h <<\EOF
 #define HAVE_OSF_SIA 1
-_ACEOF
+EOF
 
-			cat >>confdefs.h <<\_ACEOF
+			cat >>confdefs.h <<\EOF
 #define DISABLE_LOGIN 1
-_ACEOF
+EOF
 
 			LIBS="$LIBS -lsecurity -ldb -lm -laud"
 		else
-			echo "$as_me:4035: result: no" >&5
+			echo "$as_me:3840: result: no" >&5
 echo "${ECHO_T}no" >&6
 		fi
 	fi
 	;;
 
 *-*-nto-qnx)
-	cat >>confdefs.h <<\_ACEOF
+	cat >>confdefs.h <<\EOF
 #define USE_PIPES 1
-_ACEOF
+EOF
 
-	cat >>confdefs.h <<\_ACEOF
+	cat >>confdefs.h <<\EOF
 #define NO_X11_UNIX_SOCKETS 1
-_ACEOF
+EOF
 
-	cat >>confdefs.h <<\_ACEOF
+	cat >>confdefs.h <<\EOF
 #define MISSING_NFDBITS 1
-_ACEOF
+EOF
 
-	cat >>confdefs.h <<\_ACEOF
+	cat >>confdefs.h <<\EOF
 #define MISSING_HOWMANY 1
-_ACEOF
+EOF
 
-	cat >>confdefs.h <<\_ACEOF
+	cat >>confdefs.h <<\EOF
 #define MISSING_FD_MASK 1
-_ACEOF
+EOF
 
 	;;
 esac
@@ -4106,27 +3911,35 @@
 
 # Checks for header files.
 
-echo "$as_me:4109: checking for ANSI C header files" >&5
-echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
-if test "${ac_cv_header_stdc+set}" = set; then
+for ac_header in bstring.h crypt.h endian.h floatingpoint.h \
+	getopt.h glob.h lastlog.h limits.h login.h \
+	login_cap.h maillock.h netdb.h netgroup.h \
+	netinet/in_systm.h paths.h poll.h pty.h \
+	security/pam_appl.h shadow.h stddef.h stdint.h \
+	strings.h sys/bitypes.h sys/bsdtty.h sys/cdefs.h \
+	sys/poll.h sys/queue.h sys/select.h sys/stat.h \
+	sys/stropts.h sys/sysmacros.h sys/time.h \
+	sys/ttcompat.h sys/un.h time.h ttyent.h usersec.h \
+	util.h utime.h utmp.h utmpx.h
+do
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+echo "$as_me:3926: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line 4115 "configure"
+#line 3932 "configure"
 #include "confdefs.h"
-#include <stdlib.h>
-#include <stdarg.h>
-#include <string.h>
-#include <float.h>
-
+#include <$ac_header>
 _ACEOF
-if { (eval echo "$as_me:4123: \"$ac_cpp conftest.$ac_ext\"") >&5
+if { (eval echo "$as_me:3936: \"$ac_cpp conftest.$ac_ext\"") >&5
   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
   ac_status=$?
   egrep -v '^ *\+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:4129: \$? = $ac_status" >&5
+  echo "$as_me:3942: \$? = $ac_status" >&5
   (exit $ac_status); } >/dev/null; then
   if test -s conftest.err; then
     ac_cpp_err=$ac_c_preproc_warn_flag
@@ -4137,311 +3950,45 @@
   ac_cpp_err=yes
 fi
 if test -z "$ac_cpp_err"; then
-  ac_cv_header_stdc=yes
+  eval "$as_ac_Header=yes"
 else
   echo "$as_me: failed program was:" >&5
   cat conftest.$ac_ext >&5
-  ac_cv_header_stdc=no
+  eval "$as_ac_Header=no"
 fi
 rm -f conftest.err conftest.$ac_ext
-
-if test $ac_cv_header_stdc = yes; then
-  # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
-  cat >conftest.$ac_ext <<_ACEOF
-#line 4151 "configure"
-#include "confdefs.h"
-#include <string.h>
-
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  egrep "memchr" >/dev/null 2>&1; then
-  :
-else
-  ac_cv_header_stdc=no
-fi
-rm -f conftest*
-
-fi
-
-if test $ac_cv_header_stdc = yes; then
-  # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
-  cat >conftest.$ac_ext <<_ACEOF
-#line 4169 "configure"
-#include "confdefs.h"
-#include <stdlib.h>
-
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  egrep "free" >/dev/null 2>&1; then
-  :
-else
-  ac_cv_header_stdc=no
 fi
-rm -f conftest*
+echo "$as_me:3961: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+  cat >>confdefs.h <<EOF
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+EOF
 
 fi
+done
 
-if test $ac_cv_header_stdc = yes; then
-  # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
-  if test "$cross_compiling" = yes; then
-  :
+# Checks for libraries.
+echo "$as_me:3972: checking for yp_match" >&5
+echo $ECHO_N "checking for yp_match... $ECHO_C" >&6
+if test "${ac_cv_func_yp_match+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line 4190 "configure"
+#line 3978 "configure"
 #include "confdefs.h"
-#include <ctype.h>
-#if ((' ' & 0x0FF) == 0x020)
-# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
-# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
-#else
-# define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \
-                     || ('j' <= (c) && (c) <= 'r') \
-                     || ('s' <= (c) && (c) <= 'z'))
-# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char yp_match (); below.  */
+#include <assert.h>
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
 #endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char yp_match ();
+char (*f) ();
 
-#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
-int
-main ()
-{
-  int i;
-  for (i = 0; i < 256; i++)
-    if (XOR (islower (i), ISLOWER (i))
-        || toupper (i) != TOUPPER (i))
-      exit(2);
-  exit (0);
-}
-_ACEOF
-rm -f conftest$ac_exeext
-if { (eval echo "$as_me:4216: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
-  ac_status=$?
-  echo "$as_me:4219: \$? = $ac_status" >&5
-  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
-  { (eval echo "$as_me:4221: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:4224: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  :
-else
-  echo "$as_me: program exited with status $ac_status" >&5
-echo "$as_me: failed program was:" >&5
-cat conftest.$ac_ext >&5
-ac_cv_header_stdc=no
-fi
-rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
-fi
-fi
-fi
-echo "$as_me:4237: result: $ac_cv_header_stdc" >&5
-echo "${ECHO_T}$ac_cv_header_stdc" >&6
-if test $ac_cv_header_stdc = yes; then
-
-cat >>confdefs.h <<\_ACEOF
-#define STDC_HEADERS 1
-_ACEOF
-
-fi
-
-# On IRIX 5.3, sys/types and inttypes.h are conflicting.
-
-for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
-                  inttypes.h stdint.h unistd.h
-do
-as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
-echo "$as_me:4253: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
-#line 4259 "configure"
-#include "confdefs.h"
-$ac_includes_default
-
-#include <$ac_header>
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:4266: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
-  ac_status=$?
-  echo "$as_me:4269: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-         { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:4272: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:4275: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  eval "$as_ac_Header=yes"
-else
-  echo "$as_me: failed program was:" >&5
-cat conftest.$ac_ext >&5
-eval "$as_ac_Header=no"
-fi
-rm -f conftest.$ac_objext conftest.$ac_ext
-fi
-echo "$as_me:4285: result: `eval echo '${'$as_ac_Header'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
-if test `eval echo '${'$as_ac_Header'}'` = yes; then
-  cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-
-done
-
-for ac_header in bstring.h crypt.h endian.h floatingpoint.h \
-	getopt.h glob.h lastlog.h limits.h login.h \
-	login_cap.h maillock.h netdb.h netgroup.h \
-	netinet/in_systm.h paths.h poll.h pty.h \
-	security/pam_appl.h shadow.h stddef.h stdint.h \
-	strings.h sys/bitypes.h sys/bsdtty.h sys/cdefs.h \
-	sys/poll.h sys/queue.h sys/select.h sys/stat.h \
-	sys/stropts.h sys/sysmacros.h sys/time.h \
-	sys/ttcompat.h sys/un.h time.h ttyent.h usersec.h \
-	util.h utime.h utmp.h utmpx.h
-do
-as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
-  echo "$as_me:4309: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-fi
-echo "$as_me:4314: result: `eval echo '${'$as_ac_Header'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
-else
-  # Is the header compilable?
-echo "$as_me:4318: checking $ac_header usability" >&5
-echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
-cat >conftest.$ac_ext <<_ACEOF
-#line 4321 "configure"
-#include "confdefs.h"
-$ac_includes_default
-#include <$ac_header>
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:4327: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
-  ac_status=$?
-  echo "$as_me:4330: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-         { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:4333: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:4336: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_header_compiler=yes
-else
-  echo "$as_me: failed program was:" >&5
-cat conftest.$ac_ext >&5
-ac_header_compiler=no
-fi
-rm -f conftest.$ac_objext conftest.$ac_ext
-echo "$as_me:4345: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6
-
-# Is the header present?
-echo "$as_me:4349: checking $ac_header presence" >&5
-echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
-cat >conftest.$ac_ext <<_ACEOF
-#line 4352 "configure"
-#include "confdefs.h"
-#include <$ac_header>
-_ACEOF
-if { (eval echo "$as_me:4356: \"$ac_cpp conftest.$ac_ext\"") >&5
-  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
-  ac_status=$?
-  egrep -v '^ *\+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:4362: \$? = $ac_status" >&5
-  (exit $ac_status); } >/dev/null; then
-  if test -s conftest.err; then
-    ac_cpp_err=$ac_c_preproc_warn_flag
-  else
-    ac_cpp_err=
-  fi
-else
-  ac_cpp_err=yes
-fi
-if test -z "$ac_cpp_err"; then
-  ac_header_preproc=yes
-else
-  echo "$as_me: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  ac_header_preproc=no
-fi
-rm -f conftest.err conftest.$ac_ext
-echo "$as_me:4380: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6
-
-# So?  What about this header?
-case $ac_header_compiler:$ac_header_preproc in
-  yes:no )
-    { echo "$as_me:4386: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
-    { echo "$as_me:4388: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;};;
-  no:yes )
-    { echo "$as_me:4391: WARNING: $ac_header: present but cannot be compiled." >&5
-echo "$as_me: WARNING: $ac_header: present but cannot be compiled." >&2;}
-    { echo "$as_me:4393: WARNING: $ac_header: check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
-    { echo "$as_me:4395: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;};;
-esac
-echo "$as_me:4398: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  eval "$as_ac_Header=$ac_header_preproc"
-fi
-echo "$as_me:4405: result: `eval echo '${'$as_ac_Header'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
-
-fi
-if test `eval echo '${'$as_ac_Header'}'` = yes; then
-  cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-
-done
-
-# Checks for libraries.
-echo "$as_me:4419: checking for yp_match" >&5
-echo $ECHO_N "checking for yp_match... $ECHO_C" >&6
-if test "${ac_cv_func_yp_match+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
-#line 4425 "configure"
-#include "confdefs.h"
-/* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char yp_match (); below.  */
-#include <assert.h>
-/* Override any gcc2 internal prototype to avoid an error.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
-char yp_match ();
-char (*f) ();
-
-#ifdef F77_DUMMY_MAIN
-#  ifdef __cplusplus
-     extern "C"
-#  endif
-   int F77_DUMMY_MAIN() { return 1; }
-#endif
 int
 main ()
 {
@@ -4459,16 +4006,16 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:4462: \"$ac_link\"") >&5
+if { (eval echo "$as_me:4009: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:4465: \$? = $ac_status" >&5
+  echo "$as_me:4012: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:4468: \"$ac_try\"") >&5
+  { (eval echo "$as_me:4015: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:4471: \$? = $ac_status" >&5
+  echo "$as_me:4018: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_func_yp_match=yes
 else
@@ -4478,13 +4025,13 @@
 fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:4481: result: $ac_cv_func_yp_match" >&5
+echo "$as_me:4028: result: $ac_cv_func_yp_match" >&5
 echo "${ECHO_T}$ac_cv_func_yp_match" >&6
 if test $ac_cv_func_yp_match = yes; then
   :
 else
 
-echo "$as_me:4487: checking for yp_match in -lnsl" >&5
+echo "$as_me:4034: checking for yp_match in -lnsl" >&5
 echo $ECHO_N "checking for yp_match in -lnsl... $ECHO_C" >&6
 if test "${ac_cv_lib_nsl_yp_match+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -4492,7 +4039,7 @@
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-lnsl  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
-#line 4495 "configure"
+#line 4042 "configure"
 #include "confdefs.h"
 
 /* Override any gcc2 internal prototype to avoid an error.  */
@@ -4502,12 +4049,6 @@
 /* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
 char yp_match ();
-#ifdef F77_DUMMY_MAIN
-#  ifdef __cplusplus
-     extern "C"
-#  endif
-   int F77_DUMMY_MAIN() { return 1; }
-#endif
 int
 main ()
 {
@@ -4517,16 +4058,16 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:4520: \"$ac_link\"") >&5
+if { (eval echo "$as_me:4061: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:4523: \$? = $ac_status" >&5
+  echo "$as_me:4064: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:4526: \"$ac_try\"") >&5
+  { (eval echo "$as_me:4067: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:4529: \$? = $ac_status" >&5
+  echo "$as_me:4070: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_lib_nsl_yp_match=yes
 else
@@ -4537,12 +4078,12 @@
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-echo "$as_me:4540: result: $ac_cv_lib_nsl_yp_match" >&5
+echo "$as_me:4081: result: $ac_cv_lib_nsl_yp_match" >&5
 echo "${ECHO_T}$ac_cv_lib_nsl_yp_match" >&6
 if test $ac_cv_lib_nsl_yp_match = yes; then
-  cat >>confdefs.h <<_ACEOF
+  cat >>confdefs.h <<EOF
 #define HAVE_LIBNSL 1
-_ACEOF
+EOF
 
   LIBS="-lnsl $LIBS"
 
@@ -4550,13 +4091,13 @@
 
 fi
 
-echo "$as_me:4553: checking for setsockopt" >&5
+echo "$as_me:4094: checking for setsockopt" >&5
 echo $ECHO_N "checking for setsockopt... $ECHO_C" >&6
 if test "${ac_cv_func_setsockopt+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line 4559 "configure"
+#line 4100 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char setsockopt (); below.  */
@@ -4570,12 +4111,6 @@
 char setsockopt ();
 char (*f) ();
 
-#ifdef F77_DUMMY_MAIN
-#  ifdef __cplusplus
-     extern "C"
-#  endif
-   int F77_DUMMY_MAIN() { return 1; }
-#endif
 int
 main ()
 {
@@ -4593,16 +4128,16 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:4596: \"$ac_link\"") >&5
+if { (eval echo "$as_me:4131: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:4599: \$? = $ac_status" >&5
+  echo "$as_me:4134: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:4602: \"$ac_try\"") >&5
+  { (eval echo "$as_me:4137: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:4605: \$? = $ac_status" >&5
+  echo "$as_me:4140: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_func_setsockopt=yes
 else
@@ -4612,13 +4147,13 @@
 fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:4615: result: $ac_cv_func_setsockopt" >&5
+echo "$as_me:4150: result: $ac_cv_func_setsockopt" >&5
 echo "${ECHO_T}$ac_cv_func_setsockopt" >&6
 if test $ac_cv_func_setsockopt = yes; then
   :
 else
 
-echo "$as_me:4621: checking for setsockopt in -lsocket" >&5
+echo "$as_me:4156: checking for setsockopt in -lsocket" >&5
 echo $ECHO_N "checking for setsockopt in -lsocket... $ECHO_C" >&6
 if test "${ac_cv_lib_socket_setsockopt+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -4626,7 +4161,7 @@
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-lsocket  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
-#line 4629 "configure"
+#line 4164 "configure"
 #include "confdefs.h"
 
 /* Override any gcc2 internal prototype to avoid an error.  */
@@ -4636,12 +4171,6 @@
 /* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
 char setsockopt ();
-#ifdef F77_DUMMY_MAIN
-#  ifdef __cplusplus
-     extern "C"
-#  endif
-   int F77_DUMMY_MAIN() { return 1; }
-#endif
 int
 main ()
 {
@@ -4651,16 +4180,16 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:4654: \"$ac_link\"") >&5
+if { (eval echo "$as_me:4183: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:4657: \$? = $ac_status" >&5
+  echo "$as_me:4186: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:4660: \"$ac_try\"") >&5
+  { (eval echo "$as_me:4189: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:4663: \$? = $ac_status" >&5
+  echo "$as_me:4192: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_lib_socket_setsockopt=yes
 else
@@ -4671,12 +4200,12 @@
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-echo "$as_me:4674: result: $ac_cv_lib_socket_setsockopt" >&5
+echo "$as_me:4203: result: $ac_cv_lib_socket_setsockopt" >&5
 echo "${ECHO_T}$ac_cv_lib_socket_setsockopt" >&6
 if test $ac_cv_lib_socket_setsockopt = yes; then
-  cat >>confdefs.h <<_ACEOF
+  cat >>confdefs.h <<EOF
 #define HAVE_LIBSOCKET 1
-_ACEOF
+EOF
 
   LIBS="-lsocket $LIBS"
 
@@ -4686,7 +4215,7 @@
 
 if test "x$with_tcp_wrappers" != "xno" ; then
     if test "x$do_sco3_extra_lib_check" = "xyes" ; then
-	echo "$as_me:4689: checking for innetgr in -lrpc" >&5
+	echo "$as_me:4218: checking for innetgr in -lrpc" >&5
 echo $ECHO_N "checking for innetgr in -lrpc... $ECHO_C" >&6
 if test "${ac_cv_lib_rpc_innetgr+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -4694,7 +4223,7 @@
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-lrpc -lyp -lrpc $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
-#line 4697 "configure"
+#line 4226 "configure"
 #include "confdefs.h"
 
 /* Override any gcc2 internal prototype to avoid an error.  */
@@ -4704,12 +4233,6 @@
 /* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
 char innetgr ();
-#ifdef F77_DUMMY_MAIN
-#  ifdef __cplusplus
-     extern "C"
-#  endif
-   int F77_DUMMY_MAIN() { return 1; }
-#endif
 int
 main ()
 {
@@ -4719,16 +4242,16 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:4722: \"$ac_link\"") >&5
+if { (eval echo "$as_me:4245: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:4725: \$? = $ac_status" >&5
+  echo "$as_me:4248: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:4728: \"$ac_try\"") >&5
+  { (eval echo "$as_me:4251: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:4731: \$? = $ac_status" >&5
+  echo "$as_me:4254: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_lib_rpc_innetgr=yes
 else
@@ -4739,7 +4262,7 @@
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-echo "$as_me:4742: result: $ac_cv_lib_rpc_innetgr" >&5
+echo "$as_me:4265: result: $ac_cv_lib_rpc_innetgr" >&5
 echo "${ECHO_T}$ac_cv_lib_rpc_innetgr" >&6
 if test $ac_cv_lib_rpc_innetgr = yes; then
   LIBS="-lrpc -lyp -lrpc $LIBS"
@@ -4748,13 +4271,13 @@
     fi
 fi
 
-echo "$as_me:4751: checking for getspnam" >&5
+echo "$as_me:4274: checking for getspnam" >&5
 echo $ECHO_N "checking for getspnam... $ECHO_C" >&6
 if test "${ac_cv_func_getspnam+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line 4757 "configure"
+#line 4280 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char getspnam (); below.  */
@@ -4768,12 +4291,6 @@
 char getspnam ();
 char (*f) ();
 
-#ifdef F77_DUMMY_MAIN
-#  ifdef __cplusplus
-     extern "C"
-#  endif
-   int F77_DUMMY_MAIN() { return 1; }
-#endif
 int
 main ()
 {
@@ -4791,16 +4308,16 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:4794: \"$ac_link\"") >&5
+if { (eval echo "$as_me:4311: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:4797: \$? = $ac_status" >&5
+  echo "$as_me:4314: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:4800: \"$ac_try\"") >&5
+  { (eval echo "$as_me:4317: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:4803: \$? = $ac_status" >&5
+  echo "$as_me:4320: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_func_getspnam=yes
 else
@@ -4810,12 +4327,12 @@
 fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:4813: result: $ac_cv_func_getspnam" >&5
+echo "$as_me:4330: result: $ac_cv_func_getspnam" >&5
 echo "${ECHO_T}$ac_cv_func_getspnam" >&6
 if test $ac_cv_func_getspnam = yes; then
   :
 else
-  echo "$as_me:4818: checking for getspnam in -lgen" >&5
+  echo "$as_me:4335: checking for getspnam in -lgen" >&5
 echo $ECHO_N "checking for getspnam in -lgen... $ECHO_C" >&6
 if test "${ac_cv_lib_gen_getspnam+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -4823,7 +4340,7 @@
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-lgen  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
-#line 4826 "configure"
+#line 4343 "configure"
 #include "confdefs.h"
 
 /* Override any gcc2 internal prototype to avoid an error.  */
@@ -4833,12 +4350,6 @@
 /* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
 char getspnam ();
-#ifdef F77_DUMMY_MAIN
-#  ifdef __cplusplus
-     extern "C"
-#  endif
-   int F77_DUMMY_MAIN() { return 1; }
-#endif
 int
 main ()
 {
@@ -4848,16 +4359,16 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:4851: \"$ac_link\"") >&5
+if { (eval echo "$as_me:4362: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:4854: \$? = $ac_status" >&5
+  echo "$as_me:4365: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:4857: \"$ac_try\"") >&5
+  { (eval echo "$as_me:4368: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:4860: \$? = $ac_status" >&5
+  echo "$as_me:4371: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_lib_gen_getspnam=yes
 else
@@ -4868,7 +4379,7 @@
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-echo "$as_me:4871: result: $ac_cv_lib_gen_getspnam" >&5
+echo "$as_me:4382: result: $ac_cv_lib_gen_getspnam" >&5
 echo "${ECHO_T}$ac_cv_lib_gen_getspnam" >&6
 if test $ac_cv_lib_gen_getspnam = yes; then
   LIBS="$LIBS -lgen"
@@ -4894,7 +4405,7 @@
   withval="$with_zlib"
 
 		if test "x$withval" = "xno" ; then
-			{ { echo "$as_me:4897: error: *** zlib is required ***" >&5
+			{ { echo "$as_me:4408: error: *** zlib is required ***" >&5
 echo "$as_me: error: *** zlib is required ***" >&2;}
    { (exit 1); exit 1; }; }
 		fi
@@ -4919,7 +4430,7 @@
 
 fi;
 
-echo "$as_me:4922: checking for deflate in -lz" >&5
+echo "$as_me:4433: checking for deflate in -lz" >&5
 echo $ECHO_N "checking for deflate in -lz... $ECHO_C" >&6
 if test "${ac_cv_lib_z_deflate+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -4927,7 +4438,7 @@
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-lz  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
-#line 4930 "configure"
+#line 4441 "configure"
 #include "confdefs.h"
 
 /* Override any gcc2 internal prototype to avoid an error.  */
@@ -4937,12 +4448,6 @@
 /* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
 char deflate ();
-#ifdef F77_DUMMY_MAIN
-#  ifdef __cplusplus
-     extern "C"
-#  endif
-   int F77_DUMMY_MAIN() { return 1; }
-#endif
 int
 main ()
 {
@@ -4952,16 +4457,16 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:4955: \"$ac_link\"") >&5
+if { (eval echo "$as_me:4460: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:4958: \$? = $ac_status" >&5
+  echo "$as_me:4463: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:4961: \"$ac_try\"") >&5
+  { (eval echo "$as_me:4466: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:4964: \$? = $ac_status" >&5
+  echo "$as_me:4469: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_lib_z_deflate=yes
 else
@@ -4972,28 +4477,28 @@
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-echo "$as_me:4975: result: $ac_cv_lib_z_deflate" >&5
+echo "$as_me:4480: result: $ac_cv_lib_z_deflate" >&5
 echo "${ECHO_T}$ac_cv_lib_z_deflate" >&6
 if test $ac_cv_lib_z_deflate = yes; then
-  cat >>confdefs.h <<_ACEOF
+  cat >>confdefs.h <<EOF
 #define HAVE_LIBZ 1
-_ACEOF
+EOF
 
   LIBS="-lz $LIBS"
 
 else
-  { { echo "$as_me:4985: error: *** zlib missing - please install first or check config.log ***" >&5
+  { { echo "$as_me:4490: error: *** zlib missing - please install first or check config.log ***" >&5
 echo "$as_me: error: *** zlib missing - please install first or check config.log ***" >&2;}
    { (exit 1); exit 1; }; }
 fi
 
-echo "$as_me:4990: checking for strcasecmp" >&5
+echo "$as_me:4495: checking for strcasecmp" >&5
 echo $ECHO_N "checking for strcasecmp... $ECHO_C" >&6
 if test "${ac_cv_func_strcasecmp+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line 4996 "configure"
+#line 4501 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char strcasecmp (); below.  */
@@ -5007,12 +4512,6 @@
 char strcasecmp ();
 char (*f) ();
 
-#ifdef F77_DUMMY_MAIN
-#  ifdef __cplusplus
-     extern "C"
-#  endif
-   int F77_DUMMY_MAIN() { return 1; }
-#endif
 int
 main ()
 {
@@ -5030,16 +4529,16 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:5033: \"$ac_link\"") >&5
+if { (eval echo "$as_me:4532: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:5036: \$? = $ac_status" >&5
+  echo "$as_me:4535: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:5039: \"$ac_try\"") >&5
+  { (eval echo "$as_me:4538: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:5042: \$? = $ac_status" >&5
+  echo "$as_me:4541: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_func_strcasecmp=yes
 else
@@ -5049,12 +4548,12 @@
 fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:5052: result: $ac_cv_func_strcasecmp" >&5
+echo "$as_me:4551: result: $ac_cv_func_strcasecmp" >&5
 echo "${ECHO_T}$ac_cv_func_strcasecmp" >&6
 if test $ac_cv_func_strcasecmp = yes; then
   :
 else
-   echo "$as_me:5057: checking for strcasecmp in -lresolv" >&5
+   echo "$as_me:4556: checking for strcasecmp in -lresolv" >&5
 echo $ECHO_N "checking for strcasecmp in -lresolv... $ECHO_C" >&6
 if test "${ac_cv_lib_resolv_strcasecmp+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -5062,7 +4561,7 @@
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-lresolv  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
-#line 5065 "configure"
+#line 4564 "configure"
 #include "confdefs.h"
 
 /* Override any gcc2 internal prototype to avoid an error.  */
@@ -5072,12 +4571,6 @@
 /* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
 char strcasecmp ();
-#ifdef F77_DUMMY_MAIN
-#  ifdef __cplusplus
-     extern "C"
-#  endif
-   int F77_DUMMY_MAIN() { return 1; }
-#endif
 int
 main ()
 {
@@ -5087,16 +4580,16 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:5090: \"$ac_link\"") >&5
+if { (eval echo "$as_me:4583: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:5093: \$? = $ac_status" >&5
+  echo "$as_me:4586: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:5096: \"$ac_try\"") >&5
+  { (eval echo "$as_me:4589: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:5099: \$? = $ac_status" >&5
+  echo "$as_me:4592: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_lib_resolv_strcasecmp=yes
 else
@@ -5107,7 +4600,7 @@
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-echo "$as_me:5110: result: $ac_cv_lib_resolv_strcasecmp" >&5
+echo "$as_me:4603: result: $ac_cv_lib_resolv_strcasecmp" >&5
 echo "${ECHO_T}$ac_cv_lib_resolv_strcasecmp" >&6
 if test $ac_cv_lib_resolv_strcasecmp = yes; then
   LIBS="$LIBS -lresolv"
@@ -5115,13 +4608,13 @@
 
 fi
 
-echo "$as_me:5118: checking for utimes" >&5
+echo "$as_me:4611: checking for utimes" >&5
 echo $ECHO_N "checking for utimes... $ECHO_C" >&6
 if test "${ac_cv_func_utimes+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line 5124 "configure"
+#line 4617 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char utimes (); below.  */
@@ -5135,12 +4628,6 @@
 char utimes ();
 char (*f) ();
 
-#ifdef F77_DUMMY_MAIN
-#  ifdef __cplusplus
-     extern "C"
-#  endif
-   int F77_DUMMY_MAIN() { return 1; }
-#endif
 int
 main ()
 {
@@ -5158,16 +4645,16 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:5161: \"$ac_link\"") >&5
+if { (eval echo "$as_me:4648: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:5164: \$? = $ac_status" >&5
+  echo "$as_me:4651: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:5167: \"$ac_try\"") >&5
+  { (eval echo "$as_me:4654: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:5170: \$? = $ac_status" >&5
+  echo "$as_me:4657: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_func_utimes=yes
 else
@@ -5177,12 +4664,12 @@
 fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:5180: result: $ac_cv_func_utimes" >&5
+echo "$as_me:4667: result: $ac_cv_func_utimes" >&5
 echo "${ECHO_T}$ac_cv_func_utimes" >&6
 if test $ac_cv_func_utimes = yes; then
   :
 else
-   echo "$as_me:5185: checking for utimes in -lc89" >&5
+   echo "$as_me:4672: checking for utimes in -lc89" >&5
 echo $ECHO_N "checking for utimes in -lc89... $ECHO_C" >&6
 if test "${ac_cv_lib_c89_utimes+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -5190,7 +4677,7 @@
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-lc89  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
-#line 5193 "configure"
+#line 4680 "configure"
 #include "confdefs.h"
 
 /* Override any gcc2 internal prototype to avoid an error.  */
@@ -5200,12 +4687,6 @@
 /* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
 char utimes ();
-#ifdef F77_DUMMY_MAIN
-#  ifdef __cplusplus
-     extern "C"
-#  endif
-   int F77_DUMMY_MAIN() { return 1; }
-#endif
 int
 main ()
 {
@@ -5215,16 +4696,16 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:5218: \"$ac_link\"") >&5
+if { (eval echo "$as_me:4699: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:5221: \$? = $ac_status" >&5
+  echo "$as_me:4702: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:5224: \"$ac_try\"") >&5
+  { (eval echo "$as_me:4705: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:5227: \$? = $ac_status" >&5
+  echo "$as_me:4708: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_lib_c89_utimes=yes
 else
@@ -5235,7 +4716,7 @@
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-echo "$as_me:5238: result: $ac_cv_lib_c89_utimes" >&5
+echo "$as_me:4719: result: $ac_cv_lib_c89_utimes" >&5
 echo "${ECHO_T}$ac_cv_lib_c89_utimes" >&6
 if test $ac_cv_lib_c89_utimes = yes; then
   LIBS="$LIBS -lc89"
@@ -5246,61 +4727,23 @@
 for ac_header in libutil.h
 do
 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
-  echo "$as_me:5250: checking for $ac_header" >&5
+echo "$as_me:4730: checking for $ac_header" >&5
 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
 if eval "test \"\${$as_ac_Header+set}\" = set"; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
-fi
-echo "$as_me:5255: result: `eval echo '${'$as_ac_Header'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
-else
-  # Is the header compilable?
-echo "$as_me:5259: checking $ac_header usability" >&5
-echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
-cat >conftest.$ac_ext <<_ACEOF
-#line 5262 "configure"
-#include "confdefs.h"
-$ac_includes_default
-#include <$ac_header>
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:5268: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
-  ac_status=$?
-  echo "$as_me:5271: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-         { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:5274: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:5277: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_header_compiler=yes
 else
-  echo "$as_me: failed program was:" >&5
-cat conftest.$ac_ext >&5
-ac_header_compiler=no
-fi
-rm -f conftest.$ac_objext conftest.$ac_ext
-echo "$as_me:5286: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6
-
-# Is the header present?
-echo "$as_me:5290: checking $ac_header presence" >&5
-echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
-cat >conftest.$ac_ext <<_ACEOF
-#line 5293 "configure"
+  cat >conftest.$ac_ext <<_ACEOF
+#line 4736 "configure"
 #include "confdefs.h"
 #include <$ac_header>
 _ACEOF
-if { (eval echo "$as_me:5297: \"$ac_cpp conftest.$ac_ext\"") >&5
+if { (eval echo "$as_me:4740: \"$ac_cpp conftest.$ac_ext\"") >&5
   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
   ac_status=$?
   egrep -v '^ *\+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:5303: \$? = $ac_status" >&5
+  echo "$as_me:4746: \$? = $ac_status" >&5
   (exit $ac_status); } >/dev/null; then
   if test -s conftest.err; then
     ac_cpp_err=$ac_c_preproc_warn_flag
@@ -5311,52 +4754,25 @@
   ac_cpp_err=yes
 fi
 if test -z "$ac_cpp_err"; then
-  ac_header_preproc=yes
+  eval "$as_ac_Header=yes"
 else
   echo "$as_me: failed program was:" >&5
   cat conftest.$ac_ext >&5
-  ac_header_preproc=no
+  eval "$as_ac_Header=no"
 fi
 rm -f conftest.err conftest.$ac_ext
-echo "$as_me:5321: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6
-
-# So?  What about this header?
-case $ac_header_compiler:$ac_header_preproc in
-  yes:no )
-    { echo "$as_me:5327: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
-    { echo "$as_me:5329: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;};;
-  no:yes )
-    { echo "$as_me:5332: WARNING: $ac_header: present but cannot be compiled." >&5
-echo "$as_me: WARNING: $ac_header: present but cannot be compiled." >&2;}
-    { echo "$as_me:5334: WARNING: $ac_header: check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
-    { echo "$as_me:5336: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;};;
-esac
-echo "$as_me:5339: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  eval "$as_ac_Header=$ac_header_preproc"
 fi
-echo "$as_me:5346: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "$as_me:4765: result: `eval echo '${'$as_ac_Header'}'`" >&5
 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
-
-fi
 if test `eval echo '${'$as_ac_Header'}'` = yes; then
-  cat >>confdefs.h <<_ACEOF
+  cat >>confdefs.h <<EOF
 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
+EOF
 
 fi
-
 done
 
-echo "$as_me:5359: checking for library containing login" >&5
+echo "$as_me:4775: checking for library containing login" >&5
 echo $ECHO_N "checking for library containing login... $ECHO_C" >&6
 if test "${ac_cv_search_login+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -5364,7 +4780,7 @@
   ac_func_search_save_LIBS=$LIBS
 ac_cv_search_login=no
 cat >conftest.$ac_ext <<_ACEOF
-#line 5367 "configure"
+#line 4783 "configure"
 #include "confdefs.h"
 
 /* Override any gcc2 internal prototype to avoid an error.  */
@@ -5374,12 +4790,6 @@
 /* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
 char login ();
-#ifdef F77_DUMMY_MAIN
-#  ifdef __cplusplus
-     extern "C"
-#  endif
-   int F77_DUMMY_MAIN() { return 1; }
-#endif
 int
 main ()
 {
@@ -5389,16 +4799,16 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:5392: \"$ac_link\"") >&5
+if { (eval echo "$as_me:4802: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:5395: \$? = $ac_status" >&5
+  echo "$as_me:4805: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:5398: \"$ac_try\"") >&5
+  { (eval echo "$as_me:4808: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:5401: \$? = $ac_status" >&5
+  echo "$as_me:4811: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_search_login="none required"
 else
@@ -5410,7 +4820,7 @@
   for ac_lib in util bsd; do
     LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
     cat >conftest.$ac_ext <<_ACEOF
-#line 5413 "configure"
+#line 4823 "configure"
 #include "confdefs.h"
 
 /* Override any gcc2 internal prototype to avoid an error.  */
@@ -5420,12 +4830,6 @@
 /* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
 char login ();
-#ifdef F77_DUMMY_MAIN
-#  ifdef __cplusplus
-     extern "C"
-#  endif
-   int F77_DUMMY_MAIN() { return 1; }
-#endif
 int
 main ()
 {
@@ -5435,16 +4839,16 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:5438: \"$ac_link\"") >&5
+if { (eval echo "$as_me:4842: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:5441: \$? = $ac_status" >&5
+  echo "$as_me:4845: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:5444: \"$ac_try\"") >&5
+  { (eval echo "$as_me:4848: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:5447: \$? = $ac_status" >&5
+  echo "$as_me:4851: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_search_login="-l$ac_lib"
 break
@@ -5457,26 +4861,26 @@
 fi
 LIBS=$ac_func_search_save_LIBS
 fi
-echo "$as_me:5460: result: $ac_cv_search_login" >&5
+echo "$as_me:4864: result: $ac_cv_search_login" >&5
 echo "${ECHO_T}$ac_cv_search_login" >&6
 if test "$ac_cv_search_login" != no; then
   test "$ac_cv_search_login" = "none required" || LIBS="$ac_cv_search_login $LIBS"
-  cat >>confdefs.h <<\_ACEOF
+  cat >>confdefs.h <<\EOF
 #define HAVE_LOGIN 1
-_ACEOF
+EOF
 
 fi
 
 for ac_func in logout updwtmp logwtmp
 do
 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-echo "$as_me:5473: checking for $ac_func" >&5
+echo "$as_me:4877: checking for $ac_func" >&5
 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
 if eval "test \"\${$as_ac_var+set}\" = set"; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line 5479 "configure"
+#line 4883 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func (); below.  */
@@ -5490,12 +4894,6 @@
 char $ac_func ();
 char (*f) ();
 
-#ifdef F77_DUMMY_MAIN
-#  ifdef __cplusplus
-     extern "C"
-#  endif
-   int F77_DUMMY_MAIN() { return 1; }
-#endif
 int
 main ()
 {
@@ -5513,16 +4911,16 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:5516: \"$ac_link\"") >&5
+if { (eval echo "$as_me:4914: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:5519: \$? = $ac_status" >&5
+  echo "$as_me:4917: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:5522: \"$ac_try\"") >&5
+  { (eval echo "$as_me:4920: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:5525: \$? = $ac_status" >&5
+  echo "$as_me:4923: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   eval "$as_ac_var=yes"
 else
@@ -5532,12 +4930,12 @@
 fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:5535: result: `eval echo '${'$as_ac_var'}'`" >&5
+echo "$as_me:4933: result: `eval echo '${'$as_ac_var'}'`" >&5
 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
 if test `eval echo '${'$as_ac_var'}'` = yes; then
-  cat >>confdefs.h <<_ACEOF
+  cat >>confdefs.h <<EOF
 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
-_ACEOF
+EOF
 
 fi
 done
@@ -5545,13 +4943,13 @@
 for ac_func in strftime
 do
 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-echo "$as_me:5548: checking for $ac_func" >&5
+echo "$as_me:4946: checking for $ac_func" >&5
 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
 if eval "test \"\${$as_ac_var+set}\" = set"; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line 5554 "configure"
+#line 4952 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func (); below.  */
@@ -5565,12 +4963,6 @@
 char $ac_func ();
 char (*f) ();
 
-#ifdef F77_DUMMY_MAIN
-#  ifdef __cplusplus
-     extern "C"
-#  endif
-   int F77_DUMMY_MAIN() { return 1; }
-#endif
 int
 main ()
 {
@@ -5588,16 +4980,16 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:5591: \"$ac_link\"") >&5
+if { (eval echo "$as_me:4983: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:5594: \$? = $ac_status" >&5
+  echo "$as_me:4986: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:5597: \"$ac_try\"") >&5
+  { (eval echo "$as_me:4989: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:5600: \$? = $ac_status" >&5
+  echo "$as_me:4992: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   eval "$as_ac_var=yes"
 else
@@ -5607,16 +4999,16 @@
 fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:5610: result: `eval echo '${'$as_ac_var'}'`" >&5
+echo "$as_me:5002: result: `eval echo '${'$as_ac_var'}'`" >&5
 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
 if test `eval echo '${'$as_ac_var'}'` = yes; then
-  cat >>confdefs.h <<_ACEOF
+  cat >>confdefs.h <<EOF
 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
-_ACEOF
+EOF
 
 else
   # strftime is in -lintl on SCO UNIX.
-echo "$as_me:5619: checking for strftime in -lintl" >&5
+echo "$as_me:5011: checking for strftime in -lintl" >&5
 echo $ECHO_N "checking for strftime in -lintl... $ECHO_C" >&6
 if test "${ac_cv_lib_intl_strftime+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -5624,7 +5016,7 @@
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-lintl  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
-#line 5627 "configure"
+#line 5019 "configure"
 #include "confdefs.h"
 
 /* Override any gcc2 internal prototype to avoid an error.  */
@@ -5634,12 +5026,6 @@
 /* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
 char strftime ();
-#ifdef F77_DUMMY_MAIN
-#  ifdef __cplusplus
-     extern "C"
-#  endif
-   int F77_DUMMY_MAIN() { return 1; }
-#endif
 int
 main ()
 {
@@ -5649,16 +5035,16 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:5652: \"$ac_link\"") >&5
+if { (eval echo "$as_me:5038: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:5655: \$? = $ac_status" >&5
+  echo "$as_me:5041: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:5658: \"$ac_try\"") >&5
+  { (eval echo "$as_me:5044: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:5661: \$? = $ac_status" >&5
+  echo "$as_me:5047: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_lib_intl_strftime=yes
 else
@@ -5669,12 +5055,12 @@
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-echo "$as_me:5672: result: $ac_cv_lib_intl_strftime" >&5
+echo "$as_me:5058: result: $ac_cv_lib_intl_strftime" >&5
 echo "${ECHO_T}$ac_cv_lib_intl_strftime" >&6
 if test $ac_cv_lib_intl_strftime = yes; then
-  cat >>confdefs.h <<\_ACEOF
+  cat >>confdefs.h <<\EOF
 #define HAVE_STRFTIME 1
-_ACEOF
+EOF
 
 LIBS="-lintl $LIBS"
 fi
@@ -5683,10 +5069,10 @@
 done
 
 # Check for ALTDIRFUNC glob() extension
-echo "$as_me:5686: checking for GLOB_ALTDIRFUNC support" >&5
+echo "$as_me:5072: checking for GLOB_ALTDIRFUNC support" >&5
 echo $ECHO_N "checking for GLOB_ALTDIRFUNC support... $ECHO_C" >&6
 cat >conftest.$ac_ext <<_ACEOF
-#line 5689 "configure"
+#line 5075 "configure"
 #include "confdefs.h"
 
 		#include <glob.h>
@@ -5698,26 +5084,26 @@
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
   egrep "FOUNDIT" >/dev/null 2>&1; then
 
-		cat >>confdefs.h <<\_ACEOF
+		cat >>confdefs.h <<\EOF
 #define GLOB_HAS_ALTDIRFUNC 1
-_ACEOF
+EOF
 
-		echo "$as_me:5705: result: yes" >&5
+		echo "$as_me:5091: result: yes" >&5
 echo "${ECHO_T}yes" >&6
 
 else
 
-		echo "$as_me:5710: result: no" >&5
+		echo "$as_me:5096: result: no" >&5
 echo "${ECHO_T}no" >&6
 
 fi
 rm -f conftest*
 
 # Check for g.gl_matchc glob() extension
-echo "$as_me:5717: checking for gl_matchc field in glob_t" >&5
+echo "$as_me:5103: checking for gl_matchc field in glob_t" >&5
 echo $ECHO_N "checking for gl_matchc field in glob_t... $ECHO_C" >&6
 cat >conftest.$ac_ext <<_ACEOF
-#line 5720 "configure"
+#line 5106 "configure"
 #include "confdefs.h"
 
                 #include <glob.h>
@@ -5727,30 +5113,30 @@
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
   egrep "FOUNDIT" >/dev/null 2>&1; then
 
-                cat >>confdefs.h <<\_ACEOF
+                cat >>confdefs.h <<\EOF
 #define GLOB_HAS_GL_MATCHC 1
-_ACEOF
+EOF
 
-                echo "$as_me:5734: result: yes" >&5
+                echo "$as_me:5120: result: yes" >&5
 echo "${ECHO_T}yes" >&6
 
 else
 
-                echo "$as_me:5739: result: no" >&5
+                echo "$as_me:5125: result: no" >&5
 echo "${ECHO_T}no" >&6
 
 fi
 rm -f conftest*
 
-echo "$as_me:5745: checking whether struct dirent allocates space for d_name" >&5
+echo "$as_me:5131: checking whether struct dirent allocates space for d_name" >&5
 echo $ECHO_N "checking whether struct dirent allocates space for d_name... $ECHO_C" >&6
 if test "$cross_compiling" = yes; then
-  { { echo "$as_me:5748: error: cannot run test program while cross compiling" >&5
+  { { echo "$as_me:5134: error: cannot run test program while cross compiling" >&5
 echo "$as_me: error: cannot run test program while cross compiling" >&2;}
    { (exit 1); exit 1; }; }
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line 5753 "configure"
+#line 5139 "configure"
 #include "confdefs.h"
 
 #include <sys/types.h>
@@ -5759,63 +5145,202 @@
 
 _ACEOF
 rm -f conftest$ac_exeext
-if { (eval echo "$as_me:5762: \"$ac_link\"") >&5
+if { (eval echo "$as_me:5148: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:5765: \$? = $ac_status" >&5
+  echo "$as_me:5151: \$? = $ac_status" >&5
   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
-  { (eval echo "$as_me:5767: \"$ac_try\"") >&5
+  { (eval echo "$as_me:5153: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:5770: \$? = $ac_status" >&5
+  echo "$as_me:5156: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  echo "$as_me:5772: result: yes" >&5
+  echo "$as_me:5158: result: yes" >&5
 echo "${ECHO_T}yes" >&6
 else
   echo "$as_me: program exited with status $ac_status" >&5
 echo "$as_me: failed program was:" >&5
 cat conftest.$ac_ext >&5
 
-		echo "$as_me:5779: result: no" >&5
+		echo "$as_me:5165: result: no" >&5
 echo "${ECHO_T}no" >&6
-		cat >>confdefs.h <<\_ACEOF
+		cat >>confdefs.h <<\EOF
 #define BROKEN_ONE_BYTE_DIRENT_D_NAME 1
-_ACEOF
+EOF
 
 fi
 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
 fi
 
-# Check whether user wants S/Key support
-SKEY_MSG="no"
+# Check whether the user wants GSI (Globus) support
+gsi_path="no"
 
-# Check whether --with-skey or --without-skey was given.
-if test "${with_skey+set}" = set; then
-  withval="$with_skey"
+# Check whether --with-gsi or --without-gsi was given.
+if test "${with_gsi+set}" = set; then
+  withval="$with_gsi"
 
-		if test "x$withval" != "xno" ; then
+		gsi_path="$withval"
 
-			if test "x$withval" != "xyes" ; then
-				CPPFLAGS="$CPPFLAGS -I${withval}/include"
-				LDFLAGS="$LDFLAGS -L${withval}/lib"
-			fi
+fi;
 
-			cat >>confdefs.h <<\_ACEOF
-#define SKEY 1
-_ACEOF
+# Check whether --with-globus or --without-globus was given.
+if test "${with_globus+set}" = set; then
+  withval="$with_globus"
 
-			LIBS="-lskey $LIBS"
-			SKEY_MSG="yes"
+		gsi_path="$withval"
 
-			echo "$as_me:5810: checking for s/key support" >&5
-echo $ECHO_N "checking for s/key support... $ECHO_C" >&6
-			if test "$cross_compiling" = yes; then
-  { { echo "$as_me:5813: error: cannot run test program while cross compiling" >&5
-echo "$as_me: error: cannot run test program while cross compiling" >&2;}
-   { (exit 1); exit 1; }; }
-else
-  cat >conftest.$ac_ext <<_ACEOF
-#line 5818 "configure"
+fi;
+
+# Check whether the user has a Globus flavor type
+globus_flavor_type="no"
+
+# Check whether --with-globus-flavor or --without-globus-flavor was given.
+if test "${with_globus_flavor+set}" = set; then
+  withval="$with_globus_flavor"
+
+		globus_flavor_type="$withval"
+
+fi;
+
+if test "x$gsi_path" != "xno" ; then
+	# Globus GSSAPI configuration
+	cat >>confdefs.h <<\EOF
+#define GSSAPI 1
+EOF
+
+	cat >>confdefs.h <<\EOF
+#define GSI 1
+EOF
+
+	# Find GLOBUS/GSI installation Directory
+	echo "$as_me:5216: checking for Globus/GSI installation directory" >&5
+echo $ECHO_N "checking for Globus/GSI installation directory... $ECHO_C" >&6
+
+	globus_install_dir=$gsi_path
+
+	if test "x$globus_install_dir" = "xyes" ; then
+		if test -n "$GLOBUS_INSTALL_PATH" ; then
+			globus_install_dir=$GLOBUS_INSTALL_PATH
+		elif test -n "$GSI_INSTALL_PATH" ; then
+			globus_install_dir=$GSI_INSTALL_PATH
+		elif test -d /usr/local/globus ; then
+			globus_install_dir="/usr/local/globus"
+		elif test -d /usr/local/gsi ; then
+			globus_install_dir="/usr/local/gsi"
+		else
+			{ { echo "$as_me:5231: error: Cannot find Globus/GSI installation directory" >&5
+echo "$as_me: error: Cannot find Globus/GSI installation directory" >&2;}
+   { (exit 1); exit 1; }; }
+		fi
+	fi
+	echo "$as_me:5236: result: $globus_install_dir" >&5
+echo "${ECHO_T}$globus_install_dir" >&6
+
+	# Find GLOBUS/GSI development directory
+	echo "$as_me:5240: checking for Globus/GSI development directory" >&5
+echo $ECHO_N "checking for Globus/GSI development directory... $ECHO_C" >&6
+
+	if test -d ${globus_install_dir}/lib ; then
+		# Looks like a flat directory structure from configure/make
+		# and not globus-install or gsi-install
+		globus_dev_dir=$globus_install_dir
+
+	else
+		# Assume a true globus installation with architecture
+		# directories and run globus-development-path to find
+		# the development directory
+
+		# Set GLOBUS_INSTALL_PATH
+		GLOBUS_INSTALL_PATH=$globus_install_dir
+		export GLOBUS_INSTALL_PATH
+
+		dev_path_program=${globus_install_dir}/bin/globus-development-path
+
+		if test ! -x ${dev_path_program} ; then
+			{ { echo "$as_me:5260: error: Cannot find Globus/GSI installation directory: program ${dev_path_program} does not exist or is not executable" >&5
+echo "$as_me: error: Cannot find Globus/GSI installation directory: program ${dev_path_program} does not exist or is not executable" >&2;}
+   { (exit 1); exit 1; }; }
+		fi
+
+		globus_dev_dir=`${dev_path_program}`
+
+		if test -z "$globus_dev_dir" -o "X$globus_dev_dir" = "X<not found>" ; then
+				{ { echo "$as_me:5268: error: Cannot find Globus/GSI development directory" >&5
+echo "$as_me: error: Cannot find Globus/GSI development directory" >&2;}
+   { (exit 1); exit 1; }; }
+		fi
+
+		if test ! -d "$globus_dev_dir" ; then
+			{ { echo "$as_me:5274: error: Cannot find Globus/GSI development directory: $globus_dev_dir does not exist" >&5
+echo "$as_me: error: Cannot find Globus/GSI development directory: $globus_dev_dir does not exist" >&2;}
+   { (exit 1); exit 1; }; }
+		fi
+	fi
+	echo "$as_me:5279: result: $globus_dev_dir" >&5
+echo "${ECHO_T}$globus_dev_dir" >&6
+
+	# Find GLOBUS/GSI flavor Directory
+	echo "$as_me:5283: checking for Globus flavor type" >&5
+echo $ECHO_N "checking for Globus flavor type... $ECHO_C" >&6
+
+        if test "x$globus_flavor_type" = "xno" ; then
+		GSI_LIBS="-lglobus_gss_assist -lglobus_gss -lglobus_gaa"
+		GSI_LDFLAGS="-L${globus_dev_dir}/lib"
+		GSI_CFLAGS="-I${globus_dev_dir}/include"
+		echo "$as_me:5290: result: none" >&5
+echo "${ECHO_T}none" >&6
+	else
+                GLOBUS_FLAVOR_TYPE_INCL_DIR="${globus_dev_dir}/include/${globus_flavor_type}"
+
+		if test ! -d "$GLOBUS_FLAVOR_TYPE_INCL_DIR" ; then
+			{ { echo "$as_me:5296: error: Cannot find Globus flavor-specific include directory: ${GLOBUS_FLAVOR_TYPE_INCL_DIR}" >&5
+echo "$as_me: error: Cannot find Globus flavor-specific include directory: ${GLOBUS_FLAVOR_TYPE_INCL_DIR}" >&2;}
+   { (exit 1); exit 1; }; }
+                fi
+
+		echo "$as_me:5301: result: $globus_flavor_type" >&5
+echo "${ECHO_T}$globus_flavor_type" >&6
+		GSI_LIBS="-lglobus_gss_assist_${globus_flavor_type} -lglobus_gssapi_gsi_${globus_flavor_type}"
+		GSI_LDFLAGS="-L${globus_dev_dir}/lib"
+		GSI_CFLAGS="-I${GLOBUS_FLAVOR_TYPE_INCL_DIR}"
+	fi
+
+	LIBS="$LIBS $GSI_LIBS"
+	LDFLAGS="$LDFLAGS $GSI_LDFLAGS"
+	CFLAGS="$CFLAGS $GSI_CFLAGS"
+# End Globus/GSI section
+fi
+
+# Check whether user wants S/Key support
+SKEY_MSG="no"
+
+# Check whether --with-skey or --without-skey was given.
+if test "${with_skey+set}" = set; then
+  withval="$with_skey"
+
+		if test "x$withval" != "xno" ; then
+
+			if test "x$withval" != "xyes" ; then
+				CPPFLAGS="$CPPFLAGS -I${withval}/include"
+				LDFLAGS="$LDFLAGS -L${withval}/lib"
+			fi
+
+			cat >>confdefs.h <<\EOF
+#define SKEY 1
+EOF
+
+			LIBS="-lskey $LIBS"
+			SKEY_MSG="yes"
+
+			echo "$as_me:5335: checking for s/key support" >&5
+echo $ECHO_N "checking for s/key support... $ECHO_C" >&6
+			if test "$cross_compiling" = yes; then
+  { { echo "$as_me:5338: error: cannot run test program while cross compiling" >&5
+echo "$as_me: error: cannot run test program while cross compiling" >&2;}
+   { (exit 1); exit 1; }; }
+else
+  cat >conftest.$ac_ext <<_ACEOF
+#line 5343 "configure"
 #include "confdefs.h"
 
 #include <stdio.h>
@@ -5824,26 +5349,26 @@
 
 _ACEOF
 rm -f conftest$ac_exeext
-if { (eval echo "$as_me:5827: \"$ac_link\"") >&5
+if { (eval echo "$as_me:5352: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:5830: \$? = $ac_status" >&5
+  echo "$as_me:5355: \$? = $ac_status" >&5
   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
-  { (eval echo "$as_me:5832: \"$ac_try\"") >&5
+  { (eval echo "$as_me:5357: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:5835: \$? = $ac_status" >&5
+  echo "$as_me:5360: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  echo "$as_me:5837: result: yes" >&5
+  echo "$as_me:5362: result: yes" >&5
 echo "${ECHO_T}yes" >&6
 else
   echo "$as_me: program exited with status $ac_status" >&5
 echo "$as_me: failed program was:" >&5
 cat conftest.$ac_ext >&5
 
-					echo "$as_me:5844: result: no" >&5
+					echo "$as_me:5369: result: no" >&5
 echo "${ECHO_T}no" >&6
-					{ { echo "$as_me:5846: error: ** Incomplete or missing s/key libraries." >&5
+					{ { echo "$as_me:5371: error: ** Incomplete or missing s/key libraries." >&5
 echo "$as_me: error: ** Incomplete or missing s/key libraries." >&2;}
    { (exit 1); exit 1; }; }
 
@@ -5887,21 +5412,15 @@
 			fi
 			LIBWRAP="-lwrap"
 			LIBS="$LIBWRAP $LIBS"
-			echo "$as_me:5890: checking for libwrap" >&5
+			echo "$as_me:5415: checking for libwrap" >&5
 echo $ECHO_N "checking for libwrap... $ECHO_C" >&6
 			cat >conftest.$ac_ext <<_ACEOF
-#line 5893 "configure"
+#line 5418 "configure"
 #include "confdefs.h"
 
 #include <tcpd.h>
 					int deny_severity = 0, allow_severity = 0;
 
-#ifdef F77_DUMMY_MAIN
-#  ifdef __cplusplus
-     extern "C"
-#  endif
-   int F77_DUMMY_MAIN() { return 1; }
-#endif
 int
 main ()
 {
@@ -5911,23 +5430,23 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:5914: \"$ac_link\"") >&5
+if { (eval echo "$as_me:5433: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:5917: \$? = $ac_status" >&5
+  echo "$as_me:5436: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:5920: \"$ac_try\"") >&5
+  { (eval echo "$as_me:5439: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:5923: \$? = $ac_status" >&5
+  echo "$as_me:5442: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
 
-					echo "$as_me:5926: result: yes" >&5
+					echo "$as_me:5445: result: yes" >&5
 echo "${ECHO_T}yes" >&6
-					cat >>confdefs.h <<\_ACEOF
+					cat >>confdefs.h <<\EOF
 #define LIBWRAP 1
-_ACEOF
+EOF
 
 					TCPW_MSG="yes"
 
@@ -5935,7 +5454,7 @@
   echo "$as_me: failed program was:" >&5
 cat conftest.$ac_ext >&5
 
-					{ { echo "$as_me:5938: error: *** libwrap missing" >&5
+					{ { echo "$as_me:5457: error: *** libwrap missing" >&5
 echo "$as_me: error: *** libwrap missing" >&2;}
    { (exit 1); exit 1; }; }
 
@@ -5959,13 +5478,13 @@
 	vhangup vsnprintf waitpid __b64_ntop _getpty
 do
 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-echo "$as_me:5962: checking for $ac_func" >&5
+echo "$as_me:5481: checking for $ac_func" >&5
 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
 if eval "test \"\${$as_ac_var+set}\" = set"; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line 5968 "configure"
+#line 5487 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func (); below.  */
@@ -5979,12 +5498,6 @@
 char $ac_func ();
 char (*f) ();
 
-#ifdef F77_DUMMY_MAIN
-#  ifdef __cplusplus
-     extern "C"
-#  endif
-   int F77_DUMMY_MAIN() { return 1; }
-#endif
 int
 main ()
 {
@@ -6002,16 +5515,16 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:6005: \"$ac_link\"") >&5
+if { (eval echo "$as_me:5518: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:6008: \$? = $ac_status" >&5
+  echo "$as_me:5521: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:6011: \"$ac_try\"") >&5
+  { (eval echo "$as_me:5524: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:6014: \$? = $ac_status" >&5
+  echo "$as_me:5527: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   eval "$as_ac_var=yes"
 else
@@ -6021,12 +5534,12 @@
 fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:6024: result: `eval echo '${'$as_ac_var'}'`" >&5
+echo "$as_me:5537: result: `eval echo '${'$as_ac_var'}'`" >&5
 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
 if test `eval echo '${'$as_ac_var'}'` = yes; then
-  cat >>confdefs.h <<_ACEOF
+  cat >>confdefs.h <<EOF
 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
-_ACEOF
+EOF
 
 fi
 done
@@ -6034,13 +5547,13 @@
 for ac_func in dirname
 do
 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-echo "$as_me:6037: checking for $ac_func" >&5
+echo "$as_me:5550: checking for $ac_func" >&5
 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
 if eval "test \"\${$as_ac_var+set}\" = set"; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line 6043 "configure"
+#line 5556 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func (); below.  */
@@ -6054,12 +5567,6 @@
 char $ac_func ();
 char (*f) ();
 
-#ifdef F77_DUMMY_MAIN
-#  ifdef __cplusplus
-     extern "C"
-#  endif
-   int F77_DUMMY_MAIN() { return 1; }
-#endif
 int
 main ()
 {
@@ -6077,16 +5584,16 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:6080: \"$ac_link\"") >&5
+if { (eval echo "$as_me:5587: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:6083: \$? = $ac_status" >&5
+  echo "$as_me:5590: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:6086: \"$ac_try\"") >&5
+  { (eval echo "$as_me:5593: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:6089: \$? = $ac_status" >&5
+  echo "$as_me:5596: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   eval "$as_ac_var=yes"
 else
@@ -6096,71 +5603,33 @@
 fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:6099: result: `eval echo '${'$as_ac_var'}'`" >&5
+echo "$as_me:5606: result: `eval echo '${'$as_ac_var'}'`" >&5
 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
 if test `eval echo '${'$as_ac_var'}'` = yes; then
-  cat >>confdefs.h <<_ACEOF
+  cat >>confdefs.h <<EOF
 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
-_ACEOF
+EOF
 
 for ac_header in libgen.h
 do
 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
-  echo "$as_me:6110: checking for $ac_header" >&5
+echo "$as_me:5616: checking for $ac_header" >&5
 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
 if eval "test \"\${$as_ac_Header+set}\" = set"; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
-fi
-echo "$as_me:6115: result: `eval echo '${'$as_ac_Header'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
-else
-  # Is the header compilable?
-echo "$as_me:6119: checking $ac_header usability" >&5
-echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
-cat >conftest.$ac_ext <<_ACEOF
-#line 6122 "configure"
-#include "confdefs.h"
-$ac_includes_default
-#include <$ac_header>
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:6128: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
-  ac_status=$?
-  echo "$as_me:6131: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-         { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:6134: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:6137: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_header_compiler=yes
 else
-  echo "$as_me: failed program was:" >&5
-cat conftest.$ac_ext >&5
-ac_header_compiler=no
-fi
-rm -f conftest.$ac_objext conftest.$ac_ext
-echo "$as_me:6146: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6
-
-# Is the header present?
-echo "$as_me:6150: checking $ac_header presence" >&5
-echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
-cat >conftest.$ac_ext <<_ACEOF
-#line 6153 "configure"
+  cat >conftest.$ac_ext <<_ACEOF
+#line 5622 "configure"
 #include "confdefs.h"
 #include <$ac_header>
 _ACEOF
-if { (eval echo "$as_me:6157: \"$ac_cpp conftest.$ac_ext\"") >&5
+if { (eval echo "$as_me:5626: \"$ac_cpp conftest.$ac_ext\"") >&5
   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
   ac_status=$?
   egrep -v '^ *\+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:6163: \$? = $ac_status" >&5
+  echo "$as_me:5632: \$? = $ac_status" >&5
   (exit $ac_status); } >/dev/null; then
   if test -s conftest.err; then
     ac_cpp_err=$ac_c_preproc_warn_flag
@@ -6171,54 +5640,27 @@
   ac_cpp_err=yes
 fi
 if test -z "$ac_cpp_err"; then
-  ac_header_preproc=yes
+  eval "$as_ac_Header=yes"
 else
   echo "$as_me: failed program was:" >&5
   cat conftest.$ac_ext >&5
-  ac_header_preproc=no
+  eval "$as_ac_Header=no"
 fi
 rm -f conftest.err conftest.$ac_ext
-echo "$as_me:6181: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6
-
-# So?  What about this header?
-case $ac_header_compiler:$ac_header_preproc in
-  yes:no )
-    { echo "$as_me:6187: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
-    { echo "$as_me:6189: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;};;
-  no:yes )
-    { echo "$as_me:6192: WARNING: $ac_header: present but cannot be compiled." >&5
-echo "$as_me: WARNING: $ac_header: present but cannot be compiled." >&2;}
-    { echo "$as_me:6194: WARNING: $ac_header: check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
-    { echo "$as_me:6196: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;};;
-esac
-echo "$as_me:6199: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  eval "$as_ac_Header=$ac_header_preproc"
 fi
-echo "$as_me:6206: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "$as_me:5651: result: `eval echo '${'$as_ac_Header'}'`" >&5
 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
-
-fi
 if test `eval echo '${'$as_ac_Header'}'` = yes; then
-  cat >>confdefs.h <<_ACEOF
+  cat >>confdefs.h <<EOF
 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
+EOF
 
 fi
-
 done
 
 else
 
-	echo "$as_me:6221: checking for dirname in -lgen" >&5
+	echo "$as_me:5663: checking for dirname in -lgen" >&5
 echo $ECHO_N "checking for dirname in -lgen... $ECHO_C" >&6
 if test "${ac_cv_lib_gen_dirname+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -6226,7 +5668,7 @@
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-lgen  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
-#line 6229 "configure"
+#line 5671 "configure"
 #include "confdefs.h"
 
 /* Override any gcc2 internal prototype to avoid an error.  */
@@ -6236,12 +5678,6 @@
 /* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
 char dirname ();
-#ifdef F77_DUMMY_MAIN
-#  ifdef __cplusplus
-     extern "C"
-#  endif
-   int F77_DUMMY_MAIN() { return 1; }
-#endif
 int
 main ()
 {
@@ -6251,16 +5687,16 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:6254: \"$ac_link\"") >&5
+if { (eval echo "$as_me:5690: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:6257: \$? = $ac_status" >&5
+  echo "$as_me:5693: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:6260: \"$ac_try\"") >&5
+  { (eval echo "$as_me:5696: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:6263: \$? = $ac_status" >&5
+  echo "$as_me:5699: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_lib_gen_dirname=yes
 else
@@ -6271,11 +5707,11 @@
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-echo "$as_me:6274: result: $ac_cv_lib_gen_dirname" >&5
+echo "$as_me:5710: result: $ac_cv_lib_gen_dirname" >&5
 echo "${ECHO_T}$ac_cv_lib_gen_dirname" >&6
 if test $ac_cv_lib_gen_dirname = yes; then
 
-		echo "$as_me:6278: checking for broken dirname" >&5
+		echo "$as_me:5714: checking for broken dirname" >&5
 echo $ECHO_N "checking for broken dirname... $ECHO_C" >&6
 if test "${ac_cv_have_broken_dirname+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -6284,12 +5720,12 @@
 			save_LIBS="$LIBS"
 			LIBS="$LIBS -lgen"
 			if test "$cross_compiling" = yes; then
-  { { echo "$as_me:6287: error: cannot run test program while cross compiling" >&5
+  { { echo "$as_me:5723: error: cannot run test program while cross compiling" >&5
 echo "$as_me: error: cannot run test program while cross compiling" >&2;}
    { (exit 1); exit 1; }; }
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line 6292 "configure"
+#line 5728 "configure"
 #include "confdefs.h"
 
 #include <libgen.h>
@@ -6309,15 +5745,15 @@
 
 _ACEOF
 rm -f conftest$ac_exeext
-if { (eval echo "$as_me:6312: \"$ac_link\"") >&5
+if { (eval echo "$as_me:5748: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:6315: \$? = $ac_status" >&5
+  echo "$as_me:5751: \$? = $ac_status" >&5
   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
-  { (eval echo "$as_me:6317: \"$ac_try\"") >&5
+  { (eval echo "$as_me:5753: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:6320: \$? = $ac_status" >&5
+  echo "$as_me:5756: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
    ac_cv_have_broken_dirname="no"
 else
@@ -6332,72 +5768,34 @@
 			LIBS="$save_LIBS"
 
 fi
-echo "$as_me:6335: result: $ac_cv_have_broken_dirname" >&5
+echo "$as_me:5771: result: $ac_cv_have_broken_dirname" >&5
 echo "${ECHO_T}$ac_cv_have_broken_dirname" >&6
 		if test "x$ac_cv_have_broken_dirname" = "xno" ; then
 			LIBS="$LIBS -lgen"
-			cat >>confdefs.h <<\_ACEOF
+			cat >>confdefs.h <<\EOF
 #define HAVE_DIRNAME 1
-_ACEOF
+EOF
 
 for ac_header in libgen.h
 do
 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
-  echo "$as_me:6347: checking for $ac_header" >&5
+echo "$as_me:5782: checking for $ac_header" >&5
 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
 if eval "test \"\${$as_ac_Header+set}\" = set"; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
-fi
-echo "$as_me:6352: result: `eval echo '${'$as_ac_Header'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
-else
-  # Is the header compilable?
-echo "$as_me:6356: checking $ac_header usability" >&5
-echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
-cat >conftest.$ac_ext <<_ACEOF
-#line 6359 "configure"
-#include "confdefs.h"
-$ac_includes_default
-#include <$ac_header>
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:6365: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
-  ac_status=$?
-  echo "$as_me:6368: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-         { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:6371: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:6374: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_header_compiler=yes
 else
-  echo "$as_me: failed program was:" >&5
-cat conftest.$ac_ext >&5
-ac_header_compiler=no
-fi
-rm -f conftest.$ac_objext conftest.$ac_ext
-echo "$as_me:6383: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6
-
-# Is the header present?
-echo "$as_me:6387: checking $ac_header presence" >&5
-echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
-cat >conftest.$ac_ext <<_ACEOF
-#line 6390 "configure"
+  cat >conftest.$ac_ext <<_ACEOF
+#line 5788 "configure"
 #include "confdefs.h"
 #include <$ac_header>
 _ACEOF
-if { (eval echo "$as_me:6394: \"$ac_cpp conftest.$ac_ext\"") >&5
+if { (eval echo "$as_me:5792: \"$ac_cpp conftest.$ac_ext\"") >&5
   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
   ac_status=$?
   egrep -v '^ *\+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:6400: \$? = $ac_status" >&5
+  echo "$as_me:5798: \$? = $ac_status" >&5
   (exit $ac_status); } >/dev/null; then
   if test -s conftest.err; then
     ac_cpp_err=$ac_c_preproc_warn_flag
@@ -6408,49 +5806,22 @@
   ac_cpp_err=yes
 fi
 if test -z "$ac_cpp_err"; then
-  ac_header_preproc=yes
+  eval "$as_ac_Header=yes"
 else
   echo "$as_me: failed program was:" >&5
   cat conftest.$ac_ext >&5
-  ac_header_preproc=no
+  eval "$as_ac_Header=no"
 fi
 rm -f conftest.err conftest.$ac_ext
-echo "$as_me:6418: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6
-
-# So?  What about this header?
-case $ac_header_compiler:$ac_header_preproc in
-  yes:no )
-    { echo "$as_me:6424: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
-    { echo "$as_me:6426: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;};;
-  no:yes )
-    { echo "$as_me:6429: WARNING: $ac_header: present but cannot be compiled." >&5
-echo "$as_me: WARNING: $ac_header: present but cannot be compiled." >&2;}
-    { echo "$as_me:6431: WARNING: $ac_header: check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
-    { echo "$as_me:6433: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;};;
-esac
-echo "$as_me:6436: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  eval "$as_ac_Header=$ac_header_preproc"
 fi
-echo "$as_me:6443: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "$as_me:5817: result: `eval echo '${'$as_ac_Header'}'`" >&5
 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
-
-fi
 if test `eval echo '${'$as_ac_Header'}'` = yes; then
-  cat >>confdefs.h <<_ACEOF
+  cat >>confdefs.h <<EOF
 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
+EOF
 
 fi
-
 done
 
 		fi
@@ -6463,13 +5834,13 @@
 for ac_func in gettimeofday time
 do
 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-echo "$as_me:6466: checking for $ac_func" >&5
+echo "$as_me:5837: checking for $ac_func" >&5
 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
 if eval "test \"\${$as_ac_var+set}\" = set"; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line 6472 "configure"
+#line 5843 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func (); below.  */
@@ -6483,12 +5854,6 @@
 char $ac_func ();
 char (*f) ();
 
-#ifdef F77_DUMMY_MAIN
-#  ifdef __cplusplus
-     extern "C"
-#  endif
-   int F77_DUMMY_MAIN() { return 1; }
-#endif
 int
 main ()
 {
@@ -6506,16 +5871,16 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:6509: \"$ac_link\"") >&5
+if { (eval echo "$as_me:5874: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:6512: \$? = $ac_status" >&5
+  echo "$as_me:5877: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:6515: \"$ac_try\"") >&5
+  { (eval echo "$as_me:5880: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:6518: \$? = $ac_status" >&5
+  echo "$as_me:5883: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   eval "$as_ac_var=yes"
 else
@@ -6525,12 +5890,12 @@
 fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:6528: result: `eval echo '${'$as_ac_var'}'`" >&5
+echo "$as_me:5893: result: `eval echo '${'$as_ac_var'}'`" >&5
 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
 if test `eval echo '${'$as_ac_var'}'` = yes; then
-  cat >>confdefs.h <<_ACEOF
+  cat >>confdefs.h <<EOF
 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
-_ACEOF
+EOF
 
 fi
 done
@@ -6538,13 +5903,13 @@
 for ac_func in endutent getutent getutid getutline pututline setutent
 do
 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-echo "$as_me:6541: checking for $ac_func" >&5
+echo "$as_me:5906: checking for $ac_func" >&5
 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
 if eval "test \"\${$as_ac_var+set}\" = set"; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line 6547 "configure"
+#line 5912 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func (); below.  */
@@ -6558,12 +5923,6 @@
 char $ac_func ();
 char (*f) ();
 
-#ifdef F77_DUMMY_MAIN
-#  ifdef __cplusplus
-     extern "C"
-#  endif
-   int F77_DUMMY_MAIN() { return 1; }
-#endif
 int
 main ()
 {
@@ -6581,16 +5940,16 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:6584: \"$ac_link\"") >&5
+if { (eval echo "$as_me:5943: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:6587: \$? = $ac_status" >&5
+  echo "$as_me:5946: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:6590: \"$ac_try\"") >&5
+  { (eval echo "$as_me:5949: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:6593: \$? = $ac_status" >&5
+  echo "$as_me:5952: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   eval "$as_ac_var=yes"
 else
@@ -6600,12 +5959,12 @@
 fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:6603: result: `eval echo '${'$as_ac_var'}'`" >&5
+echo "$as_me:5962: result: `eval echo '${'$as_ac_var'}'`" >&5
 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
 if test `eval echo '${'$as_ac_var'}'` = yes; then
-  cat >>confdefs.h <<_ACEOF
+  cat >>confdefs.h <<EOF
 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
-_ACEOF
+EOF
 
 fi
 done
@@ -6613,13 +5972,13 @@
 for ac_func in utmpname
 do
 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-echo "$as_me:6616: checking for $ac_func" >&5
+echo "$as_me:5975: checking for $ac_func" >&5
 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
 if eval "test \"\${$as_ac_var+set}\" = set"; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line 6622 "configure"
+#line 5981 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func (); below.  */
@@ -6633,12 +5992,6 @@
 char $ac_func ();
 char (*f) ();
 
-#ifdef F77_DUMMY_MAIN
-#  ifdef __cplusplus
-     extern "C"
-#  endif
-   int F77_DUMMY_MAIN() { return 1; }
-#endif
 int
 main ()
 {
@@ -6656,16 +6009,16 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:6659: \"$ac_link\"") >&5
+if { (eval echo "$as_me:6012: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:6662: \$? = $ac_status" >&5
+  echo "$as_me:6015: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:6665: \"$ac_try\"") >&5
+  { (eval echo "$as_me:6018: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:6668: \$? = $ac_status" >&5
+  echo "$as_me:6021: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   eval "$as_ac_var=yes"
 else
@@ -6675,12 +6028,12 @@
 fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:6678: result: `eval echo '${'$as_ac_var'}'`" >&5
+echo "$as_me:6031: result: `eval echo '${'$as_ac_var'}'`" >&5
 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
 if test `eval echo '${'$as_ac_var'}'` = yes; then
-  cat >>confdefs.h <<_ACEOF
+  cat >>confdefs.h <<EOF
 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
-_ACEOF
+EOF
 
 fi
 done
@@ -6688,13 +6041,13 @@
 for ac_func in endutxent getutxent getutxid getutxline pututxline
 do
 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-echo "$as_me:6691: checking for $ac_func" >&5
+echo "$as_me:6044: checking for $ac_func" >&5
 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
 if eval "test \"\${$as_ac_var+set}\" = set"; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line 6697 "configure"
+#line 6050 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func (); below.  */
@@ -6708,12 +6061,6 @@
 char $ac_func ();
 char (*f) ();
 
-#ifdef F77_DUMMY_MAIN
-#  ifdef __cplusplus
-     extern "C"
-#  endif
-   int F77_DUMMY_MAIN() { return 1; }
-#endif
 int
 main ()
 {
@@ -6731,16 +6078,16 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:6734: \"$ac_link\"") >&5
+if { (eval echo "$as_me:6081: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:6737: \$? = $ac_status" >&5
+  echo "$as_me:6084: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:6740: \"$ac_try\"") >&5
+  { (eval echo "$as_me:6087: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:6743: \$? = $ac_status" >&5
+  echo "$as_me:6090: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   eval "$as_ac_var=yes"
 else
@@ -6750,12 +6097,12 @@
 fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:6753: result: `eval echo '${'$as_ac_var'}'`" >&5
+echo "$as_me:6100: result: `eval echo '${'$as_ac_var'}'`" >&5
 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
 if test `eval echo '${'$as_ac_var'}'` = yes; then
-  cat >>confdefs.h <<_ACEOF
+  cat >>confdefs.h <<EOF
 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
-_ACEOF
+EOF
 
 fi
 done
@@ -6763,13 +6110,13 @@
 for ac_func in setutxent utmpxname
 do
 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-echo "$as_me:6766: checking for $ac_func" >&5
+echo "$as_me:6113: checking for $ac_func" >&5
 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
 if eval "test \"\${$as_ac_var+set}\" = set"; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line 6772 "configure"
+#line 6119 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func (); below.  */
@@ -6783,12 +6130,6 @@
 char $ac_func ();
 char (*f) ();
 
-#ifdef F77_DUMMY_MAIN
-#  ifdef __cplusplus
-     extern "C"
-#  endif
-   int F77_DUMMY_MAIN() { return 1; }
-#endif
 int
 main ()
 {
@@ -6806,16 +6147,16 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:6809: \"$ac_link\"") >&5
+if { (eval echo "$as_me:6150: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:6812: \$? = $ac_status" >&5
+  echo "$as_me:6153: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:6815: \"$ac_try\"") >&5
+  { (eval echo "$as_me:6156: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:6818: \$? = $ac_status" >&5
+  echo "$as_me:6159: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   eval "$as_ac_var=yes"
 else
@@ -6825,23 +6166,23 @@
 fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:6828: result: `eval echo '${'$as_ac_var'}'`" >&5
+echo "$as_me:6169: result: `eval echo '${'$as_ac_var'}'`" >&5
 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
 if test `eval echo '${'$as_ac_var'}'` = yes; then
-  cat >>confdefs.h <<_ACEOF
+  cat >>confdefs.h <<EOF
 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
-_ACEOF
+EOF
 
 fi
 done
 
-echo "$as_me:6838: checking for getuserattr" >&5
+echo "$as_me:6179: checking for getuserattr" >&5
 echo $ECHO_N "checking for getuserattr... $ECHO_C" >&6
 if test "${ac_cv_func_getuserattr+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line 6844 "configure"
+#line 6185 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char getuserattr (); below.  */
@@ -6855,12 +6196,6 @@
 char getuserattr ();
 char (*f) ();
 
-#ifdef F77_DUMMY_MAIN
-#  ifdef __cplusplus
-     extern "C"
-#  endif
-   int F77_DUMMY_MAIN() { return 1; }
-#endif
 int
 main ()
 {
@@ -6878,16 +6213,16 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:6881: \"$ac_link\"") >&5
+if { (eval echo "$as_me:6216: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:6884: \$? = $ac_status" >&5
+  echo "$as_me:6219: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:6887: \"$ac_try\"") >&5
+  { (eval echo "$as_me:6222: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:6890: \$? = $ac_status" >&5
+  echo "$as_me:6225: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_func_getuserattr=yes
 else
@@ -6897,15 +6232,15 @@
 fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:6900: result: $ac_cv_func_getuserattr" >&5
+echo "$as_me:6235: result: $ac_cv_func_getuserattr" >&5
 echo "${ECHO_T}$ac_cv_func_getuserattr" >&6
 if test $ac_cv_func_getuserattr = yes; then
-  cat >>confdefs.h <<\_ACEOF
+  cat >>confdefs.h <<\EOF
 #define HAVE_GETUSERATTR 1
-_ACEOF
+EOF
 
 else
-  echo "$as_me:6908: checking for getuserattr in -ls" >&5
+  echo "$as_me:6243: checking for getuserattr in -ls" >&5
 echo $ECHO_N "checking for getuserattr in -ls... $ECHO_C" >&6
 if test "${ac_cv_lib_s_getuserattr+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -6913,7 +6248,7 @@
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-ls  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
-#line 6916 "configure"
+#line 6251 "configure"
 #include "confdefs.h"
 
 /* Override any gcc2 internal prototype to avoid an error.  */
@@ -6923,12 +6258,6 @@
 /* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
 char getuserattr ();
-#ifdef F77_DUMMY_MAIN
-#  ifdef __cplusplus
-     extern "C"
-#  endif
-   int F77_DUMMY_MAIN() { return 1; }
-#endif
 int
 main ()
 {
@@ -6938,16 +6267,16 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:6941: \"$ac_link\"") >&5
+if { (eval echo "$as_me:6270: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:6944: \$? = $ac_status" >&5
+  echo "$as_me:6273: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:6947: \"$ac_try\"") >&5
+  { (eval echo "$as_me:6276: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:6950: \$? = $ac_status" >&5
+  echo "$as_me:6279: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_lib_s_getuserattr=yes
 else
@@ -6958,24 +6287,24 @@
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-echo "$as_me:6961: result: $ac_cv_lib_s_getuserattr" >&5
+echo "$as_me:6290: result: $ac_cv_lib_s_getuserattr" >&5
 echo "${ECHO_T}$ac_cv_lib_s_getuserattr" >&6
 if test $ac_cv_lib_s_getuserattr = yes; then
-  LIBS="$LIBS -ls"; cat >>confdefs.h <<\_ACEOF
+  LIBS="$LIBS -ls"; cat >>confdefs.h <<\EOF
 #define HAVE_GETUSERATTR 1
-_ACEOF
+EOF
 
 fi
 
 fi
 
-echo "$as_me:6972: checking for daemon" >&5
+echo "$as_me:6301: checking for daemon" >&5
 echo $ECHO_N "checking for daemon... $ECHO_C" >&6
 if test "${ac_cv_func_daemon+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line 6978 "configure"
+#line 6307 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char daemon (); below.  */
@@ -6989,12 +6318,6 @@
 char daemon ();
 char (*f) ();
 
-#ifdef F77_DUMMY_MAIN
-#  ifdef __cplusplus
-     extern "C"
-#  endif
-   int F77_DUMMY_MAIN() { return 1; }
-#endif
 int
 main ()
 {
@@ -7012,16 +6335,16 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:7015: \"$ac_link\"") >&5
+if { (eval echo "$as_me:6338: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:7018: \$? = $ac_status" >&5
+  echo "$as_me:6341: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:7021: \"$ac_try\"") >&5
+  { (eval echo "$as_me:6344: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:7024: \$? = $ac_status" >&5
+  echo "$as_me:6347: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_func_daemon=yes
 else
@@ -7031,15 +6354,15 @@
 fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:7034: result: $ac_cv_func_daemon" >&5
+echo "$as_me:6357: result: $ac_cv_func_daemon" >&5
 echo "${ECHO_T}$ac_cv_func_daemon" >&6
 if test $ac_cv_func_daemon = yes; then
-  cat >>confdefs.h <<\_ACEOF
+  cat >>confdefs.h <<\EOF
 #define HAVE_DAEMON 1
-_ACEOF
+EOF
 
 else
-  echo "$as_me:7042: checking for daemon in -lbsd" >&5
+  echo "$as_me:6365: checking for daemon in -lbsd" >&5
 echo $ECHO_N "checking for daemon in -lbsd... $ECHO_C" >&6
 if test "${ac_cv_lib_bsd_daemon+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -7047,7 +6370,7 @@
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-lbsd  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
-#line 7050 "configure"
+#line 6373 "configure"
 #include "confdefs.h"
 
 /* Override any gcc2 internal prototype to avoid an error.  */
@@ -7057,12 +6380,6 @@
 /* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
 char daemon ();
-#ifdef F77_DUMMY_MAIN
-#  ifdef __cplusplus
-     extern "C"
-#  endif
-   int F77_DUMMY_MAIN() { return 1; }
-#endif
 int
 main ()
 {
@@ -7072,16 +6389,16 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:7075: \"$ac_link\"") >&5
+if { (eval echo "$as_me:6392: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:7078: \$? = $ac_status" >&5
+  echo "$as_me:6395: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:7081: \"$ac_try\"") >&5
+  { (eval echo "$as_me:6398: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:7084: \$? = $ac_status" >&5
+  echo "$as_me:6401: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_lib_bsd_daemon=yes
 else
@@ -7092,24 +6409,24 @@
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-echo "$as_me:7095: result: $ac_cv_lib_bsd_daemon" >&5
+echo "$as_me:6412: result: $ac_cv_lib_bsd_daemon" >&5
 echo "${ECHO_T}$ac_cv_lib_bsd_daemon" >&6
 if test $ac_cv_lib_bsd_daemon = yes; then
-  LIBS="$LIBS -lbsd"; cat >>confdefs.h <<\_ACEOF
+  LIBS="$LIBS -lbsd"; cat >>confdefs.h <<\EOF
 #define HAVE_DAEMON 1
-_ACEOF
+EOF
 
 fi
 
 fi
 
-echo "$as_me:7106: checking for getpagesize" >&5
+echo "$as_me:6423: checking for getpagesize" >&5
 echo $ECHO_N "checking for getpagesize... $ECHO_C" >&6
 if test "${ac_cv_func_getpagesize+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line 7112 "configure"
+#line 6429 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char getpagesize (); below.  */
@@ -7123,12 +6440,6 @@
 char getpagesize ();
 char (*f) ();
 
-#ifdef F77_DUMMY_MAIN
-#  ifdef __cplusplus
-     extern "C"
-#  endif
-   int F77_DUMMY_MAIN() { return 1; }
-#endif
 int
 main ()
 {
@@ -7146,16 +6457,16 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:7149: \"$ac_link\"") >&5
+if { (eval echo "$as_me:6460: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:7152: \$? = $ac_status" >&5
+  echo "$as_me:6463: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:7155: \"$ac_try\"") >&5
+  { (eval echo "$as_me:6466: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:7158: \$? = $ac_status" >&5
+  echo "$as_me:6469: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_func_getpagesize=yes
 else
@@ -7165,15 +6476,15 @@
 fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:7168: result: $ac_cv_func_getpagesize" >&5
+echo "$as_me:6479: result: $ac_cv_func_getpagesize" >&5
 echo "${ECHO_T}$ac_cv_func_getpagesize" >&6
 if test $ac_cv_func_getpagesize = yes; then
-  cat >>confdefs.h <<\_ACEOF
+  cat >>confdefs.h <<\EOF
 #define HAVE_GETPAGESIZE 1
-_ACEOF
+EOF
 
 else
-  echo "$as_me:7176: checking for getpagesize in -lucb" >&5
+  echo "$as_me:6487: checking for getpagesize in -lucb" >&5
 echo $ECHO_N "checking for getpagesize in -lucb... $ECHO_C" >&6
 if test "${ac_cv_lib_ucb_getpagesize+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -7181,7 +6492,7 @@
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-lucb  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
-#line 7184 "configure"
+#line 6495 "configure"
 #include "confdefs.h"
 
 /* Override any gcc2 internal prototype to avoid an error.  */
@@ -7191,12 +6502,6 @@
 /* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
 char getpagesize ();
-#ifdef F77_DUMMY_MAIN
-#  ifdef __cplusplus
-     extern "C"
-#  endif
-   int F77_DUMMY_MAIN() { return 1; }
-#endif
 int
 main ()
 {
@@ -7206,16 +6511,16 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:7209: \"$ac_link\"") >&5
+if { (eval echo "$as_me:6514: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:7212: \$? = $ac_status" >&5
+  echo "$as_me:6517: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:7215: \"$ac_try\"") >&5
+  { (eval echo "$as_me:6520: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:7218: \$? = $ac_status" >&5
+  echo "$as_me:6523: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_lib_ucb_getpagesize=yes
 else
@@ -7226,12 +6531,12 @@
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-echo "$as_me:7229: result: $ac_cv_lib_ucb_getpagesize" >&5
+echo "$as_me:6534: result: $ac_cv_lib_ucb_getpagesize" >&5
 echo "${ECHO_T}$ac_cv_lib_ucb_getpagesize" >&6
 if test $ac_cv_lib_ucb_getpagesize = yes; then
-  LIBS="$LIBS -lucb"; cat >>confdefs.h <<\_ACEOF
+  LIBS="$LIBS -lucb"; cat >>confdefs.h <<\EOF
 #define HAVE_GETPAGESIZE 1
-_ACEOF
+EOF
 
 fi
 
@@ -7239,15 +6544,15 @@
 
 # Check for broken snprintf
 if test "x$ac_cv_func_snprintf" = "xyes" ; then
-	echo "$as_me:7242: checking whether snprintf correctly terminates long strings" >&5
+	echo "$as_me:6547: checking whether snprintf correctly terminates long strings" >&5
 echo $ECHO_N "checking whether snprintf correctly terminates long strings... $ECHO_C" >&6
 	if test "$cross_compiling" = yes; then
-  { { echo "$as_me:7245: error: cannot run test program while cross compiling" >&5
+  { { echo "$as_me:6550: error: cannot run test program while cross compiling" >&5
 echo "$as_me: error: cannot run test program while cross compiling" >&2;}
    { (exit 1); exit 1; }; }
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line 7250 "configure"
+#line 6555 "configure"
 #include "confdefs.h"
 
 #include <stdio.h>
@@ -7255,30 +6560,30 @@
 
 _ACEOF
 rm -f conftest$ac_exeext
-if { (eval echo "$as_me:7258: \"$ac_link\"") >&5
+if { (eval echo "$as_me:6563: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:7261: \$? = $ac_status" >&5
+  echo "$as_me:6566: \$? = $ac_status" >&5
   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
-  { (eval echo "$as_me:7263: \"$ac_try\"") >&5
+  { (eval echo "$as_me:6568: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:7266: \$? = $ac_status" >&5
+  echo "$as_me:6571: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  echo "$as_me:7268: result: yes" >&5
+  echo "$as_me:6573: result: yes" >&5
 echo "${ECHO_T}yes" >&6
 else
   echo "$as_me: program exited with status $ac_status" >&5
 echo "$as_me: failed program was:" >&5
 cat conftest.$ac_ext >&5
 
-			echo "$as_me:7275: result: no" >&5
+			echo "$as_me:6580: result: no" >&5
 echo "${ECHO_T}no" >&6
-			cat >>confdefs.h <<\_ACEOF
+			cat >>confdefs.h <<\EOF
 #define BROKEN_SNPRINTF 1
-_ACEOF
+EOF
 
-			{ echo "$as_me:7281: WARNING: ****** Your snprintf() function is broken, complain to your vendor" >&5
+			{ echo "$as_me:6586: WARNING: ****** Your snprintf() function is broken, complain to your vendor" >&5
 echo "$as_me: WARNING: ****** Your snprintf() function is broken, complain to your vendor" >&2;}
 
 fi
@@ -7286,106 +6591,279 @@
 fi
 fi
 
-echo "$as_me:7289: checking whether getpgrp takes no argument" >&5
-echo $ECHO_N "checking whether getpgrp takes no argument... $ECHO_C" >&6
-if test "${ac_cv_func_getpgrp_void+set}" = set; then
+echo "$as_me:6594: checking for ANSI C header files" >&5
+echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
+if test "${ac_cv_header_stdc+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  # Use it with a single arg.
-cat >conftest.$ac_ext <<_ACEOF
-#line 7296 "configure"
+  cat >conftest.$ac_ext <<_ACEOF
+#line 6600 "configure"
 #include "confdefs.h"
-$ac_includes_default
-#ifdef F77_DUMMY_MAIN
-#  ifdef __cplusplus
-     extern "C"
-#  endif
-   int F77_DUMMY_MAIN() { return 1; }
-#endif
-int
-main ()
-{
-getpgrp (0);
-  ;
-  return 0;
-}
+#include <stdlib.h>
+#include <stdarg.h>
+#include <string.h>
+#include <float.h>
+
 _ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:7314: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
-  ac_status=$?
-  echo "$as_me:7317: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-         { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:7320: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+if { (eval echo "$as_me:6608: \"$ac_cpp conftest.$ac_ext\"") >&5
+  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
   ac_status=$?
-  echo "$as_me:7323: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_func_getpgrp_1=yes
+  egrep -v '^ *\+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:6614: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null; then
+  if test -s conftest.err; then
+    ac_cpp_err=$ac_c_preproc_warn_flag
+  else
+    ac_cpp_err=
+  fi
 else
-  echo "$as_me: failed program was:" >&5
-cat conftest.$ac_ext >&5
-ac_func_getpgrp_1=no
+  ac_cpp_err=yes
 fi
-rm -f conftest.$ac_objext conftest.$ac_ext
-# Use it with no arg.
-cat >conftest.$ac_ext <<_ACEOF
-#line 7334 "configure"
-#include "confdefs.h"
-$ac_includes_default
-#ifdef F77_DUMMY_MAIN
-#  ifdef __cplusplus
-     extern "C"
-#  endif
-   int F77_DUMMY_MAIN() { return 1; }
-#endif
-int
-main ()
-{
-getpgrp ();
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:7352: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
-  ac_status=$?
-  echo "$as_me:7355: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-         { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:7358: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:7361: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_func_getpgrp_0=yes
+if test -z "$ac_cpp_err"; then
+  ac_cv_header_stdc=yes
 else
   echo "$as_me: failed program was:" >&5
-cat conftest.$ac_ext >&5
-ac_func_getpgrp_0=no
+  cat conftest.$ac_ext >&5
+  ac_cv_header_stdc=no
 fi
-rm -f conftest.$ac_objext conftest.$ac_ext
-# If both static checks agree, we are done.
-case $ac_func_getpgrp_0:$ac_func_getpgrp_1 in
-  yes:no) ac_cv_func_getpgrp_void=yes;;
-  no:yes) ac_cv_func_getpgrp_void=false;;
-  *) if test "$cross_compiling" = yes; then
-  { { echo "$as_me:7375: error: cannot check getpgrp if cross compiling" >&5
-echo "$as_me: error: cannot check getpgrp if cross compiling" >&2;}
-   { (exit 1); exit 1; }; }
-else
+rm -f conftest.err conftest.$ac_ext
+
+if test $ac_cv_header_stdc = yes; then
+  # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
   cat >conftest.$ac_ext <<_ACEOF
-#line 7380 "configure"
+#line 6636 "configure"
 #include "confdefs.h"
-$ac_includes_default
+#include <string.h>
 
-/*
- * If this system has a BSD-style getpgrp(),
- * which takes a pid argument, exit unsuccessfully.
- *
- * Snarfed from Chet Ramey's bash pgrp.c test program
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  egrep "memchr" >/dev/null 2>&1; then
+  :
+else
+  ac_cv_header_stdc=no
+fi
+rm -f conftest*
+
+fi
+
+if test $ac_cv_header_stdc = yes; then
+  # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
+  cat >conftest.$ac_ext <<_ACEOF
+#line 6654 "configure"
+#include "confdefs.h"
+#include <stdlib.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  egrep "free" >/dev/null 2>&1; then
+  :
+else
+  ac_cv_header_stdc=no
+fi
+rm -f conftest*
+
+fi
+
+if test $ac_cv_header_stdc = yes; then
+  # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
+  if test "$cross_compiling" = yes; then
+  :
+else
+  cat >conftest.$ac_ext <<_ACEOF
+#line 6675 "configure"
+#include "confdefs.h"
+#include <ctype.h>
+#if ((' ' & 0x0FF) == 0x020)
+# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
+# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
+#else
+# define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \
+                     || ('j' <= (c) && (c) <= 'r') \
+                     || ('s' <= (c) && (c) <= 'z'))
+# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
+#endif
+
+#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
+int
+main ()
+{
+  int i;
+  for (i = 0; i < 256; i++)
+    if (XOR (islower (i), ISLOWER (i))
+        || toupper (i) != TOUPPER (i))
+      exit(2);
+  exit (0);
+}
+_ACEOF
+rm -f conftest$ac_exeext
+if { (eval echo "$as_me:6701: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:6704: \$? = $ac_status" >&5
+  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+  { (eval echo "$as_me:6706: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:6709: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  :
+else
+  echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_cv_header_stdc=no
+fi
+rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+fi
+fi
+fi
+echo "$as_me:6722: result: $ac_cv_header_stdc" >&5
+echo "${ECHO_T}$ac_cv_header_stdc" >&6
+if test $ac_cv_header_stdc = yes; then
+
+cat >>confdefs.h <<\EOF
+#define STDC_HEADERS 1
+EOF
+
+fi
+
+# On IRIX 5.3, sys/types and inttypes.h are conflicting.
+
+for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
+                  inttypes.h stdint.h unistd.h
+do
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+echo "$as_me:6738: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+#line 6744 "configure"
+#include "confdefs.h"
+$ac_includes_default
+#include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:6750: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:6753: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:6756: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:6759: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  eval "$as_ac_Header=yes"
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+eval "$as_ac_Header=no"
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:6769: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+  cat >>confdefs.h <<EOF
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+EOF
+
+fi
+done
+
+echo "$as_me:6779: checking whether getpgrp takes no argument" >&5
+echo $ECHO_N "checking whether getpgrp takes no argument... $ECHO_C" >&6
+if test "${ac_cv_func_getpgrp_void+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  # Use it with a single arg.
+cat >conftest.$ac_ext <<_ACEOF
+#line 6786 "configure"
+#include "confdefs.h"
+$ac_includes_default
+int
+main ()
+{
+getpgrp (0);
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:6798: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:6801: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:6804: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:6807: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_func_getpgrp_1=yes
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_func_getpgrp_1=no
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+# Use it with no arg.
+cat >conftest.$ac_ext <<_ACEOF
+#line 6818 "configure"
+#include "confdefs.h"
+$ac_includes_default
+int
+main ()
+{
+getpgrp ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:6830: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:6833: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:6836: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:6839: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_func_getpgrp_0=yes
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_func_getpgrp_0=no
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+# If both static checks agree, we are done.
+case $ac_func_getpgrp_0:$ac_func_getpgrp_1 in
+  yes:no) ac_cv_func_getpgrp_void=yes;;
+  no:yes) ac_cv_func_getpgrp_void=false;;
+  *) if test "$cross_compiling" = yes; then
+  { { echo "$as_me:6853: error: cannot check getpgrp if cross compiling" >&5
+echo "$as_me: error: cannot check getpgrp if cross compiling" >&2;}
+   { (exit 1); exit 1; }; }
+else
+  cat >conftest.$ac_ext <<_ACEOF
+#line 6858 "configure"
+#include "confdefs.h"
+$ac_includes_default
+
+/*
+ * If this system has a BSD-style getpgrp(),
+ * which takes a pid argument, exit unsuccessfully.
+ *
+ * Snarfed from Chet Ramey's bash pgrp.c test program
  */
 
 int     pid;
@@ -7431,15 +6909,15 @@
 
 _ACEOF
 rm -f conftest$ac_exeext
-if { (eval echo "$as_me:7434: \"$ac_link\"") >&5
+if { (eval echo "$as_me:6912: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:7437: \$? = $ac_status" >&5
+  echo "$as_me:6915: \$? = $ac_status" >&5
   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
-  { (eval echo "$as_me:7439: \"$ac_try\"") >&5
+  { (eval echo "$as_me:6917: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:7442: \$? = $ac_status" >&5
+  echo "$as_me:6920: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_func_getpgrp_void=yes
 else
@@ -7453,13 +6931,13 @@
 esac # $ac_func_getpgrp_0:$ac_func_getpgrp_1
 
 fi
-echo "$as_me:7456: result: $ac_cv_func_getpgrp_void" >&5
+echo "$as_me:6934: result: $ac_cv_func_getpgrp_void" >&5
 echo "${ECHO_T}$ac_cv_func_getpgrp_void" >&6
 if test $ac_cv_func_getpgrp_void = yes; then
 
-cat >>confdefs.h <<\_ACEOF
+cat >>confdefs.h <<\EOF
 #define GETPGRP_VOID 1
-_ACEOF
+EOF
 
 fi
 
@@ -7472,12 +6950,12 @@
 
 		if test "x$withval" != "xno" ; then
 			if test "x$ac_cv_header_security_pam_appl_h" != "xyes" ; then
-				{ { echo "$as_me:7475: error: PAM headers not found" >&5
+				{ { echo "$as_me:6953: error: PAM headers not found" >&5
 echo "$as_me: error: PAM headers not found" >&2;}
    { (exit 1); exit 1; }; }
 			fi
 
-echo "$as_me:7480: checking for dlopen in -ldl" >&5
+echo "$as_me:6958: checking for dlopen in -ldl" >&5
 echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6
 if test "${ac_cv_lib_dl_dlopen+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -7485,7 +6963,7 @@
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-ldl  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
-#line 7488 "configure"
+#line 6966 "configure"
 #include "confdefs.h"
 
 /* Override any gcc2 internal prototype to avoid an error.  */
@@ -7495,12 +6973,6 @@
 /* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
 char dlopen ();
-#ifdef F77_DUMMY_MAIN
-#  ifdef __cplusplus
-     extern "C"
-#  endif
-   int F77_DUMMY_MAIN() { return 1; }
-#endif
 int
 main ()
 {
@@ -7510,16 +6982,16 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:7513: \"$ac_link\"") >&5
+if { (eval echo "$as_me:6985: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:7516: \$? = $ac_status" >&5
+  echo "$as_me:6988: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:7519: \"$ac_try\"") >&5
+  { (eval echo "$as_me:6991: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:7522: \$? = $ac_status" >&5
+  echo "$as_me:6994: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_lib_dl_dlopen=yes
 else
@@ -7530,18 +7002,18 @@
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-echo "$as_me:7533: result: $ac_cv_lib_dl_dlopen" >&5
+echo "$as_me:7005: result: $ac_cv_lib_dl_dlopen" >&5
 echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6
 if test $ac_cv_lib_dl_dlopen = yes; then
-  cat >>confdefs.h <<_ACEOF
+  cat >>confdefs.h <<EOF
 #define HAVE_LIBDL 1
-_ACEOF
+EOF
 
   LIBS="-ldl $LIBS"
 
 fi
 
-echo "$as_me:7544: checking for pam_set_item in -lpam" >&5
+echo "$as_me:7016: checking for pam_set_item in -lpam" >&5
 echo $ECHO_N "checking for pam_set_item in -lpam... $ECHO_C" >&6
 if test "${ac_cv_lib_pam_pam_set_item+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -7549,7 +7021,7 @@
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-lpam  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
-#line 7552 "configure"
+#line 7024 "configure"
 #include "confdefs.h"
 
 /* Override any gcc2 internal prototype to avoid an error.  */
@@ -7559,12 +7031,6 @@
 /* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
 char pam_set_item ();
-#ifdef F77_DUMMY_MAIN
-#  ifdef __cplusplus
-     extern "C"
-#  endif
-   int F77_DUMMY_MAIN() { return 1; }
-#endif
 int
 main ()
 {
@@ -7574,16 +7040,16 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:7577: \"$ac_link\"") >&5
+if { (eval echo "$as_me:7043: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:7580: \$? = $ac_status" >&5
+  echo "$as_me:7046: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:7583: \"$ac_try\"") >&5
+  { (eval echo "$as_me:7049: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:7586: \$? = $ac_status" >&5
+  echo "$as_me:7052: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_lib_pam_pam_set_item=yes
 else
@@ -7594,17 +7060,17 @@
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-echo "$as_me:7597: result: $ac_cv_lib_pam_pam_set_item" >&5
+echo "$as_me:7063: result: $ac_cv_lib_pam_pam_set_item" >&5
 echo "${ECHO_T}$ac_cv_lib_pam_pam_set_item" >&6
 if test $ac_cv_lib_pam_pam_set_item = yes; then
-  cat >>confdefs.h <<_ACEOF
+  cat >>confdefs.h <<EOF
 #define HAVE_LIBPAM 1
-_ACEOF
+EOF
 
   LIBS="-lpam $LIBS"
 
 else
-  { { echo "$as_me:7607: error: *** libpam missing" >&5
+  { { echo "$as_me:7073: error: *** libpam missing" >&5
 echo "$as_me: error: *** libpam missing" >&2;}
    { (exit 1); exit 1; }; }
 fi
@@ -7612,13 +7078,13 @@
 for ac_func in pam_getenvlist
 do
 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-echo "$as_me:7615: checking for $ac_func" >&5
+echo "$as_me:7081: checking for $ac_func" >&5
 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
 if eval "test \"\${$as_ac_var+set}\" = set"; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line 7621 "configure"
+#line 7087 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func (); below.  */
@@ -7632,12 +7098,6 @@
 char $ac_func ();
 char (*f) ();
 
-#ifdef F77_DUMMY_MAIN
-#  ifdef __cplusplus
-     extern "C"
-#  endif
-   int F77_DUMMY_MAIN() { return 1; }
-#endif
 int
 main ()
 {
@@ -7655,16 +7115,16 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:7658: \"$ac_link\"") >&5
+if { (eval echo "$as_me:7118: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:7661: \$? = $ac_status" >&5
+  echo "$as_me:7121: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:7664: \"$ac_try\"") >&5
+  { (eval echo "$as_me:7124: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:7667: \$? = $ac_status" >&5
+  echo "$as_me:7127: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   eval "$as_ac_var=yes"
 else
@@ -7674,82 +7134,145 @@
 fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:7677: result: `eval echo '${'$as_ac_var'}'`" >&5
+echo "$as_me:7137: result: `eval echo '${'$as_ac_var'}'`" >&5
 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
 if test `eval echo '${'$as_ac_var'}'` = yes; then
-  cat >>confdefs.h <<_ACEOF
+  cat >>confdefs.h <<EOF
 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
-_ACEOF
+EOF
 
 fi
 done
 
-			disable_shadow=yes
-			PAM_MSG="yes"
-
-			cat >>confdefs.h <<\_ACEOF
-#define USE_PAM 1
-_ACEOF
-
-			if test $ac_cv_lib_dl_dlopen = yes; then
-				LIBPAM="-lpam -ldl"
-			else
-				LIBPAM="-lpam"
-			fi
-
-		fi
-
-fi;
-
-# Check for older PAM
-if test "x$PAM_MSG" = "xyes" ; then
-	# Check PAM strerror arguments (old PAM)
-	echo "$as_me:7707: checking whether pam_strerror takes only one argument" >&5
-echo $ECHO_N "checking whether pam_strerror takes only one argument... $ECHO_C" >&6
-	cat >conftest.$ac_ext <<_ACEOF
-#line 7710 "configure"
+for ac_func in pam_putenv
+do
+as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
+echo "$as_me:7150: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
+if eval "test \"\${$as_ac_var+set}\" = set"; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+#line 7156 "configure"
 #include "confdefs.h"
-
-#include <stdlib.h>
-#include <security/pam_appl.h>
-
-#ifdef F77_DUMMY_MAIN
-#  ifdef __cplusplus
-     extern "C"
-#  endif
-   int F77_DUMMY_MAIN() { return 1; }
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char $ac_func (); below.  */
+#include <assert.h>
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
 #endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char $ac_func ();
+char (*f) ();
+
 int
 main ()
 {
-(void)pam_strerror((pam_handle_t *)NULL, -1);
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
+choke me
+#else
+f = $ac_func;
+#endif
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:7187: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:7190: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:7193: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:7196: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  eval "$as_ac_var=yes"
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+eval "$as_ac_var=no"
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:7206: result: `eval echo '${'$as_ac_var'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
+if test `eval echo '${'$as_ac_var'}'` = yes; then
+  cat >>confdefs.h <<EOF
+#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
+EOF
+
+fi
+done
+
+			disable_shadow=yes
+			PAM_MSG="yes"
+
+			cat >>confdefs.h <<\EOF
+#define USE_PAM 1
+EOF
+
+			if test $ac_cv_lib_dl_dlopen = yes; then
+				LIBPAM="-lpam -ldl"
+			else
+				LIBPAM="-lpam"
+			fi
+
+		fi
+
+fi;
+
+# Check for older PAM
+if test "x$PAM_MSG" = "xyes" ; then
+	# Check PAM strerror arguments (old PAM)
+	echo "$as_me:7236: checking whether pam_strerror takes only one argument" >&5
+echo $ECHO_N "checking whether pam_strerror takes only one argument... $ECHO_C" >&6
+	cat >conftest.$ac_ext <<_ACEOF
+#line 7239 "configure"
+#include "confdefs.h"
+
+#include <stdlib.h>
+#include <security/pam_appl.h>
+
+int
+main ()
+{
+(void)pam_strerror((pam_handle_t *)NULL, -1);
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:7731: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:7254: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:7734: \$? = $ac_status" >&5
+  echo "$as_me:7257: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:7737: \"$ac_try\"") >&5
+  { (eval echo "$as_me:7260: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:7740: \$? = $ac_status" >&5
+  echo "$as_me:7263: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  echo "$as_me:7742: result: no" >&5
+  echo "$as_me:7265: result: no" >&5
 echo "${ECHO_T}no" >&6
 else
   echo "$as_me: failed program was:" >&5
 cat conftest.$ac_ext >&5
 
-			cat >>confdefs.h <<\_ACEOF
+			cat >>confdefs.h <<\EOF
 #define HAVE_OLD_PAM 1
-_ACEOF
+EOF
 
-			echo "$as_me:7752: result: yes" >&5
+			echo "$as_me:7275: result: yes" >&5
 echo "${ECHO_T}yes" >&6
 			PAM_MSG="yes (old library)"
 
@@ -7772,10 +7295,15 @@
 saved_LIBS="$LIBS"
 saved_LDFLAGS="$LDFLAGS"
 saved_CPPFLAGS="$CPPFLAGS"
+if test "x$globus_flavor_type" != "xno" ; then
+LIBS="$saved_LIBS -lglobus_ssl_utils_${globus_flavor_type} -lssl_${globus_flavor_type} -lcrypto_${globus_flavor_type}"
+LDFLAGS="$saved_LDFLAGS"
+CPPFLAGS="$saved_CPPFLAGS"
+else
 if test "x$prefix" != "xNONE" ; then
 	tryssldir="$tryssldir $prefix"
 fi
-echo "$as_me:7778: checking for OpenSSL directory" >&5
+echo "$as_me:7306: checking for OpenSSL directory" >&5
 echo $ECHO_N "checking for OpenSSL directory... $ECHO_C" >&6
 if test "${ac_cv_openssldir+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -7816,12 +7344,12 @@
 		# Basic test to check for compatible version and correct linking
 		# *does not* test for RSA - that comes later.
 		if test "$cross_compiling" = yes; then
-  { { echo "$as_me:7819: error: cannot run test program while cross compiling" >&5
+  { { echo "$as_me:7347: error: cannot run test program while cross compiling" >&5
 echo "$as_me: error: cannot run test program while cross compiling" >&2;}
    { (exit 1); exit 1; }; }
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line 7824 "configure"
+#line 7352 "configure"
 #include "confdefs.h"
 
 #include <string.h>
@@ -7836,15 +7364,15 @@
 
 _ACEOF
 rm -f conftest$ac_exeext
-if { (eval echo "$as_me:7839: \"$ac_link\"") >&5
+if { (eval echo "$as_me:7367: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:7842: \$? = $ac_status" >&5
+  echo "$as_me:7370: \$? = $ac_status" >&5
   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
-  { (eval echo "$as_me:7844: \"$ac_try\"") >&5
+  { (eval echo "$as_me:7372: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:7847: \$? = $ac_status" >&5
+  echo "$as_me:7375: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
 
 				found_crypto=1
@@ -7865,7 +7393,7 @@
 	done
 
 	if test -z "$found_crypto" ; then
-		{ { echo "$as_me:7868: error: Could not find working OpenSSL library, please install or check config.log" >&5
+		{ { echo "$as_me:7396: error: Could not find working OpenSSL library, please install or check config.log" >&5
 echo "$as_me: error: Could not find working OpenSSL library, please install or check config.log" >&2;}
    { (exit 1); exit 1; }; }
 	fi
@@ -7876,13 +7404,13 @@
 	ac_cv_openssldir=$ssldir
 
 fi
-echo "$as_me:7879: result: $ac_cv_openssldir" >&5
+echo "$as_me:7407: result: $ac_cv_openssldir" >&5
 echo "${ECHO_T}$ac_cv_openssldir" >&6
 
 if (test ! -z "$ac_cv_openssldir" && test "x$ac_cv_openssldir" != "x(system)") ; then
-	cat >>confdefs.h <<\_ACEOF
+	cat >>confdefs.h <<\EOF
 #define HAVE_OPENSSL 1
-_ACEOF
+EOF
 
 		ssldir=$ac_cv_openssldir
 	if test ! -z "$ssldir" -a "x$ssldir" != "x/usr"; then
@@ -7908,11 +7436,16 @@
 		fi
 	fi
 fi
+if test "x$gsi_path" == "xno" ; then
 LIBS="$saved_LIBS -lcrypto"
+else
+LIBS="$saved_LIBS -lssl -lcrypto"
+fi
+fi # globus_flavor_type
 
 # Now test RSA support
 saved_LIBS="$LIBS"
-echo "$as_me:7915: checking for RSA support" >&5
+echo "$as_me:7448: checking for RSA support" >&5
 echo $ECHO_N "checking for RSA support... $ECHO_C" >&6
 for WANTS_RSAREF in "" 1 ; do
 	if test -z "$WANTS_RSAREF" ; then
@@ -7921,12 +7454,12 @@
 		LIBS="$saved_LIBS -lRSAglue -lrsaref"
 	fi
 	if test "$cross_compiling" = yes; then
-  { { echo "$as_me:7924: error: cannot run test program while cross compiling" >&5
+  { { echo "$as_me:7457: error: cannot run test program while cross compiling" >&5
 echo "$as_me: error: cannot run test program while cross compiling" >&2;}
    { (exit 1); exit 1; }; }
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line 7929 "configure"
+#line 7462 "configure"
 #include "confdefs.h"
 
 #include <string.h>
@@ -7946,15 +7479,15 @@
 
 _ACEOF
 rm -f conftest$ac_exeext
-if { (eval echo "$as_me:7949: \"$ac_link\"") >&5
+if { (eval echo "$as_me:7482: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:7952: \$? = $ac_status" >&5
+  echo "$as_me:7485: \$? = $ac_status" >&5
   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
-  { (eval echo "$as_me:7954: \"$ac_try\"") >&5
+  { (eval echo "$as_me:7487: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:7957: \$? = $ac_status" >&5
+  echo "$as_me:7490: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
 
 		rsa_works=1
@@ -7971,22 +7504,22 @@
 LIBS="$saved_LIBS"
 
 if test ! -z "$no_rsa" ; then
-	echo "$as_me:7974: result: disabled" >&5
+	echo "$as_me:7507: result: disabled" >&5
 echo "${ECHO_T}disabled" >&6
 	RSA_MSG="disabled"
 else
 	if test -z "$rsa_works" ; then
-		{ echo "$as_me:7979: WARNING: *** No RSA support found *** " >&5
+		{ echo "$as_me:7512: WARNING: *** No RSA support found *** " >&5
 echo "$as_me: WARNING: *** No RSA support found *** " >&2;}
 		RSA_MSG="no"
 	else
 		if test -z "$WANTS_RSAREF" ; then
-			echo "$as_me:7984: result: yes" >&5
+			echo "$as_me:7517: result: yes" >&5
 echo "${ECHO_T}yes" >&6
 			RSA_MSG="yes"
 		else
 			RSA_MSG="yes (using RSAref)"
-			echo "$as_me:7989: result: using RSAref" >&5
+			echo "$as_me:7522: result: using RSAref" >&5
 echo "${ECHO_T}using RSAref" >&6
 			LIBS="$LIBS -lcrypto -lRSAglue -lrsaref"
 		fi
@@ -7994,15 +7527,15 @@
 fi
 
 # Sanity check OpenSSL headers
-echo "$as_me:7997: checking whether OpenSSL's headers match the library" >&5
+echo "$as_me:7530: checking whether OpenSSL's headers match the library" >&5
 echo $ECHO_N "checking whether OpenSSL's headers match the library... $ECHO_C" >&6
 if test "$cross_compiling" = yes; then
-  { { echo "$as_me:8000: error: cannot run test program while cross compiling" >&5
+  { { echo "$as_me:7533: error: cannot run test program while cross compiling" >&5
 echo "$as_me: error: cannot run test program while cross compiling" >&2;}
    { (exit 1); exit 1; }; }
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line 8005 "configure"
+#line 7538 "configure"
 #include "confdefs.h"
 
 #include <string.h>
@@ -8011,18 +7544,18 @@
 
 _ACEOF
 rm -f conftest$ac_exeext
-if { (eval echo "$as_me:8014: \"$ac_link\"") >&5
+if { (eval echo "$as_me:7547: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:8017: \$? = $ac_status" >&5
+  echo "$as_me:7550: \$? = $ac_status" >&5
   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
-  { (eval echo "$as_me:8019: \"$ac_try\"") >&5
+  { (eval echo "$as_me:7552: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:8022: \$? = $ac_status" >&5
+  echo "$as_me:7555: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
 
-		echo "$as_me:8025: result: yes" >&5
+		echo "$as_me:7558: result: yes" >&5
 echo "${ECHO_T}yes" >&6
 
 else
@@ -8030,9 +7563,9 @@
 echo "$as_me: failed program was:" >&5
 cat conftest.$ac_ext >&5
 
-		echo "$as_me:8033: result: no" >&5
+		echo "$as_me:7566: result: no" >&5
 echo "${ECHO_T}no" >&6
-		{ { echo "$as_me:8035: error: Your OpenSSL headers do not match your library" >&5
+		{ { echo "$as_me:7568: error: Your OpenSSL headers do not match your library" >&5
 echo "$as_me: error: Your OpenSSL headers do not match your library" >&2;}
    { (exit 1); exit 1; }; }
 
@@ -8043,7 +7576,7 @@
 # Some Linux systems (Slackware) need crypt() from libcrypt, *not* the
 # version in OpenSSL. Skip this for PAM
 if test "x$PAM_MSG" = "xno" -a "x$check_for_libcrypt_later" = "x1"; then
-	echo "$as_me:8046: checking for crypt in -lcrypt" >&5
+	echo "$as_me:7579: checking for crypt in -lcrypt" >&5
 echo $ECHO_N "checking for crypt in -lcrypt... $ECHO_C" >&6
 if test "${ac_cv_lib_crypt_crypt+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -8051,7 +7584,7 @@
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-lcrypt  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
-#line 8054 "configure"
+#line 7587 "configure"
 #include "confdefs.h"
 
 /* Override any gcc2 internal prototype to avoid an error.  */
@@ -8061,12 +7594,6 @@
 /* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
 char crypt ();
-#ifdef F77_DUMMY_MAIN
-#  ifdef __cplusplus
-     extern "C"
-#  endif
-   int F77_DUMMY_MAIN() { return 1; }
-#endif
 int
 main ()
 {
@@ -8076,16 +7603,16 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:8079: \"$ac_link\"") >&5
+if { (eval echo "$as_me:7606: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:8082: \$? = $ac_status" >&5
+  echo "$as_me:7609: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:8085: \"$ac_try\"") >&5
+  { (eval echo "$as_me:7612: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:8088: \$? = $ac_status" >&5
+  echo "$as_me:7615: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_lib_crypt_crypt=yes
 else
@@ -8096,7 +7623,7 @@
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-echo "$as_me:8099: result: $ac_cv_lib_crypt_crypt" >&5
+echo "$as_me:7626: result: $ac_cv_lib_crypt_crypt" >&5
 echo "${ECHO_T}$ac_cv_lib_crypt_crypt" >&6
 if test $ac_cv_lib_crypt_crypt = yes; then
   LIBS="$LIBS -lcrypt"
@@ -8107,15 +7634,15 @@
 ### Configure cryptographic random number support
 
 # Check wheter OpenSSL seeds itself
-echo "$as_me:8110: checking whether OpenSSL's PRNG is internally seeded" >&5
+echo "$as_me:7637: checking whether OpenSSL's PRNG is internally seeded" >&5
 echo $ECHO_N "checking whether OpenSSL's PRNG is internally seeded... $ECHO_C" >&6
 if test "$cross_compiling" = yes; then
-  { { echo "$as_me:8113: error: cannot run test program while cross compiling" >&5
+  { { echo "$as_me:7640: error: cannot run test program while cross compiling" >&5
 echo "$as_me: error: cannot run test program while cross compiling" >&2;}
    { (exit 1); exit 1; }; }
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line 8118 "configure"
+#line 7645 "configure"
 #include "confdefs.h"
 
 #include <string.h>
@@ -8124,19 +7651,19 @@
 
 _ACEOF
 rm -f conftest$ac_exeext
-if { (eval echo "$as_me:8127: \"$ac_link\"") >&5
+if { (eval echo "$as_me:7654: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:8130: \$? = $ac_status" >&5
+  echo "$as_me:7657: \$? = $ac_status" >&5
   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
-  { (eval echo "$as_me:8132: \"$ac_try\"") >&5
+  { (eval echo "$as_me:7659: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:8135: \$? = $ac_status" >&5
+  echo "$as_me:7662: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
 
 		OPENSSL_SEEDS_ITSELF=yes
-		echo "$as_me:8139: result: yes" >&5
+		echo "$as_me:7666: result: yes" >&5
 echo "${ECHO_T}yes" >&6
 
 else
@@ -8144,7 +7671,7 @@
 echo "$as_me: failed program was:" >&5
 cat conftest.$ac_ext >&5
 
-		echo "$as_me:8147: result: no" >&5
+		echo "$as_me:7674: result: no" >&5
 echo "${ECHO_T}no" >&6
 		# Default to use of the rand helper if OpenSSL doesn't
 		# seed itself
@@ -8164,7 +7691,7 @@
 			# Force use of OpenSSL's internal RNG, even if
 			# the previous test showed it to be unseeded.
 			if test -z "$OPENSSL_SEEDS_ITSELF" ; then
-				{ echo "$as_me:8167: WARNING: *** Forcing use of OpenSSL's non-self-seeding PRNG" >&5
+				{ echo "$as_me:7694: WARNING: *** Forcing use of OpenSSL's non-self-seeding PRNG" >&5
 echo "$as_me: WARNING: *** Forcing use of OpenSSL's non-self-seeding PRNG" >&2;}
 				OPENSSL_SEEDS_ITSELF=yes
 				USE_RAND_HELPER=""
@@ -8178,9 +7705,9 @@
 # Which randomness source do we use?
 if test ! -z "$OPENSSL_SEEDS_ITSELF" -a -z "$USE_RAND_HELPER" ; then
 	# OpenSSL only
-	cat >>confdefs.h <<\_ACEOF
+	cat >>confdefs.h <<\EOF
 #define OPENSSL_PRNG_ONLY 1
-_ACEOF
+EOF
 
 	RAND_MSG="OpenSSL internal ONLY"
 	INSTALL_SSH_RAND_HELPER=""
@@ -8205,16 +7732,16 @@
 		[0-9]*)
 			;;
 		*)
-			{ { echo "$as_me:8208: error: You must specify a numeric port number for --with-prngd-port" >&5
+			{ { echo "$as_me:7735: error: You must specify a numeric port number for --with-prngd-port" >&5
 echo "$as_me: error: You must specify a numeric port number for --with-prngd-port" >&2;}
    { (exit 1); exit 1; }; }
 			;;
 		esac
 		if test ! -z "$withval" ; then
 			PRNGD_PORT="$withval"
-			cat >>confdefs.h <<_ACEOF
+			cat >>confdefs.h <<EOF
 #define PRNGD_PORT $PRNGD_PORT
-_ACEOF
+EOF
 
 		fi
 
@@ -8236,7 +7763,7 @@
 		/*)
 			;;
 		*)
-			{ { echo "$as_me:8239: error: You must specify an absolute path to the entropy socket" >&5
+			{ { echo "$as_me:7766: error: You must specify an absolute path to the entropy socket" >&5
 echo "$as_me: error: You must specify an absolute path to the entropy socket" >&2;}
    { (exit 1); exit 1; }; }
 			;;
@@ -8244,18 +7771,18 @@
 
 		if test ! -z "$withval" ; then
 			if test ! -z "$PRNGD_PORT" ; then
-				{ { echo "$as_me:8247: error: You may not specify both a PRNGD/EGD port and socket" >&5
+				{ { echo "$as_me:7774: error: You may not specify both a PRNGD/EGD port and socket" >&5
 echo "$as_me: error: You may not specify both a PRNGD/EGD port and socket" >&2;}
    { (exit 1); exit 1; }; }
 			fi
 			if test ! -r "$withval" ; then
-				{ echo "$as_me:8252: WARNING: Entropy socket is not readable" >&5
+				{ echo "$as_me:7779: WARNING: Entropy socket is not readable" >&5
 echo "$as_me: WARNING: Entropy socket is not readable" >&2;}
 			fi
 			PRNGD_SOCKET="$withval"
-			cat >>confdefs.h <<_ACEOF
+			cat >>confdefs.h <<EOF
 #define PRNGD_SOCKET "$PRNGD_SOCKET"
-_ACEOF
+EOF
 
 		fi
 
@@ -8263,24 +7790,24 @@
 
 		# Check for existing socket only if we don't have a random device already
 		if test "$USE_RAND_HELPER" = yes ; then
-			echo "$as_me:8266: checking for PRNGD/EGD socket" >&5
+			echo "$as_me:7793: checking for PRNGD/EGD socket" >&5
 echo $ECHO_N "checking for PRNGD/EGD socket... $ECHO_C" >&6
 			# Insert other locations here
 			for sock in /var/run/egd-pool /dev/egd-pool /etc/entropy; do
 				if test -r $sock && $TEST_MINUS_S_SH -c "test -S $sock -o -p $sock" ; then
 					PRNGD_SOCKET="$sock"
-					cat >>confdefs.h <<_ACEOF
+					cat >>confdefs.h <<EOF
 #define PRNGD_SOCKET "$PRNGD_SOCKET"
-_ACEOF
+EOF
 
 					break;
 				fi
 			done
 			if test ! -z "$PRNGD_SOCKET" ; then
-				echo "$as_me:8280: result: $PRNGD_SOCKET" >&5
+				echo "$as_me:7807: result: $PRNGD_SOCKET" >&5
 echo "${ECHO_T}$PRNGD_SOCKET" >&6
 			else
-				echo "$as_me:8283: result: not found" >&5
+				echo "$as_me:7810: result: not found" >&5
 echo "${ECHO_T}not found" >&6
 			fi
 		fi
@@ -8300,15 +7827,15 @@
 
 fi;
 
-cat >>confdefs.h <<_ACEOF
+cat >>confdefs.h <<EOF
 #define ENTROPY_TIMEOUT_MSEC $entropy_timeout
-_ACEOF
+EOF
 
 # These programs are used by the command hashing source to gather entropy
 
 	# Extract the first word of "ls", so it can be a program name with args.
 set dummy ls; ac_word=$2
-echo "$as_me:8311: checking for $ac_word" >&5
+echo "$as_me:7838: checking for $ac_word" >&5
 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
 if test "${ac_cv_path_PROG_LS+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -8325,7 +7852,7 @@
   test -z "$ac_dir" && ac_dir=.
   if $as_executable_p "$ac_dir/$ac_word"; then
    ac_cv_path_PROG_LS="$ac_dir/$ac_word"
-   echo "$as_me:8328: found $ac_dir/$ac_word" >&5
+   echo "$as_me:7855: found $ac_dir/$ac_word" >&5
    break
 fi
 done
@@ -8336,10 +7863,10 @@
 PROG_LS=$ac_cv_path_PROG_LS
 
 if test -n "$PROG_LS"; then
-  echo "$as_me:8339: result: $PROG_LS" >&5
+  echo "$as_me:7866: result: $PROG_LS" >&5
 echo "${ECHO_T}$PROG_LS" >&6
 else
-  echo "$as_me:8342: result: no" >&5
+  echo "$as_me:7869: result: no" >&5
 echo "${ECHO_T}no" >&6
 fi
 
@@ -8349,7 +7876,7 @@
 
 	# Extract the first word of "netstat", so it can be a program name with args.
 set dummy netstat; ac_word=$2
-echo "$as_me:8352: checking for $ac_word" >&5
+echo "$as_me:7879: checking for $ac_word" >&5
 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
 if test "${ac_cv_path_PROG_NETSTAT+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -8366,7 +7893,7 @@
   test -z "$ac_dir" && ac_dir=.
   if $as_executable_p "$ac_dir/$ac_word"; then
    ac_cv_path_PROG_NETSTAT="$ac_dir/$ac_word"
-   echo "$as_me:8369: found $ac_dir/$ac_word" >&5
+   echo "$as_me:7896: found $ac_dir/$ac_word" >&5
    break
 fi
 done
@@ -8377,10 +7904,10 @@
 PROG_NETSTAT=$ac_cv_path_PROG_NETSTAT
 
 if test -n "$PROG_NETSTAT"; then
-  echo "$as_me:8380: result: $PROG_NETSTAT" >&5
+  echo "$as_me:7907: result: $PROG_NETSTAT" >&5
 echo "${ECHO_T}$PROG_NETSTAT" >&6
 else
-  echo "$as_me:8383: result: no" >&5
+  echo "$as_me:7910: result: no" >&5
 echo "${ECHO_T}no" >&6
 fi
 
@@ -8390,7 +7917,7 @@
 
 	# Extract the first word of "arp", so it can be a program name with args.
 set dummy arp; ac_word=$2
-echo "$as_me:8393: checking for $ac_word" >&5
+echo "$as_me:7920: checking for $ac_word" >&5
 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
 if test "${ac_cv_path_PROG_ARP+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -8407,7 +7934,7 @@
   test -z "$ac_dir" && ac_dir=.
   if $as_executable_p "$ac_dir/$ac_word"; then
    ac_cv_path_PROG_ARP="$ac_dir/$ac_word"
-   echo "$as_me:8410: found $ac_dir/$ac_word" >&5
+   echo "$as_me:7937: found $ac_dir/$ac_word" >&5
    break
 fi
 done
@@ -8418,10 +7945,10 @@
 PROG_ARP=$ac_cv_path_PROG_ARP
 
 if test -n "$PROG_ARP"; then
-  echo "$as_me:8421: result: $PROG_ARP" >&5
+  echo "$as_me:7948: result: $PROG_ARP" >&5
 echo "${ECHO_T}$PROG_ARP" >&6
 else
-  echo "$as_me:8424: result: no" >&5
+  echo "$as_me:7951: result: no" >&5
 echo "${ECHO_T}no" >&6
 fi
 
@@ -8431,7 +7958,7 @@
 
 	# Extract the first word of "ifconfig", so it can be a program name with args.
 set dummy ifconfig; ac_word=$2
-echo "$as_me:8434: checking for $ac_word" >&5
+echo "$as_me:7961: checking for $ac_word" >&5
 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
 if test "${ac_cv_path_PROG_IFCONFIG+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -8448,7 +7975,7 @@
   test -z "$ac_dir" && ac_dir=.
   if $as_executable_p "$ac_dir/$ac_word"; then
    ac_cv_path_PROG_IFCONFIG="$ac_dir/$ac_word"
-   echo "$as_me:8451: found $ac_dir/$ac_word" >&5
+   echo "$as_me:7978: found $ac_dir/$ac_word" >&5
    break
 fi
 done
@@ -8459,10 +7986,10 @@
 PROG_IFCONFIG=$ac_cv_path_PROG_IFCONFIG
 
 if test -n "$PROG_IFCONFIG"; then
-  echo "$as_me:8462: result: $PROG_IFCONFIG" >&5
+  echo "$as_me:7989: result: $PROG_IFCONFIG" >&5
 echo "${ECHO_T}$PROG_IFCONFIG" >&6
 else
-  echo "$as_me:8465: result: no" >&5
+  echo "$as_me:7992: result: no" >&5
 echo "${ECHO_T}no" >&6
 fi
 
@@ -8472,7 +7999,7 @@
 
 	# Extract the first word of "jstat", so it can be a program name with args.
 set dummy jstat; ac_word=$2
-echo "$as_me:8475: checking for $ac_word" >&5
+echo "$as_me:8002: checking for $ac_word" >&5
 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
 if test "${ac_cv_path_PROG_JSTAT+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -8489,7 +8016,7 @@
   test -z "$ac_dir" && ac_dir=.
   if $as_executable_p "$ac_dir/$ac_word"; then
    ac_cv_path_PROG_JSTAT="$ac_dir/$ac_word"
-   echo "$as_me:8492: found $ac_dir/$ac_word" >&5
+   echo "$as_me:8019: found $ac_dir/$ac_word" >&5
    break
 fi
 done
@@ -8500,10 +8027,10 @@
 PROG_JSTAT=$ac_cv_path_PROG_JSTAT
 
 if test -n "$PROG_JSTAT"; then
-  echo "$as_me:8503: result: $PROG_JSTAT" >&5
+  echo "$as_me:8030: result: $PROG_JSTAT" >&5
 echo "${ECHO_T}$PROG_JSTAT" >&6
 else
-  echo "$as_me:8506: result: no" >&5
+  echo "$as_me:8033: result: no" >&5
 echo "${ECHO_T}no" >&6
 fi
 
@@ -8513,7 +8040,7 @@
 
 	# Extract the first word of "ps", so it can be a program name with args.
 set dummy ps; ac_word=$2
-echo "$as_me:8516: checking for $ac_word" >&5
+echo "$as_me:8043: checking for $ac_word" >&5
 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
 if test "${ac_cv_path_PROG_PS+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -8530,7 +8057,7 @@
   test -z "$ac_dir" && ac_dir=.
   if $as_executable_p "$ac_dir/$ac_word"; then
    ac_cv_path_PROG_PS="$ac_dir/$ac_word"
-   echo "$as_me:8533: found $ac_dir/$ac_word" >&5
+   echo "$as_me:8060: found $ac_dir/$ac_word" >&5
    break
 fi
 done
@@ -8541,10 +8068,10 @@
 PROG_PS=$ac_cv_path_PROG_PS
 
 if test -n "$PROG_PS"; then
-  echo "$as_me:8544: result: $PROG_PS" >&5
+  echo "$as_me:8071: result: $PROG_PS" >&5
 echo "${ECHO_T}$PROG_PS" >&6
 else
-  echo "$as_me:8547: result: no" >&5
+  echo "$as_me:8074: result: no" >&5
 echo "${ECHO_T}no" >&6
 fi
 
@@ -8554,7 +8081,7 @@
 
 	# Extract the first word of "sar", so it can be a program name with args.
 set dummy sar; ac_word=$2
-echo "$as_me:8557: checking for $ac_word" >&5
+echo "$as_me:8084: checking for $ac_word" >&5
 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
 if test "${ac_cv_path_PROG_SAR+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -8571,7 +8098,7 @@
   test -z "$ac_dir" && ac_dir=.
   if $as_executable_p "$ac_dir/$ac_word"; then
    ac_cv_path_PROG_SAR="$ac_dir/$ac_word"
-   echo "$as_me:8574: found $ac_dir/$ac_word" >&5
+   echo "$as_me:8101: found $ac_dir/$ac_word" >&5
    break
 fi
 done
@@ -8582,10 +8109,10 @@
 PROG_SAR=$ac_cv_path_PROG_SAR
 
 if test -n "$PROG_SAR"; then
-  echo "$as_me:8585: result: $PROG_SAR" >&5
+  echo "$as_me:8112: result: $PROG_SAR" >&5
 echo "${ECHO_T}$PROG_SAR" >&6
 else
-  echo "$as_me:8588: result: no" >&5
+  echo "$as_me:8115: result: no" >&5
 echo "${ECHO_T}no" >&6
 fi
 
@@ -8595,7 +8122,7 @@
 
 	# Extract the first word of "w", so it can be a program name with args.
 set dummy w; ac_word=$2
-echo "$as_me:8598: checking for $ac_word" >&5
+echo "$as_me:8125: checking for $ac_word" >&5
 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
 if test "${ac_cv_path_PROG_W+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -8612,7 +8139,7 @@
   test -z "$ac_dir" && ac_dir=.
   if $as_executable_p "$ac_dir/$ac_word"; then
    ac_cv_path_PROG_W="$ac_dir/$ac_word"
-   echo "$as_me:8615: found $ac_dir/$ac_word" >&5
+   echo "$as_me:8142: found $ac_dir/$ac_word" >&5
    break
 fi
 done
@@ -8623,10 +8150,10 @@
 PROG_W=$ac_cv_path_PROG_W
 
 if test -n "$PROG_W"; then
-  echo "$as_me:8626: result: $PROG_W" >&5
+  echo "$as_me:8153: result: $PROG_W" >&5
 echo "${ECHO_T}$PROG_W" >&6
 else
-  echo "$as_me:8629: result: no" >&5
+  echo "$as_me:8156: result: no" >&5
 echo "${ECHO_T}no" >&6
 fi
 
@@ -8636,7 +8163,7 @@
 
 	# Extract the first word of "who", so it can be a program name with args.
 set dummy who; ac_word=$2
-echo "$as_me:8639: checking for $ac_word" >&5
+echo "$as_me:8166: checking for $ac_word" >&5
 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
 if test "${ac_cv_path_PROG_WHO+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -8653,7 +8180,7 @@
   test -z "$ac_dir" && ac_dir=.
   if $as_executable_p "$ac_dir/$ac_word"; then
    ac_cv_path_PROG_WHO="$ac_dir/$ac_word"
-   echo "$as_me:8656: found $ac_dir/$ac_word" >&5
+   echo "$as_me:8183: found $ac_dir/$ac_word" >&5
    break
 fi
 done
@@ -8664,10 +8191,10 @@
 PROG_WHO=$ac_cv_path_PROG_WHO
 
 if test -n "$PROG_WHO"; then
-  echo "$as_me:8667: result: $PROG_WHO" >&5
+  echo "$as_me:8194: result: $PROG_WHO" >&5
 echo "${ECHO_T}$PROG_WHO" >&6
 else
-  echo "$as_me:8670: result: no" >&5
+  echo "$as_me:8197: result: no" >&5
 echo "${ECHO_T}no" >&6
 fi
 
@@ -8677,7 +8204,7 @@
 
 	# Extract the first word of "last", so it can be a program name with args.
 set dummy last; ac_word=$2
-echo "$as_me:8680: checking for $ac_word" >&5
+echo "$as_me:8207: checking for $ac_word" >&5
 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
 if test "${ac_cv_path_PROG_LAST+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -8694,7 +8221,7 @@
   test -z "$ac_dir" && ac_dir=.
   if $as_executable_p "$ac_dir/$ac_word"; then
    ac_cv_path_PROG_LAST="$ac_dir/$ac_word"
-   echo "$as_me:8697: found $ac_dir/$ac_word" >&5
+   echo "$as_me:8224: found $ac_dir/$ac_word" >&5
    break
 fi
 done
@@ -8705,10 +8232,10 @@
 PROG_LAST=$ac_cv_path_PROG_LAST
 
 if test -n "$PROG_LAST"; then
-  echo "$as_me:8708: result: $PROG_LAST" >&5
+  echo "$as_me:8235: result: $PROG_LAST" >&5
 echo "${ECHO_T}$PROG_LAST" >&6
 else
-  echo "$as_me:8711: result: no" >&5
+  echo "$as_me:8238: result: no" >&5
 echo "${ECHO_T}no" >&6
 fi
 
@@ -8718,7 +8245,7 @@
 
 	# Extract the first word of "lastlog", so it can be a program name with args.
 set dummy lastlog; ac_word=$2
-echo "$as_me:8721: checking for $ac_word" >&5
+echo "$as_me:8248: checking for $ac_word" >&5
 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
 if test "${ac_cv_path_PROG_LASTLOG+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -8735,7 +8262,7 @@
   test -z "$ac_dir" && ac_dir=.
   if $as_executable_p "$ac_dir/$ac_word"; then
    ac_cv_path_PROG_LASTLOG="$ac_dir/$ac_word"
-   echo "$as_me:8738: found $ac_dir/$ac_word" >&5
+   echo "$as_me:8265: found $ac_dir/$ac_word" >&5
    break
 fi
 done
@@ -8746,10 +8273,10 @@
 PROG_LASTLOG=$ac_cv_path_PROG_LASTLOG
 
 if test -n "$PROG_LASTLOG"; then
-  echo "$as_me:8749: result: $PROG_LASTLOG" >&5
+  echo "$as_me:8276: result: $PROG_LASTLOG" >&5
 echo "${ECHO_T}$PROG_LASTLOG" >&6
 else
-  echo "$as_me:8752: result: no" >&5
+  echo "$as_me:8279: result: no" >&5
 echo "${ECHO_T}no" >&6
 fi
 
@@ -8759,7 +8286,7 @@
 
 	# Extract the first word of "df", so it can be a program name with args.
 set dummy df; ac_word=$2
-echo "$as_me:8762: checking for $ac_word" >&5
+echo "$as_me:8289: checking for $ac_word" >&5
 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
 if test "${ac_cv_path_PROG_DF+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -8776,7 +8303,7 @@
   test -z "$ac_dir" && ac_dir=.
   if $as_executable_p "$ac_dir/$ac_word"; then
    ac_cv_path_PROG_DF="$ac_dir/$ac_word"
-   echo "$as_me:8779: found $ac_dir/$ac_word" >&5
+   echo "$as_me:8306: found $ac_dir/$ac_word" >&5
    break
 fi
 done
@@ -8787,10 +8314,10 @@
 PROG_DF=$ac_cv_path_PROG_DF
 
 if test -n "$PROG_DF"; then
-  echo "$as_me:8790: result: $PROG_DF" >&5
+  echo "$as_me:8317: result: $PROG_DF" >&5
 echo "${ECHO_T}$PROG_DF" >&6
 else
-  echo "$as_me:8793: result: no" >&5
+  echo "$as_me:8320: result: no" >&5
 echo "${ECHO_T}no" >&6
 fi
 
@@ -8800,7 +8327,7 @@
 
 	# Extract the first word of "vmstat", so it can be a program name with args.
 set dummy vmstat; ac_word=$2
-echo "$as_me:8803: checking for $ac_word" >&5
+echo "$as_me:8330: checking for $ac_word" >&5
 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
 if test "${ac_cv_path_PROG_VMSTAT+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -8817,7 +8344,7 @@
   test -z "$ac_dir" && ac_dir=.
   if $as_executable_p "$ac_dir/$ac_word"; then
    ac_cv_path_PROG_VMSTAT="$ac_dir/$ac_word"
-   echo "$as_me:8820: found $ac_dir/$ac_word" >&5
+   echo "$as_me:8347: found $ac_dir/$ac_word" >&5
    break
 fi
 done
@@ -8828,10 +8355,10 @@
 PROG_VMSTAT=$ac_cv_path_PROG_VMSTAT
 
 if test -n "$PROG_VMSTAT"; then
-  echo "$as_me:8831: result: $PROG_VMSTAT" >&5
+  echo "$as_me:8358: result: $PROG_VMSTAT" >&5
 echo "${ECHO_T}$PROG_VMSTAT" >&6
 else
-  echo "$as_me:8834: result: no" >&5
+  echo "$as_me:8361: result: no" >&5
 echo "${ECHO_T}no" >&6
 fi
 
@@ -8841,7 +8368,7 @@
 
 	# Extract the first word of "uptime", so it can be a program name with args.
 set dummy uptime; ac_word=$2
-echo "$as_me:8844: checking for $ac_word" >&5
+echo "$as_me:8371: checking for $ac_word" >&5
 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
 if test "${ac_cv_path_PROG_UPTIME+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -8858,7 +8385,7 @@
   test -z "$ac_dir" && ac_dir=.
   if $as_executable_p "$ac_dir/$ac_word"; then
    ac_cv_path_PROG_UPTIME="$ac_dir/$ac_word"
-   echo "$as_me:8861: found $ac_dir/$ac_word" >&5
+   echo "$as_me:8388: found $ac_dir/$ac_word" >&5
    break
 fi
 done
@@ -8869,10 +8396,10 @@
 PROG_UPTIME=$ac_cv_path_PROG_UPTIME
 
 if test -n "$PROG_UPTIME"; then
-  echo "$as_me:8872: result: $PROG_UPTIME" >&5
+  echo "$as_me:8399: result: $PROG_UPTIME" >&5
 echo "${ECHO_T}$PROG_UPTIME" >&6
 else
-  echo "$as_me:8875: result: no" >&5
+  echo "$as_me:8402: result: no" >&5
 echo "${ECHO_T}no" >&6
 fi
 
@@ -8882,7 +8409,7 @@
 
 	# Extract the first word of "ipcs", so it can be a program name with args.
 set dummy ipcs; ac_word=$2
-echo "$as_me:8885: checking for $ac_word" >&5
+echo "$as_me:8412: checking for $ac_word" >&5
 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
 if test "${ac_cv_path_PROG_IPCS+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -8899,7 +8426,7 @@
   test -z "$ac_dir" && ac_dir=.
   if $as_executable_p "$ac_dir/$ac_word"; then
    ac_cv_path_PROG_IPCS="$ac_dir/$ac_word"
-   echo "$as_me:8902: found $ac_dir/$ac_word" >&5
+   echo "$as_me:8429: found $ac_dir/$ac_word" >&5
    break
 fi
 done
@@ -8910,10 +8437,10 @@
 PROG_IPCS=$ac_cv_path_PROG_IPCS
 
 if test -n "$PROG_IPCS"; then
-  echo "$as_me:8913: result: $PROG_IPCS" >&5
+  echo "$as_me:8440: result: $PROG_IPCS" >&5
 echo "${ECHO_T}$PROG_IPCS" >&6
 else
-  echo "$as_me:8916: result: no" >&5
+  echo "$as_me:8443: result: no" >&5
 echo "${ECHO_T}no" >&6
 fi
 
@@ -8923,7 +8450,7 @@
 
 	# Extract the first word of "tail", so it can be a program name with args.
 set dummy tail; ac_word=$2
-echo "$as_me:8926: checking for $ac_word" >&5
+echo "$as_me:8453: checking for $ac_word" >&5
 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
 if test "${ac_cv_path_PROG_TAIL+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -8940,7 +8467,7 @@
   test -z "$ac_dir" && ac_dir=.
   if $as_executable_p "$ac_dir/$ac_word"; then
    ac_cv_path_PROG_TAIL="$ac_dir/$ac_word"
-   echo "$as_me:8943: found $ac_dir/$ac_word" >&5
+   echo "$as_me:8470: found $ac_dir/$ac_word" >&5
    break
 fi
 done
@@ -8951,10 +8478,10 @@
 PROG_TAIL=$ac_cv_path_PROG_TAIL
 
 if test -n "$PROG_TAIL"; then
-  echo "$as_me:8954: result: $PROG_TAIL" >&5
+  echo "$as_me:8481: result: $PROG_TAIL" >&5
 echo "${ECHO_T}$PROG_TAIL" >&6
 else
-  echo "$as_me:8957: result: no" >&5
+  echo "$as_me:8484: result: no" >&5
 echo "${ECHO_T}no" >&6
 fi
 
@@ -8982,21 +8509,15 @@
 fi
 
 # Checks for data types
-echo "$as_me:8985: checking for char" >&5
+echo "$as_me:8512: checking for char" >&5
 echo $ECHO_N "checking for char... $ECHO_C" >&6
 if test "${ac_cv_type_char+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line 8991 "configure"
+#line 8518 "configure"
 #include "confdefs.h"
 $ac_includes_default
-#ifdef F77_DUMMY_MAIN
-#  ifdef __cplusplus
-     extern "C"
-#  endif
-   int F77_DUMMY_MAIN() { return 1; }
-#endif
 int
 main ()
 {
@@ -9009,16 +8530,16 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:9012: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:8533: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:9015: \$? = $ac_status" >&5
+  echo "$as_me:8536: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:9018: \"$ac_try\"") >&5
+  { (eval echo "$as_me:8539: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:9021: \$? = $ac_status" >&5
+  echo "$as_me:8542: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_type_char=yes
 else
@@ -9028,10 +8549,10 @@
 fi
 rm -f conftest.$ac_objext conftest.$ac_ext
 fi
-echo "$as_me:9031: result: $ac_cv_type_char" >&5
+echo "$as_me:8552: result: $ac_cv_type_char" >&5
 echo "${ECHO_T}$ac_cv_type_char" >&6
 
-echo "$as_me:9034: checking size of char" >&5
+echo "$as_me:8555: checking size of char" >&5
 echo $ECHO_N "checking size of char... $ECHO_C" >&6
 if test "${ac_cv_sizeof_char+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -9040,15 +8561,9 @@
   if test "$cross_compiling" = yes; then
   # Depending upon the size, compute the lo and hi bounds.
 cat >conftest.$ac_ext <<_ACEOF
-#line 9043 "configure"
+#line 8564 "configure"
 #include "confdefs.h"
 $ac_includes_default
-#ifdef F77_DUMMY_MAIN
-#  ifdef __cplusplus
-     extern "C"
-#  endif
-   int F77_DUMMY_MAIN() { return 1; }
-#endif
 int
 main ()
 {
@@ -9058,29 +8573,23 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:9061: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:8576: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:9064: \$? = $ac_status" >&5
+  echo "$as_me:8579: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:9067: \"$ac_try\"") >&5
+  { (eval echo "$as_me:8582: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:9070: \$? = $ac_status" >&5
+  echo "$as_me:8585: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_lo=0 ac_mid=0
   while :; do
     cat >conftest.$ac_ext <<_ACEOF
-#line 9075 "configure"
+#line 8590 "configure"
 #include "confdefs.h"
 $ac_includes_default
-#ifdef F77_DUMMY_MAIN
-#  ifdef __cplusplus
-     extern "C"
-#  endif
-   int F77_DUMMY_MAIN() { return 1; }
-#endif
 int
 main ()
 {
@@ -9090,16 +8599,16 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:9093: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:8602: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:9096: \$? = $ac_status" >&5
+  echo "$as_me:8605: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:9099: \"$ac_try\"") >&5
+  { (eval echo "$as_me:8608: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:9102: \$? = $ac_status" >&5
+  echo "$as_me:8611: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_hi=$ac_mid; break
 else
@@ -9115,15 +8624,9 @@
 ac_hi=-1 ac_mid=-1
   while :; do
     cat >conftest.$ac_ext <<_ACEOF
-#line 9118 "configure"
+#line 8627 "configure"
 #include "confdefs.h"
 $ac_includes_default
-#ifdef F77_DUMMY_MAIN
-#  ifdef __cplusplus
-     extern "C"
-#  endif
-   int F77_DUMMY_MAIN() { return 1; }
-#endif
 int
 main ()
 {
@@ -9133,16 +8636,16 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:9136: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:8639: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:9139: \$? = $ac_status" >&5
+  echo "$as_me:8642: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:9142: \"$ac_try\"") >&5
+  { (eval echo "$as_me:8645: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:9145: \$? = $ac_status" >&5
+  echo "$as_me:8648: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_lo=$ac_mid; break
 else
@@ -9158,15 +8661,9 @@
 while test "x$ac_lo" != "x$ac_hi"; do
   ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo`
   cat >conftest.$ac_ext <<_ACEOF
-#line 9161 "configure"
+#line 8664 "configure"
 #include "confdefs.h"
 $ac_includes_default
-#ifdef F77_DUMMY_MAIN
-#  ifdef __cplusplus
-     extern "C"
-#  endif
-   int F77_DUMMY_MAIN() { return 1; }
-#endif
 int
 main ()
 {
@@ -9176,16 +8673,16 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:9179: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:8676: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:9182: \$? = $ac_status" >&5
+  echo "$as_me:8679: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:9185: \"$ac_try\"") >&5
+  { (eval echo "$as_me:8682: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:9188: \$? = $ac_status" >&5
+  echo "$as_me:8685: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_hi=$ac_mid
 else
@@ -9198,20 +8695,14 @@
 ac_cv_sizeof_char=$ac_lo
 else
   if test "$cross_compiling" = yes; then
-  { { echo "$as_me:9201: error: cannot run test program while cross compiling" >&5
+  { { echo "$as_me:8698: error: cannot run test program while cross compiling" >&5
 echo "$as_me: error: cannot run test program while cross compiling" >&2;}
    { (exit 1); exit 1; }; }
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line 9206 "configure"
+#line 8703 "configure"
 #include "confdefs.h"
 $ac_includes_default
-#ifdef F77_DUMMY_MAIN
-#  ifdef __cplusplus
-     extern "C"
-#  endif
-   int F77_DUMMY_MAIN() { return 1; }
-#endif
 int
 main ()
 {
@@ -9225,15 +8716,15 @@
 }
 _ACEOF
 rm -f conftest$ac_exeext
-if { (eval echo "$as_me:9228: \"$ac_link\"") >&5
+if { (eval echo "$as_me:8719: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:9231: \$? = $ac_status" >&5
+  echo "$as_me:8722: \$? = $ac_status" >&5
   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
-  { (eval echo "$as_me:9233: \"$ac_try\"") >&5
+  { (eval echo "$as_me:8724: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:9236: \$? = $ac_status" >&5
+  echo "$as_me:8727: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_sizeof_char=`cat conftest.val`
 else
@@ -9249,27 +8740,21 @@
   ac_cv_sizeof_char=0
 fi
 fi
-echo "$as_me:9252: result: $ac_cv_sizeof_char" >&5
+echo "$as_me:8743: result: $ac_cv_sizeof_char" >&5
 echo "${ECHO_T}$ac_cv_sizeof_char" >&6
-cat >>confdefs.h <<_ACEOF
+cat >>confdefs.h <<EOF
 #define SIZEOF_CHAR $ac_cv_sizeof_char
-_ACEOF
+EOF
 
-echo "$as_me:9258: checking for short int" >&5
+echo "$as_me:8749: checking for short int" >&5
 echo $ECHO_N "checking for short int... $ECHO_C" >&6
 if test "${ac_cv_type_short_int+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line 9264 "configure"
+#line 8755 "configure"
 #include "confdefs.h"
 $ac_includes_default
-#ifdef F77_DUMMY_MAIN
-#  ifdef __cplusplus
-     extern "C"
-#  endif
-   int F77_DUMMY_MAIN() { return 1; }
-#endif
 int
 main ()
 {
@@ -9282,16 +8767,16 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:9285: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:8770: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:9288: \$? = $ac_status" >&5
+  echo "$as_me:8773: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:9291: \"$ac_try\"") >&5
+  { (eval echo "$as_me:8776: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:9294: \$? = $ac_status" >&5
+  echo "$as_me:8779: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_type_short_int=yes
 else
@@ -9301,10 +8786,10 @@
 fi
 rm -f conftest.$ac_objext conftest.$ac_ext
 fi
-echo "$as_me:9304: result: $ac_cv_type_short_int" >&5
+echo "$as_me:8789: result: $ac_cv_type_short_int" >&5
 echo "${ECHO_T}$ac_cv_type_short_int" >&6
 
-echo "$as_me:9307: checking size of short int" >&5
+echo "$as_me:8792: checking size of short int" >&5
 echo $ECHO_N "checking size of short int... $ECHO_C" >&6
 if test "${ac_cv_sizeof_short_int+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -9313,15 +8798,9 @@
   if test "$cross_compiling" = yes; then
   # Depending upon the size, compute the lo and hi bounds.
 cat >conftest.$ac_ext <<_ACEOF
-#line 9316 "configure"
+#line 8801 "configure"
 #include "confdefs.h"
 $ac_includes_default
-#ifdef F77_DUMMY_MAIN
-#  ifdef __cplusplus
-     extern "C"
-#  endif
-   int F77_DUMMY_MAIN() { return 1; }
-#endif
 int
 main ()
 {
@@ -9331,29 +8810,23 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:9334: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:8813: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:9337: \$? = $ac_status" >&5
+  echo "$as_me:8816: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:9340: \"$ac_try\"") >&5
+  { (eval echo "$as_me:8819: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:9343: \$? = $ac_status" >&5
+  echo "$as_me:8822: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_lo=0 ac_mid=0
   while :; do
     cat >conftest.$ac_ext <<_ACEOF
-#line 9348 "configure"
+#line 8827 "configure"
 #include "confdefs.h"
 $ac_includes_default
-#ifdef F77_DUMMY_MAIN
-#  ifdef __cplusplus
-     extern "C"
-#  endif
-   int F77_DUMMY_MAIN() { return 1; }
-#endif
 int
 main ()
 {
@@ -9363,16 +8836,16 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:9366: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:8839: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:9369: \$? = $ac_status" >&5
+  echo "$as_me:8842: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:9372: \"$ac_try\"") >&5
+  { (eval echo "$as_me:8845: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:9375: \$? = $ac_status" >&5
+  echo "$as_me:8848: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_hi=$ac_mid; break
 else
@@ -9388,15 +8861,9 @@
 ac_hi=-1 ac_mid=-1
   while :; do
     cat >conftest.$ac_ext <<_ACEOF
-#line 9391 "configure"
+#line 8864 "configure"
 #include "confdefs.h"
 $ac_includes_default
-#ifdef F77_DUMMY_MAIN
-#  ifdef __cplusplus
-     extern "C"
-#  endif
-   int F77_DUMMY_MAIN() { return 1; }
-#endif
 int
 main ()
 {
@@ -9406,16 +8873,16 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:9409: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:8876: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:9412: \$? = $ac_status" >&5
+  echo "$as_me:8879: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:9415: \"$ac_try\"") >&5
+  { (eval echo "$as_me:8882: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:9418: \$? = $ac_status" >&5
+  echo "$as_me:8885: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_lo=$ac_mid; break
 else
@@ -9431,15 +8898,9 @@
 while test "x$ac_lo" != "x$ac_hi"; do
   ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo`
   cat >conftest.$ac_ext <<_ACEOF
-#line 9434 "configure"
+#line 8901 "configure"
 #include "confdefs.h"
 $ac_includes_default
-#ifdef F77_DUMMY_MAIN
-#  ifdef __cplusplus
-     extern "C"
-#  endif
-   int F77_DUMMY_MAIN() { return 1; }
-#endif
 int
 main ()
 {
@@ -9449,16 +8910,16 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:9452: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:8913: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:9455: \$? = $ac_status" >&5
+  echo "$as_me:8916: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:9458: \"$ac_try\"") >&5
+  { (eval echo "$as_me:8919: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:9461: \$? = $ac_status" >&5
+  echo "$as_me:8922: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_hi=$ac_mid
 else
@@ -9471,20 +8932,14 @@
 ac_cv_sizeof_short_int=$ac_lo
 else
   if test "$cross_compiling" = yes; then
-  { { echo "$as_me:9474: error: cannot run test program while cross compiling" >&5
+  { { echo "$as_me:8935: error: cannot run test program while cross compiling" >&5
 echo "$as_me: error: cannot run test program while cross compiling" >&2;}
    { (exit 1); exit 1; }; }
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line 9479 "configure"
+#line 8940 "configure"
 #include "confdefs.h"
 $ac_includes_default
-#ifdef F77_DUMMY_MAIN
-#  ifdef __cplusplus
-     extern "C"
-#  endif
-   int F77_DUMMY_MAIN() { return 1; }
-#endif
 int
 main ()
 {
@@ -9498,15 +8953,15 @@
 }
 _ACEOF
 rm -f conftest$ac_exeext
-if { (eval echo "$as_me:9501: \"$ac_link\"") >&5
+if { (eval echo "$as_me:8956: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:9504: \$? = $ac_status" >&5
+  echo "$as_me:8959: \$? = $ac_status" >&5
   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
-  { (eval echo "$as_me:9506: \"$ac_try\"") >&5
+  { (eval echo "$as_me:8961: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:9509: \$? = $ac_status" >&5
+  echo "$as_me:8964: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_sizeof_short_int=`cat conftest.val`
 else
@@ -9522,27 +8977,21 @@
   ac_cv_sizeof_short_int=0
 fi
 fi
-echo "$as_me:9525: result: $ac_cv_sizeof_short_int" >&5
+echo "$as_me:8980: result: $ac_cv_sizeof_short_int" >&5
 echo "${ECHO_T}$ac_cv_sizeof_short_int" >&6
-cat >>confdefs.h <<_ACEOF
+cat >>confdefs.h <<EOF
 #define SIZEOF_SHORT_INT $ac_cv_sizeof_short_int
-_ACEOF
+EOF
 
-echo "$as_me:9531: checking for int" >&5
+echo "$as_me:8986: checking for int" >&5
 echo $ECHO_N "checking for int... $ECHO_C" >&6
 if test "${ac_cv_type_int+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line 9537 "configure"
+#line 8992 "configure"
 #include "confdefs.h"
 $ac_includes_default
-#ifdef F77_DUMMY_MAIN
-#  ifdef __cplusplus
-     extern "C"
-#  endif
-   int F77_DUMMY_MAIN() { return 1; }
-#endif
 int
 main ()
 {
@@ -9555,16 +9004,16 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:9558: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:9007: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:9561: \$? = $ac_status" >&5
+  echo "$as_me:9010: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:9564: \"$ac_try\"") >&5
+  { (eval echo "$as_me:9013: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:9567: \$? = $ac_status" >&5
+  echo "$as_me:9016: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_type_int=yes
 else
@@ -9574,10 +9023,10 @@
 fi
 rm -f conftest.$ac_objext conftest.$ac_ext
 fi
-echo "$as_me:9577: result: $ac_cv_type_int" >&5
+echo "$as_me:9026: result: $ac_cv_type_int" >&5
 echo "${ECHO_T}$ac_cv_type_int" >&6
 
-echo "$as_me:9580: checking size of int" >&5
+echo "$as_me:9029: checking size of int" >&5
 echo $ECHO_N "checking size of int... $ECHO_C" >&6
 if test "${ac_cv_sizeof_int+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -9586,15 +9035,9 @@
   if test "$cross_compiling" = yes; then
   # Depending upon the size, compute the lo and hi bounds.
 cat >conftest.$ac_ext <<_ACEOF
-#line 9589 "configure"
+#line 9038 "configure"
 #include "confdefs.h"
 $ac_includes_default
-#ifdef F77_DUMMY_MAIN
-#  ifdef __cplusplus
-     extern "C"
-#  endif
-   int F77_DUMMY_MAIN() { return 1; }
-#endif
 int
 main ()
 {
@@ -9604,29 +9047,23 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:9607: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:9050: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:9610: \$? = $ac_status" >&5
+  echo "$as_me:9053: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:9613: \"$ac_try\"") >&5
+  { (eval echo "$as_me:9056: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:9616: \$? = $ac_status" >&5
+  echo "$as_me:9059: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_lo=0 ac_mid=0
   while :; do
     cat >conftest.$ac_ext <<_ACEOF
-#line 9621 "configure"
+#line 9064 "configure"
 #include "confdefs.h"
 $ac_includes_default
-#ifdef F77_DUMMY_MAIN
-#  ifdef __cplusplus
-     extern "C"
-#  endif
-   int F77_DUMMY_MAIN() { return 1; }
-#endif
 int
 main ()
 {
@@ -9636,16 +9073,16 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:9639: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:9076: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:9642: \$? = $ac_status" >&5
+  echo "$as_me:9079: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:9645: \"$ac_try\"") >&5
+  { (eval echo "$as_me:9082: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:9648: \$? = $ac_status" >&5
+  echo "$as_me:9085: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_hi=$ac_mid; break
 else
@@ -9661,15 +9098,9 @@
 ac_hi=-1 ac_mid=-1
   while :; do
     cat >conftest.$ac_ext <<_ACEOF
-#line 9664 "configure"
+#line 9101 "configure"
 #include "confdefs.h"
 $ac_includes_default
-#ifdef F77_DUMMY_MAIN
-#  ifdef __cplusplus
-     extern "C"
-#  endif
-   int F77_DUMMY_MAIN() { return 1; }
-#endif
 int
 main ()
 {
@@ -9679,16 +9110,16 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:9682: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:9113: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:9685: \$? = $ac_status" >&5
+  echo "$as_me:9116: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:9688: \"$ac_try\"") >&5
+  { (eval echo "$as_me:9119: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:9691: \$? = $ac_status" >&5
+  echo "$as_me:9122: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_lo=$ac_mid; break
 else
@@ -9704,15 +9135,9 @@
 while test "x$ac_lo" != "x$ac_hi"; do
   ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo`
   cat >conftest.$ac_ext <<_ACEOF
-#line 9707 "configure"
+#line 9138 "configure"
 #include "confdefs.h"
 $ac_includes_default
-#ifdef F77_DUMMY_MAIN
-#  ifdef __cplusplus
-     extern "C"
-#  endif
-   int F77_DUMMY_MAIN() { return 1; }
-#endif
 int
 main ()
 {
@@ -9722,16 +9147,16 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:9725: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:9150: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:9728: \$? = $ac_status" >&5
+  echo "$as_me:9153: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:9731: \"$ac_try\"") >&5
+  { (eval echo "$as_me:9156: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:9734: \$? = $ac_status" >&5
+  echo "$as_me:9159: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_hi=$ac_mid
 else
@@ -9744,20 +9169,14 @@
 ac_cv_sizeof_int=$ac_lo
 else
   if test "$cross_compiling" = yes; then
-  { { echo "$as_me:9747: error: cannot run test program while cross compiling" >&5
+  { { echo "$as_me:9172: error: cannot run test program while cross compiling" >&5
 echo "$as_me: error: cannot run test program while cross compiling" >&2;}
    { (exit 1); exit 1; }; }
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line 9752 "configure"
+#line 9177 "configure"
 #include "confdefs.h"
 $ac_includes_default
-#ifdef F77_DUMMY_MAIN
-#  ifdef __cplusplus
-     extern "C"
-#  endif
-   int F77_DUMMY_MAIN() { return 1; }
-#endif
 int
 main ()
 {
@@ -9771,15 +9190,15 @@
 }
 _ACEOF
 rm -f conftest$ac_exeext
-if { (eval echo "$as_me:9774: \"$ac_link\"") >&5
+if { (eval echo "$as_me:9193: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:9777: \$? = $ac_status" >&5
+  echo "$as_me:9196: \$? = $ac_status" >&5
   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
-  { (eval echo "$as_me:9779: \"$ac_try\"") >&5
+  { (eval echo "$as_me:9198: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:9782: \$? = $ac_status" >&5
+  echo "$as_me:9201: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_sizeof_int=`cat conftest.val`
 else
@@ -9795,27 +9214,21 @@
   ac_cv_sizeof_int=0
 fi
 fi
-echo "$as_me:9798: result: $ac_cv_sizeof_int" >&5
+echo "$as_me:9217: result: $ac_cv_sizeof_int" >&5
 echo "${ECHO_T}$ac_cv_sizeof_int" >&6
-cat >>confdefs.h <<_ACEOF
+cat >>confdefs.h <<EOF
 #define SIZEOF_INT $ac_cv_sizeof_int
-_ACEOF
+EOF
 
-echo "$as_me:9804: checking for long int" >&5
+echo "$as_me:9223: checking for long int" >&5
 echo $ECHO_N "checking for long int... $ECHO_C" >&6
 if test "${ac_cv_type_long_int+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line 9810 "configure"
+#line 9229 "configure"
 #include "confdefs.h"
 $ac_includes_default
-#ifdef F77_DUMMY_MAIN
-#  ifdef __cplusplus
-     extern "C"
-#  endif
-   int F77_DUMMY_MAIN() { return 1; }
-#endif
 int
 main ()
 {
@@ -9828,16 +9241,16 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:9831: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:9244: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:9834: \$? = $ac_status" >&5
+  echo "$as_me:9247: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:9837: \"$ac_try\"") >&5
+  { (eval echo "$as_me:9250: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:9840: \$? = $ac_status" >&5
+  echo "$as_me:9253: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_type_long_int=yes
 else
@@ -9847,10 +9260,10 @@
 fi
 rm -f conftest.$ac_objext conftest.$ac_ext
 fi
-echo "$as_me:9850: result: $ac_cv_type_long_int" >&5
+echo "$as_me:9263: result: $ac_cv_type_long_int" >&5
 echo "${ECHO_T}$ac_cv_type_long_int" >&6
 
-echo "$as_me:9853: checking size of long int" >&5
+echo "$as_me:9266: checking size of long int" >&5
 echo $ECHO_N "checking size of long int... $ECHO_C" >&6
 if test "${ac_cv_sizeof_long_int+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -9859,15 +9272,9 @@
   if test "$cross_compiling" = yes; then
   # Depending upon the size, compute the lo and hi bounds.
 cat >conftest.$ac_ext <<_ACEOF
-#line 9862 "configure"
+#line 9275 "configure"
 #include "confdefs.h"
 $ac_includes_default
-#ifdef F77_DUMMY_MAIN
-#  ifdef __cplusplus
-     extern "C"
-#  endif
-   int F77_DUMMY_MAIN() { return 1; }
-#endif
 int
 main ()
 {
@@ -9877,29 +9284,23 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:9880: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:9287: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:9883: \$? = $ac_status" >&5
+  echo "$as_me:9290: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:9886: \"$ac_try\"") >&5
+  { (eval echo "$as_me:9293: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:9889: \$? = $ac_status" >&5
+  echo "$as_me:9296: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_lo=0 ac_mid=0
   while :; do
     cat >conftest.$ac_ext <<_ACEOF
-#line 9894 "configure"
+#line 9301 "configure"
 #include "confdefs.h"
 $ac_includes_default
-#ifdef F77_DUMMY_MAIN
-#  ifdef __cplusplus
-     extern "C"
-#  endif
-   int F77_DUMMY_MAIN() { return 1; }
-#endif
 int
 main ()
 {
@@ -9909,16 +9310,16 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:9912: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:9313: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:9915: \$? = $ac_status" >&5
+  echo "$as_me:9316: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:9918: \"$ac_try\"") >&5
+  { (eval echo "$as_me:9319: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:9921: \$? = $ac_status" >&5
+  echo "$as_me:9322: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_hi=$ac_mid; break
 else
@@ -9934,15 +9335,9 @@
 ac_hi=-1 ac_mid=-1
   while :; do
     cat >conftest.$ac_ext <<_ACEOF
-#line 9937 "configure"
+#line 9338 "configure"
 #include "confdefs.h"
 $ac_includes_default
-#ifdef F77_DUMMY_MAIN
-#  ifdef __cplusplus
-     extern "C"
-#  endif
-   int F77_DUMMY_MAIN() { return 1; }
-#endif
 int
 main ()
 {
@@ -9952,16 +9347,16 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:9955: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:9350: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:9958: \$? = $ac_status" >&5
+  echo "$as_me:9353: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:9961: \"$ac_try\"") >&5
+  { (eval echo "$as_me:9356: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:9964: \$? = $ac_status" >&5
+  echo "$as_me:9359: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_lo=$ac_mid; break
 else
@@ -9977,15 +9372,9 @@
 while test "x$ac_lo" != "x$ac_hi"; do
   ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo`
   cat >conftest.$ac_ext <<_ACEOF
-#line 9980 "configure"
+#line 9375 "configure"
 #include "confdefs.h"
 $ac_includes_default
-#ifdef F77_DUMMY_MAIN
-#  ifdef __cplusplus
-     extern "C"
-#  endif
-   int F77_DUMMY_MAIN() { return 1; }
-#endif
 int
 main ()
 {
@@ -9995,16 +9384,16 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:9998: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:9387: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:10001: \$? = $ac_status" >&5
+  echo "$as_me:9390: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:10004: \"$ac_try\"") >&5
+  { (eval echo "$as_me:9393: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:10007: \$? = $ac_status" >&5
+  echo "$as_me:9396: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_hi=$ac_mid
 else
@@ -10017,20 +9406,14 @@
 ac_cv_sizeof_long_int=$ac_lo
 else
   if test "$cross_compiling" = yes; then
-  { { echo "$as_me:10020: error: cannot run test program while cross compiling" >&5
+  { { echo "$as_me:9409: error: cannot run test program while cross compiling" >&5
 echo "$as_me: error: cannot run test program while cross compiling" >&2;}
    { (exit 1); exit 1; }; }
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line 10025 "configure"
+#line 9414 "configure"
 #include "confdefs.h"
 $ac_includes_default
-#ifdef F77_DUMMY_MAIN
-#  ifdef __cplusplus
-     extern "C"
-#  endif
-   int F77_DUMMY_MAIN() { return 1; }
-#endif
 int
 main ()
 {
@@ -10044,15 +9427,15 @@
 }
 _ACEOF
 rm -f conftest$ac_exeext
-if { (eval echo "$as_me:10047: \"$ac_link\"") >&5
+if { (eval echo "$as_me:9430: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:10050: \$? = $ac_status" >&5
+  echo "$as_me:9433: \$? = $ac_status" >&5
   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
-  { (eval echo "$as_me:10052: \"$ac_try\"") >&5
+  { (eval echo "$as_me:9435: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:10055: \$? = $ac_status" >&5
+  echo "$as_me:9438: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_sizeof_long_int=`cat conftest.val`
 else
@@ -10068,27 +9451,21 @@
   ac_cv_sizeof_long_int=0
 fi
 fi
-echo "$as_me:10071: result: $ac_cv_sizeof_long_int" >&5
+echo "$as_me:9454: result: $ac_cv_sizeof_long_int" >&5
 echo "${ECHO_T}$ac_cv_sizeof_long_int" >&6
-cat >>confdefs.h <<_ACEOF
+cat >>confdefs.h <<EOF
 #define SIZEOF_LONG_INT $ac_cv_sizeof_long_int
-_ACEOF
+EOF
 
-echo "$as_me:10077: checking for long long int" >&5
+echo "$as_me:9460: checking for long long int" >&5
 echo $ECHO_N "checking for long long int... $ECHO_C" >&6
 if test "${ac_cv_type_long_long_int+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line 10083 "configure"
+#line 9466 "configure"
 #include "confdefs.h"
 $ac_includes_default
-#ifdef F77_DUMMY_MAIN
-#  ifdef __cplusplus
-     extern "C"
-#  endif
-   int F77_DUMMY_MAIN() { return 1; }
-#endif
 int
 main ()
 {
@@ -10101,16 +9478,16 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:10104: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:9481: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:10107: \$? = $ac_status" >&5
+  echo "$as_me:9484: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:10110: \"$ac_try\"") >&5
+  { (eval echo "$as_me:9487: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:10113: \$? = $ac_status" >&5
+  echo "$as_me:9490: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_type_long_long_int=yes
 else
@@ -10120,10 +9497,10 @@
 fi
 rm -f conftest.$ac_objext conftest.$ac_ext
 fi
-echo "$as_me:10123: result: $ac_cv_type_long_long_int" >&5
+echo "$as_me:9500: result: $ac_cv_type_long_long_int" >&5
 echo "${ECHO_T}$ac_cv_type_long_long_int" >&6
 
-echo "$as_me:10126: checking size of long long int" >&5
+echo "$as_me:9503: checking size of long long int" >&5
 echo $ECHO_N "checking size of long long int... $ECHO_C" >&6
 if test "${ac_cv_sizeof_long_long_int+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -10132,15 +9509,9 @@
   if test "$cross_compiling" = yes; then
   # Depending upon the size, compute the lo and hi bounds.
 cat >conftest.$ac_ext <<_ACEOF
-#line 10135 "configure"
+#line 9512 "configure"
 #include "confdefs.h"
 $ac_includes_default
-#ifdef F77_DUMMY_MAIN
-#  ifdef __cplusplus
-     extern "C"
-#  endif
-   int F77_DUMMY_MAIN() { return 1; }
-#endif
 int
 main ()
 {
@@ -10150,29 +9521,23 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:10153: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:9524: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:10156: \$? = $ac_status" >&5
+  echo "$as_me:9527: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:10159: \"$ac_try\"") >&5
+  { (eval echo "$as_me:9530: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:10162: \$? = $ac_status" >&5
+  echo "$as_me:9533: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_lo=0 ac_mid=0
   while :; do
     cat >conftest.$ac_ext <<_ACEOF
-#line 10167 "configure"
+#line 9538 "configure"
 #include "confdefs.h"
 $ac_includes_default
-#ifdef F77_DUMMY_MAIN
-#  ifdef __cplusplus
-     extern "C"
-#  endif
-   int F77_DUMMY_MAIN() { return 1; }
-#endif
 int
 main ()
 {
@@ -10182,16 +9547,16 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:10185: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:9550: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:10188: \$? = $ac_status" >&5
+  echo "$as_me:9553: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:10191: \"$ac_try\"") >&5
+  { (eval echo "$as_me:9556: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:10194: \$? = $ac_status" >&5
+  echo "$as_me:9559: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_hi=$ac_mid; break
 else
@@ -10207,15 +9572,9 @@
 ac_hi=-1 ac_mid=-1
   while :; do
     cat >conftest.$ac_ext <<_ACEOF
-#line 10210 "configure"
+#line 9575 "configure"
 #include "confdefs.h"
 $ac_includes_default
-#ifdef F77_DUMMY_MAIN
-#  ifdef __cplusplus
-     extern "C"
-#  endif
-   int F77_DUMMY_MAIN() { return 1; }
-#endif
 int
 main ()
 {
@@ -10225,16 +9584,16 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:10228: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:9587: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:10231: \$? = $ac_status" >&5
+  echo "$as_me:9590: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:10234: \"$ac_try\"") >&5
+  { (eval echo "$as_me:9593: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:10237: \$? = $ac_status" >&5
+  echo "$as_me:9596: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_lo=$ac_mid; break
 else
@@ -10250,15 +9609,9 @@
 while test "x$ac_lo" != "x$ac_hi"; do
   ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo`
   cat >conftest.$ac_ext <<_ACEOF
-#line 10253 "configure"
+#line 9612 "configure"
 #include "confdefs.h"
 $ac_includes_default
-#ifdef F77_DUMMY_MAIN
-#  ifdef __cplusplus
-     extern "C"
-#  endif
-   int F77_DUMMY_MAIN() { return 1; }
-#endif
 int
 main ()
 {
@@ -10268,16 +9621,16 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:10271: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:9624: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:10274: \$? = $ac_status" >&5
+  echo "$as_me:9627: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:10277: \"$ac_try\"") >&5
+  { (eval echo "$as_me:9630: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:10280: \$? = $ac_status" >&5
+  echo "$as_me:9633: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_hi=$ac_mid
 else
@@ -10290,20 +9643,14 @@
 ac_cv_sizeof_long_long_int=$ac_lo
 else
   if test "$cross_compiling" = yes; then
-  { { echo "$as_me:10293: error: cannot run test program while cross compiling" >&5
+  { { echo "$as_me:9646: error: cannot run test program while cross compiling" >&5
 echo "$as_me: error: cannot run test program while cross compiling" >&2;}
    { (exit 1); exit 1; }; }
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line 10298 "configure"
+#line 9651 "configure"
 #include "confdefs.h"
 $ac_includes_default
-#ifdef F77_DUMMY_MAIN
-#  ifdef __cplusplus
-     extern "C"
-#  endif
-   int F77_DUMMY_MAIN() { return 1; }
-#endif
 int
 main ()
 {
@@ -10317,15 +9664,15 @@
 }
 _ACEOF
 rm -f conftest$ac_exeext
-if { (eval echo "$as_me:10320: \"$ac_link\"") >&5
+if { (eval echo "$as_me:9667: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:10323: \$? = $ac_status" >&5
+  echo "$as_me:9670: \$? = $ac_status" >&5
   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
-  { (eval echo "$as_me:10325: \"$ac_try\"") >&5
+  { (eval echo "$as_me:9672: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:10328: \$? = $ac_status" >&5
+  echo "$as_me:9675: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_sizeof_long_long_int=`cat conftest.val`
 else
@@ -10341,29 +9688,23 @@
   ac_cv_sizeof_long_long_int=0
 fi
 fi
-echo "$as_me:10344: result: $ac_cv_sizeof_long_long_int" >&5
+echo "$as_me:9691: result: $ac_cv_sizeof_long_long_int" >&5
 echo "${ECHO_T}$ac_cv_sizeof_long_long_int" >&6
-cat >>confdefs.h <<_ACEOF
+cat >>confdefs.h <<EOF
 #define SIZEOF_LONG_LONG_INT $ac_cv_sizeof_long_long_int
-_ACEOF
+EOF
 
 # More checks for data types
-echo "$as_me:10351: checking for u_int type" >&5
+echo "$as_me:9698: checking for u_int type" >&5
 echo $ECHO_N "checking for u_int type... $ECHO_C" >&6
 if test "${ac_cv_have_u_int+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
 
 	cat >conftest.$ac_ext <<_ACEOF
-#line 10358 "configure"
+#line 9705 "configure"
 #include "confdefs.h"
  #include <sys/types.h>
-#ifdef F77_DUMMY_MAIN
-#  ifdef __cplusplus
-     extern "C"
-#  endif
-   int F77_DUMMY_MAIN() { return 1; }
-#endif
 int
 main ()
 {
@@ -10373,16 +9714,16 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:10376: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:9717: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:10379: \$? = $ac_status" >&5
+  echo "$as_me:9720: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:10382: \"$ac_try\"") >&5
+  { (eval echo "$as_me:9723: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:10385: \$? = $ac_status" >&5
+  echo "$as_me:9726: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
    ac_cv_have_u_int="yes"
 else
@@ -10394,32 +9735,26 @@
 rm -f conftest.$ac_objext conftest.$ac_ext
 
 fi
-echo "$as_me:10397: result: $ac_cv_have_u_int" >&5
+echo "$as_me:9738: result: $ac_cv_have_u_int" >&5
 echo "${ECHO_T}$ac_cv_have_u_int" >&6
 if test "x$ac_cv_have_u_int" = "xyes" ; then
-	cat >>confdefs.h <<\_ACEOF
+	cat >>confdefs.h <<\EOF
 #define HAVE_U_INT 1
-_ACEOF
+EOF
 
 	have_u_int=1
 fi
 
-echo "$as_me:10407: checking for intXX_t types" >&5
+echo "$as_me:9748: checking for intXX_t types" >&5
 echo $ECHO_N "checking for intXX_t types... $ECHO_C" >&6
 if test "${ac_cv_have_intxx_t+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
 
 	cat >conftest.$ac_ext <<_ACEOF
-#line 10414 "configure"
+#line 9755 "configure"
 #include "confdefs.h"
  #include <sys/types.h>
-#ifdef F77_DUMMY_MAIN
-#  ifdef __cplusplus
-     extern "C"
-#  endif
-   int F77_DUMMY_MAIN() { return 1; }
-#endif
 int
 main ()
 {
@@ -10429,16 +9764,16 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:10432: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:9767: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:10435: \$? = $ac_status" >&5
+  echo "$as_me:9770: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:10438: \"$ac_try\"") >&5
+  { (eval echo "$as_me:9773: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:10441: \$? = $ac_status" >&5
+  echo "$as_me:9776: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
    ac_cv_have_intxx_t="yes"
 else
@@ -10450,12 +9785,12 @@
 rm -f conftest.$ac_objext conftest.$ac_ext
 
 fi
-echo "$as_me:10453: result: $ac_cv_have_intxx_t" >&5
+echo "$as_me:9788: result: $ac_cv_have_intxx_t" >&5
 echo "${ECHO_T}$ac_cv_have_intxx_t" >&6
 if test "x$ac_cv_have_intxx_t" = "xyes" ; then
-	cat >>confdefs.h <<\_ACEOF
+	cat >>confdefs.h <<\EOF
 #define HAVE_INTXX_T 1
-_ACEOF
+EOF
 
 	have_intxx_t=1
 fi
@@ -10463,18 +9798,12 @@
 if (test -z "$have_intxx_t" && \
            test "x$ac_cv_header_stdint_h" = "xyes")
 then
-    echo "$as_me:10466: checking for intXX_t types in stdint.h" >&5
+    echo "$as_me:9801: checking for intXX_t types in stdint.h" >&5
 echo $ECHO_N "checking for intXX_t types in stdint.h... $ECHO_C" >&6
 	cat >conftest.$ac_ext <<_ACEOF
-#line 10469 "configure"
+#line 9804 "configure"
 #include "confdefs.h"
  #include <stdint.h>
-#ifdef F77_DUMMY_MAIN
-#  ifdef __cplusplus
-     extern "C"
-#  endif
-   int F77_DUMMY_MAIN() { return 1; }
-#endif
 int
 main ()
 {
@@ -10484,51 +9813,45 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:10487: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:9816: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:10490: \$? = $ac_status" >&5
+  echo "$as_me:9819: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:10493: \"$ac_try\"") >&5
+  { (eval echo "$as_me:9822: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:10496: \$? = $ac_status" >&5
+  echo "$as_me:9825: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
 
-			cat >>confdefs.h <<\_ACEOF
+			cat >>confdefs.h <<\EOF
 #define HAVE_INTXX_T 1
-_ACEOF
+EOF
 
-			echo "$as_me:10503: result: yes" >&5
+			echo "$as_me:9832: result: yes" >&5
 echo "${ECHO_T}yes" >&6
 
 else
   echo "$as_me: failed program was:" >&5
 cat conftest.$ac_ext >&5
- echo "$as_me:10509: result: no" >&5
+ echo "$as_me:9838: result: no" >&5
 echo "${ECHO_T}no" >&6
 
 fi
 rm -f conftest.$ac_objext conftest.$ac_ext
 fi
 
-echo "$as_me:10516: checking for int64_t type" >&5
+echo "$as_me:9845: checking for int64_t type" >&5
 echo $ECHO_N "checking for int64_t type... $ECHO_C" >&6
 if test "${ac_cv_have_int64_t+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
 
 	cat >conftest.$ac_ext <<_ACEOF
-#line 10523 "configure"
+#line 9852 "configure"
 #include "confdefs.h"
  #include <sys/types.h>
-#ifdef F77_DUMMY_MAIN
-#  ifdef __cplusplus
-     extern "C"
-#  endif
-   int F77_DUMMY_MAIN() { return 1; }
-#endif
 int
 main ()
 {
@@ -10538,16 +9861,16 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:10541: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:9864: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:10544: \$? = $ac_status" >&5
+  echo "$as_me:9867: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:10547: \"$ac_try\"") >&5
+  { (eval echo "$as_me:9870: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:10550: \$? = $ac_status" >&5
+  echo "$as_me:9873: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
    ac_cv_have_int64_t="yes"
 else
@@ -10559,29 +9882,23 @@
 rm -f conftest.$ac_objext conftest.$ac_ext
 
 fi
-echo "$as_me:10562: result: $ac_cv_have_int64_t" >&5
+echo "$as_me:9885: result: $ac_cv_have_int64_t" >&5
 echo "${ECHO_T}$ac_cv_have_int64_t" >&6
 if test "x$ac_cv_have_int64_t" = "xyes" ; then
-	cat >>confdefs.h <<\_ACEOF
+	cat >>confdefs.h <<\EOF
 #define HAVE_INT64_T 1
-_ACEOF
+EOF
 
 	have_int64_t=1
 fi
 
 if test -z "$have_int64_t" ; then
-    echo "$as_me:10573: checking for int64_t type in sys/socket.h" >&5
+    echo "$as_me:9896: checking for int64_t type in sys/socket.h" >&5
 echo $ECHO_N "checking for int64_t type in sys/socket.h... $ECHO_C" >&6
 	cat >conftest.$ac_ext <<_ACEOF
-#line 10576 "configure"
+#line 9899 "configure"
 #include "confdefs.h"
  #include <sys/socket.h>
-#ifdef F77_DUMMY_MAIN
-#  ifdef __cplusplus
-     extern "C"
-#  endif
-   int F77_DUMMY_MAIN() { return 1; }
-#endif
 int
 main ()
 {
@@ -10591,29 +9908,29 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:10594: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:9911: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:10597: \$? = $ac_status" >&5
+  echo "$as_me:9914: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:10600: \"$ac_try\"") >&5
+  { (eval echo "$as_me:9917: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:10603: \$? = $ac_status" >&5
+  echo "$as_me:9920: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
 
-			cat >>confdefs.h <<\_ACEOF
+			cat >>confdefs.h <<\EOF
 #define HAVE_INT64_T 1
-_ACEOF
+EOF
 
-			echo "$as_me:10610: result: yes" >&5
+			echo "$as_me:9927: result: yes" >&5
 echo "${ECHO_T}yes" >&6
 
 else
   echo "$as_me: failed program was:" >&5
 cat conftest.$ac_ext >&5
- echo "$as_me:10616: result: no" >&5
+ echo "$as_me:9933: result: no" >&5
 echo "${ECHO_T}no" >&6
 
 fi
@@ -10621,18 +9938,12 @@
 fi
 
 if test -z "$have_int64_t" ; then
-    echo "$as_me:10624: checking for int64_t type in sys/bitypes.h" >&5
+    echo "$as_me:9941: checking for int64_t type in sys/bitypes.h" >&5
 echo $ECHO_N "checking for int64_t type in sys/bitypes.h... $ECHO_C" >&6
 	cat >conftest.$ac_ext <<_ACEOF
-#line 10627 "configure"
+#line 9944 "configure"
 #include "confdefs.h"
  #include <sys/bitypes.h>
-#ifdef F77_DUMMY_MAIN
-#  ifdef __cplusplus
-     extern "C"
-#  endif
-   int F77_DUMMY_MAIN() { return 1; }
-#endif
 int
 main ()
 {
@@ -10642,51 +9953,45 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:10645: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:9956: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:10648: \$? = $ac_status" >&5
+  echo "$as_me:9959: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:10651: \"$ac_try\"") >&5
+  { (eval echo "$as_me:9962: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:10654: \$? = $ac_status" >&5
+  echo "$as_me:9965: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
 
-			cat >>confdefs.h <<\_ACEOF
+			cat >>confdefs.h <<\EOF
 #define HAVE_INT64_T 1
-_ACEOF
+EOF
 
-			echo "$as_me:10661: result: yes" >&5
+			echo "$as_me:9972: result: yes" >&5
 echo "${ECHO_T}yes" >&6
 
 else
   echo "$as_me: failed program was:" >&5
 cat conftest.$ac_ext >&5
- echo "$as_me:10667: result: no" >&5
+ echo "$as_me:9978: result: no" >&5
 echo "${ECHO_T}no" >&6
 
 fi
 rm -f conftest.$ac_objext conftest.$ac_ext
 fi
 
-echo "$as_me:10674: checking for u_intXX_t types" >&5
+echo "$as_me:9985: checking for u_intXX_t types" >&5
 echo $ECHO_N "checking for u_intXX_t types... $ECHO_C" >&6
 if test "${ac_cv_have_u_intxx_t+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
 
 	cat >conftest.$ac_ext <<_ACEOF
-#line 10681 "configure"
+#line 9992 "configure"
 #include "confdefs.h"
  #include <sys/types.h>
-#ifdef F77_DUMMY_MAIN
-#  ifdef __cplusplus
-     extern "C"
-#  endif
-   int F77_DUMMY_MAIN() { return 1; }
-#endif
 int
 main ()
 {
@@ -10696,16 +10001,16 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:10699: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:10004: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:10702: \$? = $ac_status" >&5
+  echo "$as_me:10007: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:10705: \"$ac_try\"") >&5
+  { (eval echo "$as_me:10010: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:10708: \$? = $ac_status" >&5
+  echo "$as_me:10013: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
    ac_cv_have_u_intxx_t="yes"
 else
@@ -10717,29 +10022,23 @@
 rm -f conftest.$ac_objext conftest.$ac_ext
 
 fi
-echo "$as_me:10720: result: $ac_cv_have_u_intxx_t" >&5
+echo "$as_me:10025: result: $ac_cv_have_u_intxx_t" >&5
 echo "${ECHO_T}$ac_cv_have_u_intxx_t" >&6
 if test "x$ac_cv_have_u_intxx_t" = "xyes" ; then
-	cat >>confdefs.h <<\_ACEOF
+	cat >>confdefs.h <<\EOF
 #define HAVE_U_INTXX_T 1
-_ACEOF
+EOF
 
 	have_u_intxx_t=1
 fi
 
 if test -z "$have_u_intxx_t" ; then
-    echo "$as_me:10731: checking for u_intXX_t types in sys/socket.h" >&5
+    echo "$as_me:10036: checking for u_intXX_t types in sys/socket.h" >&5
 echo $ECHO_N "checking for u_intXX_t types in sys/socket.h... $ECHO_C" >&6
 	cat >conftest.$ac_ext <<_ACEOF
-#line 10734 "configure"
+#line 10039 "configure"
 #include "confdefs.h"
  #include <sys/socket.h>
-#ifdef F77_DUMMY_MAIN
-#  ifdef __cplusplus
-     extern "C"
-#  endif
-   int F77_DUMMY_MAIN() { return 1; }
-#endif
 int
 main ()
 {
@@ -10749,51 +10048,45 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:10752: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:10051: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:10755: \$? = $ac_status" >&5
+  echo "$as_me:10054: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:10758: \"$ac_try\"") >&5
+  { (eval echo "$as_me:10057: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:10761: \$? = $ac_status" >&5
+  echo "$as_me:10060: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
 
-			cat >>confdefs.h <<\_ACEOF
+			cat >>confdefs.h <<\EOF
 #define HAVE_U_INTXX_T 1
-_ACEOF
+EOF
 
-			echo "$as_me:10768: result: yes" >&5
+			echo "$as_me:10067: result: yes" >&5
 echo "${ECHO_T}yes" >&6
 
 else
   echo "$as_me: failed program was:" >&5
 cat conftest.$ac_ext >&5
- echo "$as_me:10774: result: no" >&5
+ echo "$as_me:10073: result: no" >&5
 echo "${ECHO_T}no" >&6
 
 fi
 rm -f conftest.$ac_objext conftest.$ac_ext
 fi
 
-echo "$as_me:10781: checking for u_int64_t types" >&5
+echo "$as_me:10080: checking for u_int64_t types" >&5
 echo $ECHO_N "checking for u_int64_t types... $ECHO_C" >&6
 if test "${ac_cv_have_u_int64_t+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
 
 	cat >conftest.$ac_ext <<_ACEOF
-#line 10788 "configure"
+#line 10087 "configure"
 #include "confdefs.h"
  #include <sys/types.h>
-#ifdef F77_DUMMY_MAIN
-#  ifdef __cplusplus
-     extern "C"
-#  endif
-   int F77_DUMMY_MAIN() { return 1; }
-#endif
 int
 main ()
 {
@@ -10803,16 +10096,16 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:10806: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:10099: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:10809: \$? = $ac_status" >&5
+  echo "$as_me:10102: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:10812: \"$ac_try\"") >&5
+  { (eval echo "$as_me:10105: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:10815: \$? = $ac_status" >&5
+  echo "$as_me:10108: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
    ac_cv_have_u_int64_t="yes"
 else
@@ -10824,29 +10117,23 @@
 rm -f conftest.$ac_objext conftest.$ac_ext
 
 fi
-echo "$as_me:10827: result: $ac_cv_have_u_int64_t" >&5
+echo "$as_me:10120: result: $ac_cv_have_u_int64_t" >&5
 echo "${ECHO_T}$ac_cv_have_u_int64_t" >&6
 if test "x$ac_cv_have_u_int64_t" = "xyes" ; then
-	cat >>confdefs.h <<\_ACEOF
+	cat >>confdefs.h <<\EOF
 #define HAVE_U_INT64_T 1
-_ACEOF
+EOF
 
 	have_u_int64_t=1
 fi
 
 if test -z "$have_u_int64_t" ; then
-    echo "$as_me:10838: checking for u_int64_t type in sys/bitypes.h" >&5
+    echo "$as_me:10131: checking for u_int64_t type in sys/bitypes.h" >&5
 echo $ECHO_N "checking for u_int64_t type in sys/bitypes.h... $ECHO_C" >&6
 	cat >conftest.$ac_ext <<_ACEOF
-#line 10841 "configure"
+#line 10134 "configure"
 #include "confdefs.h"
  #include <sys/bitypes.h>
-#ifdef F77_DUMMY_MAIN
-#  ifdef __cplusplus
-     extern "C"
-#  endif
-   int F77_DUMMY_MAIN() { return 1; }
-#endif
 int
 main ()
 {
@@ -10856,29 +10143,29 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:10859: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:10146: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:10862: \$? = $ac_status" >&5
+  echo "$as_me:10149: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:10865: \"$ac_try\"") >&5
+  { (eval echo "$as_me:10152: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:10868: \$? = $ac_status" >&5
+  echo "$as_me:10155: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
 
-			cat >>confdefs.h <<\_ACEOF
+			cat >>confdefs.h <<\EOF
 #define HAVE_U_INT64_T 1
-_ACEOF
+EOF
 
-			echo "$as_me:10875: result: yes" >&5
+			echo "$as_me:10162: result: yes" >&5
 echo "${ECHO_T}yes" >&6
 
 else
   echo "$as_me: failed program was:" >&5
 cat conftest.$ac_ext >&5
- echo "$as_me:10881: result: no" >&5
+ echo "$as_me:10168: result: no" >&5
 echo "${ECHO_T}no" >&6
 
 fi
@@ -10886,24 +10173,18 @@
 fi
 
 if test -z "$have_u_intxx_t" ; then
-	echo "$as_me:10889: checking for uintXX_t types" >&5
+	echo "$as_me:10176: checking for uintXX_t types" >&5
 echo $ECHO_N "checking for uintXX_t types... $ECHO_C" >&6
 if test "${ac_cv_have_uintxx_t+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
 
 		cat >conftest.$ac_ext <<_ACEOF
-#line 10896 "configure"
+#line 10183 "configure"
 #include "confdefs.h"
 
 #include <sys/types.h>
 
-#ifdef F77_DUMMY_MAIN
-#  ifdef __cplusplus
-     extern "C"
-#  endif
-   int F77_DUMMY_MAIN() { return 1; }
-#endif
 int
 main ()
 {
@@ -10913,16 +10194,16 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:10916: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:10197: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:10919: \$? = $ac_status" >&5
+  echo "$as_me:10200: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:10922: \"$ac_try\"") >&5
+  { (eval echo "$as_me:10203: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:10925: \$? = $ac_status" >&5
+  echo "$as_me:10206: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
    ac_cv_have_uintxx_t="yes"
 else
@@ -10934,29 +10215,23 @@
 rm -f conftest.$ac_objext conftest.$ac_ext
 
 fi
-echo "$as_me:10937: result: $ac_cv_have_uintxx_t" >&5
+echo "$as_me:10218: result: $ac_cv_have_uintxx_t" >&5
 echo "${ECHO_T}$ac_cv_have_uintxx_t" >&6
 	if test "x$ac_cv_have_uintxx_t" = "xyes" ; then
-		cat >>confdefs.h <<\_ACEOF
+		cat >>confdefs.h <<\EOF
 #define HAVE_UINTXX_T 1
-_ACEOF
+EOF
 
 	fi
 fi
 
 if test -z "$have_uintxx_t" ; then
-    echo "$as_me:10948: checking for uintXX_t types in stdint.h" >&5
+    echo "$as_me:10229: checking for uintXX_t types in stdint.h" >&5
 echo $ECHO_N "checking for uintXX_t types in stdint.h... $ECHO_C" >&6
 	cat >conftest.$ac_ext <<_ACEOF
-#line 10951 "configure"
+#line 10232 "configure"
 #include "confdefs.h"
  #include <stdint.h>
-#ifdef F77_DUMMY_MAIN
-#  ifdef __cplusplus
-     extern "C"
-#  endif
-   int F77_DUMMY_MAIN() { return 1; }
-#endif
 int
 main ()
 {
@@ -10966,29 +10241,29 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:10969: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:10244: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:10972: \$? = $ac_status" >&5
+  echo "$as_me:10247: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:10975: \"$ac_try\"") >&5
+  { (eval echo "$as_me:10250: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:10978: \$? = $ac_status" >&5
+  echo "$as_me:10253: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
 
-			cat >>confdefs.h <<\_ACEOF
+			cat >>confdefs.h <<\EOF
 #define HAVE_UINTXX_T 1
-_ACEOF
+EOF
 
-			echo "$as_me:10985: result: yes" >&5
+			echo "$as_me:10260: result: yes" >&5
 echo "${ECHO_T}yes" >&6
 
 else
   echo "$as_me: failed program was:" >&5
 cat conftest.$ac_ext >&5
- echo "$as_me:10991: result: no" >&5
+ echo "$as_me:10266: result: no" >&5
 echo "${ECHO_T}no" >&6
 
 fi
@@ -10998,20 +10273,14 @@
 if (test -z "$have_u_intxx_t" || test -z "$have_intxx_t" && \
            test "x$ac_cv_header_sys_bitypes_h" = "xyes")
 then
-	echo "$as_me:11001: checking for intXX_t and u_intXX_t types in sys/bitypes.h" >&5
+	echo "$as_me:10276: checking for intXX_t and u_intXX_t types in sys/bitypes.h" >&5
 echo $ECHO_N "checking for intXX_t and u_intXX_t types in sys/bitypes.h... $ECHO_C" >&6
 	cat >conftest.$ac_ext <<_ACEOF
-#line 11004 "configure"
+#line 10279 "configure"
 #include "confdefs.h"
 
 #include <sys/bitypes.h>
 
-#ifdef F77_DUMMY_MAIN
-#  ifdef __cplusplus
-     extern "C"
-#  endif
-   int F77_DUMMY_MAIN() { return 1; }
-#endif
 int
 main ()
 {
@@ -11025,57 +10294,51 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:11028: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:10297: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:11031: \$? = $ac_status" >&5
+  echo "$as_me:10300: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:11034: \"$ac_try\"") >&5
+  { (eval echo "$as_me:10303: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:11037: \$? = $ac_status" >&5
+  echo "$as_me:10306: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
 
-			cat >>confdefs.h <<\_ACEOF
+			cat >>confdefs.h <<\EOF
 #define HAVE_U_INTXX_T 1
-_ACEOF
+EOF
 
-			cat >>confdefs.h <<\_ACEOF
+			cat >>confdefs.h <<\EOF
 #define HAVE_INTXX_T 1
-_ACEOF
+EOF
 
-			echo "$as_me:11048: result: yes" >&5
+			echo "$as_me:10317: result: yes" >&5
 echo "${ECHO_T}yes" >&6
 
 else
   echo "$as_me: failed program was:" >&5
 cat conftest.$ac_ext >&5
-echo "$as_me:11054: result: no" >&5
+echo "$as_me:10323: result: no" >&5
 echo "${ECHO_T}no" >&6
 
 fi
 rm -f conftest.$ac_objext conftest.$ac_ext
 fi
 
-echo "$as_me:11061: checking for u_char" >&5
+echo "$as_me:10330: checking for u_char" >&5
 echo $ECHO_N "checking for u_char... $ECHO_C" >&6
 if test "${ac_cv_have_u_char+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
 
 	cat >conftest.$ac_ext <<_ACEOF
-#line 11068 "configure"
+#line 10337 "configure"
 #include "confdefs.h"
 
 #include <sys/types.h>
 
-#ifdef F77_DUMMY_MAIN
-#  ifdef __cplusplus
-     extern "C"
-#  endif
-   int F77_DUMMY_MAIN() { return 1; }
-#endif
 int
 main ()
 {
@@ -11085,16 +10348,16 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:11088: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:10351: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:11091: \$? = $ac_status" >&5
+  echo "$as_me:10354: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:11094: \"$ac_try\"") >&5
+  { (eval echo "$as_me:10357: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:11097: \$? = $ac_status" >&5
+  echo "$as_me:10360: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
    ac_cv_have_u_char="yes"
 else
@@ -11106,32 +10369,26 @@
 rm -f conftest.$ac_objext conftest.$ac_ext
 
 fi
-echo "$as_me:11109: result: $ac_cv_have_u_char" >&5
+echo "$as_me:10372: result: $ac_cv_have_u_char" >&5
 echo "${ECHO_T}$ac_cv_have_u_char" >&6
 if test "x$ac_cv_have_u_char" = "xyes" ; then
-	cat >>confdefs.h <<\_ACEOF
+	cat >>confdefs.h <<\EOF
 #define HAVE_U_CHAR 1
-_ACEOF
+EOF
 
 fi
 
-   echo "$as_me:11118: checking for socklen_t" >&5
+   echo "$as_me:10381: checking for socklen_t" >&5
 echo $ECHO_N "checking for socklen_t... $ECHO_C" >&6
 if test "${ac_cv_type_socklen_t+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line 11124 "configure"
+#line 10387 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <sys/socket.h>
 
-#ifdef F77_DUMMY_MAIN
-#  ifdef __cplusplus
-     extern "C"
-#  endif
-   int F77_DUMMY_MAIN() { return 1; }
-#endif
 int
 main ()
 {
@@ -11144,16 +10401,16 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:11147: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:10404: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:11150: \$? = $ac_status" >&5
+  echo "$as_me:10407: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:11153: \"$ac_try\"") >&5
+  { (eval echo "$as_me:10410: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:11156: \$? = $ac_status" >&5
+  echo "$as_me:10413: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_type_socklen_t=yes
 else
@@ -11163,13 +10420,13 @@
 fi
 rm -f conftest.$ac_objext conftest.$ac_ext
 fi
-echo "$as_me:11166: result: $ac_cv_type_socklen_t" >&5
+echo "$as_me:10423: result: $ac_cv_type_socklen_t" >&5
 echo "${ECHO_T}$ac_cv_type_socklen_t" >&6
 if test $ac_cv_type_socklen_t = yes; then
   :
 else
 
-      echo "$as_me:11172: checking for socklen_t equivalent" >&5
+      echo "$as_me:10429: checking for socklen_t equivalent" >&5
 echo $ECHO_N "checking for socklen_t equivalent... $ECHO_C" >&6
       if test "${curl_cv_socklen_t_equiv+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -11181,7 +10438,7 @@
 	 for arg2 in "struct sockaddr" void; do
 	    for t in int size_t unsigned long "unsigned long"; do
 	       cat >conftest.$ac_ext <<_ACEOF
-#line 11184 "configure"
+#line 10441 "configure"
 #include "confdefs.h"
 
 		  #include <sys/types.h>
@@ -11189,12 +10446,6 @@
 
 		  int getpeername (int, $arg2 *, $t *);
 
-#ifdef F77_DUMMY_MAIN
-#  ifdef __cplusplus
-     extern "C"
-#  endif
-   int F77_DUMMY_MAIN() { return 1; }
-#endif
 int
 main ()
 {
@@ -11207,16 +10458,16 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:11210: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:10461: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:11213: \$? = $ac_status" >&5
+  echo "$as_me:10464: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:11216: \"$ac_try\"") >&5
+  { (eval echo "$as_me:10467: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:11219: \$? = $ac_status" >&5
+  echo "$as_me:10470: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
 
 		  curl_cv_socklen_t_equiv="$t"
@@ -11231,38 +10482,32 @@
 	 done
 
 	 if test "x$curl_cv_socklen_t_equiv" = x; then
-	    { { echo "$as_me:11234: error: Cannot find a type to use in place of socklen_t" >&5
+	    { { echo "$as_me:10485: error: Cannot find a type to use in place of socklen_t" >&5
 echo "$as_me: error: Cannot find a type to use in place of socklen_t" >&2;}
    { (exit 1); exit 1; }; }
 	 fi
 
 fi
 
-      echo "$as_me:11241: result: $curl_cv_socklen_t_equiv" >&5
+      echo "$as_me:10492: result: $curl_cv_socklen_t_equiv" >&5
 echo "${ECHO_T}$curl_cv_socklen_t_equiv" >&6
 
-cat >>confdefs.h <<_ACEOF
+cat >>confdefs.h <<EOF
 #define socklen_t $curl_cv_socklen_t_equiv
-_ACEOF
+EOF
 
 fi
 
-echo "$as_me:11250: checking for sig_atomic_t" >&5
+echo "$as_me:10501: checking for sig_atomic_t" >&5
 echo $ECHO_N "checking for sig_atomic_t... $ECHO_C" >&6
 if test "${ac_cv_type_sig_atomic_t+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line 11256 "configure"
+#line 10507 "configure"
 #include "confdefs.h"
 #include <signal.h>
 
-#ifdef F77_DUMMY_MAIN
-#  ifdef __cplusplus
-     extern "C"
-#  endif
-   int F77_DUMMY_MAIN() { return 1; }
-#endif
 int
 main ()
 {
@@ -11275,16 +10520,16 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:11278: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:10523: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:11281: \$? = $ac_status" >&5
+  echo "$as_me:10526: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:11284: \"$ac_try\"") >&5
+  { (eval echo "$as_me:10529: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:11287: \$? = $ac_status" >&5
+  echo "$as_me:10532: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_type_sig_atomic_t=yes
 else
@@ -11294,34 +10539,28 @@
 fi
 rm -f conftest.$ac_objext conftest.$ac_ext
 fi
-echo "$as_me:11297: result: $ac_cv_type_sig_atomic_t" >&5
+echo "$as_me:10542: result: $ac_cv_type_sig_atomic_t" >&5
 echo "${ECHO_T}$ac_cv_type_sig_atomic_t" >&6
 if test $ac_cv_type_sig_atomic_t = yes; then
 
-cat >>confdefs.h <<_ACEOF
+cat >>confdefs.h <<EOF
 #define HAVE_SIG_ATOMIC_T 1
-_ACEOF
+EOF
 
 fi
 
-echo "$as_me:11307: checking for size_t" >&5
+echo "$as_me:10552: checking for size_t" >&5
 echo $ECHO_N "checking for size_t... $ECHO_C" >&6
 if test "${ac_cv_have_size_t+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
 
 	cat >conftest.$ac_ext <<_ACEOF
-#line 11314 "configure"
+#line 10559 "configure"
 #include "confdefs.h"
 
 #include <sys/types.h>
 
-#ifdef F77_DUMMY_MAIN
-#  ifdef __cplusplus
-     extern "C"
-#  endif
-   int F77_DUMMY_MAIN() { return 1; }
-#endif
 int
 main ()
 {
@@ -11331,16 +10570,16 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:11334: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:10573: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:11337: \$? = $ac_status" >&5
+  echo "$as_me:10576: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:11340: \"$ac_try\"") >&5
+  { (eval echo "$as_me:10579: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:11343: \$? = $ac_status" >&5
+  echo "$as_me:10582: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
    ac_cv_have_size_t="yes"
 else
@@ -11352,33 +10591,27 @@
 rm -f conftest.$ac_objext conftest.$ac_ext
 
 fi
-echo "$as_me:11355: result: $ac_cv_have_size_t" >&5
+echo "$as_me:10594: result: $ac_cv_have_size_t" >&5
 echo "${ECHO_T}$ac_cv_have_size_t" >&6
 if test "x$ac_cv_have_size_t" = "xyes" ; then
-	cat >>confdefs.h <<\_ACEOF
+	cat >>confdefs.h <<\EOF
 #define HAVE_SIZE_T 1
-_ACEOF
+EOF
 
 fi
 
-echo "$as_me:11364: checking for ssize_t" >&5
+echo "$as_me:10603: checking for ssize_t" >&5
 echo $ECHO_N "checking for ssize_t... $ECHO_C" >&6
 if test "${ac_cv_have_ssize_t+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
 
 	cat >conftest.$ac_ext <<_ACEOF
-#line 11371 "configure"
+#line 10610 "configure"
 #include "confdefs.h"
 
 #include <sys/types.h>
 
-#ifdef F77_DUMMY_MAIN
-#  ifdef __cplusplus
-     extern "C"
-#  endif
-   int F77_DUMMY_MAIN() { return 1; }
-#endif
 int
 main ()
 {
@@ -11388,16 +10621,16 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:11391: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:10624: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:11394: \$? = $ac_status" >&5
+  echo "$as_me:10627: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:11397: \"$ac_try\"") >&5
+  { (eval echo "$as_me:10630: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:11400: \$? = $ac_status" >&5
+  echo "$as_me:10633: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
    ac_cv_have_ssize_t="yes"
 else
@@ -11409,33 +10642,27 @@
 rm -f conftest.$ac_objext conftest.$ac_ext
 
 fi
-echo "$as_me:11412: result: $ac_cv_have_ssize_t" >&5
+echo "$as_me:10645: result: $ac_cv_have_ssize_t" >&5
 echo "${ECHO_T}$ac_cv_have_ssize_t" >&6
 if test "x$ac_cv_have_ssize_t" = "xyes" ; then
-	cat >>confdefs.h <<\_ACEOF
+	cat >>confdefs.h <<\EOF
 #define HAVE_SSIZE_T 1
-_ACEOF
+EOF
 
 fi
 
-echo "$as_me:11421: checking for clock_t" >&5
+echo "$as_me:10654: checking for clock_t" >&5
 echo $ECHO_N "checking for clock_t... $ECHO_C" >&6
 if test "${ac_cv_have_clock_t+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
 
 	cat >conftest.$ac_ext <<_ACEOF
-#line 11428 "configure"
+#line 10661 "configure"
 #include "confdefs.h"
 
 #include <time.h>
 
-#ifdef F77_DUMMY_MAIN
-#  ifdef __cplusplus
-     extern "C"
-#  endif
-   int F77_DUMMY_MAIN() { return 1; }
-#endif
 int
 main ()
 {
@@ -11445,16 +10672,16 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:11448: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:10675: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:11451: \$? = $ac_status" >&5
+  echo "$as_me:10678: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:11454: \"$ac_try\"") >&5
+  { (eval echo "$as_me:10681: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:11457: \$? = $ac_status" >&5
+  echo "$as_me:10684: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
    ac_cv_have_clock_t="yes"
 else
@@ -11466,34 +10693,28 @@
 rm -f conftest.$ac_objext conftest.$ac_ext
 
 fi
-echo "$as_me:11469: result: $ac_cv_have_clock_t" >&5
+echo "$as_me:10696: result: $ac_cv_have_clock_t" >&5
 echo "${ECHO_T}$ac_cv_have_clock_t" >&6
 if test "x$ac_cv_have_clock_t" = "xyes" ; then
-	cat >>confdefs.h <<\_ACEOF
+	cat >>confdefs.h <<\EOF
 #define HAVE_CLOCK_T 1
-_ACEOF
+EOF
 
 fi
 
-echo "$as_me:11478: checking for sa_family_t" >&5
+echo "$as_me:10705: checking for sa_family_t" >&5
 echo $ECHO_N "checking for sa_family_t... $ECHO_C" >&6
 if test "${ac_cv_have_sa_family_t+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
 
 	cat >conftest.$ac_ext <<_ACEOF
-#line 11485 "configure"
+#line 10712 "configure"
 #include "confdefs.h"
 
 #include <sys/types.h>
 #include <sys/socket.h>
 
-#ifdef F77_DUMMY_MAIN
-#  ifdef __cplusplus
-     extern "C"
-#  endif
-   int F77_DUMMY_MAIN() { return 1; }
-#endif
 int
 main ()
 {
@@ -11503,35 +10724,29 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:11506: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:10727: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:11509: \$? = $ac_status" >&5
+  echo "$as_me:10730: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:11512: \"$ac_try\"") >&5
+  { (eval echo "$as_me:10733: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:11515: \$? = $ac_status" >&5
+  echo "$as_me:10736: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
    ac_cv_have_sa_family_t="yes"
 else
   echo "$as_me: failed program was:" >&5
 cat conftest.$ac_ext >&5
  cat >conftest.$ac_ext <<_ACEOF
-#line 11522 "configure"
+#line 10743 "configure"
 #include "confdefs.h"
 
 #include <sys/types.h>
 #include <sys/socket.h>
 #include <netinet/in.h>
 
-#ifdef F77_DUMMY_MAIN
-#  ifdef __cplusplus
-     extern "C"
-#  endif
-   int F77_DUMMY_MAIN() { return 1; }
-#endif
 int
 main ()
 {
@@ -11541,16 +10756,16 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:11544: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:10759: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:11547: \$? = $ac_status" >&5
+  echo "$as_me:10762: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:11550: \"$ac_try\"") >&5
+  { (eval echo "$as_me:10765: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:11553: \$? = $ac_status" >&5
+  echo "$as_me:10768: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
    ac_cv_have_sa_family_t="yes"
 else
@@ -11565,33 +10780,27 @@
 rm -f conftest.$ac_objext conftest.$ac_ext
 
 fi
-echo "$as_me:11568: result: $ac_cv_have_sa_family_t" >&5
+echo "$as_me:10783: result: $ac_cv_have_sa_family_t" >&5
 echo "${ECHO_T}$ac_cv_have_sa_family_t" >&6
 if test "x$ac_cv_have_sa_family_t" = "xyes" ; then
-	cat >>confdefs.h <<\_ACEOF
+	cat >>confdefs.h <<\EOF
 #define HAVE_SA_FAMILY_T 1
-_ACEOF
+EOF
 
 fi
 
-echo "$as_me:11577: checking for pid_t" >&5
+echo "$as_me:10792: checking for pid_t" >&5
 echo $ECHO_N "checking for pid_t... $ECHO_C" >&6
 if test "${ac_cv_have_pid_t+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
 
 	cat >conftest.$ac_ext <<_ACEOF
-#line 11584 "configure"
+#line 10799 "configure"
 #include "confdefs.h"
 
 #include <sys/types.h>
 
-#ifdef F77_DUMMY_MAIN
-#  ifdef __cplusplus
-     extern "C"
-#  endif
-   int F77_DUMMY_MAIN() { return 1; }
-#endif
 int
 main ()
 {
@@ -11601,16 +10810,16 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:11604: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:10813: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:11607: \$? = $ac_status" >&5
+  echo "$as_me:10816: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:11610: \"$ac_try\"") >&5
+  { (eval echo "$as_me:10819: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:11613: \$? = $ac_status" >&5
+  echo "$as_me:10822: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
    ac_cv_have_pid_t="yes"
 else
@@ -11622,33 +10831,27 @@
 rm -f conftest.$ac_objext conftest.$ac_ext
 
 fi
-echo "$as_me:11625: result: $ac_cv_have_pid_t" >&5
+echo "$as_me:10834: result: $ac_cv_have_pid_t" >&5
 echo "${ECHO_T}$ac_cv_have_pid_t" >&6
 if test "x$ac_cv_have_pid_t" = "xyes" ; then
-	cat >>confdefs.h <<\_ACEOF
+	cat >>confdefs.h <<\EOF
 #define HAVE_PID_T 1
-_ACEOF
+EOF
 
 fi
 
-echo "$as_me:11634: checking for mode_t" >&5
+echo "$as_me:10843: checking for mode_t" >&5
 echo $ECHO_N "checking for mode_t... $ECHO_C" >&6
 if test "${ac_cv_have_mode_t+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
 
 	cat >conftest.$ac_ext <<_ACEOF
-#line 11641 "configure"
+#line 10850 "configure"
 #include "confdefs.h"
 
 #include <sys/types.h>
 
-#ifdef F77_DUMMY_MAIN
-#  ifdef __cplusplus
-     extern "C"
-#  endif
-   int F77_DUMMY_MAIN() { return 1; }
-#endif
 int
 main ()
 {
@@ -11658,16 +10861,16 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:11661: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:10864: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:11664: \$? = $ac_status" >&5
+  echo "$as_me:10867: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:11667: \"$ac_try\"") >&5
+  { (eval echo "$as_me:10870: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:11670: \$? = $ac_status" >&5
+  echo "$as_me:10873: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
    ac_cv_have_mode_t="yes"
 else
@@ -11679,34 +10882,28 @@
 rm -f conftest.$ac_objext conftest.$ac_ext
 
 fi
-echo "$as_me:11682: result: $ac_cv_have_mode_t" >&5
+echo "$as_me:10885: result: $ac_cv_have_mode_t" >&5
 echo "${ECHO_T}$ac_cv_have_mode_t" >&6
 if test "x$ac_cv_have_mode_t" = "xyes" ; then
-	cat >>confdefs.h <<\_ACEOF
+	cat >>confdefs.h <<\EOF
 #define HAVE_MODE_T 1
-_ACEOF
+EOF
 
 fi
 
-echo "$as_me:11691: checking for struct sockaddr_storage" >&5
+echo "$as_me:10894: checking for struct sockaddr_storage" >&5
 echo $ECHO_N "checking for struct sockaddr_storage... $ECHO_C" >&6
 if test "${ac_cv_have_struct_sockaddr_storage+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
 
 	cat >conftest.$ac_ext <<_ACEOF
-#line 11698 "configure"
+#line 10901 "configure"
 #include "confdefs.h"
 
 #include <sys/types.h>
 #include <sys/socket.h>
 
-#ifdef F77_DUMMY_MAIN
-#  ifdef __cplusplus
-     extern "C"
-#  endif
-   int F77_DUMMY_MAIN() { return 1; }
-#endif
 int
 main ()
 {
@@ -11716,16 +10913,16 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:11719: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:10916: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:11722: \$? = $ac_status" >&5
+  echo "$as_me:10919: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:11725: \"$ac_try\"") >&5
+  { (eval echo "$as_me:10922: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:11728: \$? = $ac_status" >&5
+  echo "$as_me:10925: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
    ac_cv_have_struct_sockaddr_storage="yes"
 else
@@ -11737,34 +10934,28 @@
 rm -f conftest.$ac_objext conftest.$ac_ext
 
 fi
-echo "$as_me:11740: result: $ac_cv_have_struct_sockaddr_storage" >&5
+echo "$as_me:10937: result: $ac_cv_have_struct_sockaddr_storage" >&5
 echo "${ECHO_T}$ac_cv_have_struct_sockaddr_storage" >&6
 if test "x$ac_cv_have_struct_sockaddr_storage" = "xyes" ; then
-	cat >>confdefs.h <<\_ACEOF
+	cat >>confdefs.h <<\EOF
 #define HAVE_STRUCT_SOCKADDR_STORAGE 1
-_ACEOF
+EOF
 
 fi
 
-echo "$as_me:11749: checking for struct sockaddr_in6" >&5
+echo "$as_me:10946: checking for struct sockaddr_in6" >&5
 echo $ECHO_N "checking for struct sockaddr_in6... $ECHO_C" >&6
 if test "${ac_cv_have_struct_sockaddr_in6+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
 
 	cat >conftest.$ac_ext <<_ACEOF
-#line 11756 "configure"
+#line 10953 "configure"
 #include "confdefs.h"
 
 #include <sys/types.h>
 #include <netinet/in.h>
 
-#ifdef F77_DUMMY_MAIN
-#  ifdef __cplusplus
-     extern "C"
-#  endif
-   int F77_DUMMY_MAIN() { return 1; }
-#endif
 int
 main ()
 {
@@ -11774,16 +10965,16 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:11777: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:10968: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:11780: \$? = $ac_status" >&5
+  echo "$as_me:10971: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:11783: \"$ac_try\"") >&5
+  { (eval echo "$as_me:10974: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:11786: \$? = $ac_status" >&5
+  echo "$as_me:10977: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
    ac_cv_have_struct_sockaddr_in6="yes"
 else
@@ -11795,34 +10986,28 @@
 rm -f conftest.$ac_objext conftest.$ac_ext
 
 fi
-echo "$as_me:11798: result: $ac_cv_have_struct_sockaddr_in6" >&5
+echo "$as_me:10989: result: $ac_cv_have_struct_sockaddr_in6" >&5
 echo "${ECHO_T}$ac_cv_have_struct_sockaddr_in6" >&6
 if test "x$ac_cv_have_struct_sockaddr_in6" = "xyes" ; then
-	cat >>confdefs.h <<\_ACEOF
+	cat >>confdefs.h <<\EOF
 #define HAVE_STRUCT_SOCKADDR_IN6 1
-_ACEOF
+EOF
 
 fi
 
-echo "$as_me:11807: checking for struct in6_addr" >&5
+echo "$as_me:10998: checking for struct in6_addr" >&5
 echo $ECHO_N "checking for struct in6_addr... $ECHO_C" >&6
 if test "${ac_cv_have_struct_in6_addr+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
 
 	cat >conftest.$ac_ext <<_ACEOF
-#line 11814 "configure"
+#line 11005 "configure"
 #include "confdefs.h"
 
 #include <sys/types.h>
 #include <netinet/in.h>
 
-#ifdef F77_DUMMY_MAIN
-#  ifdef __cplusplus
-     extern "C"
-#  endif
-   int F77_DUMMY_MAIN() { return 1; }
-#endif
 int
 main ()
 {
@@ -11832,16 +11017,16 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:11835: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:11020: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:11838: \$? = $ac_status" >&5
+  echo "$as_me:11023: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:11841: \"$ac_try\"") >&5
+  { (eval echo "$as_me:11026: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:11844: \$? = $ac_status" >&5
+  echo "$as_me:11029: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
    ac_cv_have_struct_in6_addr="yes"
 else
@@ -11853,35 +11038,29 @@
 rm -f conftest.$ac_objext conftest.$ac_ext
 
 fi
-echo "$as_me:11856: result: $ac_cv_have_struct_in6_addr" >&5
+echo "$as_me:11041: result: $ac_cv_have_struct_in6_addr" >&5
 echo "${ECHO_T}$ac_cv_have_struct_in6_addr" >&6
 if test "x$ac_cv_have_struct_in6_addr" = "xyes" ; then
-	cat >>confdefs.h <<\_ACEOF
+	cat >>confdefs.h <<\EOF
 #define HAVE_STRUCT_IN6_ADDR 1
-_ACEOF
+EOF
 
 fi
 
-echo "$as_me:11865: checking for struct addrinfo" >&5
+echo "$as_me:11050: checking for struct addrinfo" >&5
 echo $ECHO_N "checking for struct addrinfo... $ECHO_C" >&6
 if test "${ac_cv_have_struct_addrinfo+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
 
 	cat >conftest.$ac_ext <<_ACEOF
-#line 11872 "configure"
+#line 11057 "configure"
 #include "confdefs.h"
 
 #include <sys/types.h>
 #include <sys/socket.h>
 #include <netdb.h>
 
-#ifdef F77_DUMMY_MAIN
-#  ifdef __cplusplus
-     extern "C"
-#  endif
-   int F77_DUMMY_MAIN() { return 1; }
-#endif
 int
 main ()
 {
@@ -11891,16 +11070,16 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:11894: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:11073: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:11897: \$? = $ac_status" >&5
+  echo "$as_me:11076: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:11900: \"$ac_try\"") >&5
+  { (eval echo "$as_me:11079: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:11903: \$? = $ac_status" >&5
+  echo "$as_me:11082: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
    ac_cv_have_struct_addrinfo="yes"
 else
@@ -11912,31 +11091,25 @@
 rm -f conftest.$ac_objext conftest.$ac_ext
 
 fi
-echo "$as_me:11915: result: $ac_cv_have_struct_addrinfo" >&5
+echo "$as_me:11094: result: $ac_cv_have_struct_addrinfo" >&5
 echo "${ECHO_T}$ac_cv_have_struct_addrinfo" >&6
 if test "x$ac_cv_have_struct_addrinfo" = "xyes" ; then
-	cat >>confdefs.h <<\_ACEOF
+	cat >>confdefs.h <<\EOF
 #define HAVE_STRUCT_ADDRINFO 1
-_ACEOF
+EOF
 
 fi
 
-echo "$as_me:11924: checking for struct timeval" >&5
+echo "$as_me:11103: checking for struct timeval" >&5
 echo $ECHO_N "checking for struct timeval... $ECHO_C" >&6
 if test "${ac_cv_have_struct_timeval+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
 
 	cat >conftest.$ac_ext <<_ACEOF
-#line 11931 "configure"
+#line 11110 "configure"
 #include "confdefs.h"
  #include <sys/time.h>
-#ifdef F77_DUMMY_MAIN
-#  ifdef __cplusplus
-     extern "C"
-#  endif
-   int F77_DUMMY_MAIN() { return 1; }
-#endif
 int
 main ()
 {
@@ -11946,16 +11119,16 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:11949: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:11122: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:11952: \$? = $ac_status" >&5
+  echo "$as_me:11125: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:11955: \"$ac_try\"") >&5
+  { (eval echo "$as_me:11128: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:11958: \$? = $ac_status" >&5
+  echo "$as_me:11131: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
    ac_cv_have_struct_timeval="yes"
 else
@@ -11967,12 +11140,12 @@
 rm -f conftest.$ac_objext conftest.$ac_ext
 
 fi
-echo "$as_me:11970: result: $ac_cv_have_struct_timeval" >&5
+echo "$as_me:11143: result: $ac_cv_have_struct_timeval" >&5
 echo "${ECHO_T}$ac_cv_have_struct_timeval" >&6
 if test "x$ac_cv_have_struct_timeval" = "xyes" ; then
-	cat >>confdefs.h <<\_ACEOF
+	cat >>confdefs.h <<\EOF
 #define HAVE_STRUCT_TIMEVAL 1
-_ACEOF
+EOF
 
 	have_struct_timeval=1
 fi
@@ -11985,12 +11158,12 @@
 	NO_SFTP='#'
 else
 	if test "$cross_compiling" = yes; then
-  { { echo "$as_me:11988: error: cannot run test program while cross compiling" >&5
+  { { echo "$as_me:11161: error: cannot run test program while cross compiling" >&5
 echo "$as_me: error: cannot run test program while cross compiling" >&2;}
    { (exit 1); exit 1; }; }
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line 11993 "configure"
+#line 11166 "configure"
 #include "confdefs.h"
 
 #include <stdio.h>
@@ -12018,24 +11191,24 @@
 
 _ACEOF
 rm -f conftest$ac_exeext
-if { (eval echo "$as_me:12021: \"$ac_link\"") >&5
+if { (eval echo "$as_me:11194: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:12024: \$? = $ac_status" >&5
+  echo "$as_me:11197: \$? = $ac_status" >&5
   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
-  { (eval echo "$as_me:12026: \"$ac_try\"") >&5
+  { (eval echo "$as_me:11199: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:12029: \$? = $ac_status" >&5
+  echo "$as_me:11202: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
    true
 else
   echo "$as_me: program exited with status $ac_status" >&5
 echo "$as_me: failed program was:" >&5
 cat conftest.$ac_ext >&5
- cat >>confdefs.h <<\_ACEOF
+ cat >>confdefs.h <<\EOF
 #define BROKEN_SNPRINTF 1
-_ACEOF
+EOF
 
 fi
 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
@@ -12045,14 +11218,14 @@
 # look for field 'ut_host' in header 'utmp.h'
 		ossh_safe=`echo "utmp.h" | sed 'y%./+-%__p_%'`
 		ossh_varname="ossh_cv_$ossh_safe""_has_"ut_host
-	echo "$as_me:12048: checking for ut_host field in utmp.h" >&5
+	echo "$as_me:11221: checking for ut_host field in utmp.h" >&5
 echo $ECHO_N "checking for ut_host field in utmp.h... $ECHO_C" >&6
 	if eval "test \"\${$ossh_varname+set}\" = set"; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
 
 		cat >conftest.$ac_ext <<_ACEOF
-#line 12055 "configure"
+#line 11228 "configure"
 #include "confdefs.h"
 #include <utmp.h>
 
@@ -12069,30 +11242,30 @@
 
 	ossh_result=`eval 'echo $'"$ossh_varname"`
 	if test -n "`echo $ossh_varname`"; then
-		echo "$as_me:12072: result: $ossh_result" >&5
+		echo "$as_me:11245: result: $ossh_result" >&5
 echo "${ECHO_T}$ossh_result" >&6
 		if test "x$ossh_result" = "xyes"; then
-			cat >>confdefs.h <<\_ACEOF
+			cat >>confdefs.h <<\EOF
 #define HAVE_HOST_IN_UTMP 1
-_ACEOF
+EOF
 
 		fi
 	else
-		echo "$as_me:12081: result: no" >&5
+		echo "$as_me:11254: result: no" >&5
 echo "${ECHO_T}no" >&6
 	fi
 
 # look for field 'ut_host' in header 'utmpx.h'
 		ossh_safe=`echo "utmpx.h" | sed 'y%./+-%__p_%'`
 		ossh_varname="ossh_cv_$ossh_safe""_has_"ut_host
-	echo "$as_me:12088: checking for ut_host field in utmpx.h" >&5
+	echo "$as_me:11261: checking for ut_host field in utmpx.h" >&5
 echo $ECHO_N "checking for ut_host field in utmpx.h... $ECHO_C" >&6
 	if eval "test \"\${$ossh_varname+set}\" = set"; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
 
 		cat >conftest.$ac_ext <<_ACEOF
-#line 12095 "configure"
+#line 11268 "configure"
 #include "confdefs.h"
 #include <utmpx.h>
 
@@ -12109,30 +11282,30 @@
 
 	ossh_result=`eval 'echo $'"$ossh_varname"`
 	if test -n "`echo $ossh_varname`"; then
-		echo "$as_me:12112: result: $ossh_result" >&5
+		echo "$as_me:11285: result: $ossh_result" >&5
 echo "${ECHO_T}$ossh_result" >&6
 		if test "x$ossh_result" = "xyes"; then
-			cat >>confdefs.h <<\_ACEOF
+			cat >>confdefs.h <<\EOF
 #define HAVE_HOST_IN_UTMPX 1
-_ACEOF
+EOF
 
 		fi
 	else
-		echo "$as_me:12121: result: no" >&5
+		echo "$as_me:11294: result: no" >&5
 echo "${ECHO_T}no" >&6
 	fi
 
 # look for field 'syslen' in header 'utmpx.h'
 		ossh_safe=`echo "utmpx.h" | sed 'y%./+-%__p_%'`
 		ossh_varname="ossh_cv_$ossh_safe""_has_"syslen
-	echo "$as_me:12128: checking for syslen field in utmpx.h" >&5
+	echo "$as_me:11301: checking for syslen field in utmpx.h" >&5
 echo $ECHO_N "checking for syslen field in utmpx.h... $ECHO_C" >&6
 	if eval "test \"\${$ossh_varname+set}\" = set"; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
 
 		cat >conftest.$ac_ext <<_ACEOF
-#line 12135 "configure"
+#line 11308 "configure"
 #include "confdefs.h"
 #include <utmpx.h>
 
@@ -12149,30 +11322,30 @@
 
 	ossh_result=`eval 'echo $'"$ossh_varname"`
 	if test -n "`echo $ossh_varname`"; then
-		echo "$as_me:12152: result: $ossh_result" >&5
+		echo "$as_me:11325: result: $ossh_result" >&5
 echo "${ECHO_T}$ossh_result" >&6
 		if test "x$ossh_result" = "xyes"; then
-			cat >>confdefs.h <<\_ACEOF
+			cat >>confdefs.h <<\EOF
 #define HAVE_SYSLEN_IN_UTMPX 1
-_ACEOF
+EOF
 
 		fi
 	else
-		echo "$as_me:12161: result: no" >&5
+		echo "$as_me:11334: result: no" >&5
 echo "${ECHO_T}no" >&6
 	fi
 
 # look for field 'ut_pid' in header 'utmp.h'
 		ossh_safe=`echo "utmp.h" | sed 'y%./+-%__p_%'`
 		ossh_varname="ossh_cv_$ossh_safe""_has_"ut_pid
-	echo "$as_me:12168: checking for ut_pid field in utmp.h" >&5
+	echo "$as_me:11341: checking for ut_pid field in utmp.h" >&5
 echo $ECHO_N "checking for ut_pid field in utmp.h... $ECHO_C" >&6
 	if eval "test \"\${$ossh_varname+set}\" = set"; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
 
 		cat >conftest.$ac_ext <<_ACEOF
-#line 12175 "configure"
+#line 11348 "configure"
 #include "confdefs.h"
 #include <utmp.h>
 
@@ -12189,30 +11362,30 @@
 
 	ossh_result=`eval 'echo $'"$ossh_varname"`
 	if test -n "`echo $ossh_varname`"; then
-		echo "$as_me:12192: result: $ossh_result" >&5
+		echo "$as_me:11365: result: $ossh_result" >&5
 echo "${ECHO_T}$ossh_result" >&6
 		if test "x$ossh_result" = "xyes"; then
-			cat >>confdefs.h <<\_ACEOF
+			cat >>confdefs.h <<\EOF
 #define HAVE_PID_IN_UTMP 1
-_ACEOF
+EOF
 
 		fi
 	else
-		echo "$as_me:12201: result: no" >&5
+		echo "$as_me:11374: result: no" >&5
 echo "${ECHO_T}no" >&6
 	fi
 
 # look for field 'ut_type' in header 'utmp.h'
 		ossh_safe=`echo "utmp.h" | sed 'y%./+-%__p_%'`
 		ossh_varname="ossh_cv_$ossh_safe""_has_"ut_type
-	echo "$as_me:12208: checking for ut_type field in utmp.h" >&5
+	echo "$as_me:11381: checking for ut_type field in utmp.h" >&5
 echo $ECHO_N "checking for ut_type field in utmp.h... $ECHO_C" >&6
 	if eval "test \"\${$ossh_varname+set}\" = set"; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
 
 		cat >conftest.$ac_ext <<_ACEOF
-#line 12215 "configure"
+#line 11388 "configure"
 #include "confdefs.h"
 #include <utmp.h>
 
@@ -12229,30 +11402,30 @@
 
 	ossh_result=`eval 'echo $'"$ossh_varname"`
 	if test -n "`echo $ossh_varname`"; then
-		echo "$as_me:12232: result: $ossh_result" >&5
+		echo "$as_me:11405: result: $ossh_result" >&5
 echo "${ECHO_T}$ossh_result" >&6
 		if test "x$ossh_result" = "xyes"; then
-			cat >>confdefs.h <<\_ACEOF
+			cat >>confdefs.h <<\EOF
 #define HAVE_TYPE_IN_UTMP 1
-_ACEOF
+EOF
 
 		fi
 	else
-		echo "$as_me:12241: result: no" >&5
+		echo "$as_me:11414: result: no" >&5
 echo "${ECHO_T}no" >&6
 	fi
 
 # look for field 'ut_type' in header 'utmpx.h'
 		ossh_safe=`echo "utmpx.h" | sed 'y%./+-%__p_%'`
 		ossh_varname="ossh_cv_$ossh_safe""_has_"ut_type
-	echo "$as_me:12248: checking for ut_type field in utmpx.h" >&5
+	echo "$as_me:11421: checking for ut_type field in utmpx.h" >&5
 echo $ECHO_N "checking for ut_type field in utmpx.h... $ECHO_C" >&6
 	if eval "test \"\${$ossh_varname+set}\" = set"; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
 
 		cat >conftest.$ac_ext <<_ACEOF
-#line 12255 "configure"
+#line 11428 "configure"
 #include "confdefs.h"
 #include <utmpx.h>
 
@@ -12269,30 +11442,30 @@
 
 	ossh_result=`eval 'echo $'"$ossh_varname"`
 	if test -n "`echo $ossh_varname`"; then
-		echo "$as_me:12272: result: $ossh_result" >&5
+		echo "$as_me:11445: result: $ossh_result" >&5
 echo "${ECHO_T}$ossh_result" >&6
 		if test "x$ossh_result" = "xyes"; then
-			cat >>confdefs.h <<\_ACEOF
+			cat >>confdefs.h <<\EOF
 #define HAVE_TYPE_IN_UTMPX 1
-_ACEOF
+EOF
 
 		fi
 	else
-		echo "$as_me:12281: result: no" >&5
+		echo "$as_me:11454: result: no" >&5
 echo "${ECHO_T}no" >&6
 	fi
 
 # look for field 'ut_tv' in header 'utmp.h'
 		ossh_safe=`echo "utmp.h" | sed 'y%./+-%__p_%'`
 		ossh_varname="ossh_cv_$ossh_safe""_has_"ut_tv
-	echo "$as_me:12288: checking for ut_tv field in utmp.h" >&5
+	echo "$as_me:11461: checking for ut_tv field in utmp.h" >&5
 echo $ECHO_N "checking for ut_tv field in utmp.h... $ECHO_C" >&6
 	if eval "test \"\${$ossh_varname+set}\" = set"; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
 
 		cat >conftest.$ac_ext <<_ACEOF
-#line 12295 "configure"
+#line 11468 "configure"
 #include "confdefs.h"
 #include <utmp.h>
 
@@ -12309,30 +11482,30 @@
 
 	ossh_result=`eval 'echo $'"$ossh_varname"`
 	if test -n "`echo $ossh_varname`"; then
-		echo "$as_me:12312: result: $ossh_result" >&5
+		echo "$as_me:11485: result: $ossh_result" >&5
 echo "${ECHO_T}$ossh_result" >&6
 		if test "x$ossh_result" = "xyes"; then
-			cat >>confdefs.h <<\_ACEOF
+			cat >>confdefs.h <<\EOF
 #define HAVE_TV_IN_UTMP 1
-_ACEOF
+EOF
 
 		fi
 	else
-		echo "$as_me:12321: result: no" >&5
+		echo "$as_me:11494: result: no" >&5
 echo "${ECHO_T}no" >&6
 	fi
 
 # look for field 'ut_id' in header 'utmp.h'
 		ossh_safe=`echo "utmp.h" | sed 'y%./+-%__p_%'`
 		ossh_varname="ossh_cv_$ossh_safe""_has_"ut_id
-	echo "$as_me:12328: checking for ut_id field in utmp.h" >&5
+	echo "$as_me:11501: checking for ut_id field in utmp.h" >&5
 echo $ECHO_N "checking for ut_id field in utmp.h... $ECHO_C" >&6
 	if eval "test \"\${$ossh_varname+set}\" = set"; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
 
 		cat >conftest.$ac_ext <<_ACEOF
-#line 12335 "configure"
+#line 11508 "configure"
 #include "confdefs.h"
 #include <utmp.h>
 
@@ -12349,30 +11522,30 @@
 
 	ossh_result=`eval 'echo $'"$ossh_varname"`
 	if test -n "`echo $ossh_varname`"; then
-		echo "$as_me:12352: result: $ossh_result" >&5
+		echo "$as_me:11525: result: $ossh_result" >&5
 echo "${ECHO_T}$ossh_result" >&6
 		if test "x$ossh_result" = "xyes"; then
-			cat >>confdefs.h <<\_ACEOF
+			cat >>confdefs.h <<\EOF
 #define HAVE_ID_IN_UTMP 1
-_ACEOF
+EOF
 
 		fi
 	else
-		echo "$as_me:12361: result: no" >&5
+		echo "$as_me:11534: result: no" >&5
 echo "${ECHO_T}no" >&6
 	fi
 
 # look for field 'ut_id' in header 'utmpx.h'
 		ossh_safe=`echo "utmpx.h" | sed 'y%./+-%__p_%'`
 		ossh_varname="ossh_cv_$ossh_safe""_has_"ut_id
-	echo "$as_me:12368: checking for ut_id field in utmpx.h" >&5
+	echo "$as_me:11541: checking for ut_id field in utmpx.h" >&5
 echo $ECHO_N "checking for ut_id field in utmpx.h... $ECHO_C" >&6
 	if eval "test \"\${$ossh_varname+set}\" = set"; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
 
 		cat >conftest.$ac_ext <<_ACEOF
-#line 12375 "configure"
+#line 11548 "configure"
 #include "confdefs.h"
 #include <utmpx.h>
 
@@ -12389,30 +11562,30 @@
 
 	ossh_result=`eval 'echo $'"$ossh_varname"`
 	if test -n "`echo $ossh_varname`"; then
-		echo "$as_me:12392: result: $ossh_result" >&5
+		echo "$as_me:11565: result: $ossh_result" >&5
 echo "${ECHO_T}$ossh_result" >&6
 		if test "x$ossh_result" = "xyes"; then
-			cat >>confdefs.h <<\_ACEOF
+			cat >>confdefs.h <<\EOF
 #define HAVE_ID_IN_UTMPX 1
-_ACEOF
+EOF
 
 		fi
 	else
-		echo "$as_me:12401: result: no" >&5
+		echo "$as_me:11574: result: no" >&5
 echo "${ECHO_T}no" >&6
 	fi
 
 # look for field 'ut_addr' in header 'utmp.h'
 		ossh_safe=`echo "utmp.h" | sed 'y%./+-%__p_%'`
 		ossh_varname="ossh_cv_$ossh_safe""_has_"ut_addr
-	echo "$as_me:12408: checking for ut_addr field in utmp.h" >&5
+	echo "$as_me:11581: checking for ut_addr field in utmp.h" >&5
 echo $ECHO_N "checking for ut_addr field in utmp.h... $ECHO_C" >&6
 	if eval "test \"\${$ossh_varname+set}\" = set"; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
 
 		cat >conftest.$ac_ext <<_ACEOF
-#line 12415 "configure"
+#line 11588 "configure"
 #include "confdefs.h"
 #include <utmp.h>
 
@@ -12429,30 +11602,30 @@
 
 	ossh_result=`eval 'echo $'"$ossh_varname"`
 	if test -n "`echo $ossh_varname`"; then
-		echo "$as_me:12432: result: $ossh_result" >&5
+		echo "$as_me:11605: result: $ossh_result" >&5
 echo "${ECHO_T}$ossh_result" >&6
 		if test "x$ossh_result" = "xyes"; then
-			cat >>confdefs.h <<\_ACEOF
+			cat >>confdefs.h <<\EOF
 #define HAVE_ADDR_IN_UTMP 1
-_ACEOF
+EOF
 
 		fi
 	else
-		echo "$as_me:12441: result: no" >&5
+		echo "$as_me:11614: result: no" >&5
 echo "${ECHO_T}no" >&6
 	fi
 
 # look for field 'ut_addr' in header 'utmpx.h'
 		ossh_safe=`echo "utmpx.h" | sed 'y%./+-%__p_%'`
 		ossh_varname="ossh_cv_$ossh_safe""_has_"ut_addr
-	echo "$as_me:12448: checking for ut_addr field in utmpx.h" >&5
+	echo "$as_me:11621: checking for ut_addr field in utmpx.h" >&5
 echo $ECHO_N "checking for ut_addr field in utmpx.h... $ECHO_C" >&6
 	if eval "test \"\${$ossh_varname+set}\" = set"; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
 
 		cat >conftest.$ac_ext <<_ACEOF
-#line 12455 "configure"
+#line 11628 "configure"
 #include "confdefs.h"
 #include <utmpx.h>
 
@@ -12469,30 +11642,30 @@
 
 	ossh_result=`eval 'echo $'"$ossh_varname"`
 	if test -n "`echo $ossh_varname`"; then
-		echo "$as_me:12472: result: $ossh_result" >&5
+		echo "$as_me:11645: result: $ossh_result" >&5
 echo "${ECHO_T}$ossh_result" >&6
 		if test "x$ossh_result" = "xyes"; then
-			cat >>confdefs.h <<\_ACEOF
+			cat >>confdefs.h <<\EOF
 #define HAVE_ADDR_IN_UTMPX 1
-_ACEOF
+EOF
 
 		fi
 	else
-		echo "$as_me:12481: result: no" >&5
+		echo "$as_me:11654: result: no" >&5
 echo "${ECHO_T}no" >&6
 	fi
 
 # look for field 'ut_addr_v6' in header 'utmp.h'
 		ossh_safe=`echo "utmp.h" | sed 'y%./+-%__p_%'`
 		ossh_varname="ossh_cv_$ossh_safe""_has_"ut_addr_v6
-	echo "$as_me:12488: checking for ut_addr_v6 field in utmp.h" >&5
+	echo "$as_me:11661: checking for ut_addr_v6 field in utmp.h" >&5
 echo $ECHO_N "checking for ut_addr_v6 field in utmp.h... $ECHO_C" >&6
 	if eval "test \"\${$ossh_varname+set}\" = set"; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
 
 		cat >conftest.$ac_ext <<_ACEOF
-#line 12495 "configure"
+#line 11668 "configure"
 #include "confdefs.h"
 #include <utmp.h>
 
@@ -12509,30 +11682,30 @@
 
 	ossh_result=`eval 'echo $'"$ossh_varname"`
 	if test -n "`echo $ossh_varname`"; then
-		echo "$as_me:12512: result: $ossh_result" >&5
+		echo "$as_me:11685: result: $ossh_result" >&5
 echo "${ECHO_T}$ossh_result" >&6
 		if test "x$ossh_result" = "xyes"; then
-			cat >>confdefs.h <<\_ACEOF
+			cat >>confdefs.h <<\EOF
 #define HAVE_ADDR_V6_IN_UTMP 1
-_ACEOF
+EOF
 
 		fi
 	else
-		echo "$as_me:12521: result: no" >&5
+		echo "$as_me:11694: result: no" >&5
 echo "${ECHO_T}no" >&6
 	fi
 
 # look for field 'ut_addr_v6' in header 'utmpx.h'
 		ossh_safe=`echo "utmpx.h" | sed 'y%./+-%__p_%'`
 		ossh_varname="ossh_cv_$ossh_safe""_has_"ut_addr_v6
-	echo "$as_me:12528: checking for ut_addr_v6 field in utmpx.h" >&5
+	echo "$as_me:11701: checking for ut_addr_v6 field in utmpx.h" >&5
 echo $ECHO_N "checking for ut_addr_v6 field in utmpx.h... $ECHO_C" >&6
 	if eval "test \"\${$ossh_varname+set}\" = set"; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
 
 		cat >conftest.$ac_ext <<_ACEOF
-#line 12535 "configure"
+#line 11708 "configure"
 #include "confdefs.h"
 #include <utmpx.h>
 
@@ -12549,30 +11722,30 @@
 
 	ossh_result=`eval 'echo $'"$ossh_varname"`
 	if test -n "`echo $ossh_varname`"; then
-		echo "$as_me:12552: result: $ossh_result" >&5
+		echo "$as_me:11725: result: $ossh_result" >&5
 echo "${ECHO_T}$ossh_result" >&6
 		if test "x$ossh_result" = "xyes"; then
-			cat >>confdefs.h <<\_ACEOF
+			cat >>confdefs.h <<\EOF
 #define HAVE_ADDR_V6_IN_UTMPX 1
-_ACEOF
+EOF
 
 		fi
 	else
-		echo "$as_me:12561: result: no" >&5
+		echo "$as_me:11734: result: no" >&5
 echo "${ECHO_T}no" >&6
 	fi
 
 # look for field 'ut_exit' in header 'utmp.h'
 		ossh_safe=`echo "utmp.h" | sed 'y%./+-%__p_%'`
 		ossh_varname="ossh_cv_$ossh_safe""_has_"ut_exit
-	echo "$as_me:12568: checking for ut_exit field in utmp.h" >&5
+	echo "$as_me:11741: checking for ut_exit field in utmp.h" >&5
 echo $ECHO_N "checking for ut_exit field in utmp.h... $ECHO_C" >&6
 	if eval "test \"\${$ossh_varname+set}\" = set"; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
 
 		cat >conftest.$ac_ext <<_ACEOF
-#line 12575 "configure"
+#line 11748 "configure"
 #include "confdefs.h"
 #include <utmp.h>
 
@@ -12589,30 +11762,30 @@
 
 	ossh_result=`eval 'echo $'"$ossh_varname"`
 	if test -n "`echo $ossh_varname`"; then
-		echo "$as_me:12592: result: $ossh_result" >&5
+		echo "$as_me:11765: result: $ossh_result" >&5
 echo "${ECHO_T}$ossh_result" >&6
 		if test "x$ossh_result" = "xyes"; then
-			cat >>confdefs.h <<\_ACEOF
+			cat >>confdefs.h <<\EOF
 #define HAVE_EXIT_IN_UTMP 1
-_ACEOF
+EOF
 
 		fi
 	else
-		echo "$as_me:12601: result: no" >&5
+		echo "$as_me:11774: result: no" >&5
 echo "${ECHO_T}no" >&6
 	fi
 
 # look for field 'ut_time' in header 'utmp.h'
 		ossh_safe=`echo "utmp.h" | sed 'y%./+-%__p_%'`
 		ossh_varname="ossh_cv_$ossh_safe""_has_"ut_time
-	echo "$as_me:12608: checking for ut_time field in utmp.h" >&5
+	echo "$as_me:11781: checking for ut_time field in utmp.h" >&5
 echo $ECHO_N "checking for ut_time field in utmp.h... $ECHO_C" >&6
 	if eval "test \"\${$ossh_varname+set}\" = set"; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
 
 		cat >conftest.$ac_ext <<_ACEOF
-#line 12615 "configure"
+#line 11788 "configure"
 #include "confdefs.h"
 #include <utmp.h>
 
@@ -12629,30 +11802,30 @@
 
 	ossh_result=`eval 'echo $'"$ossh_varname"`
 	if test -n "`echo $ossh_varname`"; then
-		echo "$as_me:12632: result: $ossh_result" >&5
+		echo "$as_me:11805: result: $ossh_result" >&5
 echo "${ECHO_T}$ossh_result" >&6
 		if test "x$ossh_result" = "xyes"; then
-			cat >>confdefs.h <<\_ACEOF
+			cat >>confdefs.h <<\EOF
 #define HAVE_TIME_IN_UTMP 1
-_ACEOF
+EOF
 
 		fi
 	else
-		echo "$as_me:12641: result: no" >&5
+		echo "$as_me:11814: result: no" >&5
 echo "${ECHO_T}no" >&6
 	fi
 
 # look for field 'ut_time' in header 'utmpx.h'
 		ossh_safe=`echo "utmpx.h" | sed 'y%./+-%__p_%'`
 		ossh_varname="ossh_cv_$ossh_safe""_has_"ut_time
-	echo "$as_me:12648: checking for ut_time field in utmpx.h" >&5
+	echo "$as_me:11821: checking for ut_time field in utmpx.h" >&5
 echo $ECHO_N "checking for ut_time field in utmpx.h... $ECHO_C" >&6
 	if eval "test \"\${$ossh_varname+set}\" = set"; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
 
 		cat >conftest.$ac_ext <<_ACEOF
-#line 12655 "configure"
+#line 11828 "configure"
 #include "confdefs.h"
 #include <utmpx.h>
 
@@ -12669,30 +11842,30 @@
 
 	ossh_result=`eval 'echo $'"$ossh_varname"`
 	if test -n "`echo $ossh_varname`"; then
-		echo "$as_me:12672: result: $ossh_result" >&5
+		echo "$as_me:11845: result: $ossh_result" >&5
 echo "${ECHO_T}$ossh_result" >&6
 		if test "x$ossh_result" = "xyes"; then
-			cat >>confdefs.h <<\_ACEOF
+			cat >>confdefs.h <<\EOF
 #define HAVE_TIME_IN_UTMPX 1
-_ACEOF
+EOF
 
 		fi
 	else
-		echo "$as_me:12681: result: no" >&5
+		echo "$as_me:11854: result: no" >&5
 echo "${ECHO_T}no" >&6
 	fi
 
 # look for field 'ut_tv' in header 'utmpx.h'
 		ossh_safe=`echo "utmpx.h" | sed 'y%./+-%__p_%'`
 		ossh_varname="ossh_cv_$ossh_safe""_has_"ut_tv
-	echo "$as_me:12688: checking for ut_tv field in utmpx.h" >&5
+	echo "$as_me:11861: checking for ut_tv field in utmpx.h" >&5
 echo $ECHO_N "checking for ut_tv field in utmpx.h... $ECHO_C" >&6
 	if eval "test \"\${$ossh_varname+set}\" = set"; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
 
 		cat >conftest.$ac_ext <<_ACEOF
-#line 12695 "configure"
+#line 11868 "configure"
 #include "confdefs.h"
 #include <utmpx.h>
 
@@ -12709,34 +11882,28 @@
 
 	ossh_result=`eval 'echo $'"$ossh_varname"`
 	if test -n "`echo $ossh_varname`"; then
-		echo "$as_me:12712: result: $ossh_result" >&5
+		echo "$as_me:11885: result: $ossh_result" >&5
 echo "${ECHO_T}$ossh_result" >&6
 		if test "x$ossh_result" = "xyes"; then
-			cat >>confdefs.h <<\_ACEOF
+			cat >>confdefs.h <<\EOF
 #define HAVE_TV_IN_UTMPX 1
-_ACEOF
+EOF
 
 		fi
 	else
-		echo "$as_me:12721: result: no" >&5
+		echo "$as_me:11894: result: no" >&5
 echo "${ECHO_T}no" >&6
 	fi
 
-echo "$as_me:12725: checking for struct stat.st_blksize" >&5
+echo "$as_me:11898: checking for struct stat.st_blksize" >&5
 echo $ECHO_N "checking for struct stat.st_blksize... $ECHO_C" >&6
 if test "${ac_cv_member_struct_stat_st_blksize+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line 12731 "configure"
+#line 11904 "configure"
 #include "confdefs.h"
 $ac_includes_default
-#ifdef F77_DUMMY_MAIN
-#  ifdef __cplusplus
-     extern "C"
-#  endif
-   int F77_DUMMY_MAIN() { return 1; }
-#endif
 int
 main ()
 {
@@ -12748,16 +11915,16 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:12751: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:11918: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:12754: \$? = $ac_status" >&5
+  echo "$as_me:11921: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:12757: \"$ac_try\"") >&5
+  { (eval echo "$as_me:11924: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:12760: \$? = $ac_status" >&5
+  echo "$as_me:11927: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_member_struct_stat_st_blksize=yes
 else
@@ -12767,35 +11934,29 @@
 fi
 rm -f conftest.$ac_objext conftest.$ac_ext
 fi
-echo "$as_me:12770: result: $ac_cv_member_struct_stat_st_blksize" >&5
+echo "$as_me:11937: result: $ac_cv_member_struct_stat_st_blksize" >&5
 echo "${ECHO_T}$ac_cv_member_struct_stat_st_blksize" >&6
 if test $ac_cv_member_struct_stat_st_blksize = yes; then
 
-cat >>confdefs.h <<_ACEOF
+cat >>confdefs.h <<EOF
 #define HAVE_STRUCT_STAT_ST_BLKSIZE 1
-_ACEOF
+EOF
 
 fi
 
-echo "$as_me:12780: checking for ss_family field in struct sockaddr_storage" >&5
+echo "$as_me:11947: checking for ss_family field in struct sockaddr_storage" >&5
 echo $ECHO_N "checking for ss_family field in struct sockaddr_storage... $ECHO_C" >&6
 if test "${ac_cv_have_ss_family_in_struct_ss+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
 
 	cat >conftest.$ac_ext <<_ACEOF
-#line 12787 "configure"
+#line 11954 "configure"
 #include "confdefs.h"
 
 #include <sys/types.h>
 #include <sys/socket.h>
 
-#ifdef F77_DUMMY_MAIN
-#  ifdef __cplusplus
-     extern "C"
-#  endif
-   int F77_DUMMY_MAIN() { return 1; }
-#endif
 int
 main ()
 {
@@ -12805,16 +11966,16 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:12808: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:11969: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:12811: \$? = $ac_status" >&5
+  echo "$as_me:11972: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:12814: \"$ac_try\"") >&5
+  { (eval echo "$as_me:11975: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:12817: \$? = $ac_status" >&5
+  echo "$as_me:11978: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
    ac_cv_have_ss_family_in_struct_ss="yes"
 else
@@ -12825,34 +11986,28 @@
 rm -f conftest.$ac_objext conftest.$ac_ext
 
 fi
-echo "$as_me:12828: result: $ac_cv_have_ss_family_in_struct_ss" >&5
+echo "$as_me:11989: result: $ac_cv_have_ss_family_in_struct_ss" >&5
 echo "${ECHO_T}$ac_cv_have_ss_family_in_struct_ss" >&6
 if test "x$ac_cv_have_ss_family_in_struct_ss" = "xyes" ; then
-	cat >>confdefs.h <<\_ACEOF
+	cat >>confdefs.h <<\EOF
 #define HAVE_SS_FAMILY_IN_SS 1
-_ACEOF
+EOF
 
 fi
 
-echo "$as_me:12837: checking for __ss_family field in struct sockaddr_storage" >&5
+echo "$as_me:11998: checking for __ss_family field in struct sockaddr_storage" >&5
 echo $ECHO_N "checking for __ss_family field in struct sockaddr_storage... $ECHO_C" >&6
 if test "${ac_cv_have___ss_family_in_struct_ss+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
 
 	cat >conftest.$ac_ext <<_ACEOF
-#line 12844 "configure"
+#line 12005 "configure"
 #include "confdefs.h"
 
 #include <sys/types.h>
 #include <sys/socket.h>
 
-#ifdef F77_DUMMY_MAIN
-#  ifdef __cplusplus
-     extern "C"
-#  endif
-   int F77_DUMMY_MAIN() { return 1; }
-#endif
 int
 main ()
 {
@@ -12862,16 +12017,16 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:12865: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:12020: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:12868: \$? = $ac_status" >&5
+  echo "$as_me:12023: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:12871: \"$ac_try\"") >&5
+  { (eval echo "$as_me:12026: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:12874: \$? = $ac_status" >&5
+  echo "$as_me:12029: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
    ac_cv_have___ss_family_in_struct_ss="yes"
 else
@@ -12883,33 +12038,27 @@
 rm -f conftest.$ac_objext conftest.$ac_ext
 
 fi
-echo "$as_me:12886: result: $ac_cv_have___ss_family_in_struct_ss" >&5
+echo "$as_me:12041: result: $ac_cv_have___ss_family_in_struct_ss" >&5
 echo "${ECHO_T}$ac_cv_have___ss_family_in_struct_ss" >&6
 if test "x$ac_cv_have___ss_family_in_struct_ss" = "xyes" ; then
-	cat >>confdefs.h <<\_ACEOF
+	cat >>confdefs.h <<\EOF
 #define HAVE___SS_FAMILY_IN_SS 1
-_ACEOF
+EOF
 
 fi
 
-echo "$as_me:12895: checking for pw_class field in struct passwd" >&5
+echo "$as_me:12050: checking for pw_class field in struct passwd" >&5
 echo $ECHO_N "checking for pw_class field in struct passwd... $ECHO_C" >&6
 if test "${ac_cv_have_pw_class_in_struct_passwd+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
 
 	cat >conftest.$ac_ext <<_ACEOF
-#line 12902 "configure"
+#line 12057 "configure"
 #include "confdefs.h"
 
 #include <pwd.h>
 
-#ifdef F77_DUMMY_MAIN
-#  ifdef __cplusplus
-     extern "C"
-#  endif
-   int F77_DUMMY_MAIN() { return 1; }
-#endif
 int
 main ()
 {
@@ -12919,16 +12068,16 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:12922: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:12071: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:12925: \$? = $ac_status" >&5
+  echo "$as_me:12074: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:12928: \"$ac_try\"") >&5
+  { (eval echo "$as_me:12077: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:12931: \$? = $ac_status" >&5
+  echo "$as_me:12080: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
    ac_cv_have_pw_class_in_struct_passwd="yes"
 else
@@ -12940,33 +12089,27 @@
 rm -f conftest.$ac_objext conftest.$ac_ext
 
 fi
-echo "$as_me:12943: result: $ac_cv_have_pw_class_in_struct_passwd" >&5
+echo "$as_me:12092: result: $ac_cv_have_pw_class_in_struct_passwd" >&5
 echo "${ECHO_T}$ac_cv_have_pw_class_in_struct_passwd" >&6
 if test "x$ac_cv_have_pw_class_in_struct_passwd" = "xyes" ; then
-	cat >>confdefs.h <<\_ACEOF
+	cat >>confdefs.h <<\EOF
 #define HAVE_PW_CLASS_IN_PASSWD 1
-_ACEOF
+EOF
 
 fi
 
-echo "$as_me:12952: checking for pw_expire field in struct passwd" >&5
+echo "$as_me:12101: checking for pw_expire field in struct passwd" >&5
 echo $ECHO_N "checking for pw_expire field in struct passwd... $ECHO_C" >&6
 if test "${ac_cv_have_pw_expire_in_struct_passwd+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
 
 	cat >conftest.$ac_ext <<_ACEOF
-#line 12959 "configure"
+#line 12108 "configure"
 #include "confdefs.h"
 
 #include <pwd.h>
 
-#ifdef F77_DUMMY_MAIN
-#  ifdef __cplusplus
-     extern "C"
-#  endif
-   int F77_DUMMY_MAIN() { return 1; }
-#endif
 int
 main ()
 {
@@ -12976,16 +12119,16 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:12979: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:12122: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:12982: \$? = $ac_status" >&5
+  echo "$as_me:12125: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:12985: \"$ac_try\"") >&5
+  { (eval echo "$as_me:12128: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:12988: \$? = $ac_status" >&5
+  echo "$as_me:12131: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
    ac_cv_have_pw_expire_in_struct_passwd="yes"
 else
@@ -12997,33 +12140,27 @@
 rm -f conftest.$ac_objext conftest.$ac_ext
 
 fi
-echo "$as_me:13000: result: $ac_cv_have_pw_expire_in_struct_passwd" >&5
+echo "$as_me:12143: result: $ac_cv_have_pw_expire_in_struct_passwd" >&5
 echo "${ECHO_T}$ac_cv_have_pw_expire_in_struct_passwd" >&6
 if test "x$ac_cv_have_pw_expire_in_struct_passwd" = "xyes" ; then
-	cat >>confdefs.h <<\_ACEOF
+	cat >>confdefs.h <<\EOF
 #define HAVE_PW_EXPIRE_IN_PASSWD 1
-_ACEOF
+EOF
 
 fi
 
-echo "$as_me:13009: checking for pw_change field in struct passwd" >&5
+echo "$as_me:12152: checking for pw_change field in struct passwd" >&5
 echo $ECHO_N "checking for pw_change field in struct passwd... $ECHO_C" >&6
 if test "${ac_cv_have_pw_change_in_struct_passwd+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
 
 	cat >conftest.$ac_ext <<_ACEOF
-#line 13016 "configure"
+#line 12159 "configure"
 #include "confdefs.h"
 
 #include <pwd.h>
 
-#ifdef F77_DUMMY_MAIN
-#  ifdef __cplusplus
-     extern "C"
-#  endif
-   int F77_DUMMY_MAIN() { return 1; }
-#endif
 int
 main ()
 {
@@ -13033,16 +12170,16 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:13036: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:12173: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:13039: \$? = $ac_status" >&5
+  echo "$as_me:12176: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:13042: \"$ac_try\"") >&5
+  { (eval echo "$as_me:12179: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:13045: \$? = $ac_status" >&5
+  echo "$as_me:12182: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
    ac_cv_have_pw_change_in_struct_passwd="yes"
 else
@@ -13054,31 +12191,25 @@
 rm -f conftest.$ac_objext conftest.$ac_ext
 
 fi
-echo "$as_me:13057: result: $ac_cv_have_pw_change_in_struct_passwd" >&5
+echo "$as_me:12194: result: $ac_cv_have_pw_change_in_struct_passwd" >&5
 echo "${ECHO_T}$ac_cv_have_pw_change_in_struct_passwd" >&6
 if test "x$ac_cv_have_pw_change_in_struct_passwd" = "xyes" ; then
-	cat >>confdefs.h <<\_ACEOF
+	cat >>confdefs.h <<\EOF
 #define HAVE_PW_CHANGE_IN_PASSWD 1
-_ACEOF
+EOF
 
 fi
 
-echo "$as_me:13066: checking if libc defines __progname" >&5
+echo "$as_me:12203: checking if libc defines __progname" >&5
 echo $ECHO_N "checking if libc defines __progname... $ECHO_C" >&6
 if test "${ac_cv_libc_defines___progname+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
 
 	cat >conftest.$ac_ext <<_ACEOF
-#line 13073 "configure"
+#line 12210 "configure"
 #include "confdefs.h"
 
-#ifdef F77_DUMMY_MAIN
-#  ifdef __cplusplus
-     extern "C"
-#  endif
-   int F77_DUMMY_MAIN() { return 1; }
-#endif
 int
 main ()
 {
@@ -13088,16 +12219,16 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:13091: \"$ac_link\"") >&5
+if { (eval echo "$as_me:12222: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:13094: \$? = $ac_status" >&5
+  echo "$as_me:12225: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:13097: \"$ac_try\"") >&5
+  { (eval echo "$as_me:12228: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:13100: \$? = $ac_status" >&5
+  echo "$as_me:12231: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
    ac_cv_libc_defines___progname="yes"
 else
@@ -13109,33 +12240,27 @@
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 
 fi
-echo "$as_me:13112: result: $ac_cv_libc_defines___progname" >&5
+echo "$as_me:12243: result: $ac_cv_libc_defines___progname" >&5
 echo "${ECHO_T}$ac_cv_libc_defines___progname" >&6
 if test "x$ac_cv_libc_defines___progname" = "xyes" ; then
-	cat >>confdefs.h <<\_ACEOF
+	cat >>confdefs.h <<\EOF
 #define HAVE___PROGNAME 1
-_ACEOF
+EOF
 
 fi
 
-echo "$as_me:13121: checking whether getopt has optreset support" >&5
+echo "$as_me:12252: checking whether getopt has optreset support" >&5
 echo $ECHO_N "checking whether getopt has optreset support... $ECHO_C" >&6
 if test "${ac_cv_have_getopt_optreset+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
 
 	cat >conftest.$ac_ext <<_ACEOF
-#line 13128 "configure"
+#line 12259 "configure"
 #include "confdefs.h"
 
 #include <getopt.h>
 
-#ifdef F77_DUMMY_MAIN
-#  ifdef __cplusplus
-     extern "C"
-#  endif
-   int F77_DUMMY_MAIN() { return 1; }
-#endif
 int
 main ()
 {
@@ -13145,16 +12270,16 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:13148: \"$ac_link\"") >&5
+if { (eval echo "$as_me:12273: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:13151: \$? = $ac_status" >&5
+  echo "$as_me:12276: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:13154: \"$ac_try\"") >&5
+  { (eval echo "$as_me:12279: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:13157: \$? = $ac_status" >&5
+  echo "$as_me:12282: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
    ac_cv_have_getopt_optreset="yes"
 else
@@ -13166,31 +12291,25 @@
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 
 fi
-echo "$as_me:13169: result: $ac_cv_have_getopt_optreset" >&5
+echo "$as_me:12294: result: $ac_cv_have_getopt_optreset" >&5
 echo "${ECHO_T}$ac_cv_have_getopt_optreset" >&6
 if test "x$ac_cv_have_getopt_optreset" = "xyes" ; then
-	cat >>confdefs.h <<\_ACEOF
+	cat >>confdefs.h <<\EOF
 #define HAVE_GETOPT_OPTRESET 1
-_ACEOF
+EOF
 
 fi
 
-echo "$as_me:13178: checking if libc defines sys_errlist" >&5
+echo "$as_me:12303: checking if libc defines sys_errlist" >&5
 echo $ECHO_N "checking if libc defines sys_errlist... $ECHO_C" >&6
 if test "${ac_cv_libc_defines_sys_errlist+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
 
 	cat >conftest.$ac_ext <<_ACEOF
-#line 13185 "configure"
+#line 12310 "configure"
 #include "confdefs.h"
 
-#ifdef F77_DUMMY_MAIN
-#  ifdef __cplusplus
-     extern "C"
-#  endif
-   int F77_DUMMY_MAIN() { return 1; }
-#endif
 int
 main ()
 {
@@ -13200,16 +12319,16 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:13203: \"$ac_link\"") >&5
+if { (eval echo "$as_me:12322: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:13206: \$? = $ac_status" >&5
+  echo "$as_me:12325: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:13209: \"$ac_try\"") >&5
+  { (eval echo "$as_me:12328: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:13212: \$? = $ac_status" >&5
+  echo "$as_me:12331: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
    ac_cv_libc_defines_sys_errlist="yes"
 else
@@ -13221,31 +12340,25 @@
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 
 fi
-echo "$as_me:13224: result: $ac_cv_libc_defines_sys_errlist" >&5
+echo "$as_me:12343: result: $ac_cv_libc_defines_sys_errlist" >&5
 echo "${ECHO_T}$ac_cv_libc_defines_sys_errlist" >&6
 if test "x$ac_cv_libc_defines_sys_errlist" = "xyes" ; then
-	cat >>confdefs.h <<\_ACEOF
+	cat >>confdefs.h <<\EOF
 #define HAVE_SYS_ERRLIST 1
-_ACEOF
+EOF
 
 fi
 
-echo "$as_me:13233: checking if libc defines sys_nerr" >&5
+echo "$as_me:12352: checking if libc defines sys_nerr" >&5
 echo $ECHO_N "checking if libc defines sys_nerr... $ECHO_C" >&6
 if test "${ac_cv_libc_defines_sys_nerr+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
 
 	cat >conftest.$ac_ext <<_ACEOF
-#line 13240 "configure"
+#line 12359 "configure"
 #include "confdefs.h"
 
-#ifdef F77_DUMMY_MAIN
-#  ifdef __cplusplus
-     extern "C"
-#  endif
-   int F77_DUMMY_MAIN() { return 1; }
-#endif
 int
 main ()
 {
@@ -13255,16 +12368,16 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:13258: \"$ac_link\"") >&5
+if { (eval echo "$as_me:12371: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:13261: \$? = $ac_status" >&5
+  echo "$as_me:12374: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:13264: \"$ac_try\"") >&5
+  { (eval echo "$as_me:12377: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:13267: \$? = $ac_status" >&5
+  echo "$as_me:12380: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
    ac_cv_libc_defines_sys_nerr="yes"
 else
@@ -13276,12 +12389,12 @@
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 
 fi
-echo "$as_me:13279: result: $ac_cv_libc_defines_sys_nerr" >&5
+echo "$as_me:12392: result: $ac_cv_libc_defines_sys_nerr" >&5
 echo "${ECHO_T}$ac_cv_libc_defines_sys_nerr" >&6
 if test "x$ac_cv_libc_defines_sys_nerr" = "xyes" ; then
-	cat >>confdefs.h <<\_ACEOF
+	cat >>confdefs.h <<\EOF
 #define HAVE_SYS_NERR 1
-_ACEOF
+EOF
 
 fi
 
@@ -13307,61 +12420,436 @@
 for ac_header in sectok.h
 do
 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
-  echo "$as_me:13311: checking for $ac_header" >&5
+echo "$as_me:12423: checking for $ac_header" >&5
 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
 if eval "test \"\${$as_ac_Header+set}\" = set"; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+#line 12429 "configure"
+#include "confdefs.h"
+#include <$ac_header>
+_ACEOF
+if { (eval echo "$as_me:12433: \"$ac_cpp conftest.$ac_ext\"") >&5
+  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+  ac_status=$?
+  egrep -v '^ *\+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:12439: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null; then
+  if test -s conftest.err; then
+    ac_cpp_err=$ac_c_preproc_warn_flag
+  else
+    ac_cpp_err=
+  fi
+else
+  ac_cpp_err=yes
 fi
-echo "$as_me:13316: result: `eval echo '${'$as_ac_Header'}'`" >&5
+if test -z "$ac_cpp_err"; then
+  eval "$as_ac_Header=yes"
+else
+  echo "$as_me: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  eval "$as_ac_Header=no"
+fi
+rm -f conftest.err conftest.$ac_ext
+fi
+echo "$as_me:12458: result: `eval echo '${'$as_ac_Header'}'`" >&5
 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+  cat >>confdefs.h <<EOF
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+EOF
+
+fi
+done
+
+			if test "$ac_cv_header_sectok_h" != yes; then
+				{ { echo "$as_me:12469: error: Can't find sectok.h" >&5
+echo "$as_me: error: Can't find sectok.h" >&2;}
+   { (exit 1); exit 1; }; }
+			fi
+
+echo "$as_me:12474: checking for sectok_open in -lsectok" >&5
+echo $ECHO_N "checking for sectok_open in -lsectok... $ECHO_C" >&6
+if test "${ac_cv_lib_sectok_sectok_open+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  # Is the header compilable?
-echo "$as_me:13320: checking $ac_header usability" >&5
-echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lsectok  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
-#line 13323 "configure"
+#line 12482 "configure"
 #include "confdefs.h"
-$ac_includes_default
-#include <$ac_header>
+
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char sectok_open ();
+int
+main ()
+{
+sectok_open ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:12501: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:12504: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:12507: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:12510: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_lib_sectok_sectok_open=yes
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_cv_lib_sectok_sectok_open=no
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:12521: result: $ac_cv_lib_sectok_sectok_open" >&5
+echo "${ECHO_T}$ac_cv_lib_sectok_sectok_open" >&6
+if test $ac_cv_lib_sectok_sectok_open = yes; then
+  cat >>confdefs.h <<EOF
+#define HAVE_LIBSECTOK 1
+EOF
+
+  LIBS="-lsectok $LIBS"
+
+fi
+
+			if test "$ac_cv_lib_sectok_sectok_open" != yes; then
+				{ { echo "$as_me:12533: error: Can't find libsectok" >&5
+echo "$as_me: error: Can't find libsectok" >&2;}
+   { (exit 1); exit 1; }; }
+			fi
+			cat >>confdefs.h <<\EOF
+#define SMARTCARD 1
+EOF
+
+			SCARD_MSG="yes"
+		fi
+
+fi;
+
+# Check whether user wants Kerberos 5 support
+
+# Check whether --with-kerberos5 or --without-kerberos5 was given.
+if test "${with_kerberos5+set}" = set; then
+  withval="$with_kerberos5"
+
+                if test "x$withval" != "xno" ; then
+                        if test "x$withval" = "xyes" ; then
+                                KRB5ROOT="/usr/local"
+                        else
+                                KRB5ROOT=${withval}
+                        fi
+			CPPFLAGS="$CPPFLAGS -I${KRB5ROOT}/include"
+                        LDFLAGS="$LDFLAGS -L${KRB5ROOT}/lib"
+                        cat >>confdefs.h <<\EOF
+#define KRB5 1
+EOF
+
+                        echo "$as_me:12564: checking whether we are using Heimdal" >&5
+echo $ECHO_N "checking whether we are using Heimdal... $ECHO_C" >&6
+                        cat >conftest.$ac_ext <<_ACEOF
+#line 12567 "configure"
+#include "confdefs.h"
+ #include <krb5.h>
+int
+main ()
+{
+ char *tmp = heimdal_version;
+  ;
+  return 0;
+}
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:13329: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:12579: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:13332: \$? = $ac_status" >&5
+  echo "$as_me:12582: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:13335: \"$ac_try\"") >&5
+  { (eval echo "$as_me:12585: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:12588: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+   echo "$as_me:12590: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+                                         cat >>confdefs.h <<\EOF
+#define HEIMDAL 1
+EOF
+
+                                         K5LIBS="-lkrb5 -ldes -lcom_err -lasn1 -lroken"
+
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ echo "$as_me:12601: result: no" >&5
+echo "${ECHO_T}no" >&6
+                                         K5LIBS="-lkrb5 -lk5crypto -lcom_err"
+
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+                        if test ! -z "$need_dash_r" ; then
+                                LDFLAGS="$LDFLAGS -R${KRB5ROOT}/lib"
+                        fi
+                        if test ! -z "$blibpath" ; then
+                                blibpath="$blibpath:${KRB5ROOT}/lib"
+                        fi
+
+echo "$as_me:12614: checking for dn_expand in -lresolv" >&5
+echo $ECHO_N "checking for dn_expand in -lresolv... $ECHO_C" >&6
+if test "${ac_cv_lib_resolv_dn_expand+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lresolv  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+#line 12622 "configure"
+#include "confdefs.h"
+
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char dn_expand ();
+int
+main ()
+{
+dn_expand ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:12641: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:12644: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:12647: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:13338: \$? = $ac_status" >&5
+  echo "$as_me:12650: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  ac_header_compiler=yes
+  ac_cv_lib_resolv_dn_expand=yes
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_cv_lib_resolv_dn_expand=no
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:12661: result: $ac_cv_lib_resolv_dn_expand" >&5
+echo "${ECHO_T}$ac_cv_lib_resolv_dn_expand" >&6
+if test $ac_cv_lib_resolv_dn_expand = yes; then
+  cat >>confdefs.h <<EOF
+#define HAVE_LIBRESOLV 1
+EOF
+
+  LIBS="-lresolv $LIBS"
+
+fi
+
+			echo "$as_me:12672: checking for gss_init_sec_context in -lgssapi" >&5
+echo $ECHO_N "checking for gss_init_sec_context in -lgssapi... $ECHO_C" >&6
+if test "${ac_cv_lib_gssapi_gss_init_sec_context+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lgssapi $K5LIBS $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+#line 12680 "configure"
+#include "confdefs.h"
+
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char gss_init_sec_context ();
+int
+main ()
+{
+gss_init_sec_context ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:12699: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:12702: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:12705: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:12708: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_lib_gssapi_gss_init_sec_context=yes
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_cv_lib_gssapi_gss_init_sec_context=no
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:12719: result: $ac_cv_lib_gssapi_gss_init_sec_context" >&5
+echo "${ECHO_T}$ac_cv_lib_gssapi_gss_init_sec_context" >&6
+if test $ac_cv_lib_gssapi_gss_init_sec_context = yes; then
+   cat >>confdefs.h <<\EOF
+#define GSSAPI 1
+EOF
+
+				  K5LIBS="-lgssapi $K5LIBS"
+else
+   echo "$as_me:12728: checking for gss_init_sec_context in -lgssapi_krb5" >&5
+echo $ECHO_N "checking for gss_init_sec_context in -lgssapi_krb5... $ECHO_C" >&6
+if test "${ac_cv_lib_gssapi_krb5_gss_init_sec_context+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lgssapi_krb5 $K5LIBS $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+#line 12736 "configure"
+#include "confdefs.h"
+
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char gss_init_sec_context ();
+int
+main ()
+{
+gss_init_sec_context ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:12755: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:12758: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:12761: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:12764: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_lib_gssapi_krb5_gss_init_sec_context=yes
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_cv_lib_gssapi_krb5_gss_init_sec_context=no
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:12775: result: $ac_cv_lib_gssapi_krb5_gss_init_sec_context" >&5
+echo "${ECHO_T}$ac_cv_lib_gssapi_krb5_gss_init_sec_context" >&6
+if test $ac_cv_lib_gssapi_krb5_gss_init_sec_context = yes; then
+   cat >>confdefs.h <<\EOF
+#define GSSAPI 1
+EOF
+
+				  	  K5LIBS="-lgssapi_krb5 $K5LIBS"
+else
+  { echo "$as_me:12784: WARNING: Cannot find any suitable gss-api library - build may fail" >&5
+echo "$as_me: WARNING: Cannot find any suitable gss-api library - build may fail" >&2;}
+fi
+
+fi
+
+			echo "$as_me:12790: checking for gssapi.h" >&5
+echo $ECHO_N "checking for gssapi.h... $ECHO_C" >&6
+if test "${ac_cv_header_gssapi_h+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+#line 12796 "configure"
+#include "confdefs.h"
+#include <gssapi.h>
+_ACEOF
+if { (eval echo "$as_me:12800: \"$ac_cpp conftest.$ac_ext\"") >&5
+  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+  ac_status=$?
+  egrep -v '^ *\+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:12806: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null; then
+  if test -s conftest.err; then
+    ac_cpp_err=$ac_c_preproc_warn_flag
+  else
+    ac_cpp_err=
+  fi
+else
+  ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+  ac_cv_header_gssapi_h=yes
 else
   echo "$as_me: failed program was:" >&5
-cat conftest.$ac_ext >&5
-ac_header_compiler=no
+  cat conftest.$ac_ext >&5
+  ac_cv_header_gssapi_h=no
 fi
-rm -f conftest.$ac_objext conftest.$ac_ext
-echo "$as_me:13347: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6
+rm -f conftest.err conftest.$ac_ext
+fi
+echo "$as_me:12825: result: $ac_cv_header_gssapi_h" >&5
+echo "${ECHO_T}$ac_cv_header_gssapi_h" >&6
+if test $ac_cv_header_gssapi_h = yes; then
+  :
+else
+   unset ac_cv_header_gssapi_h
+				  CPPFLAGS="$CPPFLAGS -I${KRB5ROOT}/include/gssapi"
 
-# Is the header present?
-echo "$as_me:13351: checking $ac_header presence" >&5
-echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
-cat >conftest.$ac_ext <<_ACEOF
-#line 13354 "configure"
+for ac_header in gssapi.h
+do
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+echo "$as_me:12836: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+#line 12842 "configure"
 #include "confdefs.h"
 #include <$ac_header>
 _ACEOF
-if { (eval echo "$as_me:13358: \"$ac_cpp conftest.$ac_ext\"") >&5
+if { (eval echo "$as_me:12846: \"$ac_cpp conftest.$ac_ext\"") >&5
   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
   ac_status=$?
   egrep -v '^ *\+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:13364: \$? = $ac_status" >&5
+  echo "$as_me:12852: \$? = $ac_status" >&5
   (exit $ac_status); } >/dev/null; then
   if test -s conftest.err; then
     ac_cpp_err=$ac_c_preproc_warn_flag
@@ -13372,136 +12860,80 @@
   ac_cpp_err=yes
 fi
 if test -z "$ac_cpp_err"; then
-  ac_header_preproc=yes
+  eval "$as_ac_Header=yes"
 else
   echo "$as_me: failed program was:" >&5
   cat conftest.$ac_ext >&5
-  ac_header_preproc=no
+  eval "$as_ac_Header=no"
 fi
 rm -f conftest.err conftest.$ac_ext
-echo "$as_me:13382: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6
-
-# So?  What about this header?
-case $ac_header_compiler:$ac_header_preproc in
-  yes:no )
-    { echo "$as_me:13388: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
-    { echo "$as_me:13390: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;};;
-  no:yes )
-    { echo "$as_me:13393: WARNING: $ac_header: present but cannot be compiled." >&5
-echo "$as_me: WARNING: $ac_header: present but cannot be compiled." >&2;}
-    { echo "$as_me:13395: WARNING: $ac_header: check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
-    { echo "$as_me:13397: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;};;
-esac
-echo "$as_me:13400: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  eval "$as_ac_Header=$ac_header_preproc"
 fi
-echo "$as_me:13407: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "$as_me:12871: result: `eval echo '${'$as_ac_Header'}'`" >&5
 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
-
-fi
 if test `eval echo '${'$as_ac_Header'}'` = yes; then
-  cat >>confdefs.h <<_ACEOF
+  cat >>confdefs.h <<EOF
 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
+EOF
 
-fi
+else
+  { echo "$as_me:12879: WARNING: Cannot find any suitable gss-api header - build may fail" >&5
+echo "$as_me: WARNING: Cannot find any suitable gss-api header - build may fail" >&2;}
 
+fi
 done
 
-			if test "$ac_cv_header_sectok_h" != yes; then
-				{ { echo "$as_me:13421: error: Can't find sectok.h" >&5
-echo "$as_me: error: Can't find sectok.h" >&2;}
-   { (exit 1); exit 1; }; }
-			fi
+fi
 
-echo "$as_me:13426: checking for sectok_open in -lsectok" >&5
-echo $ECHO_N "checking for sectok_open in -lsectok... $ECHO_C" >&6
-if test "${ac_cv_lib_sectok_sectok_open+set}" = set; then
+			oldCPP="$CPPFLAGS"
+			CPPFLAGS="$CPPFLAGS -I${KRB5ROOT}/include/gssapi"
+			echo "$as_me:12889: checking for gssapi_krb5.h" >&5
+echo $ECHO_N "checking for gssapi_krb5.h... $ECHO_C" >&6
+if test "${ac_cv_header_gssapi_krb5_h+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lsectok  $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-#line 13434 "configure"
+  cat >conftest.$ac_ext <<_ACEOF
+#line 12895 "configure"
 #include "confdefs.h"
-
-/* Override any gcc2 internal prototype to avoid an error.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
-char sectok_open ();
-#ifdef F77_DUMMY_MAIN
-#  ifdef __cplusplus
-     extern "C"
-#  endif
-   int F77_DUMMY_MAIN() { return 1; }
-#endif
-int
-main ()
-{
-sectok_open ();
-  ;
-  return 0;
-}
+#include <gssapi_krb5.h>
 _ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:13459: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
-  ac_status=$?
-  echo "$as_me:13462: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-         { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:13465: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+if { (eval echo "$as_me:12899: \"$ac_cpp conftest.$ac_ext\"") >&5
+  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
   ac_status=$?
-  echo "$as_me:13468: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_lib_sectok_sectok_open=yes
+  egrep -v '^ *\+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:12905: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null; then
+  if test -s conftest.err; then
+    ac_cpp_err=$ac_c_preproc_warn_flag
+  else
+    ac_cpp_err=
+  fi
+else
+  ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+  ac_cv_header_gssapi_krb5_h=yes
 else
   echo "$as_me: failed program was:" >&5
-cat conftest.$ac_ext >&5
-ac_cv_lib_sectok_sectok_open=no
+  cat conftest.$ac_ext >&5
+  ac_cv_header_gssapi_krb5_h=no
 fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
+rm -f conftest.err conftest.$ac_ext
 fi
-echo "$as_me:13479: result: $ac_cv_lib_sectok_sectok_open" >&5
-echo "${ECHO_T}$ac_cv_lib_sectok_sectok_open" >&6
-if test $ac_cv_lib_sectok_sectok_open = yes; then
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_LIBSECTOK 1
-_ACEOF
-
-  LIBS="-lsectok $LIBS"
-
+echo "$as_me:12924: result: $ac_cv_header_gssapi_krb5_h" >&5
+echo "${ECHO_T}$ac_cv_header_gssapi_krb5_h" >&6
+if test $ac_cv_header_gssapi_krb5_h = yes; then
+  :
+else
+   CPPFLAGS="$oldCPP"
 fi
 
-			if test "$ac_cv_lib_sectok_sectok_open" != yes; then
-				{ { echo "$as_me:13491: error: Can't find libsectok" >&5
-echo "$as_me: error: Can't find libsectok" >&2;}
-   { (exit 1); exit 1; }; }
-			fi
-			cat >>confdefs.h <<\_ACEOF
-#define SMARTCARD 1
-_ACEOF
-
-			SCARD_MSG="yes"
-		fi
+                        KRB5=yes
+                fi
 
 fi;
-
-# Check whether user wants Kerberos support
+# Check whether user wants Kerberos 4 support
 KRB4_MSG="no"
 
 # Check whether --with-kerberos4 or --without-kerberos4 was given.
@@ -13527,61 +12959,23 @@
 for ac_header in krb.h
 do
 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
-  echo "$as_me:13531: checking for $ac_header" >&5
+echo "$as_me:12962: checking for $ac_header" >&5
 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
 if eval "test \"\${$as_ac_Header+set}\" = set"; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
-fi
-echo "$as_me:13536: result: `eval echo '${'$as_ac_Header'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
-else
-  # Is the header compilable?
-echo "$as_me:13540: checking $ac_header usability" >&5
-echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
-cat >conftest.$ac_ext <<_ACEOF
-#line 13543 "configure"
-#include "confdefs.h"
-$ac_includes_default
-#include <$ac_header>
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:13549: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
-  ac_status=$?
-  echo "$as_me:13552: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-         { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:13555: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:13558: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_header_compiler=yes
 else
-  echo "$as_me: failed program was:" >&5
-cat conftest.$ac_ext >&5
-ac_header_compiler=no
-fi
-rm -f conftest.$ac_objext conftest.$ac_ext
-echo "$as_me:13567: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6
-
-# Is the header present?
-echo "$as_me:13571: checking $ac_header presence" >&5
-echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
-cat >conftest.$ac_ext <<_ACEOF
-#line 13574 "configure"
+  cat >conftest.$ac_ext <<_ACEOF
+#line 12968 "configure"
 #include "confdefs.h"
 #include <$ac_header>
 _ACEOF
-if { (eval echo "$as_me:13578: \"$ac_cpp conftest.$ac_ext\"") >&5
+if { (eval echo "$as_me:12972: \"$ac_cpp conftest.$ac_ext\"") >&5
   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
   ac_status=$?
   egrep -v '^ *\+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:13584: \$? = $ac_status" >&5
+  echo "$as_me:12978: \$? = $ac_status" >&5
   (exit $ac_status); } >/dev/null; then
   if test -s conftest.err; then
     ac_cpp_err=$ac_c_preproc_warn_flag
@@ -13592,57 +12986,30 @@
   ac_cpp_err=yes
 fi
 if test -z "$ac_cpp_err"; then
-  ac_header_preproc=yes
+  eval "$as_ac_Header=yes"
 else
   echo "$as_me: failed program was:" >&5
   cat conftest.$ac_ext >&5
-  ac_header_preproc=no
+  eval "$as_ac_Header=no"
 fi
 rm -f conftest.err conftest.$ac_ext
-echo "$as_me:13602: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6
-
-# So?  What about this header?
-case $ac_header_compiler:$ac_header_preproc in
-  yes:no )
-    { echo "$as_me:13608: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
-    { echo "$as_me:13610: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;};;
-  no:yes )
-    { echo "$as_me:13613: WARNING: $ac_header: present but cannot be compiled." >&5
-echo "$as_me: WARNING: $ac_header: present but cannot be compiled." >&2;}
-    { echo "$as_me:13615: WARNING: $ac_header: check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
-    { echo "$as_me:13617: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;};;
-esac
-echo "$as_me:13620: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  eval "$as_ac_Header=$ac_header_preproc"
 fi
-echo "$as_me:13627: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "$as_me:12997: result: `eval echo '${'$as_ac_Header'}'`" >&5
 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
-
-fi
 if test `eval echo '${'$as_ac_Header'}'` = yes; then
-  cat >>confdefs.h <<_ACEOF
+  cat >>confdefs.h <<EOF
 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
+EOF
 
 fi
-
 done
 
 			if test "$ac_cv_header_krb_h" != yes; then
-				{ echo "$as_me:13641: WARNING: Cannot find krb.h, build may fail" >&5
+				{ echo "$as_me:13008: WARNING: Cannot find krb.h, build may fail" >&5
 echo "$as_me: WARNING: Cannot find krb.h, build may fail" >&2;}
 			fi
 
-echo "$as_me:13645: checking for main in -lkrb" >&5
+echo "$as_me:13012: checking for main in -lkrb" >&5
 echo $ECHO_N "checking for main in -lkrb... $ECHO_C" >&6
 if test "${ac_cv_lib_krb_main+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -13650,15 +13017,9 @@
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-lkrb  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
-#line 13653 "configure"
+#line 13020 "configure"
 #include "confdefs.h"
 
-#ifdef F77_DUMMY_MAIN
-#  ifdef __cplusplus
-     extern "C"
-#  endif
-   int F77_DUMMY_MAIN() { return 1; }
-#endif
 int
 main ()
 {
@@ -13668,16 +13029,16 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:13671: \"$ac_link\"") >&5
+if { (eval echo "$as_me:13032: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:13674: \$? = $ac_status" >&5
+  echo "$as_me:13035: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:13677: \"$ac_try\"") >&5
+  { (eval echo "$as_me:13038: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:13680: \$? = $ac_status" >&5
+  echo "$as_me:13041: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_lib_krb_main=yes
 else
@@ -13688,12 +13049,12 @@
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-echo "$as_me:13691: result: $ac_cv_lib_krb_main" >&5
+echo "$as_me:13052: result: $ac_cv_lib_krb_main" >&5
 echo "${ECHO_T}$ac_cv_lib_krb_main" >&6
 if test $ac_cv_lib_krb_main = yes; then
-  cat >>confdefs.h <<_ACEOF
+  cat >>confdefs.h <<EOF
 #define HAVE_LIBKRB 1
-_ACEOF
+EOF
 
   LIBS="-lkrb $LIBS"
 
@@ -13701,7 +13062,7 @@
 
 			if test "$ac_cv_lib_krb_main" != yes; then
 
-echo "$as_me:13704: checking for main in -lkrb4" >&5
+echo "$as_me:13065: checking for main in -lkrb4" >&5
 echo $ECHO_N "checking for main in -lkrb4... $ECHO_C" >&6
 if test "${ac_cv_lib_krb4_main+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -13709,15 +13070,9 @@
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-lkrb4  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
-#line 13712 "configure"
+#line 13073 "configure"
 #include "confdefs.h"
 
-#ifdef F77_DUMMY_MAIN
-#  ifdef __cplusplus
-     extern "C"
-#  endif
-   int F77_DUMMY_MAIN() { return 1; }
-#endif
 int
 main ()
 {
@@ -13727,16 +13082,16 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:13730: \"$ac_link\"") >&5
+if { (eval echo "$as_me:13085: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:13733: \$? = $ac_status" >&5
+  echo "$as_me:13088: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:13736: \"$ac_try\"") >&5
+  { (eval echo "$as_me:13091: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:13739: \$? = $ac_status" >&5
+  echo "$as_me:13094: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_lib_krb4_main=yes
 else
@@ -13747,19 +13102,19 @@
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-echo "$as_me:13750: result: $ac_cv_lib_krb4_main" >&5
+echo "$as_me:13105: result: $ac_cv_lib_krb4_main" >&5
 echo "${ECHO_T}$ac_cv_lib_krb4_main" >&6
 if test $ac_cv_lib_krb4_main = yes; then
-  cat >>confdefs.h <<_ACEOF
+  cat >>confdefs.h <<EOF
 #define HAVE_LIBKRB4 1
-_ACEOF
+EOF
 
   LIBS="-lkrb4 $LIBS"
 
 fi
 
 				if test "$ac_cv_lib_krb4_main" != yes; then
-					{ echo "$as_me:13762: WARNING: Cannot find libkrb nor libkrb4, build may fail" >&5
+					{ echo "$as_me:13117: WARNING: Cannot find libkrb nor libkrb4, build may fail" >&5
 echo "$as_me: WARNING: Cannot find libkrb nor libkrb4, build may fail" >&2;}
 				else
 					KLIBS="-lkrb4"
@@ -13768,7 +13123,7 @@
 				KLIBS="-lkrb"
 			fi
 
-echo "$as_me:13771: checking for des_cbc_encrypt in -ldes" >&5
+echo "$as_me:13126: checking for des_cbc_encrypt in -ldes" >&5
 echo $ECHO_N "checking for des_cbc_encrypt in -ldes... $ECHO_C" >&6
 if test "${ac_cv_lib_des_des_cbc_encrypt+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -13776,7 +13131,7 @@
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-ldes  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
-#line 13779 "configure"
+#line 13134 "configure"
 #include "confdefs.h"
 
 /* Override any gcc2 internal prototype to avoid an error.  */
@@ -13786,12 +13141,6 @@
 /* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
 char des_cbc_encrypt ();
-#ifdef F77_DUMMY_MAIN
-#  ifdef __cplusplus
-     extern "C"
-#  endif
-   int F77_DUMMY_MAIN() { return 1; }
-#endif
 int
 main ()
 {
@@ -13801,16 +13150,16 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:13804: \"$ac_link\"") >&5
+if { (eval echo "$as_me:13153: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:13807: \$? = $ac_status" >&5
+  echo "$as_me:13156: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:13810: \"$ac_try\"") >&5
+  { (eval echo "$as_me:13159: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:13813: \$? = $ac_status" >&5
+  echo "$as_me:13162: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_lib_des_des_cbc_encrypt=yes
 else
@@ -13821,12 +13170,12 @@
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-echo "$as_me:13824: result: $ac_cv_lib_des_des_cbc_encrypt" >&5
+echo "$as_me:13173: result: $ac_cv_lib_des_des_cbc_encrypt" >&5
 echo "${ECHO_T}$ac_cv_lib_des_des_cbc_encrypt" >&6
 if test $ac_cv_lib_des_des_cbc_encrypt = yes; then
-  cat >>confdefs.h <<_ACEOF
+  cat >>confdefs.h <<EOF
 #define HAVE_LIBDES 1
-_ACEOF
+EOF
 
   LIBS="-ldes $LIBS"
 
@@ -13834,7 +13183,7 @@
 
 			if test "$ac_cv_lib_des_des_cbc_encrypt" != yes; then
 
-echo "$as_me:13837: checking for des_cbc_encrypt in -ldes425" >&5
+echo "$as_me:13186: checking for des_cbc_encrypt in -ldes425" >&5
 echo $ECHO_N "checking for des_cbc_encrypt in -ldes425... $ECHO_C" >&6
 if test "${ac_cv_lib_des425_des_cbc_encrypt+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -13842,7 +13191,7 @@
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-ldes425  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
-#line 13845 "configure"
+#line 13194 "configure"
 #include "confdefs.h"
 
 /* Override any gcc2 internal prototype to avoid an error.  */
@@ -13852,12 +13201,6 @@
 /* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
 char des_cbc_encrypt ();
-#ifdef F77_DUMMY_MAIN
-#  ifdef __cplusplus
-     extern "C"
-#  endif
-   int F77_DUMMY_MAIN() { return 1; }
-#endif
 int
 main ()
 {
@@ -13867,16 +13210,16 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:13870: \"$ac_link\"") >&5
+if { (eval echo "$as_me:13213: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:13873: \$? = $ac_status" >&5
+  echo "$as_me:13216: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:13876: \"$ac_try\"") >&5
+  { (eval echo "$as_me:13219: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:13879: \$? = $ac_status" >&5
+  echo "$as_me:13222: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_lib_des425_des_cbc_encrypt=yes
 else
@@ -13887,19 +13230,19 @@
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-echo "$as_me:13890: result: $ac_cv_lib_des425_des_cbc_encrypt" >&5
+echo "$as_me:13233: result: $ac_cv_lib_des425_des_cbc_encrypt" >&5
 echo "${ECHO_T}$ac_cv_lib_des425_des_cbc_encrypt" >&6
 if test $ac_cv_lib_des425_des_cbc_encrypt = yes; then
-  cat >>confdefs.h <<_ACEOF
+  cat >>confdefs.h <<EOF
 #define HAVE_LIBDES425 1
-_ACEOF
+EOF
 
   LIBS="-ldes425 $LIBS"
 
 fi
 
 				if test "$ac_cv_lib_des425_des_cbc_encrypt" != yes; then
-					{ echo "$as_me:13902: WARNING: Cannot find libdes nor libdes425, build may fail" >&5
+					{ echo "$as_me:13245: WARNING: Cannot find libdes nor libdes425, build may fail" >&5
 echo "$as_me: WARNING: Cannot find libdes nor libdes425, build may fail" >&2;}
 				else
 					KLIBS="-ldes425"
@@ -13908,7 +13251,7 @@
 				KLIBS="-ldes"
 			fi
 
-echo "$as_me:13911: checking for dn_expand in -lresolv" >&5
+echo "$as_me:13254: checking for dn_expand in -lresolv" >&5
 echo $ECHO_N "checking for dn_expand in -lresolv... $ECHO_C" >&6
 if test "${ac_cv_lib_resolv_dn_expand+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -13916,7 +13259,7 @@
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-lresolv  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
-#line 13919 "configure"
+#line 13262 "configure"
 #include "confdefs.h"
 
 /* Override any gcc2 internal prototype to avoid an error.  */
@@ -13926,12 +13269,6 @@
 /* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
 char dn_expand ();
-#ifdef F77_DUMMY_MAIN
-#  ifdef __cplusplus
-     extern "C"
-#  endif
-   int F77_DUMMY_MAIN() { return 1; }
-#endif
 int
 main ()
 {
@@ -13941,16 +13278,16 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:13944: \"$ac_link\"") >&5
+if { (eval echo "$as_me:13281: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:13947: \$? = $ac_status" >&5
+  echo "$as_me:13284: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:13950: \"$ac_try\"") >&5
+  { (eval echo "$as_me:13287: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:13953: \$? = $ac_status" >&5
+  echo "$as_me:13290: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_lib_resolv_dn_expand=yes
 else
@@ -13961,12 +13298,12 @@
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-echo "$as_me:13964: result: $ac_cv_lib_resolv_dn_expand" >&5
+echo "$as_me:13301: result: $ac_cv_lib_resolv_dn_expand" >&5
 echo "${ECHO_T}$ac_cv_lib_resolv_dn_expand" >&6
 if test $ac_cv_lib_resolv_dn_expand = yes; then
-  cat >>confdefs.h <<_ACEOF
+  cat >>confdefs.h <<EOF
 #define HAVE_LIBRESOLV 1
-_ACEOF
+EOF
 
   LIBS="-lresolv $LIBS"
 
@@ -13974,9 +13311,9 @@
 
 			KRB4=yes
 			KRB4_MSG="yes"
-			cat >>confdefs.h <<\_ACEOF
+			cat >>confdefs.h <<\EOF
 #define KRB4 1
-_ACEOF
+EOF
 
 		fi
 
@@ -13997,7 +13334,7 @@
 			fi
 
 			if test -z "$KRB4" ; then
-				{ echo "$as_me:14000: WARNING: AFS requires Kerberos IV support, build may fail" >&5
+				{ echo "$as_me:13337: WARNING: AFS requires Kerberos IV support, build may fail" >&5
 echo "$as_me: WARNING: AFS requires Kerberos IV support, build may fail" >&2;}
 			fi
 
@@ -14005,15 +13342,15 @@
 			if test ! -z "$AFS_LIBS" ; then
 				LIBS="$LIBS $AFS_LIBS"
 			fi
-			cat >>confdefs.h <<\_ACEOF
+			cat >>confdefs.h <<\EOF
 #define AFS 1
-_ACEOF
+EOF
 
 			AFS_MSG="yes"
 		fi
 
 fi;
-LIBS="$LIBS $KLIBS"
+LIBS="$LIBS $KLIBS $K5LIBS"
 
 # Looking for programs, paths and files
 
@@ -14029,7 +13366,7 @@
 
 		# Extract the first word of "rsh", so it can be a program name with args.
 set dummy rsh; ac_word=$2
-echo "$as_me:14032: checking for $ac_word" >&5
+echo "$as_me:13369: checking for $ac_word" >&5
 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
 if test "${ac_cv_path_rsh_path+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -14046,7 +13383,7 @@
   test -z "$ac_dir" && ac_dir=.
   if $as_executable_p "$ac_dir/$ac_word"; then
    ac_cv_path_rsh_path="$ac_dir/$ac_word"
-   echo "$as_me:14049: found $ac_dir/$ac_word" >&5
+   echo "$as_me:13386: found $ac_dir/$ac_word" >&5
    break
 fi
 done
@@ -14057,10 +13394,10 @@
 rsh_path=$ac_cv_path_rsh_path
 
 if test -n "$rsh_path"; then
-  echo "$as_me:14060: result: $rsh_path" >&5
+  echo "$as_me:13397: result: $rsh_path" >&5
 echo "${ECHO_T}$rsh_path" >&6
 else
-  echo "$as_me:14063: result: no" >&5
+  echo "$as_me:13400: result: no" >&5
 echo "${ECHO_T}no" >&6
 fi
 
@@ -14078,7 +13415,7 @@
 
 		# Extract the first word of "xauth", so it can be a program name with args.
 set dummy xauth; ac_word=$2
-echo "$as_me:14081: checking for $ac_word" >&5
+echo "$as_me:13418: checking for $ac_word" >&5
 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
 if test "${ac_cv_path_xauth_path+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -14095,7 +13432,7 @@
   test -z "$ac_dir" && ac_dir=.
   if $as_executable_p "$ac_dir/$ac_word"; then
    ac_cv_path_xauth_path="$ac_dir/$ac_word"
-   echo "$as_me:14098: found $ac_dir/$ac_word" >&5
+   echo "$as_me:13435: found $ac_dir/$ac_word" >&5
    break
 fi
 done
@@ -14106,10 +13443,10 @@
 xauth_path=$ac_cv_path_xauth_path
 
 if test -n "$xauth_path"; then
-  echo "$as_me:14109: result: $xauth_path" >&5
+  echo "$as_me:13446: result: $xauth_path" >&5
 echo "${ECHO_T}$xauth_path" >&6
 else
-  echo "$as_me:14112: result: no" >&5
+  echo "$as_me:13449: result: no" >&5
 echo "${ECHO_T}no" >&6
 fi
 
@@ -14123,37 +13460,37 @@
 	XAUTH_PATH="undefined"
 
 else
-	cat >>confdefs.h <<_ACEOF
+	cat >>confdefs.h <<EOF
 #define XAUTH_PATH "$xauth_path"
-_ACEOF
+EOF
 
 	XAUTH_PATH=$xauth_path
 
 fi
 if test ! -z "$rsh_path" ; then
-	cat >>confdefs.h <<_ACEOF
+	cat >>confdefs.h <<EOF
 #define RSH_PATH "$rsh_path"
-_ACEOF
+EOF
 
 fi
 
 # Check for mail directory (last resort if we cannot get it from headers)
 if test ! -z "$MAIL" ; then
 	maildir=`dirname $MAIL`
-	cat >>confdefs.h <<_ACEOF
+	cat >>confdefs.h <<EOF
 #define MAIL_DIRECTORY "$maildir"
-_ACEOF
+EOF
 
 fi
 
 if test -z "$no_dev_ptmx" ; then
-	echo "$as_me:14150: checking for \"/dev/ptmx\"" >&5
+	echo "$as_me:13487: checking for \"/dev/ptmx\"" >&5
 echo $ECHO_N "checking for \"/dev/ptmx\"... $ECHO_C" >&6
 if test "${ac_cv_file___dev_ptmx_+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   test "$cross_compiling" = yes &&
-  { { echo "$as_me:14156: error: cannot check for file existence when cross compiling" >&5
+  { { echo "$as_me:13493: error: cannot check for file existence when cross compiling" >&5
 echo "$as_me: error: cannot check for file existence when cross compiling" >&2;}
    { (exit 1); exit 1; }; }
 if test -r ""/dev/ptmx""; then
@@ -14162,26 +13499,26 @@
   ac_cv_file___dev_ptmx_=no
 fi
 fi
-echo "$as_me:14165: result: $ac_cv_file___dev_ptmx_" >&5
+echo "$as_me:13502: result: $ac_cv_file___dev_ptmx_" >&5
 echo "${ECHO_T}$ac_cv_file___dev_ptmx_" >&6
 if test $ac_cv_file___dev_ptmx_ = yes; then
 
-			cat >>confdefs.h <<_ACEOF
+			cat >>confdefs.h <<EOF
 #define HAVE_DEV_PTMX 1
-_ACEOF
+EOF
 
 			have_dev_ptmx=1
 
 fi
 
 fi
-echo "$as_me:14178: checking for \"/dev/ptc\"" >&5
+echo "$as_me:13515: checking for \"/dev/ptc\"" >&5
 echo $ECHO_N "checking for \"/dev/ptc\"... $ECHO_C" >&6
 if test "${ac_cv_file___dev_ptc_+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   test "$cross_compiling" = yes &&
-  { { echo "$as_me:14184: error: cannot check for file existence when cross compiling" >&5
+  { { echo "$as_me:13521: error: cannot check for file existence when cross compiling" >&5
 echo "$as_me: error: cannot check for file existence when cross compiling" >&2;}
    { (exit 1); exit 1; }; }
 if test -r ""/dev/ptc""; then
@@ -14190,13 +13527,13 @@
   ac_cv_file___dev_ptc_=no
 fi
 fi
-echo "$as_me:14193: result: $ac_cv_file___dev_ptc_" >&5
+echo "$as_me:13530: result: $ac_cv_file___dev_ptc_" >&5
 echo "${ECHO_T}$ac_cv_file___dev_ptc_" >&6
 if test $ac_cv_file___dev_ptc_ = yes; then
 
-		cat >>confdefs.h <<_ACEOF
+		cat >>confdefs.h <<EOF
 #define HAVE_DEV_PTS_AND_PTC 1
-_ACEOF
+EOF
 
 		have_dev_ptc=1
 
@@ -14213,7 +13550,7 @@
 			MANTYPE=$withval
 			;;
 		*)
-			{ { echo "$as_me:14216: error: invalid man type: $withval" >&5
+			{ { echo "$as_me:13553: error: invalid man type: $withval" >&5
 echo "$as_me: error: invalid man type: $withval" >&2;}
    { (exit 1); exit 1; }; }
 			;;
@@ -14225,7 +13562,7 @@
 do
   # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
-echo "$as_me:14228: checking for $ac_word" >&5
+echo "$as_me:13565: checking for $ac_word" >&5
 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
 if test "${ac_cv_path_NROFF+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -14242,7 +13579,7 @@
   test -z "$ac_dir" && ac_dir=.
   if $as_executable_p "$ac_dir/$ac_word"; then
    ac_cv_path_NROFF="$ac_dir/$ac_word"
-   echo "$as_me:14245: found $ac_dir/$ac_word" >&5
+   echo "$as_me:13582: found $ac_dir/$ac_word" >&5
    break
 fi
 done
@@ -14253,10 +13590,10 @@
 NROFF=$ac_cv_path_NROFF
 
 if test -n "$NROFF"; then
-  echo "$as_me:14256: result: $NROFF" >&5
+  echo "$as_me:13593: result: $NROFF" >&5
 echo "${ECHO_T}$NROFF" >&6
 else
-  echo "$as_me:14259: result: no" >&5
+  echo "$as_me:13596: result: no" >&5
 echo "${ECHO_T}no" >&6
 fi
 
@@ -14287,9 +13624,9 @@
   withval="$with_md5_passwords"
 
 		if test "x$withval" != "xno" ; then
-			cat >>confdefs.h <<\_ACEOF
+			cat >>confdefs.h <<\EOF
 #define HAVE_MD5_PASSWORDS 1
-_ACEOF
+EOF
 
 			MD5_MSG="yes"
 		fi
@@ -14303,9 +13640,9 @@
   withval="$with_shadow"
 
 		if test "x$withval" = "xno" ; then
-			cat >>confdefs.h <<\_ACEOF
+			cat >>confdefs.h <<\EOF
 #define DISABLE_SHADOW 1
-_ACEOF
+EOF
 
 			disable_shadow=yes
 		fi
@@ -14313,22 +13650,16 @@
 fi;
 
 if test -z "$disable_shadow" ; then
-	echo "$as_me:14316: checking if the systems has expire shadow information" >&5
+	echo "$as_me:13653: checking if the systems has expire shadow information" >&5
 echo $ECHO_N "checking if the systems has expire shadow information... $ECHO_C" >&6
 	cat >conftest.$ac_ext <<_ACEOF
-#line 14319 "configure"
+#line 13656 "configure"
 #include "confdefs.h"
 
 #include <sys/types.h>
 #include <shadow.h>
 	struct spwd sp;
 
-#ifdef F77_DUMMY_MAIN
-#  ifdef __cplusplus
-     extern "C"
-#  endif
-   int F77_DUMMY_MAIN() { return 1; }
-#endif
 int
 main ()
 {
@@ -14338,16 +13669,16 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:14341: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:13672: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:14344: \$? = $ac_status" >&5
+  echo "$as_me:13675: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:14347: \"$ac_try\"") >&5
+  { (eval echo "$as_me:13678: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:14350: \$? = $ac_status" >&5
+  echo "$as_me:13681: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
    sp_expire_available=yes
 else
@@ -14358,14 +13689,14 @@
 rm -f conftest.$ac_objext conftest.$ac_ext
 
 	if test "x$sp_expire_available" = "xyes" ; then
-		echo "$as_me:14361: result: yes" >&5
+		echo "$as_me:13692: result: yes" >&5
 echo "${ECHO_T}yes" >&6
-		cat >>confdefs.h <<\_ACEOF
+		cat >>confdefs.h <<\EOF
 #define HAS_SHADOW_EXPIRE 1
-_ACEOF
+EOF
 
 	else
-		echo "$as_me:14368: result: no" >&5
+		echo "$as_me:13699: result: no" >&5
 echo "${ECHO_T}no" >&6
 	fi
 fi
@@ -14373,9 +13704,9 @@
 # Use ip address instead of hostname in $DISPLAY
 if test ! -z "$IPADDR_IN_DISPLAY" ; then
 	DISPLAY_HACK_MSG="yes"
-	cat >>confdefs.h <<\_ACEOF
+	cat >>confdefs.h <<\EOF
 #define IPADDR_IN_DISPLAY 1
-_ACEOF
+EOF
 
 else
 	DISPLAY_HACK_MSG="no"
@@ -14385,9 +13716,9 @@
   withval="$with_ipaddr_display"
 
 			if test "x$withval" != "xno" ; then
-				cat >>confdefs.h <<\_ACEOF
+				cat >>confdefs.h <<\EOF
 #define IPADDR_IN_DISPLAY 1
-_ACEOF
+EOF
 
 				DISPLAY_HACK_MSG="yes"
 			fi
@@ -14414,7 +13745,7 @@
 
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line 14417 "configure"
+#line 13748 "configure"
 #include "confdefs.h"
 
 /* find out what STDPATH is */
@@ -14447,15 +13778,15 @@
 
 _ACEOF
 rm -f conftest$ac_exeext
-if { (eval echo "$as_me:14450: \"$ac_link\"") >&5
+if { (eval echo "$as_me:13781: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:14453: \$? = $ac_status" >&5
+  echo "$as_me:13784: \$? = $ac_status" >&5
   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
-  { (eval echo "$as_me:14455: \"$ac_try\"") >&5
+  { (eval echo "$as_me:13786: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:14458: \$? = $ac_status" >&5
+  echo "$as_me:13789: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
    user_path=`cat conftest.stdpath`
 else
@@ -14479,15 +13810,15 @@
 			echo $user_path | grep "^$t_bindir"  > /dev/null 2>&1
 			if test $? -ne 0  ; then
 				user_path=$user_path:$t_bindir
-				echo "$as_me:14482: result: Adding $t_bindir to USER_PATH so scp will work" >&5
+				echo "$as_me:13813: result: Adding $t_bindir to USER_PATH so scp will work" >&5
 echo "${ECHO_T}Adding $t_bindir to USER_PATH so scp will work" >&6
 			fi
 		fi
 
 fi;
-cat >>confdefs.h <<_ACEOF
+cat >>confdefs.h <<EOF
 #define USER_PATH "$user_path"
-_ACEOF
+EOF
 
 # Whether to force IPv4 by default (needed on broken glibc Linux)
 IPV4_HACK_MSG="no"
@@ -14497,16 +13828,16 @@
   withval="$with_ipv4_default"
 
 		if test "x$withval" != "xno" ; then
-			cat >>confdefs.h <<\_ACEOF
+			cat >>confdefs.h <<\EOF
 #define IPV4_DEFAULT 1
-_ACEOF
+EOF
 
 			IPV4_HACK_MSG="yes"
 		fi
 
 fi;
 
-echo "$as_me:14509: checking if we need to convert IPv4 in IPv6-mapped addresses" >&5
+echo "$as_me:13840: checking if we need to convert IPv4 in IPv6-mapped addresses" >&5
 echo $ECHO_N "checking if we need to convert IPv4 in IPv6-mapped addresses... $ECHO_C" >&6
 IPV4_IN6_HACK_MSG="no"
 
@@ -14515,30 +13846,30 @@
   withval="$with_4in6"
 
 		if test "x$withval" != "xno" ; then
-			echo "$as_me:14518: result: yes" >&5
+			echo "$as_me:13849: result: yes" >&5
 echo "${ECHO_T}yes" >&6
-			cat >>confdefs.h <<\_ACEOF
+			cat >>confdefs.h <<\EOF
 #define IPV4_IN_IPV6 1
-_ACEOF
+EOF
 
 			IPV4_IN6_HACK_MSG="yes"
 		else
-			echo "$as_me:14526: result: no" >&5
+			echo "$as_me:13857: result: no" >&5
 echo "${ECHO_T}no" >&6
 		fi
 
 else
 
 		if test "x$inet6_default_4in6" = "xyes"; then
-			echo "$as_me:14533: result: yes (default)" >&5
+			echo "$as_me:13864: result: yes (default)" >&5
 echo "${ECHO_T}yes (default)" >&6
-			cat >>confdefs.h <<\_ACEOF
+			cat >>confdefs.h <<\EOF
 #define IPV4_IN_IPV6 1
-_ACEOF
+EOF
 
 			IPV4_IN6_HACK_MSG="yes"
 		else
-			echo "$as_me:14541: result: no (default)" >&5
+			echo "$as_me:13872: result: no (default)" >&5
 echo "${ECHO_T}no (default)" >&6
 		fi
 
@@ -14552,33 +13883,33 @@
   withval="$with_bsd_auth"
 
 		if test "x$withval" != "xno" ; then
-			cat >>confdefs.h <<\_ACEOF
+			cat >>confdefs.h <<\EOF
 #define BSD_AUTH 1
-_ACEOF
+EOF
 
 			BSD_AUTH_MSG=yes
 		fi
 
 fi;
 
-echo "$as_me:14564: checking whether to install ssh as suid root" >&5
+echo "$as_me:13895: checking whether to install ssh as suid root" >&5
 echo $ECHO_N "checking whether to install ssh as suid root... $ECHO_C" >&6
 # Check whether --enable-suid-ssh or --disable-suid-ssh was given.
 if test "${enable_suid_ssh+set}" = set; then
   enableval="$enable_suid_ssh"
    case "$enableval" in
   no)
-       echo "$as_me:14571: result: no" >&5
+       echo "$as_me:13902: result: no" >&5
 echo "${ECHO_T}no" >&6
        SSHMODE=0711
        ;;
-  *)   echo "$as_me:14575: result: yes" >&5
+  *)   echo "$as_me:13906: result: yes" >&5
 echo "${ECHO_T}yes" >&6
        SSHMODE=4711
        ;;
   esac
 else
-  echo "$as_me:14581: result: yes" >&5
+  echo "$as_me:13912: result: yes" >&5
 echo "${ECHO_T}yes" >&6
   SSHMODE=4711
 
@@ -14605,72 +13936,72 @@
 	esac
 fi
 
-cat >>confdefs.h <<_ACEOF
+cat >>confdefs.h <<EOF
 #define _PATH_SSH_PIDDIR "$piddir"
-_ACEOF
+EOF
 
 # Check whether --enable-lastlog or --disable-lastlog was given.
 if test "${enable_lastlog+set}" = set; then
   enableval="$enable_lastlog"
-   cat >>confdefs.h <<\_ACEOF
+   cat >>confdefs.h <<\EOF
 #define DISABLE_LASTLOG 1
-_ACEOF
+EOF
 
 fi;
 # Check whether --enable-utmp or --disable-utmp was given.
 if test "${enable_utmp+set}" = set; then
   enableval="$enable_utmp"
-   cat >>confdefs.h <<\_ACEOF
+   cat >>confdefs.h <<\EOF
 #define DISABLE_UTMP 1
-_ACEOF
+EOF
 
 fi;
 # Check whether --enable-utmpx or --disable-utmpx was given.
 if test "${enable_utmpx+set}" = set; then
   enableval="$enable_utmpx"
-   cat >>confdefs.h <<\_ACEOF
+   cat >>confdefs.h <<\EOF
 #define DISABLE_UTMPX 1
-_ACEOF
+EOF
 
 fi;
 # Check whether --enable-wtmp or --disable-wtmp was given.
 if test "${enable_wtmp+set}" = set; then
   enableval="$enable_wtmp"
-   cat >>confdefs.h <<\_ACEOF
+   cat >>confdefs.h <<\EOF
 #define DISABLE_WTMP 1
-_ACEOF
+EOF
 
 fi;
 # Check whether --enable-wtmpx or --disable-wtmpx was given.
 if test "${enable_wtmpx+set}" = set; then
   enableval="$enable_wtmpx"
-   cat >>confdefs.h <<\_ACEOF
+   cat >>confdefs.h <<\EOF
 #define DISABLE_WTMPX 1
-_ACEOF
+EOF
 
 fi;
 # Check whether --enable-libutil or --disable-libutil was given.
 if test "${enable_libutil+set}" = set; then
   enableval="$enable_libutil"
-   cat >>confdefs.h <<\_ACEOF
+   cat >>confdefs.h <<\EOF
 #define DISABLE_LOGIN 1
-_ACEOF
+EOF
 
 fi;
 # Check whether --enable-pututline or --disable-pututline was given.
 if test "${enable_pututline+set}" = set; then
   enableval="$enable_pututline"
-   cat >>confdefs.h <<\_ACEOF
+   cat >>confdefs.h <<\EOF
 #define DISABLE_PUTUTLINE 1
-_ACEOF
+EOF
 
 fi;
 # Check whether --enable-pututxline or --disable-pututxline was given.
 if test "${enable_pututxline+set}" = set; then
   enableval="$enable_pututxline"
-   cat >>confdefs.h <<\_ACEOF
+   cat >>confdefs.h <<\EOF
 #define DISABLE_PUTUTXLINE 1
-_ACEOF
+EOF
 
 fi;
 
@@ -14679,9 +14010,9 @@
   withval="$with_lastlog"
 
 		if test "x$withval" = "xno" ; then
-			cat >>confdefs.h <<\_ACEOF
+			cat >>confdefs.h <<\EOF
 #define DISABLE_LASTLOG 1
-_ACEOF
+EOF
 
 		else
 			conf_lastlog_location=$withval
@@ -14689,10 +14020,10 @@
 
 fi;
 
-echo "$as_me:14692: checking if your system defines LASTLOG_FILE" >&5
+echo "$as_me:14023: checking if your system defines LASTLOG_FILE" >&5
 echo $ECHO_N "checking if your system defines LASTLOG_FILE... $ECHO_C" >&6
 cat >conftest.$ac_ext <<_ACEOF
-#line 14695 "configure"
+#line 14026 "configure"
 #include "confdefs.h"
 
 #include <sys/types.h>
@@ -14707,12 +14038,6 @@
 # include <login.h>
 #endif
 
-#ifdef F77_DUMMY_MAIN
-#  ifdef __cplusplus
-     extern "C"
-#  endif
-   int F77_DUMMY_MAIN() { return 1; }
-#endif
 int
 main ()
 {
@@ -14722,29 +14047,29 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:14725: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:14050: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:14728: \$? = $ac_status" >&5
+  echo "$as_me:14053: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:14731: \"$ac_try\"") >&5
+  { (eval echo "$as_me:14056: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:14734: \$? = $ac_status" >&5
+  echo "$as_me:14059: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-   echo "$as_me:14736: result: yes" >&5
+   echo "$as_me:14061: result: yes" >&5
 echo "${ECHO_T}yes" >&6
 else
   echo "$as_me: failed program was:" >&5
 cat conftest.$ac_ext >&5
 
-		echo "$as_me:14742: result: no" >&5
+		echo "$as_me:14067: result: no" >&5
 echo "${ECHO_T}no" >&6
-		echo "$as_me:14744: checking if your system defines _PATH_LASTLOG" >&5
+		echo "$as_me:14069: checking if your system defines _PATH_LASTLOG" >&5
 echo $ECHO_N "checking if your system defines _PATH_LASTLOG... $ECHO_C" >&6
 		cat >conftest.$ac_ext <<_ACEOF
-#line 14747 "configure"
+#line 14072 "configure"
 #include "confdefs.h"
 
 #include <sys/types.h>
@@ -14756,12 +14081,6 @@
 #  include <paths.h>
 #endif
 
-#ifdef F77_DUMMY_MAIN
-#  ifdef __cplusplus
-     extern "C"
-#  endif
-   int F77_DUMMY_MAIN() { return 1; }
-#endif
 int
 main ()
 {
@@ -14771,24 +14090,24 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:14774: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:14093: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:14777: \$? = $ac_status" >&5
+  echo "$as_me:14096: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:14780: \"$ac_try\"") >&5
+  { (eval echo "$as_me:14099: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:14783: \$? = $ac_status" >&5
+  echo "$as_me:14102: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-   echo "$as_me:14785: result: yes" >&5
+   echo "$as_me:14104: result: yes" >&5
 echo "${ECHO_T}yes" >&6
 else
   echo "$as_me: failed program was:" >&5
 cat conftest.$ac_ext >&5
 
-			echo "$as_me:14791: result: no" >&5
+			echo "$as_me:14110: result: no" >&5
 echo "${ECHO_T}no" >&6
 			system_lastlog_path=no
 
@@ -14806,23 +14125,23 @@
 				fi
 		done
 		if test -z "$conf_lastlog_location"; then
-			{ echo "$as_me:14809: WARNING: ** Cannot find lastlog **" >&5
+			{ echo "$as_me:14128: WARNING: ** Cannot find lastlog **" >&5
 echo "$as_me: WARNING: ** Cannot find lastlog **" >&2;}
 					fi
 	fi
 fi
 
 if test -n "$conf_lastlog_location"; then
-	cat >>confdefs.h <<_ACEOF
+	cat >>confdefs.h <<EOF
 #define CONF_LASTLOG_FILE "$conf_lastlog_location"
-_ACEOF
+EOF
 
 fi
 
-echo "$as_me:14822: checking if your system defines UTMP_FILE" >&5
+echo "$as_me:14141: checking if your system defines UTMP_FILE" >&5
 echo $ECHO_N "checking if your system defines UTMP_FILE... $ECHO_C" >&6
 cat >conftest.$ac_ext <<_ACEOF
-#line 14825 "configure"
+#line 14144 "configure"
 #include "confdefs.h"
 
 #include <sys/types.h>
@@ -14831,12 +14150,6 @@
 #  include <paths.h>
 #endif
 
-#ifdef F77_DUMMY_MAIN
-#  ifdef __cplusplus
-     extern "C"
-#  endif
-   int F77_DUMMY_MAIN() { return 1; }
-#endif
 int
 main ()
 {
@@ -14846,23 +14159,23 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:14849: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:14162: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:14852: \$? = $ac_status" >&5
+  echo "$as_me:14165: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:14855: \"$ac_try\"") >&5
+  { (eval echo "$as_me:14168: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:14858: \$? = $ac_status" >&5
+  echo "$as_me:14171: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-   echo "$as_me:14860: result: yes" >&5
+   echo "$as_me:14173: result: yes" >&5
 echo "${ECHO_T}yes" >&6
 else
   echo "$as_me: failed program was:" >&5
 cat conftest.$ac_ext >&5
- echo "$as_me:14865: result: no" >&5
+ echo "$as_me:14178: result: no" >&5
 echo "${ECHO_T}no" >&6
 	  system_utmp_path=no
 
@@ -14876,24 +14189,24 @@
 			fi
 		done
 		if test -z "$conf_utmp_location"; then
-			cat >>confdefs.h <<\_ACEOF
+			cat >>confdefs.h <<\EOF
 #define DISABLE_UTMP 1
-_ACEOF
+EOF
 
 		fi
 	fi
 fi
 if test -n "$conf_utmp_location"; then
-	cat >>confdefs.h <<_ACEOF
+	cat >>confdefs.h <<EOF
 #define CONF_UTMP_FILE "$conf_utmp_location"
-_ACEOF
+EOF
 
 fi
 
-echo "$as_me:14893: checking if your system defines WTMP_FILE" >&5
+echo "$as_me:14206: checking if your system defines WTMP_FILE" >&5
 echo $ECHO_N "checking if your system defines WTMP_FILE... $ECHO_C" >&6
 cat >conftest.$ac_ext <<_ACEOF
-#line 14896 "configure"
+#line 14209 "configure"
 #include "confdefs.h"
 
 #include <sys/types.h>
@@ -14902,12 +14215,6 @@
 #  include <paths.h>
 #endif
 
-#ifdef F77_DUMMY_MAIN
-#  ifdef __cplusplus
-     extern "C"
-#  endif
-   int F77_DUMMY_MAIN() { return 1; }
-#endif
 int
 main ()
 {
@@ -14917,23 +14224,23 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:14920: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:14227: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:14923: \$? = $ac_status" >&5
+  echo "$as_me:14230: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:14926: \"$ac_try\"") >&5
+  { (eval echo "$as_me:14233: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:14929: \$? = $ac_status" >&5
+  echo "$as_me:14236: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-   echo "$as_me:14931: result: yes" >&5
+   echo "$as_me:14238: result: yes" >&5
 echo "${ECHO_T}yes" >&6
 else
   echo "$as_me: failed program was:" >&5
 cat conftest.$ac_ext >&5
- echo "$as_me:14936: result: no" >&5
+ echo "$as_me:14243: result: no" >&5
 echo "${ECHO_T}no" >&6
 	  system_wtmp_path=no
 
@@ -14947,24 +14254,24 @@
 			fi
 		done
 		if test -z "$conf_wtmp_location"; then
-			cat >>confdefs.h <<\_ACEOF
+			cat >>confdefs.h <<\EOF
 #define DISABLE_WTMP 1
-_ACEOF
+EOF
 
 		fi
 	fi
 fi
 if test -n "$conf_wtmp_location"; then
-	cat >>confdefs.h <<_ACEOF
+	cat >>confdefs.h <<EOF
 #define CONF_WTMP_FILE "$conf_wtmp_location"
-_ACEOF
+EOF
 
 fi
 
-echo "$as_me:14964: checking if your system defines UTMPX_FILE" >&5
+echo "$as_me:14271: checking if your system defines UTMPX_FILE" >&5
 echo $ECHO_N "checking if your system defines UTMPX_FILE... $ECHO_C" >&6
 cat >conftest.$ac_ext <<_ACEOF
-#line 14967 "configure"
+#line 14274 "configure"
 #include "confdefs.h"
 
 #include <sys/types.h>
@@ -14976,12 +14283,6 @@
 #  include <paths.h>
 #endif
 
-#ifdef F77_DUMMY_MAIN
-#  ifdef __cplusplus
-     extern "C"
-#  endif
-   int F77_DUMMY_MAIN() { return 1; }
-#endif
 int
 main ()
 {
@@ -14991,23 +14292,23 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:14994: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:14295: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:14997: \$? = $ac_status" >&5
+  echo "$as_me:14298: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:15000: \"$ac_try\"") >&5
+  { (eval echo "$as_me:14301: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:15003: \$? = $ac_status" >&5
+  echo "$as_me:14304: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-   echo "$as_me:15005: result: yes" >&5
+   echo "$as_me:14306: result: yes" >&5
 echo "${ECHO_T}yes" >&6
 else
   echo "$as_me: failed program was:" >&5
 cat conftest.$ac_ext >&5
- echo "$as_me:15010: result: no" >&5
+ echo "$as_me:14311: result: no" >&5
 echo "${ECHO_T}no" >&6
 	  system_utmpx_path=no
 
@@ -15015,22 +14316,22 @@
 rm -f conftest.$ac_objext conftest.$ac_ext
 if test -z "$conf_utmpx_location"; then
 	if test x"$system_utmpx_path" = x"no" ; then
-		cat >>confdefs.h <<\_ACEOF
+		cat >>confdefs.h <<\EOF
 #define DISABLE_UTMPX 1
-_ACEOF
+EOF
 
 	fi
 else
-	cat >>confdefs.h <<_ACEOF
+	cat >>confdefs.h <<EOF
 #define CONF_UTMPX_FILE "$conf_utmpx_location"
-_ACEOF
+EOF
 
 fi
 
-echo "$as_me:15030: checking if your system defines WTMPX_FILE" >&5
+echo "$as_me:14331: checking if your system defines WTMPX_FILE" >&5
 echo $ECHO_N "checking if your system defines WTMPX_FILE... $ECHO_C" >&6
 cat >conftest.$ac_ext <<_ACEOF
-#line 15033 "configure"
+#line 14334 "configure"
 #include "confdefs.h"
 
 #include <sys/types.h>
@@ -15042,12 +14343,6 @@
 #  include <paths.h>
 #endif
 
-#ifdef F77_DUMMY_MAIN
-#  ifdef __cplusplus
-     extern "C"
-#  endif
-   int F77_DUMMY_MAIN() { return 1; }
-#endif
 int
 main ()
 {
@@ -15057,23 +14352,23 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:15060: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:14355: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:15063: \$? = $ac_status" >&5
+  echo "$as_me:14358: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:15066: \"$ac_try\"") >&5
+  { (eval echo "$as_me:14361: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:15069: \$? = $ac_status" >&5
+  echo "$as_me:14364: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-   echo "$as_me:15071: result: yes" >&5
+   echo "$as_me:14366: result: yes" >&5
 echo "${ECHO_T}yes" >&6
 else
   echo "$as_me: failed program was:" >&5
 cat conftest.$ac_ext >&5
- echo "$as_me:15076: result: no" >&5
+ echo "$as_me:14371: result: no" >&5
 echo "${ECHO_T}no" >&6
 	  system_wtmpx_path=no
 
@@ -15081,21 +14376,21 @@
 rm -f conftest.$ac_objext conftest.$ac_ext
 if test -z "$conf_wtmpx_location"; then
 	if test x"$system_wtmpx_path" = x"no" ; then
-		cat >>confdefs.h <<\_ACEOF
+		cat >>confdefs.h <<\EOF
 #define DISABLE_WTMPX 1
-_ACEOF
+EOF
 
 	fi
 else
-	cat >>confdefs.h <<_ACEOF
+	cat >>confdefs.h <<EOF
 #define CONF_WTMPX_FILE "$conf_wtmpx_location"
-_ACEOF
+EOF
 
 fi
 
 if test ! -z "$blibpath" ; then
 	LDFLAGS="$LDFLAGS -blibpath:$blibpath"
-	{ echo "$as_me:15098: WARNING: Please check and edit -blibpath in LDFLAGS in Makefile" >&5
+	{ echo "$as_me:14393: WARNING: Please check and edit -blibpath in LDFLAGS in Makefile" >&5
 echo "$as_me: WARNING: Please check and edit -blibpath in LDFLAGS in Makefile" >&2;}
 fi
 
@@ -15187,25 +14482,22 @@
 : ${CONFIG_STATUS=./config.status}
 ac_clean_files_save=$ac_clean_files
 ac_clean_files="$ac_clean_files $CONFIG_STATUS"
-{ echo "$as_me:15190: creating $CONFIG_STATUS" >&5
+{ echo "$as_me:14485: creating $CONFIG_STATUS" >&5
 echo "$as_me: creating $CONFIG_STATUS" >&6;}
 cat >$CONFIG_STATUS <<_ACEOF
 #! $SHELL
-# Generated automatically by $as_me.
+# Generated automatically by configure.
 # Run this file to recreate the current configuration.
 # Compiler output produced by configure, useful for debugging
 # configure, is in config.log if it exists.
 
 debug=false
 SHELL=\${CONFIG_SHELL-$SHELL}
+ac_cs_invocation="\$0 \$@"
+
 _ACEOF
 
 cat >>$CONFIG_STATUS <<\_ACEOF
-
-## --------------------- ##
-## M4sh Initialization.  ##
-## --------------------- ##
-
 # Be Bourne compatible
 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
   emulate sh
@@ -15271,30 +14563,6 @@
 
 exec 6>&1
 
-# Open the log real soon, to keep \$[0] and so on meaningful, and to
-# report actual input values of CONFIG_FILES etc. instead of their
-# values after options handling.  Logging --version etc. is OK.
-exec 5>>config.log
-{
-  echo
-  sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
-## Running \$as_me. ##
-_ASBOX
-} >&5
-cat >&5 <<_CSEOF
-
-This file was extended by $as_me, which was
-generated by GNU Autoconf 2.52d.  Invocation command line was
-
-  CONFIG_FILES    = $CONFIG_FILES
-  CONFIG_HEADERS  = $CONFIG_HEADERS
-  CONFIG_LINKS    = $CONFIG_LINKS
-  CONFIG_COMMANDS = $CONFIG_COMMANDS
-  $ $@
-
-_CSEOF
-echo "on `(hostname || uname -n) 2>/dev/null | sed 1q`" >&5
-echo >&5
 _ACEOF
 
 # Files that config.status was made for.
@@ -15314,7 +14582,7 @@
   echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS
 fi
 
-cat >>$CONFIG_STATUS <<\_ACEOF
+cat >>$CONFIG_STATUS <<\EOF
 
 ac_cs_usage="\
 \`$as_me' instantiates files from templates according to the
@@ -15338,12 +14606,12 @@
 $config_headers
 
 Report bugs to <bug-autoconf@gnu.org>."
-_ACEOF
+EOF
 
-cat >>$CONFIG_STATUS <<_ACEOF
+cat >>$CONFIG_STATUS <<EOF
 ac_cs_version="\\
 config.status
-configured by $0, generated by GNU Autoconf 2.52d,
+configured by $0, generated by GNU Autoconf 2.52,
   with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
 
 Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
@@ -15352,9 +14620,9 @@
 gives unlimited permission to copy, distribute and modify it."
 srcdir=$srcdir
 INSTALL="$INSTALL"
-_ACEOF
+EOF
 
-cat >>$CONFIG_STATUS <<\_ACEOF
+cat >>$CONFIG_STATUS <<\EOF
 # If no file are specified by the user, then we need to provide default
 # value.  By we need to know if files were specified by the user.
 ac_need_defaults=:
@@ -15376,18 +14644,18 @@
 
   case $1 in
   # Handling of the options.
-_ACEOF
-cat >>$CONFIG_STATUS <<_ACEOF
+EOF
+cat >>$CONFIG_STATUS <<EOF
   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
     echo "running $SHELL $0 " $ac_configure_args " --no-create --no-recursion"
     exec $SHELL $0 $ac_configure_args --no-create --no-recursion ;;
-_ACEOF
-cat >>$CONFIG_STATUS <<\_ACEOF
+EOF
+cat >>$CONFIG_STATUS <<\EOF
   --version | --vers* | -V )
     echo "$ac_cs_version"; exit 0 ;;
   --he | --h)
     # Conflict between --help and --header
-    { { echo "$as_me:15390: error: ambiguous option: $1
+    { { echo "$as_me:14658: error: ambiguous option: $1
 Try \`$0 --help' for more information." >&5
 echo "$as_me: error: ambiguous option: $1
 Try \`$0 --help' for more information." >&2;}
@@ -15406,7 +14674,7 @@
     ac_need_defaults=false;;
 
   # This is an error.
-  -*) { { echo "$as_me:15409: error: unrecognized option: $1
+  -*) { { echo "$as_me:14677: error: unrecognized option: $1
 Try \`$0 --help' for more information." >&5
 echo "$as_me: error: unrecognized option: $1
 Try \`$0 --help' for more information." >&2;}
@@ -15418,9 +14686,25 @@
   shift
 done
 
+exec 5>>config.log
+cat >&5 << _ACEOF
+
+## ----------------------- ##
+## Running config.status.  ##
+## ----------------------- ##
+
+This file was extended by $as_me 2.52, executed with
+  CONFIG_FILES    = $CONFIG_FILES
+  CONFIG_HEADERS  = $CONFIG_HEADERS
+  CONFIG_LINKS    = $CONFIG_LINKS
+  CONFIG_COMMANDS = $CONFIG_COMMANDS
+  > $ac_cs_invocation
+on `(hostname || uname -n) 2>/dev/null | sed 1q`
+
 _ACEOF
+EOF
 
-cat >>$CONFIG_STATUS <<\_ACEOF
+cat >>$CONFIG_STATUS <<\EOF
 for ac_config_target in $ac_config_targets
 do
   case "$ac_config_target" in
@@ -15430,7 +14714,7 @@
   "scard/Makefile" ) CONFIG_FILES="$CONFIG_FILES scard/Makefile" ;;
   "ssh_prng_cmds" ) CONFIG_FILES="$CONFIG_FILES ssh_prng_cmds" ;;
   "config.h" ) CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;;
-  *) { { echo "$as_me:15433: error: invalid argument: $ac_config_target" >&5
+  *) { { echo "$as_me:14717: error: invalid argument: $ac_config_target" >&5
 echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
    { (exit 1); exit 1; }; };;
   esac
@@ -15467,9 +14751,9 @@
    { (exit 1); exit 1; }
 }
 
-_ACEOF
+EOF
 
-cat >>$CONFIG_STATUS <<_ACEOF
+cat >>$CONFIG_STATUS <<EOF
 
 #
 # CONFIG_FILES section.
@@ -15571,9 +14855,9 @@
 s,@piddir@,$piddir,;t t
 CEOF
 
-_ACEOF
+EOF
 
-  cat >>$CONFIG_STATUS <<\_ACEOF
+  cat >>$CONFIG_STATUS <<\EOF
   # Split the substitutions into bite-sized pieces for seds with
   # small command number limits, like on Digital OSF/1 and HP-UX.
   ac_max_sed_lines=48
@@ -15612,8 +14896,8 @@
   fi
 fi # test -n "$CONFIG_FILES"
 
-_ACEOF
-cat >>$CONFIG_STATUS <<\_ACEOF
+EOF
+cat >>$CONFIG_STATUS <<\EOF
 for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue
   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
   case $ac_file in
@@ -15638,7 +14922,8 @@
   	  /^X\(\/\/\)$/{ s//\1/; q; }
   	  /^X\(\/\).*/{ s//\1/; q; }
   	  s/.*/./; q'`
-  { case "$ac_dir" in
+  if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
+    { case "$ac_dir" in
   [\\/]* | ?:[\\/]* ) as_incr_dir=;;
   *)                      as_incr_dir=.;;
 esac
@@ -15649,46 +14934,40 @@
     ?:) as_incr_dir=$as_mkdir_dir ;;
     *)
       as_incr_dir=$as_incr_dir/$as_mkdir_dir
-      test -d "$as_incr_dir" ||
-        mkdir "$as_incr_dir" ||
-	{ { echo "$as_me:15654: error: cannot create \"$ac_dir\"" >&5
-echo "$as_me: error: cannot create \"$ac_dir\"" >&2;}
-   { (exit 1); exit 1; }; }
+      test -d "$as_incr_dir" || mkdir "$as_incr_dir"
     ;;
   esac
 done; }
 
-  if test "$ac_dir" != .; then
-  ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\./,,'`
-  # A "../" for each directory in $ac_dir_suffix.
-  ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^/]*,../,g'`
-else
-  ac_dir_suffix= ac_top_builddir=
-fi
+    ac_dir_suffix="/`echo $ac_dir|sed 's,^\./,,'`"
+    # A "../" for each directory in $ac_dir_suffix.
+    ac_dots=`echo "$ac_dir_suffix" | sed 's,/[^/]*,../,g'`
+  else
+    ac_dir_suffix= ac_dots=
+  fi
 
-case $srcdir in
-  .)  # No --srcdir option.  We are building in place.
-    ac_srcdir=.
-    if test -z "$ac_top_builddir"; then
-       ac_top_srcdir=.
-    else
-       ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'`
-    fi ;;
-  [\\/]* | ?:[\\/]* )  # Absolute path.
-    ac_srcdir=$srcdir$ac_dir_suffix;
-    ac_top_srcdir=$srcdir ;;
+  case $srcdir in
+  .)  ac_srcdir=.
+      if test -z "$ac_dots"; then
+         ac_top_srcdir=.
+      else
+         ac_top_srcdir=`echo $ac_dots | sed 's,/$,,'`
+      fi ;;
+  [\\/]* | ?:[\\/]* )
+      ac_srcdir=$srcdir$ac_dir_suffix;
+      ac_top_srcdir=$srcdir ;;
   *) # Relative path.
-    ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix
-    ac_top_srcdir=$ac_top_builddir$srcdir ;;
-esac
+    ac_srcdir=$ac_dots$srcdir$ac_dir_suffix
+    ac_top_srcdir=$ac_dots$srcdir ;;
+  esac
 
   case $INSTALL in
   [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
-  *) ac_INSTALL=$ac_top_builddir$INSTALL ;;
+  *) ac_INSTALL=$ac_dots$INSTALL ;;
   esac
 
   if test x"$ac_file" != x-; then
-    { echo "$as_me:15691: creating $ac_file" >&5
+    { echo "$as_me:14970: creating $ac_file" >&5
 echo "$as_me: creating $ac_file" >&6;}
     rm -f "$ac_file"
   fi
@@ -15706,7 +14985,7 @@
       -) echo $tmp/stdin ;;
       [\\/$]*)
          # Absolute (can't be DOS-style, as IFS=:)
-         test -f "$f" || { { echo "$as_me:15709: error: cannot find input file: $f" >&5
+         test -f "$f" || { { echo "$as_me:14988: error: cannot find input file: $f" >&5
 echo "$as_me: error: cannot find input file: $f" >&2;}
    { (exit 1); exit 1; }; }
          echo $f;;
@@ -15719,18 +14998,18 @@
            echo $srcdir/$f
          else
            # /dev/null tree
-           { { echo "$as_me:15722: error: cannot find input file: $f" >&5
+           { { echo "$as_me:15001: error: cannot find input file: $f" >&5
 echo "$as_me: error: cannot find input file: $f" >&2;}
    { (exit 1); exit 1; }; }
          fi;;
       esac
     done` || { (exit 1); exit 1; }
-_ACEOF
-cat >>$CONFIG_STATUS <<_ACEOF
+EOF
+cat >>$CONFIG_STATUS <<EOF
   sed "$ac_vpsub
 $extrasub
-_ACEOF
-cat >>$CONFIG_STATUS <<\_ACEOF
+EOF
+cat >>$CONFIG_STATUS <<\EOF
 :t
 /@[a-zA-Z_][a-zA-Z_0-9]*@/!b
 s,@configure_input@,$configure_input,;t t
@@ -15747,8 +15026,8 @@
   fi
 
 done
-_ACEOF
-cat >>$CONFIG_STATUS <<\_ACEOF
+EOF
+cat >>$CONFIG_STATUS <<\EOF
 
 #
 # CONFIG_HEADER section.
@@ -15780,7 +15059,7 @@
   * )   ac_file_in=$ac_file.in ;;
   esac
 
-  test x"$ac_file" != x- && { echo "$as_me:15783: creating $ac_file" >&5
+  test x"$ac_file" != x- && { echo "$as_me:15062: creating $ac_file" >&5
 echo "$as_me: creating $ac_file" >&6;}
 
   # First look for the input files in the build tree, otherwise in the
@@ -15791,7 +15070,7 @@
       -) echo $tmp/stdin ;;
       [\\/$]*)
          # Absolute (can't be DOS-style, as IFS=:)
-         test -f "$f" || { { echo "$as_me:15794: error: cannot find input file: $f" >&5
+         test -f "$f" || { { echo "$as_me:15073: error: cannot find input file: $f" >&5
 echo "$as_me: error: cannot find input file: $f" >&2;}
    { (exit 1); exit 1; }; }
          echo $f;;
@@ -15804,7 +15083,7 @@
            echo $srcdir/$f
          else
            # /dev/null tree
-           { { echo "$as_me:15807: error: cannot find input file: $f" >&5
+           { { echo "$as_me:15086: error: cannot find input file: $f" >&5
 echo "$as_me: error: cannot find input file: $f" >&2;}
    { (exit 1); exit 1; }; }
          fi;;
@@ -15813,7 +15092,7 @@
   # Remove the trailing spaces.
   sed 's/[ 	]*$//' $ac_file_inputs >$tmp/in
 
-_ACEOF
+EOF
 
 # Transform confdefs.h into two sed scripts, `conftest.defines' and
 # `conftest.undefs', that substitutes the proper values into
@@ -15829,7 +15108,7 @@
 # `end' is used to avoid that the second main sed command (meant for
 # 0-ary CPP macros) applies to n-ary macro definitions.
 # See the Autoconf documentation for `clear'.
-cat >confdef2sed.sed <<\_ACEOF
+cat >confdef2sed.sed <<\EOF
 s/[\\&,]/\\&/g
 s,[\\$`],\\&,g
 t clear
@@ -15838,7 +15117,7 @@
 t end
 s,^[ 	]*#[ 	]*define[ 	][ 	]*\([^ 	][^ 	]*\)[ 	]*\(.*\)$,${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD},gp
 : end
-_ACEOF
+EOF
 # If some macros were called several times there might be several times
 # the same #defines, which is useless.  Nevertheless, we may not want to
 # sort them, since we want the *last* AC-DEFINE to be honored.
@@ -15849,9 +15128,9 @@
 # This sed command replaces #undef with comments.  This is necessary, for
 # example, in the case of _POSIX_SOURCE, which is predefined and required
 # on some systems where configure will not decide to define it.
-cat >>conftest.undefs <<\_ACEOF
+cat >>conftest.undefs <<\EOF
 s,^[ 	]*#[ 	]*undef[ 	][ 	]*[a-zA-Z_][a-zA-Z_0-9]*,/* & */,
-_ACEOF
+EOF
 
 # Break up conftest.defines because some shells have a limit on the size
 # of here documents, and old seds have small limits too (100 cmds).
@@ -15908,7 +15187,7 @@
 done
 rm -f conftest.undefs
 
-cat >>$CONFIG_STATUS <<\_ACEOF
+cat >>$CONFIG_STATUS <<\EOF
   # Let's still pretend it is `configure' which instantiates (i.e., don't
   # use $as_me), people would be surprised to read:
   #    /* config.h.  Generated automatically by config.status.  */
@@ -15921,7 +15200,7 @@
   rm -f $tmp/in
   if test x"$ac_file" != x-; then
     if cmp -s $ac_file $tmp/config.h 2>/dev/null; then
-      { echo "$as_me:15924: $ac_file is unchanged" >&5
+      { echo "$as_me:15203: $ac_file is unchanged" >&5
 echo "$as_me: $ac_file is unchanged" >&6;}
     else
       ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
@@ -15935,7 +15214,8 @@
   	  /^X\(\/\/\)$/{ s//\1/; q; }
   	  /^X\(\/\).*/{ s//\1/; q; }
   	  s/.*/./; q'`
-      { case "$ac_dir" in
+      if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
+        { case "$ac_dir" in
   [\\/]* | ?:[\\/]* ) as_incr_dir=;;
   *)                      as_incr_dir=.;;
 esac
@@ -15946,15 +15226,12 @@
     ?:) as_incr_dir=$as_mkdir_dir ;;
     *)
       as_incr_dir=$as_incr_dir/$as_mkdir_dir
-      test -d "$as_incr_dir" ||
-        mkdir "$as_incr_dir" ||
-	{ { echo "$as_me:15951: error: cannot create \"$ac_dir\"" >&5
-echo "$as_me: error: cannot create \"$ac_dir\"" >&2;}
-   { (exit 1); exit 1; }; }
+      test -d "$as_incr_dir" || mkdir "$as_incr_dir"
     ;;
   esac
 done; }
 
+      fi
       rm -f $ac_file
       mv $tmp/config.h $ac_file
     fi
@@ -15963,12 +15240,12 @@
     rm -f $tmp/config.h
   fi
 done
-_ACEOF
+EOF
 
-cat >>$CONFIG_STATUS <<\_ACEOF
+cat >>$CONFIG_STATUS <<\EOF
 
 { (exit 0); exit 0; }
-_ACEOF
+EOF
 chmod +x $CONFIG_STATUS
 ac_clean_files=$ac_clean_files_save
 
@@ -16060,3 +15337,4 @@
 	echo "future versions of your OS."
 	echo ""
 fi
+
diff -Naur openssh-3.1p1/configure.ac openssh-3.1p1-gsi/configure.ac
--- openssh-3.1p1/configure.ac	Wed Feb 27 00:12:35 2002
+++ openssh-3.1p1-gsi/configure.ac	Thu Apr  4 17:03:45 2002
@@ -451,6 +451,118 @@
 	]
 )
 
+# Check whether the user wants GSI (Globus) support
+gsi_path="no"
+AC_ARG_WITH(gsi,
+	[  --with-gsi=PATH         Enable GSI/Globus authentication support],
+	[
+		gsi_path="$withval"
+	]
+)
+
+AC_ARG_WITH(globus,
+	[  --with-globus=PATH      Enable GSI/Globus authentication support],
+	[
+		gsi_path="$withval"
+	]
+)
+
+# Check whether the user has a Globus flavor type
+globus_flavor_type="no"
+AC_ARG_WITH(globus-flavor,
+	[  --with-globus-flavor=TYPE         Describe Globus flavor type (ex: gcc32dbg, etc.)],
+	[
+		globus_flavor_type="$withval"
+	]
+)
+
+if test "x$gsi_path" != "xno" ; then
+	# Globus GSSAPI configuration
+	AC_DEFINE(GSSAPI)
+	AC_DEFINE(GSI)
+
+	# Find GLOBUS/GSI installation Directory
+	AC_MSG_CHECKING(for Globus/GSI installation directory)
+
+	globus_install_dir=$gsi_path
+
+	if test "x$globus_install_dir" = "xyes" ; then
+		if test -n "$GLOBUS_INSTALL_PATH" ; then
+			globus_install_dir=$GLOBUS_INSTALL_PATH
+		elif test -n "$GSI_INSTALL_PATH" ; then
+			globus_install_dir=$GSI_INSTALL_PATH
+		elif test -d /usr/local/globus ; then
+			globus_install_dir="/usr/local/globus"
+		elif test -d /usr/local/gsi ; then
+			globus_install_dir="/usr/local/gsi"
+		else
+			AC_MSG_ERROR(Cannot find Globus/GSI installation directory)
+		fi	
+	fi
+	AC_MSG_RESULT($globus_install_dir)
+
+	# Find GLOBUS/GSI development directory
+	AC_MSG_CHECKING(for Globus/GSI development directory)
+
+	if test -d ${globus_install_dir}/lib ; then
+		# Looks like a flat directory structure from configure/make
+		# and not globus-install or gsi-install
+		globus_dev_dir=$globus_install_dir
+
+	else
+		# Assume a true globus installation with architecture
+		# directories and run globus-development-path to find
+		# the development directory
+
+		# Set GLOBUS_INSTALL_PATH
+		GLOBUS_INSTALL_PATH=$globus_install_dir
+		export GLOBUS_INSTALL_PATH
+
+		dev_path_program=${globus_install_dir}/bin/globus-development-path
+
+		if test ! -x ${dev_path_program} ; then
+			AC_MSG_ERROR(Cannot find Globus/GSI installation directory: program ${dev_path_program} does not exist or is not executable)
+		fi
+
+		globus_dev_dir=`${dev_path_program}`
+
+		if test -z "$globus_dev_dir" -o "X$globus_dev_dir" = "X<not found>" ; then
+				AC_MSG_ERROR(Cannot find Globus/GSI development directory)
+		fi
+
+		if test ! -d "$globus_dev_dir" ; then
+			AC_MSG_ERROR(Cannot find Globus/GSI development directory: $globus_dev_dir does not exist)
+		fi
+	fi
+	AC_MSG_RESULT($globus_dev_dir)
+
+	# Find GLOBUS/GSI flavor Directory
+	AC_MSG_CHECKING(for Globus flavor type)
+
+        if test "x$globus_flavor_type" = "xno" ; then
+		GSI_LIBS="-lglobus_gss_assist -lglobus_gss -lglobus_gaa"
+		GSI_LDFLAGS="-L${globus_dev_dir}/lib"
+		GSI_CFLAGS="-I${globus_dev_dir}/include"
+		AC_MSG_RESULT(none)
+	else
+                GLOBUS_FLAVOR_TYPE_INCL_DIR="${globus_dev_dir}/include/${globus_flavor_type}"
+
+		if test ! -d "$GLOBUS_FLAVOR_TYPE_INCL_DIR" ; then
+			AC_MSG_ERROR(Cannot find Globus flavor-specific include directory: ${GLOBUS_FLAVOR_TYPE_INCL_DIR})
+                fi
+
+		AC_MSG_RESULT($globus_flavor_type)
+		GSI_LIBS="-lglobus_gss_assist_${globus_flavor_type} -lglobus_gssapi_gsi_${globus_flavor_type}"
+		GSI_LDFLAGS="-L${globus_dev_dir}/lib"
+		GSI_CFLAGS="-I${GLOBUS_FLAVOR_TYPE_INCL_DIR}"
+	fi
+
+	LIBS="$LIBS $GSI_LIBS"
+	LDFLAGS="$LDFLAGS $GSI_LDFLAGS"
+	CFLAGS="$CFLAGS $GSI_CFLAGS"
+# End Globus/GSI section
+fi
+
 # Check whether user wants S/Key support
 SKEY_MSG="no" 
 AC_ARG_WITH(skey,
@@ -644,6 +756,7 @@
 			AC_CHECK_LIB(dl, dlopen, , )
 			AC_CHECK_LIB(pam, pam_set_item, , AC_MSG_ERROR([*** libpam missing]))
 			AC_CHECK_FUNCS(pam_getenvlist)
+			AC_CHECK_FUNCS(pam_putenv)
 
 			disable_shadow=yes
 			PAM_MSG="yes"
@@ -654,6 +767,7 @@
 			else
 				LIBPAM="-lpam"
 			fi
+
 			AC_SUBST(LIBPAM)
 		fi
 	]
@@ -691,6 +805,11 @@
 saved_LIBS="$LIBS"
 saved_LDFLAGS="$LDFLAGS"
 saved_CPPFLAGS="$CPPFLAGS"
+if test "x$globus_flavor_type" != "xno" ; then
+LIBS="$saved_LIBS -lglobus_ssl_utils_${globus_flavor_type} -lssl_${globus_flavor_type} -lcrypto_${globus_flavor_type}"
+LDFLAGS="$saved_LDFLAGS"
+CPPFLAGS="$saved_CPPFLAGS"
+else
 if test "x$prefix" != "xNONE" ; then
 	tryssldir="$tryssldir $prefix"
 fi
@@ -789,7 +908,12 @@
 		fi
 	fi
 fi
+if test "x$gsi_path" == "xno" ; then
 LIBS="$saved_LIBS -lcrypto"
+else
+LIBS="$saved_LIBS -lssl -lcrypto"
+fi
+fi # globus_flavor_type
 
 # Now test RSA support
 saved_LIBS="$LIBS"
@@ -1640,7 +1764,68 @@
 	]
 )
 
-# Check whether user wants Kerberos support
+# Check whether user wants Kerberos 5 support
+AC_ARG_WITH(kerberos5,
+        [  --with-kerberos5=PATH   Enable Kerberos 5 support],
+        [
+                if test "x$withval" != "xno" ; then
+                        if test "x$withval" = "xyes" ; then
+                                KRB5ROOT="/usr/local"
+                        else
+                                KRB5ROOT=${withval}
+                        fi
+			CPPFLAGS="$CPPFLAGS -I${KRB5ROOT}/include"
+                        LDFLAGS="$LDFLAGS -L${KRB5ROOT}/lib"
+                        AC_DEFINE(KRB5)
+                        AC_MSG_CHECKING(whether we are using Heimdal)
+                        AC_TRY_COMPILE([ #include <krb5.h> ],
+                                       [ char *tmp = heimdal_version; ],
+                                       [ AC_MSG_RESULT(yes)
+                                         AC_DEFINE(HEIMDAL)
+                                         K5LIBS="-lkrb5 -ldes -lcom_err -lasn1 -lroken"
+                                       ],
+                                       [ AC_MSG_RESULT(no)
+                                         K5LIBS="-lkrb5 -lk5crypto -lcom_err"
+                                       ]
+                        )
+                        if test ! -z "$need_dash_r" ; then
+                                LDFLAGS="$LDFLAGS -R${KRB5ROOT}/lib"
+                        fi
+                        if test ! -z "$blibpath" ; then
+                                blibpath="$blibpath:${KRB5ROOT}/lib"
+                        fi
+                        AC_CHECK_LIB(resolv, dn_expand, , )
+
+			AC_CHECK_LIB(gssapi,gss_init_sec_context,
+				[ AC_DEFINE(GSSAPI)
+				  K5LIBS="-lgssapi $K5LIBS" ],
+				[ AC_CHECK_LIB(gssapi_krb5,gss_init_sec_context,
+					[ AC_DEFINE(GSSAPI)
+				  	  K5LIBS="-lgssapi_krb5 $K5LIBS" ],
+					AC_MSG_WARN([Cannot find any suitable gss-api library - build may fail]),
+					$K5LIBS)
+				],
+				$K5LIBS)
+			
+			AC_CHECK_HEADER(gssapi.h, ,
+				[ unset ac_cv_header_gssapi_h
+				  CPPFLAGS="$CPPFLAGS -I${KRB5ROOT}/include/gssapi" 
+				  AC_CHECK_HEADERS(gssapi.h, ,
+					AC_MSG_WARN([Cannot find any suitable gss-api header - build may fail])
+				  ) 
+				]
+			)
+
+			oldCPP="$CPPFLAGS"
+			CPPFLAGS="$CPPFLAGS -I${KRB5ROOT}/include/gssapi"
+			AC_CHECK_HEADER(gssapi_krb5.h, ,
+					[ CPPFLAGS="$oldCPP" ])
+
+                        KRB5=yes
+                fi
+        ]
+)
+# Check whether user wants Kerberos 4 support
 KRB4_MSG="no" 
 AC_ARG_WITH(kerberos4,
 	[  --with-kerberos4=PATH   Enable Kerberos 4 support],
@@ -1720,7 +1905,7 @@
 		fi
 	]
 )
-LIBS="$LIBS $KLIBS"
+LIBS="$LIBS $KLIBS $K5LIBS"
 
 # Looking for programs, paths and files
 AC_ARG_WITH(rsh,
diff -Naur openssh-3.1p1/gss-genr.c openssh-3.1p1-gsi/gss-genr.c
--- openssh-3.1p1/gss-genr.c	Wed Dec 31 18:00:00 1969
+++ openssh-3.1p1-gsi/gss-genr.c	Thu Apr  4 17:03:45 2002
@@ -0,0 +1,495 @@
+/*
+ * Copyright (c) 2001 Simon Wilkinson. All rights reserved. *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR `AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "includes.h"
+
+#ifdef GSSAPI
+
+#include "ssh.h"
+#include "ssh2.h"
+#include "xmalloc.h"
+#include "buffer.h"
+#include "bufaux.h"
+#include "packet.h"
+#include "compat.h"
+#include <openssl/evp.h>
+#include "cipher.h"
+#include "kex.h"
+#include "log.h"
+#include "compat.h"
+
+#include <netdb.h>
+
+#include "ssh-gss.h"
+
+/* Assorted globals for tracking the clients identity once they've
+ * authenticated */
+ 
+gss_buffer_desc gssapi_client_name = {0,NULL}; /* Name of our client */
+gss_cred_id_t   gssapi_client_creds = GSS_C_NO_CREDENTIAL; /* Their credentials */
+enum ssh_gss_id gssapi_client_type = GSS_LAST_ENTRY;
+
+/* The mechanism name used in the list below is defined in the internet
+ * draft as the Base 64 encoding of the MD5 hash of the ASN.1 DER encoding 
+ * of the underlying GSSAPI mechanism's OID.
+ *
+ * Also from the draft, before considering adding SPNEGO, bear in mind that
+ * "mechanisms ... MUST NOT use SPNEGO as the underlying GSSAPI mechanism"
+ */
+
+/* These must be in the same order as ssh_gss_id, in ssh-gss.h */
+
+ssh_gssapi_mech supported_mechs[]= {
+#ifdef KRB5
+ /* Official OID - 1.2.850.113554.1.2.2 */
+ {"Se3H81ismmOC3OE+FwYCiQ==","Kerberos",
+ 	{9, "\x2A\x86\x48\x86\xF7\x12\x01\x02\x02"}},
+#endif
+#ifdef GSI
+ /* gssapi_ssleay 1.3.6.1.4.1.3536.1.1 */
+ {"N3+k7/4wGxHyuP8Yxi4RhA==",
+  "GSI",
+  {9, "\x2B\x06\x01\x04\x01\x9B\x50\x01\x01"}
+ },
+#endif /* GSI */
+ {NULL,NULL,{0,0}}
+};
+
+char gssprefix[]=KEX_GSS_SHA1;
+
+/* Return a list of the gss-group1-sha1-x mechanisms supported by this
+ * program.
+ *
+ * We only support the mechanisms that we've indicated in the list above,
+ * but we check that they're supported by the GSSAPI mechanism on the 
+ * machine. We also check, before including them in the list, that
+ * we have the necesary information in order to carry out the key exchange
+ * (that is, that the user has credentials, the server's creds are accessible,
+ * etc)
+ *
+ * The way that this is done is fairly nasty, as we do a lot of work that
+ * is then thrown away. This should possibly be implemented with a cache
+ * that stores the results (in an expanded Gssctxt structure), which are
+ * then used by the first calls if that key exchange mechanism is chosen.
+ */
+ 
+char * 
+ssh_gssapi_mechanisms(int server,char *host) {
+	gss_OID_set 	supported;
+	OM_uint32	maj_status, min_status;
+	Buffer		buf;
+	int 		i = 0;
+	int		present;
+	char *		mechs;
+	Gssctxt		ctx;	
+	gss_buffer_desc	token;		
+
+	if (datafellows & SSH_OLD_GSSAPI) return NULL;
+	
+	gss_indicate_mechs(&min_status, &supported);
+	
+	buffer_init(&buf);	
+
+	do {
+		if ((maj_status=gss_test_oid_set_member(&min_status,
+						   	&supported_mechs[i].oid,
+						   	supported,
+						   	&present))) {
+			present=0;
+		}
+		if (present) {
+			ssh_gssapi_build_ctx(&ctx);
+			ssh_gssapi_set_oid(&ctx,&supported_mechs[i].oid);
+			if (server) {
+		  		if (ssh_gssapi_acquire_cred(&ctx)) {
+		  			ssh_gssapi_delete_ctx(&ctx);
+					continue;
+				}
+			}
+			else { /* client */
+				if (ssh_gssapi_import_name(&ctx,host))
+					continue;
+				maj_status=ssh_gssapi_init_ctx(&ctx, 0, 
+							       GSS_C_NO_BUFFER,
+							       &token,
+							       NULL);
+				ssh_gssapi_delete_ctx(&ctx);
+				if (GSS_ERROR(maj_status)) {
+					continue;
+				}
+			}				 
+				
+			/* Append gss_group1_sha1_x to our list */
+			buffer_append(&buf, gssprefix,
+				      strlen(gssprefix));
+		        buffer_append(&buf, supported_mechs[i].enc_name,
+		        	      strlen(supported_mechs[i].enc_name));
+	 	}
+	} while (supported_mechs[++i].name != NULL);
+	
+	buffer_put_char(&buf,'\0');
+	
+	mechs=xmalloc(buffer_len(&buf));
+	buffer_get(&buf,mechs,buffer_len(&buf));
+	buffer_free(&buf);
+	if (strlen(mechs)==0)
+	   return(NULL);
+	else
+	   return(mechs);
+}
+
+void ssh_gssapi_supported_oids(gss_OID_set *oidset) {
+	enum ssh_gss_id i =0;
+	OM_uint32 maj_status,min_status;
+	int present;
+	gss_OID_set supported;
+	
+	gss_create_empty_oid_set(&min_status,oidset);
+	gss_indicate_mechs(&min_status, &supported);
+
+	while (supported_mechs[i].name!=NULL) {
+		if ((maj_status=gss_test_oid_set_member(&min_status,
+						       &supported_mechs[i].oid,
+						       supported,
+						       &present))) {
+			present=0;
+		}
+		if (present) {
+			gss_add_oid_set_member(&min_status,
+					       &supported_mechs[i].oid,
+				       	       oidset);	
+		}
+		i++;
+	}
+}	
+
+/* Set the contexts OID from a data stream */
+void ssh_gssapi_set_oid_data(Gssctxt *ctx, void *data, size_t len) { 
+  if (ctx->oid != GSS_C_NO_OID) {
+	xfree(ctx->oid->elements);
+   	xfree(ctx->oid);
+  }
+  ctx->oid=xmalloc(sizeof(gss_OID_desc));
+  ctx->oid->length=len;
+  ctx->oid->elements=xmalloc(len);
+  memcpy(ctx->oid->elements,data,len);
+}
+
+/* Set the contexts OID */
+void ssh_gssapi_set_oid(Gssctxt *ctx, gss_OID oid) {  
+  ssh_gssapi_set_oid_data(ctx,oid->elements,oid->length);
+}
+
+/* Find out which GSS type (out of the list we define in ssh-gss.h) a
+ * particular connection is using 
+ */
+enum ssh_gss_id ssh_gssapi_get_ctype(Gssctxt *ctxt) {
+	enum ssh_gss_id i=0;
+	
+	while(supported_mechs[i].name!=NULL &&
+	      	supported_mechs[i].oid.length != ctxt->oid->length &&
+	      	(memcmp(supported_mechs[i].oid.elements,
+	      	       ctxt->oid->elements,ctxt->oid->length) !=0)) {
+	   i++;
+	}
+	return(i);
+}
+
+/* Set the GSS context's OID to the oid indicated by the given key exchange
+ * name. */
+int ssh_gssapi_id_kex(Gssctxt *ctx, char *name) {
+  enum ssh_gss_id i=0;
+  
+  if (strncmp(name, gssprefix, strlen(gssprefix)-1) !=0) {
+     return(1);
+  }
+  
+  name+=strlen(gssprefix); /* Move to the start of the MIME string */
+  
+  while (supported_mechs[i].name!=NULL &&
+  	 strcmp(name,supported_mechs[i].enc_name)!=0) {
+  	i++;
+  }
+
+  if (supported_mechs[i].name==NULL)
+     return (1);
+
+  ssh_gssapi_set_oid(ctx,&supported_mechs[i].oid);
+
+  return 0;
+}
+
+
+/* All this effort to report an error ... */
+void
+ssh_gssapi_error(OM_uint32 major_status,OM_uint32 minor_status) {
+	OM_uint32 lmaj, lmin;
+        gss_buffer_desc msg;
+        OM_uint32 ctx;
+        
+        ctx = 0;
+	/* The GSSAPI error */
+        do {
+        	lmaj = gss_display_status(&lmin, major_status,
+        				  GSS_C_GSS_CODE,
+        				  GSS_C_NULL_OID,
+        				  &ctx, &msg);
+        	if (lmaj == GSS_S_COMPLETE) {
+        	    	debug((char *)msg.value);
+        	    	(void) gss_release_buffer(&lmin, &msg);
+        	}
+        } while (ctx!=0);	   
+
+        /* The mechanism specific error */
+        do {
+        	lmaj = gss_display_status(&lmin, minor_status,
+        				  GSS_C_MECH_CODE,
+        				  GSS_C_NULL_OID,
+        				  &ctx, &msg);
+        	if (lmaj == GSS_S_COMPLETE) {
+        	    	debug((char *)msg.value);
+        	    	(void) gss_release_buffer(&lmin, &msg);
+        	}
+        } while (ctx!=0);
+}
+
+/* Initialise our GSSAPI context. We use this opaque structure to contain all
+ * of the data which both the client and server need to persist across
+ * {accept,init}_sec_context calls, so that when we do it from the userauth
+ * stuff life is a little easier
+ */
+void
+ssh_gssapi_build_ctx(Gssctxt *ctx)
+{
+	ctx->context=GSS_C_NO_CONTEXT;
+	ctx->name=GSS_C_NO_NAME;
+	ctx->oid=GSS_C_NO_OID;
+	ctx->creds=GSS_C_NO_CREDENTIAL;
+	ctx->client=GSS_C_NO_NAME;
+	ctx->client_creds=GSS_C_NO_CREDENTIAL;
+}
+
+/* Delete our context, providing it has been built correctly */
+void
+ssh_gssapi_delete_ctx(Gssctxt *ctx)
+{
+	OM_uint32 ms;
+	
+	if (ctx->context != GSS_C_NO_CONTEXT) 
+		gss_delete_sec_context(&ms,&ctx->context,GSS_C_NO_BUFFER);
+	if (ctx->name != GSS_C_NO_NAME)
+		gss_release_name(&ms,&ctx->name);
+	if (ctx->oid != GSS_C_NO_OID) {
+		xfree(ctx->oid->elements);
+		xfree(ctx->oid);
+		ctx->oid = GSS_C_NO_OID;
+	}
+	if (ctx->creds != GSS_C_NO_CREDENTIAL)
+		gss_release_cred(&ms,&ctx->creds);
+	if (ctx->client != GSS_C_NO_NAME)
+		gss_release_name(&ms,&ctx->client);	
+	if (ctx->client_creds != GSS_C_NO_CREDENTIAL)
+		gss_release_cred(&ms,&ctx->client_creds); 
+}
+
+/* Wrapper to init_sec_context 
+ * Requires that the context contains:
+ *	oid
+ * 	server name (from ssh_gssapi_import_name)
+ */
+OM_uint32 
+ssh_gssapi_init_ctx(Gssctxt *ctx, int deleg_creds, gss_buffer_desc *recv_tok,
+       	      	    gss_buffer_desc* send_tok, OM_uint32 *flags) 
+{
+      	OM_uint32 maj_status, min_status;
+	int deleg_flag = 0;
+	
+	if (deleg_creds) {
+		deleg_flag=GSS_C_DELEG_FLAG;
+		debug("Delegating credentials");
+	}
+	      	
+      	maj_status=gss_init_sec_context(&min_status,
+      					GSS_C_NO_CREDENTIAL, /* def. cred */
+      					&ctx->context,
+      					ctx->name,
+      					ctx->oid,
+      					GSS_C_MUTUAL_FLAG |
+      					GSS_C_INTEG_FLAG |
+      					deleg_flag,
+      					0, /* default lifetime */
+      					NULL, /* no channel bindings */
+      					recv_tok,
+      					NULL,
+      					send_tok,
+      					flags,
+      					NULL);
+	ctx->status=maj_status;
+      	if (GSS_ERROR(maj_status)) {
+      		ssh_gssapi_error(maj_status,min_status);
+      	}
+      	return(maj_status);
+}
+
+/* Wrapper arround accept_sec_context
+ * Requires that the context contains:
+ *    oid		
+ *    credentials	(from ssh_gssapi_acquire_cred)
+ */
+OM_uint32 ssh_gssapi_accept_ctx(Gssctxt *ctx,gss_buffer_desc *recv_tok,
+				gss_buffer_desc *send_tok, OM_uint32 *flags) 
+{
+	OM_uint32 maj_status, min_status;
+	gss_OID mech;
+	
+	maj_status=gss_accept_sec_context(&min_status,
+					  &ctx->context,
+					  ctx->creds,
+					  recv_tok,
+					  GSS_C_NO_CHANNEL_BINDINGS,
+					  &ctx->client,
+					  &mech,
+					  send_tok,
+					  flags,
+					  NULL,
+					  &ctx->client_creds);
+	if (GSS_ERROR(maj_status)) {
+		ssh_gssapi_error(maj_status,min_status);
+	}
+	
+	if (ctx->client_creds) {
+		debug("Received some client credentials");
+	} else {
+		debug("Got no client credentials");
+	}
+
+	/* FIXME: We should check that the mechanism thats being used is
+	 * the one that we asked for (in ctx->oid) */
+
+	ctx->status=maj_status;
+	
+	return(maj_status);
+}
+
+/* Create a service name for the given host */
+OM_uint32
+ssh_gssapi_import_name(Gssctxt *ctx, const char *host) {
+	gss_buffer_desc gssbuf;
+	OM_uint32 maj_status, min_status;
+	struct hostent *hostinfo = NULL;
+	char *xhost;
+	
+	/* Make a copy of the host name, in case it was returned by a
+	 * previous call to gethostbyname(). */	
+	xhost = xstrdup(host);
+
+	/* Make sure we have the FQDN. Some GSSAPI implementations don't do
+	 * this for us themselves */
+	
+	hostinfo = gethostbyname(xhost);
+	
+	if ((hostinfo == NULL) || (hostinfo->h_name == NULL)) {
+		debug("Unable to get FQDN for \"%s\"", xhost);
+	} else {
+		xfree(xhost);
+		xhost = xstrdup(hostinfo->h_name);
+	}
+		
+        gssbuf.length = sizeof("host@")+strlen(xhost);
+
+        gssbuf.value = xmalloc(gssbuf.length);
+        if (gssbuf.value == NULL) {
+		xfree(xhost);
+		return(-1);
+        }
+        snprintf(gssbuf.value,gssbuf.length,"host@%s",xhost);
+        if ((maj_status=gss_import_name(&min_status,
+                                   	&gssbuf,
+                                        GSS_C_NT_HOSTBASED_SERVICE,
+                                        &ctx->name))) {
+		ssh_gssapi_error(maj_status,min_status);
+	}
+	
+	xfree(xhost);
+	xfree(gssbuf.value);
+	return(maj_status);
+}
+
+/* Acquire credentials for a server running on the current host.
+ * Requires that the context structure contains a valid OID
+ */      
+OM_uint32
+ssh_gssapi_acquire_cred(Gssctxt *ctx) {
+	OM_uint32 maj_status, min_status;
+	char lname[MAXHOSTNAMELEN];
+	gss_OID_set oidset;
+	
+	gss_create_empty_oid_set(&min_status,&oidset);
+	gss_add_oid_set_member(&min_status,ctx->oid,&oidset);
+	
+        if (gethostname(lname, MAXHOSTNAMELEN)) {
+                return(-1);
+        }
+
+	if ((maj_status=ssh_gssapi_import_name(ctx,lname))) {
+		return(maj_status);
+	}
+	if ((maj_status=gss_acquire_cred(&min_status,
+			 	    ctx->name,
+				    0,
+				    oidset,
+				    GSS_C_ACCEPT,
+				    &ctx->creds,
+				    NULL,
+				    NULL))) {
+		ssh_gssapi_error(maj_status,min_status);
+	}
+				
+	gss_release_oid_set(&min_status, &oidset);
+	return(maj_status);
+}
+
+/* Extract the client details from a given context. This can only reliably
+ * be called once for a context */
+
+OM_uint32 
+ssh_gssapi_getclient(Gssctxt *ctx, enum ssh_gss_id *type,
+		     gss_buffer_desc *name, gss_cred_id_t *creds) {
+
+	OM_uint32 maj_status,min_status;
+	
+	*type=ssh_gssapi_get_ctype(ctx);
+	if ((maj_status=gss_display_name(&min_status,ctx->client,name,NULL))) {
+		ssh_gssapi_error(maj_status,min_status);
+	}
+	
+	/* This is icky. There appears to be no way to copy this structure,
+	 * rather than the pointer to it, so we simply copy the pointer and
+	 * mark the originator as empty so we don't destroy it. 
+	 */
+	*creds=ctx->client_creds;
+	ctx->client_creds=GSS_C_NO_CREDENTIAL;
+	return(maj_status);
+}
+	
+#endif /* GSSAPI */
diff -Naur openssh-3.1p1/gss-serv.c openssh-3.1p1-gsi/gss-serv.c
--- openssh-3.1p1/gss-serv.c	Wed Dec 31 18:00:00 1969
+++ openssh-3.1p1-gsi/gss-serv.c	Thu Apr  4 17:03:45 2002
@@ -0,0 +1,718 @@
+/*
+ * Copyright (c) 2001 Simon Wilkinson. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR `AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "includes.h"
+
+#ifdef GSSAPI
+
+#include "ssh.h"
+#include "ssh1.h"
+#include "ssh2.h"
+#include "xmalloc.h"
+#include "buffer.h"
+#include "bufaux.h"
+#include "packet.h"
+#include "compat.h"
+#include <openssl/evp.h>
+#include "cipher.h"
+#include "kex.h"
+#include "auth.h"
+#include "log.h"
+#include "channels.h"
+#include "session.h"
+#include "dispatch.h"
+#include "servconf.h"
+#include "compat.h"
+
+#include "ssh-gss.h"
+
+extern ServerOptions options;
+extern u_char *session_id2;
+extern int session_id2_len;
+
+void    userauth_reply(Authctxt *authctxt, int authenticated);
+static void gssapi_unsetenv(const char *var);
+
+typedef struct ssh_gssapi_cred_cache {
+	char *filename;
+	char *envvar;
+	char *envval;
+	void *data;
+} ssh_gssapi_cred_cache;
+
+static struct ssh_gssapi_cred_cache gssapi_cred_store = {NULL,NULL,NULL};
+unsigned char ssh1_key_digest[16]; /* used for ssh1 gssapi */
+
+/*
+ * Environment variables pointing to delegated credentials
+ */
+static char *delegation_env[] = {
+  "X509_USER_PROXY",		/* GSSAPI/SSLeay */
+  "KRB5CCNAME",			/* Krb5 and possibly SSLeay */
+  NULL
+};
+
+#ifdef KRB5
+
+#ifdef HEIMDAL
+#include <krb5.h>
+#else
+#include <gssapi_krb5.h>
+#define krb5_get_err_text(context,code) error_message(code)
+#endif
+
+static krb5_context krb_context = NULL;
+
+/* Initialise the krb5 library, so we can use it for those bits that
+ * GSSAPI won't do */
+
+int ssh_gssapi_krb5_init() {
+	krb5_error_code problem;
+	
+	if (krb_context !=NULL)
+		return 1;
+		
+	problem = krb5_init_context(&krb_context);
+	if (problem) {
+		log("Cannot initialize krb5 context");
+		return 0;
+	}
+	krb5_init_ets(krb_context);
+
+	return 1;	
+}			
+
+/* Check if this user is OK to login. This only works with krb5 - other 
+ * GSSAPI mechanisms will need their own.
+ * Returns true if the user is OK to log in, otherwise returns 0
+ */
+
+int
+ssh_gssapi_krb5_userok(char *name) {
+	krb5_principal princ;
+	int retval;
+
+	if (ssh_gssapi_krb5_init() == 0)
+		return 0;
+		
+	if ((retval=krb5_parse_name(krb_context, gssapi_client_name.value, 
+				    &princ))) {
+		log("krb5_parse_name(): %.100s", 
+			krb5_get_err_text(krb_context,retval));
+		return 0;
+	}
+	if (krb5_kuserok(krb_context, princ, name)) {
+		retval = 1;
+		log("Authorized to %s, krb5 principal %s (krb5_kuserok)",name,
+		    (char *)gssapi_client_name.value);
+	}
+	else
+		retval = 0;
+	
+	krb5_free_principal(krb_context, princ);
+	return retval;
+}
+	
+/* Make sure that this is called _after_ we've setuid to the user */
+
+/* This writes out any forwarded credentials. Its specific to the Kerberos
+ * GSSAPI mechanism
+ *
+ * We assume that our caller has made sure that the user has selected
+ * delegated credentials, and that the client_creds structure is correctly
+ * populated.
+ */
+
+void
+ssh_gssapi_krb5_storecreds() {
+	krb5_ccache ccache;
+	krb5_error_code problem;
+	krb5_principal princ;
+	char ccname[35];
+	static char name[40];
+	int tmpfd;
+	OM_uint32 maj_status,min_status;
+
+
+	if (gssapi_client_creds==NULL) {
+		debug("No credentials stored"); 
+		return;
+	}
+		
+	if (ssh_gssapi_krb5_init() == 0)
+		return;
+
+	if (options.gss_use_session_ccache) {
+        	snprintf(ccname,sizeof(ccname),"/tmp/krb5cc_%d_XXXXXX",geteuid());
+       
+        	if ((tmpfd = mkstemp(ccname))==-1) {
+                	log("mkstemp(): %.100s", strerror(errno));
+                	return;
+        	}
+	        if (fchmod(tmpfd, S_IRUSR | S_IWUSR) == -1) {
+	               	log("fchmod(): %.100s", strerror(errno));
+	               	close(tmpfd);
+	               	return;
+	        }
+        } else {
+        	snprintf(ccname,sizeof(ccname),"/tmp/krb5cc_%d",geteuid());
+        	tmpfd = open(ccname, O_TRUNC | O_CREAT, S_IRUSR | S_IWUSR);
+        	if (tmpfd == -1) {
+        		log("open(): %.100s", strerror(errno));
+        		return;
+        	}
+        }
+
+       	close(tmpfd);
+        snprintf(name, sizeof(name), "FILE:%s",ccname);
+ 
+        if ((problem = krb5_cc_resolve(krb_context, name, &ccache))) {
+                log("krb5_cc_default(): %.100s", 
+                	krb5_get_err_text(krb_context,problem));
+                return;
+        }
+
+	if ((problem = krb5_parse_name(krb_context, gssapi_client_name.value, 
+				       &princ))) {
+		log("krb5_parse_name(): %.100s", 
+			krb5_get_err_text(krb_context,problem));
+		krb5_cc_destroy(krb_context,ccache);
+		return;
+	}
+	
+	if ((problem = krb5_cc_initialize(krb_context, ccache, princ))) {
+		log("krb5_cc_initialize(): %.100s", 
+			krb5_get_err_text(krb_context,problem));
+		krb5_free_principal(krb_context,princ);
+		krb5_cc_destroy(krb_context,ccache);
+		return;
+	}
+	
+	krb5_free_principal(krb_context,princ);
+
+	#ifdef HEIMDAL
+	if ((problem = krb5_cc_copy_cache(krb_context, 
+					   gssapi_client_creds->ccache,
+					   ccache))) {
+		log("krb5_cc_copy_cache(): %.100s", 
+			krb5_get_err_text(krb_context,problem));
+		krb5_cc_destroy(krb_context,ccache);
+		return;
+	}
+	#else
+	if ((maj_status = gss_krb5_copy_ccache(&min_status, 
+					       gssapi_client_creds, 
+					       ccache))) {
+		log("gss_krb5_copy_ccache() failed");
+		ssh_gssapi_error(maj_status,min_status);
+		krb5_cc_destroy(krb_context,ccache);
+		return;
+	}
+	#endif
+	
+	krb5_cc_close(krb_context,ccache);
+
+
+#ifdef USE_PAM
+	do_pam_putenv("KRB5CCNAME",name);
+#endif
+
+	gssapi_cred_store.filename=strdup(ccname);
+	gssapi_cred_store.envvar="KRB5CCNAME";
+	gssapi_cred_store.envval=strdup(name);
+
+	return;
+}
+
+#endif /* KRB5 */
+
+#ifdef GSI
+#include <globus_gss_assist.h>
+
+/*
+ * Check if this user is OK to login under GSI. User has been authenticated
+ * as identity in global 'client_name.value' and is trying to log in as passed
+ * username in 'name'.
+ *
+ * Returns non-zero if user is authorized, 0 otherwise.
+ */
+int
+ssh_gssapi_gsi_userok(char *name)
+{
+    int authorized = 0;
+    
+    /* This returns 0 on success */
+    authorized = (globus_gss_assist_userok(gssapi_client_name.value,
+					   name) == 0);
+    
+    debug("GSI user %s is%s authorized as target user %s",
+	  (char *) gssapi_client_name.value,
+	  (authorized ? "" : " not"),
+	  name);
+    
+    return authorized;
+}
+
+/*
+ * Handle setting up child environment for GSI.
+ *
+ * Make sure that this is called _after_ we've setuid to the user.
+ */
+void
+ssh_gssapi_gsi_storecreds()
+{
+	OM_uint32	major_status;
+	OM_uint32	minor_status;
+	
+	
+	if (gssapi_client_creds != NULL)
+	{
+		char *creds_env = NULL;
+
+		/*
+ 		 * This is the current hack with the GSI gssapi library to
+		 * export credentials to disk.
+		 */
+
+		debug("Exporting delegated credentials");
+		
+		minor_status = 0xdee0;	/* Magic value */
+		major_status =
+			gss_inquire_cred(&minor_status,
+					 gssapi_client_creds,
+					 (gss_name_t *) &creds_env,
+					 NULL,
+					 NULL,
+					 NULL);
+
+		if ((major_status == GSS_S_COMPLETE) &&
+		    (minor_status == 0xdee1) &&
+		    (creds_env != NULL))
+		{
+			char		*value;
+				
+			/*
+			 * String is of the form:
+			 * X509_USER_DELEG_PROXY=filename
+			 * so we parse out the filename
+			 * and then set X509_USER_PROXY
+			 * to point at it.
+			 */
+			value = strchr(creds_env, '=');
+			
+			if (value != NULL)
+			{
+				*value = '\0';
+				value++;
+#ifdef USE_PAM
+				do_pam_putenv("X509_USER_PROXY",value);
+#endif
+			 	gssapi_cred_store.filename=NULL;
+				gssapi_cred_store.envvar="X509_USER_PROXY";
+				gssapi_cred_store.envval=strdup(value);
+
+				return;
+			}
+			else
+			{
+				log("Failed to parse delegated credentials string '%s'",
+				    creds_env);
+			}
+		}
+		else
+		{
+			log("Failed to export delegated credentials (error %ld)",
+			    major_status);
+		}
+	}	
+}
+
+#endif /* GSI */
+
+void
+ssh_gssapi_cleanup_creds(void *ignored)
+{
+	if (gssapi_cred_store.filename!=NULL) {
+		/* Unlink probably isn't sufficient */
+		debug("removing gssapi cred file\"%s\"",gssapi_cred_store.filename);
+		unlink(gssapi_cred_store.filename);
+	}
+}
+
+void 
+ssh_gssapi_storecreds()
+{
+	switch (gssapi_client_type) {
+#ifdef KRB5
+	case GSS_KERBEROS:
+		ssh_gssapi_krb5_storecreds();
+		break;
+#endif
+#ifdef GSI
+	case GSS_GSI:
+		ssh_gssapi_gsi_storecreds();
+		break;
+#endif /* GSI */
+	case GSS_LAST_ENTRY:
+		/* GSSAPI not used in this authentication */
+		debug("No GSSAPI credentials stored");
+		break;
+	default:
+		log("ssh_gssapi_do_child: Unknown mechanism");
+	
+	}
+	
+	if (options.gss_cleanup_creds) {
+		fatal_add_cleanup(ssh_gssapi_cleanup_creds, NULL);
+	}
+
+}
+
+/* This allows GSSAPI methods to do things to the childs environment based
+ * on the passed authentication process and credentials.
+ *
+ * Question: If we didn't use userauth_external for some reason, should we
+ * still delegate credentials?
+ */
+void 
+ssh_gssapi_do_child(char ***envp, u_int *envsizep) 
+{
+
+	if (gssapi_cred_store.envvar!=NULL && 
+	    gssapi_cred_store.envval!=NULL) {
+	    
+		debug("Setting %s to %s", gssapi_cred_store.envvar,
+					  gssapi_cred_store.envval);				  
+		child_set_env(envp, envsizep, gssapi_cred_store.envvar, 
+					      gssapi_cred_store.envval);
+	}
+
+	switch(gssapi_client_type) {
+#ifdef KRB5
+	case GSS_KERBEROS: break;
+#endif
+#ifdef GSI
+	case GSS_GSI: break;
+#endif
+	case GSS_LAST_ENTRY:
+		debug("No GSSAPI credentials stored");
+		break;
+	default:
+		log("ssh_gssapi_do_child: Unknown mechanism");
+	}
+}
+
+int
+ssh_gssapi_userok(char *user)
+{
+	if (gssapi_client_name.length==0 || 
+	    gssapi_client_name.value==NULL) {
+		debug("No suitable client data");
+		return 0;
+	}
+	switch (gssapi_client_type) {
+#ifdef KRB5
+	case GSS_KERBEROS:
+		return(ssh_gssapi_krb5_userok(user));
+		break; /* Not reached */
+#endif
+#ifdef GSI
+	case GSS_GSI:
+		return(ssh_gssapi_gsi_userok(user));
+		break; /* Not reached */
+#endif /* GSI */
+	case GSS_LAST_ENTRY:
+		debug("Client not GSSAPI");
+		break;
+	default:
+		debug("Unknown client authentication type");
+	}
+	return(0);
+}
+
+int
+userauth_external(Authctxt *authctxt)
+{
+	packet_check_eom();
+
+	return(ssh_gssapi_userok(authctxt->user));
+}
+
+void input_gssapi_token(int type, u_int32_t plen, void *ctxt);
+void input_gssapi_exchange_complete(int type, u_int32_t plen, void *ctxt);
+
+/* We only support those mechanisms that we know about (ie ones that we know
+ * how to check local user kuserok and the like
+ */
+int
+userauth_gssapi(Authctxt *authctxt)
+{
+	gss_OID_desc	oid= {0,NULL};
+	Gssctxt		*ctxt;
+	int		mechs;
+	gss_OID_set	supported;
+	int		present;
+	OM_uint32	ms;
+	u_int		len;
+	
+	if (!authctxt->valid || authctxt->user == NULL)
+		return 0;
+		
+	if (datafellows & SSH_OLD_GSSAPI) {
+		debug("Early drafts of GSSAPI userauth not supported");
+		return 0;
+	}
+	
+	mechs=packet_get_int();
+	if (mechs==0) {
+		debug("Mechanism negotiation is not supported");
+		return 0;
+	}
+
+	ssh_gssapi_supported_oids(&supported);
+	do {
+		if (oid.elements)
+			xfree(oid.elements);
+		oid.elements = packet_get_string(&len);
+		oid.length = len;
+		gss_test_oid_set_member(&ms, &oid, supported, &present);
+		mechs--;
+	} while (mechs>0 && !present);
+	
+	if (!present) {
+		xfree(oid.elements);
+		return(0);
+	}
+	
+	ctxt=xmalloc(sizeof(Gssctxt));
+	authctxt->methoddata=(void *)ctxt;
+	
+	ssh_gssapi_build_ctx(ctxt);
+	ssh_gssapi_set_oid(ctxt,&oid);
+
+	if (ssh_gssapi_acquire_cred(ctxt))
+		return 0;
+
+	/* Send SSH_MSG_USERAUTH_GSSAPI_RESPONSE */
+
+	if (!compat20)
+	packet_start(SSH_SMSG_AUTH_GSSAPI_RESPONSE);
+	else
+	packet_start(SSH2_MSG_USERAUTH_GSSAPI_RESPONSE);
+	packet_put_string(oid.elements,oid.length);
+	packet_send();
+	packet_write_wait();
+	xfree(oid.elements);
+		
+ 	if (!compat20)
+ 	dispatch_set(SSH_MSG_AUTH_GSSAPI_TOKEN,
+ 				&input_gssapi_token);
+ 	else
+	dispatch_set(SSH2_MSG_USERAUTH_GSSAPI_TOKEN, 
+		     &input_gssapi_token);
+	authctxt->postponed = 1;
+	
+	return 0;
+}
+
+void
+input_gssapi_token(int type, u_int32_t plen, void *ctxt)
+{
+	Authctxt *authctxt = ctxt;
+	Gssctxt *gssctxt;
+	gss_buffer_desc send_tok,recv_tok;
+	OM_uint32 maj_status, min_status;
+	
+	if (authctxt == NULL || authctxt->methoddata == NULL)
+		fatal("No authentication or GSSAPI context");
+		
+	gssctxt=authctxt->methoddata;
+
+	recv_tok.value=packet_get_string(&recv_tok.length);
+	
+	maj_status=ssh_gssapi_accept_ctx(gssctxt, &recv_tok, &send_tok, NULL);
+	packet_check_eom();
+	
+	if (GSS_ERROR(maj_status)) {
+		/* Failure <sniff> */
+		authctxt->postponed = 0;
+		dispatch_set(SSH_MSG_AUTH_GSSAPI_TOKEN, NULL);
+		dispatch_set(SSH2_MSG_USERAUTH_GSSAPI_TOKEN, NULL);
+		userauth_finish(authctxt, 0, "gssapi");
+	}
+			
+	if (send_tok.length != 0) {
+		/* Send a packet back to the client */
+		if (!compat20)
+		packet_start(SSH_MSG_AUTH_GSSAPI_TOKEN);
+		else
+	        packet_start(SSH2_MSG_USERAUTH_GSSAPI_TOKEN);
+                packet_put_string(send_tok.value,send_tok.length);
+                packet_send();
+                packet_write_wait();
+                gss_release_buffer(&min_status, &send_tok);
+	}
+	
+	if (maj_status == GSS_S_COMPLETE) {
+		dispatch_set(SSH_MSG_AUTH_GSSAPI_TOKEN, NULL);
+  		dispatch_set(SSH2_MSG_USERAUTH_GSSAPI_TOKEN,NULL);
+		/* ssh1 does not have an extra message here */
+		if (!compat20)
+		input_gssapi_exchange_complete(0, 0, ctxt);
+		else
+  		dispatch_set(SSH2_MSG_USERAUTH_GSSAPI_EXCHANGE_COMPLETE,
+  			     &input_gssapi_exchange_complete);
+	}
+}
+
+/* This is called when the client thinks we've completed authentication.
+ * It should only be enabled in the dispatch handler by the function above,
+ * which only enables it once the GSSAPI exchange is complete.
+ */
+ 
+void
+input_gssapi_exchange_complete(int type, u_int32_t plen, void *ctxt)
+{
+	Authctxt *authctxt = ctxt;
+	Gssctxt *gssctxt;
+	int authenticated;
+	
+	if (authctxt == NULL || authctxt->methoddata == NULL)
+		fatal("No authentication or GSSAPI context");
+		
+	gssctxt=authctxt->methoddata;
+
+	/* This should never happen, but better safe than sorry. */
+	if (gssctxt->status != GSS_S_COMPLETE) {
+		packet_disconnect("Context negotiation is not complete");
+	}
+
+	if (ssh_gssapi_getclient(gssctxt,&gssapi_client_type,
+				 &gssapi_client_name,
+				 &gssapi_client_creds)) {
+		fatal("Couldn't convert client name");
+	}
+				     		
+        authenticated = ssh_gssapi_userok(authctxt->user);
+
+	/* ssh1 needs to exchange the hash of the keys */
+	if (!compat20) {
+		if (authenticated) {
+
+			OM_uint32 maj_status, min_status;
+			gss_buffer_desc gssbuf,msg_tok;
+
+			/* ssh1 uses wrap */
+			gssbuf.value=ssh1_key_digest;
+			gssbuf.length=sizeof(ssh1_key_digest);
+			if ((maj_status=gss_wrap(&min_status,
+					gssctxt->context,
+					0,
+					GSS_C_QOP_DEFAULT,
+					&gssbuf,
+					NULL,
+					&msg_tok))) {
+				ssh_gssapi_error(maj_status,min_status);
+				fatal("Couldn't wrap keys");
+			}
+			packet_start(SSH_SMSG_AUTH_GSSAPI_HASH);
+			packet_put_string((char *)msg_tok.value,msg_tok.length);
+			packet_send();
+			packet_write_wait();
+			gss_release_buffer(&min_status,&msg_tok);
+		}
+	}
+
+	authctxt->postponed = 0;
+	dispatch_set(SSH2_MSG_USERAUTH_GSSAPI_TOKEN, NULL);
+	dispatch_set(SSH2_MSG_USERAUTH_GSSAPI_EXCHANGE_COMPLETE, NULL);
+	userauth_finish(authctxt, authenticated, "gssapi");
+}
+
+/*
+ * Clean our environment on startup. This means removing any environment
+ * strings that might inadvertantly been in root's environment and 
+ * could cause serious security problems if we think we set them.
+ */
+void
+ssh_gssapi_clean_env(void)
+{
+  char *envstr;
+  int envstr_index;
+
+  
+   for (envstr_index = 0;
+       (envstr = delegation_env[envstr_index]) != NULL;
+       envstr_index++) {
+
+     if (getenv(envstr)) {
+       debug("Clearing environment variable %s", envstr);
+       gssapi_unsetenv(envstr);
+     }
+   }
+}
+
+/*
+ * Wrapper around unsetenv.
+ */
+static void
+gssapi_unsetenv(const char *var)
+{
+#ifdef HAVE_UNSETENV
+    unsetenv(var);
+
+#else /* !HAVE_UNSETENV */
+    extern char **environ;
+    char **p1 = environ;	/* New array list */
+    char **p2 = environ;	/* Current array list */
+    int len = strlen(var);
+
+    /*
+     * Walk through current environ array (p2) copying each pointer
+     * to new environ array (p1) unless the pointer is to the item
+     * we want to delete. Copy happens in place.
+     */
+    while (*p2) {
+	if ((strncmp(*p2, var, len) == 0) &&
+	    ((*p2)[len] == '=')) {
+	    /*
+	     * *p2 points at item to be deleted, just skip over it
+	     */
+	    p2++;
+	} else {
+	    /*
+	     * *p2 points at item we want to save, so copy it
+	     */
+	    *p1 = *p2;
+	    p1++;
+	    p2++;
+	}
+    }
+
+    /* And make sure new array is NULL terminated */
+    *p1 = NULL;
+#endif /* HAVE_UNSETENV */
+}
+
+#endif /* GSSAPI */
diff -Naur openssh-3.1p1/includes.h openssh-3.1p1-gsi/includes.h
--- openssh-3.1p1/includes.h	Mon Feb  4 19:11:03 2002
+++ openssh-3.1p1-gsi/includes.h	Thu Apr  4 17:03:45 2002
@@ -53,6 +53,11 @@
 #endif
 #ifndef HAVE_GETOPT_OPTRESET
 #define getopt(ac, av, o)  BSDgetopt(ac, av, o)
+#define opterr BSDopterr
+#define optind BSDoptind
+#define optopt BSDoptopt
+#define optreset BSDoptreset
+#define optarg BSDoptarg
 #endif
 #ifdef HAVE_BSTRING_H
 # include <bstring.h>
diff -Naur openssh-3.1p1/kex.c openssh-3.1p1-gsi/kex.c
--- openssh-3.1p1/kex.c	Mon Mar  4 19:33:38 2002
+++ openssh-3.1p1-gsi/kex.c	Thu Apr  4 17:03:45 2002
@@ -41,6 +41,10 @@
 #include "match.h"
 #include "dispatch.h"
 
+#ifdef GSSAPI
+#include "ssh-gss.h"
+#endif
+
 #define KEX_COOKIE_LEN	16
 
 /* prototype */
@@ -222,6 +226,11 @@
 	case DH_GEX_SHA1:
 		kexgex(kex);
 		break;
+#ifdef GSSAPI
+	case GSS_GRP1_SHA1:
+		kexgss(kex);
+		break;
+#endif
 	default:
 		fatal("Unsupported key exchange %d", kex->kex_type);
 	}
@@ -277,11 +286,15 @@
 {
 	k->name = match_list(client, server, NULL);
 	if (k->name == NULL)
-		fatal("no kex alg");
+		fatal("No key exchange algorithm");
 	if (strcmp(k->name, KEX_DH1) == 0) {
 		k->kex_type = DH_GRP1_SHA1;
 	} else if (strcmp(k->name, KEX_DHGEX) == 0) {
 		k->kex_type = DH_GEX_SHA1;
+#ifdef GSSAPI
+	} else if (strncmp(k->name, KEX_GSS_SHA1, sizeof(KEX_GSS_SHA1)-1) == 0) {
+		k->kex_type = GSS_GRP1_SHA1;
+#endif
 	} else
 		fatal("bad kex alg %s", k->name);
 }
diff -Naur openssh-3.1p1/kex.h openssh-3.1p1-gsi/kex.h
--- openssh-3.1p1/kex.h	Mon Feb 18 22:21:25 2002
+++ openssh-3.1p1-gsi/kex.h	Thu Apr  4 17:03:45 2002
@@ -56,7 +56,8 @@
 
 enum kex_exchange {
 	DH_GRP1_SHA1,
-	DH_GEX_SHA1
+	DH_GEX_SHA1,
+	GSS_GRP1_SHA1
 };
 
 #define KEX_INIT_SENT	0x0001
@@ -94,6 +95,11 @@
 	Mac	mac;
 	Comp	comp;
 };
+
+struct KexOptions {
+	int	gss_deleg_creds;
+};
+
 struct Kex {
 	u_char	*session_id;
 	int	session_id_len;
@@ -107,10 +113,12 @@
 	Buffer	peer;
 	int	done;
 	int	flags;
+	char	*host;
 	char	*client_version_string;
 	char	*server_version_string;
 	int	(*verify_host_key)(Key *);
 	Key	*(*load_host_key)(int);
+	struct  KexOptions options;
 };
 
 Kex	*kex_setup(char *[PROPOSAL_MAX]);
@@ -122,6 +130,9 @@
 
 void	 kexdh(Kex *);
 void	 kexgex(Kex *);
+#ifdef GSSAPI
+void	 kexgss(Kex *);
+#endif
 
 Newkeys *kex_get_newkeys(int);
 
diff -Naur openssh-3.1p1/kexgss.c openssh-3.1p1-gsi/kexgss.c
--- openssh-3.1p1/kexgss.c	Wed Dec 31 18:00:00 1969
+++ openssh-3.1p1-gsi/kexgss.c	Thu Apr  4 17:03:45 2002
@@ -0,0 +1,454 @@
+/*
+ * Copyright (c) 2001,2002 Simon Wilkinson. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR `AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "includes.h"
+
+#ifdef GSSAPI
+
+#include <openssl/crypto.h>
+#include <openssl/bn.h>
+
+#include "xmalloc.h"
+#include "buffer.h"
+#include "bufaux.h"
+#include "kex.h"
+#include "log.h"
+#include "packet.h"
+#include "dh.h"
+#include "ssh2.h"
+#include "ssh-gss.h"
+
+/* This is now the same as the DH hash ... */
+
+u_char *
+kex_gssapi_hash(
+    char *client_version_string,
+    char *server_version_string,
+    char *ckexinit, int ckexinitlen,
+    char *skexinit, int skexinitlen,
+    u_char *serverhostkeyblob, int sbloblen,
+    BIGNUM *client_dh_pub,
+    BIGNUM *server_dh_pub,
+    BIGNUM *shared_secret)
+{
+	Buffer b;
+	static u_char digest[EVP_MAX_MD_SIZE];
+	EVP_MD *evp_md = EVP_sha1();
+	EVP_MD_CTX md;
+
+	buffer_init(&b);
+	buffer_put_string(&b, client_version_string, strlen(client_version_string));
+	buffer_put_string(&b, server_version_string, strlen(server_version_string));
+
+	/* kexinit messages: fake header: len+SSH2_MSG_KEXINIT */
+	buffer_put_int(&b, ckexinitlen+1);
+	buffer_put_char(&b, SSH2_MSG_KEXINIT);
+	buffer_append(&b, ckexinit, ckexinitlen);
+	buffer_put_int(&b, skexinitlen+1);
+	buffer_put_char(&b, SSH2_MSG_KEXINIT);
+	buffer_append(&b, skexinit, skexinitlen);
+
+	buffer_put_string(&b, serverhostkeyblob, sbloblen);
+	buffer_put_bignum2(&b, client_dh_pub);
+	buffer_put_bignum2(&b, server_dh_pub);
+	buffer_put_bignum2(&b, shared_secret);
+
+#ifdef DEBUG_KEX
+	buffer_dump(&b);
+#endif
+	EVP_DigestInit(&md, evp_md);
+	EVP_DigestUpdate(&md, buffer_ptr(&b), buffer_len(&b));
+	EVP_DigestFinal(&md, digest, NULL);
+
+	buffer_free(&b);
+
+#ifdef DEBUG_KEX
+	dump_digest("hash", digest, evp_md->md_size);
+#endif
+	return digest;
+}
+
+void
+kexgss_client(Kex *kex)
+{
+	gss_buffer_desc gssbuf,send_tok,recv_tok, msg_tok, *token_ptr;
+	Gssctxt ctxt;
+	OM_uint32 maj_status, min_status, ret_flags;
+	unsigned int klen, kout;
+	DH *dh; 
+	BIGNUM *dh_server_pub = 0;
+	BIGNUM *shared_secret = 0;	
+	unsigned char *kbuf;
+	unsigned char *hash;
+	unsigned char *serverhostkey;
+	int type = 0;
+	int first = 1;
+	int slen = 0;
+	
+	/* Initialise our GSSAPI world */
+	ssh_gssapi_build_ctx(&ctxt);
+	if (ssh_gssapi_id_kex(&ctxt,kex->name)) {
+		fatal("Couldn't identify host exchange");
+	}
+	if (ssh_gssapi_import_name(&ctxt,kex->host)) {
+		fatal("Couldn't import hostname ");
+	}
+	
+	/* This code should match that in ssh_dh1_client */
+		
+	/* Step 1 - e is dh->pub_key */
+	dh = dh_new_group1();
+	dh_gen_key(dh, kex->we_need * 8);
+
+	/* This is f, we initialise it now to make life easier */
+    	dh_server_pub = BN_new();
+    	if (dh_server_pub == NULL) {
+    		fatal("dh_server_pub == NULL");
+    	}
+    		
+	token_ptr = GSS_C_NO_BUFFER;
+			 
+	do {
+		debug("Calling gss_init_sec_context");
+		
+		maj_status=ssh_gssapi_init_ctx(&ctxt,
+					       kex->options.gss_deleg_creds,
+					       token_ptr,&send_tok,
+					       &ret_flags);
+
+		if (GSS_ERROR(maj_status)) {
+			fatal("gss_init_context failed");
+		} 
+
+		/* If we've got an old receive buffer get rid of it */
+		if (token_ptr != GSS_C_NO_BUFFER)
+	  		(void) gss_release_buffer(&min_status, &recv_tok);
+ 	
+		
+		if (maj_status == GSS_S_COMPLETE) {
+			/* If mutual state flag is not true, kex fails */
+			if (!(ret_flags & GSS_C_MUTUAL_FLAG)) {
+				fatal("Mutual authentication failed");
+			}
+			/* If integ avail flag is not true kex fails */
+			if (!(ret_flags & GSS_C_INTEG_FLAG)) {
+				fatal("Integrity check failed");
+			}
+		}
+		
+		/* If we have data to send, then the last message that we
+		 * received cannot have been a 'complete'. */
+		if (send_tok.length !=0) {
+			if (first) {
+				packet_start(SSH2_MSG_KEXGSS_INIT);
+				packet_put_string(send_tok.value,
+					  	  send_tok.length);
+				packet_put_bignum2(dh->pub_key);
+				first=0;
+			} else {
+				packet_start(SSH2_MSG_KEXGSS_CONTINUE);
+				packet_put_string(send_tok.value,
+						  send_tok.length);
+			}
+			packet_send();
+			packet_write_wait();
+
+			
+			/* If we've sent them data, they'd better be polite
+			 * and reply. */
+		
+			type = packet_read();
+			switch (type) {
+			case SSH2_MSG_KEXGSS_HOSTKEY:
+				debug("Received KEXGSS_HOSTKEY");
+				serverhostkey=packet_get_string(&slen);
+				break;
+			case SSH2_MSG_KEXGSS_CONTINUE:
+				debug("Received GSSAPI_CONTINUE");
+				if (maj_status == GSS_S_COMPLETE) 
+					fatal("GSSAPI Continue received from server when complete");
+				recv_tok.value=packet_get_string(&recv_tok.length);
+				break;
+			case SSH2_MSG_KEXGSS_COMPLETE:
+				debug("Received GSSAPI_COMPLETE");
+			        packet_get_bignum2(dh_server_pub);
+			    	msg_tok.value=
+			    	    packet_get_string(&msg_tok.length);
+
+				/* Is there a token included? */
+				if (packet_get_char()) {
+					recv_tok.value=
+					    packet_get_string(&recv_tok.length);
+					/* If we're already complete - protocol error */
+					if (maj_status == GSS_S_COMPLETE)
+						packet_disconnect("Protocol error: received token when complete");
+				} else {
+				   	/* No token included */
+				   	if (maj_status != GSS_S_COMPLETE)
+				   		packet_disconnect("Protocol error: did not receive final token");
+				}
+				break;
+			default:
+				packet_disconnect("Protocol error: didn't expect packet type %d",
+		    		type);
+			}
+			token_ptr=&recv_tok;
+		}
+
+    	} while (maj_status & GSS_S_CONTINUE_NEEDED);
+    	
+    	/* We _must_ have received a COMPLETE message in reply from the 
+    	 * server, which will have set dh_server_pub and msg_tok */
+    	 
+    	if (type!=SSH2_MSG_KEXGSS_COMPLETE)
+    	   fatal("Didn't receive a SSH2_MSG_KEXGSS_COMPLETE when I expected it");
+    	 	    	
+	/* Check f in range [1, p-1] */
+        if (!dh_pub_is_valid(dh, dh_server_pub))
+                        packet_disconnect("bad server public DH value");
+                        
+        /* compute K=f^x mod p */
+        klen = DH_size(dh);
+        kbuf = xmalloc(klen);
+        kout = DH_compute_key(kbuf, dh_server_pub, dh);
+        
+        shared_secret = BN_new();
+        BN_bin2bn(kbuf,kout, shared_secret);
+        memset(kbuf, 0, klen);
+        xfree(kbuf);
+        
+        hash = kex_gssapi_hash(
+ 	    kex->client_version_string,
+            kex->server_version_string,
+            buffer_ptr(&kex->my), buffer_len(&kex->my),
+            buffer_ptr(&kex->peer), buffer_len(&kex->peer),
+            serverhostkey, slen, /* server host key */
+            dh->pub_key,	/* e */
+            dh_server_pub,	/* f */
+            shared_secret	/* K */
+        );
+        
+        gssbuf.value=hash;
+        gssbuf.length=20;
+        
+        /* Verify that H matches the token we just got. */
+                if ((maj_status = gss_verify_mic(&min_status,
+        	       		         ctxt.context,
+        	                         &gssbuf,
+        	                         &msg_tok,
+        	                         NULL))) {
+
+		packet_disconnect("Hash's MIC didn't verify");
+      	}	
+        
+        DH_free(dh);
+       	ssh_gssapi_delete_ctx(&ctxt);
+        /* save session id */
+        if (kex->session_id == NULL) {
+        	kex->session_id_len = 20;
+        	kex->session_id = xmalloc(kex->session_id_len);
+        	memcpy(kex->session_id, hash, kex->session_id_len);
+        }
+        
+	kex_derive_keys(kex, hash, shared_secret);
+	BN_clear_free(shared_secret);
+        kex_finish(kex);
+}
+
+
+
+
+void
+kexgss_server(Kex *kex)
+{
+
+	OM_uint32 maj_status, min_status;
+	
+	/* Some GSSAPI implementations use the input value of ret_flags (an
+ 	 * output variable) as a means of triggering mechanism specific 
+ 	 * features. Initializing it to zero avoids inadvertently 
+ 	 * activating this non-standard behaviour.*/
+
+	OM_uint32 ret_flags = 0;
+	gss_buffer_desc gssbuf,send_tok,recv_tok,msg_tok;
+	Gssctxt ctxt;
+        unsigned int klen, kout;
+        unsigned char *kbuf;
+        unsigned char *hash;
+        DH *dh;
+        BIGNUM *shared_secret = NULL;
+        BIGNUM *dh_client_pub = NULL;
+	int type =0;
+	
+	/* Initialise GSSAPI */
+
+	ssh_gssapi_build_ctx(&ctxt);
+        if (ssh_gssapi_id_kex(&ctxt,kex->name))
+		fatal("Unknown gssapi mechanism");
+        if (ssh_gssapi_acquire_cred(&ctxt))
+        	fatal("Unable to acquire credentials for the server");
+                                                                                                                                
+	do {
+		debug("Wait SSH2_MSG_GSSAPI_INIT");
+		type = packet_read();
+		switch(type) {
+		case SSH2_MSG_KEXGSS_INIT:
+			if (dh_client_pub!=NULL) 
+				fatal("Received KEXGSS_INIT after initialising");
+			recv_tok.value=packet_get_string(&recv_tok.length);
+
+		        dh_client_pub = BN_new();
+		        
+		        if (dh_client_pub == NULL)
+        			fatal("dh_client_pub == NULL");
+		  	packet_get_bignum2(dh_client_pub);
+		  	
+		  	/* Send SSH_MSG_KEXGSS_HOSTKEY here, if we want */
+			break;
+		case SSH2_MSG_KEXGSS_CONTINUE:
+			if (dh_client_pub == NULL)
+				fatal("Received KEXGSS_CONTINUE without initialising");
+			recv_tok.value=packet_get_string(&recv_tok.length);
+			break;
+		default:
+			packet_disconnect("Protocol error: didn't expect packet type %d",
+					   type);
+		}
+		maj_status=ssh_gssapi_accept_ctx(&ctxt,&recv_tok, &send_tok,
+						 &ret_flags);
+
+		gss_release_buffer(&min_status,&recv_tok);
+
+#ifdef GSS_C_GLOBUS_LIMITED_PROXY_FLAG
+                if (ret_flags & GSS_C_GLOBUS_LIMITED_PROXY_FLAG) {
+                        fatal("Limited proxy is not allowed.");
+                }
+#endif
+		
+		if (maj_status & GSS_S_CONTINUE_NEEDED) {
+			debug("Sending GSSAPI_CONTINUE");
+			packet_start(SSH2_MSG_KEXGSS_CONTINUE);
+			packet_put_string(send_tok.value,send_tok.length);
+			packet_send();
+			packet_write_wait();
+			gss_release_buffer(&min_status, &send_tok);
+		}
+	} while (maj_status & GSS_S_CONTINUE_NEEDED);
+
+	if (GSS_ERROR(maj_status))
+		fatal("gss_accept_context died");
+	
+	debug("gss_complete");
+	if (!(ret_flags & GSS_C_MUTUAL_FLAG))
+		fatal("mutual authentication flag wasn't set");
+		
+	if (!(ret_flags & GSS_C_INTEG_FLAG))
+		fatal("Integrity flag wasn't set");
+		
+	
+	dh = dh_new_group1();
+	dh_gen_key(dh, kex->we_need * 8);
+	
+        if (!dh_pub_is_valid(dh, dh_client_pub))
+                packet_disconnect("bad client public DH value");
+
+        klen = DH_size(dh);
+        kbuf = xmalloc(klen); 
+        kout = DH_compute_key(kbuf, dh_client_pub, dh);
+
+	shared_secret = BN_new();
+	BN_bin2bn(kbuf, kout, shared_secret);
+	memset(kbuf, 0, klen);
+	xfree(kbuf);
+	
+        hash = kex_gssapi_hash(
+            kex->client_version_string,
+            kex->server_version_string,
+            buffer_ptr(&kex->peer), buffer_len(&kex->peer),
+            buffer_ptr(&kex->my), buffer_len(&kex->my),
+            NULL, 0, /* Change this if we start sending host keys */
+            dh_client_pub,
+            dh->pub_key,
+            shared_secret
+	);
+	BN_free(dh_client_pub);
+		
+	if (kex->session_id == NULL) {
+		kex->session_id_len = 20;
+		kex->session_id = xmalloc(kex->session_id_len);
+		memcpy(kex->session_id, hash, kex->session_id_len);
+	}
+	                        
+	gssbuf.value = hash;
+	gssbuf.length = 20; /* Hashlen appears to always be 20 */
+	
+	if ((maj_status=gss_get_mic(&min_status,
+			       ctxt.context,
+			       GSS_C_QOP_DEFAULT,
+			       &gssbuf,
+			       &msg_tok))) {
+		ssh_gssapi_error(maj_status,min_status);
+		fatal("Couldn't get MIC");
+	}	
+			      
+	packet_start(SSH2_MSG_KEXGSS_COMPLETE);
+	packet_put_bignum2(dh->pub_key);
+	packet_put_string((char *)msg_tok.value,msg_tok.length);
+
+	if (send_tok.length!=0) {
+		packet_put_char(1); /* true */
+		packet_put_string((char *)send_tok.value,send_tok.length);
+	} else {
+		packet_put_char(0); /* false */
+	}
+ 	packet_send();
+	packet_write_wait();
+
+	/* Store the client name, and the delegated credentials for later
+	 * use */
+	if (ssh_gssapi_getclient(&ctxt,&gssapi_client_type, 
+				       &gssapi_client_name, 
+				       &gssapi_client_creds)) {
+		fatal("Couldn't convert client name");
+	}
+	
+	gss_release_buffer(&min_status, &send_tok);	
+	ssh_gssapi_delete_ctx(&ctxt);
+	DH_free(dh);
+
+	kex_derive_keys(kex, hash, shared_secret);
+	BN_clear_free(shared_secret);
+	kex_finish(kex);
+}
+
+void 
+kexgss(Kex *kex)
+{
+	if (kex->server)
+		kexgss_server(kex);
+	else
+		kexgss_client(kex);
+}
+
+#endif /* GSSAPI */
diff -Naur openssh-3.1p1/key.c openssh-3.1p1-gsi/key.c
--- openssh-3.1p1/key.c	Mon Mar  4 19:33:38 2002
+++ openssh-3.1p1-gsi/key.c	Thu Apr  4 17:03:45 2002
@@ -640,6 +640,8 @@
 		return KEY_RSA;
 	} else if (strcmp(name, "ssh-dss") == 0) {
 		return KEY_DSA;
+	} else if (strcmp(name, "null") == 0){
+		return KEY_NULL;
 	}
 	debug2("key_type_from_name: unknown key type '%s'", name);
 	return KEY_UNSPEC;
diff -Naur openssh-3.1p1/key.h openssh-3.1p1-gsi/key.h
--- openssh-3.1p1/key.h	Tue Feb 26 12:09:44 2002
+++ openssh-3.1p1-gsi/key.h	Thu Apr  4 17:03:45 2002
@@ -34,6 +34,7 @@
 	KEY_RSA1,
 	KEY_RSA,
 	KEY_DSA,
+	KEY_NULL,
 	KEY_UNSPEC
 };
 enum fp_type {
diff -Naur openssh-3.1p1/makegssname.pl openssh-3.1p1-gsi/makegssname.pl
--- openssh-3.1p1/makegssname.pl	Wed Dec 31 18:00:00 1969
+++ openssh-3.1p1-gsi/makegssname.pl	Thu Apr  4 17:03:45 2002
@@ -0,0 +1,46 @@
+#!/usr/bin/perl
+
+use Convert::ASN1 qw(:tag);
+use Digest::MD5 qw(md5);
+use MIME::Base64;
+ 
+$oid=shift;
+$encoded=encode_object_id($oid);
+
+@entries=unpack("C*",$encoded);
+shift @entries; # Get rid of the NULL
+
+print "DER representation: ";
+foreach $entry (@entries) {
+  print "\\x";
+  printf "%02X",$entry;
+}
+print "\n";
+
+$digest = md5($encoded);
+# We only want the first 10 characters;
+# Conversations with the authors suggest that we want to use all of the
+# characters of the digest.
+#$digest = substr($digest,0,10);
+print "gsskeyex representation: ",encode_base64($digest),"\n";
+
+sub encode_object_id {
+  $string="";
+
+  my @data = ($_[0] =~ /(\d+)/g);
+
+  if(@data < 2) {
+      @data = (0);
+  }
+  else {
+      my $first = $data[1] + ($data[0] * 40);
+      splice(@data,0,2,$first);
+  }
+
+#  my $l = length $string;
+  $string .= pack("cw*", 0, @data);
+#  substr($string,$l,1) = asn_encode_length(length($string) - $l - 1);
+  return $string;
+}
+
+
diff -Naur openssh-3.1p1/openbsd-compat/getopt.c openssh-3.1p1-gsi/openbsd-compat/getopt.c
--- openssh-3.1p1/openbsd-compat/getopt.c	Mon Sep 17 16:34:34 2001
+++ openssh-3.1p1-gsi/openbsd-compat/getopt.c	Thu Apr  4 17:03:45 2002
@@ -42,11 +42,11 @@
 #include <stdlib.h>
 #include <string.h>
 
-int	opterr = 1,		/* if error message should be printed */
-	optind = 1,		/* index into parent argv vector */
-	optopt,			/* character checked for validity */
-	optreset;		/* reset getopt */
-char	*optarg;		/* argument associated with option */
+int	BSDopterr = 1,		/* if error message should be printed */
+	BSDoptind = 1,		/* index into parent argv vector */
+	BSDoptopt,		/* character checked for validity */
+	BSDoptreset;		/* reset getopt */
+char	*BSDoptarg;		/* argument associated with option */
 
 #define	BADCH	(int)'?'
 #define	BADARG	(int)':'
@@ -66,57 +66,57 @@
 	static char *place = EMSG;		/* option letter processing */
 	char *oli;				/* option letter list index */
 
-	if (optreset || !*place) {		/* update scanning pointer */
-		optreset = 0;
-		if (optind >= nargc || *(place = nargv[optind]) != '-') {
+	if (BSDoptreset || !*place) {		/* update scanning pointer */
+		BSDoptreset = 0;
+		if (BSDoptind >= nargc || *(place = nargv[BSDoptind]) != '-') {
 			place = EMSG;
 			return (-1);
 		}
 		if (place[1] && *++place == '-') {	/* found "--" */
-			++optind;
+			++BSDoptind;
 			place = EMSG;
 			return (-1);
 		}
 	}					/* option letter okay? */
-	if ((optopt = (int)*place++) == (int)':' ||
-	    !(oli = strchr(ostr, optopt))) {
+	if ((BSDoptopt = (int)*place++) == (int)':' ||
+	    !(oli = strchr(ostr, BSDoptopt))) {
 		/*
 		 * if the user didn't specify '-' as an option,
 		 * assume it means -1.
 		 */
-		if (optopt == (int)'-')
+		if (BSDoptopt == (int)'-')
 			return (-1);
 		if (!*place)
-			++optind;
-		if (opterr && *ostr != ':')
+			++BSDoptind;
+		if (BSDopterr && *ostr != ':')
 			(void)fprintf(stderr,
-			    "%s: illegal option -- %c\n", __progname, optopt);
+			    "%s: illegal option -- %c\n", __progname, BSDoptopt);
 		return (BADCH);
 	}
 	if (*++oli != ':') {			/* don't need argument */
-		optarg = NULL;
+		BSDoptarg = NULL;
 		if (!*place)
-			++optind;
+			++BSDoptind;
 	}
 	else {					/* need an argument */
 		if (*place)			/* no white space */
-			optarg = place;
-		else if (nargc <= ++optind) {	/* no arg */
+			BSDoptarg = place;
+		else if (nargc <= ++BSDoptind) {	/* no arg */
 			place = EMSG;
 			if (*ostr == ':')
 				return (BADARG);
-			if (opterr)
+			if (BSDopterr)
 				(void)fprintf(stderr,
 				    "%s: option requires an argument -- %c\n",
-				    __progname, optopt);
+				    __progname, BSDoptopt);
 			return (BADCH);
 		}
 	 	else				/* white space */
-			optarg = nargv[optind];
+			BSDoptarg = nargv[BSDoptind];
 		place = EMSG;
-		++optind;
+		++BSDoptind;
 	}
-	return (optopt);			/* dump back option letter */
+	return (BSDoptopt);			/* dump back option letter */
 }
 
 #endif /* !defined(HAVE_GETOPT) || !defined(HAVE_OPTRESET) */
diff -Naur openssh-3.1p1/packet.c openssh-3.1p1-gsi/packet.c
--- openssh-3.1p1/packet.c	Mon Mar  4 19:31:29 2002
+++ openssh-3.1p1-gsi/packet.c	Thu Apr  4 17:03:45 2002
@@ -1040,6 +1040,13 @@
 	return buffer_get_string(&incoming_packet, length_ptr);
 }
 
+/* Clears incoming data buffer */
+
+void packet_get_all(void)
+{
+  buffer_clear(&incoming_packet);
+}
+
 /*
  * Sends a diagnostic message from the server to the client.  This message
  * can be sent at any time (but not while constructing another message). The
diff -Naur openssh-3.1p1/packet.h openssh-3.1p1-gsi/packet.h
--- openssh-3.1p1/packet.h	Mon Mar  4 19:53:05 2002
+++ openssh-3.1p1-gsi/packet.h	Thu Apr  4 17:03:45 2002
@@ -53,6 +53,7 @@
 void     packet_get_bignum2(BIGNUM * value);
 void	*packet_get_raw(int *length_ptr);
 void	*packet_get_string(u_int *length_ptr);
+void	packet_get_all(void);
 void     packet_disconnect(const char *fmt,...) __attribute__((format(printf, 1, 2)));
 void     packet_send_debug(const char *fmt,...) __attribute__((format(printf, 1, 2)));
 
diff -Naur openssh-3.1p1/readconf.c openssh-3.1p1-gsi/readconf.c
--- openssh-3.1p1/readconf.c	Mon Feb  4 19:26:35 2002
+++ openssh-3.1p1-gsi/readconf.c	Thu Apr  4 17:03:45 2002
@@ -99,6 +99,12 @@
 #if defined(KRB4) || defined(KRB5)
 	oKerberosAuthentication,
 #endif
+#ifdef GSSAPI
+	oGssAuthentication, oGssDelegateCreds,
+#ifdef GSI
+	oGssGlobusDelegateLimitedCreds,
+#endif /* GSI */
+#endif /* GSSAPI */
 #if defined(AFS) || defined(KRB5)
 	oKerberosTgtPassing,
 #endif
@@ -144,6 +150,15 @@
 #if defined(KRB4) || defined(KRB5)
 	{ "kerberosauthentication", oKerberosAuthentication },
 #endif
+#ifdef GSSAPI
+	{ "gssapiauthentication", oGssAuthentication },
+	{ "gssapidelegatecredentials", oGssDelegateCreds },
+#ifdef GSI
+	/* For backwards compatability with old 1.2.27 client code */
+	{ "forwardgssapiglobusproxy", oGssDelegateCreds }, /* alias */
+	{ "forwardgssapiglobuslimitedproxy", oGssGlobusDelegateLimitedCreds },
+#endif /* GSI */
+#endif /* GSSAPI */
 #if defined(AFS) || defined(KRB5)
 	{ "kerberostgtpassing", oKerberosTgtPassing },
 #endif
@@ -363,6 +378,23 @@
 		intptr = &options->kerberos_authentication;
 		goto parse_flag;
 #endif
+#ifdef GSSAPI
+	case oGssAuthentication:
+		intptr = &options->gss_authentication;
+		goto parse_flag;
+      
+	case oGssDelegateCreds:
+		intptr = &options->gss_deleg_creds;
+		goto parse_flag;
+ 
+#ifdef GSI
+	case oGssGlobusDelegateLimitedCreds:
+		intptr = &options->gss_globus_deleg_limited_proxy;
+		goto parse_flag;
+#endif /* GSI */
+
+#endif /* GSSAPI */
+
 #if defined(AFS) || defined(KRB5)
 	case oKerberosTgtPassing:
 		intptr = &options->kerberos_tgt_passing;
@@ -751,6 +783,14 @@
 	options->rsa_authentication = -1;
 	options->pubkey_authentication = -1;
 	options->challenge_response_authentication = -1;
+#ifdef GSSAPI
+        options->gss_authentication = -1;
+        options->gss_deleg_creds = -1;
+#ifdef GSI
+        options->gss_globus_deleg_limited_proxy = -1;
+#endif /* GSI */
+#endif /* GSSAPI */
+
 #if defined(KRB4) || defined(KRB5)
 	options->kerberos_authentication = -1;
 #endif
@@ -829,6 +869,16 @@
 		options->pubkey_authentication = 1;
 	if (options->challenge_response_authentication == -1)
 		options->challenge_response_authentication = 1;
+#ifdef GSSAPI
+	if (options->gss_authentication == -1)
+		options->gss_authentication = 1;
+	if (options->gss_deleg_creds == -1)
+		options->gss_deleg_creds = 1;
+#ifdef GSI
+	if (options->gss_globus_deleg_limited_proxy == -1)
+		options->gss_globus_deleg_limited_proxy = 0;
+#endif /* GSI */
+#endif /* GSSAPI */
 #if defined(KRB4) || defined(KRB5)
 	if (options->kerberos_authentication == -1)
 		options->kerberos_authentication = 1;
diff -Naur openssh-3.1p1/readconf.h openssh-3.1p1-gsi/readconf.h
--- openssh-3.1p1/readconf.h	Mon Mar  4 19:53:05 2002
+++ openssh-3.1p1-gsi/readconf.h	Thu Apr  4 17:03:45 2002
@@ -47,6 +47,15 @@
 #if defined(AFS) || defined(KRB5)
 	int     kerberos_tgt_passing;	/* Try Kerberos TGT passing. */
 #endif
+
+#ifdef GSSAPI
+	int 	gss_authentication;
+	int	gss_deleg_creds;
+#ifdef GSI
+	int	gss_globus_deleg_limited_proxy;
+#endif /* GSI */
+#endif /* GSSAPI */
+
 #ifdef AFS
 	int     afs_token_passing;	/* Try AFS token passing. */
 #endif
diff -Naur openssh-3.1p1/servconf.c openssh-3.1p1-gsi/servconf.c
--- openssh-3.1p1/servconf.c	Mon Feb  4 19:26:35 2002
+++ openssh-3.1p1-gsi/servconf.c	Thu Apr  4 17:03:45 2002
@@ -12,8 +12,17 @@
 #include "includes.h"
 RCSID("$OpenBSD: servconf.c,v 1.101 2002/02/04 12:15:25 markus Exp $");
 
-#if defined(KRB4) || defined(KRB5)
+#if defined(KRB4)
+#include <krb.h>
+#endif
+#if defined(KRB5)
+#ifdef HEIMDAL
 #include <krb.h>
+#else
+/* Bodge - but then, so is using the kerberos IV KEYFILE to get a Kerberos V
+ * keytab */
+#define KEYFILE "/etc/krb5.keytab"
+#endif
 #endif
 #ifdef AFS
 #include <kafs.h>
@@ -75,6 +84,12 @@
 	options->hostbased_uses_name_from_packet_only = -1;
 	options->rsa_authentication = -1;
 	options->pubkey_authentication = -1;
+#ifdef GSSAPI
+	options->gss_authentication=-1;
+	options->gss_keyex=-1;
+	options->gss_use_session_ccache = -1;
+	options->gss_cleanup_creds = -1;
+#endif
 #if defined(KRB4) || defined(KRB5)
 	options->kerberos_authentication = -1;
 	options->kerberos_or_local_passwd = -1;
@@ -184,6 +199,16 @@
 		options->rsa_authentication = 1;
 	if (options->pubkey_authentication == -1)
 		options->pubkey_authentication = 1;
+#ifdef GSSAPI
+	if (options->gss_authentication == -1)
+		options->gss_authentication = 1;
+	if (options->gss_keyex == -1)
+		options->gss_keyex =1;
+	if (options->gss_use_session_ccache == -1)
+		options->gss_use_session_ccache = 1;
+	if (options->gss_cleanup_creds == -1)
+		options->gss_cleanup_creds = 1;
+#endif
 #if defined(KRB4) || defined(KRB5)
 	if (options->kerberos_authentication == -1)
 		options->kerberos_authentication = (access(KEYFILE, R_OK) == 0);
@@ -246,6 +271,9 @@
 	sPort, sHostKeyFile, sServerKeyBits, sLoginGraceTime, sKeyRegenerationTime,
 	sPermitRootLogin, sLogFacility, sLogLevel,
 	sRhostsAuthentication, sRhostsRSAAuthentication, sRSAAuthentication,
+#ifdef GSSAPI
+	sGssAuthentication, sGssKeyEx, sGssUseSessionCredCache, sGssCleanupCreds,
+#endif
 #if defined(KRB4) || defined(KRB5)
 	sKerberosAuthentication, sKerberosOrLocalPasswd, sKerberosTicketCleanup,
 #endif
@@ -295,6 +323,13 @@
 	{ "rsaauthentication", sRSAAuthentication },
 	{ "pubkeyauthentication", sPubkeyAuthentication },
 	{ "dsaauthentication", sPubkeyAuthentication },			/* alias */
+#ifdef GSSAPI
+	{ "gssapiauthentication", sGssAuthentication },
+	{ "gssapikeyexchange", sGssKeyEx },
+	{ "gssusesessionccache", sGssUseSessionCredCache },
+	{ "gssapiusesessioncredcache", sGssUseSessionCredCache },
+	{ "gssapicleanupcreds", sGssCleanupCreds },
+#endif
 #if defined(KRB4) || defined(KRB5)
 	{ "kerberosauthentication", sKerberosAuthentication },
 	{ "kerberosorlocalpasswd", sKerberosOrLocalPasswd },
@@ -608,6 +643,20 @@
 	case sPubkeyAuthentication:
 		intptr = &options->pubkey_authentication;
 		goto parse_flag;
+#ifdef GSSAPI
+	case sGssAuthentication:
+		intptr = &options->gss_authentication;
+		goto parse_flag;
+	case sGssKeyEx:
+		intptr = &options->gss_keyex;
+		goto parse_flag;
+	case sGssUseSessionCredCache:
+		intptr = &options->gss_use_session_ccache;
+		goto parse_flag;
+	case sGssCleanupCreds:
+		intptr = &options->gss_cleanup_creds;
+		goto parse_flag;
+#endif
 #if defined(KRB4) || defined(KRB5)
 	case sKerberosAuthentication:
 		intptr = &options->kerberos_authentication;
diff -Naur openssh-3.1p1/servconf.h openssh-3.1p1-gsi/servconf.h
--- openssh-3.1p1/servconf.h	Mon Mar  4 19:53:05 2002
+++ openssh-3.1p1-gsi/servconf.h	Thu Apr  4 17:03:45 2002
@@ -73,6 +73,13 @@
 	int     hostbased_uses_name_from_packet_only; /* experimental */
 	int     rsa_authentication;	/* If true, permit RSA authentication. */
 	int     pubkey_authentication;	/* If true, permit ssh2 pubkey authentication. */
+	#ifdef GSSAPI
+	int     gss_authentication;
+	int     gss_keyex;
+	int     gss_use_session_ccache;        /* If true, delegated credentials are
+	                                        * stored in a session specific cache */
+	int 	gss_cleanup_creds;	       /* If true, destroy cred cache on logout */
+#endif	
 #if defined(KRB4) || defined(KRB5)
 	int     kerberos_authentication;	/* If true, permit Kerberos
 						 * authentication. */
diff -Naur openssh-3.1p1/session.c openssh-3.1p1-gsi/session.c
--- openssh-3.1p1/session.c	Mon Feb 25 09:48:03 2002
+++ openssh-3.1p1-gsi/session.c	Thu Apr  4 17:03:45 2002
@@ -57,6 +57,10 @@
 #include "canohost.h"
 #include "session.h"
 
+#ifdef GSSAPI
+#include "ssh-gss.h"
+#endif
+
 #ifdef HAVE_CYGWIN
 #include <windows.h>
 #include <sys/cygwin.h>
@@ -409,6 +413,12 @@
 
 	session_proctitle(s);
 
+#if defined(GSSAPI)
+	temporarily_use_uid(s->pw);
+	ssh_gssapi_storecreds();
+	restore_uid();
+#endif
+
 #if defined(USE_PAM)
 	do_pam_session(s->pw->pw_name, NULL);
 	do_pam_setcred(1);
@@ -527,6 +537,12 @@
 	ptyfd = s->ptyfd;
 	ttyfd = s->ttyfd;
 
+#if defined(GSSAPI)
+	temporarily_use_uid(s->pw);
+	ssh_gssapi_storecreds();
+	restore_uid();
+#endif
+
 #if defined(USE_PAM)
 	do_pam_session(s->pw->pw_name, s->tty);
 	do_pam_setcred(1);
@@ -781,7 +797,7 @@
  * Sets the value of the given variable in the environment.  If the variable
  * already exists, its value is overriden.
  */
-static void
+void
 child_set_env(char ***envp, u_int *envsizep, const char *name,
 	const char *value)
 {
@@ -901,6 +917,13 @@
 	copy_environment(environ, &env, &envsize);
 #endif
 
+#ifdef GSSAPI
+	/* Allow any GSSAPI methods that we've used to alter 
+	 * the childs environment as they see fit
+	 */
+	ssh_gssapi_do_child(&env,&envsize);
+#endif
+
 	if (!options.use_login) {
 		/* Set basic environment. */
 		child_set_env(&env, &envsize, "USER", pw->pw_name);
@@ -1924,4 +1947,7 @@
 do_authenticated2(Authctxt *authctxt)
 {
 	server_loop2(authctxt);
+#if defined(GSSAPI)
+	ssh_gssapi_cleanup_creds(NULL);
+#endif
 }
diff -Naur openssh-3.1p1/session.h openssh-3.1p1-gsi/session.h
--- openssh-3.1p1/session.h	Mon Feb  4 19:21:44 2002
+++ openssh-3.1p1-gsi/session.h	Thu Apr  4 17:03:45 2002
@@ -33,5 +33,6 @@
 void	 session_close_by_pid(pid_t, int);
 void	 session_close_by_channel(int, void *);
 void	 session_destroy_all(void);
-
+void	 child_set_env(char ***envp, u_int *envsizep, const char *name,
+		       const char *value);
 #endif
diff -Naur openssh-3.1p1/ssh-gss.h openssh-3.1p1-gsi/ssh-gss.h
--- openssh-3.1p1/ssh-gss.h	Wed Dec 31 18:00:00 1969
+++ openssh-3.1p1-gsi/ssh-gss.h	Thu Apr  4 17:03:45 2002
@@ -0,0 +1,123 @@
+/*
+ * Copyright (c) 2001 Simon Wilkinson. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR `AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifdef GSSAPI
+
+#include "kex.h"
+#include "buffer.h"
+
+#include <gssapi.h>
+
+#ifdef KRB5
+#ifndef HEIMDAL
+#include <gssapi_generic.h>
+
+/* MIT Kerberos doesn't seem to define GSS_NT_HOSTBASED_SERVICE */
+
+#ifndef GSS_C_NT_HOSTBASED_SERVICE
+#define GSS_C_NT_HOSTBASED_SERVICE gss_nt_service_name
+#endif /* GSS_C_NT_... */
+#endif /* !HEIMDAL */
+#endif /* KRB5 */
+
+/* draft-ietf-secsh-gsskeyex-01 */
+#define SSH2_MSG_KEXGSS_INIT		30
+#define SSH2_MSG_KEXGSS_CONTINUE 	31
+#define SSH2_MSG_KEXGSS_COMPLETE 	32
+#define SSH2_MSG_KEXGSS_HOSTKEY		33
+#define KEX_GSS_SHA1			"gss-group1-sha1-"
+
+/* draft-galb-secsh-gssapi-01 */
+#define SSH2_MSG_USERAUTH_GSSAPI_RESPONSE     60
+#define SSH2_MSG_USERAUTH_GSSAPI_TOKEN        61
+#define SSH2_MSG_USERAUTH_GSSAPI_HASH         62
+#define SSH2_MSG_USERAUTH_GSSAPI_EXCHANGE_COMPLETE	63    
+
+enum ssh_gss_id {
+#ifdef KRB5
+	GSS_KERBEROS,
+#endif
+#ifdef GSI
+	GSS_GSI,
+#endif /* GSI */
+	GSS_LAST_ENTRY
+};
+
+typedef struct ssh_gss_mech_struct {
+        char *enc_name;
+        char *name;
+        gss_OID_desc oid;
+} ssh_gssapi_mech;
+
+typedef struct {
+	OM_uint32	status; /* both */
+	gss_ctx_id_t	context; /* both */
+	gss_name_t	name; /* both */
+	gss_OID		oid; /* client */
+	gss_cred_id_t	creds; /* server */
+	gss_name_t	client; /* server */
+	gss_cred_id_t	client_creds; /* server */
+} Gssctxt;
+
+extern ssh_gssapi_mech supported_mechs[];
+extern gss_buffer_desc gssapi_client_name;
+extern gss_cred_id_t   gssapi_client_creds;
+extern enum ssh_gss_id gssapi_client_type;
+
+char *ssh_gssapi_mechanisms(int server, char *host);
+int ssh_gssapi_id_kex(Gssctxt *ctx, char *name);
+void ssh_gssapi_set_oid_data(Gssctxt *ctx, void *data, size_t len);
+void ssh_gssapi_set_oid(Gssctxt *ctx, gss_OID oid);
+void ssh_gssapi_supported_oids(gss_OID_set *oidset);
+enum ssh_gss_id ssh_gssapi_get_ctype(Gssctxt *ctxt);
+
+OM_uint32 ssh_gssapi_import_name(Gssctxt *ctx, const char *host);
+OM_uint32 ssh_gssapi_acquire_cred(Gssctxt *ctx);
+OM_uint32 ssh_gssapi_init_ctx(Gssctxt *ctx, int deleg_creds,
+			      gss_buffer_desc *recv_tok, 
+			      gss_buffer_desc *send_tok, OM_uint32 *flags);
+OM_uint32 ssh_gssapi_accept_ctx(Gssctxt *ctx,
+				gss_buffer_desc *recv_tok,
+				gss_buffer_desc *send_tok,
+				OM_uint32 *flags);
+OM_uint32 ssh_gssapi_getclient(Gssctxt *ctx,
+				enum ssh_gss_id *type,
+				gss_buffer_desc *name,
+				gss_cred_id_t *creds);
+void ssh_gssapi_error(OM_uint32 major_status,OM_uint32 minor_status);
+void ssh_gssapi_build_ctx(Gssctxt *ctx);
+void ssh_gssapi_delete_ctx(Gssctxt *ctx);
+
+/* In the client */
+void ssh_gssapi_client(Kex *kex, char *host, struct sockaddr *hostaddr,
+                       Buffer *client_kexinit, Buffer *server_kexinit);
+
+/* In the server */
+void ssh_gssapi_server(Kex *kex, Buffer *client_kexinit, 
+		       Buffer *server_kexinit);
+void ssh_gssapi_do_child(char ***envp, u_int *envsizep);                 
+void ssh_gssapi_cleanup_creds(void *ignored);
+void ssh_gssapi_storecreds();
+void ssh_gssapi_clean_env();
+#endif /* GSSAPI */
diff -Naur openssh-3.1p1/ssh1.h openssh-3.1p1-gsi/ssh1.h
--- openssh-3.1p1/ssh1.h	Fri Jun  8 19:17:12 2001
+++ openssh-3.1p1-gsi/ssh1.h	Thu Apr  4 17:03:45 2002
@@ -70,6 +70,13 @@
 #define SSH_MSG_CHANNEL_INPUT_EOF	SSH_MSG_CHANNEL_CLOSE
 #define SSH_MSG_CHANNEL_OUTPUT_CLOSE	SSH_MSG_CHANNEL_CLOSE_CONFIRMATION
 
+/* GSS-API authentication */
+#define SSH_CMSG_AUTH_GSSAPI                    88      /* int, strings... */
+#define SSH_SMSG_AUTH_GSSAPI_RESPONSE           89      /* string */
+#define SSH_MSG_AUTH_GSSAPI_TOKEN               90      /* string */
+#define SSH_SMSG_AUTH_GSSAPI_HASH               91      /* string */
+#define SSH_MSG_AUTH_GSSAPI_ABORT               92      /* */
+
 /*
  * Authentication methods.  New types can be added, but old types should not
  * be removed for compatibility.  The maximum allowed value is 31.
@@ -83,6 +90,8 @@
 #define SSH_PASS_KERBEROS_TGT	7
 				/* 8 to 15 are reserved */
 #define SSH_PASS_AFS_TOKEN	21
+
+#define SSH_AUTH_GSSAPI		24
 
 /* Protocol flags.  These are bit masks. */
 #define SSH_PROTOFLAG_SCREEN_NUMBER	1	/* X11 forwarding includes screen */
diff -Naur openssh-3.1p1/sshconnect1.c openssh-3.1p1-gsi/sshconnect1.c
--- openssh-3.1p1/sshconnect1.c	Tue Feb 12 20:54:29 2002
+++ openssh-3.1p1-gsi/sshconnect1.c	Thu Apr  4 17:03:45 2002
@@ -23,6 +23,9 @@
 #endif
 #ifdef KRB5
 #include <krb5.h>
+#ifndef HEIMDAL
+#define krb5_get_err_text(context,code) error_message(code)
+#endif /* !HEIMDAL */
 #endif
 #ifdef AFS
 #include <kafs.h>
@@ -48,6 +51,17 @@
 #include "canohost.h"
 #include "auth.h"
 
+#ifdef GSSAPI
+#include "ssh-gss.h"
+#include "bufaux.h"
+
+/*
+ * MD5 hash of host and session keys for verification. This is filled
+ * in in ssh_login() and then checked in try_gssapi_authentication().
+ */
+unsigned char ssh_key_digest[16];
+#endif /* GSSAPI */
+
 /* Session id for the current session. */
 u_char session_id[16];
 u_int supported_authentications = 0;
@@ -519,6 +533,23 @@
 		ret = 0;
 		goto out;
 	}
+	
+	problem = krb5_auth_con_init(*context, auth_context);
+	if (problem) {
+		debug("Kerberos v5: krb5_auth_con_init failed");
+		ret = 0;
+		goto out;
+	}
+
+#ifndef HEIMDAL
+	problem = krb5_auth_con_setflags(*context, *auth_context,
+					 KRB5_AUTH_CONTEXT_RET_TIME);
+	if (problem) {
+		debug("Keberos v5: krb5_auth_con_setflags failed");
+		ret = 0;
+		goto out;
+	}
+#endif
 
 	tkfile = krb5_cc_default_name(*context);
 	if (strncmp(tkfile, "FILE:", 5) == 0)
@@ -595,7 +626,11 @@
 	if (reply != NULL)
 		krb5_free_ap_rep_enc_part(*context, reply);
 	if (ap.length > 0)
+#ifdef HEIMDAL
 		krb5_data_free(&ap);
+#else
+		krb5_free_data_contents(*context, &ap);
+#endif
 
 	return (ret);
 }
@@ -608,7 +643,11 @@
 	krb5_data outbuf;
 	krb5_ccache ccache = NULL;
 	krb5_creds creds;
+#ifdef HEIMDAL
 	krb5_kdc_flags flags;
+#else
+	int forwardable;
+#endif
 	const char *remotehost;
 
 	memset(&creds, 0, sizeof(creds));
@@ -616,7 +655,13 @@
 
 	fd = packet_get_connection_in();
 
+#ifdef HEIMDAL
 	problem = krb5_auth_con_setaddrs_from_fd(context, auth_context, &fd);
+#else
+	problem = krb5_auth_con_genaddrs(context, auth_context, fd,
+			KRB5_AUTH_CONTEXT_GENERATE_REMOTE_FULL_ADDR |
+			KRB5_AUTH_CONTEXT_GENERATE_LOCAL_FULL_ADDR);
+#endif
 	if (problem)
 		goto out;
 
@@ -628,23 +673,35 @@
 	if (problem)
 		goto out;
 
+	remotehost = get_canonical_hostname(1);
+	
+#ifdef HEIMDAL
 	problem = krb5_build_principal(context, &creds.server,
 	    strlen(creds.client->realm), creds.client->realm,
 	    "krbtgt", creds.client->realm, NULL);
+#else
+	problem = krb5_build_principal(context, &creds.server,
+	    creds.client->realm.length, creds.client->realm.data,
+	    "host", remotehost, NULL);
+#endif
 	if (problem)
 		goto out;
 
 	creds.times.endtime = 0;
 
+#ifdef HEIMDAL
 	flags.i = 0;
 	flags.b.forwarded = 1;
 	flags.b.forwardable = krb5_config_get_bool(context,  NULL,
 	    "libdefaults", "forwardable", NULL);
-
-	remotehost = get_canonical_hostname(1);
-
 	problem = krb5_get_forwarded_creds(context, auth_context,
 	    ccache, flags.i, remotehost, &creds, &outbuf);
+#else
+	forwardable = 1;
+	problem = krb5_fwd_tgt_creds(context, auth_context, remotehost,
+	    creds.client, creds.server, ccache, forwardable, &outbuf);
+#endif
+
 	if (problem)
 		goto out;
 
@@ -899,6 +956,438 @@
 	return 0;
 }
 
+#ifdef GSSAPI
+/*
+ * This code stolen from the gss-client.c sample program from MIT's
+ * kerberos 5 distribution.
+ */
+
+gss_cred_id_t gss_cred = GSS_C_NO_CREDENTIAL;
+
+static void display_status_1(m, code, type)
+ char *m;
+ OM_uint32 code;
+ int type;
+{
+  OM_uint32 maj_stat, min_stat;
+  gss_buffer_desc msg;
+  OM_uint32 msg_ctx;
+
+  msg_ctx = 0;
+  while (1) {
+    maj_stat = gss_display_status(&min_stat, code,
+                                  type, GSS_C_NULL_OID,
+                                  &msg_ctx, &msg);
+    debug("GSS-API error %s: %s", m, (char *)msg.value);
+    (void) gss_release_buffer(&min_stat, &msg);
+
+    if (!msg_ctx)
+      break;
+  }
+}
+
+static void display_gssapi_status(msg, maj_stat, min_stat)
+  char *msg;
+  OM_uint32 maj_stat;
+  OM_uint32 min_stat;
+{
+  display_status_1(msg, maj_stat, GSS_C_GSS_CODE);
+  display_status_1(msg, min_stat, GSS_C_MECH_CODE);
+}
+
+#ifdef GSI
+int get_gssapi_cred()
+{
+  OM_uint32 maj_stat;
+  OM_uint32 min_stat;
+
+
+  debug("calling gss_acquire_cred");
+  maj_stat = gss_acquire_cred(&min_stat,
+                              GSS_C_NO_NAME,
+                              GSS_C_INDEFINITE,
+                              GSS_C_NO_OID_SET,
+                              GSS_C_INITIATE,
+                              &gss_cred,
+                              NULL,
+                              NULL);
+
+  if (maj_stat != GSS_S_COMPLETE) {
+    display_gssapi_status("Failuring acquiring GSSAPI credentials",
+                          maj_stat, min_stat);
+    gss_cred = GSS_C_NO_CREDENTIAL; /* should not be needed */
+    return 0;
+  }
+
+  return 1;     /* Success */
+}
+
+char * get_gss_our_name()
+{
+  OM_uint32 maj_stat;
+  OM_uint32 min_stat;
+  gss_name_t pname = GSS_C_NO_NAME;
+  gss_buffer_desc tmpname;
+  gss_buffer_t tmpnamed = &tmpname;
+  char *retname;
+
+  debug("calling gss_inquire_cred");
+  maj_stat = gss_inquire_cred(&min_stat,
+                              gss_cred,
+                              &pname,
+                              NULL,
+                              NULL,
+                              NULL);
+  if (maj_stat != GSS_S_COMPLETE) {
+    return NULL;
+  }
+
+  maj_stat = gss_export_name(&min_stat,
+                             pname,
+                             tmpnamed);
+  if (maj_stat != GSS_S_COMPLETE) {
+    return NULL;
+  }
+  debug("gss_export_name finsished");
+  retname = (char *)malloc(tmpname.length + 1);
+  if (!retname) {
+    return NULL;
+  }
+  memcpy(retname, tmpname.value, tmpname.length);
+  retname[tmpname.length] = '\0';
+
+  gss_release_name(&min_stat, &pname);
+  gss_release_buffer(&min_stat, tmpnamed);
+
+  return retname;
+}
+#endif /* GSI */
+
+int try_gssapi_authentication(char *host, Options *options)
+{
+  char *service_name = NULL;
+  gss_buffer_desc name_tok;
+  gss_buffer_desc send_tok;
+  gss_buffer_desc recv_tok;
+  gss_buffer_desc *token_ptr;
+  gss_name_t target_name = NULL;
+  gss_ctx_id_t gss_context;
+  gss_OID_desc mech_oid;
+  gss_OID name_type;
+  gss_OID_set my_mechs;
+  int my_mech_num;
+  OM_uint32 maj_stat;
+  OM_uint32 min_stat;
+  int ret_stat = 0;                             /* 1 == success */
+  OM_uint32 req_flags = 0;
+  OM_uint32 ret_flags;
+  int type;
+  char *gssapi_auth_type = NULL;
+  struct hostent *hostinfo;
+
+
+  /*
+   * host is not guarenteed to be a FQDN, so we need to make sure it is.
+   */
+  hostinfo = gethostbyname(host);
+
+  if ((hostinfo == NULL) || (hostinfo->h_name == NULL)) {
+      debug("GSSAPI authentication: Unable to get FQDN for \"%s\"", host);
+      goto cleanup;
+  }
+
+  /*
+   * Default flags
+   */
+  req_flags |= GSS_C_REPLAY_FLAG;
+
+  /* Do mutual authentication */
+  req_flags |= GSS_C_MUTUAL_FLAG;
+
+#ifdef KRB5
+
+  gssapi_auth_type = "GSSAPI/Kerberos 5";
+
+#endif
+
+#ifdef GSI
+
+  gssapi_auth_type = "GSSAPI/GLOBUS";
+
+#endif /* GSI */
+
+  if (gssapi_auth_type == NULL) {
+      debug("No GSSAPI type defined during compile");
+      goto cleanup;
+  }
+
+  debug("Attempting %s authentication", gssapi_auth_type);
+
+  service_name = (char *) malloc(strlen("host") +
+                                 strlen(hostinfo->h_name) +
+                                 2 /* 1 for '@', 1 for NUL */);
+
+  if (service_name == NULL) {
+    debug("malloc() failed");
+    goto cleanup;
+  }
+
+
+  sprintf(service_name, "host@%s", hostinfo->h_name);
+
+  name_type = GSS_C_NT_HOSTBASED_SERVICE;
+
+  debug("Service name is %s", service_name);
+
+  /* Forward credentials? */
+
+#ifdef KRB5
+  if (options->kerberos_tgt_passing) {
+      debug("Forwarding Kerberos credentials");
+      req_flags |= GSS_C_DELEG_FLAG;
+  }
+#endif /* KRB5 */
+
+#ifdef GSSAPI
+  if(options->gss_deleg_creds) {
+    debug("Forwarding X509 proxy certificate");
+    req_flags |= GSS_C_DELEG_FLAG;
+  }
+#ifdef GSS_C_GLOBUS_LIMITED_DELEG_PROXY_FLAG
+  /* Forward limited credentials, overrides gss_deleg_creds */
+  if(options->gss_globus_deleg_limited_proxy) {
+    debug("Forwarding limited X509 proxy certificate");
+    req_flags |= (GSS_C_DELEG_FLAG | GSS_C_GLOBUS_LIMITED_DELEG_PROXY_FLAG);
+  }
+#endif /* GSS_C_GLOBUS_LIMITED_DELEG_PROXY_FLAG */
+
+#endif /* GSSAPI */
+
+  debug("req_flags = %lu", req_flags);
+
+  name_tok.value = service_name;
+  name_tok.length = strlen(service_name) + 1;
+  maj_stat = gss_import_name(&min_stat, &name_tok,
+                             name_type, &target_name);
+
+  free(service_name);
+  service_name = NULL;
+
+  if (maj_stat != GSS_S_COMPLETE) {
+    display_gssapi_status("importing service name", maj_stat, min_stat);
+    goto cleanup;
+  }
+
+  maj_stat = gss_indicate_mechs(&min_stat, &my_mechs);
+
+  if (maj_stat != GSS_S_COMPLETE) {
+    display_gssapi_status("indicating mechs", maj_stat, min_stat);
+    goto cleanup;
+  }
+
+  /*
+   * Send over a packet to the daemon, letting it know we're doing
+   * GSSAPI and our mech_oid(s).
+   */
+  debug("Sending mech oid to server");
+  packet_start(SSH_CMSG_AUTH_GSSAPI);
+  packet_put_int(my_mechs->count); /* Number of mechs we're sending */
+  for (my_mech_num = 0; my_mech_num < my_mechs->count; my_mech_num++)
+      packet_put_string(my_mechs->elements[my_mech_num].elements,
+                        my_mechs->elements[my_mech_num].length);
+  packet_send();
+  packet_write_wait();
+
+  /*
+   * Get reply from the daemon to see if our mech was acceptable
+   */
+  type = packet_read();
+
+  switch (type) {
+  case SSH_SMSG_AUTH_GSSAPI_RESPONSE:
+      debug("Server accepted mechanism");
+      /* Successful negotiation */
+      break;
+
+  case SSH_MSG_AUTH_GSSAPI_ABORT:
+      debug("Unable to negotiate GSSAPI mechanism type with server");
+      packet_get_all();
+      goto cleanup;
+
+  default:
+      packet_disconnect("Protocol error during GSSAPI authentication:"
+                        " packet type %d received",
+                        type);
+      /* Does not return */
+  }
+
+  /* Read the mechanism the server returned */
+  mech_oid.elements = packet_get_string((unsigned int *) &(mech_oid.length));
+  packet_get_all();
+
+  /*
+   * Perform the context-establishement loop.
+   *
+   * On each pass through the loop, token_ptr points to the token
+   * to send to the server (or GSS_C_NO_BUFFER on the first pass).
+   * Every generated token is stored in send_tok which is then
+   * transmitted to the server; every received token is stored in
+   * recv_tok, which token_ptr is then set to, to be processed by
+   * the next call to gss_init_sec_context.
+   *
+   * GSS-API guarantees that send_tok's length will be non-zero
+   * if and only if the server is expecting another token from us,
+   * and that gss_init_sec_context returns GSS_S_CONTINUE_NEEDED if
+   * and only if the server has another token to send us.
+   */
+
+  token_ptr = GSS_C_NO_BUFFER;
+  gss_context = GSS_C_NO_CONTEXT;
+
+  do {
+    maj_stat =
+      gss_init_sec_context(&min_stat,
+                           gss_cred,
+                           &gss_context,
+                           target_name,
+                           &mech_oid,
+                           req_flags,
+                           0,
+                           NULL,        /* no channel bindings */
+                           token_ptr,
+                           NULL,        /* ignore mech type */
+                           &send_tok,
+                           &ret_flags,
+                           NULL);       /* ignore time_rec */
+
+    if (token_ptr != GSS_C_NO_BUFFER)
+      (void) gss_release_buffer(&min_stat, &recv_tok);
+
+    if (maj_stat != GSS_S_COMPLETE && maj_stat != GSS_S_CONTINUE_NEEDED) {
+      display_gssapi_status("initializing context", maj_stat, min_stat);
+
+      /* Send an abort message */
+      packet_start(SSH_MSG_AUTH_GSSAPI_ABORT);
+      packet_send();
+      packet_write_wait();
+
+      goto cleanup;
+    }
+
+    if (send_tok.length != 0) {
+      debug("Sending authenticaton token...");
+      packet_start(SSH_MSG_AUTH_GSSAPI_TOKEN);
+      packet_put_string((char *) send_tok.value, send_tok.length);
+      packet_send();
+      packet_write_wait();
+
+      (void) gss_release_buffer(&min_stat, &send_tok);
+    }
+
+    if (maj_stat == GSS_S_CONTINUE_NEEDED) {
+
+      debug("Continue needed. Reading response...");
+
+      type = packet_read();
+
+      switch(type) {
+
+      case SSH_MSG_AUTH_GSSAPI_TOKEN:
+        /* This is what we expected */
+        break;
+
+      case SSH_MSG_AUTH_GSSAPI_ABORT:
+        debug("Server aborted GSSAPI authentication.");
+        packet_get_all();
+        goto cleanup;
+
+      default:
+        packet_disconnect("Protocol error during GSSAPI authentication:"
+                          " packet type %d received",
+                          type);
+        /* Does not return */
+      }
+
+      recv_tok.value = packet_get_string((unsigned int *) &recv_tok.length);
+      packet_get_all();
+      token_ptr = &recv_tok;
+    }
+  } while (maj_stat == GSS_S_CONTINUE_NEEDED);
+
+  /* Success */
+  ret_stat = 1;
+
+  debug("%s authentication successful", gssapi_auth_type);
+
+  /*
+   * Read hash of host and server keys and make sure it
+   * matches what we got earlier.
+   */
+  debug("Reading hash of server and host keys...");
+  type = packet_read();
+
+  if (type == SSH_MSG_AUTH_GSSAPI_ABORT) {
+    debug("Server aborted GSSAPI authentication.");
+    packet_get_all();
+    ret_stat = 0;
+    goto cleanup;
+
+  } else if (type == SSH_SMSG_AUTH_GSSAPI_HASH) {
+    gss_buffer_desc wrapped_buf;
+    gss_buffer_desc unwrapped_buf;
+    int conf_state;
+    gss_qop_t qop_state;
+
+
+    wrapped_buf.value = packet_get_string(&(wrapped_buf.length));
+    packet_get_all();
+
+    maj_stat = gss_unwrap(&min_stat,
+                          gss_context,
+                          &wrapped_buf,
+                          &unwrapped_buf,
+                          &conf_state,
+                          &qop_state);
+
+    if (maj_stat != GSS_S_COMPLETE) {
+      display_gssapi_status("unwraping SSHD key hash",
+                            maj_stat, min_stat);
+      packet_disconnect("Verification of SSHD keys through GSSAPI-secured channel failed: "
+                        "Unwrapping of hash failed.");
+    }
+
+    if (unwrapped_buf.length != sizeof(ssh_key_digest)) {
+      packet_disconnect("Verification of SSHD keys through GSSAPI-secured channel failed: "
+                        "Size of key hashes do not match (%d != %d)!",
+                        unwrapped_buf.length, sizeof(ssh_key_digest));
+    }
+
+    if (memcmp(ssh_key_digest, unwrapped_buf.value, sizeof(ssh_key_digest)) != 0) {
+      packet_disconnect("Verification of SSHD keys through GSSAPI-secured channel failed: "
+                        "Hashes don't match!");
+    }
+
+    debug("Verified SSHD keys through GSSAPI-secured channel.");
+
+    gss_release_buffer(&min_stat, &unwrapped_buf);
+
+  } else {
+      packet_disconnect("Protocol error during GSSAPI authentication:"
+                        "packet type %d received", type);
+      /* Does not return */
+  }
+
+
+ cleanup:
+  if (target_name != NULL)
+      (void) gss_release_name(&min_stat, &target_name);
+
+  return ret_stat;
+}
+
+#endif /* GSSAPI */
+
+
 /*
  * SSH1 key exchange
  */
@@ -950,6 +1439,45 @@
 		log("Warning: This may be due to an old implementation of ssh.");
 	}
 
+#ifdef GSSAPI
+  {
+    MD5_CTX md5context;
+    Buffer buf;
+    unsigned char *data;
+    unsigned int data_len;
+
+    /*
+     * Hash the server and host keys. Later we will check them against
+     * a hash sent over a secure channel to make sure they are legit.
+     */
+    debug("Calculating MD5 hash of server and host keys...");
+
+    /* Write all the keys to a temporary buffer */
+    buffer_init(&buf);
+
+    /* Server key */
+    buffer_put_bignum(&buf, server_key->rsa->e);
+    buffer_put_bignum(&buf, server_key->rsa->n);
+
+    /* Host key */
+    buffer_put_bignum(&buf, host_key->rsa->e);
+    buffer_put_bignum(&buf, host_key->rsa->n);
+
+    /* Get the resulting data */
+    data = (unsigned char *) buffer_ptr(&buf);
+    data_len = buffer_len(&buf);
+
+    /* And hash it */
+    MD5_Init(&md5context);
+    MD5_Update(&md5context, data, data_len);
+    MD5_Final(ssh_key_digest, &md5context);
+
+    /* Clean up */
+    buffer_clear(&buf);
+    buffer_free(&buf);
+  }
+#endif /* GSSAPI */
+
 	/* Get protocol flags. */
 	server_flags = packet_get_int();
 	packet_set_protocol_flags(server_flags);
@@ -1092,6 +1620,12 @@
 ssh_userauth1(const char *local_user, const char *server_user, char *host,
     Key **keys, int nkeys)
 {
+#ifdef GSSAPI
+#ifdef GSI
+  	const char *save_server_user = NULL;
+#endif /* GSI */
+#endif /* GSSAPI */
+
 #ifdef KRB5
 	krb5_context context = NULL;
 	krb5_auth_context auth_context = NULL;
@@ -1101,12 +1635,67 @@
 	if (supported_authentications == 0)
 		fatal("ssh_userauth1: server supports no auth methods");
 
+#ifdef GSSAPI
+#ifdef GSI
+  /* if no user given, tack on the subject name after the server_user.
+   * This will allow us to run gridmap early to get real user
+   * This name will start with /C=
+   */
+  if ((supported_authentications & (1 << SSH_AUTH_GSSAPI)) &&
+      options.gss_authentication) {
+    if (get_gssapi_cred()) {
+      char * retname;
+      char * newname;
+
+
+      save_server_user = server_user;
+
+      retname = get_gss_our_name();
+
+      if (retname) {
+        debug("passing gssapi name '%s'", retname);
+        if (server_user) {
+          newname = (char *) malloc(strlen(retname) + strlen(server_user) + 4);
+          if (newname) {
+            strcpy(newname, server_user);
+            if(options.user == NULL)
+              {
+                strcat(newname,":i:");
+              }
+            else
+              {
+                strcat(newname,":x:");
+              }
+            strcat(newname, retname);
+            server_user = newname;
+            free(retname);
+          }
+        }
+      }
+    } else {
+      /*
+       * If we couldn't successfully get our GSSAPI credentials then
+       * turn off gssapi authentication
+       */
+      options.gss_authentication = 0;
+    }
+    debug("server_user %s", server_user);
+  }
+#endif /* GSI */
+#endif /* GSSAPI */
+
 	/* Send the name of the user to log in as on the server. */
 	packet_start(SSH_CMSG_USER);
 	packet_put_cstring(server_user);
 	packet_send();
 	packet_write_wait();
 
+#if defined(GSI)
+  if(save_server_user)
+    {
+      server_user = save_server_user;
+    }
+#endif
 	/*
 	 * The server should respond with success if no authentication is
 	 * needed (the user has no password).  Otherwise the server responds
@@ -1120,6 +1709,31 @@
 	if (type != SSH_SMSG_FAILURE)
 		packet_disconnect("Protocol error: got %d in response to SSH_CMSG_USER", type);
 
+#ifdef GSSAPI
+  /* Try GSSAPI authentication */
+  if ((supported_authentications & (1 << SSH_AUTH_GSSAPI)) &&
+      options.gss_authentication)
+    {
+      debug("Trying GSSAPI authentication...");
+      try_gssapi_authentication(host, &options);
+
+      /*
+       * XXX Hmmm. Kerberos authentication only reads a packet if it thinks
+       * the authentication went OK, but the server seems to always send
+       * a packet back. So I'm not sure if I'm missing something or
+       * the Kerberos code is broken. - vwelch 1/27/99
+       */
+
+      type = packet_read();
+      if (type == SSH_SMSG_SUCCESS)
+        return; /* Successful connection. */
+      if (type != SSH_SMSG_FAILURE)
+        packet_disconnect("Protocol error: got %d in response to Kerberos auth", type);
+
+      debug("GSSAPI authentication failed");
+    }
+#endif /* GSSAPI */
+	
 #ifdef KRB5
 	if ((supported_authentications & (1 << SSH_AUTH_KERBEROS)) &&
 	    options.kerberos_authentication) {
diff -Naur openssh-3.1p1/sshconnect2.c openssh-3.1p1-gsi/sshconnect2.c
--- openssh-3.1p1/sshconnect2.c	Tue Feb 26 12:15:10 2002
+++ openssh-3.1p1-gsi/sshconnect2.c	Thu Apr  4 17:03:45 2002
@@ -46,6 +46,10 @@
 #include "dispatch.h"
 #include "canohost.h"
 
+#ifdef GSSAPI
+#include "ssh-gss.h"
+#endif
+
 /* import */
 extern char *client_version_string;
 extern char *server_version_string;
@@ -75,10 +79,26 @@
 ssh_kex2(char *host, struct sockaddr *hostaddr)
 {
 	Kex *kex;
+#ifdef GSSAPI
+	char *orig, *gss;
+	int len;
+#endif
 
 	xxx_host = host;
 	xxx_hostaddr = hostaddr;
 
+#ifdef GSSAPI
+	/* Add the GSSAPI mechanisms currently supported on this client to
+	 * the key exchange algorithm proposal */
+	orig = myproposal[PROPOSAL_KEX_ALGS];
+	gss = ssh_gssapi_mechanisms(0,host);
+	if (gss) {
+	   len = strlen(orig)+strlen(gss)+2;
+	   myproposal[PROPOSAL_KEX_ALGS]=xmalloc(len);
+	   snprintf(myproposal[PROPOSAL_KEX_ALGS],len,"%s,%s",gss,orig);
+	}
+#endif
+
 	if (options.ciphers == (char *)-1) {
 		log("No valid ciphers for protocol version 2 given, using defaults.");
 		options.ciphers = NULL;
@@ -106,11 +126,27 @@
 		myproposal[PROPOSAL_SERVER_HOST_KEY_ALGS] =
 		    options.hostkeyalgorithms;
 
+#ifdef GSSAPI
+        /* If we've got GSSAPI algorithms, then we also support the
+         * 'null' hostkey, as a last resort */
+	if (gss) {
+		orig=myproposal[PROPOSAL_SERVER_HOST_KEY_ALGS];
+		len = strlen(orig)+sizeof(",null");
+		myproposal[PROPOSAL_SERVER_HOST_KEY_ALGS]=xmalloc(len);
+		snprintf(myproposal[PROPOSAL_SERVER_HOST_KEY_ALGS],len,"%s,null",orig);  
+	}
+#endif
+
 	/* start key exchange */
 	kex = kex_setup(myproposal);
 	kex->client_version_string=client_version_string;
 	kex->server_version_string=server_version_string;
 	kex->verify_host_key=&verify_host_key_callback;
+	kex->host=host;
+
+#ifdef GSSAPI
+	kex->options.gss_deleg_creds=options.gss_deleg_creds;
+#endif
 
 	xxx_kex = kex;
 
@@ -158,6 +194,8 @@
 	int nkeys;
 	/* kbd-interactive */
 	int info_req_seen;
+	/* generic */
+	void *methoddata;
 };
 struct Authmethod {
 	char	*name;		/* string to compare against server's list */
@@ -179,6 +217,14 @@
 int	userauth_kbdint(Authctxt *);
 int	userauth_hostbased(Authctxt *);
 
+#ifdef GSSAPI
+int	userauth_external(Authctxt *authctxt);
+int	userauth_gssapi(Authctxt *authctxt);
+void	input_gssapi_response(int type, u_int32_t plen, void *ctxt);
+void	input_gssapi_token(int type, u_int32_t plen, void *ctxt);
+void	input_gssapi_hash(int type, u_int32_t plen, void *ctxt);
+#endif
+
 void	userauth(Authctxt *, char *);
 
 static int sign_and_send_pubkey(Authctxt *, Key *, sign_cb_fn *);
@@ -189,6 +235,16 @@
 static char *authmethods_get(void);
 
 Authmethod authmethods[] = {
+#ifdef GSSAPI
+	{"external-keyx",
+		userauth_external,
+		&options.gss_authentication,
+		NULL},
+	{"gssapi",
+		userauth_gssapi,
+		&options.gss_authentication,
+		NULL},
+#endif
 	{"hostbased",
 		userauth_hostbased,
 		&options.hostbased_authentication,
@@ -254,6 +310,7 @@
 	authctxt.success = 0;
 	authctxt.method = authmethod_lookup("none");
 	authctxt.authlist = NULL;
+	authctxt.methoddata = NULL;
 	authctxt.keys = keys;
 	authctxt.nkeys = nkeys;
 	authctxt.info_req_seen = 0;
@@ -277,6 +334,11 @@
 void
 userauth(Authctxt *authctxt, char *authlist)
 {
+	if (authctxt->methoddata!=NULL) {
+		xfree(authctxt->methoddata);
+		authctxt->methoddata=NULL;
+	}
+           
 	if (authlist == NULL) {
 		authlist = authctxt->authlist;
 	} else {
@@ -323,6 +385,8 @@
 		fatal("input_userauth_success: no authentication context");
 	if (authctxt->authlist)
 		xfree(authctxt->authlist);
+	if (authctxt->methoddata)
+		xfree(authctxt->methoddata);
 	clear_auth_state(authctxt);
 	authctxt->success = 1;			/* break out */
 }
@@ -423,6 +487,153 @@
 
 }
 
+#ifdef GSSAPI
+int 
+userauth_gssapi(Authctxt *authctxt)
+{
+	int i;
+	Gssctxt *gssctxt;
+	static int tries=0;
+
+	/* For now, we only make one attempt at this. We could try offering
+	 * the server different GSSAPI OIDs until we get bored, I suppose.
+	 */	
+	if (tries++>0) return 0;
+
+	if (datafellows & SSH_OLD_GSSAPI) return 0;
+	
+        gssctxt=xmalloc(sizeof(Gssctxt));
+
+	/* Initialise as much of our context as we can, so failures can be
+	 * trapped before sending any packets.
+	 */
+	ssh_gssapi_build_ctx(gssctxt);
+	if (ssh_gssapi_import_name(gssctxt,authctxt->host)) {
+		return(0);
+	}
+	authctxt->methoddata=(void *)gssctxt;
+		
+	packet_start(SSH2_MSG_USERAUTH_REQUEST);
+	packet_put_cstring(authctxt->server_user);
+	packet_put_cstring(authctxt->service);
+        packet_put_cstring(authctxt->method->name);
+
+	/* FIXME: This assumes that our current GSSAPI implementation
+	 * supports all of the mechanisms listed in supported_mechs.
+	 * This may not be the case - we should use something along
+	 * the lines of the code in gss_genr to remove the ones that
+	 * aren't supported */
+	packet_put_int(GSS_LAST_ENTRY);
+	for (i=0;i<GSS_LAST_ENTRY;i++) {
+		packet_put_string(supported_mechs[i].oid.elements,
+			  	  supported_mechs[i].oid.length);
+	}
+        packet_send();
+        packet_write_wait();
+
+        dispatch_set(SSH2_MSG_USERAUTH_GSSAPI_RESPONSE,&input_gssapi_response);
+        dispatch_set(SSH2_MSG_USERAUTH_GSSAPI_TOKEN,&input_gssapi_token);
+	
+        return 1;
+}
+
+void
+input_gssapi_response(int type, u_int32_t plen, void *ctxt) 
+{
+	Authctxt *authctxt = ctxt;
+	Gssctxt *gssctxt;
+	OM_uint32 status,ms;
+	int oidlen;
+	char *oidv;
+	gss_buffer_desc send_tok;
+	
+	if (authctxt == NULL)
+		fatal("input_gssapi_response: no authentication context");
+	gssctxt = authctxt->methoddata;
+	
+	/* Setup our OID */
+	oidv=packet_get_string(&oidlen);
+	ssh_gssapi_set_oid_data(gssctxt,oidv,oidlen);
+	
+	packet_check_eom();
+	
+	status = ssh_gssapi_init_ctx(gssctxt, options.gss_deleg_creds,
+				     GSS_C_NO_BUFFER, &send_tok, 
+				     NULL);
+	if (GSS_ERROR(status)) {
+		/* Start again with next method on list */
+		debug("Trying to start again");
+		userauth(authctxt,NULL);
+		return;
+	}
+
+	/* We must have data to send */					
+	packet_start(SSH2_MSG_USERAUTH_GSSAPI_TOKEN);
+	packet_put_string(send_tok.value,send_tok.length);
+	packet_send();
+	packet_write_wait();
+	gss_release_buffer(&ms, &send_tok);
+}
+
+void
+input_gssapi_token(int type, u_int32_t plen, void *ctxt)
+{
+	Authctxt *authctxt = ctxt;
+	Gssctxt *gssctxt;
+	gss_buffer_desc send_tok,recv_tok;
+	OM_uint32 status;
+	
+	if (authctxt == NULL)
+		fatal("input_gssapi_response: no authentication context");
+	gssctxt = authctxt->methoddata;
+	
+	recv_tok.value=packet_get_string(&recv_tok.length);
+
+	status=ssh_gssapi_init_ctx(gssctxt, options.gss_deleg_creds,
+				   &recv_tok, &send_tok, NULL);
+
+	packet_check_eom();
+	
+	if (GSS_ERROR(status)) {
+		/* Start again with the next method in the list */
+		userauth(authctxt,NULL);
+		return;
+	}
+	
+	if (send_tok.length>0) {
+		packet_start(SSH2_MSG_USERAUTH_GSSAPI_TOKEN);
+		packet_put_string(send_tok.value,send_tok.length);
+		packet_send();
+		packet_write_wait();
+	}
+	
+	if (status == GSS_S_COMPLETE) {
+		/* If that succeeded, send a exchange complete message */
+		packet_start(SSH2_MSG_USERAUTH_GSSAPI_EXCHANGE_COMPLETE);
+		packet_send();
+		packet_write_wait();
+	}
+}
+
+int
+userauth_external(Authctxt *authctxt)
+{
+        static int attempt =0;
+        
+        if (attempt++ >= 1)
+        	return 0;
+                                
+        debug2("userauth_external");
+        packet_start(SSH2_MSG_USERAUTH_REQUEST);
+        packet_put_cstring(authctxt->server_user);
+        packet_put_cstring(authctxt->service);
+        packet_put_cstring(authctxt->method->name);
+        packet_send();
+        packet_write_wait();
+        return 1;
+}                                                                                                
+#endif /* GSSAPI */
+
 int
 userauth_none(Authctxt *authctxt)
 {
@@ -433,6 +644,7 @@
 	packet_put_cstring(authctxt->method->name);
 	packet_send();
 	return 1;
+
 }
 
 int
diff -Naur openssh-3.1p1/sshd.8 openssh-3.1p1-gsi/sshd.8
--- openssh-3.1p1/sshd.8	Mon Mar  4 19:38:59 2002
+++ openssh-3.1p1-gsi/sshd.8	Thu Apr  4 17:03:45 2002
@@ -492,6 +492,25 @@
 and applies to protocol version 2 only.
 The default is
 .Dq no .
+.It Cm GssapiAuthentication
+Specifies whether authentication based on GSSAPI may be used, either using
+the result of a successful key exchange, or using GSSAPI user
+authentication.
+The default is 
+.Dq yes .
+Note that this option applies to protocol version 2 only.
+.It Cm GssapiKeyExchange
+Specifies whether key exchange based on GSSAPI may be used. When using
+GSSAPI key exchange the server need not have a host key.
+The default is
+.Dq yes .
+Note that this option applies to protocol version 2 only.
+.It Cm GssapiUseSessionCredCache
+Specifies whether a unique credentials cache name should be generated per
+session for storing delegated credentials.
+The default is
+.Dq yes .
+Note that this option applies to protocol version 2 only.
 .It Cm HostKey
 Specifies a file containing a private host key
 used by SSH.
diff -Naur openssh-3.1p1/sshd.c openssh-3.1p1-gsi/sshd.c
--- openssh-3.1p1/sshd.c	Mon Mar  4 19:31:30 2002
+++ openssh-3.1p1-gsi/sshd.c	Thu Apr  4 17:03:45 2002
@@ -73,6 +73,15 @@
 #include "dispatch.h"
 #include "channels.h"
 
+#ifdef GSSAPI
+#include "ssh-gss.h"
+#endif
+
+#ifdef GSSAPI
+#include <openssl/md5.h>
+#include "bufaux.h"
+#endif /* GSSAPI */
+
 #ifdef LIBWRAP
 #include <tcpd.h>
 #include <syslog.h>
@@ -773,10 +782,13 @@
 		log("Disabling protocol version 1. Could not load host key");
 		options.protocol &= ~SSH_PROTO_1;
 	}
+#ifndef GSSAPI
+	/* The GSSAPI key exchange can run without a host key */
 	if ((options.protocol & SSH_PROTO_2) && !sensitive_data.have_ssh2_key) {
 		log("Disabling protocol version 2. Could not load host key");
 		options.protocol &= ~SSH_PROTO_2;
 	}
+#endif
 	if (!(options.protocol & (SSH_PROTO_1|SSH_PROTO_2))) {
 		log("sshd: no hostkeys available -- exiting.");
 		exit(1);
@@ -809,6 +821,10 @@
 	if (test_flag)
 		exit(0);
 
+#ifdef GSSAPI
+	ssh_gssapi_clean_env();
+#endif /* GSSAPI */
+
 #ifdef HAVE_SCO_PROTECTED_PW
 	(void) set_auth_parameters(ac, av);
 #endif
@@ -1328,6 +1344,12 @@
 #endif
 	if (options.challenge_response_authentication == 1)
 		auth_mask |= 1 << SSH_AUTH_TIS;
+
+#ifdef GSSAPI
+  	if (options.gss_authentication)
+    		auth_mask |= 1 << SSH_AUTH_GSSAPI;
+#endif
+
 	if (options.password_authentication)
 		auth_mask |= 1 << SSH_AUTH_PASSWORD;
 	packet_put_int(auth_mask);
@@ -1453,6 +1475,49 @@
 		for (i = 0; i < 16; i++)
 			session_id[i] = session_key[i] ^ session_key[i + 16];
 	}
+
+#ifdef GSSAPI
+  /*
+   * Before we destroy the host and server keys, hash them so we can
+   * send the hash over to the client via a secure channel so that it
+   * can verify them.
+   */
+  {
+    MD5_CTX md5context;
+    Buffer buf;
+    unsigned char *data;
+    unsigned int data_len;
+    extern unsigned char ssh1_key_digest[];      /* in gss-serv.c */
+
+
+    debug("Calculating MD5 hash of server and host keys...");
+
+    /* Write all the keys to a temporary buffer */
+    buffer_init(&buf);
+
+    /* Server key */
+    buffer_put_bignum(&buf, sensitive_data.server_key->rsa->e);
+    buffer_put_bignum(&buf, sensitive_data.server_key->rsa->n);
+
+    /* Host key */
+    buffer_put_bignum(&buf, sensitive_data.ssh1_host_key->rsa->e);
+    buffer_put_bignum(&buf, sensitive_data.ssh1_host_key->rsa->n);
+
+    /* Get the resulting data */
+    data = (unsigned char *) buffer_ptr(&buf);
+    data_len = buffer_len(&buf);
+
+    /* And hash it */
+    MD5_Init(&md5context);
+    MD5_Update(&md5context, data, data_len);
+    MD5_Final(ssh1_key_digest, &md5context);
+
+    /* Clean up */
+    buffer_clear(&buf);
+    buffer_free(&buf);
+  }
+#endif /* GSSAPI */
+
 	/* Destroy the private and public keys.  They will no longer be needed. */
 	destroy_sensitive_data();
 
@@ -1495,6 +1560,45 @@
 		myproposal[PROPOSAL_MAC_ALGS_STOC] = options.macs;
 	}
 	myproposal[PROPOSAL_SERVER_HOST_KEY_ALGS] = list_hostkey_types();
+
+#ifdef GSSAPI
+	{ 
+	char *orig;
+	char *gss = NULL;
+	char *newstr = NULL;
+       	orig = myproposal[PROPOSAL_KEX_ALGS];
+
+	/* If we don't have a host key, then all of the algorithms
+	 * currently in myproposal are useless */
+	if (strlen(myproposal[PROPOSAL_SERVER_HOST_KEY_ALGS])==0)
+		orig= NULL;
+		
+        if (options.gss_keyex)
+        	gss = ssh_gssapi_mechanisms(1,NULL);
+        else
+        	gss = NULL;
+        
+	if (gss && orig) {
+		int len = strlen(orig) + strlen(gss) +2;
+		newstr=xmalloc(len);
+		snprintf(newstr,len,"%s,%s",gss,orig);
+	} else if (gss) {
+		newstr=gss;
+	} else if (orig) {
+		newstr=orig;
+	}
+        /* If we've got GSSAPI mechanisms, then we've also got the 'null'
+	   host key algorithm, but we're not allowed to advertise it, unless
+	   its the only host key algorithm we're supporting */
+	if (gss && (strlen(myproposal[PROPOSAL_SERVER_HOST_KEY_ALGS])) == 0) {
+	  	myproposal[PROPOSAL_SERVER_HOST_KEY_ALGS]="null";
+	}
+	if (newstr)
+		myproposal[PROPOSAL_KEX_ALGS]=newstr;
+	else
+		fatal("No supported key exchange algorithms");
+        }
+#endif
 
 	/* start key exchange */
 	kex = kex_setup(myproposal);
