- $(INSTALL_PROG) ncurses-config $(DESTDIR)$(bindir)/$(NCURSES_CONFIG)
-
-@MAKE_PC_FILES@install.libs :: pc-files $(DESTDIR)$(PKG_CONFIG_LIBDIR)
-@MAKE_PC_FILES@ $(SHELL) -c 'for name in *.pc; do $(INSTALL_DATA) $$name $(DESTDIR)$(PKG_CONFIG_LIBDIR)/$$name; done'
+ $(INSTALL_SCRIPT) ncurses-config $(DESTDIR)$(bindir)/$(NCURSES_CONFIG)
+
+# some packagers prefer to be able to construct pc-files on servers where
+# pkg-config is not installed. Work around that by creating the library
+# directory during this rule:
+@MAKE_PC_FILES@install.libs :: pc-files
+@MAKE_PC_FILES@ @$(SHELL) -c 'case "x$(DESTDIR)$(PKG_CONFIG_LIBDIR)" in \
+ (x/*) \
+ mkdir -p $(DESTDIR)$(PKG_CONFIG_LIBDIR); \
+ for name in *.pc; do \
+ echo installing $$name; \
+ $(INSTALL_DATA) $$name $(DESTDIR)$(PKG_CONFIG_LIBDIR)/$$name; \
+ done \
+ ;; \
+ (*) \
+ echo "...skip actual install: no destination was given" ; \
+ ;; \
+ esac'