[xiph-commits] r3670 - in liboggz/trunk: . src/tools/oggz-chop

giles at svn.annodex.net giles at svn.annodex.net
Thu Jul 31 09:18:13 PDT 2008


Author: giles
Date: 2008-07-31 09:18:12 -0700 (Thu, 31 Jul 2008)
New Revision: 3670

Modified:
   liboggz/trunk/configure.ac
   liboggz/trunk/src/tools/oggz-chop/httpdate_test.c
Log:
MacOS X 10.4 only defines timezone with _XOPEN_SOURCE. Check for this.

This is timezone the global variable, not the function, used by 
httpdate.c. Always defining _XOPEN_SOURCE directly in the requisite
files is another option, and probably safe.


Modified: liboggz/trunk/configure.ac
===================================================================
--- liboggz/trunk/configure.ac	2008-07-31 15:18:07 UTC (rev 3669)
+++ liboggz/trunk/configure.ac	2008-07-31 16:18:12 UTC (rev 3670)
@@ -307,9 +307,31 @@
 AC_CHECK_TYPES(ssize_t)
 AC_CHECK_SIZEOF(ssize_t,4)
 
+# MacOS 10.4 only declares timezone for _XOPEN_SOURCE. Check for this.
+AC_MSG_CHECKING([for timezone])
+AC_COMPILE_IFELSE(
+  AC_LANG_PROGRAM([#include <time.h>], [
+    int seconds = 1234567;
+    seconds -= timezone;
+  ]), AC_MSG_RESULT([ok]),
+  AC_MSG_RESULT([no])
+  AC_MSG_CHECKING([for timezone with _XOPEN_SOURCE])
+  AC_COMPILE_IFELSE(
+    AC_LANG_PROGRAM([
+#define _XOPEN_SOURCE
+#include <time.h>
+    ], [
+      int seconds = 1234567;
+      seconds -= timezone;
+    ]),
+   dnl _XOPEN_SOURCE is required
+    AC_MSG_RESULT([ok])
+    AC_DEFINE([_XOPEN_SOURCE], [1], [we need _XOPEN for timezone]),
+   dnl it didn't work even with _XOPEN_SOURCE; httpdate will break 
+    AC_MSG_RESULT([no])
+  )
+)
 
-# Checks for header files.
-
 # Checks for typedefs, structures, and compiler characteristics.
 
 dnl Add some useful warnings if we have gcc.

Modified: liboggz/trunk/src/tools/oggz-chop/httpdate_test.c
===================================================================
--- liboggz/trunk/src/tools/oggz-chop/httpdate_test.c	2008-07-31 15:18:07 UTC (rev 3669)
+++ liboggz/trunk/src/tools/oggz-chop/httpdate_test.c	2008-07-31 16:18:12 UTC (rev 3670)
@@ -1,3 +1,5 @@
+#include "config.h"
+
 #include <stdio.h>
 #include <string.h>
 



More information about the commits mailing list