Small fix to last change
[bpt/emacs.git] / autogen / configure
index 2f73934..aed6c71 100755 (executable)
@@ -604,6 +604,7 @@ am__EXEEXT_TRUE
 LTLIBOBJS
 LIBOBJS
 SUBDIR_MAKEFILES_IN
+ns_check_file
 WINDOW_SYSTEM_OBJ
 EMACS_HEAPSIZE
 TEMACS_POST_LINK
@@ -614,12 +615,16 @@ LIBGNU_LIBDEPS
 gltests_WITNESS
 gl_GNULIB_ENABLED_682e609604ccaac6be382e4ee3a4eaec_FALSE
 gl_GNULIB_ENABLED_682e609604ccaac6be382e4ee3a4eaec_TRUE
+gl_GNULIB_ENABLED_tempname_FALSE
+gl_GNULIB_ENABLED_tempname_TRUE
 gl_GNULIB_ENABLED_strtoull_FALSE
 gl_GNULIB_ENABLED_strtoull_TRUE
 gl_GNULIB_ENABLED_strtoll_FALSE
 gl_GNULIB_ENABLED_strtoll_TRUE
 gl_GNULIB_ENABLED_stat_FALSE
 gl_GNULIB_ENABLED_stat_TRUE
+gl_GNULIB_ENABLED_secure_getenv_FALSE
+gl_GNULIB_ENABLED_secure_getenv_TRUE
 gl_GNULIB_ENABLED_6099e9737f757db36c47fa9d9f02e88c_FALSE
 gl_GNULIB_ENABLED_6099e9737f757db36c47fa9d9f02e88c_TRUE
 gl_GNULIB_ENABLED_pathmax_FALSE
@@ -905,6 +910,7 @@ PRIPTR_PREFIX
 PRI_MACROS_BROKEN
 INT64_MAX_EQ_LONG_MAX
 INT32_MAX_LT_INTMAX_MAX
+REPLACE_STRTOUMAX
 REPLACE_STRTOIMAX
 HAVE_DECL_STRTOUMAX
 HAVE_DECL_STRTOIMAX
@@ -1142,6 +1148,7 @@ REPLACE_ISATTY
 REPLACE_GETPAGESIZE
 REPLACE_GETGROUPS
 REPLACE_GETLOGIN_R
+REPLACE_GETDTABLESIZE
 REPLACE_GETDOMAINNAME
 REPLACE_GETCWD
 REPLACE_FTRUNCATE
@@ -1241,6 +1248,9 @@ GNULIB_CLOSE
 GNULIB_CHOWN
 GNULIB_CHDIR
 LIB_CLOCK_GETTIME
+GL_GENERATE_BYTESWAP_H_FALSE
+GL_GENERATE_BYTESWAP_H_TRUE
+BYTESWAP_H
 GL_GENERATE_ALLOCA_H_FALSE
 GL_GENERATE_ALLOCA_H_TRUE
 ALLOCA_H
@@ -1275,6 +1285,7 @@ LD_SWITCH_X_SITE
 gameuser
 gamedir
 bitmapdir
+etcdocdir
 archlibdir
 etcdir
 x_default_search_path
@@ -1311,6 +1322,7 @@ LIBXSM
 LIBGPM
 LIBGIF
 LIBTIFF
+LIBZ
 LIBPNG
 LIBJPEG
 LIBXPM
@@ -1364,6 +1376,7 @@ FIRSTFILE_OBJ
 W32_RES_LINK
 CLIENTW
 CLIENTRES
+UPDATE_MANIFEST
 EMACS_MANIFEST
 EMACSRES
 W32_LIBS
@@ -1390,6 +1403,7 @@ UNEXEC_OBJ
 C_SWITCH_MACHINE
 LD_SWITCH_SYSTEM
 CANNOT_DUMP
+DOCMISC_W32
 INFO_OPTS
 INFO_EXT
 HAVE_MAKEINFO
@@ -1398,8 +1412,8 @@ GZIP_PROG
 INSTALL_INFO
 LN_S_FILEONLY
 GNULIB_WARN_CFLAGS
-WARN_CFLAGS
 WERROR_CFLAGS
+WARN_CFLAGS
 RANLIB
 ARFLAGS
 AR
@@ -1433,7 +1447,6 @@ build_vendor
 build_cpu
 build
 PROFILING_CFLAGS
-GZIP_INFO
 cache_file
 am__untar
 am__tar
@@ -1533,9 +1546,10 @@ with_gconf
 with_gsettings
 with_selinux
 with_gnutls
+with_zlib
 with_file_notification
 with_makeinfo
-with_compress_info
+with_compress_install
 with_pkg_config_prog
 with_gameuser
 with_gnustep_conf
@@ -2233,7 +2247,9 @@ Optional Packages:
   --with-mail-unlink      unlink, rather than empty, mail spool after reading
   --with-mailhost=HOSTNAME
                           string giving default POP mail host
-  --without-sound         don't compile with sound support
+  --with-sound=VALUE      compile with sound support (VALUE one of: yes, alsa,
+                          oss, bsd-ossaudio, no; default yes). Only for
+                          GNU/Linux, FreeBSD, NetBSD, MinGW.
   --with-x-toolkit=KIT    use an X toolkit (KIT one of: yes or gtk, gtk2,
                           gtk3, lucid or athena, motif, no)
   --with-wide-int         prefer wide Emacs integers (typically 62-bit)
@@ -2261,11 +2277,14 @@ Optional Packages:
   --without-gsettings     don't compile with GSettings support
   --without-selinux       don't compile with SELinux support
   --without-gnutls        don't use -lgnutls for SSL/TLS support
+  --without-zlib          don't compile with zlib decompression support
   --with-file-notification=LIB
                           use a file notification library (LIB one of: yes,
                           gfile, inotify, w32, no)
   --without-makeinfo      don't require makeinfo for building manuals
-  --without-compress-info don't compress the installed Info pages
+  --without-compress-install
+                          don't compress some files (.el, .info, etc.) when
+                          installing. Equivalent to: make GZIP_PROG= install
   --with-pkg-config-prog=FILENAME
                           file name of pkg-config for finding GTK and librsvg
   --with-gameuser=USER    user for shared game score files
@@ -3376,7 +3395,6 @@ as_fn_append ac_func_list " faccessat"
 as_fn_append ac_func_list " fcntl"
 as_fn_append ac_func_list " fdopendir"
 as_fn_append ac_header_list " stdio_ext.h"
-as_fn_append ac_func_list " __fpending"
 as_fn_append ac_func_list " fstatat"
 as_fn_append ac_func_list " fsync"
 gl_getopt_required=GNU
@@ -3388,6 +3406,7 @@ as_fn_append ac_header_list " wchar.h"
 as_fn_append ac_header_list " stdint.h"
 as_fn_append ac_header_list " inttypes.h"
 as_fn_append ac_func_list " lstat"
+as_fn_append ac_func_list " mkostemp"
 as_fn_append ac_func_list " pipe2"
 as_fn_append ac_header_list " sys/select.h"
 as_fn_append ac_func_list " pselect"
@@ -3405,6 +3424,7 @@ as_fn_append ac_func_list " futimens"
 as_fn_append ac_func_list " utimensat"
 as_fn_append ac_func_list " lutimes"
 as_fn_append ac_func_list " getdtablesize"
+as_fn_append ac_func_list " secure_getenv"
 # Check that the precious variables saved in the cache have kept the same
 # value.
 ac_cache_corrupted=false
@@ -3474,16 +3494,37 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
 
 
-emacs_config_options="$@"
-## Add some environment variables, if they were passed via the environment
-## rather than on the command-line.
-for var in CFLAGS CPPFLAGS LDFLAGS; do
-    case "$emacs_config_options" in
-      *$var=*) continue ;;
-    esac
-    eval val="\$${var}"
-    test x"$val" = x && continue
-    emacs_config_options="${emacs_config_options}${emacs_config_options:+ }$var=\"$val\""
+emacs_config_options=
+optsep=
+for opt in ${1+"$@"} CFLAGS CPPFLAGS LDFLAGS; do
+  case $opt in
+    -n | --no-create | --no-recursion)
+      continue ;;
+    CFLAGS | CPPFLAGS | LDFLAGS)
+      eval 'test "${'$opt'+set}" = set' || continue
+      case " $*" in
+       *" $opt="*) continue ;;
+      esac
+      eval opt=$opt=\$$opt ;;
+  esac
+
+  emacs_shell_specials=$IFS\''"#$&()*;<>?[\\`{|~'
+  case $opt in
+    *["$emacs_shell_specials"]*)
+      case $opt in
+       *\'*)
+         emacs_quote_apostrophes="s/'/'\\\\''/g"
+         opt=`$as_echo "$opt" | sed "$emacs_quote_apostrophes"` ;;
+      esac
+      opt="'$opt'"
+      case $opt in
+       *['"\\']*)
+         emacs_quote_for_c='s/["\\]/\\&/g; $!s/$/\\n\\/'
+         opt=`$as_echo "$opt" | sed "$emacs_quote_for_c"` ;;
+      esac ;;
+  esac
+  as_fn_append emacs_config_options "$optsep$opt"
+  optsep=' '
 done
 
 ac_config_headers="$ac_config_headers src/config.h:src/config.in"
@@ -3993,6 +4034,15 @@ am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'
 
 
 
+for var in "`pwd`" "`cd \"$srcdir\"; pwd`" "$prefix" "$exec_prefix" \
+    "$datarootdir" "$bindir" "$datadir" "$sharedstatedir" "$libexecdir"; do
+
+    case "$var" in
+    *[^\ -~]*) as_fn_error "Emacs cannot be built or installed in a directory whose name contains non-ASCII characters: $var" "$LINENO" 5 ;;
+  esac
+
+done
+
 lispdir='${datadir}/emacs/${version}/lisp'
 leimdir='${datadir}/emacs/${version}/leim'
 standardlisppath='${lispdir}:${leimdir}'
@@ -4001,7 +4051,7 @@ locallisppath='${datadir}/emacs/${version}/site-lisp:'\
 lisppath='${locallisppath}:${standardlisppath}'
 etcdir='${datadir}/emacs/${version}/etc'
 archlibdir='${libexecdir}/emacs/${version}/${configuration}'
-docdir='${datadir}/emacs/${version}/etc'
+etcdocdir='${datadir}/emacs/${version}/etc'
 gamedir='${localstatedir}/games/emacs'
 
 
@@ -4116,9 +4166,16 @@ fi
 
 # Check whether --with-sound was given.
 if test "${with_sound+set}" = set; then :
