diff options
author | Fabio Alessandrelli <fabio.alessandrelli@gmail.com> | 2017-12-21 03:13:23 +0100 |
---|---|---|
committer | Fabio Alessandrelli <fabio.alessandrelli@gmail.com> | 2018-02-06 14:10:13 +0100 |
commit | 6a644d3ee19b7c68f28c02b29ea0a28c094b04f3 (patch) | |
tree | d3d1fbce2fe311a0a139570463835f9531a7fa61 /modules/websocket/SCsub | |
parent | fa33e0f62d9ee186464a725333662674bf1fa871 (diff) |
Add websocket module.
Webassembly is client-only for obvious reasons.
Other platforms support both client and server using libwebsockets.
Diffstat (limited to 'modules/websocket/SCsub')
-rw-r--r-- | modules/websocket/SCsub | 70 |
1 files changed, 70 insertions, 0 deletions
diff --git a/modules/websocket/SCsub b/modules/websocket/SCsub new file mode 100644 index 0000000000..067a99ffff --- /dev/null +++ b/modules/websocket/SCsub @@ -0,0 +1,70 @@ +#!/usr/bin/env python + +Import('env') +Import('env_modules') + +# Thirdparty source files + +env_lws = env_modules.Clone() + +thirdparty_dir = "#thirdparty/lws/" +helper_dir = "win32helpers/" +openssl_dir = "#thirdparty/openssl/" +thirdparty_sources = [ + "client/client.c", + "client/client-handshake.c", + "client/client-parser.c", + "client/ssl-client.c", + + "ext/extension.c", + "ext/extension-permessage-deflate.c", + + "server/fops-zip.c", + "server/lejp-conf.c", + "server/parsers.c", + "server/ranges.c", + "server/server.c", + "server/server-handshake.c", + "server/ssl-server.c", + + "misc/base64-decode.c", + "misc/lejp.c", + "misc/sha-1.c", + + "alloc.c", + "context.c", + "handshake.c", + "header.c", + "libwebsockets.c", + "minilex.c", + "output.c", + "pollfd.c", + "service.c", + "ssl.c", + +] + +if env_lws["platform"] == "android": # Builtin getifaddrs + thirdparty_sources += ["misc/getifaddrs.c"] + +if env_lws["platform"] == "windows": # Winsock + thirdparty_sources += ["plat/lws-plat-win.c", helper_dir + "getopt.c", helper_dir + "getopt_long.c", helper_dir + "gettimeofday.c"] +else: # Unix socket + thirdparty_sources += ["plat/lws-plat-unix.c"] + + +thirdparty_sources = [thirdparty_dir + file for file in thirdparty_sources] + +if env_lws["platform"] == "javascript": # No need to add third party libraries at all + pass +else: + env_lws.add_source_files(env.modules_sources, thirdparty_sources) + env_lws.Append(CPPPATH=[thirdparty_dir]) + + if env['builtin_openssl']: + env_lws.Append(CPPPATH=[openssl_dir]) + + if env_lws["platform"] == "windows": + env_lws.Append(CPPPATH=[thirdparty_dir + helper_dir]) + +env_lws.add_source_files(env.modules_sources, "*.cpp") |