* lib/Automake/Config.in: New file.
authorAlexandre Duret-Lutz <adl@gnu.org>
Wed, 6 Aug 2003 21:20:15 +0000 (21:20 +0000)
committerAlexandre Duret-Lutz <adl@gnu.org>
Wed, 6 Aug 2003 21:20:15 +0000 (21:20 +0000)
* lib/Automake/Makefile.am (nodist_perllib_DATA, do_subst,
CLEANFILES): New variables.
(Config.pm): New rule.
* Makefile.am (maintainer-check): Adjust expected differences
between automake.in and automake.
* aclocal.in, automake.in: Use Automake::Config.

ChangeLog
Makefile.am
Makefile.in
aclocal.in
automake.in
bootstrap
lib/Automake/Config.in [new file with mode: 0644]
lib/Automake/Makefile.am
lib/Automake/Makefile.in
stamp-vti
version.texi

index 76e7367..a2fb270 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2003-08-06  Alexandre Duret-Lutz  <adl@gnu.org>
+
+       * lib/Automake/Config.in: New file.
+       * lib/Automake/Makefile.am (nodist_perllib_DATA, do_subst,
+       CLEANFILES): New variables.
+       (Config.pm): New rule.
+       * Makefile.am (maintainer-check): Adjust expected differences
+       between automake.in and automake.
+       * aclocal.in, automake.in: Use Automake::Config.
+
 2003-08-05  Alexandre Duret-Lutz  <adl@gnu.org>
 
        * tests/ltconv.test: s/rm/rm -f/ to placate maintainer-check.
index 565010d..dd186a7 100644 (file)
@@ -97,7 +97,7 @@ maintainer-check: automake aclocal
 ## This check avoids accidental configure substitutions in the source.
 ## There are exactly 8 lines that should be modified.  This works out
 ## to 28 lines of diffs.
-       @if test `diff $(srcdir)/automake.in automake | wc -l` -ne 28; then \
+       @if test `diff $(srcdir)/automake.in automake | wc -l` -ne 20; then \
          echo "found too many diffs between automake.in and automake"; 1>&2; \
          diff -c $(srcdir)/automake.in automake; \
          exit 1; \
index 18e7297..663fd00 100644 (file)
@@ -777,7 +777,7 @@ INSTALL: lib/INSTALL
 # Some simple checks, and then ordinary check.  These are only really
 # guaranteed to work on my machine.
 maintainer-check: automake aclocal
-       @if test `diff $(srcdir)/automake.in automake | wc -l` -ne 28; then \
+       @if test `diff $(srcdir)/automake.in automake | wc -l` -ne 20; then \
          echo "found too many diffs between automake.in and automake"; 1>&2; \
          diff -c $(srcdir)/automake.in automake; \
          exit 1; \
index 0db058d..64c5c26 100644 (file)
@@ -33,16 +33,13 @@ BEGIN
   unshift @INC, $perllibdir;
 }
 
+use Automake::Config;
 use Automake::General;
 use Automake::Configure_ac;
 use Automake::XFile;
 use Automake::FileUtils;
 use File::stat;
 
-# Some constants.
-$VERSION = '@VERSION@';
-$APIVERSION = '@APIVERSION@';
-$PACKAGE = '@PACKAGE@';
 # Note that this isn't pkgdatadir, but a separate directory.
 # Note also that the versioned directory is handled later.
 $acdir = '@datadir@/aclocal';
index 4643053..513bb17 100755 (executable)
@@ -121,6 +121,7 @@ sub target_hook ($$$$)
 package Automake;
 
 use strict;
+use Automake::Config;
 use Automake::General;
 use Automake::XFile;
 use Automake::Channels;
@@ -142,12 +143,6 @@ use Carp;
 ## Constants.  ##
 ## ----------- ##
 
