changeset 109849:28a8c62b8ee7

imagemagick patch5 + minor mods
author joakim <joakim@exodia>
date Fri, 02 Apr 2010 23:09:13 +0200
parents 6a5be93fe0dd
children 242a8b343421
files configure configure.in lisp/image.el src/Makefile.in src/image.c
diffstat 5 files changed, 1101 insertions(+), 430 deletions(-) [+]
line wrap: on
line diff
--- a/configure	Thu Apr 01 18:29:04 2010 +0300
+++ b/configure	Fri Apr 02 23:09:13 2010 +0200
@@ -1,6 +1,6 @@
 #! /bin/sh
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.62 for emacs 24.0.50.
+# Generated by GNU Autoconf 2.63 for emacs 24.0.50.
 #
 # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
 # 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
@@ -638,150 +638,152 @@
 ac_config_libobj_dir=src
 ac_header_list=
 ac_func_list=
-ac_subst_vars='SHELL
-PATH_SEPARATOR
-PACKAGE_NAME
-PACKAGE_TARNAME
-PACKAGE_VERSION
-PACKAGE_STRING
-PACKAGE_BUGREPORT
-exec_prefix
-prefix
-program_transform_name
-bindir
-sbindir
-libexecdir
-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
-MAINT
-build
-build_cpu
-build_vendor
-build_os
-host
-host_cpu
-host_vendor
-host_os
-CC
-CFLAGS
-LDFLAGS
-CPPFLAGS
-ac_ct_CC
-EXEEXT
-OBJEXT
-CPP
-GREP
-EGREP
-LN_S
-INSTALL_PROGRAM
-INSTALL_SCRIPT
-INSTALL_DATA
-RANLIB
-INSTALL_INFO
-GZIP_PROG
-MAKEINFO
-LIBSOUND
-PKG_CONFIG
-ALSA_CFLAGS
-ALSA_LIBS
-CFLAGS_SOUND
-SET_MAKE
-XMKMF
+ac_subst_vars='LTLIBOBJS
+OTHER_FILES
+LIB_SRC_EXTRA_INSTALLABLES
+GNU_OBJC_CFLAGS
+GNUSTEP_SYSTEM_LIBRARIES
+GNUSTEP_SYSTEM_HEADERS
+GNUSTEP_MAKEFILES
+ns_appsrc
+ns_appresdir
+ns_appbindir
+ns_appdir
+opsysfile
+machfile
+X_TOOLKIT_TYPE
+C_SWITCH_X_SITE
+LD_SWITCH_X_SITE_AUX
+LD_SWITCH_X_SITE
+c_switch_machine
+c_switch_system
+gameuser
+gamedir
+bitmapdir
+archlibdir
+etcdir
+x_default_search_path
+lisppath
+locallisppath
+lispdir
+srcdir
+canonical
+configuration
+version
+KRB4LIB
+DESLIB
+KRB5LIB
+CRYPTOLIB
+COM_ERRLIB
+LIBRESOLV
+LIBHESIOD
+GETOPTOBJS
+GETOPT_H
+GETLOADAVG_LIBS
+KMEM_GROUP
+NEED_SETGID
+LIBOBJS
+LIBS_MAIL
+liblockfile
+ALLOCA
+LIBGPM
+LIBGIF
+LIBTIFF
+LIBPNG
+LIBJPEG
+LIBXPM
+FREETYPE_LIBS
+FREETYPE_CFLAGS
+M17N_FLT_LIBS
+M17N_FLT_CFLAGS
+LIBOTF_LIBS
+LIBOTF_CFLAGS
+XFT_LIBS
+XFT_CFLAGS
+FONTCONFIG_LIBS
+FONTCONFIG_CFLAGS
+GCONF_LIBS
+GCONF_CFLAGS
+DBUS_LIBS
+DBUS_CFLAGS
+GTK_LIBS
+GTK_CFLAGS
+IMAGEMAGICK_LIBS
+IMAGEMAGICK_CFLAGS
+RSVG_LIBS
+RSVG_CFLAGS
 HAVE_XSERVER
-RSVG_CFLAGS
-RSVG_LIBS
-GTK_CFLAGS
-GTK_LIBS
-DBUS_CFLAGS
-DBUS_LIBS
-GCONF_CFLAGS
-GCONF_LIBS
-FONTCONFIG_CFLAGS
-FONTCONFIG_LIBS
-XFT_CFLAGS
-XFT_LIBS
-LIBOTF_CFLAGS
-LIBOTF_LIBS
-M17N_FLT_CFLAGS
-M17N_FLT_LIBS
-FREETYPE_CFLAGS
-FREETYPE_LIBS
-LIBXPM
-LIBJPEG
-LIBPNG
-LIBTIFF
-LIBGIF
-LIBGPM
-ALLOCA
-liblockfile
-LIBS_MAIL
-LIBOBJS
-NEED_SETGID
-KMEM_GROUP
-GETLOADAVG_LIBS
-GETOPT_H
-GETOPTOBJS
-LIBHESIOD
-LIBRESOLV
-COM_ERRLIB
-CRYPTOLIB
-KRB5LIB
-DESLIB
-KRB4LIB
-version
-configuration
-canonical
-srcdir
-lispdir
-locallisppath
-lisppath
-x_default_search_path
-etcdir
-archlibdir
-bitmapdir
-gamedir
-gameuser
-c_switch_system
-c_switch_machine
-LD_SWITCH_X_SITE
-LD_SWITCH_X_SITE_AUX
-C_SWITCH_X_SITE
-X_TOOLKIT_TYPE
-machfile
-opsysfile
-ns_appdir
-ns_appbindir
-ns_appresdir
-ns_appsrc
-GNUSTEP_MAKEFILES
-GNUSTEP_SYSTEM_HEADERS
-GNUSTEP_SYSTEM_LIBRARIES
-GNU_OBJC_CFLAGS
-LIB_SRC_EXTRA_INSTALLABLES
-OTHER_FILES
-LTLIBOBJS'
+XMKMF
+SET_MAKE
+CFLAGS_SOUND
+ALSA_LIBS
+ALSA_CFLAGS
+PKG_CONFIG
+LIBSOUND
+MAKEINFO
+GZIP_PROG
+INSTALL_INFO
+RANLIB
+INSTALL_DATA
+INSTALL_SCRIPT
+INSTALL_PROGRAM
+LN_S
+EGREP
+GREP
+CPP
+OBJEXT
+EXEEXT
+ac_ct_CC
+CPPFLAGS
+LDFLAGS
+CFLAGS
+CC
+host_os
+host_vendor
+host_cpu
+host
+build_os
+build_vendor
+build_cpu
+build
+MAINT
+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
+SHELL'
 ac_subst_files=''
 ac_user_opts='
 enable_option_checking
@@ -801,6 +803,7 @@
 with_gif
 with_png
 with_rsvg
+with_imagemagick
 with_xft
 with_libotf
 with_m17n_flt
@@ -1258,9 +1261,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
 
@@ -1313,7 +1316,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
@@ -1512,6 +1515,7 @@
   --without-gif           don't compile with GIF image support
   --without-png           don't compile with PNG image support
   --without-rsvg          don't compile with SVG image support
+  --with-imagemagick      compile with ImageMagick image support
   --without-xft           don't use XFT for anti aliased fonts
   --without-libotf        don't use libotf for OpenType font support
   --without-m17n-flt      don't use m17n-flt for text shaping
@@ -1610,7 +1614,7 @@
 if $ac_init_version; then
   cat <<\_ACEOF
 emacs configure 24.0.50
-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.
@@ -1624,7 +1628,7 @@
 running configure, to aid debugging if configure makes a mistake.
 
 It was created by emacs $as_me 24.0.50, which was
-generated by GNU Autoconf 2.62.  Invocation command line was
+generated by GNU Autoconf 2.63.  Invocation command line was
 
   $ $0 $@
 
@@ -1747,8 +1751,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) ;; #(
@@ -1954,6 +1958,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
@@ -2233,6 +2239,14 @@
 fi
 
 
+# Check whether --with-imagemagick was given.
+if test "${with_imagemagick+set}" = set; then
+  withval=$with_imagemagick;
+else
+      with_imagemagick=no
+fi
+
+
 
 # Check whether --with-xft was given.
 if test "${with_xft+set}" = set; then
@@ -2773,15 +2787,6 @@
     esac
   ;;
 
-  ## LynxOS ports
-  *-*-lynxos* )
-    opsys=lynxos
-    case "${canonical}" in
-      i[3456]86-*-lynxos*) machine=intel386 ;;
-      powerpc-*-lynxos*) machine=powerpc ;;
-    esac
-  ;;
-
   alpha*-*-linux-gnu* )
     machine=alpha opsys=gnu-linux
   ;;
@@ -2865,30 +2870,14 @@
 
   *-sun-solaris* \
     | i[3456]86-*-solaris2* | i[3456]86-*-sunos5* \
-    | x86_64-*-solaris2*    | x86_64-*-sunos5*    \
-    | powerpc*-*-solaris2*  | rs6000-*-solaris2*)
+    | x86_64-*-solaris2*    | x86_64-*-sunos5*)
     case "${canonical}" in
       i[3456]86-*-* )     machine=intel386 ;;
       amd64-*-*|x86_64-*-*)	machine=amdx86-64 ;;
-      powerpc* | rs6000* )  machine=ibmrs6000 ;;
       sparc* )		machine=sparc ;;
       * )		unported=yes ;;
     esac
     case "${canonical}" in
-      *-sunos5.3* | *-solaris2.3* )
-		opsys=sol2-3
-		NON_GNU_CPP=/usr/ccs/lib/cpp
-		;;
-      *-sunos5.4* | *-solaris2.4* )
-		opsys=sol2-4
-		NON_GNU_CPP=/usr/ccs/lib/cpp
-		RANLIB="ar -ts"
-		;;
-      *-sunos5.5* | *-solaris2.5* )
-		opsys=sol2-5
-		NON_GNU_CPP=/usr/ccs/lib/cpp
-		RANLIB="ar -ts"
-		;;
       *-sunos5.6* | *-solaris2.6* )
 		opsys=sol2-6
 		NON_GNU_CPP=/usr/ccs/lib/cpp
