From 22880c71c669edb8f33e25d13d76e756a6e37579 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9gory=20Soutad=C3=A9?= Date: Wed, 8 Jun 2022 11:39:05 +0200 Subject: [PATCH] Update Makefile to support separated OpenSSL3 compilation --- Makefile | 2 +- utils/Makefile | 10 +++++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 2ce770e..de87f9a 100644 --- a/Makefile +++ b/Makefile @@ -60,7 +60,7 @@ libgourou.so: $(OBJECTS) $(UPDFPARSERLIB) $(CXX) obj/*.o $(LDFLAGS) -o $@ -shared build_utils: - make -C utils ROOT=$(PWD) CXX=$(CXX) AR=$(AR) DEBUG=$(DEBUG) STATIC_UTILS=$(STATIC_UTILS) + make -C utils ROOT=$(PWD) CXX=$(CXX) AR=$(AR) DEBUG=$(DEBUG) STATIC_UTILS=$(STATIC_UTILS) OPENSSL3=$(OPENSSL3) clean: rm -rf libgourou.a libgourou.so obj diff --git a/utils/Makefile b/utils/Makefile index 386bd97..3d1de32 100644 --- a/utils/Makefile +++ b/utils/Makefile @@ -3,11 +3,18 @@ TARGETS=acsmdownloader adept_activate adept_remove adept_loan_mgt CXXFLAGS=-Wall -fPIC -I$(ROOT)/include -I$(ROOT)/lib/pugixml/src/ +LDFLAGS= + +ifneq ($(OPENSSL3),) # OpenSSL 1.1.0 compat CXXFLAGS += -DOPENSSL_API_COMPAT=0x10100000L +CXXFLAGS += -I/tmp/openssl3/usr/include/ -I/tmp/openssl3/usr/include/x86_64-linux-gnu +LDFLAGS += -L/tmp/openssl3/usr/lib/x86_64-linux-gnu -L/tmp/openssl3/usr/lib/x86_64-linux-gnu/ossl-modules +endif + STATIC_DEP= -LDFLAGS=-L$(ROOT) -lcrypto -lzip -lz -lcurl +LDFLAGS += -L$(ROOT) -lcrypto -lzip -lz -lcurl ifneq ($(STATIC_UTILS),) STATIC_DEP = $(ROOT)/libgourou.a @@ -21,6 +28,7 @@ else CXXFLAGS += -O2 endif + COMMON_DEPS = drmprocessorclientimpl.cpp utils_common.cpp COMMON_OBJECTS = $(COMMON_DEPS:.cpp=.o) COMMON_LIB = utils.a