Module: kamailio
Branch: master
Commit: 740b73e6dd174f2946e29cfc00c2a72063fd6645
URL:
https://github.com/kamailio/kamailio/commit/740b73e6dd174f2946e29cfc00c2a72…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2024-04-09T17:10:47+02:00
nghttp2: Makefile - link with additional libraries
---
Modified: src/modules/nghttp2/Makefile
---
Diff:
https://github.com/kamailio/kamailio/commit/740b73e6dd174f2946e29cfc00c2a72…
Patch:
https://github.com/kamailio/kamailio/commit/740b73e6dd174f2946e29cfc00c2a72…
---
diff --git a/src/modules/nghttp2/Makefile b/src/modules/nghttp2/Makefile
index d6b2dd84674..f71ba0c3556 100644
--- a/src/modules/nghttp2/Makefile
+++ b/src/modules/nghttp2/Makefile
@@ -38,7 +38,55 @@ else
LEVENTLIBS = $(shell $(LEVENT_BUILDER) --libs)
endif
-DEFS+=$(LNGHTTP2DEFS) $(LEVENTDEFS)
-LIBS=$(LNGHTTP2LIBS) $(LEVENTLIBS)
+
+ifeq ($(CROSS_COMPILE),)
+LEVENTSSL_BUILDER = $(shell \
+ if pkg-config --exists libevent_openssl; then \
+ echo 'pkg-config libevent_openssl'; \
+ fi)
+endif
+
+ifeq ($(LEVENTSSL_BUILDER),)
+ LEVENTSSLDEFS=-I$(LOCALBASE)/include -I$(SYSBASE)/include
+ LEVENTSSLLIBS=-L$(LOCALBASE)/lib -levent_openssl
+else
+ LEVENTSSLDEFS = $(shell $(LEVENTSSL_BUILDER) --cflags)
+ LEVENTSSLLIBS = $(shell $(LEVENTSSL_BUILDER) --libs)
+endif
+
+
+ifeq ($(CROSS_COMPILE),)
+LSSL_BUILDER=$(shell \
+ if pkg-config --exists libssl; then \
+ echo 'pkg-config libssl'; \
+ fi)
+LCRYPTO_BUILDER=$(shell \
+ if pkg-config --exists libcrypto; then \
+ echo 'pkg-config libcrypto'; \
+ fi)
+endif
+
+ifneq ($(LSSL_BUILDER),)
+ LSSLDEFS = $(shell $(LSSL_BUILDER) --cflags)
+ LSSLLIBS = $(shell $(LSSL_BUILDER) --libs)
+
+ifneq ($(CRYPTO_BUILDER),)
+ LCRYPTODEFS = $(shell $(LCRYPTO_BUILDER) --cflags)
+ LCRYPTOLIBS = $(shell $(LCRYPTO_BUILDER) --libs)
+endif
+
+else
+ LSSLDEFS = -I$(LOCALBASE)/ssl/include
+ LSSLLIBS = -L$(LOCALBASE)/lib -L$(LOCALBASE)/ssl/lib \
+ -L$(LOCALBASE)/lib64 -L$(LOCALBASE)/ssl/lib64 \
+ -lssl -lcrypto
+ LCRYPTODEFS =
+ LCRYPTOLIBS =
+endif
+
+
+
+DEFS+=$(LNGHTTP2DEFS) $(LEVENTDEFS) $(LEVENTSSLDEFS) $(LSSLDEFS) $(LCRYPTODEFS)
+LIBS=$(LNGHTTP2LIBS) $(LEVENTLIBS) $(LEVENTSSLLIBS) $(LSSLLIBS) $(LCRYPTOLIBS)
include ../../Makefile.modules