You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

653 lines
18 KiB

  1. # License: MIT
  2. # http://opensource.org/licenses/MIT
  3. Add support for use of the system timezone database, rather
  4. than embedding a copy. Discussed upstream but was not desired.
  5. History:
  6. r15: adapt for timelib 2017.05beta7 (in 7.2.0RC1)
  7. r14: improve check for valid tz file
  8. r13: adapt for upstream changes to use PHP allocator
  9. r12: adapt for upstream changes for new zic
  10. r11: use canonical names to avoid more case sensitivity issues
  11. round lat/long from zone.tab towards zero per builtin db
  12. r10: make timezone case insensitive
  13. r9: fix another compile error without --with-system-tzdata configured (Michael Heimpold)
  14. r8: fix compile error without --with-system-tzdata configured
  15. r7: improve check for valid timezone id to exclude directories
  16. r6: fix fd leak in r5, fix country code/BC flag use in
  17. timezone_identifiers_list() using system db,
  18. fix use of PECL timezonedb to override system db,
  19. r5: reverts addition of "System/Localtime" fake tzname.
  20. updated for 5.3.0, parses zone.tab to pick up mapping between
  21. timezone name, country code and long/lat coords
  22. r4: added "System/Localtime" tzname which uses /etc/localtime
  23. r3: fix a crash if /usr/share/zoneinfo doesn't exist (Raphael Geissert)
  24. r2: add filesystem trawl to set up name alias index
  25. r1: initial revision
  26. diff -up ./ext/date/lib/parse_tz.c.systzdata ./ext/date/lib/parse_tz.c
  27. --- ./ext/date/lib/parse_tz.c.systzdata 2017-08-22 09:40:38.000000000 +0200
  28. +++ ./ext/date/lib/parse_tz.c 2017-08-22 12:16:00.370298079 +0200
  29. @@ -25,8 +25,21 @@
  30. #include "timelib.h"
  31. #include "timelib_private.h"
  32. +#ifdef HAVE_SYSTEM_TZDATA
  33. +#include <sys/mman.h>
  34. +#include <sys/stat.h>
  35. +#include <limits.h>
  36. +#include <fcntl.h>
  37. +#include <unistd.h>
  38. +
  39. +#include "php_scandir.h"
  40. +
  41. +#else
  42. #define TIMELIB_SUPPORTS_V2DATA
  43. #include "timezonedb.h"
  44. +#endif
  45. +
  46. +#include <ctype.h>
  47. #if (defined(__APPLE__) || defined(__APPLE_CC__)) && (defined(__BIG_ENDIAN__) || defined(__LITTLE_ENDIAN__))
  48. # if defined(__LITTLE_ENDIAN__)
  49. @@ -67,6 +80,11 @@ static int read_php_preamble(const unsig
  50. {
  51. uint32_t version;
  52. + if (memcmp(*tzf, "TZif", 4) == 0) {
  53. + *tzf += 20;
  54. + return 0;
  55. + }
  56. +
  57. /* read ID */
  58. version = (*tzf)[3] - '0';
  59. *tzf += 4;
  60. @@ -374,7 +392,429 @@ void timelib_dump_tzinfo(timelib_tzinfo
  61. }
  62. }
  63. -static int seek_to_tz_position(const unsigned char **tzf, char *timezone, const timelib_tzdb *tzdb)
  64. +#ifdef HAVE_SYSTEM_TZDATA
  65. +
  66. +#ifdef HAVE_SYSTEM_TZDATA_PREFIX
  67. +#define ZONEINFO_PREFIX HAVE_SYSTEM_TZDATA_PREFIX
  68. +#else
  69. +#define ZONEINFO_PREFIX "/usr/share/zoneinfo"
  70. +#endif
  71. +
  72. +/* System timezone database pointer. */
  73. +static const timelib_tzdb *timezonedb_system;
  74. +
  75. +/* Hash table entry for the cache of the zone.tab mapping table. */
  76. +struct location_info {
  77. + char code[2];
  78. + double latitude, longitude;
  79. + char name[64];
  80. + char *comment;
  81. + struct location_info *next;
  82. +};
  83. +
  84. +/* Cache of zone.tab. */
  85. +static struct location_info **system_location_table;
  86. +
  87. +/* Size of the zone.tab hash table; a random-ish prime big enough to
  88. + * prevent too many collisions. */
  89. +#define LOCINFO_HASH_SIZE (1021)
  90. +
  91. +/* Compute a case insensitive hash of str */
  92. +static uint32_t tz_hash(const char *str)
  93. +{
  94. + const unsigned char *p = (const unsigned char *)str;
  95. + uint32_t hash = 5381;
  96. + int c;
  97. +
  98. + while ((c = tolower(*p++)) != '\0') {
  99. + hash = (hash << 5) ^ hash ^ c;
  100. + }
  101. +
  102. + return hash % LOCINFO_HASH_SIZE;
  103. +}
  104. +
  105. +/* Parse an ISO-6709 date as used in zone.tab. Returns end of the
  106. + * parsed string on success, or NULL on parse error. On success,
  107. + * writes the parsed number to *result. */
  108. +static char *parse_iso6709(char *p, double *result)
  109. +{
  110. + double v, sign;
  111. + char *pend;
  112. + size_t len;
  113. +
  114. + if (*p == '+')
  115. + sign = 1.0;
  116. + else if (*p == '-')
  117. + sign = -1.0;
  118. + else
  119. + return NULL;
  120. +
  121. + p++;
  122. + for (pend = p; *pend >= '0' && *pend <= '9'; pend++)
  123. + ;;
  124. +
  125. + /* Annoying encoding used by zone.tab has no decimal point, so use
  126. + * the length to determine the format:
  127. + *
  128. + * 4 = DDMM
  129. + * 5 = DDDMM
  130. + * 6 = DDMMSS
  131. + * 7 = DDDMMSS
  132. + */
  133. + len = pend - p;
  134. + if (len < 4 || len > 7) {
  135. + return NULL;
  136. + }
  137. +
  138. + /* p => [D]DD */
  139. + v = (p[0] - '0') * 10.0 + (p[1] - '0');
  140. + p += 2;
  141. + if (len == 5 || len == 7)
  142. + v = v * 10.0 + (*p++ - '0');
  143. + /* p => MM[SS] */
  144. + v += (10.0 * (p[0] - '0')
  145. + + p[1] - '0') / 60.0;
  146. + p += 2;
  147. + /* p => [SS] */
  148. + if (len > 5) {
  149. + v += (10.0 * (p[0] - '0')
  150. + + p[1] - '0') / 3600.0;
  151. + p += 2;
  152. + }
  153. +
  154. + /* Round to five decimal place, not because it's a good idea,
  155. + * but, because the builtin data uses rounded data, so, match
  156. + * that. */
  157. + *result = trunc(v * sign * 100000.0) / 100000.0;
  158. +
  159. + return p;
  160. +}
  161. +
  162. +/* This function parses the zone.tab file to build up the mapping of
  163. + * timezone to country code and geographic location, and returns a
  164. + * hash table. The hash table is indexed by the function:
  165. + *
  166. + * tz_hash(timezone-name)
  167. + */
  168. +static struct location_info **create_location_table(void)
  169. +{
  170. + struct location_info **li, *i;
  171. + char zone_tab[PATH_MAX];
  172. + char line[512];
  173. + FILE *fp;
  174. +
  175. + strncpy(zone_tab, ZONEINFO_PREFIX "/zone.tab", sizeof zone_tab);
  176. +
  177. + fp = fopen(zone_tab, "r");
  178. + if (!fp) {
  179. + return NULL;
  180. + }
  181. +
  182. + li = calloc(LOCINFO_HASH_SIZE, sizeof *li);
  183. +
  184. + while (fgets(line, sizeof line, fp)) {
  185. + char *p = line, *code, *name, *comment;
  186. + uint32_t hash;
  187. + double latitude, longitude;
  188. +
  189. + while (isspace(*p))
  190. + p++;
  191. +
  192. + if (*p == '#' || *p == '\0' || *p == '\n')
  193. + continue;
  194. +
  195. + if (!isalpha(p[0]) || !isalpha(p[1]) || p[2] != '\t')
  196. + continue;
  197. +
  198. + /* code => AA */
  199. + code = p;
  200. + p[2] = 0;
  201. + p += 3;
  202. +
  203. + /* coords => [+-][D]DDMM[SS][+-][D]DDMM[SS] */
  204. + p = parse_iso6709(p, &latitude);
  205. + if (!p) {
  206. + continue;
  207. + }
  208. + p = parse_iso6709(p, &longitude);
  209. + if (!p) {
  210. + continue;
  211. + }
  212. +
  213. + if (!p || *p != '\t') {
  214. + continue;
  215. + }
  216. +
  217. + /* name = string */
  218. + name = ++p;
  219. + while (*p != '\t' && *p && *p != '\n')
  220. + p++;
  221. +
  222. + *p++ = '\0';
  223. +
  224. + /* comment = string */
  225. + comment = p;
  226. + while (*p != '\t' && *p && *p != '\n')
  227. + p++;
  228. +
  229. + if (*p == '\n' || *p == '\t')
  230. + *p = '\0';
  231. +
  232. + hash = tz_hash(name);
  233. + i = malloc(sizeof *i);
  234. + memcpy(i->code, code, 2);
  235. + strncpy(i->name, name, sizeof i->name);
  236. + i->comment = strdup(comment);
  237. + i->longitude = longitude;
  238. + i->latitude = latitude;
  239. + i->next = li[hash];
  240. + li[hash] = i;
  241. + /* printf("%s [%u, %f, %f]\n", name, hash, latitude, longitude); */
  242. + }
  243. +
  244. + fclose(fp);
  245. +
  246. + return li;
  247. +}
  248. +
  249. +/* Return location info from hash table, using given timezone name.
  250. + * Returns NULL if the name could not be found. */
  251. +const struct location_info *find_zone_info(struct location_info **li,
  252. + const char *name)
  253. +{
  254. + uint32_t hash = tz_hash(name);
  255. + const struct location_info *l;
  256. +
  257. + if (!li) {
  258. + return NULL;
  259. + }
  260. +
  261. + for (l = li[hash]; l; l = l->next) {
  262. + if (strcasecmp(l->name, name) == 0)
  263. + return l;
  264. + }
  265. +
  266. + return NULL;
  267. +}
  268. +
  269. +/* Filter out some non-tzdata files and the posix/right databases, if
  270. + * present. */
  271. +static int index_filter(const struct dirent *ent)
  272. +{
  273. + return strcmp(ent->d_name, ".") != 0
  274. + && strcmp(ent->d_name, "..") != 0
  275. + && strcmp(ent->d_name, "posix") != 0
  276. + && strcmp(ent->d_name, "posixrules") != 0
  277. + && strcmp(ent->d_name, "right") != 0
  278. + && strstr(ent->d_name, ".list") == NULL
  279. + && strstr(ent->d_name, ".tab") == NULL;
  280. +}
  281. +
  282. +static int sysdbcmp(const void *first, const void *second)
  283. +{
  284. + const timelib_tzdb_index_entry *alpha = first, *beta = second;
  285. +
  286. + return strcasecmp(alpha->id, beta->id);
  287. +}
  288. +
  289. +
  290. +/* Create the zone identifier index by trawling the filesystem. */
  291. +static void create_zone_index(timelib_tzdb *db)
  292. +{
  293. + size_t dirstack_size, dirstack_top;
  294. + size_t index_size, index_next;
  295. + timelib_tzdb_index_entry *db_index;
  296. + char **dirstack;
  297. +
  298. + /* LIFO stack to hold directory entries to scan; each slot is a
  299. + * directory name relative to the zoneinfo prefix. */
  300. + dirstack_size = 32;
  301. + dirstack = malloc(dirstack_size * sizeof *dirstack);
  302. + dirstack_top = 1;
  303. + dirstack[0] = strdup("");
  304. +
  305. + /* Index array. */
  306. + index_size = 64;
  307. + db_index = malloc(index_size * sizeof *db_index);
  308. + index_next = 0;
  309. +
  310. + do {
  311. + struct dirent **ents;
  312. + char name[PATH_MAX], *top;
  313. + int count;
  314. +
  315. + /* Pop the top stack entry, and iterate through its contents. */
  316. + top = dirstack[--dirstack_top];
  317. + snprintf(name, sizeof name, ZONEINFO_PREFIX "/%s", top);
  318. +
  319. + count = php_scandir(name, &ents, index_filter, php_alphasort);
  320. +
  321. + while (count > 0) {
  322. + struct stat st;
  323. + const char *leaf = ents[count - 1]->d_name;
  324. +
  325. + snprintf(name, sizeof name, ZONEINFO_PREFIX "/%s/%s",
  326. + top, leaf);
  327. +
  328. + if (strlen(name) && stat(name, &st) == 0) {
  329. + /* Name, relative to the zoneinfo prefix. */
  330. + const char *root = top;
  331. +
  332. + if (root[0] == '/') root++;
  333. +
  334. + snprintf(name, sizeof name, "%s%s%s", root,
  335. + *root ? "/": "", leaf);
  336. +
  337. + if (S_ISDIR(st.st_mode)) {
  338. + if (dirstack_top == dirstack_size) {
  339. + dirstack_size *= 2;
  340. + dirstack = realloc(dirstack,
  341. + dirstack_size * sizeof *dirstack);
  342. + }
  343. + dirstack[dirstack_top++] = strdup(name);
  344. + }
  345. + else {
  346. + if (index_next == index_size) {
  347. + index_size *= 2;
  348. + db_index = realloc(db_index,
  349. + index_size * sizeof *db_index);
  350. + }
  351. +
  352. + db_index[index_next++].id = strdup(name);
  353. + }
  354. + }
  355. +
  356. + free(ents[--count]);
  357. + }
  358. +
  359. + if (count != -1) free(ents);
  360. + free(top);
  361. + } while (dirstack_top);
  362. +
  363. + qsort(db_index, index_next, sizeof *db_index, sysdbcmp);
  364. +
  365. + db->index = db_index;
  366. + db->index_size = index_next;
  367. +
  368. + free(dirstack);
  369. +}
  370. +
  371. +#define FAKE_HEADER "1234\0??\1??"
  372. +#define FAKE_UTC_POS (7 - 4)
  373. +
  374. +/* Create a fake data segment for database 'sysdb'. */
  375. +static void fake_data_segment(timelib_tzdb *sysdb,
  376. + struct location_info **info)
  377. +{
  378. + size_t n;
  379. + char *data, *p;
  380. +
  381. + data = malloc(3 * sysdb->index_size + 7);
  382. +
  383. + p = mempcpy(data, FAKE_HEADER, sizeof(FAKE_HEADER) - 1);
  384. +
  385. + for (n = 0; n < sysdb->index_size; n++) {
  386. + const struct location_info *li;
  387. + timelib_tzdb_index_entry *ent;
  388. +
  389. + ent = (timelib_tzdb_index_entry *)&sysdb->index[n];
  390. +
  391. + /* Lookup the timezone name in the hash table. */
  392. + if (strcmp(ent->id, "UTC") == 0) {
  393. + ent->pos = FAKE_UTC_POS;
  394. + continue;
  395. + }
  396. +
  397. + li = find_zone_info(info, ent->id);
  398. + if (li) {
  399. + /* If found, append the BC byte and the
  400. + * country code; set the position for this
  401. + * section of timezone data. */
  402. + ent->pos = (p - data) - 4;
  403. + *p++ = '\1';
  404. + *p++ = li->code[0];
  405. + *p++ = li->code[1];
  406. + }
  407. + else {
  408. + /* If not found, the timezone data can
  409. + * point at the header. */
  410. + ent->pos = 0;
  411. + }
  412. + }
  413. +
  414. + sysdb->data = (unsigned char *)data;
  415. +}
  416. +
  417. +/* Returns true if the passed-in stat structure describes a
  418. + * probably-valid timezone file. */
  419. +static int is_valid_tzfile(const struct stat *st, int fd)
  420. +{
  421. + if (fd) {
  422. + char buf[20];
  423. + if (read(fd, buf, 20)!=20) {
  424. + return 0;
  425. + }
  426. + lseek(fd, SEEK_SET, 0);
  427. + if (memcmp(buf, "TZif", 4)) {
  428. + return 0;
  429. + }
  430. + }
  431. + return S_ISREG(st->st_mode) && st->st_size > 20;
  432. +}
  433. +
  434. +/* To allow timezone names to be used case-insensitively, find the
  435. + * canonical name for this timezone, if possible. */
  436. +static const char *canonical_tzname(const char *timezone)
  437. +{
  438. + if (timezonedb_system) {
  439. + timelib_tzdb_index_entry *ent, lookup;
  440. +
  441. + lookup.id = (char *)timezone;
  442. +
  443. + ent = bsearch(&lookup, timezonedb_system->index,
  444. + timezonedb_system->index_size, sizeof lookup,
  445. + sysdbcmp);
  446. + if (ent) {
  447. + return ent->id;
  448. + }
  449. + }
  450. +
  451. + return timezone;
  452. +}
  453. +
  454. +/* Return the mmap()ed tzfile if found, else NULL. On success, the
  455. + * length of the mapped data is placed in *length. */
  456. +static char *map_tzfile(const char *timezone, size_t *length)
  457. +{
  458. + char fname[PATH_MAX];
  459. + struct stat st;
  460. + char *p;
  461. + int fd;
  462. +
  463. + if (timezone[0] == '\0' || strstr(timezone, "..") != NULL) {
  464. + return NULL;
  465. + }
  466. +
  467. + snprintf(fname, sizeof fname, ZONEINFO_PREFIX "/%s", canonical_tzname(timezone));
  468. +
  469. + fd = open(fname, O_RDONLY);
  470. + if (fd == -1) {
  471. + return NULL;
  472. + } else if (fstat(fd, &st) != 0 || !is_valid_tzfile(&st, fd)) {
  473. + close(fd);
  474. + return NULL;
  475. + }
  476. +
  477. + *length = st.st_size;
  478. + p = mmap(NULL, st.st_size, PROT_READ, MAP_SHARED, fd, 0);
  479. + close(fd);
  480. +
  481. + return p != MAP_FAILED ? p : NULL;
  482. +}
  483. +
  484. +#endif
  485. +
  486. +static int inmem_seek_to_tz_position(const unsigned char **tzf, char *timezone, const timelib_tzdb *tzdb)
  487. {
  488. int left = 0, right = tzdb->index_size - 1;
  489. #ifdef HAVE_SETLOCALE
  490. @@ -419,9 +859,48 @@ static int seek_to_tz_position(const uns
  491. return 0;
  492. }
  493. +static int seek_to_tz_position(const unsigned char **tzf, char *timezone,
  494. + char **map, size_t *maplen,
  495. + const timelib_tzdb *tzdb)
  496. +{
  497. +#ifdef HAVE_SYSTEM_TZDATA
  498. + if (tzdb == timezonedb_system) {
  499. + char *orig;
  500. +
  501. + orig = map_tzfile(timezone, maplen);
  502. + if (orig == NULL) {
  503. + return 0;
  504. + }
  505. +
  506. + (*tzf) = (unsigned char *)orig;
  507. + *map = orig;
  508. + return 1;
  509. + }
  510. + else
  511. +#endif
  512. + {
  513. + return inmem_seek_to_tz_position(tzf, timezone, tzdb);
  514. + }
  515. +}
  516. +
  517. const timelib_tzdb *timelib_builtin_db(void)
  518. {
  519. +#ifdef HAVE_SYSTEM_TZDATA
  520. + if (timezonedb_system == NULL) {
  521. + timelib_tzdb *tmp = malloc(sizeof *tmp);
  522. +
  523. + tmp->version = "0.system";
  524. + tmp->data = NULL;
  525. + create_zone_index(tmp);
  526. + system_location_table = create_location_table();
  527. + fake_data_segment(tmp, system_location_table);
  528. + timezonedb_system = tmp;
  529. + }
  530. +
  531. + return timezonedb_system;
  532. +#else
  533. return &timezonedb_builtin;
  534. +#endif
  535. }
  536. const timelib_tzdb_index_entry *timelib_timezone_identifiers_list(timelib_tzdb *tzdb, int *count)
  537. @@ -433,7 +912,30 @@ const timelib_tzdb_index_entry *timelib_
  538. int timelib_timezone_id_is_valid(char *timezone, const timelib_tzdb *tzdb)
  539. {
  540. const unsigned char *tzf;
  541. - return (seek_to_tz_position(&tzf, timezone, tzdb));
  542. +
  543. +#ifdef HAVE_SYSTEM_TZDATA
  544. + if (tzdb == timezonedb_system) {
  545. + char fname[PATH_MAX];
  546. + struct stat st;
  547. +
  548. + if (timezone[0] == '\0' || strstr(timezone, "..") != NULL) {
  549. + return 0;
  550. + }
  551. +
  552. + if (system_location_table) {
  553. + if (find_zone_info(system_location_table, timezone) != NULL) {
  554. + /* found in cache */
  555. + return 1;
  556. + }
  557. + }
  558. +
  559. + snprintf(fname, sizeof fname, ZONEINFO_PREFIX "/%s", canonical_tzname(timezone));
  560. +
  561. + return stat(fname, &st) == 0 && is_valid_tzfile(&st, 0);
  562. + }
  563. +#endif
  564. +
  565. + return (inmem_seek_to_tz_position(&tzf, timezone, tzdb));
  566. }
  567. static int skip_64bit_preamble(const unsigned char **tzf, timelib_tzinfo *tz)
  568. @@ -475,12 +977,14 @@ static timelib_tzinfo* timelib_tzinfo_ct
  569. timelib_tzinfo *timelib_parse_tzfile(char *timezone, const timelib_tzdb *tzdb, int *error_code)
  570. {
  571. const unsigned char *tzf;
  572. + char *memmap = NULL;
  573. + size_t maplen;
  574. timelib_tzinfo *tmp;
  575. int version;
  576. int transitions_result, types_result;
  577. unsigned int type; /* TIMELIB_TZINFO_PHP or TIMELIB_TZINFO_ZONEINFO */
  578. - if (seek_to_tz_position(&tzf, timezone, tzdb)) {
  579. + if (seek_to_tz_position(&tzf, timezone, &memmap, &maplen, tzdb)) {
  580. tmp = timelib_tzinfo_ctor(timezone);
  581. version = read_preamble(&tzf, tmp, &type);
  582. @@ -503,6 +1007,29 @@ timelib_tzinfo *timelib_parse_tzfile(cha
  583. timelib_tzinfo_dtor(tmp);
  584. return NULL;
  585. }
  586. +
  587. +#ifdef HAVE_SYSTEM_TZDATA
  588. + if (memmap) {
  589. + const struct location_info *li;
  590. +
  591. + /* TZif-style - grok the location info from the system database,
  592. + * if possible. */
  593. +
  594. + if ((li = find_zone_info(system_location_table, timezone)) != NULL) {
  595. + tmp->location.comments = timelib_strdup(li->comment);
  596. + strncpy(tmp->location.country_code, li->code, 2);
  597. + tmp->location.longitude = li->longitude;
  598. + tmp->location.latitude = li->latitude;
  599. + tmp->bc = 1;
  600. + }
  601. + else {
  602. + set_default_location_and_comments(&tzf, tmp);
  603. + }
  604. +
  605. + /* Now done with the mmap segment - discard it. */
  606. + munmap(memmap, maplen);
  607. + } else {
  608. +#endif
  609. if (version == 2 || version == 3) {
  610. if (!skip_64bit_preamble(&tzf, tmp)) {
  611. /* 64 bit preamble is not in place */
  612. @@ -520,6 +1047,9 @@ timelib_tzinfo *timelib_parse_tzfile(cha
  613. } else {
  614. set_default_location_and_comments(&tzf, tmp);
  615. }
  616. +#ifdef HAVE_SYSTEM_TZDATA
  617. + }
  618. +#endif
  619. } else {
  620. *error_code = TIMELIB_ERROR_NO_SUCH_TIMEZONE;
  621. tmp = NULL;
  622. diff -up ./ext/date/lib/timelib.m4.systzdata ./ext/date/lib/timelib.m4
  623. --- ./ext/date/lib/timelib.m4.systzdata 2017-08-22 09:40:38.000000000 +0200
  624. +++ ./ext/date/lib/timelib.m4 2017-08-22 11:32:29.357799927 +0200
  625. @@ -81,3 +81,16 @@ io.h
  626. dnl Check for strtoll, atoll
  627. AC_CHECK_FUNCS(strtoll atoll strftime gettimeofday)
  628. +
  629. +PHP_ARG_WITH(system-tzdata, for use of system timezone data,
  630. +[ --with-system-tzdata[=DIR] to specify use of system timezone data],
  631. +no, no)
  632. +
  633. +if test "$PHP_SYSTEM_TZDATA" != "no"; then
  634. + AC_DEFINE(HAVE_SYSTEM_TZDATA, 1, [Define if system timezone data is used])
  635. +
  636. + if test "$PHP_SYSTEM_TZDATA" != "yes"; then
  637. + AC_DEFINE_UNQUOTED(HAVE_SYSTEM_TZDATA_PREFIX, "$PHP_SYSTEM_TZDATA",
  638. + [Define for location of system timezone data])
  639. + fi
  640. +fi