Skip to content

Commit fdd3153

Browse files
committed
新增支持编译时手动指定 tdengine 目录
1 parent 99de1d7 commit fdd3153

File tree

2 files changed

+21
-3
lines changed

2 files changed

+21
-3
lines changed

README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,15 @@ Swoole >= 4.8 (可选)
2424
phpize && ./configure && make -j && make install
2525
```
2626

27+
**手动指定 tdengine 目录:**
28+
29+
```shell
30+
phpize && ./configure --with-tdengine-dir=/usr/local/Cellar/tdengine/2.4.0.0 && make -j && make install
31+
```
32+
33+
> `--with-tdengine-dir=` 后跟上 tdengine 目录。
34+
> 适用于默认找不到的情况,或者 MacOS 系统用户。
35+
2736
**Swoole 环境:**
2837

2938
```shell

config.m4

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,10 +91,19 @@ if test "$PHP_TDENGINE" != "no"; then
9191
dnl PHP_SUBST(TDENGINE_SHARED_LIBADD)
9292

9393
dnl In case of no dependencies
94-
AC_DEFINE(HAVE_TDENGINE, 1, [ Have tdengine support ])
94+
PHP_ARG_WITH([tdengine_dir],
95+
[dir of tdengine],
96+
[AS_HELP_STRING([[--with-tdengine-dir[=DIR]]],
97+
[Include TDengine support (requires TDengine >= 2.0.0)])], [no], [no])
9598

96-
TDENGINE_INCLUDE="/usr/local/taos/include"
97-
TDENGINE_LIBDIR="/usr/local/taos/driver"
99+
AC_DEFINE(HAVE_TDENGINE, 1, [ Have tdengine support ])
100+
if test "$PHP_TDENGINE_DIR" != "no"; then
101+
TDENGINE_INCLUDE="${PHP_TDENGINE_DIR}/include"
102+
TDENGINE_LIBDIR="${PHP_TDENGINE_DIR}/driver"
103+
else
104+
TDENGINE_INCLUDE="/usr/local/taos/include"
105+
TDENGINE_LIBDIR="/usr/local/taos/driver"
106+
fi
98107

99108
PHP_CHECK_LIBRARY(taos, taos_init,
100109
[

0 commit comments

Comments
 (0)