Print this page
make: unifdef for MAKETOOL and DISTRIBUTED (undefined)

Split Close
Expand all
Collapse all
          --- old/usr/src/cmd/make/bin/macro.cc
          +++ new/usr/src/cmd/make/bin/macro.cc
↓ open down ↓ 24 lines elided ↑ open up ↑
  25   25  
  26   26  /*
  27   27   *      macro.cc
  28   28   *
  29   29   *      Handle expansion of make macros
  30   30   */
  31   31  
  32   32  /*
  33   33   * Included files
  34   34   */
  35      -#ifdef DISTRIBUTED
  36      -#include <avo/strings.h>        /* AVO_STRDUP() */
  37      -#include <dm/Avo_DoJobMsg.h>
  38      -#endif
  39   35  #include <mk/defs.h>
  40   36  #include <mksh/macro.h>         /* getvar(), expand_value() */
  41   37  #include <mksh/misc.h>          /* getmem() */
  42   38  
  43   39  /*
  44   40   * Defined macros
  45   41   */
  46   42  
  47   43  /*
  48   44   * typedefs & structs
↓ open down ↓ 57 lines elided ↑ open up ↑
 106  102   *
 107  103   *      This function scans the list of environment variables that have
 108  104   *      dynamic values and sets them.
 109  105   *
 110  106   *      Parameters:
 111  107   *
 112  108   *      Global variables used:
 113  109   *              envvar          A list of environment vars with $ in value
 114  110   */
 115  111  void
 116      -#ifdef DISTRIBUTED
 117      -setvar_envvar(Avo_DoJobMsg *dmake_job_msg)
 118      -#else
 119  112  setvar_envvar(void)
 120      -#endif
 121  113  {
 122  114          wchar_t                 buffer[STRING_BUFFER_LENGTH];
 123  115          int                     length;
 124      -#ifdef DISTRIBUTED
 125      -        Property                macro;
 126      -#endif
 127  116          register        char    *mbs, *tmp_mbs_buffer = NULL;
 128  117          register        char    *env, *tmp_mbs_buffer2 = NULL;
 129  118          Envvar                  p;
 130  119          String_rec              value;
 131  120  
 132  121          for (p = envvar; p != NULL; p = p->next) {
 133  122                  if (p->already_put
 134      -#ifdef DISTRIBUTED
 135      -                    && !dmake_job_msg
 136      -#endif
 137  123                      ) {
 138  124                          continue;
 139  125                  }
 140  126                  INIT_STRING_FROM_STACK(value, buffer);          
 141  127                  expand_value(p->value, &value, false);
 142  128                  if ((length = wslen(value.buffer.start)) >= MAXPATHLEN) {
 143  129                          mbs = tmp_mbs_buffer = getmem((length + 1) * MB_LEN_MAX);
 144  130                          (void) wcstombs(mbs,
 145  131                                          value.buffer.start,
 146  132                                          (length + 1) * MB_LEN_MAX);
↓ open down ↓ 13 lines elided ↑ open up ↑
 160  146                                 mbs);
 161  147                  if (!p->already_put) {
 162  148                          (void) putenv(env);
 163  149                          p->already_put = true;
 164  150                          if (p->env_string) {
 165  151                                  retmem_mb(p->env_string);
 166  152                          }
 167  153                          p->env_string = env;
 168  154                          tmp_mbs_buffer2 = NULL; // We should not return this memory now
 169  155                  }
 170      -#ifdef DISTRIBUTED
 171      -                if (dmake_job_msg) {
 172      -                        dmake_job_msg->appendVar(env);
 173      -                }
 174      -#endif
 175  156                  if (tmp_mbs_buffer2) {
 176  157                          retmem_mb(tmp_mbs_buffer2);
 177  158                          tmp_mbs_buffer2 = NULL;
 178  159                  }
 179  160                  if (tmp_mbs_buffer) {
 180  161                          retmem_mb(tmp_mbs_buffer);
 181  162                          tmp_mbs_buffer = NULL;
 182  163                  }
 183  164          }
 184      -#ifdef DISTRIBUTED
 185      -        /* Append SUNPRO_DEPENDENCIES to the dmake_job_msg. */
 186      -        if (keep_state && dmake_job_msg) {
 187      -                macro = get_prop(sunpro_dependencies->prop, macro_prop);
 188      -                length = 2 +
 189      -                         strlen(sunpro_dependencies->string_mb) +
 190      -                         strlen(macro->body.macro.value->string_mb);
 191      -                if (length > (MAXPATHLEN * MB_LEN_MAX)) {
 192      -                        env = tmp_mbs_buffer2 = getmem(length);
 193      -                } else {
 194      -                        env = mbs_buffer2;
 195      -                }
 196      -                (void) sprintf(env,
 197      -                               "%s=%s",
 198      -                               sunpro_dependencies->string_mb,
 199      -                               macro->body.macro.value->string_mb);
 200      -                dmake_job_msg->appendVar(env);
 201      -                if (tmp_mbs_buffer2) {
 202      -                        retmem_mb(tmp_mbs_buffer2);
 203      -                        tmp_mbs_buffer2 = NULL;
 204      -                }
 205      -        }
 206      -#endif
 207  165  }
 208  166  
 209  167  
    
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX