|
Boost-Build : |
Subject: Re: [Boost-build] MATCH regular expression question.
From: Aparna Kumta (aparna.kumta_at_[hidden])
Date: 2015-11-09 13:45:38
On 11/08/15 13:25, Steven Watanabe wrote:
> AMDG
>
> On 11/06/2015 02:37 PM, Aparna Kumta wrote:
>> On 11/06/15 13:29, Steven Watanabe wrote:
>>> On 11/06/2015 02:22 PM, Aparna Kumta wrote:
>>>> actions link.dll bind LIBRARIES
>>>> {
>>>> if [ MATCH "(std)" : $(OPTIONS) ]
>>>> {
>>> You can't use MATCH inside an action block.
>>> The body is literal text passed to the
>>> shell. The only processing that Boost.Build
>>> does is variable expansion.
>> Can MATCH be used outside the action block as follows?
>>
> This is syntactically correct, but doesn't
> do what you want. (OPTIONS is not defined
> at file scope.)
Thanks! I did try to echo 'OPTIONS' and saw that as well.
> I would suggest putting
> this logic inside a forwarding rule:
>
> rule link.dll ( targets * : sources * : properties * )
> {
> if [ MATCH "(std)" : [ on $(targets) return $(OPTIONS) ] ]
> {
> link.dll.std $(targets) : $(sources) ;
> }
> }
>
> actions link.dll.std bind LIBRARIES
> {
> ...
> }
>
> Actually, looking at your original problem,
> there's no need for separate action blocks:
>
> rule link.dll ( targets * : sources * : properties * )
> {
> if [ MATCH "(std)" : [ on $(targets) return $(OPTIONS) ]
> {
> STDLIBOPT on $(targets) = -library=stdcpp,CrunG3 ;
> }
> }
>
> actions link.dll bind LIBRARIES
> {
> ... -G $(STDLIBOPT) "$(>)" ...
> }
>
> STDLIBOPT will then expand to nothing when it
> isn't needed.
Thank you, appreciate the help. I will give it a try and then submit a PR.
Aparna
>
>> if [ MATCH "(std)" : $(OPTIONS) ]
>> {
>> actions link.dll bind LIBRARIES
>> {
>> "$(CONFIG_COMMAND)" $(OPTIONS) -L"$(LINKPATH)"
>> -R"$(RPATH)" -o
>> "$(<)" -h$(<[1]:D=) -G -library=stdcpp,CrunG3 "$(>)"
>> "$(LIBRARIES)"
>> -Bdynamic -l$(FINDLIBS-SA) -Bstatic -l$(FINDLIBS-ST)
>> -B$(LINK-RUNTIME)
>> }
>> }
>> else
>> {
>>
>> actions link.dll bind LIBRARIES
>> {
>> ...
>> }
>> }
>>
> In Christ,
> Steven Watanabe
>
> _______________________________________________
> Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost-build
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