acinclude.m4
changeset 65 e6871fda6fc9
parent 56 3bf928955fc5
child 131 f67d47083e3a
--- a/acinclude.m4	Mon Jan 05 23:44:41 2004 +0000
+++ b/acinclude.m4	Thu Jan 08 14:43:02 2004 +0000
@@ -217,3 +217,32 @@
 ])
 
 
+dnl ***************
+dnl Timezone checks
+dnl ***************
+AC_DEFUN([LM_CHECK_TIMEZONE],[
+AC_CACHE_CHECK(for tm_gmtoff in struct tm, ac_cv_struct_tm_gmtoff,
+	AC_TRY_COMPILE([
+		#include <time.h>
+		], [
+		struct tm tm;
+		tm.tm_gmtoff = 1;
+		], ac_cv_struct_tm_gmtoff=yes, ac_cv_struct_tm_gmtoff=no))
+if test $ac_cv_struct_tm_gmtoff = yes; then
+	AC_DEFINE(HAVE_TM_GMTOFF, 1, [Define if struct tm has a tm_gmtoff member])
+else
+	AC_CACHE_CHECK(for timezone variable, ac_cv_var_timezone,
+		AC_TRY_COMPILE([
+			#include <time.h>
+		], [
+			timezone = 1;
+		], ac_cv_var_timezone=yes, ac_cv_var_timezone=no))
+	if test $ac_cv_var_timezone = yes; then
+		AC_DEFINE(HAVE_TIMEZONE, 1, [Define if libc defines a timezone variable])
+	else
+		AC_ERROR(unable to find a way to determine timezone)
+	fi
+fi
+])
+
+