-  withval=$with_sound;
+  withval=$with_sound;  case "${withval}" in
+      yes|no|alsa|oss|bsd-ossaudio) val=$withval ;;
+      *) as_fn_error "\`--with-sound=$withval' is invalid;
+this option's value should be \`yes', \`no', \`alsa', \`oss', or \`bsd-ossaudio'." "$LINENO" 5
+      ;;
+    esac
+    with_sound=$val
+
 else
-     with_sound=$with_features
+  with_sound=$with_features
 fi
 
 
@@ -4340,6 +4397,14 @@ else
 fi
 
 
+# Check whether --with-zlib was given.
+if test "${with_zlib+set}" = set; then :
+  withval=$with_zlib;
+else
+     with_zlib=$with_features
+fi
+
+
 
 # Check whether --with-file-notification was given.
 if test "${with_file_notification+set}" = set; then :
@@ -4351,7 +4416,8 @@ if test "${with_file_notification+set}" = set; then :
     w | w3 | w32 )     val=w32 ;;
     * ) as_fn_error "\`--with-file-notification=$withval' is invalid;
 this option's value should be \`yes', \`no', \`gfile', \`inotify' or \`w32'.
-\`yes' is a synonym for \`w32' on MS-Windows, and for \`gfile' otherwise." "$LINENO" 5
+\`yes' is a synonym for \`w32' on MS-Windows, for \`no' on Nextstep,
+otherwise for the first of \`gfile' or \`inotify' that is usable." "$LINENO" 5
     ;;
    esac
    with_file_notification=$val
@@ -4378,17 +4444,11 @@ fi
 ## This is an option because I do not know if all info/man support
 ## compressed files, nor how to test if they do so.
 
-# Check whether --with-compress-info was given.
-if test "${with_compress_info+set}" = set; then :
-  withval=$with_compress_info;
-else
-     with_compress_info=$with_features
-fi
-
-if test $with_compress_info = yes; then
-   GZIP_INFO=yes
+# Check whether --with-compress-install was given.
+if test "${with_compress_install+set}" = set; then :
+  withval=$with_compress_install;
 else
-   GZIP_INFO=
+     with_compress_install=$with_features
 fi
 
 
@@ -4553,29 +4613,16 @@ if test "${enable_gtk_deprecation_warnings+set}" = set; then :
 fi
 
 
-#### Make srcdir absolute, if it isn't already.  It's important to
-#### avoid running the file name through pwd unnecessarily, since pwd can
-#### give you automounter prefixes, which can go away.  We do all this
-#### so Emacs can find its files when run uninstalled.
-## Make sure CDPATH doesn't affect cd (in case PWD is relative).
-unset CDPATH
-case "${srcdir}" in
-  [\\/]* | ?:[\\/]*) ;;
-  . )
-    ## We may be able to use the $PWD environment variable to make this
-    ## absolute.  But sometimes PWD is inaccurate.
-    ## Note: we used to use $PWD at the end instead of `pwd`,
-    ## but that tested only for a well-formed and valid PWD,
-    ## it did not object when PWD was well-formed and valid but just wrong.
-    if test ".$PWD" != "." && test ".`(cd "$PWD" ; sh -c pwd)`" = ".`pwd`"  ;
-    then
-      srcdir="$PWD"
-    else
-      srcdir=`(cd "$srcdir"; pwd)`
-    fi
-  ;;
-  *  ) srcdir=`(cd "$srcdir"; pwd)` ;;
-esac
+#### When building with MinGW inside the MSYS tree, 'pwd' produces
+#### directories relative to the root of the MSYS tree,
+#### e.g. '/home/user/foo' instead of '/d/MSYS/home/user/foo'.  When
+#### such a value of srcdir is written to the top-level Makefile, it
+#### gets propagated to src/epaths.h, and that causes temacs to fail,
+#### because, being a MinGW program that knows nothing of MSYS root
+#### substitution, it cannot find the data directory.  "pwd -W"
+#### produces Windows-style 'd:/foo/bar' absolute directory names, so
+#### we use it here to countermand that lossage.
+test "$MSYSTEM" = "MINGW32" && abs_srcdir=`(cd "$abs_srcdir"; pwd -W | sed -e 's,^\([A-Za-z]\):,/\1,')`
 
 ### Canonicalize the configuration name.
 
@@ -7228,11 +7275,15 @@ esac
   # Code from module alloca-opt:
   # Code from module allocator:
   # Code from module at-internal:
+  # Code from module binary-io:
+  # Code from module byteswap:
   # Code from module c-ctype:
   # Code from module c-strcase:
   # Code from module careadlinkat:
   # Code from module clock-time:
   # Code from module close-stream:
+  # Code from module count-one-bits:
+  # Code from module count-trailing-zeros:
   # Code from module crypto/md5:
   # Code from module crypto/sha1:
   # Code from module crypto/sha256:
@@ -7267,7 +7318,6 @@ esac
   # Code from module gettime:
   # Code from module gettimeofday:
   # Code from module group-member:
-  # Code from module ignore-value:
   # Code from module include_next:
   # Code from module intprops:
   # Code from module inttypes-incomplete:
@@ -7276,6 +7326,7 @@ esac
   # Code from module lstat:
   # Code from module manywarnings:
   # Code from module memrchr:
+  # Code from module mkostemp:
   # Code from module mktime:
   # Code from module multiarch:
   # Code from module nocrash:
@@ -7289,6 +7340,7 @@ esac
   # Code from module readlink:
   # Code from module readlinkat:
   # Code from module root-uid:
+  # Code from module secure_getenv:
   # Code from module sig2str:
   # Code from module signal-h:
   # Code from module snippet/_Noreturn:
@@ -7319,6 +7371,7 @@ esac
   # Code from module sys_select:
   # Code from module sys_stat:
   # Code from module sys_time:
+  # Code from module tempname:
   # Code from module time:
   # Code from module time_r:
   # Code from module timer-time:
@@ -7485,23 +7538,45 @@ fi
 # Otherwise, run RUN-IF-NOT-FOUND.
 
 
+# clang is unduly picky about some things.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the compiler is clang" >&5
+$as_echo_n "checking whether the compiler is clang... " >&6; }
+if test "${emacs_cv_clang+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+         #ifndef __clang__
+           #error "not clang"
+         #endif
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  emacs_cv_clang=yes
+else
+  emacs_cv_clang=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $emacs_cv_clang" >&5
+$as_echo "$emacs_cv_clang" >&6; }
+
 # When compiling with GCC, prefer -isystem to -I when including system
 # include files, to avoid generating useless diagnostics for the files.
 if test "$gl_gcc_warnings" != yes; then
   isystem='-I'
-else
-  isystem='-isystem '
-
-  # This, $nw, is the list of warnings we disable.
-  nw=
-
-  case $with_x_toolkit in
-    lucid | athena | motif)
-       # Old toolkits mishandle 'const'.
-       nw="$nw -Wwrite-strings"
-       ;;
-    *)
-       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler handles -Werror -Wunknown-warning-option" >&5
+  if test "$emacs_cv_clang" = yes
+  then
+     # Turn off some warnings if supported.
+     { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler handles -Werror -Wunknown-warning-option" >&5
 $as_echo_n "checking whether C compiler handles -Werror -Wunknown-warning-option... " >&6; }
 if test "${gl_cv_warn_c__Werror__Wunknown_warning_option+set}" = set; then :
   $as_echo_n "(cached) " >&6
@@ -7520,12 +7595,13 @@ main ()
   return 0;
 }
 _ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
+if ac_fn_c_try_link "$LINENO"; then :
   gl_cv_warn_c__Werror__Wunknown_warning_option=yes
 else
   gl_cv_warn_c__Werror__Wunknown_warning_option=no
 fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
   CFLAGS="$gl_save_compiler_FLAGS"
 
 fi
@@ -7538,6 +7614,130 @@ else
 fi
 
 
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler handles -Wno-switch" >&5
+$as_echo_n "checking whether C compiler handles -Wno-switch... " >&6; }
+if test "${gl_cv_warn_c__Wno_switch+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+
+  gl_save_compiler_FLAGS="$CFLAGS"
+  as_fn_append CFLAGS " $gl_unknown_warnings_are_errors -Wswitch"
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  gl_cv_warn_c__Wno_switch=yes
+else
+  gl_cv_warn_c__Wno_switch=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+  CFLAGS="$gl_save_compiler_FLAGS"
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_warn_c__Wno_switch" >&5
+$as_echo "$gl_cv_warn_c__Wno_switch" >&6; }
+if test "x$gl_cv_warn_c__Wno_switch" = x""yes; then :
+  as_fn_append WARN_CFLAGS " -Wno-switch"
+fi
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler handles -Wno-tautological-constant-out-of-range-compare" >&5
+$as_echo_n "checking whether C compiler handles -Wno-tautological-constant-out-of-range-compare... " >&6; }
+if test "${gl_cv_warn_c__Wno_tautological_constant_out_of_range_compare+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+
+  gl_save_compiler_FLAGS="$CFLAGS"
+  as_fn_append CFLAGS " $gl_unknown_warnings_are_errors -Wtautological-constant-out-of-range-compare"
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  gl_cv_warn_c__Wno_tautological_constant_out_of_range_compare=yes
+else
+  gl_cv_warn_c__Wno_tautological_constant_out_of_range_compare=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+  CFLAGS="$gl_save_compiler_FLAGS"
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_warn_c__Wno_tautological_constant_out_of_range_compare" >&5
+$as_echo "$gl_cv_warn_c__Wno_tautological_constant_out_of_range_compare" >&6; }
+if test "x$gl_cv_warn_c__Wno_tautological_constant_out_of_range_compare" = x""yes; then :
+  as_fn_append WARN_CFLAGS " -Wno-tautological-constant-out-of-range-compare"
+fi
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler handles -Wno-pointer-sign" >&5
+$as_echo_n "checking whether C compiler handles -Wno-pointer-sign... " >&6; }
+if test "${gl_cv_warn_c__Wno_pointer_sign+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+
+  gl_save_compiler_FLAGS="$CFLAGS"
+  as_fn_append CFLAGS " $gl_unknown_warnings_are_errors -Wpointer-sign"
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  gl_cv_warn_c__Wno_pointer_sign=yes
+else
+  gl_cv_warn_c__Wno_pointer_sign=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+  CFLAGS="$gl_save_compiler_FLAGS"
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_warn_c__Wno_pointer_sign" >&5
+$as_echo "$gl_cv_warn_c__Wno_pointer_sign" >&6; }
+if test "x$gl_cv_warn_c__Wno_pointer_sign" = x""yes; then :
+  as_fn_append WARN_CFLAGS " -Wno-pointer-sign"
+fi
+
+
+  fi
+else
+  isystem='-isystem '
+
+  # This, $nw, is the list of warnings we disable.
+  nw=
+
+  case $with_x_toolkit in
+    lucid | athena | motif)
+       # Old toolkits mishandle 'const'.
+       nw="$nw -Wwrite-strings"
+       ;;
+    *)
+
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler handles -Werror" >&5
 $as_echo_n "checking whether C compiler handles -Werror... " >&6; }
 if test "${gl_cv_warn_c__Werror+set}" = set; then :
@@ -7557,12 +7757,13 @@ main ()
   return 0;
 }
 _ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
+if ac_fn_c_try_link "$LINENO"; then :
   gl_cv_warn_c__Werror=yes
 else
   gl_cv_warn_c__Werror=no
 fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
   CFLAGS="$gl_save_compiler_FLAGS"
 
 fi
@@ -7602,36 +7803,13 @@ fi
   # The following line should be removable at some point.
   nw="$nw -Wsuggest-attribute=pure"
 
-  # clang is unduly picky about some things.
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the compiler is clang" >&5
-$as_echo_n "checking whether the compiler is clang... " >&6; }
-if test "${emacs_cv_clang+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-           #ifndef __clang__
-             #error "not clang"
-           #endif
-
-int
-main ()
-{
+  # This part is merely for shortening the command line,
+  # since -Wno-FOO needs to be added below regardless.
+  nw="$nw -Wmissing-field-initializers"
+  nw="$nw -Wswitch"
+  nw="$nw -Wtype-limits"
+  nw="$nw -Wunused-parameter"
 
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  emacs_cv_clang=yes
-else
-  emacs_cv_clang=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $emacs_cv_clang" >&5
-$as_echo "$emacs_cv_clang" >&6; }
   if test $emacs_cv_clang = yes; then
     nw="$nw -Wcast-align"
   fi
@@ -7855,6 +8033,8 @@ $as_echo "$gl_cv_cc_uninitialized_supported" >&6; }
     -Wvla \
     -Wvolatile-register-var \
     -Wwrite-strings \
+    -fdiagnostics-show-option \
+    -funit-at-a-time \
     \
     ; do
     gl_manywarn_set="$gl_manywarn_set $gl_manywarn_item"
@@ -7889,6 +8069,10 @@ $as_echo "$gl_cv_cc_uninitialized_supported" >&6; }
   for w in $ws; do
 
 as_gl_Warn=`$as_echo "gl_cv_warn_c_$w" | $as_tr_sh`
+gl_positive="$w"
+case $gl_positive in
+  -Wno-*) gl_positive=-W`expr "X$gl_positive" : 'X-Wno-\(.*\)'` ;;
+esac
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler handles $w" >&5
 $as_echo_n "checking whether C compiler handles $w... " >&6; }
 if { as_var=$as_gl_Warn; eval "test \"\${$as_var+set}\" = set"; }; then :
@@ -7896,7 +8080,7 @@ if { as_var=$as_gl_Warn; eval "test \"\${$as_var+set}\" = set"; }; then :
 else
 
   gl_save_compiler_FLAGS="$CFLAGS"
-  as_fn_append CFLAGS " $gl_unknown_warnings_are_errors $w"
+  as_fn_append CFLAGS " $gl_unknown_warnings_are_errors $gl_positive"
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
@@ -7908,12 +8092,13 @@ main ()
   return 0;
 }
 _ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
+if ac_fn_c_try_link "$LINENO"; then :
   eval "$as_gl_Warn=yes"
 else
   eval "$as_gl_Warn=no"
 fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
   CFLAGS="$gl_save_compiler_FLAGS"
 
 fi
@@ -7935,7 +8120,7 @@ if test "${gl_cv_warn_c__Wno_missing_field_initializers+set}" = set; then :
 else
 
   gl_save_compiler_FLAGS="$CFLAGS"
-  as_fn_append CFLAGS " $gl_unknown_warnings_are_errors -Wno-missing-field-initializers"
+  as_fn_append CFLAGS " $gl_unknown_warnings_are_errors -Wmissing-field-initializers"
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
@@ -7947,12 +8132,13 @@ main ()
   return 0;
 }
 _ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
+if ac_fn_c_try_link "$LINENO"; then :
   gl_cv_warn_c__Wno_missing_field_initializers=yes
 else
   gl_cv_warn_c__Wno_missing_field_initializers=no
 fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
   CFLAGS="$gl_save_compiler_FLAGS"
 
 fi
@@ -7971,7 +8157,7 @@ if test "${gl_cv_warn_c__Wno_sign_compare+set}" = set; then :
 else
 
   gl_save_compiler_FLAGS="$CFLAGS"
-  as_fn_append CFLAGS " $gl_unknown_warnings_are_errors -Wno-sign-compare"
+  as_fn_append CFLAGS " $gl_unknown_warnings_are_errors -Wsign-compare"
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
@@ -7983,12 +8169,13 @@ main ()
   return 0;
 }
 _ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
+if ac_fn_c_try_link "$LINENO"; then :
   gl_cv_warn_c__Wno_sign_compare=yes
 else
   gl_cv_warn_c__Wno_sign_compare=no
 fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
   CFLAGS="$gl_save_compiler_FLAGS"
 
 fi
@@ -8007,7 +8194,7 @@ if test "${gl_cv_warn_c__Wno_type_limits+set}" = set; then :
 else
 
   gl_save_compiler_FLAGS="$CFLAGS"
-  as_fn_append CFLAGS " $gl_unknown_warnings_are_errors -Wno-type-limits"
+  as_fn_append CFLAGS " $gl_unknown_warnings_are_errors -Wtype-limits"
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
@@ -8019,12 +8206,13 @@ main ()
   return 0;
 }
 _ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
+if ac_fn_c_try_link "$LINENO"; then :
   gl_cv_warn_c__Wno_type_limits=yes
 else
   gl_cv_warn_c__Wno_type_limits=no
 fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
   CFLAGS="$gl_save_compiler_FLAGS"
 
 fi
@@ -8043,7 +8231,7 @@ if test "${gl_cv_warn_c__Wno_switch+set}" = set; then :
 else
 
   gl_save_compiler_FLAGS="$CFLAGS"
-  as_fn_append CFLAGS " $gl_unknown_warnings_are_errors -Wno-switch"
+  as_fn_append CFLAGS " $gl_unknown_warnings_are_errors -Wswitch"
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
@@ -8055,12 +8243,13 @@ main ()
   return 0;
 }
 _ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
+if ac_fn_c_try_link "$LINENO"; then :
   gl_cv_warn_c__Wno_switch=yes
 else
   gl_cv_warn_c__Wno_switch=no
 fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
   CFLAGS="$gl_save_compiler_FLAGS"
 
 fi
@@ -8079,7 +8268,7 @@ if test "${gl_cv_warn_c__Wno_unused_parameter+set}" = set; then :
 else
 
   gl_save_compiler_FLAGS="$CFLAGS"
-  as_fn_append CFLAGS " $gl_unknown_warnings_are_errors -Wno-unused-parameter"
+  as_fn_append CFLAGS " $gl_unknown_warnings_are_errors -Wunused-parameter"
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
@@ -8091,12 +8280,13 @@ main ()
   return 0;
 }
 _ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
+if ac_fn_c_try_link "$LINENO"; then :
   gl_cv_warn_c__Wno_unused_parameter=yes
 else
   gl_cv_warn_c__Wno_unused_parameter=no
 fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
   CFLAGS="$gl_save_compiler_FLAGS"
 
 fi
@@ -8115,7 +8305,7 @@ if test "${gl_cv_warn_c__Wno_format_nonliteral+set}" = set; then :
 else
 
   gl_save_compiler_FLAGS="$CFLAGS"
-  as_fn_append CFLAGS " $gl_unknown_warnings_are_errors -Wno-format-nonliteral"
+  as_fn_append CFLAGS " $gl_unknown_warnings_are_errors -Wformat-nonliteral"
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
@@ -8127,12 +8317,13 @@ main ()
   return 0;
 }
 _ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
+if ac_fn_c_try_link "$LINENO"; then :
   gl_cv_warn_c__Wno_format_nonliteral=yes
 else
   gl_cv_warn_c__Wno_format_nonliteral=no
 fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
   CFLAGS="$gl_save_compiler_FLAGS"
 
 fi
@@ -8154,7 +8345,7 @@ if test "${gl_cv_warn_c__Wno_logical_op+set}" = set; then :
 else
 
   gl_save_compiler_FLAGS="$CFLAGS"
-  as_fn_append CFLAGS " $gl_unknown_warnings_are_errors -Wno-logical-op"
+  as_fn_append CFLAGS " $gl_unknown_warnings_are_errors -Wlogical-op"
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
@@ -8166,12 +8357,13 @@ main ()
   return 0;
 }
 _ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
+if ac_fn_c_try_link "$LINENO"; then :
   gl_cv_warn_c__Wno_logical_op=yes
 else
   gl_cv_warn_c__Wno_logical_op=no
 fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
   CFLAGS="$gl_save_compiler_FLAGS"
 
 fi
@@ -8193,7 +8385,7 @@ if test "${gl_cv_warn_c__Wno_format_extra_args+set}" = set; then :
 else
 
   gl_save_compiler_FLAGS="$CFLAGS"
-  as_fn_append CFLAGS " $gl_unknown_warnings_are_errors -Wno-format-extra-args"
+  as_fn_append CFLAGS " $gl_unknown_warnings_are_errors -Wformat-extra-args"
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
@@ -8205,12 +8397,13 @@ main ()
   return 0;
 }
 _ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
+if ac_fn_c_try_link "$LINENO"; then :
   gl_cv_warn_c__Wno_format_extra_args=yes
 else
   gl_cv_warn_c__Wno_format_extra_args=no
 fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
   CFLAGS="$gl_save_compiler_FLAGS"
 
 fi
@@ -8229,7 +8422,7 @@ if test "${gl_cv_warn_c__Wno_tautological_constant_out_of_range_compare+set}" =
 else
 
   gl_save_compiler_FLAGS="$CFLAGS"
-  as_fn_append CFLAGS " $gl_unknown_warnings_are_errors -Wno-tautological-constant-out-of-range-compare"
+  as_fn_append CFLAGS " $gl_unknown_warnings_are_errors -Wtautological-constant-out-of-range-compare"
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
@@ -8241,12 +8434,13 @@ main ()
   return 0;
 }
 _ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
+if ac_fn_c_try_link "$LINENO"; then :
   gl_cv_warn_c__Wno_tautological_constant_out_of_range_compare=yes
 else
   gl_cv_warn_c__Wno_tautological_constant_out_of_range_compare=no
 fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
   CFLAGS="$gl_save_compiler_FLAGS"
 
 fi
@@ -8265,7 +8459,7 @@ if test "${gl_cv_warn_c__Wno_unused_command_line_argument+set}" = set; then :
 else
 
   gl_save_compiler_FLAGS="$CFLAGS"
-  as_fn_append CFLAGS " $gl_unknown_warnings_are_errors -Wno-unused-command-line-argument"
+  as_fn_append CFLAGS " $gl_unknown_warnings_are_errors -Wunused-command-line-argument"
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
@@ -8277,12 +8471,13 @@ main ()
   return 0;
 }
 _ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
+if ac_fn_c_try_link "$LINENO"; then :
   gl_cv_warn_c__Wno_unused_command_line_argument=yes
 else
   gl_cv_warn_c__Wno_unused_command_line_argument=no
 fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
   CFLAGS="$gl_save_compiler_FLAGS"
 
 fi
@@ -8301,7 +8496,7 @@ if test "${gl_cv_warn_c__Wno_unused_value+set}" = set; then :
 else
 
   gl_save_compiler_FLAGS="$CFLAGS"
-  as_fn_append CFLAGS " $gl_unknown_warnings_are_errors -Wno-unused-value"
+  as_fn_append CFLAGS " $gl_unknown_warnings_are_errors -Wunused-value"
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
@@ -8313,12 +8508,13 @@ main ()
   return 0;
 }
 _ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
+if ac_fn_c_try_link "$LINENO"; then :
   gl_cv_warn_c__Wno_unused_value=yes
 else
   gl_cv_warn_c__Wno_unused_value=no
 fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
   CFLAGS="$gl_save_compiler_FLAGS"
 
 fi
@@ -8332,79 +8528,6 @@ fi
   fi
 
 
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler handles -fdiagnostics-show-option" >&5
-$as_echo_n "checking whether C compiler handles -fdiagnostics-show-option... " >&6; }
-if test "${gl_cv_warn_c__fdiagnostics_show_option+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
-
-  gl_save_compiler_FLAGS="$CFLAGS"
-  as_fn_append CFLAGS " $gl_unknown_warnings_are_errors -fdiagnostics-show-option"
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-int
-main ()
-{
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  gl_cv_warn_c__fdiagnostics_show_option=yes
-else
-  gl_cv_warn_c__fdiagnostics_show_option=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-  CFLAGS="$gl_save_compiler_FLAGS"
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_warn_c__fdiagnostics_show_option" >&5
-$as_echo "$gl_cv_warn_c__fdiagnostics_show_option" >&6; }
-if test "x$gl_cv_warn_c__fdiagnostics_show_option" = x""yes; then :
-  as_fn_append WARN_CFLAGS " -fdiagnostics-show-option"
-fi
-
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler handles -funit-at-a-time" >&5
-$as_echo_n "checking whether C compiler handles -funit-at-a-time... " >&6; }
-if test "${gl_cv_warn_c__funit_at_a_time+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
-
-  gl_save_compiler_FLAGS="$CFLAGS"
-  as_fn_append CFLAGS " $gl_unknown_warnings_are_errors -funit-at-a-time"
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-int
-main ()
-{
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  gl_cv_warn_c__funit_at_a_time=yes
-else
-  gl_cv_warn_c__funit_at_a_time=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-  CFLAGS="$gl_save_compiler_FLAGS"
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_warn_c__funit_at_a_time" >&5
-$as_echo "$gl_cv_warn_c__funit_at_a_time" >&6; }
-if test "x$gl_cv_warn_c__funit_at_a_time" = x""yes; then :
-  as_fn_append WARN_CFLAGS " -funit-at-a-time"
-fi
-
-
-
-
 $as_echo "#define lint 1" >>confdefs.h
 
 
@@ -8553,6 +8676,9 @@ fi
 
 
 
+test $with_compress_install != yes && test -n "$GZIP_PROG" && \
+   GZIP_PROG=" # $GZIP_PROG # (disabled by configure --without-compress-install)"
+
 if test $opsys = gnu-linux; then
   # Extract the first word of "paxctl", so it can be a program name with args.
 set dummy paxctl; ac_word=$2
@@ -8699,6 +8825,13 @@ INFO_OPTS=--no-split
 
 
 
+if test $opsys = mingw32; then
+   DOCMISC_W32=efaq-w32
+else
+   DOCMISC_W32=
+fi
+
+
 
 if test x$GCC = xyes; then
   test "x$GCC_LINK_TEST_OPTIONS" != x && \
@@ -8709,13 +8842,15 @@ else
 fi
 
 
-late_LDFLAGS=$LDFLAGS
+late_LDFLAGS="$LDFLAGS"
 if test x$GCC = xyes; then
-  LDFLAGS="$LDFLAGS -Wl,-znocombreloc"
+  LDFLAGS_NOCOMBRELOC="-Wl,-znocombreloc"
 else
-  LDFLAGS="$LDFLAGS -znocombreloc"
+  LDFLAGS_NOCOMBRELOC="-znocombreloc"
 fi
 
+LDFLAGS="$LDFLAGS $LDFLAGS_NOCOMBRELOC"
+
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -znocombreloc" >&5
 $as_echo_n "checking for -znocombreloc... " >&6; }
 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -8733,13 +8868,14 @@ if ac_fn_c_try_link "$LINENO"; then :
   { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
 $as_echo "yes" >&6; }
 else
-  LDFLAGS=$late_LDFLAGS
+  LDFLAGS_NOCOMBRELOC=
   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 $as_echo "no" >&6; }
 fi
 rm -f core conftest.err conftest.$ac_objext \
     conftest$ac_exeext conftest.$ac_ext
 
+LDFLAGS="$late_LDFLAGS"
 
 test "x$CANNOT_DUMP" = "x" && CANNOT_DUMP=no
 case "$opsys" in
@@ -8853,10 +8989,10 @@ fi
     if test "x$GCC" = "xyes"; then
       C_SWITCH_MACHINE="-fno-common"
     else
-      as_fn_error "What gives?  Fix me if DEC Unix supports ELF now." "$LINENO" 5
+      as_fn_error "Non-GCC compilers are not supported." "$LINENO" 5
     fi
   else
-    UNEXEC_OBJ=unexalpha.o
+                        as_fn_error "Non-ELF systems are not supported since Emacs 24.1." "$LINENO" 5
   fi
   ;;
 esac
@@ -8994,6 +9130,7 @@ fi
 
 
 
+HAVE_SOUND=no
 if test "${with_sound}" != "no"; then
   # Sound support for GNU/Linux, the free BSDs, and MinGW.
   for ac_header in machine/soundcard.h sys/soundcard.h soundcard.h
@@ -9016,8 +9153,12 @@ fi
 
 done
 
-  # Emulation library used on NetBSD.
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _oss_ioctl in -lossaudio" >&5
+  test "${with_sound}" = "oss" && test "${have_sound_header}" != "yes" && \
+    as_fn_error "OSS sound support requested but not found." "$LINENO" 5
+
+  if test "${with_sound}" = "bsd-ossaudio" || test "${with_sound}" = "yes"; then
+    # Emulation library used on NetBSD.
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _oss_ioctl in -lossaudio" >&5
 $as_echo_n "checking for _oss_ioctl in -lossaudio... " >&6; }
 if test "${ac_cv_lib_ossaudio__oss_ioctl+set}" = set; then :
   $as_echo_n "(cached) " >&6
@@ -9059,10 +9200,14 @@ else
   LIBSOUND=
 fi
 
+    test "${with_sound}" = "bsd-ossaudio" && test -z "$LIBSOUND" && \
+      as_fn_error "bsd-ossaudio sound support requested but not found." "$LINENO" 5
+          fi
 
 
-  ALSA_REQUIRED=1.0.0
-  ALSA_MODULES="alsa >= $ALSA_REQUIRED"
+  if test "${with_sound}" = "alsa" || test "${with_sound}" = "yes"; then
+    ALSA_REQUIRED=1.0.0
+    ALSA_MODULES="alsa >= $ALSA_REQUIRED"
 
   succeeded=no
 
@@ -9114,12 +9259,12 @@ $as_echo "no" >&6; }
      HAVE_ALSA=no
   fi
 
-  if test $HAVE_ALSA = yes; then
-    SAVE_CFLAGS="$CFLAGS"
-    SAVE_LIBS="$LIBS"
-    CFLAGS="$ALSA_CFLAGS $CFLAGS"
-    LIBS="$ALSA_LIBS $LIBS"
-    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+    if test $HAVE_ALSA = yes; then
+      SAVE_CFLAGS="$CFLAGS"
+      SAVE_LIBS="$LIBS"
+      CFLAGS="$ALSA_CFLAGS $CFLAGS"
+      LIBS="$ALSA_LIBS $LIBS"
+      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #include <asoundlib.h>
 int
@@ -9136,8 +9281,8 @@ else
   emacs_alsa_normal=no
 fi
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-    if test "$emacs_alsa_normal" != yes; then
-      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+      if test "$emacs_alsa_normal" != yes; then
+        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #include <alsa/asoundlib.h>
 int
@@ -9154,27 +9299,30 @@ else
   emacs_alsa_subdir=no
 fi
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-      if test "$emacs_alsa_subdir" != yes; then
-        as_fn_error "pkg-config found alsa, but it does not compile.  See config.log for error messages." "$LINENO" 5
+        if test "$emacs_alsa_subdir" != yes; then
+          as_fn_error "pkg-config found alsa, but it does not compile.  See config.log for error messages." "$LINENO" 5
+        fi
+        ALSA_CFLAGS="$ALSA_CFLAGS -DALSA_SUBDIR_INCLUDE"
       fi
-      ALSA_CFLAGS="$ALSA_CFLAGS -DALSA_SUBDIR_INCLUDE"
-    fi
 
-    CFLAGS="$SAVE_CFLAGS"
-    LIBS="$SAVE_LIBS"
-    LIBSOUND="$LIBSOUND $ALSA_LIBS"
-    CFLAGS_SOUND="$CFLAGS_SOUND $ALSA_CFLAGS"
+      CFLAGS="$SAVE_CFLAGS"
+      LIBS="$SAVE_LIBS"
+      LIBSOUND="$LIBSOUND $ALSA_LIBS"
+      CFLAGS_SOUND="$CFLAGS_SOUND $ALSA_CFLAGS"
 
 $as_echo "#define HAVE_ALSA 1" >>confdefs.h
 
+    elif test "${with_sound}" = "alsa"; then
+      as_fn_error "ALSA sound support requested but not found." "$LINENO" 5
+    fi
   fi
-
-        if test x$have_sound_header = xyes || test $HAVE_ALSA = yes; then
+            if test x$have_sound_header = xyes || test $HAVE_ALSA = yes; then
      case "$opsys" in
-              gnu-linux|freebsd|netbsd|mingw32)
+                     gnu-linux|freebsd|netbsd|mingw32)
 
 $as_echo "#define HAVE_SOUND 1" >>confdefs.h
 
+         HAVE_SOUND=yes
          ;;
      esac
   fi
@@ -9956,7 +10104,11 @@ fi
 
 
 
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+  macfont_file=""
+  if test "${NS_IMPL_COCOA}" = "yes"; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for OSX 10.4 or newer" >&5
+$as_echo_n "checking for OSX 10.4 or newer... " >&6; }
+    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #include <AppKit/AppKit.h>
 int
@@ -9981,6 +10133,45 @@ else
   ns_osx_have_104=no
 fi
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ns_osx_have_104" >&5
+$as_echo "$ns_osx_have_104" >&6; }
+
+    if test $ns_osx_have_104 = no; then
+       as_fn_error "\`OSX 10.4 or newer is required'" "$LINENO" 5;
+    fi
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for OSX 10.5 or newer" >&5
+$as_echo_n "checking for OSX 10.5 or newer... " >&6; }
+    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <AppKit/AppKit.h>
+int
+main ()
+{
+
+#ifdef MAC_OS_X_VERSION_MAX_ALLOWED
+#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1050
+ ; /* OK */
+#else
+#error "OSX 10.5 not found"
+#endif
+#endif
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  ns_osx_have_105=yes
+else
+  ns_osx_have_105=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ns_osx_have_105" >&5
+$as_echo "$ns_osx_have_105" >&6; }
+    if test $ns_osx_have_105 = yes; then
+      macfont_file="macfont.o"
+    fi
+  fi
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #include <Foundation/NSObjCRuntime.h>
@@ -9998,9 +10189,6 @@ else
   ns_have_nsinteger=no
 fi
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-  if test $ns_osx_have_104 = no; then
-     as_fn_error "\`OSX 10.4 or newer is required'" "$LINENO" 5;
-  fi
   if test $ns_have_nsinteger = yes; then
 
 $as_echo "#define NS_HAVE_NSINTEGER 1" >>confdefs.h
@@ -10027,7 +10215,7 @@ if test "${HAVE_NS}" = yes; then
      exec_prefix=${ns_appbindir}
           libexecdir="\${ns_appbindir}/libexec"
      archlibdir="\${ns_appbindir}/libexec"
-     docdir="\${ns_appresdir}/etc"
+     etcdocdir="\${ns_appresdir}/etc"
      etcdir="\${ns_appresdir}/etc"
                infodir="\${ns_appresdir}/info"
      mandir="\${ns_appresdir}/man"
@@ -10035,7 +10223,8 @@ if test "${HAVE_NS}" = yes; then
      leimdir="\${ns_appresdir}/leim"
      INSTALL_ARCH_INDEP_EXTRA=
   fi
-  NS_OBJC_OBJ="nsterm.o nsfns.o nsmenu.o nsselect.o nsimage.o nsfont.o"
+
+  NS_OBJC_OBJ="nsterm.o nsfns.o nsmenu.o nsselect.o nsimage.o nsfont.o $macfont_file"
 fi
 CFLAGS="$tmp_CFLAGS"
 CPPFLAGS="$tmp_CPPFLAGS"
@@ -10052,6 +10241,7 @@ CLIENTRES=
 CLIENTW=
 W32_RES_LINK=
 EMACS_MANIFEST=
+UPDATE_MANIFEST=
 if test "${with_w32}" != no; then
   case "${opsys}" in
     cygwin)
@@ -10085,8 +10275,8 @@ $as_echo_n "checking whether Windows API headers are recent enough... " >&6; }
 int
 main ()
 {
-void test(PIMAGE_NT_HEADERS pHeader)
-     {PIMAGE_SECTION_HEADER pSection = IMAGE_FIRST_SECTION(pHeader);}
+PIMAGE_NT_HEADERS pHeader;
+     PIMAGE_SECTION_HEADER pSection = IMAGE_FIRST_SECTION(pHeader)
   ;
   return 0;
 }
@@ -10215,6 +10405,7 @@ fi
     x86_64-*-*) EMACS_MANIFEST="emacs-x64.manifest" ;;
     *) EMACS_MANIFEST="emacs-x86.manifest" ;;
   esac
+  UPDATE_MANIFEST=update-game-score.exe.manifest
   if test "${opsys}" = "cygwin"; then
     W32_LIBS="$W32_LIBS -lkernel32 -luser32 -lgdi32 -lole32 -lcomdlg32"
     W32_LIBS="$W32_LIBS -lusp10 -lcomctl32 -lwinspool"
@@ -10252,6 +10443,7 @@ fi
 
 
 
+
 if test "${HAVE_W32}" = "yes"; then
   window_system=w32
   with_xft=no
 ## $window_system is now set to the window system we will
 ## ultimately use.
 
+if test "$window_system" = none && test "$gl_gcc_warnings" = yes; then
+   # Too many warnings for now.
+   nw=
+   nw="$nw -Wsuggest-attribute=const"
+   nw="$nw -Wsuggest-attribute=noreturn"
+
+  gl_warn_set=
+  set x $WARN_CFLAGS; shift
+  for gl_warn_item
+  do
+    case " $nw " in
+      *" $gl_warn_item "*)
+        ;;
+      *)
+        gl_warn_set="$gl_warn_set $gl_warn_item"
+        ;;
+    esac
+  done
+  WARN_CFLAGS=$gl_warn_set
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler handles -Wno-unused-variable" >&5
+$as_echo_n "checking whether C compiler handles -Wno-unused-variable... " >&6; }
+if test "${gl_cv_warn_c__Wno_unused_variable+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+
+  gl_save_compiler_FLAGS="$CFLAGS"
+  as_fn_append CFLAGS " $gl_unknown_warnings_are_errors -Wunused-variable"
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  gl_cv_warn_c__Wno_unused_variable=yes
+else
+  gl_cv_warn_c__Wno_unused_variable=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+  CFLAGS="$gl_save_compiler_FLAGS"
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_warn_c__Wno_unused_variable" >&5
+$as_echo "$gl_cv_warn_c__Wno_unused_variable" >&6; }
+if test "x$gl_cv_warn_c__Wno_unused_variable" = x""yes; then :
+  as_fn_append WARN_CFLAGS " -Wno-unused-variable"
+fi
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler handles -Wno-unused-but-set-variable" >&5
+$as_echo_n "checking whether C compiler handles -Wno-unused-but-set-variable... " >&6; }
+if test "${gl_cv_warn_c__Wno_unused_but_set_variable+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+
+  gl_save_compiler_FLAGS="$CFLAGS"
+  as_fn_append CFLAGS " $gl_unknown_warnings_are_errors -Wunused-but-set-variable"
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  gl_cv_warn_c__Wno_unused_but_set_variable=yes
+else
+  gl_cv_warn_c__Wno_unused_but_set_variable=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+  CFLAGS="$gl_save_compiler_FLAGS"
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_warn_c__Wno_unused_but_set_variable" >&5
+$as_echo "$gl_cv_warn_c__Wno_unused_but_set_variable" >&6; }
+if test "x$gl_cv_warn_c__Wno_unused_but_set_variable" = x""yes; then :
+  as_fn_append WARN_CFLAGS " -Wno-unused-but-set-variable"
+fi
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler handles -Wno-unused-but-set-parameter" >&5
+$as_echo_n "checking whether C compiler handles -Wno-unused-but-set-parameter... " >&6; }
+if test "${gl_cv_warn_c__Wno_unused_but_set_parameter+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+
+  gl_save_compiler_FLAGS="$CFLAGS"
+  as_fn_append CFLAGS " $gl_unknown_warnings_are_errors -Wunused-but-set-parameter"
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  gl_cv_warn_c__Wno_unused_but_set_parameter=yes
+else
+  gl_cv_warn_c__Wno_unused_but_set_parameter=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+  CFLAGS="$gl_save_compiler_FLAGS"
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_warn_c__Wno_unused_but_set_parameter" >&5
+$as_echo "$gl_cv_warn_c__Wno_unused_but_set_parameter" >&6; }
+if test "x$gl_cv_warn_c__Wno_unused_but_set_parameter" = x""yes; then :
+  as_fn_append WARN_CFLAGS " -Wno-unused-but-set-parameter"
+fi
+
+
+fi
+
 term_header=
 HAVE_X_WINDOWS=no
 HAVE_X11=no
@@ -10347,11 +10673,8 @@ to configure." "$LINENO" 5
    fi
 fi
 
-### If we're using X11, we should use the X menu package.
-HAVE_MENUS=no
-case ${HAVE_X11} in
-  yes ) HAVE_MENUS=yes ;;
-esac
+### We always support menus.
+HAVE_MENUS=yes
 
 # Does the opsystem file prohibit the use of the GNU malloc?
 # Assume not, until told otherwise.
@@ -11183,7 +11506,7 @@ $as_echo "#define HAVE_RSVG 1" >>confdefs.h
 fi
 
 HAVE_IMAGEMAGICK=no
-if test "${HAVE_X11}" = "yes"; then
+if test "${HAVE_X11}" = "yes" || test "${HAVE_NS}" = "yes"; then
   if test "${with_imagemagick}" != "no"; then
     ## 6.2.8 is the earliest version known to work, but earlier versions
     ## might work - let us know if you find one.
@@ -11854,17 +12177,6 @@ $as_echo "no" >&6; }
     SAVE_LIBS="$LIBS"
     CFLAGS="$SETTINGS_CFLAGS $CFLAGS"
     LIBS="$SETTINGS_LIBS $LIBS"
-    for ac_func in g_type_init
-do :
-  ac_fn_c_check_func "$LINENO" "g_type_init" "ac_cv_func_g_type_init"
-if test "x$ac_cv_func_g_type_init" = x""yes; then :
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_G_TYPE_INIT 1
-_ACEOF
-
-fi
-done
-
     CFLAGS="$SAVE_CFLAGS"
     LIBS="$SAVE_LIBS"
 fi
 
 
 HAVE_GNUTLS=no
+HAVE_GNUTLS3=no
 if test "${with_gnutls}" = "yes" ; then
 
   succeeded=no
 
+  if test "$PKG_CONFIG" = "no" ; then
+     HAVE_GNUTLS3=no
+  else
+     PKG_CONFIG_MIN_VERSION=0.9.0
+     if "$PKG_CONFIG" --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then
+        { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gnutls >= 3.0.0" >&5
+$as_echo_n "checking for gnutls >= 3.0.0... " >&6; }
+
+        if "$PKG_CONFIG" --exists "gnutls >= 3.0.0" 2>&5 &&
+          LIBGNUTLS_CFLAGS=`"$PKG_CONFIG" --cflags "gnutls >= 3.0.0" 2>&5` &&
+          LIBGNUTLS_LIBS=`"$PKG_CONFIG" --libs "gnutls >= 3.0.0" 2>&5`; then
+           edit_cflags="
+             s,///*,/,g
+             s/^/ /
+             s/ -I/ $isystem/g
+             s/^ //
+           "
+           LIBGNUTLS_CFLAGS=`$as_echo "$LIBGNUTLS_CFLAGS" | sed -e "$edit_cflags"`
+           LIBGNUTLS_LIBS=`$as_echo "$LIBGNUTLS_LIBS" | sed -e 's,///*,/,g'`
+            { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes CFLAGS='$LIBGNUTLS_CFLAGS' LIBS='$LIBGNUTLS_LIBS'" >&5
+$as_echo "yes CFLAGS='$LIBGNUTLS_CFLAGS' LIBS='$LIBGNUTLS_LIBS'" >&6; }
+            succeeded=yes
+        else
+            { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+            LIBGNUTLS_CFLAGS=""
+            LIBGNUTLS_LIBS=""
+            ## If we have a custom action on failure, don't print errors, but
+           ## do set a variable so people can do so.  Do it in a subshell
+           ## to capture any diagnostics in invoking pkg-config.
+           LIBGNUTLS_PKG_ERRORS=`("$PKG_CONFIG" --print-errors "gnutls >= 3.0.0") 2>&1`
+
+        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
+     HAVE_GNUTLS3=yes
+  else
+     HAVE_GNUTLS3=no
+  fi
+
+  if test "${HAVE_GNUTLS3}" = "yes"; then
+
+$as_echo "#define HAVE_GNUTLS3 1" >>confdefs.h
+
+    HAVE_GNUTLS="yes"
+  else
+
+  succeeded=no
+
   if test "$PKG_CONFIG" = "no" ; then
      HAVE_GNUTLS=no
   else
@@ -11979,6 +12349,7 @@ $as_echo "no" >&6; }
      HAVE_GNUTLS=no
   fi
 
+  fi
   if test "${HAVE_GNUTLS}" = "yes"; then
 
 $as_echo "#define HAVE_GNUTLS 1" >>confdefs.h
 NOTIFY_OBJ=
 NOTIFY_SUMMARY=no
 
-if test "${with_file_notification}" = "yes"; then
-   if test "${opsys}" = "mingw32"; then
-      with_file_notification=w32
-   else
-      if test "${with_ns}" != yes; then
-        with_file_notification=gfile
-      fi
-   fi
+if test "${with_ns}" = yes && test ${with_file_notification} = yes; then
+  with_file_notification=no
+fi
+
+case $with_file_notification,$opsys in
+  w32,* | yes,mingw32)
+    ac_fn_c_check_header_mongrel "$LINENO" "windows.h" "ac_cv_header_windows_h" "$ac_includes_default"
+if test "x$ac_cv_header_windows_h" = x""yes; then :
+
 fi
 
-if test "${with_file_notification}" = "gfile"; then
+
+    if test "$ac_cv_header_windows_h" = yes ; then
+
+$as_echo "#define HAVE_W32NOTIFY 1" >>confdefs.h
+
+       NOTIFY_OBJ=w32notify.o
+       NOTIFY_SUMMARY="yes (w32)"
+    fi ;;
+esac
+
+case $with_file_notification,$NOTIFY_OBJ in
+  gfile, | yes,)
 
   succeeded=no
 
@@ -12062,51 +12445,44 @@ $as_echo "no" >&6; }
      HAVE_GFILENOTIFY=no
   fi
 
-   if test "$HAVE_GFILENOTIFY" = "yes"; then
+    if test "$HAVE_GFILENOTIFY" = "yes"; then
 
 $as_echo "#define HAVE_GFILENOTIFY 1" >>confdefs.h
 
-      NOTIFY_OBJ=gfilenotify.o
-      NOTIFY_SUMMARY="yes -lgio (gfile)"
-   fi
-fi
-if test "${with_file_notification}" = "inotify"; then
-   ac_fn_c_check_header_mongrel "$LINENO" "sys/inotify.h" "ac_cv_header_sys_inotify_h" "$ac_includes_default"
+       NOTIFY_OBJ=gfilenotify.o
+       NOTIFY_SUMMARY="yes -lgio (gfile)"
+    fi ;;
+esac
+
+case $with_file_notification,$NOTIFY_OBJ in
+  inotify, | yes,)
+    ac_fn_c_check_header_mongrel "$LINENO" "sys/inotify.h" "ac_cv_header_sys_inotify_h" "$ac_includes_default"
 if test "x$ac_cv_header_sys_inotify_h" = x""yes; then :
 
 fi
 
 
-   if test "$ac_cv_header_sys_inotify_h" = yes ; then
-       ac_fn_c_check_func "$LINENO" "inotify_init1" "ac_cv_func_inotify_init1"
+    if test "$ac_cv_header_sys_inotify_h" = yes ; then
+       ac_fn_c_check_func "$LINENO" "inotify_init1" "ac_cv_func_inotify_init1"
 if test "x$ac_cv_func_inotify_init1" = x""yes; then :
 
 fi
 
-       if test "$ac_cv_func_inotify_init1" = yes; then
+       if test "$ac_cv_func_inotify_init1" = yes; then
 
 $as_echo "#define HAVE_INOTIFY 1" >>confdefs.h
 
-          NOTIFY_OBJ=inotify.o
-          NOTIFY_SUMMARY="yes -lglibc (inotify)"
-       fi
-  fi
-fi
-if test "${with_file_notification}" = "w32"; then
-   ac_fn_c_check_header_mongrel "$LINENO" "windows.h" "ac_cv_header_windows_h" "$ac_includes_default"
-if test "x$ac_cv_header_windows_h" = x""yes; then :
-
-fi
-
-
-   if test "$ac_cv_header_windows_h" = yes ; then
+         NOTIFY_OBJ=inotify.o
+         NOTIFY_SUMMARY="yes -lglibc (inotify)"
+       fi
+    fi ;;
+esac
 
-$as_echo "#define HAVE_W32NOTIFY 1" >>confdefs.h
+case $with_file_notification,$NOTIFY_OBJ in
+  yes,* | no,* | *,?*) ;;
+  *) as_fn_error "File notification \`$with_file_notification' requested but requirements not found." "$LINENO" 5 ;;
+esac
 
-      NOTIFY_OBJ=w32notify.o
-      NOTIFY_SUMMARY="yes (w32)"
-   fi
-fi
 if test -n "$NOTIFY_OBJ"; then
 
 $as_echo "#define USE_FILE_NOTIFY 1" >>confdefs.h
 fi
 
 
+HAVE_ZLIB=no
+LIBZ=
+if test "${with_zlib}" != "no"; then
+  OLIBS=$LIBS
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing inflateEnd" >&5
+$as_echo_n "checking for library containing inflateEnd... " >&6; }
+if test "${ac_cv_search_inflateEnd+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_func_search_save_LIBS=$LIBS
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* 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 inflateEnd ();
+int
+main ()
+{
+return inflateEnd ();
+  ;
+  return 0;
+}
+_ACEOF
+for ac_lib in '' z; do
+  if test -z "$ac_lib"; then
+    ac_res="none required"
+  else
+    ac_res=-l$ac_lib
+    LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
+  fi
+  if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_search_inflateEnd=$ac_res
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext
+  if test "${ac_cv_search_inflateEnd+set}" = set; then :
+  break
+fi
+done
+if test "${ac_cv_search_inflateEnd+set}" = set; then :
+
+else
+  ac_cv_search_inflateEnd=no
+fi
+rm conftest.$ac_ext
+LIBS=$ac_func_search_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_inflateEnd" >&5
+$as_echo "$ac_cv_search_inflateEnd" >&6; }
+ac_res=$ac_cv_search_inflateEnd
+if test "$ac_res" != no; then :
+  test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
+  HAVE_ZLIB=yes
+fi
+
+  LIBS=$OLIBS
+  case $ac_cv_search_inflateEnd in
+    -*) LIBZ=$ac_cv_search_inflateEnd ;;
+  esac
+fi
+if test "${HAVE_ZLIB}" = "yes"; then
+
+$as_echo "#define HAVE_ZLIB 1" >>confdefs.h
+
+  ### mingw32 doesn't use -lz, since it loads the library dynamically.
+  if test "${opsys}" = "mingw32"; then
+     LIBZ=
+  fi
+fi
+
+
+
 ### Use -ltiff if available, unless `--with-tiff=no'.
 ### mingw32 doesn't use -ltiff, since it loads the library dynamically.
 HAVE_TIFF=no
