@@ -4,8 +4,56 @@ include ../../Makefile.defs
4
4
auto_gen =
5
5
NAME =http2d.so
6
6
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
9
25
10
26
include ../../Makefile.modules
11
27
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
0 commit comments