diff -Naurbd slashem-0.0.8E0/configure slashem-0.0.8E0F1/configure
--- slashem-0.0.8E0/configure	2005-07-02 08:31:37.000000000 +0100
+++ slashem-0.0.8E0F1/configure	2006-05-15 12:13:10.000000000 +0100
@@ -1,5 +1,4 @@
 #! /bin/sh
-# From configure.ac Revision: .
 # Guess values for system-dependent variables and create Makefiles.
 # Generated by GNU Autoconf 2.59 for SLASHEM 0.0.8.
 #
@@ -274,6 +273,7 @@
 PACKAGE_STRING='SLASHEM 0.0.8'
 PACKAGE_BUGREPORT='http://sourceforge.net/bugs/?group_id=9746'
 
+ac_unique_file="slamfaq.txt"
 # Factoring default headers for most tests.
 ac_includes_default="\
 #include <stdio.h>
@@ -311,7 +311,7 @@
 # include <unistd.h>
 #endif"
 
-ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS CC CHGRP CHOWN LN_S CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os LEX LEXLIB LEX_OUTPUT_ROOT YACC ac_ct_CHOWN ac_ct_CHGRP WINTTYLIB PKG_CONFIG NETHACK_PROXY_CFLAGS NETHACK_PROXY_LIBS SDL_CONFIG ac_ct_SDL_CONFIG SDL_CONFIG_CFLAGS SDL_CONFIG_LIBS WINSRC WINOBJ WINLIB CNF_SHARE_DATND CPP EGREP LIBOBJS LTLIBOBJS'
+ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS SRCDIR CC CHGRP CHOWN CHMOD ZLIB_CFLAGS ZLIB_LIBS LN_S AWK CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT LFLAGS build build_cpu build_vendor build_os host host_cpu host_vendor host_os HOST_MSWIN HOST_UNIX SYSTEM SYSSRC SYSOBJ NHKEYDLL_GCC LEX LEXLIB LEX_OUTPUT_ROOT YACC ac_ct_CHOWN ac_ct_CHGRP ac_ct_CHMOD WINDRES ac_ct_WINDRES PKG_CONFIG NETHACK__LIBPNG_CFLAGS NETHACK__LIBPNG_LIBS NETHACK_LIBPNG_CFLAGS NETHACK_LIBPNG_LIBS EXTRA_UNSHARE WINTTYLIB NETHACK_PROXY_CFLAGS NETHACK_PROXY_LIBS SDL_CONFIG ac_ct_SDL_CONFIG SDL_CONFIG_CFLAGS SDL_CONFIG_LIBS WINSRC WINOBJ WINLIB CNF_SHARE_DATND CPP EGREP LIBOBJS LTLIBOBJS'
 ac_subst_files=''
 
 # Initialize some variables set by options.
@@ -764,6 +764,18 @@
 ac_env_CHOWN_value=$CHOWN
 ac_cv_env_CHOWN_set=${CHOWN+set}
 ac_cv_env_CHOWN_value=$CHOWN
+ac_env_CHMOD_set=${CHMOD+set}
+ac_env_CHMOD_value=$CHMOD
+ac_cv_env_CHMOD_set=${CHMOD+set}
+ac_cv_env_CHMOD_value=$CHMOD
+ac_env_ZLIB_CFLAGS_set=${ZLIB_CFLAGS+set}
+ac_env_ZLIB_CFLAGS_value=$ZLIB_CFLAGS
+ac_cv_env_ZLIB_CFLAGS_set=${ZLIB_CFLAGS+set}
+ac_cv_env_ZLIB_CFLAGS_value=$ZLIB_CFLAGS
+ac_env_ZLIB_LIBS_set=${ZLIB_LIBS+set}
+ac_env_ZLIB_LIBS_value=$ZLIB_LIBS
+ac_cv_env_ZLIB_LIBS_set=${ZLIB_LIBS+set}
+ac_cv_env_ZLIB_LIBS_value=$ZLIB_LIBS
 ac_env_CFLAGS_set=${CFLAGS+set}
 ac_env_CFLAGS_value=$CFLAGS
 ac_cv_env_CFLAGS_set=${CFLAGS+set}
@@ -844,7 +856,6 @@
 System types:
   --build=BUILD     configure for building on BUILD [guessed]
   --host=HOST       cross-compile to build programs to run on HOST [BUILD]
-  --target=TARGET   configure for building compilers for TARGET [HOST]
 _ACEOF
 fi
 
@@ -857,16 +868,18 @@
 Optional Features:
   --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
   --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
-  --enable-tty-graphics   use tty-graphics (default=yes)
   --enable-proxy-graphics use proxy-graphics (default=auto)
+  --enable-tty-graphics   use tty-graphics (default=auto)
   --enable-x11-graphics   use x11-graphics (default=no)
   --enable-sdl-graphics   use sdl-graphics (default=no)
   --enable-gl-graphics    use gl-graphics (enables sdl-graphics) (default=no)
+  --enable-mswin-graphics use Microsoft Window's native graphics (default=no)
+  --enable-data-librarian Data librarian (default=auto)
   --enable-sinks          Kitchen sinks (default=yes)
   --enable-light-src-spell
                           Spells are light sources (default=yes)
   --enable-wallified-maze Fancy mazes (default=yes)
-  --enable-reincarnation  Special Rogue-like levels (default=yes)
+  --enable-reincarnation  Special Rogue-like levels (default=no)
   --enable-blackmarket    Blackmarket (default=yes)
   --enable-kops           Keystone Kops (default=yes)
   --enable-seduce         Succubi/incubi seduction (default=yes)
@@ -884,39 +897,39 @@
   --enable-dwarf          Dwarf race (default=yes)
   --enable-tourist        Tourist class (default=yes)
   --enable-yeoman         Yeoman class (default=yes)
-  --enable-zouthern       Zoutherner class (default=yes)
+  --enable-zouthern       Zoutherner class (default=no)
   --enable-redo           Redo last command (default=yes)
   --enable-clipping       Allow smaller screens (default=yes)
   --enable-menu-color     TTY graphics menu color (default=yes)
   --enable-elbereth       Engraving the E-word repels monsters (default=yes)
-  --enable-noartifactwish Prevent wishing for special artifacts (default=yes)
-  --enable-no-bones       Disable loading and saving bones levels
-                          (default=yes)
+  --enable-noartifactwish Prevent wishing for special artifacts (default=no)
+  --enable-no-bones       Disable loading and saving bones levels (default=no)
   --enable-user-sounds    Allow user-defined regex mapping from messages to
-                          sounds (Qt with NAS only) (default=yes)
+                          sounds (Qt with NAS only) (default=no)
   --enable-exp-on-botl    Show experience on bottom line (default=yes)
-  --enable-score-on-botl  Show score on bottom line (default=yes)
-  --enable-borg           Borg player (only under DOS) (default=yes)
-  --enable-keep-save      Keep save files after restore (default=yes)
+  --enable-score-on-botl  Show score on bottom line (default=no)
+  --enable-keep-save      Keep save files after restore (default=no)
   --enable-charon         Charon's boat, enables Cerebus (not implemented)
-                          (default=yes)
+                          (default=no)
   --enable-show-dmg       Display damage reports (default=yes)
   --enable-show-weight    Display object weight (default=yes)
   --enable-other-services Shopkeeper services (default=yes)
   --enable-dungeon-growth Dungeon growth (default=yes)
-  --enable-shout          Shouting and pet commands (not implemented)
-                          (default=yes)
   --enable-display-layers Support transparent tilesets (default=yes)
   --enable-goldobj        Gold is kept on object chains (experimental)
-                          (default=yes)
+                          (default=no)
   --enable-autopickup-exceptions
-                          Exceptions to autopickup (experimental)
-                          (default=yes)
+                          Exceptions to autopickup (experimental) (default=no)
+  --enable-wizmode=USER   enable wizard mode for the specified user
+                          (default=wizard)
 
 Some influential environment variables:
   CC          C compiler
   CHGRP       sets GAMEUID (set this to true as a no op)
   CHOWN       sets GAMEGRP (set this to true as a no op)
+  CHMOD       sets file modes (set this to true as a no op)
+  ZLIB_CFLAGS Compiler flags to find zlib header files
+  ZLIB_LIBS   Linker flags to find zlib library files
   CFLAGS      C compiler flags
   LDFLAGS     linker flags, e.g. -L<lib dir> if you have libraries in a
               nonstandard directory <lib dir>
@@ -1373,6 +1386,9 @@
 
 
 
+# $Revision: 1.9 $
+
+SRCDIR=../$srcdir/src
 
 ac_aux_dir=
 for ac_dir in sys/autoconf $srcdir/sys/autoconf; do
@@ -1404,6 +1420,9 @@
 
 
 
+
+
+
 echo "$as_me:$LINENO: checking whether ln -s works" >&5
 echo $ECHO_N "checking whether ln -s works... $ECHO_C" >&6
 LN_S=$as_ln_s
@@ -1415,16 +1434,48 @@
 echo "${ECHO_T}no, using $LN_S" >&6
 fi
 
+for ac_prog in gawk mawk nawk awk
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_AWK+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$AWK"; then
+  ac_cv_prog_AWK="$AWK" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_AWK="$ac_prog"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
 
-echo "$as_me:$LINENO: checking for valid window system configuration" >&5
-echo $ECHO_N "checking for valid window system configuration... $ECHO_C" >&6
-# Check whether --enable-tty-graphics or --disable-tty-graphics was given.
-if test "${enable_tty_graphics+set}" = set; then
-  enableval="$enable_tty_graphics"
-  enable_tty_graphics="$enableval"
+fi
+fi
+AWK=$ac_cv_prog_AWK
+if test -n "$AWK"; then
+  echo "$as_me:$LINENO: result: $AWK" >&5
+echo "${ECHO_T}$AWK" >&6
 else
-  enable_tty_graphics="yes"
-fi;
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+  test -n "$AWK" && break
+done
+
+
+
 # Check whether --enable-proxy-graphics or --disable-proxy-graphics was given.
 if test "${enable_proxy_graphics+set}" = set; then
   enableval="$enable_proxy_graphics"
@@ -1432,6 +1483,21 @@
 else
   enable_proxy_graphics="auto"
 fi;
+  if test "$enable_proxy_graphics" != "no"; then
+    nethack_wins="proxy $nethack_wins"
+  fi
+nethack_default_win=""
+# Note: Order is important: The last listed enabled port will be the default.
+# Check whether --enable-tty-graphics or --disable-tty-graphics was given.
+if test "${enable_tty_graphics+set}" = set; then
+  enableval="$enable_tty_graphics"
+  enable_tty_graphics="$enableval"
+else
+  enable_tty_graphics="auto"
+fi;
+  if test "$enable_tty_graphics" != "no"; then
+    nethack_wins="tty $nethack_wins"
+  fi
 # Check whether --enable-x11-graphics or --disable-x11-graphics was given.
 if test "${enable_x11_graphics+set}" = set; then
   enableval="$enable_x11_graphics"
@@ -1439,6 +1505,9 @@
 else
   enable_x11_graphics="no"
 fi;
+  if test "$enable_x11_graphics" != "no"; then
+    nethack_wins="x11 $nethack_wins"
+  fi
 # Check whether --enable-sdl-graphics or --disable-sdl-graphics was given.
 if test "${enable_sdl_graphics+set}" = set; then
   enableval="$enable_sdl_graphics"
@@ -1446,29 +1515,33 @@
 else
   enable_sdl_graphics="no"
 fi;
+  if test "$enable_sdl_graphics" != "no"; then
+    nethack_wins="sdl $nethack_wins"
+  fi
 # Check whether --enable-gl-graphics or --disable-gl-graphics was given.
 if test "${enable_gl_graphics+set}" = set; then
   enableval="$enable_gl_graphics"
   enable_gl_graphics="$enableval"
-			      if test "$enable_gl_graphics" != "no"
-			      then
-			      	enable_sdl_graphics="yes"
-			      fi
 else
   enable_gl_graphics="no"
 fi;
-
-
-if test "$enable_tty_graphics" = "no" && test "$enable_x11_graphics" = "no"
-then
-	echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
-	{ { echo "$as_me:$LINENO: error: need to enable at least one window system" >&5
-echo "$as_me: error: need to enable at least one window system" >&2;}
-   { (exit 1); exit 1; }; }
+  if test "$enable_gl_graphics" != "no"; then
+    nethack_wins="gl $nethack_wins"
+  fi
+if test "$enable_gl_graphics" != no -a "$enable_sdl_graphics" = no; then
+    enable_sdl_graphics="yes"
+    nethack_wins=`echo $nethack_wins | sed 's/^gl/gl sdl/'`
 fi
-echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6
+# Check whether --enable-mswin-graphics or --disable-mswin-graphics was given.
+if test "${enable_mswin_graphics+set}" = set; then
+  enableval="$enable_mswin_graphics"
+  enable_mswin_graphics="$enableval"
+else
+  enable_mswin_graphics="no"
+fi;
+  if test "$enable_mswin_graphics" != "no"; then
+    nethack_wins="mswin $nethack_wins"
+  fi
 
 ac_ext=c
 ac_cpp='$CPP $CPPFLAGS'
@@ -2401,6 +2474,7 @@
 ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
 
+
 # Make sure we can run config.sub.
 $ac_config_sub sun4 >/dev/null 2>&1 ||
   { { echo "$as_me:$LINENO: error: cannot run $ac_config_sub" >&5
@@ -2455,47 +2529,73 @@
 host_os=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
 
 
-echo "$as_me:$LINENO: checking target system type" >&5
-echo $ECHO_N "checking target system type... $ECHO_C" >&6
-if test "${ac_cv_target+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  ac_cv_target_alias=$target_alias
-test "x$ac_cv_target_alias" = "x" &&
-  ac_cv_target_alias=$ac_cv_host_alias
-ac_cv_target=`$ac_config_sub $ac_cv_target_alias` ||
-  { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_target_alias failed" >&5
-echo "$as_me: error: $ac_config_sub $ac_cv_target_alias failed" >&2;}
-   { (exit 1); exit 1; }; }
+case $host_os in
+     mingw32 )
+cat >>confdefs.h <<\_ACEOF
+#define WIN32
+_ACEOF
 
-fi
-echo "$as_me:$LINENO: result: $ac_cv_target" >&5
-echo "${ECHO_T}$ac_cv_target" >&6
-target=$ac_cv_target
-target_cpu=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
-target_vendor=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
-target_os=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
 
+			HOST_UNIX=#
 
-# The aliases save the names the user supplied, while $host etc.
-# will get canonicalized.
-test -n "$target_alias" &&
-  test "$program_prefix$program_suffix$program_transform_name" = \
-    NONENONEs,x,x, &&
-  program_prefix=${target_alias}-
-case $target_os in
+			SYSTEM="Syswinnt"
+			SYSSRC="\${SYSMSWINSRC}"
+			SYSOBJ="\${SYSMSWINOBJ}"
+			;;
      *bsd* )
 cat >>confdefs.h <<\_ACEOF
 #define BSD
 _ACEOF
-;;
+
+			HOST_MSWIN=#
+
+
+			SYSTEM="Sysunix"
+			SYSSRC="\${SYSUNIXSRC}"
+			SYSOBJ="\${SYSUNIXOBJ}"
+			;;
      * )
 cat >>confdefs.h <<\_ACEOF
 #define SYSV
 _ACEOF
-;;
+
+			HOST_MSWIN=#
+
+
+			SYSTEM="Sysunix"
+			SYSSRC="\${SYSUNIXSRC}"
+			SYSOBJ="\${SYSUNIXOBJ}"
+			;;
 esac
-case $target_os in
+
+
+
+
+if test $host_os = mingw32; then
+    echo "$as_me:$LINENO: checking for how to build NetHack key dynamic libraries" >&5
+echo $ECHO_N "checking for how to build NetHack key dynamic libraries... $ECHO_C" >&6
+    if test "$GCC" = yes; then
+	echo "$as_me:$LINENO: result: gcc" >&5
+echo "${ECHO_T}gcc" >&6
+
+    else
+	echo "$as_me:$LINENO: result: unknown" >&5
+echo "${ECHO_T}unknown" >&6
+	if test "$enable_tty_graphics" = yes; then
+	    { { echo "$as_me:$LINENO: error: Don't know how to build NetHack key DLLs with $CC" >&5
+echo "$as_me: error: Don't know how to build NetHack key DLLs with $CC" >&2;}
+   { (exit 1); exit 1; }; }
+	else
+	    { echo "$as_me:$LINENO: WARNING: Can't enable tty graphics (key dynamic libraries)" >&5
+echo "$as_me: WARNING: Can't enable tty graphics (key dynamic libraries)" >&2;}
+	    enable_tty_graphics="no"
+    nethack_wins=`echo $nethack_wins | sed 's/tty //'`
+
+	fi
+    fi
+fi
+
+case $host_os in
      *cygwin* )
 cat >>confdefs.h <<\_ACEOF
 #define CYGWIN32
@@ -2997,6 +3097,724 @@
   CHGRP=$ac_ct_CHGRP
 fi
 
