Skip to content

Commit

Permalink
Refactor timelib.m4
Browse files Browse the repository at this point in the history
The ext/date/lib is bundled library and also includes additional
timelib.m4 macros and checks specific for PHP.

All the checks in the timelib.m4 are already done in the PHP's
configure.ac:
- headers except for io.h and strings.h
- two functions checked strftime and gettimeofday
- if size of longint is 8
- if size of int is 4
- int32_t and uint32_t types using the PHP_CHECK_STDINT_TYPES

Macro `AC_TIMELIB_C_BIGENDIAN` defined in timelib.m4 is not used.

The two checkings for strtoll and atoll have been moved to date extension's
config0.m4 file.

Additional check for headers <io.h> and <strings.h> has been added to
config0.m4 of the date extension.

Therefore the timelib.m4 can be simplified and removed from the bundled
library to have easier maintenance in the later branches and also
upstream library.
  • Loading branch information
petk committed Feb 13, 2019
1 parent 56dba3f commit 0ffa84d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 85 deletions.
10 changes: 8 additions & 2 deletions ext/date/config0.m4
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
dnl $Id$
dnl config.m4 for date extension

sinclude(ext/date/lib/timelib.m4)
sinclude(lib/timelib.m4)
dnl Check for headers needed by timelib
AC_CHECK_HEADERS([ \
strings.h \
io.h
])

dnl Check for strtoll, atoll
AC_CHECK_FUNCS(strtoll atoll)

PHP_DATE_CFLAGS="-I@ext_builddir@/lib -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1 -DHAVE_TIMELIB_CONFIG_H=1"
timelib_sources="lib/astro.c lib/dow.c lib/parse_date.c lib/parse_tz.c
Expand Down
83 changes: 0 additions & 83 deletions ext/date/lib/timelib.m4

This file was deleted.

0 comments on commit 0ffa84d

Please sign in to comment.