-# Parameters set by configure.  Not to be changed.  NOTE: assign
-# VERSION as string so that e.g. version 0.30 will print correctly.
-my $VERSION = '@VERSION@';
-my $PACKAGE = '@PACKAGE@';
-my $libdir = '@datadir@/@PACKAGE@-@APIVERSION@';
-
 # Some regular expressions.  One reason to put them here is that it
 # makes indentation work better in Emacs.
 
index d186084..2ac8034 100755 (executable)
--- a/bootstrap
+++ b/bootstrap
@@ -90,28 +90,29 @@ rm -rf automake-$APIVERSION
 mkdir automake-$APIVERSION
 cp -rf lib/* automake-$APIVERSION
 
+dosubst ()
+{
+  sed -e "s%@PERL@%$PERL%g" \
+      -e "s%@VERSION@%$VERSION%g" \
+      -e "s%@APIVERSION@%$APIVERSION%g" \
+      -e "s%@PACKAGE@%$PACKAGE%g" \
+      -e "s%@datadir@%$datadir%g" \
+      -e "s%@SHELL@%$BOOTSTRAP_SHELL%g" $1 > $2
+}
+
+
+# Create temporary replacement for lib/Automake/Config.pm
+dosubst automake-$APIVERSION/Automake/Config.in \
+        automake-$APIVERSION/Automake/Config.pm
+
 # Create temporary replacement for aclocal
-sed -e "s%@PERL@%$PERL%g" \
-    -e "s%@VERSION@%$VERSION%g" \
-    -e "s%@APIVERSION@%$APIVERSION%g" \
-    -e "s%@PACKAGE@%$PACKAGE%g" \
-    -e "s%@datadir@%$datadir%g" \
-    -e "s%@SHELL@%$BOOTSTRAP_SHELL%g" \
-    aclocal.in >aclocal.tmp
+dosubst aclocal.in aclocal.tmp
 
 # Overwrite amversion.m4
-sed -e "s%@VERSION@%$VERSION%g" \
-    -e "s%@APIVERSION@%$APIVERSION%g" \
-    m4/amversion.in >m4/amversion.m4
+dosubst m4/amversion.in m4/amversion.m4
 
 # Create temporary replacement for automake
-sed -e "s%@PERL@%$PERL%g" \
-    -e "s%@VERSION@%$VERSION%g" \
-    -e "s%@APIVERSION@%$APIVERSION%g" \
-    -e "s%@PACKAGE@%$PACKAGE%g" \
-    -e "s%@datadir@%$datadir%g" \
-    -e "s%@SHELL@%$BOOTSTRAP_SHELL%g" \
-    automake.in >automake.tmp
+dosubst automake.in automake.tmp
 
 # Run the autotools.
 $PERL ./aclocal.tmp -I m4
@@ -121,3 +122,4 @@ $PERL ./automake.tmp
 # Remove temporary files and directories
 rm -rf aclocal-$APIVERSION automake-$APIVERSION
 rm -f aclocal.tmp automake.tmp
+rm -f lib/Automake/Config.pm
diff --git a/lib/Automake/Config.in b/lib/Automake/Config.in
new file mode 100644 (file)
index 0000000..e5d5f1a
--- /dev/null
@@ -0,0 +1,52 @@
+# Copyright (C) 2003  Free Software Foundation, Inc.      -*- Perl -*-
+
+# 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, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+# 02111-1307, USA.
+
+package Automake::Config;
+use strict;
+
+use vars qw (@ISA @EXPORT);
+
+@ISA = qw (Exporter);
+@EXPORT = qw ($APIVERSION $PACKAGE $VERSION $libdir);
+
+use vars qw ($APIVERSION $PACKAGE $VERSION $libdir);
+
+# Parameters set by configure.  Not to be changed.  NOTE: assign
+# VERSION as string so that e.g. version 0.30 will print correctly.
+$APIVERSION = '@APIVERSION@';
+$PACKAGE = '@PACKAGE@';
+$VERSION = '@VERSION@';
+$libdir = '@datadir@/@PACKAGE@-@APIVERSION@';
+
+1;;
+
+### Setup "GNU" style for perl-mode and cperl-mode.
+## Local Variables:
+## perl-indent-level: 2
+## perl-continued-statement-offset: 2
+## perl-continued-brace-offset: 0
+## perl-brace-offset: 0
+## perl-brace-imaginary-offset: 0
+## perl-label-offset: -2
+## cperl-indent-level: 2
+## cperl-brace-offset: 0
+## cperl-continued-brace-offset: 0
+## cperl-label-offset: -2
+## cperl-extra-newline-before-brace: t
+## cperl-merge-trailing-else: nil
+## cperl-continued-statement-offset: 2
+## End:
index 75eefac..97b236e 100644 (file)
@@ -35,3 +35,21 @@ dist_perllib_DATA = \
   Version.pm \
   XFile.pm \
   Wrap.pm
+
+nodist_perllib_DATA = \
+  Config.pm
+
+CLEANFILES = $(nodist_perllib_DATA)
+
+## We can't use configure to do the substitution here; we must do it
+## by hand.  We use a funny notation here to avoid configure
+## substitutions in our text.
+do_subst = sed -e 's,[@]datadir[@],$(datadir),g' -e 's,[@]PERL[@],$(PERL),g' \
+           -e 's,[@]configure_input[@],@configure_input@,g' \
+           -e 's,[@]PACKAGE[@],$(PACKAGE),g' \
+           -e 's,[@]VERSION[@],$(VERSION),g' \
+           -e 's,[@]APIVERSION[@],$(APIVERSION),g' \
+           -e 's,[@]SHELL[@],$(SHELL),g'
+
+Config.pm: Config.in
+       $(do_subst) <$(srcdir)/Config.in >$@
index 21e7aef..8367fba 100644 (file)
@@ -55,9 +55,10 @@ RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
        install-recursive installcheck-recursive installdirs-recursive \
        pdf-recursive ps-recursive uninstall-info-recursive \
        uninstall-recursive
-am__installdirs = $(DESTDIR)$(perllibdir)
+am__installdirs = $(DESTDIR)$(perllibdir) $(DESTDIR)$(perllibdir)
 dist_perllibDATA_INSTALL = $(INSTALL_DATA)
-DATA = $(dist_perllib_DATA)
+nodist_perllibDATA_INSTALL = $(INSTALL_DATA)
+DATA = $(dist_perllib_DATA) $(nodist_perllib_DATA)
 ETAGS = etags
 ETAGSFLAGS = 
 CTAGS = ctags
@@ -145,6 +146,17 @@ dist_perllib_DATA = \
   XFile.pm \
   Wrap.pm
 
+nodist_perllib_DATA = \
+  Config.pm
+
+CLEANFILES = $(nodist_perllib_DATA)
+do_subst = sed -e 's,[@]datadir[@],$(datadir),g' -e 's,[@]PERL[@],$(PERL),g' \
+           -e 's,[@]configure_input[@],@configure_input@,g' \
+           -e 's,[@]PACKAGE[@],$(PACKAGE),g' \
+           -e 's,[@]VERSION[@],$(VERSION),g' \
+           -e 's,[@]APIVERSION[@],$(APIVERSION),g' \
+           -e 's,[@]SHELL[@],$(SHELL),g'
+
 all: all-recursive
 
 .SUFFIXES:
@@ -194,6 +206,23 @@ uninstall-dist_perllibDATA:
          echo " rm -f $(DESTDIR)$(perllibdir)/$$f"; \
          rm -f $(DESTDIR)$(perllibdir)/$$f; \
        done
+install-nodist_perllibDATA: $(nodist_perllib_DATA)
+       @$(NORMAL_INSTALL)
+       $(mkinstalldirs) $(DESTDIR)$(perllibdir)
+       @list='$(nodist_perllib_DATA)'; for p in $$list; do \
+         if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+         f="`echo $$p | sed -e 's|^.*/||'`"; \
+         echo " $(nodist_perllibDATA_INSTALL) $$d$$p $(DESTDIR)$(perllibdir)/$$f"; \
+         $(nodist_perllibDATA_INSTALL) $$d$$p $(DESTDIR)$(perllibdir)/$$f; \
+       done
+
+uninstall-nodist_perllibDATA:
+       @$(NORMAL_UNINSTALL)
+       @list='$(nodist_perllib_DATA)'; for p in $$list; do \
+         f="`echo $$p | sed -e 's|^.*/||'`"; \
+         echo " rm -f $(DESTDIR)$(perllibdir)/$$f"; \
+         rm -f $(DESTDIR)$(perllibdir)/$$f; \
+       done
 
 # This directory's subdirectories are mostly independent; you can cd
 # into them and run `make' without going through this Makefile.