@@ -2979,22 +2968,6 @@
 if test x"${opsys}" = x; then
   case "${canonical}" in
     *-gnu* )				opsys=gnu ;;
-    *-sysv4.2uw* )			opsys=unixware ;;
-    *-sysv5uw* )			opsys=unixware ;;
-    *-sysv5OpenUNIX* )			opsys=unixware ;;
-    *-sysv4.1* | *-sysvr4.1* )
-	NON_GNU_CPP=/usr/lib/cpp
-	opsys=usg5-4 ;;
-    *-sysv4.[2-9]* | *-sysvr4.[2-9]* )
-	if [ x$NON_GNU_CPP = x ]; then
-	  if [ -f /usr/ccs/lib/cpp ]; then
-	    NON_GNU_CPP=/usr/ccs/lib/cpp
-	  else
-	    NON_GNU_CPP=/lib/cpp
-	  fi
-	fi
-	opsys=usg5-4-2 ;;
-    *-sysv4* | *-sysvr4* )		opsys=usg5-4 ;;
     * )
       unported=yes
     ;;
@@ -3108,12 +3081,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
@@ -3312,12 +3281,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
@@ -3327,11 +3292,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
@@ -3461,11 +3428,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
@@ -3493,13 +3462,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
@@ -3542,11 +3513,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
@@ -3600,11 +3573,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
@@ -4276,11 +4251,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
@@ -4663,8 +4640,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
@@ -4802,7 +4780,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=
@@ -5250,11 +5228,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
@@ -5439,12 +5419,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
@@ -5819,10 +5795,6 @@
 configure___ use_mmap_for_buffers=no
 #endif
 
-#ifndef C_DEBUG_SWITCH
-#define C_DEBUG_SWITCH -g
-#endif
-
 #ifndef C_OPTIMIZE_SWITCH
 #ifdef __GNUC__
 #define C_OPTIMIZE_SWITCH -O2
@@ -5854,18 +5826,18 @@
 
 /* Get the CFLAGS for tests in configure.  */
 #ifdef __GNUC__
-configure___ CFLAGS=C_DEBUG_SWITCH C_OPTIMIZE_SWITCH '${SPECIFIED_CFLAGS}'
-#else
-configure___ CFLAGS=C_DEBUG_SWITCH '${SPECIFIED_CFLAGS}'
+configure___ CFLAGS=C_OPTIMIZE_SWITCH '${SPECIFIED_CFLAGS}'
+#else
+configure___ CFLAGS='${SPECIFIED_CFLAGS}'
 #endif
 
 #else /* not THIS_IS_CONFIGURE */
 
 /* Get the CFLAGS for real compilation.  */
 #ifdef __GNUC__
-configure___ REAL_CFLAGS=C_DEBUG_SWITCH C_OPTIMIZE_SWITCH C_WARNINGS_SWITCH ${PROFILING_CFLAGS} '${SPECIFIED_CFLAGS}'
-#else
-configure___ REAL_CFLAGS=C_DEBUG_SWITCH '${SPECIFIED_CFLAGS}'
+configure___ REAL_CFLAGS=C_OPTIMIZE_SWITCH C_WARNINGS_SWITCH ${PROFILING_CFLAGS} '${SPECIFIED_CFLAGS}'
+#else
+configure___ REAL_CFLAGS='${SPECIFIED_CFLAGS}'
 #endif
 
 #endif /* not THIS_IS_CONFIGURE */
@@ -6413,8 +6385,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
@@ -6489,7 +6462,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
   LIBSOUND=-lossaudio
 else
   LIBSOUND=
@@ -6867,8 +6840,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
@@ -6981,8 +6955,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
@@ -7284,7 +7259,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
@@ -7355,7 +7330,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
@@ -7897,8 +7872,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
@@ -7961,8 +7937,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
@@ -8135,7 +8112,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
@@ -8205,7 +8182,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
@@ -8386,7 +8363,7 @@
 fi
 { $as_echo "$as_me:$LINENO: result: $ac_cv_member_struct_tm_tm_gmtoff" >&5
 $as_echo "$ac_cv_member_struct_tm_tm_gmtoff" >&6; }
-if test $ac_cv_member_struct_tm_tm_gmtoff = yes; then
+if test "x$ac_cv_member_struct_tm_tm_gmtoff" = x""yes; then
 
 cat >>confdefs.h <<\_ACEOF
 #define HAVE_TM_GMTOFF 1
@@ -8503,7 +8480,7 @@
 fi
 { $as_echo "$as_me:$LINENO: result: $ac_cv_member_struct_ifreq_ifr_flags" >&5
 $as_echo "$ac_cv_member_struct_ifreq_ifr_flags" >&6; }
-if test $ac_cv_member_struct_ifreq_ifr_flags = yes; then
+if test "x$ac_cv_member_struct_ifreq_ifr_flags" = x""yes; then
 
 cat >>confdefs.h <<_ACEOF
 #define HAVE_STRUCT_IFREQ_IFR_FLAGS 1
@@ -8620,7 +8597,7 @@
 fi
 { $as_echo "$as_me:$LINENO: result: $ac_cv_member_struct_ifreq_ifr_hwaddr" >&5
 $as_echo "$ac_cv_member_struct_ifreq_ifr_hwaddr" >&6; }
-if test $ac_cv_member_struct_ifreq_ifr_hwaddr = yes; then
+if test "x$ac_cv_member_struct_ifreq_ifr_hwaddr" = x""yes; then
 
 cat >>confdefs.h <<_ACEOF
 #define HAVE_STRUCT_IFREQ_IFR_HWADDR 1
@@ -8737,7 +8714,7 @@
 fi
 { $as_echo "$as_me:$LINENO: result: $ac_cv_member_struct_ifreq_ifr_netmask" >&5
 $as_echo "$ac_cv_member_struct_ifreq_ifr_netmask" >&6; }
-if test $ac_cv_member_struct_ifreq_ifr_netmask = yes; then
+if test "x$ac_cv_member_struct_ifreq_ifr_netmask" = x""yes; then
 
 cat >>confdefs.h <<_ACEOF
 #define HAVE_STRUCT_IFREQ_IFR_NETMASK 1
@@ -8854,7 +8831,7 @@
 fi
 { $as_echo "$as_me:$LINENO: result: $ac_cv_member_struct_ifreq_ifr_broadaddr" >&5
 $as_echo "$ac_cv_member_struct_ifreq_ifr_broadaddr" >&6; }
-if test $ac_cv_member_struct_ifreq_ifr_broadaddr = yes; then
+if test "x$ac_cv_member_struct_ifreq_ifr_broadaddr" = x""yes; then
 
 cat >>confdefs.h <<_ACEOF
 #define HAVE_STRUCT_IFREQ_IFR_BROADADDR 1
@@ -8971,7 +8948,7 @@
 fi
 { $as_echo "$as_me:$LINENO: result: $ac_cv_member_struct_ifreq_ifr_addr" >&5
 $as_echo "$ac_cv_member_struct_ifreq_ifr_addr" >&6; }
-if test $ac_cv_member_struct_ifreq_ifr_addr = yes; then
+if test "x$ac_cv_member_struct_ifreq_ifr_addr" = x""yes; then
 
 cat >>confdefs.h <<_ACEOF
 #define HAVE_STRUCT_IFREQ_IFR_ADDR 1
@@ -9402,8 +9379,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
@@ -9441,7 +9418,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
@@ -9850,7 +9827,7 @@
 $as_echo "$ac_cv_header_AppKit_AppKit_h" >&6; }
 
 fi
