summaryrefslogtreecommitdiff
path: root/Build
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2006-12-18 01:58:59 +0000
committerKarl Berry <karl@freefriends.org>2006-12-18 01:58:59 +0000
commitd62799d4a4bd07c090e794bfbe3e25ce2689f693 (patch)
treefcc3c3b326e1f9f85f9ccb5498915734c07b2bbc /Build
parent7fc8fcceed56744d8819f2f6d4b161e4c0ab0c8c (diff)
configure for gm_toff; from Apostolos, for i386-solaris
git-svn-id: svn://tug.org/texlive/trunk@2774 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build')
-rwxr-xr-xBuild/source/texk/dvipdfmx/configure111
-rw-r--r--Build/source/texk/dvipdfmx/configure.in14
-rw-r--r--Build/source/texk/dvipdfmx/src/pdfdoc.c9
3 files changed, 133 insertions, 1 deletions
diff --git a/Build/source/texk/dvipdfmx/configure b/Build/source/texk/dvipdfmx/configure
index 3fc27d179c4..7774d11949f 100755
--- a/Build/source/texk/dvipdfmx/configure
+++ b/Build/source/texk/dvipdfmx/configure
@@ -1780,6 +1780,11 @@ fi
+# Timezone tests written by MAW for pdfdoc.c.
+#
+
+
+
ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
@@ -4398,6 +4403,112 @@ fi
done
+echo "$as_me:$LINENO: checking whether time.h defines timezone as an external variable" >&5
+echo $ECHO_N "checking whether time.h defines timezone as an external variable... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <time.h>
+int
+main ()
+{
+ -timezone;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; cat >>confdefs.h <<\_ACEOF
+#define HAVE_TIMEZONE 1
+_ACEOF
+
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+echo "$as_me:$LINENO: checking whether struct tz has tm_gmtoff as a member" >&5
+echo $ECHO_N "checking whether struct tz has tm_gmtoff as a member... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <time.h>
+int
+main ()
+{
+struct tm *tp; tp->tm_gmtoff
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; cat >>confdefs.h <<\_ACEOF
+#define HAVE_TM_GMTOFF 1
+_ACEOF
+
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
echo "$as_me:$LINENO: checking for an ANSI C-conforming const" >&5
echo $ECHO_N "checking for an ANSI C-conforming const... $ECHO_C" >&6
if test "${ac_cv_c_const+set}" = set; then
diff --git a/Build/source/texk/dvipdfmx/configure.in b/Build/source/texk/dvipdfmx/configure.in
index a9f48bf215d..038fe3d1635 100644
--- a/Build/source/texk/dvipdfmx/configure.in
+++ b/Build/source/texk/dvipdfmx/configure.in
@@ -4,6 +4,17 @@ AM_INIT_AUTOMAKE(dvipdfmx, 20061211)
AM_CONFIG_HEADER(config.h)
AM_MAINTAINER_MODE
+# Timezone tests written by MAW for pdfdoc.c.
+#
+AC_DEFUN([AC_EXT_TIMEZONE],
+[AC_MSG_CHECKING([whether time.h defines timezone as an external variable])
+AC_TRY_LINK([#include <time.h>], [ -timezone; ],
+ [AC_MSG_RESULT(yes); AC_DEFINE(HAVE_TIMEZONE)], [AC_MSG_RESULT(no)])])
+AC_DEFUN([AC_TZ_HAS_TM_GMTOFF],
+[AC_MSG_CHECKING([whether struct tz has tm_gmtoff as a member])
+AC_TRY_COMPILE([#include <time.h>], [struct tm *tp; tp->tm_gmtoff],
+ [AC_MSG_RESULT(yes); AC_DEFINE(HAVE_TM_GMTOFF)], [AC_MSG_RESULT(no)])])
+
dnl Checks for programs.
AC_PROG_CC
AC_PROG_INSTALL
@@ -81,6 +92,9 @@ AC_FUNC_MEMCMP
AC_CHECK_FUNCS(open close system getenv mkstemp basename)
dnl Checks for typedefs, structures, and compiler characteristics.
+AC_EXT_TIMEZONE
+AC_TZ_HAS_TM_GMTOFF
+
AC_C_CONST
AC_C_INLINE
AC_TYPE_SIZE_T
diff --git a/Build/source/texk/dvipdfmx/src/pdfdoc.c b/Build/source/texk/dvipdfmx/src/pdfdoc.c
index c8ad7e69b71..d2047debe55 100644
--- a/Build/source/texk/dvipdfmx/src/pdfdoc.c
+++ b/Build/source/texk/dvipdfmx/src/pdfdoc.c
@@ -490,6 +490,13 @@ pdf_doc_set_eop_content (const char *content, unsigned length)
static long
asn_date (char *date_string)
{
+#ifndef HAVE_TIMEZONE
+#ifdef TM_GM_TOFF
+ #define timezone (bdtime->gm_toff)
+#else
+ #define timezone 0l
+#endif /* TM_GM_TOFF */
+#endif /* HAVE_TIMEZONE */
time_t current_time;
struct tm *bd_time;
@@ -498,7 +505,7 @@ asn_date (char *date_string)
sprintf(date_string, "D:%04d%02d%02d%02d%02d%02d%+03ld'%02ld'",
bd_time->tm_year + 1900, bd_time->tm_mon + 1, bd_time->tm_mday,
bd_time->tm_hour, bd_time->tm_min, bd_time->tm_sec,
- -(bd_time->tm_gmtoff / 3600), (bd_time->tm_gmtoff % 3600) / 60);
+ -(timezone / 3600), (timezone % 3600) / 60);
return strlen(date_string);
}