diff options
author | Jay Berkenbilt <ejb@ql.org> | 2021-04-18 00:12:55 +0200 |
---|---|---|
committer | Jay Berkenbilt <ejb@ql.org> | 2021-04-18 00:12:55 +0200 |
commit | 36c7c208191a0fd34cf48bdfb4af66b4ab0ec594 (patch) | |
tree | b9a0afe891c01222e1c844e1d3bb0b85fc724f12 /configure.ac | |
parent | 8971443e4680fc1c0babe56da58cc9070a9dae2e (diff) | |
download | qpdf-36c7c208191a0fd34cf48bdfb4af66b4ab0ec594.tar.zst |
Fix timezone portability issue (fixes #515)
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 29 |
1 files changed, 29 insertions, 0 deletions
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 <time.h> + ]],[[ + 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 <time.h> + #include <stdio.h> + ]],[[ + 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" |