automake
[Top][All Lists]
Advanced

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

89-stricter-vars.patch


From: Akim Demaille
Subject: 89-stricter-vars.patch
Date: Wed, 28 Feb 2001 11:01:40 +0100

[Written yesterday by night]

Groumph, I'm starting to be too drunk to hack properly :(

There are several problems my series of patches has introduced, but
I'm tempted to ask for their installations because my feeling is that
the patches are right, they just reveal serious problems.  And
reaching `use strict' is a great news.

use strict is almost happy, there remains one var causing problems:
require_file_found, which I did not fix (it'd be easy) because there
is a dirty hack for depcomp.  Tom, why does it have that special
handling?  It does not follow the regular rules?

There is another problem: installsh.test, but it's related to the very
same problem: the require_file_internal series is incredible...

I plead for my patches because having the test suite fail might be an
impetus sufficient to have people install better handlings (at least,
I plan to, but certainly not before Friday).

In particular, the way require_file_internal modifies
@require_file_paths frigthens me to death.  require_file_internal
should be a pure function (well, installing copies should be the only
side effect), taking require_file_paths as an argument, and returning
the right path.  As is, it's hairy and incredibly fragile (most
ypically, hecking it when you're drunk breaks it :).

If someone has a deep insight in the ../../install-sh missing stuff,
I'm very interested.  I read all the relevant notes, but still did not
catch the actually idea of it.

BTW, until mu drunkness drove me to remove all the work I had done to
uniformize the handling of $config_aux_dir, I had it default to
$(top_srcdir), and had good results.  Is there any point in defaulting
it to nothing and special casing it everywhere it appears?  Yeah,
there are bad bad case such as texinfo.tex, but that remains doable
with a $config_aux_dir_has_no_been_set.

Also, what's the deep meaning of

my @config_aux_path = ('.', '..', '../..');

?  What's special about ../.. and even .. ?  Anything to do with
$cygnus_mode?

Hm.  A few more cigarettes, some more alcohol, and time to get some
sleep now.

Index: ChangeLog
from  Akim Demaille  <address@hidden>

        * automake.in ($in_file_name, $am_file_name, $relative_dirs):
        Globals, initialized...
        (&initialize_per_input): here.

Index: Makefile.am
--- Makefile.am Tue, 27 Feb 2001 22:22:03 +0100 akim (am/f/46_Makefile.a 1.11 
644)
+++ Makefile.am Wed, 28 Feb 2001 01:06:07 +0100 akim (am/f/46_Makefile.a 1.11 
644)
@@ -116,18 +116,18 @@
          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
Index: Makefile.in
--- Makefile.in Tue, 27 Feb 2001 22:22:03 +0100 akim (am/h/16_Makefile.i 1.27 
644)
+++ Makefile.in Wed, 28 Feb 2001 01:06:53 +0100 akim (am/h/16_Makefile.i 1.27 
644)
@@ -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 @@
 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
@@ -622,7 +622,8 @@
          exit 1; \
        else :; fi
        @if grep -n -w undef $(srcdir)/automake.in | \
-             fgrep -v 'undef $/'; then \
+             fgrep -v 'undef $/' | \
+             grep . ; then \
          echo "Found undef in automake.in; use delete instead" 1>&2; \
          exit 1; \
        fi
@@ -645,15 +646,15 @@
        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
Index: automake.in
--- automake.in Tue, 27 Feb 2001 23:44:37 +0100 akim (am/f/39_automake.i 1.96 
755)
+++ automake.in Wed, 28 Feb 2001 01:06:45 +0100 akim (am/f/39_automake.i 1.96 
755)
@@ -28,7 +28,7 @@
 # Perl reimplementation by Tom Tromey <address@hidden>.

 require 5.005;
-use strict;
+# FIXME: use strict;
 use File::Basename;
 use IO::File;

@@ -414,6 +414,16 @@
 ## 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 @@
 # 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 @@
 # (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 = '';
@@ -1034,11 +1045,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
@@ -4884,8 +4894,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';
Index: m4/Makefile.in
--- m4/Makefile.in Mon, 26 Feb 2001 23:44:40 +0100 akim (am/h/15_Makefile.i 
1.19 644)
+++ m4/Makefile.in Wed, 28 Feb 2001 01:06:54 +0100 akim (am/h/15_Makefile.i 
1.19 644)
@@ -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 @@
 DIST_SOURCES =
 DATA =  $(m4data_DATA)

-DIST_COMMON =  Makefile.am Makefile.in
+DIST_COMMON =

 all: all-am
 .SUFFIXES:
Index: tests/Makefile.in
--- tests/Makefile.in Tue, 27 Feb 2001 20:24:10 +0100 akim (am/h/14_Makefile.i 
1.22 644)
+++ tests/Makefile.in Wed, 28 Feb 2001 01:06:54 +0100 akim (am/h/14_Makefile.i 
1.22 644)
@@ -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 @@
 mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
 CONFIG_CLEAN_FILES =
 DIST_SOURCES =
-DIST_COMMON =  Makefile.am Makefile.in
+DIST_COMMON =   install-sh

 all: all-am
 .SUFFIXES:



reply via email to

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