Skip to content

Commit

Permalink
Add configure option to enable the static PKCS11 engine
Browse files Browse the repository at this point in the history
  • Loading branch information
Mulling committed Dec 20, 2024
1 parent 50b1363 commit 8ae9865
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
9 changes: 9 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,13 @@ AC_ARG_WITH(
]
)

AC_ARG_ENABLE(
[static-engine],
[AS_HELP_STRING([--enable-static-engine], [enable static engine (libpkcs11.a) build @<:@disabled@:>@])],
,
[enable_static_engine="no"]
)

AC_ARG_WITH(
[pkcs11-module],
[AS_HELP_STRING([--with-pkcs11-module], [default PKCS11 module])],
Expand Down Expand Up @@ -226,6 +233,7 @@ AC_SUBST([SHARED_EXT], $(eval echo "${shrext_cmds}"))
AM_CONDITIONAL([WIN32], [test "${WIN32}" = "yes"])
AM_CONDITIONAL([CYGWIN], [test "${CYGWIN}" = "yes"])
AM_CONDITIONAL([ENABLE_API_DOC], [test "${enable_api_doc}" = "yes"])
AM_CONDITIONAL([ENABLE_STATIC_ENGINE], [test "${enable_static_engine}" = "yes"])

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

Host: ${host}
Compiler: ${CC}
Expand Down
7 changes: 6 additions & 1 deletion src/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,11 @@ EXTRA_DIST = Makefile.mak libp11.rc.in pkcs11.rc.in

noinst_HEADERS= libp11-int.h pkcs11.h p11_pthread.h
include_HEADERS= libp11.h p11_err.h
if ENABLE_STATIC_ENGINE
lib_LTLIBRARIES = libp11.la libpkcs11.la
else
lib_LTLIBRARIES = libp11.la
endif
enginesexec_LTLIBRARIES = pkcs11.la
pkgconfig_DATA = libp11.pc

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

if ENABLE_STATIC_ENGINE
# Create a static version of the engine as well to allow applications
# to statically link into it.

libpkcs11_la_SOURCES = $(pkcs11_la_SOURCES)
libpkcs11_la_CFLAGS = $(pkcs11_la_CFLAGS)
libpkcs11_la_LIBADD = $(pkcs11_la_LIBADD)
endif

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

0 comments on commit 8ae9865

Please sign in to comment.