]> code.delx.au - gnu-emacs/commitdiff
Merge from trunk.
authorPaul Eggert <eggert@cs.ucla.edu>
Sat, 3 Sep 2011 23:03:38 +0000 (16:03 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Sat, 3 Sep 2011 23:03:38 +0000 (16:03 -0700)
36 files changed:
ChangeLog
Makefile.in
admin/ChangeLog
admin/notes/copyright
autogen/README
autogen/copy_autogen
autogen/update_autogen
build-aux/move-if-change [moved from move-if-change with 100% similarity]
build-aux/snippet/_Noreturn.h [new file with mode: 0644]
build-aux/snippet/arg-nonnull.h [moved from arg-nonnull.h with 100% similarity]
build-aux/snippet/c++defs.h [moved from c++defs.h with 100% similarity]
build-aux/snippet/warn-on-use.h [moved from warn-on-use.h with 100% similarity]
config.bat
configure.in
leim/ChangeLog
leim/Makefile.in
lib-src/ChangeLog
lib-src/Makefile.in
lib/gnulib.mk
lib/makefile.w32-in
lib/pthread_sigmask.c
lib/stdlib.in.h
m4/dup2.m4
m4/extensions.m4
m4/getopt.m4
m4/gl-comp.m4
m4/gnulib-common.m4
m4/include_next.m4
m4/largefile.m4 [new file with mode: 0644]
m4/nocrash.m4 [new file with mode: 0644]
m4/pthread_sigmask.m4
make-dist
msdos/ChangeLog
msdos/sedlibmk.inp
src/ChangeLog
src/Makefile.in

index 1f38dbf71ca4b9becc35838ff47fbdc9031f750e..f760b7bf5d8027a22462264a82b8a36747184f70 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,37 @@
+2011-09-03  Paul Eggert  <eggert@cs.ucla.edu>
+
+       Merge from gnulib, using build-aux to remove clutter (Bug#9169).
+       * autogen/README: Update destination list.
+       * autogen/copy_autogen, autogen/update_autogen, .bzrignore:
+       The autogenerated files compile, config.guess,
+       config.sub, depcomp, install-sh, and missing are now in build-aux.
+       * m4/largefile.m4: New file, so that Emacs does not mess up when
+       accessing files with large inode numbers in MacOS X 10.5 and later.
+       * m4/nocrash.m4: New file, to avoid triggering background debugger
+       and/or create core dumps during 'configure'.
+       * build-aux/move-if-change: Renamed from move-if-change.
+       * build-aux/snippet/arg-nonnull.h: Renamed from arg-nonnull.h.
+       * build-aux/snippet/c++defs.h: Renamed from c++defs.h.
+       * build-aux/snippet/warn-on-use.h: Renamed from warn-on-use.h.
+       * build-aux/snippet/_Noreturn.h: New file, for draft C1X _Noreturn.
+       * Makefile.in (epaths-force, sync-from-gnulib):
+       move-if-change is now in build-aux.
+       (GNULIB_TOOL_FLAGS): Avoid threadlib; this is now a prerequisite
+       of gnulib's pthread_sigmask module, but Emacs doesn't need it.
+       (mkdir): install-sh is now in build-aux.
+       * config.bat: c++defs.h is now in build-aux/snippets.
+       * configure.in: Specify AC_CONFIG_AUX_DIR with build-aux (the
+       usual parameter).
+       * lib/gnulib.mk, m4/gl-comp.m4: Regenerate.
+       * lib/makefile.w32-in (ARG_NONNULL_H): arg-nonnull.h moved
+       to build-aux/snippet.
+       * lib/pthread_sigmask.c, lib/stdlib.in.h, m4/extensions.m4:
+       * m4/getopt.m4, m4/gnulib-common.m4, m4/pthread_sigmask.m4:
+       Merge from gnuilib.  This fixes porting bugs on Cygwin, Irix, and
+       Solaris, enables MacOS extensions, and enables nocrash during
+       'configure'.
+       * make-dist: Adjust to new build-aux and build-aux/snippit dirs.
+
 2011-08-30  Paul Eggert  <eggert@cs.ucla.edu>
 
        * configure.in (opsys): Change pattern to *-*-linux*
index ce7f3f1a3d892cd850a9c4cccc491d8f77fc4abc..29e20298dafa0475fac8b6fae4b55fa50834603c 100644 (file)
@@ -300,7 +300,7 @@ epaths-force: FRC
          -e 's;\(#.*PATH_X_DEFAULTS\).*$$;\1 "${x_default_search_path}";' \
          -e 's;\(#.*PATH_GAME\).*$$;\1 "${gamedir}";' \
          -e 's;\(#.*PATH_DOC\).*$$;\1 "${docdir}";') &&                \
-       ${srcdir}/move-if-change epaths.h.$$$$ src/epaths.h
+       ${srcdir}/build-aux/move-if-change epaths.h.$$$$ src/epaths.h
 
 # For parallel make, src should be built before leim.
 # "export PARALLEL=0" is for SGI's Make, to prevent it from
@@ -339,6 +339,7 @@ GNULIB_MODULES = \
   mktime pthread_sigmask readlink \
   socklen stdarg stdio strftime strtoimax strtoumax symlink sys_stat
 GNULIB_TOOL_FLAGS = \
+ --avoid=threadlib \
  --conditional-dependencies --import --no-changelog --no-vc-files \
  --makefile-name=gnulib.mk
 sync-from-gnulib: $(gnulib_srcdir)
@@ -350,7 +351,7 @@ sync-from-gnulib: $(gnulib_srcdir)
        cp $(gnulib_srcdir)/build-aux/texinfo.tex $(srcdir)/doc/misc
        cp \
          $(gnulib_srcdir)/build-aux/move-if-change \
-         $(srcdir)
+         $(srcdir)/build-aux
        cd $(srcdir) && autoreconf -i -I m4
 .PHONY: sync-from-gnulib
 
@@ -688,7 +689,7 @@ mkdir: FRC
        done ; \
        icondirs=`echo "$${icondirs}" | sed 's,$(srcdir)/etc/images/icons,$(DESTDIR)${icondir},g'` ; \
        umask 022 ; \
-       $(srcdir)/install-sh -d $(DESTDIR)${datadir} ${COPYDESTS} \
+       $(srcdir)/build-aux/install-sh -d $(DESTDIR)${datadir} ${COPYDESTS} \
          $(DESTDIR)${infodir} $(DESTDIR)${man1dir} \
          $(DESTDIR)${bindir} $(DESTDIR)${docdir} $(DESTDIR)${libexecdir} \
          $(DESTDIR)${datadir}/emacs/site-lisp \
index 17cbcbb3bdf3e67069644657532fb9078ff9c9b2..40300fc8dcf05c7d5cbffbeef6e184aedd6aaff1 100644 (file)
@@ -1,3 +1,12 @@
+2011-09-03  Paul Eggert  <eggert@cs.ucla.edu>
+
+       Merge from gnulib (Bug#9169).
+       * notes/copyright: The files compile, config.guess, config.sub,
+       depcomp, install-sh, missing, and move-if-change are now in the
+       new build-aux subdirectory.  The files arg-nonnull.h, c++defs.h,
+       and warn-on-use.h are now in build-aux/snippets.  New file
+       build-aux/snippets/_Noreturn.h.
+
 2011-08-23  Eli Zaretskii  <eliz@gnu.org>
 
        * unidata/unidata-gen.el (unidata-prop-alist): Update the default
index 39eb003a07dd4860d56fc6237550088303174395..f4d22f9b2706e817210ff03048c127327a373e12 100644 (file)
@@ -143,7 +143,7 @@ m4/*.m4
 lib/Makefile.in
  - copyright FSF, with MIT-like license
 
-install-sh
+build-aux/install-sh
  - this file is copyright MIT, which is OK. Leave the copyright alone.
 
 etc/refcards/*.tex
@@ -545,16 +545,17 @@ of writing) GPL >= 2. rms says may as well leave the licenses of these
 alone (may import them from Gnulib again). These are:
 
     Gnulib:
-    arg-nonnull.h
-    c++defs.h
-    compile
-    config.guess
-    config.sub
-    depcomp
+    build-aux/compile
+    build-aux/config.guess
+    build-aux/config.sub
+    build-aux/depcomp
+    build-aux/missing
+    build-aux/move-if-change
+    build-aux/snippet/_Noreturn.h
+    build-aux/snippet/arg-nonnull.h
+    build-aux/snippet/c++defs.h
+    build-aux/snippet/warn-on-use.h
     doc/man/texinfo.tex
-    missing
-    move-if-change
-    warn-on-use.h
     lib/*.[ch]
     lib/gnulib.mk
     src/gmalloc.c
index fd574c41cd68deff2bb4cf59107f23a445b722f7..d4c2236581b4640826c94b288c048eb4f521330a 100644 (file)
@@ -7,12 +7,12 @@ configure    ../           autoconf
 config.in    ../src        autoheader      * also used by MSDOS bzr build
 aclocal.m4   ../           aclocal
 Makefile.in  ../lib        automake
-compile      ../           automake
-config.guess ../           automake
-config.sub   ../           automake
-depcomp      ../           automake
-install-sh   ../           automake
-missing      ../           automake
+compile      ../build-aux  automake
+config.guess ../build-aux  automake
+config.sub   ../build-aux  automake
+depcomp      ../build-aux  automake
+install-sh   ../build-aux  automake
+missing      ../build-aux  automake
 
 There are also some scripts:
 
index a0daf9f02e5f4dfbb9ba4c7a6cb457b86583eed1..c9f04ad625355ae9b2f4312cd87a0511875eb432 100755 (executable)
@@ -16,7 +16,7 @@ if test ! -e config.in; then
 fi
 
 ## Order implied by top-level Makefile's rules, for time-stamps.
-cp compile config.guess config.sub depcomp install-sh missing ../
+cp compile config.guess config.sub depcomp install-sh missing ../build-aux
 cp aclocal.m4 ../
 cp configure ../
 touch ../src/stamp-h.in
index c134609356ca44e4a4f9d59697af4c7f069db17f..e406f346edeaa7fb1609394c88df93793e7d07f2 100755 (executable)
@@ -80,7 +80,11 @@ lboot_flag=
 ldefs_in=lisp/loaddefs.el
 ldefs_out=lisp/ldefs-boot.el
 sources="configure.in lib/Makefile.am"
-genfiles="configure aclocal.m4 src/config.in lib/Makefile.in compile config.guess config.sub depcomp install-sh missing"
+genfiles="
+  configure aclocal.m4 src/config.in lib/Makefile.in
+  build-aux/compile build-aux/config.guess build-aux/config.sub
+  build-aux/depcomp build-aux/install-sh build-aux/missing
+"
 
 for g in $genfiles; do
     basegen="$basegen ${g##*/}"
similarity index 100%
rename from move-if-change
rename to build-aux/move-if-change
diff --git a/build-aux/snippet/_Noreturn.h b/build-aux/snippet/_Noreturn.h
new file mode 100644 (file)
index 0000000..1a7b4da
--- /dev/null
@@ -0,0 +1,10 @@
+#ifndef _Noreturn
+# if (3 <= __GNUC__ || (__GNUC__ == 2 && 8 <= __GNUC_MINOR__) \
+      || 0x5110 <= __SUNPRO_C)
+#  define _Noreturn __attribute__ ((__noreturn__))
+# elif 1200 <= _MSC_VER
+#  define _Noreturn __declspec (noreturn)
+# else
+#  define _Noreturn
+# endif
+#endif
similarity index 100%
rename from c++defs.h
rename to build-aux/snippet/c++defs.h
index dba3600e0d9f3ae94bf832c855a7cbf06bdd1459..a3660d577cdc329f67cb982bcdbdb9903cda67ca 100644 (file)
@@ -275,10 +275,10 @@ for %%d in (emacs lispref lispintro lispintr misc) do sed -f ../msdos/sed6.inp <
 cd ..\r
 rem   ----------------------------------------------------------------------\r
 Echo Configuring the lib directory...\r
