diff --git a/Adapter.cc b/Adapter.cc index 7ec0cdb..2a96092 100644 --- a/Adapter.cc +++ b/Adapter.cc @@ -113,8 +113,11 @@ namespace pEp { void shutdown() { - if (_sync_thread) + pEpLog("called"); + if (_sync_thread) { + pEpLog("sync_is_running - injecting null event"); _inject_sync_event(nullptr, nullptr); + } } bool is_sync_running() @@ -123,4 +126,3 @@ namespace pEp { } } } - diff --git a/Adapter.hh b/Adapter.hh index 51dc87c..5f1d5d2 100644 --- a/Adapter.hh +++ b/Adapter.hh @@ -7,6 +7,13 @@ #include #include +// TODO: put into not yet existing libpEpAdapter_utils.h, to be across whole libpEpAdapter +#ifdef NDEBUG + #define pEpLog(msg) do{}while(0) +#else + #include + #define pEpLog(msg) do{std::cerr << __FILE__ << "::" << __FUNCTION__ << " - " << msg << '\n';} while(0) +#endif namespace pEp { diff --git a/Adapter.hxx b/Adapter.hxx index 3fd4db6..73947dc 100644 --- a/Adapter.hxx +++ b/Adapter.hxx @@ -47,7 +47,9 @@ namespace pEp { } } + pEpLog("sync protocol loop started"); do_sync_protocol(session(), (void *)obj); + pEpLog("sync protocol loop ended"); unregister_sync_callbacks(session()); session(release); @@ -88,4 +90,3 @@ namespace pEp { } } } - diff --git a/Makefile.conf b/Makefile.conf index ad355c9..bb95499 100644 --- a/Makefile.conf +++ b/Makefile.conf @@ -3,27 +3,33 @@ # This file may be used under the terms of the GNU General Public License version 3 # see LICENSE.txt -######### Header ######### HERE:=$(dir $(lastword $(MAKEFILE_LIST))) -######### General ######### -BUILD_FOR:=$(shell uname) + PREFIX=$(HOME) +CXXFLAGS=-std=c++11 -######### C and C++ ######### -CXXFLAGS=-std=c++11 +# Build target +BUILD_FOR:=$(shell uname) -######### C++ ######### ifeq ($(BUILD_FOR),Linux) + $(info Building for Linux) CXX=g++ + CXXFLAGS+=-fdiagnostics-color=always -O0 $(ENGINE_INC) -fPIC else ifeq ($(BUILD_FOR),Darwin) + $(info Building for Darwin) CXX=clang + CXXFLAGS+=-fcolor-diagnostics -O0 $(ENGINE_INC) endif -ifeq ($(BUILD_FOR),Linux) - CXXFLAGS+=-fdiagnostics-color=always -O0 -g $(ENGINE_INC) -fPIC -else ifeq ($(BUILD_FOR),Darwin) - CXXFLAGS+=-fcolor-diagnostics -O0 -g $(ENGINE_INC) +# Debug or Release build +DEBUG=1 +ifeq ($(DEBUG),1) + $(info Debug build (set DEBUG=0 for release build)) + CXXFLAGS+=-g +else + $(info Release Build (set DEBUG=1 for debug build)) + CXXFLAGS+=-DNDEBUG=1 endif ######### Engine ######### @@ -33,7 +39,8 @@ ENGINE_INC_PATH=$(HOME)/include ######### Overrides ######### -include $(HERE)/local.conf -# Add Prefixes to paths, if not already explicitly set in local.conf(s) +# Add -L Prefixes to LIB/INC paths, +# if not already explicitly set in local.conf ifndef ENGINE_LIB ENGINE_LIB=-L$(ENGINE_LIB_PATH) endif