diff --git a/Makefile.am b/Makefile.am index c9f9db6c..48b36e24 100644 --- a/Makefile.am +++ b/Makefile.am @@ -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) @@ -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)' diff --git a/configure.ac b/configure.ac index 0f1457e4..1ec6eb4c 100644 --- a/configure.ac +++ b/configure.ac @@ -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()