-If Exist c++defs.h update c++defs.h cxxdefs.h\r
+If Exist build-aux\snippet\c++defs.h update build-aux/snippet/c++defs.h build-aux/snippet/cxxdefs.h\r
 cd lib\r
 Rem Rename files like djtar on plain DOS filesystem would.\r
-If Exist c++defs.h update c++defs.h cxxdefs.h\r
+If Exist build-aux\snippet\c++defs.h update build-aux/snippet/c++defs.h build-aux/snippet/cxxdefs.h\r
 If Exist getopt.in.h update getopt.in.h getopt.in-h\r
 If Exist stdbool.in.h update stdbool.in.h stdbool.in-h\r
 If Exist stddef.in.h update stddef.in.h  stddef.in-h\r
index 715e8278df29568646719e3cc5ba0b3db88891f4..6d35975292286ca622c3c18ad2f252f2feb38fcd 100644 (file)
@@ -25,6 +25,7 @@ AC_PREREQ(2.65)
 AC_INIT(emacs, 24.0.50)
 AC_CONFIG_HEADER(src/config.h:src/config.in)
 AC_CONFIG_SRCDIR(src/lisp.h)
+AC_CONFIG_AUX_DIR(build-aux)
 AM_INIT_AUTOMAKE
 
 dnl Support for --program-prefix, --program-suffix and
