Skip to content

Commit

Permalink
configure: detect --prefix when checking for P11_KIT
Browse files Browse the repository at this point in the history
If HAVE_P11KIT flag is set, install location will be changed (e.g.
'/usr/lib/x86_64-linux-gnu/pkcs11' on Ubuntu with libp11-kit-dev
package) even overwriting the path given by --prefix

This patch ensures that if --prefix is given even with the flag
HAVE_P11KIT is set, the install location will still use --prefix

Signed-off-by: Lim, Lukaz Wei Hwang <[email protected]>
  • Loading branch information
lukazlim authored and williamcroberts committed Sep 5, 2024
1 parent 51a573b commit fab3140
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
5 changes: 5 additions & 0 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,10 @@ endif # HAVE_LD_VERSION_SCRIPT
src_libtpm2_pkcs11_la_LIBADD = $(AM_LDFLAGS)
src_libtpm2_pkcs11_la_SOURCES = $(LIB_PKCS11_SRC) $(LIB_PKCS11_INTERNAL_LIB_SRC)

if HAVE_PREFIX
# Use standard install location when using --prefix
lib_LTLIBRARIES = $(libtpm2_pkcs11)
else
if HAVE_P11KIT
# Use P11 kit library module install location
p11libdir=$(P11_MODULE_PATH)
Expand All @@ -69,6 +73,7 @@ else
# Use standard install location when P11Kit is not found
lib_LTLIBRARIES = $(libtpm2_pkcs11)
endif
endif

AM_DISTCHECK_CONFIGURE_FLAGS = --with-p11kitconfigdir='$$(datarootdir)/p11kitconfigdir' --with-p11kitmoduledir='$$(libdir)'

Expand Down
4 changes: 4 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -485,6 +485,10 @@ AS_IF([test "x$have_p11kit" = "xyes"], [

AM_CONDITIONAL([HAVE_P11KIT], [test "x$have_p11kit" = "xyes"])

# check for --prefix and set flag HAVE_PREFIX if found
# do not change install location if --prefix is given and with P11_KIT found
AM_CONDITIONAL([HAVE_PREFIX], [test ! -z "$(prefix)"])

# END P11 CONFIG

AC_C_BIGENDIAN()
Expand Down

0 comments on commit fab3140

Please sign in to comment.