@@ -214,6 +214,10 @@ MK_LIBS_SYML := $(strip $(MK_LIBS_SYML))
214214# Set the path to the subdirectory of the include installation directory.
215215MK_INCL_DIR_INST := $(INSTALL_INCDIR )
216216
217+ PC_DIR_INST := $(INSTALL_LIBDIR ) /pkgconfig
218+ PC_IN_FILE := libflame.pc.in
219+ PC_OUT_FILE := libflame.pc
220+
217221
218222
219223#
@@ -411,7 +415,7 @@ all: libs
411415
412416libs : libflame
413417
414- install : libs install-libs install-lib-symlinks install-headers
418+ install : libs install-libs install-lib-symlinks install-headers $( PC_DIR_INST )
415419
416420uninstall : uninstall-libs uninstall-lib-symlinks uninstall-headers
417421
@@ -705,6 +709,21 @@ else
705709 @$(MV) $(@F) $(INSTALL_LIBDIR)/
706710endif
707711
712+ $(PC_DIR_INST ) : $(PC_IN_FILE )
713+ $(MKDIR ) $(@ )
714+ ifeq ($(ENABLE_VERBOSE ) ,no)
715+ @echo "Installing $(PC_OUT_FILE) into $(@)/"
716+ endif
717+ $(shell cat "$(PC_IN_FILE)" \
718+ | sed -e "s# @PACKAGE_VERSION@#$(VERSION)#g" \
719+ | sed -e "s#@prefix@#$(prefix)#g" \
720+ | sed -e "s#@exec_prefix@#$(exec_prefix)#g" \
721+ | sed -e "s#@libdir@#$(libdir)#g" \
722+ | sed -e "s#@includedir@#$(includedir)#g" \
723+ | sed -e "s#@LDFLAGS@#$(LDFLAGS)#g" \
724+ > "$(PC_OUT_FILE)" )
725+ $(INSTALL) -m 0644 $(PC_OUT_FILE) $(@)
726+
708727
709728# --- Clean rules ---
710729
@@ -751,6 +770,7 @@ ifeq ($(ENABLE_VERBOSE),yes)
751770 - $(RM_RF) $(OBJ_DIR)
752771 - $(RM_RF) $(LIB_DIR)
753772 - $(RM_RF) $(INC_DIR)
773+ - $(RM_RF) $(PC_OUT_FILE)
754774 - $(RM_RF) config.log
755775 - $(RM_RF) aclocal.m4
756776 - $(RM_RF) autom4te.cache
762782 @$(RM_F) $(AR_OBJ_LIST_FILE)
763783 @echo "Removing $(CONFIG_DIR)"
764784 @$(RM_RF) $(CONFIG_DIR)
785+ @echo "Removing $(PC_OUT_FILE)"
786+ @$(RM_F) $(PC_OUT_FILE)
765787 @echo "Removing $(OBJ_DIR)"
766788 @$(RM_RF) $(OBJ_DIR)
767789 @echo "Removing $(LIB_DIR)"
0 commit comments