From: Ross Paterson Date: Wed, 9 Aug 2006 12:42:59 +0000 (+0000) Subject: move altzone test from ghc to base package X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=2a4f932c2e4b6fe1ca9b6c258d3860a1e8f23842;p=ghc-base.git move altzone test from ghc to base package --- diff --git a/aclocal.m4 b/aclocal.m4 index 49ad919..16d8bb9 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -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 +# include +#else +# if HAVE_SYS_TIME_H +# include +# else +# include +# 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 diff --git a/configure.ac b/configure.ac index be50d70..e91432f 100644 --- a/configure.ac +++ b/configure.ac @@ -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 and +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)