diff options
author | Stefan Metzmacher <metze@samba.org> | 2006-09-13 10:51:26 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 14:18:33 -0500 |
commit | 4c0b19277a495b33869f447166d03a0e1e163b72 (patch) | |
tree | 5d9703aea46fcc7882b154ba9fad7722fa9c8ffb /source4/lib | |
parent | f425072ed961f8cb832c8515ed71766142f07138 (diff) | |
download | samba-4c0b19277a495b33869f447166d03a0e1e163b72.tar.gz samba-4c0b19277a495b33869f447166d03a0e1e163b72.tar.bz2 samba-4c0b19277a495b33869f447166d03a0e1e163b72.zip |
r18460: split out timegm test and only add timegm.o when needed
metze
(This used to be commit f9bff4dbdad8c7acc649d13a5666b58967bf5d92)
Diffstat (limited to 'source4/lib')
-rw-r--r-- | source4/lib/replace/libreplace.m4 | 9 | ||||
-rw-r--r-- | source4/lib/replace/timegm.c | 14 | ||||
-rw-r--r-- | source4/lib/replace/timegm.m4 | 1 |
3 files changed, 7 insertions, 17 deletions
diff --git a/source4/lib/replace/libreplace.m4 b/source4/lib/replace/libreplace.m4 index 3a40b39da2..8649a50bba 100644 --- a/source4/lib/replace/libreplace.m4 +++ b/source4/lib/replace/libreplace.m4 @@ -11,7 +11,7 @@ done LIBREPLACEOBJ="replace.o" AC_SUBST(LIBREPLACEOBJ) -LIBREPLACEOBJ="${LIBREPLACEOBJ} snprintf.o timegm.o" +LIBREPLACEOBJ="${LIBREPLACEOBJ} snprintf.o" dnl stop the C89 attempt by autoconf - if autoconf detects -Ae it will enable it dnl which conflicts with C99 on HPUX @@ -279,7 +279,7 @@ AC_CHECK_HEADERS([sys/param.h limits.h]) AC_CHECK_TYPE(comparison_fn_t, [AC_DEFINE(HAVE_COMPARISON_FN_T, 1,[Whether or not we have comparison_fn_t])]) -AC_CHECK_FUNCS(timegm strnlen setenv) +AC_CHECK_FUNCS(strnlen setenv) AC_CHECK_FUNCS(strtoull __strtoull strtouq strtoll __strtoll strtoq) # this test disabled as we don't actually need __VA_ARGS__ yet @@ -338,12 +338,13 @@ if test x"$samba_cv_volatile" = x"yes"; then AC_DEFINE(HAVE_VOLATILE, 1, [Whether the C compiler understands volatile]) fi +m4_include(system/config.m4) + m4_include(dlfcn.m4) m4_include(getpass.m4) m4_include(win32.m4) +m4_include(timegm.m4) m4_include(repdir.m4) -m4_include(system/config.m4) - AC_CHECK_FUNCS([syslog memset setnetgrent getnetgrent endnetgrent memcpy],, [AC_MSG_ERROR([Required function not found])]) diff --git a/source4/lib/replace/timegm.c b/source4/lib/replace/timegm.c index bd20da703f..ff90626d44 100644 --- a/source4/lib/replace/timegm.c +++ b/source4/lib/replace/timegm.c @@ -36,17 +36,7 @@ */ #include "replace.h" -#include <stdlib.h> - -#ifndef HAVE_TIMEGM - -#ifdef HAVE_SYS_TIME_H -#include <sys/time.h> -#endif - -#ifdef HAVE_TIME_H -#include <time.h> -#endif +#include "system/time.h" static int is_leap(unsigned y) { @@ -76,5 +66,3 @@ time_t timegm(struct tm *tm) res += tm->tm_sec; return res; } - -#endif /* HAVE_TIMEGM */ diff --git a/source4/lib/replace/timegm.m4 b/source4/lib/replace/timegm.m4 new file mode 100644 index 0000000000..59f3ae0521 --- /dev/null +++ b/source4/lib/replace/timegm.m4 @@ -0,0 +1 @@ +AC_CHECK_FUNCS(timegm,[],[LIBREPLACEOBJ="${LIBREPLACEOBJ} timegm.o"]) |