lib_LTLIBRARIES=@OCK_LIBLIBRARIES_STR@ @OPENSSL_LIBLIBRARIES_STR@ @PASSPHRASE_LIBLIBRARIES_STR@ @TSPI_LIBLIBRARIES_STR@
EXTRA_LTLIBRARIES=libecryptfs_pki_opencryptoki.la libecryptfs_pki_openssl.la libecryptfs_pki_passphrase.la libecryptfs_pki_tspi.la

if BUILD_OPENSSL
libecryptfs_pki_openssl_la_SOURCES = ecryptfs_pki_openssl.c
libecryptfs_pki_openssl_la_LDFLAGS = -lcrypto -rpath '$(libdir)'
endif

if BUILD_OCK
libecryptfs_pki_opencryptoki_la_SOURCES = ecryptfs_pki_opencryptoki.c
libecryptfs_pki_opencryptoki_la_LDFLAGS = -lopencryptoki -rpath '$(libdir)'
endif

if BUILD_TSPI
libecryptfs_pki_tspi_la_SOURCES = ecryptfs_pki_tspi.c
libecryptfs_pki_tspi_la_LDFLAGS = -ltspi -rpath '$(libdir)'
endif

libecryptfs_pki_passphrase_la_SOURCES = ecryptfs_pki_passphrase.c
libecryptfs_pki_passphrase_la_LDFLAGS = -lgcrypt -rpath '$(libdir)'

install-data-local:
	mkdir -p $(DESTDIR)/$(libdir)/ecryptfs/
	@OPENSSL_INSTALL_STR@
	@OCK_INSTALL_STR@
	@PASSPHRASE_INSTALL_STR@
	@TSPI_INSTALL_STR@
	chmod ugo+x $(DESTDIR)/$(libdir)/ecryptfs/*so
	strip $(DESTDIR)/$(libdir)/ecryptfs/*so
	@OPENSSL_SCRUB_STR@
	@OCK_SCRUB_STR@
	@PASSPHRASE_SCRUB_STR@
	@TSPI_SCRUB_STR@
	rm -f $(DESTDIR)/$(libdir)/libecryptfs_pki_*
