diff --git a/src/Makefile.shlib b/src/Makefile.shlib index 4b2a62fa14c..59779b616f3 100644 --- a/src/Makefile.shlib +++ b/src/Makefile.shlib @@ -387,14 +387,19 @@ endif # PORTNAME == cygwin || PORTNAME == win32 %.pc: $(MAKEFILE_LIST) - echo 'Name: lib$(NAME)' >$@ + echo 'prefix=$(prefix)' >$@ + echo 'exec_prefix=$(patsubst $(prefix),$${prefix},$(exec_prefix))' >>$@ + echo 'libdir=$(patsubst $(exec_prefix)/%,$${exec_prefix}/%,$(libdir))' >>$@ + echo 'includedir=$(patsubst $(prefix)/%,$${prefix}/%,$(includedir))' >>$@ + echo >>$@ + echo 'Name: lib$(NAME)' >>$@ echo 'Description: PostgreSQL lib$(NAME) library' >>$@ echo 'Url: $(PACKAGE_URL)' >>$@ echo 'Version: $(VERSION)' >>$@ echo 'Requires: ' >>$@ echo 'Requires.private: $(PKG_CONFIG_REQUIRES_PRIVATE)' >>$@ - echo 'Cflags: -I$(includedir)' >>$@ - echo 'Libs: -L$(libdir) -l$(NAME)' >>$@ + echo 'Cflags: -I$${includedir}' >>$@ + echo 'Libs: -L$${libdir} -l$(NAME)' >>$@ # Record -L flags that the user might have passed in to the PostgreSQL # build to locate third-party libraries (e.g., ldap, ssl). Filter out # those that point inside the build or source tree. Use sort to