Debian Codegraph @

src/modules/tlsa/Makefile

raw symbols SCIP
1 #
2 # TLSA module makefile
3 #
4 #
5 # WARNING: do not run this directly, it should be run by the main Makefile
6
7 include ../../Makefile.defs
8 auto_gen=
9 NAME=tlsa.so
10
11 # set to yes when wanting to link with static libraries compiled from source
12 LIBSSL_STATIC_SRCLIB ?= no
13 # set to the path of the folder with static libraries compiled from source;
14 # can also be the folder where static OpenSSL libraries are installed
15 # in which case headers are expected to be in $LIBSSL_STATIC_SRCPATH/../include
16 LIBSSL_STATIC_SRCPATH ?= /usr/local/src/openssl
17 # or set to the path where the static libraries are installed, for example:
18 # LIBSSL_STATIC_SRCPATH ?= /usr/lib/x86_64-linux-gnu/
19
20 ifeq ($(CROSS_COMPILE),)
21 SSL_BUILDER=$(shell \
22 if pkg-config --exists libssl; then \
23 echo 'pkg-config libssl'; \
24 fi)
25 CRYPTO_BUILDER=$(shell \
26 if pkg-config --exists libcrypto; then \
27 echo 'pkg-config libcrypto'; \
28 fi)
29 endif
30
31 DEFS += -DKSR_LIBSSL_STATIC
32
33 ifneq ($(SSL_BUILDER),)
34
35 ifneq ($(LIBSSL_STATIC_SRCLIB),yes)
36 ## when static libs (*.a) from packages are compiled with -fPIC
37 DEFS += $(shell $(SSL_BUILDER) --cflags)
38 LIBS += $(shell $(SSL_BUILDER) --libs-only-L)
39 ifneq ($(CRYPTO_BUILDER),)
40 DEFS += $(shell $(CRYPTO_BUILDER) --cflags)
41 LIBS += $(shell $(CRYPTO_BUILDER) --libs-only-L)
42 endif # ifneq ($(CRYPTO_BUILDER),)
43
44 LIBS += -l:libssl.a -l:libcrypto.a -l:libz.a -ldl
45 # TODO: explore use of LIBS += -Wl,-Bstatic $(shell $(SSL_BUILDER) --libs-only-l)
46
47 else
48 ## when linking against static libs compiled from sources
49 ## default OpenSSL installation has lib/,lib64/ as siblings of include/
50 ifneq "$(wildcard $(LIBSSL_STATIC_SRCPATH)/../include )" ""
51 DEFS += -I$(LIBSSL_STATIC_SRCPATH)/../include
52 else
53 DEFS += -I$(LIBSSL_STATIC_SRCPATH)/include
54 endif
55 LIBS += $(LIBSSL_STATIC_SRCPATH)/libssl.a $(LIBSSL_STATIC_SRCPATH)/libcrypto.a \
56 -l:libz.a -ldl
57 endif # ifneq ($(LIBSSL_STATIC_SRCLIB),yes)
58
59 else # ifneq ($(SSL_BUILDER),)
60
61 DEFS += -I$(LOCALBASE)/ssl/include
62 LIBS += -L$(LOCALBASE)/lib -L$(LOCALBASE)/ssl/lib \
63 -L$(LOCALBASE)/lib64 -L$(LOCALBASE)/ssl/lib64 \
64 -l:libssl.a -l:libcrypto.a -l:libz.a -ldl
65 endif # ifneq ($(SSL_BUILDER),)
66
67 include ../../Makefile.modules