]> git.ipfire.org Git - thirdparty/automake.git/commitdiff
refactor: improve signature of 'check_directory' sub in automake
authorStefano Lattarini <stefano.lattarini@gmail.com>
Mon, 17 Oct 2011 09:38:01 +0000 (11:38 +0200)
committerStefano Lattarini <stefano.lattarini@gmail.com>
Mon, 17 Oct 2011 09:38:01 +0000 (11:38 +0200)
* automake.in (check_directory): Take the relative directory
the directory to be checked is expected to be found into as
an optional parameter, rather than reading it from the global
variable `$relative_dir'.
(scan_autoconf_traces, check_directories_in_var): Adjust.

ChangeLog
automake.in

index 4a470bd72ba2d8d9394317d016b62145022d84fc..bb0a5215667c164fe1d31580a56d6fdf673157a5 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2011-10-17  Stefano Lattarini  <stefano.lattarini@gmail.com>
+
+       refactor: improve signature of 'check_directory' sub in automake
+       * automake.in (check_directory): Take the relative directory
+       the directory to be checked is expected to be found into as
+       an optional parameter, rather than reading it from the global
+       variable `$relative_dir'.
+       (scan_autoconf_traces, check_directories_in_var): Adjust.
+
 2011-10-07  Stefano Lattarini  <stefano.lattarini@gmail.com>
 
        parallel-tests: warn on conditional TEST_EXTENSIONS definition
index 00fcbf19f4962cbdaeaaceeb06eecb4c0ac17ec1..c218f83a73285ce40e1b3f91cef200e66660c397 100644 (file)
@@ -3880,16 +3880,17 @@ sub handle_dist ()
 }
 
 
-# check_directory ($NAME, $WHERE)
-# -------------------------------
-# Ensure $NAME is a directory, and that it uses a sane name.
-# Use $WHERE as a location in the diagnostic, if any.
-sub check_directory ($$)
+# check_directory ($NAME, $WHERE [, $RELATIVE_DIR = "."])
+# -------------------------------------------------------
+# Ensure $NAME is a directory (in $RELATIVE_DIR), and that it uses a sane
+# name.  Use $WHERE as a location in the diagnostic, if any.
+sub check_directory ($$;$)
 {
-  my ($dir, $where) = @_;
+  my ($dir, $where, $reldir) = @_;
+  $reldir = '.' unless defined $reldir;
 
-  error $where, "required directory $relative_dir/$dir does not exist"
-    unless -d "$relative_dir/$dir";
+  error $where, "required directory $reldir/$dir does not exist"
+    unless -d "$reldir/$dir";
 
   # If an `obj/' directory exists, BSD make will enter it before
   # reading `Makefile'.  Hence the `Makefile' in the current directory
@@ -3928,7 +3929,7 @@ sub check_directories_in_var ($)
     (sub
      {
        my ($var, $val, $cond, $full_cond) = @_;
-       check_directory ($val, $var->rdef ($cond)->location);
+       check_directory ($val, $var->rdef ($cond)->location, $relative_dir);
        return ();
      },
      undef,
@@ -5252,7 +5253,6 @@ sub scan_autoconf_traces ($)
            }
          $config_aux_dir = $args[1];
          $config_aux_dir_set_in_configure_ac = 1;
-         $relative_dir = '.';
          check_directory ($config_aux_dir, $where);
        }
       elsif ($macro eq 'AC_CONFIG_FILES')
@@ -5272,7 +5272,6 @@ sub scan_autoconf_traces ($)
       elsif ($macro eq 'AC_CONFIG_LIBOBJ_DIR')
        {
          $config_libobj_dir = $args[1];
-         $relative_dir = '.';
          check_directory ($config_libobj_dir, $where);
        }
       elsif ($macro eq 'AC_CONFIG_LINKS')