@@ -13695,8 +14148,47 @@ elif test "${HAVE_X11}" = "yes" && test "${with_gif}" != "no" \
   ac_fn_c_check_header_mongrel "$LINENO" "gif_lib.h" "ac_cv_header_gif_lib_h" "$ac_includes_default"
 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:${as_lineno-$LINENO}: checking for EGifPutExtensionLast in -lgif" >&5
+# Earlier versions can crash Emacs, but version 5.0 removes EGifPutExtensionLast.
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GifMakeMapObject in -lgif" >&5
+$as_echo_n "checking for GifMakeMapObject in -lgif... " >&6; }
+if test "${ac_cv_lib_gif_GifMakeMapObject+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lgif  $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* 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 GifMakeMapObject ();
+int
+main ()
+{
+return GifMakeMapObject ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_gif_GifMakeMapObject=yes
+else
+  ac_cv_lib_gif_GifMakeMapObject=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_gif_GifMakeMapObject" >&5
+$as_echo "$ac_cv_lib_gif_GifMakeMapObject" >&6; }
+if test "x$ac_cv_lib_gif_GifMakeMapObject" = x""yes; then :
+  HAVE_GIF=yes
+else
+  { $as_echo "$as_me:${as_lineno-$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
@@ -13738,6 +14230,8 @@ else
   HAVE_GIF=maybe
 fi
 
+fi
+
 fi
 
 
@@ -13907,15 +14401,9 @@ $as_echo "#define NS_IMPL_GNUSTEP 1" >>confdefs.h
     ## Extra CFLAGS applied to src/*.m files.
     GNU_OBJC_CFLAGS="$GNU_OBJC_CFLAGS -fgnu-runtime -Wno-import -fconstant-string-class=NSConstantString -DGNUSTEP_BASE_LIBRARY=1 -DGNU_GUI_LIBRARY=1 -DGNU_RUNTIME=1 -DGSWARN -DGSDIAGNOSE"
   fi
-  # We also have mouse menus.
-  HAVE_MENUS=yes
   OTHER_FILES=ns-app
 fi
 
-if test "${HAVE_W32}" = "yes"; then
-  HAVE_MENUS=yes
-fi
-
 ### Use session management (-lSM -lICE) if available
 HAVE_X_SM=no
 LIBXSM=
@@ -14668,7 +15156,7 @@ select getpagesize setlocale \
 getrlimit setrlimit shutdown getaddrinfo \
 strsignal setitimer \
 sendto recvfrom getsockname getpeername getifaddrs freeifaddrs \
-gai_strerror mkostemp mkstemp getline getdelim sync \
+gai_strerror getline getdelim sync \
 difftime posix_memalign \
 getpwent endpwent getgrent endgrent \
 touchlock \
@@ -15016,6 +15504,11 @@ $as_echo "#define TERMINFO 1" >>confdefs.h
 
   TERMCAP_OBJ=terminfo.o
 fi
+if test "X$LIBS_TERMCAP" = "X-lncurses"; then
+
+$as_echo "#define USE_NCURSES 1" >>confdefs.h
+
+fi
 
 
 
 
 
 
+for ac_header in valgrind/valgrind.h
+do :
+  ac_fn_c_check_header_mongrel "$LINENO" "valgrind/valgrind.h" "ac_cv_header_valgrind_valgrind_h" "$ac_includes_default"
+if test "x$ac_cv_header_valgrind_valgrind_h" = x""yes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_VALGRIND_VALGRIND_H 1
+_ACEOF
+
+fi
+
+done
+
+
 
 
 
@@ -16321,7 +16827,7 @@ esac
 emacs_broken_SIGIO=no
 
 case $opsys in
-      hpux* | irix6-5 | openbsd | sol2* | unixware | gnu-kfreebsd )
+      hpux* | irix6-5 | openbsd | sol2* | unixware )
     emacs_broken_SIGIO=yes
     ;;
 
