mirror of
https://github.com/ClassiCube/ClassiCube.git
synced 2025-09-12 17:17:09 -04:00
Use BearSSL + builtin HTTP on more posix platforms
This commit is contained in:
parent
a8daedc480
commit
9069b33ded
9
Makefile
9
Makefile
@ -79,6 +79,7 @@ endif
|
||||
ifeq ($(PLAT),sunos)
|
||||
LIBS = -lsocket -lX11 -lXi -lGL
|
||||
BUILD_DIR = build/solaris
|
||||
BEARSSL = 1
|
||||
endif
|
||||
|
||||
ifeq ($(PLAT),hp-ux)
|
||||
@ -86,6 +87,7 @@ ifeq ($(PLAT),hp-ux)
|
||||
LDFLAGS =
|
||||
LIBS = -lm -lX11 -lXi -lXext -L/opt/graphics/OpenGL/lib -lGL -lpthread
|
||||
BUILD_DIR = build/hpux
|
||||
BEARSSL = 1
|
||||
endif
|
||||
|
||||
ifeq ($(PLAT),darwin)
|
||||
@ -101,6 +103,7 @@ ifeq ($(PLAT),freebsd)
|
||||
LDFLAGS = -L /usr/local/lib -rdynamic
|
||||
LIBS = -lexecinfo -lGL -lX11 -lXi -lpthread
|
||||
BUILD_DIR = build/freebsd
|
||||
BEARSSL = 1
|
||||
endif
|
||||
|
||||
ifeq ($(PLAT),openbsd)
|
||||
@ -108,6 +111,7 @@ ifeq ($(PLAT),openbsd)
|
||||
LDFLAGS = -L /usr/X11R6/lib -L /usr/local/lib -rdynamic
|
||||
LIBS = -lexecinfo -lGL -lX11 -lXi -lpthread
|
||||
BUILD_DIR = build/openbsd
|
||||
BEARSSL = 1
|
||||
endif
|
||||
|
||||
ifeq ($(PLAT),netbsd)
|
||||
@ -115,6 +119,7 @@ ifeq ($(PLAT),netbsd)
|
||||
LDFLAGS = -L /usr/X11R7/lib -L /usr/pkg/lib -rdynamic
|
||||
LIBS = -lexecinfo -lGL -lX11 -lXi -lpthread
|
||||
BUILD_DIR = build/netbsd
|
||||
BEARSSL = 1
|
||||
endif
|
||||
|
||||
ifeq ($(PLAT),dragonfly)
|
||||
@ -122,6 +127,7 @@ ifeq ($(PLAT),dragonfly)
|
||||
LDFLAGS = -L /usr/local/lib -rdynamic
|
||||
LIBS = -lexecinfo -lGL -lX11 -lXi -lpthread
|
||||
BUILD_DIR = build/flybsd
|
||||
BEARSSL = 1
|
||||
endif
|
||||
|
||||
ifeq ($(PLAT),haiku)
|
||||
@ -131,6 +137,7 @@ ifeq ($(PLAT),haiku)
|
||||
LINK = $(CXX)
|
||||
LIBS = -lGL -lnetwork -lbe -lgame -ltracker
|
||||
BUILD_DIR = build/haiku
|
||||
BEARSSL = 1
|
||||
endif
|
||||
|
||||
ifeq ($(PLAT),beos)
|
||||
@ -146,12 +153,14 @@ endif
|
||||
ifeq ($(PLAT),serenityos)
|
||||
LIBS = -lgl -lSDL2
|
||||
BUILD_DIR = build/serenity
|
||||
BEARSSL = 1
|
||||
endif
|
||||
|
||||
ifeq ($(PLAT),irix)
|
||||
CC = gcc
|
||||
LIBS = -lGL -lX11 -lXi -lpthread -ldl
|
||||
BUILD_DIR = build/irix
|
||||
BEARSSL = 1
|
||||
endif
|
||||
|
||||
ifeq ($(PLAT),dos)
|
||||
|
@ -93,8 +93,12 @@ static int (*_X509_STORE_CTX_init)(X509_STORE_CTX* ctx, X509_STORE* store,
|
||||
|
||||
#if defined CC_BUILD_WIN
|
||||
static const cc_string cryptoLib = String_FromConst("libcrypto.dll");
|
||||
#elif defined CC_BUILD_HAIKU
|
||||
static const cc_string cryptoLib = String_FromConst("libcrypto.so.3");
|
||||
static const cc_string cryptoAlt = String_FromConst("libcrypto.so");
|
||||
#else
|
||||
static const cc_string cryptoLib = String_FromConst("libcrypto.so");
|
||||
static const cc_string cryptoAlt = String_FromConst("libcrypto.so.3");
|
||||
#endif
|
||||
|
||||
static X509_STORE* store;
|
||||
@ -119,7 +123,10 @@ void CertsBackend_Init(void) {
|
||||
};
|
||||
void* lib;
|
||||
|
||||
ossl_loaded = DynamicLib_LoadAll(&cryptoLib, funcs, Array_Elems(funcs), &lib);
|
||||
ossl_loaded = DynamicLib_LoadAll(&cryptoLib, funcs, Array_Elems(funcs), &lib);
|
||||
if (!lib) {
|
||||
ossl_loaded = DynamicLib_LoadAll(&cryptoAlt, funcs, Array_Elems(funcs), &lib);
|
||||
}
|
||||
}
|
||||
|
||||
static X509* ToOpenSSLCert(struct X509Cert* cert) {
|
||||
|
35
src/Core.h
35
src/Core.h
@ -229,7 +229,9 @@ typedef cc_uint8 cc_bool;
|
||||
#elif defined __serenity__
|
||||
#define CC_BUILD_SERENITY
|
||||
#define CC_BUILD_POSIX
|
||||
#define DEFAULT_NET_BACKEND CC_NET_BACKEND_LIBCURL
|
||||
#define DEFAULT_NET_BACKEND CC_NET_BACKEND_BUILTIN
|
||||
#define DEFAULT_SSL_BACKEND CC_SSL_BACKEND_BEARSSL
|
||||
#define DEFAULT_CRT_BACKEND CC_CRT_BACKEND_OPENSSL
|
||||
#define DEFAULT_AUD_BACKEND CC_AUD_BACKEND_OPENAL
|
||||
#define DEFAULT_GFX_BACKEND CC_GFX_BACKEND_GL1
|
||||
#define DEFAULT_WIN_BACKEND CC_WIN_BACKEND_SDL2
|
||||
@ -259,9 +261,10 @@ typedef cc_uint8 cc_bool;
|
||||
#define CC_BUILD_POSIX
|
||||
#define CC_BUILD_XINPUT2
|
||||
#define DEFAULT_NET_BACKEND CC_NET_BACKEND_BUILTIN
|
||||
#define DEFAULT_SSL_BACKEND CC_SSL_BACKEND_BEARSSL
|
||||
#define DEFAULT_CRT_BACKEND CC_CRT_BACKEND_OPENSSL
|
||||
#define DEFAULT_AUD_BACKEND CC_AUD_BACKEND_OPENAL
|
||||
#define DEFAULT_WIN_BACKEND CC_WIN_BACKEND_X11
|
||||
#define DEFAULT_CRT_BACKEND CC_CRT_BACKEND_OPENSSL
|
||||
#if defined CC_BUILD_RPI
|
||||
#define CC_BUILD_GLES
|
||||
#define CC_BUILD_EGL
|
||||
@ -301,7 +304,9 @@ typedef cc_uint8 cc_bool;
|
||||
#define CC_BUILD_SOLARIS
|
||||
#define CC_BUILD_POSIX
|
||||
#define CC_BUILD_XINPUT2
|
||||
#define DEFAULT_NET_BACKEND CC_NET_BACKEND_LIBCURL
|
||||
#define DEFAULT_NET_BACKEND CC_NET_BACKEND_BUILTIN
|
||||
#define DEFAULT_SSL_BACKEND CC_SSL_BACKEND_BEARSSL
|
||||
#define DEFAULT_CRT_BACKEND CC_CRT_BACKEND_OPENSSL
|
||||
#define DEFAULT_AUD_BACKEND CC_AUD_BACKEND_OPENAL
|
||||
#define DEFAULT_GFX_BACKEND CC_GFX_BACKEND_GL1
|
||||
#define DEFAULT_WIN_BACKEND CC_WIN_BACKEND_X11
|
||||
@ -320,7 +325,9 @@ typedef cc_uint8 cc_bool;
|
||||
#define CC_BUILD_POSIX
|
||||
#define CC_BUILD_BSD
|
||||
#define CC_BUILD_XINPUT2
|
||||
#define DEFAULT_NET_BACKEND CC_NET_BACKEND_LIBCURL
|
||||
#define DEFAULT_NET_BACKEND CC_NET_BACKEND_BUILTIN
|
||||
#define DEFAULT_SSL_BACKEND CC_SSL_BACKEND_BEARSSL
|
||||
#define DEFAULT_CRT_BACKEND CC_CRT_BACKEND_OPENSSL
|
||||
#define DEFAULT_AUD_BACKEND CC_AUD_BACKEND_OPENAL
|
||||
#define DEFAULT_GFX_BACKEND CC_GFX_BACKEND_GL1
|
||||
#define DEFAULT_WIN_BACKEND CC_WIN_BACKEND_X11
|
||||
@ -329,7 +336,9 @@ typedef cc_uint8 cc_bool;
|
||||
#define CC_BUILD_POSIX
|
||||
#define CC_BUILD_BSD
|
||||
#define CC_BUILD_XINPUT2
|
||||
#define DEFAULT_NET_BACKEND CC_NET_BACKEND_LIBCURL
|
||||
#define DEFAULT_NET_BACKEND CC_NET_BACKEND_BUILTIN
|
||||
#define DEFAULT_SSL_BACKEND CC_SSL_BACKEND_BEARSSL
|
||||
#define DEFAULT_CRT_BACKEND CC_CRT_BACKEND_OPENSSL
|
||||
#define DEFAULT_AUD_BACKEND CC_AUD_BACKEND_OPENAL
|
||||
#define DEFAULT_GFX_BACKEND CC_GFX_BACKEND_GL1
|
||||
#define DEFAULT_WIN_BACKEND CC_WIN_BACKEND_X11
|
||||
@ -338,7 +347,9 @@ typedef cc_uint8 cc_bool;
|
||||
#define CC_BUILD_POSIX
|
||||
#define CC_BUILD_BSD
|
||||
#define CC_BUILD_XINPUT2
|
||||
#define DEFAULT_NET_BACKEND CC_NET_BACKEND_LIBCURL
|
||||
#define DEFAULT_NET_BACKEND CC_NET_BACKEND_BUILTIN
|
||||
#define DEFAULT_SSL_BACKEND CC_SSL_BACKEND_BEARSSL
|
||||
#define DEFAULT_CRT_BACKEND CC_CRT_BACKEND_OPENSSL
|
||||
#define DEFAULT_AUD_BACKEND CC_AUD_BACKEND_OPENAL
|
||||
#define DEFAULT_GFX_BACKEND CC_GFX_BACKEND_GL1
|
||||
#define DEFAULT_WIN_BACKEND CC_WIN_BACKEND_X11
|
||||
@ -346,7 +357,9 @@ typedef cc_uint8 cc_bool;
|
||||
#define CC_BUILD_HAIKU
|
||||
#define CC_BUILD_POSIX
|
||||
#define CC_BACKTRACE_BUILTIN
|
||||
#define DEFAULT_NET_BACKEND CC_NET_BACKEND_LIBCURL
|
||||
#define DEFAULT_NET_BACKEND CC_NET_BACKEND_BUILTIN
|
||||
#define DEFAULT_SSL_BACKEND CC_SSL_BACKEND_BEARSSL
|
||||
#define DEFAULT_CRT_BACKEND CC_CRT_BACKEND_OPENSSL
|
||||
#define DEFAULT_AUD_BACKEND CC_AUD_BACKEND_OPENAL
|
||||
#define DEFAULT_GFX_BACKEND CC_GFX_BACKEND_GL1
|
||||
#define DEFAULT_WIN_BACKEND CC_WIN_BACKEND_BEOS
|
||||
@ -363,7 +376,9 @@ typedef cc_uint8 cc_bool;
|
||||
#define CC_BUILD_IRIX
|
||||
#define CC_BUILD_POSIX
|
||||
#define CC_BIG_ENDIAN
|
||||
#define DEFAULT_NET_BACKEND CC_NET_BACKEND_LIBCURL
|
||||
#define DEFAULT_NET_BACKEND CC_NET_BACKEND_BUILTIN
|
||||
#define DEFAULT_SSL_BACKEND CC_SSL_BACKEND_BEARSSL
|
||||
#define DEFAULT_CRT_BACKEND CC_CRT_BACKEND_OPENSSL
|
||||
#define DEFAULT_AUD_BACKEND CC_AUD_BACKEND_OPENAL
|
||||
#define DEFAULT_GFX_BACKEND CC_GFX_BACKEND_GL1
|
||||
#define DEFAULT_WIN_BACKEND CC_WIN_BACKEND_X11
|
||||
@ -529,7 +544,9 @@ typedef cc_uint8 cc_bool;
|
||||
#define CC_BUILD_OS2
|
||||
#define CC_BUILD_POSIX
|
||||
#define CC_BUILD_FREETYPE
|
||||
#define DEFAULT_NET_BACKEND CC_NET_BACKEND_LIBCURL
|
||||
#define DEFAULT_NET_BACKEND CC_NET_BACKEND_BUILTIN
|
||||
#define DEFAULT_SSL_BACKEND CC_SSL_BACKEND_BEARSSL
|
||||
#define DEFAULT_CRT_BACKEND CC_CRT_BACKEND_OPENSSL
|
||||
#define DEFAULT_GFX_BACKEND CC_GFX_BACKEND_SOFTGPU
|
||||
#define DEFAULT_WIN_BACKEND CC_WIN_BACKEND_OS2
|
||||
#elif defined PLAT_SATURN
|
||||
|
Loading…
x
Reference in New Issue
Block a user