+if test -n "$ac_tool_prefix"; then
+  for ac_prog in chmod true
+  do
+    # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
+set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_CHMOD+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$CHMOD"; then
+  ac_cv_prog_CHMOD="$CHMOD" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_CHMOD="$ac_tool_prefix$ac_prog"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+fi
+fi
+CHMOD=$ac_cv_prog_CHMOD
+if test -n "$CHMOD"; then
+  echo "$as_me:$LINENO: result: $CHMOD" >&5
+echo "${ECHO_T}$CHMOD" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+    test -n "$CHMOD" && break
+  done
+fi
+if test -z "$CHMOD"; then
+  ac_ct_CHMOD=$CHMOD
+  for ac_prog in chmod true
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_ac_ct_CHMOD+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$ac_ct_CHMOD"; then
+  ac_cv_prog_ac_ct_CHMOD="$ac_ct_CHMOD" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_ac_ct_CHMOD="$ac_prog"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+fi
+fi
+ac_ct_CHMOD=$ac_cv_prog_ac_ct_CHMOD
+if test -n "$ac_ct_CHMOD"; then
+  echo "$as_me:$LINENO: result: $ac_ct_CHMOD" >&5
+echo "${ECHO_T}$ac_ct_CHMOD" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+  test -n "$ac_ct_CHMOD" && break
+done
+
+  CHMOD=$ac_ct_CHMOD
+fi
+
+if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}windres", so it can be a program name with args.
+set dummy ${ac_tool_prefix}windres; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_WINDRES+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$WINDRES"; then
+  ac_cv_prog_WINDRES="$WINDRES" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_WINDRES="${ac_tool_prefix}windres"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+fi
+fi
+WINDRES=$ac_cv_prog_WINDRES
+if test -n "$WINDRES"; then
+  echo "$as_me:$LINENO: result: $WINDRES" >&5
+echo "${ECHO_T}$WINDRES" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+fi
+if test -z "$ac_cv_prog_WINDRES"; then
+  ac_ct_WINDRES=$WINDRES
+  # Extract the first word of "windres", so it can be a program name with args.
+set dummy windres; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_ac_ct_WINDRES+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$ac_ct_WINDRES"; then
+  ac_cv_prog_ac_ct_WINDRES="$ac_ct_WINDRES" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_ac_ct_WINDRES="windres"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+  test -z "$ac_cv_prog_ac_ct_WINDRES" && ac_cv_prog_ac_ct_WINDRES="no"
+fi
+fi
+ac_ct_WINDRES=$ac_cv_prog_ac_ct_WINDRES
+if test -n "$ac_ct_WINDRES"; then
+  echo "$as_me:$LINENO: result: $ac_ct_WINDRES" >&5
+echo "${ECHO_T}$ac_ct_WINDRES" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+  WINDRES=$ac_ct_WINDRES
+else
+  WINDRES="$ac_cv_prog_WINDRES"
+fi
+
+
+
+
+    # Slash'EM may well work with earlier versions,
+    # but 1.2.4 is the earliest tested to date.
+
+  succeeded=no
+
+  if test -z "$PKG_CONFIG"; then
+    # Extract the first word of "pkg-config", so it can be a program name with args.
+set dummy pkg-config; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_path_PKG_CONFIG+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  case $PKG_CONFIG in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+  test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no"
+  ;;
+esac
+fi
+PKG_CONFIG=$ac_cv_path_PKG_CONFIG
+
+if test -n "$PKG_CONFIG"; then
+  echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5
+echo "${ECHO_T}$PKG_CONFIG" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+  fi
+
+  if test "$PKG_CONFIG" = "no" ; then
+     echo "*** The pkg-config script could not be found. Make sure it is"
+     echo "*** in your path, or set the PKG_CONFIG environment variable"
+     echo "*** to the full path to pkg-config."
+     echo "*** Or see http://www.freedesktop.org/software/pkgconfig to get pkg-config."
+  else
+     PKG_CONFIG_MIN_VERSION=0.9.0
+     if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then
+        echo "$as_me:$LINENO: checking for libpng >= 1.2.4" >&5
+echo $ECHO_N "checking for libpng >= 1.2.4... $ECHO_C" >&6
+
+        if $PKG_CONFIG --exists "libpng >= 1.2.4" ; then
+            echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+            succeeded=yes
+
+            echo "$as_me:$LINENO: checking NETHACK__LIBPNG_CFLAGS" >&5
+echo $ECHO_N "checking NETHACK__LIBPNG_CFLAGS... $ECHO_C" >&6
+            NETHACK__LIBPNG_CFLAGS=`$PKG_CONFIG --cflags "libpng >= 1.2.4"`
+            echo "$as_me:$LINENO: result: $NETHACK__LIBPNG_CFLAGS" >&5
+echo "${ECHO_T}$NETHACK__LIBPNG_CFLAGS" >&6
+
+            echo "$as_me:$LINENO: checking NETHACK__LIBPNG_LIBS" >&5
+echo $ECHO_N "checking NETHACK__LIBPNG_LIBS... $ECHO_C" >&6
+            NETHACK__LIBPNG_LIBS=`$PKG_CONFIG --libs "libpng >= 1.2.4"`
+            echo "$as_me:$LINENO: result: $NETHACK__LIBPNG_LIBS" >&5
+echo "${ECHO_T}$NETHACK__LIBPNG_LIBS" >&6
+        else
+            NETHACK__LIBPNG_CFLAGS=""
+            NETHACK__LIBPNG_LIBS=""
+            ## If we have a custom action on failure, don't print errors, but
+            ## do set a variable so people can do so.
+            NETHACK__LIBPNG_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "libpng >= 1.2.4"`
+
+        fi
+
+
+
+     else
+        echo "*** Your version of pkg-config is too old. You need version $PKG_CONFIG_MIN_VERSION or newer."
+        echo "*** See http://www.freedesktop.org/software/pkgconfig"
+     fi
+  fi
+
+  if test $succeeded = yes; then
+     nethack__succeeded=maybe
+  else
+     nethack__succeeded=no
+  fi
+
+    # Slash'EM doesn't use zlib directly, but libpng does. This should
+    # all be handled in libpng.pc, but isn't in many versions of libpng.
+    if test $nethack__succeeded = maybe; then
+
+    for flag in -lz; do
+
+    case "$flag" in
+	-I*|-L*|-l*)
+	    for flag in $NETHACK__LIBPNG_LIBS; do
+		if test $flag = "$flag"; then
+		    break
+		fi
+	    done
+	    if test $flag = "$flag"; then
+		nethack__libs="$NETHACK__LIBPNG_LIBS"
+	    else
+		case "$flag" in
+		    -L*)nethack__libs="$flag $NETHACK__LIBPNG_LIBS";;
+		    *)  nethack__libs="$NETHACK__LIBPNG_LIBS $flag";;
+		esac
+	    fi
+	    ;;
+	*)  nethack__libs="$NETHACK__LIBPNG_LIBS $flag";;
+    esac
+
+    done
+
+
+    nethack__save_cflags=$CFLAGS
+    nethack__save_libs=$LIBS
+    CFLAGS="$CFLAGS $NETHACK__LIBPNG_CFLAGS"
+    LIBS="$LIBS $nethack__libs"
+    echo "$as_me:$LINENO: checking if libpng is useable with $CFLAGS and $LIBS" >&5
+echo $ECHO_N "checking if libpng is useable with $CFLAGS and $LIBS... $ECHO_C" >&6
+    cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <png.h>
+int
+main ()
+{
+png_structp ptr=
+	    png_create_write_struct(PNG_LIBPNG_VER_STRING,NULL,NULL,NULL);
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  NETHACK_LIBPNG_CFLAGS="$NETHACK__LIBPNG_CFLAGS"; NETHACK_LIBPNG_LIBS="$nethack__libs"; echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; nethack__succeeded=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6;
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+    CFLAGS=$nethack__save_cflags
+    LIBS=$nethack__save_libs
+    fi
+    # If the user has supplied flags, then believe them.
+    if test $nethack__succeeded = maybe -a \
+      \( -n "$ZLIB_CFLAGS" -o -n "$ZLIB_LIBS" \); then
+
+    for flag in $ZLIB_CFLAGS; do
+
+    case "$flag" in
+	-I*|-L*|-l*)
+	    for flag in $NETHACK__LIBPNG_CFLAGS; do
+		if test $flag = "$flag"; then
+		    break
+		fi
+	    done
+	    if test $flag = "$flag"; then
+		nethack__cflags="$NETHACK__LIBPNG_CFLAGS"
+	    else
+		case "$flag" in
+		    -L*)nethack__cflags="$flag $NETHACK__LIBPNG_CFLAGS";;
+		    *)  nethack__cflags="$NETHACK__LIBPNG_CFLAGS $flag";;
+		esac
+	    fi
+	    ;;
+	*)  nethack__cflags="$NETHACK__LIBPNG_CFLAGS $flag";;
+    esac
+
+    done
+
+
+    for flag in $ZLIB_LIBS; do
+
+    case "$flag" in
+	-I*|-L*|-l*)
+	    for flag in $NETHACK__LIBPNG_LIBS; do
+		if test $flag = "$flag"; then
+		    break
+		fi
+	    done
+	    if test $flag = "$flag"; then
+		nethack__libs="$NETHACK__LIBPNG_LIBS"
+	    else
+		case "$flag" in
+		    -L*)nethack__libs="$flag $NETHACK__LIBPNG_LIBS";;
+		    *)  nethack__libs="$NETHACK__LIBPNG_LIBS $flag";;
+		esac
+	    fi
+	    ;;
+	*)  nethack__libs="$NETHACK__LIBPNG_LIBS $flag";;
+    esac
+
+    done
+
+
+    nethack__save_cflags=$CFLAGS
+    nethack__save_libs=$LIBS
+    CFLAGS="$CFLAGS $nethack__cflags"
+    LIBS="$LIBS $nethack__libs"
+    echo "$as_me:$LINENO: checking if libpng is useable with $CFLAGS and $LIBS" >&5
+echo $ECHO_N "checking if libpng is useable with $CFLAGS and $LIBS... $ECHO_C" >&6
+    cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <png.h>
+int
+main ()
+{
+png_structp ptr=
+	    png_create_write_struct(PNG_LIBPNG_VER_STRING,NULL,NULL,NULL);
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  NETHACK_LIBPNG_CFLAGS="$nethack__cflags"; NETHACK_LIBPNG_LIBS="$nethack__libs"; echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; nethack__succeeded=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6;
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+    CFLAGS=$nethack__save_cflags
+    LIBS=$nethack__save_libs
+    fi
+    # Otherwise, try pkg-config.
+    if test $nethack__succeeded = maybe; then
+	echo "$as_me:$LINENO: checking for zlib" >&5
+echo $ECHO_N "checking for zlib... $ECHO_C" >&6
+	if $PKG_CONFIG --exists zlib; then
+	    echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+
+    for flag in `$PKG_CONFIG --cflags zlib`; do
+
+    case "$flag" in
+	-I*|-L*|-l*)
+	    for flag in $NETHACK__LIBPNG_CFLAGS; do
+		if test $flag = "$flag"; then
+		    break
+		fi
+	    done
+	    if test $flag = "$flag"; then
+		nethack__cflags="$NETHACK__LIBPNG_CFLAGS"
+	    else
+		case "$flag" in
+		    -L*)nethack__cflags="$flag $NETHACK__LIBPNG_CFLAGS";;
+		    *)  nethack__cflags="$NETHACK__LIBPNG_CFLAGS $flag";;
+		esac
+	    fi
+	    ;;
+	*)  nethack__cflags="$NETHACK__LIBPNG_CFLAGS $flag";;
+    esac
+
+    done
+
+
+    for flag in `$PKG_CONFIG --libs zlib`; do
+
+    case "$flag" in
+	-I*|-L*|-l*)
+	    for flag in $NETHACK__LIBPNG_LIBS; do
+		if test $flag = "$flag"; then
+		    break
+		fi
+	    done
+	    if test $flag = "$flag"; then
+		nethack__libs="$NETHACK__LIBPNG_LIBS"
+	    else
+		case "$flag" in
+		    -L*)nethack__libs="$flag $NETHACK__LIBPNG_LIBS";;
+		    *)  nethack__libs="$NETHACK__LIBPNG_LIBS $flag";;
+		esac
+	    fi
+	    ;;
+	*)  nethack__libs="$NETHACK__LIBPNG_LIBS $flag";;
+    esac
+
+    done
+
+
+    nethack__save_cflags=$CFLAGS
+    nethack__save_libs=$LIBS
+    CFLAGS="$CFLAGS $nethack__cflags"
+    LIBS="$LIBS $nethack__libs"
+    echo "$as_me:$LINENO: checking if libpng is useable with $CFLAGS and $LIBS" >&5
+echo $ECHO_N "checking if libpng is useable with $CFLAGS and $LIBS... $ECHO_C" >&6
+    cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <png.h>
+int
+main ()
+{
+png_structp ptr=
+	    png_create_write_struct(PNG_LIBPNG_VER_STRING,NULL,NULL,NULL);
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  NETHACK_LIBPNG_CFLAGS="$nethack__cflags"; NETHACK_LIBPNG_LIBS="$nethack__libs"; echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; nethack__succeeded=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6;
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+    CFLAGS=$nethack__save_cflags
+    LIBS=$nethack__save_libs
+	else
+	    echo "$as_me:$LINENO: result: not found by pkg-config" >&5
+echo "${ECHO_T}not found by pkg-config" >&6
+	fi
+    fi
+    # Try the same prefix as libpng since zlib is
+    # likely to be installed in the same place.
+    if test $nethack__succeeded = maybe; then
+        nethack__libpng_prefix=`$PKG_CONFIG --variable=prefix libpng`
+
+    case "-I$nethack__libpng_prefix/include" in
+	-I*|-L*|-l*)
+	    for flag in $NETHACK__LIBPNG_CFLAGS; do
+		if test $flag = "-I$nethack__libpng_prefix/include"; then
+		    break
+		fi
+	    done
+	    if test $flag = "-I$nethack__libpng_prefix/include"; then
+		nethack__cflags="$NETHACK__LIBPNG_CFLAGS"
+	    else
+		case "-I$nethack__libpng_prefix/include" in
+		    -L*)nethack__cflags="-I$nethack__libpng_prefix/include $NETHACK__LIBPNG_CFLAGS";;
+		    *)  nethack__cflags="$NETHACK__LIBPNG_CFLAGS -I$nethack__libpng_prefix/include";;
+		esac
+	    fi
+	    ;;
+	*)  nethack__cflags="$NETHACK__LIBPNG_CFLAGS -I$nethack__libpng_prefix/include";;
+    esac
+
+
+    case "-L$nethack__libpng_prefix/lib" in
+	-I*|-L*|-l*)
+	    for flag in $NETHACK__LIBPNG_LIBS; do
+		if test $flag = "-L$nethack__libpng_prefix/lib"; then
+		    break
+		fi
+	    done
+	    if test $flag = "-L$nethack__libpng_prefix/lib"; then
+		nethack__libs="$NETHACK__LIBPNG_LIBS"
+	    else
+		case "-L$nethack__libpng_prefix/lib" in
+		    -L*)nethack__libs="-L$nethack__libpng_prefix/lib $NETHACK__LIBPNG_LIBS";;
+		    *)  nethack__libs="$NETHACK__LIBPNG_LIBS -L$nethack__libpng_prefix/lib";;
+		esac
+	    fi
+	    ;;
+	*)  nethack__libs="$NETHACK__LIBPNG_LIBS -L$nethack__libpng_prefix/lib";;
+    esac
+
+
+    case "-lz" in
+	-I*|-L*|-l*)
+	    for flag in $nethack__libs; do
+		if test $flag = "-lz"; then
+		    break
+		fi
+	    done
+	    if test $flag = "-lz"; then
+		nethack__libs="$nethack__libs"
+	    else
+		case "-lz" in
+		    -L*)nethack__libs="-lz $nethack__libs";;
+		    *)  nethack__libs="$nethack__libs -lz";;
+		esac
+	    fi
+	    ;;
+	*)  nethack__libs="$nethack__libs -lz";;
+    esac
+
+
+    nethack__save_cflags=$CFLAGS
+    nethack__save_libs=$LIBS
+    CFLAGS="$CFLAGS $nethack__cflags"
+    LIBS="$LIBS $nethack__libs"
+    echo "$as_me:$LINENO: checking if libpng is useable with $CFLAGS and $LIBS" >&5
+echo $ECHO_N "checking if libpng is useable with $CFLAGS and $LIBS... $ECHO_C" >&6
+    cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <png.h>
+int
+main ()
+{
+png_structp ptr=
+	    png_create_write_struct(PNG_LIBPNG_VER_STRING,NULL,NULL,NULL);
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  NETHACK_LIBPNG_CFLAGS="$nethack__cflags"; NETHACK_LIBPNG_LIBS="$nethack__libs"; echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; nethack__succeeded=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6;
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+    CFLAGS=$nethack__save_cflags
+    LIBS=$nethack__save_libs
+    fi
+    if test $nethack__succeeded = yes; then
+	echo "$as_me:$LINENO: checking NETHACK_LIBPNG_CFLAGS" >&5
+echo $ECHO_N "checking NETHACK_LIBPNG_CFLAGS... $ECHO_C" >&6
+	echo "$as_me:$LINENO: result: ${NETHACK_LIBPNG_CFLAGS}" >&5
+echo "${ECHO_T}${NETHACK_LIBPNG_CFLAGS}" >&6
+
+	echo "$as_me:$LINENO: checking NETHACK_LIBPNG_LIBS" >&5
+echo $ECHO_N "checking NETHACK_LIBPNG_LIBS... $ECHO_C" >&6
+	echo "$as_me:$LINENO: result: ${NETHACK_LIBPNG_LIBS}" >&5
+echo "${ECHO_T}${NETHACK_LIBPNG_LIBS}" >&6
+
+	have_libpng=yes
+    else have_libpng=no
+    fi
 
 
 
@@ -3006,10 +3824,25 @@
 CNF_SHARE_DATND=
 
 WINTTYLIB=
-if test "$enable_tty_graphics" != "no"
-then
-TERMLIB_VARIANTS="ncurses curses termlib termcap terminfo"
-for termlib in ${TERMLIB_VARIANTS}; do
+if test "$enable_tty_graphics" != "no"; then
+    if test $host_os = mingw32; then
+	EXTRA_UNSHARE=nhdefkey.dll nh340key.dll nhraykey.dll
+
+	CFLAGS="$CFLAGS -DWIN32CON"
+	WINTTYLIB=""
+	WINSRC="${WINSRC} \$(WINTTYSRC)"
+	WINOBJ="${WINOBJ} \$(WINTTYOBJ)"
+	WINLIB="${WINLIB} \$(WINTTYLIB)"
+
+cat >>confdefs.h <<\_ACEOF
+#define TTY_GRAPHICS
+_ACEOF
+
+    else
+	# For TTY, determine the termlib
+	# Check for termlib before termcap because Solaris termcap needs libucb.
+	TERMLIB_VARIANTS="ncurses curses termlib termcap terminfo"
+	for termlib in ${TERMLIB_VARIANTS}; do
   as_ac_Lib=`echo "ac_cv_lib_${termlib}''_tgetent" | $as_tr_sh`
 echo "$as_me:$LINENO: checking for tgetent in -l${termlib}" >&5
 echo $ECHO_N "checking for tgetent in -l${termlib}... $ECHO_C" >&6
@@ -3088,14 +3921,39 @@
 		break
 fi
 
-done
+	done
+	if test -z "$termlib"; then
+	    if test "$enable_tty_graphics" = yes; then
+		{ { echo "$as_me:$LINENO: error: Can't find tgetent (needed for tty graphics)" >&5
+echo "$as_me: error: Can't find tgetent (needed for tty graphics)" >&2;}
+   { (exit 1); exit 1; }; }
+	    else
+		{ echo "$as_me:$LINENO: WARNING: Can't enable tty graphics (no tgetent)" >&5
+echo "$as_me: WARNING: Can't enable tty graphics (no tgetent)" >&2;}
+		enable_tty_graphics="no"
+    nethack_wins=`echo $nethack_wins | sed 's/tty //'`
+
+	    fi
+	fi
+    fi
+fi
+if test "$enable_tty_graphics" = "no" -a $host_os = mingw32; then
+    LFLAGS="$LFLAGS -mwindows"
 fi
 
 
-if test "$enable_proxy_graphics" != "no"
-then
-	if test "$enable_proxy_graphics" = "yes"
-	then
+if test "$enable_proxy_graphics" != "no"; then
+    if test "$have_libpng" = "no"; then
+	if test "$enable_proxy_graphics" = "yes"; then
+	    { { echo "$as_me:$LINENO: error: Need libpng for proxy graphics" >&5
+echo "$as_me: error: Need libpng for proxy graphics" >&2;}
+   { (exit 1); exit 1; }; }
+	else
+	    { echo "$as_me:$LINENO: WARNING: Can't enable proxy graphics (no useable libpng)" >&5
+echo "$as_me: WARNING: Can't enable proxy graphics (no useable libpng)" >&2;}
+	fi
+    else
+	if test "$enable_proxy_graphics" = "yes"; then
 
   succeeded=no
 
@@ -3292,8 +4150,9 @@
   fi
 
 	fi
-	if test -n "$NETHACK_PROXY_LIBS"
-	then
+	if test -n "$NETHACK_PROXY_LIBS"; then
+	    CFLAGS="${CFLAGS} ${NETHACK_LIBPNG_CFLAGS}"
+	    LFLAGS="${LFLAGS} ${NETHACK_LIBPNG_LFLAGS}"
 	    WINSRC="${WINSRC} \$(WINPROXYSRC)"
 	    WINOBJ="${WINOBJ} \$(WINPROXYOBJ)"
 	    WINLIB="${WINLIB} ${NETHACK_PROXY_LIBS}"
@@ -3304,6 +4163,7 @@
 _ACEOF
 
 	fi
+    fi
 fi
 
 
@@ -3583,13 +4443,51 @@
 
 
 
+if test "$enable_mswin_graphics" != "no"; then
+    if test "$WINDRES" = "no"; then
+	{ { echo "$as_me:$LINENO: error: Need windres for Microsoft Window's native graphics" >&5
+echo "$as_me: error: Need windres for Microsoft Window's native graphics" >&2;}
+   { (exit 1); exit 1; }; }
+    fi
+    WINSRC="${WINSRC} \$(WINMSSRC)"
+    WINOBJ="${WINOBJ} \$(WINMSOBJ)"
+    WINLIB="${WINLIB} \$(WINMSLIB)"
+    CNF_SHARE_DATND="${CNF_SHARE_DATND} \$(CNF_SHARE_MSND)"
 
+cat >>confdefs.h <<\_ACEOF
+#define MSWIN_GRAPHICS
+_ACEOF
 
+fi
 
 
 
 
 
+
+
+echo "$as_me:$LINENO: checking for valid window system configuration" >&5
+echo $ECHO_N "checking for valid window system configuration... $ECHO_C" >&6
+if test -n "$nethack_wins"; then
+    echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+    for win in $nethack_wins; do
+
+cat >>confdefs.h <<_ACEOF
+#define DEFAULT_WINDOW_SYS "$win"
+_ACEOF
+
+	break
+    done
+else
+    echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+    { { echo "$as_me:$LINENO: error: need to enable at least one window system" >&5
+echo "$as_me: error: need to enable at least one window system" >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+
 ac_ext=c
 ac_cpp='$CPP $CPPFLAGS'
 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
@@ -4006,9 +4904,26 @@
 
 fi
 
-echo "$as_me:$LINENO: checking for regex.h" >&5
-echo $ECHO_N "checking for regex.h... $ECHO_C" >&6
-if test "${ac_cv_header_regex_h+set}" = set; then
+# Due to what may be a bug in autoconf, we have to call AC_CHECK_HEADERS()
+# to get the various HAVE_xxx_H preprocessor variables detected by
+# AC_HEADER_STDC active. These are needed for AC_CHECK_DECLS(), below.
+# On IRIX 5.3, sys/types and inttypes.h are conflicting.
+
+
+
+
+
+
+
+
+
+for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
+		  inttypes.h stdint.h unistd.h
+do
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
@@ -4017,9 +4932,9 @@
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-/* TEST_REGEX */
+$ac_includes_default
 
-#include <regex.h>
+#include <$ac_header>
 _ACEOF
 rm -f conftest.$ac_objext
 if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
@@ -4043,53 +4958,50 @@
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  ac_cv_header_regex_h=yes
+  eval "$as_ac_Header=yes"
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_header_regex_h=no
+eval "$as_ac_Header=no"
 fi
 rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: $ac_cv_header_regex_h" >&5
-echo "${ECHO_T}$ac_cv_header_regex_h" >&6
-if test $ac_cv_header_regex_h = yes; then
-  have_regex_h=yes
-else
-  have_regex_h=no
-fi
-
-
-
-if test "$have_regex_h" = "yes"; then
-   # On IRIX 5.3, sys/types and inttypes.h are conflicting.
-
-
-
-
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
 
+fi
 
+done
 
 
 
-for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
-		  inttypes.h stdint.h unistd.h
+for ac_header in string.h
 do
 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
-echo "$as_me:$LINENO: checking for $ac_header" >&5
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+  echo "$as_me:$LINENO: checking for $ac_header" >&5
 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
 if eval "test \"\${$as_ac_Header+set}\" = set"; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
 else
-  cat >conftest.$ac_ext <<_ACEOF
+  # Is the header compilable?
+echo "$as_me:$LINENO: checking $ac_header usability" >&5
+echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-
 #include <$ac_header>
 _ACEOF
 rm -f conftest.$ac_objext
@@ -4114,17 +5026,100 @@
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  eval "$as_ac_Header=yes"
+  ac_header_compiler=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-eval "$as_ac_Header=no"
+ac_header_compiler=no
 fi
 rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6
+
+# Is the header present?
+echo "$as_me:$LINENO: checking $ac_header presence" >&5
+echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <$ac_header>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null; then
+  if test -s conftest.err; then
+    ac_cpp_err=$ac_c_preproc_warn_flag
+    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+  else
+    ac_cpp_err=
+  fi
+else
+  ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+  ac_header_preproc=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  ac_header_preproc=no
+fi
+rm -f conftest.err conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6
+
+# So?  What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+  yes:no: )
+    { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+    ac_header_preproc=yes
+    ;;
+  no:yes:* )
+    { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+    (
+      cat <<\_ASBOX
+## --------------------------------------------------------- ##
+## Report this to http://sourceforge.net/bugs/?group_id=9746 ##
+## --------------------------------------------------------- ##
+_ASBOX
+    ) |
+      sed "s/^/$as_me: WARNING:     /" >&2
+    ;;
+esac
+echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  eval "$as_ac_Header=\$ac_header_preproc"
 fi
 echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+
+fi
 if test `eval echo '${'$as_ac_Header'}'` = yes; then
   cat >>confdefs.h <<_ACEOF
 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
@@ -4134,8 +5129,64 @@
 
 done
 
+echo "$as_me:$LINENO: checking for regex.h" >&5
+echo $ECHO_N "checking for regex.h... $ECHO_C" >&6
+if test "${ac_cv_header_regex_h+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+/* TEST_REGEX */
 
-echo "$as_me:$LINENO: checking for struct re_pattern_buffer" >&5
+#include <regex.h>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_header_regex_h=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_header_regex_h=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_header_regex_h" >&5
+echo "${ECHO_T}$ac_cv_header_regex_h" >&6
+if test $ac_cv_header_regex_h = yes; then
+  have_regex_h=yes
+else
+  have_regex_h=no
+fi
+
+
+
+if test "$have_regex_h" = "yes"; then
+   echo "$as_me:$LINENO: checking for struct re_pattern_buffer" >&5
 echo $ECHO_N "checking for struct re_pattern_buffer... $ECHO_C" >&6
 if test "${ac_cv_type_struct_re_pattern_buffer+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -4404,19 +5455,127 @@
 echo "${ECHO_T}$ac_cv_have_decl_strncmpi" >&6
 if test $ac_cv_have_decl_strncmpi = yes; then
 
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_STRNCMPI 1
+_ACEOF
+
+
+cat >>confdefs.h <<\_ACEOF
+#define STRNCMPI
+_ACEOF
+
+else
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_STRNCMPI 0
+_ACEOF
+
+
+fi
+echo "$as_me:$LINENO: checking whether strnicmp is declared" >&5
+echo $ECHO_N "checking whether strnicmp is declared... $ECHO_C" >&6
+if test "${ac_cv_have_decl_strnicmp+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+int
+main ()
+{
+#ifndef strnicmp
+  char *p = (char *) strnicmp;
+#endif
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_have_decl_strnicmp=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_have_decl_strnicmp=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_have_decl_strnicmp" >&5
+echo "${ECHO_T}$ac_cv_have_decl_strnicmp" >&6
+if test $ac_cv_have_decl_strnicmp = yes; then
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_STRNICMP 1
+_ACEOF
+
+
 cat >>confdefs.h <<\_ACEOF
 #define STRNCMPI
 _ACEOF
 
+else
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_STRNICMP 0
+_ACEOF
+
+
 fi
 
 
+
+# We use auto for data librarian to avoid breaking the rule that autoconf
+# should use the same defaults as the manual configuration, but all platforms
+# that support autoconf also support DLB, so the automatic choice is always yes.
+echo "$as_me:$LINENO: checking whether to enable data-librarian" >&5
+echo $ECHO_N "checking whether to enable data-librarian... $ECHO_C" >&6
+   # Check whether --enable-data-librarian or --disable-data-librarian was given.
+if test "${enable_data_librarian+set}" = set; then
+  enableval="$enable_data_librarian"
+
+else
+  enable_data_librarian=yes
+fi;
+   echo "$as_me:$LINENO: result: $enable_data_librarian" >&5
+echo "${ECHO_T}$enable_data_librarian" >&6
+   if test "$enable_data_librarian" != "no" ; then
+
+cat >>confdefs.h <<_ACEOF
+#define DLB
+_ACEOF
+
+   fi
+
 echo "$as_me:$LINENO: checking whether to enable sinks" >&5
 echo $ECHO_N "checking whether to enable sinks... $ECHO_C" >&6
    # Check whether --enable-sinks or --disable-sinks was given.
 if test "${enable_sinks+set}" = set; then
   enableval="$enable_sinks"
-  enable_sinks="$enableval"
+
 else
   enable_sinks="yes"
 fi;
@@ -4432,10 +5591,10 @@
 
 echo "$as_me:$LINENO: checking whether to enable light-src-spell" >&5
 echo $ECHO_N "checking whether to enable light-src-spell... $ECHO_C" >&6
-   # Check whether --enable-light_src_spell or --disable-light_src_spell was given.
+   # Check whether --enable-light-src-spell or --disable-light-src-spell was given.
 if test "${enable_light_src_spell+set}" = set; then
   enableval="$enable_light_src_spell"
-  enable_light_src_spell="$enableval"
+
 else
   enable_light_src_spell="yes"
 fi;
@@ -4451,10 +5610,10 @@
 
 echo "$as_me:$LINENO: checking whether to enable wallified-maze" >&5
 echo $ECHO_N "checking whether to enable wallified-maze... $ECHO_C" >&6
-   # Check whether --enable-wallified_maze or --disable-wallified_maze was given.
+   # Check whether --enable-wallified-maze or --disable-wallified-maze was given.
 if test "${enable_wallified_maze+set}" = set; then
   enableval="$enable_wallified_maze"
-  enable_wallified_maze="$enableval"
+
 else
   enable_wallified_maze="yes"
 fi;
@@ -4473,7 +5632,7 @@
    # Check whether --enable-reincarnation or --disable-reincarnation was given.
 if test "${enable_reincarnation+set}" = set; then
   enableval="$enable_reincarnation"
-  enable_reincarnation="$enableval"
+
 else
   enable_reincarnation="no"
 fi;
@@ -4492,7 +5651,7 @@
    # Check whether --enable-blackmarket or --disable-blackmarket was given.
 if test "${enable_blackmarket+set}" = set; then
   enableval="$enable_blackmarket"
-  enable_blackmarket="$enableval"
+
 else
   enable_blackmarket="yes"
 fi;
@@ -4511,7 +5670,7 @@
    # Check whether --enable-kops or --disable-kops was given.
 if test "${enable_kops+set}" = set; then
   enableval="$enable_kops"
-  enable_kops="$enableval"
+
 else
   enable_kops="yes"
 fi;
@@ -4530,7 +5689,7 @@
    # Check whether --enable-seduce or --disable-seduce was given.
 if test "${enable_seduce+set}" = set; then
   enableval="$enable_seduce"
-  enable_seduce="$enableval"
+
 else
   enable_seduce="yes"
 fi;
@@ -4546,10 +5705,10 @@
 
 echo "$as_me:$LINENO: checking whether to enable invisible-objects" >&5
 echo $ECHO_N "checking whether to enable invisible-objects... $ECHO_C" >&6
-   # Check whether --enable-invisible_objects or --disable-invisible_objects was given.
+   # Check whether --enable-invisible-objects or --disable-invisible-objects was given.
 if test "${enable_invisible_objects+set}" = set; then
   enableval="$enable_invisible_objects"
-  enable_invisible_objects="$enableval"
+
 else
   enable_invisible_objects="yes"
 fi;
@@ -4568,7 +5727,7 @@
    # Check whether --enable-unpolypile or --disable-unpolypile was given.
 if test "${enable_unpolypile+set}" = set; then
   enableval="$enable_unpolypile"
-  enable_unpolypile="$enableval"
+
 else
   enable_unpolypile="yes"
 fi;
@@ -4584,10 +5743,10 @@
 
 echo "$as_me:$LINENO: checking whether to enable wallet-o-p" >&5
 echo $ECHO_N "checking whether to enable wallet-o-p... $ECHO_C" >&6
-   # Check whether --enable-wallet_o_p or --disable-wallet_o_p was given.
+   # Check whether --enable-wallet-o-p or --disable-wallet-o-p was given.
 if test "${enable_wallet_o_p+set}" = set; then
   enableval="$enable_wallet_o_p"
-  enable_wallet_o_p="$enableval"
+
 else
   enable_wallet_o_p="yes"
 fi;
@@ -4606,7 +5765,7 @@
    # Check whether --enable-lightsabers or --disable-lightsabers was given.
 if test "${enable_lightsabers+set}" = set; then
   enableval="$enable_lightsabers"
-  enable_lightsabers="$enableval"
+
 else
   enable_lightsabers="yes"
 fi;
@@ -4622,10 +5781,10 @@
 
 echo "$as_me:$LINENO: checking whether to enable d-saber" >&5
 echo $ECHO_N "checking whether to enable d-saber... $ECHO_C" >&6
-   # Check whether --enable-d_saber or --disable-d_saber was given.
+   # Check whether --enable-d-saber or --disable-d-saber was given.
 if test "${enable_d_saber+set}" = set; then
   enableval="$enable_d_saber"
-  enable_d_saber="$enableval"
+
 else
   enable_d_saber="yes"
 fi;
@@ -4641,10 +5800,10 @@
 
 echo "$as_me:$LINENO: checking whether to enable p-spoon" >&5
 echo $ECHO_N "checking whether to enable p-spoon... $ECHO_C" >&6
-   # Check whether --enable-p_spoon or --disable-p_spoon was given.
+   # Check whether --enable-p-spoon or --disable-p-spoon was given.
 if test "${enable_p_spoon+set}" = set; then
   enableval="$enable_p_spoon"
-  enable_p_spoon="$enableval"
+
 else
   enable_p_spoon="yes"
 fi;
@@ -4663,7 +5822,7 @@
    # Check whether --enable-firearms or --disable-firearms was given.
 if test "${enable_firearms+set}" = set; then
   enableval="$enable_firearms"
-  enable_firearms="$enableval"
+
 else
   enable_firearms="yes"
 fi;
@@ -4679,10 +5838,10 @@
 
 echo "$as_me:$LINENO: checking whether to enable eaten-memory" >&5
 echo $ECHO_N "checking whether to enable eaten-memory... $ECHO_C" >&6
-   # Check whether --enable-eaten_memory or --disable-eaten_memory was given.
+   # Check whether --enable-eaten-memory or --disable-eaten-memory was given.
 if test "${enable_eaten_memory+set}" = set; then
   enableval="$enable_eaten_memory"
-  enable_eaten_memory="$enableval"
+
 else
   enable_eaten_memory="yes"
 fi;
@@ -4701,7 +5860,7 @@
    # Check whether --enable-steed or --disable-steed was given.
 if test "${enable_steed+set}" = set; then
   enableval="$enable_steed"
-  enable_steed="$enableval"
+
 else
   enable_steed="yes"
 fi;
@@ -4720,7 +5879,7 @@
    # Check whether --enable-dwarf or --disable-dwarf was given.
 if test "${enable_dwarf+set}" = set; then
   enableval="$enable_dwarf"
-  enable_dwarf="$enableval"
+
 else
   enable_dwarf="yes"
 fi;
@@ -4739,7 +5898,7 @@
    # Check whether --enable-tourist or --disable-tourist was given.
 if test "${enable_tourist+set}" = set; then
   enableval="$enable_tourist"
-  enable_tourist="$enableval"
+
 else
   enable_tourist="yes"
 fi;
@@ -4758,7 +5917,7 @@
    # Check whether --enable-yeoman or --disable-yeoman was given.
 if test "${enable_yeoman+set}" = set; then
   enableval="$enable_yeoman"
-  enable_yeoman="$enableval"
+
 else
   enable_yeoman="yes"
 fi;
@@ -4777,7 +5936,7 @@
    # Check whether --enable-zouthern or --disable-zouthern was given.
 if test "${enable_zouthern+set}" = set; then
   enableval="$enable_zouthern"
-  enable_zouthern="$enableval"
+
 else
   enable_zouthern="no"
 fi;
@@ -4796,7 +5955,7 @@
    # Check whether --enable-redo or --disable-redo was given.
 if test "${enable_redo+set}" = set; then
   enableval="$enable_redo"
-  enable_redo="$enableval"
+
 else
   enable_redo="yes"
 fi;
@@ -4815,7 +5974,7 @@
    # Check whether --enable-clipping or --disable-clipping was given.
 if test "${enable_clipping+set}" = set; then
   enableval="$enable_clipping"
-  enable_clipping="$enableval"
+
 else
   enable_clipping="yes"
 fi;
@@ -4831,10 +5990,10 @@
 
 echo "$as_me:$LINENO: checking whether to enable menu-color" >&5
 echo $ECHO_N "checking whether to enable menu-color... $ECHO_C" >&6
-   # Check whether --enable-menu_color or --disable-menu_color was given.
+   # Check whether --enable-menu-color or --disable-menu-color was given.
 if test "${enable_menu_color+set}" = set; then
   enableval="$enable_menu_color"
-  enable_menu_color="$enableval"
+
 else
   enable_menu_color="yes"
 fi;
@@ -4853,7 +6012,7 @@
    # Check whether --enable-elbereth or --disable-elbereth was given.
 if test "${enable_elbereth+set}" = set; then
   enableval="$enable_elbereth"
-  enable_elbereth="$enableval"
+
 else
   enable_elbereth="yes"
 fi;
@@ -4872,7 +6031,7 @@
    # Check whether --enable-noartifactwish or --disable-noartifactwish was given.
 if test "${enable_noartifactwish+set}" = set; then
   enableval="$enable_noartifactwish"
-  enable_noartifactwish="$enableval"
+
 else
   enable_noartifactwish="no"
 fi;
@@ -4888,10 +6047,10 @@
 
 echo "$as_me:$LINENO: checking whether to enable no-bones" >&5
 echo $ECHO_N "checking whether to enable no-bones... $ECHO_C" >&6
-   # Check whether --enable-no_bones or --disable-no_bones was given.
+   # Check whether --enable-no-bones or --disable-no-bones was given.
 if test "${enable_no_bones+set}" = set; then
   enableval="$enable_no_bones"
-  enable_no_bones="$enableval"
+
 else
   enable_no_bones="no"
 fi;
@@ -4907,10 +6066,10 @@
 
 echo "$as_me:$LINENO: checking whether to enable user-sounds" >&5
 echo $ECHO_N "checking whether to enable user-sounds... $ECHO_C" >&6
-   # Check whether --enable-user_sounds or --disable-user_sounds was given.
+   # Check whether --enable-user-sounds or --disable-user-sounds was given.
 if test "${enable_user_sounds+set}" = set; then
   enableval="$enable_user_sounds"
-  enable_user_sounds="$enableval"
+
 else
   enable_user_sounds="no"
 fi;
@@ -4926,10 +6085,10 @@
 
 echo "$as_me:$LINENO: checking whether to enable exp-on-botl" >&5
 echo $ECHO_N "checking whether to enable exp-on-botl... $ECHO_C" >&6
-   # Check whether --enable-exp_on_botl or --disable-exp_on_botl was given.
+   # Check whether --enable-exp-on-botl or --disable-exp-on-botl was given.
 if test "${enable_exp_on_botl+set}" = set; then
   enableval="$enable_exp_on_botl"
-  enable_exp_on_botl="$enableval"
+
 else
   enable_exp_on_botl="yes"
 fi;
@@ -4945,10 +6104,10 @@
 
 echo "$as_me:$LINENO: checking whether to enable score-on-botl" >&5
 echo $ECHO_N "checking whether to enable score-on-botl... $ECHO_C" >&6
-   # Check whether --enable-score_on_botl or --disable-score_on_botl was given.
+   # Check whether --enable-score-on-botl or --disable-score-on-botl was given.
 if test "${enable_score_on_botl+set}" = set; then
   enableval="$enable_score_on_botl"
-  enable_score_on_botl="$enableval"
+
 else
   enable_score_on_botl="no"
 fi;
@@ -4962,31 +6121,13 @@
 
    fi
 
-echo "$as_me:$LINENO: checking whether to enable borg" >&5
-echo $ECHO_N "checking whether to enable borg... $ECHO_C" >&6
-   # Check whether --enable-borg or --disable-borg was given.
-if test "${enable_borg+set}" = set; then
-  enableval="$enable_borg"
-  enable_borg="$enableval"
-else
-  enable_borg="no"
-fi;
-   echo "$as_me:$LINENO: result: $enable_borg" >&5
-echo "${ECHO_T}$enable_borg" >&6
-   if test "$enable_borg" != "no" ; then
-
-cat >>confdefs.h <<_ACEOF
-#define BORG
-_ACEOF
-
-   fi
-
+#NETHACK_ARG(borg,[Borg player (only under DOS)],BORG,no)
 echo "$as_me:$LINENO: checking whether to enable keep-save" >&5
 echo $ECHO_N "checking whether to enable keep-save... $ECHO_C" >&6
-   # Check whether --enable-keep_save or --disable-keep_save was given.
+   # Check whether --enable-keep-save or --disable-keep-save was given.
 if test "${enable_keep_save+set}" = set; then
   enableval="$enable_keep_save"
-  enable_keep_save="$enableval"
+
 else
   enable_keep_save="no"
 fi;
@@ -5005,7 +6146,7 @@
    # Check whether --enable-charon or --disable-charon was given.
 if test "${enable_charon+set}" = set; then
   enableval="$enable_charon"
-  enable_charon="$enableval"
+
 else
   enable_charon="no"
 fi;
@@ -5021,10 +6162,10 @@
 
 echo "$as_me:$LINENO: checking whether to enable show-dmg" >&5
 echo $ECHO_N "checking whether to enable show-dmg... $ECHO_C" >&6
-   # Check whether --enable-show_dmg or --disable-show_dmg was given.
+   # Check whether --enable-show-dmg or --disable-show-dmg was given.
 if test "${enable_show_dmg+set}" = set; then
   enableval="$enable_show_dmg"
-  enable_show_dmg="$enableval"
+
 else
   enable_show_dmg="yes"
 fi;
@@ -5040,10 +6181,10 @@
 
 echo "$as_me:$LINENO: checking whether to enable show-weight" >&5
 echo $ECHO_N "checking whether to enable show-weight... $ECHO_C" >&6
-   # Check whether --enable-show_weight or --disable-show_weight was given.
+   # Check whether --enable-show-weight or --disable-show-weight was given.
 if test "${enable_show_weight+set}" = set; then
   enableval="$enable_show_weight"
-  enable_show_weight="$enableval"
+
 else
   enable_show_weight="yes"
 fi;
@@ -5059,10 +6200,10 @@
 
 echo "$as_me:$LINENO: checking whether to enable other-services" >&5
 echo $ECHO_N "checking whether to enable other-services... $ECHO_C" >&6
-   # Check whether --enable-other_services or --disable-other_services was given.
+   # Check whether --enable-other-services or --disable-other-services was given.
 if test "${enable_other_services+set}" = set; then
   enableval="$enable_other_services"
-  enable_other_services="$enableval"
+
 else
   enable_other_services="yes"
 fi;
@@ -5078,10 +6219,10 @@
 
 echo "$as_me:$LINENO: checking whether to enable dungeon-growth" >&5
 echo $ECHO_N "checking whether to enable dungeon-growth... $ECHO_C" >&6
-   # Check whether --enable-dungeon_growth or --disable-dungeon_growth was given.
+   # Check whether --enable-dungeon-growth or --disable-dungeon-growth was given.
 if test "${enable_dungeon_growth+set}" = set; then
   enableval="$enable_dungeon_growth"
-  enable_dungeon_growth="$enableval"
+
 else
   enable_dungeon_growth="yes"
 fi;
@@ -5095,31 +6236,13 @@
 
    fi
 
-echo "$as_me:$LINENO: checking whether to enable shout" >&5
-echo $ECHO_N "checking whether to enable shout... $ECHO_C" >&6
-   # Check whether --enable-shout or --disable-shout was given.
-if test "${enable_shout+set}" = set; then
-  enableval="$enable_shout"
-  enable_shout="$enableval"
-else
-  enable_shout="no"
-fi;
-   echo "$as_me:$LINENO: result: $enable_shout" >&5
-echo "${ECHO_T}$enable_shout" >&6
-   if test "$enable_shout" != "no" ; then
-
-cat >>confdefs.h <<_ACEOF
-#define SHOUT
-_ACEOF
-
-   fi
-
+#NETHACK_ARG(shout,[Shouting and pet commands (not implemented)],SHOUT,no)
 echo "$as_me:$LINENO: checking whether to enable display-layers" >&5
 echo $ECHO_N "checking whether to enable display-layers... $ECHO_C" >&6
-   # Check whether --enable-display_layers or --disable-display_layers was given.
+   # Check whether --enable-display-layers or --disable-display-layers was given.
 if test "${enable_display_layers+set}" = set; then
   enableval="$enable_display_layers"
-  enable_display_layers="$enableval"
+
 else
   enable_display_layers="yes"
 fi;
@@ -5138,7 +6261,7 @@
    # Check whether --enable-goldobj or --disable-goldobj was given.
 if test "${enable_goldobj+set}" = set; then
   enableval="$enable_goldobj"
-  enable_goldobj="$enableval"
+
 else
   enable_goldobj="no"
 fi;
@@ -5154,10 +6277,10 @@
 
 echo "$as_me:$LINENO: checking whether to enable autopickup-exceptions" >&5
 echo $ECHO_N "checking whether to enable autopickup-exceptions... $ECHO_C" >&6
-   # Check whether --enable-autopickup_exceptions or --disable-autopickup_exceptions was given.
+   # Check whether --enable-autopickup-exceptions or --disable-autopickup-exceptions was given.
 if test "${enable_autopickup_exceptions+set}" = set; then
   enableval="$enable_autopickup_exceptions"
-  enable_autopickup_exceptions="$enableval"
+
 else
   enable_autopickup_exceptions="no"
 fi;
@@ -5172,57 +6295,84 @@
    fi
 
 
+echo "$as_me:$LINENO: checking whether to enable wizmode" >&5
+echo $ECHO_N "checking whether to enable wizmode... $ECHO_C" >&6
+# Check whether --enable-wizmode or --disable-wizmode was given.
+if test "${enable_wizmode+set}" = set; then
+  enableval="$enable_wizmode"
+  if test "$enableval" != no; then enable_wizmode=yes; wizard=$enableval;
+	else enable_wizmode=no; fi
+else
+  enable_wizmode=yes; wizard="wizard"
+fi;
+if test "$enable_wizmode" != "no" ; then
+	echo "$as_me:$LINENO: result: yes (user $wizard)" >&5
+echo "${ECHO_T}yes (user $wizard)" >&6
+
+cat >>confdefs.h <<_ACEOF
+#define WIZARD "$wizard"
+_ACEOF
+
+else
+	echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+
 NETHACK_LINKS=
-if test ${srcdir}/include/file.h -nt include/file.h ; then
-	   NETHACK_LINKS="${LINKS_LIST} include/file.h:include/file.h"
+if test ! -f include/file.h -o ${srcdir}/include/file.h -nt include/file.h ; then
+	   NETHACK_LINKS="${NETHACK_LINKS} include/file.h:include/file.h"
 	fi
-if test ${srcdir}/dat/data.base -nt dat/data.base ; then
-	   NETHACK_LINKS="${LINKS_LIST} dat/data.base:dat/data.base"
+if test ! -f dat/data.base -o ${srcdir}/dat/data.base -nt dat/data.base ; then
+	   NETHACK_LINKS="${NETHACK_LINKS} dat/data.base:dat/data.base"
 	fi
-if test ${srcdir}/dat/rumors.tru:dat/rumors.tru -nt dat/rumors.tru:dat/rumors.tru ; then
-	   NETHACK_LINKS="${LINKS_LIST} dat/rumors.tru:dat/rumors.tru:dat/rumors.tru:dat/rumors.tru"
+if test ! -f dat/rumors.tru -o ${srcdir}/dat/rumors.tru -nt dat/rumors.tru ; then
+	   NETHACK_LINKS="${NETHACK_LINKS} dat/rumors.tru:dat/rumors.tru"
 	fi
-if test ${srcdir}/dat/rumors.fal:dat/rumors.fal -nt dat/rumors.fal:dat/rumors.fal ; then
-	   NETHACK_LINKS="${LINKS_LIST} dat/rumors.fal:dat/rumors.fal:dat/rumors.fal:dat/rumors.fal"
+if test ! -f dat/rumors.fal -o ${srcdir}/dat/rumors.fal -nt dat/rumors.fal ; then
+	   NETHACK_LINKS="${NETHACK_LINKS} dat/rumors.fal:dat/rumors.fal"
 	fi
-if test ${srcdir}/dat/quest.txt:dat/quest.txt -nt dat/quest.txt:dat/quest.txt ; then
-	   NETHACK_LINKS="${LINKS_LIST} dat/quest.txt:dat/quest.txt:dat/quest.txt:dat/quest.txt"
+if test ! -f dat/quest.txt -o ${srcdir}/dat/quest.txt -nt dat/quest.txt ; then
+	   NETHACK_LINKS="${NETHACK_LINKS} dat/quest.txt:dat/quest.txt"
 	fi
-if test ${srcdir}/dat/oracles.txt:dat/oracles.txt -nt dat/oracles.txt:dat/oracles.txt ; then
-	   NETHACK_LINKS="${LINKS_LIST} dat/oracles.txt:dat/oracles.txt:dat/oracles.txt:dat/oracles.txt"
+if test ! -f dat/oracles.txt -o ${srcdir}/dat/oracles.txt -nt dat/oracles.txt ; then
+	   NETHACK_LINKS="${NETHACK_LINKS} dat/oracles.txt:dat/oracles.txt"
 	fi
-if test ${srcdir}/dat/dungeon.def:dat/dungeon.def -nt dat/dungeon.def:dat/dungeon.def ; then
-	   NETHACK_LINKS="${LINKS_LIST} dat/dungeon.def:dat/dungeon.def:dat/dungeon.def:dat/dungeon.def"
+if test ! -f dat/dungeon.def -o ${srcdir}/dat/dungeon.def -nt dat/dungeon.def ; then
+	   NETHACK_LINKS="${NETHACK_LINKS} dat/dungeon.def:dat/dungeon.def"
 	fi
-if test ${srcdir}/dat/help:dat/help -nt dat/help:dat/help ; then
-	   NETHACK_LINKS="${LINKS_LIST} dat/help:dat/help:dat/help:dat/help"
+if test ! -f dat/help -o ${srcdir}/dat/help -nt dat/help ; then
+	   NETHACK_LINKS="${NETHACK_LINKS} dat/help:dat/help"
 	fi
-if test ${srcdir}/dat/hh:dat/hh -nt dat/hh:dat/hh ; then
-	   NETHACK_LINKS="${LINKS_LIST} dat/hh:dat/hh:dat/hh:dat/hh"
+if test ! -f dat/hh -o ${srcdir}/dat/hh -nt dat/hh ; then
+	   NETHACK_LINKS="${NETHACK_LINKS} dat/hh:dat/hh"
 	fi
-if test ${srcdir}/dat/cmdhelp:dat/cmdhelp -nt dat/cmdhelp:dat/cmdhelp ; then
-	   NETHACK_LINKS="${LINKS_LIST} dat/cmdhelp:dat/cmdhelp:dat/cmdhelp:dat/cmdhelp"
+if test ! -f dat/cmdhelp -o ${srcdir}/dat/cmdhelp -nt dat/cmdhelp ; then
+	   NETHACK_LINKS="${NETHACK_LINKS} dat/cmdhelp:dat/cmdhelp"
 	fi
-if test ${srcdir}/dat/history:dat/history -nt dat/history:dat/history ; then
-	   NETHACK_LINKS="${LINKS_LIST} dat/history:dat/history:dat/history:dat/history"
+if test ! -f dat/history -o ${srcdir}/dat/history -nt dat/history ; then
+	   NETHACK_LINKS="${NETHACK_LINKS} dat/history:dat/history"
 	fi
-if test ${srcdir}/dat/opthelp:dat/opthelp -nt dat/opthelp:dat/opthelp ; then
-	   NETHACK_LINKS="${LINKS_LIST} dat/opthelp:dat/opthelp:dat/opthelp:dat/opthelp"
+if test ! -f dat/opthelp -o ${srcdir}/dat/opthelp -nt dat/opthelp ; then
+	   NETHACK_LINKS="${NETHACK_LINKS} dat/opthelp:dat/opthelp"
 	fi
-if test ${srcdir}/dat/wizhelp:dat/wizhelp -nt dat/wizhelp:dat/wizhelp ; then
-	   NETHACK_LINKS="${LINKS_LIST} dat/wizhelp:dat/wizhelp:dat/wizhelp:dat/wizhelp"
+if test ! -f dat/wizhelp -o ${srcdir}/dat/wizhelp -nt dat/wizhelp ; then
+	   NETHACK_LINKS="${NETHACK_LINKS} dat/wizhelp:dat/wizhelp"
 	fi
-if test ${srcdir}/dat/gypsy.txt:dat/gypsy.txt -nt dat/gypsy.txt:dat/gypsy.txt ; then
-	   NETHACK_LINKS="${LINKS_LIST} dat/gypsy.txt:dat/gypsy.txt:dat/gypsy.txt:dat/gypsy.txt"
+if test ! -f dat/gypsy.txt -o ${srcdir}/dat/gypsy.txt -nt dat/gypsy.txt ; then
+	   NETHACK_LINKS="${NETHACK_LINKS} dat/gypsy.txt:dat/gypsy.txt"
 	fi
-if test ${srcdir}/win/share/tile_t.h:win/share/tile_t.h -nt win/share/tile_t.h:win/share/tile_t.h ; then
-	   NETHACK_LINKS="${LINKS_LIST} win/share/tile_t.h:win/share/tile_t.h:win/share/tile_t.h:win/share/tile_t.h"
+if test ! -f win/share/tile_t.h -o ${srcdir}/win/share/tile_t.h -nt win/share/tile_t.h ; then
+	   NETHACK_LINKS="${NETHACK_LINKS} win/share/tile_t.h:win/share/tile_t.h"
+	fi
+if test ! -f include/win32api.h -o ${srcdir}/sys/winnt/win32api.h -nt include/win32api.h ; then
+	   NETHACK_LINKS="${NETHACK_LINKS} include/win32api.h:sys/winnt/win32api.h"
 	fi
 
           ac_config_links="$ac_config_links ${NETHACK_LINKS}"
 
 
-                                                  ac_config_files="$ac_config_files Makefile:sys/autoconf/Makefile.top src/Makefile:sys/autoconf/Makefile.src doc/Makefile:sys/autoconf/Makefile.doc dat/Makefile:sys/autoconf/Makefile.dat util/Makefile:sys/autoconf/Makefile.utl"
+                                                            ac_config_files="$ac_config_files Makefile:sys/autoconf/Makefile.top src/Makefile:sys/autoconf/Makefile.src doc/Makefile:sys/autoconf/Makefile.doc dat/Makefile:sys/autoconf/Makefile.dat util/Makefile:sys/autoconf/Makefile.utl sys/autoconf/depend.awk:sys/autoconf/depend.in"
 
 
           ac_config_headers="$ac_config_headers include/autoconf.h:sys/autoconf/autoconf.hin"
@@ -5760,6 +6910,7 @@
   "doc/Makefile" ) CONFIG_FILES="$CONFIG_FILES doc/Makefile:sys/autoconf/Makefile.doc" ;;
   "dat/Makefile" ) CONFIG_FILES="$CONFIG_FILES dat/Makefile:sys/autoconf/Makefile.dat" ;;
   "util/Makefile" ) CONFIG_FILES="$CONFIG_FILES util/Makefile:sys/autoconf/Makefile.utl" ;;
+  "sys/autoconf/depend.awk" ) CONFIG_FILES="$CONFIG_FILES sys/autoconf/depend.awk:sys/autoconf/depend.in" ;;
   "${NETHACK_LINKS}" ) CONFIG_LINKS="$CONFIG_LINKS ${NETHACK_LINKS}" ;;
   "include/autoconf.h" ) CONFIG_HEADERS="$CONFIG_HEADERS include/autoconf.h:sys/autoconf/autoconf.hin" ;;
   *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5
@@ -5847,16 +6998,22 @@
 s,@ECHO_N@,$ECHO_N,;t t
 s,@ECHO_T@,$ECHO_T,;t t
 s,@LIBS@,$LIBS,;t t
+s,@SRCDIR@,$SRCDIR,;t t
 s,@CC@,$CC,;t t
 s,@CHGRP@,$CHGRP,;t t
 s,@CHOWN@,$CHOWN,;t t
+s,@CHMOD@,$CHMOD,;t t
+s,@ZLIB_CFLAGS@,$ZLIB_CFLAGS,;t t
+s,@ZLIB_LIBS@,$ZLIB_LIBS,;t t
 s,@LN_S@,$LN_S,;t t
+s,@AWK@,$AWK,;t t
 s,@CFLAGS@,$CFLAGS,;t t
 s,@LDFLAGS@,$LDFLAGS,;t t
 s,@CPPFLAGS@,$CPPFLAGS,;t t
 s,@ac_ct_CC@,$ac_ct_CC,;t t
 s,@EXEEXT@,$EXEEXT,;t t
 s,@OBJEXT@,$OBJEXT,;t t
+s,@LFLAGS@,$LFLAGS,;t t
 s,@build@,$build,;t t
 s,@build_cpu@,$build_cpu,;t t
 s,@build_vendor@,$build_vendor,;t t
@@ -5865,18 +7022,28 @@
 s,@host_cpu@,$host_cpu,;t t
 s,@host_vendor@,$host_vendor,;t t
 s,@host_os@,$host_os,;t t
-s,@target@,$target,;t t
-s,@target_cpu@,$target_cpu,;t t
-s,@target_vendor@,$target_vendor,;t t
-s,@target_os@,$target_os,;t t
+s,@HOST_MSWIN@,$HOST_MSWIN,;t t
+s,@HOST_UNIX@,$HOST_UNIX,;t t
+s,@SYSTEM@,$SYSTEM,;t t
+s,@SYSSRC@,$SYSSRC,;t t
+s,@SYSOBJ@,$SYSOBJ,;t t
+s,@NHKEYDLL_GCC@,$NHKEYDLL_GCC,;t t
 s,@LEX@,$LEX,;t t
 s,@LEXLIB@,$LEXLIB,;t t
 s,@LEX_OUTPUT_ROOT@,$LEX_OUTPUT_ROOT,;t t
 s,@YACC@,$YACC,;t t
 s,@ac_ct_CHOWN@,$ac_ct_CHOWN,;t t
 s,@ac_ct_CHGRP@,$ac_ct_CHGRP,;t t
-s,@WINTTYLIB@,$WINTTYLIB,;t t
+s,@ac_ct_CHMOD@,$ac_ct_CHMOD,;t t
+s,@WINDRES@,$WINDRES,;t t
+s,@ac_ct_WINDRES@,$ac_ct_WINDRES,;t t
 s,@PKG_CONFIG@,$PKG_CONFIG,;t t
+s,@NETHACK__LIBPNG_CFLAGS@,$NETHACK__LIBPNG_CFLAGS,;t t
+s,@NETHACK__LIBPNG_LIBS@,$NETHACK__LIBPNG_LIBS,;t t
+s,@NETHACK_LIBPNG_CFLAGS@,$NETHACK_LIBPNG_CFLAGS,;t t
+s,@NETHACK_LIBPNG_LIBS@,$NETHACK_LIBPNG_LIBS,;t t
+s,@EXTRA_UNSHARE@,$EXTRA_UNSHARE,;t t
+s,@WINTTYLIB@,$WINTTYLIB,;t t
 s,@NETHACK_PROXY_CFLAGS@,$NETHACK_PROXY_CFLAGS,;t t
 s,@NETHACK_PROXY_LIBS@,$NETHACK_PROXY_LIBS,;t t
 s,@SDL_CONFIG@,$SDL_CONFIG,;t t
@@ -6347,8 +7514,9 @@
   fi
   # Run the commands associated with the file.
   case $ac_file in
-    include/autoconf.h ) sed 's,^/\* \(#undef .*\) \*/,\1,' < include/autoconf.h \
-        > include/autoconf.new
+    include/autoconf.h ) sed -e 's,^/\* \(#undef .*\) \*/,\1,' \
+        -e '/#define [^ ]*/ { h; s,#define \([^ ]*\).*,#undef \1,p; g; }' \
+        < include/autoconf.h > include/autoconf.new
       mv include/autoconf.new \
         include/autoconf.h ;;
   esac
diff -Naurbd slashem-0.0.8E0/dat/data.base slashem-0.0.8E0F1/dat/data.base
--- slashem-0.0.8E0/dat/data.base	2005-07-02 08:31:37.000000000 +0100
+++ slashem-0.0.8E0F1/dat/data.base	2006-05-15 12:13:10.000000000 +0100
@@ -1,5 +1,5 @@
 #	SCCS Id: @(#)data.base	3.4	2003/07/23
-#	    $Id: data.base,v 1.14 2003/12/11 09:49:05 j_ali Exp $
+#	    $Id: data.base,v 1.16 2006/04/17 11:14:33 prousu Exp $
 #   Copyright (c) 1994, 1995, 1996 by the NetHack Development Team
 #   Copyright (c) 1994 by Boudewijn Wayers
 #   Copyright (c) 2002 by the Slash'EM Development Team
@@ -455,8 +455,9 @@
 barbed devil
 	Barbed devils lack any real special abilities, though they
 	are quite difficult to kill.
-+~mongbat
-+~vampire bat
+~mongbat
+~vampire bat
+~wombat
 *bat
 	A bat, flitting in the darkness outside, took the wrong turn
 	as it made its nightly rounds and came in through the window
@@ -2851,7 +2852,8 @@
 	and harry, and overcome all the gods, and burn all the
 	world with fire.
 			[ The Prose Edda, by Snorri Sturluson ]
-lug*
+lug
+lugh
 	Lugh, or Lug, was the sun god of the Irish Celts.  One of his
 	weapons was a rod-sling which worshippers sometimes saw in
 	the sky as a rainbow.  As a tribal god, he was particularly
diff -Naurbd slashem-0.0.8E0/dat/nightmar.des slashem-0.0.8E0F1/dat/nightmar.des
--- slashem-0.0.8E0/dat/nightmar.des	2005-07-02 08:31:37.000000000 +0100
+++ slashem-0.0.8E0F1/dat/nightmar.des	2006-05-15 12:13:10.000000000 +0100
@@ -1,5 +1,5 @@
 #	SCCS Id: @(#)nightmar.des	0.0.7	2002/03/13
-#	$Id: nightmar.des,v 1.6 2003/05/08 17:42:14 j_ali Exp $
+#	$Id: nightmar.des,v 1.7 2005/12/03 16:21:22 j_ali Exp $
 # NetHack may be freely redistributed.  See license for details.
 #
 # Nightmare's Nightmare World
@@ -113,7 +113,7 @@
 MONSTER[80%]:'%',"bad egg",place[1],asleep
 MONSTER[60%]:'%',"bad egg",place[1],asleep
 MONSTER[40%]:'%',"bad egg",place[1],asleep
-OBJECT:'%',"egg",place[1],"giant louse",1
+OBJECT:'%',"egg",place[1],"giant louse",2
 OBJECT[40%]:'%',"egg",place[1],"giant flea",0
 OBJECT[20%]:'%',"mushroom",place[1],cursed,0
 OBJECT[50%]:'%',"tin",place[1],"asphynx meat",0
diff -Naurbd slashem-0.0.8E0/doc/Guidebook.mn slashem-0.0.8E0F1/doc/Guidebook.mn
--- slashem-0.0.8E0/doc/Guidebook.mn	2005-07-02 08:31:37.000000000 +0100
+++ slashem-0.0.8E0F1/doc/Guidebook.mn	2006-05-15 12:13:10.000000000 +0100
@@ -1,4 +1,4 @@
-.\" $Revision: 1.18 $ $Date: 2004/09/18 15:00:49 $
+.\" $Revision: 1.19 $ $Date: 2005/08/13 11:27:03 $
 .ds h0 "SLASH'EM Guidebook
 .ds h1
 .ds h2 %
@@ -2482,6 +2482,12 @@
 The order of colors is red, green, brown, blue, magenta, cyan,
 bright.white, bright.red, bright.green, yellow, bright.blue,
 bright.magenta, and bright.cyan.
+Unix and OS/2 ports compiled with VIDEOSHADES option allow defining 
+three more colors. The order of colors is red, green, brown, blue, 
+magenta, cyan, gray, black, bright.red, bright.green, yellow, 
+bright.blue, bright.magenta, bright.cyan and white.
+MS-Windows and Mac ports don't use this option. In Windows colors can be 
+redefined from window properties.
 Cannot be set with the `O' command.
 .lp videoshades
 Set the intensity level of the three gray scales available
