automake-ng
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Automake-NG] [PATCH 4/4] [ng] texi: verbatim include of rules for texin


From: Stefano Lattarini
Subject: [Automake-NG] [PATCH 4/4] [ng] texi: verbatim include of rules for texinfo installation
Date: Sun, 12 Aug 2012 14:49:49 +0200

It tells whether the '.info' files must be installed by default (usually
yes, unless the "no-installinfo" automake option is used).  This is just
a preparatory change, in view of future ones.

* lib/am/texinfos.am: Move ...
* lib/am/texinfos.mk: ... here, with related adjustments.  Also ...
(info_TEXINFOS): ... initialize this to empty by default.
* lib/am/automake.in (handle_texinfo): Adjust and simplify accordingly.
* Makefile.am (dist_am_DATA): Adjust.
* t/txinfo10.sh: Remove, basically an obsolete grepping check.  We can
instead ...
* t/txinfo21.sh: ... enhance this semantic test to subsume and supersede
the removed one.
* t/override-conditional-1.sh: Adjust to avoid spurious failures.

Signed-off-by: Stefano Lattarini <address@hidden>
---
 Makefile.am                         |  4 +--
 automake.in                         |  7 ++---
 lib/am/{texinfos.am => texinfos.mk} | 57 ++++++++++++++++++-------------------
 t/override-conditional-1.sh         | 26 ++++++++++-------
 t/txinfo10.sh                       | 39 -------------------------
 t/txinfo21.sh                       | 10 +++++++
 6 files changed, 57 insertions(+), 86 deletions(-)
 rename lib/am/{texinfos.am => texinfos.mk} (94%)
 delete mode 100755 t/txinfo10.sh

diff --git a/Makefile.am b/Makefile.am
index 5b3d6ab..db3dea7 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -185,7 +185,6 @@ EXTRA_DIST += lib/Automake/Config.in
 
 dist_am_DATA = \
   lib/am/am-dir.mk \
-  lib/am/texibuild.mk \
   lib/am/common-targets.mk \
   lib/am/color-tests.mk \
   lib/am/serial-tests.mk \
@@ -198,6 +197,8 @@ dist_am_DATA = \
   lib/am/distcheck.mk \
   lib/am/distdir.mk \
   lib/am/subdirs.mk \
+  lib/am/texibuild.mk \
+  lib/am/texinfos.mk \
   lib/am/compile.am \
   lib/am/configure.am \
   lib/am/data.am \
@@ -221,7 +222,6 @@ dist_am_DATA = \
   lib/am/scripts.am \
   lib/am/texi-vers.am \
   lib/am/texi-spec.am \
-  lib/am/texinfos.am \
   lib/am/vala.am \
   lib/am/yacc.am
 
diff --git a/automake.in b/automake.in
index 1b56581..a81f8e3 100644
--- a/automake.in
+++ b/automake.in
@@ -2973,16 +2973,13 @@ sub handle_texinfo ()
   # FIXME: I think this is an obsolete future feature name.
   reject_var 'html_TEXINFOS', "HTML generation not yet supported";
 
-  my $info_texinfos = var ('info_TEXINFOS');
-  if ($info_texinfos)
+  if (my $info_texinfos = var ('info_TEXINFOS'))
     {
       define_verbose_texinfo;
       verbatim ('texibuild');
       handle_texinfo_helper ($info_texinfos);
     }
-  $output_rules .=  file_contents ('texinfos',
-                                  new Automake::Location,
-                                  'LOCAL-TEXIS' => !!$info_texinfos);
+  verbatim ('texinfos');
 }
 
 
diff --git a/lib/am/texinfos.am b/lib/am/texinfos.mk
similarity index 94%
rename from lib/am/texinfos.am
rename to lib/am/texinfos.mk
index b35389f..64d10eb 100644
--- a/lib/am/texinfos.am
+++ b/lib/am/texinfos.mk
@@ -18,13 +18,17 @@
 # FIXME: this should probably be generalized and moved to header-vars.mk
 am.texi.create-installdir = $(if $(and $1,$^),$(MKDIR_P) '$(DESTDIR)$1',@:)
 