-if test $ac_cv_header_AppKit_AppKit_h = yes; then
+if test "x$ac_cv_header_AppKit_AppKit_h" = x""yes; then
   HAVE_NS=yes
 else
   { { $as_echo "$as_me:$LINENO: error: \`--with-ns' was specified, but the include
@@ -10098,7 +10075,7 @@
 fi
 { $as_echo "$as_me:$LINENO: result: $ac_cv_func_malloc_get_state" >&5
 $as_echo "$ac_cv_func_malloc_get_state" >&6; }
-if test $ac_cv_func_malloc_get_state = yes; then
+if test "x$ac_cv_func_malloc_get_state" = x""yes; then
   :
 else
   doug_lea_malloc=no
@@ -10189,7 +10166,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
@@ -10411,8 +10388,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
@@ -10512,8 +10490,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
@@ -10782,7 +10761,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
   cat >>confdefs.h <<_ACEOF
 #define HAVE_LIBDNET 1
 _ACEOF
@@ -10851,7 +10830,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
   LD_SWITCH_X_SITE="$LD_SWITCH_X_SITE -lXbsd"
 fi
 
@@ -10922,7 +10901,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
@@ -11305,8 +11284,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
@@ -11506,6 +11486,121 @@
   fi
 fi
 
+HAVE_IMAGEMAGICK=no
+if test "${HAVE_X11}" = "yes" ; then
+  if test "${with_imagemagick}" != "no"; then
+    IMAGEMAGICK_REQUIRED=1
+    IMAGEMAGICK_MODULE="MagickWand >= $IMAGEMAGICK_REQUIRED"
+
+
+  succeeded=no
+
+  # Extract the first word of "pkg-config", so it can be a program name with args.
+set dummy pkg-config; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_path_PKG_CONFIG+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  case $PKG_CONFIG in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+  test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no"
+  ;;
+esac
+fi
+PKG_CONFIG=$ac_cv_path_PKG_CONFIG
+if test -n "$PKG_CONFIG"; then
+  { $as_echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5
+$as_echo "$PKG_CONFIG" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+
+  if test "$PKG_CONFIG" = "no" ; then
+     :
+  else
+     PKG_CONFIG_MIN_VERSION=0.9.0
+     if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then
+        { $as_echo "$as_me:$LINENO: checking for $IMAGEMAGICK_MODULE" >&5
+$as_echo_n "checking for $IMAGEMAGICK_MODULE... " >&6; }
+
+        if $PKG_CONFIG --exists "$IMAGEMAGICK_MODULE" 2>&5; then
+            { $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
+            succeeded=yes
+
+            { $as_echo "$as_me:$LINENO: checking IMAGEMAGICK_CFLAGS" >&5
+$as_echo_n "checking IMAGEMAGICK_CFLAGS... " >&6; }
+            IMAGEMAGICK_CFLAGS=`$PKG_CONFIG --cflags "$IMAGEMAGICK_MODULE"|sed -e 's,///*,/,g'`
+            { $as_echo "$as_me:$LINENO: result: $IMAGEMAGICK_CFLAGS" >&5
+$as_echo "$IMAGEMAGICK_CFLAGS" >&6; }
+
+            { $as_echo "$as_me:$LINENO: checking IMAGEMAGICK_LIBS" >&5
+$as_echo_n "checking IMAGEMAGICK_LIBS... " >&6; }
+            IMAGEMAGICK_LIBS=`$PKG_CONFIG --libs "$IMAGEMAGICK_MODULE"|sed -e 's,///*,/,g'`
+            { $as_echo "$as_me:$LINENO: result: $IMAGEMAGICK_LIBS" >&5
+$as_echo "$IMAGEMAGICK_LIBS" >&6; }
+        else
+            { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+            IMAGEMAGICK_CFLAGS=""
+            IMAGEMAGICK_LIBS=""
+            ## If we have a custom action on failure, don't print errors, but
+            ## do set a variable so people can do so.
+            IMAGEMAGICK_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$IMAGEMAGICK_MODULE"`
+
+        fi
+
+
+
+     else
+        echo "*** Your version of pkg-config is too old. You need version $PKG_CONFIG_MIN_VERSION or newer."
+        echo "*** See http://www.freedesktop.org/software/pkgconfig"
+     fi
+  fi
+
+  if test $succeeded = yes; then
+     :
+  else
+     :
+  fi
+
+
+
+
+    if test ".${IMAGEMAGICK_CFLAGS}" != "."; then
+      HAVE_IMAGEMAGICK=yes
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_IMAGEMAGICK 1
+_ACEOF
+
+      CFLAGS="$CFLAGS $IMAGEMAGICK_CFLAGS"
+      LIBS="$IMAGEMAGICK_LIBS $LIBS"
+    fi
+  fi
+fi
 
 HAVE_GTK=no
 if test "${with_gtk}" = "yes" || test "$USE_X_TOOLKIT" = "maybe"; then
@@ -11714,8 +11809,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
@@ -11853,8 +11949,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
@@ -11926,7 +12023,7 @@
 fi
 { $as_echo "$as_me:$LINENO: result: $ac_cv_have_decl_GTK_TYPE_FILE_SELECTION" >&5
 $as_echo "$ac_cv_have_decl_GTK_TYPE_FILE_SELECTION" >&6; }
-if test $ac_cv_have_decl_GTK_TYPE_FILE_SELECTION = yes; then
+if test "x$ac_cv_have_decl_GTK_TYPE_FILE_SELECTION" = x""yes; then
   HAVE_GTK_FILE_SELECTION=yes
 else
   HAVE_GTK_FILE_SELECTION=no
@@ -12024,8 +12121,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
@@ -12093,7 +12191,7 @@
 fi
 { $as_echo "$as_me:$LINENO: result: $ac_cv_have_decl_GTK_TYPE_FILE_CHOOSER" >&5
 $as_echo "$ac_cv_have_decl_GTK_TYPE_FILE_CHOOSER" >&6; }
-if test $ac_cv_have_decl_GTK_TYPE_FILE_CHOOSER = yes; then
+if test "x$ac_cv_have_decl_GTK_TYPE_FILE_CHOOSER" = x""yes; then
   HAVE_GTK_FILE_CHOOSER=yes
 else
   HAVE_GTK_FILE_CHOOSER=no
@@ -12191,8 +12289,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
@@ -12350,8 +12449,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
@@ -12426,7 +12526,7 @@
 fi
 { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_pthread_pthread_self" >&5
 $as_echo "$ac_cv_lib_pthread_pthread_self" >&6; }
-if test $ac_cv_lib_pthread_pthread_self = yes; then
+if test "x$ac_cv_lib_pthread_pthread_self" = x""yes; then
   HAVE_GTK_AND_PTHREAD=yes
 fi
 
@@ -12639,8 +12739,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
@@ -13049,7 +13150,7 @@
 fi
 { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_Xmu_XmuConvertStandardSelection" >&5
 $as_echo "$ac_cv_lib_Xmu_XmuConvertStandardSelection" >&6; }
-if test $ac_cv_lib_Xmu_XmuConvertStandardSelection = yes; then
+if test "x$ac_cv_lib_Xmu_XmuConvertStandardSelection" = x""yes; then
   cat >>confdefs.h <<_ACEOF
 #define HAVE_LIBXMU 1
 _ACEOF
@@ -13130,7 +13231,7 @@
 fi
 { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_Xext_XShapeQueryExtension" >&5
 $as_echo "$ac_cv_lib_Xext_XShapeQueryExtension" >&6; }
-if test $ac_cv_lib_Xext_XShapeQueryExtension = yes; then
+if test "x$ac_cv_lib_Xext_XShapeQueryExtension" = x""yes; then
   cat >>confdefs.h <<_ACEOF
 #define HAVE_LIBXEXT 1
 _ACEOF
@@ -13270,7 +13371,7 @@
 fi
 { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_Xp_XpCreateContext" >&5
 $as_echo "$ac_cv_lib_Xp_XpCreateContext" >&6; }
-if test $ac_cv_lib_Xp_XpCreateContext = yes; then
+if test "x$ac_cv_lib_Xp_XpCreateContext" = x""yes; then
   HAVE_LIBXP=yes
 fi
 
@@ -13795,7 +13896,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
   HAVE_XRENDER=yes
 fi
 
@@ -13934,7 +14035,7 @@
 $as_echo "$ac_cv_header_X11_Xft_Xft_h" >&6; }
 
 fi
-if test $ac_cv_header_X11_Xft_Xft_h = yes; then
+if test "x$ac_cv_header_X11_Xft_Xft_h" = x""yes; then
   { $as_echo "$as_me:$LINENO: checking for XftFontOpen in -lXft" >&5
 $as_echo_n "checking for XftFontOpen in -lXft... " >&6; }
 if test "${ac_cv_lib_Xft_XftFontOpen+set}" = set; then
@@ -14000,7 +14101,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
   HAVE_XFT=yes
 fi
 
@@ -14211,7 +14312,7 @@
 fi
 { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_otf_OTF_get_variation_glyphs" >&5
 $as_echo "$ac_cv_lib_otf_OTF_get_variation_glyphs" >&6; }
-if test $ac_cv_lib_otf_OTF_get_variation_glyphs = yes; then
+if test "x$ac_cv_lib_otf_OTF_get_variation_glyphs" = x""yes; then
   HAVE_OTF_GET_VARIATION_GLYPHS=yes
 else
   HAVE_OTF_GET_VARIATION_GLYPHS=no
@@ -14483,7 +14584,7 @@
 $as_echo "$ac_cv_header_X11_xpm_h" >&6; }
 
 fi
-if test $ac_cv_header_X11_xpm_h = yes; then
+if test "x$ac_cv_header_X11_xpm_h" = x""yes; then
   { $as_echo "$as_me:$LINENO: checking for XpmReadFileToPixmap in -lXpm" >&5
 $as_echo_n "checking for XpmReadFileToPixmap in -lXpm... " >&6; }
 if test "${ac_cv_lib_Xpm_XpmReadFileToPixmap+set}" = set; then
@@ -14549,7 +14650,7 @@
 fi
 { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_Xpm_XpmReadFileToPixmap" >&5
 $as_echo "$ac_cv_lib_Xpm_XpmReadFileToPixmap" >&6; }
-if test $ac_cv_lib_Xpm_XpmReadFileToPixmap = yes; then
+if test "x$ac_cv_lib_Xpm_XpmReadFileToPixmap" = x""yes; then
   HAVE_XPM=yes
 fi
 
@@ -14733,7 +14834,7 @@
 $as_echo "$ac_cv_header_jerror_h" >&6; }
 
 fi
-if test $ac_cv_header_jerror_h = yes; then
+if test "x$ac_cv_header_jerror_h" = x""yes; then
   { $as_echo "$as_me:$LINENO: checking for jpeg_destroy_compress in -ljpeg" >&5
 $as_echo_n "checking for jpeg_destroy_compress in -ljpeg... " >&6; }
 if test "${ac_cv_lib_jpeg_jpeg_destroy_compress+set}" = set; then
@@ -14799,7 +14900,7 @@
 fi
 { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_jpeg_jpeg_destroy_compress" >&5
 $as_echo "$ac_cv_lib_jpeg_jpeg_destroy_compress" >&6; }
-if test $ac_cv_lib_jpeg_jpeg_destroy_compress = yes; then
+if test "x$ac_cv_lib_jpeg_jpeg_destroy_compress" = x""yes; then
   HAVE_JPEG=yes
 fi
 
@@ -14987,8 +15088,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
@@ -15063,7 +15165,7 @@
 fi
 { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_png_png_get_channels" >&5
 $as_echo "$ac_cv_lib_png_png_get_channels" >&6; }
-if test $ac_cv_lib_png_png_get_channels = yes; then
+if test "x$ac_cv_lib_png_png_get_channels" = x""yes; then
   HAVE_PNG=yes
 fi
 
@@ -15213,7 +15315,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
   tifflibs="-lz -lm"
       # At least one tiff package requires the jpeg library.
       if test "${HAVE_JPEG}" = yes; then tifflibs="-ljpeg $tifflibs"; fi
@@ -15282,7 +15384,7 @@
 fi
 { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_tiff_TIFFGetVersion" >&5
 $as_echo "$ac_cv_lib_tiff_TIFFGetVersion" >&6; }
-if test $ac_cv_lib_tiff_TIFFGetVersion = yes; then
+if test "x$ac_cv_lib_tiff_TIFFGetVersion" = x""yes; then
   HAVE_TIFF=yes
 fi
 
@@ -15433,7 +15535,7 @@
 $as_echo "$ac_cv_header_gif_lib_h" >&6; }
 
 fi
-if test $ac_cv_header_gif_lib_h = yes; then
+if test "x$ac_cv_header_gif_lib_h" = x""yes; then
   # EGifPutExtensionLast only exists from version libungif-4.1.0b1.
 # Earlier versions can crash Emacs.
     { $as_echo "$as_me:$LINENO: checking for EGifPutExtensionLast in -lgif" >&5
@@ -15501,7 +15603,7 @@
 fi
 { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_gif_EGifPutExtensionLast" >&5
 $as_echo "$ac_cv_lib_gif_EGifPutExtensionLast" >&6; }
-if test $ac_cv_lib_gif_EGifPutExtensionLast = yes; then
+if test "x$ac_cv_lib_gif_EGifPutExtensionLast" = x""yes; then
   HAVE_GIF=yes
 else
   HAVE_GIF=maybe
@@ -15580,7 +15682,7 @@
 fi
 { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_ungif_EGifPutExtensionLast" >&5
 $as_echo "$ac_cv_lib_ungif_EGifPutExtensionLast" >&6; }
-if test $ac_cv_lib_ungif_EGifPutExtensionLast = yes; then
+if test "x$ac_cv_lib_ungif_EGifPutExtensionLast" = x""yes; then
   HAVE_GIF=yes
 else
   HAVE_GIF=no
@@ -15761,7 +15863,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; }
 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
@@ -15827,7 +15929,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
 
@@ -15973,7 +16075,7 @@
 $as_echo "$ac_cv_header_malloc_malloc_h" >&6; }
 
 fi