diff -Naurbd slashem-0.0.8E0/doc/Guidebook.tex slashem-0.0.8E0F1/doc/Guidebook.tex
--- slashem-0.0.8E0/doc/Guidebook.tex	2005-07-02 08:31:37.000000000 +0100
+++ slashem-0.0.8E0F1/doc/Guidebook.tex	2006-05-15 12:13:10.000000000 +0100
@@ -46,7 +46,7 @@
 % input file: Guidebook.mn
 %
 
-% $Revision: 1.17 $ $Date: 2004/09/18 15:00:49 $
+% $Revision: 1.18 $ $Date: 2005/08/13 11:27:03 $
 \DefineString{h0}{{\it SLASH'EM\/} Guidebook}
 \DefineString{h1}{}
 \DefineString{h2}{\%}
@@ -3449,6 +3449,12 @@
 The order of colors is red, green, brown, blue, magenta, cyan,
 bright.white, bright.red, bright.green, yellow, bright.blue,
 bright.magenta, and bright.cyan.
+Unix and OS/2 ports compiled with VIDEOSHADES option allow defining 
+three more colors. The order of colors is red, green, brown, blue, 
+magenta, cyan, gray, black, bright.red, bright.green, yellow, 
+bright.blue, bright.magenta, bright.cyan and white.
+MS-Windows and Mac ports don't use this option. In Windows colors can be 
+redefined from window properties.
 Cannot be set with the `{\tt O}' command.
 %.lp
 
diff -Naurbd slashem-0.0.8E0/history.txt slashem-0.0.8E0F1/history.txt
--- slashem-0.0.8E0/history.txt	2005-07-02 08:31:37.000000000 +0100
+++ slashem-0.0.8E0F1/history.txt	2006-05-15 12:13:10.000000000 +0100
@@ -29,6 +29,114 @@
 | Section 1: Yesterday's News |
 +-----------------------------+
 
+ver 0.0.8E0 [July 2/2005] [Released by Ali]
+-Added dumplog patch (Tom Friedetzky and Jukka Lahtinen)
+-fixed bug 923003: Invisible mirrors can be applied
+-fixed bug 916544: Wrong weight of corpses on Nightmare level
+-fixed bug 947369: Crash when multiple wands explode
+-fixed bug 950120: crash when wishing for Wallet of Perseus
+-fixed bug 933365: wand of draining does not interrupt ctrl-run
+-fixed bug 933379: weird behaviour with polyself into monsters like migo drone
+-fixed bug 929546: Flaming spheres won't attack acid blobs
+-fixed bug 951991: Reading spellbooks not safe for wizards
+-fixed bug 914894: "Beautiful" gnome thief seduced female character
+-fixed bug 918178: Double message "You are suddenly very hot/cold!"
+-fixed bug 921810: Invisible books can be read (?!)
+-fixed bug 934076: Dipping amnesia into amnesia gives water
+-fixed bug 946306: do_look: bad glyph 3726 at (7, 16)
+-fixed bug 929220: Prayer and chi healing
+-fixed bug 946157: Water elementals created over lava on Flame mage quest
+-fixed bug 946161: Bad message when two-weaponing against a rust monster
+-fixed bug 946566: Partly eaten more nutritious while raising drained corpses
+-fixed bug 946984: arch-liches are not MR_HITAS*
+-fixed bug 949016: Draining a rotten corpse
+-fixed bug 951439: Invisible Corpses and Ressurection
+-fixed bug 941453: Grand slam against monsters needing +n weapons
+-fixed bug 962515: Disarming fire trap doesn't use up water
+-fixed bug 1001167: Is this a Gray Stone bug?
+-fixed bug 992247: wolfname & ghoulname in default.nh doesn't work
+-fixed bug 931679: Space Bar not working as rest
+-fixed bug 912588: Molds stagger from your powerful strike
+-fixed bug 962574: Display bug when setting OPTIONS=tiles:Small tiles
+-fixed bug 1011313: SEGV using technique "raise zombies"
+-fixed bug 1018229: impossible splitbill: no resident shopkeeper??
+-fixed bug 1018447: Game crash when Hero with ball displace displacer beast
+-fixed bug 1020983: Typo in doc/sources.txt (cloack)
+-fixed bug 956891: Breeders are explosive
+-fixed bug 1007127: diluted potion of water
+-fixed bug 1010421: Thiefbane drains your levels even if you aren't hit
+-fixed bug 976157: Dipping into !oAmnesia didn't use up potion
+-fixed bug 982331: Can't name Cursed scrolls of teleport after reading them
+-fixed some theoretical bugs thrown up by valgrind
+-fixed bug 980258: Guidebook doesn't describe showdmg option accurately
+		   (Andy Ruse)
+-fixed bug 926202: Gnome thieves don't eat (Andy Ruse)
+-fixed bug 926200: Dwarf thieves have M2_NOPOLY (Andy Ruse)
+-fixed bug 962568: Mjollnir can't be thrown - code comment incorrect (Andy Ruse)
+-fixed bug 1005587: Beholder killed by "it's" own gaze (Andy Ruse)
+-fixed bug 1022460: [C343-8] The plural of Nazgul is Nazgul (Andy Ruse)
+-fixed bug 1039689: malloc_consolidate hang after using cursed bag of holding
+-fixed bug 1028955: Surgery technique doesn't work with polymorph
+-fixed bug 1035356: God gave Deathsword to "human" character
+-fixed bug 1024200: Problems about Thiefbane
+-fixed bug 1024202: Dipping a loadstone into a potion of amnesia
+-fixed bug 1038151: Power surge becomes permanent if lost
+-fixed bug 1025486: Pets can't follow lvl telep from Blk Mkt
+-fixed bug 1029750: Lycanthropes and eating wolfsbane while polymorphed
+-fixed bug 1030725: Doppelganger liquid leap does not release from chain
+-fixed bug 1032419: Eviscerate tech should not work while wearing gloves
+-fixed bug 1055724: Raise Zombies gives tame troll
+-fixed bug 1020980: Objects are forgotten when you search blind
+-fixed bug 954414: pickup_thrown option includes some non-throw weapons
+-fixed bug 937239: Wrong cause of death from exploding wands
+-fixed bug 962572: Inventory item prints to console instead of chat buffer
+-fixed bug 936167: Started with empty medical kit (Pasi Kallinen)
+-fixed bug 934077: Wrote an invisible scroll (Pasi Kallinen)
+-fixed bug 1015079: Spurious "it snatches the boulder" message (Pasi Kallinen)
+-fixed bug 957731: Shop purchases free after 200 objects
+-fixed bug 1062624: GTK Interface is not resizable
+-fixed bug 931684: Inventory window behaving strangely
+-Fixed build of proxy tests
+-fixed bug 1071688: cannot compile on FreeBSD (termcap)
+-fixed bug 1071623: Cannot compile on FreeBSD due to menucolor inclusion
+-Unbundled proxy and gtk modules:
+	http://www.nongnu.org/nhproxy/
+	http://www.gtkhack.org/
+-fixed bug 993420: Crashes when typing symbols on drop menu
+-fixed bug 1084366: ghoul queen don't has M2_FEMALE
+-fixed bug 1066530: Fired/thrown items get new inventory letter when retrieved
+-fixed bug 992244: Alt Gr key doesn't work
+-fixed bug 1076125: Unsuccessful use of medical kits
+-fixed bug 1076123: Vampires can eat white pills
+-fixed bug 994993: when polying, you take off T-shirt after scales merge
+-fixed bug 961914: Deep dragons should resist their own breath
+-fixed bug 963344: Stat exercise effects calculated while polymorphed
+-fixed bug 1097792: Duplicate message when hit by sleep gaze
+-fixed bug 1065927: Should bars stop bullets?
+-fixed bug 947009: Scroll of taming exercises skill in healing spells
+-fixed bug 1077355: game crashes with: "panic monsndx - could not index monster"
+-fixed bug 1098686: Restoring a mounted character wielding Sting can fail
+-fixed bug 1105100: Escaping from pits by polymorphing into a mind flayer
+-Proxy: Implement get_no_glyph method for compatibility with nhproxy 0.9.1
+-fixed bug 1110081: in_container() uses obj->quan after deallocatin obj
+-fixed bug 1116877: Dereferencing freed memory when applying bags which explode
+-fixed bug 951483: Wands of cancellation can be held in a bag of holding
+-fixed bug 1155634: charm spell or command undead spell invoke genocide
+-fixed incorrect #ifdef resulting in compilation failure on ANSI only DOS builds
+-fixed bug 1193070: Engraving with a wand of draining keeps illiterate
+		    conduct (Nico Kist)
+-fixed bug 924811: Fire vampires leave corpses
+-fixed bug 1028948: casting stone to flesh on a gargoyle
+-fixed bug 1213881: Lieutenants lack Firearms
+-fixed bug 1212903: Int and Wis stats not correct (in obscure case)
+-fixed bug 1175912: Deity-gifted pets should not attack like aligned unicorns
+		    (Nico Kist)
+-fixed bug 1205563: suppress_alert still says NetHack
+-fixed bug 1157414: Do not "loose" faith
+-fixed bug 1021014: leashed pet movement bug
+-fixed bug 1197822: necromancer zombie's hp
+-fixed bug 1185759: Shopkeeper "looks at corpse" through wall
+-Experimental support for GNU autoconf
 ver 0.0.7E6F2 [May 3/2004] [Released by Ali]
 -fixed bug 910334: Vampire blood and foodless conduct
 -fixed bug 924384: Inconsistency with shoggoth corroding items
diff -Naurbd slashem-0.0.8E0/include/artilist.h slashem-0.0.8E0F1/include/artilist.h
--- slashem-0.0.8E0/include/artilist.h	2005-07-02 08:31:37.000000000 +0100
+++ slashem-0.0.8E0F1/include/artilist.h	2006-05-15 12:13:10.000000000 +0100
@@ -153,7 +153,7 @@
 	PHYS(5,5),      NO_DFNS,        NO_CARY,        0, A_NEUTRAL, NON_PM, PM_GNOME, 1000L ),
 
 A("Sword of Balance",           SILVER_SHORT_SWORD,
-	SPFX_DALIGN, 0, 0,
+	(SPFX_RESTR|SPFX_DALIGN), 0, 0,
 	PHYS(2,5),      NO_DFNS,        NO_CARY,        0, A_NEUTRAL, NON_PM, NON_PM, 5000L ),
 
 A("Frost Brand",                LONG_SWORD,
diff -Naurbd slashem-0.0.8E0/include/color.h slashem-0.0.8E0F1/include/color.h
--- slashem-0.0.8E0/include/color.h	2005-07-02 08:31:37.000000000 +0100
+++ slashem-0.0.8E0F1/include/color.h	2006-05-15 12:13:10.000000000 +0100
@@ -17,7 +17,12 @@
  * exceptions, these are listed below.  Bright black doesn't mean very
  * much, so it is used as the "default" foreground color of the screen.
  */
-#define CLR_BLACK		0
+
+#ifndef VIDEOSHADES
+# define CLR_BLACK		0
+#else
+# define CLR_BLACK		8
+#endif
 #define CLR_RED			1
 #define CLR_GREEN		2
 #define CLR_BROWN		3 /* on IBM, low-intensity yellow is brown */
@@ -25,7 +30,11 @@
 #define CLR_MAGENTA		5
 #define CLR_CYAN		6
 #define CLR_GRAY		7 /* low-intensity white */
-#define NO_COLOR		8
+#ifndef VIDEOSHADES
+# define NO_COLOR		8
+#else
+# define NO_COLOR		0
+#endif
 #define CLR_ORANGE		9
 #define CLR_BRIGHT_GREEN	10
 #define CLR_YELLOW		11
@@ -73,4 +82,8 @@
 };
 #endif
 
+#if defined(VIDEOSHADES) && !defined(MSDOS)
+extern char ttycolors[CLR_MAX];
+#endif
+
 #endif /* COLOR_H */
diff -Naurbd slashem-0.0.8E0/include/config.h slashem-0.0.8E0F1/include/config.h
--- slashem-0.0.8E0/include/config.h	2005-07-02 08:31:37.000000000 +0100
+++ slashem-0.0.8E0F1/include/config.h	2006-05-15 12:13:10.000000000 +0100
@@ -159,10 +159,6 @@
 # endif
 #endif
 
-#ifndef DEFAULT_WINDOW_SYS
-# define DEFAULT_WINDOW_SYS "tty"
-#endif
-
 #ifdef X11_GRAPHICS
 /*
  * There are two ways that X11 tiles may be defined.  (1) using a custom
@@ -177,6 +173,13 @@
 # ifdef USE_XPM
 #  define GRAPHIC_TOMBSTONE	/* Use graphical tombstone (rip.xpm) */
 # endif
+# ifndef DEFAULT_WINDOW_SYS
+#  define DEFAULT_WINDOW_SYS "X11"
+# endif
+#endif
+
+#ifndef DEFAULT_WINDOW_SYS
+# define DEFAULT_WINDOW_SYS "tty"
 #endif
 
 /*
diff -Naurbd slashem-0.0.8E0/include/decl.h.orig slashem-0.0.8E0F1/include/decl.h.orig
--- slashem-0.0.8E0/include/decl.h.orig	2005-07-02 08:31:37.000000000 +0100
+++ slashem-0.0.8E0F1/include/decl.h.orig	1970-01-01 01:00:00.000000000 +0100
@@ -1,488 +0,0 @@
-/*	SCCS Id: @(#)decl.h	3.4	2001/12/10	*/
-/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
-/* NetHack may be freely redistributed.  See license for details. */
-
-#ifndef DECL_H
-#define DECL_H
-
-#define E extern
-
-E int NDECL((*occupation));
-E int NDECL((*afternmv));
-
-E const char *hname;
-E int hackpid;
-#if defined(UNIX) || defined(VMS)
-E int locknum;
-#endif
-#ifdef DEF_PAGER
-E char *catmore;
-#endif	/* DEF_PAGER */
-
-E char SAVEF[];
-#ifdef MICRO
-E char SAVEP[];
-#endif
-
-E NEARDATA int bases[MAXOCLASSES];
-
-E NEARDATA int multi;
-#if 0
-E NEARDATA int warnlevel;
-#endif
-E NEARDATA int lastuse;
-E NEARDATA int nextuse;
-E NEARDATA int nroom;
-E NEARDATA int nsubroom;
-E NEARDATA int occtime;
-
-#define WARNCOUNT 6			/* number of different warning levels */
-E uchar warnsyms[WARNCOUNT];
-
-E int x_maze_max, y_maze_max;
-E int otg_temp;
-
-#ifdef REDO
-E NEARDATA int in_doagain;
-#endif
-
-E struct dgn_topology {		/* special dungeon levels for speed */
-    d_level	d_oracle_level;
-    d_level	d_bigroom_level;	/* unused */
-#ifdef REINCARNATION
-    d_level	d_rogue_level;
-#endif
-    d_level	d_medusa_level;
-    d_level     d_mineend_level;
-    d_level	d_stronghold_level;
-    d_level	d_valley_level;
-    d_level	d_wiz1_level;
-    d_level	d_wiz2_level;
-    d_level	d_wiz3_level;
-    d_level	d_juiblex_level;
-    d_level	d_orcus_level;
-    d_level	d_baalzebub_level;	/* unused */
-    d_level     d_demogorgon_level;      /* unused */
-    d_level     d_dispater_level;      /* unused */
-    d_level     d_geryon_level;      /* unused */
-    d_level     d_yeenoghu_level;      /* unused */
-    d_level	d_asmodeus_level;	/* unused */
-    d_level	d_portal_level;		/* only in goto_level() [do.c] */
-    d_level	d_sanctum_level;
-    d_level	d_earth_level;
-    d_level	d_water_level;
-    d_level	d_fire_level;
-    d_level	d_air_level;
-    d_level	d_astral_level;
-    xchar	d_tower_dnum;
-    xchar	d_sokoban_dnum;
-    xchar	d_mines_dnum, d_quest_dnum;
-    xchar       d_spiders_dnum;
-    d_level	d_lawful_quest_level;
-    d_level	d_neutral_quest_level;
-    d_level	d_chaotic_quest_level;
-    d_level	d_qstart_level, d_qlocate_level, d_nemesis_level;
-    d_level	d_knox_level;
-#ifdef BLACKMARKET
-    d_level     d_blackmarket_level;
-#endif /* BLACKMARKET */
-} dungeon_topology;
-/* macros for accesing the dungeon levels by their old names */
-#define oracle_level		(dungeon_topology.d_oracle_level)
-#define bigroom_level		(dungeon_topology.d_bigroom_level)
-#ifdef REINCARNATION
-#define rogue_level		(dungeon_topology.d_rogue_level)
-#endif
-#define medusa_level		(dungeon_topology.d_medusa_level)
-#define stronghold_level	(dungeon_topology.d_stronghold_level)
-#define valley_level		(dungeon_topology.d_valley_level)
-#define mineend_level           (dungeon_topology.d_mineend_level)
-#define wiz1_level		(dungeon_topology.d_wiz1_level)
-#define wiz2_level		(dungeon_topology.d_wiz2_level)
-#define wiz3_level		(dungeon_topology.d_wiz3_level)
-#define juiblex_level		(dungeon_topology.d_juiblex_level)
-#define orcus_level		(dungeon_topology.d_orcus_level)
-#define baalzebub_level		(dungeon_topology.d_baalzebub_level)
-#define yeenoghu_level          (dungeon_topology.d_yeenoghu_level)
-#define geryon_level            (dungeon_topology.d_geryon_level)
-#define dispater_level          (dungeon_topology.d_dispater_level)
-#define demogorgon_level        (dungeon_topology.d_demogorgon_level)
-#define asmodeus_level		(dungeon_topology.d_asmodeus_level)
-#define portal_level		(dungeon_topology.d_portal_level)
-#define sanctum_level		(dungeon_topology.d_sanctum_level)
-#define earth_level		(dungeon_topology.d_earth_level)
-#define water_level		(dungeon_topology.d_water_level)
-#define fire_level		(dungeon_topology.d_fire_level)
-#define air_level		(dungeon_topology.d_air_level)
-#define astral_level		(dungeon_topology.d_astral_level)
-#define tower_dnum		(dungeon_topology.d_tower_dnum)
-#define sokoban_dnum		(dungeon_topology.d_sokoban_dnum)
-#define mines_dnum		(dungeon_topology.d_mines_dnum)
-#define quest_dnum		(dungeon_topology.d_quest_dnum)
-#define qstart_level		(dungeon_topology.d_qstart_level)
-#define qlocate_level		(dungeon_topology.d_qlocate_level)
-#define nemesis_level		(dungeon_topology.d_nemesis_level)
-#define knox_level		(dungeon_topology.d_knox_level)
-#define spiders_dnum		(dungeon_topology.d_spiders_dnum)
-#define lawful_quest_level	(dungeon_topology.d_lawful_quest_level)
-#define neutral_quest_level	(dungeon_topology.d_neutral_quest_level)
-#define chaotic_quest_level	(dungeon_topology.d_chaotic_quest_level)
-#ifdef BLACKMARKET
-#define blackmarket_level	(dungeon_topology.d_blackmarket_level)
-#endif /* BLACKMARKET */
-
-E NEARDATA stairway dnstair, upstair;		/* stairs up and down */
-#define xdnstair	(dnstair.sx)
-#define ydnstair	(dnstair.sy)
-#define xupstair	(upstair.sx)
-#define yupstair	(upstair.sy)
-
-E NEARDATA stairway dnladder, upladder;		/* ladders up and down */
-#define xdnladder	(dnladder.sx)
-#define ydnladder	(dnladder.sy)
-#define xupladder	(upladder.sx)
-#define yupladder	(upladder.sy)
-
-E NEARDATA stairway sstairs;
-
-E NEARDATA dest_area updest, dndest;	/* level-change destination areas */
-
-E NEARDATA coord inv_pos;
-E NEARDATA dungeon dungeons[];
-E NEARDATA s_level *sp_levchn;
-#define dunlev_reached(x)	(dungeons[(x)->dnum].dunlev_ureached)
-
-#include "quest.h"
-E struct q_score quest_status;
-
-E NEARDATA char pl_fruit[PL_FSIZ];
-E NEARDATA int current_fruit;
-E NEARDATA struct fruit *ffruit;
-
-E NEARDATA char tune[6];
-
-#define MAXLINFO (MAXDUNGEON * MAXLEVEL)
-E struct linfo level_info[MAXLINFO];
-
-E NEARDATA struct sinfo {
-	int gameover;		/* self explanatory? */
-	int stopprint;		/* inhibit further end of game disclosure */
-#if defined(UNIX) || defined(VMS) || defined (__EMX__) || defined(WIN32)
-	int done_hup;		/* SIGHUP or moral equivalent received
-				 * -- no more screen output */
-#endif
-	int something_worth_saving;	/* in case of panic */
-	int panicking;		/* `panic' is in progress */
-#if defined(VMS) || defined(WIN32)
-	int exiting;		/* an exit handler is executing */
-#endif
-	int in_impossible;
-#ifdef PANICLOG
-	int in_paniclog;
-#endif
-} program_state;
-
-E boolean restoring;
-
-E const char quitchars[];
-E const char vowels[];
-E const char ynchars[];
-E const char ynqchars[];
-E const char ynaqchars[];
-E const char ynNaqchars[];
-E NEARDATA long yn_number;
-
-E const char disclosure_options[];
-
-E NEARDATA int smeq[];
-E NEARDATA int doorindex;
-E NEARDATA char *save_cm;
-#define KILLED_BY_AN	 0
-#define KILLED_BY	 1
-#define NO_KILLER_PREFIX 2
-E NEARDATA int killer_format;
-E const char *killer;
-E const char *delayed_killer;
-#ifdef GOLDOBJ
-E long done_money;
-#endif
-E char killer_buf[BUFSZ];
-#ifdef DUMP_LOG
-E char dump_fn[];		/* dumpfile name (dump patch) */
-#endif
-E const char *configfile;
-E NEARDATA char plname[PL_NSIZ];
-E NEARDATA char dogname[];
-E NEARDATA char catname[];
-E NEARDATA char ghoulname[];
-E NEARDATA char horsename[];
-E NEARDATA char wolfname[];
-#if 0
-E NEARDATA char batname[];
-E NEARDATA char snakename[];
-E NEARDATA char ratname[];
-E NEARDATA char badgername[];
-E NEARDATA char reddragonname[];
-E NEARDATA char whitedragonname[];
-#endif
-E char preferred_pet;
-E const char *occtxt;			/* defined when occupation != NULL */
-E const char *nomovemsg;
-E const char nul[];
-E char lock[];
-
-E const char sdir[], ndir[];
-E const schar xdir[], ydir[], zdir[];
-
-E NEARDATA schar tbx, tby;		/* set in mthrowu.c */
-
-E NEARDATA struct multishot { int n, i; short o; boolean s; } m_shot;
-
-E NEARDATA struct dig_info {		/* apply.c, hack.c */
-	int	effort;
-	d_level level;
-	coord	pos;
-	long lastdigtime;
-	boolean down, chew, warned, quiet;
-} digging;
-
-E NEARDATA long moves, monstermoves;
-E NEARDATA long wailmsg;
-
-E NEARDATA boolean in_mklev;
-E NEARDATA boolean stoned;
-E NEARDATA boolean unweapon;
-E NEARDATA boolean mrg_to_wielded;
-E NEARDATA struct obj *current_wand;
-
-E NEARDATA boolean in_steed_dismounting;
-
-E const int shield_static[];
-
-
-/*** Objects ***/
-#include "obj.h"
-
-E NEARDATA struct obj *invent, *uarm, *uarmc, *uarmh, *uarms, *uarmg, *uarmf,
-#ifdef TOURIST
-	*uarmu,				/* under-wear, so to speak */
-#endif
-#ifdef STEED
-	*usaddle,
-#endif
-	*uskin, *uamul, *uleft, *uright, *ublindf,
-	*uwep, *uswapwep, *uquiver;
-
-E NEARDATA struct obj *uchain;		/* defined only when punished */
-E NEARDATA struct obj *uball;
-E NEARDATA struct obj *migrating_objs;
-E NEARDATA struct obj *billobjs;
-E NEARDATA struct obj zeroobj;		/* init'd and defined in decl.c */
-E NEARDATA struct obj thisplace;	/* init'd and defined in decl.c */
-
-#include "spell.h"
-E NEARDATA struct spell spl_book[];	/* sized in decl.c */
-
-#ifndef TECH_H
-#include "tech.h"
-#endif
-E NEARDATA struct tech tech_list[];     /* sized in decl.c */
-
-
-/*** The player ***/
-E NEARDATA char pl_character[PL_CSIZ];
-E NEARDATA char pl_race;		/* character's race */
-/* KMH, role patch -- more maintainable when declared as an array */
-E const char pl_classes[];
-
-#include "you.h"
-#include "onames.h"
-
-E NEARDATA struct you u;
-E NEARDATA struct Role urole;
-
-
-/*** Monsters ***/
-#ifndef PM_H
-#include "pm.h"
-#endif
-
-E NEARDATA struct permonst playermon, *uasmon;
-					/* also decl'd extern in permonst.h */
-					/* init'd in monst.c */
-
-E NEARDATA struct monst youmonst;	/* init'd and defined in decl.c */
-E NEARDATA struct monst *mydogs, *migrating_mons;
-
-E NEARDATA struct permonst upermonst;	/* init'd in decl.c, 
-					 * defined in polyself.c 
-					 */
-
-E NEARDATA struct mvitals {
-	uchar	born;
-	uchar	died;
-	uchar	mvflags;
-#ifdef EATEN_MEMORY
-	uchar	eaten;		/* WAC -- eaten memory */
-#endif
-} mvitals[NUMMONS];
-
-
-/* The names of the colors used for gems, etc. */
-E const char *c_obj_colors[];
-
-E struct c_common_strings {
-    const char	*const c_nothing_happens, *const c_thats_enough_tries,
-		*const c_silly_thing_to, *const c_shudder_for_moment,
-		*const c_something, *const c_Something,
-		*const c_You_can_move_again,
-		*const c_Never_mind, *c_vision_clears,
-		*const c_the_your[2];
-} c_common_strings;
-#define nothing_happens    c_common_strings.c_nothing_happens
-#define thats_enough_tries c_common_strings.c_thats_enough_tries
-#define silly_thing_to	   c_common_strings.c_silly_thing_to
-#define shudder_for_moment c_common_strings.c_shudder_for_moment
-#define something	   c_common_strings.c_something
-#define Something	   c_common_strings.c_Something
-#define You_can_move_again c_common_strings.c_You_can_move_again
-#define Never_mind	   c_common_strings.c_Never_mind
-#define vision_clears	   c_common_strings.c_vision_clears
-#define the_your	   c_common_strings.c_the_your
-
-E const char no_elbow_room[];
-
-/* material strings */
-E const char *materialnm[];
-
-/* Monster name articles */
-#define ARTICLE_NONE	0
-#define ARTICLE_THE	1
-#define ARTICLE_A	2
-#define ARTICLE_YOUR	3
-
-/* Monster name suppress masks */
-#define SUPPRESS_IT		0x01
-#define SUPPRESS_INVISIBLE	0x02
-#define SUPPRESS_HALLUCINATION  0x04
-#define SUPPRESS_SADDLE		0x08
-#define EXACT_NAME		0x0F
-
-
-/*** Vision ***/
-E NEARDATA boolean vision_full_recalc;	/* TRUE if need vision recalc */
-E NEARDATA char **viz_array;		/* could see/in sight row pointers */
-
-
-/*** Window system stuff ***/
-#include "color.h"
-#ifdef TEXTCOLOR
-E const int zapcolors[];
-#endif
-
-E const char def_oc_syms[MAXOCLASSES];	/* default class symbols */
-E uchar oc_syms[MAXOCLASSES];		/* current class symbols */
-E const char def_monsyms[MAXMCLASSES];	/* default class symbols */
-E uchar monsyms[MAXMCLASSES];		/* current class symbols */
-
-E NEARDATA struct c_color_names {
-    const char	*const c_black, *const c_amber, *const c_golden,
-		*const c_light_blue,*const c_red, *const c_green,
-		*const c_silver, *const c_blue, *const c_purple,
-		*const c_white;
-} c_color_names;
-#define NH_BLACK		c_color_names.c_black
-#define NH_AMBER		c_color_names.c_amber
-#define NH_GOLDEN		c_color_names.c_golden
-#define NH_LIGHT_BLUE		c_color_names.c_light_blue
-#define NH_RED			c_color_names.c_red
-#define NH_GREEN		c_color_names.c_green
-#define NH_SILVER		c_color_names.c_silver
-#define NH_BLUE			c_color_names.c_blue
-#define NH_PURPLE		c_color_names.c_purple
-#define NH_WHITE		c_color_names.c_white
-
-E NEARDATA winid WIN_MESSAGE, WIN_STATUS;
-E NEARDATA winid WIN_MAP, WIN_INVEN;
-E char toplines[];
-#ifndef TCAP_H
-E struct tc_gbl_data {	/* also declared in tcap.h */
-    char *tc_AS, *tc_AE;	/* graphics start and end (tty font swapping) */
-    int   tc_LI,  tc_CO;	/* lines and columns */
-} tc_gbl_data;
-#define AS tc_gbl_data.tc_AS
-#define AE tc_gbl_data.tc_AE
-#define LI tc_gbl_data.tc_LI
-#define CO tc_gbl_data.tc_CO
-#endif
-
-E struct authentication {
-    char prog[BUFSZ];
-    char args[BUFSZ];
-} authentication;
-
-#define MAXNOTILESETS		20
-#ifndef TILESET_MAX_FILENAME
-#define TILESET_MAX_FILENAME	256
-#endif
-
-#define TILESET_TRANSPARENT	1
-#define TILESET_PSEUDO3D	2
-
-E struct tileset {
-    char name[PL_PSIZ];
-    char file[TILESET_MAX_FILENAME];
-    unsigned long flags;
-    void *data;				/* For windowing port's use */
-} tilesets[MAXNOTILESETS];
-E int no_tilesets;
-E struct tileset def_tilesets[];
-E char tileset[PL_PSIZ];
-
-/* xxxexplain[] is in drawing.c */
-E const char * const monexplain[], invisexplain[], * const objexplain[], * const oclass_names[];
-
-/* Some systems want to use full pathnames for some subsets of file names,
- * rather than assuming that they're all in the current directory.  This
- * provides all the subclasses that seem reasonable, and sets up for all
- * prefixes being null.  Port code can set those that it wants.
- */
-#define HACKPREFIX	0
-#define LEVELPREFIX	1
-#define SAVEPREFIX	2
-#define BONESPREFIX	3
-#define DATAPREFIX	4	/* this one must match hardcoded value in dlb.c */
-#define SCOREPREFIX	5
-#define LOCKPREFIX	6
-#define CONFIGPREFIX	7
-#define TROUBLEPREFIX	8
-#define PREFIX_COUNT	9
-/* used in files.c; xxconf.h can override if needed */
-# ifndef FQN_MAX_FILENAME
-#define FQN_MAX_FILENAME 512
-# endif
-
-#if defined(NOCWD_ASSUMPTIONS) || defined(VAR_PLAYGROUND)
-/* the bare-bones stuff is unconditional above to simplify coding; for
- * ports that actually use prefixes, add some more localized things
- */
-#define PREFIXES_IN_USE
-#endif
-
-E char *fqn_prefix[PREFIX_COUNT];
-#ifdef PREFIXES_IN_USE
-E char *fqn_prefix_names[PREFIX_COUNT];
-#endif
-
-
-#ifdef AUTOPICKUP_EXCEPTIONS
-struct autopickup_exception {
-	char *pattern;
-	boolean grab;
-	struct autopickup_exception *next;
-};
-#endif /* AUTOPICKUP_EXCEPTIONS */
-
-#undef E
-
-#endif /* DECL_H */
diff -Naurbd slashem-0.0.8E0/include/global.h slashem-0.0.8E0F1/include/global.h
--- slashem-0.0.8E0/include/global.h	2005-07-02 08:31:37.000000000 +0100
+++ slashem-0.0.8E0F1/include/global.h	2006-05-15 12:13:10.000000000 +0100
@@ -209,6 +209,12 @@
  * config.h and *conf.h
  */
 #include "autoconf.h"
+#if HAVE_STRING_H
+#include <string.h>
+#endif
+#if HAVE_DECL_STRNICMP && !HAVE_DECL_STRNCMPI
+#define strncmpi(a,b,c) strnicmp(a,b,c)
+#endif
 #endif
 
 #ifndef FILE_AREAS
diff -Naurbd slashem-0.0.8E0/include/mondata.h slashem-0.0.8E0F1/include/mondata.h
--- slashem-0.0.8E0/include/mondata.h	2005-07-02 08:31:37.000000000 +0100
+++ slashem-0.0.8E0F1/include/mondata.h	2006-05-15 12:13:10.000000000 +0100
@@ -176,7 +176,8 @@
 				 ((ptr) == &mons[PM_FIRE_ELEMENTAL]) ? 2 : \
 				 ((ptr) == &mons[PM_FIRE_VAMPIRE])? 2 : \
 				 ((ptr) == &mons[PM_FLAMING_SPHERE]) ? 1 : \
-				 ((ptr) == &mons[PM_SHOCKING_SPHERE]) ? 1 : 0)
+				 ((ptr) == &mons[PM_SHOCKING_SPHERE]) ? 1 : \
+				 ((ptr) == &mons[PM_WAX_GOLEM]) ? 1 : 0)
 /*	[note: the light ranges above were reduced to 1 for performance...] */
 /*  WAC increased to 3 and 2?*/
 #define likes_lava(ptr)		(ptr == &mons[PM_FIRE_ELEMENTAL] || \
