ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Adam Murdoch" <adammurdoch...@yahoo.com>
Subject RE: C/C++ Compile Task - Another
Date Thu, 21 Jun 2001 01:00:48 GMT


> -----Original Message-----
> From: glenn@dryline-fw.wireless-sys.com
> [mailto:glenn@dryline-fw.wireless-sys.com]On Behalf Of Glenn McAllister
> Sent: Thursday, 21 June 2001 2:28 AM
> To: ant-dev@jakarta.apache.org
> Subject: Re: C/C++ Compile Task - Another
>
>
> Mark A Russell wrote:
>
> > Yannick Menager (posted after your comments) had an interesting
> idea.  Maybe
> > we do
> > both.  We could have our main compile task that can both
> compile and link
> > but
> > also maybe add a seperate link task.  This would add some
> flexability for
> > those who wanted/needed to do these tasks seperatly.
>
> I'd support this choice - have the link task execute the linking
> part of your
> omnibus compiler task.
>
> > >>The name of the task is another issue.  I think the names I chose are
> > pretty
> > >>crap - I'd like something more descriptive, <cppcomp> is fine.  Maybe
> > >><cppcompile> or <compilecpp> is better?
> >
> > compilecpp is fine by me, but one question that goes along with
> this.  Is it
> > just
> > a C++ task or is it also a C task?  If its both (really should be) then
> > maybe C_CPPCompile?
>
> Actually, I prefer Adam's initial <cc>.  Maybe <cclink> for the link task.
> Everyone who needs to do C/C++ compilation knows what cc is, or
> they know what
> gcc is and making the leap isn't hard.  Having a name like
> <c_cpp_compile> is a
> little verbose, IMHO.
>

I'm happy with <cc> and <cclink>.

> > The only reason I didn't define an optimize attribute
> originally is because
> > I couldn't decide what level of optimization it should do.
> Should it be a
> > lvl
> > thing like 1-5 and then each compiler adapter determines what flags that
> > corresponds
> > to? or just true/false where true means just the basic default
> optimization?
>
> <cc optimize="yes" optimization_level="adapter_specific_string"  ... />
>
> The adapter has the choice of paying attention to the level or not; a
> documentation issue.
>

This is nice.  Perhaps we only need the optimizationlevel attribute, and
have 'none' as one of the levels (the default).

> > Agreed.  Maybe we make GCC the default since a port of it
> exists on nearly
> > every
> > platform?  Would like comments from the group on this one.
>
> I'd agree with gcc being the default.  You may want a magic
> property like the
> java compiler does for specifying which compiler to use if its
> not defined with
> the task.
>

Not a big fan of the magic property.  Anything wrong with just using:

<cc compiler="${would.have.been.a.magic.property}">

Another thing we could do is probe for the compilers in some particular
order, if not explictly specified in the task.


> > The only further questions I have are about our handling of libraries.
> > How will we handle libraries when the object file(s) are newer
> then those
> > contained within the library we built?  Do we just update the
> library, or
> > completely rebuild the library?
>
> I don't know enough about library linking to say this with any
> authority, but
> if you can do an incremental update, that would probably be preferred.
>

Agreed.

> > We will also need to do some checks when we link executables.
> I am thinking
> > mostly in the case where the libraries we previously linked
> against are now
> > newer
> > then the executable.  Shouldn't be much of an issue, but
> something to keep
> > in mind.
>
> I'd relink the executable by default - there's no point in having
> an output
> executable that is out of date with the library.
>

Agreed.

> > Again comments would be most welcome from the group
>
> Hope the comments from the guy who hasn't done C/C++ in a couple
> of years (but
> really wants to see this task work so I can sway the last of the
> make adherents
> in his workplace to the light) were useful. :-)
>

Good luck.  They're hard to convince, makefile people :)

> Glenn McAllister
> SOMA Networks, Inc.
>


_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com


Mime
View raw message