From e90179e12ad1773be772fc497e785c26cef6a8b8 Mon Sep 17 00:00:00 2001 From: José Bollo Date: Thu, 12 Oct 2017 22:39:51 +0200 Subject: Restore compilation of native-sdk MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I3855854407ad47c2b9a2288b8425513de5ae94d3 Signed-off-by: José Bollo --- src/CMakeLists.txt | 15 ++++++++++----- src/utils-systemd.c | 1 + 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index e7b946b..9921660 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -57,11 +57,20 @@ else() endif() pkg_check_modules(libsystemd libsystemd>=222) -if(NOT libsystemd_FOUND) +if(libsystemd_FOUND) + add_compile_options(${libsystemd_CFLAGS}) + include_directories(${libsystemd_INCLUDE_DIRS}) + link_libraries(${libsystemd_LIBRARIES}) +else() add_definitions(-DNO_LIBSYSTEMD) endif() pkg_check_modules(AFB afb-daemon>=4.99 libafbwsc>=4.99) +if(AFB_FOUND) + add_compile_options(${AFB_CFLAGS}) + include_directories(${AFB_INCLUDE_DIRS}) + link_libraries(${AFB_LIBRARIES}) +endif() ########################################################################### @@ -153,10 +162,6 @@ install(TARGETS wgtpkg-sign wgtpkg-pack wgtpkg-info wgtpkg-installer DESTINATION if(libsystemd_FOUND AND AFB_FOUND) MESSAGE(STATUS "Creating daemons") - add_compile_options(${libsystemd_CFLAGS} ${AFB_CFLAGS}) - include_directories(${libsystemd_INCLUDE_DIRS} ${AFB_INCLUDE_DIRS}) - link_libraries(${libsystemd_LIBRARIES} ${AFB_LIBRARIES}) - add_library(jbus STATIC utils-jbus.c) add_executable(afm-user-daemon afm-user-daemon.c) diff --git a/src/utils-systemd.c b/src/utils-systemd.c index d4d6929..1e77e27 100644 --- a/src/utils-systemd.c +++ b/src/utils-systemd.c @@ -34,6 +34,7 @@ struct sd_bus; struct sd_bus_message; typedef struct { const char *name; const char *message; } sd_bus_error; +# define sd_bus_unref(...) ((void)0) # define sd_bus_default_user(p) ((*(p)=NULL),(-ENOTSUP)) # define sd_bus_default_system(p) ((*(p)=NULL),(-ENOTSUP)) # define sd_bus_call_method(...) (-ENOTSUP) -- cgit 1.2.3-korg