so that we don't attempt to redefine the libc mktime.
#undef HAVE_SETSID
#undef HAVE_FPATHCONF
#undef HAVE_SELECT
-#undef HAVE_MKTIME
#undef HAVE_EUIDACCESS
#undef HAVE_GETPAGESIZE
#undef HAVE_TZSET
#undef HAVE_AIX_SMT_EXP
+#undef HAVE_MKTIME
+#if HAVE_MKTIME && ! defined (_NEXT_SOURCE)
+#define mktime emacs_mktime
+#endif
+
/* Define if you have the ANSI `strerror' function.
Otherwise you must have the variable `char *sys_errlist[]'. */
#undef HAVE_STRERROR