-if test $ac_cv_header_malloc_malloc_h = yes; then
+if test "x$ac_cv_header_malloc_malloc_h" = x""yes; then
 
 cat >>confdefs.h <<\_ACEOF
 #define HAVE_MALLOC_MALLOC_H 1
@@ -16149,7 +16251,7 @@
 $as_echo "$ac_cv_header_X11_SM_SMlib_h" >&6; }
 
 fi
-if test $ac_cv_header_X11_SM_SMlib_h = yes; then
+if test "x$ac_cv_header_X11_SM_SMlib_h" = x""yes; then
   { $as_echo "$as_me:$LINENO: checking for SmcOpenConnection in -lSM" >&5
 $as_echo_n "checking for SmcOpenConnection in -lSM... " >&6; }
 if test "${ac_cv_lib_SM_SmcOpenConnection+set}" = set; then
@@ -16215,7 +16317,7 @@
 fi
 { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_SM_SmcOpenConnection" >&5
 $as_echo "$ac_cv_lib_SM_SmcOpenConnection" >&6; }
-if test $ac_cv_lib_SM_SmcOpenConnection = yes; then
+if test "x$ac_cv_lib_SM_SmcOpenConnection" = x""yes; then
   HAVE_X_SM=yes
 fi
 
@@ -16581,8 +16683,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
@@ -16751,7 +16854,7 @@
 fi
 { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_m_sqrt" >&5
 $as_echo "$ac_cv_lib_m_sqrt" >&6; }
-if test $ac_cv_lib_m_sqrt = yes; then
+if test "x$ac_cv_lib_m_sqrt" = x""yes; then
   cat >>confdefs.h <<_ACEOF
 #define HAVE_LIBM 1
 _ACEOF
@@ -16828,7 +16931,7 @@
 fi
 { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_mail_maillock" >&5
 $as_echo "$ac_cv_lib_mail_maillock" >&6; }
-if test $ac_cv_lib_mail_maillock = yes; then
+if test "x$ac_cv_lib_mail_maillock" = x""yes; then
   have_mail=yes
 else
   have_mail=no
@@ -16910,7 +17013,7 @@
 fi
 { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_lockfile_maillock" >&5
 $as_echo "$ac_cv_lib_lockfile_maillock" >&6; }
-if test $ac_cv_lib_lockfile_maillock = yes; then
+if test "x$ac_cv_lib_lockfile_maillock" = x""yes; then
   have_lockfile=yes
 else
   have_lockfile=no
@@ -17068,8 +17171,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
@@ -17212,8 +17316,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
@@ -17394,8 +17499,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
@@ -17539,8 +17645,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
@@ -17688,8 +17795,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
@@ -17796,8 +17904,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
@@ -18182,7 +18291,7 @@
 fi
 { $as_echo "$as_me:$LINENO: result: $ac_cv_func_getloadavg" >&5
 $as_echo "$ac_cv_func_getloadavg" >&6; }
-if test $ac_cv_func_getloadavg = yes; then
+if test "x$ac_cv_func_getloadavg" = x""yes; then
   exit 0
 else
   exit 1
@@ -18281,8 +18390,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
@@ -18358,7 +18468,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
@@ -18439,7 +18549,7 @@
 fi
 { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_elf_elf_begin" >&5
 $as_echo "$ac_cv_lib_elf_elf_begin" >&6; }
-if test $ac_cv_lib_elf_elf_begin = yes; then
+if test "x$ac_cv_lib_elf_elf_begin" = x""yes; then
   LIBS="-lelf $LIBS"
 fi
 
@@ -18510,7 +18620,7 @@
 fi
 { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_kvm_kvm_open" >&5
 $as_echo "$ac_cv_lib_kvm_kvm_open" >&6; }
-if test $ac_cv_lib_kvm_kvm_open = yes; then
+if test "x$ac_cv_lib_kvm_kvm_open" = x""yes; then
   LIBS="-lkvm $LIBS"
 fi
 
@@ -18580,7 +18690,7 @@
 fi
 { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_util_getloadavg" >&5
 $as_echo "$ac_cv_lib_util_getloadavg" >&6; }
-if test $ac_cv_lib_util_getloadavg = yes; then
+if test "x$ac_cv_lib_util_getloadavg" = x""yes; then
   LIBS="-lutil $LIBS" ac_have_func=yes ac_cv_func_getloadavg_setgid=yes
 fi
 
@@ -18656,7 +18766,7 @@
 fi
 { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_getloadavg_getloadavg" >&5
 $as_echo "$ac_cv_lib_getloadavg_getloadavg" >&6; }
-if test $ac_cv_lib_getloadavg_getloadavg = yes; then
+if test "x$ac_cv_lib_getloadavg_getloadavg" = x""yes; then
   LIBS="-lgetloadavg $LIBS"
 else
   LIBS=$ac_getloadavg_LIBS
@@ -18757,8 +18867,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
@@ -18904,7 +19015,7 @@
 $as_echo "$ac_cv_header_sys_dg_sys_info_h" >&6; }
 
 fi
-if test $ac_cv_header_sys_dg_sys_info_h = yes; then
+if test "x$ac_cv_header_sys_dg_sys_info_h" = x""yes; then
   ac_have_func=yes
 
 cat >>confdefs.h <<\_ACEOF
@@ -18977,7 +19088,7 @@
 fi
 { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_dgc_dg_sys_info" >&5
 $as_echo "$ac_cv_lib_dgc_dg_sys_info" >&6; }
-if test $ac_cv_lib_dgc_dg_sys_info = yes; then
+if test "x$ac_cv_lib_dgc_dg_sys_info" = x""yes; then
   cat >>confdefs.h <<_ACEOF
 #define HAVE_LIBDGC 1
 _ACEOF
@@ -19210,8 +19321,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
@@ -19360,7 +19472,7 @@
 $as_echo "$ac_cv_header_inq_stats_cpustats_h" >&6; }
 
 fi
-if test $ac_cv_header_inq_stats_cpustats_h = yes; then
+if test "x$ac_cv_header_inq_stats_cpustats_h" = x""yes; then
   ac_have_func=yes
 
 cat >>confdefs.h <<\_ACEOF
@@ -19505,7 +19617,7 @@
 $as_echo "$ac_cv_header_sys_cpustats_h" >&6; }
 
 fi
-if test $ac_cv_header_sys_cpustats_h = yes; then
+if test "x$ac_cv_header_sys_cpustats_h" = x""yes; then
   ac_have_func=yes; cat >>confdefs.h <<\_ACEOF
 #define UMAX 1
 _ACEOF
@@ -19651,8 +19763,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
@@ -19798,8 +19911,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
@@ -19900,7 +20014,7 @@
 fi
 { $as_echo "$as_me:$LINENO: result: $ac_cv_member_struct_nlist_n_un_n_name" >&5
 $as_echo "$ac_cv_member_struct_nlist_n_un_n_name" >&6; }
-if test $ac_cv_member_struct_nlist_n_un_n_name = yes; then
+if test "x$ac_cv_member_struct_nlist_n_un_n_name" = x""yes; then
 
 cat >>confdefs.h <<_ACEOF
 #define HAVE_STRUCT_NLIST_N_UN_N_NAME 1
@@ -20281,8 +20395,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
@@ -20385,8 +20500,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
@@ -20453,7 +20569,7 @@
 fi
 { $as_echo "$as_me:$LINENO: result: $ac_cv_have_decl_optreset" >&5
 $as_echo "$ac_cv_have_decl_optreset" >&6; }
