| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
include ../../Makefile.defs |
| 8 |
auto_gen= |
| 9 |
NAME=tlsa.so |
| 10 |
|
| 11 |
|
| 12 |
LIBSSL_STATIC_SRCLIB ?= no |
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
LIBSSL_STATIC_SRCPATH ?= /usr/local/src/openssl |
| 17 |
|
| 18 |
|
| 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 |
| 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 |
| 58 |
|
| 59 |
else |
| 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 |
| 66 |
|
| 67 |
include ../../Makefile.modules |