about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorThomas E. Dickey <dickey@invisible-island.net>1997-12-18 17:31:01 -0500
committerThomas E. Dickey <dickey@invisible-island.net>1997-12-18 17:31:01 -0500
commitb6c832d07f5a1c68607a9cff0da25cee0de89dad (patch)
tree46428c4ecb61ce53eccb5b9c367a917e9e6dba9d
parent97d3287af85e3890f03d2a48474de0d1a431b676 (diff)
downloadlynx-snapshots-b6c832d07f5a1c68607a9cff0da25cee0de89dad.tar.gz
snapshot of project "lynx", label v2-7-1ac_0-102
-rw-r--r--CHANGES.configure269
-rw-r--r--CHANGES.new40
-rw-r--r--README.configure4
-rw-r--r--WWW/Library/Implementation/HTDOS.c4
-rw-r--r--WWW/Library/Implementation/HTFile.c4
-rw-r--r--WWW/Library/Implementation/HTMIME.c8
-rw-r--r--WWW/Library/Implementation/HTTCP.c9
-rw-r--r--WWW/Library/unix/makefile.in7
-rw-r--r--aclocal.m4103
-rw-r--r--config.hin4
-rwxr-xr-xconfigure1080
-rw-r--r--configure.in16
-rw-r--r--lynx.cfg36
-rw-r--r--makefile.in37
-rwxr-xr-xmkdirs.sh1
-rw-r--r--samples/lynx.lss4
-rw-r--r--src/GridText.c8
-rw-r--r--src/LYBookmark.c6
-rw-r--r--src/LYCharUtils.c8
-rw-r--r--src/LYCurses.c43
-rw-r--r--src/LYEdit.c4
-rw-r--r--src/LYGlobalDefs.h4
-rw-r--r--src/LYMain.c22
-rw-r--r--src/LYOptions.c2
-rw-r--r--src/LYPrint.c6
-rw-r--r--src/LYReadCFG.c88
-rw-r--r--src/LYReadCFG.h14
-rw-r--r--src/LYStrings.c35
-rw-r--r--src/LYStyle.c420
-rw-r--r--src/LYrcFile.c22
-rw-r--r--src/UCAux.c4
-rw-r--r--src/chrtrans/MAKEW32.BAT11
-rw-r--r--src/chrtrans/cp850_uni.tbl2
-rw-r--r--src/chrtrans/makefile.dos108
-rw-r--r--src/makefile.in2
-rw-r--r--src/mktime.c42
-rw-r--r--userdefs.h18
37 files changed, 1305 insertions, 1190 deletions
diff --git a/CHANGES.configure b/CHANGES.configure
deleted file mode 100644
index 48473e38..00000000
--- a/CHANGES.configure
+++ /dev/null
@@ -1,269 +0,0 @@
-97-11-23
---------
-* Check for existence of sys/wait.h. - PHDM
-* Do not include sys/stat.h twice. - PHDM
-* New autoconf-macros to check if a function is declared after including a
-  specific set of files. - PHDM
-* Declare strstr if it is not declared by string.h. - PHDM
-* Declare getgrgid and getgrnam if not declared by grp.h. - PHDM
-* Provide strstr and mktime implementations, and use them if needed. - PHDM
-* Always include sys/types.h in HTUtils.h. - PHDM
-* define NO_GROUPS if we do not have getgroups. - PHDM
-* define NEED_REMOVE also if test yields unknown. - PHDM
-* define mode_t if not done by system include files. - PHDM (phdm@macqel.be)
-* change CF_UNION_WAIT to use compile+link rather than compile, to ensure
-  that we pick up the wait-macros rather than an implied function, which
-  should fix configure problems on NeXT for Francisco A. Tomei Torres
-  <fatomei2@mail.unm.edu>. - TD
-* spelling nit from Larry Virden. - TD
-* add osf3.0 to special case compiler options using -g3 in place of
-  -O -g, from Harsh Kumar <harsh@krcl.ernet.in>. - TD
-* remove redundant "-c" option from $(installbin) in makefile.in, reported
-  by Michael Warner <warner@wsu.edu>, for OSF/1 4.0. - TD
-* if configure --srcdir is not used, comment-out rmdir's in "make distclean"
-  rule. - TD
-* modify recent erase/clear change so that it applies only to FANCY_CURSES,
-  since BSD curses does not otherwise clear the screen when restoring after
-  popup. - TD
-* modify change for boxes so this builds with BSD curses, which has no
-  wborder() function. - TD
-* reverse ifdef for NO_SIZECHANGEHACK to USE_SIZECHANGEHACK, which is
-  normally off, since this code did not work with BSD 4.4 curses, SVr4
-  curses, or ncurses 4.1 with xterm. (Will make a configure test if anyone
-  can identify a configuration that works). - TD.
-97-11-12
---------
-* remove options --with-lss-file and --with-cfg-file, since the corresponding
-  files will always be installed under $(libdir), reported by Nelson Henry
-  Eric. - TD
-* modify configure script and makefile templates to permit builds with the
-  --srcdir option, noted by Philippe De Muyter. - TD
-97-11-07
---------
-* add logic to make install-directories as needed. - TD
-* remove --disable-char-trans option (ifdef's still remain). - TD
-* correct type used in first compile-test for union wait. - TD
-* correct order of deletions in "make distclean" rule. - TD
-* new versions of macros used to check for ncurses version. - TD
-* don't suppress -I/usr/local/include when checking -I/usr/local/include/*,
-  to accommodate older versions of gcc. - TD
-97-10-21
---------
-* revised tests for wait/waitpid/union-wait. - TD
-* correct/update handling of default prefix in CF_WITH_PATH macro, used for
-  parsing --with-cfg-file and --with-lss-file options.  - TD
-* add uninstall target to top-level makefile. - TD
-* remove redundant install options from $(INSTALL_DATA). - TD
-* add configure --with-lss-file option.
-* minor cleanup of gcc warnings, ifdefs. - TD
-97-10-08
---------
-* add logic to implement mouse button 2 "previous document" for
-  ncurses configuration. - TD
-* add dependencies on 'lynx' to top-level 'all' and 'install' rules
-  in makefile.in - TD
-* add osf4.0 to special case compiler options using -g3 in place of
-  -O -g, for Heikki Kantola <hezu@iki.fi>. - TD
-* correct some of the uninitialized-variable warnings. - TD
-97-09-19
---------
-* minor ifdef/declaration fixes required to build on IRIX 6.2,
-  SunOS (K&R) and VAX C. - TD
-97-09-17
---------
-* merge symbols 'has_color' and 'lynx_has_color' to simplify ifdef's,
-  and correct a problem building color-style configuration. - TD
-* add configure symbol for ifdef'ing presence of waitpid, which
-  was stopping build on HP-UX. - TD
-* correct the symbol that is defined by CF_SIZECHANGE test, noted
-  by failure to build SCO version after making an include for
-  <sys/ioctl.h> ifdef'd according to configure test. - TD
-* corrected check for broken (pre-1.9.9g) ncurses versions so that
-  they can build with color support. - TD
-* cache state of CF_NETLIBS so that rerunning configure will yield
-  the same results for network libraries. - TD
-* Add configure test for HP-UX -lHcurses library. - TD
-* Minor adjustments to names of configure-script variables, to make
-  them the same as other programs (e.g., tin-unoff). - TD
-97-09-12
---------
-* Correct mismatch/omission of HAVE_TYPE_UNIONWAIT symbol from
-  change for wait vs waitpid. - TD
-97-09-10
---------
-* Modify CF_WITH_PATH to allow substitution of --libdir and other
-  configure options pathnames, e.g., for --with-cfg-file. - TD
-* Include lynx_cfg.h in userdefs.h to resolve redefinition reported by
-  AC. - TD
-* Remove Ultrix/sony_news -specific ifdef's for curses headers,
-  replace with configure-tests. - TD
-* Remove AIX/NeXT/sony_news -specific ifdef's for wait vs waitpid,
-  replace with configure-tests. - TD
-* Add/use CF_HELP_MESSAGE macro to visually break down the very long
-  help message into sections. - TD
-* Move the development options to the beginning of the configure script,
-  to facilitate adjustment of compiler options (especially for Ultrix)
-  to reduce the number of spurious warnings from miscombining -g/-O
-  options. - TD
-* Correct misplaced assignment to cf_cv_ncurses_header in configure.in,
-  which caused misconfigure against vendor curses, reported by Hynek Med
-  (Ultrix) and Roger Hill (HP-UX 10.x). - TD
-97-09-04
---------
-* Correct ifdef'ing for getbkgd function calls. - TD
-* Correct ifdef'ing for remaining inline chmod calls. - TD
-* Consolidate various logic for opening secure files into utility
-  functions, correcting portability problems as well.  - TD
-* Add configure option --with-cfg-file to override default location of
-  Lynx configuration file (requested by Laura Eaves).  - TD
-* Strip -g option from CFLAGS for the non-debug version of Ultrix
-  configuration (requested by Hynek Med).  - TD
-* Add configure test for HP "color" curses (noting that this cannot
-  possibly comply with XPG4 due to naming conventions, we'll expect
-  other problems with it). - TD
-* Add checks to configure test for COLOR_CURSES to work around bug
-  report for HP-UX.  - TD
-* Don't cache configure options except where essential (e.g., the
-  setting of 'screen').  - TD
-* Change some configure options to disable/enable for consistency.  - TD
-1997-08-28
-----------
-* Correct a quoting error in CF_RECHECK_FUNC macro. - TD
-1997-08-27
-----------
-* Further refine/correct configure macros for finding network and curses
-  libraries, adding CF_RECHECK_FUNC to simplify CF_NETLIBS. - TD
-* Rename #define for NCURSESHEADER to HAVE_NCURSES_H, for consistency. - TD
-* Add-back test for -lm to support slang shared libraries. - TD
-* Modify test for disentangling ncurses library from mytinfo on FreeBSD
-  to workaround linker limitation. - AC
-1997-08-20
-----------
-* Modify top-level install rule to depend on 'all'. - TD
-* Suppress check for ANSI compiler when we are using gcc. - TD
-* Use -g3 option in place of -O -g for Ultrix compiler --debug configuration
-  (request by Hynek Med). - TD
-* Drop "-lm" library from slang configuration, since it does not seem to
-  be used. - TD
-* Add configure --includedir and --oldincludedir values to header search
-  path for ncurses and slang. - TD
-* Modify configure checks for ncurses and slang libraries to generate
-  -L options as required, using new macros CF_FIND_LIBRARY and
-  CF_LIBRARY_PATH. - TD
-* Add substitution for CPP in src/makefile.in so that .c.i rule works. - TD
-* Add configure test for lint program. - TD
-* Add "make depend" target to generated makefiles.  This is intended only
-  for use in editing/developing, since many of the header dependencies in
-  chrtrans are generated during the build process and cannot be determined
-  by makedepend in advance. - TD
-* Add configure option --with-zlib. - TD
-1997-08-07
-----------
-* Refine configure tests for acs_map, ttytype to accommodate broken linker
-  on FreeBSD 2.1.5
-* Modify README.configure to indicate the associated definitions for
-  each configure option, as suggested by Klaus Weide. - TD
-* Add -G7 option to Ultrix compiler options (request by Hynek Med
-  <xmedh02@lada.vse.cz>). - TD
-* Add include for <sys/types.h> to utmp configure test (reported by Andrey
-  A. Chernov). - TD
-* Add check for FreeBSD library mytinfo (reported by Andrey A. Chernov
-  <ache@null.net>). - TD
-* Modify ./makefile.in so that 'all', the default target, will build the
-  Lynx executable. The old 'all' target is retained as "make help". - TD
-* Modify src/makefile.in to allow development compiles within the src
-  directory. - TD
-1997-07-27
-----------
-* Rename top-level Makefile to Makefile.old (it's obsolete) - TD
-* Reduce top-level targets to one, 'lynx' - TD
-* Move comments describing DirEd to README.configure from makefile.in,
-  leaving only the definitions that haven't been integrated yet. - TD
-* Add configure options to enable/disable DirEd and its associated modes. - TD
-* Add configure option to enable/disable char-trans support. - TD
-* Correct sense of autoconf'd symbol for size-change. - TD
-* Accommodate systems with obsolete ncurses.h in configure tests. - TD
-1997-07-22
-----------
-* Check for/suppress duplicate -lsocket in network library configure - TD
-* Remove HP-UX snake2/snake3 targets from makefile.in - TD
-* Add configure script case for 'sequent', drop ptx, ptx2 targets from
-  makefile.in - TD
-* Add logic to configure script handling of slang to suppress spurious
-  -Ipredefined when header location is given in $CFLAGS - TD
-1997-07-20
-----------
-* Remove option value from configure option "--with-color-styles". - TD
-* Add configure check for compiler options to enable prototypes - TD
-* Remove IRIX "-cckr" compiler flags. - TD
-1997-04-22
-----------
-* refined check for slang libraries/headers by checking if $CFLAGS has been
-  set so that slang.h is in the search path - TD
-* add check to allow use of broken ncurses 1.9.9e's color - TD
-* add check for NGROUPS, TRUE, FALSE macro definitions - TD
-* remove top-level makefile.in targets that can be combined with the generic
-  target (more work required on the remaining ones) - TD.
-
-1997-04-15
-----------
-* refined logic of SVr4 curses color support to test the no_color_video
-  attribute - TD
-* ifdef'd NCURSES_MOUSE_VERSION logic to allow build with ncurses 1.9.4 - TD
-* ifdef'd wgetbkgd misspelling to allow build with ncurses prior to 1.9.9g - TD
-* document USE_MOUSE configuration-option - TD
-* modify configure script and makefile.in templates to make BSDI_Makefile
-  obsolete - TD
-* rename config.h to lynx_cfg.h to minimize conflict when configuring against
-  ncurses or slang in nonstandard locations - TD
-* new autoconf macro CF_HEADER_PATH is used to make header-search for slang
-  the same as ncurses - TD
-* modify CF_CURSES_LIBS, CF_NCURSES_LIBS and CF_SLANG_LIBS to accommodate
-  predefinition of $LIBS variable - TD
-* corrected autoconf'd compiler flags for Ultrix - TD
-* add config.guess & config.sub to allow specialized host-type checks - TD
-* guard against redefinition of NO_FILIO_H - TD
-* use new autoconf macro CF_SYSTEM_MAIL_FLAGS /jes
-
-1997-04-06
-----------
-* modified LYMain.c, LYMail.c, LYPrint.c, LYReadCFG.c, LYGlobalDefs.h
-  to add SYSTEM_MAIL_FLAGS define and system_mail_flags global
-  variable and remove MMDF from internal code.  /jes
-
-1997-04-02
-----------
-* add Andrew Kuchling's patch to support mouse-clicks with ncurses.
-* refine tests that address porting problems to SCO (detecting struct winsize,
-  workaround for misdefinition of 'remove')
-* refine CF_COLOR_CURSES test to avoid ncurses 1.9.9e bugs.
-* refine CF_PATH_PROG to allow for machines that haven't the given programs,
-  by using only the program name and added configure option
-  --disable-full-paths to enforce this behavior.
-* fixes for some gcc compiler warnings (missing prototypes, unused variables,
-  unintialized variables, shadowed variables, 2-3 places where assignments were
-  not being performed due to syntax errors -- LYHistory.c, LYMail.c).
-* correct cast in HTFWriter.c that may break if atoi() is not prototyped.
-* add top-level makefile target 'maintainer-clean', use this to remove Lynx.prj
-
-1997-03-22
-----------
-* Further reduction of top-level makefile.in by moving definitions out of
-  WWW/Implementation/*/Makefile, so only one is needed for autoconfigured
-  build (i.e., WWW/Implementation/unix/Makefile).  This highlights the
-  remaining differences between the top-level targets - TD
-* Make configure script generate Unix makefiles in subdirectories, a step
-  toward being able to run make from any directory, for development - TD
-* Add autoconf tests for paths of programs, including sendmail vs mmdf - TD
-* Add configure script options for development (--disable-echo, --enable-debug,
-  --enable-find-leaks, --enable-warnings) - TD
-* Allow user to override search path for ncurses header by setting $CFLAGS or
-  $CPPFLAGS - TD
-* Correct array limit in LYCurses.c for SVr4 color support - TD
-* Use addstr rather than printw in popup-forms to address concern about 8-bit
-  characters - TD
-
-1997-3-9
---------
-* Integrated (simple) color, auto-configure patches with 2.7 following
-  chrtrans patch - T.Dickey, J.Spath.
diff --git a/CHANGES.new b/CHANGES.new
index 84d6473d..7f822e5f 100644
--- a/CHANGES.new
+++ b/CHANGES.new
@@ -7,6 +7,46 @@ platforms see also README.win-386, for some changes for auto-configure and
 simple curses color see also README.configure).  Note that the 2.7 -> 2.7.1
 changes are included here. - KW]
 
+1997-12-18 
+* forgotten last } UN-inserted (John Line) - WB
+* few commented messages corrected according to RFC2068 (HTTP1.1)
+  (Leonid Pauzner) - WB
+1997-12-17 (all patches by Leonid Pauzner)
+* open text mode while writing lynx.rc and bookmarks files
+  LYrcFile.c and LYBookmark.c (forgotten last } inserted). - WB
+* add a comment about binary mode in LYMain.c and pile them 
+  in one ifdef - WB
+* few misprinted characters (in comments) corrected in
+  \chrtrans\cp850_uni.tbl - WB
+1997-12-14
+* added a lynx.cfg switch to turn on/off extended dos translations for keys. 
+  -WB
+* added minor DOS tweaks by Doug Kaufman and myself. - WB
+* fixed windos binary mode piping. - WB
+1997-12-13
+* check for and use ncurses default-color extension, use to make the
+  color-style configuration usable on xterm with white background. - TD
+* add cases in LYgetch() for remaining VT220-compatible codes, reported
+  by Michael Ritzert and FM.  - TD
+* add configure test to see if slang can be linked without curses or
+  termcap libraries, request by John Davis. - TD
+* set umask in mkdirs.sh script to work around users who have set root's
+  umask to 077. - TD
+* split up install rule to install-bin, install-cfg, install-man and
+  install-help. - TD
+* suppress suffixes in top-level makefile so 'make' won't try to create
+  a file named "install" from install.sh - TD 
+* make $(CPPFLAGS) inherit consistently from top-level makefile. - TD
+* add configure option --enable-externs, to turn on USE_EXTERNS. - TD
+* use explicit comparison for enum values, fix compile problem with VAX C
+  for UCAux functions (reported by Brian Tillman). - TD
+1997-12-03
+* Remove CHANGES.configure, since it is redundant. - TD
+* Make -g3 option check for OSF/1 3.2 consistent with -Olimit check. - TD
+* Use 'result' rather than 'time' in mktime.c to avoid shadowing. - TD
+* Use wborder only if configure finds it, not ifdef FANCY_CURSES. - PHDM
+* List of systems having strerror replaced by configure test. - PHDM
+* Beautifying of mktime.c (`now' was misleading). - PHDM
 1997-11-23
 * integrate PHDM's patch. - TD
 * Check for existence of sys/wait.h. - PHDM
diff --git a/README.configure b/README.configure
index af7f851c..3d1c8892 100644
--- a/README.configure
+++ b/README.configure
@@ -143,6 +143,10 @@ the script:
   	Use this option to compile-in support for debugging.
 	(The symbol DEBUG is always defined).
 
+  --enable-externs			(define USE_EXTERNS)
+  	Use this option to compile-in support for passing URLs to external
+	programs.
+
   --enable-find-leaks			(defines LY_FIND_LEAKS)
   	Use this option to compile-in logic for testing memory leaks.
 
diff --git a/WWW/Library/Implementation/HTDOS.c b/WWW/Library/Implementation/HTDOS.c
index 1e67a1a0..05e56194 100644
--- a/WWW/Library/Implementation/HTDOS.c
+++ b/WWW/Library/Implementation/HTDOS.c
@@ -68,10 +68,10 @@ char * HTDOS_name(char *dosname)	{
 		}
 	}
 
-//	if(strlen(cp_url) < 4) cp_url[] = ':';
+/*	if(strlen(cp_url) < 4) cp_url[] = ':';
 	if(strlen(cp_url) == 3) cp_url[3] = '\\';
 
-	if(strlen(cp_url) == 4) cp_url[4] = '.';
+	if(strlen(cp_url) == 4) cp_url[4] = '.'; */
 
 	if((strlen(cp_url) > 2) && (cp_url[1] == '|'))
 		cp_url[1] = ':';
diff --git a/WWW/Library/Implementation/HTFile.c b/WWW/Library/Implementation/HTFile.c
index ac0d2874..a4eae4a7 100644
--- a/WWW/Library/Implementation/HTFile.c
+++ b/WWW/Library/Implementation/HTFile.c
@@ -873,7 +873,7 @@ PUBLIC HTFormat HTCharsetFormat ARGS3(
 	*cp4 = '\0';
 	cp4 = cp3;
 	chndl = UCGetLYhndl_byMIME(cp3);
-	if (UCCanTranslateFromTo(chndl, current_char_set)) {
+	if (UCCanTranslateFromTo(chndl, current_char_set) != TQ_NO) {
 	    chartrans_ok = YES;
 	    *cp1 = '\0';
 	    format = HTAtom_for(cp);
@@ -886,7 +886,7 @@ PUBLIC HTFormat HTCharsetFormat ARGS3(
 	    **  Got something but we don't recognize it.
 	    */
 	    chndl = UCLYhndl_for_unrec;
-	    if (UCCanTranslateFromTo(chndl, current_char_set)) {
+	    if (UCCanTranslateFromTo(chndl, current_char_set) != TQ_NO) {
 		chartrans_ok = YES;
 		HTAnchor_setUCInfoStage(anchor, chndl,
 					UCT_STAGE_MIME,
diff --git a/WWW/Library/Implementation/HTMIME.c b/WWW/Library/Implementation/HTMIME.c
index b694bb05..814ed9c7 100644
--- a/WWW/Library/Implementation/HTMIME.c
+++ b/WWW/Library/Implementation/HTMIME.c
@@ -378,7 +378,7 @@ PRIVATE void HTMIME_put_character ARGS2(
 			    cp4 = cp3;
 			    chndl = UCGetLYhndl_byMIME(cp3);
 			    if (UCCanTranslateFromTo(chndl,
-						     current_char_set)) {
+						     current_char_set) != TQ_NO) {
 				chartrans_ok = YES;
 				*cp1 = '\0';
 				me->format = HTAtom_for(cp);
@@ -390,7 +390,7 @@ PRIVATE void HTMIME_put_character ARGS2(
 						 recognize it */
 				chndl = UCLYhndl_for_unrec;
 				if (UCCanTranslateFromTo(chndl,
-							 current_char_set)) {
+							 current_char_set) != TQ_NO) {
 				    chartrans_ok = YES;
 				    *cp1 = '\0';
 				    me->format = HTAtom_for(cp);
@@ -2388,8 +2388,8 @@ PUBLIC void HTmmdecode ARGS2(
 			for (p = s+2; *p; p++)
 			    *p = TOLOWER(*p);
 			invalid = ((LYhndl = UCGetLYhndl_byMIME(s+2)) < 0 ||
-				   !UCCanTranslateFromTo(LYhndl,
-							 current_char_set));
+				   UCCanTranslateFromTo(LYhndl,
+						 current_char_set) != TQ_NO);
 			*qm2 = '?';
 		    }
 		    if (!invalid) {
diff --git a/WWW/Library/Implementation/HTTCP.c b/WWW/Library/Implementation/HTTCP.c
index cbc43984..6fe7739a 100644
--- a/WWW/Library/Implementation/HTTCP.c
+++ b/WWW/Library/Implementation/HTTCP.c
@@ -206,15 +206,10 @@ PUBLIC int HTInetStatus ARGS1(
 #define ER_NO_TRANS_DONE
 #endif /* VMS */
 
-#if defined(NeXT) || defined(THINK_C)
+#ifdef HAVE_STRERROR
 	   strerror(SOCKET_ERRNO));
 #define ER_NO_TRANS_DONE
-#endif /* NeXT || THINK_C */
-
-#if defined(__NetBSD__) || defined(__FreeBSD__) || defined(BSDI)
-	   strerror(SOCKET_ERRNO));
-#define ER_NO_TRANS_DONE
-#endif /* __NetBSD__ || __FreeBSD__ || BSDI */
+#endif /* HAVE_STRERROR */
 
 #ifndef ER_NO_TRANS_DONE
 	   (SOCKET_ERRNO < sys_nerr ?
diff --git a/WWW/Library/unix/makefile.in b/WWW/Library/unix/makefile.in
index f9fbb160..89c1cf2f 100644
--- a/WWW/Library/unix/makefile.in
+++ b/WWW/Library/unix/makefile.in
@@ -18,8 +18,11 @@ VPATH		= $(srcdir)
 LYFLAGS		= # FIXME: set in parent makefile
 
 CC		= @CC@
-CPPOPTS		= @DEFS@ @CPPFLAGS@ $(LYFLAGS) -I../../.. -I../../../src
-CFLAGS		= $(CPPOPTS) @CFLAGS@
+DEFS		= @DEFS@
+CPPFLAGS	= @CPPFLAGS@
+CPPOPTS		= $(DEFS) $(CPPFLAGS) $(LYFLAGS) -I../../.. -I../../../src
+LY_CFLAGS	= @CFLAGS@
+CFLAGS		= $(CPPOPTS) $(LY_CFLAGS)
 
 # Directory for installed binary:
 BINDIR		= @bindir@
diff --git a/aclocal.m4 b/aclocal.m4
index 4db8eaf9..4cfb3777 100644
--- a/aclocal.m4
+++ b/aclocal.m4
@@ -137,6 +137,41 @@ if test "$cf_cv_bool_defs" = no ; then
 fi
 ])dnl
 dnl ---------------------------------------------------------------------------
+dnl Check for data that is usually declared in <stdio.h> or <errno.h>
+dnl $1 = the name to check
+AC_DEFUN([CF_CHECK_ERRNO],
+[
+AC_MSG_CHECKING([declaration of $1])
+AC_CACHE_VAL(cf_cv_dcl_$1,[
+    AC_TRY_COMPILE([
+#include <stdio.h>
+#include <sys/types.h>
+#include <errno.h> ],
+    [long x = (long) $1],
+    [eval 'cf_cv_dcl_'$1'=yes'],
+    [eval 'cf_cv_dcl_'$1'=no]')])
+eval 'cf_result=$cf_cv_dcl_'$1
+AC_MSG_RESULT($cf_result)
+
+# It's possible (for near-UNIX clones) that the data doesn't exist
+if test $cf_result = no ; then
+    eval 'cf_result=DECL_'$1
+    CF_UPPER(cf_result,$cf_result)
+    AC_DEFINE_UNQUOTED($cf_result)
+    AC_MSG_CHECKING([existence of $1])
+    AC_CACHE_VAL(cf_cv_have_$1,[
+        AC_TRY_LINK([
+#undef $1
+extern long $1;
+],
+            [$1 = 2],
+            [eval 'cf_cv_have_'$1'=yes'],
+            [eval 'cf_cv_have_'$1'=no'])])
+    eval 'cf_result=$cf_cv_have_'$1
+    AC_MSG_RESULT($cf_result)
+fi
+])dnl
+dnl ---------------------------------------------------------------------------
 dnl Check if a function is declared by including a set of include files.
 dnl Invoke the corresponding actions according to whether it is found or not.
 dnl CF_CHECK_FUNCDECL(INCLUDES, FUNCTION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
@@ -330,15 +365,7 @@ dnl ---------------------------------------------------------------------------
 dnl Check if 'errno' is declared in <errno.h>
 AC_DEFUN([CF_ERRNO],
 [
-AC_MSG_CHECKING([for errno external decl])
-AC_CACHE_VAL(cf_cv_extern_errno,[
-    AC_TRY_COMPILE([
-#include <errno.h>],
-        [int x = errno],
-        [cf_cv_extern_errno=yes],
-        [cf_cv_extern_errno=no])])
-AC_MSG_RESULT($cf_cv_extern_errno)
-test $cf_cv_extern_errno = no && AC_DEFINE(DECL_ERRNO)
+CF_CHECK_ERRNO(errno)
 ])dnl
 dnl ---------------------------------------------------------------------------
 AC_DEFUN([CF_FANCY_CURSES],
@@ -710,8 +737,15 @@ dnl and the linker will record a dependency.
 AC_DEFUN([CF_NCURSES_LIBS],
 [AC_REQUIRE([CF_NCURSES_CPPFLAGS])
 
+	# This works, except for the special case where we find gpm, but
+	# ncurses is in a nonstandard location via $LIBS, and we really want
+	# to link gpm.
 cf_ncurses_LIBS=""
-AC_CHECK_LIB(gpm,Gpm_Open,[AC_CHECK_LIB(gpm,initscr,,[cf_ncurses_LIBS="-lgpm"])])
+cf_ncurses_SAVE="$LIBS"
+AC_CHECK_LIB(gpm,Gpm_Open,
+	[AC_CHECK_LIB(gpm,initscr,
+		[LIBS="$cf_ncurses_SAVE"],
+		[cf_ncurses_LIBS="-lgpm"])])
 
 case $host_os in #(vi
 freebsd*)
@@ -1065,11 +1099,28 @@ dnl ---------------------------------------------------------------------------
 dnl Look for the slang library.
 AC_DEFUN([CF_SLANG_LIBS],
 [
+cf_slang_LIBS1="$LIBS"
+CF_TERMCAP_LIBS
+cf_slang_LIBS2="$LIBS"
 AC_CHECK_FUNC(acos,,[CF_RECHECK_FUNC(acos,m,LIBS)])
 CF_FIND_LIBRARY(slang,
 	[#include <slang.h>],
 	[SLtt_get_screen_size()],
 	SLtt_get_screen_size)
+cf_slang_LIBS3="$LIBS"
+AC_MSG_CHECKING(if we can link slang without termcap)
+if test -n "$cf_slang_LIBS1" ; then
+	cf_exclude=`echo ".$cf_slang_LIBS2" | sed -e "s@$cf_slang_LIBS1@@" -e 's@^.@@'`
+else
+	cf_exclude="$cf_slang_LIBS2"
+fi
+LIBS=`echo ".$cf_slang_LIBS3" | sed -e "s@$cf_exclude@@" -e 's@^.@@'`
+AC_TRY_LINK([#include <slang.h>],
+	[SLtt_get_screen_size()],
+	[cf_result=yes],
+	[cf_result=no])
+AC_MSG_RESULT($cf_result)
+test $cf_result = no && LIBS="$cf_slang_LIBS3"
 ])dnl
 dnl ---------------------------------------------------------------------------
 dnl	Remove "-g" option from the compiler options
@@ -1099,33 +1150,15 @@ AC_MSG_RESULT($cf_cv_system_mail_flags)
 AC_DEFINE_UNQUOTED(SYSTEM_MAIL_FLAGS, "$cf_cv_system_mail_flags")
 ])dnl
 dnl ---------------------------------------------------------------------------
-dnl Check for declaration of sys_errlist in one of stdio.h and errno.h.
-dnl Declaration of sys_errlist on BSD4.4 interferes with our declaration.
-dnl Reported by Keith Bostic.
+dnl Check for declaration of sys_nerr and sys_errlist in one of stdio.h and
+dnl errno.h.  Declaration of sys_errlist on BSD4.4 interferes with our
+dnl declaration.  Reported by Keith Bostic.
 AC_DEFUN([CF_SYS_ERRLIST],
 [
-AC_MSG_CHECKING([declaration of sys_errlist])
-AC_CACHE_VAL(cf_cv_dcl_sys_errlist,[
-    AC_TRY_COMPILE([
-#include <stdio.h>
-#include <sys/types.h>
-#include <errno.h> ],
-    [char *c = (char *) *sys_errlist],
-    [cf_cv_dcl_sys_errlist=yes],
-    [cf_cv_dcl_sys_errlist=no])])
-AC_MSG_RESULT($cf_cv_dcl_sys_errlist)
-
-# It's possible (for near-UNIX clones) that sys_errlist doesn't exist
-if test $cf_cv_dcl_sys_errlist = no ; then
-    AC_DEFINE(DECL_SYS_ERRLIST)
-    AC_MSG_CHECKING([existence of sys_errlist])
-    AC_CACHE_VAL(cf_cv_have_sys_errlist,[
-        AC_TRY_LINK([#include <errno.h>],
-            [char *c = (char *) *sys_errlist],
-            [cf_cv_have_sys_errlist=yes],
-            [cf_cv_have_sys_errlist=no])])
-    AC_MSG_RESULT($cf_cv_have_sys_errlist)
-fi
+for cf_name in sys_nerr sys_errlist
+do
+    CF_CHECK_ERRNO($cf_name)
+done
 ])dnl
 dnl ---------------------------------------------------------------------------
 dnl Look for termcap libraries, needed by some versions of slang.
diff --git a/config.hin b/config.hin
index 3653bad7..5e299965 100644
--- a/config.hin
+++ b/config.hin
@@ -31,6 +31,7 @@
 #undef HAVE_PUTENV
 #undef HAVE_READDIR
 #undef HAVE_SIZECHANGE		/* defined by CF_SIZECHANGE */
+#undef HAVE_STRERROR
 #undef HAVE_STRING_H
 #undef HAVE_SYS_DIR_H		/* defined by AC_HEADER_DIRENT */
 #undef HAVE_SYS_FCNTL_H		/* have <sys/fcntl.h> */
@@ -42,8 +43,10 @@
 #undef HAVE_TTYTYPE
 #undef HAVE_TYPE_UNIONWAIT	/* CF_UNION_WAIT */
 #undef HAVE_UNISTD_H		/* have <unistd.h> */
+#undef HAVE_USE_DEFAULT_COLORS	/* ncurses extension */
 #undef HAVE_UTMP
 #undef HAVE_WAITPID
+#undef HAVE_WBORDER
 #undef IGNORE_CTRL_C		/* FIXME: make tests? */
 #undef INSTALL_ARGS		/* CF_PATH_PROG(install) */
 #undef INSTALL_PATH		/* CF_PATH_PROG(install) */
@@ -80,6 +83,7 @@
 #undef UNIX
 #undef UNZIP_PATH		/* CF_PATH_PROG(unzip) */
 #undef USE_COLOR_STYLE		/* CF_ARG_ENABLE(color-style) */
+#undef USE_EXTERNS		/* CF_ARG_ENABLE(externs) */
 #undef USE_HASH			/* see USE_COLOR_STYLE */
 #undef USE_SIZECHANGEHACK	/* FIXME: find a case where this works! */
 #undef USE_SLANG		/* AC_ARG_WITH(screen=slang) */
diff --git a/configure b/configure
index c054152b..4e21f31c 100755
--- a/configure
+++ b/configure
@@ -34,6 +34,8 @@ Miscellaneous Options:"
 ac_help="$ac_help
   --enable-color-style    use optional/experimental color style (default: off)"
 ac_help="$ac_help
+  --enable-externs        use external commands (default: off)"
+ac_help="$ac_help
   --with-zlib             use zlib for decompression of some gzip files"
 ac_help="$ac_help
 Directory Editor Options:"
@@ -596,7 +598,7 @@ else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
 fi
 
 echo $ac_n "checking host system type""... $ac_c" 1>&6
-echo "configure:600: checking host system type" >&5
+echo "configure:602: checking host system type" >&5
 
 host_alias=$host
 case "$host_alias" in
@@ -621,7 +623,7 @@ echo "$ac_t""$host" 1>&6
 # Extract the first word of "gcc", so it can be a program name with args.
 set dummy gcc; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:625: checking for $ac_word" >&5
+echo "configure:627: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -650,7 +652,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 $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:654: checking for $ac_word" >&5
+echo "configure:656: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -698,7 +700,7 @@ fi
 fi
 
 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
-echo "configure:702: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
+echo "configure:704: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
 
 ac_ext=c
 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
@@ -708,11 +710,11 @@ ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS
 cross_compiling=$ac_cv_prog_cc_cross
 
 cat > conftest.$ac_ext <<EOF
-#line 712 "configure"
+#line 714 "configure"
 #include "confdefs.h"
 main(){return(0);}
 EOF
-if { (eval echo configure:716: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:718: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   ac_cv_prog_cc_works=yes
   # If we can't run a trivial program, we are probably using a cross compiler.
   if (./conftest; exit) 2>/dev/null; then
@@ -732,12 +734,12 @@ if test $ac_cv_prog_cc_works = no; then
   { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
 fi
 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
-echo "configure:736: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
+echo "configure:738: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
 cross_compiling=$ac_cv_prog_cc_cross
 
 echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
-echo "configure:741: checking whether we are using GNU C" >&5
+echo "configure:743: checking whether we are using GNU C" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -746,7 +748,7 @@ else
   yes;
 #endif
 EOF
-if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:750: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
+if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:752: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
   ac_cv_prog_gcc=yes
 else
   ac_cv_prog_gcc=no
@@ -761,7 +763,7 @@ if test $ac_cv_prog_gcc = yes; then
   ac_save_CFLAGS="$CFLAGS"
   CFLAGS=
   echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
-echo "configure:765: checking whether ${CC-cc} accepts -g" >&5
+echo "configure:767: checking whether ${CC-cc} accepts -g" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -789,7 +791,7 @@ else
 fi
 
 echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
-echo "configure:793: checking how to run the C preprocessor" >&5
+echo "configure:795: checking how to run the C preprocessor" >&5
 # On Suns, sometimes $CPP names a directory.
 if test -n "$CPP" && test -d "$CPP"; then
   CPP=
@@ -804,13 +806,13 @@ else
   # On the NeXT, cc -E runs the code through the compiler's parser,
   # not just through cpp.
   cat > conftest.$ac_ext <<EOF
-#line 808 "configure"
+#line 810 "configure"
 #include "confdefs.h"
 #include <assert.h>
 Syntax Error
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:814: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:816: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   :
@@ -821,13 +823,13 @@ else
   rm -rf conftest*
   CPP="${CC-cc} -E -traditional-cpp"
   cat > conftest.$ac_ext <<EOF
-#line 825 "configure"
+#line 827 "configure"
 #include "confdefs.h"
 #include <assert.h>
 Syntax Error
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:831: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:833: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   :
@@ -852,7 +854,7 @@ echo "$ac_t""$CPP" 1>&6
 # Extract the first word of "ranlib", so it can be a program name with args.
 set dummy ranlib; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:856: checking for $ac_word" >&5
+echo "configure:858: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -879,7 +881,7 @@ else
 fi
 
 echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
-echo "configure:883: checking whether ${MAKE-make} sets \${MAKE}" >&5
+echo "configure:885: checking whether ${MAKE-make} sets \${MAKE}" >&5
 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -907,7 +909,7 @@ fi
 
 
 echo $ac_n "checking for style of include in makefiles""... $ac_c" 1>&6
-echo "configure:911: checking for style of include in makefiles" >&5
+echo "configure:913: checking for style of include in makefiles" >&5
 
 make_include_left=""
 make_include_right=""
@@ -968,7 +970,7 @@ echo "$ac_t""${make_include_left}file${make_include_right}" 1>&6
 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
 # ./install, which can be erroneously created by make from ./install.sh.
 echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
-echo "configure:972: checking for a BSD compatible install" >&5
+echo "configure:974: checking for a BSD compatible install" >&5
 if test -z "$INSTALL"; then
 if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -1022,7 +1024,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 $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1026: checking for $ac_word" >&5
+echo "configure:1028: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_LINT'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1056,7 +1058,7 @@ done
 
 
 echo $ac_n "checking if you want to see long compiling messages""... $ac_c" 1>&6
-echo "configure:1060: checking if you want to see long compiling messages" >&5
+echo "configure:1062: checking if you want to see long compiling messages" >&5
 # Check whether --enable-echo or --disable-echo was given.
 if test "${enable_echo+set}" = set; then
   enableval="$enable_echo"
@@ -1095,7 +1097,7 @@ echo "$ac_t""$enableval" 1>&6
 
 
 echo $ac_n "checking if you want to check memory-leaks""... $ac_c" 1>&6
-echo "configure:1099: checking if you want to check memory-leaks" >&5
+echo "configure:1101: checking if you want to check memory-leaks" >&5
 # Check whether --enable-find-leaks or --disable-find-leaks was given.
 if test "${enable_find_leaks+set}" = set; then
   enableval="$enable_find_leaks"
@@ -1118,7 +1120,7 @@ EOF
 
 
 echo $ac_n "checking if you want to enable debug-code""... $ac_c" 1>&6
-echo "configure:1122: checking if you want to enable debug-code" >&5
+echo "configure:1124: checking if you want to enable debug-code" >&5
 # Check whether --enable-debug or --disable-debug was given.
 if test "${enable_debug+set}" = set; then
   enableval="$enable_debug"
@@ -1137,7 +1139,7 @@ fi
 echo "$ac_t""$with_debug" 1>&6
 if test "$with_debug" = "yes" ; then
 	case $host_os in
-	ultrix*|osf34.*)
+	ultrix*|osf*)
 		
 CFLAGS=`echo ${CFLAGS} | sed -e 's/-O[1-9]\? //' -e 's/-O[1-9]\?$//'`
 
@@ -1148,7 +1150,7 @@ CFLAGS=`echo ${CFLAGS} | sed -e 's/-O[1-9]\? //' -e 's/-O[1-9]\?$//'`
 	esac
 else
 	case $host_os in
-	ultrix*) #(vi
+	ultrix*|osf*) #(vi
 		CFLAGS=`echo ${CFLAGS} | sed -e 's/-g //' -e 's/-g$//'`
 		;;
 	*)
@@ -1162,7 +1164,7 @@ fi
 if test -n "$GCC"
 then
 echo $ac_n "checking if you want to turn on gcc warnings""... $ac_c" 1>&6
-echo "configure:1166: checking if you want to turn on gcc warnings" >&5
+echo "configure:1168: checking if you want to turn on gcc warnings" >&5
 # Check whether --enable-warnings or --disable-warnings was given.
 if test "${enable_warnings+set}" = set; then
   enableval="$enable_warnings"
@@ -1185,11 +1187,11 @@ then
 if test -n "$GCC"
 then
 		cat > conftest.$ac_ext <<EOF
-#line 1189 "configure"
+#line 1191 "configure"
 int main(int argc, char *argv[]) { return argv[argc-1] == 0; }
 EOF
 		echo "checking for gcc warning options" 1>&6
-echo "configure:1193: checking for gcc warning options" >&5
+echo "configure:1195: checking for gcc warning options" >&5
 	cf_save_CFLAGS="$CFLAGS"
 	EXTRA_CFLAGS="-W -Wall"
 	cf_warn_CONST=""
@@ -1207,7 +1209,7 @@ echo "configure:1193: checking for gcc warning options" >&5
 		Wstrict-prototypes $cf_warn_CONST
 	do
 		CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
-		if { (eval echo configure:1211: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+		if { (eval echo configure:1213: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
 			test -n "$verbose" && echo "$ac_t""... -$cf_opt" 1>&6
 			EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
 			test "$cf_opt" = Wcast-qual && EXTRA_CFLAGS="$EXTRA_CFLAGS -DXTSTRINGDEFINES"
@@ -1225,7 +1227,7 @@ fi
 
 
 echo $ac_n "checking if you want full utility pathnames""... $ac_c" 1>&6
-echo "configure:1229: checking if you want full utility pathnames" >&5
+echo "configure:1231: checking if you want full utility pathnames" >&5
 # Check whether --enable-full-paths or --disable-full-paths was given.
 if test "${enable_full_paths+set}" = set; then
   enableval="$enable_full_paths"
@@ -1245,7 +1247,7 @@ echo "$ac_t""$with_full_paths" 1>&6
 
 
 echo $ac_n "checking for system mailer""... $ac_c" 1>&6
-echo "configure:1249: checking for system mailer" >&5
+echo "configure:1251: checking for system mailer" >&5
 if eval "test \"`echo '$''{'cf_cv_SYSTEM_MAIL'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1272,7 +1274,7 @@ EOF
 
 
 echo $ac_n "checking system mail flags""... $ac_c" 1>&6
-echo "configure:1276: checking system mail flags" >&5
+echo "configure:1278: checking system mail flags" >&5
 if eval "test \"`echo '$''{'cf_cv_system_mail_flags'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1300,7 +1302,7 @@ if test "$with_full_paths" = yes ; then
 	# Extract the first word of "chmod", so it can be a program name with args.
 set dummy chmod; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1304: checking for $ac_word" >&5
+echo "configure:1306: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_CHMOD'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1331,7 +1333,7 @@ fi
 
 else
 	echo $ac_n "checking for chmod""... $ac_c" 1>&6
-echo "configure:1335: checking for chmod" >&5
+echo "configure:1337: checking for chmod" >&5
 	echo "$ac_t""$CHMOD" 1>&6
 fi
 
@@ -1365,7 +1367,7 @@ if test "$with_full_paths" = yes ; then
 	# Extract the first word of "compress", so it can be a program name with args.
 set dummy compress; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1369: checking for $ac_word" >&5
+echo "configure:1371: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_COMPRESS'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1396,7 +1398,7 @@ fi
 
 else
 	echo $ac_n "checking for compress""... $ac_c" 1>&6
-echo "configure:1400: checking for compress" >&5
+echo "configure:1402: checking for compress" >&5
 	echo "$ac_t""$COMPRESS" 1>&6
 fi
 
@@ -1430,7 +1432,7 @@ if test "$with_full_paths" = yes ; then
 	# Extract the first word of "cp", so it can be a program name with args.
 set dummy cp; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1434: checking for $ac_word" >&5
+echo "configure:1436: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_COPY'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1461,7 +1463,7 @@ fi
 
 else
 	echo $ac_n "checking for cp""... $ac_c" 1>&6
-echo "configure:1465: checking for cp" >&5
+echo "configure:1467: checking for cp" >&5
 	echo "$ac_t""$COPY" 1>&6
 fi
 
@@ -1495,7 +1497,7 @@ if test "$with_full_paths" = yes ; then
 	# Extract the first word of "gzip", so it can be a program name with args.
 set dummy gzip; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1499: checking for $ac_word" >&5
+echo "configure:1501: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_GZIP'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1526,7 +1528,7 @@ fi
 
 else
 	echo $ac_n "checking for gzip""... $ac_c" 1>&6
-echo "configure:1530: checking for gzip" >&5
+echo "configure:1532: checking for gzip" >&5
 	echo "$ac_t""$GZIP" 1>&6
 fi
 
@@ -1560,7 +1562,7 @@ if test "$with_full_paths" = yes ; then
 	# Extract the first word of "install", so it can be a program name with args.
 set dummy install; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1564: checking for $ac_word" >&5
+echo "configure:1566: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_INSTALL'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1591,7 +1593,7 @@ fi
 
 else
 	echo $ac_n "checking for install""... $ac_c" 1>&6
-echo "configure:1595: checking for install" >&5
+echo "configure:1597: checking for install" >&5
 	echo "$ac_t""$INSTALL" 1>&6
 fi
 
@@ -1625,7 +1627,7 @@ if test "$with_full_paths" = yes ; then
 	# Extract the first word of "mkdir", so it can be a program name with args.
 set dummy mkdir; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1629: checking for $ac_word" >&5
+echo "configure:1631: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_MKDIR'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1656,7 +1658,7 @@ fi
 
 else
 	echo $ac_n "checking for mkdir""... $ac_c" 1>&6
-echo "configure:1660: checking for mkdir" >&5
+echo "configure:1662: checking for mkdir" >&5
 	echo "$ac_t""$MKDIR" 1>&6
 fi
 
@@ -1690,7 +1692,7 @@ if test "$with_full_paths" = yes ; then
 	# Extract the first word of "mv", so it can be a program name with args.
 set dummy mv; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1694: checking for $ac_word" >&5
+echo "configure:1696: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_MV'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1721,7 +1723,7 @@ fi
 
 else
 	echo $ac_n "checking for mv""... $ac_c" 1>&6
-echo "configure:1725: checking for mv" >&5
+echo "configure:1727: checking for mv" >&5
 	echo "$ac_t""$MV" 1>&6
 fi
 
@@ -1755,7 +1757,7 @@ if test "$with_full_paths" = yes ; then
 	# Extract the first word of "rm", so it can be a program name with args.
 set dummy rm; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1759: checking for $ac_word" >&5
+echo "configure:1761: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_RM'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1786,7 +1788,7 @@ fi
 
 else
 	echo $ac_n "checking for rm""... $ac_c" 1>&6
-echo "configure:1790: checking for rm" >&5
+echo "configure:1792: checking for rm" >&5
 	echo "$ac_t""$RM" 1>&6
 fi
 
@@ -1820,7 +1822,7 @@ if test "$with_full_paths" = yes ; then
 	# Extract the first word of "tar", so it can be a program name with args.
 set dummy tar; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1824: checking for $ac_word" >&5
+echo "configure:1826: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_TAR'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1851,7 +1853,7 @@ fi
 
 else
 	echo $ac_n "checking for tar""... $ac_c" 1>&6
-echo "configure:1855: checking for tar" >&5
+echo "configure:1857: checking for tar" >&5
 	echo "$ac_t""$TAR" 1>&6
 fi
 
@@ -1885,7 +1887,7 @@ if test "$with_full_paths" = yes ; then
 	# Extract the first word of "touch", so it can be a program name with args.
 set dummy touch; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1889: checking for $ac_word" >&5
+echo "configure:1891: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_TOUCH'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1916,7 +1918,7 @@ fi
 
 else
 	echo $ac_n "checking for touch""... $ac_c" 1>&6
-echo "configure:1920: checking for touch" >&5
+echo "configure:1922: checking for touch" >&5
 	echo "$ac_t""$TOUCH" 1>&6
 fi
 
@@ -1950,7 +1952,7 @@ if test "$with_full_paths" = yes ; then
 	# Extract the first word of "gunzip", so it can be a program name with args.
 set dummy gunzip; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1954: checking for $ac_word" >&5
+echo "configure:1956: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_UNCOMPRESS'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1981,7 +1983,7 @@ fi
 
 else
 	echo $ac_n "checking for gunzip""... $ac_c" 1>&6
-echo "configure:1985: checking for gunzip" >&5
+echo "configure:1987: checking for gunzip" >&5
 	echo "$ac_t""$UNCOMPRESS" 1>&6
 fi
 
@@ -2015,7 +2017,7 @@ if test "$with_full_paths" = yes ; then
 	# Extract the first word of "unzip", so it can be a program name with args.
 set dummy unzip; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2019: checking for $ac_word" >&5
+echo "configure:2021: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_UNZIP'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2046,7 +2048,7 @@ fi
 
 else
 	echo $ac_n "checking for unzip""... $ac_c" 1>&6
-echo "configure:2050: checking for unzip" >&5
+echo "configure:2052: checking for unzip" >&5
 	echo "$ac_t""$UNZIP" 1>&6
 fi
 
@@ -2080,7 +2082,7 @@ if test "$with_full_paths" = yes ; then
 	# Extract the first word of "uudecode", so it can be a program name with args.
 set dummy uudecode; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2084: checking for $ac_word" >&5
+echo "configure:2086: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_UUDECODE'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2111,7 +2113,7 @@ fi
 
 else
 	echo $ac_n "checking for uudecode""... $ac_c" 1>&6
-echo "configure:2115: checking for uudecode" >&5
+echo "configure:2117: checking for uudecode" >&5
 	echo "$ac_t""$UUDECODE" 1>&6
 fi
 
@@ -2145,7 +2147,7 @@ if test "$with_full_paths" = yes ; then
 	# Extract the first word of "zcat", so it can be a program name with args.
 set dummy zcat; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2149: checking for $ac_word" >&5
+echo "configure:2151: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_ZCAT'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2176,7 +2178,7 @@ fi
 
 else
 	echo $ac_n "checking for zcat""... $ac_c" 1>&6
-echo "configure:2180: checking for zcat" >&5
+echo "configure:2182: checking for zcat" >&5
 	echo "$ac_t""$ZCAT" 1>&6
 fi
 
@@ -2210,7 +2212,7 @@ if test "$with_full_paths" = yes ; then
 	# Extract the first word of "zip", so it can be a program name with args.
 set dummy zip; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2214: checking for $ac_word" >&5
+echo "configure:2216: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_ZIP'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2241,7 +2243,7 @@ fi
 
 else
 	echo $ac_n "checking for zip""... $ac_c" 1>&6
-echo "configure:2245: checking for zip" >&5
+echo "configure:2247: checking for zip" >&5
 	echo "$ac_t""$ZIP" 1>&6
 fi
 
@@ -2279,7 +2281,7 @@ EOF
 if test -z "$GCC" ; then
 	
 echo $ac_n "checking for ${CC-cc} option to accept ANSI C""... $ac_c" 1>&6
-echo "configure:2283: checking for ${CC-cc} option to accept ANSI C" >&5
+echo "configure:2285: checking for ${CC-cc} option to accept ANSI C" >&5
 if eval "test \"`echo '$''{'cf_cv_ansi_cc'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2297,7 +2299,7 @@ for cf_arg in "-DCC_HAS_PROTOS" "" -qlanglvl=ansi -std1 "-Aa -D_HPUX_SOURCE" -Xc
 do
 	CFLAGS="$cf_save_CFLAGS $cf_arg"
 	cat > conftest.$ac_ext <<EOF
-#line 2301 "configure"
+#line 2303 "configure"
 #include "confdefs.h"
 
 #ifndef CC_HAS_PROTOS
@@ -2313,7 +2315,7 @@ int main() {
 	struct s2 {int (*f) (double a);};
 ; return 0; }
 EOF
-if { (eval echo configure:2317: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2319: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   cf_cv_ansi_cc="$cf_arg"; break
 else
@@ -2341,12 +2343,12 @@ fi
 
 fi
 echo $ac_n "checking for working const""... $ac_c" 1>&6
-echo "configure:2345: checking for working const" >&5
+echo "configure:2347: checking for working const" >&5
 if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2350 "configure"
+#line 2352 "configure"
 #include "confdefs.h"
 
 int main() {
@@ -2395,7 +2397,7 @@ ccp = (char const *const *) p;
 
 ; return 0; }
 EOF
-if { (eval echo configure:2399: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2401: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_c_const=yes
 else
@@ -2435,7 +2437,7 @@ clix*)
 	# contributed by Alex Matulich (matuli_a@marlin.navsea.navy.mil) also
 	# references -lmalloc and -lbsd.
 	echo $ac_n "checking for strcmp in -lc_s""... $ac_c" 1>&6
-echo "configure:2439: checking for strcmp in -lc_s" >&5
+echo "configure:2441: checking for strcmp in -lc_s" >&5
 ac_lib_var=`echo c_s'_'strcmp | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -2443,7 +2445,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lc_s  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 2447 "configure"
+#line 2449 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -2454,7 +2456,7 @@ int main() {
 strcmp()
 ; return 0; }
 EOF
-if { (eval echo configure:2458: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:2460: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -2532,7 +2534,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 $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2536: checking for $ac_word" >&5
+echo "configure:2538: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2576,17 +2578,17 @@ sony-newsos*)
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:2580: checking for $ac_hdr" >&5
+echo "configure:2582: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2585 "configure"
+#line 2587 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2590: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2592: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -2630,17 +2632,17 @@ ultrix*)
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:2634: checking for $ac_hdr" >&5
+echo "configure:2636: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2639 "configure"
+#line 2641 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2644: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2646: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -2673,7 +2675,7 @@ esac
 
 cf_test_netlibs=no
 echo $ac_n "checking for network libraries""... $ac_c" 1>&6
-echo "configure:2677: checking for network libraries" >&5
+echo "configure:2679: checking for network libraries" >&5
 if eval "test \"`echo '$''{'cf_cv_netlibs'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2684,12 +2686,12 @@ cf_test_netlibs=yes
 for ac_func in gethostname
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:2688: checking for $ac_func" >&5
+echo "configure:2690: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2693 "configure"
+#line 2695 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -2712,7 +2714,7 @@ $ac_func();
 
 ; return 0; }
 EOF
-if { (eval echo configure:2716: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:2718: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -2735,7 +2737,7 @@ else
   echo "$ac_t""no" 1>&6
 
 echo $ac_n "checking for gethostname in -lnsl""... $ac_c" 1>&6
-echo "configure:2739: checking for gethostname in -lnsl" >&5
+echo "configure:2741: checking for gethostname in -lnsl" >&5
 ac_lib_var=`echo nsl'_'gethostname | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -2743,7 +2745,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lnsl $cf_cv_netlibs $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 2747 "configure"
+#line 2749 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -2754,7 +2756,7 @@ int main() {
 gethostname()
 ; return 0; }
 EOF
-if { (eval echo configure:2758: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:2760: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -2787,7 +2789,7 @@ else
 	
 		
 echo $ac_n "checking for gethostname in -lsocket""... $ac_c" 1>&6
-echo "configure:2791: checking for gethostname in -lsocket" >&5
+echo "configure:2793: checking for gethostname in -lsocket" >&5
 ac_lib_var=`echo socket'_'gethostname | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -2795,7 +2797,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lsocket $cf_cv_netlibs $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 2799 "configure"
+#line 2801 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -2806,7 +2808,7 @@ int main() {
 gethostname()
 ; return 0; }
 EOF
-if { (eval echo configure:2810: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:2812: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -2850,21 +2852,21 @@ done
 # FIXME:  sequent needs this library (i.e., -lsocket -linet -lnsl), but
 # I don't know the entrypoints - 97/7/22 TD
 echo $ac_n "checking for -linet""... $ac_c" 1>&6
-echo "configure:2854: checking for -linet" >&5
+echo "configure:2856: checking for -linet" >&5
 if eval "test \"`echo '$''{'ac_cv_lib_inet'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   ac_save_LIBS="$LIBS"
 LIBS="-linet  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 2861 "configure"
+#line 2863 "configure"
 #include "confdefs.h"
 
 int main() {
 main()
 ; return 0; }
 EOF
-if { (eval echo configure:2868: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:2870: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   ac_cv_lib_inet=yes
 else
@@ -2887,12 +2889,12 @@ if test "$ac_cv_func_lsocket" != no ; then
 for ac_func in socket
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:2891: checking for $ac_func" >&5
+echo "configure:2893: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2896 "configure"
+#line 2898 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -2915,7 +2917,7 @@ $ac_func();
 
 ; return 0; }
 EOF
-if { (eval echo configure:2919: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:2921: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -2938,7 +2940,7 @@ else
   echo "$ac_t""no" 1>&6
 
 echo $ac_n "checking for socket in -lsocket""... $ac_c" 1>&6
-echo "configure:2942: checking for socket in -lsocket" >&5
+echo "configure:2944: checking for socket in -lsocket" >&5
 ac_lib_var=`echo socket'_'socket | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -2946,7 +2948,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lsocket $cf_cv_netlibs $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 2950 "configure"
+#line 2952 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -2957,7 +2959,7 @@ int main() {
 socket()
 ; return 0; }
 EOF
-if { (eval echo configure:2961: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:2963: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -2990,7 +2992,7 @@ else
 	
 		
 echo $ac_n "checking for socket in -lbsd""... $ac_c" 1>&6
-echo "configure:2994: checking for socket in -lbsd" >&5
+echo "configure:2996: checking for socket in -lbsd" >&5
 ac_lib_var=`echo bsd'_'socket | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -2998,7 +3000,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lbsd $cf_cv_netlibs $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 3002 "configure"
+#line 3004 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -3009,7 +3011,7 @@ int main() {
 socket()
 ; return 0; }
 EOF
-if { (eval echo configure:3013: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:3015: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -3054,12 +3056,12 @@ fi
 for ac_func in gethostbyname
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:3058: checking for $ac_func" >&5
+echo "configure:3060: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3063 "configure"
+#line 3065 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -3082,7 +3084,7 @@ $ac_func();
 
 ; return 0; }
 EOF
-if { (eval echo configure:3086: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:3088: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -3105,7 +3107,7 @@ else
   echo "$ac_t""no" 1>&6
 
 echo $ac_n "checking for gethostbyname in -lnsl""... $ac_c" 1>&6
-echo "configure:3109: checking for gethostbyname in -lnsl" >&5
+echo "configure:3111: checking for gethostbyname in -lnsl" >&5
 ac_lib_var=`echo nsl'_'gethostbyname | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -3113,7 +3115,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lnsl $cf_cv_netlibs $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 3117 "configure"
+#line 3119 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -3124,7 +3126,7 @@ int main() {
 gethostbyname()
 ; return 0; }
 EOF
-if { (eval echo configure:3128: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:3130: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -3165,12 +3167,12 @@ done
 for ac_func in strcasecmp
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:3169: checking for $ac_func" >&5
+echo "configure:3171: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3174 "configure"
+#line 3176 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -3193,7 +3195,7 @@ $ac_func();
 
 ; return 0; }
 EOF
-if { (eval echo configure:3197: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:3199: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -3216,7 +3218,7 @@ else
   echo "$ac_t""no" 1>&6
 
 echo $ac_n "checking for strcasecmp in -lresolv""... $ac_c" 1>&6
-echo "configure:3220: checking for strcasecmp in -lresolv" >&5
+echo "configure:3222: checking for strcasecmp in -lresolv" >&5
 ac_lib_var=`echo resolv'_'strcasecmp | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -3224,7 +3226,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lresolv $cf_cv_netlibs $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 3228 "configure"
+#line 3230 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -3235,7 +3237,7 @@ int main() {
 strcasecmp()
 ; return 0; }
 EOF
-if { (eval echo configure:3239: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:3241: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -3280,7 +3282,7 @@ test $cf_test_netlibs = no && echo "$cf_cv_netlibs" >&6
 
 
 echo $ac_n "checking for screen type""... $ac_c" 1>&6
-echo "configure:3284: checking for screen type" >&5
+echo "configure:3286: checking for screen type" >&5
 if eval "test \"`echo '$''{'cf_cv_screen'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -3314,12 +3316,12 @@ case $cf_cv_screen in
 curses)
 	
 echo $ac_n "checking for initscr""... $ac_c" 1>&6
-echo "configure:3318: checking for initscr" >&5
+echo "configure:3320: checking for initscr" >&5
 if eval "test \"`echo '$''{'ac_cv_func_initscr'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3323 "configure"
+#line 3325 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char initscr(); below.  */
@@ -3342,7 +3344,7 @@ initscr();
 
 ; return 0; }
 EOF
-if { (eval echo configure:3346: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:3348: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_initscr=yes"
 else
@@ -3363,7 +3365,7 @@ else
 case $host_os in #(vi
 freebsd*) #(vi
 	echo $ac_n "checking for tgoto in -lmytinfo""... $ac_c" 1>&6
-echo "configure:3367: checking for tgoto in -lmytinfo" >&5
+echo "configure:3369: checking for tgoto in -lmytinfo" >&5
 ac_lib_var=`echo mytinfo'_'tgoto | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -3371,7 +3373,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lmytinfo  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 3375 "configure"
+#line 3377 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -3382,7 +3384,7 @@ int main() {
 tgoto()
 ; return 0; }
 EOF
-if { (eval echo configure:3386: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:3388: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -3405,7 +3407,7 @@ fi
 	;;
 *hp-hpux10.*)
 	echo $ac_n "checking for initscr in -lHcurses""... $ac_c" 1>&6
-echo "configure:3409: checking for initscr in -lHcurses" >&5
+echo "configure:3411: checking for initscr in -lHcurses" >&5
 ac_lib_var=`echo Hcurses'_'initscr | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -3413,7 +3415,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lHcurses  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 3417 "configure"
+#line 3419 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -3424,7 +3426,7 @@ int main() {
 initscr()
 ; return 0; }
 EOF
-if { (eval echo configure:3428: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:3430: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -3448,7 +3450,7 @@ else
   echo "$ac_t""no" 1>&6
 
 	echo $ac_n "checking for initscr in -lcur_color""... $ac_c" 1>&6
-echo "configure:3452: checking for initscr in -lcur_color" >&5
+echo "configure:3454: checking for initscr in -lcur_color" >&5
 ac_lib_var=`echo cur_color'_'initscr | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -3456,7 +3458,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lcur_color  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 3460 "configure"
+#line 3462 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -3467,7 +3469,7 @@ int main() {
 initscr()
 ; return 0; }
 EOF
-if { (eval echo configure:3471: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:3473: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -3506,12 +3508,12 @@ fi
 
 cf_save_LIBS="$LIBS"
 echo $ac_n "checking for tgoto""... $ac_c" 1>&6
-echo "configure:3510: checking for tgoto" >&5
+echo "configure:3512: checking for tgoto" >&5
 if eval "test \"`echo '$''{'ac_cv_func_tgoto'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3515 "configure"
+#line 3517 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char tgoto(); below.  */
@@ -3534,7 +3536,7 @@ tgoto();
 
 ; return 0; }
 EOF
-if { (eval echo configure:3538: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:3540: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_tgoto=yes"
 else
@@ -3550,7 +3552,7 @@ if eval "test \"`echo '$ac_cv_func_'tgoto`\" = yes"; then
   echo "$ac_t""yes" 1>&6
   
 	echo $ac_n "checking for initscr in -lcurses""... $ac_c" 1>&6
-echo "configure:3554: checking for initscr in -lcurses" >&5
+echo "configure:3556: checking for initscr in -lcurses" >&5
 ac_lib_var=`echo curses'_'initscr | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -3558,7 +3560,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lcurses  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 3562 "configure"
+#line 3564 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -3569,7 +3571,7 @@ int main() {
 initscr()
 ; return 0; }
 EOF
-if { (eval echo configure:3573: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:3575: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -3603,7 +3605,7 @@ else
   echo "$ac_t""no" 1>&6
 
 echo $ac_n "checking for tgoto in -ltermcap""... $ac_c" 1>&6
-echo "configure:3607: checking for tgoto in -ltermcap" >&5
+echo "configure:3609: checking for tgoto in -ltermcap" >&5
 ac_lib_var=`echo termcap'_'tgoto | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -3611,7 +3613,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-ltermcap  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 3615 "configure"
+#line 3617 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -3622,7 +3624,7 @@ int main() {
 tgoto()
 ; return 0; }
 EOF
-if { (eval echo configure:3626: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:3628: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -3640,7 +3642,7 @@ if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
   
 	LIBS="-ltermcap $cf_save_LIBS"
 	echo $ac_n "checking for initscr in -lcurses""... $ac_c" 1>&6
-echo "configure:3644: checking for initscr in -lcurses" >&5
+echo "configure:3646: checking for initscr in -lcurses" >&5
 ac_lib_var=`echo curses'_'initscr | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -3648,7 +3650,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lcurses  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 3652 "configure"
+#line 3654 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -3659,7 +3661,7 @@ int main() {
 initscr()
 ; return 0; }
 EOF
-if { (eval echo configure:3663: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:3665: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -3686,7 +3688,7 @@ else
   echo "$ac_t""no" 1>&6
 
 		echo $ac_n "checking for initscr in -lcursesX""... $ac_c" 1>&6
-echo "configure:3690: checking for initscr in -lcursesX" >&5
+echo "configure:3692: checking for initscr in -lcursesX" >&5
 ac_lib_var=`echo cursesX'_'initscr | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -3694,7 +3696,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lcursesX  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 3698 "configure"
+#line 3700 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -3705,7 +3707,7 @@ int main() {
 initscr()
 ; return 0; }
 EOF
-if { (eval echo configure:3709: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:3711: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -3732,7 +3734,7 @@ else
   echo "$ac_t""no" 1>&6
 
 			echo $ac_n "checking for initscr in -ljcurses""... $ac_c" 1>&6
-echo "configure:3736: checking for initscr in -ljcurses" >&5
+echo "configure:3738: checking for initscr in -ljcurses" >&5
 ac_lib_var=`echo jcurses'_'initscr | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -3740,7 +3742,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-ljcurses  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 3744 "configure"
+#line 3746 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -3751,7 +3753,7 @@ int main() {
 initscr()
 ; return 0; }
 EOF
-if { (eval echo configure:3755: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:3757: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -3789,7 +3791,7 @@ else
   echo "$ac_t""no" 1>&6
 
 	echo $ac_n "checking for initscr in -lcurses""... $ac_c" 1>&6
-echo "configure:3793: checking for initscr in -lcurses" >&5
+echo "configure:3795: checking for initscr in -lcurses" >&5
 ac_lib_var=`echo curses'_'initscr | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -3797,7 +3799,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lcurses  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 3801 "configure"
+#line 3803 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -3808,7 +3810,7 @@ int main() {
 initscr()
 ; return 0; }
 EOF
-if { (eval echo configure:3812: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:3814: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -3847,14 +3849,14 @@ fi
 
 	
 echo $ac_n "checking for curses performance tradeoff""... $ac_c" 1>&6
-echo "configure:3851: checking for curses performance tradeoff" >&5
+echo "configure:3853: checking for curses performance tradeoff" >&5
 if eval "test \"`echo '$''{'cf_cv_curs_performance'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
     cf_cv_curs_performance=no
     cat > conftest.$ac_ext <<EOF
-#line 3858 "configure"
+#line 3860 "configure"
 #include "confdefs.h"
 
 #include <$cf_cv_ncurses_header>
@@ -3868,11 +3870,11 @@ int main() {
 	
 ; return 0; }
 EOF
-if { (eval echo configure:3872: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3874: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   
 	cat > conftest.$ac_ext <<EOF
-#line 3876 "configure"
+#line 3878 "configure"
 #include "confdefs.h"
 
 #define CURS_PERFORMANCE
@@ -3887,7 +3889,7 @@ int main() {
 	
 ; return 0; }
 EOF
-if { (eval echo configure:3891: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3893: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   cf_cv_curs_performance=yes
 else
@@ -3912,13 +3914,13 @@ EOF
 ncurses)
 	
 echo $ac_n "checking for ncurses header file""... $ac_c" 1>&6
-echo "configure:3916: checking for ncurses header file" >&5
+echo "configure:3918: checking for ncurses header file" >&5
 if eval "test \"`echo '$''{'cf_cv_ncurses_header'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
 	cat > conftest.$ac_ext <<EOF
-#line 3922 "configure"
+#line 3924 "configure"
 #include "confdefs.h"
 #include <curses.h>
 int main() {
@@ -3935,7 +3937,7 @@ make an error
 	
 ; return 0; }
 EOF
-if { (eval echo configure:3939: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3941: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   cf_cv_ncurses_header=predefined
 else
@@ -4021,7 +4023,7 @@ done
 	;;
 esac
 echo $ac_n "checking for ncurses version""... $ac_c" 1>&6
-echo "configure:4025: checking for ncurses version" >&5
+echo "configure:4027: checking for ncurses version" >&5
 if eval "test \"`echo '$''{'cf_cv_ncurses_version'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -4046,7 +4048,7 @@ Autoconf "old"
 #endif
 EOF
 	cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
-	{ (eval echo configure:4050: \"$cf_try\") 1>&5; (eval $cf_try) 2>&5; }
+	{ (eval echo configure:4052: \"$cf_try\") 1>&5; (eval $cf_try) 2>&5; }
 	if test -f conftest.out ; then
 		cf_out=`cat conftest.out | sed -e 's@^Autoconf @@' -e 's@^[^"]*"@@' -e 's@".*@@'`
 		test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
@@ -4055,7 +4057,7 @@ EOF
 
 else
   cat > conftest.$ac_ext <<EOF
-#line 4059 "configure"
+#line 4061 "configure"
 #include "confdefs.h"
 
 #include <$cf_cv_ncurses_header>
@@ -4078,7 +4080,7 @@ int main()
 	exit(0);
 }
 EOF
-if { (eval echo configure:4082: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:4084: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
 then
   
 	cf_cv_ncurses_version=`cat $cf_tempfile`
@@ -4097,9 +4099,13 @@ echo "$ac_t""$cf_cv_ncurses_version" 1>&6
 
 	
 
+	# This works, except for the special case where we find gpm, but
+	# ncurses is in a nonstandard location via $LIBS, and we really want
+	# to link gpm.
 cf_ncurses_LIBS=""
+cf_ncurses_SAVE="$LIBS"
 echo $ac_n "checking for Gpm_Open in -lgpm""... $ac_c" 1>&6
-echo "configure:4103: checking for Gpm_Open in -lgpm" >&5
+echo "configure:4109: checking for Gpm_Open in -lgpm" >&5
 ac_lib_var=`echo gpm'_'Gpm_Open | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -4107,7 +4113,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lgpm  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 4111 "configure"
+#line 4117 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -4118,7 +4124,7 @@ int main() {
 Gpm_Open()
 ; return 0; }
 EOF
-if { (eval echo configure:4122: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:4128: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -4134,7 +4140,7 @@ fi
 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
   echo "$ac_t""yes" 1>&6
   echo $ac_n "checking for initscr in -lgpm""... $ac_c" 1>&6
-echo "configure:4138: checking for initscr in -lgpm" >&5
+echo "configure:4144: checking for initscr in -lgpm" >&5
 ac_lib_var=`echo gpm'_'initscr | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -4142,7 +4148,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lgpm  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 4146 "configure"
+#line 4152 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -4153,7 +4159,7 @@ int main() {
 initscr()
 ; return 0; }
 EOF
-if { (eval echo configure:4157: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:4163: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -4168,14 +4174,7 @@ LIBS="$ac_save_LIBS"
 fi
 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
   echo "$ac_t""yes" 1>&6
-    ac_tr_lib=HAVE_LIB`echo gpm | sed -e 's/[^a-zA-Z0-9_]/_/g' \
-    -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
-  cat >> confdefs.h <<EOF
-#define $ac_tr_lib 1
-EOF
-
-  LIBS="-lgpm $LIBS"
-
+  LIBS="$cf_ncurses_SAVE"
 else
   echo "$ac_t""no" 1>&6
 cf_ncurses_LIBS="-lgpm"
@@ -4191,7 +4190,7 @@ freebsd*)
 	# This is only necessary if you are linking against an obsolete
 	# version of ncurses (but it should do no harm, since it's static).
 	echo $ac_n "checking for tgoto in -lmytinfo""... $ac_c" 1>&6
-echo "configure:4195: checking for tgoto in -lmytinfo" >&5
+echo "configure:4194: checking for tgoto in -lmytinfo" >&5
 ac_lib_var=`echo mytinfo'_'tgoto | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -4199,7 +4198,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lmytinfo  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 4203 "configure"
+#line 4202 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -4210,7 +4209,7 @@ int main() {
 tgoto()
 ; return 0; }
 EOF
-if { (eval echo configure:4214: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:4213: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -4238,12 +4237,12 @@ LIBS="$cf_ncurses_LIBS $LIBS"
 	cf_cv_have_lib_ncurses=no
 	cf_libdir=""
 	echo $ac_n "checking for initscr""... $ac_c" 1>&6
-echo "configure:4242: checking for initscr" >&5
+echo "configure:4241: checking for initscr" >&5
 if eval "test \"`echo '$''{'ac_cv_func_initscr'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4247 "configure"
+#line 4246 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char initscr(); below.  */
@@ -4266,7 +4265,7 @@ initscr();
 
 ; return 0; }
 EOF
-if { (eval echo configure:4270: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:4269: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_initscr=yes"
 else
@@ -4286,17 +4285,17 @@ else
 
 		cf_save_LIBS="$LIBS"
 		echo $ac_n "checking for initscr in -lncurses""... $ac_c" 1>&6
-echo "configure:4290: checking for initscr in -lncurses" >&5
+echo "configure:4289: checking for initscr in -lncurses" >&5
 		LIBS="-lncurses $LIBS"
 		cat > conftest.$ac_ext <<EOF
-#line 4293 "configure"
+#line 4292 "configure"
 #include "confdefs.h"
 #include <$cf_cv_ncurses_header>
 int main() {
 initscr()
 ; return 0; }
 EOF
-if { (eval echo configure:4300: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:4299: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   echo "$ac_t""yes" 1>&6
 			 cf_cv_have_lib_ncurses=yes
@@ -4323,17 +4322,17 @@ test "$prefix" != /usr           && cf_search="$cf_search /usr/lib /usr/lib/ncur
 			for cf_libdir in $cf_search
 			do
 				echo $ac_n "checking for -lncurses in $cf_libdir""... $ac_c" 1>&6
-echo "configure:4327: checking for -lncurses in $cf_libdir" >&5
+echo "configure:4326: checking for -lncurses in $cf_libdir" >&5
 				LIBS="-L$cf_libdir -lncurses $cf_save_LIBS"
 				cat > conftest.$ac_ext <<EOF
-#line 4330 "configure"
+#line 4329 "configure"
 #include "confdefs.h"
 #include <$cf_cv_ncurses_header>
 int main() {
 initscr()
 ; return 0; }
 EOF
-if { (eval echo configure:4337: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:4336: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   echo "$ac_t""yes" 1>&6
 			 		 cf_cv_have_lib_ncurses=yes
@@ -4360,7 +4359,7 @@ fi
 
 if test -n "$cf_ncurses_LIBS" ; then
 	echo $ac_n "checking if we can link ncurses without $cf_ncurses_LIBS""... $ac_c" 1>&6
-echo "configure:4364: checking if we can link ncurses without $cf_ncurses_LIBS" >&5
+echo "configure:4363: checking if we can link ncurses without $cf_ncurses_LIBS" >&5
 	cf_ncurses_SAVE="$LIBS"
 	for p in $cf_ncurses_LIBS ; do
 		q=`echo $LIBS | sed -e 's/'$p' //' -e 's/'$p'$//'`
@@ -4369,14 +4368,14 @@ echo "configure:4364: checking if we can link ncurses without $cf_ncurses_LIBS"
 		fi
 	done
 	cat > conftest.$ac_ext <<EOF
-#line 4373 "configure"
+#line 4372 "configure"
 #include "confdefs.h"
 #include <$cf_cv_ncurses_header>
 int main() {
 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
 ; return 0; }
 EOF
-if { (eval echo configure:4380: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:4379: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   echo "$ac_t""yes" 1>&6
 else
@@ -4392,6 +4391,95 @@ fi
 	;;
 slang)
 	
+echo $ac_n "checking for slang header file""... $ac_c" 1>&6
+echo "configure:4396: checking for slang header file" >&5
+if eval "test \"`echo '$''{'cf_cv_slang_header'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  
+	cat > conftest.$ac_ext <<EOF
+#line 4402 "configure"
+#include "confdefs.h"
+#include <slang.h>
+int main() {
+printf("%s\n", SLANG_VERSION)
+; return 0; }
+EOF
+if { (eval echo configure:4409: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+  rm -rf conftest*
+  cf_cv_slang_header=predefined
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  
+	cf_search=""
+if test -d "$includedir"  ; then
+test "$includedir" != NONE       && cf_search="$cf_search $includedir $includedir/slang"
+fi
+if test -d "$oldincludedir"  ; then
+test "$oldincludedir" != NONE    && cf_search="$cf_search $oldincludedir $oldincludedir/slang"
+fi
+if test -d "$prefix"; then
+test "$prefix" != NONE           && cf_search="$cf_search $prefix/include $prefix/include/slang"
+fi
+test "$prefix" != /usr/local     && cf_search="$cf_search /usr/local/include /usr/local/include/slang"
+test "$prefix" != /usr           && cf_search="$cf_search /usr/include /usr/include/slang"
+
+	for cf_incdir in $cf_search
+	do
+		for cf_header in \
+			slang.h
+		do
+			if egrep "SLANG_VERSION" $cf_incdir/$cf_header 1>&5 2>&1; then
+				cf_cv_slang_header=$cf_incdir/$cf_header 
+				break
+			fi
+		done
+		test -n "$cf_cv_slang_header" && break
+	done
+	test -z "$cf_cv_slang_header" && { echo "configure: error: not found" 1>&2; exit 1; }
+	
+fi
+rm -f conftest*
+fi
+
+echo "$ac_t""$cf_cv_slang_header" 1>&6
+cat >> confdefs.h <<\EOF
+#define USE_SLANG 1
+EOF
+
+
+cf_incdir=`echo $cf_cv_slang_header | sed -e 's:/[^/]*$::'`
+
+case $cf_cv_slang_header in # (vi
+predefined) # (vi
+	;;
+*)
+	
+for cf_add_incdir in $cf_incdir
+do
+	while true
+	do
+		case $cf_add_incdir in
+		/usr/include) # (vi
+			;;
+		*) # (vi
+			CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
+			;;
+		esac
+		cf_top_incdir=`echo $cf_add_incdir | sed -e 's:/include/.*$:/include:'`
+		test "$cf_top_incdir" = "$cf_add_incdir" && break
+		cf_add_incdir="$cf_top_incdir"
+	done
+done
+
+	;;
+esac
+
+	
+cf_slang_LIBS1="$LIBS"
+
 if eval "test \"`echo '$''{'cf_cv_lib_termcap'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -4400,7 +4488,7 @@ cf_cv_lib_termcap=none
 # HP-UX 9.x terminfo has setupterm, but no tigetstr.
 if test "$termlib" = none; then
 	echo $ac_n "checking for tigetstr in -ltermlib""... $ac_c" 1>&6
-echo "configure:4404: checking for tigetstr in -ltermlib" >&5
+echo "configure:4492: checking for tigetstr in -ltermlib" >&5
 ac_lib_var=`echo termlib'_'tigetstr | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -4408,7 +4496,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-ltermlib  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 4412 "configure"
+#line 4500 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -4419,7 +4507,7 @@ int main() {
 tigetstr()
 ; return 0; }
 EOF
-if { (eval echo configure:4423: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:4511: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -4442,7 +4530,7 @@ fi
 fi
 if test "$cf_cv_lib_termcap" = none; then
 	echo $ac_n "checking for tgoto in -ltermlib""... $ac_c" 1>&6
-echo "configure:4446: checking for tgoto in -ltermlib" >&5
+echo "configure:4534: checking for tgoto in -ltermlib" >&5
 ac_lib_var=`echo termlib'_'tgoto | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -4450,7 +4538,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-ltermlib  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 4454 "configure"
+#line 4542 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -4461,7 +4549,7 @@ int main() {
 tgoto()
 ; return 0; }
 EOF
-if { (eval echo configure:4465: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:4553: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -4485,7 +4573,7 @@ fi
 if test "$cf_cv_lib_termcap" = none; then
 	# allow curses library for broken AIX system.
 	echo $ac_n "checking for initscr in -lcurses""... $ac_c" 1>&6
-echo "configure:4489: checking for initscr in -lcurses" >&5
+echo "configure:4577: checking for initscr in -lcurses" >&5
 ac_lib_var=`echo curses'_'initscr | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -4493,7 +4581,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lcurses  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 4497 "configure"
+#line 4585 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -4504,7 +4592,7 @@ int main() {
 initscr()
 ; return 0; }
 EOF
-if { (eval echo configure:4508: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:4596: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -4525,7 +4613,7 @@ else
 fi
 
 	echo $ac_n "checking for tgoto in -ltermcap""... $ac_c" 1>&6
-echo "configure:4529: checking for tgoto in -ltermcap" >&5
+echo "configure:4617: checking for tgoto in -ltermcap" >&5
 ac_lib_var=`echo termcap'_'tgoto | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -4533,7 +4621,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-ltermcap  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 4537 "configure"
+#line 4625 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -4544,7 +4632,7 @@ int main() {
 tgoto()
 ; return 0; }
 EOF
-if { (eval echo configure:4548: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:4636: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -4567,7 +4655,7 @@ fi
 fi
 if test "$cf_cv_lib_termcap" = none; then
 	echo $ac_n "checking for tgoto in -ltermcap""... $ac_c" 1>&6
-echo "configure:4571: checking for tgoto in -ltermcap" >&5
+echo "configure:4659: checking for tgoto in -ltermcap" >&5
 ac_lib_var=`echo termcap'_'tgoto | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -4575,7 +4663,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-ltermcap  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 4579 "configure"
+#line 4667 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -4586,7 +4674,7 @@ int main() {
 tgoto()
 ; return 0; }
 EOF
-if { (eval echo configure:4590: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:4678: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -4609,7 +4697,7 @@ fi
 fi
 if test "$cf_cv_lib_termcap" = none; then
 	echo $ac_n "checking for tgoto in -lncurses""... $ac_c" 1>&6
-echo "configure:4613: checking for tgoto in -lncurses" >&5
+echo "configure:4701: checking for tgoto in -lncurses" >&5
 ac_lib_var=`echo ncurses'_'tgoto | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -4617,7 +4705,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lncurses  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 4621 "configure"
+#line 4709 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -4628,7 +4716,7 @@ int main() {
 tgoto()
 ; return 0; }
 EOF
-if { (eval echo configure:4632: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:4720: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -4656,101 +4744,14 @@ if test "$cf_cv_lib_termcap" = none; then
 	{ echo "configure: error: Can't find -ltermlib, -lcurses, or -ltermcap" 1>&2; exit 1; }
 fi
 
-	
-echo $ac_n "checking for slang header file""... $ac_c" 1>&6
-echo "configure:4662: checking for slang header file" >&5
-if eval "test \"`echo '$''{'cf_cv_slang_header'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  
-	cat > conftest.$ac_ext <<EOF
-#line 4668 "configure"
-#include "confdefs.h"
-#include <slang.h>
-int main() {
-printf("%s\n", SLANG_VERSION)
-; return 0; }
-EOF
-if { (eval echo configure:4675: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
-  rm -rf conftest*
-  cf_cv_slang_header=predefined
-else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  
-	cf_search=""
-if test -d "$includedir"  ; then
-test "$includedir" != NONE       && cf_search="$cf_search $includedir $includedir/slang"
-fi
-if test -d "$oldincludedir"  ; then
-test "$oldincludedir" != NONE    && cf_search="$cf_search $oldincludedir $oldincludedir/slang"
-fi
-if test -d "$prefix"; then
-test "$prefix" != NONE           && cf_search="$cf_search $prefix/include $prefix/include/slang"
-fi
-test "$prefix" != /usr/local     && cf_search="$cf_search /usr/local/include /usr/local/include/slang"
-test "$prefix" != /usr           && cf_search="$cf_search /usr/include /usr/include/slang"
-
-	for cf_incdir in $cf_search
-	do
-		for cf_header in \
-			slang.h
-		do
-			if egrep "SLANG_VERSION" $cf_incdir/$cf_header 1>&5 2>&1; then
-				cf_cv_slang_header=$cf_incdir/$cf_header 
-				break
-			fi
-		done
-		test -n "$cf_cv_slang_header" && break
-	done
-	test -z "$cf_cv_slang_header" && { echo "configure: error: not found" 1>&2; exit 1; }
-	
-fi
-rm -f conftest*
-fi
-
-echo "$ac_t""$cf_cv_slang_header" 1>&6
-cat >> confdefs.h <<\EOF
-#define USE_SLANG 1
-EOF
-
-
-cf_incdir=`echo $cf_cv_slang_header | sed -e 's:/[^/]*$::'`
-
-case $cf_cv_slang_header in # (vi
-predefined) # (vi
-	;;
-*)
-	
-for cf_add_incdir in $cf_incdir
-do
-	while true
-	do
-		case $cf_add_incdir in
-		/usr/include) # (vi
-			;;
-		*) # (vi
-			CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
-			;;
-		esac
-		cf_top_incdir=`echo $cf_add_incdir | sed -e 's:/include/.*$:/include:'`
-		test "$cf_top_incdir" = "$cf_add_incdir" && break
-		cf_add_incdir="$cf_top_incdir"
-	done
-done
-
-	;;
-esac
-
-	
+cf_slang_LIBS2="$LIBS"
 echo $ac_n "checking for acos""... $ac_c" 1>&6
-echo "configure:4749: checking for acos" >&5
+echo "configure:4750: checking for acos" >&5
 if eval "test \"`echo '$''{'ac_cv_func_acos'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4754 "configure"
+#line 4755 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char acos(); below.  */
@@ -4773,7 +4774,7 @@ acos();
 
 ; return 0; }
 EOF
-if { (eval echo configure:4777: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:4778: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_acos=yes"
 else
@@ -4792,7 +4793,7 @@ else
   echo "$ac_t""no" 1>&6
 
 echo $ac_n "checking for acos in -lm""... $ac_c" 1>&6
-echo "configure:4796: checking for acos in -lm" >&5
+echo "configure:4797: checking for acos in -lm" >&5
 ac_lib_var=`echo m'_'acos | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -4800,7 +4801,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lm $LIBS $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 4804 "configure"
+#line 4805 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -4811,7 +4812,7 @@ int main() {
 acos()
 ; return 0; }
 EOF
-if { (eval echo configure:4815: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:4816: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -4851,12 +4852,12 @@ fi
 	cf_cv_have_lib_slang=no
 	cf_libdir=""
 	echo $ac_n "checking for SLtt_get_screen_size""... $ac_c" 1>&6
-echo "configure:4855: checking for SLtt_get_screen_size" >&5
+echo "configure:4856: checking for SLtt_get_screen_size" >&5
 if eval "test \"`echo '$''{'ac_cv_func_SLtt_get_screen_size'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4860 "configure"
+#line 4861 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char SLtt_get_screen_size(); below.  */
@@ -4879,7 +4880,7 @@ SLtt_get_screen_size();
 
 ; return 0; }
 EOF
-if { (eval echo configure:4883: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:4884: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_SLtt_get_screen_size=yes"
 else
@@ -4899,17 +4900,17 @@ else
 
 		cf_save_LIBS="$LIBS"
 		echo $ac_n "checking for SLtt_get_screen_size in -lslang""... $ac_c" 1>&6
-echo "configure:4903: checking for SLtt_get_screen_size in -lslang" >&5
+echo "configure:4904: checking for SLtt_get_screen_size in -lslang" >&5
 		LIBS="-lslang $LIBS"
 		cat > conftest.$ac_ext <<EOF
-#line 4906 "configure"
+#line 4907 "configure"
 #include "confdefs.h"
 #include <slang.h>
 int main() {
 SLtt_get_screen_size()
 ; return 0; }
 EOF
-if { (eval echo configure:4913: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:4914: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   echo "$ac_t""yes" 1>&6
 			 cf_cv_have_lib_slang=yes
@@ -4936,17 +4937,17 @@ test "$prefix" != /usr           && cf_search="$cf_search /usr/lib /usr/lib/slan
 			for cf_libdir in $cf_search
 			do
 				echo $ac_n "checking for -lslang in $cf_libdir""... $ac_c" 1>&6
-echo "configure:4940: checking for -lslang in $cf_libdir" >&5
+echo "configure:4941: checking for -lslang in $cf_libdir" >&5
 				LIBS="-L$cf_libdir -lslang $cf_save_LIBS"
 				cat > conftest.$ac_ext <<EOF
-#line 4943 "configure"
+#line 4944 "configure"
 #include "confdefs.h"
 #include <slang.h>
 int main() {
 SLtt_get_screen_size()
 ; return 0; }
 EOF
-if { (eval echo configure:4950: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:4951: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   echo "$ac_t""yes" 1>&6
 			 		 cf_cv_have_lib_slang=yes
@@ -4970,6 +4971,35 @@ if test $cf_cv_have_lib_slang = no ; then
 	{ echo "configure: error: Cannot link slang library" 1>&2; exit 1; }
 fi
 
+cf_slang_LIBS3="$LIBS"
+echo $ac_n "checking if we can link slang without termcap""... $ac_c" 1>&6
+echo "configure:4977: checking if we can link slang without termcap" >&5
+if test -n "$cf_slang_LIBS1" ; then
+	cf_exclude=`echo ".$cf_slang_LIBS2" | sed -e "s@$cf_slang_LIBS1@@" -e 's@^.@@'`
+else
+	cf_exclude="$cf_slang_LIBS2"
+fi
+LIBS=`echo ".$cf_slang_LIBS3" | sed -e "s@$cf_exclude@@" -e 's@^.@@'`
+cat > conftest.$ac_ext <<EOF
+#line 4985 "configure"
+#include "confdefs.h"
+#include <slang.h>
+int main() {
+SLtt_get_screen_size()
+; return 0; }
+EOF
+if { (eval echo configure:4992: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+  rm -rf conftest*
+  cf_result=yes
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  cf_result=no
+fi
+rm -f conftest*
+echo "$ac_t""$cf_result" 1>&6
+test $cf_result = no && LIBS="$cf_slang_LIBS3"
 
 	;;
 esac
@@ -4978,7 +5008,7 @@ eval cf_libdir=$libdir
 cf_libdir=`echo $cf_libdir | sed -e s@'^NONE/'@$ac_default_prefix/@`
 
 echo $ac_n "checking for location of config-file""... $ac_c" 1>&6
-echo "configure:4982: checking for location of config-file" >&5
+echo "configure:5012: checking for location of config-file" >&5
 LYNX_CFG_FILE=$cf_libdir/lynx.cfg
 cat >> confdefs.h <<EOF
 #define LYNX_CFG_FILE "$LYNX_CFG_FILE"
@@ -4988,12 +5018,12 @@ echo "$ac_t""$LYNX_CFG_FILE" 1>&6
 
 
 echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
-echo "configure:4992: checking for ANSI C header files" >&5
+echo "configure:5022: checking for ANSI C header files" >&5
 if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4997 "configure"
+#line 5027 "configure"
 #include "confdefs.h"
 #include <stdlib.h>
 #include <stdarg.h>
@@ -5001,7 +5031,7 @@ else
 #include <float.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:5005: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:5035: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -5018,7 +5048,7 @@ rm -f conftest*
 if test $ac_cv_header_stdc = yes; then
   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
 cat > conftest.$ac_ext <<EOF
-#line 5022 "configure"
+#line 5052 "configure"
 #include "confdefs.h"
 #include <string.h>
 EOF
@@ -5036,7 +5066,7 @@ 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 <<EOF
-#line 5040 "configure"
+#line 5070 "configure"
 #include "confdefs.h"
 #include <stdlib.h>
 EOF
@@ -5057,7 +5087,7 @@ if test "$cross_compiling" = yes; then
   :
 else
   cat > conftest.$ac_ext <<EOF
-#line 5061 "configure"
+#line 5091 "configure"
 #include "confdefs.h"
 #include <ctype.h>
 #define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
@@ -5068,7 +5098,7 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
 exit (0); }
 
 EOF
-if { (eval echo configure:5072: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:5102: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
 then
   :
 else
@@ -5092,12 +5122,12 @@ EOF
 fi
 
 echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6
-echo "configure:5096: checking whether time.h and sys/time.h may both be included" >&5
+echo "configure:5126: checking whether time.h and sys/time.h may both be included" >&5
 if eval "test \"`echo '$''{'ac_cv_header_time'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 5101 "configure"
+#line 5131 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <sys/time.h>
@@ -5106,7 +5136,7 @@ int main() {
 struct tm *tp;
 ; return 0; }
 EOF
-if { (eval echo configure:5110: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5140: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_header_time=yes
 else
@@ -5131,12 +5161,12 @@ for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr that defines DIR""... $ac_c" 1>&6
-echo "configure:5135: checking for $ac_hdr that defines DIR" >&5
+echo "configure:5165: checking for $ac_hdr that defines DIR" >&5
 if eval "test \"`echo '$''{'ac_cv_header_dirent_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 5140 "configure"
+#line 5170 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <$ac_hdr>
@@ -5144,7 +5174,7 @@ int main() {
 DIR *dirp = 0;
 ; return 0; }
 EOF
-if { (eval echo configure:5148: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5178: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   eval "ac_cv_header_dirent_$ac_safe=yes"
 else
@@ -5169,7 +5199,7 @@ done
 # Two versions of opendir et al. are in -ldir and -lx on SCO Xenix.
 if test $ac_header_dirent = dirent.h; then
 echo $ac_n "checking for opendir in -ldir""... $ac_c" 1>&6
-echo "configure:5173: checking for opendir in -ldir" >&5
+echo "configure:5203: checking for opendir in -ldir" >&5
 ac_lib_var=`echo dir'_'opendir | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -5177,7 +5207,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-ldir  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 5181 "configure"
+#line 5211 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -5188,7 +5218,7 @@ int main() {
 opendir()
 ; return 0; }
 EOF
-if { (eval echo configure:5192: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:5222: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -5210,7 +5240,7 @@ fi
 
 else
 echo $ac_n "checking for opendir in -lx""... $ac_c" 1>&6
-echo "configure:5214: checking for opendir in -lx" >&5
+echo "configure:5244: checking for opendir in -lx" >&5
 ac_lib_var=`echo x'_'opendir | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -5218,7 +5248,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lx  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 5222 "configure"
+#line 5252 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -5229,7 +5259,7 @@ int main() {
 opendir()
 ; return 0; }
 EOF
-if { (eval echo configure:5233: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:5263: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -5267,17 +5297,17 @@ for ac_hdr in \
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:5271: checking for $ac_hdr" >&5
+echo "configure:5301: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 5276 "configure"
+#line 5306 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:5281: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:5311: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -5305,13 +5335,13 @@ done
 
 
 echo $ac_n "checking termio.h and termios.h""... $ac_c" 1>&6
-echo "configure:5309: checking termio.h and termios.h" >&5
+echo "configure:5339: checking termio.h and termios.h" >&5
 if eval "test \"`echo '$''{'cf_cv_termio_and_termios'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
     cat > conftest.$ac_ext <<EOF
-#line 5315 "configure"
+#line 5345 "configure"
 #include "confdefs.h"
 
 #if HAVE_TERMIO_H
@@ -5324,7 +5354,7 @@ int main() {
 putchar (0x0a)
 ; return 0; }
 EOF
-if { (eval echo configure:5328: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5358: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   cf_cv_termio_and_termios=yes
 else
@@ -5347,17 +5377,17 @@ for ac_hdr in sys/wait.h
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:5351: checking for $ac_hdr" >&5
+echo "configure:5381: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 5356 "configure"
+#line 5386 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:5361: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:5391: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -5394,17 +5424,17 @@ for ac_hdr in wait.h
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:5398: checking for $ac_hdr" >&5
+echo "configure:5428: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 5403 "configure"
+#line 5433 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:5408: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:5438: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -5434,17 +5464,17 @@ for ac_hdr in waitstatus.h
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:5438: checking for $ac_hdr" >&5
+echo "configure:5468: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 5443 "configure"
+#line 5473 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:5448: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:5478: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -5485,13 +5515,13 @@ fi
 
 
 echo $ac_n "checking for union wait""... $ac_c" 1>&6
-echo "configure:5489: checking for union wait" >&5
+echo "configure:5519: checking for union wait" >&5
 if eval "test \"`echo '$''{'cf_cv_type_unionwait'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
 	cat > conftest.$ac_ext <<EOF
-#line 5495 "configure"
+#line 5525 "configure"
 #include "confdefs.h"
 $cf_wait_headers
 int main() {
@@ -5502,7 +5532,7 @@ int x;
 	
 ; return 0; }
 EOF
-if { (eval echo configure:5506: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:5536: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   cf_cv_type_unionwait=no
 	 echo compiles ok w/o union wait 1>&5
@@ -5513,7 +5543,7 @@ else
   rm -rf conftest*
   
 	cat > conftest.$ac_ext <<EOF
-#line 5517 "configure"
+#line 5547 "configure"
 #include "confdefs.h"
 $cf_wait_headers
 int main() {
@@ -5528,7 +5558,7 @@ union wait x;
 	
 ; return 0; }
 EOF
-if { (eval echo configure:5532: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:5562: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   cf_cv_type_unionwait=yes
 	 echo compiles ok with union wait and possibly macros too 1>&5
@@ -5555,20 +5585,20 @@ EOF
 if test $cf_cv_type_unionwait = yes; then
 
 	echo $ac_n "checking if union wait can be used as wait-arg""... $ac_c" 1>&6
-echo "configure:5559: checking if union wait can be used as wait-arg" >&5
+echo "configure:5589: checking if union wait can be used as wait-arg" >&5
 	if eval "test \"`echo '$''{'cf_cv_arg_union_wait'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
 		cat > conftest.$ac_ext <<EOF
-#line 5565 "configure"
+#line 5595 "configure"
 #include "confdefs.h"
 $cf_wait_headers
 int main() {
 union wait x; wait(&x)
 ; return 0; }
 EOF
-if { (eval echo configure:5572: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5602: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   cf_cv_arg_union_wait=yes
 else
@@ -5588,20 +5618,20 @@ EOF
 
 
 	echo $ac_n "checking if union wait can be used as waitpid-arg""... $ac_c" 1>&6
-echo "configure:5592: checking if union wait can be used as waitpid-arg" >&5
+echo "configure:5622: checking if union wait can be used as waitpid-arg" >&5
 	if eval "test \"`echo '$''{'cf_cv_arg_union_waitpid'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
 		cat > conftest.$ac_ext <<EOF
-#line 5598 "configure"
+#line 5628 "configure"
 #include "confdefs.h"
 $cf_wait_headers
 int main() {
 union wait x; waitpid(0, &x, 0)
 ; return 0; }
 EOF
-if { (eval echo configure:5605: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5635: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   cf_cv_arg_union_waitpid=yes
 else
@@ -5623,12 +5653,12 @@ EOF
 fi
 
 echo $ac_n "checking for mode_t""... $ac_c" 1>&6
-echo "configure:5627: checking for mode_t" >&5
+echo "configure:5657: checking for mode_t" >&5
 if eval "test \"`echo '$''{'ac_cv_type_mode_t'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 5632 "configure"
+#line 5662 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #if STDC_HEADERS
@@ -5658,12 +5688,12 @@ fi
 
 
 echo $ac_n "checking for pid_t""... $ac_c" 1>&6
-echo "configure:5662: checking for pid_t" >&5
+echo "configure:5692: checking for pid_t" >&5
 if eval "test \"`echo '$''{'ac_cv_type_pid_t'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 5667 "configure"
+#line 5697 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #if STDC_HEADERS
@@ -5692,17 +5722,17 @@ fi
 
 ac_safe=`echo "vfork.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for vfork.h""... $ac_c" 1>&6
-echo "configure:5696: checking for vfork.h" >&5
+echo "configure:5726: checking for vfork.h" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 5701 "configure"
+#line 5731 "configure"
 #include "confdefs.h"
 #include <vfork.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:5706: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:5736: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -5727,18 +5757,18 @@ else
 fi
 
 echo $ac_n "checking for working vfork""... $ac_c" 1>&6
-echo "configure:5731: checking for working vfork" >&5
+echo "configure:5761: checking for working vfork" >&5
 if eval "test \"`echo '$''{'ac_cv_func_vfork_works'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   if test "$cross_compiling" = yes; then
   echo $ac_n "checking for vfork""... $ac_c" 1>&6
-echo "configure:5737: checking for vfork" >&5
+echo "configure:5767: checking for vfork" >&5
 if eval "test \"`echo '$''{'ac_cv_func_vfork'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 5742 "configure"
+#line 5772 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char vfork(); below.  */
@@ -5761,7 +5791,7 @@ vfork();
 
 ; return 0; }
 EOF
-if { (eval echo configure:5765: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:5795: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_vfork=yes"
 else
@@ -5782,7 +5812,7 @@ fi
 
 else
   cat > conftest.$ac_ext <<EOF
-#line 5786 "configure"
+#line 5816 "configure"
 #include "confdefs.h"
 /* Thanks to Paul Eggert for this test.  */
 #include <stdio.h>
@@ -5877,7 +5907,7 @@ main() {
   }
 }
 EOF
-if { (eval echo configure:5881: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:5911: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
 then
   ac_cv_func_vfork_works=yes
 else
@@ -5901,20 +5931,20 @@ fi
 
 
 echo $ac_n "checking for broken/missing definition of remove""... $ac_c" 1>&6
-echo "configure:5905: checking for broken/missing definition of remove" >&5
+echo "configure:5935: checking for broken/missing definition of remove" >&5
 if eval "test \"`echo '$''{'cf_cv_baddef_remove'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
 cat > conftest.$ac_ext <<EOF
-#line 5911 "configure"
+#line 5941 "configure"
 #include "confdefs.h"
 #include <stdio.h>
 int main() {
 remove("dummy")
 ; return 0; }
 EOF
-if { (eval echo configure:5918: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:5948: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   cf_cv_baddef_remove=no
 else
@@ -5922,7 +5952,7 @@ else
   cat conftest.$ac_ext >&5
   rm -rf conftest*
   cat > conftest.$ac_ext <<EOF
-#line 5926 "configure"
+#line 5956 "configure"
 #include "confdefs.h"
 #include <stdio.h>
 		int __unlink(name) { return unlink(name); } 
@@ -5930,7 +5960,7 @@ int main() {
 remove("dummy")
 ; return 0; }
 EOF
-if { (eval echo configure:5934: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:5964: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   cf_cv_baddef_remove=yes
 else
@@ -5958,16 +5988,17 @@ for ac_func in \
 	getgroups \
 	putenv \
 	readdir \
+	strerror \
 	waitpid \
 
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:5966: checking for $ac_func" >&5
+echo "configure:5997: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 5971 "configure"
+#line 6002 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -5990,7 +6021,7 @@ $ac_func();
 
 ; return 0; }
 EOF
-if { (eval echo configure:5994: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:6025: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -6020,12 +6051,12 @@ for ac_func in \
 
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:6024: checking for $ac_func" >&5
+echo "configure:6055: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 6029 "configure"
+#line 6060 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -6048,7 +6079,7 @@ $ac_func();
 
 ; return 0; }
 EOF
-if { (eval echo configure:6052: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:6083: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -6078,12 +6109,12 @@ done
 for ac_func in strstr
 do
 echo $ac_n "checking for $ac_func declaration""... $ac_c" 1>&6
-echo "configure:6082: checking for $ac_func declaration" >&5
+echo "configure:6113: checking for $ac_func declaration" >&5
 if eval "test \"`echo '$''{'ac_cv_func_decl_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 6087 "configure"
+#line 6118 "configure"
 #include "confdefs.h"
 #include <string.h>
 int main() {
@@ -6092,7 +6123,7 @@ int	(*p)() = ${ac_func};
 #endif
 ; return 0; }
 EOF
-if { (eval echo configure:6096: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:6127: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   eval "ac_cv_func_decl_$ac_func=yes"
 else
@@ -6122,12 +6153,12 @@ done
 for ac_func in getgrgid getgrnam
 do
 echo $ac_n "checking for $ac_func declaration""... $ac_c" 1>&6
-echo "configure:6126: checking for $ac_func declaration" >&5
+echo "configure:6157: checking for $ac_func declaration" >&5
 if eval "test \"`echo '$''{'ac_cv_func_decl_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 6131 "configure"
+#line 6162 "configure"
 #include "confdefs.h"
 #include <grp.h>
 int main() {
@@ -6136,7 +6167,7 @@ int	(*p)() = ${ac_func};
 #endif
 ; return 0; }
 EOF
-if { (eval echo configure:6140: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:6171: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   eval "ac_cv_func_decl_$ac_func=yes"
 else
@@ -6167,13 +6198,13 @@ done
 
 
 echo $ac_n "checking if TRUE/FALSE are defined""... $ac_c" 1>&6
-echo "configure:6171: checking if TRUE/FALSE are defined" >&5
+echo "configure:6202: checking if TRUE/FALSE are defined" >&5
 if eval "test \"`echo '$''{'cf_cv_bool_defs'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
 cat > conftest.$ac_ext <<EOF
-#line 6177 "configure"
+#line 6208 "configure"
 #include "confdefs.h"
 
 #include <$cf_cv_ncurses_header>
@@ -6182,7 +6213,7 @@ int main() {
 int x = TRUE, y = FALSE
 ; return 0; }
 EOF
-if { (eval echo configure:6186: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:6217: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   cf_cv_bool_defs=yes
 else
@@ -6207,55 +6238,99 @@ EOF
 fi
 
 
-echo $ac_n "checking for errno external decl""... $ac_c" 1>&6
-echo "configure:6212: checking for errno external decl" >&5
-if eval "test \"`echo '$''{'cf_cv_extern_errno'+set}'`\" = set"; then
+
+echo $ac_n "checking declaration of errno""... $ac_c" 1>&6
+echo "configure:6244: checking declaration of errno" >&5
+if eval "test \"`echo '$''{'cf_cv_dcl_errno'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
     cat > conftest.$ac_ext <<EOF
-#line 6218 "configure"
+#line 6250 "configure"
 #include "confdefs.h"
 
-#include <errno.h>
+#include <stdio.h>
+#include <sys/types.h>
+#include <errno.h> 
 int main() {
-int x = errno
+long x = (long) errno
 ; return 0; }
 EOF
-if { (eval echo configure:6226: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:6260: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
-  cf_cv_extern_errno=yes
+  eval 'cf_cv_dcl_'errno'=yes'
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -rf conftest*
-  cf_cv_extern_errno=no
+  eval 'cf_cv_dcl_'errno'=no'
 fi
 rm -f conftest*
 fi
 
-echo "$ac_t""$cf_cv_extern_errno" 1>&6
-test $cf_cv_extern_errno = no && cat >> confdefs.h <<\EOF
-#define DECL_ERRNO 1
+eval 'cf_result=$cf_cv_dcl_'errno
+echo "$ac_t""$cf_result" 1>&6
+
+# It's possible (for near-UNIX clones) that the data doesn't exist
+if test $cf_result = no ; then
+    eval 'cf_result=DECL_'errno
+    
+cf_result=`echo $cf_result | tr '[a-z]' '[A-Z]'`
+
+    cat >> confdefs.h <<EOF
+#define $cf_result 1
 EOF
 
+    echo $ac_n "checking existence of errno""... $ac_c" 1>&6
+echo "configure:6286: checking existence of errno" >&5
+    if eval "test \"`echo '$''{'cf_cv_have_errno'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  
+        cat > conftest.$ac_ext <<EOF
+#line 6292 "configure"
+#include "confdefs.h"
+
+#undef errno
+extern long errno;
+
+int main() {
+errno = 2
+; return 0; }
+EOF
+if { (eval echo configure:6302: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+  rm -rf conftest*
+  eval 'cf_cv_have_'errno'=yes'
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  eval 'cf_cv_have_'errno'=no'
+fi
+rm -f conftest*
+fi
+
+    eval 'cf_result=$cf_cv_have_'errno
+    echo "$ac_t""$cf_result" 1>&6
+fi
+
 
 
 echo $ac_n "checking for setlocale()""... $ac_c" 1>&6
-echo "configure:6246: checking for setlocale()" >&5
+echo "configure:6321: checking for setlocale()" >&5
 if eval "test \"`echo '$''{'cf_cv_locale'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
 cat > conftest.$ac_ext <<EOF
-#line 6252 "configure"
+#line 6327 "configure"
 #include "confdefs.h"
 #include <locale.h>
 int main() {
 setlocale(LC_ALL, "")
 ; return 0; }
 EOF
-if { (eval echo configure:6259: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:6334: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   cf_cv_locale=yes
 else
@@ -6276,13 +6351,13 @@ EOF
 
 
 echo $ac_n "checking if NGROUPS is defined""... $ac_c" 1>&6
-echo "configure:6280: checking if NGROUPS is defined" >&5
+echo "configure:6355: checking if NGROUPS is defined" >&5
 if eval "test \"`echo '$''{'cf_cv_ngroups'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
 cat > conftest.$ac_ext <<EOF
-#line 6286 "configure"
+#line 6361 "configure"
 #include "confdefs.h"
 
 #if HAVE_SYS_PARAM_H
@@ -6296,7 +6371,7 @@ int main() {
 int x = NGROUPS
 ; return 0; }
 EOF
-if { (eval echo configure:6300: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:6375: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   cf_cv_ngroups=yes
 else
@@ -6304,7 +6379,7 @@ else
   cat conftest.$ac_ext >&5
   rm -rf conftest*
   cat > conftest.$ac_ext <<EOF
-#line 6308 "configure"
+#line 6383 "configure"
 #include "confdefs.h"
 
 #if HAVE_SYS_PARAM_H
@@ -6318,7 +6393,7 @@ int main() {
 int x = NGROUPS_MAX
 ; return 0; }
 EOF
-if { (eval echo configure:6322: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:6397: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   cf_cv_ngroups=NGROUPS_MAX
 else
@@ -6348,81 +6423,95 @@ fi
 
 
 
-echo $ac_n "checking declaration of sys_errlist""... $ac_c" 1>&6
-echo "configure:6353: checking declaration of sys_errlist" >&5
-if eval "test \"`echo '$''{'cf_cv_dcl_sys_errlist'+set}'`\" = set"; then
+for cf_name in sys_nerr sys_errlist
+do
+    
+echo $ac_n "checking declaration of $cf_name""... $ac_c" 1>&6
+echo "configure:6431: checking declaration of $cf_name" >&5
+if eval "test \"`echo '$''{'cf_cv_dcl_$cf_name'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
     cat > conftest.$ac_ext <<EOF
-#line 6359 "configure"
+#line 6437 "configure"
 #include "confdefs.h"
 
 #include <stdio.h>
 #include <sys/types.h>
 #include <errno.h> 
 int main() {
-char *c = (char *) *sys_errlist
+long x = (long) $cf_name
 ; return 0; }
 EOF
-if { (eval echo configure:6369: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:6447: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
-  cf_cv_dcl_sys_errlist=yes
+  eval 'cf_cv_dcl_'$cf_name'=yes'
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -rf conftest*
-  cf_cv_dcl_sys_errlist=no
+  eval 'cf_cv_dcl_'$cf_name'=no'
 fi
 rm -f conftest*
 fi
 
-echo "$ac_t""$cf_cv_dcl_sys_errlist" 1>&6
+eval 'cf_result=$cf_cv_dcl_'$cf_name
+echo "$ac_t""$cf_result" 1>&6
 
-# It's possible (for near-UNIX clones) that sys_errlist doesn't exist
-if test $cf_cv_dcl_sys_errlist = no ; then
-    cat >> confdefs.h <<\EOF
-#define DECL_SYS_ERRLIST 1
+# It's possible (for near-UNIX clones) that the data doesn't exist
+if test $cf_result = no ; then
+    eval 'cf_result=DECL_'$cf_name
+    
+cf_result=`echo $cf_result | tr '[a-z]' '[A-Z]'`
+
+    cat >> confdefs.h <<EOF
+#define $cf_result 1
 EOF
 
-    echo $ac_n "checking existence of sys_errlist""... $ac_c" 1>&6
-echo "configure:6390: checking existence of sys_errlist" >&5
-    if eval "test \"`echo '$''{'cf_cv_have_sys_errlist'+set}'`\" = set"; then
+    echo $ac_n "checking existence of $cf_name""... $ac_c" 1>&6
+echo "configure:6473: checking existence of $cf_name" >&5
+    if eval "test \"`echo '$''{'cf_cv_have_$cf_name'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
         cat > conftest.$ac_ext <<EOF
-#line 6396 "configure"
+#line 6479 "configure"
 #include "confdefs.h"
-#include <errno.h>
+
+#undef $cf_name
+extern long $cf_name;
+
 int main() {
-char *c = (char *) *sys_errlist
+$cf_name = 2
 ; return 0; }
 EOF
-if { (eval echo configure:6403: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:6489: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
-  cf_cv_have_sys_errlist=yes
+  eval 'cf_cv_have_'$cf_name'=yes'
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -rf conftest*
-  cf_cv_have_sys_errlist=no
+  eval 'cf_cv_have_'$cf_name'=no'
 fi
 rm -f conftest*
 fi
 
-    echo "$ac_t""$cf_cv_have_sys_errlist" 1>&6
+    eval 'cf_result=$cf_cv_have_'$cf_name
+    echo "$ac_t""$cf_result" 1>&6
 fi
 
+done
+
 
 echo $ac_n "checking if struct utmp is declared""... $ac_c" 1>&6
-echo "configure:6420: checking if struct utmp is declared" >&5
+echo "configure:6509: checking if struct utmp is declared" >&5
 if eval "test \"`echo '$''{'cf_cv_have_utmp'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
 	cat > conftest.$ac_ext <<EOF
-#line 6426 "configure"
+#line 6515 "configure"
 #include "confdefs.h"
 
 #include <sys/types.h>
@@ -6431,7 +6520,7 @@ int main() {
 struct utmp x; char *y = &x.ut_host[0]
 ; return 0; }
 EOF
-if { (eval echo configure:6435: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:6524: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   cf_cv_have_utmp=yes
 else
@@ -6439,14 +6528,14 @@ else
   cat conftest.$ac_ext >&5
   rm -rf conftest*
   cat > conftest.$ac_ext <<EOF
-#line 6443 "configure"
+#line 6532 "configure"
 #include "confdefs.h"
 #include <utmpx.h>
 int main() {
 struct utmpx x; char *y = &x.ut_host[0]
 ; return 0; }
 EOF
-if { (eval echo configure:6450: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:6539: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   cf_cv_have_utmp=utmpx
 else
@@ -6477,13 +6566,13 @@ EOF
 if test $cf_cv_screen != slang ; then
 	
 echo $ac_n "checking if curses supports alternate-character set""... $ac_c" 1>&6
-echo "configure:6481: checking if curses supports alternate-character set" >&5
+echo "configure:6570: checking if curses supports alternate-character set" >&5
 if eval "test \"`echo '$''{'cf_cv_alt_char_set'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
 	cat > conftest.$ac_ext <<EOF
-#line 6487 "configure"
+#line 6576 "configure"
 #include "confdefs.h"
 
 #include <$cf_cv_ncurses_header>
@@ -6492,7 +6581,7 @@ int main() {
 chtype x = acs_map['l']; acs_map['m'] = 0
 ; return 0; }
 EOF
-if { (eval echo configure:6496: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:6585: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   cf_cv_alt_char_set=yes
 else
@@ -6512,13 +6601,13 @@ EOF
 
 	
 echo $ac_n "checking if curses supports fancy attributes""... $ac_c" 1>&6
-echo "configure:6516: checking if curses supports fancy attributes" >&5
+echo "configure:6605: checking if curses supports fancy attributes" >&5
 if eval "test \"`echo '$''{'cf_cv_fancy_curses'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
 	cat > conftest.$ac_ext <<EOF
-#line 6522 "configure"
+#line 6611 "configure"
 #include "confdefs.h"
 
 #include <$cf_cv_ncurses_header>
@@ -6531,7 +6620,7 @@ attrset(A_UNDERLINE|A_BOLD|A_REVERSE);
 	
 ; return 0; }
 EOF
-if { (eval echo configure:6535: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:6624: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   cf_cv_fancy_curses=yes
 else
@@ -6551,7 +6640,7 @@ EOF
 
 
 	echo $ac_n "checking for ncurses version""... $ac_c" 1>&6
-echo "configure:6555: checking for ncurses version" >&5
+echo "configure:6644: checking for ncurses version" >&5
 if eval "test \"`echo '$''{'cf_cv_ncurses_version'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -6576,7 +6665,7 @@ Autoconf "old"
 #endif
 EOF
 	cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
-	{ (eval echo configure:6580: \"$cf_try\") 1>&5; (eval $cf_try) 2>&5; }
+	{ (eval echo configure:6669: \"$cf_try\") 1>&5; (eval $cf_try) 2>&5; }
 	if test -f conftest.out ; then
 		cf_out=`cat conftest.out | sed -e 's@^Autoconf @@' -e 's@^[^"]*"@@' -e 's@".*@@'`
 		test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
@@ -6585,7 +6674,7 @@ EOF
 
 else
   cat > conftest.$ac_ext <<EOF
-#line 6589 "configure"
+#line 6678 "configure"
 #include "confdefs.h"
 
 #include <$cf_cv_ncurses_header>
@@ -6608,7 +6697,7 @@ int main()
 	exit(0);
 }
 EOF
-if { (eval echo configure:6612: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:6701: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
 then
   
 	cf_cv_ncurses_version=`cat $cf_tempfile`
@@ -6628,13 +6717,13 @@ echo "$ac_t""$cf_cv_ncurses_version" 1>&6
 
 if test "$cf_cv_ncurses_version" != no ; then
 echo $ac_n "checking for obsolete/broken version of ncurses""... $ac_c" 1>&6
-echo "configure:6632: checking for obsolete/broken version of ncurses" >&5
+echo "configure:6721: checking for obsolete/broken version of ncurses" >&5
 if eval "test \"`echo '$''{'cf_cv_ncurses_broken'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
 cat > conftest.$ac_ext <<EOF
-#line 6638 "configure"
+#line 6727 "configure"
 #include "confdefs.h"
 
 #include <$cf_cv_ncurses_header>
@@ -6648,7 +6737,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:6652: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:6741: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   cf_cv_ncurses_broken=no
 else
@@ -6673,13 +6762,13 @@ fi
 
 	
 echo $ac_n "checking if curses supports color attributes""... $ac_c" 1>&6
-echo "configure:6677: checking if curses supports color attributes" >&5
+echo "configure:6766: checking if curses supports color attributes" >&5
 if eval "test \"`echo '$''{'cf_cv_color_curses'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
 	cat > conftest.$ac_ext <<EOF
-#line 6683 "configure"
+#line 6772 "configure"
 #include "confdefs.h"
 
 #include <$cf_cv_ncurses_header>
@@ -6694,7 +6783,7 @@ chtype x = COLOR_BLUE;
 	
 ; return 0; }
 EOF
-if { (eval echo configure:6698: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:6787: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   cf_cv_color_curses=yes
 else
@@ -6721,7 +6810,7 @@ fi
 
 	
 echo $ac_n "checking declaration of size-change""... $ac_c" 1>&6
-echo "configure:6725: checking declaration of size-change" >&5
+echo "configure:6814: checking declaration of size-change" >&5
 if eval "test \"`echo '$''{'cf_cv_sizechange'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -6735,7 +6824,7 @@ do
     CFLAGS="$cf_save_CFLAGS"
     test -n "$cf_opts" && CFLAGS="$CFLAGS -D$cf_opts"
     cat > conftest.$ac_ext <<EOF
-#line 6739 "configure"
+#line 6828 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #if HAVE_TERMIOS_H
@@ -6770,7 +6859,7 @@ int main() {
 	
 ; return 0; }
 EOF
-if { (eval echo configure:6774: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:6863: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   cf_cv_sizechange=yes
 else
@@ -6802,20 +6891,20 @@ EOF
 
 	
 echo $ac_n "checking if ttytype is declared in curses library""... $ac_c" 1>&6
-echo "configure:6806: checking if ttytype is declared in curses library" >&5
+echo "configure:6895: checking if ttytype is declared in curses library" >&5
 if eval "test \"`echo '$''{'cf_cv_have_ttytype'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
 	cat > conftest.$ac_ext <<EOF
-#line 6812 "configure"
+#line 6901 "configure"
 #include "confdefs.h"
 #include <$cf_cv_ncurses_header>
 int main() {
 char *x = &ttytype[1]; *x = 1
 ; return 0; }
 EOF
-if { (eval echo configure:6819: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:6908: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   cf_cv_have_ttytype=yes
 else
@@ -6837,15 +6926,17 @@ EOF
 	for ac_func in \
 		cbreak \
 		keypad \
+		use_default_colors \
+		wborder \
 	
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:6844: checking for $ac_func" >&5
+echo "configure:6935: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 6849 "configure"
+#line 6940 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -6868,7 +6959,7 @@ $ac_func();
 
 ; return 0; }
 EOF
-if { (eval echo configure:6872: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:6963: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -6910,7 +7001,7 @@ EOF
 	EXTRA_DEPS="$EXTRA_DEPS do_chartrans_stuff"
 
 echo $ac_n "checking if color-style code should be used""... $ac_c" 1>&6
-echo "configure:6914: checking if color-style code should be used" >&5
+echo "configure:7005: checking if color-style code should be used" >&5
 # Check whether --enable-color-style or --disable-color-style was given.
 if test "${enable_color_style+set}" = set; then
   enableval="$enable_color_style"
@@ -6956,7 +7047,7 @@ EOF
 	echo "$ac_t""curses-style" 1>&6
 
 	echo $ac_n "checking for location of style-sheet file""... $ac_c" 1>&6
-echo "configure:6960: checking for location of style-sheet file" >&5
+echo "configure:7051: checking for location of style-sheet file" >&5
 	LYNX_LSS_FILE=$cf_libdir/lynx.lss
 	cat >> confdefs.h <<EOF
 #define LYNX_LSS_FILE "$LYNX_LSS_FILE"
@@ -6966,8 +7057,31 @@ EOF
 	;;
 esac
 
+echo $ac_n "checking if you want to use external commands""... $ac_c" 1>&6
+echo "configure:7062: checking if you want to use external commands" >&5
+# Check whether --enable-externs or --disable-externs was given.
+if test "${enable_externs+set}" = set; then
+  enableval="$enable_externs"
+  test "$enableval" != yes && enableval=no
+  if test "$enableval" != "no" ; then
+    use_externs=yes 
+  else
+    use_externs=no
+  fi
+else
+  enableval=no 
+  use_externs=no
+  
+fi
+
+echo "$ac_t""$use_externs" 1>&6
+test $use_externs != ".no" && cat >> confdefs.h <<\EOF
+#define USE_EXTERNS 1
+EOF
+
+
 echo $ac_n "checking if you want to use zlib for decompression of some gzip files""... $ac_c" 1>&6
-echo "configure:6971: checking if you want to use zlib for decompression of some gzip files" >&5
+echo "configure:7085: checking if you want to use zlib for decompression of some gzip files" >&5
 # Check whether --with-zlib or --without-zlib was given.
 if test "${with_zlib+set}" = set; then
   withval="$with_zlib"
@@ -6983,12 +7097,12 @@ if test ".$use_zlib" != ".no" ; then
 	cf_cv_have_lib_z=no
 	cf_libdir=""
 	echo $ac_n "checking for gzopen""... $ac_c" 1>&6
-echo "configure:6987: checking for gzopen" >&5
+echo "configure:7101: checking for gzopen" >&5
 if eval "test \"`echo '$''{'ac_cv_func_gzopen'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 6992 "configure"
+#line 7106 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char gzopen(); below.  */
@@ -7011,7 +7125,7 @@ gzopen();
 
 ; return 0; }
 EOF
-if { (eval echo configure:7015: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:7129: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_gzopen=yes"
 else
@@ -7031,17 +7145,17 @@ else
 
 		cf_save_LIBS="$LIBS"
 		echo $ac_n "checking for gzopen in -lz""... $ac_c" 1>&6
-echo "configure:7035: checking for gzopen in -lz" >&5
+echo "configure:7149: checking for gzopen in -lz" >&5
 		LIBS="-lz $LIBS"
 		cat > conftest.$ac_ext <<EOF
-#line 7038 "configure"
+#line 7152 "configure"
 #include "confdefs.h"
 #include <zlib.h>
 int main() {
 gzopen("name","mode")
 ; return 0; }
 EOF
-if { (eval echo configure:7045: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:7159: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   echo "$ac_t""yes" 1>&6
 			 cf_cv_have_lib_z=yes
@@ -7068,17 +7182,17 @@ test "$prefix" != /usr           && cf_search="$cf_search /usr/lib /usr/lib/z"
 			for cf_libdir in $cf_search
 			do
 				echo $ac_n "checking for -lz in $cf_libdir""... $ac_c" 1>&6
-echo "configure:7072: checking for -lz in $cf_libdir" >&5
+echo "configure:7186: checking for -lz in $cf_libdir" >&5
 				LIBS="-L$cf_libdir -lz $cf_save_LIBS"
 				cat > conftest.$ac_ext <<EOF
-#line 7075 "configure"
+#line 7189 "configure"
 #include "confdefs.h"
 #include <zlib.h>
 int main() {
 gzopen("name","mode")
 ; return 0; }
 EOF
-if { (eval echo configure:7082: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:7196: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   echo "$ac_t""yes" 1>&6
 			 		 cf_cv_have_lib_z=yes
@@ -7114,7 +7228,7 @@ fi
 # All DirEd functions that were enabled on compilation can be disabled
 # or modified at run time via DIRED_MENU symbols in lynx.cfg.
 echo $ac_n "checking if directory-editor code should be used""... $ac_c" 1>&6
-echo "configure:7118: checking if directory-editor code should be used" >&5
+echo "configure:7232: checking if directory-editor code should be used" >&5
 # Check whether --enable-dired or --disable-dired was given.
 if test "${enable_dired+set}" = set; then
   enableval="$enable_dired"
@@ -7139,7 +7253,7 @@ EOF
 
 
 	echo $ac_n "checking if you wish to allow extracting from archives via DirEd""... $ac_c" 1>&6
-echo "configure:7143: checking if you wish to allow extracting from archives via DirEd" >&5
+echo "configure:7257: checking if you wish to allow extracting from archives via DirEd" >&5
 	# Check whether --enable-dired-archive or --disable-dired-archive was given.
 if test "${enable_dired_archive+set}" = set; then
   enableval="$enable_dired_archive"
@@ -7157,7 +7271,7 @@ fi
 	echo "$ac_t""$enableval" 1>&6
 
 	echo $ac_n "checking if you wish to allow users to redefine DirEd keys""... $ac_c" 1>&6
-echo "configure:7161: checking if you wish to allow users to redefine DirEd keys" >&5
+echo "configure:7275: checking if you wish to allow users to redefine DirEd keys" >&5
 	# Check whether --enable-dired-override or --disable-dired-override was given.
 if test "${enable_dired_override+set}" = set; then
   enableval="$enable_dired_override"
@@ -7182,7 +7296,7 @@ fi
 	echo "$ac_t""$enableval" 1>&6
 
 	echo $ac_n "checking if you wish to allow permissions commands via DirEd""... $ac_c" 1>&6
-echo "configure:7186: checking if you wish to allow permissions commands via DirEd" >&5
+echo "configure:7300: checking if you wish to allow permissions commands via DirEd" >&5
 	# Check whether --enable-dired-permit or --disable-dired-permit was given.
 if test "${enable_dired_permit+set}" = set; then
   enableval="$enable_dired_permit"
@@ -7207,7 +7321,7 @@ fi
 	echo "$ac_t""$enableval" 1>&6
 
 	echo $ac_n "checking if you wish to allow executable-permission commands via DirEd""... $ac_c" 1>&6
-echo "configure:7211: checking if you wish to allow executable-permission commands via DirEd" >&5
+echo "configure:7325: checking if you wish to allow executable-permission commands via DirEd" >&5
 	# Check whether --enable-dired-xpermit or --disable-dired-xpermit was given.
 if test "${enable_dired_xpermit+set}" = set; then
   enableval="$enable_dired_xpermit"
@@ -7225,7 +7339,7 @@ fi
 	echo "$ac_t""$enableval" 1>&6
 
 	echo $ac_n "checking if you wish to allow \"tar\" commands from DirEd""... $ac_c" 1>&6
-echo "configure:7229: checking if you wish to allow \"tar\" commands from DirEd" >&5
+echo "configure:7343: checking if you wish to allow \"tar\" commands from DirEd" >&5
 	# Check whether --enable-dired-tar or --disable-dired-tar was given.
 if test "${enable_dired_tar+set}" = set; then
   enableval="$enable_dired_tar"
@@ -7250,7 +7364,7 @@ fi
 	echo "$ac_t""$enableval" 1>&6
 
 	echo $ac_n "checking if you wish to allow \"uudecode\" commands from DirEd""... $ac_c" 1>&6
-echo "configure:7254: checking if you wish to allow \"uudecode\" commands from DirEd" >&5
+echo "configure:7368: checking if you wish to allow \"uudecode\" commands from DirEd" >&5
 	# Check whether --enable-dired-uudecode or --disable-dired-uudecode was given.
 if test "${enable_dired_uudecode+set}" = set; then
   enableval="$enable_dired_uudecode"
@@ -7275,7 +7389,7 @@ fi
 	echo "$ac_t""$enableval" 1>&6
 
 	echo $ac_n "checking if you wish to allow \"zip\" and \"unzip\" commands from DirEd""... $ac_c" 1>&6
-echo "configure:7279: checking if you wish to allow \"zip\" and \"unzip\" commands from DirEd" >&5
+echo "configure:7393: checking if you wish to allow \"zip\" and \"unzip\" commands from DirEd" >&5
 	# Check whether --enable-dired-zip or --disable-dired-zip was given.
 if test "${enable_dired_zip+set}" = set; then
   enableval="$enable_dired_zip"
@@ -7300,7 +7414,7 @@ fi
 	echo "$ac_t""$enableval" 1>&6
 
 	echo $ac_n "checking if you wish to allow \"gzip\" and \"gunzip\" commands from DirEd""... $ac_c" 1>&6
-echo "configure:7304: checking if you wish to allow \"gzip\" and \"gunzip\" commands from DirEd" >&5
+echo "configure:7418: checking if you wish to allow \"gzip\" and \"gunzip\" commands from DirEd" >&5
 	# Check whether --enable-dired-gzip or --disable-dired-gzip was given.
 if test "${enable_dired_gzip+set}" = set; then
   enableval="$enable_dired_gzip"
@@ -7326,7 +7440,7 @@ fi
 fi
 
 echo $ac_n "checking if you want long-directory listings""... $ac_c" 1>&6
-echo "configure:7330: checking if you want long-directory listings" >&5
+echo "configure:7444: checking if you want long-directory listings" >&5
 # Check whether --enable-long-list or --disable-long-list was given.
 if test "${enable_long_list+set}" = set; then
   enableval="$enable_long_list"
@@ -7351,7 +7465,7 @@ fi
 echo "$ac_t""$enableval" 1>&6
 
 echo $ac_n "checking if parent-directory references are permitted""... $ac_c" 1>&6
-echo "configure:7355: checking if parent-directory references are permitted" >&5
+echo "configure:7469: checking if parent-directory references are permitted" >&5
 # Check whether --enable-parent-dir-refs or --disable-parent-dir-refs was given.
 if test "${enable_parent_dir_refs+set}" = set; then
   enableval="$enable_parent_dir_refs"
diff --git a/configure.in b/configure.in
index d56702c7..d0962e02 100644
--- a/configure.in
+++ b/configure.in
@@ -47,7 +47,7 @@ CF_ARG_ENABLE(debug,
 AC_MSG_RESULT($with_debug)
 if test "$with_debug" = "yes" ; then
 	case $host_os in
-	ultrix*|osf[34].*)
+	ultrix*|osf*)
 		CF_STRIP_O_OPT(CFLAGS)
 		if test -z "$GCC" ; then
 			CFLAGS="$CFLAGS -g3"
@@ -56,7 +56,7 @@ if test "$with_debug" = "yes" ; then
 	esac
 else
 	case $host_os in
-	ultrix*) #(vi
+	ultrix*|osf*) #(vi
 		CF_STRIP_G_OPT(CFLAGS)
 		;;
 	*)
@@ -265,7 +265,6 @@ ncurses)
 	CF_NCURSES_LIBS
 	;;
 slang)
-	CF_TERMCAP_LIBS
 	CF_SLANG_CPPFLAGS
 	CF_SLANG_LIBS
 	;;
@@ -318,6 +317,7 @@ AC_CHECK_FUNCS( \
 	getgroups \
 	putenv \
 	readdir \
+	strerror \
 	waitpid \
 )
 AC_REPLACE_FUNCS( \
@@ -351,6 +351,8 @@ if test $cf_cv_screen != slang ; then
 	AC_CHECK_FUNCS( \
 		cbreak \
 		keypad \
+		use_default_colors \
+		wborder \
 	)
 fi
 
@@ -410,6 +412,14 @@ no)
 	;;
 esac
 
+AC_MSG_CHECKING(if you want to use external commands)
+CF_ARG_ENABLE(externs,
+[  --enable-externs        use external commands],
+	[use_externs=yes],
+	[use_externs=no])
+AC_MSG_RESULT($use_externs)
+test $use_externs != ".no" && AC_DEFINE(USE_EXTERNS)
+
 AC_MSG_CHECKING(if you want to use zlib for decompression of some gzip files)
 AC_ARG_WITH(zlib,
 [  --with-zlib             use zlib for decompression of some gzip files],
diff --git a/lynx.cfg b/lynx.cfg
index e7bde81f..80a7af5c 100644
--- a/lynx.cfg
+++ b/lynx.cfg
@@ -271,17 +271,23 @@ DEFAULT_INDEX_FILE:http://www.ncsa.uiuc.edu/SDG/Software/Mosaic/MetaIndex.html
 # as the preferred language.  If available, the document will be
 # transmitted in that language.  Users can override this setting via
 # the 'o'ptions menu and save that preference in their RC file.
+# This may be a comma-separated list of languages in decreasing preference.
 #
 #PREFERRED_LANGUAGE:en
 
 # PREFERRED_CHARSET specifies the character set in MIME notation (e.g.,
 # "ISO-8859-2", "ISO-8859-5") which Lynx will indicate you prefer in
-# requests to http servers using an Accept-Charsets header.  The value
-# should NOT include "ISO-8859-1" or "US-ASCII", since those values are
-# always assumed by default.  If a file in that character set is available,
-# the server will send it.  Otherwise, the server will send the file in
-# ISO-8859-1 or US-ASCII.  Users can change or eliminate this definition
-# via the 'o'ptions menu and save that preference in their RC file.
+# requests to http servers using an Accept-Charsets header. Users can
+# change it via the 'o'ptions menu and save that preference in their RC file.
+# The value should NOT include "ISO-8859-1" or "US-ASCII",
+# since those values are always assumed by default.
+# If a file in that character set is available, the server will send it.
+# If no Accept-Charset header is present, the default is that any
+# character set is acceptable. If an Accept-Charset header is present,
+# and if the server cannot send a response which is acceptable
+# according to the Accept-Charset header, then the server SHOULD send
+# an error response with the 406 (not acceptable) status code, though
+# the sending of an unacceptable response is also allowed. (RFC2068)
 #
 #PREFERRED_CHARSET:
 
@@ -1679,3 +1685,21 @@ MINIMAL_COMMENTS:TRUE
 #
 # EXTERNAL:ftp:wget %s &:TRUE
 
+# Raw DOS Key hack
+# This will bypass the DOS key hack if is compiled in.
+# The hack is as follows:
+# if (c == 0) c = '/';
+# if (c > 255) {      /* handle raw dos keys */
+#		switch (c)
+#		{
+#			case 464: c = '-'; break;  /* keypad minus*/
+#			case 465: c = '+'; break;  /* keypad plus*/
+#			case 459: c = 13; break;  /* keypad enter*/
+#			case 463: c = '*'; break;  /* keypad * */
+#			case 440: c = 'Q'; break;  /* alt x */
+#			default: break;
+#		}
+#	}
+#
+# RAW_DOS_KEY_HACK = TRUE
+
diff --git a/makefile.in b/makefile.in
index 356a778d..c6576614 100644
--- a/makefile.in
+++ b/makefile.in
@@ -1,6 +1,7 @@
 ##makefile for lynx
 
 SHELL = /bin/sh
+.SUFFIXES:
 @SET_MAKE@
 prefix		= @prefix@
 exec_prefix	= @exec_prefix@
@@ -35,6 +36,9 @@ mandir= @mandir@/man1
 ## Where you want the lynx.cfg file installed
 libdir= @libdir@
 
+## Where you want the help-files installed
+helpdir= @libdir@/lynx_help
+
 installbin= @INSTALL_PROGRAM@ -s -m 755
 installdoc= @INSTALL_DATA@
 
@@ -127,6 +131,7 @@ SITE_DEFS = # Your defines here
 # -DSOCKS          For making a SOCKSified lynx.
 # -DUNDERLINE_LINKS  Define if you want links underlined instead of bold.
 # -DUSE_COLOR_STYLE (see README.configure)
+# -DUSE_EXTERNS    (see README.configure)
 # -DUSE_HASH       (see README.configure)
 # -DUSE_SLANG      (see README.configure)
 # -DUSE_ZLIB       To use some functions from zlib library if you have it.
@@ -161,9 +166,12 @@ SITE_DEFS = # Your defines here
 # TESTED: Linux FreeBSD SunOS Solaris IRIX CLIX HP-UX AIX SCO
 all lynx:
 	cd WWW/Library/unix && $(MAKE) CC="$(CC)" \
+		LY_CFLAGS="$(CFLAGS)"
+		CPPFLAGS="$(CPPFLAGS)" \
 		LYFLAGS="$(SITE_LYDEFS)"
 	cd src && $(MAKE) all CC="$(CC)" \
 		CFLAGS="$(CFLAGS)" \
+		CPPFLAGS="$(CPPFLAGS)" \
 		LIBS="$(LIBS) $(RESOLVLIB) $(WAISLIB) $(SOCKSLIB) $(SITE_LIBS)" \
 		SITE_DEFS="$(SITE_DEFS)" \
 		WWWINC=$(WWWINC) \
@@ -199,10 +207,12 @@ distclean: clean
 	-cd src/chrtrans && $(MAKE) $@
 	-rm -f *~ *.bak *.sav
 	-rm -f WWW/Library/unix/makefile src/makefile src/chrtrans/makefile
+	@SRCDIR_CLEAN@-find . -type f -name '*.rej' -exec -rm -f {} \;
+	@SRCDIR_CLEAN@-find . -type f -name '*.orig' -exec -rm -f {} \;
 	@SRCDIR_CLEAN@-rmdir WWW/Library/unix && rmdir WWW/Library && rmdir WWW
 	@SRCDIR_CLEAN@-rmdir src/chrtrans && rmdir src
 	-rm -f makefile lynx_cfg.h config.status config.log config.cache
-	-rm -f lynx
+	-rm -f lynx install-*
 
 maintainer-clean: distclean
 	-rm -rf WWW/Library/*/obsolete
@@ -231,17 +241,34 @@ save:
 compress: tar
 	cd ..; rm -f $(lynxname).tar.Z; compress -f -v $(lynxname).tar
 
-install: lynx $(bindir) $(mandir) $(libdir)
+install: lynx install-bin install-man install-help install-cfg
+
+install-bin: $(bindir)
 	-mv -f $(bindir)/lynx $(bindir)/lynx.old
-	-mv -f $(libdir)/lynx.cfg $(libdir)/lynx.oldcfg
 	$(installbin) lynx $(bindir)/lynx
+
+install-man : $(mandir) 
 	$(installdoc) lynx.man $(mandir)/lynx.1
-	$(installdoc) lynx.cfg $(libdir)/lynx.cfg
+
+install-help : $(helpdir)
+	(cd $(helpdir) && rm -rf *)
+	(cd $(srcdir)/lynx_help && tar cf - . ) | ( cd $(helpdir) && tar xf - )
+	(cd $(srcdir) && tar cf - CHANGES* PROBLEMS README samples test ) | \
+			       ( cd $(helpdir) && tar xf - )
+
+install-cfg :
+	-mv -f $(libdir)/lynx.cfg $(libdir)/lynx.oldcfg
+	sed	-e '/^HELPFILE:http/s@^@#@' \
+		-e '/^#HELPFILE:file/s@#@@' \
+		-e '/^HELPFILE:file/s@/PATH_TO/lynx_help@$(helpdir)@' \
+		lynx.cfg >$(libdir)/lynx.cfg
+	chmod 0644 $(libdir)/lynx.cfg
 
 uninstall:
 	-rm -f $(bindir)/lynx
 	-rm -f $(mandir)/lynx.1
 	-rm -f $(libdir)/lynx.cfg
+	-rm -rf $(libdir)/lynx_help
 
-$(bindir) $(mandir) $(libdir) :
+$(bindir) $(mandir) $(libdir) $(helpdir) :
 	$(srcdir)/mkdirs.sh $@
diff --git a/mkdirs.sh b/mkdirs.sh
index 3ea69794..9a20f822 100755
--- a/mkdirs.sh
+++ b/mkdirs.sh
@@ -7,6 +7,7 @@
 #
 
 errstatus=0
+umask 022
 
 for file in ${1+"$@"} ; do
    set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'`
diff --git a/samples/lynx.lss b/samples/lynx.lss
index 1e0e70fe..77109762 100644
--- a/samples/lynx.lss
+++ b/samples/lynx.lss
@@ -7,7 +7,7 @@ em:bold:brightblue
 strong:bold:brightred
 b:bold:red
 i:bold:blue
-alink:reverse:yellow
+alink:reverse:yellow:black
 a:bold:green
 img:dim:brown
 status:reverse:yellow:blue
@@ -17,7 +17,7 @@ hr:normal:yellow
 blockquote:normal:brightblue
 ul:normal:brown
 address:normal:magenta
-title:normal:magenta:black
+title:normal:magenta:default
 tt:dim:gray:blue
 h1:bold:yellow:blue
 label:normal:magenta
diff --git a/src/GridText.c b/src/GridText.c
index 2cfae408..1848efa4 100644
--- a/src/GridText.c
+++ b/src/GridText.c
@@ -7155,9 +7155,9 @@ PUBLIC void HText_SubmitForm ARGS4(
 		    /* those specials will be trivial */
 		} else if (UCNeedNotTranslate(form_ptr->value_cs, target_cs)) {
 		    /* already ok */
-		} else if (UCCanTranslateFromTo(form_ptr->value_cs, target_cs)) {
+		} else if (UCCanTranslateFromTo(form_ptr->value_cs, target_cs) != TQ_NO) {
 		    /* also ok */
-		} else if (UCCanTranslateFromTo(target_cs, form_ptr->value_cs)) {
+		} else if (UCCanTranslateFromTo(target_cs, form_ptr->value_cs) != TQ_NO) {
 		    target_cs = form_ptr->value_cs; 	/* try this */
 		    target_csname = NULL; /* will be set after loop */
 		} else {
@@ -7175,9 +7175,9 @@ PUBLIC void HText_SubmitForm ARGS4(
 		    /* those specials will be trivial */
 		} else if (UCNeedNotTranslate(form_ptr->name_cs, target_cs)) {
 		    /* already ok */
-		} else if (UCCanTranslateFromTo(form_ptr->name_cs, target_cs)) {
+		} else if (UCCanTranslateFromTo(form_ptr->name_cs, target_cs) != TQ_NO) {
 		    /* also ok */
-		} else if (UCCanTranslateFromTo(target_cs, form_ptr->name_cs)) {
+		} else if (UCCanTranslateFromTo(target_cs, form_ptr->name_cs) != TQ_NO) {
 		    target_cs = form_ptr->value_cs; 	/* try this */
 		    target_csname = NULL; /* will be set after loop */
 		} else {
diff --git a/src/LYBookmark.c b/src/LYBookmark.c
index 24fa5614..faacac0a 100644
--- a/src/LYBookmark.c
+++ b/src/LYBookmark.c
@@ -317,6 +317,9 @@ PUBLIC void save_bookmark_link ARGS2(
      *  Create the bookmark file, if it doesn't exist already,
      *  Otherwise, open the pre-existing bookmark file. - FM
      */
+#if defined(__DJGPP__) || defined(_WINDOWS)
+                _fmode = O_TEXT;
+#endif /* __DJGPP__  or _WINDOWS */
     if (first_time) {
         /*
 	 *  Seek it in the home path. - FM
@@ -375,6 +378,9 @@ PUBLIC void save_bookmark_link ARGS2(
     }
     fclose(fp);
 
+#if defined(__DJGPP__) || defined(_WINDOWS)
+              _fmode = O_BINARY;
+#endif /* __DJGPP__ or _WINDOWS */
     /*
      *  If this is a cached bookmark file, set nocache for
      *  it so we'll see the new bookmark link when that
diff --git a/src/LYCharUtils.c b/src/LYCharUtils.c
index 20969f52..4de3728e 100644
--- a/src/LYCharUtils.c
+++ b/src/LYCharUtils.c
@@ -1083,7 +1083,7 @@ PRIVATE char ** LYUCFullyTranslateString_1 ARGS9(
 	do_ent = FALSE;
 
     /* Can't do, caller should figure out what to do... */
-    if (!UCCanTranslateFromTo(cs_from, cs_to)) {
+    if (UCCanTranslateFromTo(cs_from, cs_to) == TQ_NO) {
 	if (cs_to < 0)
 	    return NULL;
 	if (!do_ent && no_bytetrans)
@@ -3225,7 +3225,7 @@ PRIVATE BOOL LYUCTranslateString ARGS7(
 	return YES;
 
     /* Can't do, caller should figure out what to do... */
-    else if (!UCCanTranslateFromTo(cs_from, cs_to))
+    else if (UCCanTranslateFromTo(cs_from, cs_to) == TQ_NO)
 	return NO;
     /*
     **  Start a clean copy of the string, without
@@ -3679,7 +3679,7 @@ PUBLIC void LYHandleMETA ARGS4(
 	    *cp4 = '\0';
 	    cp4 = cp3;
 	    chndl = UCGetLYhndl_byMIME(cp3);
-	    if (UCCanTranslateFromTo(chndl, current_char_set)) {
+	    if (UCCanTranslateFromTo(chndl, current_char_set) != TQ_NO) {
 		chartrans_ok = YES;
 		StrAllocCopy(me->node_anchor->charset, cp4);
 		HTAnchor_setUCInfoStage(me->node_anchor, chndl,
@@ -3690,7 +3690,7 @@ PUBLIC void LYHandleMETA ARGS4(
 		 *  Got something but we don't recognize it.
 		 */
 		chndl = UCLYhndl_for_unrec;
-		if (UCCanTranslateFromTo(chndl, current_char_set)) {
+		if (UCCanTranslateFromTo(chndl, current_char_set) != TQ_NO) {
 		    chartrans_ok = YES;
 		    HTAnchor_setUCInfoStage(me->node_anchor, chndl,
 					    UCT_STAGE_PARSER,
diff --git a/src/LYCurses.c b/src/LYCurses.c
index 3ab3c51c..bea0ad43 100644
--- a/src/LYCurses.c
+++ b/src/LYCurses.c
@@ -6,6 +6,7 @@
 #include "LYGlobalDefs.h"
 #include "LYSignal.h"
 #include "LYClean.h"
+#include "LYReadCFG.h"
 #include "LYStrings.h"
 #include "LYCharSets.h"
 #include "UCAux.h"
@@ -37,7 +38,7 @@ extern int _NOSHARE(COLS);
 #endif
 
 #if defined(COLOR_CURSES)
-int lynx_has_color = 0;
+int lynx_has_color = FALSE;
 #endif
 
 /*
@@ -236,7 +237,7 @@ PUBLIC void LYbox ARGS2(
      *  specifiy our own ASCII characters for the corners and call
      *  wborder() instead of box(). - kw
      */
-#ifdef FANCY_CURSES
+#ifdef HAVE_WBORDER
     if (!boxvert || !boxhori)
 	box(win, boxvert, boxhori);
     else if (boxvert == '*' || boxhori == '*')
@@ -560,12 +561,10 @@ PUBLIC int lynx_chg_color ARGS3(
 	int, bg
 	)
 {
-    if (color >= 0 && color < 8
-     && fg >= 0 && fg < 16
-     && bg >= 0 && bg < 16) {
-	lynx_color_cfg[color].fg = fg & 7;
-	lynx_color_cfg[color].bg = bg & 7;
-	lynx_color_cfg[color].attr = (fg & 8) ? A_BOLD : A_NORMAL;
+    if (color >= 0 && color < 8) {
+	lynx_color_cfg[color].fg = (fg > 7) ? (fg & 7) : fg;
+	lynx_color_cfg[color].bg = (bg > 7) ? (bg & 7) : bg;
+	lynx_color_cfg[color].attr = ((fg > 7) && (fg & 8)) ? A_BOLD : A_NORMAL;
 	lynx_map_color(color);
     } else {
 	return -1;
@@ -590,13 +589,11 @@ PUBLIC void lynx_standout ARGS1(int, flag)
 
 PRIVATE void lynx_init_colors NOARGS
 {
-    lynx_has_color = FALSE;
-
-    if (has_colors()) {
+    if (lynx_has_color) {
 	int n, m;
 
-	lynx_has_color = TRUE;
-	start_color();
+	lynx_color_cfg[0].fg = default_fg;
+	lynx_color_cfg[0].bg = default_bg;
 
 	for (n = 0; n < sizeof(lynx_color_cfg)/sizeof(lynx_color_cfg[0]); n++) {
 	    for (m = 0; m <= 16; m += 8) {
@@ -634,7 +631,6 @@ PUBLIC void start_curses NOARGS
 		  initscr();      /* start curses */
 		  first_time = FALSE;
 		  cbreak();
-		  noecho();
 		  keypad(stdscr, TRUE);
 		  fflush(stdin);
 		  fflush(stdout);
@@ -651,6 +647,7 @@ PUBLIC void start_curses NOARGS
 
 	 LYCursesON = TRUE;
 	 clear();
+         noecho();
 }
 #else
 PUBLIC void start_curses NOARGS
@@ -792,17 +789,27 @@ PUBLIC void start_curses NOARGS
 	}
 #endif
 
+#if defined(USE_COLOR_STYLE) || defined(USE_COLOR_TABLE)
+	if (has_colors()) {
+	    lynx_has_color = TRUE;
+	    start_color();
+#if HAVE_USE_DEFAULT_COLORS
+	    if (use_default_colors() == OK) {
+		default_fg = DEFAULT_COLOR;
+		default_bg = DEFAULT_COLOR;
+	    }
+#endif
+	}
+#endif /* USE_COLOR_STYLE || USE_COLOR_TABLE */
+
 #ifdef USE_COLOR_STYLE
-	lynx_has_color = has_colors();
-	if (lynx_has_color)
-		start_color();
 	parse_userstyles();
 #endif
 	first_time = FALSE;
 #if USE_COLOR_TABLE
 	lynx_init_colors();
 	lynx_called_initscr = TRUE;
-#endif /* USE_SLANG */
+#endif /* USE_COLOR_TABLE */
     }
 #endif /* VMS */
 
diff --git a/src/LYEdit.c b/src/LYEdit.c
index 38346c90..6b3c0736 100644
--- a/src/LYEdit.c
+++ b/src/LYEdit.c
@@ -144,12 +144,16 @@ PUBLIC int edit_current_file ARGS3(
                                                                 filename);
 #endif /* DOSPATH */
     else
+#ifdef __DJGPP__
+        sprintf(command, "%s %s", editor, HTDOS_name(filename));
+#else
 	sprintf(command, "%s \"%s\"", editor,
 #ifdef DOSPATH
 				 HTDOS_name(filename));
 #else
 				 filename);
 #endif /* DOSPATH */
+#endif /* __DJGPP__ */
 #endif /* VMS */
     if (TRACE) {
 	fprintf(stderr, "LYEdit: %s\n", command);
diff --git a/src/LYGlobalDefs.h b/src/LYGlobalDefs.h
index ee2939b6..c66b26bd 100644
--- a/src/LYGlobalDefs.h
+++ b/src/LYGlobalDefs.h
@@ -326,6 +326,10 @@ extern BOOLEAN LYForceSSLCookiesSecure;
 extern BOOLEAN LYNoCc;
 extern BOOLEAN LYPreparsedSource;	/* Show source as preparsed?	 */
 
+#ifdef RAWDOSKEYHACK
+extern BOOLEAN raw_dos_key_hack; /* Turn on and off DOS key hack */
+#endif /* RAWDOSKEYHACK */
+
 #ifndef VMS
 extern BOOLEAN LYNoCore;
 #endif /* !VMS */
diff --git a/src/LYMain.c b/src/LYMain.c
index 5a6875e3..c3d208cd 100644
--- a/src/LYMain.c
+++ b/src/LYMain.c
@@ -201,6 +201,9 @@ PUBLIC BOOLEAN system_editor = FALSE;
 #ifdef USE_EXTERNALS
 PUBLIC BOOLEAN no_externals = FALSE;
 #endif
+#ifdef RAWDOSKEYHACK
+PUBLIC BOOLEAN raw_dos_key_hack = TRUE;
+#endif /* RAWDOSKEYHACK */
 PUBLIC BOOLEAN no_inside_telnet = FALSE;
 PUBLIC BOOLEAN no_outside_telnet = FALSE;
 PUBLIC BOOLEAN no_telnet_port = FALSE;
@@ -530,8 +533,6 @@ PUBLIC int main ARGS2(
 	int err;
 	WORD wVerReq;
 
-	_fmode = O_BINARY;
-
 	wVerReq = MAKEWORD(1,1);
 
 	err = WSAStartup(wVerReq, &WSAData);
@@ -546,7 +547,16 @@ PUBLIC int main ARGS2(
 
 #ifdef DJGPP
     sock_init();
-    _fmode = O_BINARY;
+#endif
+
+#if defined(_WINDOWS) || defined(DJGPP)
+        /*
+        * To prevent corrupting binary data with _WINDOWS and DJGPP
+        * we open files and stdout in BINARY mode by default.
+        * Where necessary we should open and (close!) TEXT mode.
+        */
+        _fmode = O_BINARY;
+	setmode( fileno( stdout ), O_BINARY );
 #endif
 
 #ifdef DOSPATH
@@ -815,7 +825,8 @@ PUBLIC int main ARGS2(
 		StrAllocCopy(lynx_lss_file, argv[i+1]);
 		i++;
 	    }
-	    fprintf(stderr, "LYMain found -lss flag, lss file is %s\n",
+	    if (TRACE)
+		fprintf(stderr, "LYMain found -lss flag, lss file is %s\n",
 		    lynx_lss_file ? lynx_lss_file : "<NONE>");
 #endif
 	}
@@ -898,7 +909,8 @@ PUBLIC int main ARGS2(
 		    if (*cp)
 			StrAllocCopy(lynx_cfg_file, cp);
 	        }
-		fprintf(stderr, "LYMain found -lss flag, lss file is %s\n",
+		if (TRACE)
+		    fprintf(stderr, "LYMain found -lss flag, lss file is %s\n",
 			lynx_lss_file ? lynx_lss_file : "<NONE>");
 #endif
 	    } else if (strcmp(buf, "-get_data") == 0) {
diff --git a/src/LYOptions.c b/src/LYOptions.c
index 5d657a7a..e48ada2e 100644
--- a/src/LYOptions.c
+++ b/src/LYOptions.c
@@ -796,7 +796,7 @@ draw_options:
 		if (use_assume_charset) {
 		    int i, curval;
 		    char ** assume_list;
-		    assume_list = calloc(LYNumCharsets + 1, sizeof(char *));
+		    assume_list = (char **)calloc(LYNumCharsets + 1, sizeof(char *));
 		    if (!assume_list) {
 			outofmem(__FILE__, "options");
 		    }
diff --git a/src/LYPrint.c b/src/LYPrint.c
index b466ff74..e4903ede 100644
--- a/src/LYPrint.c
+++ b/src/LYPrint.c
@@ -223,6 +223,9 @@ PUBLIC int printfile ARGS1(
      */
     switch (type) {
 	case TO_FILE:
+#if defined(__DJGPP__) || defined(_WINDOWS)
+                _fmode = O_TEXT;
+#endif /* __DJGPP__  or _WINDOWS */
 		_statusline(FILENAME_PROMPT);
 	retry:	strcpy(filename, sug_filename);  /* add suggestion info */
 		/* make the sug_filename conform to system specs */
@@ -477,6 +480,9 @@ PUBLIC int printfile ARGS1(
 #else
 		HTAddSugFilename(buffer);
 #endif /* VMS */
+#if defined(__DJGPP__) || defined(_WINDOWS)
+              _fmode = O_BINARY;
+#endif /* __DJGPP__ or _WINDOWS */
 		break;
 
 	case MAIL: 
diff --git a/src/LYReadCFG.c b/src/LYReadCFG.c
index 070fbcfc..87d31358 100644
--- a/src/LYReadCFG.c
+++ b/src/LYReadCFG.c
@@ -288,28 +288,16 @@ PRIVATE void add_printer_to_list ARGS2(
     }
 }
 
-#if USE_COLOR_TABLE
-#ifdef DOSPATH /* I.E. broken curses */
-static char *Color_Strings[16] =
-{
-	 "black",
-	 "blue",
-	 "green",
-	 "cyan",
-	 "red",
-	 "magenta",
-	 "brown",
-	 "lightgray",
-	 "gray",
-	 "brightblue",
-	 "brightgreen",
-	 "brightcyan",
-	 "brightred",
-	 "brightmagenta",
-	 "yellow",
-	 "white"
-};
-#else
+#if defined(USE_COLOR_STYLE) || defined(USE_COLOR_TABLE)
+
+#ifdef USE_SLANG
+#define COLOR_WHITE 7
+#define COLOR_BLACK 0
+#endif
+
+int default_fg = COLOR_WHITE;
+int default_bg = COLOR_BLACK;
+
 static char *Color_Strings[16] =
 {
     "black",
@@ -329,22 +317,47 @@ static char *Color_Strings[16] =
     "brightcyan",
     "white"
 };
-#endif /* DOSPATH (broken curses) */
+
+#ifdef DOSPATH
+/*
+ * PDCurses (and possibly some other implementations) use a non-ANSI set of
+ * codes for colors.
+ */
+PRIVATE int ColorCode ARGS1(
+	int,	color)
+{
+	static int map[] = {
+		0,  4,  2,  6, 1,  5,  3,  7,
+		8, 12, 10, 14, 9, 13, 11, 15 };
+	return map[n];
+}
+#else
+#define ColorCode(n) (n)
+#endif
 
 /*
  *  Validator for COLOR fields.
  */
-PRIVATE int check_color ARGS1(
-	char *,	color)
+PUBLIC int check_color ARGS2(
+	char *,	color,
+	int,	the_default)
 {
     int i;
 
+    if (!strcasecmp(color, "default"))
+	return the_default;
+    if (!strcasecmp(color, "nocolor"))
+	return NO_COLOR;
+
     for (i = 0; i < 16; i++) {
-	if (!strcmp(color, Color_Strings[i]))
-	    return i;
+	if (!strcasecmp(color, Color_Strings[i]))
+	    return ColorCode(i);
     }
-    return -1;
+    return ERR_COLOR;
 }
+#endif /* USE_COLOR_STYLE || USE_COLOR_TABLE */
+
+#if defined(USE_COLOR_TABLE)
 
 /*
  *  Exit routine for failed COLOR parsing.
@@ -358,7 +371,8 @@ Syntax Error parsing COLOR in configuration file:\n\
 The line must be of the form:\n\
 COLOR:INTEGER:FOREGROUND:BACKGROUND\n\
 \n\
-Here FOREGROUND and BACKGROUND must be one of:\n"
+Here FOREGROUND and BACKGROUND must be one of:\n\
+The special strings 'nocolor' or 'default', or\n"
 	    );
     for (i = 0; i < 16; i += 4) {
 	fprintf(stderr, "%16s %16s %16s %16s\n",
@@ -412,13 +426,15 @@ PRIVATE void parse_color ARGS1(
     *bg++ = 0;
 
 #if defined(USE_SLANG)
-    if ((-1 == check_color(fg)) ||
-        (-1 == check_color(bg)))
+    if ((check_color(fg, default_fg) < 0) ||
+        (check_color(bg, default_bg) < 0))
 	exit_with_color_syntax(parse_color_line);
 
     SLtt_set_color(color, NULL, fg, bg);
 #else
-    if (lynx_chg_color(color, check_color(fg), check_color(bg)) < 0)
+    if (lynx_chg_color(color,
+	check_color(fg, default_fg),
+	check_color(bg, default_bg)) < 0)
 	exit_with_color_syntax(parse_color_line);
 #endif
 }
@@ -1040,6 +1056,14 @@ PUBLIC void read_cfg ARGS1(
 	}
 	break;
 
+#ifdef RAWDOSKEYHACK
+	case 'R':
+	if (!strncasecomp(buffer, "RAW_DOS_KEY_HACK:", 17)) {
+		 raw_dos_key_hack = is_true(buffer+17);
+	}
+	break;
+#endif /* RAWDOSKEYHACK */
+
 	case 'S':
 	if (!strncasecomp(buffer, "SAVE_SPACE:", 11)) {
 	    StrAllocCopy(lynx_save_space, buffer+11);
diff --git a/src/LYReadCFG.h b/src/LYReadCFG.h
index a16ce4ac..7cf805c0 100644
--- a/src/LYReadCFG.h
+++ b/src/LYReadCFG.h
@@ -1,4 +1,3 @@
-
 #ifndef LYREADCFG_H
 #define LYREADCFG_H
 
@@ -6,8 +5,19 @@
 #include "LYStructs.h"
 #endif /* LYSTRUCTS_H */
 
+#if defined(USE_COLOR_STYLE) || defined(USE_COLOR_TABLE)
+
+#define DEFAULT_COLOR -1
+#define NO_COLOR      -2
+#define ERR_COLOR     -3
+
+extern int default_fg;
+extern int default_bg;
+
+extern int check_color PARAMS((char * color, int the_default));
+#endif
+
 extern void read_cfg PARAMS((char *cfg_filename));
 extern BOOLEAN have_read_cfg;
 
 #endif /* LYREADCFG_H */
-
diff --git a/src/LYStrings.c b/src/LYStrings.c
index 868590df..9e995b39 100644
--- a/src/LYStrings.c
+++ b/src/LYStrings.c
@@ -349,7 +349,8 @@ re_read:
    }
 #endif /* !USE_SLANG || VMS */
 
-#ifdef DOSPATH
+#ifdef RAWDOSKEYHACK
+ if (raw_dos_key_hack) {
 	if (c == 0) c = '/';
 	if (c > 255) {      /* handle raw dos keys */
 		switch (c)
@@ -362,7 +363,9 @@ re_read:
 			default: break;
 		}
 	}
-#endif
+ }
+#endif /* RAWDOSKEYHACK */
+
 #ifdef USE_GETCHAR
     if (c == EOF && errno == EINTR)	/* Ctrl-Z causes EINTR in getchar() */
         goto re_read;
@@ -613,6 +616,34 @@ re_read:
 	   c=127;		   /* backspace key (delete, not Ctrl-H) */
 	   break;
 #endif /* KEY_BACKSPACE */
+#ifdef KEY_DC
+	case KEY_DC:
+	   c=REMOVE_KEY;	   /* delete character */
+	   break;
+#endif /* KEY_DC */
+#ifdef KEY_IC
+	case KEY_IC:
+	   c=INSERT_KEY;	   /* insert character */
+	   break;
+#endif /* KEY_IC */
+#ifdef KEY_FIND
+	case KEY_FIND:
+	   c=FIND_KEY;		   /* find */
+	   break;
+#endif /* KEY_FIND */
+#ifdef KEY_SELECT
+	case KEY_SELECT:
+	   c=SELECT_KEY;	   /* select */
+	   break;
+#endif /* KEY_SELECT */
+#ifdef KEY_F
+	case KEY_F(1):
+	   c=F1;		   /* help-key */
+	   break;
+	case KEY_F(16):
+	   c=DO_KEY;		   /* help-key */
+	   break;
+#endif /* KEY_F */
 
 #ifdef NCURSES_MOUSE_VERSION
 	case KEY_MOUSE:
diff --git a/src/LYStyle.c b/src/LYStyle.c
index a596214e..082f0a6b 100644
--- a/src/LYStyle.c
+++ b/src/LYStyle.c
@@ -1,6 +1,6 @@
 /* character level styles for Lynx
  * (c) 1996 Rob Partington -- donated to the Lyncei (if they want it :-)
- * @Id: LYStyle.c 1.13 Wed, 22 Oct 1997 08:29:34 -0600 dickey @
+ * @Id: LYStyle.c 1.15 Sat, 13 Dec 1997 16:30:40 -0700 dickey @
  */
 #include "HTUtils.h"
 #include "HTML.h"
@@ -9,6 +9,7 @@
 #include "LYGlobalDefs.h"
 
 #include "LYStructs.h"
+#include "LYReadCFG.h"
 #include "LYCurses.h"
 #include "LYCharUtils.h"
 #include "AttrList.h"
@@ -40,30 +41,14 @@ static char *Mono_Strings[7] =
  "normal", "bold", "reverse", "underline", "standout", "blink", "dim"
 };
 
-/* definitions for the colour attributes we can use */
-static int ncursesColors[8] = {
- COLOR_BLACK, COLOR_RED, COLOR_GREEN, COLOR_YELLOW, COLOR_BLUE, 
- COLOR_MAGENTA, COLOR_CYAN, COLOR_WHITE
-};
-
-/*
- * Ditto for these strings - RP
- */
-static char *Color_Strings[16] =
-{
- "black", "red", "green", "brown", "blue", "magenta", "cyan", "lightgray",
- "gray", "brightred", "brightgreen", "yellow", "brightblue", "brightmagenta",
- "brightcyan", "white"
-};
-
 /* Remember the hash codes for common elements */
-PUBLIC int	s_alink=NOSTYLE, s_a=NOSTYLE, s_status=NOSTYLE,
-		s_label=NOSTYLE, s_value=NOSTYLE, s_high=NOSTYLE,
-		s_normal=NOSTYLE, s_alert=NOSTYLE, s_title=NOSTYLE;
+PUBLIC int	s_alink  = NOSTYLE, s_a     = NOSTYLE, s_status = NOSTYLE,
+		s_label  = NOSTYLE, s_value = NOSTYLE, s_high   = NOSTYLE,
+		s_normal = NOSTYLE, s_alert = NOSTYLE, s_title  = NOSTYLE;
 
-/* start somewhere safe */ 
-PRIVATE int colorPairs=0;
-PRIVATE int last_fA=COLOR_WHITE, last_bA=COLOR_BLACK;
+/* start somewhere safe */
+PRIVATE int colorPairs = 0;
+PRIVATE int last_fA = COLOR_WHITE, last_bA = COLOR_BLACK;
 
 
 #define FREE(x) if (x) {free(x); x = NULL;}
@@ -71,80 +56,59 @@ PRIVATE int last_fA=COLOR_WHITE, last_bA=COLOR_BLACK;
 /* icky parsing of the style options */
 PRIVATE void parse_attributes ARGS5(char*,mono,char*,fg,char*,bg,int,style,char*,element)
 {
- int i;
- int mA=0, fA=COLOR_WHITE, bA=COLOR_BLACK, cA=0;
-	int newstyle=hash_code(element);
-	if (TRACE)
+    int i;
+    int mA = 0, fA = default_fg, bA = default_bg, cA = A_NORMAL;
+    int newstyle = hash_code(element);
+
+    if (TRACE)
 	fprintf(stderr, "CSS(PA):style d=%d / h=%d, e=%s\n", style, newstyle,element);
- 
- for (i=0; i<7; i++)
- {
+
+    for (i = 0; i <7; i++)
+    {
 	if (!strcasecmp(Mono_Strings[i], mono))
 	{
-	 mA = ncursesMono[i];
+	    mA = ncursesMono[i];
 	}
- }
-	if (TRACE)
+    }
+    if (TRACE)
 	fprintf(stderr, "CSS(CP):%d\n", colorPairs);
- /*
-  * `nocolor' means don't even try to do colour for this - RP
-  */
- if (!strcasecmp("nocolor", fg))
- {
-	fA=-1;
-	bA=-1;
-	cA=-1;
- }
- else
- {
-	for (i=0; i<16; i++)
-	{
-	 if (!strcasecmp(Color_Strings[i], fg))
-	 {
-		fA = ncursesColors[i%8];
-		/*
-		 * if the string was in the upper 8, then it's
-		 * a bright version, so set the BOLD attribute
-		 */
-		cA = (i>=8 ? A_BOLD : 0);
-	 }
-	}
-	/* 
-	 * Backgrounds are horribly broken under ncurses - RP
-	 */
-	for (i=0; i<16; i++)
-	{
-	 if (!strcasecmp(Color_Strings[i], bg))
-	 {
-		bA = ncursesColors[i%8];
-		cA |=(i>=8 ? A_BOLD : 0);
-	 }
+
+    fA = check_color(fg, default_fg);
+    bA = check_color(bg, default_bg);
+    if (fA == NO_COLOR) {
+	bA = NO_COLOR;
+    } else {
+	if (fA >= COLORS || bA >= COLORS)
+	    cA = A_BOLD;
+	if (fA >= COLORS)
+	    fA %= COLORS;
+	if (bA > COLORS)
+	    bA %= COLORS;
+    }
+
+    /*
+     * If we have colour, and space to create a new colour attribute,
+     * and we have a valid colour description, then add this style
+     */
+    if (lynx_has_color && colorPairs < COLOR_PAIRS-1 && fA != NO_COLOR)
+    {
+	if (colorPairs <= 0 || fA != last_fA || bA != last_bA) {
+	    colorPairs++;
+	    init_pair(colorPairs, fA, bA);
+	    last_fA = fA;
+	    last_bA = bA;
 	}
- }
-
- /* 
-  * If we have colour, and space to create a new colour attribute,
-  * and we have a valid colour description, then add this style
-  */
- if (lynx_has_color && colorPairs < COLOR_PAIRS-1 && fA!=-1)
- {
-     if (colorPairs <= 0 || fA != last_fA || bA != last_bA) {
-	 colorPairs++;
-	 init_pair(colorPairs, fA, bA);
-	 last_fA = fA;
-	 last_bA = bA;
-     }
 	if (style < DSTYLE_ELEMENTS)
 	    setStyle(style, COLOR_PAIR(colorPairs)|cA, cA, mA);
 	setHashStyle(newstyle, COLOR_PAIR(colorPairs)|cA, cA, mA, element);
- }
- else
- {
-	/* only mono is set */
+    }
+    else
+    {
+    /* only mono is set */
 	if (style < DSTYLE_ELEMENTS)
 	    setStyle(style, -1, -1, mA);
 	setHashStyle(newstyle, -1, -1, mA, element);
- }
+    }
 }
 
 /* parse a style option of the format
@@ -152,11 +116,11 @@ PRIVATE void parse_attributes ARGS5(char*,mono,char*,fg,char*,bg,int,style,char*
  */
 PRIVATE void parse_style ARGS1(char*,buffer)
 {
- char *tmp = strchr(buffer, ':');
- char *element, *mono, *fg, *bg;
- 
- if(!tmp)
- {
+    char *tmp = strchr(buffer, ':');
+    char *element, *mono, *fg, *bg;
+
+    if(!tmp)
+    {
 	fprintf (stderr, "\
 Syntax Error parsing style in lss file:\n\
 [%s]\n\
@@ -178,90 +142,100 @@ where OBJECT is one of EM,STRONG,B,I,U,BLINK etc.\n\n", buffer);
 	    exit(-1);
 	}
 	exit(1);
- }
-	{
-		char *i;
-		for (i=buffer; *i; *i++=tolower(*i));
-	}
- *tmp='\0';
- element=buffer;
- 
- mono=tmp+1;
- tmp=strchr(mono, ':');
- 
- if (!tmp) { fg="nocolor"; bg="nocolor"; }
- else      
- {
-	*tmp='\0';
-	fg=tmp+1;
-	tmp=strchr(fg, ':');
-	if (!tmp) bg="black";
-	else {*tmp='\0'; bg=tmp+1;}
- }
-
-	if (TRACE)
+    }
+    {
+	char *i;
+	for (i = buffer; *i; *i++ = tolower(*i))
+	    ;
+    }
+    *tmp = '\0';
+    element = buffer;
+
+    mono = tmp + 1;
+    tmp = strchr(mono, ':');
+
+    if (!tmp)
+    {
+	fg = "nocolor";
+	bg = "nocolor";
+    }
+    else
+    {
+	*tmp = '\0';
+	fg = tmp+1;
+	tmp = strchr(fg, ':');
+	if (!tmp)
+	    bg = "default";
+	else
 	{
-		int bucket = hash_code(element);
-		fprintf(stderr, "CSSPARSE:%s => %d %s\n", 
-			element, bucket,
-			(hashStyles[bucket].name ? "used" : ""));
+	    *tmp = '\0';
+	    bg = tmp + 1;
 	}
-
-	strtolower(element);	
-
- /* 
-  * We use some pseudo-elements, so catch these first
-  */
- if (!strncasecmp(element, "alink", 5)) /* active link */
- {
+    }
+
+    if (TRACE)
+    {
+	int bkt = hash_code(element);
+	fprintf(stderr, "CSSPARSE:%s => %d %s\n",
+	    element, bkt,
+	    (hashStyles[bkt].name ? "used" : ""));
+    }
+
+    strtolower(element);
+
+    /*
+    * We use some pseudo-elements, so catch these first
+    */
+    if (!strncasecmp(element, "alink", 5)) /* active link */
+    {
 	parse_attributes(mono,fg,bg,DSTYLE_ALINK,"alink");
- }
- else if (!strcasecmp(element, "a")) /* normal link */
- {
+    }
+    else if (!strcasecmp(element, "a")) /* normal link */
+    {
 	parse_attributes(mono,fg,bg, DSTYLE_LINK,"a");
 	parse_attributes(mono,fg,bg, HTML_A,"a");
- }
- else if (!strncasecmp(element, "status", 4)) /* status bar */
- {
+    }
+    else if (!strncasecmp(element, "status", 4)) /* status bar */
+    {
 	parse_attributes(mono,fg,bg, DSTYLE_STATUS,"status");
- }
- else if (!strncasecmp(element, "label", 6)) /* [INLINE]'s */
- {
+    }
+    else if (!strncasecmp(element, "label", 6)) /* [INLINE]'s */
+    {
 	parse_attributes(mono,fg,bg,DSTYLE_OPTION,"label");
- }
- else if (!strncasecmp(element, "value", 5)) /* [INLINE]'s */
- {
+    }
+    else if (!strncasecmp(element, "value", 5)) /* [INLINE]'s */
+    {
 	parse_attributes(mono,fg,bg,DSTYLE_VALUE,"value");
- }
- else if (!strncasecmp(element, "high", 4)) /* [INLINE]'s */
- {
+    }
+    else if (!strncasecmp(element, "high", 4)) /* [INLINE]'s */
+    {
 	parse_attributes(mono,fg,bg,DSTYLE_HIGH,"high");
- }
- else if (!strcmp(element, "normal")) /* added - kw */
- {
+    }
+    else if (!strcmp(element, "normal")) /* added - kw */
+    {
 	parse_attributes(mono,fg,bg,DSTYLE_NORMAL,"html");
- }
- /* this may vanish */
- else if (!strncasecmp(element, "candy", 5)) /* [INLINE]'s */
- {
+    }
+    /* this may vanish */
+    else if (!strncasecmp(element, "candy", 5)) /* [INLINE]'s */
+    {
 	parse_attributes(mono,fg,bg,DSTYLE_CANDY,"candy");
- }
- /* Ok, it must be a HTML element, so look through the list until we
-	* find it
-	*/
- else
- {
+    }
+    /* Ok, it must be a HTML element, so look through the list until we
+    * find it
+    */
+    else
+    {
 #if !defined(USE_HASH)
 	int i;
-	for (i=0; i<HTML_ELEMENTS; i++)
+	for (i = 0; i <HTML_ELEMENTS; i++)
 	{
-	 if (!strcasecmp (HTML_dtd.tags[i].name, element))
-	 {
+	    if (!strcasecmp (HTML_dtd.tags[i].name, element))
+	    {
 		if (TRACE)
-		 fprintf(stderr, "PARSECSS:applying style <%s,%s,%s> for HTML_%s\n",mono,fg,bg,HTML_dtd.tags[i].name);
-		parse_attributes(mono,fg,bg,i+STARTAT,element);
+		    fprintf(stderr, "PARSECSS:applying style <%s,%s,%s> for HTML_%s\n",mono,fg,bg,HTML_dtd.tags[i].name);
+			parse_attributes(mono,fg,bg,i+STARTAT,element);
 		break;
-	 }
+	    }
 	}
 #else
 	int element_number = -1;
@@ -275,7 +249,7 @@ where OBJECT is one of EM,STRONG,B,I,U,BLINK etc.\n\n", buffer);
 	else
 	    parse_attributes(mono,fg,bg, DSTYLE_ELEMENTS,element);
 #endif
- }
+    }
 }
 
 PRIVATE void free_colorstylestuff NOARGS
@@ -297,31 +271,31 @@ PUBLIC void style_initialiseHashTable NOARGS
 {
 	int i;
 	static int firsttime = 1;
-	
-	for (i=0; i<CSHASHSIZE; i++)
+
+	for (i = 0; i <CSHASHSIZE; i++)
 	{
 	    if (firsttime)
-		hashStyles[i].name=NULL;
+		hashStyles[i].name = NULL;
 	    else
 		FREE(hashStyles[i].name);
-	    hashStyles[i].color=-1;
-	    hashStyles[i].cattr=-1;
-	    hashStyles[i].mono=-1;
+	    hashStyles[i].color = -1;
+	    hashStyles[i].cattr = -1;
+	    hashStyles[i].mono  = -1;
 	}
 	if (firsttime) {
 	    firsttime = 0;
 	    atexit(free_colorstylestuff);
 	}
-	s_high=hash_code("high");
-	s_alink=hash_code("alink");
-	s_value=hash_code("value");
-	s_label=hash_code("label");
-	s_a=hash_code("a");
-	s_status=hash_code("status");
-	s_alert=hash_code("alert");
-	s_title=hash_code("title");
+	s_high   = hash_code("high");
+	s_alink  = hash_code("alink");
+	s_value  = hash_code("value");
+	s_label  = hash_code("label");
+	s_a      = hash_code("a");
+	s_status = hash_code("status");
+	s_alert  = hash_code("alert");
+	s_title  = hash_code("title");
 }
-	
+
 /* because curses isn't started when we parse the config file, we
  * need to remember the STYLE: lines we encounter and parse them
  * after curses has started
@@ -332,13 +306,13 @@ PUBLIC void parse_userstyles NOARGS
 {
 	char *name;
 	HTList *cur = lss_styles;
-	colorPairs=0;
+	colorPairs = 0;
 	style_initialiseHashTable();
 
 	/* set our styles to be the same as vanilla-curses-lynx */
 	initialise_default_stylesheet();
 
-	while ((name=HTList_nextObject(cur)) != NULL)
+	while ((name = HTList_nextObject(cur)) != NULL)
 	{
 		if (TRACE)
 			fprintf(stderr, "LSS:%s\n", name ? name : "!?! empty !?!");
@@ -351,10 +325,10 @@ PUBLIC void parse_userstyles NOARGS
 /* Add a STYLE: option line to our list */
 PUBLIC void HStyle_addStyle ARGS1(char*,buffer)
 {
-	char *name=NULL;
+	char *name = NULL;
 	StrAllocCopy(name, buffer);
-	if (lss_styles==NULL)
-		lss_styles=HTList_new();
+	if (lss_styles == NULL)
+		lss_styles = HTList_new();
 	strtolower(name);
 	if (TRACE)
 		fprintf(stderr, "READCSS:%s\n", name ? name : "!?! empty !?!");
@@ -367,10 +341,10 @@ PUBLIC void style_deleteStyleList NOARGS
     while ((name = HTList_removeLastObject(lss_styles)) != NULL)
 	FREE(name);
     HTList_delete (lss_styles);
-    lss_styles=NULL;
+    lss_styles = NULL;
 }
 
-char* default_stylesheet[]={
+char* default_stylesheet[] = {
 	"a:bold", "em:bold", "strong:bold", "b:bold", "i:bold",
 	"alink:reverse", "status:reverse", NULL
 };
@@ -378,55 +352,55 @@ char* default_stylesheet[]={
 PUBLIC void style_defaultStyleSheet NOARGS
 {
 	int i;
-	for (i=0; default_stylesheet[i]; i++)
+	for (i = 0; default_stylesheet[i]; i++)
 		HStyle_addStyle(default_stylesheet[i]);
 }
 
 PUBLIC int style_readFromFile ARGS1(char*, file)
 {
-	FILE *fh;
-	char buffer[1024];
-	int len;
-
+    FILE *fh;
+    char buffer[1024];
+    int len;
+
+    if (TRACE)
+	fprintf(stderr, "CSS:Reading styles from file: %s\n", file ? file : "?!? empty ?!?");
+    if (file == NULL || *file == '\0')
+	return -1;
+    fh = fopen(file, "r");
+    if (!fh)
+    {
+	/* this should probably be an alert or something */
 	if (TRACE)
-	    fprintf(stderr, "CSS:Reading styles from file: %s\n", file ? file : "?!? empty ?!?");
-	if (file == NULL || *file == '\0')
-	    return -1;
-	fh=fopen(file, "r");
-	if (!fh) 
-	{
-/* this should probably be an alert or something */
-		if (TRACE)
-			fprintf(stderr, "CSS:Can't open style file %s, using defaults\n", file);
-		return -1;
-	}
-	
-	style_initialiseHashTable();
-	style_deleteStyleList();
+	    fprintf(stderr, "CSS:Can't open style file %s, using defaults\n", file);
+	return -1;
+    }
 
-	while (!feof(fh)
-	 && fgets(buffer, sizeof(buffer)-1, fh) != NULL)
-	{
-		len = strlen(buffer);
-		if (len > 0) {
-		    if (buffer[len-1] == '\n' || buffer[len-1] == '\r')
-			buffer[len-1]='\0'; /* hack */
-		    else
-			buffer[1023]='\0'; /* hack */
-		}
-		LYTrimTail(buffer);
-		LYTrimHead(buffer);
-		if (buffer[0] != '#' && (len = strlen(buffer)) > 0)
-		    HStyle_addStyle(buffer);
+    style_initialiseHashTable();
+    style_deleteStyleList();
+
+    while (!feof(fh)
+    && fgets(buffer, sizeof(buffer)-1, fh) != NULL)
+    {
+	len = strlen(buffer);
+	if (len > 0) {
+	    if (buffer[len-1] == '\n' || buffer[len-1] == '\r')
+		buffer[len-1] = '\0'; /* hack */
+	    else
+		buffer[sizeof(buffer)-1] = '\0'; /* hack */
 	}
-	/* the default styles are added after the user styles in order
-	** that they come before them  <grin>  RP
-	*/ 
-/*	style_defaultStyleSheet(); */
-
-	fclose (fh);
-	if (LYCursesON)
-		parse_userstyles();
-	return 0;
+	LYTrimTail(buffer);
+	LYTrimHead(buffer);
+	if (buffer[0] != '#' && (len = strlen(buffer)) > 0)
+	    HStyle_addStyle(buffer);
+    }
+    /* the default styles are added after the user styles in order
+    ** that they come before them  <grin>  RP
+    */
+    /*	style_defaultStyleSheet(); */
+
+    fclose (fh);
+    if (LYCursesON)
+	parse_userstyles();
+    return 0;
 }
 #endif /* USE_COLOR_STYLE */
diff --git a/src/LYrcFile.c b/src/LYrcFile.c
index e83d72cb..2ba688dd 100644
--- a/src/LYrcFile.c
+++ b/src/LYrcFile.c
@@ -34,6 +34,9 @@ PUBLIC void read_rc NOPARAMS
     sprintf(rcfile, "%s/.lynxrc", Home_Dir());
 #endif /* VMS */
 #endif /* DJGPP */
+#if defined(__DJGPP__) || defined(_WINDOWS)
+                _fmode = O_TEXT;
+#endif /* __DJGPP__  or _WINDOWS */
 
     /*
      *  Open the RC file for reading.
@@ -663,7 +666,8 @@ PUBLIC int save_rc NOPARAMS
      */
     fprintf(fp, "\
 # preferred_language specifies the language in MIME notation (e.g., en,\n\
-# fr) which Lynx will indicate you prefer in requests to http servers.\n\
+# fr, may be a comma-separated list in decreasing preference)\n\
+# which Lynx will indicate you prefer in requests to http servers.\n\
 # If a file in that language is available, the server will send it.\n\
 # Otherwise, the server will send the file in it's default language.\n");
     fprintf(fp, "preferred_language=%s\n\n", (language ? language : ""));
@@ -675,10 +679,15 @@ PUBLIC int save_rc NOPARAMS
 # preferred_charset specifies the character set in MIME notation (e.g.,\n\
 # ISO-8859-2, ISO-8859-5) which Lynx will indicate you prefer in requests\n\
 # to http servers using an Accept-Charset header.  The value should NOT\n\
-# include ISO-8859-1 or US-ASCII, since those values are always assumed by\n\
-# default.  If a file in that character set is available, the server will\n\
-# send it.  Otherwise, the server will send the file in ISO-8859-1 or\n\
-# US-ASCII.\n");
+# include ISO-8859-1 or US-ASCII, since those values are always assumed\n\
+# by default.  May be a comma-separated list.\n\
+# If a file in that character set is available, the server will send it.\n\
+# If no Accept-Charset header is present, the default is that any\n\
+# character set is acceptable.  If an Accept-Charset header is present,\n\
+# and if the server cannot send a response which is acceptable\n\
+# according to the Accept-Charset header, then the server SHOULD send\n\
+# an error response, though the sending of an unacceptable response\n\
+# is also allowed.\n");
     fprintf(fp, "preferred_charset=%s\n\n",
     		(pref_charset ? pref_charset : ""));
 
@@ -896,6 +905,9 @@ PUBLIC int save_rc NOPARAMS
      *  Close the RC file.
      */
     fclose(fp);
+#if defined(__DJGPP__) || defined(_WINDOWS)
+              _fmode = O_BINARY;
+#endif /* __DJGPP__ or _WINDOWS */
 
 #ifdef VMS
     /*
diff --git a/src/UCAux.c b/src/UCAux.c
index 98fb9e37..d0323233 100644
--- a/src/UCAux.c
+++ b/src/UCAux.c
@@ -261,7 +261,7 @@ PUBLIC void UCSetTransParams ARGS5(
 	    **  treated as already Unicode here.
 	    */
 	    pT->trans_to_uni = (!intm_ucs &&
-				UCCanUniTranslateFrom(cs_in));
+				UCCanUniTranslateFrom(cs_in) != TQ_NO);
 	    /*
 	    **  We set this if we are translating to Unicode and
 	    **  what normally are low value control characters in
@@ -329,7 +329,7 @@ PUBLIC void UCSetTransParams ARGS5(
 	    */
 	    pT->trans_from_uni = (use_ucs && !pT->do_8bitraw &&
 				  !pT->use_raw_char_in &&
-				  UCCanTranslateUniTo(cs_out));
+				  UCCanTranslateUniTo(cs_out) != TQ_NO);
 	}
     }
 }
diff --git a/src/chrtrans/MAKEW32.BAT b/src/chrtrans/MAKEW32.BAT
index 4a3afaf9..009de876 100644
--- a/src/chrtrans/MAKEW32.BAT
+++ b/src/chrtrans/MAKEW32.BAT
@@ -26,4 +26,13 @@ makeuctb mnem_suni.tbl > mnem_suni.h
 makeuctb rfc_suni.tbl > rfc_suni.h
 makeuctb def7_uni.tbl > def7_uni.h
 makeuctb koi8r_uni.tbl > koi8r_uni.h
-
+makeuctb mac_uni.tbl > mac_uni.h

+makeuctb next_uni.tbl > next_uni.h

+makeuctb dmcs_uni.tbl > dmcs_uni.h

+makeuctb cp869_uni.tbl > cp869_uni.h

+makeuctb cp864_uni.tbl > cp864_uni.h

+makeuctb cp862_uni.tbl > cp862_uni.h

+makeuctb cp737_uni.tbl > cp737_uni.h

+makeuctb cp1256_uni.tbl > cp1256_uni.h

+makeuctb cp1255_uni.tbl > cp1255_uni.h

+makeuctb cp1253_uni.tbl > cp1253_uni.h

diff --git a/src/chrtrans/cp850_uni.tbl b/src/chrtrans/cp850_uni.tbl
index 759bf950..a8e66e15 100644
--- a/src/chrtrans/cp850_uni.tbl
+++ b/src/chrtrans/cp850_uni.tbl
@@ -18,7 +18,7 @@ OIBM PC codepage 850
 #    General notes: none
 #
 #    Format: Three tab-separated columns
-#        Column #1 is the cp1255_WinHebrew code (in hex)
+#        Column #1 is the cp850_DOSLatin1 code (in hex)
 #        Column #2 is the Unicode (in hex as U+XXXX)
 #        Column #3 is the Unicode name (follows a comment sign, '#')
 #
diff --git a/src/chrtrans/makefile.dos b/src/chrtrans/makefile.dos
index 6a99e87f..deb0987c 100644
--- a/src/chrtrans/makefile.dos
+++ b/src/chrtrans/makefile.dos
@@ -25,30 +25,40 @@ FONTMAP_INC = iso01_un.h
 
 CHRTR=
 
-TABLES= $(CHRTR)iso01_un.h \
- $(CHRTR)iso02_un.h \
+TABLES= $(CHRTR)iso01_uni.h \
  $(CHRTR)def7_uni.h \
- $(CHRTR)iso03_un.h \
- $(CHRTR)iso04_un.h \
- $(CHRTR)iso05_un.h \
- $(CHRTR)iso06_un.h \
- $(CHRTR)iso07_un.h \
- $(CHRTR)iso08_un.h \
- $(CHRTR)iso09_un.h \
- $(CHRTR)iso10_un.h \
- $(CHRTR)koi8r_un.h \
- $(CHRTR)cp437_un.h \
- $(CHRTR)cp850_un.h \
- $(CHRTR)cp852_un.h \
- $(CHRTR)cp866_un.h \
- $(CHRTR)cp1250_u.h \
- $(CHRTR)cp1251_u.h \
- $(CHRTR)cp1252_u.h \
- $(CHRTR)viscii_u.h \
+ $(CHRTR)iso02_uni.h \
+ $(CHRTR)cp1252_uni.h \
+ $(CHRTR)dmcs_uni.h \
+ $(CHRTR)mac_uni.h \
+ $(CHRTR)next_uni.h \
+ $(CHRTR)koi8r_uni.h \
+ $(CHRTR)viscii_uni.h \
+ $(CHRTR)cp437_uni.h \
+ $(CHRTR)cp850_uni.h \
+ $(CHRTR)cp852_uni.h \
+ $(CHRTR)cp866_uni.h \
+ $(CHRTR)cp737_uni.h \
+ $(CHRTR)cp869_uni.h \
+ $(CHRTR)cp864_uni.h \
+ $(CHRTR)cp862_uni.h \
+ $(CHRTR)cp1250_uni.h \
+ $(CHRTR)cp1251_uni.h \
+ $(CHRTR)cp1253_uni.h \
+ $(CHRTR)cp1255_uni.h \
+ $(CHRTR)cp1256_uni.h \
+ $(CHRTR)iso03_uni.h \
+ $(CHRTR)iso04_uni.h \
+ $(CHRTR)iso05_uni.h \
+ $(CHRTR)iso06_uni.h \
+ $(CHRTR)iso07_uni.h \
+ $(CHRTR)iso08_uni.h \
+ $(CHRTR)iso09_uni.h \
+ $(CHRTR)iso10_uni.h \
  $(CHRTR)utf8_uni.h \
  $(CHRTR)rfc_suni.h \
- $(CHRTR)mnemonic.h \
- $(CHRTR)mnem_sun.h
+ $(CHRTR)mnemonic_suni.h \
+ $(CHRTR)mnem_suni.h
 
 default: $(TABLES)
 
@@ -61,28 +71,40 @@ makeuctb.exe: makeuctb.c UCkd.h
 .tbl.h:
 	./makeuctb $*.tbl > $@
 
-iso01_un.h: iso01_un.tbl makeuctb.exe
-iso02_un.h: iso02_un.tbl makeuctb.exe
-def7_uni.h: def7_uni.tbl makeuctb.exe
-iso03_un.h: iso03_un.tbl makeuctb.exe
-iso04_un.h: iso04_un.tbl makeuctb.exe
-iso05_un.h: iso05_un.tbl makeuctb.exe
-iso06_un.h: iso06_un.tbl makeuctb.exe
-iso07_un.h: iso07_un.tbl makeuctb.exe
-iso08_un.h: iso08_un.tbl makeuctb.exe
-iso09_un.h: iso09_un.tbl makeuctb.exe
-iso10_un.h: iso10_un.tbl makeuctb.exe
-koi8r_un.h: koi8r_un.tbl makeuctb.exe
-cp437_un.h: cp437_un.tbl makeuctb.exe
-cp850_un.h: cp850_un.tbl makeuctb.exe
-cp852_un.h: cp852_un.tbl makeuctb.exe
-cp1250_u.h: cp1250_u.tbl makeuctb.exe
-cp1251_u.h: cp1251_u.tbl makeuctb.exe
-cp1252_u.h: cp1252_u.tbl makeuctb.exe
-utf8_uni.h: utf8_uni.tbl makeuctb.exe
-mnemonic.h: mnemonic.tbl makeuctb.exe
-mnem_sun.h: mnem_sun.tbl makeuctb.exe
-rfc_suni.h: rfc_suni.tbl makeuctb.exe
+def7_uni.h:		def7_uni.tbl		makeuctb.exe
+iso01_uni.h:		iso01_uni.tbl		makeuctb.exe
+iso02_uni.h:		iso02_uni.tbl		makeuctb.exe
+cp1252_uni.h:		cp1252_uni.tbl		makeuctb.exe
+dmcs_uni.h:		dmcs_uni.tbl		makeuctb.exe
+mac_uni.h:		mac_uni.tbl		makeuctb.exe
+next_uni.h:		next_uni.tbl		makeuctb.exe
+koi8r_uni.h:		koi8r_uni.tbl		makeuctb.exe
+viscii_uni.h:		viscii_uni.tbl		makeuctb.exe
+cp437_uni.h:		cp437_uni.tbl		makeuctb.exe
+cp850_uni.h:		cp850_uni.tbl		makeuctb.exe
+cp852_uni.h:		cp852_uni.tbl		makeuctb.exe
+cp866_uni.h:		cp866_uni.tbl		makeuctb.exe
+cp737_uni.h:		cp737_uni.tbl		makeuctb.exe
+cp869_uni.h:		cp869_uni.tbl		makeuctb.exe
+cp864_uni.h:		cp864_uni.tbl		makeuctb.exe
+cp862_uni.h:		cp862_uni.tbl		makeuctb.exe
+cp1250_uni.h:		cp1250_uni.tbl		makeuctb.exe
+cp1251_uni.h:		cp1251_uni.tbl		makeuctb.exe
+cp1253_uni.h:		cp1253_uni.tbl		makeuctb.exe
+cp1255_uni.h:		cp1255_uni.tbl		makeuctb.exe
+cp1256_uni.h:		cp1256_uni.tbl		makeuctb.exe
+iso03_uni.h:		iso03_uni.tbl		makeuctb.exe
+iso04_uni.h:		iso04_uni.tbl		makeuctb.exe
+iso05_uni.h:		iso05_uni.tbl		makeuctb.exe
+iso06_uni.h:		iso06_uni.tbl		makeuctb.exe
+iso07_uni.h:		iso07_uni.tbl		makeuctb.exe
+iso08_uni.h:		iso08_uni.tbl		makeuctb.exe
+iso09_uni.h:		iso09_uni.tbl		makeuctb.exe
+iso10_uni.h:		iso10_uni.tbl		makeuctb.exe
+utf8_uni.h:		utf8_uni.tbl		makeuctb.exe
+mnemonic_suni.h:	mnemonic_suni.tbl	makeuctb.exe
+mnem_suni.h:		mnem_suni.tbl		makeuctb.exe
+rfc_suni.h:		rfc_suni.tbl		makeuctb.exe
 
 clean:
 	rm -f makeuctb.exe makeuctb *.o *un.h *u.h *c.h *i.h
diff --git a/src/makefile.in b/src/makefile.in
index e6f436f5..c9e73326 100644
--- a/src/makefile.in
+++ b/src/makefile.in
@@ -78,6 +78,8 @@ message:
 do_chartrans_stuff:
 	-cd chrtrans && $(MAKE) \
 		SITE_DEFS="$(SITE_DEFS)" \
+		CFLAGS="$(CFLAGS)" \
+		CPPFLAGS="$(CPPFLAGS)" \
 		CC="$(CC)" tables
 
 lint:
diff --git a/src/mktime.c b/src/mktime.c
index 0db7f122..46ca944b 100644
--- a/src/mktime.c
+++ b/src/mktime.c
@@ -27,9 +27,9 @@ mkgmtime(t)
 register struct tm	*t;
 {
 	register short	month, year;
-	register long	time;
+	register time_t	result;
 	static int	m_to_d[12] =
-{0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334};
+		{0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334};
 
 	month = t->tm_mon;
 	year = t->tm_year + month / 12 + 1900;
@@ -39,22 +39,22 @@ register struct tm	*t;
 		year -= 1;
 		month += 12;
 	}
-	time = (year - 1970) * 365 + (year - 1969) / 4 + m_to_d[month];
-	time = (year - 1970) * 365 + m_to_d[month];
+	result = (year - 1970) * 365 + (year - 1969) / 4 + m_to_d[month];
+	result = (year - 1970) * 365 + m_to_d[month];
 	if (month <= 1)
 		year -= 1;
-	time += (year - 1968) / 4;
-	time -= (year - 1900) / 100;
-	time += (year - 1600) / 400;
-	time += t->tm_mday;
-	time -= 1;
-	time *= 24;
-	time += t->tm_hour;
-	time *= 60;
-	time += t->tm_min;
-	time *= 60;
-	time += t->tm_sec;
-	return(time);
+	result += (year - 1968) / 4;
+	result -= (year - 1900) / 100;
+	result += (year - 1600) / 400;
+	result += t->tm_mday;
+	result -= 1;
+	result *= 24;
+	result += t->tm_hour;
+	result *= 60;
+	result += t->tm_min;
+	result *= 60;
+	result += t->tm_sec;
+	return(result);
 }
 
 /*
@@ -66,12 +66,12 @@ time_t
 mktime(t)
 struct tm	*t;
 {
-	time_t	now;
+	time_t	result;
 
 	tzset();
-	now = mkgmtime(t) + timezone;
+	result = mkgmtime(t) + timezone;
 	if (t->tm_isdst > 0
-	|| (t->tm_isdst < 0 && localtime(&now)->tm_isdst))
-		now -= 3600;
-	return(now);
+	|| (t->tm_isdst < 0 && localtime(&result)->tm_isdst))
+		result -= 3600;
+	return(result);
 }
diff --git a/userdefs.h b/userdefs.h
index de27f138..b2519a1a 100644
--- a/userdefs.h
+++ b/userdefs.h
@@ -675,12 +675,18 @@
 /*****************************
  * PREFERRED_CHARSET specifies the character set in MIME notation (e.g.,
  * "ISO-8859-2", "ISO-8859-5") which Lynx will indicate you prefer in
- * requests to http servers using an Accept-Charsets header.  The value
- * should NOT include "ISO-8859-1" or "US-ASCII", since those values are
- * always assumed by default.  If a file in that character set is available,
- * the server will send it.  Otherwise, the server will send the file in
- * ISO-8859-1 or US-ASCII.  Users can change or eliminate this definition
+ * requests to http servers using an Accept-Charsets header.
+ * This definition can be overriden via lynx.cfg.  Users also can change it
  * via the 'o'ptions menu and save that preference in their RC file.
+ * The value should NOT include "ISO-8859-1" or "US-ASCII", since those
+ * values are always assumed by default.
+ * If a file in that character set is available, the server will send it.
+ * If no Accept-Charset header is present, the default is that any
+ * character set is acceptable. If an Accept-Charset header is present,
+ * and if the server cannot send a response which is acceptable
+ * according to the Accept-Charset header, then the server SHOULD send
+ * an error response with the 406 (not acceptable) status code, though
+ * the sending of an unacceptable response is also allowed. (RFC2068)
  */
 #define PREFERRED_CHARSET ""
 
@@ -1188,7 +1194,7 @@
  * the version definition with the Project Version on checkout. Just
  * ignore it. - kw */
 /* $Format: "#define LYNX_VERSION \"$ProjectVersion$\""$ */
-#define LYNX_VERSION "2.7.1ac-0.95"
+#define LYNX_VERSION "2.7.1ac-0.102"
 
 #ifndef MAXINT
 #define MAXINT 2147483647	/* max integer */