summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2011-07-24 15:15:47 -0700
committerPaul Eggert <eggert@cs.ucla.edu>2011-07-24 15:15:47 -0700
commit24e0f6b1dc721a919814b226834a4d027e9f90d0 (patch)
treeeb3edef13fd2275ab655eba6b83983b2e5513b0d /lib
parentf25e39b45a5960f8f2bff6c43f88833bc04540a9 (diff)
downloademacs-24e0f6b1dc721a919814b226834a4d027e9f90d0.tar.gz
Merge from gnulib, using build-aux to remove clutter.
* 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. * .bzrignore: The autogenerated files compile, config.guess, config.sub, depcomp, install-sh, and missing are now in build-aux. * 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. * admin/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. * leim/Makefile.in (install): install-sh is now in build-aux. * lib-src/Makefile.in ($(DESTDIR)${archlibdir}): install-sh moved to build-aux. * msdos/sedlibmk.inp (CONFIG_CLEAN_VPATH_FILES): Adjust to snippet moves from top level to build-aux/snippet. * src/Makefile.in (gl-stamp): move-if-change is now in build-aux.
Diffstat (limited to 'lib')
-rw-r--r--lib/gnulib.mk154
-rw-r--r--lib/makefile.w32-in2
-rw-r--r--lib/pthread_sigmask.c40
-rw-r--r--lib/stdlib.in.h8
4 files changed, 128 insertions, 76 deletions
diff --git a/lib/gnulib.mk b/lib/gnulib.mk
index 4341a5d184d..5163269db41 100644
--- a/lib/gnulib.mk
+++ b/lib/gnulib.mk
@@ -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 \
diff --git a/lib/makefile.w32-in b/lib/makefile.w32-in
index df7f8e274f0..6b451dd14e1 100644
--- a/lib/makefile.w32-in
+++ b/lib/makefile.w32-in
@@ -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
diff --git a/lib/pthread_sigmask.c b/lib/pthread_sigmask.c
index 1f460f13c48..11d549cad41 100644
--- a/lib/pthread_sigmask.c
+++ b/lib/pthread_sigmask.c
@@ -20,10 +20,50 @@
#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
}
diff --git a/lib/stdlib.in.h b/lib/stdlib.in.h
index 62a2ce920e6..047fac18b83 100644
--- a/lib/stdlib.in.h
+++ b/lib/stdlib.in.h
@@ -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);