diff options
author | Matthew Waters <matthew@centricular.com> | 2018-10-29 01:43:02 +1100 |
---|---|---|
committer | Nirbheek Chauhan <nirbheek.chauhan@gmail.com> | 2018-11-12 04:13:14 +0000 |
commit | 8ca02e6fe8bb151496dd6eb9961692c39894ec82 (patch) | |
tree | 6074d2ad6ebb47f94ebb7110427f534facd9c1ae | |
parent | aafbbd5637e458d445d103da52faac4a47b7d9ec (diff) |
srt: fix android NDK r18 building
-rw-r--r-- | recipes/srt.recipe | 7 | ||||
-rw-r--r-- | recipes/srt/0001-Allow-building-using-gnustl.patch | 72 |
2 files changed, 76 insertions, 3 deletions
diff --git a/recipes/srt.recipe b/recipes/srt.recipe index e8f4ad02..f6089c6c 100644 --- a/recipes/srt.recipe +++ b/recipes/srt.recipe @@ -20,12 +20,13 @@ class Recipe(recipe.Recipe): 'srt/0002-srt-Fix-MingW-build.patch', 'srt/0003-platform_sys-Only-include-inttypes.h-with-MSFT-compi.patch', 'srt/0004-MingW-needs-the-explicit-exports-too.patch', - 'srt/0005-Windows-Only-define-SRT_API-in-one-place.patch'] + 'srt/0005-Windows-Only-define-SRT_API-in-one-place.patch', + 'srt/0001-Allow-building-using-gnustl.patch'] def prepare(self): if self.config.target_platform == Platform.ANDROID: - self.append_env('CXXFLAGS', '-frtti', '-fexceptions', '`pkg-config --cflags gnustl`') - self.append_env('LDFLAGS', '-lgnustl') + self.append_env('CXXFLAGS', '-frtti', '-fexceptions') + self.configure_options += ' -DUSE_GNUSTL=ON' self.deps += ['gnustl'] def post_install(self): diff --git a/recipes/srt/0001-Allow-building-using-gnustl.patch b/recipes/srt/0001-Allow-building-using-gnustl.patch new file mode 100644 index 00000000..70d83d8f --- /dev/null +++ b/recipes/srt/0001-Allow-building-using-gnustl.patch @@ -0,0 +1,72 @@ +From cd531977c4d20950c22410ebcf1338dd5d0f19e6 Mon Sep 17 00:00:00 2001 +From: Matthew Waters <matthew@centricular.com> +Date: Sun, 28 Oct 2018 02:10:42 +1100 +Subject: [PATCH] Allow building using gnustl + +--- + CMakeLists.txt | 14 +++++++++++--- + 1 file changed, 11 insertions(+), 3 deletions(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 6014376..478a763 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -86,6 +86,7 @@ option(ENABLE_GETNAMEINFO "In-logs sockaddr-to-string should do rev-dns" OFF) + option(USE_GNUTLS "Should use gnutls instead of openssl" OFF) + option(ENABLE_C_DEPS "Extra library dependencies in srt.pc for C language" OFF) + option(USE_STATIC_LIBSTDCXX "Should use static rather than shared libstdc++" OFF) ++option(USE_GNUSTL "Get c++ library/headers from the gnustl.pc" OFF) + + set(TARGET_srt "srt" CACHE STRING "The name for the haisrt library") + +@@ -203,6 +204,12 @@ endif() + + message (STATUS "SSL libraries: ${SSL_LIBRARIES}") + ++if ( USE_GNUSTL ) ++ pkg_check_modules (GNUSTL REQUIRED gnustl) ++ link_directories(${GNUSTL_LIBRARY_DIRS}) ++ include_directories(${GNUSTL_INCLUDE_DIRS}) ++endif() ++ + # Detect if the compiler is GNU compatable for flags + set(HAVE_COMPILER_GNU_COMPAT 0) + foreach (gnid GNU Intel Clang AppleClang) +@@ -440,7 +447,7 @@ if (srt_libspec_shared) + set_property(TARGET ${TARGET_srt}_shared PROPERTY OUTPUT_NAME ${TARGET_srt}) + set_target_properties (${TARGET_srt}_shared PROPERTIES VERSION ${SRT_VERSION} SOVERSION ${SRT_VERSION_MAJOR}) + list (APPEND INSTALL_TARGETS ${TARGET_srt}_shared) +- target_link_libraries(${TARGET_srt}_shared PRIVATE ${SSL_LIBRARIES}) ++ target_link_libraries(${TARGET_srt}_shared PRIVATE ${SSL_LIBRARIES} ${GNUSTL_LIBRARIES} ${GNUSTL_LDFLAGS}) + if (MICROSOFT) + target_link_libraries(${TARGET_srt}_shared PRIVATE ws2_32.lib) + elseif (MINGW) +@@ -466,7 +473,7 @@ if (srt_libspec_static) + endif() + + list (APPEND INSTALL_TARGETS ${TARGET_srt}_static) +- target_link_libraries(${TARGET_srt}_static PRIVATE ${SSL_LIBRARIES}) ++ target_link_libraries(${TARGET_srt}_static PRIVATE ${SSL_LIBRARIES} ${GNUSTL_LIBRARIES} ${GNUSTL_LDFLAGS}) + if (MICROSOFT) + target_link_libraries(${TARGET_srt}_static PRIVATE ws2_32.lib) + elseif (MINGW) +@@ -488,7 +495,7 @@ endif() + + target_include_directories(haicrypt_virtual PRIVATE ${SSL_INCLUDE_DIRS}) + +-set (SRT_LIBS_PRIVATE ${SSL_LIBRARIES}) ++set (SRT_LIBS_PRIVATE ${SSL_LIBRARIES} ${GNUSTL_LIBRARIES} ${GNUSTL_LDFLAGS}) + + if (MICROSOFT) + set (SRT_LIBS_PRIVATE ${SRT_LIBS_PRIVATE} ws2_32.lib) +@@ -647,6 +654,7 @@ macro(srt_make_application name) + set_target_properties(${name} PROPERTIES COMPILE_FLAGS "${CFLAGS_CXX_STANDARD} ${EXTRA_stransmit}" ${FORCE_RPATH}) + + target_link_libraries(${name} ${srt_link_library}) ++ target_link_libraries(${name} PRIVATE ${GNUSTL_LIBRARIES} ${GNUSTL_LDFLAGS}) + endmacro() + + macro(srt_add_application name sources) +-- +2.19.0 + |