diff -r 0cc9d22c3732 ChangeLog
--- a/ChangeLog	Thu Aug 27 15:18:51 2009 +0100
+++ b/ChangeLog	Fri Aug 28 11:24:47 2009 -0600
@@ -1,3 +1,8 @@
+2009-08-28  Jerry James  <james@xemacs.org>
+
+	* configure.ac: Check for external giflib instead of using builtin
+	gif support.  Remove "(builtin)" from relevant strings.
+
 2009-07-28  Mike Sperber  <mike@xemacs.org>
 
 	* Makefile.in.in: Don't install silly symlinks when $(prefix) !=
diff -r 0cc9d22c3732 configure
--- a/configure	Thu Aug 27 15:18:51 2009 +0100
+++ b/configure	Fri Aug 28 11:24:47 2009 -0600
@@ -1,6 +1,6 @@
 #! /bin/sh
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.62 for XEmacs 21.5.
+# Generated by GNU Autoconf 2.63 for XEmacs 21.5.
 #
 # Report bugs to <xemacs-beta@xemacs.org>.
 #
@@ -683,179 +683,179 @@
 # include <unistd.h>
 #endif"
 
-ac_subst_vars='SHELL
+ac_subst_vars='LTLIBOBJS
+LIBOBJS
+internal_makefile_list
+XE_CFLAGS
+XEMACS_CC
+dynodump_arch
+sound_cflags
+native_sound_lib
+RECURSIVE_MAKE_ARGS
+ld_libs_all
+ld_libs_window_system
+ld_libs_general
+ld_switch_all
+ld_switch_window_system
+ld_switch_general
+c_switch_all
+c_switch_window_system
+c_switch_general
+opsysfile
+machfile
+extra_objs
+bitmapdir
+DOCDIR
+DOCDIR_USER_DEFINED
+ARCHLIBDIR
+ARCHLIBDIR_USER_DEFINED
+archlibdir
+ETCDIR
+ETCDIR_USER_DEFINED
+etcdir
+SITEMODULEDIR
+SITEMODULEDIR_USER_DEFINED
+sitemoduledir
+SITELISPDIR
+SITELISPDIR_USER_DEFINED
+sitelispdir
+MODULEDIR
+MODULEDIR_USER_DEFINED
+moduledir
+LISPDIR
+LISPDIR_USER_DEFINED
+lispdir
+PACKAGE_PATH
+PACKAGE_PATH_USER_DEFINED
+package_path
+LAST_PACKAGE_DIRECTORIES
+LAST_PACKAGE_DIRECTORIES_USER_DEFINED
+last_packages
+LATE_PACKAGE_DIRECTORIES
+LATE_PACKAGE_DIRECTORIES_USER_DEFINED
+late_packages
+EARLY_PACKAGE_DIRECTORIES
+EARLY_PACKAGE_DIRECTORIES_USER_DEFINED
+early_packages
+INFOPATH
+INFOPATH_USER_DEFINED
+infopath
+INFODIR
+INFODIR_USER_DEFINED
+EXEC_PREFIX
+EXEC_PREFIX_USER_DEFINED
+PREFIX
+PREFIX_USER_DEFINED
+extra_includes
+srcdir
+instvardir
+verbose_version
+version
+PROGNAME
+SUBDIR_MAKEFILES
+MAKE_SUBDIR
+INSTALL_ARCH_DEP_SUBDIR
+SRC_SUBDIR_DEPS
+have_esd_config
+ALLOCA
+canna_libs
+lwlib_objs
+postgresql_libs
+ldap_libs
+OBJECT_TO_BUILD
+MOD_INSTALL_PROGRAM
+INSTALLPATH
+MODCFLAGS
+MAKE_DOCFILE
+MODARCHDIR
+MOD_CC
+with_modules
+ld_dynamic_link_flags
+dll_ldo
+dll_post
+dll_ldflags
+dll_cflags
+dll_ld
+LIBSTDCPP
+dnd_objs
+libs_xauth
+install_pp
+X_EXTRA_LIBS
+X_LIBS
+X_PRE_LIBS
+X_CFLAGS
+XMKMF
+GTK_CONFIG
+SET_MAKE
+YFLAGS
+YACC
+INSTALL_DATA
+INSTALL_SCRIPT
+INSTALL_PROGRAM
+RANLIB
+AR
+lib_gcc
+ld
+start_files
+ld_switch_shared
+start_flags
+EGREP
+GREP
+CPP
+OBJEXT
+EXEEXT
+ac_ct_CC
+CPPFLAGS
+LDFLAGS
+CFLAGS
+CC
+configuration
+SHEBANG_PROGNAME
+build_os
+build_vendor
+build_cpu
+build
+blddir
+LN_S
+statedir
+inststaticdir
+target_alias
+host_alias
+build_alias
+LIBS
+ECHO_T
+ECHO_N
+ECHO_C
+DEFS
+mandir
+localedir
+libdir
+psdir
+pdfdir
+dvidir
+htmldir
+infodir
+docdir
+oldincludedir
+includedir
+localstatedir
+sharedstatedir
+sysconfdir
+datadir
+datarootdir
+libexecdir
+sbindir
+bindir
+program_transform_name
+prefix
+exec_prefix
+PACKAGE_BUGREPORT
+PACKAGE_STRING
+PACKAGE_VERSION
+PACKAGE_TARNAME
+PACKAGE_NAME
 PATH_SEPARATOR
-PACKAGE_NAME
-PACKAGE_TARNAME
-PACKAGE_VERSION
-PACKAGE_STRING
-PACKAGE_BUGREPORT
-exec_prefix
-prefix
-program_transform_name
-bindir
-sbindir
-libexecdir
-datarootdir
-datadir
-sysconfdir
-sharedstatedir
-localstatedir
-includedir
-oldincludedir
-docdir
-infodir
-htmldir
-dvidir
-pdfdir
-psdir
-libdir
-localedir
-mandir
-DEFS
-ECHO_C
-ECHO_N
-ECHO_T
-LIBS
-build_alias
-host_alias
-target_alias
-inststaticdir
-statedir
-LN_S
-blddir
-build
-build_cpu
-build_vendor
-build_os
-SHEBANG_PROGNAME
-configuration
-CC
-CFLAGS
-LDFLAGS
-CPPFLAGS
-ac_ct_CC
-EXEEXT
-OBJEXT
-CPP
-GREP
-EGREP
-start_flags
-ld_switch_shared
-start_files
-ld
-lib_gcc
-AR
-RANLIB
-INSTALL_PROGRAM
-INSTALL_SCRIPT
-INSTALL_DATA
-YACC
-YFLAGS
-SET_MAKE
-GTK_CONFIG
-XMKMF
-X_CFLAGS
-X_PRE_LIBS
-X_LIBS
-X_EXTRA_LIBS
-install_pp
-libs_xauth
-dnd_objs
-LIBSTDCPP
-dll_ld
-dll_cflags
-dll_ldflags
-dll_post
-dll_ldo
-ld_dynamic_link_flags
-with_modules
-MOD_CC
-MODARCHDIR
-MAKE_DOCFILE
-MODCFLAGS
-INSTALLPATH
-MOD_INSTALL_PROGRAM
-OBJECT_TO_BUILD
-ldap_libs
-postgresql_libs
-lwlib_objs
-canna_libs
-ALLOCA
-have_esd_config
-SRC_SUBDIR_DEPS
-INSTALL_ARCH_DEP_SUBDIR
-MAKE_SUBDIR
-SUBDIR_MAKEFILES
-PROGNAME
-version
-verbose_version
-instvardir
-srcdir
-extra_includes
-PREFIX_USER_DEFINED
-PREFIX
-EXEC_PREFIX_USER_DEFINED
-EXEC_PREFIX
-INFODIR_USER_DEFINED
-INFODIR
-infopath
-INFOPATH_USER_DEFINED
-INFOPATH
-early_packages
-EARLY_PACKAGE_DIRECTORIES_USER_DEFINED
-EARLY_PACKAGE_DIRECTORIES
-late_packages
-LATE_PACKAGE_DIRECTORIES_USER_DEFINED
-LATE_PACKAGE_DIRECTORIES
-last_packages
-LAST_PACKAGE_DIRECTORIES_USER_DEFINED
-LAST_PACKAGE_DIRECTORIES
-package_path
-PACKAGE_PATH_USER_DEFINED
-PACKAGE_PATH
-lispdir
-LISPDIR_USER_DEFINED
-LISPDIR
-moduledir
-MODULEDIR_USER_DEFINED
-MODULEDIR
-sitelispdir
-SITELISPDIR_USER_DEFINED
-SITELISPDIR
-sitemoduledir
-SITEMODULEDIR_USER_DEFINED
-SITEMODULEDIR
-etcdir
-ETCDIR_USER_DEFINED
-ETCDIR
-archlibdir
-ARCHLIBDIR_USER_DEFINED
-ARCHLIBDIR
-DOCDIR_USER_DEFINED
-DOCDIR
-bitmapdir
-extra_objs
-machfile
-opsysfile
-c_switch_general
-c_switch_window_system
-c_switch_all
-ld_switch_general
-ld_switch_window_system
-ld_switch_all
-ld_libs_general
-ld_libs_window_system
-ld_libs_all
-RECURSIVE_MAKE_ARGS
-native_sound_lib
-sound_cflags
-dynodump_arch
-XEMACS_CC
-XE_CFLAGS
-internal_makefile_list
-LIBOBJS
-LTLIBOBJS'
+SHELL'
 ac_subst_files=''
 ac_user_opts='
 enable_option_checking
@@ -1503,9 +1503,9 @@
 if test -n "$ac_unrecognized_opts"; then
   case $enable_option_checking in
     no) ;;
-    fatal) { $as_echo "$as_me: error: Unrecognized options: $ac_unrecognized_opts" >&2
+    fatal) { $as_echo "$as_me: error: unrecognized options: $ac_unrecognized_opts" >&2
    { (exit 1); exit 1; }; } ;;
-    *)     $as_echo "$as_me: WARNING: Unrecognized options: $ac_unrecognized_opts" >&2 ;;
+    *)     $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;;
   esac
 fi
 
@@ -1558,7 +1558,7 @@
 ac_pwd=`pwd` && test -n "$ac_pwd" &&
 ac_ls_di=`ls -di .` &&
 ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` ||
-  { $as_echo "$as_me: error: Working directory cannot be determined" >&2
+  { $as_echo "$as_me: error: working directory cannot be determined" >&2
    { (exit 1); exit 1; }; }
 test "X$ac_ls_di" = "X$ac_pwd_ls_di" ||
   { $as_echo "$as_me: error: pwd does not report name of working directory" >&2
@@ -1893,8 +1893,7 @@
                           useful, for the same reason as JPEG images.
   --with-xface            Compile with support for X-Face mail headers.
                           Requires the compface package.
-  --with-gif              Compile without the (builtin) support for GIF
-                          images.
+  --with-gif              Compile with support for GIF images.
 
 Sound options
 -------------
@@ -2131,7 +2130,7 @@
 if $ac_init_version; then
   cat <<\_ACEOF
 XEmacs configure 21.5
-generated by GNU Autoconf 2.62
+generated by GNU Autoconf 2.63
 
 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
@@ -2191,7 +2190,7 @@
 running configure, to aid debugging if configure makes a mistake.
 
 It was created by XEmacs $as_me 21.5, which was
-generated by GNU Autoconf 2.62.  Invocation command line was
+generated by GNU Autoconf 2.63.  Invocation command line was
 
   $ $0 $@
 
@@ -2314,8 +2313,8 @@
     case $ac_val in #(
     *${as_nl}*)
       case $ac_var in #(
-      *_cv_*) { $as_echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5
-$as_echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;;
+      *_cv_*) { $as_echo "$as_me:$LINENO: WARNING: cache variable $ac_var contains a newline" >&5
+$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
       esac
       case $ac_var in #(
       _ | IFS | as_nl) ;; #(
@@ -2518,6 +2517,8 @@
   fi
 done
 if $ac_cache_corrupted; then
+  { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
   { $as_echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5
 $as_echo "$as_me: error: changes in the environment can compromise the build" >&2;}
   { { $as_echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5
@@ -5849,12 +5850,8 @@
   else
     case $cross_compiling:$ac_tool_warned in
 yes:)
-{ $as_echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
-whose name does not start with the host triplet.  If you think this
-configuration is useful to you, please write to autoconf@gnu.org." >&5
-$as_echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
-whose name does not start with the host triplet.  If you think this
-configuration is useful to you, please write to autoconf@gnu.org." >&2;}
+{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
 ac_tool_warned=yes ;;
 esac
     CC=$ac_ct_CC
@@ -6053,12 +6050,8 @@
   else
     case $cross_compiling:$ac_tool_warned in
 yes:)
-{ $as_echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
-whose name does not start with the host triplet.  If you think this
-configuration is useful to you, please write to autoconf@gnu.org." >&5
-$as_echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
-whose name does not start with the host triplet.  If you think this
-configuration is useful to you, please write to autoconf@gnu.org." >&2;}
+{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
 ac_tool_warned=yes ;;
 esac
     CC=$ac_ct_CC
@@ -6068,11 +6061,13 @@
 fi
 
 
-test -z "$CC" && { { $as_echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH
+test -z "$CC" && { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ { $as_echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH
 See \`config.log' for more details." >&5
 $as_echo "$as_me: error: no acceptable C compiler found in \$PATH
 See \`config.log' for more details." >&2;}
-   { (exit 1); exit 1; }; }
+   { (exit 1); exit 1; }; }; }
 
 # Provide some information about the compiler.
 $as_echo "$as_me:$LINENO: checking for C compiler version" >&5
@@ -6202,11 +6197,13 @@
   $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
+{ { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
 { { $as_echo "$as_me:$LINENO: error: C compiler cannot create executables
 See \`config.log' for more details." >&5
 $as_echo "$as_me: error: C compiler cannot create executables
 See \`config.log' for more details." >&2;}
-   { (exit 77); exit 77; }; }
+   { (exit 77); exit 77; }; }; }
 fi
 
 ac_exeext=$ac_cv_exeext
@@ -6234,13 +6231,15 @@
     if test "$cross_compiling" = maybe; then
 	cross_compiling=yes
     else
-	{ { $as_echo "$as_me:$LINENO: error: cannot run C compiled programs.
+	{ { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ { $as_echo "$as_me:$LINENO: error: cannot run C compiled programs.
 If you meant to cross compile, use \`--host'.
 See \`config.log' for more details." >&5
 $as_echo "$as_me: error: cannot run C compiled programs.
 If you meant to cross compile, use \`--host'.
 See \`config.log' for more details." >&2;}
-   { (exit 1); exit 1; }; }
+   { (exit 1); exit 1; }; }; }
     fi
   fi
 fi
@@ -6283,11 +6282,13 @@
   esac
 done
 else
-  { { $as_echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link
+  { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ { $as_echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link
 See \`config.log' for more details." >&5
 $as_echo "$as_me: error: cannot compute suffix of executables: cannot compile and link
 See \`config.log' for more details." >&2;}
-   { (exit 1); exit 1; }; }
+   { (exit 1); exit 1; }; }; }
 fi
 
 rm -f conftest$ac_cv_exeext
@@ -6341,11 +6342,13 @@
   $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
+{ { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
 { { $as_echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile
 See \`config.log' for more details." >&5
 $as_echo "$as_me: error: cannot compute suffix of object files: cannot compile
 See \`config.log' for more details." >&2;}
-   { (exit 1); exit 1; }; }
+   { (exit 1); exit 1; }; }; }
 fi
 
 rm -f conftest.$ac_cv_objext conftest.$ac_ext
@@ -6921,11 +6924,13 @@
 if $ac_preproc_ok; then
   :
 else
-  { { $as_echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check
+  { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ { $as_echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check
 See \`config.log' for more details." >&5
 $as_echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check
 See \`config.log' for more details." >&2;}
-   { (exit 1); exit 1; }; }
+   { (exit 1); exit 1; }; }; }
 fi
 
 ac_ext=c
@@ -7311,8 +7316,9 @@
 		 $as_echo "$as_val"'`
 	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
 $as_echo "$ac_res" >&6; }
-if test `eval 'as_val=${'$as_ac_Header'}
-		 $as_echo "$as_val"'` = yes; then
+as_val=`eval 'as_val=${'$as_ac_Header'}
+		 $as_echo "$as_val"'`
+   if test "x$as_val" = x""yes; then
   cat >>confdefs.h <<_ACEOF
 #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
 _ACEOF
@@ -7455,7 +7461,7 @@
 $as_echo "$ac_cv_header_minix_config_h" >&6; }
 
 fi
-if test $ac_cv_header_minix_config_h = yes; then
+if test "x$ac_cv_header_minix_config_h" = x""yes; then
   MINIX=yes
 else
   MINIX=
@@ -7646,12 +7652,8 @@
   else
     case $cross_compiling:$ac_tool_warned in
 yes:)
-{ $as_echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
-whose name does not start with the host triplet.  If you think this
-configuration is useful to you, please write to autoconf@gnu.org." >&5
-$as_echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
-whose name does not start with the host triplet.  If you think this
-configuration is useful to you, please write to autoconf@gnu.org." >&2;}
+{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
 ac_tool_warned=yes ;;
 esac
     CC=$ac_ct_CC
@@ -7850,12 +7852,8 @@
   else
     case $cross_compiling:$ac_tool_warned in
 yes:)
-{ $as_echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
-whose name does not start with the host triplet.  If you think this
-configuration is useful to you, please write to autoconf@gnu.org." >&5
-$as_echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
-whose name does not start with the host triplet.  If you think this
-configuration is useful to you, please write to autoconf@gnu.org." >&2;}
+{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
 ac_tool_warned=yes ;;
 esac
     CC=$ac_ct_CC
@@ -7865,11 +7863,13 @@
 fi
 
 
-test -z "$CC" && { { $as_echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH
+test -z "$CC" && { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ { $as_echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH
 See \`config.log' for more details." >&5
 $as_echo "$as_me: error: no acceptable C compiler found in \$PATH
 See \`config.log' for more details." >&2;}
-   { (exit 1); exit 1; }; }
+   { (exit 1); exit 1; }; }; }
 
 # Provide some information about the compiler.
 $as_echo "$as_me:$LINENO: checking for C compiler version" >&5
@@ -8343,12 +8343,8 @@
   else
     case $cross_compiling:$ac_tool_warned in
 yes:)
-{ $as_echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
-whose name does not start with the host triplet.  If you think this
-configuration is useful to you, please write to autoconf@gnu.org." >&5
-$as_echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
-whose name does not start with the host triplet.  If you think this
-configuration is useful to you, please write to autoconf@gnu.org." >&2;}
+{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
 ac_tool_warned=yes ;;
 esac
     CC=$ac_ct_CC
@@ -8547,12 +8543,8 @@
   else
     case $cross_compiling:$ac_tool_warned in
 yes:)
-{ $as_echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
-whose name does not start with the host triplet.  If you think this
-configuration is useful to you, please write to autoconf@gnu.org." >&5
-$as_echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
-whose name does not start with the host triplet.  If you think this
-configuration is useful to you, please write to autoconf@gnu.org." >&2;}
+{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
 ac_tool_warned=yes ;;
 esac
     CC=$ac_ct_CC
@@ -8562,11 +8554,13 @@
 fi
 
 
-test -z "$CC" && { { $as_echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH
+test -z "$CC" && { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ { $as_echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH
 See \`config.log' for more details." >&5
 $as_echo "$as_me: error: no acceptable C compiler found in \$PATH
 See \`config.log' for more details." >&2;}
-   { (exit 1); exit 1; }; }
+   { (exit 1); exit 1; }; }; }
 
 # Provide some information about the compiler.
 $as_echo "$as_me:$LINENO: checking for C compiler version" >&5
@@ -9040,12 +9034,8 @@
   else
     case $cross_compiling:$ac_tool_warned in
 yes:)
-{ $as_echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
-whose name does not start with the host triplet.  If you think this
-configuration is useful to you, please write to autoconf@gnu.org." >&5
-$as_echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
-whose name does not start with the host triplet.  If you think this
-configuration is useful to you, please write to autoconf@gnu.org." >&2;}
+{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
 ac_tool_warned=yes ;;
 esac
     CC=$ac_ct_CC
@@ -9244,12 +9234,8 @@
   else
     case $cross_compiling:$ac_tool_warned in
 yes:)
-{ $as_echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
-whose name does not start with the host triplet.  If you think this
-configuration is useful to you, please write to autoconf@gnu.org." >&5
-$as_echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
-whose name does not start with the host triplet.  If you think this
-configuration is useful to you, please write to autoconf@gnu.org." >&2;}
+{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
 ac_tool_warned=yes ;;
 esac
     CC=$ac_ct_CC
@@ -9259,11 +9245,13 @@
 fi
 
 
-test -z "$CC" && { { $as_echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH
+test -z "$CC" && { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ { $as_echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH
 See \`config.log' for more details." >&5
 $as_echo "$as_me: error: no acceptable C compiler found in \$PATH
 See \`config.log' for more details." >&2;}
-   { (exit 1); exit 1; }; }
+   { (exit 1); exit 1; }; }; }
 
 # Provide some information about the compiler.
 $as_echo "$as_me:$LINENO: checking for C compiler version" >&5
@@ -9650,11 +9638,13 @@
 
 if test "$GCC" = "yes"; then
 if test "$cross_compiling" = yes; then
-  { { $as_echo "$as_me:$LINENO: error: cannot run test program while cross compiling
+  { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ { $as_echo "$as_me:$LINENO: error: cannot run test program while cross compiling
 See \`config.log' for more details." >&5
 $as_echo "$as_me: error: cannot run test program while cross compiling
 See \`config.log' for more details." >&2;}
-   { (exit 1); exit 1; }; }
+   { (exit 1); exit 1; }; }; }
 else
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -9703,11 +9693,13 @@
 
 
 if test "$cross_compiling" = yes; then
-  { { $as_echo "$as_me:$LINENO: error: cannot run test program while cross compiling
+  { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ { $as_echo "$as_me:$LINENO: error: cannot run test program while cross compiling
 See \`config.log' for more details." >&5
 $as_echo "$as_me: error: cannot run test program while cross compiling
 See \`config.log' for more details." >&2;}
-   { (exit 1); exit 1; }; }
+   { (exit 1); exit 1; }; }; }
 else
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -9993,11 +9985,13 @@
 if $ac_preproc_ok; then
   :
 else
-  { { $as_echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check
+  { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ { $as_echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check
 See \`config.log' for more details." >&5
 $as_echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check
 See \`config.log' for more details." >&2;}
-   { (exit 1); exit 1; }; }
+   { (exit 1); exit 1; }; }; }
 fi
 
 ac_ext=c
@@ -10111,11 +10105,13 @@
 esac
 
 if test "$cross_compiling" = yes; then
-  { { $as_echo "$as_me:$LINENO: error: cannot run test program while cross compiling
+  { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ { $as_echo "$as_me:$LINENO: error: cannot run test program while cross compiling
 See \`config.log' for more details." >&5
 $as_echo "$as_me: error: cannot run test program while cross compiling
 See \`config.log' for more details." >&2;}
-   { (exit 1); exit 1; }; }
+   { (exit 1); exit 1; }; }; }
 else
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -10965,7 +10961,7 @@
 fi
 { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_c_terminateAndUnload" >&5
 $as_echo "$ac_cv_lib_c_terminateAndUnload" >&6; }
-if test $ac_cv_lib_c_terminateAndUnload = yes; then
+if test "x$ac_cv_lib_c_terminateAndUnload" = x""yes; then
   libs_system="$libs_system -lC" &&  if test "$verbose" = "yes"; then echo "    Appending \"-lC\" to \$libs_system"; fi
 fi
 
@@ -11387,7 +11383,7 @@
 fi
 { $as_echo "$as_me:$LINENO: result: $ac_cv_func_malloc_set_state" >&5
 $as_echo "$ac_cv_func_malloc_set_state" >&6; }
-if test $ac_cv_func_malloc_set_state = yes; then
+if test "x$ac_cv_func_malloc_set_state" = x""yes; then
   :
 else
   doug_lea_malloc=no
@@ -11602,12 +11598,8 @@
   else
     case $cross_compiling:$ac_tool_warned in
 yes:)
-{ $as_echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
-whose name does not start with the host triplet.  If you think this
-configuration is useful to you, please write to autoconf@gnu.org." >&5
-$as_echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
-whose name does not start with the host triplet.  If you think this
-configuration is useful to you, please write to autoconf@gnu.org." >&2;}
+{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
 ac_tool_warned=yes ;;
 esac
     RANLIB=$ac_ct_RANLIB
@@ -11909,8 +11901,9 @@
 $as_echo "$ac_res" >&6; }
 
 fi
-if test `eval 'as_val=${'$as_ac_Header'}
-		 $as_echo "$as_val"'` = yes; then
+as_val=`eval 'as_val=${'$as_ac_Header'}
+		 $as_echo "$as_val"'`
+   if test "x$as_val" = x""yes; then
   cat >>confdefs.h <<_ACEOF
 #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
 _ACEOF
@@ -12286,7 +12279,7 @@
 fi
 { $as_echo "$as_me:$LINENO: result: $ac_cv_have_decl_sys_siglist" >&5
 $as_echo "$ac_cv_have_decl_sys_siglist" >&6; }
-if test $ac_cv_have_decl_sys_siglist = yes; then
+if test "x$ac_cv_have_decl_sys_siglist" = x""yes; then
 
 cat >>confdefs.h <<_ACEOF
 #define HAVE_DECL_SYS_SIGLIST 1
@@ -12443,8 +12436,9 @@
 		 $as_echo "$as_val"'`
 	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
 $as_echo "$ac_res" >&6; }
-if test `eval 'as_val=${'$as_ac_var'}
-		 $as_echo "$as_val"'` = yes; then
+as_val=`eval 'as_val=${'$as_ac_var'}
+		 $as_echo "$as_val"'`
+   if test "x$as_val" = x""yes; then
   cat >>confdefs.h <<_ACEOF
 #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
@@ -12609,7 +12603,7 @@
 fi
 { $as_echo "$as_me:$LINENO: result: $ac_cv_type_size_t" >&5
 $as_echo "$ac_cv_type_size_t" >&6; }
-if test $ac_cv_type_size_t = yes; then
+if test "x$ac_cv_type_size_t" = x""yes; then
   :
 else
 
@@ -12713,7 +12707,7 @@
 fi
 { $as_echo "$as_me:$LINENO: result: $ac_cv_type_pid_t" >&5
 $as_echo "$ac_cv_type_pid_t" >&6; }
-if test $ac_cv_type_pid_t = yes; then
+if test "x$ac_cv_type_pid_t" = x""yes; then
   :
 else
 
@@ -12855,7 +12849,7 @@
 fi
 { $as_echo "$as_me:$LINENO: result: $ac_cv_type_mode_t" >&5
 $as_echo "$ac_cv_type_mode_t" >&6; }
-if test $ac_cv_type_mode_t = yes; then
+if test "x$ac_cv_type_mode_t" = x""yes; then
   :
 else
 
@@ -12959,7 +12953,7 @@
 fi
 { $as_echo "$as_me:$LINENO: result: $ac_cv_type_off_t" >&5
 $as_echo "$ac_cv_type_off_t" >&6; }
-if test $ac_cv_type_off_t = yes; then
+if test "x$ac_cv_type_off_t" = x""yes; then
   :
 else
 
@@ -13063,7 +13057,7 @@
 fi
 { $as_echo "$as_me:$LINENO: result: $ac_cv_type_ssize_t" >&5
 $as_echo "$ac_cv_type_ssize_t" >&6; }
-if test $ac_cv_type_ssize_t = yes; then
+if test "x$ac_cv_type_ssize_t" = x""yes; then
   :
 else
 
@@ -13439,7 +13433,7 @@
 fi
 { $as_echo "$as_me:$LINENO: result: $ac_cv_member_struct_tm_tm_zone" >&5
 $as_echo "$ac_cv_member_struct_tm_tm_zone" >&6; }
-if test $ac_cv_member_struct_tm_tm_zone = yes; then
+if test "x$ac_cv_member_struct_tm_tm_zone" = x""yes; then
 
 cat >>confdefs.h <<_ACEOF
 #define HAVE_STRUCT_TM_TM_ZONE 1
@@ -13509,7 +13503,7 @@
 fi
 { $as_echo "$as_me:$LINENO: result: $ac_cv_have_decl_tzname" >&5
 $as_echo "$ac_cv_have_decl_tzname" >&6; }
-if test $ac_cv_have_decl_tzname = yes; then
+if test "x$ac_cv_have_decl_tzname" = x""yes; then
 
 cat >>confdefs.h <<_ACEOF
 #define HAVE_DECL_TZNAME 1
@@ -13741,7 +13735,52 @@
   $as_echo_n "(cached) " >&6
 else
   ac_cv_c_bigendian=unknown
-
+    # See if we're dealing with a universal compiler.
+    cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#ifndef __APPLE_CC__
+	       not a universal capable compiler
+	     #endif
+	     typedef int dummy;
+
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+
+	# Check for potential -arch flags.  It is not universal unless
+	# there are some -arch flags.  Note that *ppc* also matches
+	# ppc64.  This check is also rather less than ideal.
+	case "${CC} ${CFLAGS} ${CPPFLAGS} ${LDFLAGS}" in  #(
+	  *-arch*ppc*|*-arch*i386*|*-arch*x86_64*) ac_cv_c_bigendian=universal;;
+	esac
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
     if test $ac_cv_c_bigendian = unknown; then
       # See if sys/param.h defines the BYTE_ORDER macro.
       cat >conftest.$ac_ext <<_ACEOF
@@ -14081,7 +14120,12 @@
    no)
       ;; #(
    universal)
-      ;; #(
+
+cat >>confdefs.h <<\_ACEOF
+#define AC_APPLE_UNIVERSAL_BUILD 1
+_ACEOF
+
+     ;; #(
    *)
      { { $as_echo "$as_me:$LINENO: error: unknown endianness
  presetting ac_cv_c_bigendian=no (or yes) will help" >&5
@@ -14342,11 +14386,13 @@
 case $ac_lo in
 ?*) ac_cv_sizeof_short=$ac_lo;;
 '') if test "$ac_cv_type_short" = yes; then
-     { { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (short)
+     { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (short)
 See \`config.log' for more details." >&5
 $as_echo "$as_me: error: cannot compute sizeof (short)
 See \`config.log' for more details." >&2;}
-   { (exit 77); exit 77; }; }
+   { (exit 77); exit 77; }; }; }
    else
      ac_cv_sizeof_short=0
    fi ;;
@@ -14422,11 +14468,13 @@
 
 ( exit $ac_status )
 if test "$ac_cv_type_short" = yes; then
-     { { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (short)
+     { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (short)
 See \`config.log' for more details." >&5
 $as_echo "$as_me: error: cannot compute sizeof (short)
 See \`config.log' for more details." >&2;}
-   { (exit 77); exit 77; }; }
+   { (exit 77); exit 77; }; }; }
    else
      ac_cv_sizeof_short=0
    fi
@@ -14703,11 +14751,13 @@
 case $ac_lo in
 ?*) ac_cv_sizeof_int=$ac_lo;;
 '') if test "$ac_cv_type_int" = yes; then
-     { { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (int)
+     { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (int)
 See \`config.log' for more details." >&5
 $as_echo "$as_me: error: cannot compute sizeof (int)
 See \`config.log' for more details." >&2;}
-   { (exit 77); exit 77; }; }
+   { (exit 77); exit 77; }; }; }
    else
      ac_cv_sizeof_int=0
    fi ;;
@@ -14783,11 +14833,13 @@
 
 ( exit $ac_status )
 if test "$ac_cv_type_int" = yes; then
-     { { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (int)
+     { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (int)
 See \`config.log' for more details." >&5
 $as_echo "$as_me: error: cannot compute sizeof (int)
 See \`config.log' for more details." >&2;}
-   { (exit 77); exit 77; }; }
+   { (exit 77); exit 77; }; }; }
    else
      ac_cv_sizeof_int=0
    fi
@@ -15058,11 +15110,13 @@
 case $ac_lo in
 ?*) ac_cv_sizeof_long=$ac_lo;;
 '') if test "$ac_cv_type_long" = yes; then
-     { { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (long)
+     { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (long)
 See \`config.log' for more details." >&5
 $as_echo "$as_me: error: cannot compute sizeof (long)
 See \`config.log' for more details." >&2;}
-   { (exit 77); exit 77; }; }
+   { (exit 77); exit 77; }; }; }
    else
      ac_cv_sizeof_long=0
    fi ;;
@@ -15138,11 +15192,13 @@
 
 ( exit $ac_status )
 if test "$ac_cv_type_long" = yes; then
-     { { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (long)
+     { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (long)
 See \`config.log' for more details." >&5
 $as_echo "$as_me: error: cannot compute sizeof (long)
 See \`config.log' for more details." >&2;}
-   { (exit 77); exit 77; }; }
+   { (exit 77); exit 77; }; }; }
    else
      ac_cv_sizeof_long=0
    fi
@@ -15413,11 +15469,13 @@
 case $ac_lo in
 ?*) ac_cv_sizeof_long_long=$ac_lo;;
 '') if test "$ac_cv_type_long_long" = yes; then
-     { { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (long long)
+     { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (long long)
 See \`config.log' for more details." >&5
 $as_echo "$as_me: error: cannot compute sizeof (long long)
 See \`config.log' for more details." >&2;}
-   { (exit 77); exit 77; }; }
+   { (exit 77); exit 77; }; }; }
    else
      ac_cv_sizeof_long_long=0
    fi ;;
@@ -15493,11 +15551,13 @@
 
 ( exit $ac_status )
 if test "$ac_cv_type_long_long" = yes; then
-     { { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (long long)
+     { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (long long)
 See \`config.log' for more details." >&5
 $as_echo "$as_me: error: cannot compute sizeof (long long)
 See \`config.log' for more details." >&2;}
-   { (exit 77); exit 77; }; }
+   { (exit 77); exit 77; }; }; }
    else
      ac_cv_sizeof_long_long=0
    fi
@@ -15768,11 +15828,13 @@
 case $ac_lo in
 ?*) ac_cv_sizeof_void_p=$ac_lo;;
 '') if test "$ac_cv_type_void_p" = yes; then
-     { { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (void *)
+     { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (void *)
 See \`config.log' for more details." >&5
 $as_echo "$as_me: error: cannot compute sizeof (void *)
 See \`config.log' for more details." >&2;}
-   { (exit 77); exit 77; }; }
+   { (exit 77); exit 77; }; }; }
    else
      ac_cv_sizeof_void_p=0
    fi ;;
@@ -15848,11 +15910,13 @@
 
 ( exit $ac_status )
 if test "$ac_cv_type_void_p" = yes; then
-     { { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (void *)
+     { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (void *)
 See \`config.log' for more details." >&5
 $as_echo "$as_me: error: cannot compute sizeof (void *)
 See \`config.log' for more details." >&2;}
-   { (exit 77); exit 77; }; }
+   { (exit 77); exit 77; }; }; }
    else
      ac_cv_sizeof_void_p=0
    fi
@@ -16123,11 +16187,13 @@
 case $ac_lo in
 ?*) ac_cv_sizeof_double=$ac_lo;;
 '') if test "$ac_cv_type_double" = yes; then
-     { { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (double)
+     { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (double)
 See \`config.log' for more details." >&5
 $as_echo "$as_me: error: cannot compute sizeof (double)
 See \`config.log' for more details." >&2;}
-   { (exit 77); exit 77; }; }
+   { (exit 77); exit 77; }; }; }
    else
      ac_cv_sizeof_double=0
    fi ;;
@@ -16203,11 +16269,13 @@
 
 ( exit $ac_status )
 if test "$ac_cv_type_double" = yes; then
-     { { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (double)
+     { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (double)
 See \`config.log' for more details." >&5
 $as_echo "$as_me: error: cannot compute sizeof (double)
 See \`config.log' for more details." >&2;}
-   { (exit 77); exit 77; }; }
+   { (exit 77); exit 77; }; }; }
    else
      ac_cv_sizeof_double=0
    fi
@@ -16356,7 +16424,7 @@
 fi
 { $as_echo "$as_me:$LINENO: result: $ac_cv_func_sin" >&5
 $as_echo "$ac_cv_func_sin" >&6; }
-if test $ac_cv_func_sin = yes; then
+if test "x$ac_cv_func_sin" = x""yes; then
   :
 else
 
@@ -16425,7 +16493,7 @@
 fi
 { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_m_sin" >&5
 $as_echo "$ac_cv_lib_m_sin" >&6; }
-if test $ac_cv_lib_m_sin = yes; then
+if test "x$ac_cv_lib_m_sin" = x""yes; then
   cat >>confdefs.h <<_ACEOF
 #define HAVE_LIBM 1
 _ACEOF
@@ -16579,8 +16647,9 @@
 		 $as_echo "$as_val"'`
 	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
 $as_echo "$ac_res" >&6; }
-if test `eval 'as_val=${'$as_ac_var'}
-		 $as_echo "$as_val"'` = yes; then
+as_val=`eval 'as_val=${'$as_ac_var'}
+		 $as_echo "$as_val"'`
+   if test "x$as_val" = x""yes; then
   cat >>confdefs.h <<_ACEOF
 #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
@@ -16685,8 +16754,9 @@
 		 $as_echo "$as_val"'`
 	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
 $as_echo "$ac_res" >&6; }
-if test `eval 'as_val=${'$as_ac_var'}
-		 $as_echo "$as_val"'` = yes; then
+as_val=`eval 'as_val=${'$as_ac_var'}
+		 $as_echo "$as_val"'`
+   if test "x$as_val" = x""yes; then
   cat >>confdefs.h <<_ACEOF
 #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
@@ -16801,7 +16871,7 @@
 fi
 { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_pthreads_cma_open" >&5
 $as_echo "$ac_cv_lib_pthreads_cma_open" >&6; }
-if test $ac_cv_lib_pthreads_cma_open = yes; then
+if test "x$ac_cv_lib_pthreads_cma_open" = x""yes; then
   cat >>confdefs.h <<_ACEOF
 #define HAVE_LIBPTHREADS 1
 _ACEOF
@@ -16989,7 +17059,7 @@
 fi
 { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_gdk_imlib_main" >&5
 $as_echo "$ac_cv_lib_gdk_imlib_main" >&6; }
-if test $ac_cv_lib_gdk_imlib_main = yes; then
+if test "x$ac_cv_lib_gdk_imlib_main" = x""yes; then
   libs_gtk="-lgdk_imlib $libs_gtk" &&  if test "$verbose" = "yes"; then echo "    Prepending \"-lgdk_imlib\" to \$libs_gtk"; fi
 fi
 
@@ -17058,7 +17128,7 @@
 fi
 { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_Imlib_Imlib_init" >&5
 $as_echo "$ac_cv_lib_Imlib_Imlib_init" >&6; }
-if test $ac_cv_lib_Imlib_Imlib_init = yes; then
+if test "x$ac_cv_lib_Imlib_Imlib_init" = x""yes; then
   libs_gtk="$libs_gtk -lImlib" &&  if test "$verbose" = "yes"; then echo "    Appending \"-lImlib\" to \$libs_gtk"; fi
 fi
 
@@ -17153,8 +17223,9 @@
 		 $as_echo "$as_val"'`
 	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
 $as_echo "$ac_res" >&6; }
-if test `eval 'as_val=${'$as_ac_var'}
-		 $as_echo "$as_val"'` = yes; then
+as_val=`eval 'as_val=${'$as_ac_var'}
+		 $as_echo "$as_val"'`
+   if test "x$as_val" = x""yes; then
   cat >>confdefs.h <<_ACEOF
 #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
@@ -17350,8 +17421,9 @@
 $as_echo "$ac_res" >&6; }
 
 fi
-if test `eval 'as_val=${'$as_ac_Header'}
-		 $as_echo "$as_val"'` = yes; then
+as_val=`eval 'as_val=${'$as_ac_Header'}
+		 $as_echo "$as_val"'`
+   if test "x$as_val" = x""yes; then
   cat >>confdefs.h <<_ACEOF
 #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
 _ACEOF
@@ -17419,7 +17491,7 @@
 fi
 { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_xml_main" >&5
 $as_echo "$ac_cv_lib_xml_main" >&6; }
-if test $ac_cv_lib_xml_main = yes; then
+if test "x$ac_cv_lib_xml_main" = x""yes; then
   libs_gtk="-lxml $libs_gtk" &&  if test "$verbose" = "yes"; then echo "    Prepending \"-lxml\" to \$libs_gtk"; fi
 fi
 
@@ -17482,7 +17554,7 @@
 fi
 { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_glade_main" >&5
 $as_echo "$ac_cv_lib_glade_main" >&6; }
-if test $ac_cv_lib_glade_main = yes; then
+if test "x$ac_cv_lib_glade_main" = x""yes; then
   libs_gtk="-lglade $libs_gtk" &&  if test "$verbose" = "yes"; then echo "    Prepending \"-lglade\" to \$libs_gtk"; fi
 fi
 
@@ -17545,7 +17617,7 @@
 fi
 { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_glade_gnome_main" >&5
 $as_echo "$ac_cv_lib_glade_gnome_main" >&6; }
-if test $ac_cv_lib_glade_gnome_main = yes; then
+if test "x$ac_cv_lib_glade_gnome_main" = x""yes; then
   libs_gtk="-lglade-gnome $libs_gtk" &&  if test "$verbose" = "yes"; then echo "    Prepending \"-lglade-gnome\" to \$libs_gtk"; fi
 fi
 
@@ -17619,8 +17691,8 @@
   have_x=disabled
 else
   case $x_includes,$x_libraries in #(
-    *\'*) { { $as_echo "$as_me:$LINENO: error: Cannot use X directory names containing '" >&5
-$as_echo "$as_me: error: Cannot use X directory names containing '" >&2;}
+    *\'*) { { $as_echo "$as_me:$LINENO: error: cannot use X directory names containing '" >&5
+$as_echo "$as_me: error: cannot use X directory names containing '" >&2;}
    { (exit 1); exit 1; }; };; #(
     *,NONE | NONE,*) if test "${ac_cv_have_x+set}" = set; then
   $as_echo_n "(cached) " >&6
@@ -17658,7 +17730,7 @@
 	*) test -f "$ac_im_incroot/X11/Xos.h" && ac_x_includes=$ac_im_incroot;;
     esac
     case $ac_im_usrlibdir in
-	/usr/lib | /lib) ;;
+	/usr/lib | /usr/lib64 | /lib | /lib64) ;;
 	*) test -d "$ac_im_usrlibdir" && ac_x_libraries=$ac_im_usrlibdir ;;
     esac
   fi
@@ -18098,7 +18170,7 @@
 fi
 { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_dnet_dnet_ntoa" >&5
 $as_echo "$ac_cv_lib_dnet_dnet_ntoa" >&6; }
-if test $ac_cv_lib_dnet_dnet_ntoa = yes; then
+if test "x$ac_cv_lib_dnet_dnet_ntoa" = x""yes; then
   X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet"
 fi
 
@@ -18168,7 +18240,7 @@
 fi
 { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_dnet_stub_dnet_ntoa" >&5
 $as_echo "$ac_cv_lib_dnet_stub_dnet_ntoa" >&6; }
-if test $ac_cv_lib_dnet_stub_dnet_ntoa = yes; then
+if test "x$ac_cv_lib_dnet_stub_dnet_ntoa" = x""yes; then
   X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub"
 fi
 
@@ -18340,7 +18412,7 @@
 fi
 { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_nsl_gethostbyname" >&5
 $as_echo "$ac_cv_lib_nsl_gethostbyname" >&6; }
-if test $ac_cv_lib_nsl_gethostbyname = yes; then
+if test "x$ac_cv_lib_nsl_gethostbyname" = x""yes; then
   X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl"
 fi
 
@@ -18410,7 +18482,7 @@
 fi
 { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_bsd_gethostbyname" >&5
 $as_echo "$ac_cv_lib_bsd_gethostbyname" >&6; }
-if test $ac_cv_lib_bsd_gethostbyname = yes; then
+if test "x$ac_cv_lib_bsd_gethostbyname" = x""yes; then
   X_EXTRA_LIBS="$X_EXTRA_LIBS -lbsd"
 fi
 
@@ -18576,7 +18648,7 @@
 fi
 { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_socket_connect" >&5
 $as_echo "$ac_cv_lib_socket_connect" >&6; }
-if test $ac_cv_lib_socket_connect = yes; then
+if test "x$ac_cv_lib_socket_connect" = x""yes; then
   X_EXTRA_LIBS="-lsocket $X_EXTRA_LIBS"
 fi
 
@@ -18735,7 +18807,7 @@
 fi
 { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_posix_remove" >&5
 $as_echo "$ac_cv_lib_posix_remove" >&6; }
-if test $ac_cv_lib_posix_remove = yes; then
+if test "x$ac_cv_lib_posix_remove" = x""yes; then
   X_EXTRA_LIBS="$X_EXTRA_LIBS -lposix"
 fi
 
@@ -18894,7 +18966,7 @@
 fi
 { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_ipc_shmat" >&5
 $as_echo "$ac_cv_lib_ipc_shmat" >&6; }
-if test $ac_cv_lib_ipc_shmat = yes; then
+if test "x$ac_cv_lib_ipc_shmat" = x""yes; then
   X_EXTRA_LIBS="$X_EXTRA_LIBS -lipc"
 fi
 
@@ -18975,7 +19047,7 @@
 fi
 { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_ICE_IceConnectionNumber" >&5
 $as_echo "$ac_cv_lib_ICE_IceConnectionNumber" >&6; }
-if test $ac_cv_lib_ICE_IceConnectionNumber = yes; then
+if test "x$ac_cv_lib_ICE_IceConnectionNumber" = x""yes; then
   X_PRE_LIBS="$X_PRE_LIBS -lSM -lICE"
 fi
 
@@ -19130,7 +19202,7 @@
 $as_echo "$ac_cv_header_Xm_Xm_h" >&6; }
 
 fi
-if test $ac_cv_header_Xm_Xm_h = yes; then
+if test "x$ac_cv_header_Xm_Xm_h" = x""yes; then
   { $as_echo "$as_me:$LINENO: checking for XmStringFree in -lXm" >&5
 $as_echo_n "checking for XmStringFree in -lXm... " >&6; }
 if test "${ac_cv_lib_Xm_XmStringFree+set}" = set; then
@@ -19196,7 +19268,7 @@
 fi
 { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_Xm_XmStringFree" >&5
 $as_echo "$ac_cv_lib_Xm_XmStringFree" >&6; }
-if test $ac_cv_lib_Xm_XmStringFree = yes; then
+if test "x$ac_cv_lib_Xm_XmStringFree" = x""yes; then
   got_motif=yes
 fi
 
@@ -19500,7 +19572,7 @@
 $as_echo "$ac_cv_header_X11_Intrinsic_h" >&6; }
 
 fi
-if test $ac_cv_header_X11_Intrinsic_h = yes; then
+if test "x$ac_cv_header_X11_Intrinsic_h" = x""yes; then
   :
 else
   { { $as_echo "$as_me:$LINENO: error: Unable to find X11 header files." >&5
@@ -19575,7 +19647,7 @@
 fi
 { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_X11_XOpenDisplay" >&5
 $as_echo "$ac_cv_lib_X11_XOpenDisplay" >&6; }
-if test $ac_cv_lib_X11_XOpenDisplay = yes; then
+if test "x$ac_cv_lib_X11_XOpenDisplay" = x""yes; then
   have_lib_x11=yes
 fi
 
@@ -19645,7 +19717,7 @@
 fi
 { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_X11_XGetFontProperty" >&5
 $as_echo "$ac_cv_lib_X11_XGetFontProperty" >&6; }
-if test $ac_cv_lib_X11_XGetFontProperty = yes; then
+if test "x$ac_cv_lib_X11_XGetFontProperty" = x""yes; then
   ld_switch_x_site="-b i486-linuxaout $ld_switch_x_site"
 else
   { { $as_echo "$as_me:$LINENO: error: Unable to find X11 libraries." >&5
@@ -19722,7 +19794,7 @@
 fi
 { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_Xext_XShapeSelectInput" >&5
 $as_echo "$ac_cv_lib_Xext_XShapeSelectInput" >&6; }
-if test $ac_cv_lib_Xext_XShapeSelectInput = yes; then
+if test "x$ac_cv_lib_Xext_XShapeSelectInput" = x""yes; then
   libs_x="-lXext $libs_x" &&  if test "$verbose" = "yes"; then echo "    Prepending \"-lXext\" to \$libs_x"; fi
 fi
 
@@ -19792,7 +19864,7 @@
 fi
 { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_Xt_XtOpenDisplay" >&5
 $as_echo "$ac_cv_lib_Xt_XtOpenDisplay" >&6; }
-if test $ac_cv_lib_Xt_XtOpenDisplay = yes; then
+if test "x$ac_cv_lib_Xt_XtOpenDisplay" = x""yes; then
   libs_x="-lXt $libs_x" &&  if test "$verbose" = "yes"; then echo "    Prepending \"-lXt\" to \$libs_x"; fi
 else
   { { $as_echo "$as_me:$LINENO: error: Unable to find X11 libraries." >&5
@@ -19957,8 +20029,9 @@
 		 $as_echo "$as_val"'`
 	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
 $as_echo "$ac_res" >&6; }
-if test `eval 'as_val=${'$as_ac_var'}
-		 $as_echo "$as_val"'` = yes; then
+as_val=`eval 'as_val=${'$as_ac_var'}
+		 $as_echo "$as_val"'`
+   if test "x$as_val" = x""yes; then
   cat >>confdefs.h <<_ACEOF
 #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
@@ -20108,8 +20181,9 @@
 $as_echo "$ac_res" >&6; }
 
 fi
-if test `eval 'as_val=${'$as_ac_Header'}
-		 $as_echo "$as_val"'` = yes; then
+as_val=`eval 'as_val=${'$as_ac_Header'}
+		 $as_echo "$as_val"'`
+   if test "x$as_val" = x""yes; then
   cat >>confdefs.h <<_ACEOF
 #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
 _ACEOF
@@ -20210,8 +20284,9 @@
 		 $as_echo "$as_val"'`
 	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
 $as_echo "$ac_res" >&6; }
-if test `eval 'as_val=${'$as_ac_var'}
-		 $as_echo "$as_val"'` = yes; then
+as_val=`eval 'as_val=${'$as_ac_var'}
+		 $as_echo "$as_val"'`
+   if test "x$as_val" = x""yes; then
   cat >>confdefs.h <<_ACEOF
 #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
@@ -20333,7 +20408,7 @@
 fi
 { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_Xmu_XmuReadBitmapDataFromFile" >&5
 $as_echo "$ac_cv_lib_Xmu_XmuReadBitmapDataFromFile" >&6; }
-if test $ac_cv_lib_Xmu_XmuReadBitmapDataFromFile = yes; then
+if test "x$ac_cv_lib_Xmu_XmuReadBitmapDataFromFile" = x""yes; then
   with_xmu=yes
 else
   with_xmu=no
@@ -20410,7 +20485,7 @@
 fi
 { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_Xbsd_main" >&5
 $as_echo "$ac_cv_lib_Xbsd_main" >&6; }
-if test $ac_cv_lib_Xbsd_main = yes; then
+if test "x$ac_cv_lib_Xbsd_main" = x""yes; then
   libs_x="-lXbsd $libs_x" &&  if test "$verbose" = "yes"; then echo "    Prepending \"-lXbsd\" to \$libs_x"; fi
 fi
 
@@ -20582,8 +20657,9 @@
 $as_echo "$ac_res" >&6; }
 
 fi
-if test `eval 'as_val=${'$as_ac_Header'}
-		 $as_echo "$as_val"'` = yes; then
+as_val=`eval 'as_val=${'$as_ac_Header'}
+		 $as_echo "$as_val"'`
+   if test "x$as_val" = x""yes; then
   cat >>confdefs.h <<_ACEOF
 #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
 _ACEOF
@@ -20740,8 +20816,9 @@
 $as_echo "$ac_res" >&6; }
 
 fi
-if test `eval 'as_val=${'$as_ac_Header'}
-		 $as_echo "$as_val"'` = yes; then
+as_val=`eval 'as_val=${'$as_ac_Header'}
+		 $as_echo "$as_val"'`
+   if test "x$as_val" = x""yes; then
   cat >>confdefs.h <<_ACEOF
 #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
 _ACEOF
@@ -20827,7 +20904,7 @@
 fi
 { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_Xrender_XRenderQueryExtension" >&5
 $as_echo "$ac_cv_lib_Xrender_XRenderQueryExtension" >&6; }
-if test $ac_cv_lib_Xrender_XRenderQueryExtension = yes; then
+if test "x$ac_cv_lib_Xrender_XRenderQueryExtension" = x""yes; then
   libs_x="-lXrender $libs_x" &&  if test "$verbose" = "yes"; then echo "    Prepending \"-lXrender\" to \$libs_x"; fi
 else
   { echo "Error:" "Unable to find libXrender for --with-xft" >&2; exit 1; }
@@ -20898,7 +20975,7 @@
 fi
 { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_fontconfig_FcPatternCreate" >&5
 $as_echo "$ac_cv_lib_fontconfig_FcPatternCreate" >&6; }
-if test $ac_cv_lib_fontconfig_FcPatternCreate = yes; then
+if test "x$ac_cv_lib_fontconfig_FcPatternCreate" = x""yes; then
   libs_x="-lfontconfig $libs_x" &&  if test "$verbose" = "yes"; then echo "    Prepending \"-lfontconfig\" to \$libs_x"; fi
 else
   { echo "Error:" "Unable to find libfontconfig for --with-xft" >&2; exit 1; }
@@ -20969,7 +21046,7 @@
 fi
 { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_Xft_XftFontOpen" >&5
 $as_echo "$ac_cv_lib_Xft_XftFontOpen" >&6; }
-if test $ac_cv_lib_Xft_XftFontOpen = yes; then
+if test "x$ac_cv_lib_Xft_XftFontOpen" = x""yes; then
   libs_x="-lXft $libs_x" &&  if test "$verbose" = "yes"; then echo "    Prepending \"-lXft\" to \$libs_x"; fi
 else
   { echo "Error:" "Unable to find libXft for --with-xft" >&2; exit 1; }
@@ -21067,8 +21144,9 @@
 		 $as_echo "$as_val"'`
 	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
 $as_echo "$ac_res" >&6; }
-if test `eval 'as_val=${'$as_ac_var'}
-		 $as_echo "$as_val"'` = yes; then
+as_val=`eval 'as_val=${'$as_ac_var'}
+		 $as_echo "$as_val"'`
+   if test "x$as_val" = x""yes; then
   cat >>confdefs.h <<_ACEOF
 #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
@@ -21167,8 +21245,9 @@
 		 $as_echo "$as_val"'`
 	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
 $as_echo "$ac_res" >&6; }
-if test `eval 'as_val=${'$as_ac_var'}
-		 $as_echo "$as_val"'` = yes; then
+as_val=`eval 'as_val=${'$as_ac_var'}
+		 $as_echo "$as_val"'`
+   if test "x$as_val" = x""yes; then
   cat >>confdefs.h <<_ACEOF
 #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
@@ -21254,7 +21333,7 @@
 fi
 { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_gdi32_main" >&5
 $as_echo "$ac_cv_lib_gdi32_main" >&6; }
-if test $ac_cv_lib_gdi32_main = yes; then
+if test "x$ac_cv_lib_gdi32_main" = x""yes; then
   with_msw=yes
 fi
 
@@ -21285,11 +21364,13 @@
       test "$enable_widgets"    != "no" && enable_widgets=msw
     fi
         if test "$cross_compiling" = yes; then
-  { { $as_echo "$as_me:$LINENO: error: cannot run test program while cross compiling
+  { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ { $as_echo "$as_me:$LINENO: error: cannot run test program while cross compiling
 See \`config.log' for more details." >&5
 $as_echo "$as_me: error: cannot run test program while cross compiling
 See \`config.log' for more details." >&2;}
-   { (exit 1); exit 1; }; }
+   { (exit 1); exit 1; }; }; }
 else
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -21431,7 +21512,7 @@
 fi
 { $as_echo "$as_me:$LINENO: result: $ac_cv_header_X11_extensions_shape_h" >&5
 $as_echo "$ac_cv_header_X11_extensions_shape_h" >&6; }
-if test $ac_cv_header_X11_extensions_shape_h = yes; then
+if test "x$ac_cv_header_X11_extensions_shape_h" = x""yes; then
 
    cat >>confdefs.h <<\_ACEOF
 #define HAVE_BALLOON_HELP 1
@@ -21608,7 +21689,7 @@
 $as_echo "$ac_cv_header_X11_Xauth_h" >&6; }
 
 fi
-if test $ac_cv_header_X11_Xauth_h = yes; then
+if test "x$ac_cv_header_X11_Xauth_h" = x""yes; then
   :
 else
   with_xauth=no
@@ -21680,7 +21761,7 @@
 fi
 { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_Xau_XauGetAuthByAddr" >&5
 $as_echo "$ac_cv_lib_Xau_XauGetAuthByAddr" >&6; }
-if test $ac_cv_lib_Xau_XauGetAuthByAddr = yes; then
+if test "x$ac_cv_lib_Xau_XauGetAuthByAddr" = x""yes; then
   :
 else
   with_xauth=no
@@ -21857,7 +21938,7 @@
 $as_echo "$ac_cv_header_dlfcn_h" >&6; }
 
 fi
-if test $ac_cv_header_dlfcn_h = yes; then
+if test "x$ac_cv_header_dlfcn_h" = x""yes; then
 
 	{ $as_echo "$as_me:$LINENO: checking for dlopen in -lc" >&5
 $as_echo_n "checking for dlopen in -lc... " >&6; }
@@ -22158,7 +22239,7 @@
 $as_echo "$ac_cv_header_dl_h" >&6; }
 
 fi
-if test $ac_cv_header_dl_h = yes; then
+if test "x$ac_cv_header_dl_h" = x""yes; then
 
 	  { $as_echo "$as_me:$LINENO: checking for shl_load in -lc" >&5
 $as_echo_n "checking for shl_load in -lc... " >&6; }
@@ -22405,7 +22486,7 @@
 $as_echo "$ac_cv_header_ltdl_h" >&6; }
 
 fi
-if test $ac_cv_header_ltdl_h = yes; then
+if test "x$ac_cv_header_ltdl_h" = x""yes; then
 
 	    { $as_echo "$as_me:$LINENO: checking for lt_dlinit in -lltdl" >&5
 $as_echo_n "checking for lt_dlinit in -lltdl... " >&6; }
@@ -23227,8 +23308,9 @@
 		 $as_echo "$as_val"'`
 	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
 $as_echo "$ac_res" >&6; }
-if test `eval 'as_val=${'$as_ac_var'}
-		 $as_echo "$as_val"'` = yes; then
+as_val=`eval 'as_val=${'$as_ac_var'}
+		 $as_echo "$as_val"'`
+   if test "x$as_val" = x""yes; then
   cat >>confdefs.h <<_ACEOF
 #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
@@ -23409,8 +23491,9 @@
 $as_echo "$ac_res" >&6; }
 
 fi
-if test `eval 'as_val=${'$as_ac_Header'}
-		 $as_echo "$as_val"'` = yes; then
+as_val=`eval 'as_val=${'$as_ac_Header'}
+		 $as_echo "$as_val"'`
+   if test "x$as_val" = x""yes; then
   tt_c_h_file="${dir}tt_c.h"; break
 fi
 
@@ -23492,7 +23575,7 @@
 fi
 { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_tt_tt_message_create" >&5
 $as_echo "$ac_cv_lib_tt_tt_message_create" >&6; }
-if test $ac_cv_lib_tt_tt_message_create = yes; then
+if test "x$ac_cv_lib_tt_tt_message_create" = x""yes; then
   tt_libs="-ltt $extra_libs"; break
 else
   :
@@ -23653,7 +23736,7 @@
 $as_echo "$ac_cv_header_Dt_Dt_h" >&6; }
 
 fi
-if test $ac_cv_header_Dt_Dt_h = yes; then
+if test "x$ac_cv_header_Dt_Dt_h" = x""yes; then
   :
 else
   with_cde=no
@@ -23725,7 +23808,7 @@
 fi
 { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_DtSvc_DtDndDragStart" >&5
 $as_echo "$ac_cv_lib_DtSvc_DtDndDragStart" >&6; }
-if test $ac_cv_lib_DtSvc_DtDndDragStart = yes; then
+if test "x$ac_cv_lib_DtSvc_DtDndDragStart" = x""yes; then
   :
 else
   with_cde=no
@@ -23941,7 +24024,7 @@
 $as_echo "$ac_cv_header_ldap_h" >&6; }
 
 fi
-if test $ac_cv_header_ldap_h = yes; then
+if test "x$ac_cv_header_ldap_h" = x""yes; then
   :
 else
   with_ldap=no
@@ -24080,7 +24163,7 @@
 $as_echo "$ac_cv_header_lber_h" >&6; }
 
 fi
-if test $ac_cv_header_lber_h = yes; then
+if test "x$ac_cv_header_lber_h" = x""yes; then
   :
 else
   with_ldap=no
@@ -24153,7 +24236,7 @@
 fi
 { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_ldap_ldap_search" >&5
 $as_echo "$ac_cv_lib_ldap_ldap_search" >&6; }
-if test $ac_cv_lib_ldap_ldap_search = yes; then
+if test "x$ac_cv_lib_ldap_ldap_search" = x""yes; then
   with_ldap=yes
 fi
 
@@ -24222,7 +24305,7 @@
 fi
 { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_ldap_ldap_open" >&5
 $as_echo "$ac_cv_lib_ldap_ldap_open" >&6; }
-if test $ac_cv_lib_ldap_ldap_open = yes; then
+if test "x$ac_cv_lib_ldap_ldap_open" = x""yes; then
   with_ldap=yes with_ldap_lber=yes
 fi
  }
@@ -24291,7 +24374,7 @@
 fi
 { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_ldap_ldap_open" >&5
 $as_echo "$ac_cv_lib_ldap_ldap_open" >&6; }
-if test $ac_cv_lib_ldap_ldap_open = yes; then
+if test "x$ac_cv_lib_ldap_ldap_open" = x""yes; then
   with_ldap=yes with_ldap_lber=yes with_ldap_krb=yes
 fi
  }
@@ -24360,7 +24443,7 @@
 fi
 { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_ldap_ldap_open" >&5
 $as_echo "$ac_cv_lib_ldap_ldap_open" >&6; }
-if test $ac_cv_lib_ldap_ldap_open = yes; then
+if test "x$ac_cv_lib_ldap_ldap_open" = x""yes; then
   with_ldap=yes with_ldap_lber=yes with_ldap_krb=yes with_ldap_des=yes
 fi
  }
@@ -24429,7 +24512,7 @@
 fi
 { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_lber_ber_pvt_opt_on" >&5
 $as_echo "$ac_cv_lib_lber_ber_pvt_opt_on" >&6; }
-if test $ac_cv_lib_lber_ber_pvt_opt_on = yes; then
+if test "x$ac_cv_lib_lber_ber_pvt_opt_on" = x""yes; then
   with_ldap_lber=yes
 fi
  }
@@ -24544,8 +24627,9 @@
 		 $as_echo "$as_val"'`
 	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
 $as_echo "$ac_res" >&6; }
-if test `eval 'as_val=${'$as_ac_var'}
-		 $as_echo "$as_val"'` = yes; then
+as_val=`eval 'as_val=${'$as_ac_var'}
+		 $as_echo "$as_val"'`
+   if test "x$as_val" = x""yes; then
   cat >>confdefs.h <<_ACEOF
 #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
@@ -24707,8 +24791,9 @@
 $as_echo "$ac_res" >&6; }
 
 fi
-if test `eval 'as_val=${'$as_ac_Header'}
-		 $as_echo "$as_val"'` = yes; then
+as_val=`eval 'as_val=${'$as_ac_Header'}
+		 $as_echo "$as_val"'`
+   if test "x$as_val" = x""yes; then
   libpq_fe_h_file=${header_dir}libpq-fe.h; break
 fi
 
@@ -24783,7 +24868,7 @@
 fi
 { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_pq_PQconnectdb" >&5
 $as_echo "$ac_cv_lib_pq_PQconnectdb" >&6; }
-if test $ac_cv_lib_pq_PQconnectdb = yes; then
+if test "x$ac_cv_lib_pq_PQconnectdb" = x""yes; then
   pq_libs="-lpq"
 else
 
@@ -24853,7 +24938,7 @@
 fi
 { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_pq_PQconnectdb" >&5
 $as_echo "$ac_cv_lib_pq_PQconnectdb" >&6; }
-if test $ac_cv_lib_pq_PQconnectdb = yes; then
+if test "x$ac_cv_lib_pq_PQconnectdb" = x""yes; then
   pq_libs="-lpq -lcrypto -lssl"
 fi
 
@@ -24937,7 +25022,7 @@
 fi
 { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_pq_PQconnectStart" >&5
 $as_echo "$ac_cv_lib_pq_PQconnectStart" >&6; }
-if test $ac_cv_lib_pq_PQconnectStart = yes; then
+if test "x$ac_cv_lib_pq_PQconnectStart" = x""yes; then
 
                  with_postgresqlv7=yes;
                  cat >>confdefs.h <<\_ACEOF
@@ -25000,11 +25085,13 @@
 $as_echo_n "checking for Xpm - no older than 3.4f... " >&6; }
     xe_check_libs="$libname_xpm"
     if test "$cross_compiling" = yes; then
-  { { $as_echo "$as_me:$LINENO: error: cannot run test program while cross compiling
+  { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ { $as_echo "$as_me:$LINENO: error: cannot run test program while cross compiling
 See \`config.log' for more details." >&5
 $as_echo "$as_me: error: cannot run test program while cross compiling
 See \`config.log' for more details." >&2;}
-   { (exit 1); exit 1; }; }
+   { (exit 1); exit 1; }; }; }
 else
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -25278,7 +25365,7 @@
 $as_echo "$ac_cv_header_compface_h" >&6; }
 
 fi
-if test $ac_cv_header_compface_h = yes; then
+if test "x$ac_cv_header_compface_h" = x""yes; then
   :
 else
   with_xface=no
@@ -25350,7 +25437,7 @@
 fi
 { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_compface_UnGenFace" >&5
 $as_echo "$ac_cv_lib_compface_UnGenFace" >&6; }
-if test $ac_cv_lib_compface_UnGenFace = yes; then
+if test "x$ac_cv_lib_compface_UnGenFace" = x""yes; then
   :
 else
   with_xface=no
@@ -25365,8 +25452,289 @@
     libs_x="-lcompface $libs_x" &&  if test "$verbose" = "yes"; then echo "    Prepending \"-lcompface\" to \$libs_x"; fi
   fi
 
-        if test "$with_gif" != "no"; then
-    with_gif="yes"
+    test -z "$with_gif" && { if test "${ac_cv_header_gif_lib_h+set}" = set; then
+  { $as_echo "$as_me:$LINENO: checking for gif_lib.h" >&5
+$as_echo_n "checking for gif_lib.h... " >&6; }
+if test "${ac_cv_header_gif_lib_h+set}" = set; then
+  $as_echo_n "(cached) " >&6
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_gif_lib_h" >&5
+$as_echo "$ac_cv_header_gif_lib_h" >&6; }
+else
+  # Is the header compilable?
+{ $as_echo "$as_me:$LINENO: checking gif_lib.h usability" >&5
+$as_echo_n "checking gif_lib.h usability... " >&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 <gif_lib.h>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_header_compiler=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_header_compiler=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+$as_echo "$ac_header_compiler" >&6; }
+
+# Is the header present?
+{ $as_echo "$as_me:$LINENO: checking gif_lib.h presence" >&5
+$as_echo_n "checking gif_lib.h presence... " >&6; }
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <gif_lib.h>
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&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
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null && {
+	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       }; then
+  ac_header_preproc=yes
+else
+  $as_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
+{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+$as_echo "$ac_header_preproc" >&6; }
+
+# So?  What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+  yes:no: )
+    { $as_echo "$as_me:$LINENO: WARNING: gif_lib.h: accepted by the compiler, rejected by the preprocessor!" >&5
+$as_echo "$as_me: WARNING: gif_lib.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: gif_lib.h: proceeding with the compiler's result" >&5
+$as_echo "$as_me: WARNING: gif_lib.h: proceeding with the compiler's result" >&2;}
+    ac_header_preproc=yes
+    ;;
+  no:yes:* )
+    { $as_echo "$as_me:$LINENO: WARNING: gif_lib.h: present but cannot be compiled" >&5
+$as_echo "$as_me: WARNING: gif_lib.h: present but cannot be compiled" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: gif_lib.h:     check for missing prerequisite headers?" >&5
+$as_echo "$as_me: WARNING: gif_lib.h:     check for missing prerequisite headers?" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: gif_lib.h: see the Autoconf documentation" >&5
+$as_echo "$as_me: WARNING: gif_lib.h: see the Autoconf documentation" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: gif_lib.h:     section \"Present But Cannot Be Compiled\"" >&5
+$as_echo "$as_me: WARNING: gif_lib.h:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: gif_lib.h: proceeding with the preprocessor's result" >&5
+$as_echo "$as_me: WARNING: gif_lib.h: proceeding with the preprocessor's result" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: gif_lib.h: in the future, the compiler will take precedence" >&5
+$as_echo "$as_me: WARNING: gif_lib.h: in the future, the compiler will take precedence" >&2;}
+    ( cat <<\_ASBOX
+## ------------------------------------- ##
+## Report this to xemacs-beta@xemacs.org ##
+## ------------------------------------- ##
+_ASBOX
+     ) | sed "s/^/$as_me: WARNING:     /" >&2
+    ;;
+esac
+{ $as_echo "$as_me:$LINENO: checking for gif_lib.h" >&5
+$as_echo_n "checking for gif_lib.h... " >&6; }
+if test "${ac_cv_header_gif_lib_h+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  ac_cv_header_gif_lib_h=$ac_header_preproc
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_gif_lib_h" >&5
+$as_echo "$ac_cv_header_gif_lib_h" >&6; }
+
+fi
+if test "x$ac_cv_header_gif_lib_h" = x""yes; then
+  :
+else
+  with_gif=no
+fi
+
+ }
+  if test "$with_gif" != "no"; then
+                { $as_echo "$as_me:$LINENO: checking for EGifPutExtensionLast in -lgif" >&5
+$as_echo_n "checking for EGifPutExtensionLast in -lgif... " >&6; }
+if test "${ac_cv_lib_gif_EGifPutExtensionLast+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lgif  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char EGifPutExtensionLast ();
+int
+main ()
+{
+return EGifPutExtensionLast ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
+  ac_cv_lib_gif_EGifPutExtensionLast=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_lib_gif_EGifPutExtensionLast=no
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_gif_EGifPutExtensionLast" >&5
+$as_echo "$ac_cv_lib_gif_EGifPutExtensionLast" >&6; }
+if test "x$ac_cv_lib_gif_EGifPutExtensionLast" = x""yes; then
+  libs_x="-lgif $libs_x" &&  if test "$verbose" = "yes"; then echo "    Prepending \"-lgif\" to \$libs_x"; fi
+else
+  { $as_echo "$as_me:$LINENO: checking for EGifPutExtensionLast in -lungif" >&5
+$as_echo_n "checking for EGifPutExtensionLast in -lungif... " >&6; }
+if test "${ac_cv_lib_ungif_EGifPutExtensionLast+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lungif  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char EGifPutExtensionLast ();
+int
+main ()
+{
+return EGifPutExtensionLast ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
+  ac_cv_lib_ungif_EGifPutExtensionLast=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_lib_ungif_EGifPutExtensionLast=no
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_ungif_EGifPutExtensionLast" >&5
+$as_echo "$ac_cv_lib_ungif_EGifPutExtensionLast" >&6; }
+if test "x$ac_cv_lib_ungif_EGifPutExtensionLast" = x""yes; then
+  libs_x="-lungif $libs_x" &&  if test "$verbose" = "yes"; then echo "    Prepending \"-lungif\" to \$libs_x"; fi
+else
+  with_gif=no
+fi
+
+fi
+
+  fi
+  if test "$with_gif" != "no"; then
     cat >>confdefs.h <<\_ACEOF
 #define HAVE_GIF 1
 _ACEOF
@@ -25439,7 +25807,7 @@
 fi
 { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_c_inflate" >&5
 $as_echo "$ac_cv_lib_c_inflate" >&6; }
-if test $ac_cv_lib_c_inflate = yes; then
+if test "x$ac_cv_lib_c_inflate" = x""yes; then
   :
 else
 
@@ -25508,7 +25876,7 @@
 fi
 { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_z_inflate" >&5
 $as_echo "$ac_cv_lib_z_inflate" >&6; }
-if test $ac_cv_lib_z_inflate = yes; then
+if test "x$ac_cv_lib_z_inflate" = x""yes; then
   libs_x="-lz $libs_x" &&  if test "$verbose" = "yes"; then echo "    Prepending \"-lz\" to \$libs_x"; fi
 else
 
@@ -25577,7 +25945,7 @@
 fi
 { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_gz_inflate" >&5
 $as_echo "$ac_cv_lib_gz_inflate" >&6; }
-if test $ac_cv_lib_gz_inflate = yes; then
+if test "x$ac_cv_lib_gz_inflate" = x""yes; then
   libs_x="-lgz $libs_x" &&  if test "$verbose" = "yes"; then echo "    Prepending \"-lgz\" to \$libs_x"; fi
 fi
 
@@ -25719,7 +26087,7 @@
 $as_echo "$ac_cv_header_jpeglib_h" >&6; }
 
 fi
-if test $ac_cv_header_jpeglib_h = yes; then
+if test "x$ac_cv_header_jpeglib_h" = x""yes; then
   :
 else
   with_jpeg=no
@@ -25791,7 +26159,7 @@
 fi
 { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_jpeg_jpeg_destroy_decompress" >&5
 $as_echo "$ac_cv_lib_jpeg_jpeg_destroy_decompress" >&6; }
-if test $ac_cv_lib_jpeg_jpeg_destroy_decompress = yes; then
+if test "x$ac_cv_lib_jpeg_jpeg_destroy_decompress" = x""yes; then
   :
 else
   with_jpeg=no
@@ -25892,7 +26260,7 @@
 fi
 { $as_echo "$as_me:$LINENO: result: $ac_cv_func_pow" >&5
 $as_echo "$ac_cv_func_pow" >&6; }
-if test $ac_cv_func_pow = yes; then
+if test "x$ac_cv_func_pow" = x""yes; then
   :
 else
   with_png=no
@@ -26030,7 +26398,7 @@
 $as_echo "$ac_cv_header_png_h" >&6; }
 
 fi
-if test $ac_cv_header_png_h = yes; then
+if test "x$ac_cv_header_png_h" = x""yes; then
   :
 else
   with_png=no
@@ -26102,7 +26470,7 @@
 fi
 { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_png_png_read_image" >&5
 $as_echo "$ac_cv_lib_png_png_read_image" >&6; }
-if test $ac_cv_lib_png_png_read_image = yes; then
+if test "x$ac_cv_lib_png_png_read_image" = x""yes; then
   :
 else
   with_png=no
@@ -26113,11 +26481,13 @@
 $as_echo_n "checking for workable png version information... " >&6; }
     xe_check_libs="-lpng -lz"
     if test "$cross_compiling" = yes; then
-  { { $as_echo "$as_me:$LINENO: error: cannot run test program while cross compiling
+  { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ { $as_echo "$as_me:$LINENO: error: cannot run test program while cross compiling
 See \`config.log' for more details." >&5
 $as_echo "$as_me: error: cannot run test program while cross compiling
 See \`config.log' for more details." >&2;}
-   { (exit 1); exit 1; }; }
+   { (exit 1); exit 1; }; }; }
 else
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -26326,7 +26696,7 @@
 $as_echo "$ac_cv_header_tiffio_h" >&6; }
 
 fi
-if test $ac_cv_header_tiffio_h = yes; then
+if test "x$ac_cv_header_tiffio_h" = x""yes; then
   :
 else
   with_tiff=no
@@ -26398,7 +26768,7 @@
 fi
 { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_tiff_TIFFClientOpen" >&5
 $as_echo "$ac_cv_lib_tiff_TIFFClientOpen" >&6; }
-if test $ac_cv_lib_tiff_TIFFClientOpen = yes; then
+if test "x$ac_cv_lib_tiff_TIFFClientOpen" = x""yes; then
   :
 else
   with_tiff=no
@@ -26548,7 +26918,7 @@
 $as_echo "$ac_cv_header_compface_h" >&6; }
 
 fi
-if test $ac_cv_header_compface_h = yes; then
+if test "x$ac_cv_header_compface_h" = x""yes; then
   :
 else
   with_xface=no
@@ -26620,7 +26990,7 @@
 fi
 { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_compface_UnGenFace" >&5
 $as_echo "$ac_cv_lib_compface_UnGenFace" >&6; }
-if test $ac_cv_lib_compface_UnGenFace = yes; then
+if test "x$ac_cv_lib_compface_UnGenFace" = x""yes; then
   :
 else
   with_xface=no
@@ -26737,8 +27107,9 @@
 		 $as_echo "$as_val"'`
 	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
 $as_echo "$ac_res" >&6; }
-if test `eval 'as_val=${'$as_ac_Lib'}
-		 $as_echo "$as_val"'` = yes; then
+as_val=`eval 'as_val=${'$as_ac_Lib'}
+		 $as_echo "$as_val"'`
+   if test "x$as_val" = x""yes; then
 
                 as_ac_Lib=`$as_echo "ac_cv_lib_$athena_variant''_XawSme3dComputeTopShadowRGB" | $as_tr_sh`
 { $as_echo "$as_me:$LINENO: checking for XawSme3dComputeTopShadowRGB in -l$athena_variant" >&5
@@ -26808,8 +27179,9 @@
 		 $as_echo "$as_val"'`
 	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
 $as_echo "$ac_res" >&6; }
-if test `eval 'as_val=${'$as_ac_Lib'}
-		 $as_echo "$as_val"'` = yes; then
+as_val=`eval 'as_val=${'$as_ac_Lib'}
+		 $as_echo "$as_val"'`
+   if test "x$as_val" = x""yes; then
   { $as_echo "$as_me:$LINENO: WARNING: Could not find a non-3d Athena widget library." >&5
 $as_echo "$as_me: WARNING: Could not find a non-3d Athena widget library." >&2;}
 else
@@ -26891,8 +27263,9 @@
 		 $as_echo "$as_val"'`
 	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
 $as_echo "$ac_res" >&6; }
-if test `eval 'as_val=${'$as_ac_Lib'}
-		 $as_echo "$as_val"'` = yes; then
+as_val=`eval 'as_val=${'$as_ac_Lib'}
+		 $as_echo "$as_val"'`
+   if test "x$as_val" = x""yes; then
   athena_lib=$athena_variant
 else
               { $as_echo "$as_me:$LINENO: checking for XawSme3dComputeTopShadowRGB in -lXaw" >&5
@@ -26960,7 +27333,7 @@
 fi
 { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_Xaw_XawSme3dComputeTopShadowRGB" >&5
 $as_echo "$ac_cv_lib_Xaw_XawSme3dComputeTopShadowRGB" >&6; }
-if test $ac_cv_lib_Xaw_XawSme3dComputeTopShadowRGB = yes; then
+if test "x$ac_cv_lib_Xaw_XawSme3dComputeTopShadowRGB" = x""yes; then
 
           athena_lib=Xaw;
           { $as_echo "$as_me:$LINENO: WARNING: Assuming that libXaw is actually $athena_variant." >&5
@@ -27108,7 +27481,7 @@
 $as_echo "$ac_cv_header_X11_Xaw_ThreeD_h" >&6; }
 
 fi
-if test $ac_cv_header_X11_Xaw_ThreeD_h = yes; then
+if test "x$ac_cv_header_X11_Xaw_ThreeD_h" = x""yes; then
   { $as_echo "$as_me:$LINENO: WARNING: Could not find a non-3d Athena header set." >&5
 $as_echo "$as_me: WARNING: Could not find a non-3d Athena header set." >&2;}
 else
@@ -27159,7 +27532,7 @@
 fi
 { $as_echo "$as_me:$LINENO: result: $ac_cv_header_X11_Xaw_XawInit_h" >&5
 $as_echo "$ac_cv_header_X11_Xaw_XawInit_h" >&6; }
-if test $ac_cv_header_X11_Xaw_XawInit_h = yes; then
+if test "x$ac_cv_header_X11_Xaw_XawInit_h" = x""yes; then
   athena_h_path=X11/Xaw
 else
   { $as_echo "$as_me:$LINENO: WARNING: Could not find a non-3d Athena header set." >&5
@@ -27224,8 +27597,9 @@
 		 $as_echo "$as_val"'`
 	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
 $as_echo "$ac_res" >&6; }
-if test `eval 'as_val=${'$as_ac_Header'}
-		 $as_echo "$as_val"'` = yes; then
+as_val=`eval 'as_val=${'$as_ac_Header'}
+		 $as_echo "$as_val"'`
+   if test "x$as_val" = x""yes; then
   as_ac_Header=`$as_echo "ac_cv_header_X11/$athena_variant/ThreeD.h" | $as_tr_sh`
 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
   { $as_echo "$as_me:$LINENO: checking for X11/$athena_variant/ThreeD.h" >&5
@@ -27363,8 +27737,9 @@
 $as_echo "$ac_res" >&6; }
 
 fi
-if test `eval 'as_val=${'$as_ac_Header'}
-		 $as_echo "$as_val"'` = yes; then
+as_val=`eval 'as_val=${'$as_ac_Header'}
+		 $as_echo "$as_val"'`
+   if test "x$as_val" = x""yes; then
   athena_h_path=X11/$athena_variant
 fi
 
@@ -27427,8 +27802,9 @@
 		 $as_echo "$as_val"'`
 	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
 $as_echo "$ac_res" >&6; }
-if test `eval 'as_val=${'$as_ac_Header'}
-		 $as_echo "$as_val"'` = yes; then
+as_val=`eval 'as_val=${'$as_ac_Header'}
+		 $as_echo "$as_val"'`
+   if test "x$as_val" = x""yes; then
   as_ac_Header=`$as_echo "ac_cv_header_$athena_variant/ThreeD.h" | $as_tr_sh`
 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
   { $as_echo "$as_me:$LINENO: checking for $athena_variant/ThreeD.h" >&5
@@ -27566,8 +27942,9 @@
 $as_echo "$ac_res" >&6; }
 
 fi
-if test `eval 'as_val=${'$as_ac_Header'}
-		 $as_echo "$as_val"'` = yes; then
+as_val=`eval 'as_val=${'$as_ac_Header'}
+		 $as_echo "$as_val"'`
+   if test "x$as_val" = x""yes; then
   athena_h_path=$athena_variant
 fi
 
@@ -27628,7 +28005,7 @@
 fi
 { $as_echo "$as_me:$LINENO: result: $ac_cv_header_X11_Xaw3d_XawInit_h" >&5
 $as_echo "$ac_cv_header_X11_Xaw3d_XawInit_h" >&6; }
-if test $ac_cv_header_X11_Xaw3d_XawInit_h = yes; then
+if test "x$ac_cv_header_X11_Xaw3d_XawInit_h" = x""yes; then
   if test "${ac_cv_header_X11_Xaw3d_ThreeD_h+set}" = set; then
   { $as_echo "$as_me:$LINENO: checking for X11/Xaw3d/ThreeD.h" >&5
 $as_echo_n "checking for X11/Xaw3d/ThreeD.h... " >&6; }
@@ -27761,7 +28138,7 @@
 $as_echo "$ac_cv_header_X11_Xaw3d_ThreeD_h" >&6; }
 
 fi
-if test $ac_cv_header_X11_Xaw3d_ThreeD_h = yes; then
+if test "x$ac_cv_header_X11_Xaw3d_ThreeD_h" = x""yes; then
 
             { $as_echo "$as_me:$LINENO: WARNING: Assuming that X11/Xaw3d headers are suitable for $athena_variant." >&5
 $as_echo "$as_me: WARNING: Assuming that X11/Xaw3d headers are suitable for $athena_variant." >&2;}
@@ -27826,7 +28203,7 @@
 fi
 { $as_echo "$as_me:$LINENO: result: $ac_cv_header_Xaw3d_XawInit_h" >&5
 $as_echo "$ac_cv_header_Xaw3d_XawInit_h" >&6; }
-if test $ac_cv_header_Xaw3d_XawInit_h = yes; then
+if test "x$ac_cv_header_Xaw3d_XawInit_h" = x""yes; then
   if test "${ac_cv_header_Xaw3d_ThreeD_h+set}" = set; then
   { $as_echo "$as_me:$LINENO: checking for Xaw3d/ThreeD.h" >&5
 $as_echo_n "checking for Xaw3d/ThreeD.h... " >&6; }
@@ -27959,7 +28336,7 @@
 $as_echo "$ac_cv_header_Xaw3d_ThreeD_h" >&6; }
 
 fi
-if test $ac_cv_header_Xaw3d_ThreeD_h = yes; then
+if test "x$ac_cv_header_Xaw3d_ThreeD_h" = x""yes; then
 
             { $as_echo "$as_me:$LINENO: WARNING: Assuming that Xaw3d headers are suitable for $athena_variant." >&5
 $as_echo "$as_me: WARNING: Assuming that Xaw3d headers are suitable for $athena_variant." >&2;}
@@ -28106,7 +28483,7 @@
 $as_echo "$ac_cv_header_X11_Xaw_ThreeD_h" >&6; }
 
 fi
-if test $ac_cv_header_X11_Xaw_ThreeD_h = yes; then
+if test "x$ac_cv_header_X11_Xaw_ThreeD_h" = x""yes; then
 
           { $as_echo "$as_me:$LINENO: WARNING: Assuming that X11/Xaw headers are suitable for $athena_variant." >&5
 $as_echo "$as_me: WARNING: Assuming that X11/Xaw headers are suitable for $athena_variant." >&2;}
@@ -28263,7 +28640,7 @@
 $as_echo "$ac_cv_header_Xm_Xm_h" >&6; }
 
 fi
-if test $ac_cv_header_Xm_Xm_h = yes; then
+if test "x$ac_cv_header_Xm_Xm_h" = x""yes; then
   { $as_echo "$as_me:$LINENO: checking for XmStringCreate in -lXm" >&5
 $as_echo_n "checking for XmStringCreate in -lXm... " >&6; }
 if test "${ac_cv_lib_Xm_XmStringCreate+set}" = set; then
@@ -28329,7 +28706,7 @@
 fi
 { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_Xm_XmStringCreate" >&5
 $as_echo "$ac_cv_lib_Xm_XmStringCreate" >&6; }
-if test $ac_cv_lib_Xm_XmStringCreate = yes; then
+if test "x$ac_cv_lib_Xm_XmStringCreate" = x""yes; then
   have_motif=yes
 else
   have_motif=no
@@ -28788,8 +29165,9 @@
 $as_echo "$ac_res" >&6; }
 
 fi
-if test `eval 'as_val=${'$as_ac_Header'}
-		 $as_echo "$as_val"'` = yes; then
+as_val=`eval 'as_val=${'$as_ac_Header'}
+		 $as_echo "$as_val"'`
+   if test "x$as_val" = x""yes; then
   cat >>confdefs.h <<_ACEOF
 #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
 _ACEOF
@@ -28864,7 +29242,7 @@
 fi
 { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_intl_strerror" >&5
 $as_echo "$ac_cv_lib_intl_strerror" >&6; }
-if test $ac_cv_lib_intl_strerror = yes; then
+if test "x$ac_cv_lib_intl_strerror" = x""yes; then
   cat >>confdefs.h <<_ACEOF
 #define HAVE_LIBINTL 1
 _ACEOF
@@ -28944,7 +29322,7 @@
 fi
 { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_X11_XOpenIM" >&5
 $as_echo "$ac_cv_lib_X11_XOpenIM" >&6; }
-if test $ac_cv_lib_X11_XOpenIM = yes; then
+if test "x$ac_cv_lib_X11_XOpenIM" = x""yes; then
   with_xim=xlib
 else
   with_xim=no
@@ -29016,7 +29394,7 @@
 fi
 { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_Xm_XmImMbLookupString" >&5
 $as_echo "$ac_cv_lib_Xm_XmImMbLookupString" >&6; }
-if test $ac_cv_lib_Xm_XmImMbLookupString = yes; then
+if test "x$ac_cv_lib_Xm_XmImMbLookupString" = x""yes; then
   with_xim=motif
 fi
 
@@ -29086,7 +29464,7 @@
 fi
 { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_Xm_XmImMbLookupString" >&5
 $as_echo "$ac_cv_lib_Xm_XmImMbLookupString" >&6; }
-if test $ac_cv_lib_Xm_XmImMbLookupString = yes; then
+if test "x$ac_cv_lib_Xm_XmImMbLookupString" = x""yes; then
   with_xim=motif
 fi
 
@@ -29189,7 +29567,7 @@
 fi
 { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_X11_XmbDrawString" >&5
 $as_echo "$ac_cv_lib_X11_XmbDrawString" >&6; }
-if test $ac_cv_lib_X11_XmbDrawString = yes; then
+if test "x$ac_cv_lib_X11_XmbDrawString" = x""yes; then
   :
 else
   with_xfs=no
@@ -29340,7 +29718,7 @@
 $as_echo "$ac_cv_header_wnn_jllib_h" >&6; }
 
 fi
-if test $ac_cv_header_wnn_jllib_h = yes; then
+if test "x$ac_cv_header_wnn_jllib_h" = x""yes; then
   :
 else
   with_wnn=no
@@ -29479,7 +29857,7 @@
 $as_echo "$ac_cv_header_wnn_commonhd_h" >&6; }
 
 fi
-if test $ac_cv_header_wnn_commonhd_h = yes; then
+if test "x$ac_cv_header_wnn_commonhd_h" = x""yes; then
   :
 else
   with_wnn=no
@@ -29578,8 +29956,9 @@
 		 $as_echo "$as_val"'`
 	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
 $as_echo "$ac_res" >&6; }
-if test `eval 'as_val=${'$as_ac_var'}
-		 $as_echo "$as_val"'` = yes; then
+as_val=`eval 'as_val=${'$as_ac_var'}
+		 $as_echo "$as_val"'`
+   if test "x$as_val" = x""yes; then
   cat >>confdefs.h <<_ACEOF
 #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
@@ -29653,7 +30032,7 @@
 fi
 { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_crypt_crypt" >&5
 $as_echo "$ac_cv_lib_crypt_crypt" >&6; }
-if test $ac_cv_lib_crypt_crypt = yes; then
+if test "x$ac_cv_lib_crypt_crypt" = x""yes; then
   cat >>confdefs.h <<_ACEOF
 #define HAVE_LIBCRYPT 1
 _ACEOF
@@ -29729,7 +30108,7 @@
 fi
 { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_wnn_jl_dic_list_e" >&5
 $as_echo "$ac_cv_lib_wnn_jl_dic_list_e" >&6; }
-if test $ac_cv_lib_wnn_jl_dic_list_e = yes; then
+if test "x$ac_cv_lib_wnn_jl_dic_list_e" = x""yes; then
   libwnn=wnn
 else
   { $as_echo "$as_me:$LINENO: checking for jl_dic_list_e in -lwnn4" >&5
@@ -29797,7 +30176,7 @@
 fi
 { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_wnn4_jl_dic_list_e" >&5
 $as_echo "$ac_cv_lib_wnn4_jl_dic_list_e" >&6; }
-if test $ac_cv_lib_wnn4_jl_dic_list_e = yes; then
+if test "x$ac_cv_lib_wnn4_jl_dic_list_e" = x""yes; then
   libwnn=wnn4
 else
   { $as_echo "$as_me:$LINENO: checking for jl_dic_list_e in -lwnn6" >&5
@@ -29865,7 +30244,7 @@
 fi
 { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_wnn6_jl_dic_list_e" >&5
 $as_echo "$ac_cv_lib_wnn6_jl_dic_list_e" >&6; }
-if test $ac_cv_lib_wnn6_jl_dic_list_e = yes; then
+if test "x$ac_cv_lib_wnn6_jl_dic_list_e" = x""yes; then
   libwnn=wnn6
 else
   { $as_echo "$as_me:$LINENO: checking for dic_list_e in -lwnn6_fromsrc" >&5
@@ -29933,7 +30312,7 @@
 fi
 { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_wnn6_fromsrc_dic_list_e" >&5
 $as_echo "$ac_cv_lib_wnn6_fromsrc_dic_list_e" >&6; }
-if test $ac_cv_lib_wnn6_fromsrc_dic_list_e = yes; then
+if test "x$ac_cv_lib_wnn6_fromsrc_dic_list_e" = x""yes; then
   libwnn=wnn6_fromsrc
 else
   with_wnn=no
@@ -30022,8 +30401,9 @@
 		 $as_echo "$as_val"'`
 	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
 $as_echo "$ac_res" >&6; }
-if test `eval 'as_val=${'$as_ac_Lib'}
-		 $as_echo "$as_val"'` = yes; then
+as_val=`eval 'as_val=${'$as_ac_Lib'}
+		 $as_echo "$as_val"'`
+   if test "x$as_val" = x""yes; then
   with_wnn6=yes
 fi
 
@@ -30177,7 +30557,7 @@
 $as_echo "$ac_cv_header_canna_jrkanji_h" >&6; }
 
 fi
-if test $ac_cv_header_canna_jrkanji_h = yes; then
+if test "x$ac_cv_header_canna_jrkanji_h" = x""yes; then
   if test "${ac_cv_header_canna_RK_h+set}" = set; then
   { $as_echo "$as_me:$LINENO: checking for canna/RK.h" >&5
 $as_echo_n "checking for canna/RK.h... " >&6; }
@@ -30310,7 +30690,7 @@
 $as_echo "$ac_cv_header_canna_RK_h" >&6; }
 
 fi
-if test $ac_cv_header_canna_RK_h = yes; then
+if test "x$ac_cv_header_canna_RK_h" = x""yes; then
   have_canna=$ac_header_compiler
 fi
 
@@ -30400,7 +30780,7 @@
 fi
 { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_RKC_RkBgnBun" >&5
 $as_echo "$ac_cv_lib_RKC_RkBgnBun" >&6; }
-if test $ac_cv_lib_RKC_RkBgnBun = yes; then
+if test "x$ac_cv_lib_RKC_RkBgnBun" = x""yes; then
   :
 else
   have_canna=no
@@ -30471,7 +30851,7 @@
 fi
 { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_canna_jrKanjiControl" >&5
 $as_echo "$ac_cv_lib_canna_jrKanjiControl" >&6; }
-if test $ac_cv_lib_canna_jrKanjiControl = yes; then
+if test "x$ac_cv_lib_canna_jrKanjiControl" = x""yes; then
   :
 else
   have_canna=no
@@ -30576,7 +30956,7 @@
 fi
 { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_i18n_layout_object_getvalue" >&5
 $as_echo "$ac_cv_lib_i18n_layout_object_getvalue" >&6; }
-if test $ac_cv_lib_i18n_layout_object_getvalue = yes; then
+if test "x$ac_cv_lib_i18n_layout_object_getvalue" = x""yes; then
   libs_x="-li18n $libs_x" &&  if test "$verbose" = "yes"; then echo "    Prepending \"-li18n\" to \$libs_x"; fi
 fi
 
@@ -30786,8 +31166,9 @@
 		 $as_echo "$as_val"'`
 	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
 $as_echo "$ac_res" >&6; }
-if test `eval 'as_val=${'$as_ac_var'}
-		 $as_echo "$as_val"'` = yes; then
+as_val=`eval 'as_val=${'$as_ac_var'}
+		 $as_echo "$as_val"'`
+   if test "x$as_val" = x""yes; then
   cat >>confdefs.h <<_ACEOF
 #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
@@ -30892,7 +31273,7 @@
 fi
 { $as_echo "$as_me:$LINENO: result: $ac_cv_func_mprotect" >&5
 $as_echo "$ac_cv_func_mprotect" >&6; }
-if test $ac_cv_func_mprotect = yes; then
+if test "x$ac_cv_func_mprotect" = x""yes; then
   cat >>confdefs.h <<\_ACEOF
 #define HAVE_MPROTECT 1
 _ACEOF
@@ -30985,7 +31366,7 @@
 fi
 { $as_echo "$as_me:$LINENO: result: $ac_cv_func_sigaction" >&5
 $as_echo "$ac_cv_func_sigaction" >&6; }
-if test $ac_cv_func_sigaction = yes; then
+if test "x$ac_cv_func_sigaction" = x""yes; then
   cat >>confdefs.h <<\_ACEOF
 #define HAVE_SIGACTION 1
 _ACEOF
@@ -31091,7 +31472,7 @@
 fi
 { $as_echo "$as_me:$LINENO: result: $ac_cv_member_struct_siginfo_si_addr" >&5
 $as_echo "$ac_cv_member_struct_siginfo_si_addr" >&6; }
-if test $ac_cv_member_struct_siginfo_si_addr = yes; then
+if test "x$ac_cv_member_struct_siginfo_si_addr" = x""yes; then
   cat >>confdefs.h <<\_ACEOF
 #define HAVE_STRUCT_SIGINFO_SI_ADDR 1
 _ACEOF
@@ -31195,7 +31576,7 @@
 fi
 { $as_echo "$as_me:$LINENO: result: $ac_cv_member_siginfo_t_si_addr" >&5
 $as_echo "$ac_cv_member_siginfo_t_si_addr" >&6; }
-if test $ac_cv_member_siginfo_t_si_addr = yes; then
+if test "x$ac_cv_member_siginfo_t_si_addr" = x""yes; then
   cat >>confdefs.h <<\_ACEOF
 #define HAVE_SIGINFO_T_SI_ADDR 1
 _ACEOF
@@ -31291,7 +31672,7 @@
 fi
 { $as_echo "$as_me:$LINENO: result: $ac_cv_func_signal" >&5
 $as_echo "$ac_cv_func_signal" >&6; }
-if test $ac_cv_func_signal = yes; then
+if test "x$ac_cv_func_signal" = x""yes; then
   cat >>confdefs.h <<\_ACEOF
 #define HAVE_SIGNAL 1
 _ACEOF
@@ -31395,7 +31776,7 @@
 fi
 { $as_echo "$as_me:$LINENO: result: $ac_cv_member_struct_sigcontext_cr2" >&5
 $as_echo "$ac_cv_member_struct_sigcontext_cr2" >&6; }
-if test $ac_cv_member_struct_sigcontext_cr2 = yes; then
+if test "x$ac_cv_member_struct_sigcontext_cr2" = x""yes; then
   cat >>confdefs.h <<\_ACEOF
 #define HAVE_STRUCT_SIGCONTEXT_CR2 1
 _ACEOF
@@ -31521,8 +31902,9 @@
 		 $as_echo "$as_val"'`
 	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
 $as_echo "$ac_res" >&6; }
-if test `eval 'as_val=${'$as_ac_var'}
-		 $as_echo "$as_val"'` = yes; then
+as_val=`eval 'as_val=${'$as_ac_var'}
+		 $as_echo "$as_val"'`
+   if test "x$as_val" = x""yes; then
   cat >>confdefs.h <<_ACEOF
 #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
@@ -31616,7 +31998,7 @@
 fi
 { $as_echo "$as_me:$LINENO: result: $ac_cv_func_openpty" >&5
 $as_echo "$ac_cv_func_openpty" >&6; }
-if test $ac_cv_func_openpty = yes; then
+if test "x$ac_cv_func_openpty" = x""yes; then
   have_openpty=yes
 else
 
@@ -31685,7 +32067,7 @@
 fi
 { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_util_openpty" >&5
 $as_echo "$ac_cv_lib_util_openpty" >&6; }
-if test $ac_cv_lib_util_openpty = yes; then
+if test "x$ac_cv_lib_util_openpty" = x""yes; then
   have_openpty=yes need_libutil=yes
 fi
 
@@ -31837,8 +32219,9 @@
 $as_echo "$ac_res" >&6; }
 
 fi
-if test `eval 'as_val=${'$as_ac_Header'}
-		 $as_echo "$as_val"'` = yes; then
+as_val=`eval 'as_val=${'$as_ac_Header'}
+		 $as_echo "$as_val"'`
+   if test "x$as_val" = x""yes; then
   cat >>confdefs.h <<_ACEOF
 #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
 _ACEOF
@@ -31991,8 +32374,9 @@
 $as_echo "$ac_res" >&6; }
 
 fi
-if test `eval 'as_val=${'$as_ac_Header'}
-		 $as_echo "$as_val"'` = yes; then
+as_val=`eval 'as_val=${'$as_ac_Header'}
+		 $as_echo "$as_val"'`
+   if test "x$as_val" = x""yes; then
   cat >>confdefs.h <<_ACEOF
 #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
 _ACEOF
@@ -32141,8 +32525,9 @@
 $as_echo "$ac_res" >&6; }
 
 fi
-if test `eval 'as_val=${'$as_ac_Header'}
-		 $as_echo "$as_val"'` = yes; then
+as_val=`eval 'as_val=${'$as_ac_Header'}
+		 $as_echo "$as_val"'`
+   if test "x$as_val" = x""yes; then
   cat >>confdefs.h <<_ACEOF
 #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
 _ACEOF
@@ -32291,8 +32676,9 @@
 $as_echo "$ac_res" >&6; }
 
 fi
-if test `eval 'as_val=${'$as_ac_Header'}
-		 $as_echo "$as_val"'` = yes; then
+as_val=`eval 'as_val=${'$as_ac_Header'}
+		 $as_echo "$as_val"'`
+   if test "x$as_val" = x""yes; then
   cat >>confdefs.h <<_ACEOF
 #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
 _ACEOF
@@ -32444,8 +32830,9 @@
 $as_echo "$ac_res" >&6; }
 
 fi
-if test `eval 'as_val=${'$as_ac_Header'}
-		 $as_echo "$as_val"'` = yes; then
+as_val=`eval 'as_val=${'$as_ac_Header'}
+		 $as_echo "$as_val"'`
+   if test "x$as_val" = x""yes; then
   cat >>confdefs.h <<_ACEOF
 #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
 _ACEOF
@@ -32546,8 +32933,9 @@
 		 $as_echo "$as_val"'`
 	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
 $as_echo "$ac_res" >&6; }
-if test `eval 'as_val=${'$as_ac_var'}
-		 $as_echo "$as_val"'` = yes; then
+as_val=`eval 'as_val=${'$as_ac_var'}
+		 $as_echo "$as_val"'`
+   if test "x$as_val" = x""yes; then
   cat >>confdefs.h <<_ACEOF
 #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
@@ -32695,8 +33083,9 @@
 $as_echo "$ac_res" >&6; }
 
 fi
-if test `eval 'as_val=${'$as_ac_Header'}
-		 $as_echo "$as_val"'` = yes; then
+as_val=`eval 'as_val=${'$as_ac_Header'}
+		 $as_echo "$as_val"'`
+   if test "x$as_val" = x""yes; then
   cat >>confdefs.h <<_ACEOF
 #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
 _ACEOF
@@ -32797,8 +33186,9 @@
 		 $as_echo "$as_val"'`
 	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
 $as_echo "$ac_res" >&6; }
-if test `eval 'as_val=${'$as_ac_var'}
-		 $as_echo "$as_val"'` = yes; then
+as_val=`eval 'as_val=${'$as_ac_var'}
+		 $as_echo "$as_val"'`
+   if test "x$as_val" = x""yes; then
   cat >>confdefs.h <<_ACEOF
 #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
@@ -32948,8 +33338,9 @@
 $as_echo "$ac_res" >&6; }
 
 fi
-if test `eval 'as_val=${'$as_ac_Header'}
-		 $as_echo "$as_val"'` = yes; then
+as_val=`eval 'as_val=${'$as_ac_Header'}
+		 $as_echo "$as_val"'`
+   if test "x$as_val" = x""yes; then
   cat >>confdefs.h <<_ACEOF
 #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
 _ACEOF
@@ -33029,7 +33420,7 @@
 fi
 { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_kstat_kstat_open" >&5
 $as_echo "$ac_cv_lib_kstat_kstat_open" >&6; }
-if test $ac_cv_lib_kstat_kstat_open = yes; then
+if test "x$ac_cv_lib_kstat_kstat_open" = x""yes; then
   cat >>confdefs.h <<_ACEOF
 #define HAVE_LIBKSTAT 1
 _ACEOF
@@ -33178,8 +33569,9 @@
 $as_echo "$ac_res" >&6; }
 
 fi
-if test `eval 'as_val=${'$as_ac_Header'}
-		 $as_echo "$as_val"'` = yes; then
+as_val=`eval 'as_val=${'$as_ac_Header'}
+		 $as_echo "$as_val"'`
+   if test "x$as_val" = x""yes; then
   cat >>confdefs.h <<_ACEOF
 #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
 _ACEOF
@@ -33255,7 +33647,7 @@
 fi
 { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_kvm_kvm_read" >&5
 $as_echo "$ac_cv_lib_kvm_kvm_read" >&6; }
-if test $ac_cv_lib_kvm_kvm_read = yes; then
+if test "x$ac_cv_lib_kvm_kvm_read" = x""yes; then
   cat >>confdefs.h <<_ACEOF
 #define HAVE_LIBKVM 1
 _ACEOF
@@ -33983,8 +34375,9 @@
 		 $as_echo "$as_val"'`
 	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
 $as_echo "$ac_res" >&6; }
-if test `eval 'as_val=${'$as_ac_var'}
-		 $as_echo "$as_val"'` = yes; then
+as_val=`eval 'as_val=${'$as_ac_var'}
+		 $as_echo "$as_val"'`
+   if test "x$as_val" = x""yes; then
 
 cat >>confdefs.h <<_ACEOF
 #define CRAY_STACKSEG_END $ac_func
@@ -34086,11 +34479,13 @@
 { $as_echo "$as_me:$LINENO: checking for working alloca in function calls" >&5
 $as_echo_n "checking for working alloca in function calls... " >&6; }
 if test "$cross_compiling" = yes; then
-  { { $as_echo "$as_me:$LINENO: error: cannot run test program while cross compiling
+  { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ { $as_echo "$as_me:$LINENO: error: cannot run test program while cross compiling
 See \`config.log' for more details." >&5
 $as_echo "$as_me: error: cannot run test program while cross compiling
 See \`config.log' for more details." >&2;}
-   { (exit 1); exit 1; }; }
+   { (exit 1); exit 1; }; }; }
 else
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -34196,11 +34591,13 @@
 { $as_echo "$as_me:$LINENO: checking for working scanf" >&5
 $as_echo_n "checking for working scanf... " >&6; }
 if test "$cross_compiling" = yes; then
-  { { $as_echo "$as_me:$LINENO: error: cannot run test program while cross compiling
+  { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ { $as_echo "$as_me:$LINENO: error: cannot run test program while cross compiling
 See \`config.log' for more details." >&5
 $as_echo "$as_me: error: cannot run test program while cross compiling
 See \`config.log' for more details." >&2;}
-   { (exit 1); exit 1; }; }
+   { (exit 1); exit 1; }; }; }
 else
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -34429,8 +34826,9 @@
 		 $as_echo "$as_val"'`
 	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
 $as_echo "$ac_res" >&6; }
-if test `eval 'as_val=${'$as_ac_var'}
-		 $as_echo "$as_val"'` = yes; then
+as_val=`eval 'as_val=${'$as_ac_var'}
+		 $as_echo "$as_val"'`
+   if test "x$as_val" = x""yes; then
   cat >>confdefs.h <<_ACEOF
 #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
@@ -34503,11 +34901,13 @@
 $as_echo_n "checking for working mmap... " >&6; }
 case "$opsys" in ultrix* ) have_mmap=no ;; *)
 if test "$cross_compiling" = yes; then
-  { { $as_echo "$as_me:$LINENO: error: cannot run test program while cross compiling
+  { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ { $as_echo "$as_me:$LINENO: error: cannot run test program while cross compiling
 See \`config.log' for more details." >&5
 $as_echo "$as_me: error: cannot run test program while cross compiling
 See \`config.log' for more details." >&2;}
-   { (exit 1); exit 1; }; }
+   { (exit 1); exit 1; }; }; }
 else
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -34788,7 +35188,7 @@
 $as_echo "$ac_cv_header_termios_h" >&6; }
 
 fi
-if test $ac_cv_header_termios_h = yes; then
+if test "x$ac_cv_header_termios_h" = x""yes; then
   cat >>confdefs.h <<\_ACEOF
 #define HAVE_TERMIOS 1
 _ACEOF
@@ -34934,7 +35334,7 @@
 $as_echo "$ac_cv_header_termio_h" >&6; }
 
 fi
-if test $ac_cv_header_termio_h = yes; then
+if test "x$ac_cv_header_termio_h" = x""yes; then
   cat >>confdefs.h <<\_ACEOF
 #define HAVE_TERMIO 1
 _ACEOF
@@ -35032,7 +35432,7 @@
 fi
 { $as_echo "$as_me:$LINENO: result: $ac_cv_func_socket" >&5
 $as_echo "$ac_cv_func_socket" >&6; }
-if test $ac_cv_func_socket = yes; then
+if test "x$ac_cv_func_socket" = x""yes; then
   if test "${ac_cv_header_netinet_in_h+set}" = set; then
   { $as_echo "$as_me:$LINENO: checking for netinet/in.h" >&5
 $as_echo_n "checking for netinet/in.h... " >&6; }
@@ -35165,7 +35565,7 @@
 $as_echo "$ac_cv_header_netinet_in_h" >&6; }
 
 fi
-if test $ac_cv_header_netinet_in_h = yes; then
+if test "x$ac_cv_header_netinet_in_h" = x""yes; then
   if test "${ac_cv_header_arpa_inet_h+set}" = set; then
   { $as_echo "$as_me:$LINENO: checking for arpa/inet.h" >&5
 $as_echo_n "checking for arpa/inet.h... " >&6; }
@@ -35298,7 +35698,7 @@
 $as_echo "$ac_cv_header_arpa_inet_h" >&6; }
 
 fi
-if test $ac_cv_header_arpa_inet_h = yes; then
+if test "x$ac_cv_header_arpa_inet_h" = x""yes; then
 
   cat >>confdefs.h <<\_ACEOF
 #define HAVE_SOCKETS 1
@@ -35513,7 +35913,7 @@
 fi
 { $as_echo "$as_me:$LINENO: result: $ac_cv_func_msgget" >&5
 $as_echo "$ac_cv_func_msgget" >&6; }
-if test $ac_cv_func_msgget = yes; then
+if test "x$ac_cv_func_msgget" = x""yes; then
   if test "${ac_cv_header_sys_ipc_h+set}" = set; then
   { $as_echo "$as_me:$LINENO: checking for sys/ipc.h" >&5
 $as_echo_n "checking for sys/ipc.h... " >&6; }
@@ -35646,7 +36046,7 @@
 $as_echo "$ac_cv_header_sys_ipc_h" >&6; }
 
 fi
-if test $ac_cv_header_sys_ipc_h = yes; then
+if test "x$ac_cv_header_sys_ipc_h" = x""yes; then
   if test "${ac_cv_header_sys_msg_h+set}" = set; then
   { $as_echo "$as_me:$LINENO: checking for sys/msg.h" >&5
 $as_echo_n "checking for sys/msg.h... " >&6; }
@@ -35779,7 +36179,7 @@
 $as_echo "$ac_cv_header_sys_msg_h" >&6; }
 
 fi
-if test $ac_cv_header_sys_msg_h = yes; then
+if test "x$ac_cv_header_sys_msg_h" = x""yes; then
   cat >>confdefs.h <<\_ACEOF
 #define HAVE_SYSVIPC 1
 _ACEOF
@@ -35925,7 +36325,7 @@
 $as_echo "$ac_cv_header_dirent_h" >&6; }
 
 fi
-if test $ac_cv_header_dirent_h = yes; then
+if test "x$ac_cv_header_dirent_h" = x""yes; then
   cat >>confdefs.h <<\_ACEOF
 #define SYSV_SYSTEM_DIR 1
 _ACEOF
@@ -36063,7 +36463,7 @@
 $as_echo "$ac_cv_header_sys_dir_h" >&6; }
 
 fi
-if test $ac_cv_header_sys_dir_h = yes; then
+if test "x$ac_cv_header_sys_dir_h" = x""yes; then
   :
 else
   cat >>confdefs.h <<\_ACEOF
@@ -36209,7 +36609,7 @@
 $as_echo "$ac_cv_header_nlist_h" >&6; }
 
 fi
-if test $ac_cv_header_nlist_h = yes; then
+if test "x$ac_cv_header_nlist_h" = x""yes; then
   cat >>confdefs.h <<\_ACEOF
 #define NLIST_STRUCT 1
 _ACEOF
@@ -36359,7 +36759,7 @@
 $as_echo "$ac_cv_header_multimedia_audio_device_h" >&6; }
 
 fi
-if test $ac_cv_header_multimedia_audio_device_h = yes; then
+if test "x$ac_cv_header_multimedia_audio_device_h" = x""yes; then
   sound_found=yes sound_cflags=""
       extra_objs="$extra_objs sunplay.o" &&  if test "$verbose" = "yes"; then
    echo "    xemacs will be linked with \"sunplay.o\""
@@ -36463,7 +36863,7 @@
 fi
 { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_audio_ALopenport" >&5
 $as_echo "$ac_cv_lib_audio_ALopenport" >&6; }
-if test $ac_cv_lib_audio_ALopenport = yes; then
+if test "x$ac_cv_lib_audio_ALopenport" = x""yes; then
   with_native_sound_lib="-laudio"
 fi
 
@@ -36541,7 +36941,7 @@
 fi
 { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_Alib_AOpenAudio" >&5
 $as_echo "$ac_cv_lib_Alib_AOpenAudio" >&6; }
-if test $ac_cv_lib_Alib_AOpenAudio = yes; then
+if test "x$ac_cv_lib_Alib_AOpenAudio" = x""yes; then
   with_native_sound_lib="-lAlib"
 fi
 
@@ -36709,8 +37109,9 @@
 $as_echo "$ac_res" >&6; }
 
 fi
-if test `eval 'as_val=${'$as_ac_Header'}
-		 $as_echo "$as_val"'` = yes; then
+as_val=`eval 'as_val=${'$as_ac_Header'}
+		 $as_echo "$as_val"'`
+   if test "x$as_val" = x""yes; then
 
         sound_found=yes
         case "${ac_cv_build}" in
@@ -36784,7 +37185,7 @@
 fi
 { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_ossaudio__oss_ioctl" >&5
 $as_echo "$ac_cv_lib_ossaudio__oss_ioctl" >&6; }
-if test $ac_cv_lib_ossaudio__oss_ioctl = yes; then
+if test "x$ac_cv_lib_ossaudio__oss_ioctl" = x""yes; then
   with_native_sound_lib=-lossaudio
 		 { $as_echo "$as_me:$LINENO: WARNING: Using NetBSD-deprecated -lossaudio" >&5
 $as_echo "$as_me: WARNING: Using NetBSD-deprecated -lossaudio" >&2;}
@@ -36964,7 +37365,7 @@
 $as_echo "$ac_cv_header_alsa_input_h" >&6; }
 
 fi
-if test $ac_cv_header_alsa_input_h = yes; then
+if test "x$ac_cv_header_alsa_input_h" = x""yes; then
 
     { $as_echo "$as_me:$LINENO: checking for snd_pcm_open in -lasound" >&5
 $as_echo_n "checking for snd_pcm_open in -lasound... " >&6; }
@@ -37031,7 +37432,7 @@
 fi
 { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_asound_snd_pcm_open" >&5
 $as_echo "$ac_cv_lib_asound_snd_pcm_open" >&6; }
-if test $ac_cv_lib_asound_snd_pcm_open = yes; then
+if test "x$ac_cv_lib_asound_snd_pcm_open" = x""yes; then
   have_alsa_sound=yes
 fi
 
@@ -37188,7 +37589,7 @@
 $as_echo "$ac_cv_header_audio_audiolib_h" >&6; }
 
 fi
-if test $ac_cv_header_audio_audiolib_h = yes; then
+if test "x$ac_cv_header_audio_audiolib_h" = x""yes; then
 
     { $as_echo "$as_me:$LINENO: checking for AuOpenServer in -laudio" >&5
 $as_echo_n "checking for AuOpenServer in -laudio... " >&6; }
@@ -37255,7 +37656,7 @@
 fi
 { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_audio_AuOpenServer" >&5
 $as_echo "$ac_cv_lib_audio_AuOpenServer" >&6; }
-if test $ac_cv_lib_audio_AuOpenServer = yes; then
+if test "x$ac_cv_lib_audio_AuOpenServer" = x""yes; then
   have_nas_sound=yes
 fi
 
@@ -37427,7 +37828,7 @@
 fi
 { $as_echo "$as_me:$LINENO: result: $ac_cv_func_esd_play_stream" >&5
 $as_echo "$ac_cv_func_esd_play_stream" >&6; }
-if test $ac_cv_func_esd_play_stream = yes; then
+if test "x$ac_cv_func_esd_play_stream" = x""yes; then
   have_esd_sound=yes
 else
   c_switch_site="$save_c_switch_site" LIBS="$save_LIBS"
@@ -37535,7 +37936,7 @@
 fi
 { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_ncurses_tgetent" >&5
 $as_echo "$ac_cv_lib_ncurses_tgetent" >&6; }
-if test $ac_cv_lib_ncurses_tgetent = yes; then
+if test "x$ac_cv_lib_ncurses_tgetent" = x""yes; then
   with_ncurses=yes
 else
   with_ncurses=no
@@ -37679,7 +38080,7 @@
 $as_echo "$ac_cv_header_ncurses_curses_h" >&6; }
 
 fi
-if test $ac_cv_header_ncurses_curses_h = yes; then
+if test "x$ac_cv_header_ncurses_curses_h" = x""yes; then
   curses_h_file=ncurses/curses.h
 fi
 
@@ -37816,7 +38217,7 @@
 $as_echo "$ac_cv_header_ncurses_term_h" >&6; }
 
 fi
