Ignore:
Timestamp:
May 17, 2005, 1:34:55 AM (20 years ago)
Author:
bird
Message:

join + optimizations.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/gmake/variable.c

    r225 r287  
    500500
    501501          do
    502             /* We found one, so insert it into the set.  */
    503             do_variable_definition (&p->variable.fileinfo, p->variable.name,
    504                                     p->variable.value, p->variable.origin,
    505                                     p->variable.flavor, 1);
     502            {
     503              /* We found one, so insert it into the set.  */
     504
     505              struct variable *v;
     506
     507              if (p->variable.flavor == f_simple)
     508                {
     509                  v = define_variable_loc (
     510                    p->variable.name, strlen (p->variable.name),
     511                    p->variable.value, p->variable.origin,
     512                    0, &p->variable.fileinfo);
     513
     514                  v->flavor = f_simple;
     515                }
     516              else
     517                {
     518                  v = do_variable_definition (
     519                    &p->variable.fileinfo, p->variable.name,
     520                    p->variable.value, p->variable.origin,
     521                    p->variable.flavor, 1);
     522                }
     523
     524              /* Also mark it as a per-target and copy export status. */
     525              v->per_target = p->variable.per_target;
     526              v->export = p->variable.export;
     527            }
    506528          while ((p = lookup_pattern_var (p, file->name)) != 0);
    507529
     
    735757#endif
    736758
    737   /* This won't override any definition, but it
    738      will provide one if there isn't one there.  */
     759  /* This won't override any definition, but it will provide one if there
     760     isn't one there.  */
    739761  v = define_variable ("SHELL", 5, default_shell, o_default, 0);
    740   v->export = v_export;         /* Always export SHELL.  */
    741 
    742   /* On MSDOS we do use SHELL from environment, since
    743      it isn't a standard environment variable on MSDOS,
    744      so whoever sets it, does that on purpose.
    745      On OS/2 we do not use SHELL from environment but
    746      we have already handled that problem above. */
     762
     763  /* On MSDOS we do use SHELL from environment, since it isn't a standard
     764     environment variable on MSDOS, so whoever sets it, does that on purpose.
     765     On OS/2 we do not use SHELL from environment but we have already handled
     766     that problem above. */
    747767#if !defined(__MSDOS__) && !defined(__EMX__)
    748768  /* Don't let SHELL come from the environment.  */
     
    862882
    863883              case v_noexport:
    864                 continue;
     884                /* If this is the SHELL variable and it's not exported, then
     885                   add the value from our original environment.  */
     886                if (streq (v->name, "SHELL"))
     887                  {
     888                    extern struct variable shell_var;
     889                    v = &shell_var;
     890                    break;
     891                  }
     892                continue;
    865893
    866894              case v_ifset:
     
    9771005            v = lookup_variable_in_set (varname, strlen (varname),
    9781006                                        current_variable_set_list->set);
     1007
     1008            /* Don't append from the global set if a previous non-appending
     1009               target-specific variable definition exists. */
     1010            if (v && !v->append)
     1011              append = 0;
    9791012          }
    9801013        else
     
    10351068      && strcmp (varname, "SHELL") == 0)
    10361069    {
    1037       char shellpath[PATH_MAX];
     1070      PATH_VAR (shellpath);
    10381071      extern char * __dosexec_find_on_path (const char *, char *[], char *);
    10391072
     
    14201453sync_Path_environment (void)
    14211454{
    1422   char *path = allocated_variable_expand ("$(Path)");
     1455  char *path = allocated_variable_expand ("$(PATH)");
    14231456  static char *environ_path = NULL;
    14241457
     
    14371470   */
    14381471  convert_Path_to_windows32 (path, ';');
    1439   environ_path = concat ("Path", "=", path);
     1472  environ_path = concat ("PATH", "=", path);
    14401473  putenv (environ_path);
    14411474  free (path);
Note: See TracChangeset for help on using the changeset viewer.