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