Changeset 534 for trunk/src/gmake/main.c


Ignore:
Timestamp:
Sep 19, 2006, 1:16:21 AM (19 years ago)
Author:
bird
Message:

Made it build again on linux.

File:
1 edited

Legend:

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

    r532 r534  
    284284
    285285#ifdef KMK
    286 /* Process priority. 
    287     0 = no change; 
    288     1 = idle / max nice; 
    289     2 = below normal /  nice 10; 
    290     3 = normal / nice 0; 
     286/* Process priority.
     287    0 = no change;
     288    1 = idle / max nice;
     289    2 = below normal /  nice 10;
     290    3 = normal / nice 0;
    291291    4 = high / nice -10;
    292292    4 = realtime / nice -19; */
    293293int process_priority = 0;
    294 #endif 
     294#endif
    295295
    296296
     
    414414      "print-data-base" },
    415415#ifdef KMK
    416     { CHAR_MAX+5, positive_int, (char *) &process_priority, 1, 1, 0, 
     416    { CHAR_MAX+5, positive_int, (char *) &process_priority, 1, 1, 0,
    417417      (char *) &process_priority, (char *) &process_priority, "priority" },
    418418#endif
     
    515515#else  /* CONFIG_WITH_EXTENDED_NOTPARALLEL */
    516516
    517 /* Negative if we have seen the `.NOTPARALLEL' target with an 
    518    empty dependency list. 
    519 
    520    Zero if no `.NOTPARALLEL' or no file in the dependency list 
    521    is being executed. 
    522 
    523    Positive when a file in the `.NOTPARALLEL' dependency list 
     517/* Negative if we have seen the `.NOTPARALLEL' target with an
     518   empty dependency list.
     519
     520   Zero if no `.NOTPARALLEL' or no file in the dependency list
     521   is being executed.
     522
     523   Positive when a file in the `.NOTPARALLEL' dependency list
    524524   is in progress, the value is the number of notparallel files
    525525   in progress (running or queued for running).
     
    689689{
    690690#ifdef WINDOWS32
    691     DWORD dwPriority;
    692     switch (process_priority)
    693       {
    694         case 0:     return;
    695         case 1:     dwPriority = IDLE_PRIORITY_CLASS; break;
    696         case 2:     dwPriority = BELOW_NORMAL_PRIORITY_CLASS; break;
    697         case 3:     dwPriority = NORMAL_PRIORITY_CLASS; break;
    698         case 4:     dwPriority = HIGH_PRIORITY_CLASS; break;
    699         case 5:     dwPriority = REALTIME_PRIORITY_CLASS; break;
    700         default:    fatal(NILF, _("invalid priority %d\n"), process_priority);
    701       }
    702     SetPriorityClass(GetCurrentProcess(), dwPriority);
     691  DWORD dwPriority;
     692  switch (process_priority)
     693    {
     694      case 0:     return;
     695      case 1:     dwPriority = IDLE_PRIORITY_CLASS; break;
     696      case 2:     dwPriority = BELOW_NORMAL_PRIORITY_CLASS; break;
     697      case 3:     dwPriority = NORMAL_PRIORITY_CLASS; break;
     698      case 4:     dwPriority = HIGH_PRIORITY_CLASS; break;
     699      case 5:     dwPriority = REALTIME_PRIORITY_CLASS; break;
     700      default:    fatal(NILF, _("invalid priority %d\n"), process_priority);
     701    }
     702  SetPriorityClass(GetCurrentProcess(), dwPriority);
    703703#else /*#elif HAVE_NICE */
    704     int nice = 0;
    705     switch (process_priority)
    706       {
    707         case 0:     return;
    708         case 1:     nice = 19; break;
    709         case 2:     nice = 10; break;
    710         case 3:     nice = 0; break;
    711         case 4:     nice = -10; break;
    712         case 5:     nice = -19; break;
    713         default:    fatal(NILF, _("invalid priority %d\n"), process_priority);
    714       }
    715     nice(nice);
    716 #endif 
     704  int nice_level = 0;
     705  switch (process_priority)
     706    {
     707      case 0:     return;
     708      case 1:     nice_level = 19; break;
     709      case 2:     nice_level = 10; break;
     710      case 3:     nice_level = 0; break;
     711      case 4:     nice_level = -10; break;
     712      case 5:     nice_level = -19; break;
     713      default:    fatal(NILF, _("invalid priority %d\n"), process_priority);
     714    }
     715  nice (nice_level);
     716#endif
    717717}
    718 #endif 
     718#endif
    719719
    720720
     
    895895#ifdef KMK
    896896  /* WORKAROUND:
    897     With GNU Make 3.81, this kludge was necessary to get double quotes 
    898     working correctly again (worked fine with the 3.81beta1 code). 
    899     beta1 was forcing batch_mode_shell I think, so let's enforce that 
     897    With GNU Make 3.81, this kludge was necessary to get double quotes
     898    working correctly again (worked fine with the 3.81beta1 code).
     899    beta1 was forcing batch_mode_shell I think, so let's enforce that
    900900    for the kBuild shell. */
    901901  if (sh_found && strstr(default_shell, "kmk_ash")) {
     
    903903      batch_mode_shell = 1;
    904904  } else
    905 #endif 
     905#endif
    906906  /* naive test */
    907907  if (!unixy_shell && sh_found &&
     
    13311331#ifdef KMK
    13321332  set_make_priority ();
    1333 #endif 
     1333#endif
    13341334
    13351335  /* Set always_make_flag if -B was given and we've not restarted already.  */
Note: See TracChangeset for help on using the changeset viewer.