/* * Copyright 1993, 1995 Christopher Seiwald. * * This file is part of Jam - see jam.c for Copyright information. */ /* * command.c - maintain lists of commands */ # include "jam.h" # include "lists.h" # include "parse.h" # include "variable.h" # include "rules.h" # include "command.h" /* * cmd_new() - return a new CMD or 0 if too many args */ CMD * cmd_new( RULE *rule, LIST *targets, LIST *sources, LIST *shell ) { int len; #ifdef OPT_DYNAMIC_COMMAND_SIZE_EXT int size = MAXLINE; int keepGrowing = 1; #endif CMD *cmd = (CMD *)malloc( sizeof( CMD ) ); #ifdef OPT_DYNAMIC_COMMAND_SIZE_EXT cmd->buf = (char *)malloc( sizeof( char ) * size ); #endif cmd->rule = rule; cmd->shell = shell; cmd->next = 0; lol_init( &cmd->args ); lol_add( &cmd->args, targets ); lol_add( &cmd->args, sources ); #ifndef OPT_DYNAMIC_COMMAND_SIZE_EXT /* Bail if the result won't fit in MAXLINE */ /* We don't free targets/sources/shell if bailing. */ len = var_string( rule->actions, cmd->buf, MAXLINE, &cmd->args ); #else /* Most commands fit in the buffer - so don't worry too much about * sometimes computing the string twice. */ do { len = var_string( rule->actions, cmd->buf, size, &cmd->args ); /* If this is a piecemeal rule, we don't grow */ if (len < 0 && ((rule->flags & RULE_PIECEMEAL) == 0)) { free (cmd->buf); size *= 5; cmd->buf = (char *)malloc( sizeof( char ) * size ); } else keepGrowing = 0; } while (keepGrowing); #endif if( len < 0 ) { cmd_free( cmd ); return 0; } return cmd; } /* * cmd_free() - free a CMD */ void cmd_free( CMD *cmd ) { lol_free( &cmd->args ); list_free( cmd->shell ); #ifdef OPT_DYNAMIC_COMMAND_SIZE_EXT free( (char *)cmd->buf ); #endif free( (char *)cmd ); }
# | Change | User | Description | Committed | |
---|---|---|---|---|---|
#1 | 1226 | Craig Mcpheeters |
Created a branch which will be used to integrate changes from Matt Armstrong's copy of Jam. |
||
//guest/craig_mcpheeters/jam/src/command.c | |||||
#5 | 1086 | Craig Mcpheeters |
Modified 'jam0' in the Makefile to './jam0' Fixed a bug in my 'dynamic command size' extension. It wasn't dealing with piecemeal targets properly In execcmd(), reverted to 2.2 behaviour for the logic on NT of when to write a command to a .bat file, and when to invoke the shell directly. The cmd.exe interpreter has limitations on how large the lines in it can be. We were invoking rc.exe with a long command line, and it was failing when invoked via a .bat file |
||
#4 | 1023 | Craig Mcpheeters |
Integration from //guest/craig_mcpheeters/work/jam/src/... This return incorporates all of the Alias|Wavefront extensions to Jam, into an area which is a proper branch of the Jam mainline. An integration of these files into the Jam mainline will show all of the differences. There are several extensions to Jam in this return. Look at the new file Jamfile.config for an explanation of the extensions, and how to compile them into your own copy of Jam. If you want to build a copy of Jam with all of the extensions, do this: jam -sAllOptions=1 Read the config file for more info. The extensions range from minor output tweaks and simple fixes to more major things like a header cache, serialization of output from multiple jobs, dynamic command block sizing These are all offered without warranty, etc. |
||
#3 | 784 | Craig Mcpheeters | Integration from Jam mainline | ||
#2 | 617 | Craig Mcpheeters | Integration from mainline as of @3 | ||
#1 | 616 | Craig Mcpheeters | Integration from Jam mainline, as of @2 |