Re: Autoconf/Automake is not using version from AC_INIT

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

 




On 25/1/21 11:33 am, Zack Weinberg wrote:
On Sun, Jan 24, 2021 at 7:27 PM Bob Friesenhahn
<bfriesen@xxxxxxxxxxxxxxxxxxx> wrote:
AC_SUBST([CONFIGURE_DEPENDENCIES],["$CONFIGURE_DEPENDENCIES \$(top_srcdir)/ChangeLog \$(top_srcdir)/version.sh"])
Why did you write it like this instead of

CONFIGURE_DEPENDENCIES = $(top_srcdir)/ChangeLog $(top_srcdir)/version.sh

directly in Makefile.am?  The way you did it, I don't think Automake
will be aware that the variable exists.
All automake does is to declare

am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
    $(ACLOCAL_M4)

regardless whether 'CONFIGURE_DEPENDENCIES' is mentioned in 'Makefile.am'.


(Also, I thought having configure not be updated when the information
provided to AC_INIT has not changed was what you wanted to happen!)

True, but once the rule for regenerating configure is updated, one wants it to be updated so the rule is not triggered at every 'make'.

I've managed to reproduce the behavior Bob describes in the attached script. If we touch the timestamp of configure.ac, running autoconf will update the timestamp of configure. But if the autoconf is triggered by something else for example if ChangeLog has been touched, then autoconf won't touch configure. I suppose that behavior of autoconf is too established to be changed, but I think making --force default would be more intuitive.

One solution is to put the content of the AC_INIT arguments into dedicated files and add this file to  CONFIGURE_DEPENDENCIES, which will reduce the risk for this to happen but it's still possible that this file becomes newer than configure and one is back to autoconf being triggered at every 'make'.

Peter

Attachment: test.sh
Description: application/shellscript


[Index of Archives]     [GCC Help]     [Kernel Discussion]     [RPM Discussion]     [Red Hat Development]     [Yosemite News]     [Linux USB]     [Samba]

  Powered by Linux