diff options
| author | Paul Eggert | 2012-09-26 18:06:23 -0700 |
|---|---|---|
| committer | Paul Eggert | 2012-09-26 18:06:23 -0700 |
| commit | a615a3aeef0fb1469dcf89e2217a027a6dce82c1 (patch) | |
| tree | 6a9d26ac4b2a5ac287af1485234637c992474e12 | |
| parent | 3670daf7f9a480d8e87b292ff7051d5be331c6b4 (diff) | |
| download | emacs-a615a3aeef0fb1469dcf89e2217a027a6dce82c1.tar.gz emacs-a615a3aeef0fb1469dcf89e2217a027a6dce82c1.zip | |
Check more robustly for timer_settime.
This should fix an OS X build problem reported by Ivan Andrus in
<http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00671.html>.
* admin/merge-gnulib (GNULIB_MODULES): Add timer-time.
* configure.ac (gl_THREADLIB): Define to empty, since Emacs
does threads its own way.
* lib/gnulib.mk, m4/gnulib-comp.m4: Regenerate.
* m4/timer_time.m4: New file, from gnulib.
* src/atimer.c (alarm_timer, alarm_timer_ok, set_alarm, init_atimer):
Use HAVE_TIMER_SETTIME, not SIGEV_SIGNAL, to decide whether to
call timer_settime.
| -rw-r--r-- | ChangeLog | 8 | ||||
| -rw-r--r-- | admin/ChangeLog | 5 | ||||
| -rwxr-xr-x | admin/merge-gnulib | 2 | ||||
| -rw-r--r-- | configure.ac | 3 | ||||
| -rw-r--r-- | lib/gnulib.mk | 2 | ||||
| -rw-r--r-- | m4/gnulib-comp.m4 | 3 | ||||
| -rw-r--r-- | m4/timer_time.m4 | 39 | ||||
| -rw-r--r-- | src/ChangeLog | 7 | ||||
| -rw-r--r-- | src/atimer.c | 6 |
9 files changed, 70 insertions, 5 deletions
| @@ -1,3 +1,11 @@ | |||
| 1 | 2012-09-27 Paul Eggert <eggert@cs.ucla.edu> | ||
| 2 | |||
| 3 | Check more robustly for timer_settime. | ||
| 4 | This should fix an OS X build problem reported by Ivan Andrus in | ||
| 5 | <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00671.html>. | ||
| 6 | * configure.ac (gl_THREADLIB): Define to empty, since Emacs | ||
| 7 | does threads its own way. | ||
| 8 | |||
| 1 | 2012-09-23 Paul Eggert <eggert@cs.ucla.edu> | 9 | 2012-09-23 Paul Eggert <eggert@cs.ucla.edu> |
| 2 | 10 | ||
| 3 | * Makefile.in (bootstrap): Set MAKEFILE_NAME when building Makefile, | 11 | * Makefile.in (bootstrap): Set MAKEFILE_NAME when building Makefile, |
diff --git a/admin/ChangeLog b/admin/ChangeLog index 3f1c8e6a197..b8394036afb 100644 --- a/admin/ChangeLog +++ b/admin/ChangeLog | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | 2012-09-27 Paul Eggert <eggert@cs.ucla.edu> | ||
| 2 | |||
| 3 | Check more robustly for timer_settime. | ||
| 4 | * merge-gnulib (GNULIB_MODULES): Add timer-time. | ||
| 5 | |||
| 1 | 2012-09-26 Juanma Barranquero <lekktu@gmail.com> | 6 | 2012-09-26 Juanma Barranquero <lekktu@gmail.com> |
| 2 | 7 | ||
| 3 | * unidata/BidiMirroring.txt: | 8 | * unidata/BidiMirroring.txt: |
diff --git a/admin/merge-gnulib b/admin/merge-gnulib index 775d43e68d3..7fc0b5f4844 100755 --- a/admin/merge-gnulib +++ b/admin/merge-gnulib | |||
| @@ -34,7 +34,7 @@ GNULIB_MODULES=' | |||
| 34 | manywarnings mktime pselect pthread_sigmask readlink | 34 | manywarnings mktime pselect pthread_sigmask readlink |
| 35 | socklen stat-time stdalign stdarg stdbool stdio | 35 | socklen stat-time stdalign stdarg stdbool stdio |
| 36 | strftime strtoimax strtoumax symlink sys_stat | 36 | strftime strtoimax strtoumax symlink sys_stat |
| 37 | sys_time time timespec-add timespec-sub utimens | 37 | sys_time time timer-time timespec-add timespec-sub utimens |
| 38 | warnings | 38 | warnings |
| 39 | ' | 39 | ' |
| 40 | 40 | ||
diff --git a/configure.ac b/configure.ac index a6462f7959a..5a3aea763c0 100644 --- a/configure.ac +++ b/configure.ac | |||
| @@ -571,6 +571,9 @@ else | |||
| 571 | test "x$NON_GCC_TEST_OPTIONS" != x && CC="$CC $NON_GCC_TEST_OPTIONS" | 571 | test "x$NON_GCC_TEST_OPTIONS" != x && CC="$CC $NON_GCC_TEST_OPTIONS" |
| 572 | fi | 572 | fi |
| 573 | 573 | ||
| 574 | # Avoid gnulib's threadlib module, as we do threads our own way. | ||
| 575 | AC_DEFUN([gl_THREADLIB]) | ||
| 576 | |||
| 574 | # Initialize gnulib right after choosing the compiler. | 577 | # Initialize gnulib right after choosing the compiler. |
| 575 | gl_EARLY | 578 | gl_EARLY |
| 576 | 579 | ||
diff --git a/lib/gnulib.mk b/lib/gnulib.mk index d49eb4fdf7a..e79fe35622c 100644 --- a/lib/gnulib.mk +++ b/lib/gnulib.mk | |||
| @@ -21,7 +21,7 @@ | |||
| 21 | # the same distribution terms as the rest of that program. | 21 | # the same distribution terms as the rest of that program. |
| 22 | # | 22 | # |
| 23 | # Generated by gnulib-tool. | 23 | # Generated by gnulib-tool. |
| 24 | # 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=errno --avoid=fcntl --avoid=fcntl-h --avoid=fstat --avoid=msvc-inval --avoid=msvc-nothrow --avoid=raise --avoid=select --avoid=sigprocmask --avoid=sys_types --avoid=threadlib --makefile-name=gnulib.mk --conditional-dependencies --no-libtool --macro-prefix=gl --no-vc-files alloca-opt c-ctype c-strcase careadlinkat crypto/md5 crypto/sha1 crypto/sha256 crypto/sha512 dtoastr dtotimespec dup2 environ execinfo filemode getloadavg getopt-gnu gettime gettimeofday ignore-value intprops largefile lstat manywarnings mktime pselect pthread_sigmask readlink socklen stat-time stdalign stdarg stdbool stdio strftime strtoimax strtoumax symlink sys_stat sys_time time timespec-add timespec-sub utimens warnings | 24 | # 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=errno --avoid=fcntl --avoid=fcntl-h --avoid=fstat --avoid=msvc-inval --avoid=msvc-nothrow --avoid=raise --avoid=select --avoid=sigprocmask --avoid=sys_types --avoid=threadlib --makefile-name=gnulib.mk --conditional-dependencies --no-libtool --macro-prefix=gl --no-vc-files alloca-opt c-ctype c-strcase careadlinkat crypto/md5 crypto/sha1 crypto/sha256 crypto/sha512 dtoastr dtotimespec dup2 environ execinfo filemode getloadavg getopt-gnu gettime gettimeofday ignore-value intprops largefile lstat manywarnings mktime pselect pthread_sigmask readlink socklen stat-time stdalign stdarg stdbool stdio strftime strtoimax strtoumax symlink sys_stat sys_time time timer-time timespec-add timespec-sub utimens warnings |
| 25 | 25 | ||
| 26 | 26 | ||
| 27 | MOSTLYCLEANFILES += core *.stackdump | 27 | MOSTLYCLEANFILES += core *.stackdump |
diff --git a/m4/gnulib-comp.m4 b/m4/gnulib-comp.m4 index 0d73faee8d1..de2355d87c3 100644 --- a/m4/gnulib-comp.m4 +++ b/m4/gnulib-comp.m4 | |||
| @@ -111,6 +111,7 @@ AC_DEFUN([gl_EARLY], | |||
| 111 | # Code from module sys_time: | 111 | # Code from module sys_time: |
| 112 | # Code from module time: | 112 | # Code from module time: |
| 113 | # Code from module time_r: | 113 | # Code from module time_r: |
| 114 | # Code from module timer-time: | ||
| 114 | # Code from module timespec: | 115 | # Code from module timespec: |
| 115 | # Code from module timespec-add: | 116 | # Code from module timespec-add: |
| 116 | # Code from module timespec-sub: | 117 | # Code from module timespec-sub: |
| @@ -263,6 +264,7 @@ AC_DEFUN([gl_INIT], | |||
| 263 | gl_PREREQ_TIME_R | 264 | gl_PREREQ_TIME_R |
| 264 | fi | 265 | fi |
| 265 | gl_TIME_MODULE_INDICATOR([time_r]) | 266 | gl_TIME_MODULE_INDICATOR([time_r]) |
| 267 | gl_TIMER_TIME | ||
| 266 | gl_TIMESPEC | 268 | gl_TIMESPEC |
| 267 | gl_UNISTD_H | 269 | gl_UNISTD_H |
| 268 | gl_UTIMENS | 270 | gl_UTIMENS |
| @@ -661,6 +663,7 @@ AC_DEFUN([gl_FILE_LIST], [ | |||
| 661 | m4/sys_time_h.m4 | 663 | m4/sys_time_h.m4 |
| 662 | m4/time_h.m4 | 664 | m4/time_h.m4 |
| 663 | m4/time_r.m4 | 665 | m4/time_r.m4 |
| 666 | m4/timer_time.m4 | ||
| 664 | m4/timespec.m4 | 667 | m4/timespec.m4 |
| 665 | m4/tm_gmtoff.m4 | 668 | m4/tm_gmtoff.m4 |
| 666 | m4/unistd_h.m4 | 669 | m4/unistd_h.m4 |
diff --git a/m4/timer_time.m4 b/m4/timer_time.m4 new file mode 100644 index 00000000000..bc84554b789 --- /dev/null +++ b/m4/timer_time.m4 | |||
| @@ -0,0 +1,39 @@ | |||
| 1 | # timer_time.m4 serial 2 | ||
| 2 | dnl Copyright (C) 2011-2012 Free Software Foundation, Inc. | ||
| 3 | dnl This file is free software; the Free Software Foundation | ||
| 4 | dnl gives unlimited permission to copy and/or distribute it, | ||
| 5 | dnl with or without modifications, as long as this notice is preserved. | ||
| 6 | |||
| 7 | # Check for timer_settime, and set LIB_TIMER_TIME. | ||
| 8 | |||
| 9 | AC_DEFUN([gl_TIMER_TIME], | ||
| 10 | [ | ||
| 11 | dnl Based on clock_time.m4. See details there. | ||
| 12 | |||
| 13 | AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS]) | ||
| 14 | AC_REQUIRE([gl_THREADLIB]) | ||
| 15 | |||
| 16 | LIB_TIMER_TIME= | ||
| 17 | AC_SUBST([LIB_TIMER_TIME]) | ||
| 18 | gl_saved_libs=$LIBS | ||
| 19 | AC_SEARCH_LIBS([timer_settime], [rt posix4], | ||
| 20 | [test "$ac_cv_search_timer_settime" = "none required" || | ||
| 21 | LIB_TIMER_TIME=$ac_cv_search_timer_settime]) | ||
| 22 | dnl GLIBC uses threads to emulate posix timers when kernel support | ||
| 23 | dnl is not available (like Linux < 2.6 or when used with kFreeBSD) | ||
| 24 | dnl Now the pthread lib is linked automatically in the normal case, | ||
| 25 | dnl but when linking statically, it needs to be explicitly specified. | ||
| 26 | AC_EGREP_CPP([Thread], | ||
| 27 | [ | ||
| 28 | #include <features.h> | ||
| 29 | #ifdef __GNU_LIBRARY__ | ||
| 30 | #if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 2) || (__GLIBC__ > 2)) \ | ||
| 31 | && !defined __UCLIBC__ | ||
| 32 | Thread emulation available | ||
| 33 | #endif | ||
| 34 | #endif | ||
| 35 | ], | ||
| 36 | [LIB_TIMER_TIME="$LIB_TIMER_TIME $LIBMULTITHREAD"]) | ||
| 37 | AC_CHECK_FUNCS([timer_settime]) | ||
| 38 | LIBS=$gl_saved_libs | ||
| 39 | ]) | ||
diff --git a/src/ChangeLog b/src/ChangeLog index 445090fb2a1..c920f091063 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,10 @@ | |||
| 1 | 2012-09-27 Paul Eggert <eggert@cs.ucla.edu> | ||
| 2 | |||
| 3 | Check more robustly for timer_settime. | ||
| 4 | * atimer.c (alarm_timer, alarm_timer_ok, set_alarm, init_atimer): | ||
| 5 | Use HAVE_TIMER_SETTIME, not SIGEV_SIGNAL, to decide whether to | ||
| 6 | call timer_settime. | ||
| 7 | |||
| 1 | 2012-09-26 Tomohiro Matsuyama <tomo@cx4a.org> | 8 | 2012-09-26 Tomohiro Matsuyama <tomo@cx4a.org> |
| 2 | 9 | ||
| 3 | * profiler.c (Fprofiler_cpu_start): Remove unnecessary flag SA_SIGINFO. | 10 | * profiler.c (Fprofiler_cpu_start): Remove unnecessary flag SA_SIGINFO. |
diff --git a/src/atimer.c b/src/atimer.c index 8bb80445bde..048c62798ef 100644 --- a/src/atimer.c +++ b/src/atimer.c | |||
| @@ -42,7 +42,7 @@ static struct atimer *atimers; | |||
| 42 | 42 | ||
| 43 | /* The alarm timer and whether it was properly initialized, if | 43 | /* The alarm timer and whether it was properly initialized, if |
| 44 | POSIX timers are available. */ | 44 | POSIX timers are available. */ |
| 45 | #ifdef SIGEV_SIGNAL | 45 | #ifdef HAVE_TIMER_SETTIME |
| 46 | static timer_t alarm_timer; | 46 | static timer_t alarm_timer; |
| 47 | static bool alarm_timer_ok; | 47 | static bool alarm_timer_ok; |
| 48 | #endif | 48 | #endif |
| @@ -296,7 +296,7 @@ set_alarm (void) | |||
| 296 | #endif | 296 | #endif |
| 297 | EMACS_TIME now, interval; | 297 | EMACS_TIME now, interval; |
| 298 | 298 | ||
| 299 | #ifdef SIGEV_SIGNAL | 299 | #ifdef HAVE_TIMER_SETTIME |
| 300 | if (alarm_timer_ok) | 300 | if (alarm_timer_ok) |
| 301 | { | 301 | { |
| 302 | struct itimerspec ispec; | 302 | struct itimerspec ispec; |
| @@ -416,7 +416,7 @@ void | |||
| 416 | init_atimer (void) | 416 | init_atimer (void) |
| 417 | { | 417 | { |
| 418 | struct sigaction action; | 418 | struct sigaction action; |
| 419 | #ifdef SIGEV_SIGNAL | 419 | #ifdef HAVE_TIMER_SETTIME |
| 420 | struct sigevent sigev; | 420 | struct sigevent sigev; |
| 421 | sigev.sigev_notify = SIGEV_SIGNAL; | 421 | sigev.sigev_notify = SIGEV_SIGNAL; |
| 422 | sigev.sigev_signo = SIGALRM; | 422 | sigev.sigev_signo = SIGALRM; |