index 426c679fe1f2951ee6dd66df9049f23be8cd1e95..c28e947262571165ceda8a155e5eaba9d6b87167 100644 (file)
@@ -1,3 +1,7 @@
+2011-09-03  Paul Eggert  <eggert@cs.ucla.edu>
+
+       * Makefile.in (install): install-sh is now in build-aux (Bug#9169).
+
 2011-08-29  Stefan Monnier  <monnier@iro.umontreal.ca>
 
        * quail/latin-ltx.el: Complete the super and subscript letters.
index 87020616a5738e40dc1684b98b69a4ad57c86ea3..23eaf215e2ebdafbe79a361a934066878f237ffe 100644 (file)
@@ -222,7 +222,7 @@ MV_DIRS = for i in $$dir; do rm -fr `basename "$$i"` ; mv "$$i" . ; done
 
 install: all
        if [ ! -d ${INSTALLDIR} ] ; then \
-          umask 022; ${srcdir}/../install-sh -d ${INSTALLDIR}; \
+          umask 022; ${srcdir}/../build-aux/install-sh -d ${INSTALLDIR}; \
        else true; fi
        if [ x`(cd ${INSTALLDIR} && /bin/pwd)` != x`(/bin/pwd)` ] ; then \
          rm -f ${INSTALLDIR}/leim-list.el; \
index c878d313b703d6e03fd734133e290675db8d0f24..00876d2a044525fae85a9915cfdf4fb63246f2da 100644 (file)
@@ -1,3 +1,8 @@
+2011-07-28  Paul Eggert  <eggert@cs.ucla.edu>
+
+       * Makefile.in ($(DESTDIR)${archlibdir}): install-sh moved
+       to build-aux (Bug#9169).
+
 2011-07-28  Paul Eggert  <eggert@cs.ucla.edu>
 
        Assume freestanding C89 headers, string.h, stdlib.h.
index f619febbb2b60fe9567a93df6c2c1d77f8b8b4b1..499305ec512292582375142872092e050bf672fe 100644 (file)
@@ -229,13 +229,13 @@ maybe-blessmail: $(BLESSMAIL_TARGET)
 $(DESTDIR)${archlibdir}: all
        @echo
        @echo "Installing utilities run internally by Emacs."
-       umask 022; $(top_srcdir)/install-sh -d $(DESTDIR)${archlibdir}
+       umask 022; $(top_srcdir)/build-aux/install-sh -d $(DESTDIR)${archlibdir}
        if [ `(cd $(DESTDIR)${archlibdir} && /bin/pwd)` != `/bin/pwd` ]; then \
          for file in ${UTILITIES}; do \
            $(INSTALL_PROGRAM) $(INSTALL_STRIP) $$file $(DESTDIR)${archlibdir}/$$file ; \
          done ; \
         fi
-       umask 022; $(top_srcdir)/install-sh -d $(DESTDIR)${gamedir}; \
+       umask 022; $(top_srcdir)/build-aux/install-sh -d $(DESTDIR)${gamedir}; \
        touch $(DESTDIR)${gamedir}/snake-scores; \
        touch $(DESTDIR)${gamedir}/tetris-scores
        -if chown ${gameuser} $(DESTDIR)${archlibdir}/update-game-score && chmod u+s $(DESTDIR)${archlibdir}/update-game-score; then \
index 4341a5d184d50926ca5b82b316f047c7d4f1133d..5163269db411ca8b8303e333a9e0d53ce34c4e89 100644 (file)
@@ -9,7 +9,7 @@
 # the same distribution terms as the rest of that program.
 #
 # Generated by gnulib-tool.
-# Reproduce by: gnulib-tool --import --dir=. --lib=libgnu --source-base=lib --m4-base=m4 --doc-base=doc --tests-base=tests --aux-dir=. --makefile-name=gnulib.mk --conditional-dependencies --no-libtool --macro-prefix=gl --no-vc-files alloca-opt careadlinkat crypto/md5 crypto/sha1 crypto/sha256 crypto/sha512 dtoastr dup2 filemode getloadavg getopt-gnu ignore-value intprops lstat mktime pthread_sigmask readlink socklen stdarg stdio strftime strtoimax strtoumax symlink sys_stat
+# Reproduce by: gnulib-tool --import --dir=. --lib=libgnu --source-base=lib --m4-base=m4 --doc-base=doc --tests-base=tests --aux-dir=build-aux --avoid=threadlib --makefile-name=gnulib.mk --conditional-dependencies --no-libtool --macro-prefix=gl --no-vc-files alloca-opt careadlinkat crypto/md5 crypto/sha1 crypto/sha256 crypto/sha512 dtoastr dup2 filemode getloadavg getopt-gnu ignore-value intprops lstat mktime pthread_sigmask readlink socklen stdarg stdio strftime strtoimax strtoumax symlink sys_stat
 
 
 MOSTLYCLEANFILES += core *.stackdump
@@ -52,54 +52,6 @@ EXTRA_DIST += allocator.h
 
 ## end   gnulib module allocator
 
-## begin gnulib module arg-nonnull
-
-# The BUILT_SOURCES created by this Makefile snippet are not used via #include
-# statements but through direct file reference. Therefore this snippet must be
-# present in all Makefile.am that need it. This is ensured by the applicability
-# 'all' defined above.
-
-BUILT_SOURCES += arg-nonnull.h
-# The arg-nonnull.h that gets inserted into generated .h files is the same as
-# build-aux/arg-nonnull.h, except that it has the copyright header cut off.
-arg-nonnull.h: $(top_srcdir)/./arg-nonnull.h
-       $(AM_V_GEN)rm -f $@-t $@ && \
-       sed -n -e '/GL_ARG_NONNULL/,$$p' \
-         < $(top_srcdir)/./arg-nonnull.h \
-         > $@-t && \
-       mv $@-t $@
-MOSTLYCLEANFILES += arg-nonnull.h arg-nonnull.h-t
-
-ARG_NONNULL_H=arg-nonnull.h
-
-EXTRA_DIST += $(top_srcdir)/./arg-nonnull.h
-
-## end   gnulib module arg-nonnull
-
-## begin gnulib module c++defs
-
-# The BUILT_SOURCES created by this Makefile snippet are not used via #include
-# statements but through direct file reference. Therefore this snippet must be
-# present in all Makefile.am that need it. This is ensured by the applicability
-# 'all' defined above.
-
-BUILT_SOURCES += c++defs.h
-# The c++defs.h that gets inserted into generated .h files is the same as
-# build-aux/c++defs.h, except that it has the copyright header cut off.
-c++defs.h: $(top_srcdir)/./c++defs.h
-       $(AM_V_GEN)rm -f $@-t $@ && \
-       sed -n -e '/_GL_CXXDEFS/,$$p' \
-         < $(top_srcdir)/./c++defs.h \
-         > $@-t && \
-       mv $@-t $@
-MOSTLYCLEANFILES += c++defs.h c++defs.h-t
-
-CXXDEFS_H=c++defs.h
-
-EXTRA_DIST += $(top_srcdir)/./c++defs.h
-
-## end   gnulib module c++defs
-
 ## begin gnulib module careadlinkat
 
 libgnu_a_SOURCES += careadlinkat.c
@@ -362,6 +314,87 @@ EXTRA_libgnu_a_SOURCES += sigprocmask.c
 
 ## end   gnulib module sigprocmask
 
+## begin gnulib module snippet/_Noreturn
+
+# Because this Makefile snippet defines a variable used by other
+# gnulib Makefile snippets, it must be present in all Makefile.am that
+# need it. This is ensured by the applicability 'all' defined above.
+
+_NORETURN_H=$(top_srcdir)/build-aux/snippet/_Noreturn.h
+
+EXTRA_DIST += $(top_srcdir)/build-aux/snippet/_Noreturn.h
+
+## end   gnulib module snippet/_Noreturn
+
+## begin gnulib module snippet/arg-nonnull
+
+# The BUILT_SOURCES created by this Makefile snippet are not used via #include
+# statements but through direct file reference. Therefore this snippet must be
+# present in all Makefile.am that need it. This is ensured by the applicability
+# 'all' defined above.
+
+BUILT_SOURCES += arg-nonnull.h
+# The arg-nonnull.h that gets inserted into generated .h files is the same as
+# build-aux/snippet/arg-nonnull.h, except that it has the copyright header cut
+# off.
+arg-nonnull.h: $(top_srcdir)/build-aux/snippet/arg-nonnull.h
+       $(AM_V_GEN)rm -f $@-t $@ && \
+       sed -n -e '/GL_ARG_NONNULL/,$$p' \
+         < $(top_srcdir)/build-aux/snippet/arg-nonnull.h \
+         > $@-t && \
+       mv $@-t $@
+MOSTLYCLEANFILES += arg-nonnull.h arg-nonnull.h-t
+
+ARG_NONNULL_H=arg-nonnull.h
+
+EXTRA_DIST += $(top_srcdir)/build-aux/snippet/arg-nonnull.h
+
+## end   gnulib module snippet/arg-nonnull
+
+## begin gnulib module snippet/c++defs
+
+# The BUILT_SOURCES created by this Makefile snippet are not used via #include
+# statements but through direct file reference. Therefore this snippet must be
+# present in all Makefile.am that need it. This is ensured by the applicability
+# 'all' defined above.
+
+BUILT_SOURCES += c++defs.h
+# The c++defs.h that gets inserted into generated .h files is the same as
+# build-aux/snippet/c++defs.h, except that it has the copyright header cut off.
+c++defs.h: $(top_srcdir)/build-aux/snippet/c++defs.h
+       $(AM_V_GEN)rm -f $@-t $@ && \
+       sed -n -e '/_GL_CXXDEFS/,$$p' \
+         < $(top_srcdir)/build-aux/snippet/c++defs.h \
+         > $@-t && \
+       mv $@-t $@
+MOSTLYCLEANFILES += c++defs.h c++defs.h-t
+
+CXXDEFS_H=c++defs.h
+
+EXTRA_DIST += $(top_srcdir)/build-aux/snippet/c++defs.h
+
+## end   gnulib module snippet/c++defs
+
+## begin gnulib module snippet/warn-on-use
+
+BUILT_SOURCES += warn-on-use.h
+# The warn-on-use.h that gets inserted into generated .h files is the same as
+# build-aux/snippet/warn-on-use.h, except that it has the copyright header cut
+# off.
+warn-on-use.h: $(top_srcdir)/build-aux/snippet/warn-on-use.h
+       $(AM_V_GEN)rm -f $@-t $@ && \
+       sed -n -e '/^.ifndef/,$$p' \
+         < $(top_srcdir)/build-aux/snippet/warn-on-use.h \
+         > $@-t && \
+       mv $@-t $@
+MOSTLYCLEANFILES += warn-on-use.h warn-on-use.h-t
+
+WARN_ON_USE_H=warn-on-use.h
+
+EXTRA_DIST += $(top_srcdir)/build-aux/snippet/warn-on-use.h
+
+## end   gnulib module snippet/warn-on-use
+
 ## begin gnulib module stat
 
 if gl_GNULIB_ENABLED_stat
@@ -634,7 +667,8 @@ BUILT_SOURCES += stdlib.h
 
 # We need the following in order to create <stdlib.h> when the system
 # doesn't have one that works with the given compiler.
-stdlib.h: stdlib.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
+stdlib.h: stdlib.in.h $(top_builddir)/config.status $(CXXDEFS_H) \
+  $(_NORETURN_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
        $(AM_V_GEN)rm -f $@-t $@ && \
        { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \
          sed -e 's|@''GUARD_PREFIX''@|GL|g' \
@@ -708,6 +742,7 @@ stdlib.h: stdlib.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H
              -e 's|@''REPLACE_UNSETENV''@|$(REPLACE_UNSETENV)|g' \
              -e 's|@''REPLACE_WCTOMB''@|$(REPLACE_WCTOMB)|g' \
              -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
+             -e '/definition of _Noreturn/r $(_NORETURN_H)' \
              -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
              -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)'; \
        } > $@-t && \
@@ -1040,25 +1075,6 @@ EXTRA_DIST += verify.h
 
 ## end   gnulib module verify
 
-## begin gnulib module warn-on-use
-
-BUILT_SOURCES += warn-on-use.h
-# The warn-on-use.h that gets inserted into generated .h files is the same as
-# build-aux/warn-on-use.h, except that it has the copyright header cut off.
-warn-on-use.h: $(top_srcdir)/./warn-on-use.h
-       $(AM_V_GEN)rm -f $@-t $@ && \
-       sed -n -e '/^.ifndef/,$$p' \
-         < $(top_srcdir)/./warn-on-use.h \
-         > $@-t && \
-       mv $@-t $@
-MOSTLYCLEANFILES += warn-on-use.h warn-on-use.h-t
-
-WARN_ON_USE_H=warn-on-use.h
-
-EXTRA_DIST += $(top_srcdir)/./warn-on-use.h
-
-## end   gnulib module warn-on-use
-
 
 mostlyclean-local: mostlyclean-generic
        @for dir in '' $(MOSTLYCLEANDIRS); do \
index df7f8e274f02eca443d22f5ea2627d6b0fee6349..6b451dd14e1a6f8f25bb42becbe374b0ffb93841 100644 (file)
@@ -213,7 +213,7 @@ INCLUDE_NEXT = include_next
 PRAGMA_SYSTEM_HEADER = \#pragma GCC system_header
 PRAGMA_COLUMNS =
 NEXT_GETOPT_H = <getopt.h>
-ARG_NONNULL_H = ../arg-nonnull.h
+ARG_NONNULL_H = ../build-aux/snippet/arg-nonnull.h
 
 getopt_h:
        - $(DEL) getopt_.h-t getopt_.h
index 1f460f13c48c5e516a2729026ed298c4c8ee0cc1..11d549cad41bf9e6f9142af5971484066206db14 100644 (file)
 #include <signal.h>
 
 #include <errno.h>
+#include <stddef.h>
+
+#if PTHREAD_SIGMASK_UNBLOCK_BUG
+# include <unistd.h>
+#endif
 
 int
 pthread_sigmask (int how, const sigset_t *new_mask, sigset_t *old_mask)
+#undef pthread_sigmask
 {
+#if HAVE_PTHREAD_SIGMASK
+  int ret = pthread_sigmask (how, new_mask, old_mask);
+# if PTHREAD_SIGMASK_INEFFECTIVE
+  if (ret == 0)
+    {
+      /* Detect whether pthread_sigmask is currently ineffective.
+         Don't cache the information: libpthread.so could be dynamically
+         loaded after the program started and after pthread_sigmask was
+         called for the first time.  */
+      if (pthread_sigmask (1729, NULL, NULL) == 0)
+        {
+          /* pthread_sigmask is currently ineffective.  The program is not
+             linked to -lpthread.  So use sigprocmask instead.  */
+          return (sigprocmask (how, new_mask, old_mask) < 0 ? errno : 0);
+        }
+    }
+# endif
+# if PTHREAD_SIGMASK_FAILS_WITH_ERRNO
+  if (ret == -1)
+    return errno;
+# endif
+# if PTHREAD_SIGMASK_UNBLOCK_BUG
+  if (ret == 0
+      && new_mask != NULL
+      && (how == SIG_UNBLOCK || how == SIG_SETMASK))
+    {
+      /* Give the OS the opportunity to raise signals that were pending before
+         the pthread_sigmask call and have now been unblocked.  */
+      usleep (1);
+    }
+# endif
+  return ret;
+#else
   int ret = sigprocmask (how, new_mask, old_mask);
   return (ret < 0 ? errno : 0);
+#endif
 }
index 62a2ce920e6955e389513b1a4b23c2df8f20210e..047fac18b83bfdb3ab8887ba13391178192c64c2 100644 (file)
@@ -89,11 +89,7 @@ struct random_data
 # include <unistd.h>
 #endif
 
-#if 3 <= __GNUC__ || __GNUC__ == 2 && 8 <= __GNUC_MINOR__
-# define _GL_ATTRIBUTE_NORETURN __attribute__ ((__noreturn__))
-#else
-# define _GL_ATTRIBUTE_NORETURN
-#endif
+/* The definition of _Noreturn is copied here.  */
 
 /* The definitions of _GL_FUNCDECL_RPL etc. are copied here.  */
 
@@ -120,7 +116,7 @@ struct random_data
 /* Terminate the current process with the given return code, without running
    the 'atexit' handlers.  */
 # if !@HAVE__EXIT@
-_GL_FUNCDECL_SYS (_Exit, void, (int status) _GL_ATTRIBUTE_NORETURN);
+_GL_FUNCDECL_SYS (_Exit, _Noreturn void, (int status));
 # endif
 _GL_CXXALIAS_SYS (_Exit, void, (int status));
 _GL_CXXALIASWARN (_Exit);
index 8d7f62c8876df157923a3910d6798c96e9c84b63..5c2cc9674c1f467672b3c25d9dafb0ee6ceb6514 100644 (file)
@@ -1,4 +1,4 @@
-#serial 13
+#serial 14
 dnl Copyright (C) 2002, 2005, 2007, 2009-2011 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -12,7 +12,6 @@ AC_DEFUN([gl_FUNC_DUP2],
     AC_CHECK_FUNCS_ONCE([dup2])
     if test $ac_cv_func_dup2 = no; then
       HAVE_DUP2=0
-      AC_LIBOBJ([dup2])
     fi
   ], [
     AC_DEFINE([HAVE_DUP2], [1], [Define to 1 if you have the 'dup2' function.])
@@ -60,17 +59,15 @@ AC_DEFUN([gl_FUNC_DUP2],
          esac])
       ])
     if test "$gl_cv_func_dup2_works" = no; then
-      gl_REPLACE_DUP2
+      REPLACE_DUP2=1
     fi
   fi
-])
-
-AC_DEFUN([gl_REPLACE_DUP2],
-[
-  AC_REQUIRE([gl_UNISTD_H_DEFAULTS])
-  AC_CHECK_FUNCS_ONCE([dup2])
-  if test $ac_cv_func_dup2 = yes; then
-    REPLACE_DUP2=1
-  fi
-  AC_LIBOBJ([dup2])
+  dnl Replace dup2() for supporting the gnulib-defined fchdir() function,
+  dnl to keep fchdir's bookkeeping up-to-date.
+  m4_ifdef([gl_FUNC_FCHDIR], [
+    gl_TEST_FCHDIR
+    if test $HAVE_FCHDIR = 0; then
+      REPLACE_DUP2=1
+    fi
+  ])
 ])
index 1330503f0d77cf417f4e1e54062f258246401afb..22156e068c6679b75827589dbdd8f40da41fba08 100644 (file)
@@ -1,4 +1,4 @@
-# serial 9  -*- Autoconf -*-
+# serial 10  -*- Autoconf -*-
 # Enable extensions on systems that normally disable them.
 
 # Copyright (C) 2003, 2006-2011 Free Software Foundation, Inc.
@@ -67,6 +67,10 @@ AC_BEFORE([$0], [AC_RUN_IFELSE])dnl
 #ifndef _ALL_SOURCE
 # undef _ALL_SOURCE
 #endif
+/* Enable general extensions on MacOS X.  */
+#ifndef _DARWIN_C_SOURCE
+# undef _DARWIN_C_SOURCE
+#endif
 /* Enable GNU extensions on systems that have them.  */
 #ifndef _GNU_SOURCE
 # undef _GNU_SOURCE
@@ -95,6 +99,7 @@ AC_BEFORE([$0], [AC_RUN_IFELSE])dnl
   test $ac_cv_safe_to_define___extensions__ = yes &&
     AC_DEFINE([__EXTENSIONS__])
   AC_DEFINE([_ALL_SOURCE])
+  AC_DEFINE([_DARWIN_C_SOURCE])
   AC_DEFINE([_GNU_SOURCE])
   AC_DEFINE([_POSIX_PTHREAD_SEMANTICS])
   AC_DEFINE([_TANDEM_SOURCE])
