From 34cf6bb9255884fb235a90111724e12743bd916e Mon Sep 17 00:00:00 2001 From: Harmen Stoppels Date: Fri, 4 Jun 2021 15:22:53 +0200 Subject: [PATCH 1/2] Install a libflame.pc file --- Makefile | 24 +++++++++++++++++++++++- libflame.pc.in | 11 +++++++++++ 2 files changed, 34 insertions(+), 1 deletion(-) create mode 100644 libflame.pc.in diff --git a/Makefile b/Makefile index d50f9d194..32d27e1a6 100644 --- a/Makefile +++ b/Makefile @@ -214,6 +214,10 @@ MK_LIBS_SYML := $(strip $(MK_LIBS_SYML)) # Set the path to the subdirectory of the include installation directory. MK_INCL_DIR_INST := $(INSTALL_INCDIR) +PC_DIR_INST := $(INSTALL_LIBDIR)/pkgconfig +PC_IN_FILE := libflame.pc.in +PC_OUT_FILE := libflame.pc + # @@ -411,7 +415,7 @@ all: libs libs: libflame -install: libs install-libs install-lib-symlinks install-headers +install: libs install-libs install-lib-symlinks install-headers $(PC_DIR_INST) uninstall: uninstall-libs uninstall-lib-symlinks uninstall-headers @@ -705,6 +709,21 @@ else @$(MV) $(@F) $(INSTALL_LIBDIR)/ endif +$(PC_DIR_INST): $(PC_IN_FILE) + $(MKDIR) $(@) +ifeq ($(ENABLE_VERBOSE),no) + @echo "Installing $(PC_OUT_FILE) into $(@)/" +endif + $(shell cat "$(PC_IN_FILE)" \ + | sed -e "s#@PACKAGE_VERSION@#$(VERSION)#g" \ + | sed -e "s#@prefix@#$(prefix)#g" \ + | sed -e "s#@exec_prefix@#$(exec_prefix)#g" \ + | sed -e "s#@libdir@#$(libdir)#g" \ + | sed -e "s#@includedir@#$(includedir)#g" \ + | sed -e "s#@LDFLAGS@#$(LDFLAGS)#g" \ + > "$(PC_OUT_FILE)" ) + $(INSTALL) -m 0644 $(PC_OUT_FILE) $(@) + # --- Clean rules --- @@ -751,6 +770,7 @@ ifeq ($(ENABLE_VERBOSE),yes) - $(RM_RF) $(OBJ_DIR) - $(RM_RF) $(LIB_DIR) - $(RM_RF) $(INC_DIR) + - $(RM_RF) $(PC_OUT_FILE) - $(RM_RF) config.log - $(RM_RF) aclocal.m4 - $(RM_RF) autom4te.cache @@ -762,6 +782,8 @@ else @$(RM_F) $(AR_OBJ_LIST_FILE) @echo "Removing $(CONFIG_DIR)" @$(RM_RF) $(CONFIG_DIR) + @echo "Removing $(PC_OUT_FILE)" + @$(RM_F) $(PC_OUT_FILE) @echo "Removing $(OBJ_DIR)" @$(RM_RF) $(OBJ_DIR) @echo "Removing $(LIB_DIR)" diff --git a/libflame.pc.in b/libflame.pc.in new file mode 100644 index 000000000..27a869632 --- /dev/null +++ b/libflame.pc.in @@ -0,0 +1,11 @@ +prefix=@prefix@ +exec_prefix=@exec_prefix@ +libdir=@libdir@ +includedir=@includedir@ + +Name: libflame +Description: A portable library for dense matrix computations, providing much of the functionality present in LAPACK +Version: @PACKAGE_VERSION@ +Libs: -L${libdir} -lflame +Libs.private: @LDFLAGS@ +Cflags: -I${includedir}/libflame \ No newline at end of file From 5fe5581814a49f298b5dd3b7fc759b4d281dda56 Mon Sep 17 00:00:00 2001 From: Harmen Stoppels Date: Fri, 4 Jun 2021 17:34:40 +0200 Subject: [PATCH 2/2] Fix -I flag --- libflame.pc.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libflame.pc.in b/libflame.pc.in index 27a869632..464580dd6 100644 --- a/libflame.pc.in +++ b/libflame.pc.in @@ -8,4 +8,4 @@ Description: A portable library for dense matrix computations, providing much of Version: @PACKAGE_VERSION@ Libs: -L${libdir} -lflame Libs.private: @LDFLAGS@ -Cflags: -I${includedir}/libflame \ No newline at end of file +Cflags: -I${includedir} \ No newline at end of file