Re: 3 aap suggestions

Bram Moolenaar <[email protected]> Mon, 28 Nov 2005 21:53:45 +0100
Newsgroups gmane.comp.tools.aap.devel
Message-ID <[email protected]>
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=20
> to add "LD=3D$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.

> > I didn't figure out what happens in your specific example.  Perhaps t=
he
> > problem is that the ":rule" for .cpp to .o isn't used, but the compil=
e
> > action  is invoked directly.  For the ":rule" this is taken care of i=
n
> > the default.aap recipe.
> >=20
> > This is one area where Aap appears to be too complicated.  I hope
> > someone has a good idea how to simplify the use of actions and how th=
ey
> > are defined.
>=20
> BTW, I found another thing:  ref-variables.html mentions USECXXLD=20
> variable, which should be set to "yes" when aap decides to use CXX=20
> for linking.  However, when I use $USECXXLD in a recipe, aap=20
> complains about Unknown variable: "USECXXLD".
> I grepped for USECXXLD and it is nowhere in the aap sources.
> Is it an obsolete variable, or is there any code missing?

Right, this is old and should be removed.  The cxx_build action does use
$CXX for the default of $LD.  This is not easy to explain...

> Well, it's a slight distinction - the original :toolsearch requires
> that a tool is defined and checks if it is installed, while the=20
> patched one checks if it is defined and installed.  If user made=20
> a typo, he is asking to search for non-existing tool, so it won't be=20
> found - user just gets what he asked for.  Perhaps there could be=20
> a :toolsearch option (allow_undefined_tools=3Dyes or strict=3Dno) for=20
> this behavior?

Hmm, another choice for the user.  It's not really difficult to copy the
tool to another system, is it?

Consider the average use of a recipe: You copy it to another system with
the files that are used and run it.  The user should be warned if
something is missing for the recipe to be executed properly.  Note that
the compiler searched for may be present, but when the Aap tool is
missing it won't be found.  That may result in an obscure problem in a
larger application, that the wrong compiler is used might go unnoticed.

> In any case, I suggest to use the import code from my patch,=20
> otherwise there would be the same problem as with :usetool - the=20
> default tools will not be available as soon as user defines any=20
> custom tool in ~/.aap/tools.

OK.  Can you make a patch for that?

> Is there any other place where aap imports from tools?  I guess the=20
> same fixes would apply there as well.

Ehm, I don't know.  It has been a while since I wrote this...

--=20
hundred-and-one symptoms of being an internet addict:
235. You start naming your kids Pascal, COBOL, Algol and Fortran.

 /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net   \=
\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ =
\\\
\\\        download, build and distribute -- http://www.A-A-P.org        =
///
 \\\            help me help AIDS victims -- http://www.ICCF.nl         /=
//


-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log fi=
les
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=3D7637&alloc_id=3D16865&op=3Dclick