-if test $ac_cv_have_decl_optreset = yes; then
+if test "x$ac_cv_have_decl_optreset" = x""yes; then
   GETOPT_H=getopt.h
 fi
 
@@ -20520,7 +20636,7 @@
 fi
 { $as_echo "$as_me:$LINENO: result: $ac_cv_have_decl_getopt_clip" >&5
 $as_echo "$ac_cv_have_decl_getopt_clip" >&6; }
-if test $ac_cv_have_decl_getopt_clip = yes; then
+if test "x$ac_cv_have_decl_getopt_clip" = x""yes; then
   gl_cv_func_gnu_getopt=no
 else
   gl_cv_func_gnu_getopt=yes
@@ -20765,8 +20881,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
@@ -20838,7 +20955,7 @@
 fi
 { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_intl_strftime" >&5
 $as_echo "$ac_cv_lib_intl_strftime" >&6; }
-if test $ac_cv_lib_intl_strftime = yes; then
+if test "x$ac_cv_lib_intl_strftime" = x""yes; then
   cat >>confdefs.h <<\_ACEOF
 #define HAVE_STRFTIME 1
 _ACEOF
@@ -20942,8 +21059,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
@@ -21044,8 +21162,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
@@ -21159,6 +21278,7 @@
    { (exit 1); exit 1; }; }
 fi
 # Must define this when any termcap library is found.
+
 cat >>confdefs.h <<\_ACEOF
 #define HAVE_LIBNCURSES 1
 _ACEOF
@@ -21375,7 +21495,7 @@
 fi
 { $as_echo "$as_me:$LINENO: result: $ac_cv_func_res_send" >&5
 $as_echo "$ac_cv_func_res_send" >&6; }
