xref: /PHP-8.1/ext/date/config0.m4 (revision dcdc5d90)
1dnl Check for headers needed by timelib
2AC_CHECK_HEADERS([io.h])
3
4dnl Check for strtoll, atoll
5AC_CHECK_FUNCS(strtoll atoll)
6
7PHP_DATE_CFLAGS="-Wno-implicit-fallthrough -I@ext_builddir@/lib -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1 -DHAVE_TIMELIB_CONFIG_H=1"
8timelib_sources="lib/astro.c lib/dow.c lib/parse_date.c lib/parse_tz.c lib/parse_posix.c
9                 lib/timelib.c lib/tm2unixtime.c lib/unixtime2tm.c lib/parse_iso_intervals.c lib/interval.c"
10
11PHP_NEW_EXTENSION(date, php_date.c $timelib_sources, no,, $PHP_DATE_CFLAGS)
12
13PHP_ADD_BUILD_DIR([$ext_builddir/lib], 1)
14PHP_ADD_INCLUDE([$ext_builddir/lib])
15PHP_ADD_INCLUDE([$ext_srcdir/lib])
16
17PHP_INSTALL_HEADERS([ext/date], [php_date.h lib/timelib.h lib/timelib_config.h])
18AC_DEFINE([HAVE_TIMELIB_CONFIG_H], [1], [Have timelib_config.h])
19
20cat > $ext_builddir/lib/timelib_config.h <<EOF
21#ifdef PHP_WIN32
22# include "config.w32.h"
23#else
24# include <php_config.h>
25#endif
26#include <php_stdint.h>
27
28#include "zend.h"
29
30#define timelib_malloc  emalloc
31#define timelib_realloc erealloc
32#define timelib_calloc  ecalloc
33#define timelib_strdup  estrdup
34#define timelib_strndup estrndup
35#define timelib_free    efree
36EOF
37