Skip to content

Commit

Permalink
chore: introduce OPENSSL_STATIC to make, static link with openssl
Browse files Browse the repository at this point in the history
  • Loading branch information
zhaozg committed Mar 12, 2023
1 parent cc581ea commit a5cac5f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
5 changes: 5 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,12 @@ endif

#OpenSSL auto detect
OPENSSL_CFLAGS ?= $(shell $(PKG_CONFIG) openssl --cflags)
ifeq (${OPENSSL_STATIC},)
OPENSSL_LIBS ?= $(shell $(PKG_CONFIG) openssl --static --libs)
else
OPENSSL_LIBDIR ?= $(shell $(PKG_CONFIG) openssl --variable=libdir)
OPENSSL_LIBS ?= $(OPENSSL_LIBDIR)/libcrypto.a $(OPENSSL_LIBDIR)/libssl.a
endif

TARGET = $(MAKECMDGOALS)
ifeq (coveralls, ${TARGET})
Expand Down
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,11 @@ I try to use [luaunit](https://github.com/bluebird75/luaunit) to write unit
make install
make clean

If you want to make lua-openssl static link with openssl, please given
`OPENSSL_STATIC` flags, default will do dynamic link.

make OPENSSL_STAITC=1

### Howto 2: Build on Windows with MSVC.

Before building, please change the setting in the config.win file.
Expand Down

0 comments on commit a5cac5f

Please sign in to comment.