Skip to content
Snippets Groups Projects
Unverified Commit 4bde1dbc authored by Roman Khabibov's avatar Roman Khabibov Committed by Alexander Turenko
Browse files

build: enable smtp

Enable smtp and smtps protocols in bundled libcurl. It is needed
to use SMTP client with tarantool's libcurl instead of system
libcurl.

See related issue: https://github.com/tarantool/smtp/issues/24

Part of #4559
parent c5049edc
No related branches found
No related tags found
No related merge requests found
## feature/build
* Enable smtp and smtps protocols in bundled libcurl (gh-4559).
......@@ -77,7 +77,7 @@ macro(curl_build)
# Switch off the group of protocols with special flag HTTP_ONLY:
# ftp, file, ldap, ldaps, rtsp, dict, telnet, tftp, pop3, imap, smtp.
list(APPEND LIBCURL_CMAKE_FLAGS "-DHTTP_ONLY=ON")
list(APPEND LIBCURL_CMAKE_FLAGS "-DHTTP_ONLY=OFF")
# Additionaly disable some more protocols.
list(APPEND LIBCURL_CMAKE_FLAGS "-DCURL_DISABLE_SMB=ON")
......@@ -142,7 +142,7 @@ macro(curl_build)
list(APPEND LIBCURL_CMAKE_FLAGS "-DCURL_DISABLE_TFTP=ON")
list(APPEND LIBCURL_CMAKE_FLAGS "-DCURL_DISABLE_POP3=ON")
list(APPEND LIBCURL_CMAKE_FLAGS "-DCURL_DISABLE_IMAP=ON")
list(APPEND LIBCURL_CMAKE_FLAGS "-DCURL_DISABLE_SMTP=ON")
list(APPEND LIBCURL_CMAKE_FLAGS "-DCURL_DISABLE_SMTP=OFF")
include(ExternalProject)
ExternalProject_Add(
......
......@@ -56,7 +56,7 @@ ffi.cdef([[
local info = ffi.C.curl_version_info(7)
local test = tap.test('curl-features')
test:plan(3)
test:plan(5)
if test:ok(info.ssl_version ~= nil, 'Curl built with SSL support') then
test:diag('ssl_version: ' .. ffi.string(info.ssl_version))
......@@ -78,6 +78,9 @@ else
RTLD_DEFAULT = ffi.cast("void *", 0LL)
end
--
-- gh-5223: Check if all curl symbols are exported.
--
-- The following list was obtained by parsing libcurl.a static library:
-- nm libcurl.a | grep -oP 'T \K(curl_.+)$' | sort
local curl_symbols = {
......@@ -174,4 +177,29 @@ test:test('curl_symbols', function(t)
end
end)
local function has_protocol(protocol_str)
local i = 0
-- curl_version_info_data.protocols is a null terminated array
-- of pointers to char.
-- See curl/lib/version.c:
-- static const char * const protocols[]
local info = ffi.C.curl_version_info(7)
local protocol = info.protocols[i]
while protocol ~= nil do
if ffi.string(protocol) == protocol_str then
return true
end
i = i + 1
protocol = info.protocols[i]
end
return false
end
--
-- gh-4559: check if smtp and smtps protocols are enabled.
--
test:ok(has_protocol('smtp'), 'smtp protocol is supported')
test:ok(has_protocol('smtps'), 'smtps protocol is supported')
os.exit(test:check() and 0 or 1)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment