File: timezone.m4

package info (click to toggle)
libtinymail 0.0.9-4
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 18,148 kB
  • ctags: 19,175
  • sloc: ansic: 151,565; xml: 20,145; sh: 9,245; makefile: 2,394; cs: 243; cpp: 141; python: 93; perl: 71
file content (36 lines) | stat: -rw-r--r-- 1,125 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
AC_DEFUN([AC_TNY_TIMEZONE_CHECK],
[

AC_CACHE_CHECK(for tm_gmtoff in struct tm, ac_cv_struct_tm_gmtoff,
	AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
		#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_COMPILE_IFELSE([AC_LANG_PROGRAM([[
			#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])
		AC_CACHE_CHECK(for altzone variable, ac_cv_var_altzone,
			AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
				#include <time.h>
			]], [[
				altzone = 1;
			]])],[ac_cv_var_altzone=yes],[ac_cv_var_altzone=no]))
		if test $ac_cv_var_altzone = yes; then
			AC_DEFINE(HAVE_ALTZONE, 1, [Define if libc defines an altzone variable])
		fi
	else
		AC_MSG_ERROR([unable to find a way to determine timezone])
	fi
fi

])