This is the mail archive of the
automake@gnu.org
mailing list for the automake project.
Re: Automake 1.5
- To: "Gary V. Vaughan" <gary at gnu dot org>
- Subject: Re: Automake 1.5
- From: Tim Van Holder <tim dot van dot holder at pandora dot be>
- Date: 31 Aug 2001 08:32:31 +0200
- Cc: Akim Demaille <akim at epita dot fr>, m4-discuss at gnu dot org, automake at gnu dot org
- List-Id: Discussion list for automake <automake.gnu.org>
- References: <20010824163757.A17191@lrde.epita.fr><20010826175539.A4158@demon.co.uk> <20010829204316.D29340@demon.co.uk><mv4lmk1rd4v.fsf@nostromo.lrde.epita.fr> <20010830201502.E15411@demon.co.uk>
On 30 Aug 2001 20:15:02 +0100, Gary V. Vaughan wrote:
> On Thu, Aug 30, 2001 at 01:38:40PM +0200, Akim Demaille wrote:
> >
> > | 29 m4_SOURCES = main.c m4.h freeze.c stackovf.c $(M4OBJS)
> >
>
> M4OBJS=
> m4_pattern_allow([^m4_getopt_h$])
> m4_getopt_h=src/getopt.h
> rm -f $m4_getopt_h
> AC_CHECK_FUNC(getopt_long, [],
> [M4OBJS="getopt1.$ac_objext getopt.$ac_objext"
> echo linking src/gnu-getopt.h to $m4_getopt_h
> $LN_S ./gnu-getopt.h $m4_getopt_h])
> AC_SUBST(M4OBJS)
>
> The Makefile.am snippet is in the quote above, and relies on
> automake's property of creating a make variable from every AC_SUBST.
> Obviously, this has worked until we upgraded to automake-1.5. Any
> advice?
If I remember correctly, automake needs to know about all the sources so
it can properly set up compilation, dependency tracking, etc.
In cases like this, I think you're supposed to use
EXTRA_m4_SOURCES = getopt1.c getopt.c
m4_LDADD = $(M4OBJS)
in Makefile.am (the configure.ac snippet can remain unchanged, though
using AC_CONFIG_LINKS instead of a manual echo/$LN_S might be nice).
That way, automake can do its magic based on the source files, and will
build and link them as required.