[Top][All Lists]

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

Re: Strangeness with m4_include and aclocal.

From: Stefano Lattarini
Subject: Re: Strangeness with m4_include and aclocal.
Date: Fri, 22 Oct 2010 20:43:49 +0200
User-agent: KMail/1.13.3 (Linux/2.6.30-2-686; KDE/4.4.4; i686; ; )

Hello Nick.  Thanks for the report.

May I ask you that, the next time you report a problem, you also tell which
version of aclocal/automake are you using, and post the content of all the
relevant files (or reduced exemples thereof)?  That would make it easier
for us to understand and reproduce the reported issues.  Thanks.

On Wednesday 20 October 2010, Nick Bowler wrote:
> I'm trying to define an autoconf macro which calls m4_include on one of its
> arguments.  However, aclocal and/or automake seem to be choking a bit
> when I do this.
> My first idea was to write something simple like the following:
>   AC_DEFUN([MY_INC], [m4_include([$1])])
> but this causes aclocal to fail with the following error message:
>   aclocal-1.11: file `$1' does not exist
> Strange.
I can reproduce and confirm this problem with both Automake 1.11 and with
the latest developement version of Automake (from git "master" branch), as

  $ cat > <<'END'
  AC_DEFUN([MY_INC], [m4_include([$1])])
  AC_INIT([foo], [1.0])
  $ touch foo.m4
  $ aclocal # latest stable version
  aclocal: file `$1' does not exist
  $ aclocal-1.11a # latest developement version
  aclocal: error: file `$1' does not exist

I currently have no idea of why this is happening (but luckily you have
a workaround, so this should not be such a big problem for you ATM).

> So I tried to avoid this by being a little trickier:
>   AC_DEFUN([MY_INC2], [m4_apply([m4_include], [[$1]])])
> Now aclocal works properly, but the makefiles generated by automake do
> not: if the m4_included file is newer than aclocal.m4, 'make' will
> attempt to regenerate aclocal.m4 by calling aclocal.  Since aclocal.m4
> isn't actually out of date, aclocal does nothing and aclocal.m4 isn't
> updated.  Thus, every 'make' invocation will run aclocal needlessly.
I can reproduce and confirm this problem with Automake 1.11, but luckily
it *seems* to have been fixed in developement version from git master
branch, probably with commit `v1.11-17-g333c18a' by Ralf Wildenhues.

I'm out of time right now, but maybe tomorrow I might be able to check
that it really was that commit that fixed that problem; and if it is so,
your report might become a nice testsuite addition, ensuring that we do
not regress again in this matter.
> 'make dist' correctly picks up the m4_included file in either case.
> What's going on here?
The failure in your second example was probably due to timestamp issues
(I'd classify it as a minor bug in automake).  I still have no idea why
your first example fails; I might try to dig deeper in the next days (if
nobody beats me ;-). 

reply via email to

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