diff -Naurbd slashem-0.0.8E0/include/ntconf.h slashem-0.0.8E0F1/include/ntconf.h
--- slashem-0.0.8E0/include/ntconf.h	2005-07-02 08:31:37.000000000 +0100
+++ slashem-0.0.8E0F1/include/ntconf.h	2006-05-15 12:13:10.000000000 +0100
@@ -46,7 +46,9 @@
 #ifdef NH_OPTIONS_USED
 #undef NH_OPTIONS_USED
 #endif
-#if defined(MSWIN_GRAPHICS) || defined(GTK_GRAPHICS)
+#if defined(AUTOCONF)
+#define NH_OPTIONS_USED	"options"
+#elif defined(MSWIN_GRAPHICS) || defined(GTK_GRAPHICS)
 #define NH_OPTIONS_USED	"guioptions"
 #else
 #define NH_OPTIONS_USED	"ttyoptions"
@@ -70,12 +72,14 @@
 #include <process.h>	/* Provides prototypes of exit(), spawn()      */
 #endif
 
+#ifndef AUTOCONF
 #include <string.h>	/* Provides prototypes of strncmpi(), etc.     */
 #ifdef STRNCMPI
 #ifndef __CYGWIN__
 #define strncmpi(a,b,c) strnicmp(a,b,c)
 #endif
 #endif