@@ -16436,10 +16942,10 @@ $as_echo "#define UNIX98_PTYS 1" >>confdefs.h
 
       $as_echo "#define PTY_ITERATION int i; for (i = 0; i < 1; i++)" >>confdefs.h
 
-                  $as_echo "#define PTY_TTY_NAME_SPRINTF { char *ptyname = 0; sigset_t blocked; sigemptyset (&blocked); sigaddset (&blocked, SIGCHLD); pthread_sigmask (SIG_BLOCK, &blocked, 0); if (grantpt (fd) != -1 && unlockpt (fd) != -1) ptyname = ptsname(fd); pthread_sigmask (SIG_UNBLOCK, &blocked, 0); if (!ptyname) { close (fd); return -1; } snprintf (pty_name, sizeof pty_name, \"%s\", ptyname); }" >>confdefs.h
+                  $as_echo "#define PTY_TTY_NAME_SPRINTF { char *ptyname = 0; sigset_t blocked; sigemptyset (&blocked); sigaddset (&blocked, SIGCHLD); pthread_sigmask (SIG_BLOCK, &blocked, 0); if (grantpt (fd) != -1 && unlockpt (fd) != -1) ptyname = ptsname(fd); pthread_sigmask (SIG_UNBLOCK, &blocked, 0); if (!ptyname) { emacs_close (fd); return -1; } snprintf (pty_name, PTY_NAME_SIZE, \"%s\", ptyname); }" >>confdefs.h
 
             if test "x$ac_cv_func_posix_openpt" = xyes; then
