-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.m4
54 lines (41 loc) · 1.72 KB
/
config.m4
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
PHP_ARG_WITH(clickhouse, for clickhouse support,
[ --with-clickhouse=DIR Path to libclickhouse-cpp-lib])
PHP_ARG_ENABLE(overoptimization, whether to enable overoptimization,
[ --enable-overoptimization
Enable miscellaneous weird optimizations default=no], no, no)
PHP_ARG_ENABLE(date-stringify, whether to enable timestamps as strings,
[ --enable-date-stringify
Enable returning Date/DateTime fields as strings in local TZ default=no], no, no)
if test "$PHP_CLICKHOUSE" != "no"; then
CXXFLAGS="-std=c++14"
PHP_REQUIRE_CXX()
AC_LANG_CPLUSPLUS
PHP_SUBST(CLICKHOUSE_SHARED_LIBADD)
PHP_ADD_LIBRARY(stdc++,,CLICKHOUSE_SHARED_LIBADD)
if test "$PHP_OVEROPTIMIZATION" != "no"; then
AC_DEFINE(OVEROPTIMIZATION,1,[Enable miscellaneous weird optimizations])
fi
if test "$PHP_DATE_STRINGIFY" != "no"; then
AC_DEFINE(DATE_STRINGIFY,1,[Enable returning Date/DateTime fields as strings in local TZ])
fi
if test "$PHP_CLICKHOUSE" = "yes"; then
PHP_CHECK_LIBRARY(clickhouse-cpp-lib, _ZN10clickhouse6Client4PingEv,
[],[
AC_MSG_ERROR([ClickHouse C++ library required.])
])
PHP_ADD_LIBRARY(clickhouse-cpp-lib,,CLICKHOUSE_SHARED_LIBADD)
else
if test ! -f $PHP_CLICKHOUSE/include/client.h; then
AC_MSG_ERROR(Unable to locate client.h)
fi
PHP_CHECK_LIBRARY(clickhouse-cpp-lib, _ZN10clickhouse6Client4PingEv,
[],[
AC_MSG_ERROR([ClickHouse C++ library required.])
],[
-L$PHP_CLICKHOUSE/$PHP_LIBDIR
])
PHP_ADD_LIBRARY_WITH_PATH(clickhouse-cpp-lib, $PHP_CLICKHOUSE/$PHP_LIBDIR, CLICKHOUSE_SHARED_LIBADD)
PHP_ADD_INCLUDE($PHP_CLICKHOUSE/include)
fi
PHP_NEW_EXTENSION(clickhouse, bridge.cpp clickhouse.cpp, $ext_shared)
fi