+# Avoid interferences from the environment.
+ifeq ($(call am.vars.is-undef,info_TEXINFOS),yes)
+  info_TEXINFOS :=
+endif
 
 ## ---------- ##
 ## Building.  ##
 ## ---------- ##
 
 .PHONY: dvi dvi-am html html-am info info-am pdf pdf-am ps ps-am
-if %?SUBDIRS%
+ifdef SUBDIRS
 RECURSIVE_TARGETS += dvi-recursive html-recursive info-recursive
 RECURSIVE_TARGETS += pdf-recursive ps-recursive
 dvi: dvi-recursive
@@ -32,27 +36,27 @@ html: html-recursive
 info: info-recursive
 pdf: pdf-recursive
 ps: ps-recursive
-else !%?SUBDIRS%
+else
 dvi: dvi-am
 html: html-am
 info: info-am
 pdf: pdf-am
 ps: ps-am
-endif !%?SUBDIRS%
+endif
 
-if %?LOCAL-TEXIS%
+ifdef info_TEXINFOS
 dvi-am: $(DVIS)
 html-am: $(HTMLS)
 info-am: $(INFO_DEPS)
 pdf-am: $(PDFS)
 ps-am: $(PSS)
-else ! %?LOCAL-TEXIS%
+else
 dvi-am:
 html-am:
 info-am:
 pdf-am:
 ps-am:
-endif ! %?LOCAL-TEXIS%
+endif
 
 
 ## ------------ ##
@@ -78,12 +82,12 @@ am.texi.can-run-installinfo = \
 ##
 ## TEXINFOS primary are always installed in infodir, hence install-data
 ## is hard coded.
-if %?INSTALL-INFO%
-if %?LOCAL-TEXIS%
+ifndef am.conf.install-info
+ifdef info_TEXINFOS
 am__installdirs += "$(DESTDIR)$(infodir)"
 install-data-am: install-info-am
-endif %?LOCAL-TEXIS%
-endif %?INSTALL-INFO%
+endif
+endif
 .PHONY: \
   install-dvi  install-dvi-am \
   install-html install-html-am \
@@ -91,7 +95,7 @@ endif %?INSTALL-INFO%
   install-pdf  install-pdf-am \
   install-ps   install-ps-am
 
-if %?SUBDIRS%
+ifdef SUBDIRS
 RECURSIVE_TARGETS += \
   install-dvi-recursive \
   install-html-recursive \
@@ -103,15 +107,15 @@ install-html: install-html-recursive
 install-info: install-info-recursive
 install-pdf: install-pdf-recursive
 install-ps: install-ps-recursive
-else !%?SUBDIRS%
+else
 install-dvi: install-dvi-am
 install-html: install-html-am
 install-info: install-info-am
 install-pdf: install-pdf-am
 install-ps: install-ps-am
-endif !%?SUBDIRS%
+endif
 
-if %?LOCAL-TEXIS%
+ifdef info_TEXINFOS
 
 # In GNU make, '$^' used in a recipe contains every dependency for the
 # target, even those not declared when the recipe is read; for example,
@@ -208,20 +212,21 @@ install-html-am: .am/install-html
          $(INSTALL_DATA) $$files "$(DESTDIR)$(psdir)" || exit $$?; \
        done
 
-else ! %?LOCAL-TEXIS%
+else # !info_TEXINFOS
 install-dvi-am:
 install-html-am:
 install-info-am:
 install-pdf-am:
 install-ps-am:
-endif ! %?LOCAL-TEXIS%
+endif # !info_TEXINFOS
 
 
-## -------------- ##
-## Uninstalling.  ##
-## -------------- ##
+## --------------------------- ##
+## Uninstalling and cleaning.  ##
+## --------------------------- ##
+
+ifdef info_TEXINFOS
 
-if %?LOCAL-TEXIS%
 .PHONY uninstall-am: \
   uninstall-dvi-am \
   uninstall-html-am \
@@ -265,20 +270,12 @@ uninstall-info-am:
        $(call am.uninst.cmd,$(infodir),\
          $(foreach i,$(notdir $(INFO_DEPS)),$i $i-[0-9] $i-[0-9][0-9]))
 
-endif %?LOCAL-TEXIS%
 
