From f30bb13921cbf6593e3f8b90d5c05014873b6eea Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Mon, 11 Dec 1995 01:27:29 +0000 Subject: [PATCH] Added --install-missing option --- ChangeLog | 12 ++++++++++++ Makefile.am | 10 +++++----- Makefile.in | 16 ++++++++-------- NEWS | 3 +++ TODO | 4 +--- automake.in | 24 ++++++++++++++++++++++++ lib/am/Makefile.am | 10 +++++----- 7 files changed, 58 insertions(+), 21 deletions(-) diff --git a/ChangeLog b/ChangeLog index 1f103adbb..7ccd877a6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,7 +1,19 @@ Sun Dec 10 11:59:33 1995 Tom Tromey + * Makefile.am (pkgdata_DATA): Cause INSTALL, install-sh, mdate-sh, + mkinstalldirs, texinfo.tex to be installed. + * automake.in (symlink_exists): New global. + (install_missing): Ditto. + (require_file): Install missing files if possible. + (parse_arguments): Handle --install-missing option. + (initialize_global_constants): Document --install-missing. + * Makefile.am (cvs-dist): Don't release unless NEWS updated. Ensure 'checks' pass before release. + (maintainer-check): Renamed. Look in $(srcdir) for sources. From + Franc,ois Pinard. + (cvs-dist): Depend on maintainer-check instead of explicitly + running check. * configure.in (VERSION): Version 0.26. diff --git a/Makefile.am b/Makefile.am index 2c0a83529..eccfe0b4f 100644 --- a/Makefile.am +++ b/Makefile.am @@ -12,7 +12,8 @@ program.am programs.am remake-hdr.am \ remake-subd.am remake.am scripts.am subdirs.am tags.am tags-subd.am \ tags-clean.am \ texi-clean.am texi-version.am texinfos-vars.am texinfos.am \ -libraries-clean.am scripts-clean.am programs-clean.am data-clean.am +libraries-clean.am scripts-clean.am programs-clean.am data-clean.am \ +INSTALL install-sh mdate-sh mkinstalldirs texinfo.tex DIST_OTHER = automake.in @@ -27,9 +28,9 @@ ETAGS_ARGS = automake.in --lang=none \ # * syntax check with perl4 and perl5. # * make sure the scripts don't use 'true' # These are only really guaranteed to work on my machine. -check-local: automake +maintainer-check: automake @PERL@ -c -w automake - if grep '^[^#].*true' [a-z]*.am; then \ + if grep '^[^#].*true' $(srcdir)/[a-z]*.am; then \ echo "can't use 'true' in GNU Makefile" 1>&2; \ exit 1; \ else :; fi @@ -42,8 +43,7 @@ automake: automake.in # Tag before making distribution. Also, don't make a distribution if # checks fail. Also, make sure the NEWS file is up-to-date. -cvs-dist: - $(MAKE) check +cvs-dist: maintainer-check if sed 1q NEWS | grep -e "$(VERSION)"; then :; else \ echo "NEWS not updated; not releasing" 1>&2; \ exit 1; \ diff --git a/Makefile.in b/Makefile.in index acf1fc1d0..edb4291c1 100644 --- a/Makefile.in +++ b/Makefile.in @@ -1,4 +1,4 @@ -# Makefile.in generated automatically by automake 0.25 from Makefile.am +# Makefile.in generated automatically by automake 0.26 from Makefile.am # Copyright (C) 1994, 1995 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify @@ -59,7 +59,8 @@ program.am programs.am remake-hdr.am \ remake-subd.am remake.am scripts.am subdirs.am tags.am tags-subd.am \ tags-clean.am \ texi-clean.am texi-version.am texinfos-vars.am texinfos.am \ -libraries-clean.am scripts-clean.am programs-clean.am data-clean.am +libraries-clean.am scripts-clean.am programs-clean.am data-clean.am \ +INSTALL install-sh mdate-sh mkinstalldirs texinfo.tex DIST_OTHER = automake.in @@ -84,7 +85,7 @@ DVIS = automake.dvi DATA = $(pkgdata_DATA) ACLOCAL = aclocal.m4 -DIST_COMMON = mkinstalldirs configure Makefile.in stamp-vti configure.in ChangeLog THANKS README version.texi mdate-sh TODO INSTALL Makefile.am texinfo.tex NEWS aclocal.m4 install-sh +DIST_COMMON = mkinstalldirs configure Makefile.in stamp-vti configure.in ChangeLog THANKS README version.texi mdate-sh TODO INSTALL Makefile.am NEWS aclocal.m4 install-sh PACKAGE = @PACKAGE@ VERSION = @VERSION@ @@ -247,7 +248,7 @@ info: $(INFO_DEPS) dvi: $(DVIS) -check: check-local +check: installcheck: @@ -294,9 +295,9 @@ maintainer-clean: distclean maintainer-clean-binSCRIPTS maintainer-clean-vti mai # * syntax check with perl4 and perl5. # * make sure the scripts don't use 'true' # These are only really guaranteed to work on my machine. -check-local: automake +maintainer-check: automake @PERL@ -c -w automake - if grep '^[^#].*true' [a-z]*.am; then \ + if grep '^[^#].*true' $(srcdir)/[a-z]*.am; then \ echo "can't use 'true' in GNU Makefile" 1>&2; \ exit 1; \ else :; fi @@ -309,8 +310,7 @@ automake: automake.in # Tag before making distribution. Also, don't make a distribution if # checks fail. Also, make sure the NEWS file is up-to-date. -cvs-dist: - $(MAKE) check +cvs-dist: maintainer-check if sed 1q NEWS | grep -e "$(VERSION)"; then :; else \ echo "NEWS not updated; not releasing" 1>&2; \ exit 1; \ diff --git a/NEWS b/NEWS index dea0209c6..60acb2175 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,6 @@ +New in 0.26: +* Added --install-missing option. + New in 0.25: * Bug fixes. * Works with Perl 4 again. diff --git a/TODO b/TODO index 2a0b6373d..a6f182ecd 100644 --- a/TODO +++ b/TODO @@ -1,5 +1,6 @@ Top priorities: * Fix up how 'clean' interacts with new naming scheme. +* am_error should use printf-style arguments (for eventual gettext scheme) uninstall and pkg-dirs should rm -rf the dir. @@ -36,9 +37,6 @@ Should 'distclean' remove $(SCRIPTS)? Should 'maintainer-clean' do "rm -rf .deps"? Should look for clean-local targets in Makefile.am. -Consider a --install-missing option to install missing files such as -mdate-sh, texinfo.tex, etc. - Think about writing a small tool to guess what the local Makefile.am should look like. diff --git a/automake.in b/automake.in index 996c28e6e..c4212e78e 100755 --- a/automake.in +++ b/automake.in @@ -54,6 +54,12 @@ $use_dependencies = 1; # we have processed all input files. $exit_status = 0; +# From the Perl manual. +$symlink_exists = (eval 'symlink ("", "");', $@ eq ''); + +# TRUE if missing standard files should be installed. +$install_missing = 0; + &initialize_global_constants; @@ -131,6 +137,10 @@ sub parse_arguments shift (@arglist); $output_directory = $arglist[0]; } + elsif ($arglist[0] eq '--install-missing') + { + $install_missing = 1; + } elsif ($arglist[0] eq '--') { # Stop option processing. @@ -1193,6 +1203,7 @@ sub initialize_global_constants --amdir=DIR directory storing config files --help print this help, then exit --include-deps include generated dependencies in Makefile.in + --install-missing install missing standard files --output-dir=DIR put generated Makefile.in's into DIR --strictness=LEVEL set strictness level. LEVEL is normal, gnu, gnits --version print version number, then exit\n"; @@ -1411,6 +1422,19 @@ sub require_file { &push_dist_common ($file); } + elsif ($install_missing && -f ($am_dir . '/' . $file)) + { + # Install the missing file. Symlink if we can, copy if we must. + if ($symlink_exists) + { + symlink ($am_dir . '/' . $file, $fullfile); + } + else + { + system ('cp', $am_dir . '/' . $file, $fullfile); + } + &am_error ("required file \"$fullfile\" not found; installing"); + } elsif ($strictness >= $mystrict) { # Only an error if strictness constraint violated. diff --git a/lib/am/Makefile.am b/lib/am/Makefile.am index 2c0a83529..eccfe0b4f 100644 --- a/lib/am/Makefile.am +++ b/lib/am/Makefile.am @@ -12,7 +12,8 @@ program.am programs.am remake-hdr.am \ remake-subd.am remake.am scripts.am subdirs.am tags.am tags-subd.am \ tags-clean.am \ texi-clean.am texi-version.am texinfos-vars.am texinfos.am \ -libraries-clean.am scripts-clean.am programs-clean.am data-clean.am +libraries-clean.am scripts-clean.am programs-clean.am data-clean.am \ +INSTALL install-sh mdate-sh mkinstalldirs texinfo.tex DIST_OTHER = automake.in @@ -27,9 +28,9 @@ ETAGS_ARGS = automake.in --lang=none \ # * syntax check with perl4 and perl5. # * make sure the scripts don't use 'true' # These are only really guaranteed to work on my machine. -check-local: automake +maintainer-check: automake @PERL@ -c -w automake - if grep '^[^#].*true' [a-z]*.am; then \ + if grep '^[^#].*true' $(srcdir)/[a-z]*.am; then \ echo "can't use 'true' in GNU Makefile" 1>&2; \ exit 1; \ else :; fi @@ -42,8 +43,7 @@ automake: automake.in # Tag before making distribution. Also, don't make a distribution if # checks fail. Also, make sure the NEWS file is up-to-date. -cvs-dist: - $(MAKE) check +cvs-dist: maintainer-check if sed 1q NEWS | grep -e "$(VERSION)"; then :; else \ echo "NEWS not updated; not releasing" 1>&2; \ exit 1; \ -- 2.11.4.GIT