automake
[Top][All Lists]
Advanced

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

Re: Conditional sources


From: NightStrike
Subject: Re: Conditional sources
Date: Sun, 4 Nov 2007 14:14:32 -0500

On 11/4/07, Ralf Wildenhues <address@hidden> wrote:
> > > On Nov 4, 2007, at 7:47 PM, NightStrike wrote:
> > > > AM_CONDITIONAL(WITH32, test x$WITH_32 != x)
> > > >
> > > > And I put this in Makefile.am:
> > > >
> > > > if WITH32
> > > >   crtdir=$(prefix)/lib32
> > > >   uuidsrc = lib32/uuid.c
> > > > else
> > > >   crtdir=$(prefix)/$(target)/lib
> > > >   uuidsrc = lib/uuid.c
> > > > endif
> > > >
> > > > crtlibs_LIBRARIES += libuuid.a
> > > > libuuid_a_SOURCES = $(uuidsrc)
> > > >
> > > >
> > > > When I run autoreconf, I get this:
> > > >
> > > > Makefile.am: object `uuid.$(OBJEXT)' created by `lib32/uuid.c' and
> > > > `lib/uuid.c'
> [...]
>
> You can adapt the hint from
>   info Automake 'Libtool Issues'
>
> to your example.  You'll have to live with a rewritten object file name
> in that case though.
>
>   info Automake 'Conditional Sources'
>
> has more useful information.

I was following those sections almost.  I missed that part about
having to add in a bogus _CFLAGS variable.  That seems somewhat
kludgey, doesn't it?  Automake should be able to detect the name
collisions in the conditional and rename the object files accordingly.
 Either that, or can't automake just put the object files in separate
directories, given my setup?  What I mean is, I have lib/uuid.c and
lib32/uuid.c.  If the object files were placed in the respective
directories, lib/uuid.o and lib32/uuid.o, then there would be no
collision and no need for a bogus _CFLAGS variable, yes?




reply via email to

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