+#endif /* AUTOCONF */
 
 #include <sys/types.h>
 #include <stdlib.h>
diff -Naurbd slashem-0.0.8E0/include/os2conf.h slashem-0.0.8E0F1/include/os2conf.h
--- slashem-0.0.8E0/include/os2conf.h	2005-07-02 08:31:37.000000000 +0100
+++ slashem-0.0.8E0F1/include/os2conf.h	2006-05-15 12:13:10.000000000 +0100
@@ -43,6 +43,10 @@
 #define MAIL			/* Allows for fake mail daemon to deliver mail */
 #define TIMED_DELAY		/* enable the `timed_delay' run-time option */
 
+#ifdef TEXTCOLOR
+# define VIDEOSHADES
+#endif
+
 /*
  * The remaining code shouldn't need modification.
  */
diff -Naurbd slashem-0.0.8E0/include/patchlevel.h slashem-0.0.8E0F1/include/patchlevel.h
--- slashem-0.0.8E0/include/patchlevel.h	2005-07-02 08:31:37.000000000 +0100
+++ slashem-0.0.8E0F1/include/patchlevel.h	2006-05-15 12:13:10.000000000 +0100
@@ -16,10 +16,10 @@
  */
 #define PATCHLEVEL      8
 #define EDITLEVEL	0
