libreplace: move "struct timespec" checks into libreplace (where timespec is already...
authorGünther Deschner <gd@samba.org>
Thu, 3 Mar 2011 15:26:48 +0000 (16:26 +0100)
committerGünther Deschner <gd@samba.org>
Thu, 3 Mar 2011 23:28:27 +0000 (00:28 +0100)
Bjoern, Metze, please check.

Guenther

lib/replace/libreplace.m4
lib/replace/system/time.h
lib/replace/wscript
source3/configure.in
source3/include/includes.h
source3/wscript

index 24fc5cdafe2a7cd4dc71852fefef41edaed411e3..808d5d1c0662cb46c423a73a0fa91583730d3d1b 100644 (file)
@@ -303,6 +303,29 @@ if test x$libreplace_cv_have_clock_gettime = xyes ; then
        SMB_CHECK_CLOCK_ID(CLOCK_REALTIME)
 fi
 
+AC_CACHE_CHECK([for struct timespec type],libreplace_cv_struct_timespec, [
+    AC_TRY_COMPILE([
+#include <sys/types.h>
+#if STDC_HEADERS
+#include <stdlib.h>
+#include <stddef.h>
+#endif
+#if TIME_WITH_SYS_TIME
+# include <sys/time.h>
+# include <time.h>
+#else
+# if HAVE_SYS_TIME_H
+#  include <sys/time.h>
+# else
+#  include <time.h>
+# endif
+#endif
+],[struct timespec ts;],
+       libreplace_cv_struct_timespec=yes,libreplace_cv_struct_timespec=no)])
+if test x"$libreplace_cv_struct_timespec" = x"yes"; then
+   AC_DEFINE(HAVE_STRUCT_TIMESPEC,1,[Whether we have struct timespec])
+fi
+
 AC_CHECK_FUNCS([printf memset memcpy],,[AC_MSG_ERROR([Required function not found])])
 
 echo "LIBREPLACE_BROKEN_CHECKS: END"
index 5fce4dbc45b4203fe8a79c732692d3fd90aeb51e..b6d260928907644fe19f279873fa2a168dc4f1b2 100644 (file)
@@ -46,6 +46,13 @@ struct utimbuf {
 };
 #endif
 
+#ifndef HAVE_STRUCT_TIMESPEC
+struct timespec {
+       time_t tv_sec;            /* Seconds.  */
+       long tv_nsec;           /* Nanoseconds.  */
+};
+#endif
+
 #ifndef HAVE_MKTIME
 /* define is in "replace.h" */
 time_t rep_mktime(struct tm *t);
index d0bbe9615975b7191a9c3edab7cf7f9a760adaff..c24d6e76b3155263df3eaf498d8c23c134a9ae93 100644 (file)
@@ -219,6 +219,7 @@ def configure(conf):
                            'HAVE_%s' % c,
                            msg='Checking whether the clock_gettime clock ID %s is available' % c)
 
+    conf.CHECK_TYPE('struct timespec', headers='sys/time.h time.h')
 
     # these headers need to be tested as a group on freebsd
     conf.CHECK_HEADERS(headers='sys/socket.h net/if.h', together=True)
index b4794f28a2fa7b22cc8e264b0c711a749d245020..8d32a1baca3b78999b7f4ec55b74d97b245fd37f 100644 (file)
@@ -951,29 +951,6 @@ if test x"$samba_cv_struct_sigevent" = x"yes"; then
        [#include <signal.h>])
 fi
 
-AC_CACHE_CHECK([for struct timespec type],samba_cv_struct_timespec, [
-    AC_TRY_COMPILE([
-#include <sys/types.h>
-#if STDC_HEADERS
-#include <stdlib.h>
-#include <stddef.h>
-#endif
-#if TIME_WITH_SYS_TIME
-# include <sys/time.h>
-# include <time.h>
-#else
-# if HAVE_SYS_TIME_H
-#  include <sys/time.h>
-# else
-#  include <time.h>
-# endif
-#endif
-],[struct timespec ts;],
-       samba_cv_struct_timespec=yes,samba_cv_struct_timespec=no)])
-if test x"$samba_cv_struct_timespec" = x"yes"; then
-   AC_DEFINE(HAVE_STRUCT_TIMESPEC,1,[Whether we have struct timespec])
-fi
-
 # and glibc has setresuid under linux but the function does
 # nothing until kernel 2.1.44! very dumb.
 AC_CACHE_CHECK([for real setresuid],samba_cv_have_setresuid,[
index 9d55c4a7472a19bacf7ad193f59b94f0769c986d..d715db6354aeb262f829b4112d973997809d68f9 100644 (file)
@@ -425,14 +425,6 @@ typedef long blksize_t;
 typedef long blkcnt_t;
 #endif
 
-#ifndef HAVE_STRUCT_TIMESPEC
-struct timespec {
-       time_t tv_sec;            /* Seconds.  */
-       long tv_nsec;           /* Nanoseconds.  */
-};
-#endif
-
-
 /*
  * Type for stat structure.
  */
index 90a541ba95bf9eacfee9503a4f1d482aacba6037..2082a8bd056e465a9071d47bc56fc3da44f6a727 100644 (file)
@@ -290,8 +290,6 @@ __sys_llseek syslog _telldir __telldir telldir64 textdomain timegm
 utimensat vsyslog _write __write __xstat
 ''')
 
-    conf.CHECK_TYPE('struct timespec', headers='sys/time.h time.h')
-
     conf.CHECK_SAMBA3_CHARSET() # see build/charset.py
 
     # FIXME: these should be tests for features, but the old build system just