Skip to content

Commit 0b94abd

Browse files
committedMay 27, 2024
http2d: add static build
1 parent 7bb3b8a commit 0b94abd

File tree

4 files changed

+58
-2
lines changed

4 files changed

+58
-2
lines changed
 

‎.gitmodules

+3
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,6 @@
44
[submodule "modules/launch_darkly/lib/c-server-sdk"]
55
path = modules/launch_darkly/lib/c-server-sdk
66
url = https://github.com/launchdarkly/c-server-sdk.git
7+
[submodule "modules/http2d/lib/nghttp2"]
8+
path = modules/http2d/lib/nghttp2
9+
url = https://github.com/nghttp2/nghttp2

‎modules/http2d/.gitignore

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
/lib/include
2+
/lib/lib
3+
/lib/build
4+
/lib/share

‎modules/http2d/Makefile

+50-2
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,56 @@ include ../../Makefile.defs
44
auto_gen=
55
NAME=http2d.so
66

7-
#DEFS +=-I$(LOCALBASE)/include
8-
LIBS +=-L$(LOCALBASE)/lib -lssl -lcrypto -levent -lnghttp2 -levent_openssl
7+
_makefile_path := $(lastword $(MAKEFILE_LIST))
8+
MOD_DIR ?= $(shell realpath `dirname $(_makefile_path)`)/modules/http2d
9+
10+
ifneq ($(HTTP2D_USE_SYSTEM),yes)
11+
HTTP2D_LOCALBASE ?= ./lib
12+
ifeq ($(HTTP2D_USE_SHARED),yes)
13+
HTTP2D_LIB_NAME ?= libnghttp2.so
14+
else
15+
HTTP2D_USE_SHARED = no
16+
HTTP2D_LIB_NAME ?= libnghttp2.a
17+
endif
18+
DEPS += lib/lib/$(HTTP2D_LIB_NAME)
19+
else
20+
HTTP2D_LOCALBASE ?= $(LOCALBASE)
21+
endif
22+
23+
DEFS+=-I$(HTTP2D_LOCALBASE)/include
24+
LIBS+=-L$(HTTP2D_LOCALBASE)/lib -lssl -lcrypto -levent -lnghttp2 -levent_openssl
925

1026
include ../../Makefile.modules
1127

28+
ifneq ($(HTTP2D_USE_SYSTEM),yes)
29+
lib/nghttp2/configure:
30+
$(Q)cd ./lib/nghttp2 && \
31+
autoreconf -i && \
32+
automake && \
33+
autoconf
34+
35+
lib/nghttp2/Makefile: lib/nghttp2/configure
36+
$(Q)cd ./lib/nghttp2 && \
37+
CFLAGS=-fPIC \
38+
./configure \
39+
--enable-lib-only \
40+
--enable-shared=$(HTTP2D_USE_SHARED) \
41+
--enable-silent-rules \
42+
--disable-app \
43+
--disable-failmalloc \
44+
--prefix=$(MOD_DIR)/lib
45+
46+
lib/lib/libnghttp2.a: lib/nghttp2/Makefile
47+
$(Q)$(MAKE) -C ./lib/nghttp2 install
48+
49+
clean: http2d-wolfssl-lib
50+
51+
.PHONY: http2d-wolfssl-lib
52+
http2d-wolfssl-lib:
53+
-@if [ -f ./lib/nghttp2/Makefile ]; then \
54+
$(MAKE) -C ./lib/nghttp2 clean; \
55+
fi;
56+
-@rm -rf ./lib/lib lib/share lib/include lib/bin \
57+
./lib/nghttp2/autom4te.cache \
58+
./lib/nghttp2/configure lib/nghttp2/Makefile
59+
endif

‎modules/http2d/lib/nghttp2

Submodule nghttp2 added at d13a575

0 commit comments

Comments
 (0)
Please sign in to comment.