index 7e49ddde9f6885488c3448344178d4b08876eae8..047a3db022141a001767069b7e3ba3e0d2239e2c 100644 (file)
@@ -231,8 +231,12 @@ dnl is ambiguous with environment values that contain newlines.
         [AC_LANG_PROGRAM([[#include <getopt.h>
                            #include <stddef.h>
                            #include <string.h>
+           ]GL_NOCRASH[
            ]], [[
              int result = 0;
+
+             nocrash_init();
+
              /* This code succeeds on glibc 2.8, OpenBSD 4.0, Cygwin, mingw,
                 and fails on MacOS X 10.5, AIX 5.2, HP-UX 11, IRIX 6.5,
                 OSF/1 5.1, Solaris 10.  */
index 8370c571655a1369698210ecdf5020d46febcbbd..becf95bef71797d854a5ec108a1b5adbce5c02bb 100644 (file)
@@ -28,8 +28,6 @@ AC_DEFUN([gl_EARLY],
   AC_REQUIRE([AC_PROG_RANLIB])
   # Code from module alloca-opt:
   # Code from module allocator:
-  # Code from module arg-nonnull:
-  # Code from module c++defs:
   # Code from module careadlinkat:
   # Code from module crypto/md5:
   # Code from module crypto/sha1:
@@ -49,13 +47,19 @@ AC_DEFUN([gl_EARLY],
   # Code from module include_next:
   # Code from module intprops:
   # Code from module inttypes-incomplete:
+  # Code from module largefile:
   # Code from module lstat:
   # Code from module mktime:
   # Code from module multiarch:
+  # Code from module nocrash:
   # Code from module pthread_sigmask:
   # Code from module readlink:
   # Code from module signal:
   # Code from module sigprocmask:
+  # Code from module snippet/_Noreturn:
+  # Code from module snippet/arg-nonnull:
+  # Code from module snippet/c++defs:
+  # Code from module snippet/warn-on-use:
   # Code from module socklen:
   # Code from module ssize_t:
   # Code from module stat:
@@ -82,7 +86,6 @@ AC_DEFUN([gl_EARLY],
   # Code from module u64:
   # Code from module unistd:
   # Code from module verify:
-  # Code from module warn-on-use:
 ])
 
 # This macro should be invoked from ./configure.in, in the section
@@ -109,6 +112,9 @@ gl_SHA256
 gl_SHA512
 AC_REQUIRE([gl_C99_STRTOLD])
 gl_FUNC_DUP2
+if test $HAVE_DUP2 = 0 || test $REPLACE_DUP2 = 1; then
+  AC_LIBOBJ([dup2])
+fi
 gl_UNISTD_MODULE_INDICATOR([dup2])
 gl_FILEMODE
 gl_GETLOADAVG
@@ -148,6 +154,7 @@ gl_MULTIARCH
 gl_FUNC_PTHREAD_SIGMASK
 if test $HAVE_PTHREAD_SIGMASK = 0 || test $REPLACE_PTHREAD_SIGMASK = 1; then
   AC_LIBOBJ([pthread_sigmask])
+  gl_PREREQ_PTHREAD_SIGMASK
 fi
 gl_SIGNAL_MODULE_INDICATOR([pthread_sigmask])
 gl_FUNC_READLINK
@@ -451,9 +458,10 @@ AC_DEFUN([gltests_LIBSOURCES], [
 # This macro records the list of files which have been installed by
 # gnulib-tool and may be removed by future gnulib-tool invocations.
 AC_DEFUN([gl_FILE_LIST], [
-  build-aux/arg-nonnull.h
-  build-aux/c++defs.h
-  build-aux/warn-on-use.h
+  build-aux/snippet/_Noreturn.h
+  build-aux/snippet/arg-nonnull.h
+  build-aux/snippet/c++defs.h
+  build-aux/snippet/warn-on-use.h
   lib/alloca.in.h
   lib/allocator.c
   lib/allocator.h
@@ -523,11 +531,13 @@ AC_DEFUN([gl_FILE_LIST], [
   m4/gnulib-common.m4
   m4/include_next.m4
   m4/inttypes.m4
+  m4/largefile.m4
   m4/longlong.m4
   m4/lstat.m4
   m4/md5.m4
   m4/mktime.m4
   m4/multiarch.m4
+  m4/nocrash.m4
   m4/pthread_sigmask.m4
   m4/readlink.m4
   m4/sha1.m4
index 843efe051812f59647f03c6521edf4e0e335cc12..6b5923a0ea6e02608468ca28148d442650aba472 100644 (file)
@@ -1,4 +1,4 @@
-# gnulib-common.m4 serial 26
+# gnulib-common.m4 serial 28
 dnl Copyright (C) 2007-2011 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -12,6 +12,19 @@ AC_DEFUN([gl_COMMON], [
   AC_REQUIRE([gl_COMMON_BODY])
 ])
 AC_DEFUN([gl_COMMON_BODY], [
+  AH_VERBATIM([_Noreturn],
+[/* The _Noreturn keyword of draft C1X.  */
+#ifndef _Noreturn
+# if (3 <= __GNUC__ || (__GNUC__ == 2 && 8 <= __GNUC_MINOR__) \
+      || 0x5110 <= __SUNPRO_C)
+#  define _Noreturn __attribute__ ((__noreturn__))
+# elif 1200 <= _MSC_VER
+#  define _Noreturn __declspec (noreturn)
+# else
+#  define _Noreturn
+# endif
+#endif
+])
   AH_VERBATIM([isoc99_inline],
 [/* Work around a bug in Apple GCC 4.0.1 build 5465: In C99 mode, it supports
    the ISO C 99 semantics of 'extern inline' (unlike the GNU C semantics of
index b3c78491855295c6b0a855438f5fac7ad146e641..ebf081a11012928a4dabf5570dc02b3bb38b27d1 100644 (file)
@@ -1,4 +1,4 @@
-# include_next.m4 serial 18
+# include_next.m4 serial 20
 dnl Copyright (C) 2006-2011 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -175,11 +175,13 @@ AC_DEFUN([gl_NEXT_HEADERS_INTERNAL],
     [AC_CHECK_HEADERS_ONCE([$1])
     ])
 
+dnl FIXME: gl_next_header and gl_header_exists must be used unquoted
+dnl until we can assume autoconf 2.64 or newer.
   m4_foreach_w([gl_HEADER_NAME], [$1],
     [AS_VAR_PUSHDEF([gl_next_header],
                     [gl_cv_next_]m4_defn([gl_HEADER_NAME]))
      if test $gl_cv_have_include_next = yes; then
-       AS_VAR_SET([gl_next_header], ['<'gl_HEADER_NAME'>'])
+       AS_VAR_SET(gl_next_header, ['<'gl_HEADER_NAME'>'])
      else
        AC_CACHE_CHECK(
          [absolute name of <]m4_defn([gl_HEADER_NAME])[>],
@@ -208,7 +210,7 @@ AC_DEFUN([gl_NEXT_HEADERS_INTERNAL],
                dnl eval is necessary to expand gl_absname_cpp.
                dnl Ultrix and Pyramid sh refuse to redirect output of eval,
                dnl so use subshell.
-               AS_VAR_SET([gl_next_header],
+               AS_VAR_SET(gl_next_header,
                  ['"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&AS_MESSAGE_LOG_FD |
                   sed -n '\#/]m4_defn([gl_HEADER_NAME])[#{
                     s#.*"\(.*/]m4_defn([gl_HEADER_NAME])[\)".*#\1#
@@ -218,20 +220,20 @@ AC_DEFUN([gl_NEXT_HEADERS_INTERNAL],
                   }'`'"'])
           m4_if([$2], [check],
             [else
-               AS_VAR_SET([gl_next_header], ['<'gl_HEADER_NAME'>'])
+               AS_VAR_SET(gl_next_header, ['<'gl_HEADER_NAME'>'])
              fi
             ])
          ])
      fi
      AC_SUBST(
        AS_TR_CPP([NEXT_]m4_defn([gl_HEADER_NAME])),
-       [AS_VAR_GET([gl_next_header])])
+       [AS_VAR_GET(gl_next_header)])
      if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
        # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
        gl_next_as_first_directive='<'gl_HEADER_NAME'>'
      else
        # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
-       gl_next_as_first_directive=AS_VAR_GET([gl_next_header])
+       gl_next_as_first_directive=AS_VAR_GET(gl_next_header)
      fi
      AC_SUBST(
        AS_TR_CPP([NEXT_AS_FIRST_DIRECTIVE_]m4_defn([gl_HEADER_NAME])),
diff --git a/m4/largefile.m4 b/m4/largefile.m4
new file mode 100644 (file)
index 0000000..6986244
--- /dev/null
@@ -0,0 +1,104 @@
+# Enable large files on systems where this is not the default.
+
+# Copyright 1992-1996, 1998-2011 Free Software Foundation, Inc.
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# The following implementation works around a problem in autoconf <= 2.68;
+# AC_SYS_LARGEFILE does not configure for large inodes on Mac OS X 10.5.
+m4_version_prereq([2.69], [] ,[
+
+# _AC_SYS_LARGEFILE_TEST_INCLUDES
+# -------------------------------
+m4_define([_AC_SYS_LARGEFILE_TEST_INCLUDES],
+[@%:@include <sys/types.h>
+ /* Check that off_t can represent 2**63 - 1 correctly.
+    We can't simply define LARGE_OFF_T to be 9223372036854775807,
+    since some C++ compilers masquerading as C compilers
+    incorrectly reject 9223372036854775807.  */
+@%:@define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
+  int off_t_is_large[[(LARGE_OFF_T % 2147483629 == 721
+                      && LARGE_OFF_T % 2147483647 == 1)
+                     ? 1 : -1]];[]dnl
+])
+
+
+# _AC_SYS_LARGEFILE_MACRO_VALUE(C-MACRO, VALUE,
+#                              CACHE-VAR,
+#                              DESCRIPTION,
+#                              PROLOGUE, [FUNCTION-BODY])
+# --------------------------------------------------------
+m4_define([_AC_SYS_LARGEFILE_MACRO_VALUE],
+[AC_CACHE_CHECK([for $1 value needed for large files], [$3],
+[while :; do
+  m4_ifval([$6], [AC_LINK_IFELSE], [AC_COMPILE_IFELSE])(
+    [AC_LANG_PROGRAM([$5], [$6])],
+    [$3=no; break])
+  m4_ifval([$6], [AC_LINK_IFELSE], [AC_COMPILE_IFELSE])(
+    [AC_LANG_PROGRAM([@%:@define $1 $2
+$5], [$6])],
+    [$3=$2; break])
+  $3=unknown
+  break
+done])
+case $$3 in #(
+  no | unknown) ;;
+  *) AC_DEFINE_UNQUOTED([$1], [$$3], [$4]);;
+esac
+rm -rf conftest*[]dnl
+])# _AC_SYS_LARGEFILE_MACRO_VALUE
+
+
+# AC_SYS_LARGEFILE
+# ----------------
+# By default, many hosts won't let programs access large files;
+# one must use special compiler options to get large-file access to work.
+# For more details about this brain damage please see:
+# http://www.unix-systems.org/version2/whatsnew/lfs20mar.html
+AC_DEFUN([AC_SYS_LARGEFILE],
+[AC_ARG_ENABLE(largefile,
+              [  --disable-largefile     omit support for large files])
+if test "$enable_largefile" != no; then
+
+  AC_CACHE_CHECK([for special C compiler options needed for large files],
+    ac_cv_sys_largefile_CC,
+    [ac_cv_sys_largefile_CC=no
+     if test "$GCC" != yes; then
+       ac_save_CC=$CC
+       while :; do
+        # IRIX 6.2 and later do not support large files by default,
+        # so use the C compiler's -n32 option if that helps.
+        AC_LANG_CONFTEST([AC_LANG_PROGRAM([_AC_SYS_LARGEFILE_TEST_INCLUDES])])
+        AC_COMPILE_IFELSE([], [break])
+        CC="$CC -n32"
+        AC_COMPILE_IFELSE([], [ac_cv_sys_largefile_CC=' -n32'; break])
+        break
+       done
+       CC=$ac_save_CC
+       rm -f conftest.$ac_ext
+    fi])
+  if test "$ac_cv_sys_largefile_CC" != no; then
+    CC=$CC$ac_cv_sys_largefile_CC
+  fi
+
+  _AC_SYS_LARGEFILE_MACRO_VALUE(_FILE_OFFSET_BITS, 64,
+    ac_cv_sys_file_offset_bits,
+    [Number of bits in a file offset, on hosts where this is settable.],
+    [_AC_SYS_LARGEFILE_TEST_INCLUDES])
+  if test $ac_cv_sys_file_offset_bits = unknown; then
+    _AC_SYS_LARGEFILE_MACRO_VALUE(_LARGE_FILES, 1,
+      ac_cv_sys_large_files,
+      [Define for large files, on AIX-style hosts.],
+      [_AC_SYS_LARGEFILE_TEST_INCLUDES])
+  fi
+
+  AH_VERBATIM([_DARWIN_USE_64_BIT_INODE],
+[/* Enable large inode numbers on Mac OS X.  */
+#ifndef _DARWIN_USE_64_BIT_INODE
+# define _DARWIN_USE_64_BIT_INODE 1
+#endif])
+fi
+])# AC_SYS_LARGEFILE
+
+])# m4_version_prereq 2.69
diff --git a/m4/nocrash.m4 b/m4/nocrash.m4
new file mode 100644 (file)
index 0000000..0cc0d53
--- /dev/null
@@ -0,0 +1,102 @@
+# nocrash.m4 serial 2
+dnl Copyright (C) 2005, 2009-2011 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl Based on libsigsegv, from Bruno Haible and Paolo Bonzini.
+
+AC_PREREQ([2.13])
+
+dnl Expands to some code for use in .c programs that will cause the configure
+dnl test to exit instead of crashing. This is useful to avoid triggering
+dnl action from a background debugger and to avoid core dumps.
+dnl Usage:   ...
+dnl          ]GL_NOCRASH[
+dnl          ...
+dnl          int main() { nocrash_init(); ... }
+AC_DEFUN([GL_NOCRASH],[[
+#include <stdlib.h>
+#if defined __MACH__ && defined __APPLE__
+/* Avoid a crash on MacOS X.  */
+#include <mach/mach.h>
+#include <mach/mach_error.h>
+#include <mach/thread_status.h>
+#include <mach/exception.h>
+#include <mach/task.h>
+#include <pthread.h>
+/* The exception port on which our thread listens.  */
+static mach_port_t our_exception_port;
+/* The main function of the thread listening for exceptions of type
+   EXC_BAD_ACCESS.  */
+static void *
+mach_exception_thread (void *arg)
+{
+  /* Buffer for a message to be received.  */
+  struct {
+    mach_msg_header_t head;
+    mach_msg_body_t msgh_body;
+    char data[1024];
+  } msg;
+  mach_msg_return_t retval;
+  /* Wait for a message on the exception port.  */
+  retval = mach_msg (&msg.head, MACH_RCV_MSG | MACH_RCV_LARGE, 0, sizeof (msg),
+                     our_exception_port, MACH_MSG_TIMEOUT_NONE, MACH_PORT_NULL);
+  if (retval != MACH_MSG_SUCCESS)
+    abort ();
+  exit (1);
+}
+static void
+nocrash_init (void)
+{
+  mach_port_t self = mach_task_self ();
+  /* Allocate a port on which the thread shall listen for exceptions.  */
+  if (mach_port_allocate (self, MACH_PORT_RIGHT_RECEIVE, &our_exception_port)
+      == KERN_SUCCESS) {
+    /* See http://web.mit.edu/darwin/src/modules/xnu/osfmk/man/mach_port_insert_right.html.  */
+    if (mach_port_insert_right (self, our_exception_port, our_exception_port,
+                                MACH_MSG_TYPE_MAKE_SEND)
+        == KERN_SUCCESS) {
+      /* The exceptions we want to catch.  Only EXC_BAD_ACCESS is interesting
+         for us.  */
+      exception_mask_t mask = EXC_MASK_BAD_ACCESS;
+      /* Create the thread listening on the exception port.  */
+      pthread_attr_t attr;
+      pthread_t thread;
+      if (pthread_attr_init (&attr) == 0
+          && pthread_attr_setdetachstate (&attr, PTHREAD_CREATE_DETACHED) == 0
+          && pthread_create (&thread, &attr, mach_exception_thread, NULL) == 0) {
+        pthread_attr_destroy (&attr);
+        /* Replace the exception port info for these exceptions with our own.
+           Note that we replace the exception port for the entire task, not only
+           for a particular thread.  This has the effect that when our exception
+           port gets the message, the thread specific exception port has already
+           been asked, and we don't need to bother about it.
+           See http://web.mit.edu/darwin/src/modules/xnu/osfmk/man/task_set_exception_ports.html.  */
+        task_set_exception_ports (self, mask, our_exception_port,
+                                  EXCEPTION_DEFAULT, MACHINE_THREAD_STATE);
+      }
+    }
+  }
+}
+#else
+/* Avoid a crash on POSIX systems.  */
+#include <signal.h>
+/* A POSIX signal handler.  */
+static void
+exception_handler (int sig)
+{
+  exit (1);
+}
+static void
+nocrash_init (void)
+{
+#ifdef SIGSEGV
+  signal (SIGSEGV, exception_handler);
+#endif
+#ifdef SIGBUS
+  signal (SIGBUS, exception_handler);
+#endif
+}
+#endif
+]])
index e98d8e0f4ea0d1700f6bef68f3c1f74f6c5a8983..f3522496cd5e0efa46aa5c4fe3c7a8a6e379ef3d 100644 (file)
@@ -1,4 +1,4 @@
-# pthread_sigmask.m4 serial 7-emacs1
+# pthread_sigmask.m4 serial 11
 dnl Copyright (C) 2011 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -8,20 +8,240 @@ AC_DEFUN([gl_FUNC_PTHREAD_SIGMASK],
 [
   AC_CHECK_FUNCS_ONCE([pthread_sigmask])
   LIB_PTHREAD_SIGMASK=
-    dnl gl_THREADLIB is not in use.  Assume the application wants
-    dnl POSIX semantics.
-    if test $ac_cv_func_pthread_sigmask != yes; then
-      gl_save_LIBS=$LIBS
-      AC_SEARCH_LIBS([pthread_sigmask], [pthread c_r])
-      LIBS=$gl_save_LIBS
-      if test "$ac_cv_search_pthread_sigmask" = no; then
+
+  dnl Test whether the gnulib module 'threadlib' is in use.
+  dnl Some packages like Emacs use --avoid=threadlib.
+  dnl Write the symbol in such a way that it does not cause 'aclocal' to pick
+  dnl the threadlib.m4 file that is installed in $PREFIX/share/aclocal/.
+  m4_ifdef([gl_[]THREADLIB], [
+    AC_REQUIRE([gl_[]THREADLIB])
+
+    if test "$gl_threads_api" = posix; then
+      if test $ac_cv_func_pthread_sigmask = yes; then
+        dnl pthread_sigmask is available without -lpthread.
+        :
+      else
+        if test -n "$LIBMULTITHREAD"; then
+          AC_CACHE_CHECK([for pthread_sigmask in $LIBMULTITHREAD],
+            [gl_cv_func_pthread_sigmask_in_LIBMULTITHREAD],
+            [gl_save_LIBS="$LIBS"
+             LIBS="$LIBS $LIBMULTITHREAD"
+             AC_LINK_IFELSE(
+               [AC_LANG_PROGRAM(
+                  [[#include <pthread.h>
+                    #include <signal.h>
+                  ]],
+                  [[return pthread_sigmask (0, (sigset_t *) 0, (sigset_t *) 0);]])
+               ],
+               [gl_cv_func_pthread_sigmask_in_LIBMULTITHREAD=yes],
+               [gl_cv_func_pthread_sigmask_in_LIBMULTITHREAD=no])
+             LIBS="$gl_save_LIBS"
+            ])
+          if test $gl_cv_func_pthread_sigmask_in_LIBMULTITHREAD = yes; then
+            dnl pthread_sigmask is available with -lpthread.
+            LIB_PTHREAD_SIGMASK="$LIBMULTITHREAD"
+          else
+            dnl pthread_sigmask is not available at all.
+            HAVE_PTHREAD_SIGMASK=0
+          fi
+        else
+          dnl pthread_sigmask is not available at all.
+          HAVE_PTHREAD_SIGMASK=0
+        fi
+      fi
+    else
+      dnl pthread_sigmask may exist but does not interoperate with the chosen
+      dnl multithreading facility.
+      dnl If "$gl_threads_api" = pth, we could use the function pth_sigmask,
+      dnl but it is equivalent to sigprocmask, so we choose to emulate
+      dnl pthread_sigmask with sigprocmask also in this case. This yields fewer
+      dnl link dependencies.
+      if test $ac_cv_func_pthread_sigmask = yes; then
+        REPLACE_PTHREAD_SIGMASK=1
+      else
         HAVE_PTHREAD_SIGMASK=0
-      elif test "$ac_cv_search_pthread_sigmask" != 'none required'; then
-        LIB_PTHREAD_SIGMASK=$ac_cv_search_pthread_sigmask
       fi
     fi
+  ], [
+    dnl The module 'threadlib' is not in use, due to --avoid=threadlib being
+    dnl specified.
+    dnl The package either has prepared CPPFLAGS and LIBS for use of POSIX:2008
+    dnl threads, or wants to build single-threaded programs.
+    if test $ac_cv_func_pthread_sigmask = yes; then
+      dnl pthread_sigmask exists and does not require extra libraries.
+      dnl Assume that it is declared.
+      :
+    else
+      dnl pthread_sigmask either does not exist or needs extra libraries.
+      HAVE_PTHREAD_SIGMASK=0
+      dnl Define the symbol rpl_pthread_sigmask, not pthread_sigmask,
+      dnl so as to not accidentally override the system's pthread_sigmask
+      dnl symbol from libpthread. This is necessary on IRIX 6.5.
+      REPLACE_PTHREAD_SIGMASK=1
+    fi
+  ])
+
   AC_SUBST([LIB_PTHREAD_SIGMASK])
   dnl We don't need a variable LTLIB_PTHREAD_SIGMASK, because when
   dnl "$gl_threads_api" = posix, $LTLIBMULTITHREAD and $LIBMULTITHREAD are the
   dnl same: either both empty or both "-lpthread".
+
+  dnl Now test for some bugs in the system function.
+  if test $HAVE_PTHREAD_SIGMASK = 1; then
+    AC_REQUIRE([AC_PROG_CC])
+    AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
+
+    dnl On FreeBSD 6.4, HP-UX 11.31, Solaris 9, in programs that are not linked
+    dnl with -lpthread, the pthread_sigmask() function always returns 0 and has
+    dnl no effect.
+    if test -z "$LIB_PTHREAD_SIGMASK"; then
+      AC_CACHE_CHECK([whether pthread_sigmask works without -lpthread],
+        [gl_cv_func_pthread_sigmask_in_libc_works],
+        [
+          AC_RUN_IFELSE(
+            [AC_LANG_SOURCE([[
+#include <pthread.h>
+#include <signal.h>
+#include <stddef.h>
+int main ()
+{
+  sigset_t set;
+  sigemptyset (&set);
+  return pthread_sigmask (1729, &set, NULL) != 0;
+}]])],
+            [gl_cv_func_pthread_sigmask_in_libc_works=no],
+            [gl_cv_func_pthread_sigmask_in_libc_works=yes],
+            [
+changequote(,)dnl
+             case "$host_os" in
+               freebsd* | hpux* | solaris | solaris2.[2-9]*)
+                 gl_cv_func_pthread_sigmask_in_libc_works="guessing no";;
+               *)
+                 gl_cv_func_pthread_sigmask_in_libc_works="guessing yes";;
+             esac
+changequote([,])dnl
+            ])
+        ])
+      case "$gl_cv_func_pthread_sigmask_in_libc_works" in
+        *no)
+          REPLACE_PTHREAD_SIGMASK=1
+          AC_DEFINE([PTHREAD_SIGMASK_INEFFECTIVE], [1],
+            [Define to 1 if pthread_sigmask() may returns 0 and have no effect.])
+          ;;
+      esac
+    fi
+
+    dnl On Cygwin 1.7.5, the pthread_sigmask() has a wrong return value
+    dnl convention: Upon failure, it returns -1 and sets errno.
+    AC_CACHE_CHECK([whether pthread_sigmask returns error numbers],
+      [gl_cv_func_pthread_sigmask_return_works],
+      [
+        gl_save_LIBS="$LIBS"
+        LIBS="$LIBS $LIB_PTHREAD_SIGMASK"
+        AC_RUN_IFELSE(
+          [AC_LANG_SOURCE([[
+#include <pthread.h>
+#include <signal.h>
+#include <stddef.h>
+int main ()
+{
+  sigset_t set;
+  sigemptyset (&set);
+  if (pthread_sigmask (1729, &set, NULL) == -1)
+    return 1;
+  return 0;
+}]])],
+          [gl_cv_func_pthread_sigmask_return_works=yes],
+          [gl_cv_func_pthread_sigmask_return_works=no],
+          [case "$host_os" in
+             cygwin*)
+               gl_cv_func_pthread_sigmask_return_works="guessing no";;
+             *)
+               gl_cv_func_pthread_sigmask_return_works="guessing yes";;
+           esac
+          ])
+        LIBS="$gl_save_LIBS"
+      ])
+    case "$gl_cv_func_pthread_sigmask_return_works" in
+      *no)
+        REPLACE_PTHREAD_SIGMASK=1
+        AC_DEFINE([PTHREAD_SIGMASK_FAILS_WITH_ERRNO], [1],
+          [Define to 1 if pthread_sigmask(), when it fails, returns -1 and sets errno.])
+        ;;
+    esac
+
+    dnl On IRIX 6.5, in a single-threaded program, pending signals are not
+    dnl immediately delivered when they are unblocked through pthread_sigmask,
+    dnl only a little while later.
+    AC_CACHE_CHECK([whether pthread_sigmask unblocks signals correctly],
+      [gl_cv_func_pthread_sigmask_unblock_works],
+      [
+        case "$host_os" in
+          irix*)
+            gl_cv_func_pthread_sigmask_unblock_works="guessing no";;
+          *)
+            gl_cv_func_pthread_sigmask_unblock_works="guessing yes";;
+        esac
+        dnl Here we link against $LIBMULTITHREAD, not only $LIB_PTHREAD_SIGMASK,
+        dnl otherwise we get a false positive on those platforms where
+        dnl $gl_cv_func_pthread_sigmask_in_libc_works is "no".
+        gl_save_LIBS="$LIBS"
+        LIBS="$LIBS $LIBMULTITHREAD"
+        AC_RUN_IFELSE(
+          [AC_LANG_SOURCE([[
+#include <pthread.h>
+#include <signal.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+static volatile int sigint_occurred;
+static void
+sigint_handler (int sig)
+{
+  sigint_occurred++;
+}
+int main ()
+{
+  sigset_t set;
+  int pid = getpid ();
+  char command[80];
+  signal (SIGINT, sigint_handler);
+  sigemptyset (&set);
+  sigaddset (&set, SIGINT);
+  if (!(pthread_sigmask (SIG_BLOCK, &set, NULL) == 0))
+    return 1;
+  sprintf (command, "sh -c 'sleep 1; kill -%d %d' &", SIGINT, pid);
+  if (!(system (command) == 0))
+    return 2;
+  sleep (2);
+  if (!(sigint_occurred == 0))
+    return 3;
+  if (!(pthread_sigmask (SIG_UNBLOCK, &set, NULL) == 0))
+    return 4;
+  if (!(sigint_occurred == 1)) /* This fails on IRIX.  */
+    return 5;
+  return 0;
+}]])],
+          [:],
+          [gl_cv_func_pthread_sigmask_unblock_works=no],
+          [:])
+        LIBS="$gl_save_LIBS"
+      ])
+    case "$gl_cv_func_pthread_sigmask_unblock_works" in
+      *no)
+        REPLACE_PTHREAD_SIGMASK=1
+        AC_DEFINE([PTHREAD_SIGMASK_UNBLOCK_BUG], [1],
+          [Define to 1 if pthread_sigmask() unblocks signals incorrectly.])
+        ;;
+    esac
+  fi
+])
+
+# Prerequisite of lib/pthread_sigmask.c.
+AC_DEFUN([gl_PREREQ_PTHREAD_SIGMASK],
+[
+  if test $HAVE_PTHREAD_SIGMASK = 1; then
+    AC_DEFINE([HAVE_PTHREAD_SIGMASK], [1],
+      [Define to 1 if the pthread_sigmask function can be used (despite bugs).])
+  fi
 ])
index e069c71a762a48cefce0a2869c0558573e3f6c4b..c15fecfd111796e7a4440795c65f505b15de6253 100755 (executable)
--- a/make-dist
+++ b/make-dist
@@ -283,18 +283,16 @@ mkdir ${tempdir}
 ### tar file; this means that people can start reading the INSTALL and
 ### README while the rest of the tar file is still unpacking.  Whoopee.
 echo "Making links to top-level files"
-ln INSTALL README BUGS move-if-change ${tempdir}
+ln INSTALL README BUGS ${tempdir}
 ln ChangeLog Makefile.in configure configure.in ${tempdir}
 ln config.bat make-dist update-subdirs vpath.sed .dir-locals.el ${tempdir}
-ln config.sub config.guess install-sh ${tempdir}
 ln aclocal.m4 ${tempdir}
-ln compile depcomp missing ${tempdir}
-ln arg-nonnull.h c++defs.h warn-on-use.h ${tempdir}
 
 echo "Creating subdirectories"
 for subdir in site-lisp \
              leim leim/CXTERM-DIC leim/MISC-DIC \
              leim/SKK-DIC leim/ja-dic leim/quail \
+             build-aux build-aux/snippet \
              src src/m src/s src/bitmaps lib lib-src oldXMenu lwlib \
              nt nt/inc nt/inc/sys nt/inc/arpa nt/inc/netinet nt/icons \
              `find etc lisp admin -type d` \
@@ -346,6 +344,15 @@ echo "Making links to \`leim' and its subdirectories"
  rm -f ../${tempdir}/leim/quail/tsang-b5.*
  rm -f ../${tempdir}/leim/quail/tsang-cns.*)
 
+echo "Making links to \`build-aux'"
+(cd build-aux
+ ln compile config.guess config.sub depcomp ../${tempdir}/build-aux
+ ln install-sh missing move-if-change ../${tempdir}/build-aux)
+
+echo "Making links to \`build-aux/snippet'"
+(cd build-aux/snippet
+ ln *.h ../../${tempdir}/build-aux/snippet)
+
 echo "Making links to \`src'"
 ### Don't distribute the configured versions of
 ### config.in, paths.in, buildobj.h, or Makefile.in.
@@ -373,12 +380,13 @@ echo "Making links to \`src/s'"
  ln README [a-zA-Z0-9]*.h ../../${tempdir}/src/s)
 
 echo "Making links to \`lib'"