-        $as_echo "#define PTY_OPEN fd = posix_openpt (O_RDWR | O_CLOEXEC | O_NOCTTY)" >>confdefs.h
+        $as_echo "#define PTY_OPEN do { fd = posix_openpt (O_RDWR | O_CLOEXEC | O_NOCTTY); if (fd < 0 && errno == EINVAL) fd = posix_openpt (O_RDWR | O_NOCTTY); } while (0)" >>confdefs.h
 
         $as_echo "#define PTY_NAME_SPRINTF /**/" >>confdefs.h
 
@@ -16481,12 +16987,12 @@ $as_echo "#define UNIX98_PTYS 1" >>confdefs.h
     ;;
 
   sol2* )
-                $as_echo "#define PTY_TTY_NAME_SPRINTF { char *ptsname (int), *ptyname; int grantpt_result; sigset_t blocked; sigemptyset (&blocked); sigaddset (&blocked, SIGCHLD); pthread_sigmask (SIG_BLOCK, &blocked, 0); grantpt_result = grantpt (fd); pthread_sigmask (SIG_UNBLOCK, &blocked, 0); if (grantpt_result == -1 || unlockpt (fd) == -1 || !(ptyname = ptsname (fd))) { emacs_close (fd); return -1; } snprintf (pty_name, sizeof pty_name, \"%s\", ptyname); }" >>confdefs.h
+                $as_echo "#define PTY_TTY_NAME_SPRINTF { char *ptsname (int), *ptyname; int grantpt_result; sigset_t blocked; sigemptyset (&blocked); sigaddset (&blocked, SIGCHLD); pthread_sigmask (SIG_BLOCK, &blocked, 0); grantpt_result = grantpt (fd); pthread_sigmask (SIG_UNBLOCK, &blocked, 0); if (grantpt_result == -1 || unlockpt (fd) == -1 || !(ptyname = ptsname (fd))) { emacs_close (fd); return -1; } snprintf (pty_name, PTY_NAME_SIZE, \"%s\", ptyname); }" >>confdefs.h
 
     ;;
 
   unixware )
-        $as_echo "#define PTY_TTY_NAME_SPRINTF { char *ptsname (int), *ptyname; int grantpt_result; sigset_t blocked; sigemptyset (&blocked); sigaddset (&blocked, SIGCHLD); pthread_sigmask (SIG_BLOCK, &blocked, 0); grantpt_result = grantpt (fd); pthread_sigmask (SIG_UNBLOCK, &blocked, 0); if (grantpt_result == -1) fatal(\"could not grant slave pty\"); if (unlockpt(fd) == -1) fatal(\"could not unlock slave pty\"); if (!(ptyname = ptsname(fd))) fatal (\"could not enable slave pty\"); snprintf (pty_name, sizeof pty_name, \"%s\", ptyname); }" >>confdefs.h
+        $as_echo "#define PTY_TTY_NAME_SPRINTF { char *ptsname (int), *ptyname; int grantpt_result; sigset_t blocked; sigemptyset (&blocked); sigaddset (&blocked, SIGCHLD); pthread_sigmask (SIG_BLOCK, &blocked, 0); grantpt_result = grantpt (fd); pthread_sigmask (SIG_UNBLOCK, &blocked, 0); if (grantpt_result == -1) fatal(\"could not grant slave pty\"); if (unlockpt(fd) == -1) fatal(\"could not unlock slave pty\"); if (!(ptyname = ptsname(fd))) fatal (\"could not enable slave pty\"); snprintf (pty_name, PTY_NAME_SIZE, \"%s\", ptyname); }" >>confdefs.h
 
     ;;
 esac
@@ -16936,7 +17442,7 @@ fi
 
 
 case $opsys in
-          cygwin)
+                cygwin)
 
 $as_echo "#define G_SLICE_ALWAYS_MALLOC 1" >>confdefs.h
 
@@ -17039,7 +17545,6 @@ cat >>confdefs.h <<_ACEOF
 #define EMACS_CONFIGURATION "${canonical}"
 _ACEOF
 
-emacs_config_options=`echo "$emacs_config_options " | sed -e 's/--no-create //' -e 's/--no-recursion //' -e 's/ *$//' -e "s/\"/'/g"`
 
 cat >>confdefs.h <<_ACEOF
 #define EMACS_CONFIG_OPTIONS "${emacs_config_options}"
@@ -17215,6 +17720,8 @@ fi
 
 
 
+
+
 # Configure gnulib.  Although this does not affect CFLAGS or LIBS permanently.
 # it temporarily reverts them to their pre-pkg-config values,
 # because gnulib needs to work with both src (which uses the
 
 
 
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for unsigned long long int" >&5
+$as_echo_n "checking for unsigned long long int... " >&6; }
+if test "${ac_cv_type_unsigned_long_long_int+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_cv_type_unsigned_long_long_int=yes
+     if test "x${ac_cv_prog_cc_c99-no}" = xno; then
+       cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+  /* For now, do not test the preprocessor; as of 2007 there are too many
+         implementations with broken preprocessors.  Perhaps this can
+         be revisited in 2012.  In the meantime, code should not expect
+         #if to work with literals wider than 32 bits.  */
+      /* Test literals.  */
+      long long int ll = 9223372036854775807ll;
+      long long int nll = -9223372036854775807LL;
+      unsigned long long int ull = 18446744073709551615ULL;
+      /* Test constant expressions.   */
+      typedef int a[((-9223372036854775807LL < 0 && 0 < 9223372036854775807ll)
+                     ? 1 : -1)];
+      typedef int b[(18446744073709551615ULL <= (unsigned long long int) -1
+                     ? 1 : -1)];
+      int i = 63;
+int
+main ()
+{
+/* Test availability of runtime routines for shift and division.  */
+      long long int llmax = 9223372036854775807ll;
+      unsigned long long int ullmax = 18446744073709551615ull;
+      return ((ll << 63) | (ll >> 63) | (ll < i) | (ll > i)
+              | (llmax / ll) | (llmax % ll)
+              | (ull << 63) | (ull >> 63) | (ull << i) | (ull >> i)
+              | (ullmax / ull) | (ullmax % ull));
+  ;
+  return 0;
+}
+
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+
+else
+  ac_cv_type_unsigned_long_long_int=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+     fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_unsigned_long_long_int" >&5
+$as_echo "$ac_cv_type_unsigned_long_long_int" >&6; }
+  if test $ac_cv_type_unsigned_long_long_int = yes; then
+
+$as_echo "#define HAVE_UNSIGNED_LONG_LONG_INT 1" >>confdefs.h
+
+  fi
+
+
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether byte ordering is bigendian" >&5
 $as_echo_n "checking whether byte ordering is bigendian... " >&6; }
 if test "${ac_cv_c_bigendian+set}" = set; then :
@@ -17759,6 +18323,7 @@ $as_echo "#define AC_APPLE_UNIVERSAL_BUILD 1" >>confdefs.h
   REPLACE_FTRUNCATE=0;
   REPLACE_GETCWD=0;
   REPLACE_GETDOMAINNAME=0;
+  REPLACE_GETDTABLESIZE=0;
   REPLACE_GETLOGIN_R=0;
   REPLACE_GETGROUPS=0;
   REPLACE_GETPAGESIZE=0;
@@ -18483,8 +19048,6 @@ _ACEOF
 
 
 
-
-
      GNULIB_FCHMODAT=0;
   GNULIB_FSTAT=0;
   GNULIB_FSTATAT=0;
@@ -19517,93 +20080,36 @@ else
               #endif
 
 int
-main ()
-{
-static struct timeval x;
-              typedef int verify_tv_sec_type[
-                sizeof (time_t) <= sizeof x.tv_sec ? 1 : -1
-              ];
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  gl_cv_sys_struct_timeval_tv_sec=yes
-else
-  gl_cv_sys_struct_timeval_tv_sec=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_sys_struct_timeval_tv_sec" >&5
-$as_echo "$gl_cv_sys_struct_timeval_tv_sec" >&6; }
-    if test $gl_cv_sys_struct_timeval_tv_sec != yes; then
-      REPLACE_STRUCT_TIMEVAL=1
-    fi
-  fi
-
-
-
-
-
-
-
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for unsigned long long int" >&5
-$as_echo_n "checking for unsigned long long int... " >&6; }
-if test "${ac_cv_type_unsigned_long_long_int+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
-  ac_cv_type_unsigned_long_long_int=yes
-     if test "x${ac_cv_prog_cc_c99-no}" = xno; then
-       cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-  /* For now, do not test the preprocessor; as of 2007 there are too many
-         implementations with broken preprocessors.  Perhaps this can
-         be revisited in 2012.  In the meantime, code should not expect
-         #if to work with literals wider than 32 bits.  */
-      /* Test literals.  */
-      long long int ll = 9223372036854775807ll;
-      long long int nll = -9223372036854775807LL;
-      unsigned long long int ull = 18446744073709551615ULL;
-      /* Test constant expressions.   */
-      typedef int a[((-9223372036854775807LL < 0 && 0 < 9223372036854775807ll)
-                     ? 1 : -1)];
-      typedef int b[(18446744073709551615ULL <= (unsigned long long int) -1
-                     ? 1 : -1)];
-      int i = 63;
-int
-main ()
-{
-/* Test availability of runtime routines for shift and division.  */
-      long long int llmax = 9223372036854775807ll;
-      unsigned long long int ullmax = 18446744073709551615ull;
-      return ((ll << 63) | (ll >> 63) | (ll < i) | (ll > i)
-              | (llmax / ll) | (llmax % ll)
-              | (ull << 63) | (ull >> 63) | (ull << i) | (ull >> i)
-              | (ullmax / ull) | (ullmax % ull));
+main ()
+{
+static struct timeval x;
+              typedef int verify_tv_sec_type[
+                sizeof (time_t) <= sizeof x.tv_sec ? 1 : -1
+              ];
+
   ;
   return 0;
 }
-
 _ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-
+if ac_fn_c_try_compile "$LINENO"; then :
+  gl_cv_sys_struct_timeval_tv_sec=yes
 else
-  ac_cv_type_unsigned_long_long_int=no
+  gl_cv_sys_struct_timeval_tv_sec=no
 fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-     fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_unsigned_long_long_int" >&5
-$as_echo "$ac_cv_type_unsigned_long_long_int" >&6; }
-  if test $ac_cv_type_unsigned_long_long_int = yes; then
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_sys_struct_timeval_tv_sec" >&5
+$as_echo "$gl_cv_sys_struct_timeval_tv_sec" >&6; }
+    if test $gl_cv_sys_struct_timeval_tv_sec != yes; then
+      REPLACE_STRUCT_TIMEVAL=1
+    fi
+  fi
+
+
+
 
