build: make man page hardlinks conditional on having man pages

Otherwise we fail since they don't exist.  We have to carefully
implement an "or" condition for the cases of having prebuilt manpages
in a tarball, vs actually building them from source.
This commit is contained in:
Colin Walters 2016-04-05 11:26:26 -04:00 committed by Thomas Haller
parent 9a68f12737
commit c976f983eb

View file

@ -91,21 +91,34 @@ EXTRA_DIST += \
nmtui_links = nmtui-edit nmtui-connect nmtui-hostname nmtui_links = nmtui-edit nmtui-connect nmtui-hostname
NetworkManager_conf_links = nm-system-settings.conf NetworkManager_conf_links = nm-system-settings.conf
# Implement a || condition
if INSTALL_PREGEN_MANPAGES
install_manpages = true
else
if ENABLE_GTK_DOC
install_manpages = true
endif
endif
install-data-hook: install-data-hook:
for link in $(nmtui_links); do \ if test -n "$(install_manpages)"; then \
ln -f $(DESTDIR)$(mandir)/man1/nmtui.1 $(DESTDIR)$(mandir)/man1/$$link.1; \ for link in $(nmtui_links); do \
done ln -f $(DESTDIR)$(mandir)/man1/nmtui.1 $(DESTDIR)$(mandir)/man1/$$link.1; \
for link in $(NetworkManager_conf_links); do \ done; \
ln -f $(DESTDIR)$(mandir)/man5/NetworkManager.conf.5 $(DESTDIR)$(mandir)/man5/$$link.5; \ for link in $(NetworkManager_conf_links); do \
done ln -f $(DESTDIR)$(mandir)/man5/NetworkManager.conf.5 $(DESTDIR)$(mandir)/man5/$$link.5; \
done; \
fi
uninstall-hook: uninstall-hook:
for link in $(nmtui_links); do \ if test -n "$(install_manpages)"; then \
rm -f $(DESTDIR)$(mandir)/man1/$$link.1; \ for link in $(nmtui_links); do \
done rm -f $(DESTDIR)$(mandir)/man1/$$link.1; \
for link in $(NetworkManager_conf_links); do \ done; \
rm -f $(DESTDIR)$(mandir)/man5/$$link.5; \ for link in $(NetworkManager_conf_links); do \
done rm -f $(DESTDIR)$(mandir)/man5/$$link.5; \
done; \
fi
if ENABLE_GTK_DOC if ENABLE_GTK_DOC
man_MANS += $(man_pages) man_MANS += $(man_pages)