diff --git a/Makefile b/Makefile index 919514ea3..ee38db1ba 100644 --- a/Makefile +++ b/Makefile @@ -89,6 +89,14 @@ pkgconfigdir ?= $(libdir)/pkgconfig CFLAGS += -I$(INC_PATH) -I$(SRC_PATH) -I$(SRC_PATH)/wrappers/themis/ LDFLAGS += -L$(BIN_PATH) +ifneq ($(ENGINE),boringssl) +# Not all platforms include /usr/local in default search path +CFLAGS += -I/usr/local/include +LDFLAGS += -L/usr/local/lib +# Build shared libraries +CFLAGS += -fPIC +endif + ######################################################################## # # Pretty-printing utilities @@ -143,14 +151,14 @@ CRYPTO_ENGINE = $(SRC_PATH)/soter/$(CRYPTO_ENGINE_PATH) CFLAGS += -D$(CRYPTO_ENGINE_DEF) -DCRYPTO_ENGINE_PATH=$(CRYPTO_ENGINE_PATH) CFLAGS += $(CRYPTO_ENGINE_CFLAGS) - +ifeq ($(ENGINE),boringssl) # Basic compiler flags (lower priority than vendored boringssl) # Not all platforms include /usr/local in default search path CFLAGS += -I/usr/local/include LDFLAGS += -L/usr/local/lib # Build shared libraries CFLAGS += -fPIC - +endif # If we're building for macOS and there's Homebrew installed then prefer # Homebrew's OpenSSL instead of the system one by default.