From c830eabc6946dcf6bda3b2407acb8d6cb104ac14 Mon Sep 17 00:00:00 2001 From: Alexandre Duret-Lutz Date: Wed, 6 Aug 2003 21:20:15 +0000 Subject: [PATCH] * 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. --- ChangeLog | 10 +++++++ Makefile.am | 2 +- Makefile.in | 2 +- aclocal.in | 5 +--- automake.in | 7 +---- bootstrap | 36 +++++++++++++----------- lib/Automake/Config.in | 52 ++++++++++++++++++++++++++++++++++ lib/Automake/Makefile.am | 18 ++++++++++++ lib/Automake/Makefile.in | 61 +++++++++++++++++++++++++++++++--------- stamp-vti | 4 +-- version.texi | 4 +-- 11 files changed, 155 insertions(+), 46 deletions(-) create mode 100644 lib/Automake/Config.in diff --git a/ChangeLog b/ChangeLog index 76e73679..a2fb2703 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2003-08-06 Alexandre Duret-Lutz + + * 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 * tests/ltconv.test: s/rm/rm -f/ to placate maintainer-check. diff --git a/Makefile.am b/Makefile.am index 565010de..dd186a73 100644 --- a/Makefile.am +++ b/Makefile.am @@ -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; \ diff --git a/Makefile.in b/Makefile.in index 18e7297c..663fd003 100644 --- a/Makefile.in +++ b/Makefile.in @@ -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; \ diff --git a/aclocal.in b/aclocal.in index 0db058dd..64c5c265 100644 --- a/aclocal.in +++ b/aclocal.in @@ -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'; diff --git a/automake.in b/automake.in index 46430531..513bb177 100755 --- a/automake.in +++ b/automake.in @@ -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. diff --git a/bootstrap b/bootstrap index d1860847..2ac80347 100755 --- 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 index 00000000..e5d5f1aa --- /dev/null +++ b/lib/Automake/Config.in @@ -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: diff --git a/lib/Automake/Makefile.am b/lib/Automake/Makefile.am index 75eefac7..97b236e3 100644 --- a/lib/Automake/Makefile.am +++ b/lib/Automake/Makefile.am @@ -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 >$@ diff --git a/lib/Automake/Makefile.in b/lib/Automake/Makefile.in index 21e7aef2..8367fba3 100644 --- a/lib/Automake/Makefile.in +++ b/lib/Automake/Makefile.in @@ -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: diff --git a/stamp-vti b/stamp-vti index 03e1d2b6..02eaec66 100644 --- 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 diff --git a/version.texi b/version.texi index 03e1d2b6..02eaec66 100644 --- a/version.texi +++ b/version.texi @@ -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 -- 2.43.5