-(build_aux_h=`(ls *.h)`
+(snippet_h=`(cd build-aux/snippet && ls *.h)`
  cd lib
  ln [a-zA-Z]*.[ch] ../${tempdir}/lib
  ln gnulib.mk Makefile.am Makefile.in ../${tempdir}/lib
  cd ../${tempdir}/lib
- rm -f `(echo "$build_aux_h"; ls *.in.h) | sed '/[*]/d; s/.in.h$/.h/'`)
+ script='/[*]/d; s/\.in\.h$/.h/'
+ rm -f `(echo "$snippet_h"; ls *.in.h) | sed "$script"`)
 
 echo "Making links to \`lib-src'"
 (cd lib-src
index e1ce2a312e05f0a9cd062a5f993adbb9172592c9..9b8a96c117c5b97cb8c4c96631579106e7d18720 100644 (file)
@@ -1,3 +1,8 @@
+2011-07-25  Paul Eggert  <eggert@cs.ucla.edu>
+
+       * sedlibmk.inp (CONFIG_CLEAN_VPATH_FILES): Adjust to snippet moves
+       from top level to build-aux/snippet (Bug#9169).
+
 2011-06-07  Eli Zaretskii  <eliz@gnu.org>
 
        * sedlibmk.inp (PTRDIFF_T_SUFFIX): Edit to nothing.
index 3860203d2bf6c281ac0f7c753e10e831dc073e48..a97ec7cb5f6806012d94a9edea943406cc601b5d 100644 (file)
@@ -569,11 +569,11 @@ s/^@GL_GENERATE_STDDEF_H_FALSE@/\#/
 s/^@GL_GENERATE_STDINT_H_TRUE@//
 s/^@GL_GENERATE_STDINT_H_FALSE@/\#/
 /^arg-nonnull\.h:/,/^[         ][      ]*mv /c\
-arg-nonnull.h: $(top_srcdir)/./arg-nonnull.h\
-       sed -n -e '/GL_ARG_NONNULL/,$$p' < $(top_srcdir)/./arg-nonnull.h > $@
+arg-nonnull.h: $(top_srcdir)/build-aux/snippet/arg-nonnull.h\
+       sed -n -e '/GL_ARG_NONNULL/,$$p' < $(top_srcdir)/build-aux/snippet/arg-nonnull.h > $@
 /^cxxdefs\.h:/,/^[     ][      ]*mv /c\
-cxxdefs.h: $(top_srcdir)/./cxxdefs.h\
-       sed -n -e '/_GL_CXXDEFS/,$$p' < $(top_srcdir)/./cxxdefs.h > $@
+cxxdefs.h: $(top_srcdir)/build-aux/snippet/cxxdefs.h\
+       sed -n -e '/_GL_CXXDEFS/,$$p' < $(top_srcdir)/build-aux/snippet/cxxdefs.h > $@
 s/^    [       ]*{ echo \(.*\); \\/     djecho \1 > $@-t/
 s/^    [       ]*{ echo \(.*\) && \\/   djecho \1 > $@-t/
 s/ \&\& \\ *$//
index 6113c2362ee1e3e2ea3d26d2aad4ab39fa387728..f39536308035349de440b851498ef99a1f7dee7b 100644 (file)
 
 2011-07-29  Paul Eggert  <eggert@cs.ucla.edu>
 
+       * Makefile.in (gl-stamp): move-if-change now in build-aux (Bug#9169).
+
+2011-07-28  Paul Eggert  <eggert@cs.ucla.edu>
+
        * image.c (check_image_size): Use 1024x1024 if unknown frame (Bug#9189).
        This is needed if max-image-size is a floating-point number.
 
index af4d6df9f8f67e3fbcc9f6f7ad90d2159b50865f..3be10c388c75cc37c3be175ceb91f822fba62c52 100644 (file)
@@ -442,7 +442,7 @@ GLOBAL_SOURCES = $(base_obj:.o=.c) $(NS_OBJC_OBJ:.o=.m)
 gl-stamp: $(libsrc)/make-docfile$(EXEEXT) $(GLOBAL_SOURCES)
        @rm -f gl-tmp
        $(libsrc)/make-docfile -d $(srcdir) -g $(SOME_MACHINE_OBJECTS) $(obj) > gl-tmp
-       $(srcdir)/../move-if-change gl-tmp globals.h
+       $(srcdir)/../build-aux/move-if-change gl-tmp globals.h
        echo timestamp > $@
 
 $(obj) $(otherobj): globals.h