From 2d530b6451704d41dab064f19f52b1a331f7ae99 Mon Sep 17 00:00:00 2001 From: heyanlong Date: Mon, 10 Dec 2018 11:34:19 +0800 Subject: [PATCH] fix bugs --- README.md | 2 ++ sky-php7ext/config.m4 | 44 ++---------------------- sky-php7ext/src/report/report_client.cpp | 2 +- 3 files changed, 5 insertions(+), 43 deletions(-) diff --git a/README.md b/README.md index 63e75da..265dd05 100644 --- a/README.md +++ b/README.md @@ -13,6 +13,8 @@ SkyWalking APM : https://github.com/apache/incubator-skywalking * You need to add business codes to monnitor. # Dep +* libuuid +* gcc 4.9+ * pkg-config * grpc * protoc diff --git a/sky-php7ext/config.m4 b/sky-php7ext/config.m4 index 48b2f38..93c9b8c 100644 --- a/sky-php7ext/config.m4 +++ b/sky-php7ext/config.m4 @@ -29,51 +29,11 @@ if test -z "$PHP_DEBUG"; then fi if test "$PHP_SKYWALKING" != "no"; then - dnl Write more examples of tests here... - - dnl # --with-skywalking -> check with-path - dnl SEARCH_PATH="/usr/local /usr" # you might want to change this - dnl SEARCH_FOR="/include/skywalking.h" # you most likely want to change this - dnl if test -r $PHP_SKYWALKING/$SEARCH_FOR; then # path given as parameter - dnl SKYWALKING_DIR=$PHP_SKYWALKING - dnl else # search default path list - dnl AC_MSG_CHECKING([for skywalking files in default path]) - dnl for i in $SEARCH_PATH ; do - dnl if test -r $i/$SEARCH_FOR; then - dnl SKYWALKING_DIR=$i - dnl AC_MSG_RESULT(found in $i) - dnl fi - dnl done - dnl fi - dnl - dnl if test -z "$SKYWALKING_DIR"; then - dnl AC_MSG_RESULT([not found]) - dnl AC_MSG_ERROR([Please reinstall the skywalking distribution]) - dnl fi - - dnl # --with-skywalking -> add include path - dnl PHP_ADD_INCLUDE($SKYWALKING_DIR/include) - - dnl # --with-skywalking -> check for lib and symbol presence - dnl LIBNAME=skywalking # you may want to change this - dnl LIBSYMBOL=skywalking # you most likely want to change this - - dnl PHP_CHECK_LIBRARY($LIBNAME,$LIBSYMBOL, - dnl [ - dnl PHP_ADD_LIBRARY_WITH_PATH($LIBNAME, $SKYWALKING_DIR/$PHP_LIBDIR, SKYWALKING_SHARED_LIBADD) - dnl AC_DEFINE(HAVE_SKYWALKINGLIB,1,[ ]) - dnl ],[ - dnl AC_MSG_ERROR([wrong skywalking lib version or lib not found]) - dnl ],[ - dnl -L$SKYWALKING_DIR/$PHP_LIBDIR -lm - dnl ]) - dnl - dnl PHP_SUBST(SKYWALKING_SHARED_LIBADD) + CXXFLAGS+=" -std=c++11 " PHP_REQUIRE_CXX() - KYWALKING_LIBS=" -L/usr/local/lib " - KYWALKING_LIBS+=`pkg-config --libs protobuf grpc++ grpc` + KYWALKING_LIBS=`pkg-config --cflags --libs uuid protobuf grpc++ grpc` KYWALKING_LIBS+=" -Wl,--no-as-needed -lgrpc++_reflection -Wl,--as-needed -ldl " AC_OUTPUT_COMMANDS( diff --git a/sky-php7ext/src/report/report_client.cpp b/sky-php7ext/src/report/report_client.cpp index c7cb54e..6386b19 100644 --- a/sky-php7ext/src/report/report_client.cpp +++ b/sky-php7ext/src/report/report_client.cpp @@ -85,7 +85,7 @@ int main(int argc, char **argv) { } } - if (argc == 0) { + if (argc == 1) { std::cout << "report_client grpc log_path" << std::endl; std::cout << "e.g. report_client 120.0.0.1:11800 /tmp" << std::endl; return 0; -- GitLab