bgarrigues pushed a commit to branch automake3 in repository groff. commit 561bbf61934f99d9ed362d156fb8ec8d9cdc0aa9 Author: Bertrand Garrigues <bertrand.garrig...@laposte.net> Date: Tue Sep 16 00:28:04 2014 +0200
Various build fixes. If there is a system tmac macro package, groff version of the package should be installed with a prefix. `test-groff' should be cleaned. --- Makefile.am | 3 ++- TESTS | 21 ++++++++++++++------- tmac/tmac.am | 46 ++++++++++++++++++++++++++++++++++------------ 3 files changed, 50 insertions(+), 20 deletions(-) diff --git a/Makefile.am b/Makefile.am index 1f8bad2..b0be073 100644 --- a/Makefile.am +++ b/Makefile.am @@ -805,7 +805,8 @@ EXTRA_DIST += \ MOSTLYCLEANFILES += $(prefixexecbin_SCRIPTS) $(bin_SCRIPTS) \ $(man1_MANS) $(man5_MANS) $(man7_MANS) \ - $(PREFIXMAN1) $(PREFIXMAN5) $(PREFIXMAN7) + $(PREFIXMAN1) $(PREFIXMAN5) $(PREFIXMAN7) \ + test-groff # Rule to build .man files. The brackets around the @ are used to prevent the # substitution of the variable by automake. diff --git a/TESTS b/TESTS index 91cb08b..5c556ab 100644 --- a/TESTS +++ b/TESTS @@ -385,13 +385,7 @@ Differences with former build system: Diff with previous build system: - devcp1047 fonts are installed $(DESTDIR)/usr/local/groff/1.22.3/font -TODO: - - - The original build system might uses tmac_s_prefix, - tmac_an_prefix, tmac_wrap and sys_tmac_prefix during the - installation of some tmac files but set these variables to an empty - value in tmac/Makefile.sub, I don't quite understand how these - variables could be set. +TODO: - When contrib and doc will be completed, full installation tree comparison with the tree installed by the old build system. Note: @@ -567,6 +561,19 @@ in the install tree). install/uninstall, distcheck) work as usual. No diff with the old build system. +3.4 Build in presence of system tmac files + + - Create 3 dummy files in /usr/lib/tmac: tmac.an, tmac.m, tmac.s, that all contain: + +.if + + - Build and install as usual: + + -- $(DESTDIR)/usr/local/lib/groff/site-tmac/ contains 3 files: an.tmac, m.tmac, s.tmac + -- In $(DESTDIR)/usr/local/share/groff/1.22.3/tmac 6 files have a + 'g' prefix: gan.tmac, gm.tmac, gmm.tmac, gmmse.tmac, gmse.tmac, + gs.tmac. + Notes ----- diff --git a/tmac/tmac.am b/tmac/tmac.am index 1a6e4ef..08edc0c 100644 --- a/tmac/tmac.am +++ b/tmac/tmac.am @@ -18,6 +18,7 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see <http://www.gnu.org/licenses/>. tmac_srcdir = $(top_srcdir)/tmac +tmac_builddir = $(top_builddir)/tmac man7_MANS += \ tmac/groff_ms.n \ @@ -115,16 +116,6 @@ MOSTLYCLEANFILES += $(TMACMDOCFILES) tmac/www.tmac $(TMACSTRIPFILES) \ tmac/stamp-wrap \ tmac/*-wrap -# FIXME -# Original Makefile.sub forced the following variables that are -# originally defined in the top Makefile.am. We don't use them here, -# if they are needed custom install commands should be written -# -# tmac_s_prefix= -# tmac_an_prefix= -# tmac_wrap= -# sys_tmac_prefix= - EXTRA_DIST += \ tmac/fixmacros.sed \ tmac/groff_ms.man \ @@ -150,6 +141,12 @@ tmac-dist-hook: cp -f $(top_srcdir)/$$f-u $(distdir)/tmac; \ done + +# If an existing system tmac macro is installed (/usr/lib/tmac +# contains tmac.anm tmac.m, tmac.s), ms and man macros are installed +# as gs.tmac and gan.tmac, instead of s.tmac and an.tmac. Alos, +# an.tmac, m.tmac and s.tmac files are installed in +# <prefix>/lib/groff/site-tmac. all: tmac/stamp-wrap $(TMACMDOCFILES) $(TMACSTRIPFILES): @@ -164,7 +161,7 @@ tmac/stamp-wrap: for m in ""$(tmac_wrap); do \ $(RM) $(top_builddir)/tmac/$$m-wrap; \ if test "$$m" = an; then \ - echo .do mso $(tmac_srcdir)/andoc.tmac >>$(top_builddir)/tmac/$$m-wrap; \ + echo .do mso andoc.tmac >>$(top_builddir)/tmac/$$m-wrap; \ fi; \ echo .cp 1 >>$(top_builddir)/tmac/$$m-wrap; \ echo .so $(sys_tmac_prefix)$$m >>$(top_builddir)/tmac/$$m-wrap; \ @@ -177,12 +174,37 @@ tmac/www.tmac: tmac/www.tmac.in sed -e "s;[@]PNMTOPS_NOSETPAGE[@];$(pnmtops_nosetpage);g" \ $(tmac_srcdir)/www.tmac.in > $(top_builddir)/tmac/www.tmac +install-data-local: install_tmac_wrap +install_tmac_wrap: + $(MKDIR_P) $(DESTDIR)$(systemtmacdir); + if test -n "$(tmac_wrap)"; then \ + for m in ""$(tmac_wrap); do \ + $(INSTALL_DATA) $(tmac_builddir)/$$m-wrap \ + $(DESTDIR)$(systemtmacdir)/$$m.tmac; \ + done; \ + fi + +install-data-hook: install_tmac_wrap_hook +install_tmac_wrap_hook: + if test -n "$(tmac_wrap)"; then \ + if test -f $(DESTDIR)$(tmacdir)/s.tmac; then \ + mv $(DESTDIR)$(tmacdir)/s.tmac \ + $(DESTDIR)$(tmacdir)/$(tmac_s_prefix)s.tmac; \ + fi; \ + if test -f $(DESTDIR)$(tmacdir)/an.tmac; then \ + mv $(DESTDIR)$(tmacdir)/an.tmac \ + $(DESTDIR)$(tmacdir)/$(tmac_an_prefix)an.tmac; \ + fi; \ + fi + uninstall_groffdirs: uninstall_tmac_hook uninstall_tmac_hook: - -if test -n "$(tmac_wrap)"; then \ + if test -n "$(tmac_wrap)"; then \ for m in ""$(tmac_wrap); do \ $(RM) $(DESTDIR)$(systemtmacdir)/$$m.tmac; \ done; \ + $(RM) -f $(DESTDIR)$(tmacdir)/$(tmac_an_prefix)an.tmac; \ + $(RM) -f $(DESTDIR)$(tmacdir)/$(tmac_s_prefix)s.tmac; \ fi if test -d $(DESTDIR)$(mdocdir); then \ rmdir $(DESTDIR)$(mdocdir); \ _______________________________________________ Groff-commit mailing list Groff-commit@gnu.org https://lists.gnu.org/mailman/listinfo/groff-commit