Browse Source
Almost the same as the previous one but squashing two patches which should have been and improving the inet_ntop() removing patch.
Skipping 1.3.0 as it was a bad version. Also removed all
custom patches are they don't seem to be required anymore, but
added new ones to make it build with MingW.
Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
(cherry picked from commit e4e95613cc) (edited)
edited:
- don't force pthreadGC2 but pthread
- removed non-gnu detection
Signed-off-by: Steve Lhomme <robux4@ycbcr.xyz>
pull/135/head
committed by
Hugo Beauzée-Luyssen
8 changed files with 119 additions and 119 deletions
@ -1,33 +0,0 @@ |
|||
From 671f9bc81168438d7cbc86f5946f2dbb720fa60e Mon Sep 17 00:00:00 2001 |
|||
From: Justin Kim <justin.kim@collabora.com> |
|||
Date: Thu, 19 Apr 2018 20:12:21 +0900 |
|||
Subject: [PATCH 1/2] CMakeLists.txt: substitute link flags for package names |
|||
|
|||
Signed-off-by: Justin Kim <justin.kim@collabora.com> |
|||
---
|
|||
CMakeLists.txt | 2 ++ |
|||
1 file changed, 2 insertions(+) |
|||
|
|||
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
|||
index 85eb9c5..77fbfb0 100644
|
|||
--- a/CMakeLists.txt
|
|||
+++ b/CMakeLists.txt
|
|||
@@ -90,6 +90,7 @@ if ( USE_GNUTLS )
|
|||
endif() |
|||
|
|||
pkg_check_modules (SSL REQUIRED ${SSL_REQUIRED_MODULES}) |
|||
+ set (SRT_LIBS_PRIVATE ${SSL_LDFLAGS})
|
|||
|
|||
add_definitions( |
|||
-DUSE_GNUTLS=1 |
|||
@@ -103,6 +104,7 @@ else()
|
|||
find_package(OpenSSL REQUIRED) |
|||
set (SSL_INCLUDE_DIRS ${OPENSSL_INCLUDE_DIR}) |
|||
set (SSL_LIBRARIES ${OPENSSL_LIBRARIES}) |
|||
+ set (SRT_LIBS_PRIVATE ${SSL_LIBRARIES})
|
|||
|
|||
add_definitions( |
|||
-DHAICRYPT_USE_OPENSSL_EVP=1 |
|||
--
|
|||
2.17.0 |
|||
|
|||
@ -0,0 +1,44 @@ |
|||
From 1658479fe1f113a02a7af48f53da6baeea5df482 Mon Sep 17 00:00:00 2001 |
|||
From: =?UTF-8?q?Olivier=20Cr=C3=AAte?= <olivier.crete@collabora.com> |
|||
Date: Mon, 9 Jul 2018 17:51:27 -0400 |
|||
Subject: [PATCH 1/3] api: Don't use inet_ntop |
|||
|
|||
It's not defined on Windows. Instead use getnameinfo with |
|||
the numeric request. |
|||
---
|
|||
srtcore/api.h | 15 ++++++--------- |
|||
1 file changed, 6 insertions(+), 9 deletions(-) |
|||
|
|||
diff --git a/srtcore/api.h b/srtcore/api.h
|
|||
index e6e9d3f..de3b4f0 100644
|
|||
--- a/srtcore/api.h
|
|||
+++ b/srtcore/api.h
|
|||
@@ -270,19 +270,16 @@ inline std::string SockaddrToString(const sockaddr* sadr)
|
|||
|
|||
std::ostringstream output; |
|||
char hostbuf[1024]; |
|||
+ int flags;
|
|||
|
|||
#if ENABLE_GETNAMEINFO |
|||
- if (!getnameinfo(sadr, sizeof(*sadr), hostbuf, 1024, NULL, 0, NI_NAMEREQD))
|
|||
- {
|
|||
- output << hostbuf;
|
|||
- }
|
|||
- else
|
|||
+ flags = NI_NAMEREQD;
|
|||
+#else
|
|||
+ flags = NI_NUMERICHOST | NI_NUMERICSERV;
|
|||
#endif |
|||
+
|
|||
+ if (!getnameinfo(sadr, sizeof(*sadr), hostbuf, 1024, NULL, 0, flags))
|
|||
{ |
|||
- if (inet_ntop(sadr->sa_family, addr, hostbuf, 1024) == NULL)
|
|||
- {
|
|||
- strcpy(hostbuf, "unknown");
|
|||
- }
|
|||
output << hostbuf; |
|||
} |
|||
|
|||
--
|
|||
2.17.1 |
|||
|
|||
@ -1,51 +0,0 @@ |
|||
From 6446d6c9294b63b3b1d363a4e92213a3bb5d4101 Mon Sep 17 00:00:00 2001 |
|||
From: Justin Kim <justin.kim@collabora.com> |
|||
Date: Fri, 23 Mar 2018 13:05:29 +0900 |
|||
Subject: [PATCH 2/2] CMakeLists.txt: let cmake find pthread |
|||
|
|||
---
|
|||
CMakeLists.txt | 24 ++++++------------------ |
|||
1 file changed, 6 insertions(+), 18 deletions(-) |
|||
|
|||
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
|||
index 77fbfb0..52d6bcd 100644
|
|||
--- a/CMakeLists.txt
|
|||
+++ b/CMakeLists.txt
|
|||
@@ -213,28 +213,16 @@ if (${ENABLE_PROFILE} AND HAVE_COMPILER_GNU_COMPAT)
|
|||
endif() |
|||
|
|||
|
|||
-if (NOT MINGW)
|
|||
# find pthread |
|||
-find_path(PTHREAD_INCLUDE_DIR pthread.h HINTS C:/pthread-win32/include)
|
|||
-if (PTHREAD_INCLUDE_DIR)
|
|||
- message(STATUS "Pthread include dir: ${PTHREAD_INCLUDE_DIR}")
|
|||
-else()
|
|||
- message(FATAL_ERROR "Failed to find pthread.h. Specify PTHREAD_INCLUDE_DIR.")
|
|||
-endif()
|
|||
-
|
|||
-find_library(PTHREAD_LIBRARY NAMES pthread pthread_dll pthread_lib HINTS C:/pthread-win32/lib)
|
|||
-if (PTHREAD_LIBRARY)
|
|||
- message(STATUS "Pthread library: ${PTHREAD_LIBRARY}")
|
|||
+set (THREADS_PTHREAD_ARG "2" CACHE STRING "Forcibly set by CMakeLists.txt." FORCE)
|
|||
+set (THREADS_PREFER_PTHREAD_FLAG ON)
|
|||
+find_package (Threads REQUIRED)
|
|||
+if (WIN32)
|
|||
+ set (SRT_LIBS_PRIVATE ${SRT_LIBS_PRIVATE} -lpthread)
|
|||
else() |
|||
- message(FATAL_ERROR "Failed to find pthread library. Specify PTHREAD_LIBRARY.")
|
|||
+ set (SRT_LIBS_PRIVATE ${SRT_LIBS_PRIVATE} ${CMAKE_THREAD_LIBS_INIT})
|
|||
endif() |
|||
|
|||
-elseif(THREADS_FOUND)
|
|||
- set(PTHREAD_LIBRARY ${CMAKE_THREAD_LIBS_INIT})
|
|||
-else()
|
|||
- find_library(PTHREAD_LIBRARY NAMES pthread pthreadGC2 pthreadGC)
|
|||
-endif() # if (NOT MINGW)
|
|||
-
|
|||
# This is required in some projects that add some other sources |
|||
# to the SRT library to be compiled together (aka "virtual library"). |
|||
if (DEFINED SRT_EXTRA_LIB_INC) |
|||
--
|
|||
2.17.0 |
|||
|
|||
@ -0,0 +1,27 @@ |
|||
From e4d6b4d7f26d8d839889ae8508856d5a108cc258 Mon Sep 17 00:00:00 2001 |
|||
From: =?UTF-8?q?Olivier=20Cr=C3=AAte?= <olivier.crete@collabora.com> |
|||
Date: Mon, 9 Jul 2018 18:04:44 -0400 |
|||
Subject: [PATCH 2/3] win32: Only include inttypes.h with MSVC |
|||
|
|||
---
|
|||
srtcore/platform_sys.h | 2 +- |
|||
1 file changed, 1 insertion(+), 1 deletion(-) |
|||
|
|||
diff --git a/srtcore/platform_sys.h b/srtcore/platform_sys.h
|
|||
index 33c4d9b..ce546d2 100644
|
|||
--- a/srtcore/platform_sys.h
|
|||
+++ b/srtcore/platform_sys.h
|
|||
@@ -15,9 +15,9 @@
|
|||
#include <ws2tcpip.h> |
|||
#include <ws2ipdef.h> |
|||
#include <windows.h> |
|||
- #include <inttypes.h>
|
|||
#include <stdint.h> |
|||
#if defined(_MSC_VER) |
|||
+ #include <inttypes.h>
|
|||
#pragma warning(disable:4251) |
|||
#endif |
|||
#else |
|||
--
|
|||
2.17.1 |
|||
|
|||
@ -0,0 +1,41 @@ |
|||
From cfc7871bad28737e5b0480c90643e7d09bf6f5cb Mon Sep 17 00:00:00 2001 |
|||
From: =?UTF-8?q?Olivier=20Cr=C3=AAte?= <olivier.crete@collabora.com> |
|||
Date: Mon, 9 Jul 2018 18:16:28 -0400 |
|||
Subject: [PATCH 3/3] cmake: Only install Windows headers in win subdir |
|||
|
|||
---
|
|||
CMakeLists.txt | 1 - |
|||
srtcore/platform_sys.h | 4 ++-- |
|||
2 files changed, 2 insertions(+), 3 deletions(-) |
|||
|
|||
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
|||
index daec198..b197c19 100644
|
|||
--- a/CMakeLists.txt
|
|||
+++ b/CMakeLists.txt
|
|||
@@ -450,7 +450,6 @@ endif()
|
|||
# will now apply to the dependent library. |
|||
#list(APPEND SOURCES_srt ${SOURCES_haicrypt}) |
|||
set (VIRTUAL_srt $<TARGET_OBJECTS:srt_virtual> $<TARGET_OBJECTS:haicrypt_virtual>) |
|||
-set (HEADERS_srt ${HEADERS_srt} ${HEADERS_srt_win32})
|
|||
|
|||
if (srt_libspec_shared) |
|||
add_library(${TARGET_srt}_shared SHARED ${VIRTUAL_srt}) |
|||
diff --git a/srtcore/platform_sys.h b/srtcore/platform_sys.h
|
|||
index ce546d2..e8e6927 100644
|
|||
--- a/srtcore/platform_sys.h
|
|||
+++ b/srtcore/platform_sys.h
|
|||
@@ -15,9 +15,9 @@
|
|||
#include <ws2tcpip.h> |
|||
#include <ws2ipdef.h> |
|||
#include <windows.h> |
|||
- #include <stdint.h>
|
|||
#if defined(_MSC_VER) |
|||
- #include <inttypes.h>
|
|||
+ #include <win/stdint.h>
|
|||
+ #include <win/inttypes.h>
|
|||
#pragma warning(disable:4251) |
|||
#endif |
|||
#else |
|||
--
|
|||
2.17.1 |
|||
|
|||
@ -1,2 +1 @@ |
|||
30bc7750e1a47d637c57fef9dcf0d1be02ac51831f041f75ea3bd2437f1e1bfd06848fbbdcfb5476267b9165b1a035e5bedfa9ea2f3c88ea536ee93c23e3cd46 srt-1.2.3.tar.gz |
|||
|
|||
1f8fdfc0e1d92bc8c477651982c23afeacb65e2293a7225227927e1b6f71a01355a3311600097d77b3df638503e4856acbcb52ed270b650480f20b98c1be5ec2 srt-1.3.1.tar.gz |
|||
@ -1,25 +0,0 @@ |
|||
--- srt.old/CMakeLists.txt 2017-12-09 09:10:02.000000000 +0100
|
|||
+++ srt/CMakeLists.txt 2017-12-09 09:18:38.000000000 +0100
|
|||
@@ -425,13 +425,15 @@
|
|||
# This may cause trouble when you want to compile your app with static libstdc++; |
|||
# if your build requires it, you'd probably remove -lstdc++ from the list |
|||
# obtained by `pkg-config --libs`. |
|||
-#
|
|||
-# Some sensible solution for that is desired. Currently turned on only on demand.
|
|||
-if (ENABLE_C_DEPS)
|
|||
-if ( LINUX )
|
|||
- set (IFNEEDED_SRT_LDFLAGS "${IFNEEDED_SRT_LDFLAGS} -lstdc++ -lm")
|
|||
-endif()
|
|||
-endif()
|
|||
+
|
|||
+message("Adding the following implicit link libraries: ${CMAKE_CXX_IMPLICIT_LINK_LIBRARIES}")
|
|||
+foreach(LIB ${CMAKE_CXX_IMPLICIT_LINK_LIBRARIES})
|
|||
+ if(IS_ABSOLUTE ${LIB} AND EXISTS ${LIB})
|
|||
+ set(SRT_LIBS_PRIVATE ${SRT_LIBS_PRIVATE} ${LIB})
|
|||
+ else()
|
|||
+ set(SRT_LIBS_PRIVATE ${SRT_LIBS_PRIVATE} "-l${LIB}")
|
|||
+ endif()
|
|||
+endforeach()
|
|||
|
|||
join_arguments(SRT_LIBS_PRIVATE ${SRT_LIBS_PRIVATE}) |
|||
|
|||
Loading…
Reference in new issue