2005-06-15 05:32:29 +08:00
|
|
|
dnl $Id$
|
|
|
|
dnl config.m4 for date extension
|
|
|
|
|
2018-09-27 01:29:25 +08:00
|
|
|
dnl Check for headers needed by timelib
|
|
|
|
AC_CHECK_HEADERS([ \
|
|
|
|
strings.h \
|
|
|
|
io.h
|
|
|
|
])
|
|
|
|
|
|
|
|
dnl Check for strtoll, atoll
|
|
|
|
AC_CHECK_FUNCS(strtoll atoll)
|
2005-06-17 07:12:10 +08:00
|
|
|
|
2015-01-21 23:26:36 +08:00
|
|
|
PHP_DATE_CFLAGS="-I@ext_builddir@/lib -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1 -DHAVE_TIMELIB_CONFIG_H=1"
|
2018-10-13 20:14:50 +08:00
|
|
|
timelib_sources="lib/astro.c lib/dow.c lib/parse_date.c lib/parse_tz.c
|
2008-04-25 20:55:16 +08:00
|
|
|
lib/timelib.c lib/tm2unixtime.c lib/unixtime2tm.c lib/parse_iso_intervals.c lib/interval.c"
|
2005-06-17 05:23:16 +08:00
|
|
|
|
|
|
|
PHP_NEW_EXTENSION(date, php_date.c $timelib_sources, no,, $PHP_DATE_CFLAGS)
|
2005-10-04 04:20:20 +08:00
|
|
|
|
2005-06-17 07:12:10 +08:00
|
|
|
PHP_ADD_BUILD_DIR([$ext_builddir/lib], 1)
|
2005-10-04 04:20:20 +08:00
|
|
|
PHP_ADD_INCLUDE([$ext_builddir/lib])
|
|
|
|
PHP_ADD_INCLUDE([$ext_srcdir/lib])
|
|
|
|
|
2017-08-16 03:22:41 +08:00
|
|
|
PHP_INSTALL_HEADERS([ext/date], [php_date.h lib/timelib.h lib/timelib_config.h])
|
2015-01-21 23:22:23 +08:00
|
|
|
AC_DEFINE([HAVE_TIMELIB_CONFIG_H], [1], [Have timelib_config.h])
|
2005-06-17 07:12:10 +08:00
|
|
|
|
2005-07-08 07:18:22 +08:00
|
|
|
cat > $ext_builddir/lib/timelib_config.h <<EOF
|
|
|
|
#ifdef PHP_WIN32
|
2005-06-17 07:12:10 +08:00
|
|
|
# include "config.w32.h"
|
|
|
|
#else
|
|
|
|
# include <php_config.h>
|
|
|
|
#endif
|
2013-08-07 04:45:35 +08:00
|
|
|
#include <php_stdint.h>
|
2015-01-21 17:49:28 +08:00
|
|
|
#define TIMELIB_OMIT_STDINT 1
|
2015-09-22 16:17:50 +08:00
|
|
|
|
|
|
|
#include "zend.h"
|
|
|
|
|
|
|
|
#define timelib_malloc emalloc
|
|
|
|
#define timelib_realloc erealloc
|
|
|
|
#define timelib_calloc ecalloc
|
|
|
|
#define timelib_strdup estrdup
|
|
|
|
#define timelib_free efree
|
2005-06-17 07:12:10 +08:00
|
|
|
EOF
|