Re: 3 aap suggestions
Bram Moolenaar <[email protected]> Wed, 30 Nov 2005 20:29:41 +0100
| Newsgroups | gmane.comp.tools.aap.devel |
|---|---|
| Message-ID | <[email protected]> |
Pavol Juhas wrote:
> > What is the problem then?
>=20
> Step by step reproduction - when main.aap contains
>=20
> :usetool gcc
> LD=3D$CXX
> :program hello : hello.cpp=20
>=20
> clean build works
>=20
> aap clean
> aap
>=20
> but object build does not (which is the problem)
>=20
> rm hello
> aap
>=20
> If you remove the :usetool line in main.aap, both builds=20
> would work. It seems :usetool is somehow breaking the object build=20
> procedure. Attached is the hello.cpp file if you'd like to test the=20
> problem.
Thanks for the example. The problem is that the compile action in the
gcc tool adds the "buildaction" attribute to the object file only when
the source file is compiled. Unfortunately, at this place using
sections is not supported, like it is in the rule. And the rule is not
used for ":program".
I can't think of an obvious solution. This would require some new
mechanism. Either by supporting sections in actions (which is not
logical) or adding optional "compile_nobuild" actions (which is clumsy).
Perhaps we need a more drastic change to define actions in a tool in a
better way. define_action() isn't very nice...
> > 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.
>=20
> LD=3D$CXX means that user wants to link with whatever is the=20
> c++ compiler for the selected tool. It would be useful for=20
> a project where all the files are c++, but which may be compiled=20
> with different tools, e.g., gcc, icc, msvc. In that case the=20
> usetool line would be replaced with ":toolsearch gcc icc msvc".
The build_gxx action uses $GXX always. You are suggesting that it
should use $LD if it is set. Wouldn't that have undesired/unexpected
effects?
I do think that the gcc tool should allow changing the linker used, but
since it uses $GCC or $GXX that is not possible (the compile action
would change too). Perhaps using $LD_GCC and/or $LD_GXX would help,
then you can at least change the linker.
Well, perhaps it is simpler to use $LD to overrule any linker used by
the currently selected tool.
--=20
hundred-and-one symptoms of being an internet addict:
269. You receive an e-mail from the wife of a deceased president, offerin=
g
to send you twenty million dollar, and you are not even surprised.
/// 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