-if test $ac_cv_header_ncurses_term_h = yes; then
+if test "x$ac_cv_header_ncurses_term_h" = x""yes; then
   term_h_file=ncurses/term.h
 fi
 
@@ -37961,7 +38362,7 @@
 $as_echo "$ac_cv_header_ncurses_curses_h" >&6; }
 
 fi
-if test $ac_cv_header_ncurses_curses_h = yes; then
+if test "x$ac_cv_header_ncurses_curses_h" = x""yes; then
   curses_h_file=ncurses/curses.h
 fi
 
@@ -38048,8 +38449,9 @@
 		 $as_echo "$as_val"'`
 	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
 $as_echo "$ac_res" >&6; }
-if test `eval 'as_val=${'$as_ac_Lib'}
-		 $as_echo "$as_val"'` = yes; then
+as_val=`eval 'as_val=${'$as_ac_Lib'}
+		 $as_echo "$as_val"'`
+   if test "x$as_val" = x""yes; then
   LIBS="-l${lib} $LIBS" &&  if test "$verbose" = "yes"; then echo "    Prepending \"-l${lib}\" to \$LIBS"; fi; break
 fi
 
@@ -38127,7 +38529,7 @@
 fi
 { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_curses_tgetent" >&5
 $as_echo "$ac_cv_lib_curses_tgetent" >&6; }
-if test $ac_cv_lib_curses_tgetent = yes; then
+if test "x$ac_cv_lib_curses_tgetent" = x""yes; then
   LIBS="-lcurses $LIBS" &&  if test "$verbose" = "yes"; then echo "    Prepending \"-lcurses\" to \$LIBS"; fi
 else
   { $as_echo "$as_me:$LINENO: checking for tgetent in -ltermcap" >&5
@@ -38195,7 +38597,7 @@
 fi
 { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_termcap_tgetent" >&5
 $as_echo "$ac_cv_lib_termcap_tgetent" >&6; }
-if test $ac_cv_lib_termcap_tgetent = yes; then
+if test "x$ac_cv_lib_termcap_tgetent" = x""yes; then
   LIBS="-ltermcap $LIBS" &&  if test "$verbose" = "yes"; then echo "    Prepending \"-ltermcap\" to \$LIBS"; fi
 else
   extra_objs="$extra_objs termcap.o" &&  if test "$verbose" = "yes"; then
@@ -38350,7 +38752,7 @@
 $as_echo "$ac_cv_header_gpm_h" >&6; }
 
 fi
-if test $ac_cv_header_gpm_h = yes; then
+if test "x$ac_cv_header_gpm_h" = x""yes; then
 
       { $as_echo "$as_me:$LINENO: checking for Gpm_Open in -lgpm" >&5
 $as_echo_n "checking for Gpm_Open in -lgpm... " >&6; }
@@ -38417,7 +38819,7 @@
 fi
 { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_gpm_Gpm_Open" >&5
 $as_echo "$ac_cv_lib_gpm_Gpm_Open" >&6; }
-if test $ac_cv_lib_gpm_Gpm_Open = yes; then
+if test "x$ac_cv_lib_gpm_Gpm_Open" = x""yes; then
   have_gpm=yes
 fi
 
@@ -38586,7 +38988,7 @@
 $as_echo "$ac_cv_header_ndbm_h" >&6; }
 
 fi
-if test $ac_cv_header_ndbm_h = yes; then
+if test "x$ac_cv_header_ndbm_h" = x""yes; then
   :
 else
 
@@ -38665,7 +39067,7 @@
 fi
 { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_gdbm_dbm_open" >&5
 $as_echo "$ac_cv_lib_gdbm_dbm_open" >&6; }
-if test $ac_cv_lib_gdbm_dbm_open = yes; then
+if test "x$ac_cv_lib_gdbm_dbm_open" = x""yes; then
 
    enable_database_gdbm=yes enable_database_dbm=no libdbm=-lgdbm
 else
@@ -38735,7 +39137,7 @@
 fi
 { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_gdbm_compat_dbm_open" >&5
 $as_echo "$ac_cv_lib_gdbm_compat_dbm_open" >&6; }
-if test $ac_cv_lib_gdbm_compat_dbm_open = yes; then
+if test "x$ac_cv_lib_gdbm_compat_dbm_open" = x""yes; then
 
        enable_database_gdbm=yes enable_database_dbm=no libdbm="-lgdbm_compat -lgdbm"
 else
@@ -38837,7 +39239,7 @@
 fi
 { $as_echo "$as_me:$LINENO: result: $ac_cv_func_dbm_open" >&5
 $as_echo "$ac_cv_func_dbm_open" >&6; }
-if test $ac_cv_func_dbm_open = yes; then
+if test "x$ac_cv_func_dbm_open" = x""yes; then
   enable_database_dbm=yes libdbm=
 else
 
@@ -38906,7 +39308,7 @@
 fi
 { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_dbm_dbm_open" >&5
 $as_echo "$ac_cv_lib_dbm_dbm_open" >&6; }
-if test $ac_cv_lib_dbm_dbm_open = yes; then
+if test "x$ac_cv_lib_dbm_dbm_open" = x""yes; then
   enable_database_dbm=yes libdbm=-ldbm
 else
 
@@ -39021,7 +39423,7 @@
 fi
 { $as_echo "$as_me:$LINENO: result: $ac_cv_type_u_int8_t" >&5
 $as_echo "$ac_cv_type_u_int8_t" >&6; }
-if test $ac_cv_type_u_int8_t = yes; then
+if test "x$ac_cv_type_u_int8_t" = x""yes; then
 
 cat >>confdefs.h <<_ACEOF
 #define HAVE_U_INT8_T 1
@@ -39123,7 +39525,7 @@
 fi
 { $as_echo "$as_me:$LINENO: result: $ac_cv_type_u_int16_t" >&5
 $as_echo "$ac_cv_type_u_int16_t" >&6; }
-if test $ac_cv_type_u_int16_t = yes; then
+if test "x$ac_cv_type_u_int16_t" = x""yes; then
 
 cat >>confdefs.h <<_ACEOF
 #define HAVE_U_INT16_T 1
@@ -39225,7 +39627,7 @@
 fi
 { $as_echo "$as_me:$LINENO: result: $ac_cv_type_u_int32_t" >&5
 $as_echo "$ac_cv_type_u_int32_t" >&6; }
-if test $ac_cv_type_u_int32_t = yes; then
+if test "x$ac_cv_type_u_int32_t" = x""yes; then
 
 cat >>confdefs.h <<_ACEOF
 #define HAVE_U_INT32_T 1
@@ -39461,8 +39863,9 @@
 		 $as_echo "$as_val"'`
 	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
 $as_echo "$ac_res" >&6; }
-if test `eval 'as_val=${'$as_ac_var'}
-		 $as_echo "$as_val"'` = yes; then
+as_val=`eval 'as_val=${'$as_ac_var'}
+		 $as_echo "$as_val"'`
+   if test "x$as_val" = x""yes; then
   enable_database_berkdb=yes need_libdb=no
 else
 
@@ -39534,8 +39937,9 @@
 		 $as_echo "$as_val"'`
 	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
 $as_echo "$ac_res" >&6; }
-if test `eval 'as_val=${'$as_ac_Lib'}
-		 $as_echo "$as_val"'` = yes; then
+as_val=`eval 'as_val=${'$as_ac_Lib'}
+		 $as_echo "$as_val"'`
+   if test "x$as_val" = x""yes; then
   enable_database_berkdb=yes need_libdb=yes
 fi
 
@@ -39620,8 +40024,9 @@
 		 $as_echo "$as_val"'`
 	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
 $as_echo "$ac_res" >&6; }
-if test `eval 'as_val=${'$as_ac_Lib'}
-		 $as_echo "$as_val"'` = yes; then
+as_val=`eval 'as_val=${'$as_ac_Lib'}
+		 $as_echo "$as_val"'`
+   if test "x$as_val" = x""yes; then
   enable_database_berkdb=yes need_libdb=yes
 fi
 
@@ -39716,7 +40121,7 @@
 fi
 { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_socks_SOCKSinit" >&5
 $as_echo "$ac_cv_lib_socks_SOCKSinit" >&6; }
-if test $ac_cv_lib_socks_SOCKSinit = yes; then
+if test "x$ac_cv_lib_socks_SOCKSinit" = x""yes; then
   cat >>confdefs.h <<_ACEOF
 #define HAVE_LIBSOCKS 1
 _ACEOF
@@ -39872,7 +40277,7 @@
 $as_echo "$ac_cv_header_gmp_h" >&6; }
 
 fi
-if test $ac_cv_header_gmp_h = yes; then
+if test "x$ac_cv_header_gmp_h" = x""yes; then
 
     { $as_echo "$as_me:$LINENO: checking for __gmpz_init in -lgmp" >&5
 $as_echo_n "checking for __gmpz_init in -lgmp... " >&6; }
@@ -39939,7 +40344,7 @@
 fi
 { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_gmp___gmpz_init" >&5
 $as_echo "$ac_cv_lib_gmp___gmpz_init" >&6; }
-if test $ac_cv_lib_gmp___gmpz_init = yes; then
+if test "x$ac_cv_lib_gmp___gmpz_init" = x""yes; then
   have_mpz_init=yes
 fi
 
@@ -40093,7 +40498,7 @@
 $as_echo "$ac_cv_header_mp_h" >&6; }
 
 fi
-if test $ac_cv_header_mp_h = yes; then
+if test "x$ac_cv_header_mp_h" = x""yes; then
 
       { $as_echo "$as_me:$LINENO: checking for mp_mfree in -lmp" >&5
 $as_echo_n "checking for mp_mfree in -lmp... " >&6; }
@@ -40160,7 +40565,7 @@
 fi
 { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_mp_mp_mfree" >&5
 $as_echo "$ac_cv_lib_mp_mp_mfree" >&6; }
-if test $ac_cv_lib_mp_mp_mfree = yes; then
+if test "x$ac_cv_lib_mp_mp_mfree" = x""yes; then
   have_mp_mfree=yes; break
 else
 
@@ -40229,7 +40634,7 @@
 fi
 { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_mp_mfree" >&5
 $as_echo "$ac_cv_lib_mp_mfree" >&6; }
-if test $ac_cv_lib_mp_mfree = yes; then
+if test "x$ac_cv_lib_mp_mfree" = x""yes; then
   have_mfree=yes; break
 fi
 
@@ -40333,7 +40738,7 @@
 fi
 { $as_echo "$as_me:$LINENO: result: $ac_cv_func_mp_move" >&5
 $as_echo "$ac_cv_func_mp_move" >&6; }
-if test $ac_cv_func_mp_move = yes; then
+if test "x$ac_cv_func_mp_move" = x""yes; then
   cat >>confdefs.h <<\_ACEOF
 #define HAVE_MP_MOVE 1
 _ACEOF
@@ -40430,7 +40835,7 @@
 fi
 { $as_echo "$as_me:$LINENO: result: $ac_cv_func_move" >&5
 $as_echo "$ac_cv_func_move" >&6; }
-if test $ac_cv_func_move = yes; then
+if test "x$ac_cv_func_move" = x""yes; then
   cat >>confdefs.h <<\_ACEOF
 #define HAVE_MP_MOVE 1
 _ACEOF
@@ -40451,11 +40856,13 @@
 fi
 
 if test "$cross_compiling" = yes; then
-  { { $as_echo "$as_me:$LINENO: error: cannot run test program while cross compiling
+  { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ { $as_echo "$as_me:$LINENO: error: cannot run test program while cross compiling
 See \`config.log' for more details." >&5
 $as_echo "$as_me: error: cannot run test program while cross compiling
 See \`config.log' for more details." >&2;}
-   { (exit 1); exit 1; }; }
+   { (exit 1); exit 1; }; }; }
 else
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -41209,7 +41616,7 @@
 
 echo "
 Images:"
-test "$with_gif" = yes && echo "  Compiling in support for GIF  images (builtin)."
+test "$with_gif" = yes && echo "  Compiling in support for GIF images."
 if test "$with_xpm" = yes; then
   echo "  Compiling in support for XPM  images."
 elif test "$with_x11" = yes; then
@@ -41406,8 +41813,8 @@
     case $ac_val in #(
     *${as_nl}*)
       case $ac_var in #(
-      *_cv_*) { $as_echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5
-$as_echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;;
+      *_cv_*) { $as_echo "$as_me:$LINENO: WARNING: cache variable $ac_var contains a newline" >&5
+$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
       esac
       case $ac_var in #(
       _ | IFS | as_nl) ;; #(
@@ -41477,6 +41884,7 @@
 
 
 
+
 : ${CONFIG_STATUS=./config.status}
 ac_write_fail=0
 ac_clean_files_save=$ac_clean_files
@@ -41799,7 +42207,7 @@
 # values after options handling.
 ac_log="
 This file was extended by XEmacs $as_me 21.5, which was
-generated by GNU Autoconf 2.62.  Invocation command line was
+generated by GNU Autoconf 2.63.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
   CONFIG_HEADERS  = $CONFIG_HEADERS
@@ -41812,6 +42220,15 @@
 
 _ACEOF
 
+case $ac_config_files in *"
+"*) set x $ac_config_files; shift; ac_config_files=$*;;
+esac
+
+case $ac_config_headers in *"
+"*) set x $ac_config_headers; shift; ac_config_headers=$*;;
+esac
+
+
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 # Files that config.status was made for.
 config_files="$ac_config_files"
@@ -41825,16 +42242,17 @@
 \`$as_me' instantiates files from templates according to the
 current configuration.
 
-Usage: $0 [OPTIONS] [FILE]...
+Usage: $0 [OPTION]... [FILE]...
 
   -h, --help       print this help, then exit
   -V, --version    print version number and configuration settings, then exit
-  -q, --quiet      do not print progress messages
+  -q, --quiet, --silent
+                   do not print progress messages
   -d, --debug      don't remove temporary files
       --recheck    update $as_me by reconfiguring in the same conditions
-  --file=FILE[:TEMPLATE]
+      --file=FILE[:TEMPLATE]
                    instantiate the configuration file FILE
-  --header=FILE[:TEMPLATE]
+      --header=FILE[:TEMPLATE]
                    instantiate the configuration header FILE
 
 Configuration files:
@@ -41852,7 +42270,7 @@
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 ac_cs_version="\\
 XEmacs config.status 21.5
-configured by $0, generated by GNU Autoconf 2.62,
+configured by $0, generated by GNU Autoconf 2.63,
   with options \\"`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\"
 
 Copyright (C) 2008 Free Software Foundation, Inc.
@@ -42063,7 +42481,8 @@
 $as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;}
    { (exit 1); exit 1; }; }
 
-  if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` = $ac_delim_num; then
+  ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X`
+  if test $ac_delim_n = $ac_delim_num; then
     break
   elif $ac_last_try; then
     { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
@@ -42268,9 +42687,9 @@
   }
   split(mac1, mac2, "(") #)
   macro = mac2[1]
+  prefix = substr(line, 1, index(line, defundef) - 1)
   if (D_is_set[macro]) {
     # Preserve the white space surrounding the "#".
-    prefix = substr(line, 1, index(line, defundef) - 1)
     print prefix "define", macro P[macro] D[macro]
     next
   } else {
@@ -42278,7 +42697,7 @@
     # in the case of _POSIX_SOURCE, which is predefined and required
     # on some systems where configure will not decide to define it.
     if (defundef == "undef") {
-      print "/*", line, "*/"
+      print "/*", prefix defundef, macro, "*/"
       next
     }
   }
@@ -42302,8 +42721,8 @@
   esac
   case $ac_mode$ac_tag in
   :[FHL]*:*);;
-  :L* | :C*:*) { { $as_echo "$as_me:$LINENO: error: Invalid tag $ac_tag." >&5
-$as_echo "$as_me: error: Invalid tag $ac_tag." >&2;}
+  :L* | :C*:*) { { $as_echo "$as_me:$LINENO: error: invalid tag $ac_tag" >&5
+$as_echo "$as_me: error: invalid tag $ac_tag" >&2;}
    { (exit 1); exit 1; }; };;
   :[FH]-) ac_tag=-:-;;
   :[FH]*) ac_tag=$ac_tag:$ac_tag.in;;
@@ -42778,7 +43197,7 @@
   $ac_cs_success || { (exit 1); exit 1; }
 fi
 if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then
-  { $as_echo "$as_me:$LINENO: WARNING: Unrecognized options: $ac_unrecognized_opts" >&5
-$as_echo "$as_me: WARNING: Unrecognized options: $ac_unrecognized_opts" >&2;}
-fi
-
+  { $as_echo "$as_me:$LINENO: WARNING: unrecognized options: $ac_unrecognized_opts" >&5
+$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;}
+fi
+
diff -r 0cc9d22c3732 configure.ac
--- a/configure.ac	Thu Aug 27 15:18:51 2009 +0100
+++ b/configure.ac	Fri Aug 28 11:24:47 2009 -0600
@@ -802,7 +802,7 @@
                         Requires the compface package.]),
 	[], [])
 XE_MERGED_ARG([gif],
-	AS_HELP_STRING([--with-gif],[Compile without the (builtin) support for GIF images.]),
+	AS_HELP_STRING([--with-gif],[Compile with support for GIF images.]),
 	[], [])
 dnl
 XE_HELP_SUBSECTION([Sound options])
@@ -4124,11 +4124,18 @@
     XE_PREPEND(-lcompface, libs_x)
   fi
 
-  dnl For a brief period we had the GIF code split out into a separate library,
-  dnl but patent problems, etc. sort of squashed that idea.
-  dnl We default to building with builtin GIF decoding
+  dnl autodetect GIF
+  test -z "$with_gif" && { AC_CHECK_HEADER(gif_lib.h, , with_gif=no) }
   if test "$with_gif" != "no"; then
-    with_gif="yes"
+    dnl Versions of libgif and libungif prior to the introduction of
+    dnl EGifPutExtensionLast caused Emacs crashes.  We'll require that
+    dnl function, too, in hopes that we can avoid similar crashes.
+    AC_CHECK_LIB(gif, EGifPutExtensionLast,
+      [XE_PREPEND(-lgif, libs_x)],
+      [AC_CHECK_LIB(ungif, EGifPutExtensionLast,
+        [XE_PREPEND(-lungif, libs_x)], with_gif=no)])
+  fi
+  if test "$with_gif" != "no"; then
     AC_DEFINE(HAVE_GIF)
   fi
 
@@ -6096,7 +6103,7 @@
 
 echo "
 Images:"
-test "$with_gif" = yes && echo "  Compiling in support for GIF  images (builtin)."
+test "$with_gif" = yes && echo "  Compiling in support for GIF images."
 if test "$with_xpm" = yes; then
   echo "  Compiling in support for XPM  images."
 elif test "$with_x11" = yes; then
diff -r 0cc9d22c3732 lisp/ChangeLog
--- a/lisp/ChangeLog	Thu Aug 27 15:18:51 2009 +0100
+++ b/lisp/ChangeLog	Fri Aug 28 11:24:47 2009 -0600
@@ -1,3 +1,8 @@
+2009-08-28  Jerry James  <james@xemacs.org>
+
+	* glyphs.el (make-image-specifier): Remove ancient comment about
+	lack of support for animated GIFs.
+
 2009-08-27  Aidan Kehoe  <kehoea@parhasard.net>
 
 	* cl.el (bytecomp-load-hook): New.
diff -r 0cc9d22c3732 lisp/glyphs.el
--- a/lisp/glyphs.el	Thu Aug 27 15:18:51 2009 +0100
+++ b/lisp/glyphs.el	Fri Aug 28 11:24:47 2009 -0600
@@ -81,8 +81,7 @@
    Not currently implemented -- it's treated like `string'.
    [:data] (text)
 `gif'
-   A GIF87 or GIF89 image; only if GIF support was compiled into this
-   XEmacs.  NOTE: Only the first frame of animated gifs will be displayed.
+   A GIF87 or GIF89 image; only if GIF support was compiled into this XEmacs.
    [:data, :file] (color-pixmap, pointer)
 `jpeg'
    A JPEG image; only if JPEG support was compiled into this XEmacs.
@@ -1240,4 +1239,4 @@
 (unintern 'init-glyphs) ;; This was dump time thing, no need to keep the
 			;; function around.
 
-;;; glyphs.el ends here.
\ No newline at end of file
+;;; glyphs.el ends here.
diff -r 0cc9d22c3732 man/ChangeLog
--- a/man/ChangeLog	Thu Aug 27 15:18:51 2009 +0100
+++ b/man/ChangeLog	Fri Aug 28 11:24:47 2009 -0600
@@ -1,3 +1,14 @@
+2009-08-28  Jerry James  <james@xemacs.org>
+
+	* beta.texi (Building XEmacs from a full distribution): Remove
+	"(builtin)" from GIF line in example Installation.
+	(Reporting Problems): Recommend taking screenshots as a PNG
+	instead of a GIF.
+	* internals/internals.texi (A Summary of the Various XEmacs Modules):
+	Remove GIF-related files.
+	* lispref/glyphs.texi (Image Instantiator Formats): Remove remark
+	about builtin GIF support.
+
 2009-08-11  Aidan Kehoe  <kehoea@parhasard.net>
 
 	* lispref/numbers.texi (Bigfloat Basics): 
diff -r 0cc9d22c3732 man/beta.texi
--- a/man/beta.texi	Thu Aug 27 15:18:51 2009 +0100
+++ b/man/beta.texi	Fri Aug 28 11:24:47 2009 -0600
@@ -479,7 +479,7 @@
   Compiling in support for ncurses.
 
 Images:
-  Compiling in support for GIF  images (builtin).
+  Compiling in support for GIF  images.
   Compiling in support for XPM  images.
   Compiling in support for PNG  images.
   Compiling in support for JPEG images.
@@ -733,7 +733,7 @@
 unusual display, it is generally best to capture the problem in a
 screen dump and include that with the problem report.  The easiest
 way to get a screen dump is to use the xv program and its grab
-function.  Save the image as a GIF to keep bandwidth requirements
+function.  Save the image as a PNG to keep bandwidth requirements
 down without loss of information.  MIME is the preferred method
 for making the image attachments.
 @end enumerate
diff -r 0cc9d22c3732 man/internals/internals.texi
--- a/man/internals/internals.texi	Thu Aug 27 15:18:51 2009 +0100
+++ b/man/internals/internals.texi	Fri Aug 28 11:24:47 2009 -0600
@@ -2920,7 +2920,6 @@
 @item @file{device.c} @tab @ref{Modules for the Basic Displayable Lisp Objects}.
 @item @file{device.h} @tab @ref{Modules for the Basic Displayable Lisp Objects}.
 @item @file{devslots.h} @tab
-@item @file{dgif_lib.c} @tab @ref{Modules for other Display-Related Lisp Objects}.
 @item @file{dialog-gtk.c} @tab
 @item @file{dialog-msw.c} @tab
 @item @file{dialog-x.c} @tab
@@ -2994,11 +2993,6 @@
 @item @file{general.c} @tab @ref{Basic Lisp Modules}.
 @item @file{getloadavg.c} @tab @ref{Modules for Interfacing with the Operating System}.
 @item @file{getpagesize.h} @tab @ref{Low-Level Modules}.
-@item @file{gif_err.c} @tab @ref{Modules for other Display-Related Lisp Objects}.
-@item @file{gif_io.c} @tab
-@item @file{gif_lib.h} @tab @ref{Modules for other Display-Related Lisp Objects}.
-@item @file{gifalloc.c} @tab @ref{Modules for other Display-Related Lisp Objects}.
-@item @file{gifrlib.h} @tab
 @item @file{glade.c} @tab
 @item @file{glyphs-eimage.c} @tab @ref{Modules for other Display-Related Lisp Objects}.
 @item @file{glyphs-gtk.c} @tab
@@ -18470,17 +18464,6 @@
 
 
 
-@example
-@file{dgif_lib.c}
-@file{gif_err.c}
-@file{gif_lib.h}
-@file{gifalloc.c}
-@end example
-
-These modules decode GIF-format image files, for use with glyphs.
-These files were removed due to Unisys patent infringement concerns.
-
-
 @node Extents, Faces, The Redisplay Mechanism, Top
 @chapter Extents
 @cindex extents
diff -r 0cc9d22c3732 man/lispref/glyphs.texi
--- a/man/lispref/glyphs.texi	Thu Aug 27 15:18:51 2009 +0100
+++ b/man/lispref/glyphs.texi	Fri Aug 28 11:24:47 2009 -0600
@@ -515,13 +515,11 @@
 @itemx tiff
 These are GIF87- or GIF89-format, JPEG-format, PNG/GIF24-format, and
 TIFF-format images, respectively.  They are available only if
-appropriate decoding support was built into XEmacs.  XEmacs includes GIF
-decoding functions as a standard part of it, so if you have X support,
-you will normally have GIF support, unless you explicitly disable it at
-configure time.  If you have development support (both the libraries and
-the relevant C header files) available when XEmacs is built, the JPEG,
-PNG, and TIFF libraries will automatically be detected (in the ``usual
-places'') and linked into the build.
+appropriate decoding support was built into XEmacs.  If you have
+development support (both the libraries and the relevant C header files)
+available when XEmacs is built, the JPEG, PNG, GIF, and TIFF libraries
+will automatically be detected (in the ``usual places'') and linked into
+the build.
 
 Note that PNG is the standard format for images distributed with XEmacs,
 so it is highly recommended that PNG support be built in.
diff -r 0cc9d22c3732 nt/ChangeLog
--- a/nt/ChangeLog	Thu Aug 27 15:18:51 2009 +0100
+++ b/nt/ChangeLog	Fri Aug 28 11:24:47 2009 -0600
@@ -1,3 +1,10 @@
+2009-08-28  Jerry James  <james@xemacs.org>
+
+	* config.inc.samp: Add GIF_DIR for external GIF support.
+	* xemacs.mak: Convert from internal to external GIF support.
+	* xemacs.dsp: Drop internal GIF source files.
+	* README: Remove remark about internal GIF support.
+
 2009-05-18  Stephen J. Turnbull  <stephen@xemacs.org>
 
 	* XEmacs 21.5.29 "garbanzo" is released.
diff -r 0cc9d22c3732 nt/README
--- a/nt/README	Thu Aug 27 15:18:51 2009 +0100
+++ b/nt/README	Fri Aug 28 11:24:47 2009 -0600
@@ -236,8 +236,6 @@
        Similarly for JPEG, TIFF, etc. support.
 
        For PNG support, you also need to specify ZLIB_DIR.
-       For GIF support, no directory is necessary as the appropriate code
-       is already in XEmacs.
 
        If you want to use the DLL version of the Sleepycat DB library,
        set BUILD_DATABASE_SHARED to 1.  You will have to have the DLL
diff -r 0cc9d22c3732 nt/config.inc.samp
--- a/nt/config.inc.samp	Thu Aug 27 15:18:51 2009 +0100
+++ b/nt/config.inc.samp	Fri Aug 28 11:24:47 2009 -0600
@@ -45,8 +45,10 @@
 HAVE_XPM=1
 XPM_DIR=$(OPTIONAL_LIBRARY_DIR)\xpm-3.4k
 
-# Set this to enable GIF support (built-in).
+# Set this to enable GIF support, and specify the directory containing giflib.
+# Get the latest version from http://sourceforge.net/projects/giflib/.
 HAVE_GIF=1
+GIF_DIR=$(OPTIONAL_LIBRARY_DIR)\giflib-4.1.6
 
 # Set this to enable PNG support (virtually mandatory), and specify the
 # directories containing png and zlib.  Get the latest version of PNG from
diff -r 0cc9d22c3732 nt/xemacs.dsp
--- a/nt/xemacs.dsp	Thu Aug 27 15:18:51 2009 +0100
+++ b/nt/xemacs.dsp	Fri Aug 28 11:24:47 2009 -0600
@@ -271,10 +271,6 @@
 # End Source File
 # Begin Source File
 
-SOURCE=..\src\dgif_lib.c
-# End Source File
-# Begin Source File
-
 SOURCE="..\src\dialog-msw.c"
 # End Source File
 # Begin Source File
@@ -575,14 +571,6 @@
 # End Source File
 # Begin Source File
 
-SOURCE=..\src\gif_io.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\src\gifrlib.h
-# End Source File
-# Begin Source File
-
 SOURCE="..\src\glyphs-eimage.c"
 # End Source File
 # Begin Source File
diff -r 0cc9d22c3732 nt/xemacs.mak
--- a/nt/xemacs.mak	Thu Aug 27 15:18:51 2009 +0100
+++ b/nt/xemacs.mak	Fri Aug 28 11:24:47 2009 -0600
@@ -142,7 +142,7 @@
 HAVE_XFACE=0
 !endif
 !if !defined(HAVE_GIF)
-HAVE_GIF=1
+HAVE_GIF=0
 !endif
 !if !defined(HAVE_GTK)
 HAVE_GTK=0
@@ -548,7 +548,8 @@
 !endif
 !if $(HAVE_GIF)
 OPT_DEFINES=$(OPT_DEFINES) -DHAVE_GIF
-OPT_OBJS=$(OPT_OBJS) $(OUTDIR)\dgif_lib.obj $(OUTDIR)\gif_io.obj
+OPT_INCLUDES=$(OPT_INCLUDES) -I"$(GIF_DIR)\lib"
+OPT_LIBS=$(OPT_LIBS) "$(GIF_DIR)\lib\libgif.lib"
 !endif
 !if $(HAVE_PNG)
 OPT_DEFINES=$(OPT_DEFINES) -DHAVE_PNG
diff -r 0cc9d22c3732 src/ChangeLog
--- a/src/ChangeLog	Thu Aug 27 15:18:51 2009 +0100
+++ b/src/ChangeLog	Fri Aug 28 11:24:47 2009 -0600
@@ -1,3 +1,21 @@
+2009-08-28  Jerry James  <james@xemacs.org>
+
+	* Makefile.in.in: Remove internal GIF object files from link.
+	* dgif_lib.c: Removed.
+	* gif_io.c: Removed.
+	* gifrlib.h: Removed.
+	* glyphs-eimage.c: Use external giflib instead of internal GIF
+	support.
+	(gif_instantiate_unwind): Use giflib's FreeSavedImages call
+	instead of the defunct GifFree.
+	(gif_read_from_memory): Adapt signature to giflib.
+	(gif_error_func): Removed.
+	(gif_memory_close): Removed.
+	(gif_decode_error_string): New function.
+	(gif_instantiate): Adapt to giflib API.
+	* libinterface.h: Include external giflib header instead of
+	internal GIF header.
+
 2009-08-24  Jerry James  <james@xemacs.org>
 
 	* lisp.h (INT_64_BIT): define as __int64 on WIN32.
diff -r 0cc9d22c3732 src/Makefile.in.in
--- a/src/Makefile.in.in	Thu Aug 27 15:18:51 2009 +0100
+++ b/src/Makefile.in.in	Fri Aug 28 11:24:47 2009 -0600
@@ -183,10 +183,6 @@
 event_unixoid_objs=event-unixoid.o
 #endif
 
-#ifdef HAVE_GIF
-gif_objs=dgif_lib.o gif_io.o
-#endif
-
 #ifdef HAVE_GPM
 gpm_objs=gpmevent.o
 #endif
@@ -285,7 +281,7 @@
  event-stream.o $(event_unixoid_objs) $(extra_objs) extents.o\
  faces.o file-coding.o fileio.o $(LOCK_OBJ) filemode.o floatfns.o fns.o \
  font-lock.o frame.o\
- gc.o general.o $(gif_objs) glyphs.o glyphs-eimage.o glyphs-shared.o\
+ gc.o general.o glyphs.o glyphs-eimage.o glyphs-shared.o\
  glyphs-widget.o $(gpm_objs) $(gtk_objs) $(gtk_gui_objs) $(gui_objs) \
  gutter.o\
  hash.o imgproc.o indent.o insdel.o intl.o\
diff -r 0cc9d22c3732 src/depend
--- a/src/depend	Thu Aug 27 15:18:51 2009 +0100
+++ b/src/depend	Fri Aug 28 11:24:47 2009 -0600
@@ -123,7 +123,6 @@
 data.o: $(CONFIG_H) $(LISP_H) buffer.h bufslots.h bytecode.h casetab.h charset.h chartab.h compiler.h dumper.h gc.h general-slots.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h symeval.h symsinit.h sysfloat.h syssignal.h text.h vdb.h
 debug.o: $(CONFIG_H) $(LISP_H) bytecode.h compiler.h debug.h dumper.h gc.h general-slots.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h symeval.h symsinit.h text.h vdb.h
 device.o: $(CONFIG_H) $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h compiler.h conslots.h console-impl.h console.h device-impl.h device.h devslots.h dumper.h elhash.h events.h faces.h frame-impl.h frame.h frameslots.h gc.h general-slots.h keymap.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h objects.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h sysdep.h syssignal.h systime.h text.h toolbar.h vdb.h window.h
-dgif_lib.o: $(CONFIG_H) $(LISP_H) compiler.h dumper.h gc.h general-slots.h gifrlib.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h symeval.h symsinit.h sysfile.h text.h vdb.h
 dialog.o: $(CONFIG_H) $(LISP_H) compiler.h conslots.h console-impl.h console.h dumper.h frame-impl.h frame.h frameslots.h gc.h general-slots.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h redisplay.h specifier.h symeval.h symsinit.h text.h vdb.h
 dired.o: $(CONFIG_H) $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h commands.h compiler.h dumper.h elhash.h gc.h general-slots.h intl-auto-encap-win32.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h ndir.h number-gmp.h number-mp.h number.h opaque.h regex.h symeval.h symsinit.h syntax.h sysdep.h sysdir.h sysfile.h syspwd.h systime.h syswindows.h text.h vdb.h
 doc.o: $(CONFIG_H) $(LISP_H) buffer.h bufslots.h bytecode.h casetab.h charset.h chartab.h coding-system-slots.h compiler.h dumper.h file-coding.h gc.h general-slots.h insdel.h keymap.h lisp-disunion.h lisp-union.h lisp.h lrecord.h lstream.h mc-alloc.h number-gmp.h number-mp.h number.h symeval.h symsinit.h sysfile.h text.h vdb.h
@@ -158,8 +157,7 @@
 gc.o: $(CONFIG_H) $(LISP_H) backtrace.h buffer.h bufslots.h bytecode.h casetab.h charset.h chartab.h coding-system-slots.h compiler.h conslots.h console-impl.h console-stream.h console.h device.h dumper.h elhash.h events.h extents-impl.h extents.h file-coding.h frame-impl.h frame.h frameslots.h gc.h general-slots.h glyphs.h lisp-disunion.h lisp-union.h lisp.h lrecord.h lstream.h mc-alloc.h number-gmp.h number-mp.h number.h opaque.h process.h profile.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h sysdep.h sysfile.h systime.h text.h vdb.h window-impl.h window.h winslots.h
 general.o: $(CONFIG_H) $(LISP_H) compiler.h dumper.h gc.h general-slots.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h symeval.h symsinit.h text.h vdb.h
 getloadavg.o: $(CONFIG_H) $(LISP_H) compiler.h dumper.h gc.h general-slots.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h symeval.h symsinit.h sysfile.h syssignal.h text.h vdb.h
-gif_io.o: $(CONFIG_H) $(LISP_H) compiler.h dumper.h gc.h general-slots.h gifrlib.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h symeval.h symsinit.h sysfile.h text.h vdb.h
-glyphs-eimage.o: $(CONFIG_H) $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h coding-system-slots.h compiler.h conslots.h console-impl.h console.h device-impl.h device.h devslots.h dumper.h faces.h file-coding.h frame.h gc.h general-slots.h gifrlib.h glyphs.h lisp-disunion.h lisp-union.h lisp.h lrecord.h lstream.h mc-alloc.h number-gmp.h number-mp.h number.h objects-impl.h objects.h opaque.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h sysfile.h text.h vdb.h window-impl.h window.h winslots.h
+glyphs-eimage.o: $(CONFIG_H) $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h coding-system-slots.h compiler.h conslots.h console-impl.h console.h device-impl.h device.h devslots.h dumper.h faces.h file-coding.h frame.h gc.h general-slots.h glyphs.h lisp-disunion.h lisp-union.h lisp.h lrecord.h lstream.h mc-alloc.h number-gmp.h number-mp.h number.h objects-impl.h objects.h opaque.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h sysfile.h text.h vdb.h window-impl.h window.h winslots.h
 glyphs-shared.o: $(CONFIG_H) $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h compiler.h console.h dumper.h elhash.h faces.h frame.h gc.h general-slots.h glyphs.h imgproc.h insdel.h lisp-disunion.h lisp-union.h lisp.h lrecord.h lstream.h mc-alloc.h number-gmp.h number-mp.h number.h opaque.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h sysdep.h sysfile.h text.h vdb.h window-impl.h window.h winslots.h
 glyphs-widget.o: $(CONFIG_H) $(LISP_H) bytecode.h charset.h compiler.h conslots.h console-impl.h console.h device-impl.h device.h devslots.h dumper.h faces.h frame.h gc.h general-slots.h glyphs.h gui.h insdel.h lisp-disunion.h lisp-union.h lisp.h lrecord.h lstream.h mc-alloc.h number-gmp.h number-mp.h number.h objects.h opaque.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h text.h vdb.h window-impl.h window.h winslots.h
 glyphs.o: $(CONFIG_H) $(LISP_H) blocktype.h buffer.h bufslots.h casetab.h charset.h chartab.h compiler.h conslots.h console-impl.h console.h device-impl.h device.h devslots.h dumper.h elhash.h faces.h frame-impl.h frame.h frameslots.h gc.h general-slots.h glyphs.h gui.h insdel.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h objects-impl.h objects.h opaque.h rangetab.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h sysfile.h text.h vdb.h window-impl.h window.h winslots.h
@@ -182,7 +180,7 @@
 intl.o: $(CONFIG_H) $(LISP_H) compiler.h dumper.h gc.h general-slots.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h symeval.h symsinit.h text.h vdb.h
 keymap.o: $(CONFIG_H) $(LISP_H) buffer.h bufslots.h bytecode.h casetab.h charset.h chartab.h compiler.h conslots.h console-impl.h console.h dumper.h elhash.h events.h extents.h frame.h gc.h general-slots.h insdel.h keymap.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h systime.h text.h vdb.h window.h
 lastfile.o: $(CONFIG_H)
-libinterface.o: $(CONFIG_H) $(LISP_H) compiler.h dumper.h gc.h general-slots.h gifrlib.h libinterface.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h symeval.h symsinit.h text.h vdb.h
+libinterface.o: $(CONFIG_H) $(LISP_H) compiler.h dumper.h gc.h general-slots.h libinterface.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h symeval.h symsinit.h text.h vdb.h
 libsst.o: $(CONFIG_H) $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h compiler.h dumper.h gc.h general-slots.h libsst.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h sound.h symeval.h symsinit.h sysfile.h text.h vdb.h
 line-number.o: $(CONFIG_H) $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h compiler.h dumper.h gc.h general-slots.h line-number.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h symeval.h symsinit.h text.h vdb.h
 linuxplay.o: $(CONFIG_H) $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h compiler.h dumper.h gc.h general-slots.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h miscplay.h number-gmp.h number-mp.h number.h sound.h symeval.h symsinit.h sysfile.h syssignal.h systty.h text.h vdb.h
diff -r 0cc9d22c3732 src/dgif_lib.c
--- a/src/dgif_lib.c	Thu Aug 27 15:18:51 2009 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,955 +0,0 @@
-/******************************************************************************
-*   "Gif-Lib" - Yet another gif library.				      *
-*									      *
-* Written by:  Gershon Elber			IBM PC Ver 1.1,	Aug. 1990     *
-*******************************************************************************
-* The kernel of the GIF Decoding process can be found here.		      *
-*******************************************************************************
-* History:								      *
-* 16 Jun 89 - Version 1.0 by Gershon Elber.				      *
-*  3 Sep 90 - Version 1.1 by Gershon Elber (Support for Gif89, Unique names). *
-* 19 Feb 98 - Version 1.2 by Jareth Hein (Support for user specified I/O)     *
-******************************************************************************/
-
-#include <config.h>
-#include "lisp.h"
-
-#include "sysfile.h"
-
-#include "gifrlib.h"
-
-#define PROGRAM_NAME	"GIFLIB"
-
-
-static void DGifGetWord(GifFileType *GifFile, int *Word);
-static void DGifSetupDecompress(GifFileType *GifFile);
-static void DGifDecompressLine(GifFileType *GifFile, GifPixelType *Line,
-								int LineLen);
-static int DGifGetPrefixChar(unsigned int *Prefix, int Code, int ClearCode);
-static void DGifDecompressInput(GifFileType *GifFile, int *Code);
-static void DGifBufferedInput(GifFileType *GifFile, GifByteType *NextByte);
-
-/******************************************************************************
-*   Open a new gif file for read, given by its name.			      *
-*   Returns GifFileType pointer dynamically allocated which serves as the gif *
-* info record. 								      *
-******************************************************************************/
-void DGifOpenFileName(GifFileType *GifFile, const char *FileName)
-{
-    FILE *f;
-
-    if ((f = fopen(FileName, 
-#ifdef WIN32_NATIVE
-			     "rb"
-#else
-		             "r"
-#endif /* WIN32_NATIVE */
-			                     )) == NULL)
-	GifInternError(GifFile, D_GIF_ERR_OPEN_FAILED);
-
-    GifStdIOInit(GifFile, f, -1);
-    DGifInitRead(GifFile);
-}
-
-/******************************************************************************
-*   Update a new gif file, given its file handle.			      *
-*   Returns GifFileType pointer dynamically allocated which serves as the gif *
-* info record.								      *
-******************************************************************************/
-void DGifOpenFileHandle(GifFileType *GifFile, int FileHandle)
-{
-    FILE *f;
-
-#ifdef WIN32_NATIVE
-    setmode(FileHandle, O_BINARY);	  /* Make sure it is in binary mode. */
-    f = fdopen(FileHandle, "rb");		   /* Make it into a stream: */
-    setvbuf(f, NULL, _IOFBF, GIF_FILE_BUFFER_SIZE);/* And inc. stream buffer.*/
-#else
-    f = fdopen(FileHandle, "r");		   /* Make it into a stream: */
-#endif /* WIN32_NATIVE */
-
-    GifStdIOInit(GifFile, f, -1);
-    DGifInitRead(GifFile);
-}
-
-/******************************************************************************
-*   Update a new gif file, given its file handle.			      *
-*   Returns GifFileType pointer dynamically allocated which serves as the gif *
-* info record. _GifError is cleared if succesfull.			      *
-******************************************************************************/
-void DGifInitRead(GifFileType *GifFile)
-{
-    GifByteType Buf[GIF_STAMP_LEN+1];
-    GifFilePrivateType *Private;
-
-    if ((Private = (GifFilePrivateType *) malloc(sizeof(GifFilePrivateType)))
-	== NULL) {
-	GifInternError(GifFile, D_GIF_ERR_NOT_ENOUGH_MEM);
-    }
-    memset(Private, '\0', sizeof(GifFilePrivateType));
-    GifFile->Private = (VoidPtr) Private;
-
-    Private->FileState = 0;   /* Make sure bit 0 = 0 (File open for read). */
-
-    /* Lets see if this is a GIF file: */
-    GifRead(Buf, GIF_STAMP_LEN, GifFile);
-
-    /* The GIF Version number is ignored at this time. Maybe we should do    */
-    /* something more useful with it.					     */
-    Buf[GIF_STAMP_LEN] = 0;
-    if (strncmp(GIF_STAMP, (const char *) Buf, GIF_VERSION_POS) != 0) {
-	GifInternError(GifFile, D_GIF_ERR_NOT_GIF_FILE);
-      }
-
-    DGifGetScreenDesc(GifFile);
-}
-
-/******************************************************************************
-*   This routine should be called before any other DGif calls. Note that      *
-* this routine is called automatically from DGif file open routines.	      *
-******************************************************************************/
-void DGifGetScreenDesc(GifFileType *GifFile)
-{
-    int i, BitsPerPixel;
-    GifByteType Buf[3];
-    GifFilePrivateType *Private = (GifFilePrivateType*) GifFile->Private;
-
-    if (!IS_READABLE(Private)) {
-	/* This file was NOT open for reading: */
-	GifInternError(GifFile, D_GIF_ERR_NOT_READABLE);
-    }
-
-    /* Put the screen descriptor into the file: */
-    DGifGetWord(GifFile, &GifFile->SWidth);
-    DGifGetWord(GifFile, &GifFile->SHeight);
-
-    GifRead(Buf, 3, GifFile);
-    GifFile->SColorResolution = (((Buf[0] & 0x70) + 1) >> 4) + 1;
-    BitsPerPixel = (Buf[0] & 0x07) + 1;
-    GifFile->SBackGroundColor = Buf[1];
-    if (Buf[0] & 0x80) {		     /* Do we have global color map? */
-
-	GifFile->SColorMap = MakeMapObject(1 << BitsPerPixel, NULL);
-
-	/* Get the global color map: */
-	for (i = 0; i < GifFile->SColorMap->ColorCount; i++) {
-	    GifRead(Buf, 3, GifFile);
-	    GifFile->SColorMap->Colors[i].Red = Buf[0];
-	    GifFile->SColorMap->Colors[i].Green = Buf[1];
-	    GifFile->SColorMap->Colors[i].Blue = Buf[2];
-	}
-    } else {
-	/* We should always have a colormap */
-	GifFile->SColorMap = MakeMapObject(2, NULL);
-	GifFile->SColorMap->Colors[0].Red = 0;
-	GifFile->SColorMap->Colors[0].Green = 0;
-	GifFile->SColorMap->Colors[0].Blue = 0;
-	GifFile->SColorMap->Colors[1].Red = 0xff;
-	GifFile->SColorMap->Colors[1].Green = 0xff;
-	GifFile->SColorMap->Colors[1].Blue = 0xff;
-    }
-}
-
-/******************************************************************************
-*   This routine should be called before any attemp to read an image.         *
-******************************************************************************/
-void DGifGetRecordType(GifFileType *GifFile, GifRecordType *Type)
-{
-    GifByteType Buf;
-    GifFilePrivateType *Private = (GifFilePrivateType *) GifFile->Private;
-    
-    if (!IS_READABLE(Private)) {
-	/* This file was NOT open for reading: */
-	GifInternError(GifFile, D_GIF_ERR_NOT_READABLE);
-    }
-
-    GifRead(&Buf, 1, GifFile);
-
-    switch (Buf) {
-	case ',':
-	    *Type = IMAGE_DESC_RECORD_TYPE;
-	    break;
-	case '!':
-	    *Type = EXTENSION_RECORD_TYPE;
-	    break;
-	case ';':
-	    *Type = TERMINATE_RECORD_TYPE;
-	    break;
-	default:
-	    *Type = UNDEFINED_RECORD_TYPE;
-	    GifInternError(GifFile, D_GIF_ERR_WRONG_RECORD);
-    }
-}
-
-/******************************************************************************
-*   This routine should be called before any attemp to read an image.         *
-*   Note it is assumed the Image desc. header (',') has been read.	      *
-******************************************************************************/
-void DGifGetImageDesc(GifFileType *GifFile)
-{
-    int i, BitsPerPixel;
-    GifByteType Buf[3];
-    GifFilePrivateType *Private = (GifFilePrivateType *) GifFile->Private;
-
-    if (!IS_READABLE(Private)) {
-	/* This file was NOT open for reading: */
-	GifInternError(GifFile, D_GIF_ERR_NOT_READABLE);
-    }
-
-    DGifGetWord(GifFile, &GifFile->Image.Left);
-    DGifGetWord(GifFile, &GifFile->Image.Top);
-    DGifGetWord(GifFile, &GifFile->Image.Width);
-    DGifGetWord(GifFile, &GifFile->Image.Height);
-
-    GifRead(Buf, 1, GifFile);
-    BitsPerPixel = (Buf[0] & 0x07) + 1;
-    GifFile->Image.Interlace = (Buf[0] & 0x40);
-    if (Buf[0] & 0x80) {	    /* Does this image have local color map? */
-
-	if (GifFile->Image.ColorMap && GifFile->SavedImages == NULL)
-	    FreeMapObject(GifFile->Image.ColorMap);
-
-	GifFile->Image.ColorMap = MakeMapObject(1 << BitsPerPixel, NULL);
-    
-	/* Get the image local color map: */
-	for (i = 0; i < GifFile->Image.ColorMap->ColorCount; i++) {
-	    GifRead(Buf, 3, GifFile);
-	    GifFile->Image.ColorMap->Colors[i].Red = Buf[0];
-	    GifFile->Image.ColorMap->Colors[i].Green = Buf[1];
-	    GifFile->Image.ColorMap->Colors[i].Blue = Buf[2];
-	}
-    }
-
-    if (GifFile->SavedImages) {
-	SavedImage	*sp;
-
-	if ((GifFile->SavedImages = (SavedImage *)realloc(GifFile->SavedImages,
-		    sizeof(SavedImage) * (GifFile->ImageCount + 1))) == NULL) {
-	    GifInternError(GifFile, D_GIF_ERR_NOT_ENOUGH_MEM);
-	}
-
-	sp = &GifFile->SavedImages[GifFile->ImageCount];
-	memcpy(&sp->ImageDesc, &GifFile->Image, sizeof(GifImageDesc));
-	if (GifFile->Image.ColorMap)
-	  {
-	    sp->ImageDesc.ColorMap =
-	      MakeMapObject (GifFile->Image.ColorMap->ColorCount,
-			     GifFile->Image.ColorMap->Colors);
-	  }
-	sp->RasterBits = NULL;
-	sp->ExtensionBlockCount = 0;
-	sp->ExtensionBlocks = (ExtensionBlock *)NULL;
-    }
-
-    GifFile->ImageCount++;
-
-    Private->PixelCount = (long) GifFile->Image.Width *
-			    (long) GifFile->Image.Height;
-
-    DGifSetupDecompress(GifFile);  /* Reset decompress algorithm parameters. */
-}
-
-/******************************************************************************
-*  Get one full scanned line (Line) of length LineLen from GIF file.	      *
-******************************************************************************/
-void DGifGetLine(GifFileType *GifFile, GifPixelType *Line, int LineLen)
-{
-    GifByteType *Dummy;
-    GifFilePrivateType *Private = (GifFilePrivateType *) GifFile->Private;
-
-    if (!IS_READABLE(Private)) {
-	/* This file was NOT open for reading: */
-	GifInternError(GifFile, D_GIF_ERR_NOT_READABLE);
-    }
-
-    if (!LineLen) LineLen = GifFile->Image.Width;
-
-#if defined(WIN32_NATIVE) || defined(__GNUC__)
-    if ((Private->PixelCount -= LineLen) > 0xffff0000UL)
-#else
-    if ((Private->PixelCount -= LineLen) > 0xffff0000)
-#endif /* WIN32_NATIVE */
-    {    
-	GifInternError(GifFile, D_GIF_ERR_DATA_TOO_BIG);
-    }
-
-    DGifDecompressLine(GifFile, Line, LineLen);
-    if (Private->PixelCount == 0) {
-	/* We probably would not be called any more, so lets clean 	     */
-	/* everything before we return: need to flush out all rest of    */
-	/* image until empty block (size 0) detected. We use GetCodeNext.*/
-	do
-	    DGifGetCodeNext(GifFile, &Dummy);
-	while (Dummy != NULL);
-    }
-}
-
-/******************************************************************************
-* Put one pixel (Pixel) into GIF file.					      *
-******************************************************************************/
-void DGifGetPixel(GifFileType *GifFile, GifPixelType Pixel)
-{
-    GifByteType *Dummy;
-    GifFilePrivateType *Private = (GifFilePrivateType *) GifFile->Private;
-
-    if (!IS_READABLE(Private)) {
-	/* This file was NOT open for reading: */
-	GifInternError(GifFile, D_GIF_ERR_NOT_READABLE);
-    }
-
-#if defined(WIN32_NATIVE) || defined(__GNUC__)
-    if (--Private->PixelCount > 0xffff0000UL)
-#else
-    if (--Private->PixelCount > 0xffff0000)
-#endif /* WIN32_NATIVE */
-    {
-	GifInternError(GifFile, D_GIF_ERR_DATA_TOO_BIG);
-    }
-
-    DGifDecompressLine(GifFile, &Pixel, 1);
-    if (Private->PixelCount == 0) {
-	/* We probably would not be called any more, so lets clean 	     */
-	/* everything before we return: need to flush out all rest of    */
-	/* image until empty block (size 0) detected. We use GetCodeNext.*/
-	do
-	    DGifGetCodeNext(GifFile, &Dummy);
-	while (Dummy != NULL);
-    }
-}
-
-/******************************************************************************
-*   Get an extension block (see GIF manual) from gif file. This routine only  *
-* returns the first data block, and DGifGetExtensionNext shouldbe called      *
-* after this one until NULL extension is returned.			      *
-*   The Extension should NOT be freed by the user (not dynamically allocated).*
-*   Note it is assumed the Extension desc. header ('!') has been read.	      *
-******************************************************************************/
-void DGifGetExtension(GifFileType *GifFile, int *ExtCode,
-						    GifByteType **Extension)
-{
-    GifByteType Buf;
-    GifFilePrivateType *Private = (GifFilePrivateType *) GifFile->Private;
-
-    if (!IS_READABLE(Private)) {
-	/* This file was NOT open for reading: */
-	GifInternError(GifFile, D_GIF_ERR_NOT_READABLE);
-    }
-
-    GifRead(&Buf, 1, GifFile);
-    *ExtCode = Buf;
-
-    DGifGetExtensionNext(GifFile, Extension);
-}
-
-/******************************************************************************
-*   Get a following extension block (see GIF manual) from gif file. This      *
-* routine sould be called until NULL Extension is returned.		      *
-*   The Extension should NOT be freed by the user (not dynamically allocated).*
-******************************************************************************/
-void DGifGetExtensionNext(GifFileType *GifFile, GifByteType **Extension)
-{
-    GifByteType Buf;
-    GifFilePrivateType *Private = (GifFilePrivateType *) GifFile->Private;
-
-    GifRead(&Buf, 1, GifFile);
-    if (Buf > 0) {
-	*Extension = Private->Buf;           /* Use private unused buffer. */
-	(*Extension)[0] = Buf;  /* Pascal strings notation (pos. 0 is len.). */
-	GifRead(&((*Extension)[1]), Buf, GifFile);
-    }
-    else
-	*Extension = NULL;
-}
-
-/******************************************************************************
-*   This routine should be called second to last, to close the GIF file.      *
-******************************************************************************/
-int DGifCloseFile(GifFileType *GifFile)
-{
-    GifFilePrivateType *Private;
-
-    if (GifFile == NULL) return -1;
-
-    Private = (GifFilePrivateType *)GifFile->Private;
-    if (!IS_READABLE(Private))
-    {
-	/* This file was NOT open for reading: */
-	GifInternError(GifFile, D_GIF_ERR_NOT_READABLE);
-    }
-
-    if (GifClose (GifFile))
-    {
-	GifInternError(GifFile, D_GIF_ERR_CLOSE_FAILED);
-    }
-    return 0;
-}
-
-/******************************************************************************
-*   Get 2 bytes (word) from the given file:				      *
-******************************************************************************/
-static void DGifGetWord(GifFileType *GifFile, int *Word)
-{
-    unsigned char c[2];
-
-    GifRead(c, 2, GifFile);
-
-    *Word = (((unsigned int) c[1]) << 8) + c[0];
-}
-
-/******************************************************************************
-*   Get the image code in compressed form.  his routine can be called if the  *
-* information needed to be piped out as is. Obviously this is much faster     *
-* than decoding and encoding again. This routine should be followed by calls  *
-* to DGifGetCodeNext, until NULL block is returned.			      *
-*   The block should NOT be freed by the user (not dynamically allocated).    *
-******************************************************************************/
-void DGifGetCode(GifFileType *GifFile, int *CodeSize, GifByteType **CodeBlock)
-{
-    GifFilePrivateType *Private = (GifFilePrivateType *) GifFile->Private;
-
-    if (!IS_READABLE(Private)) {
-	/* This file was NOT open for reading: */
-	GifInternError(GifFile, D_GIF_ERR_NOT_READABLE);
-    }
-
-    *CodeSize = Private->BitsPerPixel;
-
-    DGifGetCodeNext(GifFile, CodeBlock);
-}
-
-/******************************************************************************
-*   Continue to get the image code in compressed form. This routine should be *
-* called until NULL block is returned.					      *
-*   The block should NOT be freed by the user (not dynamically allocated).    *
-******************************************************************************/
-void DGifGetCodeNext(GifFileType *GifFile, GifByteType **CodeBlock)
-{
-    GifByteType Buf;
-    GifFilePrivateType *Private = (GifFilePrivateType *) GifFile->Private;
-
-    GifRead(&Buf, 1, GifFile);
-
-    if (Buf > 0) {
-	*CodeBlock = Private->Buf;	       /* Use private unused buffer. */
-	(*CodeBlock)[0] = Buf;  /* Pascal strings notation (pos. 0 is len.). */
-	GifRead(&((*CodeBlock)[1]), Buf, GifFile);
-    }
-    else {
-	*CodeBlock = NULL;
-	Private->Buf[0] = 0;		   /* Make sure the buffer is empty! */
-	Private->PixelCount = 0;   /* And local info. indicate image read. */
-    }
-
-}
-
-/******************************************************************************
-*   Setup the LZ decompression for this image:				      *
-******************************************************************************/
-static void DGifSetupDecompress(GifFileType *GifFile)
-{
-    int i, BitsPerPixel;
-    GifByteType CodeSize;
-    unsigned int *Prefix;
-    GifFilePrivateType *Private = (GifFilePrivateType *) GifFile->Private;
-
-    GifRead(&CodeSize, 1, GifFile);    /* Read Code size from file. */
-    BitsPerPixel = CodeSize;
-
-    Private->Buf[0] = 0;			      /* Input Buffer empty. */
-    Private->BitsPerPixel = BitsPerPixel;
-    Private->ClearCode = (1 << BitsPerPixel);
-    Private->EOFCode = Private->ClearCode + 1;
-    Private->RunningCode = Private->EOFCode + 1;
-    Private->RunningBits = BitsPerPixel + 1;	 /* Number of bits per code. */
-    Private->MaxCode1 = 1 << Private->RunningBits;     /* Max. code + 1. */
-    Private->StackPtr = 0;		    /* No pixels on the pixel stack. */
-    Private->LastCode = NO_SUCH_CODE;
-    Private->CrntShiftState = 0;	/* No information in CrntShiftDWord. */
-    Private->CrntShiftDWord = 0;
-
-    Prefix = Private->Prefix;
-    for (i = 0; i <= LZ_MAX_CODE; i++) Prefix[i] = NO_SUCH_CODE;
-}
-
-/******************************************************************************
-*   The LZ decompression routine:					      *
-*   This version decompress the given gif file into Line of length LineLen.   *
-*   This routine can be called few times (one per scan line, for example), in *
-* order the complete the whole image.					      *
-******************************************************************************/
-static void DGifDecompressLine(GifFileType *GifFile, GifPixelType *Line,
-								int LineLen)
-{
-    int i = 0, j, CrntCode, EOFCode, ClearCode, CrntPrefix, LastCode, StackPtr;
-    GifByteType *Stack, *Suffix;
-    unsigned int *Prefix;
-    GifFilePrivateType *Private = (GifFilePrivateType *) GifFile->Private;
-
-    StackPtr = Private->StackPtr;
-    Prefix = Private->Prefix;
-    Suffix = Private->Suffix;
-    Stack = Private->Stack;
-    EOFCode = Private->EOFCode;
-    ClearCode = Private->ClearCode;
-    LastCode = Private->LastCode;
-
-    CrntPrefix = 0;
-    if (StackPtr != 0) {
-	/* Let pop the stack off before continueing to read the gif file: */
-	while (StackPtr != 0 && i < LineLen) Line[i++] = Stack[--StackPtr];
-    }
-
-    while (i < LineLen) {			    /* Decode LineLen items. */
-	DGifDecompressInput(GifFile, &CrntCode);
-
-	if (CrntCode == EOFCode) {
-	    /* Note however that usually we will not be here as we will stop */
-	    /* decoding as soon as we got all the pixel, or EOF code will    */
-	    /* not be read at all, and DGifGetLine/Pixel clean everything.   */
-	    if (i != LineLen - 1 || Private->PixelCount != 0) {
-		GifInternError(GifFile, D_GIF_ERR_EOF_TOO_SOON);
-	    }
-	    i++;
-	}
-	else if (CrntCode == ClearCode) {
-	    /* We need to start over again: */
-	    for (j = 0; j <= LZ_MAX_CODE; j++) Prefix[j] = NO_SUCH_CODE;
-	    Private->RunningCode = Private->EOFCode + 1;
-	    Private->RunningBits = Private->BitsPerPixel + 1;
-	    Private->MaxCode1 = 1 << Private->RunningBits;
-	    LastCode = Private->LastCode = NO_SUCH_CODE;
-	}
-	else {
-	    /* Its regular code - if in pixel range simply add it to output  */
-	    /* stream, otherwise trace to codes linked list until the prefix */
-	    /* is in pixel range:					     */
-	    if (CrntCode < ClearCode) {
-		/* This is simple - its pixel scalar, so add it to output:   */
-		Line[i++] = CrntCode;
-	    }
-	    else {
-		/* Its a code to needed to be traced: trace the linked list  */
-		/* until the prefix is a pixel, while pushing the suffix     */
-		/* pixels on our stack. If we done, pop the stack in reverse */
-		/* (thats what stack is good for!) order to output.	     */
-		if (Prefix[CrntCode] == NO_SUCH_CODE) {
-		    /* Only allowed if CrntCode is exactly the running code: */
-		    /* In that case CrntCode = XXXCode, CrntCode or the	     */
-		    /* prefix code is last code and the suffix char is	     */
-		    /* exactly the prefix of last code!			     */
-		    if (CrntCode == Private->RunningCode - 2) {
-			CrntPrefix = LastCode;
-			Suffix[Private->RunningCode - 2] =
-			Stack[StackPtr++] = DGifGetPrefixChar(Prefix,
-							LastCode, ClearCode);
-		    }
-		    else {
-			GifInternError(GifFile, D_GIF_ERR_IMAGE_DEFECT);
-		    }
-		}
-		else
-		    CrntPrefix = CrntCode;
-
-		/* Now (if image is O.K.) we should not get an NO_SUCH_CODE  */
-		/* During the trace. As we might loop forever, in case of    */
-		/* defective image, we count the number of loops we trace    */
-		/* and stop if we got LZ_MAX_CODE. obviously we can not      */
-		/* loop more than that.					     */
-		j = 0;
-		while (j++ <= LZ_MAX_CODE &&
-		       CrntPrefix > ClearCode &&
-		       CrntPrefix <= LZ_MAX_CODE) {
-		    Stack[StackPtr++] = Suffix[CrntPrefix];
-		    CrntPrefix = Prefix[CrntPrefix];
-		}
-		if (j >= LZ_MAX_CODE || CrntPrefix > LZ_MAX_CODE) {
-		    GifInternError(GifFile, D_GIF_ERR_IMAGE_DEFECT);
-		}
-		/* Push the last character on stack: */
-		Stack[StackPtr++] = CrntPrefix;
-
-		/* Now lets pop all the stack into output: */
-		while (StackPtr != 0 && i < LineLen)
-		    Line[i++] = Stack[--StackPtr];
-	    }
-	    if (LastCode != NO_SUCH_CODE) {
-		Prefix[Private->RunningCode - 2] = LastCode;
-
-		if (CrntCode == Private->RunningCode - 2) {
-		    /* Only allowed if CrntCode is exactly the running code: */
-		    /* In that case CrntCode = XXXCode, CrntCode or the	     */
-		    /* prefix code is last code and the suffix char is	     */
-		    /* exactly the prefix of last code!			     */
-		    Suffix[Private->RunningCode - 2] =
-			DGifGetPrefixChar(Prefix, LastCode, ClearCode);
-		}
-		else {
-		    Suffix[Private->RunningCode - 2] =
-			DGifGetPrefixChar(Prefix, CrntCode, ClearCode);
-		}
-	    }
-	    LastCode = CrntCode;
-	}
-    }
-
-    Private->LastCode = LastCode;
-    Private->StackPtr = StackPtr;
-}
-
-/******************************************************************************
-* Routine to trace the Prefixes linked list until we get a prefix which is    *
-* not code, but a pixel value (less than ClearCode). Returns that pixel value.*
-* If image is defective, we might loop here forever, so we limit the loops to *
-* the maximum possible if image O.k. - LZ_MAX_CODE times.		      *
-******************************************************************************/
-static int DGifGetPrefixChar(unsigned int *Prefix, int Code, int ClearCode)
-{
-    int i = 0;
-
-    while (Code > ClearCode && i++ <= LZ_MAX_CODE) Code = Prefix[Code];
-    return Code;
-}
-
-/******************************************************************************
-*   Interface for accessing the LZ codes directly. Set Code to the real code  *
-* (12bits), or to -1 if EOF code is returned.				      *
-******************************************************************************/
-void DGifGetLZCodes(GifFileType *GifFile, int *Code)
-{
-    GifByteType *CodeBlock;
-    GifFilePrivateType *Private = (GifFilePrivateType *) GifFile->Private;
-
-    if (!IS_READABLE(Private)) {
-	/* This file was NOT open for reading: */
-	GifInternError(GifFile, D_GIF_ERR_NOT_READABLE);
-    }
-
-    DGifDecompressInput(GifFile, Code);
-
-    if (*Code == Private->EOFCode) {
-	/* Skip rest of codes (hopefully only NULL terminating block): */
-	do
-	    DGifGetCodeNext(GifFile, &CodeBlock);
-	while (CodeBlock != NULL);
-
-	*Code = -1;
-    }
-    else if (*Code == Private->ClearCode) {
-	/* We need to start over again: */
-	Private->RunningCode = Private->EOFCode + 1;
-	Private->RunningBits = Private->BitsPerPixel + 1;
-	Private->MaxCode1 = 1 << Private->RunningBits;
-    }
-}
-
-/******************************************************************************
-*   The LZ decompression input routine:					      *
-*   This routine is responsable for the decompression of the bit stream from  *
-* 8 bits (bytes) packets, into the real codes.				      *
-*   Returns GIF_OK if read succesfully.					      *
-******************************************************************************/
-static void DGifDecompressInput(GifFileType *GifFile, int *Code)
-{
-    GifFilePrivateType *Private = (GifFilePrivateType *) GifFile->Private;
-    GifByteType NextByte;
-    static unsigned int CodeMasks[] = {
-	0x0000, 0x0001, 0x0003, 0x0007,
-	0x000f, 0x001f, 0x003f, 0x007f,
-	0x00ff, 0x01ff, 0x03ff, 0x07ff,
-	0x0fff
-    };
-
-    while (Private->CrntShiftState < Private->RunningBits) {
-	/* Needs to get more bytes from input stream for next code: */
-	DGifBufferedInput(GifFile, &NextByte);
-	Private->CrntShiftDWord |=
-		((unsigned long) NextByte) << Private->CrntShiftState;
-	Private->CrntShiftState += 8;
-    }
-    *Code = Private->CrntShiftDWord & CodeMasks[Private->RunningBits];
-
-    Private->CrntShiftDWord >>= Private->RunningBits;
-    Private->CrntShiftState -= Private->RunningBits;
-
-    /* If code cannt fit into RunningBits bits, must raise its size. Note */
-    /* however that codes above 4095 are used for special signaling.      */
-    if (++Private->RunningCode > Private->MaxCode1 &&
-	Private->RunningBits < LZ_BITS) {
-	Private->MaxCode1 <<= 1;
-	Private->RunningBits++;
-    }
-}
-
-/******************************************************************************
-*   This routines read one gif data block at a time and buffers it internally *
-* so that the decompression routine could access it.			      *
-*   The routine returns the next byte from its internal buffer (or read next  *
-* block in if buffer empty)						      *
-******************************************************************************/
-static void DGifBufferedInput(GifFileType *GifFile, GifByteType *NextByte)
-{
-    GifFilePrivateType *Private = (GifFilePrivateType *) GifFile->Private;
-    GifByteType *Buf = Private->Buf;
-
-    if (Buf[0] == 0) {
-	/* Needs to read the next buffer - this one is empty: */
-	GifRead(Buf, 1, GifFile);
-	GifRead((Buf + 1), Buf[0], GifFile);
-	*NextByte = Buf[1];
-	Buf[1] = 2;	   /* We use now the second place as last char read! */
-	Buf[0]--;
-    }
-    else {
-	*NextByte = Buf[Buf[1]++];
-	Buf[0]--;
-    }
-}
-
-/******************************************************************************
-* This routine reads an entire GIF into core, hanging all its state info off  *
-* the GifFileType pointer.  Call DGifOpenFileName() or DGifOpenFileHandle()   *
-* first to initialize I/O.  Its inverse is EGifSpew().			      *
-******************************************************************************/
-void DGifSlurp(GifFileType *GifFile)
-{
-    int ImageSize;
-    GifRecordType RecordType;
-    SavedImage *sp;
-    GifByteType *ExtData;
-
-    /* Some versions of malloc dislike 0-length requests */
-    GifFile->SavedImages = (SavedImage *)malloc(sizeof(SavedImage));
-    memset(GifFile->SavedImages, 0, sizeof(SavedImage));
-    sp = &GifFile->SavedImages[0];
-
-    do {
-	DGifGetRecordType(GifFile, &RecordType);
-
-	switch (RecordType) {
-	    case IMAGE_DESC_RECORD_TYPE:
-		DGifGetImageDesc(GifFile);
-
-		sp = &GifFile->SavedImages[GifFile->ImageCount-1];
-		ImageSize = sp->ImageDesc.Width * sp->ImageDesc.Height;
-
-		sp->RasterBits
-		    = (GifPixelType*) malloc (ImageSize * sizeof(GifPixelType));
-
-		DGifGetLine(GifFile, sp->RasterBits, ImageSize);
-		break;
-
-	    case EXTENSION_RECORD_TYPE:
-		DGifGetExtension(GifFile,&sp->Function,&ExtData);
-		
-		while (ExtData != NULL) {
-    		    if (AddExtensionBlock(sp, ExtData[0], ExtData+1) == GIF_ERROR)
-			GifInternError(GifFile, D_GIF_ERR_NOT_ENOUGH_MEM);
-		    DGifGetExtensionNext(GifFile, &ExtData);
-		}
-		break;
-
-	    case TERMINATE_RECORD_TYPE:
-		break;
-
-	    default:	/* Should be trapped by DGifGetRecordType */
-		break;
-	}
-    } while (RecordType != TERMINATE_RECORD_TYPE);
-}
-
-/******************************************************************************
-* Extension record functions						      *
-******************************************************************************/
-
-void MakeExtension(SavedImage *New, int Function)
-{
-    New->Function = Function;
-    /*
-     * Someday we might have to deal with multiple extensions.
-     */
-}
-
-int AddExtensionBlock(SavedImage *New, int Len, GifByteType *data)
-{
-    int size;
-    ExtensionBlock *ep;
-
-    if (New->ExtensionBlocks == NULL)
-	New->ExtensionBlocks = (ExtensionBlock *)malloc(sizeof(ExtensionBlock));
-    else
-	New->ExtensionBlocks =
-	    (ExtensionBlock *)realloc(New->ExtensionBlocks,
-		      sizeof(ExtensionBlock) * (New->ExtensionBlockCount + 1));
-
-    if (New->ExtensionBlocks == NULL)
-	return(GIF_ERROR);
-
-    ep = &New->ExtensionBlocks[New->ExtensionBlockCount++];
-    ep->ByteCount = Len;
-    size = Len * sizeof(GifByteType);
-    ep->Bytes = (GifByteType *)malloc(size);
-    memcpy(ep->Bytes, data, size);
-    return(GIF_OK);
-}
-
-void FreeExtension(SavedImage *Image)
-{
-    ExtensionBlock	*ep;
-
-    for (ep = Image->ExtensionBlocks;
-	 ep < Image->ExtensionBlocks + Image->ExtensionBlockCount;
-	 ep++)
-	(void) free((char *)ep->Bytes);
-    free((char *)Image->ExtensionBlocks);
-    Image->ExtensionBlocks = NULL;
-}
-
-/******************************************************************************
-* Image block allocation functions					      *
-******************************************************************************/
-SavedImage *MakeSavedImage(GifFileType *GifFile, SavedImage *CopyFrom)
-/*
- * Append an image block to the SavedImages array  
- */
-{
-    SavedImage	*sp;
-
-    if (GifFile->SavedImages == NULL)
-	GifFile->SavedImages = (SavedImage *)malloc(sizeof(SavedImage));
-    else
-	GifFile->SavedImages = (SavedImage *)realloc(GifFile->SavedImages,
-				sizeof(SavedImage) * (GifFile->ImageCount+1));
-
-    if (GifFile->SavedImages == NULL)
-	return((SavedImage *)NULL);
-    else
-    {
-	sp = &GifFile->SavedImages[GifFile->ImageCount++];
-	memset((char *)sp, '\0', sizeof(SavedImage));
-
-	if (CopyFrom)
-	{
-	    memcpy((char *)sp, CopyFrom, sizeof(SavedImage));
-
-	    /*
-	     * Make our own allocated copies of the heap fields in the
-	     * copied record.  This guards against potential aliasing
-	     * problems.
-	     */
-
-	    /* first, the local color map */
-	    if (sp->ImageDesc.ColorMap)
-		sp->ImageDesc.ColorMap =
-		    MakeMapObject(CopyFrom->ImageDesc.ColorMap->ColorCount,
-				  CopyFrom->ImageDesc.ColorMap->Colors);
-
-	    /* next, the raster */
-	    sp->RasterBits = (GifPixelType *) malloc(sizeof(GifPixelType)
-				* CopyFrom->ImageDesc.Height
-				* CopyFrom->ImageDesc.Width);
-	    memcpy(sp->RasterBits,
-		   CopyFrom->RasterBits,
-		   sizeof(GifPixelType)
-			* CopyFrom->ImageDesc.Height
-			* CopyFrom->ImageDesc.Width);
-
-	    /* finally, the extension blocks */
-	    if (sp->ExtensionBlocks)
-	    {
-		sp->ExtensionBlocks
-		    = (ExtensionBlock*)malloc(sizeof(ExtensionBlock)
-					      * CopyFrom->ExtensionBlockCount);
-		memcpy(sp->ExtensionBlocks,
-		   CopyFrom->ExtensionBlocks,
-		   sizeof(ExtensionBlock)
-		   	* CopyFrom->ExtensionBlockCount);
-
-		/*
-		 * For the moment, the actual blocks can take their
-		 * chances with free().  We'll fix this later. 
-		 */
-	    }
-	}
-
-	return(sp);
-    }
-}
-
-void FreeSavedImages(GifFileType *GifFile)
-{
-    SavedImage	*sp;
-
-    for (sp = GifFile->SavedImages;
-	 sp < GifFile->SavedImages + GifFile->ImageCount;
-	 sp++)
-    {
-	if (sp->ImageDesc.ColorMap)
-	    FreeMapObject(sp->ImageDesc.ColorMap);
-
-	if (sp->RasterBits)
-	    free((char *)sp->RasterBits);
-
-	if (sp->ExtensionBlocks)
-	    FreeExtension(sp);
-    }
-    free((char *) GifFile->SavedImages);
-}
-
-/******************************************************************************
-* Miscellaneous utility functions					      *
-******************************************************************************/
-
-static int BitSize(int n)
-/* return smallest bitfield size n will fit in */
-{
-    register	int i;
-
-    for (i = 1; i <= 8; i++)
-	if ((1 << i) >= n)
-	    break;
-    return(i);
-}
-
-/******************************************************************************
-* Color map object functions						      *
-******************************************************************************/
-
-ColorMapObject *MakeMapObject(int ColorCount, GifColorType *ColorMap)
-/*
- * Allocate a color map of given size; initialize with contents of
- * ColorMap if that pointer is non-NULL.
- */
-{
-    ColorMapObject *Object;
-
-    if (ColorCount != (1 << BitSize(ColorCount)))
-	return((ColorMapObject *)NULL);
-
-    Object = (ColorMapObject *)malloc(sizeof(ColorMapObject));
-    if (Object == (ColorMapObject *)NULL)
-	return((ColorMapObject *)NULL);
-
-    Object->Colors = (GifColorType *)calloc(ColorCount, sizeof(GifColorType));
-    if (Object->Colors == (GifColorType *)NULL) {
-	free(Object);
-	return((ColorMapObject *)NULL);
-    }
-
-    Object->ColorCount = ColorCount;
-    Object->BitsPerPixel = BitSize(ColorCount);
-
-    if (ColorMap)
-	memcpy((char *)Object->Colors,
-	       (char *)ColorMap, ColorCount * sizeof(GifColorType));
-
-    return(Object);
-}
-
-void FreeMapObject(ColorMapObject *Object)
-/*
- * Free a color map object
- */
-{
-    free(Object->Colors);
-    free(Object);
-}
diff -r 0cc9d22c3732 src/gif_io.c
--- a/src/gif_io.c	Thu Aug 27 15:18:51 2009 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,260 +0,0 @@
-#include <config.h>
-#include "lisp.h"
-
-#include "sysfile.h"
-
-#include "gifrlib.h"
-
-/******************************************************************************
-* Set up the GifFileType structure for use.  This must be called first in any *
-* client program.  Then, if custom IO or Error functions are desired, call    *
-* GifSetIOFunc/GifSetErrorFunc, then call EGifInitWrite.  Else call           *
-* EGifOpenFileName or EGifOpenFileHandle for standard IO functions.           *
-* If setup fails, a NULL pointer is returned.                                 *
-******************************************************************************/
-GifFileType *GifSetup(void)
-{
-    GifIODataType *GifIO;
-    GifFileType *GifFile;
-
-    if ((GifFile = (GifFileType *) malloc(sizeof(GifFileType))) == NULL)
-	return NULL;
-    memset(GifFile, '\0', sizeof(GifFileType));
-    if ((GifIO = (GifIODataType *) malloc(sizeof(GifIODataType))) == NULL) {
-	free((char *) GifFile);
-	return NULL;
-    }
-    memset(GifIO, '\0', sizeof(GifIODataType));
-    GifFile->GifIO = GifIO;    
-    return GifFile;
-}
-
-void GifFree(GifFileType *GifFile)
-{
-    GifFilePrivateType *Private;
-
-    if (GifFile == NULL) return;
-
-    Private = (GifFilePrivateType *) GifFile->Private;
-
-    if (GifFile->SavedImages)
-	FreeSavedImages(GifFile);
-    if (GifFile->Image.ColorMap)
-	FreeMapObject(GifFile->Image.ColorMap);
-    if (GifFile->SColorMap)
-	FreeMapObject(GifFile->SColorMap);
-    if (Private)
-    {
-	free(Private);
-    }
-    if (GifFile->GifIO)
-	free(GifFile->GifIO);
-    free(GifFile);
-}
-
-/****************************************************************************
-* Install the specified ReadFunction into the GifFile specified.            *
-****************************************************************************/
-void GifSetReadFunc(GifFileType *GifFile, Gif_rw_func ReadFunc, VoidPtr data)
-{
-    GifIODataType *GifIO = (GifIODataType *)GifFile->GifIO;
-    GifIO->ReadFunc = ReadFunc;
-    GifIO->ReadFunc_data = data;
-}
-
-/****************************************************************************
-* Install the specified WriteFunction into the GifFile specified.           *
-****************************************************************************/
-void GifSetWriteFunc(GifFileType *GifFile, Gif_rw_func WriteFunc, VoidPtr data)
-{
-    GifIODataType *GifIO = (GifIODataType *)GifFile->GifIO;
-    GifIO->WriteFunc = WriteFunc;
-    GifIO->WriteFunc_data = data;
-}
-
-/****************************************************************************
-* Install the specified CloseFunction into the GifFile specified.           *
-****************************************************************************/
-void GifSetCloseFunc(GifFileType *GifFile, Gif_close_func CloseFunc, VoidPtr data)
-{
-    GifIODataType *GifIO = (GifIODataType *)GifFile->GifIO;
-    GifIO->CloseFunc = CloseFunc;
-    GifIO->CloseFunc_data = data;
-}
-
-/****************************************************************************
-* Install the standard IO funcs into the GifFile, including the FILE info   *
-****************************************************************************/
-void GifStdIOInit(GifFileType *GifFile, FILE *file, int filehandle)
-{
-    GifStdIODataType *IOData;
-    
-    if ((IOData = (GifStdIODataType*)malloc(sizeof(GifStdIODataType))) == NULL)
-	GifInternError(GifFile, GIF_ERR_NOT_ENOUGH_MEM);
-    IOData->File = file;
-    IOData->FileHandle = filehandle;
-    GifSetReadFunc(GifFile, GifStdRead, IOData);
-    GifSetWriteFunc(GifFile, GifStdWrite, IOData);
-    GifSetCloseFunc(GifFile, GifStdFileClose, IOData);
-}
-
-Bytecount GifStdRead(GifByteType *buf, Bytecount size, VoidPtr method_data)
-{
-  GifStdIODataType *IOtype = (GifStdIODataType*)method_data;
-  return (retry_fread(buf, 1, size, IOtype->File));
-}
-
-Bytecount GifStdWrite(GifByteType *buf, Bytecount size, VoidPtr method_data)
-{
-  GifStdIODataType *IOtype = (GifStdIODataType*)method_data;
-  return (retry_fwrite(buf, 1, size, IOtype->File));  
-}
-
-int GifStdFileClose(VoidPtr method_data)
-{
-  int ret;
-  GifStdIODataType *IOtype = (GifStdIODataType*)method_data;
-  ret = retry_fclose(IOtype->File);
-  if (ret == 0 && IOtype->FileHandle != -1)
-    ret = retry_close(IOtype->FileHandle);
-  return ret;
-}
-
-void GifRead(GifByteType *buf, Bytecount size, GifFileType *GifFile)
-{
-  GifIODataType *GifIO = (GifIODataType*)GifFile->GifIO;
-  if ((*(GifIO->ReadFunc))(buf, size, GifIO->ReadFunc_data) != size)
-    GifError(GifFile, "Read error!");
-}
-
-void GifWrite(GifByteType *buf, Bytecount size, GifFileType *GifFile)
-{
-  GifIODataType *GifIO = (GifIODataType*)GifFile->GifIO;
-  if ((*(GifIO->WriteFunc))(buf, size, GifIO->WriteFunc_data) != size)
-    GifError(GifFile, "Write error!");
-}
-
-int GifClose(GifFileType *GifFile) 
-{
-  GifIODataType *GifIO = (GifIODataType*)GifFile->GifIO;
-  return ((*(GifIO->CloseFunc))(GifIO->CloseFunc_data));
-}
-
-static const char *GifErrorString[14] = {
-  "Failed to open given file",			/* D_GIF_ERR_OPEN_FAILED */
-  "Failed to read from given file",		/* D_GIF_ERR_READ_FAILED */
-  "Given file is NOT a GIF file",		/* D_GIF_ERR_NOT_GIF_FILE */
-  "No Screen Descriptor detected",		/* D_GIF_ERR_NO_SCRN_DSCR */
-  "No Image Descriptor detected",		/* D_GIF_ERR_NO_IMAG_DSCR */
-  "No global or local color map",		/* D_GIF_ERR_NO_COLOR_MAP */
-  "Wrong record type detected",			/* D_GIF_ERR_WRONG_RECORD */
-  "#Pixels bigger than Width * Height",		/* D_GIF_ERR_DATA_TOO_BIG */
-  "Fail to allocate required memory",		/* D_GIF_ERR_NOT_ENOUGH_MEM */
-  "Failed to close given file",			/* D_GIF_ERR_CLOSE_FAILED */
-  "Given file was not opened for read",		/* D_GIF_ERR_CLOSE_FAILED */
-  "Image is defective, decoding aborted",	/* D_GIF_ERR_IMAGE_DEFECT */
-  "Image EOF detected before image complete",	/* D_GIF_ERR_EOF_TOO_SOON */
-  "Undefined error!",
-};
-
-const char *GetGifError(int errore);
-
-/*****************************************************************************
-* Get the last GIF error in human-readable form.			     *
-*****************************************************************************/
-const char *GetGifError(int errore)
-{
-    const char *Err;
-
-    switch(errore) {
-	case D_GIF_ERR_OPEN_FAILED:
-	    Err = GifErrorString[0];
-	    break;
-	case D_GIF_ERR_READ_FAILED:
-	    Err = GifErrorString[1];
-	    break;
-	case D_GIF_ERR_NOT_GIF_FILE:
-	    Err = GifErrorString[2];
-	    break;
-	case D_GIF_ERR_NO_SCRN_DSCR:
-	    Err = GifErrorString[3];
-	    break;
-	case D_GIF_ERR_NO_IMAG_DSCR:
-	    Err = GifErrorString[4];
-	    break;
-	case D_GIF_ERR_NO_COLOR_MAP:
-	    Err = GifErrorString[5];
-	    break;
-	case D_GIF_ERR_WRONG_RECORD:
-	    Err = GifErrorString[6];
-	    break;
-	case D_GIF_ERR_DATA_TOO_BIG:
-	    Err = GifErrorString[7];
-	    break;
-	case D_GIF_ERR_NOT_ENOUGH_MEM:
-	    Err = GifErrorString[8];
-	    break;
-	case D_GIF_ERR_CLOSE_FAILED:
-	    Err = GifErrorString[9];
-	    break;
-	case D_GIF_ERR_NOT_READABLE:
-	    Err = GifErrorString[10];
-	    break;
-	case D_GIF_ERR_IMAGE_DEFECT:
-	    Err = GifErrorString[11];
-	    break;
-	case D_GIF_ERR_EOF_TOO_SOON:
-	    Err = GifErrorString[12];
-	    break;
-	default:
-	    Err = GifErrorString[13];
-	    break;
-    }
-    return Err;
-}
-
-/******************************
-* These are called internally *        
-******************************/
-DOESNT_RETURN GifError(GifFileType *GifFile, const char *err_str)
-{
-  GifIODataType *GifIO = (GifIODataType*)GifFile->GifIO;
-  if (GifIO->ErrorFunc)
-    (*(GifIO->ErrorFunc))(err_str, GifIO->ErrorFunc_data);
-  else
-    fprintf(stderr, "GIF FATAL ERROR: %s", err_str);
-  exit(-10);
-}
-
-void GifWarning(GifFileType *GifFile, const char *err_str)
-{
-  GifIODataType *GifIO = (GifIODataType*)GifFile->GifIO;
-  if (GifIO->WarningFunc) 
-    (*(GifIO->WarningFunc))(err_str, GifIO->WarningFunc_data);
-}
-
-DOESNT_RETURN GifInternError(GifFileType *GifFile, int error_num)
-{
-  const char *ErrStr = GetGifError(error_num);
-  GifError(GifFile, ErrStr);
-}
-
-void GifInternWarning(GifFileType *GifFile, int error_num)
-{
-  const char *ErrStr = GetGifError(error_num);
-  GifWarning(GifFile, ErrStr);
-}
-
-void GifSetErrorFunc(GifFileType *GifFile, Gif_error_func ErrorFunc, VoidPtr data)
-{
-    GifIODataType *GifIO = (GifIODataType *)GifFile->GifIO;
-    GifIO->ErrorFunc = ErrorFunc;
-    GifIO->ErrorFunc_data = data;  
-}
-
-void GifSetWarningFunc(GifFileType *GifFile, Gif_error_func WarningFunc, VoidPtr data)
-{
-    GifIODataType *GifIO = (GifIODataType *)GifFile->GifIO;
-    GifIO->WarningFunc = WarningFunc;
-    GifIO->WarningFunc_data = data;
-}
diff -r 0cc9d22c3732 src/gifrlib.h
--- a/src/gifrlib.h	Thu Aug 27 15:18:51 2009 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,267 +0,0 @@
-/******************************************************************************
-* In order to make life a little bit easier when using the GIF file format,   *
-* this library was written, and which does all the dirty work...	      *
-*									      *
-*					Written by Gershon Elber,  Jun. 1989  *
-*					Hacks by Eric S. Raymond,  Sep. 1992  *
-*                                             and Jareth Hein,     Jan. 1998  *
-*******************************************************************************
-* History:								      *
-* 14 Jun 89 - Version 1.0 by Gershon Elber.				      *
-*  3 Sep 90 - Version 1.1 by Gershon Elber (Support for Gif89, Unique names). *
-* 15 Sep 90 - Version 2.0 by Eric S. Raymond (Changes to suoport GIF slurp)   *
-* 26 Jun 96 - Version 3.0 by Eric S. Raymond (Full GIF89 support)             *
-* 19 Jan 98 - Version 3.1 by Jareth Hein (Support for user-defined I/O).      *
-******************************************************************************/
-
-#ifndef INCLUDED_gifrlib_h_
-#define INCLUDED_gifrlib_h_
-
-#define	GIF_ERROR	0
-#define GIF_OK		1
-
-#ifndef TRUE
-#define TRUE		1
-#define FALSE		0
-#endif
-
-#ifndef NULL
-#define NULL		0
-#endif /* NULL */
-
-#define GIF_FILE_BUFFER_SIZE 16384  /* Files uses bigger buffers than usual. */
-
-typedef	int		GifBooleanType;
-typedef	unsigned char	GifPixelType;
-typedef unsigned char *	GifRowType;
-typedef unsigned char	GifByteType;
-
-#define VoidPtr void *
-
-typedef struct GifColorType {
-    GifByteType Red, Green, Blue;
-} GifColorType;
-
-typedef struct ColorMapObject
-{
-    int	ColorCount;
-    int BitsPerPixel;
-    GifColorType *Colors;		/* on malloc(3) heap */
-}
-ColorMapObject;
-
-typedef struct GifImageDesc {
-    int Left, Top, Width, Height,	/* Current image dimensions. */
-	Interlace;			/* Sequential/Interlaced lines. */
-    ColorMapObject *ColorMap;		/* The local color map */
-} GifImageDesc;
-
-/* I/O operations.  If you roll your own, they need to be semantically equivilent to
-   fread/fwrite, with an additional paramater to hold data local to your method. */
-typedef Bytecount (*Gif_rw_func)(GifByteType *buffer, Bytecount size, VoidPtr method_data);
-/* Finish up stream. Non-zero return indicates failure */
-typedef int (*Gif_close_func)(VoidPtr close_data);
-/* Error handling function */
-typedef void (*Gif_error_func)(const char *string, VoidPtr error_data);
-
-typedef struct GifFileType {
-    int SWidth, SHeight,		/* Screen dimensions. */
-	SColorResolution, 		/* How many colors can we generate? */
-	SBackGroundColor;		/* I hope you understand this one... */
-    ColorMapObject *SColorMap;		/* NULL if it doesn't exist. */
-    int ImageCount;			/* Number of current image */
-    GifImageDesc Image;			/* Block describing current image */
-    struct SavedImage *SavedImages;	/* Use this to accumulate file state */
-    VoidPtr Private;	  		/* Don't mess with this! */
-    VoidPtr GifIO;			/* Contains all information for I/O */
-} GifFileType;
-
-typedef enum {
-    UNDEFINED_RECORD_TYPE,
-    SCREEN_DESC_RECORD_TYPE,
-    IMAGE_DESC_RECORD_TYPE,		/* Begin with ',' */
-    EXTENSION_RECORD_TYPE,		/* Begin with '!' */
-    TERMINATE_RECORD_TYPE		/* Begin with ';' */
-} GifRecordType;
-
-/******************************************************************************
-*  GIF89 extension function codes                                             *
-******************************************************************************/
-
-#define COMMENT_EXT_FUNC_CODE		0xfe	/* comment */
-#define GRAPHICS_EXT_FUNC_CODE		0xf9	/* graphics control */
-#define PLAINTEXT_EXT_FUNC_CODE		0x01	/* plaintext */
-#define APPLICATION_EXT_FUNC_CODE	0xff	/* application block */
-
-/******************************************************************************
-* IO related routines.  Defined in gif_io.c                                   *
-******************************************************************************/
-GifFileType *GifSetup(void);
-void GifFree(GifFileType *GifFile);
-void GifSetReadFunc (GifFileType *GifFile, Gif_rw_func func, VoidPtr data);
-void GifSetWriteFunc(GifFileType *GifFile, Gif_rw_func func, VoidPtr data);
-void GifSetCloseFunc(GifFileType *GifFile, Gif_close_func func, VoidPtr data);
-
-/******************************************************************************
-* O.K., here are the routines one can access in order to decode GIF file:     *
-******************************************************************************/
-
-void DGifOpenFileName(GifFileType *GifFile, const char *GifFileName);
-void DGifOpenFileHandle(GifFileType *GifFile, int GifFileHandle);
-void DGifInitRead(GifFileType *GifFile);
-void DGifSlurp(GifFileType *GifFile);
-void DGifGetScreenDesc(GifFileType *GifFile);
-void DGifGetRecordType(GifFileType *GifFile, GifRecordType *GifType);
-void DGifGetImageDesc(GifFileType *GifFile);
-void DGifGetLine(GifFileType *GifFile, GifPixelType *GifLine, int GifLineLen);
-void DGifGetPixel(GifFileType *GifFile, GifPixelType GifPixel);
-void DGifGetComment(GifFileType *GifFile, char *GifComment);
-void DGifGetExtension(GifFileType *GifFile, int *GifExtCode,
-						GifByteType **GifExtension);
-void DGifGetExtensionNext(GifFileType *GifFile, GifByteType **GifExtension);
-void DGifGetCode(GifFileType *GifFile, int *GifCodeSize,
-						GifByteType **GifCodeBlock);
-void DGifGetCodeNext(GifFileType *GifFile, GifByteType **GifCodeBlock);
-void DGifGetLZCodes(GifFileType *GifFile, int *GifCode);
-int DGifCloseFile(GifFileType *GifFile);
-
-#define	D_GIF_ERR_OPEN_FAILED	101		/* And DGif possible errors. */
-#define	D_GIF_ERR_READ_FAILED	102
-#define	D_GIF_ERR_NOT_GIF_FILE	103
-#define D_GIF_ERR_NO_SCRN_DSCR	104
-#define D_GIF_ERR_NO_IMAG_DSCR	105
-#define D_GIF_ERR_NO_COLOR_MAP	106
-#define D_GIF_ERR_WRONG_RECORD	107
-#define D_GIF_ERR_DATA_TOO_BIG	108
-#define GIF_ERR_NOT_ENOUGH_MEM 109
-#define D_GIF_ERR_NOT_ENOUGH_MEM 109
-#define D_GIF_ERR_CLOSE_FAILED	110
-#define D_GIF_ERR_NOT_READABLE	111
-#define D_GIF_ERR_IMAGE_DEFECT	112
-#define D_GIF_ERR_EOF_TOO_SOON	113
-
-/******************************************************************************
-* O.K., here are the error routines 					      *
-******************************************************************************/
-extern void GifSetErrorFunc(GifFileType *GifFile, Gif_error_func func, VoidPtr data);
-extern void GifSetWarningFunc(GifFileType *GifFile, Gif_error_func func, VoidPtr data);
-DECLARE_DOESNT_RETURN (GifInternError(GifFileType *GifFile, int errnum));
-extern void GifInternWarning(GifFileType *GifFile, int errnum);
-DECLARE_DOESNT_RETURN (GifError(GifFileType *GifFile, const char *err_str));
-extern void GifWarning(GifFileType *GifFile, const char *err_str);
-
-/*****************************************************************************
- *
- * Everything below this point is new after version 1.2, supporting `slurp
- * mode' for doing I/O in two big belts with all the image-bashing in core.
- *
- *****************************************************************************/
-
-/******************************************************************************
-* Support for the in-core structures allocation (slurp mode).		      *
-******************************************************************************/
-
-/* This is the in-core version of an extension record */
-typedef struct {
-    int		ByteCount;
-    GifByteType	*Bytes;		/* on malloc(3) heap */
-} ExtensionBlock;
-
-/* This holds an image header, its unpacked raster bits, and extensions */
-typedef struct SavedImage {
-    GifImageDesc	ImageDesc;
-
-    GifPixelType	*RasterBits;		/* on malloc(3) heap */
-
-    int			Function;
-    int			ExtensionBlockCount;
-    ExtensionBlock	*ExtensionBlocks;	/* on malloc(3) heap */
-} SavedImage;
-
-extern void ApplyTranslation(SavedImage *Image, GifPixelType Translation[]);
-
-extern void MakeExtension(SavedImage *New, int Function);
-extern int AddExtensionBlock(SavedImage *New, int Length, GifByteType *data);
-extern void FreeExtension(SavedImage *Image);
-
-extern SavedImage *MakeSavedImage(GifFileType *GifFile, SavedImage *CopyFrom);
-extern void FreeSavedImages(GifFileType *GifFile);
-
-/*   Common defines used by encode/decode functions */
-
-#define COMMENT_EXT_FUNC_CODE	0xfe /* Extension function code for comment. */
-#define GIF_STAMP	"GIFVER"	 /* First chars in file - GIF stamp. */
-#define GIF_STAMP_LEN	sizeof(GIF_STAMP) - 1
-#define GIF_VERSION_POS	3		/* Version first character in stamp. */
-#define GIF87_STAMP	"GIF87a"         /* First chars in file - GIF stamp. */
-#define GIF89_STAMP	"GIF89a"         /* First chars in file - GIF stamp. */
-
-#define LZ_MAX_CODE	4095		/* Biggest code possible in 12 bits. */
-#define LZ_BITS		12
-
-#define FILE_STATE_READ		0x01
-#define FILE_STATE_WRITE	0x01
-#define FILE_STATE_SCREEN	0x02
-#define FILE_STATE_IMAGE	0x04
-
-#define FLUSH_OUTPUT		4096    /* Impossible code, to signal flush. */
-#define FIRST_CODE		4097    /* Impossible code, to signal first. */
-#define NO_SUCH_CODE		4098    /* Impossible code, to signal empty. */
-
-#define IS_READABLE(Private)	(!(Private->FileState & FILE_STATE_READ))
-#define IS_WRITEABLE(Private)	(Private->FileState & FILE_STATE_WRITE)
-
-typedef struct GifFilePrivateType {
-    int FileState,
-	BitsPerPixel,	    /* Bits per pixel (Codes uses at list this + 1). */
-	ClearCode,				       /* The CLEAR LZ code. */
-	EOFCode,				         /* The EOF LZ code. */
-	RunningCode,		    /* The next code algorithm can generate. */
-	RunningBits,/* The number of bits required to represent RunningCode. */
-	MaxCode1,  /* 1 bigger than max. possible code, in RunningBits bits. */
-	LastCode,		        /* The code before the current code. */
-	CrntCode,				  /* Current algorithm code. */
-	StackPtr,		         /* For character stack (see below). */
-	CrntShiftState;		        /* Number of bits in CrntShiftDWord. */
-    unsigned long CrntShiftDWord;     /* For bytes decomposition into codes. */
-    unsigned long PixelCount;		       /* Number of pixels in image. */
-    GifByteType Buf[256];	       /* Compressed input is buffered here. */
-    GifByteType Stack[LZ_MAX_CODE];	 /* Decoded pixels are stacked here. */
-    GifByteType Suffix[LZ_MAX_CODE+1];	       /* So we can trace the codes. */
-    unsigned int Prefix[LZ_MAX_CODE+1];
-} GifFilePrivateType;
-
-typedef struct GifIODataType {
-    Gif_rw_func ReadFunc, WriteFunc;	/* Pointers to the functions that will do the I/O */
-    Gif_close_func CloseFunc;    
-    VoidPtr ReadFunc_data;		/* data to be passed to the read function */
-    VoidPtr WriteFunc_data;		/* data to be passed to the write function */
-    VoidPtr CloseFunc_data;		/* data to be passed to the close function */
-    Gif_error_func ErrorFunc;	/* MUST NOT RETURN (use lng_jmp or exit)!  */
-    Gif_error_func WarningFunc;	/* For warning messages (can be ignored) */
-    VoidPtr ErrorFunc_data;
-    VoidPtr WarningFunc_data;
-} GifIODataType;
-
-typedef struct GifStdIODataType {
-  FILE *File;
-  int FileHandle;
-} GifStdIODataType;
-
-/* Install StdIO funcs on FILE into GifFile */
-void GifStdIOInit(GifFileType *GifFile, FILE *file, int filehandle);
-
-/* Error checking reads, writes and closes */
-void GifRead(GifByteType *buf, Bytecount size, GifFileType *GifFile);
-void GifWrite(GifByteType *buf, Bytecount size, GifFileType *GifFile);
-int GifClose(GifFileType *GifFile);
-
-/* The default Read and Write functions for files */
-Bytecount GifStdRead(GifByteType *buf, Bytecount size, VoidPtr method_data);
-Bytecount GifStdWrite(GifByteType *buf, Bytecount size, VoidPtr method_data);
-int GifStdFileClose(VoidPtr method_data);
-
-ColorMapObject *MakeMapObject(int ColorCount, GifColorType *ColorMap);
-void FreeMapObject(ColorMapObject *Object);
-
-#endif /* INCLUDED_gifrlib_h_ */
diff -r 0cc9d22c3732 src/glyphs-eimage.c
--- a/src/glyphs-eimage.c	Thu Aug 27 15:18:51 2009 +0100
+++ b/src/glyphs-eimage.c	Fri Aug 28 11:24:47 2009 -0600
@@ -34,6 +34,7 @@
    Many changes for color work and optimizations by Jareth Hein for 21.0
    Switch of GIF/JPEG/PNG to new EImage intermediate code by Jareth Hein for 21.0
    TIFF code by Jareth Hein for 21.0
+   GIF support changed to external giflib by Jerry James for 21.5
    TODO:
    Convert images.el to C and stick it in here?
    This file is really repetitious; can we refactor?
@@ -527,7 +528,7 @@
  *                               GIF                                  *
  **********************************************************************/
 
-#include "gifrlib.h"
+#include <gif_lib.h>
 
 static void
 gif_validate (Lisp_Object instantiator)
@@ -569,7 +570,7 @@
   if (data->giffile)
     {
       DGifCloseFile (data->giffile);
-      GifFree(data->giffile);
+      FreeSavedImages(data->giffile);
     }
   if (data->eimage)
     xfree (data->eimage, Binbyte *);
@@ -584,10 +585,10 @@
   Bytecount index;		/* Where are we?  */
 } gif_memory_storage;
 
-static Bytecount
-gif_read_from_memory (GifByteType *buf, Bytecount size, VoidPtr data)
+static int
+gif_read_from_memory (GifFileType *gif, GifByteType *buf, int size)
 {
-  gif_memory_storage *mem = (gif_memory_storage *) data;
+  gif_memory_storage *mem = (gif_memory_storage *) gif->UserData;
 
   if (size > (mem->len - mem->index))
     return -1;
@@ -596,26 +597,40 @@
   return size;
 }
 
-static int
-gif_memory_close (VoidPtr UNUSED (data))
+static const char *
+gif_decode_error_string ()
 {
-  return 0;
-}
-
-struct gif_error_struct
-{
-  const Extbyte *err_str;	/* return the error string */
-  jmp_buf setjmp_buffer;	/* for return to caller */
-};
-
-static void
-gif_error_func (const Extbyte *err_str, VoidPtr error_ptr)
-{
-  struct gif_error_struct *error_data = (struct gif_error_struct *) error_ptr;
-
-  /* return to setjmp point */
-  error_data->err_str = err_str;
-  longjmp (error_data->setjmp_buffer, 1);
+  switch (GifLastError ())
+    {
+    case D_GIF_ERR_OPEN_FAILED:
+      return "GIF error: unable to open";
+    case D_GIF_ERR_READ_FAILED:
+      return "GIF error: read failed";
+    case D_GIF_ERR_NOT_GIF_FILE:
+      return "GIF error: not a GIF file";
+    case D_GIF_ERR_NO_SCRN_DSCR:
+      return "GIF error: no Screen Descriptor detected";
+    case D_GIF_ERR_NO_IMAG_DSCR:
+      return "GIF error: no Image Descriptor detected";
+    case D_GIF_ERR_NO_COLOR_MAP:
+      return "GIF error: no global or local color map";
+    case D_GIF_ERR_WRONG_RECORD:
+      return "GIF error: wrong record type";
+    case D_GIF_ERR_DATA_TOO_BIG:
+      return "GIF error: image is larger than indicated by header";
+    case D_GIF_ERR_NOT_ENOUGH_MEM:
+      return "GIF error: out of memory";
+    case D_GIF_ERR_CLOSE_FAILED:
+      return "GIF error: failed to close file";
+    case D_GIF_ERR_NOT_READABLE:
+      return "GIF error: file is not readable";
+    case D_GIF_ERR_IMAGE_DEFECT:
+      return "GIF error: image is defective";
+    case D_GIF_ERR_EOF_TOO_SOON:
+      return "GIF error: image EOF detected before image complete";
+    default:
+      return "GIF error: unknown error";
+    }
 }
 
 static void
@@ -630,7 +645,6 @@
   struct gif_unwind_data unwind;
   int speccount = specpdl_depth ();
   gif_memory_storage mem_struct;
-  struct gif_error_struct gif_err;
   Binbyte *bytes;
   Bytecount len;
   int height = 0;
@@ -646,35 +660,19 @@
 
     assert (!NILP (data));
 
-    if (!(unwind.giffile = GifSetup()))
-      signal_image_error ("Insufficient memory to instantiate GIF image", instantiator);
-
-    /* set up error facilities */
-    if (setjmp(gif_err.setjmp_buffer))
-      {
-	/* An error was signaled. No clean up is needed, as unwind handles that
-	   for us.  Just pass the error along. */
-	Ibyte *interr;
-	Lisp_Object errstring;
-	EXTERNAL_TO_C_STRING (gif_err.err_str, interr, Qnative);
-	errstring = build_msg_intstring (interr);
-	signal_image_error_2 ("GIF decoding error", errstring, instantiator);
-      }
-    GifSetErrorFunc(unwind.giffile, (Gif_error_func)gif_error_func, (VoidPtr)&gif_err);
-
     TO_EXTERNAL_FORMAT (LISP_STRING, data, ALLOCA, (bytes, len), Qbinary);
     mem_struct.bytes = bytes;
     mem_struct.len = len;
     mem_struct.index = 0;
-    GifSetReadFunc(unwind.giffile, gif_read_from_memory, (VoidPtr)&mem_struct);
-    GifSetCloseFunc(unwind.giffile, gif_memory_close, (VoidPtr)&mem_struct);
-    DGifInitRead(unwind.giffile);
+    unwind.giffile = DGifOpen (&mem_struct, gif_read_from_memory);
+    if (unwind.giffile == NULL)
+      signal_image_error (gif_decode_error_string (), instantiator);
 
     /* Then slurp the image into memory, decoding along the way.
        The result is the image in a simple one-byte-per-pixel
-       format (#### the GIF routines only support 8-bit GIFs,
-       it appears). */
-    DGifSlurp (unwind.giffile);
+       format. */
+    if (DGifSlurp (unwind.giffile) == GIF_ERROR)
+      signal_image_error (gif_decode_error_string (), instantiator);
   }
 
   /* 3. Now create the EImage(s) */
@@ -748,7 +746,7 @@
   if (unwind.giffile->ImageCount > 1)
     {
     /* See if there is a timeout value. In theory there could be one
-       for every image - but that makes the implementation way to
+       for every image - but that makes the implementation way too
        complicated for now so we just take the first. */
       unsigned short timeout = 0;
       Lisp_Object tid;
diff -r 0cc9d22c3732 src/libinterface.h
--- a/src/libinterface.h	Thu Aug 27 15:18:51 2009 +0100
+++ b/src/libinterface.h	Fri Aug 28 11:24:47 2009 -0600
@@ -24,7 +24,7 @@
 #define INCLUDED_libinterface_h_
 
 #ifdef HAVE_GIF
-#include "gifrlib.h"
+#include <gif_lib.h>
 #endif /* HAVE_GIF */
 
 #ifdef HAVE_PNG