@@ -358,7 +387,7 @@ check: check-recursive
 all-am: Makefile $(DATA)
 installdirs: installdirs-recursive
 installdirs-am:
-       $(mkinstalldirs) $(DESTDIR)$(perllibdir)
+       $(mkinstalldirs) $(DESTDIR)$(perllibdir) $(DESTDIR)$(perllibdir)
 install: install-recursive
 install-exec: install-exec-recursive
 install-data: install-data-recursive
@@ -376,6 +405,7 @@ install-strip:
 mostlyclean-generic:
 
 clean-generic:
+       -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
 
 distclean-generic:
        -rm -f $(CONFIG_CLEAN_FILES)
@@ -401,7 +431,7 @@ info: info-recursive
 
 info-am:
 
-install-data-am: install-dist_perllibDATA
+install-data-am: install-dist_perllibDATA install-nodist_perllibDATA
 
 install-exec-am:
 
@@ -427,7 +457,8 @@ ps: ps-recursive
 
 ps-am:
 
-uninstall-am: uninstall-dist_perllibDATA uninstall-info-am
+uninstall-am: uninstall-dist_perllibDATA uninstall-info-am \
+       uninstall-nodist_perllibDATA
 
 uninstall-info: uninstall-info-recursive
 
@@ -437,14 +468,18 @@ uninstall-info: uninstall-info-recursive
        distdir dvi dvi-am html html-am info info-am install \
        install-am install-data install-data-am \
        install-dist_perllibDATA install-exec install-exec-am \
