[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 4/7] configure-time support for ns-resolution time stamps
From: |
Paul Eggert |
Subject: |
[PATCH 4/7] configure-time support for ns-resolution time stamps |
Date: |
Fri, 01 Jul 2011 01:15:20 -0700 |
User-agent: |
Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.17) Gecko/20110516 Thunderbird/3.1.10 |
This is the hand-written part of the gnulib/autoconf stuff for
nanosecond-resolution time stamps.
Add configure-time support for nanosecond-resolution time stamps.
* Makefile.in (GNULIB_MODULES): Add dtotimespec, gettime, gettimeofday,
pselect, stat-time, strtoimax, sys_time, time, timespec-add,
timespec-sub, utimens.
* configure.in (gl_ASSERT_NO_GNULIB_POSIXCHECK)
(gl_ASSERT_NO_GNULIB_TESTS, gl_INIT): Move these up earlier, so
that the new clock stuff doesn't clash with RSVG_LIBS.
(AC_CHECK_HEADERS): Don't check for sys/select.h, sys/time.h, utime.h,
as gnulib does that for us now.
(emacs_cv_struct_utimbuf): Remove; gnulib does this.
=== modified file 'Makefile.in'
--- Makefile.in 2011-06-25 08:40:38 +0000
+++ Makefile.in 2011-07-01 05:27:05 +0000
@@ -334,9 +334,11 @@
GNULIB_MODULES = \
alloca-opt \
careadlinkat crypto/md5 crypto/sha1 crypto/sha256 crypto/sha512 dtoastr \
- dup2 \
- filemode getloadavg getopt-gnu ignore-value intprops lstat mktime readlink \
- socklen stdarg stdio strftime strtoumax symlink sys_stat
+ dtotimespec dup2 filemode getloadavg getopt-gnu gettime gettimeofday \
+ ignore-value intprops lstat mktime pselect readlink socklen \
+ stat-time stdarg stdio strftime strtoimax strtoumax \
+ symlink sys_stat sys_time \
+ time timespec-add timespec-sub utimens
GNULIB_TOOL_FLAGS = \
--conditional-dependencies --import --no-changelog --no-vc-files \
--makefile-name=gnulib.mk
=== modified file 'configure.in'
--- configure.in 2011-06-30 14:32:07 +0000
+++ configure.in 2011-07-01 05:24:03 +0000
@@ -1103,6 +1103,13 @@
AC_SUBST(CRT_DIR)
+# Configure gnulib before invoking PKG_CHECK_MODULES, as the latter might
+# for example add -lrt to RSVG_LIBS, which would then cause gnulib to
incorrectly
+# conclude that -lrt is not needed to link clock_gettime.
+gl_ASSERT_NO_GNULIB_POSIXCHECK
+gl_ASSERT_NO_GNULIB_TESTS
+gl_INIT
+
dnl This function definition taken from Gnome 2.0
dnl PKG_CHECK_MODULES(GSTUFF, gtk+-2.0 >= 1.3 glib = 1.3.4, action-if,
action-not)
dnl defines GSTUFF_LIBS, GSTUFF_CFLAGS, see pkg-config man page
@@ -1210,7 +1217,7 @@
fi
dnl checks for header files
-AC_CHECK_HEADERS(sys/select.h sys/time.h unistd.h utime.h \
+AC_CHECK_HEADERS(unistd.h \
linux/version.h sys/systeminfo.h limits.h \
stdio_ext.h fcntl.h coff.h pty.h sys/mman.h \
sys/vlimit.h sys/resource.h locale.h sys/_mbstate_t.h \
@@ -1243,26 +1250,6 @@
fi
AC_HEADER_SYS_WAIT
-dnl Some systems have utime.h but don't declare the struct anyplace.
-AC_CACHE_CHECK(for struct utimbuf, emacs_cv_struct_utimbuf,
-AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#ifdef TIME_WITH_SYS_TIME
-#include <sys/time.h>
-#include <time.h>
-#else
-#ifdef HAVE_SYS_TIME_H
-#include <sys/time.h>
-#else
-#include <time.h>
-#endif
-#endif
-#ifdef HAVE_UTIME_H
-#include <utime.h>
-#endif]], [[static struct utimbuf x; x.actime = x.modtime;]])],
- emacs_cv_struct_utimbuf=yes, emacs_cv_struct_utimbuf=no))
-if test $emacs_cv_struct_utimbuf = yes; then
- AC_DEFINE(HAVE_STRUCT_UTIMBUF, 1, [Define to 1 if `struct utimbuf' is
declared by <utime.h>.])
-fi
-
dnl Check for speed_t typedef.
AC_CACHE_CHECK(for speed_t, emacs_cv_speed_t,
[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <termios.h>]], [[speed_t x =
1;]])],
@@ -1272,23 +1259,6 @@
[Define to 1 if `speed_t' is declared by <termios.h>.])
fi
-AC_CACHE_CHECK(for struct timeval, emacs_cv_struct_timeval,
-AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#ifdef TIME_WITH_SYS_TIME
-#include <sys/time.h>
-#include <time.h>
-#else
-#ifdef HAVE_SYS_TIME_H
-#include <sys/time.h>
-#else
-#include <time.h>
-#endif
-#endif]], [[static struct timeval x; x.tv_sec = x.tv_usec;]])],
- emacs_cv_struct_timeval=yes, emacs_cv_struct_timeval=no))
-HAVE_TIMEVAL=$emacs_cv_struct_timeval
-if test $emacs_cv_struct_timeval = yes; then
- AC_DEFINE(HAVE_TIMEVAL, 1, [Define to 1 if `struct timeval' is declared by
<sys/time.h>.])
-fi
-
AC_CACHE_CHECK(for struct exception, emacs_cv_struct_exception,
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <math.h>]],
[[static struct exception x; x.arg1 = x.arg2 = x.retval; x.name = ""; x.type =
1;]])],
@@ -2701,7 +2671,7 @@
rename closedir mkdir rmdir sysinfo getrusage get_current_dir_name \
random lrand48 logb frexp fmod rint cbrt ftime setsid \
strerror fpathconf select euidaccess getpagesize tzset setlocale \
-utimes getrlimit setrlimit setpgid getcwd getwd shutdown getaddrinfo \
+getrlimit setrlimit setpgid getcwd getwd shutdown getaddrinfo \
__fpending mblen mbrlen mbsinit strsignal setitimer ualarm strchr strrchr \
sendto recvfrom getsockopt setsockopt getsockname getpeername \
gai_strerror mkstemp getline getdelim mremap memmove fsync sync \
@@ -2725,11 +2695,6 @@
AC_FUNC_GETPGRP
-# Configure gnulib.
-gl_ASSERT_NO_GNULIB_POSIXCHECK
-gl_ASSERT_NO_GNULIB_TESTS
-gl_INIT
-
# UNIX98 PTYs.
AC_CHECK_FUNCS(grantpt)
@@ -3019,33 +2984,6 @@
[Define to 1 if localtime caches TZ.])
fi
-if test "x$HAVE_TIMEVAL" = xyes; then
- AC_CHECK_FUNCS(gettimeofday)
- if test $ac_cv_func_gettimeofday = yes; then
- AC_CACHE_CHECK(whether gettimeofday can accept two arguments,
- emacs_cv_gettimeofday_two_arguments,
- [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
-#ifdef TIME_WITH_SYS_TIME
-#include <sys/time.h>
-#include <time.h>
-#else
-#ifdef HAVE_SYS_TIME_H
-#include <sys/time.h>
-#else
-#include <time.h>
-#endif
-#endif]],
- [[struct timeval time;
- gettimeofday (&time, 0);]])],
- emacs_cv_gettimeofday_two_arguments=yes,
- emacs_cv_gettimeofday_two_arguments=no)])
- if test $emacs_cv_gettimeofday_two_arguments = no; then
- AC_DEFINE(GETTIMEOFDAY_ONE_ARGUMENT, 1,
- [Define to 1 if gettimeofday accepts only one argument.])
- fi
- fi
-fi
-
ok_so_far=yes
AC_CHECK_FUNC(socket, , ok_so_far=no)
if test $ok_so_far = yes; then
- nanosecond-resolution time stamps, Paul Eggert, 2011/07/01
- [PATCH 1/7] gnulib substrate for ns-resolution time stamps, Paul Eggert, 2011/07/01
- Re: [PATCH 1/7] gnulib substrate for ns-resolution time stamps, Eli Zaretskii, 2011/07/01
- Re: [PATCH 1/7] gnulib substrate for ns-resolution time stamps, Eli Zaretskii, 2011/07/01
- Re: [PATCH 1/7] gnulib substrate for ns-resolution time stamps, Paul Eggert, 2011/07/01
- Re: [PATCH 1/7] gnulib substrate for ns-resolution time stamps, Eli Zaretskii, 2011/07/01
- Re: [PATCH 1/7] gnulib substrate for ns-resolution time stamps, Paul Eggert, 2011/07/01
- Re: [PATCH 1/7] gnulib substrate for ns-resolution time stamps, Eli Zaretskii, 2011/07/01
[PATCH 2/7] etc/NEWS patch for ns-resolution time stamps, Paul Eggert, 2011/07/01
[PATCH 3/7] Doc patches for ns-resolution time stamps, Paul Eggert, 2011/07/01
[PATCH 4/7] configure-time support for ns-resolution time stamps,
Paul Eggert <=
[PATCH 5/7] C-level support for ns-resolution time stamps, Paul Eggert, 2011/07/01
[PATCH 6/7] lib-src support for ns-resolution time stamps, Paul Eggert, 2011/07/01
[PATCH 7/7] Lisp-level support for ns-resolution time stamps, Paul Eggert, 2011/07/01
Re: nanosecond-resolution time stamps, Stefan Monnier, 2011/07/01