Skip to content

Commit 2c3a5fd

Browse files
committed
update Libs part of pkg-config file with configured MPI providers
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
1 parent 93dc29a commit 2c3a5fd

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

libtomcrypt.pc.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@ includedir=${prefix}/@CMAKE_INSTALL_INCLUDEDIR@/@PROJECT_NAME@
66
Name: LibTomCrypt
77
Description: public domain open source cryptographic toolkit
88
Version: @PROJECT_VERSION@
9-
Libs: -L${libdir} -ltomcrypt
9+
Libs: -L${libdir} -ltomcrypt @MPI_PROVIDERS@
1010
Cflags: -I${includedir}

makefile.shared

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,15 @@ endif
5454

5555
include makefile_include.mk
5656

57+
ifneq ($(findstring -DLTM_DESC,$(LTC_CFLAGS)),)
58+
LTC_MPI_PROVIDERS += -ltommath
59+
endif
60+
ifneq ($(findstring -DTFM_DESC,$(LTC_CFLAGS)),)
61+
LTC_MPI_PROVIDERS += -ltfm
62+
endif
63+
ifneq ($(findstring -DGMP_DESC,$(LTC_CFLAGS)),)
64+
LTC_MPI_PROVIDERS += -lgmp
65+
endif
5766

5867
#ciphers come in two flavours... enc+dec and enc
5968
src/ciphers/aes/aes_enc.o: src/ciphers/aes/aes.c src/ciphers/aes/aes_tab.c
@@ -80,7 +89,8 @@ $(foreach demo, $(strip $(DEMOS)), $(eval $(call DEMO_template,$(demo))))
8089

8190
install: $(call print-help,install,Installs the library + headers + pkg-config file) .common_install
8291
sed -e 's,^prefix=.*,prefix=$(PREFIX),' -e 's,^Version:.*,Version: $(VERSION_PC),' -e 's,@CMAKE_INSTALL_LIBDIR@,lib,' \
83-
-e 's,@CMAKE_INSTALL_INCLUDEDIR@/@PROJECT_NAME@,include/tomcrypt,' libtomcrypt.pc.in > libtomcrypt.pc
92+
-e 's,@CMAKE_INSTALL_INCLUDEDIR@/@PROJECT_NAME@,include/tomcrypt,' \
93+
-e 's,@MPI_PROVIDERS@,$(LTC_MPI_PROVIDERS),' libtomcrypt.pc.in > libtomcrypt.pc
8494
install -p -d $(DESTDIR)$(LIBPATH)/pkgconfig
8595
install -p -m 644 libtomcrypt.pc $(DESTDIR)$(LIBPATH)/pkgconfig/
8696

0 commit comments

Comments
 (0)