-/* #define FIXLEVEL        0 */
+#define FIXLEVEL        1
 
 #define COPYRIGHT_BANNER_A \
-"This is SuperLotsoAddedStuffHack-Extended Magic 1997-2004"
+"This is SuperLotsoAddedStuffHack-Extended Magic 1997-2005"
 
 #define COPYRIGHT_BANNER_B \
 "NetHack, Copyright 1985-2003 Stichting Mathematisch Centrum, M. Stephenson."
diff -Naurbd slashem-0.0.8E0/include/unixconf.h slashem-0.0.8E0F1/include/unixconf.h
--- slashem-0.0.8E0/include/unixconf.h	2005-07-02 08:31:37.000000000 +0100
+++ slashem-0.0.8E0F1/include/unixconf.h	2006-05-15 12:13:10.000000000 +0100
@@ -196,6 +196,10 @@
  * a fine-grained timer.
  */
 /* #define TIMED_DELAY */	/* usleep() */
+
+# ifdef TEXTCOLOR
+#  define VIDEOSHADES
+# endif
 #endif
 
 /*
diff -Naurbd slashem-0.0.8E0/readme.txt slashem-0.0.8E0F1/readme.txt
--- slashem-0.0.8E0/readme.txt	2005-07-02 08:31:37.000000000 +0100
+++ slashem-0.0.8E0F1/readme.txt	2006-05-15 12:13:10.000000000 +0100
@@ -65,114 +65,68 @@
 1.2 Changes
 -----------
 
-ver 0.0.8E0 [July 2/2005] [Released by Ali]
--Added dumplog patch (Tom Friedetzky and Jukka Lahtinen)
--fixed bug 923003: Invisible mirrors can be applied
--fixed bug 916544: Wrong weight of corpses on Nightmare level
--fixed bug 947369: Crash when multiple wands explode
--fixed bug 950120: crash when wishing for Wallet of Perseus
--fixed bug 933365: wand of draining does not interrupt ctrl-run
--fixed bug 933379: weird behaviour with polyself into monsters like migo drone
--fixed bug 929546: Flaming spheres won't attack acid blobs
--fixed bug 951991: Reading spellbooks not safe for wizards
--fixed bug 914894: "Beautiful" gnome thief seduced female character
--fixed bug 918178: Double message "You are suddenly very hot/cold!"
--fixed bug 921810: Invisible books can be read (?!)
--fixed bug 934076: Dipping amnesia into amnesia gives water
--fixed bug 946306: do_look: bad glyph 3726 at (7, 16)
--fixed bug 929220: Prayer and chi healing
--fixed bug 946157: Water elementals created over lava on Flame mage quest
--fixed bug 946161: Bad message when two-weaponing against a rust monster
--fixed bug 946566: Partly eaten more nutritious while raising drained corpses
--fixed bug 946984: arch-liches are not MR_HITAS*
--fixed bug 949016: Draining a rotten corpse
--fixed bug 951439: Invisible Corpses and Ressurection
--fixed bug 941453: Grand slam against monsters needing +n weapons
--fixed bug 962515: Disarming fire trap doesn't use up water
--fixed bug 1001167: Is this a Gray Stone bug?
--fixed bug 992247: wolfname & ghoulname in default.nh doesn't work
--fixed bug 931679: Space Bar not working as rest
--fixed bug 912588: Molds stagger from your powerful strike
--fixed bug 962574: Display bug when setting OPTIONS=tiles:Small tiles
--fixed bug 1011313: SEGV using technique "raise zombies"
--fixed bug 1018229: impossible splitbill: no resident shopkeeper??
--fixed bug 1018447: Game crash when Hero with ball displace displacer beast
--fixed bug 1020983: Typo in doc/sources.txt (cloack)
--fixed bug 956891: Breeders are explosive
--fixed bug 1007127: diluted potion of water
--fixed bug 1010421: Thiefbane drains your levels even if you aren't hit
--fixed bug 976157: Dipping into !oAmnesia didn't use up potion
--fixed bug 982331: Can't name Cursed scrolls of teleport after reading them
--fixed some theoretical bugs thrown up by valgrind
--fixed bug 980258: Guidebook doesn't describe showdmg option accurately
-		   (Andy Ruse)
--fixed bug 926202: Gnome thieves don't eat (Andy Ruse)
--fixed bug 926200: Dwarf thieves have M2_NOPOLY (Andy Ruse)
--fixed bug 962568: Mjollnir can't be thrown - code comment incorrect (Andy Ruse)
--fixed bug 1005587: Beholder killed by "it's" own gaze (Andy Ruse)
--fixed bug 1022460: [C343-8] The plural of Nazgul is Nazgul (Andy Ruse)
--fixed bug 1039689: malloc_consolidate hang after using cursed bag of holding
--fixed bug 1028955: Surgery technique doesn't work with polymorph
--fixed bug 1035356: God gave Deathsword to "human" character
--fixed bug 1024200: Problems about Thiefbane
--fixed bug 1024202: Dipping a loadstone into a potion of amnesia
--fixed bug 1038151: Power surge becomes permanent if lost
--fixed bug 1025486: Pets can't follow lvl telep from Blk Mkt
--fixed bug 1029750: Lycanthropes and eating wolfsbane while polymorphed
--fixed bug 1030725: Doppelganger liquid leap does not release from chain
--fixed bug 1032419: Eviscerate tech should not work while wearing gloves
--fixed bug 1055724: Raise Zombies gives tame troll
--fixed bug 1020980: Objects are forgotten when you search blind
--fixed bug 954414: pickup_thrown option includes some non-throw weapons
--fixed bug 937239: Wrong cause of death from exploding wands
--fixed bug 962572: Inventory item prints to console instead of chat buffer
--fixed bug 936167: Started with empty medical kit (Pasi Kallinen)
--fixed bug 934077: Wrote an invisible scroll (Pasi Kallinen)
--fixed bug 1015079: Spurious "it snatches the boulder" message (Pasi Kallinen)
--fixed bug 957731: Shop purchases free after 200 objects
--fixed bug 1062624: GTK Interface is not resizable
--fixed bug 931684: Inventory window behaving strangely
--Fixed build of proxy tests
--fixed bug 1071688: cannot compile on FreeBSD (termcap)
--fixed bug 1071623: Cannot compile on FreeBSD due to menucolor inclusion
--Unbundled proxy and gtk modules:
-	http://www.nongnu.org/nhproxy/
-	http://www.gtkhack.org/
--fixed bug 993420: Crashes when typing symbols on drop menu
--fixed bug 1084366: ghoul queen don't has M2_FEMALE
--fixed bug 1066530: Fired/thrown items get new inventory letter when retrieved
--fixed bug 992244: Alt Gr key doesn't work
--fixed bug 1076125: Unsuccessful use of medical kits
--fixed bug 1076123: Vampires can eat white pills
--fixed bug 994993: when polying, you take off T-shirt after scales merge
--fixed bug 961914: Deep dragons should resist their own breath
--fixed bug 963344: Stat exercise effects calculated while polymorphed
--fixed bug 1097792: Duplicate message when hit by sleep gaze
--fixed bug 1065927: Should bars stop bullets?
--fixed bug 947009: Scroll of taming exercises skill in healing spells
--fixed bug 1077355: game crashes with: "panic monsndx - could not index monster"
--fixed bug 1098686: Restoring a mounted character wielding Sting can fail
--fixed bug 1105100: Escaping from pits by polymorphing into a mind flayer
--Proxy: Implement get_no_glyph method for compatibility with nhproxy 0.9.1
--fixed bug 1110081: in_container() uses obj->quan after deallocatin obj
--fixed bug 1116877: Dereferencing freed memory when applying bags which explode
--fixed bug 951483: Wands of cancellation can be held in a bag of holding
--fixed bug 1155634: charm spell or command undead spell invoke genocide
--fixed incorrect #ifdef resulting in compilation failure on ANSI only DOS builds
--fixed bug 1193070: Engraving with a wand of draining keeps illiterate
-		    conduct (Nico Kist)
--fixed bug 924811: Fire vampires leave corpses
--fixed bug 1028948: casting stone to flesh on a gargoyle
--fixed bug 1213881: Lieutenants lack Firearms
--fixed bug 1212903: Int and Wis stats not correct (in obscure case)
--fixed bug 1175912: Deity-gifted pets should not attack like aligned unicorns
-		    (Nico Kist)
--fixed bug 1205563: suppress_alert still says NetHack
--fixed bug 1157414: Do not "loose" faith
--fixed bug 1021014: leashed pet movement bug
--fixed bug 1197822: necromancer zombie's hp
--fixed bug 1185759: Shopkeeper "looks at corpse" through wall
--Experimental support for GNU autoconf
+ver 0.0.8E0F1 [?] [Released by ?]
+-fixed bug 1231549: GNU autoconf vpath support is broken
+-fixed bug 1231579: Can't specify wizard with GNU autoconf
+-fixed bug 1232707: engraving with lightsabers
+-fixed bug 1239041: engrave dialog doesn't show lightsabers
+-fixed bug 1231766: Food shown in Medical Kits
+-fixed bug 1238060: grammatical error when burning through a door 
+		    (Benjamin Schieder)
+-fixed bug 1104713: Pet and Frozen food stores can charge
+-fixed bug 988827: Monster wearing CoI left invisible corpse
+-fixed bug 934078: Mold "wiggle" out of bag
+-fixed bug 933587: One-Eyed Sam referred to as "it"
+-fixed bug 1240794: Pets don't grow up properly
+-fixed bug 1240799: Steed ridden onto poly trap polymorphs permanently
+-fixed bug 1243904: chameleon as statue trap
+-fixed bug 1223226: Some creatures are missing horns
+-fixed bug 1223222: Female Bulls??
+-fixed bug 1244470: shopkeeper don't have shotgun
+Autoconf improvements:
+	-support for data librarian,
+	-fix default values in help strings,
+	-more portable use of test and sed,
+	-drop useless borg and shout features,
+	-recognize mingw32 platform for msys,
+	-support aclocal 1.7 (needed for msys development),
+	-basic support for Microsoft Window's native graphics,
+	-better determination of default windowing system,
+	-improved detection of libpng/zlib,
+	-support "make depend".
+-fixed bug 215062: no black color
+		   Extends videocolors option, see Guidebook for details.
+-Macintosh: fixed calculation of version for About Box
+-fixed bug 1258354: msys autoconf fails to detect strncmpi
+-fixed bug 1258355: autoconf Makefile.src assumes UNIX
+-fixed bug 1258357: configure doesn't set TTY_GRAPHICS under mingw32
+-fixed bug 1258358: No autoconf support for key handlers
+-fixed bug 1244468: different spitting venom when polymorph
+-fixed bug 1179557: Found egg marked (laid by you)
+-fixed bug 1206099: Torches are not extinguished with rust traps
+-fixed bug 1294907: 'Raise Zombies' technique cannot raise dwarf zombies! (Xeno)
+-fixed bug 1355972: Monsters Don't gain Drain resistance due to worn items!
+		    (Xeno)
+-inserted missing #ifdef resulting in compilation of pure ansi tty version for DOS failure.
+-fixed bug 1461660: Misaligned door
+-fixed bug 1449238: #youpoly takes a turn when denied
+-fixed bug 1432473: help for Luggage shows help for Lug/Lugh
+-fixed bug 1428520: Poisoned ID'd weapon gives description as well as ID
+-fixed bug 1375292: help for wombat shows text for bat
+-fixed bug 1375286: pummel strikes nothing, inside ochre jelly
+-fixed bug 1355891: Cannot wish for multiple potions of vampire blood
+-fixed bug 1314114: Shopkeepers cant see Shirts through invisible armour
+-fixed bug 1304954: You can Name the Sword of Balance
+-fixed bug 1223533: Typo error in the Install.X11 file
+-fixed bug 1407275: Wrong weight of medical kits
+-fixed bug 1213658: Death message missing with gas spore explosion when blind
+-fixed bug 1291161: #force command doesn't work on locked box
+-fixed bug 1223632: #force on shop doors
+-fixed bug 879247: gender & alignment select dont focus on "random" button
+-fixed bug 943553: Eating off floor while levitating
+-fixed bug 1432411: Knew the colour of a potion thrown on me, when blind
+-fixed bug 1449159: DEFAULT_WINDOW_SYS wrong if only X11 enabled
+-fixed bug 1400802: wax golems don't emit light
 
 See history.txt for changes made in previous versions.
 
diff -Naurbd slashem-0.0.8E0/src/allmain.c.orig slashem-0.0.8E0F1/src/allmain.c.orig
--- slashem-0.0.8E0/src/allmain.c.orig	2005-07-02 08:31:37.000000000 +0100
+++ slashem-0.0.8E0F1/src/allmain.c.orig	1970-01-01 01:00:00.000000000 +0100
@@ -1,718 +0,0 @@
-/*	SCCS Id: @(#)allmain.c	3.4	2003/04/02	*/
-/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
-/* NetHack may be freely redistributed.  See license for details. */
-
-/* various code that was replicated in *main.c */
-
-#include "hack.h"
-#ifndef NO_SIGNAL
-#include <signal.h>
-#endif
-#ifdef SHORT_FILENAMES
-#include "patchlev.h"
-#else
-#include "patchlevel.h"
-#endif
-
-#ifdef POSITIONBAR
-STATIC_DCL void NDECL(do_positionbar);
-#endif
-
-#define decrnknow(spell)	spl_book[spell].sp_know--
-#define spellid(spell)		spl_book[spell].sp_id
-#define spellknow(spell)	spl_book[spell].sp_know
-
-#ifdef OVL0
-
-void
-moveloop()
-{
-#if defined(MICRO) || defined(WIN32)
-    char ch;
-    int abort_lev;
-#endif
-    int moveamt = 0, wtcap = 0, change = 0;
-    boolean didmove = FALSE, monscanmove = FALSE;
-
-    flags.moonphase = phase_of_the_moon();
-    if(flags.moonphase == FULL_MOON) {
-	You("are lucky!  Full moon tonight.");
-	change_luck(1);
-    } else if(flags.moonphase == NEW_MOON) {
-	pline("Be careful!  New moon tonight.");
-    }
-    flags.friday13 = friday_13th();
-    if (flags.friday13) {
-	pline("Watch out!  Bad things can happen on Friday the 13th.");
-	change_luck(-1);
-    }
-    /* KMH -- February 2 */
-    flags.groundhogday = groundhog_day();
-    if (flags.groundhogday)
-	pline("Happy Groundhog Day!");
-
-    initrack();
-
-
-    /* Note:  these initializers don't do anything except guarantee that
-	    we're linked properly.
-    */
-    decl_init();
-    monst_init();
-    monstr_init();	/* monster strengths */
-    objects_init();
-
-#ifdef WIZARD
-    if (wizard) add_debug_extended_commands();
-#endif
-
-    (void) encumber_msg(); /* in case they auto-picked up something */
-
-    u.uz0.dlevel = u.uz.dlevel;
-    youmonst.movement = NORMAL_SPEED;	/* give the hero some movement points */
-
-    for(;;) {
-	get_nh_event();
-#ifdef POSITIONBAR
-	do_positionbar();
-#endif
-
-	didmove = flags.move;
-	if(didmove) {
-	    /* actual time passed */
-	    youmonst.movement -= NORMAL_SPEED;
-
-	    do { /* hero can't move this turn loop */
-		wtcap = encumber_msg();
-
-		flags.mon_moving = TRUE;
-		do {
-		    monscanmove = movemon();
-		    if (youmonst.movement > NORMAL_SPEED)
-			break;	/* it's now your turn */
-		} while (monscanmove);
-		flags.mon_moving = FALSE;
-
-		if (!monscanmove && youmonst.movement < NORMAL_SPEED) {
-		    /* both you and the monsters are out of steam this round */
-		    /* set up for a new turn */
-		    struct monst *mtmp;
-		    mcalcdistress();	/* adjust monsters' trap, blind, etc */
-
-		    /* reallocate movement rations to monsters */
-		    for (mtmp = fmon; mtmp; mtmp = mtmp->nmon)
-			mtmp->movement += mcalcmove(mtmp);
-
-		    if(!rn2(u.uevent.udemigod ? 25 :
-			    (depth(&u.uz) > depth(&stronghold_level)) ? 50 : 70))
-			(void) makemon((struct permonst *)0, 0, 0, NO_MM_FLAGS);
-
-		    /* calculate how much time passed. */
-#ifdef STEED
-		    if (u.usteed && u.umoved) {
-			/* your speed doesn't augment steed's speed */
-			moveamt = mcalcmove(u.usteed);
-		    } else
-#endif
-		    {
-			moveamt = youmonst.data->mmove;
-
-			if (Very_fast) {	/* speed boots or potion */
-			    /* average movement is 1.67 times normal */
-			    moveamt += NORMAL_SPEED / 2;
-			    if (rn2(3) == 0) moveamt += NORMAL_SPEED / 2;
-			} else if (Fast) {
-			    /* average movement is 1.33 times normal */
-			    if (rn2(3) != 0) moveamt += NORMAL_SPEED / 2;
-			}
-			if (tech_inuse(T_BLINK)) { /* TECH: Blinking! */
-			    /* Case    Average  Variance
-			     * -------------------------
-			     * Normal    12         0
-			     * Fast      16        12
-			     * V fast    20        12
-			     * Blinking  24        12
-			     * F & B     28        18
-			     * V F & B   30        18
-			     */
-			    moveamt += NORMAL_SPEED * 2 / 3;
-			    if (rn2(3) == 0) moveamt += NORMAL_SPEED / 2;
-			}
-		    }
-
-		    switch (wtcap) {
-			case UNENCUMBERED: break;
-			case SLT_ENCUMBER: moveamt -= (moveamt / 4); break;
-			case MOD_ENCUMBER: moveamt -= (moveamt / 2); break;
-			case HVY_ENCUMBER: moveamt -= ((moveamt * 3) / 4); break;
-			case EXT_ENCUMBER: moveamt -= ((moveamt * 7) / 8); break;
-			default: break;
-		    }
-
-		    youmonst.movement += moveamt;
-		    if (youmonst.movement < 0) youmonst.movement = 0;
-		    settrack();
-
-		    monstermoves++;
-		    moves++;
-
-		    /********************************/
-		    /* once-per-turn things go here */
-		    /********************************/
-
-		    if (flags.bypasses) clear_bypasses();
-		    if(Glib) glibr();
-		    nh_timeout();
-		    run_regions();
-
-#ifdef DUNGEON_GROWTH
-		    dgn_growths(TRUE, TRUE);
-#endif
-
-		    if (u.ublesscnt)  u.ublesscnt--;
-		    
-		    if(flags.time && !flags.run)
-			flags.botl = 1;
-
-		    /* One possible result of prayer is healing.  Whether or
-		     * not you get healed depends on your current hit points.
-		     * If you are allowed to regenerate during the prayer, the
-		     * end-of-prayer calculation messes up on this.
-		     * Another possible result is rehumanization, which requires
-		     * that encumbrance and movement rate be recalculated.
-		     */
-		    if (u.uinvulnerable) {
-			/* for the moment at least, you're in tiptop shape */
-			wtcap = UNENCUMBERED;
-		    } else if (Upolyd && youmonst.data->mlet == S_EEL && !is_pool(u.ux,u.uy) && !Is_waterlevel(&u.uz)) {
-			if (u.mh > 1) {
-			    u.mh--;
-			    flags.botl = 1;
-			} else if (u.mh < 1)
-			    rehumanize();
-		    } else if (Upolyd && u.mh < u.mhmax) {
-			if (u.mh < 1)
-			    rehumanize();
-			else if (Regeneration ||
-				    (wtcap < MOD_ENCUMBER && !(moves%20))) {
-			    flags.botl = 1;
-			    u.mh++;
-			}
-		    } else if (u.uhp < u.uhpmax &&
-			 (wtcap < MOD_ENCUMBER || !u.umoved || Regeneration)) {
-/*
- * KMH, balance patch -- New regeneration code
- * Healthstones have been added, which alter your effective
- * experience level and constitution (-2 cursed, +1 uncursed,
- * +2 blessed) for the basis of regeneration calculations.
- */
-
- 			int efflev = u.ulevel + u.uhealbonus;
- 			int effcon = ACURR(A_CON) + u.uhealbonus;
-			int heal = 1;
-
-
-			if (efflev > 9 && !(moves % 3)) {
-			    if (effcon <= 12) {
-				heal = 1;
-			    } else {
-				heal = rnd(effcon);
-  				if (heal > efflev-9) heal = efflev-9;
-			    }
-			    flags.botl = 1;
-			    u.uhp += heal;
-			    if(u.uhp > u.uhpmax)
-				u.uhp = u.uhpmax;
-			} else if (Regeneration ||
-			     (efflev <= 9 &&
-			      !(moves % ((MAXULEV+12) / (u.ulevel+2) + 1)))) {
-			    flags.botl = 1;
-			    u.uhp++;
-			}
-		    }
-
-		    if (!u.uinvulnerable && u.uen > 0 && u.uhp < u.uhpmax &&
-			    tech_inuse(T_CHI_HEALING)) {
-			u.uen--;
-			u.uhp++;
-			flags.botl = 1;
-		    }
-
-		    /* moving around while encumbered is hard work */
-		    if (wtcap > MOD_ENCUMBER && u.umoved) {
-			if(!(wtcap < EXT_ENCUMBER ? moves%30 : moves%10)) {
-			    if (Upolyd && u.mh > 1) {
-				u.mh--;
-			    } else if (!Upolyd && u.uhp > 1) {
-				u.uhp--;
-			    } else {
-				You("pass out from exertion!");
-				exercise(A_CON, FALSE);
-				fall_asleep(-10, FALSE);
-			    }
-			}
-		    }
-
-		    
-		    /* KMH -- OK to regenerate if you don't move */
-		    if ((u.uen < u.uenmax) && (Energy_regeneration ||
-				((wtcap < MOD_ENCUMBER || !flags.mv) &&
-				(!(moves%((MAXULEV + 15 - u.ulevel) *                                    
-				(Role_if(PM_WIZARD) ? 3 : 4) / 6)))))) {
-			u.uen += rn1((int)(ACURR(A_WIS) + ACURR(A_INT)) / 15 + 1,1);
-#ifdef WIZ_PATCH_DEBUG
-                pline("mana was = %d now = %d",temp,u.uen);
-#endif
-
-			if (u.uen > u.uenmax)  u.uen = u.uenmax;
-			flags.botl = 1;
-		    }
-
-		    if(!u.uinvulnerable) {
-			if(Teleportation && !rn2(85)) {
-			    xchar old_ux = u.ux, old_uy = u.uy;
-			    tele();
-			    if (u.ux != old_ux || u.uy != old_uy) {
-				if (!next_to_u()) {
-				    check_leash(old_ux, old_uy);
-				}
-#ifdef REDO
-				/* clear doagain keystrokes */
-				pushch(0);
-				savech(0);
-#endif
-			    }
-			}
-			/* delayed change may not be valid anymore */
-			if ((change == 1 && !Polymorph) ||
-			    (change == 2 && u.ulycn == NON_PM))
-			    change = 0;
-			if(Polymorph && !rn2(100))
-			    change = 1;
-			else if (u.ulycn >= LOW_PM && !Upolyd &&
-				 !rn2(80 - (20 * night())))
-			    change = 2;
-			if (change && !Unchanging) {
-			    if (multi >= 0) {
-				if (occupation)
-				    stop_occupation();
-				else
-				    nomul(0);
-				if (change == 1) polyself(FALSE);
-				else you_were();
-				change = 0;
-			    }
-			}
-		}	/* !u.uinvulnerable */
-
-		    if(Searching && multi >= 0) (void) dosearch0(1);
-		    dosounds();
-		    do_storms();
-		    gethungry();
-		    age_spells();
-		    exerchk();
-		    invault();
-		    if (u.uhave.amulet) amulet();
-		if (!rn2(40+(int)(ACURR(A_DEX)*3))) u_wipe_engr(rnd(3));
-		    if (u.uevent.udemigod && !u.uinvulnerable) {
-			if (u.udg_cnt) u.udg_cnt--;
-			if (!u.udg_cnt) {
-			    intervene();
-			    u.udg_cnt = rn1(200, 50);
-			}
-		    }
-		    restore_attrib();
-
-		    /* underwater and waterlevel vision are done here */
-		    if (Is_waterlevel(&u.uz))
-			movebubbles();
-		    else if (Underwater)
-			under_water(0);
-		    /* vision while buried done here */
-		    else if (u.uburied) under_ground(0);
-
-		    /* when immobile, count is in turns */
-		    if(multi < 0) {
-			if (++multi == 0) {	/* finished yet? */
-			    unmul((char *)0);
-			    /* if unmul caused a level change, take it now */
-			    if (u.utotype) deferred_goto();
-			}
-		    }
-		}
-	    } while (youmonst.movement<NORMAL_SPEED); /* hero can't move loop */
-
-	    /******************************************/
-	    /* once-per-hero-took-time things go here */
-	    /******************************************/
-
-
-	} /* actual time passed */
-
-	/****************************************/
-	/* once-per-player-input things go here */
-	/****************************************/
-
-	find_ac();
-	if(!flags.mv || Blind) {
-	    /* redo monsters if hallu or wearing a helm of telepathy */
-	    if (Hallucination) {	/* update screen randomly */
-		see_monsters();
-		see_objects();
-		see_traps();
-		if (u.uswallow) swallowed(0);
-	    } else if (Unblind_telepat) {
-		see_monsters();
-	    } else if (Warning || Warn_of_mon)
-	     	see_monsters();
-
-	    if (vision_full_recalc) vision_recalc(0);	/* vision! */
-	}
-	if(flags.botl || flags.botlx) bot();
-
-	flags.move = 1;
-
-	if(multi >= 0 && occupation) {
-#if defined(MICRO) || defined(WIN32)
-	    abort_lev = 0;
-	    if (kbhit()) {
-		if ((ch = Getchar()) == 