diff --git a/libtomcrypt.pc.in b/libtomcrypt.pc.in index f840a545..ebc977d8 100644 --- a/libtomcrypt.pc.in +++ b/libtomcrypt.pc.in @@ -1,6 +1,5 @@ prefix=@CMAKE_INSTALL_PREFIX@ -exec_prefix=${prefix} -libdir=${exec_prefix}/@CMAKE_INSTALL_LIBDIR@ +libdir=${prefix}/@CMAKE_INSTALL_LIBDIR@ includedir=${prefix}/@CMAKE_INSTALL_INCLUDEDIR@/@PROJECT_NAME@ Name: LibTomCrypt diff --git a/makefile.shared b/makefile.shared index 2ac1e78a..310840c9 100644 --- a/makefile.shared +++ b/makefile.shared @@ -93,8 +93,8 @@ endef $(foreach demo, $(strip $(DEMOS)), $(eval $(call DEMO_template,$(demo)))) install: $(call print-help,install,Installs the library + headers + pkg-config file) .common_install - sed -e 's,^prefix=.*,prefix=$(PREFIX),' -e 's,^Version:.*,Version: $(VERSION_PC),' -e 's,@CMAKE_INSTALL_LIBDIR@,lib,' \ - -e 's,@CMAKE_INSTALL_INCLUDEDIR@/@PROJECT_NAME@,include/tomcrypt,' \ + sed -e 's,^prefix=.*,prefix=$(PREFIX),' -e 's,^Version:.*,Version: $(VERSION_PC),' -e 's,^libdir=.*,libdir=$(LIBPATH),' \ + -e 's,^includedir=.*,includedir=$(INCPATH),' \ -e 's,@MPI_PROVIDERS_LIBS@,$(LTC_MPI_PROVIDERS_LIBS),' \ -e 's,@MPI_PROVIDERS_CFLAGS@,$(LTC_MPI_PROVIDERS_CFLAGS),' libtomcrypt.pc.in > libtomcrypt.pc install -p -d $(DESTDIR)$(LIBPATH)/pkgconfig diff --git a/makefile.unix b/makefile.unix index 31473a07..a46736c2 100644 --- a/makefile.unix +++ b/makefile.unix @@ -35,11 +35,15 @@ ARFLAGS = r RANLIB = ranlib CFLAGS = -O2 -DUSE_LTM -DLTM_DESC -I../libtommath EXTRALIBS = ../libtommath/libtommath.a +# pkg-config flags, added to libtomcrypt.pc on install time +PC_CFLAGS = -DLTM_DESC +PC_LIBS = -ltommath #Compilation flags LTC_CFLAGS = -Isrc/headers -Itests -DLTC_SOURCE $(CFLAGS) LTC_LDFLAGS = $(LDFLAGS) $(EXTRALIBS) VERSION=1.18.2-develop +VERSION_PC=1.18.2 #Libraries to be created (this makefile builds only static libraries) LIBMAIN_S =libtomcrypt.a @@ -320,7 +324,10 @@ install: $(LIBMAIN_S) @mkdir -p $(DESTDIR)$(INCPATH) $(DESTDIR)$(LIBPATH)/pkgconfig @cp $(LIBMAIN_S) $(DESTDIR)$(LIBPATH)/ @cp $(HEADERS_PUB) $(DESTDIR)$(INCPATH)/ - @sed -e 's,^prefix=.*,prefix=$(PREFIX),' -e 's,^Version:.*,Version: $(VERSION),' libtomcrypt.pc.in > $(DESTDIR)$(LIBPATH)/pkgconfig/libtomcrypt.pc + @sed -e 's,^prefix=.*,prefix=$(PREFIX),' -e 's,^Version:.*,Version: $(VERSION_PC),' -e 's,^libdir=.*,libdir=$(LIBPATH),' \ + -e 's,^includedir=.*,includedir=$(INCPATH),' \ + -e 's,@MPI_PROVIDERS_LIBS@,$(PC_LIBS),' \ + -e 's,@MPI_PROVIDERS_CFLAGS@,$(PC_CFLAGS),' libtomcrypt.pc.in > $(DESTDIR)$(LIBPATH)/pkgconfig/libtomcrypt.pc #Install useful tools install_bins: hashsum diff --git a/makefile_include.mk b/makefile_include.mk index 22f3fb1c..f933b36b 100644 --- a/makefile_include.mk +++ b/makefile_include.mk @@ -190,7 +190,7 @@ DEMOS = $(UNBROKEN_DEMOS) $(BROKEN_DEMOS) DESTDIR ?= PREFIX ?= /usr/local LIBPATH ?= $(PREFIX)/lib -INCPATH ?= $(PREFIX)/include +INCPATH ?= $(PREFIX)/include/libtomcrypt DATAPATH ?= $(PREFIX)/share/doc/libtomcrypt/pdf BINPATH ?= $(PREFIX)/bin