Skip to content

Commit 7300cb8

Browse files
Mullingmtrojnar
authored andcommitted
Add configure option to enable the static PKCS11 engine
1 parent 5be6422 commit 7300cb8

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

configure.ac

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,13 @@ AC_ARG_WITH(
149149
]
150150
)
151151

152+
AC_ARG_ENABLE(
153+
[static-engine],
154+
[AS_HELP_STRING([--enable-static-engine], [enable static engine (libpkcs11.a) build @<:@disabled@:>@])],
155+
,
156+
[enable_static_engine="no"]
157+
)
158+
152159
AC_ARG_WITH(
153160
[pkcs11-module],
154161
[AS_HELP_STRING([--with-pkcs11-module], [default PKCS11 module])],
@@ -226,6 +233,7 @@ AC_SUBST([SHARED_EXT], $(eval echo "${shrext_cmds}"))
226233
AM_CONDITIONAL([WIN32], [test "${WIN32}" = "yes"])
227234
AM_CONDITIONAL([CYGWIN], [test "${CYGWIN}" = "yes"])
228235
AM_CONDITIONAL([ENABLE_API_DOC], [test "${enable_api_doc}" = "yes"])
236+
AM_CONDITIONAL([ENABLE_STATIC_ENGINE], [test "${enable_static_engine}" = "yes"])
229237

230238
if test "${enable_pedantic}" = "yes"; then
231239
enable_strict="yes";
@@ -283,6 +291,7 @@ libp11 directory: $(eval eval eval echo "${libdir}")
283291
Engine directory: ${enginesexecdir}
284292
Default PKCS11 module: ${pkcs11_module}
285293
API doc support: ${enable_api_doc}
294+
Static PKCS#11 engine ${enable_static_engine}
286295

287296
Host: ${host}
288297
Compiler: ${CC}

src/Makefile.am

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,11 @@ EXTRA_DIST = Makefile.mak libp11.rc.in pkcs11.rc.in
66

77
noinst_HEADERS= libp11-int.h pkcs11.h p11_pthread.h
88
include_HEADERS= libp11.h p11_err.h
9+
if ENABLE_STATIC_ENGINE
910
lib_LTLIBRARIES = libp11.la libpkcs11.la
11+
else
12+
lib_LTLIBRARIES = libp11.la
13+
endif
1014
enginesexec_LTLIBRARIES = pkcs11.la
1115
pkgconfig_DATA = libp11.pc
1216

@@ -49,12 +53,13 @@ pkcs11_la_LIBADD = $(libp11_la_OBJECTS) $(OPENSSL_LIBS)
4953
pkcs11_la_LDFLAGS = $(AM_LDFLAGS) -module -shared -shrext $(SHARED_EXT) \
5054
-avoid-version -export-symbols "$(srcdir)/pkcs11.exports"
5155

56+
if ENABLE_STATIC_ENGINE
5257
# Create a static version of the engine as well to allow applications
5358
# to statically link into it.
54-
5559
libpkcs11_la_SOURCES = $(pkcs11_la_SOURCES)
5660
libpkcs11_la_CFLAGS = $(pkcs11_la_CFLAGS)
5761
libpkcs11_la_LIBADD = $(pkcs11_la_LIBADD)
62+
endif
5863

5964
# OpenSSL older than 1.1.0 expected libpkcs11.so instead of pkcs11.so
6065
check-local: $(LTLIBRARIES)

0 commit comments

Comments
 (0)