automake
[Top][All Lists]
Advanced

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

Re: Automake 1.5


From: Gary V. Vaughan
Subject: Re: Automake 1.5
Date: Sat, 1 Sep 2001 11:28:19 +0100
User-agent: Mutt/1.3.21i

On Fri, Aug 31, 2001 at 08:32:31AM +0200, Tim Van Holder wrote:
> 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

I think this info must have been lurking in my subconcious, since we
already had the EXTRA_m4_SOURCES declaration.  Moving the $(M4OBJS)
reference from m4_SOURCES to m4_LDADD does allow Automake 1.5 to parse
out Makefile.am again though.  Thanks!

Was this a deliberate change in semantics to enforce some sanity
(which is fine), or would you not rather keep compatibility with
version 1.4 (which seems to just ignore variables in this case)?

> 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.

Good call!  Done.

Cheers,
        Gary.
-- 
  ())_. Gary V. Vaughan     gary@(oranda.demon.co.uk|gnu.org)
  ( '/  Research Scientist  http://www.oranda.demon.co.uk       ,_())____
  / )=  GNU Hacker          http://www.gnu.org/software/libtool  \'      `&
`(_~)_  Tech' Author        http://sources.redhat.com/autobook   =`---d__/



reply via email to

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