VirtualBox

Changeset 225 in kBuild


Ignore:
Timestamp:
Feb 9, 2005 8:31:14 AM (20 years ago)
Author:
bird
Message:

kMk builtin command basics. KMK_VERSION variable.

Location:
trunk/src/gmake
Files:
2 added
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/gmake/Makefile.kmk

    r202 r225  
    2727        CONFIG_NO_DEFAULT_TERMINAL_RULES \
    2828        CONFIG_NO_DEFAULT_SUFFIX_RULES \
    29         CONFIG_NO_DEFAULT_VARIABLES
     29        CONFIG_NO_DEFAULT_VARIABLES \
     30        CONFIG_WITH_KMK_BUILTIN
    3031kmk_DEFS.win32          = WINDOWS32 _CONSOLE WIN32
    3132kmk_DEFS.win32.release  = NDEBUG
    3233
    33 kmk_LDFLAGS.linux.release   = -s 
     34kmk_LDFLAGS.linux.release   = -s
    3435kmk_LDFLAGS.os2             = -Zhigh-mem -Zstack=1024
    3536kmk_LDFLAGS.os2.release     = -s
     
    4243        $(PATH_DEV)/x86.win32/sdk200209/lib/Kernel32.Lib \
    4344        $(PATH_DEV)/x86.win32/sdk200209/lib/User32.Lib \
    44         $(PATH_DEV)/x86.win32/sdk200209/lib/AdvAPI32.Lib 
     45        $(PATH_DEV)/x86.win32/sdk200209/lib/AdvAPI32.Lib
    4546       
    4647kmk_SOURCES         = \
     
    6566        version.c \
    6667        vpath.c \
    67         remote-stub.c
     68        remote-stub.c \
     69        kmkbuiltin.c
    6870
    6971kmk_SOURCES.os2 = \
  • trunk/src/gmake/commands.c

    r154 r225  
    350350            flags |= COMMANDS_RECURSE;
    351351        }
     352#ifdef CONFIG_WITH_KMK_BUILTIN
     353      if (!strncmp(p, "kmk_builtin_", sizeof("kmk_builtin_") - 1))
     354          flags |= COMMANDS_BUILTIN;
     355#endif
    352356
    353357      cmds->lines_flags[idx] = flags;
  • trunk/src/gmake/commands.h

    r217 r225  
    3636#define COMMANDS_SILENT         2 /* Silent: @.  */
    3737#define COMMANDS_NOERROR        4 /* No errors: -.  */
    38 #define COMMANDS_NOTPARALLEL    64 /* kmk: the commands must be executed alone. */
     38#define COMMANDS_NOTPARALLEL    32 /* kmk: the commands must be executed alone. */
     39#define COMMANDS_BUILTIN        64 /* kmk: builtin command. */
    3940
    4041extern void execute_file_commands PARAMS ((struct file *file));
  • trunk/src/gmake/job.c

    r218 r225  
    2828#include "variable.h"
    2929#include "debug.h"
     30#ifdef CONFIG_WITH_KMK_BUILTIN
     31#include "kmkbuiltin.h"
     32#endif
     33
    3034
    3135#include <string.h>
     
    965969        child->noerror = 1;
    966970      else if (!isblank ((unsigned char)*p))
    967         break;
     971        {
     972#ifdef CONFIG_WITH_KMK_BUILTIN
     973          if (   !(flags & COMMANDS_BUILTIN)
     974              && !strncmp(p, "kmk_builtin_", sizeof("kmk_builtin_") - 1))
     975            flags |= COMMANDS_BUILTIN;
     976#endif /* CONFIG_WITH_KMK_BUILTIN */
     977          break;
     978        }
    968979      ++p;
    969980    }
     
    10951106      goto next_command;
    10961107    }
     1108
     1109#ifdef CONFIG_WITH_KMK_BUILTIN
     1110  /* If builtin command then pass it on to the builtin shell interpreter. */
     1111
     1112  if ((flags & COMMANDS_BUILTIN) && !just_print_flag)
     1113    {
     1114      char **p2 = argv;
     1115      while (*p2 && strncmp(*p2, "kmk_builtin_", sizeof("kmk_builtin_") - 1))
     1116          p2++;
     1117      assert(*p2);
     1118      set_command_state (child->file, cs_running);
     1119      int rc = kmk_builtin_command(p2);
     1120#ifndef VMS
     1121      free (argv[0]);
     1122      free ((char *) argv);
     1123#endif
     1124      if (!rc)
     1125          goto next_command;
     1126      child->file->update_status = 2;
     1127      notice_finished_file (child->file);
     1128      return;
     1129    }
     1130#endif /* CONFIG_WITH_KMK_BUILTIN */
    10971131
    10981132  /* Flush the output streams so they won't have things written twice.  */
     
    13881422{
    13891423  struct file *f = c->file;
     1424  DB (DB_KMK, (_("start_waiting_job %p (`%s') command_flags=%#x\n"), c, c->file->name, c->file->command_flags));
    13901425
    13911426  /* If we can start a job remotely, we always want to, and don't care about
     
    13971432  /* If we are running at least one job already and the load average
    13981433     is too high, make this one wait.  */
    1399   if (!c->remote && job_slots_used > 0 && 
     1434  if (!c->remote && job_slots_used > 0 &&
    14001435      (not_parallel || (c->file->command_flags & COMMANDS_NOTPARALLEL) || load_too_high ()))
    14011436    {
     
    14051440      c->next = waiting_jobs;
    14061441      if (c->next && (c->file->command_flags & COMMANDS_NOTPARALLEL))
    1407         { 
     1442        {
    14081443          struct child *prev = waiting_jobs;
    14091444          while (prev->next)
     
    14141449      else
    14151450        waiting_jobs = c;
     1451      DB (DB_KMK, (_("queued child %p (`%s')\n"), c, c->file->name));
    14161452      return 0;
    14171453    }
  • trunk/src/gmake/variable.c

    r53 r225  
    654654           ? "" : remote_description);
    655655  (void) define_variable ("MAKE_VERSION", 12, buf, o_default, 0);
     656
     657  /* Define KMK_VERSION to indicate kMk. */
     658  (void) define_variable ("KMK_VERSION", 11, buf, o_default, 0);
     659
     660#ifdef CONFIG_WITH_KMK_BUILTIN
     661  /* The kMk Builtin Level. */
     662  (void) define_variable ("KMK_BUILTIN", 11, "1", o_default, 0);
     663#endif
    656664
    657665#ifdef  __MSDOS__
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette