Re: 3 aap suggestions

Pavol Juhas <[email protected]> Wed, 30 Nov 2005 11:42:42 -0500
Newsgroups gmane.comp.tools.aap.devel
Message-ID <[email protected]>
--LZvS9be/3tNcYl/X
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

On Tue, Nov 29, 2005 at 11:15:10AM +0100, Bram Moolenaar wrote:
> 
> Pavol Juhas wrote:
> 
> > > > ...
> > > > > > > > (1) aap is not using correct linker when linking c++ objects.
> > > > ...
> > > > > > > > Can this be fixed so that aap uses g++ as a linker when linking
> > > > > > > > c++ objects?
> > > 
> > > [...]
> > > 
> > > > A simpler way of telling aap to use g++ to link from hello.o is 
> > > > to add "LD=$CXXSHLINK" to main.app.
> > > 
> > > Yes, but then all programs will use that linker.  It would be nice if
> > > you can build both C and C++ programs automatically.
> > 
> > For sure it would.  Well, I found another mystery - for main.aap with
> >     LD=$CXX
> >     :program hello : hello.cpp
> > the object-build works (aap; rm hello; aap), but if I add :usetool gcc
> > to the begining, object-build stops working (clean build works).
> > That happens with both the original and patched usetool.  
> 
> What is the problem then?

Step by step reproduction - when main.aap contains

    :usetool gcc
    LD=$CXX
    :program hello : hello.cpp 

clean build works

    aap clean
    aap

but object build does not (which is the problem)

    rm hello
    aap

If you remove the :usetool line in main.aap, both builds 
would work.  It seems :usetool is somehow breaking the object build 
procedure.  Attached is the hello.cpp file if you'd like to test the 
problem.

> 
> If setting both $LD and ":usetool gcc", what would the writer of the
> recipe have intended?  I would guess he wants to use gcc but with a
> different linker.

LD=$CXX  means that user wants to link with whatever is the 
c++ compiler for the selected tool.  It would be useful for 
a project where all the files are c++, but which may be compiled 
with different tools, e.g., gcc, icc, msvc.  In that case the 
usetool line would be replaced with ":toolsearch gcc icc msvc".

--LZvS9be/3tNcYl/X
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="hello.cpp"

#include <iostream>
int main()
{
    std::cout << "hello world" << std::endl;
    return EXIT_SUCCESS;
}

--LZvS9be/3tNcYl/X--


-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click