Author: metze Date: 2006-09-13 10:51:26 +0000 (Wed, 13 Sep 2006) New Revision: 18460
WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=18460 Log: split out timegm test and only add timegm.o when needed metze Added: branches/SAMBA_4_0/source/lib/replace/timegm.m4 Modified: branches/SAMBA_4_0/source/lib/replace/libreplace.m4 branches/SAMBA_4_0/source/lib/replace/timegm.c Changeset: Modified: branches/SAMBA_4_0/source/lib/replace/libreplace.m4 =================================================================== --- branches/SAMBA_4_0/source/lib/replace/libreplace.m4 2006-09-13 10:26:32 UTC (rev 18459) +++ branches/SAMBA_4_0/source/lib/replace/libreplace.m4 2006-09-13 10:51:26 UTC (rev 18460) @@ -11,7 +11,7 @@ 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_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 @@ 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])]) Modified: branches/SAMBA_4_0/source/lib/replace/timegm.c =================================================================== --- branches/SAMBA_4_0/source/lib/replace/timegm.c 2006-09-13 10:26:32 UTC (rev 18459) +++ branches/SAMBA_4_0/source/lib/replace/timegm.c 2006-09-13 10:51:26 UTC (rev 18460) @@ -36,18 +36,8 @@ */ #include "replace.h" -#include <stdlib.h> +#include "system/time.h" -#ifndef HAVE_TIMEGM - -#ifdef HAVE_SYS_TIME_H -#include <sys/time.h> -#endif - -#ifdef HAVE_TIME_H -#include <time.h> -#endif - static int is_leap(unsigned y) { y += 1900; @@ -76,5 +66,3 @@ res += tm->tm_sec; return res; } - -#endif /* HAVE_TIMEGM */ Added: branches/SAMBA_4_0/source/lib/replace/timegm.m4 =================================================================== --- branches/SAMBA_4_0/source/lib/replace/timegm.m4 2006-09-13 10:26:32 UTC (rev 18459) +++ branches/SAMBA_4_0/source/lib/replace/timegm.m4 2006-09-13 10:51:26 UTC (rev 18460) @@ -0,0 +1 @@ +AC_CHECK_FUNCS(timegm,[],[LIBREPLACEOBJ="${LIBREPLACEOBJ} timegm.o"])