From e900ebe95a32bdb48c67c5c415d9f5d179537097 Mon Sep 17 00:00:00 2001 From: mhei Date: Sat, 28 Jul 2012 13:00:47 +0000 Subject: [PATCH] [packages] php5: fix compilation without CONFIG_PHP5_SYSTEMTZDATA selected Fixes #11917. git-svn-id: svn://svn.openwrt.org/openwrt/packages@32900 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- .../102-debian_patches_use_embedded_timezonedb.patch | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/lang/php5/patches/102-debian_patches_use_embedded_timezonedb.patch b/lang/php5/patches/102-debian_patches_use_embedded_timezonedb.patch index c27fa9d8b..390910f14 100644 --- a/lang/php5/patches/102-debian_patches_use_embedded_timezonedb.patch +++ b/lang/php5/patches/102-debian_patches_use_embedded_timezonedb.patch @@ -3,6 +3,7 @@ Add support for use of the system timezone database, rather than embedding a copy. Discussed upstream but was not desired. History: +r9: fix another compile error without --with-system-tzdata configured r8: fix compile error without --with-system-tzdata configured r7: improve check for valid timezone id to exclude directories r6: fix fd leak in r5, fix country code/BC flag use in @@ -66,7 +67,7 @@ r1: initial revision /* read BC flag */ tz->bc = (**tzf == '\1'); *tzf += 1; -@@ -256,7 +276,397 @@ void timelib_dump_tzinfo(timelib_tzinfo +@@ -256,7 +276,397 @@ } } @@ -465,7 +466,7 @@ r1: initial revision { int left = 0, right = tzdb->index_size - 1; #ifdef HAVE_SETLOCALE -@@ -295,36 +705,125 @@ static int seek_to_tz_position(const uns +@@ -295,36 +705,128 @@ return 0; } @@ -473,6 +474,7 @@ r1: initial revision + char **map, size_t *maplen, + const timelib_tzdb *tzdb) +{ ++#ifdef HAVE_SYSTEM_TZDATA + if (tzdb == timezonedb_system) { + char *orig; + @@ -486,7 +488,9 @@ r1: initial revision + + return 1; + } -+ else { ++ else ++#endif ++ { + return inmem_seek_to_tz_position(tzf, timezone, tzdb); + } +} @@ -596,7 +600,7 @@ r1: initial revision } --- a/ext/date/lib/timelib.m4 +++ b/ext/date/lib/timelib.m4 -@@ -78,3 +78,17 @@ stdlib.h +@@ -78,3 +78,17 @@ dnl Check for strtoll, atoll AC_CHECK_FUNCS(strtoll atoll strftime)