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