This repository has been archived by the owner on Oct 12, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 104
/
config.m4
72 lines (64 loc) · 2.17 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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
PHP_ARG_ENABLE([skywalking],
[whether to enable skywalking support],
[AS_HELP_STRING([--enable-skywalking],
[Enable skywalking support])],
[yes])
if test "$PHP_THREAD_SAFETY" == "yes"; then
AC_MSG_ERROR([skywalking does not support ZTS])
fi
if test "$PHP_SKYWALKING" != "no"; then
AC_PATH_PROG(CARGO, cargo, no)
if ! test -x "$CARGO"; then
AC_MSG_ERROR([cargo command missing, please reinstall the cargo distribution])
fi
AC_PATH_PROG(RUSTFMT, rustfmt, no)
if ! test -x "$RUSTFMT"; then
AC_MSG_ERROR([rustfmt command missing, please reinstall the cargo distribution])
fi
EXTRA_LDFLAGS="$EXTRA_LDFLAGS $srcdir/target/release/libsky_core_report.a"
LIBS="-lpthread $LIBS"
SKYWALKING_SHARED_LIBADD="-lpthread $SKYWALKING_SHARED_LIBADD"
PHP_ADD_LIBRARY(pthread)
PHP_ADD_LIBRARY(dl,,SKYWALKING_SHARED_LIBADD)
PHP_ADD_LIBRARY(dl)
case $host in
*darwin*)
;;
*)
PHP_ADD_LIBRARY(rt,,SKYWALKING_SHARED_LIBADD)
PHP_ADD_LIBRARY(rt)
;;
esac
PHP_SUBST(SKYWALKING_SHARED_LIBADD)
PHP_ADD_INCLUDE(src)
AC_DEFINE(HAVE_SKYWALKING, 1, [ Have skywalking support ])
PHP_NEW_EXTENSION(skywalking, \
skywalking.c \
src/sky_core_cross_process.c \
src/sky_core_log.c \
src/sky_core_module.c \
src/sky_core_segment.c \
src/sky_core_segment_reference.c \
src/sky_core_span.c \
src/sky_core_tag.c \
src/sky_plugin_curl.c \
src/sky_plugin_redis.c \
src/sky_util_base64.c \
src/sky_util_php.c \
src/sky_utils.c \
, $ext_shared)
PHP_ADD_BUILD_DIR($ext_builddir/src)
fi
if test -r $phpincludedir/ext/mysqli/mysqli_mysqlnd.h; then
AC_DEFINE([MYSQLI_USE_MYSQLND], 1, [Whether mysqlnd is enabled])
fi
shared_objects_skywalking="$srcdir/target/release/libsky_core_report.a $shared_objects_skywalking"
dnl PHP_SUBST(shared_objects_skywalking)
case $host in
*darwin*)
echo "$srcdir/target/release/libsky_core_report.a:\n cargo build --release --manifest-path=$srcdir/Cargo.toml" >> Makefile.objects
;;
*)
echo -e "$srcdir/target/release/libsky_core_report.a:\n cargo build --release --manifest-path=$srcdir/Cargo.toml" >> Makefile.objects
;;
esac