Tag
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39
dnl From Jim Meyering.
dnl FIXME: this should migrate into libit.
dnl This little macro is solely so AM_FUNC_MKTIME can require
dnl that AC_CHECK_HEADERS(sys/time.h) has been run.
AC_DEFUN(AC_HEADER_SYS_TIME_H,
[AC_CHECK_HEADERS(sys/time.h)])
AC_DEFUN(AM_FUNC_MKTIME,
[AC_REQUIRE([AC_HEADER_TIME])dnl
AC_REQUIRE([AC_HEADER_SYS_TIME_H])dnl
AC_CACHE_CHECK([for working mktime], am_cv_func_working_mktime,
[AC_TRY_RUN([/* Test program from Tony Leneis (tony@plaza.ds.adp.com). */
#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
int
main ()
{
time_t today = time (0);
struct tm *local = localtime (&today);
exit (mktime (local) != today);
}
],
am_cv_func_working_mktime=yes, am_cv_func_working_mktime=no,
dnl When crosscompiling, assume mktime is missing or broken.
am_cv_func_working_mktime=no)
])
if test $am_cv_func_working_mktime = no; then
LIBOBJS="$LIBOBJS mktime.o"
fi
])