automake-patches
[Top][All Lists]
Advanced

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

34-fyi-require-file-where.patch


From: Akim Demaille
Subject: 34-fyi-require-file-where.patch
Date: Sun, 21 Oct 2001 20:12:19 +0200

Index: ChangeLog
from  Akim Demaille  <address@hidden>
        * automake.in (&require_file_internal): Instead of $file and $line,
        take $where as first argument.
        Adjust all callers.
        (&require_file_with_macro): New.
        Use it where internal black magic was used to recover the location
        of a macro definition.
        
        
Index: automake.in
--- automake.in Sun, 21 Oct 2001 16:49:48 +0200 akim
+++ automake.in Sun, 21 Oct 2001 17:27:57 +0200 akim
@@ -2330,7 +2330,7 @@ sub handle_lib_objects_cond
 
                if ($iter =~ /\.h$/)
                {
-                   &require_file_with_line ($var, $FOREIGN, $iter);
+                   require_file_with_macro ($var, $FOREIGN, $iter);
                }
                elsif ($iter ne 'alloca.c')
                {
@@ -2345,7 +2345,7 @@ sub handle_lib_objects_cond
                                   &variable_value_as_list_recursive (
                                        'BUILT_SOURCES', 'all')))
                    {
-                       &require_file_with_line ($var, $FOREIGN, $iter);
+                       require_file_with_macro ($var, $FOREIGN, $iter);
                    }
                }
            }
@@ -2360,7 +2360,7 @@ sub handle_lib_objects_cond
                            "address@hidden" . "ALLOCA\@ seen but 
`AC_FUNC_ALLOCA' not in `$configure_ac'")
                if ! defined $libsources{'alloca.c'};
            $dep_files{'$(DEPDIR)/alloca.P' . $myobjext} = 1;
-           &require_file_with_line ($var, $FOREIGN, 'alloca.c');
+           require_file_with_macro ($var, $FOREIGN, 'alloca.c');
            &saw_extension ('c');
        }
     }
@@ -2469,7 +2469,7 @@ sub handle_compile ()
          {
            # Only require ansi2knr files if they should appear in
            # this directory.
-           &require_file_with_line ('AUTOMAKE_OPTIONS', $FOREIGN,
+           require_file_with_macro ('AUTOMAKE_OPTIONS', $FOREIGN,
                                     'ansi2knr.c', 'ansi2knr.1');
 
            # ansi2knr needs to be built before subdirs, so unshift it.
@@ -3090,7 +3090,7 @@ sub handle_texinfo_helper
            }
            else
            {
-               &require_file_with_line ('info_TEXINFOS', $FOREIGN,
+               require_file_with_macro ('info_TEXINFOS', $FOREIGN,
                                         'mdate-sh');
            }
 
@@ -3202,7 +3202,7 @@ sub handle_texinfo_helper
        }
        else
        {
-           &require_file_with_line ('info_TEXINFOS', $FOREIGN, 'texinfo.tex');
+           require_file_with_macro ('info_TEXINFOS', $FOREIGN, 'texinfo.tex');
        }
     }
 
@@ -3773,8 +3773,7 @@ sub handle_configure
                $ch_sans_dir = backname ($relative_dir) . '/' . $one_hdr;
            }
 
-           &require_file_with_conf_line ($config_header_line,
-                                         $FOREIGN, $ch_sans_dir);
+           require_file ($config_header_line, $FOREIGN, $ch_sans_dir);
 
            # Header defined and in this directory.
            my @files;
@@ -3810,8 +3809,8 @@ sub handle_configure
                               'SRC_STAMP'        => "$out_dir/$stamp_name"));
 
            &create ("${relative_dir}/${out_dir}/${stamp_name}.in");
-           &require_file_with_conf_line ($config_header_line, $FOREIGN,
-                                         "${out_dir}/${stamp_name}.in");
+           require_file ($config_header_line, $FOREIGN,
+                         "${out_dir}/${stamp_name}.in");
 
            $distclean_config .= ' ' if $distclean_config;
            $distclean_config .= $cn_sans_dir;
@@ -3939,8 +3938,8 @@ sub handle_configure
        push (@actual_other_files, $local);
 
        # Require all input files.
-       &require_file_with_conf_line ($ac_output_line, $FOREIGN,
-                                     &rewrite_inputs_into_dependencies (0, 
@inputs));
+       require_file ($ac_output_line, $FOREIGN,
+                     &rewrite_inputs_into_dependencies (0, @inputs));
     }
 
     # These files get removed by "make clean".
@@ -3979,7 +3978,7 @@ sub handle_gettext
                    "AM_GNU_GETTEXT used but `intl' not in SUBDIRS")
        if ! grep ('intl', @subdirs);
 
-    &require_file_with_conf_line ($ac_gettext_line, $GNU, 'ABOUT-NLS');
+    require_file ($ac_gettext_line, $GNU, 'ABOUT-NLS');
 }
 
 # Handle footer elements.
@@ -7688,8 +7687,8 @@ sub maybe_push_required_file
 }
 
 
-# &require_file_internal ($IS_CONFIGURE, $LINE, $MYSTRICT, @FILES)
-# ----------------------------------------------------------------
+# &require_file_internal ($WHERE, $MYSTRICT, @FILES)
+# --------------------------------------------------
 # Verify that the file must exist in the current directory.
 # $MYSTRICT is the strictness level at which this file becomes required.
 #
