Boost logo

Boost-Build :

From: Rene Rivera (grafikrobot_at_[hidden])
Date: 2007-06-07 14:59:40


K. Noel Belcourt wrote:
> Hi,
>
> I've got a rule like this :
>
> rule dart-run ( target sources * : status : user : system : command :
> output + )
> {
> ECHO "output = $(output)" ;
> }
>
> and I want to know how to setup the frame arguments so the output
> (7th argument) evaluates to empty, and the output echo is
> suppressed. Here's the code (in make1.c) where I setup to evaluate
> the rule.
>
> LIST* initial_args = list_copy( L0, dart_rule->next );
> FRAME frame[1];
> frame_init( frame );
>
> lol_add( frame->args, list_new( initial_args, target->name ) );
> append_int_string(frame->args, status);
> append_double_string(frame->args, time->user);
> append_double_string(frame->args, time->system);
> lol_add(frame->args, list_new(L0, newstr(executed_command)));
>
> if (!command_output)
> lol_add(frame->args, list_new(L0, ""));
> else
> lol_add(frame->args, list_new(L0, newstr(command_output)));
>
> if( lol_get( frame->args, 2 ) )
> evaluate_rule( dart_rule->string, frame );
>
> As you can see, when the 7th argument is null, I create an "" string,
> which doesn't evaluate to the empty string in the dart-run rule. Any
> ideas on how to setup the frame argument so that when command_output
> is null, the rule is correctly called?

AFAIK, it should be adding an empty list as the argument. As opposed to
adding a list with the one output element. So instead of:

     lol_add(frame->args, list_new(L0, ""));

It would be:

     lol_add(frame->args, L0);

-- 
-- Grafik - Don't Assume Anything
-- Redshift Software, Inc. - http://redshift-software.com
-- rrivera/acm.org - grafik/redshift-software.com
-- 102708583/icq - grafikrobot/aim - grafikrobot/yahoo

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