-if test $ac_cv_func_res_send = yes; then
+if test "x$ac_cv_func_res_send" = x""yes; then
   :
 else
   { $as_echo "$as_me:$LINENO: checking for __res_send" >&5
@@ -21463,7 +21583,7 @@
 fi
 { $as_echo "$as_me:$LINENO: result: $ac_cv_func___res_send" >&5
 $as_echo "$ac_cv_func___res_send" >&6; }
-if test $ac_cv_func___res_send = yes; then
+if test "x$ac_cv_func___res_send" = x""yes; then
   :
 else
   { $as_echo "$as_me:$LINENO: checking for res_send in -lresolv" >&5
@@ -21531,7 +21651,7 @@
 fi
 { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_resolv_res_send" >&5
 $as_echo "$ac_cv_lib_resolv_res_send" >&6; }
-if test $ac_cv_lib_resolv_res_send = yes; then
+if test "x$ac_cv_lib_resolv_res_send" = x""yes; then
   resolv=yes
 else
   { $as_echo "$as_me:$LINENO: checking for __res_send in -lresolv" >&5
@@ -21599,7 +21719,7 @@
 fi
 { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_resolv___res_send" >&5
 $as_echo "$ac_cv_lib_resolv___res_send" >&6; }
-if test $ac_cv_lib_resolv___res_send = yes; then
+if test "x$ac_cv_lib_resolv___res_send" = x""yes; then
   resolv=yes
 fi
 
@@ -21699,7 +21819,7 @@
 fi
 { $as_echo "$as_me:$LINENO: result: $ac_cv_func_hes_getmailhost" >&5
 $as_echo "$ac_cv_func_hes_getmailhost" >&6; }
-if test $ac_cv_func_hes_getmailhost = yes; then
+if test "x$ac_cv_func_hes_getmailhost" = x""yes; then
   :
 else
   { $as_echo "$as_me:$LINENO: checking for hes_getmailhost in -lhesiod" >&5
@@ -21767,7 +21887,7 @@
 fi
 { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_hesiod_hes_getmailhost" >&5
 $as_echo "$ac_cv_lib_hesiod_hes_getmailhost" >&6; }
-if test $ac_cv_lib_hesiod_hes_getmailhost = yes; then
+if test "x$ac_cv_lib_hesiod_hes_getmailhost" = x""yes; then
   hesiod=yes
 else
   :
@@ -21873,7 +21993,7 @@
 fi
 { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_com_err_com_err" >&5
 $as_echo "$ac_cv_lib_com_err_com_err" >&6; }
-if test $ac_cv_lib_com_err_com_err = yes; then
+if test "x$ac_cv_lib_com_err_com_err" = x""yes; then
   have_com_err=yes
 else
   have_com_err=no
@@ -21953,7 +22073,7 @@
 fi
 { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_crypto_mit_des_cbc_encrypt" >&5
 $as_echo "$ac_cv_lib_crypto_mit_des_cbc_encrypt" >&6; }
-if test $ac_cv_lib_crypto_mit_des_cbc_encrypt = yes; then
+if test "x$ac_cv_lib_crypto_mit_des_cbc_encrypt" = x""yes; then
   have_crypto=yes
 else
   have_crypto=no
@@ -22033,7 +22153,7 @@
 fi
 { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_k5crypto_mit_des_cbc_encrypt" >&5
 $as_echo "$ac_cv_lib_k5crypto_mit_des_cbc_encrypt" >&6; }
-if test $ac_cv_lib_k5crypto_mit_des_cbc_encrypt = yes; then
+if test "x$ac_cv_lib_k5crypto_mit_des_cbc_encrypt" = x""yes; then
   have_k5crypto=yes
 else
   have_k5crypto=no
@@ -22113,7 +22233,7 @@
 fi
 { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_krb5_krb5_init_context" >&5
 $as_echo "$ac_cv_lib_krb5_krb5_init_context" >&6; }
-if test $ac_cv_lib_krb5_krb5_init_context = yes; then
+if test "x$ac_cv_lib_krb5_krb5_init_context" = x""yes; then
   have_krb5=yes
 else
   have_krb5=no
@@ -22194,7 +22314,7 @@
 fi
 { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_des425_des_cbc_encrypt" >&5
 $as_echo "$ac_cv_lib_des425_des_cbc_encrypt" >&6; }
-if test $ac_cv_lib_des425_des_cbc_encrypt = yes; then
+if test "x$ac_cv_lib_des425_des_cbc_encrypt" = x""yes; then
   have_des425=yes
 else
   have_des425=no
@@ -22274,7 +22394,7 @@
 fi
 { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_des_des_cbc_encrypt" >&5
 $as_echo "$ac_cv_lib_des_des_cbc_encrypt" >&6; }
-if test $ac_cv_lib_des_des_cbc_encrypt = yes; then
+if test "x$ac_cv_lib_des_des_cbc_encrypt" = x""yes; then
   have_des=yes
 else
   have_des=no
@@ -22355,7 +22475,7 @@
 fi
 { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_krb4_krb_get_cred" >&5
 $as_echo "$ac_cv_lib_krb4_krb_get_cred" >&6; }
-if test $ac_cv_lib_krb4_krb_get_cred = yes; then
+if test "x$ac_cv_lib_krb4_krb_get_cred" = x""yes; then
   have_krb4=yes
 else
   have_krb4=no
@@ -22435,7 +22555,7 @@
 fi
 { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_krb_krb_get_cred" >&5
 $as_echo "$ac_cv_lib_krb_krb_get_cred" >&6; }
-if test $ac_cv_lib_krb_krb_get_cred = yes; then
+if test "x$ac_cv_lib_krb_krb_get_cred" = x""yes; then
   have_krb=yes
 else
   have_krb=no
@@ -22589,8 +22709,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
@@ -22691,7 +22812,7 @@
 fi
 { $as_echo "$as_me:$LINENO: result: $ac_cv_member_krb5_error_text" >&5
 $as_echo "$ac_cv_member_krb5_error_text" >&6; }
-if test $ac_cv_member_krb5_error_text = yes; then
+if test "x$ac_cv_member_krb5_error_text" = x""yes; then
 
 cat >>confdefs.h <<_ACEOF
 #define HAVE_KRB5_ERROR_TEXT 1
@@ -22796,7 +22917,7 @@
 fi
 { $as_echo "$as_me:$LINENO: result: $ac_cv_member_krb5_error_e_text" >&5
 $as_echo "$ac_cv_member_krb5_error_e_text" >&6; }
-if test $ac_cv_member_krb5_error_e_text = yes; then
+if test "x$ac_cv_member_krb5_error_e_text" = x""yes; then
 
 cat >>confdefs.h <<_ACEOF
 #define HAVE_KRB5_ERROR_E_TEXT 1
@@ -22945,8 +23066,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
@@ -23087,8 +23209,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
@@ -23229,8 +23352,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
@@ -23382,8 +23506,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
@@ -23524,8 +23649,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
@@ -23666,8 +23792,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
@@ -23820,8 +23947,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
@@ -23906,7 +24034,7 @@
 fi
 { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_intl_dgettext" >&5
 $as_echo "$ac_cv_lib_intl_dgettext" >&6; }
-if test $ac_cv_lib_intl_dgettext = yes; then
+if test "x$ac_cv_lib_intl_dgettext" = x""yes; then
   cat >>confdefs.h <<_ACEOF
 #define HAVE_LIBINTL 1
 _ACEOF
@@ -24106,8 +24234,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
@@ -24273,7 +24402,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
   :
 else
   ok_so_far=no
@@ -24407,7 +24536,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
   :
 else
   ok_so_far=no
@@ -24543,7 +24672,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
   :
 else
   ok_so_far=no
@@ -24694,8 +24823,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
@@ -24822,7 +24952,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
 
@@ -24967,8 +25097,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
@@ -25069,8 +25200,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
@@ -25494,7 +25626,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
 
 cat >>confdefs.h <<_ACEOF
 #define HAVE_SIZE_T 1
@@ -25936,6 +26068,7 @@
 echo "  Does Emacs use a gif library?                           ${HAVE_GIF} $LIBGIF"
 echo "  Does Emacs use -lpng?                                   ${HAVE_PNG}"
 echo "  Does Emacs use -lrsvg-2?                                ${HAVE_RSVG}"
+echo "  Does Emacs use imagemagick?                             ${HAVE_IMAGEMAGICK}"
 echo "  Does Emacs use -lgpm?                                   ${HAVE_GPM}"
 echo "  Does Emacs use -ldbus?                                  ${HAVE_DBUS}"
 echo "  Does Emacs use -lgconf?                                 ${HAVE_GCONF}"
@@ -26045,8 +26178,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) ;; #(
@@ -26438,7 +26571,7 @@
 # values after options handling.
 ac_log="
 This file was extended by emacs $as_me 24.0.50, 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
@@ -26451,6 +26584,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"
@@ -26464,16 +26606,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:
@@ -26491,7 +26634,7 @@
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 ac_cs_version="\\
 emacs config.status 24.0.50
-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.
@@ -26705,7 +26848,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
@@ -26910,9 +27054,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 {
@@ -26920,7 +27064,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
     }
   }
@@ -26944,8 +27088,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;;
@@ -27333,8 +27477,8 @@
   $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
+
+
--- a/configure.in	Thu Apr 01 18:29:04 2010 +0300
+++ b/configure.in	Fri Apr 02 23:09:13 2010 +0200
@@ -148,6 +148,7 @@
 OPTION_DEFAULT_ON([gif],[don't compile with GIF image support])
 OPTION_DEFAULT_ON([png],[don't compile with PNG image support])
 OPTION_DEFAULT_ON([rsvg],[don't compile with SVG image support])
+OPTION_DEFAULT_OFF([imagemagick],[compile with ImageMagick image support])
 
 OPTION_DEFAULT_ON([xft],[don't use XFT for anti aliased fonts])
 OPTION_DEFAULT_ON([libotf],[don't use libotf for OpenType font support])
@@ -1599,6 +1600,24 @@
   fi
 fi
 
+HAVE_IMAGEMAGICK=no
+if test "${HAVE_X11}" = "yes" ; then
+  if test "${with_imagemagick}" != "no"; then
+    IMAGEMAGICK_REQUIRED=1
+    IMAGEMAGICK_MODULE="MagickWand >= $IMAGEMAGICK_REQUIRED"
+
+    PKG_CHECK_MODULES(IMAGEMAGICK, $IMAGEMAGICK_MODULE, :, :)
+    AC_SUBST(IMAGEMAGICK_CFLAGS)
+    AC_SUBST(IMAGEMAGICK_LIBS)
+
+    if test ".${IMAGEMAGICK_CFLAGS}" != "."; then
+      HAVE_IMAGEMAGICK=yes
+      AC_DEFINE(HAVE_IMAGEMAGICK, 1, [Define to 1 if using imagemagick.])
+      CFLAGS="$CFLAGS $IMAGEMAGICK_CFLAGS"
+      LIBS="$IMAGEMAGICK_LIBS $LIBS"
+    fi    
+  fi
+fi
 
 HAVE_GTK=no
 if test "${with_gtk}" = "yes" || test "$USE_X_TOOLKIT" = "maybe"; then
@@ -3083,6 +3102,7 @@
 echo "  Does Emacs use a gif library?                           ${HAVE_GIF} $LIBGIF"
 echo "  Does Emacs use -lpng?                                   ${HAVE_PNG}"
 echo "  Does Emacs use -lrsvg-2?                                ${HAVE_RSVG}"
+echo "  Does Emacs use imagemagick?                             ${HAVE_IMAGEMAGICK}"
 echo "  Does Emacs use -lgpm?                                   ${HAVE_GPM}"
 echo "  Does Emacs use -ldbus?                                  ${HAVE_DBUS}"
 echo "  Does Emacs use -lgconf?                                 ${HAVE_GCONF}"
--- a/lisp/image.el	Thu Apr 01 18:29:04 2010 +0300
+++ b/lisp/image.el	Fri Apr 02 23:09:13 2010 +0200
@@ -690,6 +690,31 @@
 	   (cons images (+ (aref anim 1) (* (aref anim 2) 256))))))))
 
 
+(defconst imagemagick-types-inhibit
+  '(C HTML HTM TXT)
+  "Types the imagemagic loader should not try to handle.")
+
+;;;###autoload
+(defun imagemagic-register-types ()
+  "Register file types that imagemagick is able to handle."
+  (let ((im-types (imagemagick-types))
+        (im-inhibit imagemagick-types-inhibit))
+    (while im-inhibit
+      (setq im-types (remove (car im-inhibit) im-types))
+      (setq im-inhibit (cdr im-inhibit)))
+    (while im-types
+      (let
+	  ((extension (downcase (symbol-name (car im-types)))))
+	(push
+	 (cons  (concat "\\." extension "\\'") 'image-mode)
+	 auto-mode-alist)
+	(push
+	 (cons  (concat "\\." extension "\\'") 'imagemagick)
+	 image-type-file-name-regexps)
+	(setq im-types (cdr im-types))))))
+
+
+
 (provide 'image)
 
 ;; arch-tag: 8e76a07b-eb48-4f3e-a7a0-1a7ba9f096b3
--- a/src/Makefile.in	Thu Apr 01 18:29:04 2010 +0300
+++ b/src/Makefile.in	Fri Apr 02 23:09:13 2010 +0200
@@ -1,3 +1,4 @@
+
 # Makefile for GNU Emacs.
 # Copyright (C) 1985, 1987, 1988, 1993, 1994, 1995, 1999, 2000, 2001, 2002,
 #               2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
@@ -269,7 +270,9 @@
 
 /* C_SWITCH_X_SITE must come before C_SWITCH_X_MACHINE and C_SWITCH_X_SYSTEM
    since it may have -I options that should override those two.  */
-ALL_CFLAGS=-Demacs -DHAVE_CONFIG_H $(MYCPPFLAGS) -I. -I${srcdir} C_SWITCH_MACHINE C_SWITCH_SYSTEM C_SWITCH_X_SITE C_SWITCH_X_MACHINE C_SWITCH_X_SYSTEM C_SWITCH_SYSTEM_TEMACS ${CFLAGS_SOUND} ${RSVG_CFLAGS} ${DBUS_CFLAGS} ${GCONF_CFLAGS} ${CFLAGS} @FREETYPE_CFLAGS@ @FONTCONFIG_CFLAGS@ @LIBOTF_CFLAGS@ @M17N_FLT_CFLAGS@ ${DEPFLAGS}
+
+ALL_CFLAGS=-Demacs -DHAVE_CONFIG_H $(MYCPPFLAGS) -I. -I${srcdir} C_SWITCH_MACHINE C_SWITCH_SYSTEM C_SWITCH_X_SITE C_SWITCH_X_MACHINE C_SWITCH_X_SYSTEM C_SWITCH_SYSTEM_TEMACS ${CFLAGS_SOUND} ${RSVG_CFLAGS} ${IMAGEMAGICK_CFLAGS} ${DBUS_CFLAGS} ${GCONF_CFLAGS} ${CFLAGS} @FREETYPE_CFLAGS@ @FONTCONFIG_CFLAGS@ @LIBOTF_CFLAGS@ @M17N_FLT_CFLAGS@ ${DEPFLAGS}
+
 ALL_OBJC_CFLAGS=$(ALL_CFLAGS) @GNU_OBJC_CFLAGS@
 
 .SUFFIXES: .m
@@ -388,6 +391,9 @@
 RSVG_LIBS= @RSVG_LIBS@
 RSVG_CFLAGS= @RSVG_CFLAGS@
 
+IMAGEMAGICK_LIBS= @IMAGEMAGICK_LIBS@
+IMAGEMAGICK_CFLAGS= @IMAGEMAGICK_CFLAGS@
+
 #ifndef ORDINARY_LINK
 /* Fix linking if compiled with GCC.  */
 #ifdef __GNUC__
@@ -850,7 +856,7 @@
    duplicated symbols.  If the standard libraries were compiled
    with GCC, we might need gnulib again after them.  */
 
-LIBES = $(LOADLIBES) $(LIBS) $(LIBX) $(LIBSOUND) $(RSVG_LIBS) $(DBUS_LIBS) \
+LIBES = $(LOADLIBES) $(LIBS) $(LIBX) $(LIBSOUND) $(RSVG_LIBS) ${IMAGEMAGICK_LIBS} $(DBUS_LIBS) \
    @LIBGPM@ @LIBRESOLV@ LIBS_SYSTEM LIBS_MACHINE LIBS_TERMCAP \
    $(GETLOADAVG_LIBS) ${GCONF_LIBS} \
    @FREETYPE_LIBS@ @FONTCONFIG_LIBS@ @LIBOTF_LIBS@ @M17N_FLT_LIBS@ \
--- a/src/image.c	Thu Apr 01 18:29:04 2010 +0300
+++ b/src/image.c	Fri Apr 02 23:09:13 2010 +0200
@@ -606,7 +606,7 @@
 extern Lisp_Object Qcenter;
 Lisp_Object QCascent, QCmargin, QCrelief, Qcount, Qextension_data;
 Lisp_Object QCconversion, QCcolor_symbols, QCheuristic_mask;
-Lisp_Object QCindex, QCmatrix, QCcolor_adjustment, QCmask;
+Lisp_Object QCindex, QCmatrix, QCcolor_adjustment, QCmask, QCgeometry, QCcrop, QCrotation;
 
 /* Other symbols.  */
 
@@ -7538,6 +7538,449 @@
 #endif /* HAVE_GIF */
 
 
+/***********************************************************************
+				 imagemagick
+ ***********************************************************************/
+#if defined (HAVE_IMAGEMAGICK)
+Lisp_Object Vimagemagick_render_type;
+/* Function prototypes.  */
+
+static int imagemagick_image_p (Lisp_Object object);
+static int imagemagick_load (struct frame *f, struct image *img);
+
+static int imagemagick_load_image (struct frame *, struct image *,
+                                       unsigned char *, unsigned int, unsigned char *);
+
+/* The symbol `imagemagick' identifying images of this type.  */
+
+Lisp_Object Qimagemagick;
+Lisp_Object Vimagemagick_render_type;
+
+/* Indices of image specification fields in imagemagick_format, below.  */
+
+enum imagemagick_keyword_index
+{
+  IMAGEMAGICK_TYPE,
+  IMAGEMAGICK_DATA,
+  IMAGEMAGICK_FILE,
+  IMAGEMAGICK_ASCENT,
+  IMAGEMAGICK_MARGIN,
+  IMAGEMAGICK_RELIEF,
+  IMAGEMAGICK_ALGORITHM,
+  IMAGEMAGICK_HEURISTIC_MASK,
+  IMAGEMAGICK_MASK,
+  IMAGEMAGICK_BACKGROUND,
+  IMAGEMAGICK_LAST
+};
+
+/* Vector of image_keyword structures describing the format
+   of valid user-defined image specifications.  */
+
+static struct image_keyword imagemagick_format[IMAGEMAGICK_LAST] =
+{
+  {":type",		IMAGE_SYMBOL_VALUE,			1},
+  {":data",		IMAGE_STRING_VALUE,			0},
+  {":file",		IMAGE_STRING_VALUE,			0},
+  {":ascent",		IMAGE_ASCENT_VALUE,			0},
+  {":margin",		IMAGE_POSITIVE_INTEGER_VALUE_OR_PAIR,	0},
+  {":relief",		IMAGE_INTEGER_VALUE,			0},
+  {":conversion",	IMAGE_DONT_CHECK_VALUE_TYPE,		0},
+  {":heuristic-mask",	IMAGE_DONT_CHECK_VALUE_TYPE,		0},
+  {":mask",		IMAGE_DONT_CHECK_VALUE_TYPE,		0},
+  {":background",	IMAGE_STRING_OR_NIL_VALUE,		0}
+};
+/* Free X resources of imagemagick image IMG which is used on frame F.  */
+
+static void
+imagemagick_clear_image (f, img)
+     struct frame *f;
+     struct image *img;
+{
+  printf("clearing imagemagick image\n");
+  x_clear_image (f, img);
+}
+
+/* Structure describing the image type `imagemagick'.  Its the same type of
+   structure defined for all image formats, handled by Emacs image
+   functions.  See struct image_type in dispextern.h.  */
+
+static struct image_type imagemagick_type =
+{
+  /* An identifier showing that this is an image structure for the IMAGEMAGICK format.  */
+  &Qimagemagick,
+  /* Handle to a function that can be used to identify a IMAGEMAGICK file.  */
+  imagemagick_image_p,
+  /* Handle to function used to load a IMAGEMAGICK file.  */
+  imagemagick_load,
+  /* Handle to function to free resources for IMAGEMAGICK.  */
+  imagemagick_clear_image,
+  /* An internal field to link to the next image type in a list of
+     image types, will be filled in when registering the format.  */
+  NULL
+};
+
+
+/* Return non-zero if OBJECT is a valid IMAGEMAGICK image specification.  Do
+   this by calling parse_image_spec and supplying the keywords that
+   identify the IMAGEMAGICK format.   */
+
+static int
+imagemagick_image_p (object)
+     Lisp_Object object;
+{
+  struct image_keyword fmt[IMAGEMAGICK_LAST];
+  bcopy (imagemagick_format, fmt, sizeof fmt);
+
+  if (!parse_image_spec (object, fmt, IMAGEMAGICK_LAST, Qimagemagick))
+    return 0;
+
+  /* Must specify either the :data or :file keyword.  */
+  return fmt[IMAGEMAGICK_FILE].count + fmt[IMAGEMAGICK_DATA].count == 1;
+}
+
+/* The GIF library also defines DrawRectangle, but its never used in Emacs.
+   Therefore rename the function so it doesnt collide with ImageMagick.  */
+#define DrawRectangle DrawRectangleGif
+#include <wand/MagickWand.h>
+
+/* Load IMAGEMAGICK image IMG for use on frame F.  Value is non-zero if
+   successful. this function will go into the imagemagick_type structure, and
+   the prototype thus needs to be compatible with that structure.  */
+
+static int
+imagemagick_load (f, img)
+     struct frame *f;
+     struct image *img;
+{
+  int success_p = 0;
+  Lisp_Object file_name;
+
+  /* If IMG->spec specifies a file name, create a non-file spec from it.  */
+  file_name = image_spec_value (img->spec, QCfile, NULL);
+  if (STRINGP (file_name))
+    {
+      Lisp_Object file;
+      unsigned char *contents;
+      int size;
+      struct gcpro gcpro1;
+
+      file = x_find_image_file (file_name);
+      GCPRO1 (file);
+      if (!STRINGP (file))
+	{
+	  image_error ("Cannot find image file `%s'", file_name, Qnil);
+	  UNGCPRO;
+	  return 0;
+	}
+
+      /* Read the entire file into memory.  */
+      /* contents = slurp_file (SDATA (file), &size); */
+      /* if (contents == NULL) */
+      /*   { */
+      /*     image_error ("Error loading IMAGEMAGICK image `%s'", img->spec, Qnil); */
+      /*     UNGCPRO; */
+      /*     return 0; */
+      /*   } */
+      /* If the file was slurped into memory properly, parse it.  */
+      success_p = imagemagick_load_image (f, img, 0, 0, SDATA(file_name));
+      UNGCPRO;
+    }
+  /* Else its not a file, its a lisp object.  Load the image from a
+     lisp object rather than a file.  */
+  else
+    {
+      Lisp_Object data;
+
+      data = image_spec_value (img->spec, QCdata, NULL);
+      success_p = imagemagick_load_image (f, img, SDATA (data), SBYTES (data),NULL);
+    }
+
+  return success_p;
+}
+
+/* imagemagick_load_image is a helper function for imagemagick_load, which does the
+   actual loading given contents and size, apart from frame and image
+   structures, passed from imagemagick_load.
+
+   Uses librimagemagick to do most of the image processing.
+
+   Returns non-zero when successful.
+*/
+
+static int
+imagemagick_load_image (f, img, contents, size, filename)
+    /* Pointer to emacs frame structure.  */
+     struct frame *f;
+     /* Pointer to emacs image structure.  */
+     struct image *img;
+     /* String containing the IMAGEMAGICK  data to be parsed.  */
+     unsigned char *contents;
+     /* Size of data in bytes.  */
+     unsigned int size;
+     /* Filename, either pass filename or contents/size.  */
+     unsigned char *filename;
+{
+  long unsigned int width;
+  long unsigned int height;
+
+  MagickBooleanType
+    status;
+
+  XImagePtr ximg;
+  Lisp_Object specified_bg;
+  XColor background;
+  int x;
+  int y;
+
+  MagickWand  *image_wand;
+  PixelIterator *iterator;
+  PixelWand  **pixels;
+  MagickPixelPacket  pixel;
+
+  
+  /* image_wand will contain the image.  */
+  image_wand = NewMagickWand();  
+
+  /* Parse the contents argument and initialize image_wand.  */
+  if(filename!=NULL)
+    status=MagickReadImage(image_wand, filename);
+  else
+    status=MagickReadImageBlob(image_wand, contents, size);
+  image_error ("im read failed", Qnil, Qnil);
+  if (status == MagickFalse) goto imagemagick_error;
+
+  /* Handle image index for image types who can contain more than one image.
+   Interface :index is same as for GIF.  */
+  Lisp_Object image;
+  long ino;
+  image = image_spec_value (img->spec, QCindex, NULL);
+  ino = INTEGERP (image) ? XFASTINT (image) : 0;
+  
+  /* if (ino >= ) */
+  /*   { */
+  /*     image_error ("Invalid image number `%s' in image `%s'", */
+  /*       	   image, img->spec); */
+  /*     UNGCPRO; */
+  /*     return 0; */
+  /*   } */
+
+  if(ino==0)
+    MagickSetFirstIterator(image_wand);
+  else
+    MagickSetIteratorIndex(image_wand, ino);
+
+  /*
+    If width and/or height is set in the display spec
+    assume we want to scale to those.  */
+
+  int desired_width, desired_height;
+  Lisp_Object value;  
+  value = image_spec_value (img->spec, QCwidth, NULL);
+  desired_width = (INTEGERP (value)  ? XFASTINT (value) : -1);
+  value = image_spec_value (img->spec, QCheight, NULL);
+  desired_height = (INTEGERP (value) ? XFASTINT (value) : -1);
+  if(desired_width != -1 && desired_height != -1){
+    printf("MagickScaleImage %d %d\n",desired_width, desired_height);
+    status=MagickScaleImage(image_wand, desired_width, desired_height);
+    if (status == MagickFalse) {
+      image_error ("Imagemagick scale failed", Qnil, Qnil);
+      goto imagemagick_error;
+    }
+    
+  }
+
+  /* Also support :geometry and :crop which are imagemagick specific descriptors.  */
+
+  Lisp_Object crop, geometry;
+  crop     = image_spec_value (img->spec, QCcrop, NULL);
+  geometry = image_spec_value (img->spec, QCgeometry, NULL);
+  if (STRINGP (crop) && STRINGP (geometry)){
+    printf("MagickTransformImage %s %s\n",SDATA(crop), SDATA(geometry));
+    image_wand = MagickTransformImage (image_wand, SDATA (crop), SDATA (geometry));
+    /* TODO differ between image_wand and transform_wand. */
+  }
+
+  /* Furthermore :rotation. we need background color and angle for rotation.  */
+  /*
+    TODO background handling for rotation
+    specified_bg = image_spec_value (img->spec, QCbackground, NULL);
+  if (!STRINGP (specified_bg)
+  */
+    double rotation;
+    value = image_spec_value (img->spec, QCrotation, NULL);
+    if (FLOATP (value)){
+      PixelWand* background = NewPixelWand();
+      PixelSetColor (background, "#ffffff");/*TODO remove hardcode*/
+
+      rotation = extract_float (value);
+      printf ("MagickRotateImage %f\n",rotation);
+      
+      status=MagickRotateImage (image_wand, background,rotation);
+      DestroyPixelWand (background);
+      if (status == MagickFalse) {
+        image_error ("Imagemagick image rotate failed", Qnil, Qnil);
+        goto imagemagick_error;
+      }
+    }
+  
+  /* Finaly we are done manipulating the image,
+     figure out resulting width, height, and then transfer ownerwship to Emacs.
+   */
+  height=MagickGetImageHeight (image_wand);
+  width=MagickGetImageWidth (image_wand);
+  if (status == MagickFalse) {
+      image_error ("Imagemagick image get size failed", Qnil, Qnil);  
+      goto imagemagick_error;
+  }
+    
+  if (! check_image_size (f, width, height))
+    {
+      image_error ("Invalid image size (see `max-image-size')", Qnil, Qnil);
+      goto imagemagick_error;
+    }
+  
+  /* We can now get a valid pixel buffer from the imagemagick file, if all
+     went ok.  */
+  
+
+  init_color_table ();
+  int imagemagick_rendermethod=(INTEGERP (Vimagemagick_render_type) ? XFASTINT (Vimagemagick_render_type) : 0);
+  if (imagemagick_rendermethod==0){
+    /* Try to create a x pixmap to hold the imagemagick pixmap.  */
+    if (!x_create_x_image_and_pixmap (f, width, height, 0, &ximg, &img->pixmap)){
+      image_error("Imagemagick X bitmap allocation failure",Qnil,Qnil);
+      goto imagemagick_error;
+    }
+    
+    /* Copy imagegmagick image to x with primitive yet robust pixel
+       pusher loop.  This has been tested a lot with many different
+       images, it doesnt work too well with image archive formats though!
+
+       Also seems slow.
+    */
+  
+    /* Copy pixels from the imagemagick image structure to the x image map. */
+    iterator = NewPixelIterator (image_wand);
+    if ((iterator == (PixelIterator *) NULL)) {
+          image_error ("Imagemagick pixel iterator creation failed", Qnil, Qnil);
+          goto imagemagick_error;
+    }
+
+    for (y=0; y < (long) MagickGetImageHeight(image_wand); y++)
+      {
+        pixels = PixelGetNextIteratorRow (iterator, &width);
+        if ((pixels == (PixelWand **) NULL))
+          break;
+        for (x=0; x < (long) width; x++)
+          {
+            PixelGetMagickColor (pixels[x], &pixel);
+            XPutPixel (ximg, x, y, lookup_rgb_color (f, pixel.red, pixel.green, pixel.blue));      
+          }
+      }
+    DestroyPixelIterator (iterator);
+  }
+
+  if (imagemagick_rendermethod==1){
+    /* Try if magicexportimage is any faster than pixelpushing. */
+    /* printf("ximg: bitmap_unit:%d format:%d byte_order:%d depth:%d bits_per_pixel:%d\n", */
+    /*        ximg->bitmap_unit,ximg->format,ximg->byte_order,ximg->depth,ximg->bits_per_pixel); */
+    int imagedepth=24;/*MagickGetImageDepth(image_wand);*/
+    char* exportdepth= imagedepth <= 8 ? "I" : "BGRP";/*"RGBP";*/
+    /* Try to create a x pixmap to hold the imagemagick pixmap.  */
+    printf("imagedepth:%d exportdepth:%s\n", imagedepth, exportdepth);
+    if (!x_create_x_image_and_pixmap (f, width, height, imagedepth, &ximg, &img->pixmap)){
+      image_error("Imagemagick X bitmap allocation failure",Qnil,Qnil);
+      goto imagemagick_error;
+    }
+
+    
+    /* Oddly, the below code doesnt seem to work:*/
+    int pixelwidth; 
+    /* switch(ximg->bitmap_unit){ */
+    /* case 8: */
+    /*   pixelwidth=CharPixel; */
+    /*   break; */
+    /* case   16: */
+    /*   pixelwidth=ShortPixel; */
+    /*   break; */
+    /* case   32: */
+    /*   pixelwidth=LongPixel; */
+    /*   break; */
+    /* } */
+    /*
+      Here im just guessing the format of the bitmap.
+      happens to work fine for:
+      - bw djvu images
+      on rgb display.
+      seems about 3 times as fast as pixel pushing(not carefully measured)
+      with color djvu, the bitplanes are mapped to wrong color(seems fixed).
+
+    */
+    pixelwidth=CharPixel;/*??? TODO figure out*/
+    MagickExportImagePixels(image_wand,
+                            0,0,
+                            width,height,
+                            exportdepth,
+                            pixelwidth, 
+                            /*&(img->pixmap));*/
+                            ximg->data);
+  }
+  
+#ifdef COLOR_TABLE_SUPPORT
+  /* Remember colors allocated for this image.  */
+  img->colors = colors_in_color_table (&img->ncolors);
+  free_color_table ();
+#endif /* COLOR_TABLE_SUPPORT */
+
+
+  img->width  = width;
+  img->height = height;
+
+  /* Maybe fill in the background field while we have ximg handy.
+     Casting avoids a GCC warning.  */
+  /*  IMAGE_BACKGROUND (img, f, (XImagePtr_or_DC)ximg);*/
+
+  /* Put the image into the pixmap, then free the X image and its
+     buffer.  */
+  x_put_x_image (f, ximg, img->pixmap, width, height);
+
+  x_destroy_x_image (ximg);
+
+
+  /* JAVE TODO more cleanup.  */
+  DestroyMagickWand (image_wand);
+
+  return 1;
+
+ imagemagick_error:
+  /* TODO more cleanup.  */
+  image_error ("Error parsing IMAGEMAGICK image `%s'", img->spec, Qnil);
+  printf("Imagemagick error, see *Messages*\n");
+  return 0;
+}
+
+DEFUN ("imagemagick-types", Fimagemagick_types, Simagemagick_types, 0,0,0,
+       doc: /* Return image file types supported by ImageMagick.
+             Since ImageMagic recognizes a lot of file-types that clash with Emacs,
+            such as .c, we want to be able to alter the list at the lisp level.  */)
+  ()
+{
+  Lisp_Object typelist = Qnil;
+  unsigned long numf;
+  ExceptionInfo ex;
+  char** imtypes = GetMagickList ("*", &numf, &ex);
+  int i;
+  Lisp_Object Qimagemagicktype;
+  for (i = 0; i < numf; i++) {
+    Qimagemagicktype = intern (*( imtypes + i));
+    typelist = Fcons (Qimagemagicktype, typelist);
+  }
+  return typelist;
+}
+  
+#endif	/* defined (HAVE_IMAGEMAGICK) */
+
+
 
 /***********************************************************************
 				 SVG
@@ -8335,6 +8778,14 @@
     return CHECK_LIB_AVAILABLE (&svg_type, init_svg_functions, libraries);
 #endif
 
+#if defined (HAVE_IMAGEMAGICK)
+  if (EQ (type, Qimagemagick)){
+    /* MagickWandGenesis() initalizes the imagemagick library.  */
+    MagickWandGenesis(); 
+    return CHECK_LIB_AVAILABLE (&imagemagick_type, init_imagemagick_functions, libraries);
+  }
+#endif
+
 #ifdef HAVE_GHOSTSCRIPT
   if (EQ (type, Qpostscript))
     return CHECK_LIB_AVAILABLE (&gs_type, init_gs_functions, libraries);
@@ -8345,6 +8796,7 @@
   return Qnil;
 }
 
+
 void
 syms_of_image ()
 {
@@ -8422,7 +8874,14 @@
   staticpro (&QCheuristic_mask);
   QCindex = intern_c_string (":index");
   staticpro (&QCindex);
+  QCgeometry = intern (":geometry");
+  staticpro (&QCgeometry);
+  QCcrop = intern (":crop");
+  staticpro (&QCcrop);
+  QCrotation = intern (":rotation");
+  staticpro (&QCrotation);
   QCmatrix = intern_c_string (":matrix");
+
   staticpro (&QCmatrix);
   QCcolor_adjustment = intern_c_string (":color-adjustment");
   staticpro (&QCcolor_adjustment);
@@ -8482,6 +8941,12 @@
   ADD_IMAGE_TYPE (Qpng);
 #endif
 
+#if defined (HAVE_IMAGEMAGICK)
+  Qimagemagick = intern ("imagemagick");
+  staticpro (&Qimagemagick);
+  ADD_IMAGE_TYPE (Qimagemagick);
+#endif
+  
 #if defined (HAVE_RSVG)
   Qsvg = intern_c_string ("svg");
   staticpro (&Qsvg);
@@ -8498,6 +8963,9 @@
 #endif /* HAVE_RSVG  */
 
   defsubr (&Sinit_image_library);
+#ifdef HAVE_IMAGEMAGICK  
+  defsubr (&Simagemagick_types);
+#endif  
   defsubr (&Sclear_image_cache);
   defsubr (&Simage_refresh);
   defsubr (&Simage_size);
@@ -8525,12 +8993,20 @@
 from the image cache.  Value must be an integer or nil with nil
 meaning don't clear the cache.  */);
   Vimage_cache_eviction_delay = make_number (30 * 60);
+
+#ifdef HAVE_IMAGEMAGICK  
+  DEFVAR_LISP ("imagemagick-render-type", &Vimagemagick_render_type,
+    doc: /*   */);
+#endif    
 }
 
 void
 init_image ()
 {
-}
+
+}
+
+
 
 /* arch-tag: 123c2a5e-14a8-4c53-ab95-af47d7db49b9
    (do not change this comment) */