-$as_echo "#define HAVE_UNSIGNED_LONG_LONG_INT 1" >>confdefs.h
 
-  fi
 
 
 
@@ -20449,6 +20955,7 @@ fi
   HAVE_DECL_STRTOIMAX=1;
   HAVE_DECL_STRTOUMAX=1;
   REPLACE_STRTOIMAX=0;
+  REPLACE_STRTOUMAX=0;
   INT32_MAX_LT_INTMAX_MAX=1;
   INT64_MAX_EQ_LONG_MAX='defined _LP64';
   PRI_MACROS_BROKEN=0;
@@ -20674,6 +21181,8 @@ cat >>confdefs.h <<_ACEOF
 _ACEOF
 
 
+
+
   GNULIB_MKTIME=0;
   GNULIB_NANOSLEEP=0;
   GNULIB_STRPTIME=0;
@@ -21903,6 +22412,8 @@ _ACEOF
 
 
 
+
+
    if false; then
   GL_COND_LIBTOOL_TRUE=
   GL_COND_LIBTOOL_FALSE='#'
 
 
 
+    for ac_header in byteswap.h
+do :
+  ac_fn_c_check_header_mongrel "$LINENO" "byteswap.h" "ac_cv_header_byteswap_h" "$ac_includes_default"
+if test "x$ac_cv_header_byteswap_h" = x""yes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_BYTESWAP_H 1
+_ACEOF
+
+    BYTESWAP_H=''
+
+else
+
+    BYTESWAP_H='byteswap.h'
+
+fi
+
+done
+
+
+   if test -n "$BYTESWAP_H"; then
+  GL_GENERATE_BYTESWAP_H_TRUE=
+  GL_GENERATE_BYTESWAP_H_FALSE='#'
+else
+  GL_GENERATE_BYTESWAP_H_TRUE='#'
+  GL_GENERATE_BYTESWAP_H_FALSE=
+fi
+
+
+
 
 
 
@@ -22077,6 +22617,12 @@ _ACEOF
 
 
 
+
+
+
+
+
+
   :
 
 
@@ -22085,9 +22631,11 @@ _ACEOF
 
 
 
+  :
 
 
 
+  :
 
 
 
@@ -22232,9 +22780,11 @@ int result = 0;
             /* Many gnulib modules require POSIX conformance of EBADF.  */
             if (dup2 (2, 1000000) == -1 && errno != EBADF)
               result |= 16;
-            /* Flush out a cygwin core dump.  */
+            /* Flush out some cygwin core dumps.  */
             if (dup2 (2, -1) != -1 || errno != EBADF)
               result |= 32;
+            dup2 (2, 255);
+            dup2 (2, 256);
             return result;
 
   ;
@@ -22259,6 +22809,17 @@ $as_echo "$gl_cv_func_dup2_works" >&6; }
       *yes) ;;
       *)
         REPLACE_DUP2=1
+        for ac_func in setdtablesize
+do :
+  ac_fn_c_check_func "$LINENO" "setdtablesize" "ac_cv_func_setdtablesize"
+if test "x$ac_cv_func_setdtablesize" = x""yes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_SETDTABLESIZE 1
+_ACEOF
+
+fi
+done
+
         ;;
     esac
   fi
@@ -22921,27 +23482,40 @@ _ACEOF
 
 
 
-
-  fp_headers='
-#     include <stdio.h>
-#     if HAVE_STDIO_EXT_H
-#      include <stdio_ext.h>
-#     endif
-'
-  ac_fn_c_check_decl "$LINENO" "__fpending" "ac_cv_have_decl___fpending" "$fp_headers
-"
-if test "x$ac_cv_have_decl___fpending" = x""yes; then :
-  ac_have_decl=1
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for __fpending" >&5
+$as_echo_n "checking for __fpending... " >&6; }
+if test "${gl_cv_func___fpending+set}" = set; then :
+  $as_echo_n "(cached) " >&6
 else
-  ac_have_decl=0
-fi
 
-cat >>confdefs.h <<_ACEOF
-#define HAVE_DECL___FPENDING $ac_have_decl
+      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <stdio.h>
+             #if HAVE_STDIO_EXT_H
+             # include <stdio_ext.h>
+             #endif
+
+int
+main ()
+{
+return ! __fpending (stdin);
+  ;
+  return 0;
+}
 _ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  gl_cv_func___fpending=yes
+else
+  gl_cv_func___fpending=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
 
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func___fpending" >&5
+$as_echo "$gl_cv_func___fpending" >&6; }
 
-  if test $ac_cv_func___fpending = no; then
+  if test $gl_cv_func___fpending = no; then
 
 
 
@@ -24061,6 +24635,48 @@ done
 
 
 
+  if test $ac_cv_func_mkostemp != yes; then
+    HAVE_MKOSTEMP=0
+  fi
+
+  if test $HAVE_MKOSTEMP = 0; then
+
+
+
+
+
+
+
+
+  gl_LIBOBJS="$gl_LIBOBJS mkostemp.$ac_objext"
+
+
+
+  fi
+
+
+cat >>confdefs.h <<_ACEOF
+#define GNULIB_MKOSTEMP 1
+_ACEOF
+
+
+
+
+
+
+
+          GNULIB_MKOSTEMP=1
+
+
+
+
+
+
+
+
+
+
+
   if test $APPLE_UNIVERSAL_BUILD = 1; then
     # A universal build on Apple Mac OS X platforms.
     # The test result would be 'yes' in 32-bit mode and 'no' in 64-bit mode.
@@ -24961,10 +25577,8 @@ $as_echo_n "checking for working acl_get_file... " >&6; }
 if test "${gl_cv_func_working_acl_get_file+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
-  if test "$cross_compiling" = yes; then :
-  gl_cv_func_working_acl_get_file=cross-compiling
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+  gl_cv_func_working_acl_get_file=no
+     cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #include <sys/types.h>
            #include <sys/acl.h>
@@ -24981,20 +25595,19 @@ if (!acl_get_file (".", ACL_TYPE_ACCESS) && errno == ENOENT)
   return 0;
 }
 _ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
-  gl_cv_func_working_acl_get_file=yes
-else
-  gl_cv_func_working_acl_get_file=no
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
-  conftest.$ac_objext conftest.beam conftest.$ac_ext
+if ac_fn_c_try_link "$LINENO"; then :
+  if test $cross_compiling = yes; then
+          gl_cv_func_working_acl_get_file="guessing yes"
+        elif ./conftest$ac_exeext; then
+          gl_cv_func_working_acl_get_file=yes
+        fi
 fi
-
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_working_acl_get_file" >&5
 $as_echo "$gl_cv_func_working_acl_get_file" >&6; }
-
-  if test $gl_cv_func_working_acl_get_file = yes; then :
+  if test "$gl_cv_func_working_acl_get_file" != no; then :
   use_acl=1
 fi
 
@@ -26406,7 +27019,7 @@ $as_echo "#define my_strftime nstrftime" >>confdefs.h
     HAVE_DECL_STRTOIMAX=0
   fi
 
-  if test $ac_cv_func_strtoimax = yes; then
+  if test "$ac_cv_func_strtoimax" = yes; then
     HAVE_STRTOIMAX=1
              { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether strtoimax works" >&5
 $as_echo_n "checking whether strtoimax works... " >&6; }
@@ -26479,10 +27092,14 @@ $as_echo "$gl_cv_func_strtoimax" >&6; }
       *no) REPLACE_STRTOIMAX=1 ;;
     esac
   else
+    if test "$ac_cv_have_decl_strtoimax" = yes; then
+      # HP-UX 11.11 has "#define strtoimax(...) ..." but no function.
+      REPLACE_STRTOIMAX=1
+    fi
     HAVE_STRTOIMAX=0
   fi
 
-  if test $HAVE_STRTOIMAX = 0 || test $REPLACE_STRTOIMAX = 1; then
+  if test $HAVE_DECL_STRTOIMAX = 0 || test $REPLACE_STRTOIMAX = 1; then
 
 
 
@@ -26523,11 +27140,16 @@ _ACEOF
 
 
 
-  if test "$ac_cv_have_decl_strtoumax" != yes; then
+  if test "$ac_cv_have_decl_strtoumax" = yes; then
+    if test "$ac_cv_func_strtoumax" != yes; then
+      # HP-UX 11.11 has "#define strtoimax(...) ..." but no function.
+      REPLACE_STRTOUMAX=1
+    fi
+  else
     HAVE_DECL_STRTOUMAX=0
   fi
 
-  if test $ac_cv_func_strtoumax = no; then
+  if test $HAVE_DECL_STRTOUMAX = 0 || test $REPLACE_STRTOUMAX = 1; then
 
 
 
@@ -27464,9 +28086,11 @@ $as_echo "#define FUTIMESAT_NULL_BUG 1" >>confdefs.h
   gl_gnulib_enabled_03e0aaad4cb89ca757653bd367a6ccb7=false
   gl_gnulib_enabled_pathmax=false
   gl_gnulib_enabled_6099e9737f757db36c47fa9d9f02e88c=false
+  gl_gnulib_enabled_secure_getenv=false
   gl_gnulib_enabled_stat=false
   gl_gnulib_enabled_strtoll=false
   gl_gnulib_enabled_strtoull=false
+  gl_gnulib_enabled_tempname=false
   gl_gnulib_enabled_682e609604ccaac6be382e4ee3a4eaec=false
   func_gl_gnulib_m4code_260941c0e5dc67ec9e87d1fb321c300b ()
   {
@@ -27752,11 +28376,62 @@ done
 
 
 
-  if test $ac_cv_func_getdtablesize != yes; then
+
+  if test $ac_cv_func_getdtablesize = yes; then
+    # Cygwin 1.7.25 automatically increases the RLIMIT_NOFILE soft limit
+    # up to an unchangeable hard limit; all other platforms correctly
+    # require setrlimit before getdtablesize() can report a larger value.
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether getdtablesize works" >&5
+$as_echo_n "checking whether getdtablesize works... " >&6; }
+if test "${gl_cv_func_getdtablesize_works+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test "$cross_compiling" = yes; then :
+  case "$host_os" in
+          cygwin*) # on cygwin 1.5.25, getdtablesize() automatically grows
+            gl_cv_func_getdtablesize_works="guessing no" ;;
+          *) gl_cv_func_getdtablesize_works="guessing yes" ;;
+         esac
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+        #include <unistd.h>
+int
+main ()
+{
+int size = getdtablesize();
+           if (dup2 (0, getdtablesize()) != -1)
+             return 1;
+           if (size != getdtablesize())
+             return 2;
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+  gl_cv_func_getdtablesize_works=yes
+else
+  gl_cv_func_getdtablesize_works=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_getdtablesize_works" >&5
+$as_echo "$gl_cv_func_getdtablesize_works" >&6; }
+    case "$gl_cv_func_getdtablesize_works" in
+      *yes) ;;
+      *) REPLACE_GETDTABLESIZE=1 ;;
+    esac
+  else
     HAVE_GETDTABLESIZE=0
   fi
 
-      if test $HAVE_GETDTABLESIZE = 0; then
+      if test $HAVE_GETDTABLESIZE = 0 || test $REPLACE_GETDTABLESIZE = 1; then
 
 
 
       gl_gnulib_enabled_6099e9737f757db36c47fa9d9f02e88c=true
     fi
   }
+  func_gl_gnulib_m4code_secure_getenv ()
+  {
+    if ! $gl_gnulib_enabled_secure_getenv; then
+
+
+
+
+
+  if test $ac_cv_func_secure_getenv = no; then
+    HAVE_SECURE_GETENV=0
+  fi
+
+      if test $HAVE_SECURE_GETENV = 0; then
+
+
+
+
+
+
+
+
+  gl_LIBOBJS="$gl_LIBOBJS secure_getenv.$ac_objext"
+
+
+  for ac_func in __secure_getenv
+do :
+  ac_fn_c_check_func "$LINENO" "__secure_getenv" "ac_cv_func___secure_getenv"
+if test "x$ac_cv_func___secure_getenv" = x""yes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE___SECURE_GETENV 1
+_ACEOF
+
+fi
+done
+
+  if test $ac_cv_func___secure_getenv = no; then
+    for ac_func in issetugid
+do :
+  ac_fn_c_check_func "$LINENO" "issetugid" "ac_cv_func_issetugid"
+if test "x$ac_cv_func_issetugid" = x""yes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_ISSETUGID 1
+_ACEOF
+
+fi
+done
+
+  fi
+
+      fi
+
+
+
+
+
+          GNULIB_SECURE_GETENV=1
+
+
+
+
+
+      gl_gnulib_enabled_secure_getenv=true
+    fi
+  }
   func_gl_gnulib_m4code_stat ()
   {
     if ! $gl_gnulib_enabled_stat; then
@@ -28311,6 +29050,18 @@ done
       gl_gnulib_enabled_strtoull=true
     fi
   }
