diff --git a/acconfig.h b/acconfig.h
index 294da5ce9bffe8b0bb4465b878d7002e1f19a3fc..48027d63bf8724d424baa1b8c9016ddd804f40c0 100644
--- a/acconfig.h
+++ b/acconfig.h
@@ -54,6 +54,9 @@
 /* Define if compiler supports prototypes. */
 #define HAVE_PROTOTYPES 0
 
+/* Define if time.h or sys/time.h define the timezone variable */
+#undef HAVE_TIMEZONE
+
 /* Define if you have the WinExec function.  */
 #define HAVE_WINEXEC 0
 
diff --git a/aclocal.m4 b/aclocal.m4
index b442a354619bde8d098f105847856fed42032e6c..42aee424263eccfc0014afa8c85f1dfc2144b8cc 100644
--- a/aclocal.m4
+++ b/aclocal.m4
@@ -1,4 +1,4 @@
-dnl $Id: aclocal.m4,v 1.37 1999/01/26 09:59:18 sof Exp $
+dnl $Id: aclocal.m4,v 1.38 1999/02/08 11:16:17 sof Exp $
 dnl 
 dnl Extra autoconf macros for the Glasgow fptools
 dnl
@@ -6,6 +6,28 @@ dnl To be a good autoconf citizen, names of local macros have
 dnl prefixed with FPTOOLS_ to ensure we don't clash
 dnl with any pre-supplied autoconf ones.
 
+dnl
+dnl Is timezone around? (in a header file)
+dnl 
+AC_DEFUN(FPTOOLS_HAVE_TIMEZONE,
+[AC_CACHE_CHECK([timezone], fptools_cv_have_timezone,
+[AC_TRY_COMPILE([#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
+], [return timezone;], 
+fptools_cv_have_timezone=yes, fptools_cv_have_timezone=no)])
+if test "$fptools_cv_have_timezone" = yes; then
+  AC_DEFINE(HAVE_TIMEZONE)
+fi
+])
+
 dnl
 dnl Has timezone the type time_t or long (HP-UX 10.20 apparently
 dnl has `long'..)
@@ -23,7 +45,7 @@ AC_DEFUN(FPTOOLS_TYPE_TIMEZONE,
 # endif
 #endif
 
-extern time_t timezone;
+extern time_t timezone;	
 ],
 [int i;], fptools_cv_type_timezone=time_t, fptools_cv_type_timezone=long)])
 AC_DEFINE_UNQUOTED(TYPE_TIMEZONE, $fptools_cv_type_timezone)
diff --git a/configure.in b/configure.in
index 9124666bfeba5937c2b543968a90745863eb1ca9..6e174afec5166692d0877c092b5d4a0220df3ca3 100644
--- a/configure.in
+++ b/configure.in
@@ -470,6 +470,7 @@ dnl ** how do we get a timezone name, and UTC offset ?
 AC_STRUCT_TIMEZONE
 
 dnl ** what's the type of timezone?
+FPTOOLS_HAVE_TIMEZONE
 FPTOOLS_TYPE_TIMEZONE
 
 dnl ** do we have altzone?
diff --git a/ghc/lib/std/cbits/timezone.h b/ghc/lib/std/cbits/timezone.h
index 5050342c8de68923f035fc591c928dcf4804e5d1..65f69e3b2f22156b6e7dd6d3b2ca1185fc0b3809 100644
--- a/ghc/lib/std/cbits/timezone.h
+++ b/ghc/lib/std/cbits/timezone.h
@@ -1,7 +1,7 @@
 /* 
  * (c) The GRASP/AQUA Project, Glasgow University, 1994-1998
  *
- * $Id: timezone.h,v 1.4 1999/02/05 14:34:05 sof Exp $
+ * $Id: timezone.h,v 1.5 1999/02/08 11:16:20 sof Exp $
  *
  * Time-zone support header
  */
@@ -57,7 +57,7 @@ extern char *tzname[2];
 # endif /* ! HAVE_TZNAME */
 /* Get the offset in secs from UTC, if (struct tm) doesn't supply it. */
 
-#ifndef cygwin32_TARGET_OS
+#ifndef HAVE_TIMEZONE
 extern TYPE_TIMEZONE timezone;
 #endif
 
diff --git a/mk/config.h.in b/mk/config.h.in
index 580029c6dd4a1419c0116274d87d3a55d0af64c6..780f4910c3e0edbdeddd231811b9db1c005a5d75 100644
--- a/mk/config.h.in
+++ b/mk/config.h.in
@@ -105,6 +105,9 @@
 /* Define if compiler supports prototypes. */
 #define HAVE_PROTOTYPES 0
 
+/* Define if time.h or sys/time.h define the timezone variable */
+#undef HAVE_TIMEZONE
+
 /* Define if you have the WinExec function.  */
 #define HAVE_WINEXEC 0