aboutsummaryrefslogtreecommitdiffstats
path: root/configure
diff options
context:
space:
mode:
authorJay Berkenbilt <ejb@ql.org>2021-04-18 00:12:55 +0200
committerJay Berkenbilt <ejb@ql.org>2021-04-18 00:12:55 +0200
commit36c7c208191a0fd34cf48bdfb4af66b4ab0ec594 (patch)
treeb9a0afe891c01222e1c844e1d3bb0b85fc724f12 /configure
parent8971443e4680fc1c0babe56da58cc9070a9dae2e (diff)
downloadqpdf-36c7c208191a0fd34cf48bdfb4af66b4ab0ec594.tar.zst
Fix timezone portability issue (fixes #515)
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure72
1 files changed, 72 insertions, 0 deletions
diff --git a/configure b/configure
index 55c59a92..daac3f5a 100755
--- a/configure
+++ b/configure
@@ -17830,6 +17830,78 @@ $as_echo "no" >&6; }
fi
fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for tm_gmtoff in struct tm" >&5
+$as_echo_n "checking for tm_gmtoff in struct tm... " >&6; }
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+ #include <time.h>
+
+int
+main ()
+{
+
+ struct tm tm;
+ tm.tm_gmtoff = 1;
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ qpdf_TM_GMTOFF=1
+else
+ qpdf_TM_GMTOFF=0
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+if test "$qpdf_TM_GMTOFF" = "1"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+$as_echo "#define HAVE_TM_GMTOFF 1" >>confdefs.h
+
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for extern long timezone" >&5
+$as_echo_n "checking for extern long timezone... " >&6; }
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+ #include <time.h>
+ #include <stdio.h>
+
+int
+main ()
+{
+
+ tzset();
+ printf("%ld\n", timezone);
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ qpdf_EXTERN_LONG_TIMEZONE=1
+else
+ qpdf_EXTERN_LONG_TIMEZONE=0
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+if test "$qpdf_EXTERN_LONG_TIMEZONE" = "1"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+$as_echo "#define HAVE_EXTERN_LONG_TIMEZONE 1" >>confdefs.h
+
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
LL_FMT=""
oCFLAGS=$CFLAGS
CFLAGS="$WFLAGS $CFLAGS"