Package: automake1.9
Version: 1.9.6-4
Severity: normal
Tags: patch

I'm using Automake with a package that has its source in various
subdirectories but builds the whole package with a single non-recursive
Makefile, as mentioned in the Automake manual under Directories /
Alternative.  Everything works except that, after checking for a
deficient snprintf, I call AC_LIBOBJ([util/snprintf]).  This results
in the following error from Automake:

configure.ac:25: required file `./util/snprintf.c' not found

even though the file exists.

The problem is in the dir_has_case_matching_file routine in
Automake/FileUtils.pm, which assumes that the file that it's passed is
a simple filename, or alternately is in require_file_internal in
automake itself, which doesn't detect this case.  A quick inspection
of the former routine reveals that it will never work if passed a
filename like util/snprintf.c (and a $dir of ., which is what happens
in this case).

The attached patch works around this and shouldn't have any negative
side effects.  It may not be as clean as upstream wants, since it
supports a partial path as part of the filename, but the alternative
of modifying require_file_internal looked slightly more complex.

Let me know, though, if you'd rather have a patch for automake.

-- System Information:
Debian Release: testing/unstable
  APT prefers testing
  APT policy: (990, 'testing'), (500, 'unstable'), (1, 'experimental')
Architecture: i386 (i686)
Shell:  /bin/sh linked to /bin/bash
Kernel: Linux 2.6.15-1-686
Locale: LANG=C, LC_CTYPE=C (charmap=ANSI_X3.4-1968)

Versions of packages automake1.9 depends on:
ii  autoconf                      2.59a-8    automatic configure script builder
ii  autotools-dev                 20060223.1 Update infrastructure for config.{

automake1.9 recommends no packages.

-- no debconf information
--- automake1.9-1.9.6/lib/Automake/FileUtils.pm.orig    2005-05-14 
13:21:06.000000000 -0700
+++ automake1.9-1.9.6/lib/Automake/FileUtils.pm 2006-03-29 20:46:43.000000000 
-0800
@@ -339,6 +339,16 @@
   my ($dirname, $file_name) = @_;
   return 0 unless -f "$dirname/$file_name";
 
+  # It's possible that the file name won't be a simple file name and
+  # instead will include a directory component.  In that case, we have
+  # to figure out what the real directory is.
+  if ($file_name =~ m%/%)
+    {
+      my $partial_dir;
+      ($partial_dir, $file_name) = ($file_name =~ m%^(.*)/([^/]*)%);
+      $dirname = "$dirname/$partial_dir";
+    }
+
   # The file appears to exist, however it might be a mirage if the
   # system is case insensitive.  Let's browse the directory and check
   # whether the file is really in.  We maintain a cache of directories

Reply via email to