-       install-info install-info-am install-man install-strip \
-       installcheck installcheck-am installdirs installdirs-am \
-       maintainer-clean maintainer-clean-generic \
-       maintainer-clean-recursive mostlyclean mostlyclean-generic \
-       mostlyclean-recursive pdf pdf-am ps ps-am tags tags-recursive \
-       uninstall uninstall-am uninstall-dist_perllibDATA \
-       uninstall-info-am
-
+       install-info install-info-am install-man \
+       install-nodist_perllibDATA install-strip installcheck \
+       installcheck-am installdirs installdirs-am maintainer-clean \
+       maintainer-clean-generic maintainer-clean-recursive \
+       mostlyclean mostlyclean-generic mostlyclean-recursive pdf \
+       pdf-am ps ps-am tags tags-recursive uninstall uninstall-am \
+       uninstall-dist_perllibDATA uninstall-info-am \
+       uninstall-nodist_perllibDATA
+
+
+Config.pm: Config.in
+       $(do_subst) <$(srcdir)/Config.in >$@
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
 # Otherwise a system limit (for SysV at least) may be exceeded.
 .NOEXPORT:
index 03e1d2b..02eaec6 100644 (file)
--- a/stamp-vti
+++ b/stamp-vti
@@ -1,4 +1,4 @@
-@set UPDATED 31 July 2003
-@set UPDATED-MONTH July 2003
+@set UPDATED 5 August 2003
+@set UPDATED-MONTH August 2003
 @set EDITION 1.7a
 @set VERSION 1.7a
index 03e1d2b..02eaec6 100644 (file)
@@ -1,4 +1,4 @@
-@set UPDATED 31 July 2003
-@set UPDATED-MONTH July 2003
+@set UPDATED 5 August 2003
+@set UPDATED-MONTH August 2003
 @set EDITION 1.7a
 @set VERSION 1.7a