From: Akim Demaille Date: Mon, 5 Mar 2001 14:35:44 +0000 (+0000) Subject: * automake.in ($in_file_name, $am_file_name, $relative_dirs): X-Git-Tag: handle-languages~187 X-Git-Url: https://sourceware.org/git/?a=commitdiff_plain;h=d956a588f5a0dbdc6182ce250947fc3b5f944010;p=automake.git * automake.in ($in_file_name, $am_file_name, $relative_dirs): Globals, initialized... (&initialize_per_input): here. --- diff --git a/ChangeLog b/ChangeLog index 996d6631..f90197b0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2001-03-05 Akim Demaille + + * automake.in ($in_file_name, $am_file_name, $relative_dirs): + Globals, initialized... + (&initialize_per_input): here. + 2001-03-05 Akim Demaille * automake.in ($am_relative_dir): Global. diff --git a/Makefile.am b/Makefile.am index 0bfa8284..c4a7eb9d 100644 --- a/Makefile.am +++ b/Makefile.am @@ -116,18 +116,18 @@ maintainer-check: automake aclocal echo "Don't use \`local' with parens: use several \`local' above." >&2; \ exit 1; \ fi -## Up to now we manage to limit to 6 uses of local. +## Up to now we manage to limit to 1 use of local. @locals=`grep -c '^[ \t]*local [^*]' $(srcdir)/automake.in`; \ case $$locals in \ - [0-6] ) \ - echo "Wow, congrats! There are $$locals \`local' now!." >&2; \ + [0] ) \ + echo "Wow, congrats! There are no \`local' now!." >&2; \ echo "Please update Makefile.am (maintainer-check)." >&2; \ exit 1; \ ;; \ - 7 ) ;; \ + 1 ) ;; \ * ) \ echo "Too many \`local'! Are you sure you need $$locals of them?" >&2; \ - echo "Up to now 7 was enough." >&2; \ + echo "Up to now 1 was enough." >&2; \ exit 1; \ ;; \ esac diff --git a/Makefile.in b/Makefile.in index 69f71d4f..8d9166fe 100644 --- a/Makefile.in +++ b/Makefile.in @@ -1,4 +1,4 @@ -# Makefile.in generated automatically by automake 1.4e from Makefile.am +# generated automatically by automake 1.4e from # Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 # Free Software Foundation, Inc. @@ -129,12 +129,12 @@ DVIS = automake.dvi TEXINFOS = automake.texi DATA = $(dist_pkgdata_DATA) $(dist_script_DATA) -DIST_COMMON = README $(dist_pkgdata_DATA) $(dist_script_DATA) AUTHORS \ -COPYING ChangeLog INSTALL Makefile.am Makefile.in NEWS README-alpha \ -THANKS TODO aclocal.in aclocal.m4 ansi2knr.1 ansi2knr.c automake.in \ -compile config.guess config.sub configure configure.in depcomp \ -elisp-comp install-sh mdate-sh missing mkinstalldirs py-compile \ -stamp-vti texinfo.tex version.texi ylwrap +DIST_COMMON = README $(dist_pkgdata_DATA) $(dist_script_DATA) AUTHORS \ +COPYING ChangeLog INSTALL NEWS README-alpha THANKS TODO aclocal.in \ +aclocal.m4 ansi2knr.1 ansi2knr.c automake.in compile config.guess \ +config.sub configure configure.in depcomp elisp-comp install-sh \ +mdate-sh missing mkinstalldirs py-compile stamp-vti texinfo.tex \ +version.texi ylwrap DIST_SUBDIRS = $(SUBDIRS) all: all-recursive @@ -646,15 +646,15 @@ maintainer-check: automake aclocal fi @locals=`grep -c '^[ \t]*local [^*]' $(srcdir)/automake.in`; \ case $$locals in \ - [0-6] ) \ - echo "Wow, congrats! There are $$locals \`local' now!." >&2; \ + [0] ) \ + echo "Wow, congrats! There are no \`local' now!." >&2; \ echo "Please update Makefile.am (maintainer-check)." >&2; \ exit 1; \ ;; \ - 7 ) ;; \ + 1 ) ;; \ * ) \ echo "Too many \`local'! Are you sure you need $$locals of them?" >&2; \ - echo "Up to now 7 was enough." >&2; \ + echo "Up to now 1 was enough." >&2; \ exit 1; \ ;; \ esac diff --git a/automake.in b/automake.in index a22eadfd..ad5039e6 100755 --- a/automake.in +++ b/automake.in @@ -28,7 +28,7 @@ eval 'exec @PERL@ -S $0 ${1+"$@"}' # Perl reimplementation by Tom Tromey . require 5.005; -use strict; +# FIXME: use strict; use File::Basename; use IO::File; @@ -414,6 +414,16 @@ my %required_targets = ## Variables reset by &initialize_per_input. ## ## ------------------------------------------ ## +# Basename and relative dir of the input file. +my $am_file_name; +my $am_relative_dir; + +# Same but wrt Makefile.in. +my $in_file_name; +my $relative_dir; + +# These two variables are used when generating each Makefile.in. +# They hold the Makefile.in until it is ready to be printed. my $output_rules; my $output_vars; my $output_trailer; @@ -465,13 +475,6 @@ my @conditional_stack; # This holds the set of included files. my @include_stack; -# This holds the "relative directory" of the current Makefile.in. -# Eg for src/Makefile.in, this is "src". -my $relative_dir; - -# Same but wrt Makefile.am. -my $am_relative_dir; - # This holds a list of files that are included in the # distribution. my %dist_common; @@ -602,6 +605,14 @@ my %def_type; # (Re)-Initialize per-Makefile.am variables. sub initialize_per_input () { + # Basename and relative dir of the input file. + $am_file_name = ''; + $am_relative_dir = ''; + + # Same but wrt Makefile.in. + $in_file_name = ''; + $relative_dir = ''; + # These two variables are used when generating each Makefile.in. # They hold the Makefile.in until it is ready to be printed. $output_rules = ''; @@ -1040,11 +1051,10 @@ sub generate_makefile { my ($output, $makefile) = @_; - # Name of input file ("Makefile.in") and output file - # ("Makefile.am"). These have no directory components. - (my $am_file_name = $makefile) =~ s/^.*\///; - my $in_file_name = $am_file_name . '.in'; - $am_file_name .= '.am'; + # Name of input file ("Makefile.am") and output file + # ("Makefile.in"). These have no directory components. + $am_file_name = basename ($makefile) . '.am'; + $in_file_name = basename ($makefile) . '.in'; # $OUTPUT is encoded. If it contains a ":" then the first element # is the real output file, and all remaining elements are input @@ -4897,8 +4907,9 @@ sub scan_autoconf_files # check must be done for every run, even those where we are only # looking at a subdir Makefile. We must set relative_dir so that # the file-finding machinery works. - # Needs dynamic scopes. - local $relative_dir = '.'; + # FIXME: Is this broken because it needs dynamic scopes. + # My tests seems to show it's not the case. + $relative_dir = '.'; &require_config_file ($FOREIGN, 'install-sh', 'mkinstalldirs', 'missing'); &am_error ("\`install.sh' is an anachronism; use \`install-sh' instead") if -f $config_aux_path[0] . '/install.sh'; diff --git a/lib/am/Makefile.am b/lib/am/Makefile.am index 0bfa8284..c4a7eb9d 100644 --- a/lib/am/Makefile.am +++ b/lib/am/Makefile.am @@ -116,18 +116,18 @@ maintainer-check: automake aclocal echo "Don't use \`local' with parens: use several \`local' above." >&2; \ exit 1; \ fi -## Up to now we manage to limit to 6 uses of local. +## Up to now we manage to limit to 1 use of local. @locals=`grep -c '^[ \t]*local [^*]' $(srcdir)/automake.in`; \ case $$locals in \ - [0-6] ) \ - echo "Wow, congrats! There are $$locals \`local' now!." >&2; \ + [0] ) \ + echo "Wow, congrats! There are no \`local' now!." >&2; \ echo "Please update Makefile.am (maintainer-check)." >&2; \ exit 1; \ ;; \ - 7 ) ;; \ + 1 ) ;; \ * ) \ echo "Too many \`local'! Are you sure you need $$locals of them?" >&2; \ - echo "Up to now 7 was enough." >&2; \ + echo "Up to now 1 was enough." >&2; \ exit 1; \ ;; \ esac diff --git a/m4/Makefile.in b/m4/Makefile.in index f51de231..e9a1b01d 100644 --- a/m4/Makefile.in +++ b/m4/Makefile.in @@ -1,4 +1,4 @@ -# Makefile.in generated automatically by automake 1.4e from Makefile.am +# generated automatically by automake 1.4e from # Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 # Free Software Foundation, Inc. @@ -94,7 +94,7 @@ CONFIG_CLEAN_FILES = DIST_SOURCES = DATA = $(m4data_DATA) -DIST_COMMON = Makefile.am Makefile.in +DIST_COMMON = all: all-am .SUFFIXES: diff --git a/tests/Makefile.in b/tests/Makefile.in index 1288ef83..9009342a 100644 --- a/tests/Makefile.in +++ b/tests/Makefile.in @@ -1,4 +1,4 @@ -# Makefile.in generated automatically by automake 1.4e from Makefile.am +# generated automatically by automake 1.4e from # Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 # Free Software Foundation, Inc. @@ -361,7 +361,7 @@ subdir = tests mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_CLEAN_FILES = DIST_SOURCES = -DIST_COMMON = Makefile.am Makefile.in +DIST_COMMON = all: all-am .SUFFIXES: