#serial 1 # Copyright (C) 2005 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. AC_DEFUN([gl_FUNC_GETTIMEOFDAY], [ AC_LIBSOURCES([gettimeofday.c, gettimeofday.h]) gl_PREREQ_GETTIMEOFDAY AC_REPLACE_FUNCS(gettimeofday) ]) # Prerequisites for lib/gettimeofday.c AC_DEFUN([gl_PREREQ_GETTIMEOFDAY], [ AC_REQUIRE([AC_HEADER_TIME]) AC_CHECK_TYPE([suseconds_t], , [AC_DEFINE([suseconds_t], [int], [Define to `int' if `suseconds_t' is missing.]) ], [ # if TIME_WITH_SYS_TIME # include # include # else # if HAVE_SYS_TIME_H # include # else # include # endif # endif ]) AC_CACHE_CHECK([for struct timeval], fu_cv_sys_struct_timeval, [AC_TRY_COMPILE( [ # if TIME_WITH_SYS_TIME # include # include # else # if HAVE_SYS_TIME_H # include # else # include # endif # endif ], [static struct timeval x; x.tv_sec = x.tv_usec;], fu_cv_sys_struct_timeval=yes, fu_cv_sys_struct_timeval=no) ]) if test $fu_cv_sys_struct_timeval = yes; then AC_DEFINE(HAVE_STRUCT_TIMEVAL, 1, [Define if struct timeval is declared in or . ]) fi ])