- AC_CHECK_DECLS(gmtime_r,,,[
-#ifdef HAVE_TIME_H
-#include <time.h>
-#endif
-])
- AC_CHECK_FUNCS(gmtime_r)
+ AC_REQUIRE([gl_TIME_R])
+ AC_REQUIRE([gl_FUNC_MKTIME])
+ if test $ac_cv_func_working_mktime = yes; then
+ AC_CHECK_FUNC(__mktime_internal, ,
+ [# mktime works but it doesn't export __mktime_internal,
+ # so we need to substitute our own mktime implementation.
+ AC_LIBOBJ([mktime])
+ AC_DEFINE([mktime], [rpl_mktime],
+ [Define to rpl_mktime if the replacement function should be used.])
+ gl_PREREQ_MKTIME])
+ fi