move altzone test from ghc to base package
authorRoss Paterson <ross@soi.city.ac.uk>
Wed, 9 Aug 2006 12:42:59 +0000 (12:42 +0000)
committerRoss Paterson <ross@soi.city.ac.uk>
Wed, 9 Aug 2006 12:42:59 +0000 (12:42 +0000)
aclocal.m4
configure.ac

index 49ad919..16d8bb9 100644 (file)
@@ -1,3 +1,24 @@
+# FP_DECL_ALTZONE
+# ---------------
+# Defines HAVE_DECL_ALTZONE to 1 if declared, 0 otherwise.
+#
+# Used by base package.
+AC_DEFUN([FP_DECL_ALTZONE],
+[AC_REQUIRE([AC_HEADER_TIME])dnl
+AC_CHECK_HEADERS([sys/time.h])
+AC_CHECK_DECLS([altzone], [], [],[#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])
+])# FP_DECL_ALTZONE
+
+
 # FP_COMPUTE_INT(EXPRESSION, VARIABLE, INCLUDES, IF-FAILS)
 # --------------------------------------------------------
 # Assign VARIABLE the value of the compile-time EXPRESSION using INCLUDES for
index be50d70..e91432f 100644 (file)
@@ -29,6 +29,15 @@ AC_CHECK_FUNCS([ftime gmtime_r localtime_r lstat readdir_r])
 
 AC_CHECK_FUNCS([_chsize ftruncate])
 
+dnl ** check if it is safe to include both <time.h> and <sys/time.h>
+AC_HEADER_TIME
+
+dnl ** how do we get a timezone name, and UTC offset ?
+AC_STRUCT_TIMEZONE
+
+dnl ** do we have altzone?
+FP_DECL_ALTZONE
+
 # map standard C types and ISO types to Haskell types
 FPTOOLS_CHECK_HTYPE(char)
 FPTOOLS_CHECK_HTYPE(signed char)