automake
[Top][All Lists]
Advanced

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

Re: Automake 1.5


From: Tim Van Holder
Subject: Re: Automake 1.5
Date: 31 Aug 2001 08:32:31 +0200

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.





reply via email to

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