diff --git a/.github/workflows/composite/unit-integration-test-runner/run-integration-tests.sh b/.github/workflows/composite/unit-integration-test-runner/run-integration-tests.sh index a89779a3..b0f8fac8 100755 --- a/.github/workflows/composite/unit-integration-test-runner/run-integration-tests.sh +++ b/.github/workflows/composite/unit-integration-test-runner/run-integration-tests.sh @@ -1,4 +1,5 @@ #!/bin/bash +set -e INFO_BG="\033[0m\033[48;2;5;49;70m" INFO_FG="\033[38;2;19;181;255m" diff --git a/core/Makefile b/core/Makefile index 6736fe6b..dd0e4858 100644 --- a/core/Makefile +++ b/core/Makefile @@ -87,21 +87,20 @@ CRYPTO_INCLUDES += -I ../openssl/. CRYPTO_LIBS += -lssl -lcrypto CRYPTO_SOURCEFILES += pubnub_crypto.c pbcc_crypto.c pbcc_crypto_aes_cbc.c pbcc_crypto_legacy.c ../openssl/pbaes256.c -ifeq ($(shell uname),Darwin) - CRYPTO_CFLAGS := $(shell pkg-config --cflags openssl 2>/dev/null) - CRYPTO_LIBS := $(shell pkg-config --libs openssl 2>/dev/null) - - ifeq ($(CRYPTO_CFLAGS),) - CRYPTO_CFLAGS := -I/usr/local/opt/openssl/include - endif - ifeq ($(CRYPTO_LIBS),) - CRYPTO_LIBS := -L/usr/local/opt/openssl/lib -lssl -lcrypto - endif - - CRYPTO_INCLUDES += $(CRYPTO_CFLAGS) - CRYPTO_LIBS += $(CRYPTO_LIBS) +# Searching for proper OpenSSL paths. +CRYPTO_CFLAGS := $(shell pkg-config --cflags openssl 2>/dev/null) +CRYPTO_LIBS := $(shell pkg-config --libs openssl 2>/dev/null) + +ifeq ($(CRYPTO_CFLAGS),) + CRYPTO_CFLAGS := -I/usr/local/opt/openssl/include +endif +ifeq ($(CRYPTO_LIBS),) + CRYPTO_LIBS := -L/usr/local/opt/openssl/lib endif +CRYPTO_INCLUDES += $(CRYPTO_CFLAGS) +CRYPTO_LIBS += $(CRYPTO_LIBS) + pbcc_crypto_unittest: $(PROJECT_SOURCEFILES) $(CRYPTO_SOURCEFILES) pbcc_crypto_unit_tests.c gcc -o pbcc_crypto_unit_test.so -shared $(CFLAGS) $(LDFLAGS) $(CRYPTO_INCLUDES) $(CRYPTO_LIBS) -D PUBNUB_CRYPTO_API=1 -Wall $(COVERAGE_FLAGS) -fPIC $(PROJECT_SOURCEFILES) $(CRYPTO_SOURCEFILES) test/pubnub_test_mocks.c pbcc_crypto_unit_tests.c -lcgreen -lm # gcc -o pubnub_core_unit_testo $(CFLAGS) -Wall $(COVERAGE_FLAGS) $(PROJECT_SOURCEFILES) pbcc_crypto_unit_tests.c -lcgreen -lm diff --git a/cpp/posix_openssl.mk b/cpp/posix_openssl.mk index 12bb230e..0e6e0827 100644 --- a/cpp/posix_openssl.mk +++ b/cpp/posix_openssl.mk @@ -120,14 +120,27 @@ OS := $(shell uname) ifeq ($(OS),Darwin) SOURCEFILES += ../posix/monotonic_clock_get_time_darwin.c OBJFILES += monotonic_clock_get_time_darwin.o -LDLIBS=-lpthread -lssl -lcrypto -L/usr/local/opt/openssl/lib -CFLAGS += -I/usr/local/opt/openssl/include +LDLIBS=-lpthread -lssl -lcrypto else SOURCEFILES += ../posix/monotonic_clock_get_time_posix.c OBJFILES += monotonic_clock_get_time_posix.o LDLIBS=-lrt -lpthread -lssl -lcrypto endif +# Searching for proper OpenSSL paths. +OPENSSL_CFLAGS := $(shell pkg-config --cflags openssl 2>/dev/null) +OPENSSL_LIBS := $(shell pkg-config --libs openssl 2>/dev/null) + +ifeq ($(OPENSSL_CFLAGS),) + OPENSSL_CFLAGS := -I/usr/local/opt/openssl/include +endif +ifeq ($(OPENSSL_LIBS),) + OPENSSL_LIBS := -L/usr/local/opt/openssl/lib +endif + +CFLAGS += $(OPENSSL_CFLAGS) +LDLIBS += $(OPENSSL_LIBS) + all: openssl/pubnub_sync_sample openssl/pubnub_callback_sample openssl/pubnub_sync_grant_sample openssl/pubnub_callback_cpp11_sample openssl/cancel_subscribe_sync_sample openssl/subscribe_publish_callback_sample openssl/futres_nesting_sync openssl/fntest_runner openssl/futres_nesting_callback openssl/futres_nesting_callback_cpp11 diff --git a/openssl/posix.mk b/openssl/posix.mk index 445d083b..d20b7322 100644 --- a/openssl/posix.mk +++ b/openssl/posix.mk @@ -127,14 +127,27 @@ OS := $(shell uname) ifeq ($(OS),Darwin) SOURCEFILES += ../posix/monotonic_clock_get_time_darwin.c OBJFILES += monotonic_clock_get_time_darwin.o -LDLIBS = -lpthread -lssl -lcrypto -L/usr/local/opt/openssl/lib -CFLAGS += -I/usr/local/opt/openssl/include +LDLIBS = -lpthread -lssl -lcrypto else SOURCEFILES += ../posix/monotonic_clock_get_time_posix.c OBJFILES += monotonic_clock_get_time_posix.o LDLIBS=-lrt -lpthread -lssl -lcrypto endif +# Searching for proper OpenSSL paths. +OPENSSL_CFLAGS := $(shell pkg-config --cflags openssl 2>/dev/null) +OPENSSL_LIBS := $(shell pkg-config --libs openssl 2>/dev/null) + +ifeq ($(OPENSSL_CFLAGS),) + OPENSSL_CFLAGS := -I/usr/local/opt/openssl/include +endif +ifeq ($(OPENSSL_LIBS),) + OPENSSL_LIBS := -L/usr/local/opt/openssl/lib +endif + +CFLAGS += $(OPENSSL_CFLAGS) +LDLIBS += $(OPENSSL_LIBS) + INCLUDES=-I .. -I . -I ../lib/base64/