From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Paul Eggert Newsgroups: gmane.emacs.devel Subject: [PATCH 4/7] configure-time support for ns-resolution time stamps Date: Fri, 01 Jul 2011 01:15:20 -0700 Organization: UCLA Computer Science Department Message-ID: <4E0D8218.3060403@cs.ucla.edu> References: <4E0D704F.4070304@cs.ucla.edu> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1309509432 11675 80.91.229.12 (1 Jul 2011 08:37:12 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 1 Jul 2011 08:37:12 +0000 (UTC) To: Emacs Development Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Jul 01 10:37:08 2011 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1QcZDo-0004lA-Cf for ged-emacs-devel@m.gmane.org; Fri, 01 Jul 2011 10:37:08 +0200 Original-Received: from localhost ([::1]:37894 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QcZDn-0002gW-4D for ged-emacs-devel@m.gmane.org; Fri, 01 Jul 2011 04:37:07 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:56374) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QcYsn-0005Ra-Je for emacs-devel@gnu.org; Fri, 01 Jul 2011 04:15:26 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QcYsl-0001Lc-Mi for emacs-devel@gnu.org; Fri, 01 Jul 2011 04:15:25 -0400 Original-Received: from smtp.cs.ucla.edu ([131.179.128.62]:45698) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QcYsk-0001LS-Vy for emacs-devel@gnu.org; Fri, 01 Jul 2011 04:15:23 -0400 Original-Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp.cs.ucla.edu (Postfix) with ESMTP id EED1539E8106 for ; Fri, 1 Jul 2011 01:15:21 -0700 (PDT) X-Virus-Scanned: amavisd-new at smtp.cs.ucla.edu Original-Received: from smtp.cs.ucla.edu ([127.0.0.1]) by localhost (smtp.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id ZSqBYivLt3iP for ; Fri, 1 Jul 2011 01:15:21 -0700 (PDT) Original-Received: from [192.168.1.10] (pool-71-189-109-235.lsanca.fios.verizon.net [71.189.109.235]) by smtp.cs.ucla.edu (Postfix) with ESMTPSA id 4821C39E80F2 for ; Fri, 1 Jul 2011 01:15:21 -0700 (PDT) User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.17) Gecko/20110516 Thunderbird/3.1.10 In-Reply-To: <4E0D704F.4070304@cs.ucla.edu> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 131.179.128.62 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:141332 Archived-At: 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 -#include -#else -#ifdef HAVE_SYS_TIME_H -#include -#else -#include -#endif -#endif -#ifdef HAVE_UTIME_H -#include -#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 .]) -fi - dnl Check for speed_t typedef. AC_CACHE_CHECK(for speed_t, emacs_cv_speed_t, [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include ]], [[speed_t x = 1;]])], @@ -1272,23 +1259,6 @@ [Define to 1 if `speed_t' is declared by .]) fi -AC_CACHE_CHECK(for struct timeval, emacs_cv_struct_timeval, -AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#ifdef TIME_WITH_SYS_TIME -#include -#include -#else -#ifdef HAVE_SYS_TIME_H -#include -#else -#include -#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 .]) -fi - AC_CACHE_CHECK(for struct exception, emacs_cv_struct_exception, AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include ]], [[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 -#include -#else -#ifdef HAVE_SYS_TIME_H -#include -#else -#include -#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