Skip to content

Commit

Permalink
Merge pull request softhsm#233 from dwmw2/develop
Browse files Browse the repository at this point in the history
Issue softhsm#230: Install p11-kit module file
  • Loading branch information
bellgrim authored Sep 30, 2016
2 parents f66970e + f1de8e2 commit a0804df
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 1 deletion.
7 changes: 6 additions & 1 deletion Makefile.am
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
ACLOCAL_AMFLAGS = -I m4

if P11_MODULE_FILE
p11moddir = $(pk_module_configs)
p11mod_DATA = softhsm2.module
endif

MAINTAINERCLEANFILES = \
config.log config.status \
config.log config.status softhsm2.module \
$(srcdir)/Makefile.in \
$(srcdir)/config.h.in $(srcdir)/config.h.in~ \
$(srcdir)/configure \
Expand Down
15 changes: 15 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,19 @@ softhsmtokendir=${full_localstatedir}/lib/softhsm/tokens/
full_libdir="$full_libdir/softhsm"
libdir=$full_libdir

AC_ARG_ENABLE([p11-kit],
AS_HELP_STRING([--disable-p11-kit], [Disable p11-kit integration]),
[use_p11kit=$enableval], [use_p11kit=yes])

pk_module_configs=
if test "x${use_p11kit}" != "xno"; then
AC_PATH_PROG(PKGCONFIG, [pkg-config])
if test "x${PKGCONFIG}" != "x" && ${PKGCONFIG} --exists p11-kit-1; then
pk_module_configs=`${PKGCONFIG} --variable=p11_module_configs p11-kit-1`
fi
fi
AM_CONDITIONAL([P11_MODULE_FILE], [test "x${pk_module_configs}" != "x"])

# For getConfigPath()
AC_CHECK_FUNCS([getpwuid_r])

Expand Down Expand Up @@ -174,6 +187,7 @@ AC_DEFINE_UNQUOTED(
[The default PKCS#11 library]
)

AC_SUBST([pk_module_configs])
AC_SUBST([softhsmtokendir])
AC_SUBST([default_softhsm2_conf])

Expand All @@ -184,6 +198,7 @@ AC_PROG_LIBTOOL
# Generate the makefiles
AC_CONFIG_FILES([
Makefile
softhsm2.module
src/Makefile
src/lib/Makefile
src/lib/common/Makefile
Expand Down
4 changes: 4 additions & 0 deletions softhsm2.module.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# This file describes how to load the pk11 module
# See: http://p11-glue.freedesktop.org/doc/p11-kit/config.html

module: @libdir@/libsofthsm2.so
3 changes: 3 additions & 0 deletions testing/build-softhsm2.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ case "$DISTRIBUTION" in
cd build &&
../configure --prefix="$INSTALL_ROOT" \
--disable-non-paged-memory \
--disable-p11-kit \
--with-migrate \
--with-crypto-backend=botan \
--with-botan="$INSTALL_ROOT" &&
Expand All @@ -45,6 +46,7 @@ case "$DISTRIBUTION" in
cd build &&
../configure --prefix="$INSTALL_ROOT" \
--disable-non-paged-memory \
--disable-p11-kit \
--with-migrate \
--with-crypto-backend=botan \
--with-botan="$INSTALL_ROOT" \
Expand Down Expand Up @@ -83,6 +85,7 @@ case "$DISTRIBUTION" in
cd build &&
../configure --prefix="$INSTALL_ROOT" \
--disable-non-paged-memory \
--disable-p11-kit \
--with-migrate \
--with-crypto-backend=botan \
--with-botan="$INSTALL_ROOT" &&
Expand Down

0 comments on commit a0804df

Please sign in to comment.