[Top][All Lists]

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

AX_ADD_AM_MACRO creates circular dependencies

From: Allan Caffee
Subject: AX_ADD_AM_MACRO creates circular dependencies
Date: Tue, 3 Feb 2009 18:38:01 -0500
User-agent: Mutt/1.5.17+20080114 (2008-01-14)

First of all I wasn't really sure where to start this thread so if this isn't
the appropriate place I apologize.

I've noticed that a handful of the packages in the Autoconf archives use the
macros AX_ADD_AM_MACRO and AX_ADD_RECURSIVE_AM_MACRO.  These macros add targets
and variable assignments to a generated file $(top_srcdir)/  Users
are then intended to add a line like

include $(top_srcdir)/

to whichever needs the provided functionality.  The problem with
this is that now depends on  And is
created by configure.  And in turn configure cannot be run (successfully)
without  So in order to even get a useable build system the
developer has to touch

This circular dependency is inconvenient for developers but what's
even worse is that any user who tries to compile this project from a
source tarball must now have Automake installed.  Why?  Because is generated at configure-time and included Automake
files are inserted into the when Automake runs.  This
means that (even if the actual contents of are identical
to those in the tarball) running ./configure && make on a source will
(detecting the change in a dependency of automatically
rerun Automake.

One possible solution to this would be to have the macros responsible
for generating Automake code instead create the file when Autoconf is
run via something like

m4_esyscmd([printf "$2" >> $1])

This should guarantee that the files exist and have the right content
before Automake begins to run.

I'm including a simple example that demonstrates this issue.  Thoughts?


Description: Text document

Attachment: hello.c
Description: Text Data

Description: Text document

reply via email to

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