diff --git a/configure.ac b/configure.ac
index 81c77dd5fd01166ed37d95c214a9ea57322c959e..0e161badae33895ba73bccb24c66fac816fb4614 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1321,6 +1321,7 @@ if test x$cross_compiling != xyes; then
    dnl failure, now disable the function
    AC_MSG_RESULT(no)
    ac_cv_func_gmtime_r="no"
+   AC_DEFINE(HAVE_GMTIME_R, 0, [if you have gmtime_r])
    ,
    dnl not invoked when crosscompiling)
 ])