+  func_gl_gnulib_m4code_tempname ()
+  {
+    if ! $gl_gnulib_enabled_tempname; then
+
+
+  :
+
+
+      gl_gnulib_enabled_tempname=true
+      func_gl_gnulib_m4code_secure_getenv
+    fi
+  }
   func_gl_gnulib_m4code_682e609604ccaac6be382e4ee3a4eaec ()
   {
     if ! $gl_gnulib_enabled_682e609604ccaac6be382e4ee3a4eaec; then
@@ -28353,6 +29104,9 @@ done
   if test $REPLACE_LSTAT = 1; then
     func_gl_gnulib_m4code_stat
   fi
+  if test $HAVE_MKOSTEMP = 0; then
+    func_gl_gnulib_m4code_tempname
+  fi
   if test $HAVE_READLINK = 0 || test $REPLACE_READLINK = 1; then
     func_gl_gnulib_m4code_stat
   fi
@@ -28365,10 +29119,10 @@ done
   if test $HAVE_READLINKAT = 0; then
     func_gl_gnulib_m4code_03e0aaad4cb89ca757653bd367a6ccb7
   fi
-  if { test $HAVE_STRTOIMAX = 0 || test $REPLACE_STRTOIMAX = 1; } && test $ac_cv_type_long_long_int = yes; then
+  if { test $HAVE_DECL_STRTOIMAX = 0 || test $REPLACE_STRTOIMAX = 1; } && test $ac_cv_type_long_long_int = yes; then
     func_gl_gnulib_m4code_strtoll
   fi
-  if test $ac_cv_func_strtoumax = no && test $ac_cv_type_unsigned_long_long_int = yes; then
+  if { test $HAVE_DECL_STRTOUMAX = 0 || test $REPLACE_STRTOUMAX = 1; } && test $ac_cv_type_unsigned_long_long_int = yes; then
     func_gl_gnulib_m4code_strtoull
   fi
 
@@ -28452,6 +29206,14 @@ else
   gl_GNULIB_ENABLED_6099e9737f757db36c47fa9d9f02e88c_FALSE=
 fi
 
+   if $gl_gnulib_enabled_secure_getenv; then
+  gl_GNULIB_ENABLED_secure_getenv_TRUE=
+  gl_GNULIB_ENABLED_secure_getenv_FALSE='#'
+else
+  gl_GNULIB_ENABLED_secure_getenv_TRUE='#'
+  gl_GNULIB_ENABLED_secure_getenv_FALSE=
+fi
+
    if $gl_gnulib_enabled_stat; then
   gl_GNULIB_ENABLED_stat_TRUE=
   gl_GNULIB_ENABLED_stat_FALSE='#'
@@ -28476,6 +29238,14 @@ else
   gl_GNULIB_ENABLED_strtoull_FALSE=
 fi
 
+   if $gl_gnulib_enabled_tempname; then
+  gl_GNULIB_ENABLED_tempname_TRUE=
+  gl_GNULIB_ENABLED_tempname_FALSE='#'
+else
+  gl_GNULIB_ENABLED_tempname_TRUE='#'
+  gl_GNULIB_ENABLED_tempname_FALSE=
+fi
+
    if $gl_gnulib_enabled_682e609604ccaac6be382e4ee3a4eaec; then
   gl_GNULIB_ENABLED_682e609604ccaac6be382e4ee3a4eaec_TRUE=
   gl_GNULIB_ENABLED_682e609604ccaac6be382e4ee3a4eaec_FALSE='#'
@@ -28528,7 +29298,7 @@ CFLAGS=$SAVE_CFLAGS
 LIBS=$SAVE_LIBS
 
 if test "${opsys}" = "mingw32"; then
-  CPPFLAGS="$CPPFLAGS -DUSE_CRT_DLL=1 -I $srcdir/nt/inc"
+  CPPFLAGS="$CPPFLAGS -DUSE_CRT_DLL=1 -I \${abs_top_srcdir}/nt/inc"
   # Remove unneeded switches from the value of CC that goes to Makefiles
   CC=`echo $CC | sed -e "s,$GCC_TEST_OPTIONS,,"`
 fi
@@ -28591,6 +29361,8 @@ if test x$ac_enable_profiling != x ; then
   esac
 fi
 
+LD_SWITCH_SYSTEM_TEMACS="$LDFLAGS_NOCOMBRELOC $LD_SWITCH_SYSTEM_TEMACS"
+
 
 
 ## MinGW-specific post-link processing of temacs.
@@ -28668,6 +29440,8 @@ 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 support sound?                               ${HAVE_SOUND}"
+
 echo "  Does Emacs use -lgpm?                                   ${HAVE_GPM}"
 echo "  Does Emacs use -ldbus?                                  ${HAVE_DBUS}"
 echo "  Does Emacs use -lgconf?                                 ${HAVE_GCONF}"
@@ -28682,6 +29456,7 @@ echo "  Does Emacs use -lfreetype?                              ${HAVE_FREETYPE}
 echo "  Does Emacs use -lm17n-flt?                              ${HAVE_M17N_FLT}"
 echo "  Does Emacs use -lotf?                                   ${HAVE_LIBOTF}"
 echo "  Does Emacs use -lxft?                                   ${HAVE_XFT}"
+echo "  Does Emacs directly use zlib?                           ${HAVE_ZLIB}"
 
 echo "  Does Emacs use toolkit scroll bars?                     ${USE_TOOLKIT_SCROLL_BARS}"
 echo
@@ -28729,10 +29504,13 @@ if test "$HAVE_NS" = "yes"; then
   if test "$NS_IMPL_GNUSTEP" = yes; then
     ac_config_files="$ac_config_files nextstep/GNUstep/Emacs.base/Resources/Info-gnustep.plist:nextstep/templates/Info-gnustep.plist.in nextstep/GNUstep/Emacs.base/Resources/Emacs.desktop:nextstep/templates/Emacs.desktop.in"
 
+    ns_check_file=Resources/Info-gnustep.plist
   else
     ac_config_files="$ac_config_files nextstep/Cocoa/Emacs.base/Contents/Info.plist:nextstep/templates/Info.plist.in nextstep/Cocoa/Emacs.base/Contents/Resources/English.lproj/InfoPlist.strings:nextstep/templates/InfoPlist.strings.in"
 
+    ns_check_file=Contents/Info.plist
   fi
+
 fi
 
 SUBDIR_MAKEFILES="lib/Makefile lib-src/Makefile oldXMenu/Makefile doc/emacs/Makefile doc/misc/Makefile doc/lispintro/Makefile doc/lispref/Makefile src/Makefile lwlib/Makefile lisp/Makefile leim/Makefile nextstep/Makefile nt/Makefile"
@@ -28762,13 +29540,10 @@ SUBDIR_MAKEFILES_IN=`echo " ${SUBDIR_MAKEFILES}" | sed -e 's| | $(srcdir)/|g' -e
 
 
 
-ac_config_commands="$ac_config_commands mkdirs"
-
-
-ac_config_commands="$ac_config_commands epaths"
+ac_config_commands="$ac_config_commands src/epaths.h"
 
 
-ac_config_commands="$ac_config_commands gdbinit"
+ac_config_commands="$ac_config_commands src/.gdbinit"
 
 
 cat >confcache <<\_ACEOF
@@ -28896,6 +29671,10 @@ if test -z "${GL_GENERATE_ALLOCA_H_TRUE}" && test -z "${GL_GENERATE_ALLOCA_H_FAL
   as_fn_error "conditional \"GL_GENERATE_ALLOCA_H\" was never defined.
 Usually this means the macro was only invoked conditionally." "$LINENO" 5
 fi
+if test -z "${GL_GENERATE_BYTESWAP_H_TRUE}" && test -z "${GL_GENERATE_BYTESWAP_H_FALSE}"; then
+  as_fn_error "conditional \"GL_GENERATE_BYTESWAP_H\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
 
 if test -z "${GL_GENERATE_ERRNO_H_TRUE}" && test -z "${GL_GENERATE_ERRNO_H_FALSE}"; then
   as_fn_error "conditional \"GL_GENERATE_ERRNO_H\" was never defined.
@@ -28965,6 +29744,10 @@ if test -z "${gl_GNULIB_ENABLED_6099e9737f757db36c47fa9d9f02e88c_TRUE}" && test
   as_fn_error "conditional \"gl_GNULIB_ENABLED_6099e9737f757db36c47fa9d9f02e88c\" was never defined.
 Usually this means the macro was only invoked conditionally." "$LINENO" 5
 fi
+if test -z "${gl_GNULIB_ENABLED_secure_getenv_TRUE}" && test -z "${gl_GNULIB_ENABLED_secure_getenv_FALSE}"; then
+  as_fn_error "conditional \"gl_GNULIB_ENABLED_secure_getenv\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
 if test -z "${gl_GNULIB_ENABLED_stat_TRUE}" && test -z "${gl_GNULIB_ENABLED_stat_FALSE}"; then
   as_fn_error "conditional \"gl_GNULIB_ENABLED_stat\" was never defined.
 Usually this means the macro was only invoked conditionally." "$LINENO" 5
@@ -28977,6 +29760,10 @@ if test -z "${gl_GNULIB_ENABLED_strtoull_TRUE}" && test -z "${gl_GNULIB_ENABLED_
   as_fn_error "conditional \"gl_GNULIB_ENABLED_strtoull\" was never defined.
 Usually this means the macro was only invoked conditionally." "$LINENO" 5
 fi
+if test -z "${gl_GNULIB_ENABLED_tempname_TRUE}" && test -z "${gl_GNULIB_ENABLED_tempname_FALSE}"; then
+  as_fn_error "conditional \"gl_GNULIB_ENABLED_tempname\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
 if test -z "${gl_GNULIB_ENABLED_682e609604ccaac6be382e4ee3a4eaec_TRUE}" && test -z "${gl_GNULIB_ENABLED_682e609604ccaac6be382e4ee3a4eaec_FALSE}"; then
   as_fn_error "conditional \"gl_GNULIB_ENABLED_682e609604ccaac6be382e4ee3a4eaec\" was never defined.
 Usually this means the macro was only invoked conditionally." "$LINENO" 5
@@ -29633,9 +30420,8 @@ do
     "nt/Makefile") CONFIG_FILES="$CONFIG_FILES nt/Makefile" ;;
     "test/automated/Makefile") CONFIG_FILES="$CONFIG_FILES test/automated/Makefile" ;;
     "admin/unidata/Makefile") CONFIG_FILES="$CONFIG_FILES admin/unidata/Makefile" ;;
-    "mkdirs") CONFIG_COMMANDS="$CONFIG_COMMANDS mkdirs" ;;
-    "epaths") CONFIG_COMMANDS="$CONFIG_COMMANDS epaths" ;;
-    "gdbinit") CONFIG_COMMANDS="$CONFIG_COMMANDS gdbinit" ;;
+    "src/epaths.h") CONFIG_COMMANDS="$CONFIG_COMMANDS src/epaths.h" ;;
+    "src/.gdbinit") CONFIG_COMMANDS="$CONFIG_COMMANDS src/.gdbinit" ;;
 
   *) as_fn_error "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
   esac
@@ -30354,23 +31140,16 @@ $as_echo X"$file" |
   done
 }
  ;;
-    "mkdirs":C)
-for dir in etc lisp ; do
-  test -d ${dir} || mkdir ${dir}
-done
- ;;
-    "epaths":C)
-echo creating src/epaths.h
+    "src/epaths.h":C)
 if test "${opsys}" = "mingw32"; then
   ${MAKE-make} MAKEFILE_NAME=do-not-make-Makefile epaths-force-w32
 else
   ${MAKE-make} MAKEFILE_NAME=do-not-make-Makefile epaths-force
 fi
  ;;
-    "gdbinit":C)
+    "src/.gdbinit":C)
 if test ! -f src/.gdbinit && test -f "$srcdir/src/.gdbinit"; then
-  echo creating src/.gdbinit
-  echo "source $srcdir/src/.gdbinit" > src/.gdbinit
+  echo "source $ac_abs_top_srcdir/src/.gdbinit" > src/.gdbinit
 fi
  ;;