Re: Build system
On Friday, 28 April 2006 at 14:08, Ralf Wildenhues wrote:
> * Rocco Rutte wrote on Fri, Apr 28, 2006 at 12:16:00PM CEST:
> >
> > Also, what I could need help with is to a find a nice way solving empty
> > source file problem. Files like utf8.c are compiled unconditionally but
> > the whole content is wrapped in a #ifdef. If we know we don't need them,
> > then just don't attempt to compile it. I can go and grep for a list of
> > files affected and their #ifdefs so we know how to extend configure.in.
>
> One way to solve this cleanly:
>
> In configure.ac:
> AM_CONDITIONAL([NEED_WC_FUNCS], [test "$wc_funcs" != yes])
>
> In Makefile.am:
> if NEED_WC_FUNCS
> mutt_SOURCES += utf8.c
> endif
>
> Then, there is also AC_REPLACE_FUNCS (but it doesn't fit this case).
We do this for a number of files already (sasl/ssl/pop/imap). Older
versions of automake didn't do dependencies right for
conditionally-compiled files, but I believe that's been fixed. It's
worth keeping an eye on though.