@@ -7698,7 +7697,7 @@ sub maybe_push_required_file
 # which the first file was found) before return.
 sub require_file_internal
 {
-    my ($is_configure, $line, $mystrict, @files) = @_;
+    my ($where, $mystrict, @files) = @_;
 
     foreach my $file (@files)
     {
@@ -7821,83 +7820,93 @@ sub require_file_internal
 
                if ($suppress)
                {
-                   if ($is_configure)
-                   {
-                       # FIXME: allow actual file to be specified.
-                       am_file_warning ("$configure_ac:$line",
-                                        "$message$trailer");
-                   }
-                   else
-                   {
-                       &am_line_warning ($line, "$message$trailer");
-                   }
+                 am_file_warning ($where, "$message$trailer");
                }
                else
                {
-                   if ($is_configure)
-                   {
-                       # FIXME: allow actual file to be specified.
-                       am_file_error ("$configure_ac:$line",
-                                      "$message$trailer");
-                   }
-                   else
-                   {
-                       am_line_error ($line, "$message$trailer");
-                   }
+                 am_file_error ($where, "$message$trailer");
                }
            }
        }
     }
 }
 
-# Like require_file_with_line, but error messages refer to
-# configure.ac, not the current Makefile.am.
-sub require_file_with_conf_line
+# &require_file ($WHERE, $MYSTRICT, @FILES)
+# -----------------------------------------
+sub require_file ($$@)
 {
+    my ($mystrict, @files) = @_;
     @require_file_paths = $relative_dir;
-    &require_file_internal (1, @_);
+    require_file_internal ($where, $mystrict, @files);
 }
 
-sub require_file_with_line
+# &require_file_with_macro ($MACRO, $MYSTRICT, @FILES)
+# ----------------------------------------------------
+sub require_file_with_macro ($$@)
 {
+    my ($macro, $mystrict, @files) = @_;
     @require_file_paths = $relative_dir;
-    &require_file_internal (0, @_);
+    require_file_internal ($var_location{$macro}, $mystrict, @files);
 }
 
-sub require_file
+# &require_file_with_conf_line ($LINE, $MYSTRICT, @FILES)
+# -------------------------------------------------------
+# Like require_file_with_line, but error messages refer to
+# configure.ac.
+sub require_file_with_conf_line ($$@)
 {
+    my ($line, $mystrict, @files) = @_;
     @require_file_paths = $relative_dir;
-    &require_file_internal (0, '', @_);
+    require_file_internal ("$configure_ac:$line", $mystrict, @files);
 }
 
+# &require_file_with_line ($LINE, $MYSTRICT, @FILES)
+# --------------------------------------------------
+# $LINE is wrt $AM_FILE.am.
+sub require_file_with_line ($$@)
+{
+    my ($line, $mystrict, @files) = @_;
+    @require_file_paths = $relative_dir;
+    require_file_internal ("$am_file.am:$line", $mystrict, @files);
+}
+
+# &require_config_file ($MYSTRICT, @FILES)
+# ----------------------------------------
 # Require a file that is also required by Autoconf.  Looks in
 # configuration path, as specified by AC_CONFIG_AUX_DIR.
-sub require_config_file
+sub require_config_file ($@)
 {
+    my ($mystrict, @files) = @_;
     @require_file_paths = @config_aux_path;
-    &require_file_internal (1, '', @_);
+    &require_file_internal ($configure_ac, $mystrict, @files);
     my $dir = $require_file_paths[0];
     @config_aux_path = @require_file_paths;
      # Avoid unsightly '/.'s.
     $config_aux_dir = '$(top_srcdir)' . ($dir eq '.' ? "" : "/$dir");
 }
 
-# Assumes that the line number is in Makefile.am.
-sub require_conf_file_with_line
+# &require_file_with_line ($LINE, $MYSTRICT, @FILES)
+# --------------------------------------------------
+# $LINE is wrt $AM_FILE.am.
+sub require_conf_file_with_line ($$@)
 {
+    my ($line, $mystrict, @files) = @_;
     @require_file_paths = @config_aux_path;
-    &require_file_internal (0, @_);
+    require_file_internal ("$am_file.am:$line", $mystrict, @files);
     my $dir = $require_file_paths[0];
     @config_aux_path = @require_file_paths;
      # Avoid unsightly '/.'s.
     $config_aux_dir = '$(top_srcdir)' . ($dir eq '.' ? "" : "/$dir");
 }
 
-# Assumes that the line number is in configure.ac.
-sub require_conf_file_with_conf_line
+# &require_file_with_line ($LINE, $MYSTRICT, @FILES)
+# --------------------------------------------------
+# $LINE is wrt $AM_FILE.am
+sub require_conf_file_with_conf_line ($$@)
 {
+    my ($line, $mystrict, @files) = @_;
     @require_file_paths = @config_aux_path;
-    &require_file_internal (1, @_);
+    &require_file_internal ("$configure_ac:$line", $mystrict, @files);
     my $dir = $require_file_paths[0];
     @config_aux_path = @require_file_paths;
     # avoid unsightly '/.'s.



reply via email to

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