From 36c7c208191a0fd34cf48bdfb4af66b4ab0ec594 Mon Sep 17 00:00:00 2001 From: Jay Berkenbilt Date: Sat, 17 Apr 2021 18:12:55 -0400 Subject: Fix timezone portability issue (fixes #515) --- configure.ac | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) (limited to 'configure.ac') diff --git a/configure.ac b/configure.ac index 7cf58123..a1c4e5fb 100644 --- a/configure.ac +++ b/configure.ac @@ -520,6 +520,35 @@ if test "$BUILDRULES" != "msvc"; then fi fi +AC_MSG_CHECKING(for tm_gmtoff in struct tm) +AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ + #include + ]],[[ + struct tm tm; + tm.tm_gmtoff = 1; + ]])], [qpdf_TM_GMTOFF=1], [qpdf_TM_GMTOFF=0]) +if test "$qpdf_TM_GMTOFF" = "1"; then + AC_MSG_RESULT(yes) + AC_DEFINE([HAVE_TM_GMTOFF], [1], [Whether struct tm has tm_gmtoff]) +else + AC_MSG_RESULT(no) +fi + +AC_MSG_CHECKING(for extern long timezone) +AC_LINK_IFELSE([AC_LANG_PROGRAM([[ + #include + #include + ]],[[ + tzset(); + printf("%ld\n", timezone); + ]])], [qpdf_EXTERN_LONG_TIMEZONE=1], [qpdf_EXTERN_LONG_TIMEZONE=0]) +if test "$qpdf_EXTERN_LONG_TIMEZONE" = "1"; then + AC_MSG_RESULT(yes) + AC_DEFINE([HAVE_EXTERN_LONG_TIMEZONE], [1], [Whether extern long timezone is available]) +else + AC_MSG_RESULT(no) +fi + LL_FMT="" oCFLAGS=$CFLAGS CFLAGS="$WFLAGS $CFLAGS" -- cgit v1.2.3-54-g00ecf