From bc2757ab796880a0ab979bdde1884231f983ead8 Mon Sep 17 00:00:00 2001 From: Eduardo Silva Date: Thu, 11 Jun 2015 11:49:53 -0600 Subject: [PATCH] in_http: fix linking to http library Signed-off-by: Eduardo Silva --- CMakeLists.txt | 2 +- lib/monkey/mk_server/CMakeLists.txt | 2 ++ plugins/in_http/CMakeLists.txt | 4 +++- plugins/in_http/in_http.c | 4 ++++ src/CMakeLists.txt | 4 ++-- 5 files changed, 12 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index bff7b6309cc..e48e38f029c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -43,7 +43,7 @@ if(WITH_DEBUG) endif() # General Headers -include_directories(include/ lib/ lib/msgpack-0.5.9/src) +include_directories(include/ lib/ lib/msgpack-0.5.9/src lib/monkey/include) # MSGPACK modification: disable the install routines.z set(MSGPACK_NO_INSTALL 1) diff --git a/lib/monkey/mk_server/CMakeLists.txt b/lib/monkey/mk_server/CMakeLists.txt index 1b54a4d50a5..d5ebfbf737b 100644 --- a/lib/monkey/mk_server/CMakeLists.txt +++ b/lib/monkey/mk_server/CMakeLists.txt @@ -1,3 +1,5 @@ +set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC") + set(src monkey.c mk_mimetype.c diff --git a/plugins/in_http/CMakeLists.txt b/plugins/in_http/CMakeLists.txt index 724085e2aaf..edac04fa607 100644 --- a/plugins/in_http/CMakeLists.txt +++ b/plugins/in_http/CMakeLists.txt @@ -2,4 +2,6 @@ set(src in_http.c) FLB_PLUGIN(in_http "${src}" "") -target_link_libraries(flb-plugin-in_http ${CMAKE_BINARY_DIR}/library/libmonkey.a) +target_link_libraries(flb-plugin-in_http + ${CMAKE_BINARY_DIR}/library/libmonkey.a + ${CMAKE_DL_LIBS}) diff --git a/plugins/in_http/in_http.c b/plugins/in_http/in_http.c index 8a8005a075f..17efb143e52 100644 --- a/plugins/in_http/in_http.c +++ b/plugins/in_http/in_http.c @@ -22,6 +22,7 @@ #include #include +#include #include #include @@ -30,6 +31,9 @@ /* Init CPU input */ int in_http_init(struct flb_config *config) { + mk_config = mk_server_init(); + mk_server_loop(); + return 0; } diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 12b35eb9526..c50111018c9 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -36,7 +36,7 @@ set_target_properties(fluent-bit-static PROPERTIES # Link dependencies to Fluent-Bit library core target_link_libraries(fluent-bit-shared msgpack mk_core jsmn ${FLB_PLUGINS}) -target_link_libraries(fluent-bit-static msgpack mk_core jsmn ${FLB_PLUGINS}) +target_link_libraries(fluent-bit-static msgpack mk_core jsmn dl ${FLB_PLUGINS}) # Library install routines install(TARGETS fluent-bit-shared LIBRARY DESTINATION lib) @@ -45,7 +45,7 @@ install(TARGETS fluent-bit-shared LIBRARY DESTINATION lib) if(NOT WITHOUT_BIN) find_package (Threads) add_executable(fluent-bit-bin fluent-bit.c) - target_link_libraries(fluent-bit-bin fluent-bit-static ${CMAKE_THREAD_LIBS_INIT}) + target_link_libraries(fluent-bit-bin fluent-bit-static ${CMAKE_THREAD_LIBS_INIT} ${CMAKE_DL_LIBS}) set_target_properties(fluent-bit-bin PROPERTIES OUTPUT_NAME fluent-bit) install(TARGETS fluent-bit-bin RUNTIME DESTINATION bin)