automake
[Top][All Lists]
Advanced

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

Re: conditional sources with libtool error?


From: Matthias Braun
Subject: Re: conditional sources with libtool error?
Date: Tue, 2 Oct 2001 17:36:40 +0200 (CEST)

At first: Thank you for your help

On 2 Oct 2001, Tim Van Holder wrote:

> On Tue, 2001-10-02 at 15:17, Matthias Braun wrote:
> > Hello,
> >
> > I'm quite new to automake so I don't know if the following is a bug or an 
> > error from me:
> >
> > I use the following Makefile.am:
> > ---
> > EXTRA_libsal_la_SOURCES=wtask.cxx
> > if USE_WINTASK
> >  TASKSOURCES=wtask.cxx
> > endif
> >
> > EXTRA_libsal_la_SOURCES+=ptask.cxx
> > if USE_PTHREAD
> >  TASKSOURCES=ptask.cxx
> > endif
> >
> > libsal_la_SOURCES = ... $(TASKSOURCES)
> > ---
> >
> > but automake 1.5 complains about it with an:
> > warning: automake does not support conditional definition of TASKSOURCES in 
> > libsal_la_SOURCES
>
> Since you already have them in EXTRA_x_SOURCES, you don't need them in
> x_SOURCES.
>
> Try
Well this first way didn't work:
>
>
> libsal_la_SOURCES = ...
> EXTRA_libsal_la_SOURCES = wtask.cxx ptask.cxx
>
> if USE_WINTASK
> TASKOBJ = wtask.$(OBJEXT)
> endif
> if USE_PTHREAD
> TASKOBJ = pthread.$(OBJEXT)
> endif
>
> libsal_la_LDADD = $(TASKOBJ)
automake (I had to use an old 1.4... but I think this doesn't change the
thing) told me that I have to use libsal_la_LIBADD, so I changed it and I
got that "automake does not support conditional" error again.

>
>
> I think that should work - the EXTRA_x_SOURCES causes compilation rules
> to be generated for both optional files, and the LDADD pulls in the
> requested object.
> Note that as an alternative to the automake conditional, you could also
> subst TASKOBJ in configure.ac:
>
So I tried way2...

>
> [configure.ac]
> TASKOBJ=
> if foo-win; then
>   TASKOBJ=wtask.$OBJEXT # or TASKOBJ='wtask.$(OBJEXT)'; your choice
at this point only way 2 (TASKOBJ='wtask.$(OBJEXT)' worked reliable.

> elif foo-posix
>   TASKOBJ=pthread.$OBJEXT
> fi
> AC_SUBST(TASK_OBJ)
>
>
> [Makefile.am]
> libsal_la_SOURCES = ...
> EXTRA_libsal_la_SOURCES = wtask.cxx ptask.cxx
> libsal_la_LDADD = @TASKOBJ@
I changed it again to address@hidden@, now automake didn't
complain any more, but the file wasn't compiled anyway :(

I also tried setting TASKSRC="ptask.cxx"... in configure.ac but it also
just didn't  compile the file.
Ater reading Makefile a bit it seems that automake would need the
informations about which sources it needs earlier than configure time...

Greetings
        Matze





reply via email to

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