-if %?LOCAL-TEXIS%
 .PHONY: dist-info
 dist-info: $(INFO_DEPS)
        @$(foreach f,$(foreach x,$^,$(wildcard $x $x-[0-9] $x-[0-9][0-9])), \
          cp -p $f $(distdir)/$(patsubst $(srcdir)/%,%,$f);)
-endif %?LOCAL-TEXIS%
-
-
-## ---------- ##
-## Cleaning.  ##
-## ---------- ##
 
-if %?LOCAL-TEXIS%
 am.clean.maint.f += $(foreach f,$(INFO_DEPS),$f $f-[0-9] $f-[0-9][0-9])
-endif %?LOCAL-TEXIS%
+
+endif # !info_TEXINFOS
diff --git a/t/override-conditional-1.sh b/t/override-conditional-1.sh
index 2752346..26f0a28 100755
--- a/t/override-conditional-1.sh
+++ b/t/override-conditional-1.sh
@@ -24,10 +24,11 @@ AC_OUTPUT
 END
 
 cat > Makefile.am << 'END'
+man1_MANS = foo.1
 foobar:
        : > $@
 if COND
-ps: foobar
+install-man: foobar
        :
 endif
 END
@@ -35,20 +36,25 @@ END
 $ACLOCAL
 $AUTOMAKE -Wno-override
 
-# "ps:" should be output in two conditions
-grep 'ps:' Makefile.in # For debugging.
-test $(grep -c '@ps:' Makefile.in) -eq 2
-grep '@address@hidden: *foobar' Makefile.in
-grep '@address@hidden: *ps-am' Makefile.in
+# "install-man:" should be output in two conditions
+grep 'install-man' Makefile.in # For debugging.
+test $(grep -c '@install-man:' Makefile.in) -eq 2
+grep '@address@hidden: *foobar' Makefile.in
+grep '@address@hidden:' Makefile.in
 
 $AUTOCONF
+: > foo.1
 
-./configure cond=no
-$MAKE ps
+./configure cond=no --prefix="$(pwd)/inst"
+$MAKE install-man
+test -d inst
 test ! -e foobar
 
-./configure cond=yes
-$MAKE ps
+rm -rf inst
+
+./configure cond=yes --prefix="$(pwd)/inst"
+$MAKE install-man
+test ! -e inst
 test -f foobar
 
 :
diff --git a/t/txinfo10.sh b/t/txinfo10.sh
deleted file mode 100755
index 903d6f5..0000000
--- a/t/txinfo10.sh
+++ /dev/null
@@ -1,39 +0,0 @@
-#! /bin/sh
-# Copyright (C) 2001-2012 Free Software Foundation, Inc.
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program.  If not, see <http://www.gnu.org/licenses/>.
-
-# Make sure dvi target recurses into subdir.
-# Reported by Pavel Roskin.
-
-. ./defs || exit 1
-
-cat > Makefile.am << 'END'
-SUBDIRS = sub
-END
-
-mkdir sub
-cat > sub/Makefile.am << 'END'
-info_TEXINFOS = maude.texi
-END
-
-echo '@setfilename maude.info' > sub/maude.texi
-: > sub/texinfo.tex
-
-$ACLOCAL
-$AUTOMAKE
-
-grep dvi-recursive Makefile.in
-grep '[^-]info-recursive' Makefile.in
-grep '[^n]install-info-recursive' Makefile.in
diff --git a/t/txinfo21.sh b/t/txinfo21.sh
index 001d134..b892f68 100755
--- a/t/txinfo21.sh
+++ b/t/txinfo21.sh
@@ -146,6 +146,16 @@ test ! -e share/$me/html/main.html
 test ! -e share/$me/html/main2.html
 test ! -e share/$me/html/main3.html
 
+$MAKE dvi
+test -f main.dvi
+test -f sub/main2.dvi
+test -f rec/main3.dvi
+
+$MAKE clean
+test ! -e main.dvi
+test ! -e sub/main2.dvi
+test ! -e rec/main3.dvi
+
 $MAKE install-dvi
 test -f share/$me/dvi/main.dvi
 test -f share/$me/dvi/main2.dvi
-- 
1.7.12.rc0




reply via email to

[Prev in Thread] Current Thread [Next in Thread]