emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] /srv/bzr/emacs/trunk r110212: Check more robustly for time


From: Paul Eggert
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r110212: Check more robustly for timer_settime.
Date: Wed, 26 Sep 2012 18:06:23 -0700
User-agent: Bazaar (2.5.0)

------------------------------------------------------------
revno: 110212
committer: Paul Eggert <address@hidden>
branch nick: trunk
timestamp: Wed 2012-09-26 18:06:23 -0700
message:
  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.
added:
  m4/timer_time.m4
modified:
  ChangeLog
  admin/ChangeLog
  admin/merge-gnulib
  configure.ac
  lib/gnulib.mk
  m4/gnulib-comp.m4
  src/ChangeLog
  src/atimer.c
=== modified file 'ChangeLog'
--- a/ChangeLog 2012-09-26 15:19:10 +0000
+++ b/ChangeLog 2012-09-27 01:06:23 +0000
@@ -1,3 +1,11 @@
+2012-09-27  Paul Eggert  <address@hidden>
+
+       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>.
+       * configure.ac (gl_THREADLIB): Define to empty, since Emacs
+       does threads its own way.
+
 2012-09-23  Paul Eggert  <address@hidden>
 
        * Makefile.in (bootstrap): Set MAKEFILE_NAME when building Makefile,

=== modified file 'admin/ChangeLog'
--- a/admin/ChangeLog   2012-09-26 22:21:16 +0000
+++ b/admin/ChangeLog   2012-09-27 01:06:23 +0000
@@ -1,3 +1,8 @@
+2012-09-27  Paul Eggert  <address@hidden>
+
+       Check more robustly for timer_settime.
+       * merge-gnulib (GNULIB_MODULES): Add timer-time.
+
 2012-09-26  Juanma Barranquero  <address@hidden>
 
        * unidata/BidiMirroring.txt:

=== modified file 'admin/merge-gnulib'
--- a/admin/merge-gnulib        2012-08-25 04:04:08 +0000
+++ b/admin/merge-gnulib        2012-09-27 01:06:23 +0000
@@ -34,7 +34,7 @@
   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
+  sys_time time timer-time timespec-add timespec-sub utimens
   warnings
 '
 

=== modified file 'configure.ac'
--- a/configure.ac      2012-09-18 18:13:01 +0000
+++ b/configure.ac      2012-09-27 01:06:23 +0000
@@ -571,6 +571,9 @@
   test "x$NON_GCC_TEST_OPTIONS" != x && CC="$CC $NON_GCC_TEST_OPTIONS"
 fi
 
+# Avoid gnulib's threadlib module, as we do threads our own way.
+AC_DEFUN([gl_THREADLIB])
+
 # Initialize gnulib right after choosing the compiler.
 gl_EARLY
 

=== modified file 'lib/gnulib.mk'
--- a/lib/gnulib.mk     2012-08-28 16:01:59 +0000
+++ b/lib/gnulib.mk     2012-09-27 01:06:23 +0000
@@ -21,7 +21,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=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
+# 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
 
 
 MOSTLYCLEANFILES += core *.stackdump

=== modified file 'm4/gnulib-comp.m4'
--- a/m4/gnulib-comp.m4 2012-08-25 04:04:08 +0000
+++ b/m4/gnulib-comp.m4 2012-09-27 01:06:23 +0000
@@ -111,6 +111,7 @@
   # Code from module sys_time:
   # Code from module time:
   # Code from module time_r:
+  # Code from module timer-time:
   # Code from module timespec:
   # Code from module timespec-add:
   # Code from module timespec-sub:
@@ -263,6 +264,7 @@
     gl_PREREQ_TIME_R
   fi
   gl_TIME_MODULE_INDICATOR([time_r])
+  gl_TIMER_TIME
   gl_TIMESPEC
   gl_UNISTD_H
   gl_UTIMENS
@@ -661,6 +663,7 @@
   m4/sys_time_h.m4
   m4/time_h.m4
   m4/time_r.m4
+  m4/timer_time.m4
   m4/timespec.m4
   m4/tm_gmtoff.m4
   m4/unistd_h.m4

=== added file 'm4/timer_time.m4'
--- a/m4/timer_time.m4  1970-01-01 00:00:00 +0000
+++ b/m4/timer_time.m4  2012-09-27 01:06:23 +0000
@@ -0,0 +1,39 @@
+# timer_time.m4 serial 2
+dnl Copyright (C) 2011-2012 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.
+
+# Check for timer_settime, and set LIB_TIMER_TIME.
+
+AC_DEFUN([gl_TIMER_TIME],
+[
+  dnl Based on clock_time.m4. See details there.
+
+  AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
+  AC_REQUIRE([gl_THREADLIB])
+
+  LIB_TIMER_TIME=
+  AC_SUBST([LIB_TIMER_TIME])
+  gl_saved_libs=$LIBS
+    AC_SEARCH_LIBS([timer_settime], [rt posix4],
+                   [test "$ac_cv_search_timer_settime" = "none required" ||
+                    LIB_TIMER_TIME=$ac_cv_search_timer_settime])
+    dnl GLIBC uses threads to emulate posix timers when kernel support
+    dnl is not available (like Linux < 2.6 or when used with kFreeBSD)
+    dnl Now the pthread lib is linked automatically in the normal case,
+    dnl but when linking statically, it needs to be explicitly specified.
+    AC_EGREP_CPP([Thread],
+      [
+#include <features.h>
+#ifdef __GNU_LIBRARY__
+ #if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 2) || (__GLIBC__ > 2)) \
+     && !defined __UCLIBC__
+  Thread emulation available
+ #endif
+#endif
+      ],
+      [LIB_TIMER_TIME="$LIB_TIMER_TIME $LIBMULTITHREAD"])
+    AC_CHECK_FUNCS([timer_settime])
+  LIBS=$gl_saved_libs
+])

=== modified file 'src/ChangeLog'
--- a/src/ChangeLog     2012-09-26 23:14:13 +0000
+++ b/src/ChangeLog     2012-09-27 01:06:23 +0000
@@ -1,3 +1,10 @@
+2012-09-27  Paul Eggert  <address@hidden>
+
+       Check more robustly for timer_settime.
+       * 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.
+
 2012-09-26  Tomohiro Matsuyama  <address@hidden>
 
        * profiler.c (Fprofiler_cpu_start): Remove unnecessary flag SA_SIGINFO.

=== modified file 'src/atimer.c'
--- a/src/atimer.c      2012-09-25 19:18:05 +0000
+++ b/src/atimer.c      2012-09-27 01:06:23 +0000
@@ -42,7 +42,7 @@
 
 /* The alarm timer and whether it was properly initialized, if
    POSIX timers are available.  */
-#ifdef SIGEV_SIGNAL
+#ifdef HAVE_TIMER_SETTIME
 static timer_t alarm_timer;
 static bool alarm_timer_ok;
 #endif
@@ -296,7 +296,7 @@
 #endif
       EMACS_TIME now, interval;
 
-#ifdef SIGEV_SIGNAL
+#ifdef HAVE_TIMER_SETTIME
       if (alarm_timer_ok)
        {
          struct itimerspec ispec;
@@ -416,7 +416,7 @@
 init_atimer (void)
 {
   struct sigaction action;
-#ifdef SIGEV_SIGNAL
+#ifdef HAVE_TIMER_SETTIME
   struct sigevent sigev;
   sigev.sigev_notify = SIGEV_SIGNAL;
   sigev.sigev_signo = SIGALRM;


reply via email to

[Prev in Thread] Current Thread [Next in Thread]