diff options
author | Alberto Compagno <acompagn+fdio@cisco.com> | 2019-12-03 16:00:27 +0000 |
---|---|---|
committer | Alberto Compagno <acompagn+fdio@cisco.com> | 2019-12-04 09:08:34 +0000 |
commit | 36d699cc16a609cb7cd87945b5a618448dca5889 (patch) | |
tree | 9e9d6acdfcf53a33ffc81c6c630ab86b18fd728e | |
parent | ac2224ae8845f414c1a7fa85aab4e7287fb1df84 (diff) |
[HICN-428] Creating libctrl deb and rpm packages specific for hicn-plugin
Signed-off-by: Alberto Compagno <acompagn+fdio@cisco.com>
Change-Id: I2460276eb400777105d3351dffdaf8452f01c51f
-rw-r--r-- | CMakeLists.txt | 1 | ||||
-rw-r--r-- | cmake/Modules/FindHicnPlugin.cmake | 2 | ||||
-rw-r--r-- | ctrl/libhicnctrl/CMakeLists.txt | 21 | ||||
-rw-r--r-- | ctrl/libhicnctrl/cmake/Modules/Packaging.cmake | 55 | ||||
-rw-r--r-- | ctrl/libhicnctrl/src/CMakeLists.txt | 4 | ||||
-rw-r--r-- | ctrl/libhicnctrl/src/hicn_plugin_api.c | 1 | ||||
-rw-r--r-- | libtransport/CMakeLists.txt | 3 | ||||
-rw-r--r-- | libtransport/cmake/Modules/Packaging.cmake | 4 |
8 files changed, 62 insertions, 29 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 9bff3d35e..f2deb1468 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -94,6 +94,7 @@ if (BUILD_HICNPLUGIN AND "${CMAKE_SYSTEM_NAME}" STREQUAL "Linux") endif() set(LIBTRANSPORT ${LIBTRANSPORT}-memif) + set(LIBHICNCTRL ${LIBHICNCTRL}-memif) endif() ## Libraries targets diff --git a/cmake/Modules/FindHicnPlugin.cmake b/cmake/Modules/FindHicnPlugin.cmake index 0e67e22d8..07e5f9a8c 100644 --- a/cmake/Modules/FindHicnPlugin.cmake +++ b/cmake/Modules/FindHicnPlugin.cmake @@ -30,6 +30,6 @@ find_path(HICNPLUGIN_INCLUDE_DIR vapi/hicn.api.vapi.h set(HICNPLUGIN_INCLUDE_DIRS ${HICNPLUGIN_INCLUDE_DIR} ${HICNPLUGIN_INCLUDE_DIR}/vpp_plugins) include(FindPackageHandleStandardArgs) -find_package_handle_standard_args(HicnPlugin DEFAULT_MSG HICNPLUGIN_INCLUDE_DIRS) +find_package_handle_standard_args(HicnPlugin DEFAULT_MSG HICNPLUGIN_INCLUDE_DIR) mark_as_advanced(HICNPLUGIN_INCLUDE_DIR)
\ No newline at end of file diff --git a/ctrl/libhicnctrl/CMakeLists.txt b/ctrl/libhicnctrl/CMakeLists.txt index 59620088e..2a131f155 100644 --- a/ctrl/libhicnctrl/CMakeLists.txt +++ b/ctrl/libhicnctrl/CMakeLists.txt @@ -34,25 +34,32 @@ set(CMAKE_C_STANDARD_REQUIRED ON) set(CMAKE_MACOSX_RPATH ON) if(CMAKE_SOURCE_DIR STREQUAL PROJECT_SOURCE_DIR) - - if (BUILD_CTRL_HICNPLUGIN AND "${CMAKE_SYSTEM_NAME}" STREQUAL "Linux") + set(HICNCTRL hicnctrl) + set(LIBHICNCTRL hicnctrl) + if (BUILD_HICNPLUGIN AND "${CMAKE_SYSTEM_NAME}" STREQUAL "Linux") + set(LIBHICNCTRL ${LIBHICNCTRL}-plugin) find_package_wrapper(HicnPlugin REQUIRED) - else () - find_package_wrapper(Libhicn REQUIRED) + list(APPEND HICN_LIBRARIES ${HICNPLUGIN_LIBRARIES}) + set(LINK_FLAGS "-Wl,-unresolved-symbols=ignore-in-shared-libs") endif() - set(HICNCTRL hicnctrl) - set(LIBHICNCTRL hicnctrl) + find_package_wrapper(Libhicn REQUIRED) + list(APPEND HICN_LIBRARIES ${LIBHICN_SHARED}) + set(LIBHICNCTRL_SHARED ${LIBHICNCTRL}.shared) set(LIBHICNCTRL_STATIC ${LIBHICNCTRL}.static) + set(HICN_INCLUDE_DIRS + ${HICN_INCLUDE_DIRS} + ${HICNPLUGIN_INCLUDE_DIRS}) + else() if (${CMAKE_SYSTEM_NAME} STREQUAL "Android") set(HICN_LIBRARIES ${LIBHICN_STATIC} log) list(APPEND DEPENDENCIES ${LIBHICN_STATIC} ) - elseif (BUILD_CTRL_HICNPLUGIN AND "${CMAKE_SYSTEM_NAME}" STREQUAL "Linux") + elseif (BUILD_HICNPLUGIN AND "${CMAKE_SYSTEM_NAME}" STREQUAL "Linux") set(HICN_INCLUDE_DIRS ${HICN_INCLUDE_DIRS} ${HICNPLUGIN_INCLUDE_DIRS}) diff --git a/ctrl/libhicnctrl/cmake/Modules/Packaging.cmake b/ctrl/libhicnctrl/cmake/Modules/Packaging.cmake index cbee25d35..92e9d4adb 100644 --- a/ctrl/libhicnctrl/cmake/Modules/Packaging.cmake +++ b/ctrl/libhicnctrl/cmake/Modules/Packaging.cmake @@ -25,22 +25,45 @@ set(${LIBHICNCTRL_COMPONENT}-dev_DESCRIPTION CACHE STRING "Description for deb/rpm package." ) -set(${LIBHICNCTRL_COMPONENT}_DEB_DEPENDENCIES - "" - CACHE STRING "Dependencies for deb/rpm package." -) +if (BUILD_HICNPLUGIN AND "${CMAKE_SYSTEM_NAME}" STREQUAL "Linux") + set(${LIBHICNCTRL_COMPONENT}_DEB_DEPENDENCIES + "" + CACHE STRING "Dependencies for deb/rpm package." + ) -set(${LIBHICNCTRL_COMPONENT}-dev_DEB_DEPENDENCIES - "${LIBHICNCTRL_COMPONENT} (>= stable_version)" - CACHE STRING "Dependencies for deb/rpm package." -) + set(${LIBHICNCTRL_COMPONENT}-dev_DEB_DEPENDENCIES + "${LIBHICNCTRL_COMPONENT} (>= stable_version), hicn-plugin-dev (>= stable_version-release), hicn-plugin-dev (<< next_version-release)" + CACHE STRING "Dependencies for deb/rpm package." + ) -set(${LIBHICNCTRL_COMPONENT}_RPM_DEPENDENCIES - "" - CACHE STRING "Dependencies for deb/rpm package." -) + set(${LIBHICNCTRL_COMPONENT}_RPM_DEPENDENCIES + "" + CACHE STRING "Dependencies for deb/rpm package." + ) + + set(${LIBHICNCTRL_COMPONENT}-dev_RPM_DEPENDENCIES + "${LIBHICNCTRL_COMPONENT} >= stable_version, hicn-plugin-dev >= stable_version-release, hicn-plugin-dev < next_version-release" + CACHE STRING "Dependencies for deb/rpm package." + ) -set(${LIBHICNCTRL_COMPONENT}-dev_RPM_DEPENDENCIES - "${LIBHICNCTRL_COMPONENT} >= stable_version" - CACHE STRING "Dependencies for deb/rpm package." -)
\ No newline at end of file +else () + set(${LIBHICNCTRL_COMPONENT}_DEB_DEPENDENCIES + "" + CACHE STRING "Dependencies for deb/rpm package." + ) + + set(${LIBHICNCTRL_COMPONENT}-dev_DEB_DEPENDENCIES + "${LIBHICNCTRL_COMPONENT} (>= stable_version)" + CACHE STRING "Dependencies for deb/rpm package." + ) + + set(${LIBHICNCTRL_COMPONENT}_RPM_DEPENDENCIES + "" + CACHE STRING "Dependencies for deb/rpm package." + ) + + set(${LIBHICNCTRL_COMPONENT}-dev_RPM_DEPENDENCIES + "${LIBHICNCTRL_COMPONENT} >= stable_version" + CACHE STRING "Dependencies for deb/rpm package." +) +endif()
\ No newline at end of file diff --git a/ctrl/libhicnctrl/src/CMakeLists.txt b/ctrl/libhicnctrl/src/CMakeLists.txt index 42fe3d543..6f4066238 100644 --- a/ctrl/libhicnctrl/src/CMakeLists.txt +++ b/ctrl/libhicnctrl/src/CMakeLists.txt @@ -30,7 +30,7 @@ set(SOURCE_FILES route.c ) -if(BUILD_CTRL_HICNPLUGIN) +if(BUILD_HICNPLUGIN) set(SOURCE_FILES ${SOURCE_FILES} hicn_plugin_api.c @@ -53,7 +53,7 @@ set(INCLUDE_DIRS ${HICN_INCLUDE_DIRS} ) -# Android requires static libraries +# Android requires static libraries if (${CMAKE_SYSTEM_NAME} STREQUAL "Android") set(LIBRARIES ${LIBRARIES} ${LIBHICN_STATIC}) set(LINK_TYPE STATIC) diff --git a/ctrl/libhicnctrl/src/hicn_plugin_api.c b/ctrl/libhicnctrl/src/hicn_plugin_api.c index d0f1eae10..233abb0f8 100644 --- a/ctrl/libhicnctrl/src/hicn_plugin_api.c +++ b/ctrl/libhicnctrl/src/hicn_plugin_api.c @@ -360,6 +360,7 @@ int hc_sock_connect(hc_sock_t *s) { vapi_ctx_free(vapi_skc.g_vapi_ctx_instance); goto ERR_CONNECT; } + s->g_vapi_ctx_instance = vapi_skc.g_vapi_ctx_instance; printf("[hc_sock_connect] *connected %s ok", APP_NAME); } else if (s->async == vapi_skc.async){ s->g_vapi_ctx_instance = vapi_skc.g_vapi_ctx_instance; diff --git a/libtransport/CMakeLists.txt b/libtransport/CMakeLists.txt index a76e91208..d58df5c07 100644 --- a/libtransport/CMakeLists.txt +++ b/libtransport/CMakeLists.txt @@ -70,9 +70,11 @@ find_package_wrapper(Libparc REQUIRED) find_package_wrapper(Asio REQUIRED) if(CMAKE_SOURCE_DIR STREQUAL PROJECT_SOURCE_DIR) + set(LIBTRANSPORT hicntransport) if (__vpp__) find_package_wrapper(HicnPlugin REQUIRED) find_package(Libmemif REQUIRED) + set(LIBTRANSPORT ${LIBTRANSPORT}-memif) list(APPEND LIBRARIES ${LIBMEMIF_LIBRARIES} @@ -81,7 +83,6 @@ if(CMAKE_SOURCE_DIR STREQUAL PROJECT_SOURCE_DIR) find_package_wrapper(Libhicn REQUIRED) - set(LIBTRANSPORT hicntransport) set(LIBTRANSPORT_SHARED ${LIBTRANSPORT}.shared) set(LIBTRANSPORT_STATIC ${LIBTRANSPORT}.static) else() diff --git a/libtransport/cmake/Modules/Packaging.cmake b/libtransport/cmake/Modules/Packaging.cmake index bd6bfc11a..844df42cc 100644 --- a/libtransport/cmake/Modules/Packaging.cmake +++ b/libtransport/cmake/Modules/Packaging.cmake @@ -42,12 +42,12 @@ if ((BUILD_MEMIF_CONNECTOR OR BUILD_HICNPLUGIN) AND "${CMAKE_SYSTEM_NAME}" STREQ ) set(lib${LIBTRANSPORT}-dev_DEB_DEPENDENCIES - "lib${LIBTRANSPORT} (>= stable_version), libasio-dev (>= 1.10), libhicn-dev (>= stable_version), libmemif-dev (>= stable_version), libparc-dev (>= 1.0), vpp-dev (>= stable_version-release), vpp-dev (<< next_version-release)" + "lib${LIBTRANSPORT} (>= stable_version), libasio-dev (>= 1.10), libhicn-dev (>= stable_version), libmemif-dev (>= stable_version), libparc-dev (>= 1.0), vpp-dev (>= stable_version-release), vpp-dev (<< next_version-release), hicn-plugin-dev (>= stable_version-release), hicn-plugin-dev (<< next_version-release)" CACHE STRING "Dependencies for deb/rpm package." ) set(lib${LIBTRANSPORT}-dev_RPM_DEPENDENCIES - "lib${LIBTRANSPORT} >= stable_version, asio-devel >= 1.10, lib${LIBHICN}-devel >= stable_version, libmemif-devel >= stable_version, libparc-devel >= 1.0, vpp-devel >= stable_version-release, vpp-devel < next_version-release" + "lib${LIBTRANSPORT} >= stable_version, asio-devel >= 1.10, lib${LIBHICN}-devel >= stable_version, libmemif-devel >= stable_version, libparc-devel >= 1.0, vpp-devel >= stable_version-release, vpp-devel < next_version-release, hicn-plugin-dev >= stable_version-release, hicn-plugin-dev < next_version-release" CACHE STRING "Dependencies for deb/rpm package." ) |