- all:
- changed-files:
- any-glob-to-all-files: "{\
+ CMake/FindLibrtmp.cmake,\
lib/curl_rtmp.*\
}"
configure: --enable-debug --disable-ldap --with-openssl=$(brew --prefix openssl)
macos-version-min: '10.15'
# cmake
- - name: 'OpenSSL gsasl AppleIDN'
- install: gsasl
- generate: -DOPENSSL_ROOT_DIR=$(brew --prefix openssl) -DCURL_USE_GSASL=ON -DUSE_APPLE_IDN=ON
+ - name: 'OpenSSL gsasl rtmp AppleIDN'
+ install: gsasl rtmpdump
+ generate: -DOPENSSL_ROOT_DIR=$(brew --prefix openssl) -DCURL_USE_GSASL=ON -DUSE_LIBRTMP=ON -DUSE_APPLE_IDN=ON
- name: 'OpenSSL +static libssh +examples'
install: libssh
generate: -DOPENSSL_ROOT_DIR=$(brew --prefix openssl) -DBUILD_STATIC_LIBS=ON -DCURL_USE_LIBSSH2=OFF -DCURL_USE_LIBSSH=ON
--- /dev/null
+#***************************************************************************
+# _ _ ____ _
+# Project ___| | | | _ \| |
+# / __| | | | |_) | |
+# | (__| |_| | _ <| |___
+# \___|\___/|_| \_\_____|
+#
+# Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
+#
+# This software is licensed as described in the file COPYING, which
+# you should have received as part of this distribution. The terms
+# are also available at https://curl.se/docs/copyright.html.
+#
+# You may opt to use, copy, modify, merge, publish, distribute and/or sell
+# copies of the Software, and permit persons to whom the Software is
+# furnished to do so, under the terms of the COPYING file.
+#
+# This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
+# KIND, either express or implied.
+#
+# SPDX-License-Identifier: curl
+#
+###########################################################################
+# Find the librtmp library
+#
+# Input variables:
+#
+# - `LIBRTMP_INCLUDE_DIR`: The librtmp include directory.
+# - `LIBRTMP_LIBRARY`: Path to `librtmp` library.
+#
+# Result variables:
+#
+# - `LIBRTMP_FOUND`: System has librtmp.
+# - `LIBRTMP_INCLUDE_DIRS`: The librtmp include directories.
+# - `LIBRTMP_LIBRARIES`: The librtmp library names.
+# - `LIBRTMP_LIBRARY_DIRS`: The librtmp library directories.
+# - `LIBRTMP_PC_REQUIRES`: The librtmp pkg-config packages.
+# - `LIBRTMP_CFLAGS`: Required compiler flags.
+# - `LIBRTMP_VERSION`: Version of librtmp.
+
+set(LIBRTMP_PC_REQUIRES "librtmp")
+
+if(CURL_USE_PKGCONFIG AND
+ NOT DEFINED LIBRTMP_INCLUDE_DIR AND
+ NOT DEFINED LIBRTMP_LIBRARY)
+ find_package(PkgConfig QUIET)
+ pkg_check_modules(LIBRTMP ${LIBRTMP_PC_REQUIRES})
+endif()
+
+if(LIBRTMP_FOUND AND LIBRTMP_INCLUDE_DIRS)
+ string(REPLACE ";" " " LIBRTMP_CFLAGS "${LIBRTMP_CFLAGS}")
+ message(STATUS "Found Librtmp (via pkg-config): ${LIBRTMP_INCLUDE_DIRS} (found version \"${LIBRTMP_VERSION}\")")
+else()
+ find_path(LIBRTMP_INCLUDE_DIR NAMES "librtmp/rtmp.h")
+ find_library(LIBRTMP_LIBRARY NAMES "rtmp")
+
+ unset(LIBRTMP_VERSION CACHE)
+ if(LIBRTMP_INCLUDE_DIR AND EXISTS "${LIBRTMP_INCLUDE_DIR}/librtmp/rtmp.h")
+ set(_version_regex "#[\t ]*define[\t ]+RTMP_LIB_VERSION[\t ]+0x([0-9a-fA-F][0-9a-fA-F])([0-9a-fA-F][0-9a-fA-F]).*")
+ file(STRINGS "${LIBRTMP_INCLUDE_DIR}/librtmp/rtmp.h" _version_str REGEX "${_version_regex}")
+ string(REGEX REPLACE "${_version_regex}" "\\1" _version_str1 "${_version_str}")
+ string(REGEX REPLACE "${_version_regex}" "\\2" _version_str2 "${_version_str}")
+ if(CMAKE_VERSION VERSION_LESS 3.13)
+ # No support for hex version numbers, just strip leading zeroes
+ string(REGEX REPLACE "^0" "" _version_str1 "${_version_str1}")
+ string(REGEX REPLACE "^0" "" _version_str2 "${_version_str2}")
+ else()
+ math(EXPR _version_str1 "0x${_version_str1}" OUTPUT_FORMAT DECIMAL)
+ math(EXPR _version_str2 "0x${_version_str2}" OUTPUT_FORMAT DECIMAL)
+ endif()
+ set(LIBRTMP_VERSION "${_version_str1}.${_version_str2}")
+ unset(_version_regex)
+ unset(_version_str1)
+ unset(_version_str2)
+ endif()
+
+ include(FindPackageHandleStandardArgs)
+ find_package_handle_standard_args(Librtmp
+ REQUIRED_VARS
+ LIBRTMP_INCLUDE_DIR
+ LIBRTMP_LIBRARY
+ VERSION_VAR
+ LIBRTMP_VERSION
+ )
+
+ if(LIBRTMP_FOUND)
+ set(LIBRTMP_INCLUDE_DIRS ${LIBRTMP_INCLUDE_DIR})
+ set(LIBRTMP_LIBRARIES ${LIBRTMP_LIBRARY})
+ endif()
+
+ mark_as_advanced(LIBRTMP_INCLUDE_DIR LIBRTMP_LIBRARY)
+
+ # Necessary when linking a static librtmp
+ find_package(OpenSSL)
+ if(OPENSSL_FOUND)
+ list(APPEND LIBRTMP_LIBRARIES OpenSSL::SSL OpenSSL::Crypto)
+ endif()
+endif()
+
+if(WIN32)
+ list(APPEND LIBRTMP_LIBRARIES "winmm")
+endif()
endif()
# Check symbol in an OpenSSL-like TLS backend, or in _extra_libs depending on it.
-macro(curl_openssl_check_symbol_exists _symbol _files _variable _extra_libs)
+macro(curl_openssl_check_symbol_exists _symbol _files _variable)
cmake_push_check_state()
if(USE_OPENSSL)
list(APPEND CMAKE_REQUIRED_INCLUDES "${OPENSSL_INCLUDE_DIR}")
endif()
list(APPEND CMAKE_REQUIRED_DEFINITIONS "-DHAVE_UINTPTR_T") # to pull in stdint.h (as of wolfSSL v5.5.4)
endif()
- list(APPEND CMAKE_REQUIRED_LIBRARIES "${_extra_libs}")
check_symbol_exists("${_symbol}" "${_files}" "${_variable}")
cmake_pop_check_state()
endmacro()
macro(curl_openssl_check_quic)
if(NOT DEFINED HAVE_SSL_CTX_SET_QUIC_METHOD)
if(USE_OPENSSL)
- curl_openssl_check_symbol_exists("SSL_CTX_set_quic_method" "openssl/ssl.h" HAVE_SSL_CTX_SET_QUIC_METHOD "")
+ curl_openssl_check_symbol_exists("SSL_CTX_set_quic_method" "openssl/ssl.h" HAVE_SSL_CTX_SET_QUIC_METHOD)
endif()
if(USE_WOLFSSL)
curl_openssl_check_symbol_exists("wolfSSL_set_quic_method" "wolfssl/options.h;wolfssl/openssl/ssl.h"
- HAVE_SSL_CTX_SET_QUIC_METHOD "")
+ HAVE_SSL_CTX_SET_QUIC_METHOD)
endif()
endif()
if(NOT HAVE_SSL_CTX_SET_QUIC_METHOD)
endmacro()
if(USE_WOLFSSL)
- curl_openssl_check_symbol_exists("wolfSSL_DES_ecb_encrypt" "wolfssl/options.h;wolfssl/openssl/des.h" HAVE_WOLFSSL_DES_ECB_ENCRYPT
- "")
- curl_openssl_check_symbol_exists("wolfSSL_BIO_new" "wolfssl/options.h;wolfssl/ssl.h" HAVE_WOLFSSL_BIO "")
- curl_openssl_check_symbol_exists("wolfSSL_BIO_set_shutdown" "wolfssl/options.h;wolfssl/ssl.h" HAVE_WOLFSSL_FULL_BIO "")
+ curl_openssl_check_symbol_exists("wolfSSL_DES_ecb_encrypt" "wolfssl/options.h;wolfssl/openssl/des.h" HAVE_WOLFSSL_DES_ECB_ENCRYPT)
+ curl_openssl_check_symbol_exists("wolfSSL_BIO_new" "wolfssl/options.h;wolfssl/ssl.h" HAVE_WOLFSSL_BIO)
+ curl_openssl_check_symbol_exists("wolfSSL_BIO_set_shutdown" "wolfssl/options.h;wolfssl/ssl.h" HAVE_WOLFSSL_FULL_BIO)
endif()
if(USE_OPENSSL OR USE_WOLFSSL)
if(NOT DEFINED HAVE_SSL_SET0_WBIO)
- curl_openssl_check_symbol_exists("SSL_set0_wbio" "openssl/ssl.h" HAVE_SSL_SET0_WBIO "")
+ curl_openssl_check_symbol_exists("SSL_set0_wbio" "openssl/ssl.h" HAVE_SSL_SET0_WBIO)
endif()
if(NOT DEFINED HAVE_OPENSSL_SRP AND NOT CURL_DISABLE_SRP)
- curl_openssl_check_symbol_exists("SSL_CTX_set_srp_username" "openssl/ssl.h" HAVE_OPENSSL_SRP "")
+ curl_openssl_check_symbol_exists("SSL_CTX_set_srp_username" "openssl/ssl.h" HAVE_OPENSSL_SRP)
endif()
endif()
# Be sure that the TLS library actually supports ECH.
if(USE_WOLFSSL)
curl_openssl_check_symbol_exists("wolfSSL_CTX_GenerateEchConfig" "wolfssl/options.h;wolfssl/ssl.h"
- HAVE_WOLFSSL_CTX_GENERATEECHCONFIG "")
+ HAVE_WOLFSSL_CTX_GENERATEECHCONFIG)
endif()
if(HAVE_BORINGSSL OR HAVE_AWSLC)
- curl_openssl_check_symbol_exists("SSL_set1_ech_config_list" "openssl/ssl.h"
- HAVE_SSL_SET1_ECH_CONFIG_LIST "")
+ curl_openssl_check_symbol_exists("SSL_set1_ech_config_list" "openssl/ssl.h" HAVE_SSL_SET1_ECH_CONFIG_LIST)
elseif(HAVE_OPENSSL)
- curl_openssl_check_symbol_exists("SSL_ech_set1_echconfig" "openssl/ech.h"
- HAVE_SSL_ECH_SET1_ECHCONFIG "")
+ curl_openssl_check_symbol_exists("SSL_ech_set1_echconfig" "openssl/ech.h" HAVE_SSL_ECH_SET1_ECHCONFIG)
endif()
if(HAVE_WOLFSSL_CTX_GENERATEECHCONFIG OR
HAVE_SSL_SET1_ECH_CONFIG_LIST OR
option(USE_LIBRTMP "Enable librtmp from rtmpdump" OFF)
if(USE_LIBRTMP)
- set(_extra_libs "rtmp")
- if(WIN32)
- list(APPEND _extra_libs "winmm")
- endif()
- curl_openssl_check_symbol_exists("RTMP_Init" "librtmp/rtmp.h" HAVE_LIBRTMP "${_extra_libs}")
- if(HAVE_LIBRTMP)
- list(APPEND CURL_LIBS "rtmp")
- list(APPEND LIBCURL_PC_REQUIRES_PRIVATE "librtmp")
- if(WIN32)
- list(APPEND CURL_LIBS "winmm")
- endif()
- else()
- message(WARNING "librtmp has been requested, but not found or missing OpenSSL. Skipping.")
- set(USE_LIBRTMP OFF)
+ find_package(Librtmp REQUIRED)
+ list(APPEND CURL_LIBS ${LIBRTMP_LIBRARIES})
+ list(APPEND CURL_LIBDIRS ${LIBRTMP_LIBRARY_DIRS})
+ list(APPEND LIBCURL_PC_REQUIRES_PRIVATE ${LIBRTMP_PC_REQUIRES})
+ include_directories(SYSTEM ${LIBRTMP_INCLUDE_DIRS})
+ link_directories(${LIBRTMP_LIBRARY_DIRS})
+ if(LIBRTMP_CFLAGS)
+ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${LIBRTMP_CFLAGS}")
endif()
endif()
CMake/FindLibgsasl.cmake \
CMake/FindLibidn2.cmake \
CMake/FindLibpsl.cmake \
+ CMake/FindLibrtmp.cmake \
CMake/FindLibssh.cmake \
CMake/FindLibssh2.cmake \
CMake/FindLibuv.cmake \
- `LIBIDN2_LIBRARY`: Path to `libidn2` library.
- `LIBPSL_INCLUDE_DIR`: The libpsl include directory.
- `LIBPSL_LIBRARY`: Path to `libpsl` library.
+- `LIBRTMP_INCLUDE_DIR`: The librtmp include directory.
+- `LIBRTMP_LIBRARY`: Path to `librtmp` library.
- `LIBSSH_INCLUDE_DIR`: The libssh include directory.
- `LIBSSH_LIBRARY`: Path to `libssh` library.
- `LIBSSH2_INCLUDE_DIR`: The libssh2 include directory.