diff options
| author | Paul Eggert | 2014-05-29 08:05:06 -0700 |
|---|---|---|
| committer | Paul Eggert | 2014-05-29 08:05:06 -0700 |
| commit | 035159ed54cf2e1abc0439fbb6e628c9223f8e5d (patch) | |
| tree | e99b3609d60f0bbda83dec913cf46cb5f32e2c6d /m4/timer_time.m4 | |
| parent | 0bbb27fc3f52f87605cfadba62d52b72523b73a5 (diff) | |
| download | emacs-035159ed54cf2e1abc0439fbb6e628c9223f8e5d.tar.gz emacs-035159ed54cf2e1abc0439fbb6e628c9223f8e5d.zip | |
Don't substitute sigprocmask for pthread_sigmask.
sigprocmask isn't portable in a multithreaded process.
* configure.ac (gl_THREADLIB): Remove dummy.
Merge from gnulib, incorporating:
2014-05-28 pthread_sigmask, timer-time: use gl_THREADLIB only if needed
* m4/pthread_sigmask.m4, m4/timer_time.m4: Update from gnulib.
* src/Makefile.in (LIB_PTHREAD_SIGMASK): Remove; all uses removed.
Fixes: debbugs:17561
Diffstat (limited to 'm4/timer_time.m4')
| -rw-r--r-- | m4/timer_time.m4 | 39 |
1 files changed, 22 insertions, 17 deletions
diff --git a/m4/timer_time.m4 b/m4/timer_time.m4 index 8e2c921cbef..578ebe0809a 100644 --- a/m4/timer_time.m4 +++ b/m4/timer_time.m4 | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | # timer_time.m4 serial 2 | 1 | # timer_time.m4 serial 3 |
| 2 | dnl Copyright (C) 2011-2014 Free Software Foundation, Inc. | 2 | dnl Copyright (C) 2011-2014 Free Software Foundation, Inc. |
| 3 | dnl This file is free software; the Free Software Foundation | 3 | dnl This file is free software; the Free Software Foundation |
| 4 | dnl gives unlimited permission to copy and/or distribute it, | 4 | dnl gives unlimited permission to copy and/or distribute it, |
| @@ -11,7 +11,12 @@ AC_DEFUN([gl_TIMER_TIME], | |||
| 11 | dnl Based on clock_time.m4. See details there. | 11 | dnl Based on clock_time.m4. See details there. |
| 12 | 12 | ||
| 13 | AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS]) | 13 | AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS]) |
| 14 | AC_REQUIRE([gl_THREADLIB]) | 14 | |
| 15 | dnl Test whether the gnulib module 'threadlib' is in use. | ||
| 16 | dnl Some packages like Emacs use --avoid=threadlib. | ||
| 17 | dnl Write the symbol in such a way that it does not cause 'aclocal' to pick | ||
| 18 | dnl the threadlib.m4 file that is installed in $PREFIX/share/aclocal/. | ||
| 19 | m4_ifdef([gl_][THREADLIB], [AC_REQUIRE([gl_][THREADLIB])]) | ||
| 15 | 20 | ||
| 16 | LIB_TIMER_TIME= | 21 | LIB_TIMER_TIME= |
| 17 | AC_SUBST([LIB_TIMER_TIME]) | 22 | AC_SUBST([LIB_TIMER_TIME]) |
| @@ -19,21 +24,21 @@ AC_DEFUN([gl_TIMER_TIME], | |||
| 19 | AC_SEARCH_LIBS([timer_settime], [rt posix4], | 24 | AC_SEARCH_LIBS([timer_settime], [rt posix4], |
| 20 | [test "$ac_cv_search_timer_settime" = "none required" || | 25 | [test "$ac_cv_search_timer_settime" = "none required" || |
| 21 | LIB_TIMER_TIME=$ac_cv_search_timer_settime]) | 26 | LIB_TIMER_TIME=$ac_cv_search_timer_settime]) |
| 22 | dnl GLIBC uses threads to emulate posix timers when kernel support | 27 | m4_ifdef([gl_][THREADLIB], |
| 23 | dnl is not available (like Linux < 2.6 or when used with kFreeBSD) | 28 | [dnl GLIBC uses threads to emulate posix timers when kernel support |
| 24 | dnl Now the pthread lib is linked automatically in the normal case, | 29 | dnl is not available (like Linux < 2.6 or when used with kFreeBSD) |
| 25 | dnl but when linking statically, it needs to be explicitly specified. | 30 | dnl Now the pthread lib is linked automatically in the normal case, |
| 26 | AC_EGREP_CPP([Thread], | 31 | dnl but when linking statically, it needs to be explicitly specified. |
| 27 | [ | 32 | AC_EGREP_CPP([Thread], |
| 28 | #include <features.h> | 33 | [#include <features.h> |
| 29 | #ifdef __GNU_LIBRARY__ | 34 | #ifdef __GNU_LIBRARY__ |
| 30 | #if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 2) || (__GLIBC__ > 2)) \ | 35 | #if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 2) || (__GLIBC__ > 2)) \ |
| 31 | && !(__UCLIBC__ && __HAS_NO_THREADS__) | 36 | && !(__UCLIBC__ && __HAS_NO_THREADS__) |
| 32 | Thread emulation available | 37 | Thread emulation available |
| 33 | #endif | 38 | #endif |
| 34 | #endif | 39 | #endif |
| 35 | ], | 40 | ], |
| 36 | [LIB_TIMER_TIME="$LIB_TIMER_TIME $LIBMULTITHREAD"]) | 41 | [LIB_TIMER_TIME="$LIB_TIMER_TIME $LIBMULTITHREAD"])]) |
| 37 | AC_CHECK_FUNCS([timer_settime]) | 42 | AC_CHECK_FUNCS([timer_settime]) |
| 38 | LIBS=$gl_saved_libs | 43 | LIBS=$gl_saved_libs |
| 39 | ]) | 44 | ]) |