|
Boost-Build : |
From: Larry Evans (cppljevans_at_[hidden])
Date: 2007-08-07 22:17:58
On 08/04/2007 09:30 AM, Vladimir Prus wrote:
> Larry Evans wrote:
>
>> On 08/03/2007 01:23 PM, Larry Evans wrote:
>> [snip]
>>> * question 2
>>>
>>> The following is from gcc.jam:
>>> <-------- cut here ---------
>>> actions link bind LIBRARIES
>>> {
>>> "$(CONFIG_COMMAND)" -L"$(LINKPATH)"
>>> -Wl,$(RPATH_OPTION:E=-R)$(SPACE)-Wl,"$(RPATH)"
>>> -Wl,-rpath-link$(SPACE)-Wl,"$(RPATH_LINK)" -o "$(<)" $(START-GROUP)
>>> "$(>)" "$(LIBRARIES)" -l$(FINDLIBS-ST) -l$(FINDLIBS-SA) $(END-GROUP)
>>> $(OPTIONS) $(USER_OPTIONS)
>>> #the above appears all on one line in my editor.
>>> }
>>>
>>> >-------- cut here ---------
>>>
>>> What variable values are available in the actions body? Was the
>>> 'bind LIBRARIES' needed because it wasn't among the set of
>>> variables passed to all actions or just actions for link commands
>>> or is there some other criteria for determining the variables
>>> passed to the actions body?
>> Part of the answer to this is, maybe, provided by:
>>
>> http://www.boost.org/doc/html/bbv2/extender.html#bbv2.extending.features
>>
>> which contains:
>>
>> Then, the flags invocation says that whenever verbatin.inline-file
>> action is run, the value of the verbatim-options feature will be added
>> to the OPTIONS variable, and can be used inside the action body.
>>
>> So, are RPATH_LINK, FINDLIBS-ST, FINDLIBS-SA, OPTIONS, and USER_OPTIONS
>> all declared as features of the gcc toolset (or more precisely,
>> the superclass of gcc, i.e. the unix toolset)?
>
> A rule can use the following variables:
>
> 1. Variables globally set in the module an action is in.
> 2. A variable set "on target"
>
> On Boost.Build, the "on target" variables to set are described via
> the 'flags' rule. So, this line from gcc.jam:
>
> flags $(toolset).link RPATH_LINK $(condition) : <xdll-path> : unchecked ;
>
> makes RPATH_LINK available in the 'link' action.
>
> The 'bind' you was asking is somewhat different -- when a variable used in action
> is a string, it can be just used. But when a variable is a name of jam's low-level
> target, one has to use 'bind' to get the pathname inside the action, not the target's
> name.
>
> Finally, I don't really remember if modifiers should be used before action name
> or after -- using 'bind' after apparently works.
The following output:
<------- cut here -------
>------- cut here -------
Boost-Build list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk