Subject: Diagnose invalid primary/directory combinations (was: Re: configmake module and automake 1.9.6)
From: Stefano Lattarini <[email-masked]>
To: [email-masked]
Cc: [email-masked], Ralf Wildenhues <[email-masked]>, Eric Blake <[email-masked]>
Date: Wed, 15 Dec 2010 12:27:43 +0100
List-Id: <debbugs-submit.debbugs.gnu.org>

Hi Eric.

On Tuesday 14 December 2010, Eric Blake wrote:
> [dropping gnulib for this reply]
> 
> On 12/14/2010 02:54 PM, Eric Blake wrote:
> >>>  # Listed in the same order as the GNU makefile conventions.
> >>>  # The Automake-defined pkg* macros are appended, in the order
> >>>  # listed in the Automake 1.10a+ documentation.
> >>> +# Support newer definitions even when using older automake 1.9.6
> >>
> >> The Automake version is probably irrelevant here. It's the Autoconf
> >> version that matters.
> > 
> > Oh; it's a mix of both autoconf and automake macros (autoconf AC_SUBST's
> > localedir, but only automake 1.11 AC_SUBST's pkglibexecdir); the comment
> > in modules/configmake only mentioned automake, but both tools have a
> > hand in feeding configmake.h.
> 
> In fact, I think automake has a minor bug.  automake.in lists the
> following directories:
> 
> my %standard_prefix =
>     map { $_ => 1 } (qw(bin data dataroot dvi exec html include info
>                         lib libexec lisp localstate man man1 man2 man3
>                         man4 man5 man6 man7 man8 man9 oldinclude pdf
>                         pkgdatadir pkgincludedir pkglibdir pkglibexecdir
>                         ps sbin sharedstate sysconf));
> 
> That list is missing 'doc' and 'locale'.
>
If you are referring to this issue:
 <http://lists.gnu.org/archive/html/bug-gnulib/2010-12/msg00080.html>
then I don't think this automake bug (or limitation) is relevant.

The list in `%standard_prefix' is used only for diagnosing invalid
primary/directory combinations, such as `data_PROGRAMS' or
'lib_HEADERS'. For more info, see test `dirforbid.test', PR/294 at
<http://sources.redhat.com/cgi-bin/gnatsweb.pl?database=automake>,
and commit e87d851a863a7c321af8bc7b2b36aff5e072ff94 (05/03/2002).

That said, you might have uncovered a bug in automake, because
something like:
  doc_LIBRARIES = libfoo.a
should warn IMHO, but it currently doesn't.

Ralf, what do you think?  If you agree with me, I'll attempt a
patch (and a testsuite enhancement).

Regards,
   Stefano